@florid-kit/components 0.7.4 → 0.7.6
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/icon-button.d.ts +2 -0
- package/index.js +75 -71
- package/index.mjs +208 -198
- package/package.json +1 -1
|
@@ -13,6 +13,8 @@ export declare class OccitaneIconButton extends LitElement {
|
|
|
13
13
|
strokewidth: string;
|
|
14
14
|
icon: string;
|
|
15
15
|
disabled: boolean;
|
|
16
|
+
showSrLabel: boolean;
|
|
17
|
+
srLabel: string;
|
|
16
18
|
protected updated(changedProperties: Map<string, unknown>): void;
|
|
17
19
|
protected render(): import('lit').TemplateResult<1>;
|
|
18
20
|
}
|
package/index.js
CHANGED
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright 2017 Google LLC
|
|
8
8
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
-
*/const{is:Vt,defineProperty:Zt,getOwnPropertyDescriptor:qt,getOwnPropertyNames:Wt,getOwnPropertySymbols:Kt,getPrototypeOf:Gt}=Object,
|
|
9
|
+
*/const{is:Vt,defineProperty:Zt,getOwnPropertyDescriptor:qt,getOwnPropertyNames:Wt,getOwnPropertySymbols:Kt,getPrototypeOf:Gt}=Object,z=globalThis,Et=z.trustedTypes,Xt=Et?Et.emptyScript:"",dt=z.reactiveElementPolyfillSupport,X=(o,t)=>o,st={toAttribute(o,t){switch(t){case Boolean:o=o?Xt:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},xt=(o,t)=>!Vt(o,t),Lt={attribute:!0,type:String,converter:st,reflect:!1,useDefault:!1,hasChanged:xt};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),z.litPropertyMetadata??(z.litPropertyMetadata=new WeakMap);let V=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=Lt){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 n=Symbol(),i=this.getPropertyDescriptor(t,n,e);i!==void 0&&Zt(this.prototype,t,i)}}static getPropertyDescriptor(t,e,n){const{get:i,set:s}=qt(this.prototype,t)??{get(){return this[e]},set(r){this[e]=r}};return{get:i,set(r){const h=i==null?void 0:i.call(this);s==null||s.call(this,r),this.requestUpdate(t,h,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Lt}static _$Ei(){if(this.hasOwnProperty(X("elementProperties")))return;const t=Gt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(X("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(X("properties"))){const e=this.properties,n=[...Wt(e),...Kt(e)];for(const i of n)this.createProperty(i,e[i])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[n,i]of e)this.elementProperties.set(n,i)}this._$Eh=new Map;for(const[e,n]of this.elementProperties){const i=this._$Eu(e,n);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const n=new Set(t.flat(1/0).reverse());for(const i of n)e.unshift(St(i))}else t!==void 0&&e.push(St(t));return e}static _$Eu(t,e){const n=e.attribute;return n===!1?void 0:typeof n=="string"?n: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 n of e.keys())this.hasOwnProperty(n)&&(t.set(n,this[n]),delete this[n]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Rt(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 n;return(n=e.hostConnected)==null?void 0:n.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var n;return(n=e.hostDisconnected)==null?void 0:n.call(e)})}attributeChangedCallback(t,e,n){this._$AK(t,n)}_$ET(t,e){var s;const n=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,n);if(i!==void 0&&n.reflect===!0){const r=(((s=n.converter)==null?void 0:s.toAttribute)!==void 0?n.converter:st).toAttribute(e,n.type);this._$Em=t,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(t,e){var s,r;const n=this.constructor,i=n._$Eh.get(t);if(i!==void 0&&this._$Em!==i){const h=n.getPropertyOptions(i),c=typeof h.converter=="function"?{fromAttribute:h.converter}:((s=h.converter)==null?void 0:s.fromAttribute)!==void 0?h.converter:st;this._$Em=i,this[i]=c.fromAttribute(e,h.type)??((r=this._$Ej)==null?void 0:r.get(i))??null,this._$Em=null}}requestUpdate(t,e,n){var i;if(t!==void 0){const s=this.constructor,r=this[t];if(n??(n=s.getPropertyOptions(t)),!((n.hasChanged??xt)(r,e)||n.useDefault&&n.reflect&&r===((i=this._$Ej)==null?void 0:i.get(t))&&!this.hasAttribute(s._$Eu(t,n))))return;this.C(t,e,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:n,reflect:i,wrapped:s},r){n&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,r??e??this[t]),s!==!0||r!==void 0)||(this._$AL.has(t)||(this.hasUpdated||n||(e=void 0),this._$AL.set(t,e)),i===!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 n;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[s,r]of this._$Ep)this[s]=r;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[s,r]of i){const{wrapped:h}=r,c=this[s];h!==!0||this._$AL.has(s)||c===void 0||this.C(s,void 0,r,c)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(n=this._$EO)==null||n.forEach(i=>{var s;return(s=i.hostUpdate)==null?void 0:s.call(i)}),this.update(e)):this._$EM()}catch(i){throw t=!1,this._$EM(),i}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(n=>{var i;return(i=n.hostUpdated)==null?void 0:i.call(n)}),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){}};V.elementStyles=[],V.shadowRootOptions={mode:"open"},V[X("elementProperties")]=new Map,V[X("finalized")]=new Map,dt==null||dt({ReactiveElement:V}),(z.reactiveElementVersions??(z.reactiveElementVersions=[])).push("2.1.0");/**
|
|
10
10
|
* @license
|
|
11
11
|
* Copyright 2017 Google LLC
|
|
12
12
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
|
-
*/const J=globalThis,at=J.trustedTypes,It=at?at.createPolicy("lit-html",{createHTML:o=>o}):void 0,Tt="$lit$",
|
|
14
|
-
\f\r]`,G=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Pt=/-->/g,Ot=/>/g,
|
|
15
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Bt=/'/g,zt=/"/g,Ut=/^(?:script|style|textarea|title)$/i,Qt=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),
|
|
13
|
+
*/const J=globalThis,at=J.trustedTypes,It=at?at.createPolicy("lit-html",{createHTML:o=>o}):void 0,Tt="$lit$",B=`lit$${Math.random().toFixed(9).slice(2)}$`,jt="?"+B,Jt=`<${jt}>`,j=document,Y=()=>j.createComment(""),Q=o=>o===null||typeof o!="object"&&typeof o!="function",$t=Array.isArray,Yt=o=>$t(o)||typeof(o==null?void 0:o[Symbol.iterator])=="function",pt=`[
|
|
14
|
+
\f\r]`,G=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Pt=/-->/g,Ot=/>/g,H=RegExp(`>|${pt}(?:([^\\s"'>=/]+)(${pt}*=${pt}*(?:[^
|
|
15
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Bt=/'/g,zt=/"/g,Ut=/^(?:script|style|textarea|title)$/i,Qt=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),l=Qt(1),U=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),Dt=new WeakMap,M=j.createTreeWalker(j,129);function Nt(o,t){if(!$t(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return It!==void 0?It.createHTML(t):t}const te=(o,t)=>{const e=o.length-1,n=[];let i,s=t===2?"<svg>":t===3?"<math>":"",r=G;for(let h=0;h<e;h++){const c=o[h];let v,b,p=-1,S=0;for(;S<c.length&&(r.lastIndex=S,b=r.exec(c),b!==null);)S=r.lastIndex,r===G?b[1]==="!--"?r=Pt:b[1]!==void 0?r=Ot:b[2]!==void 0?(Ut.test(b[2])&&(i=RegExp("</"+b[2],"g")),r=H):b[3]!==void 0&&(r=H):r===H?b[0]===">"?(r=i??G,p=-1):b[1]===void 0?p=-2:(p=r.lastIndex-b[2].length,v=b[1],r=b[3]===void 0?H:b[3]==='"'?zt:Bt):r===zt||r===Bt?r=H:r===Pt||r===Ot?r=G:(r=H,i=void 0);const P=r===H&&o[h+1].startsWith("/>")?" ":"";s+=r===G?c+Jt:p>=0?(n.push(v),c.slice(0,p)+Tt+c.slice(p)+B+P):c+B+(p===-2?h:P)}return[Nt(o,s+(o[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),n]};class tt{constructor({strings:t,_$litType$:e},n){let i;this.parts=[];let s=0,r=0;const h=t.length-1,c=this.parts,[v,b]=te(t,e);if(this.el=tt.createElement(v,n),M.currentNode=this.el.content,e===2||e===3){const p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(i=M.nextNode())!==null&&c.length<h;){if(i.nodeType===1){if(i.hasAttributes())for(const p of i.getAttributeNames())if(p.endsWith(Tt)){const S=b[r++],P=i.getAttribute(p).split(B),nt=/([.?@])?(.*)/.exec(S);c.push({type:1,index:s,name:nt[2],strings:P,ctor:nt[1]==="."?oe:nt[1]==="?"?ie:nt[1]==="@"?ne:lt}),i.removeAttribute(p)}else p.startsWith(B)&&(c.push({type:6,index:s}),i.removeAttribute(p));if(Ut.test(i.tagName)){const p=i.textContent.split(B),S=p.length-1;if(S>0){i.textContent=at?at.emptyScript:"";for(let P=0;P<S;P++)i.append(p[P],Y()),M.nextNode(),c.push({type:2,index:++s});i.append(p[S],Y())}}}else if(i.nodeType===8)if(i.data===jt)c.push({type:2,index:s});else{let p=-1;for(;(p=i.data.indexOf(B,p+1))!==-1;)c.push({type:7,index:s}),p+=B.length-1}s++}}static createElement(t,e){const n=j.createElement("template");return n.innerHTML=t,n}}function Z(o,t,e=o,n){var r,h;if(t===U)return t;let i=n!==void 0?(r=e._$Co)==null?void 0:r[n]:e._$Cl;const s=Q(t)?void 0:t._$litDirective$;return(i==null?void 0:i.constructor)!==s&&((h=i==null?void 0:i._$AO)==null||h.call(i,!1),s===void 0?i=void 0:(i=new s(o),i._$AT(o,e,n)),n!==void 0?(e._$Co??(e._$Co=[]))[n]=i:e._$Cl=i),i!==void 0&&(t=Z(o,i._$AS(o,t.values),i,n)),t}class ee{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:n}=this._$AD,i=((t==null?void 0:t.creationScope)??j).importNode(e,!0);M.currentNode=i;let s=M.nextNode(),r=0,h=0,c=n[0];for(;c!==void 0;){if(r===c.index){let v;c.type===2?v=new it(s,s.nextSibling,this,t):c.type===1?v=new c.ctor(s,c.name,c.strings,this,t):c.type===6&&(v=new re(s,this,t)),this._$AV.push(v),c=n[++h]}r!==(c==null?void 0:c.index)&&(s=M.nextNode(),r++)}return M.currentNode=j,i}p(t){let e=0;for(const n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(t,n,e),e+=n.strings.length-2):n._$AI(t[e])),e++}}class it{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,n,i){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=n,this.options=i,this._$Cv=(i==null?void 0:i.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=Z(this,t,e),Q(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==U&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Yt(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(j.createTextNode(t)),this._$AH=t}$(t){var s;const{values:e,_$litType$:n}=t,i=typeof n=="number"?this._$AC(t):(n.el===void 0&&(n.el=tt.createElement(Nt(n.h,n.h[0]),this.options)),n);if(((s=this._$AH)==null?void 0:s._$AD)===i)this._$AH.p(e);else{const r=new ee(i,this),h=r.u(this.options);r.p(e),this.T(h),this._$AH=r}}_$AC(t){let e=Dt.get(t.strings);return e===void 0&&Dt.set(t.strings,e=new tt(t)),e}k(t){$t(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let n,i=0;for(const s of t)i===e.length?e.push(n=new it(this.O(Y()),this.O(Y()),this,this.options)):n=e[i],n._$AI(s),i++;i<e.length&&(this._$AR(n&&n._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){var n;for((n=this._$AP)==null?void 0:n.call(this,!1,!0,e);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class lt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,n,i,s){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=s,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=d}_$AI(t,e=this,n,i){const s=this.strings;let r=!1;if(s===void 0)t=Z(this,t,e,0),r=!Q(t)||t!==this._$AH&&t!==U,r&&(this._$AH=t);else{const h=t;let c,v;for(t=s[0],c=0;c<s.length-1;c++)v=Z(this,h[n+c],e,c),v===U&&(v=this._$AH[c]),r||(r=!Q(v)||v!==this._$AH[c]),v===d?t=d:t!==d&&(t+=(v??"")+s[c+1]),this._$AH[c]=v}r&&!i&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class oe extends lt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}}class ie extends lt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}}class ne extends lt{constructor(t,e,n,i,s){super(t,e,n,i,s),this.type=5}_$AI(t,e=this){if((t=Z(this,t,e,0)??d)===U)return;const n=this._$AH,i=t===d&&n!==d||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,s=t!==d&&(n===d||i);i&&this.element.removeEventListener(this.name,this,n),s&&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 re{constructor(t,e,n){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(t){Z(this,t)}}const ut=J.litHtmlPolyfillSupport;ut==null||ut(tt,it),(J.litHtmlVersions??(J.litHtmlVersions=[])).push("3.3.0");const se=(o,t,e)=>{const n=(e==null?void 0:e.renderBefore)??t;let i=n._$litPart$;if(i===void 0){const s=(e==null?void 0:e.renderBefore)??null;n._$litPart$=i=new it(t.insertBefore(Y(),s),s,void 0,e??{})}return i._$AI(o),i};/**
|
|
16
16
|
* @license
|
|
17
17
|
* Copyright 2017 Google LLC
|
|
18
18
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
* @license
|
|
21
21
|
* Copyright 2017 Google LLC
|
|
22
22
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
23
|
-
*/const
|
|
23
|
+
*/const _=o=>(t,e)=>{e!==void 0?e.addInitializer(()=>{customElements.define(o,t)}):customElements.define(o,t)};/**
|
|
24
24
|
* @license
|
|
25
25
|
* Copyright 2017 Google LLC
|
|
26
26
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
|
-
*/const ae={attribute:!0,type:String,converter:st,reflect:!1,hasChanged:xt},le=(o=ae,t,e)=>{const{kind:n,metadata:i}=e;let s=globalThis.litPropertyMetadata.get(i);if(s===void 0&&globalThis.litPropertyMetadata.set(i,s=new Map),n==="setter"&&((o=Object.create(o)).wrapped=!0),s.set(e.name,o),n==="accessor"){const{name:r}=e;return{set(h){const
|
|
27
|
+
*/const ae={attribute:!0,type:String,converter:st,reflect:!1,hasChanged:xt},le=(o=ae,t,e)=>{const{kind:n,metadata:i}=e;let s=globalThis.litPropertyMetadata.get(i);if(s===void 0&&globalThis.litPropertyMetadata.set(i,s=new Map),n==="setter"&&((o=Object.create(o)).wrapped=!0),s.set(e.name,o),n==="accessor"){const{name:r}=e;return{set(h){const c=t.get.call(this);t.set.call(this,h),this.requestUpdate(r,c,o)},init(h){return h!==void 0&&this.C(r,void 0,o,h),h}}}if(n==="setter"){const{name:r}=e;return function(h){const c=this[r];t.call(this,h),this.requestUpdate(r,c,o)}}throw Error("Unsupported decorator location: "+n)};function a(o){return(t,e)=>typeof e=="object"?le(o,t,e):((n,i,s)=>{const r=i.hasOwnProperty(s);return i.constructor.createProperty(s,n),r?Object.getOwnPropertyDescriptor(i,s):void 0})(o,t,e)}/**
|
|
28
28
|
* @license
|
|
29
29
|
* Copyright 2017 Google LLC
|
|
30
30
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -130,16 +130,16 @@
|
|
|
130
130
|
* @license
|
|
131
131
|
* Copyright 2017 Google LLC
|
|
132
132
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
133
|
-
*/class ft extends bt{}ft.directiveName="unsafeSVG",ft.resultType=2;const
|
|
133
|
+
*/class ft extends bt{}ft.directiveName="unsafeSVG",ft.resultType=2;const D=Be(ft);var De=Object.defineProperty,He=Object.getOwnPropertyDescriptor,m=(o,t,e,n)=>{for(var i=n>1?void 0:n?He(t,e):t,s=o.length-1,r;s>=0;s--)(r=o[s])&&(i=(n?r(t,e,i):r(i))||i);return n&&i&&De(t,e,i),i};const Me=he(f);let u=class extends Me{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(o){this.setAttribute("name",o)}get form(){return this[_t].form}handleClick(){if(this.panelTarget){const o=document.getElementById(this.panelTarget);o!=null&&o.openPanel&&typeof o.openPanel=="function"?o.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(o){const t=o==="start"?this.startIconModel:this.endIconModel;if(!t)return d;const e=K[t].replace("<svg",'<svg aria-hidden="true" focusable="false" part="svg"');return l`<span class="${o==="start"?"icon-start":"icon-end"}">${D(e)}</span>`}renderButton(){const o=this.text||this.textsecond;return l`
|
|
134
134
|
<button type=${this.type} class="button" ?disabled=${this.disabled} @click=${this.handleClick}>
|
|
135
135
|
${this.startIcon?this.renderIcon("start"):d}
|
|
136
|
-
${o?
|
|
137
|
-
${this.text?
|
|
138
|
-
${this.textsecond?
|
|
139
|
-
`:
|
|
136
|
+
${o?l`
|
|
137
|
+
${this.text?l`<span class="text">${this.text}</span>`:d}
|
|
138
|
+
${this.textsecond?l`<span class="text">${this.textsecond}</span>`:d}
|
|
139
|
+
`:l`<slot></slot>`}
|
|
140
140
|
${this.endIcon?this.renderIcon("end"):d}
|
|
141
141
|
</button>
|
|
142
|
-
`}renderLink(){const o=this.text||this.textsecond;return
|
|
142
|
+
`}renderLink(){const o=this.text||this.textsecond;return l`
|
|
143
143
|
<a
|
|
144
144
|
href=${this.href}
|
|
145
145
|
target=${this.target||d}
|
|
@@ -147,10 +147,10 @@
|
|
|
147
147
|
?disabled=${this.disabled}
|
|
148
148
|
>
|
|
149
149
|
${this.startIcon?this.renderIcon("start"):d}
|
|
150
|
-
${o?
|
|
151
|
-
${this.text?
|
|
152
|
-
${this.textsecond?
|
|
153
|
-
`:
|
|
150
|
+
${o?l`
|
|
151
|
+
${this.text?l`<span>${this.text}</span>`:d}
|
|
152
|
+
${this.textsecond?l`<span>${this.textsecond}</span>`:d}
|
|
153
|
+
`:l`<slot></slot>`}
|
|
154
154
|
${this.endIcon?this.renderIcon("end"):d}
|
|
155
155
|
</a>
|
|
156
156
|
`}};de(u);u.formAssociated=!0;u.styles=w`
|
|
@@ -310,10 +310,10 @@
|
|
|
310
310
|
transform: translateX(4px);
|
|
311
311
|
}
|
|
312
312
|
//End icon movment on hover
|
|
313
|
-
`;m([a()],u.prototype,"type",2);m([a({reflect:!0})],u.prototype,"value",2);m([a({type:String,reflect:!0})],u.prototype,"variant",2);m([a({type:String})],u.prototype,"text",2);m([a({type:String})],u.prototype,"textsecond",2);m([a({type:Boolean,reflect:!0})],u.prototype,"fullwidth",2);m([a({type:Boolean,reflect:!0})],u.prototype,"disabled",2);m([a({type:String,reflect:!0})],u.prototype,"startIconModel",2);m([a({type:String,reflect:!0})],u.prototype,"endIconModel",2);m([a({type:Boolean,reflect:!0,attribute:"starticon"})],u.prototype,"startIcon",2);m([a({type:Boolean,reflect:!0,attribute:"endicon"})],u.prototype,"endIcon",2);m([a({type:String,attribute:"paneltarget",reflect:!0})],u.prototype,"panelTarget",2);m([a({type:String})],u.prototype,"href",2);m([a({type:String})],u.prototype,"target",2);u=m([
|
|
313
|
+
`;m([a()],u.prototype,"type",2);m([a({reflect:!0})],u.prototype,"value",2);m([a({type:String,reflect:!0})],u.prototype,"variant",2);m([a({type:String})],u.prototype,"text",2);m([a({type:String})],u.prototype,"textsecond",2);m([a({type:Boolean,reflect:!0})],u.prototype,"fullwidth",2);m([a({type:Boolean,reflect:!0})],u.prototype,"disabled",2);m([a({type:String,reflect:!0})],u.prototype,"startIconModel",2);m([a({type:String,reflect:!0})],u.prototype,"endIconModel",2);m([a({type:Boolean,reflect:!0,attribute:"starticon"})],u.prototype,"startIcon",2);m([a({type:Boolean,reflect:!0,attribute:"endicon"})],u.prototype,"endIcon",2);m([a({type:String,attribute:"paneltarget",reflect:!0})],u.prototype,"panelTarget",2);m([a({type:String})],u.prototype,"href",2);m([a({type:String})],u.prototype,"target",2);u=m([_("o-button")],u);var Te=Object.defineProperty,je=Object.getOwnPropertyDescriptor,ct=(o,t,e,n)=>{for(var i=n>1?void 0:n?je(t,e):t,s=o.length-1,r;s>=0;s--)(r=o[s])&&(i=(n?r(t,e,i):r(i))||i);return n&&i&&Te(t,e,i),i};let q=class extends f{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(o){(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),this.toggleStatus())}render(){const o=K.wishlist.replace("<svg",'<svg aria-hidden="true" focusable="false" part="svg"');return l`
|
|
314
314
|
<button type="button" aria-describedby="${this.ariaDescribedBy}" class="wishlist-button">
|
|
315
315
|
<span class="sr-only">${this.label}</span>
|
|
316
|
-
${
|
|
316
|
+
${D(o)}
|
|
317
317
|
</button>
|
|
318
318
|
`}setStatus(o){this.status=o,this.setAttribute("aria-pressed",String(this.status==="filled")),this.requestUpdate()}setAriaDescribedBy(o){this.ariaDescribedBy=o,this.requestUpdate()}setLabel(o){this.label=o,this.requestUpdate()}};q.styles=w`
|
|
319
319
|
:host {
|
|
@@ -379,22 +379,27 @@
|
|
|
379
379
|
width: 0.1rem !important;
|
|
380
380
|
white-space: nowrap !important;
|
|
381
381
|
}
|
|
382
|
-
`;ct([a({type:String,reflect:!0})],q.prototype,"status",2);ct([a({type:String,reflect:!0})],q.prototype,"ariaDescribedBy",2);ct([a({type:String,reflect:!0})],q.prototype,"label",2);q=ct([
|
|
383
|
-
|
|
382
|
+
`;ct([a({type:String,reflect:!0})],q.prototype,"status",2);ct([a({type:String,reflect:!0})],q.prototype,"ariaDescribedBy",2);ct([a({type:String,reflect:!0})],q.prototype,"label",2);q=ct([_("o-wishlist-button")],q);/**
|
|
383
|
+
* @license
|
|
384
|
+
* Copyright 2018 Google LLC
|
|
385
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
386
|
+
*/const O=o=>o??d;var Ue=Object.defineProperty,Ne=Object.getOwnPropertyDescriptor,k=(o,t,e,n)=>{for(var i=n>1?void 0:n?Ne(t,e):t,s=o.length-1,r;s>=0;s--)(r=o[s])&&(i=(n?r(t,e,i):r(i))||i);return n&&i&&Ue(t,e,i),i};let x=class extends f{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,this.showSrLabel=!1,this.srLabel=""}updated(o){super.updated(o),this.style.setProperty("--icon-stroke-width",this.strokewidth)}render(){const o=K[this.icon]??"",t=`icon-${this.icon}`,e=o.replace("<svg",'<svg aria-hidden="true" focusable="false" part="svg"'),n=this.showSrLabel?l`<span class="sr-only">${this.srLabel}</span>`:null,i=this.showSrLabel?null:"icon";return l`
|
|
387
|
+
${this.type==="span"?l`
|
|
384
388
|
<span class="icon icon-button ${this.size} ${this.bgstyle} ${this.status} ${t}" ?disabled="${this.disabled}">
|
|
385
|
-
${
|
|
389
|
+
${D(e)}
|
|
386
390
|
</span>
|
|
387
|
-
`:
|
|
391
|
+
`:l`
|
|
388
392
|
<button
|
|
389
393
|
type="button"
|
|
390
|
-
aria-label
|
|
394
|
+
aria-label=${O(i)}
|
|
391
395
|
class="icon-button ${this.size} ${this.bgstyle} ${this.status} ${t}"
|
|
392
396
|
?disabled="${this.disabled}"
|
|
393
397
|
>
|
|
394
|
-
${
|
|
398
|
+
${D(e)}
|
|
399
|
+
${n}
|
|
395
400
|
</button>
|
|
396
401
|
`}
|
|
397
|
-
`}};
|
|
402
|
+
`}};x.styles=w`
|
|
398
403
|
:host {
|
|
399
404
|
display: inline-flex;
|
|
400
405
|
justify-content: center;
|
|
@@ -591,19 +596,18 @@
|
|
|
591
596
|
fill: var(--color-content-disabled);
|
|
592
597
|
}
|
|
593
598
|
}
|
|
594
|
-
|
|
595
599
|
}
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
600
|
+
|
|
601
|
+
.sr-only {
|
|
602
|
+
display: none;
|
|
603
|
+
}
|
|
604
|
+
`;k([a({type:String,reflect:!0})],x.prototype,"bgstyle",2);k([a({type:String,reflect:!0})],x.prototype,"size",2);k([a({type:String,reflect:!0})],x.prototype,"status",2);k([a({type:String,reflect:!0})],x.prototype,"type",2);k([a({type:String})],x.prototype,"strokewidth",2);k([a({type:String})],x.prototype,"icon",2);k([a({type:Boolean,reflect:!0})],x.prototype,"disabled",2);k([a({type:Boolean})],x.prototype,"showSrLabel",2);k([a({type:String})],x.prototype,"srLabel",2);x=k([_("o-icon-button")],x);var Fe=Object.defineProperty,Re=Object.getOwnPropertyDescriptor,F=(o,t,e,n)=>{for(var i=n>1?void 0:n?Re(t,e):t,s=o.length-1,r;s>=0;s--)(r=o[s])&&(i=(n?r(t,e,i):r(i))||i);return n&&i&&Fe(t,e,i),i};let E=class extends f{constructor(){super(...arguments),this.href="",this.target="",this.template="standard",this.inverse=!1,this.endIcon=!1,this.reverseEndIcon=!1}_handleClick(o){(!this.href||this.href==="#")&&o.preventDefault()}render(){const o=this.href||"#";return l`
|
|
601
605
|
<a
|
|
602
606
|
href="${o}"
|
|
603
|
-
target="${
|
|
607
|
+
target="${O(this.target||void 0)}"
|
|
604
608
|
@click="${this._handleClick}"
|
|
605
609
|
>
|
|
606
|
-
${this.endIcon&&this.reverseEndIcon?
|
|
610
|
+
${this.endIcon&&this.reverseEndIcon?l`
|
|
607
611
|
<o-icon-button
|
|
608
612
|
icon="chevronLeft"
|
|
609
613
|
bgstyle="${this.inverse?"none-light":"none-contrast"}"
|
|
@@ -613,7 +617,7 @@
|
|
|
613
617
|
></o-icon-button>
|
|
614
618
|
`:null}
|
|
615
619
|
<span class="link-text"><slot></slot></span>
|
|
616
|
-
${this.endIcon&&!this.reverseEndIcon?
|
|
620
|
+
${this.endIcon&&!this.reverseEndIcon?l`
|
|
617
621
|
<o-icon-button
|
|
618
622
|
icon="chevronRight"
|
|
619
623
|
bgstyle="${this.inverse?"none-light":"none-contrast"}"
|
|
@@ -623,7 +627,7 @@
|
|
|
623
627
|
></o-icon-button>
|
|
624
628
|
`:null}
|
|
625
629
|
</a>
|
|
626
|
-
`}};
|
|
630
|
+
`}};E.styles=w`
|
|
627
631
|
:host([template="standard"]) a {
|
|
628
632
|
color: var(--color-content-action-secondary);
|
|
629
633
|
font-size: var(--font-size-200);
|
|
@@ -710,12 +714,12 @@
|
|
|
710
714
|
height: 1px;
|
|
711
715
|
}
|
|
712
716
|
/* End of underline effect */
|
|
713
|
-
`;F([a({type:String})],
|
|
717
|
+
`;F([a({type:String})],E.prototype,"href",2);F([a({type:String})],E.prototype,"target",2);F([a({type:String,reflect:!0})],E.prototype,"template",2);F([a({type:Boolean,reflect:!0})],E.prototype,"inverse",2);F([a({type:Boolean,reflect:!0})],E.prototype,"endIcon",2);F([a({type:Boolean,reflect:!0})],E.prototype,"reverseEndIcon",2);E=F([_("o-link")],E);var Ve=Object.defineProperty,Ze=Object.getOwnPropertyDescriptor,ht=(o,t,e,n)=>{for(var i=n>1?void 0:n?Ze(t,e):t,s=o.length-1,r;s>=0;s--)(r=o[s])&&(i=(n?r(t,e,i):r(i))||i);return n&&i&&Ve(t,e,i),i};let W=class extends f{constructor(){super(...arguments),this.rating=0}getStarKeys(){const o=[];for(let t=0;t<5;t++){const e=this.rating-t;let n;e>=1?n=100:e<=0?n=0:n=Math.round(e*100/25)*25,o.push(`star-${n}`)}return o}render(){const o=this.getStarKeys();return l`
|
|
714
718
|
<div class="rating">
|
|
715
719
|
<div class="stars">
|
|
716
|
-
${o.map(t=>
|
|
720
|
+
${o.map(t=>l`<span class="star">${D(K[t]??"")}</span>`)}
|
|
717
721
|
</div>
|
|
718
|
-
${this.reviewCount!=null&&this.href!=null?
|
|
722
|
+
${this.reviewCount!=null&&this.href!=null?l`<o-link template="review" href="${this.href}">${this.reviewCount}</o-link>`:null}
|
|
719
723
|
</div>
|
|
720
724
|
`}};W.styles=w`
|
|
721
725
|
svg {
|
|
@@ -750,7 +754,7 @@
|
|
|
750
754
|
text-decoration: underline;
|
|
751
755
|
cursor: pointer;
|
|
752
756
|
}
|
|
753
|
-
`;ht([a({type:Number})],W.prototype,"rating",2);ht([a({type:String})],W.prototype,"reviewCount",2);ht([a({type:String})],W.prototype,"href",2);W=ht([
|
|
757
|
+
`;ht([a({type:Number})],W.prototype,"rating",2);ht([a({type:String})],W.prototype,"reviewCount",2);ht([a({type:String})],W.prototype,"href",2);W=ht([_("o-rating")],W);var qe=Object.defineProperty,We=Object.getOwnPropertyDescriptor,y=(o,t,e,n)=>{for(var i=n>1?void 0:n?We(t,e):t,s=o.length-1,r;s>=0;s--)(r=o[s])&&(i=(n?r(t,e,i):r(i))||i);return n&&i&&qe(t,e,i),i};let g=class extends f{constructor(){super(...arguments),this.open=!1,this.showHeader=!0,this.showFooter=!1,this.showHeaderStartIcon=!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=o=>{this.open&&(o.key==="Escape"?this.closePanel():o.key==="Tab"&&this.trapFocus(o))}}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(o){const t=this.getFocusableElements();if(t.length===0)return;const e=t[0],n=t[t.length-1];o.shiftKey&&document.activeElement===e?(o.preventDefault(),n.focus()):!o.shiftKey&&document.activeElement===n&&(o.preventDefault(),e.focus())}getFocusableElements(){const o=this.renderRoot.querySelector(".panel");return o?Array.from(o.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 o=this.getFocusableElements()[0];o==null||o.focus()})}closePanel(){var o;this.open=!1,document.body.style.overflow="",document.body.removeAttribute("data-side-panel"),(o=this.previousFocusedElement)==null||o.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 l`
|
|
754
758
|
<div class="overlay" style="z-index: ${this.zIndex}" @click=${this.closePanel}></div>
|
|
755
759
|
<div
|
|
756
760
|
class="panel"
|
|
@@ -760,9 +764,9 @@
|
|
|
760
764
|
style="z-index: ${this.zIndex+1}"
|
|
761
765
|
>
|
|
762
766
|
|
|
763
|
-
${this.showHeader?
|
|
767
|
+
${this.showHeader?l`
|
|
764
768
|
<div class="header">
|
|
765
|
-
${this.showHeaderStartIcon?
|
|
769
|
+
${this.showHeaderStartIcon?l`
|
|
766
770
|
<o-icon-button icon="arrowLeft" size="small" class="return-btn" bgstyle="background-light" @click=${this.closePanel} aria-label="${this.closeButtonLabel}"></o-icon-button>
|
|
767
771
|
`:null}
|
|
768
772
|
<span id="panel-title" class="panel-title">${this.headerTitle}</span>
|
|
@@ -774,9 +778,9 @@
|
|
|
774
778
|
<slot></slot>
|
|
775
779
|
</div>
|
|
776
780
|
|
|
777
|
-
${this.showFooter?
|
|
781
|
+
${this.showFooter?l`
|
|
778
782
|
<div class="footer">
|
|
779
|
-
${this.firstButtonVariant&&this.firstButtonLabel?
|
|
783
|
+
${this.firstButtonVariant&&this.firstButtonLabel?l`
|
|
780
784
|
<o-button
|
|
781
785
|
variant="${this.firstButtonVariant}"
|
|
782
786
|
@click=${this.handleFirstClick}
|
|
@@ -785,7 +789,7 @@
|
|
|
785
789
|
</o-button>
|
|
786
790
|
`:null}
|
|
787
791
|
|
|
788
|
-
${this.secondaryButtonVariant&&this.secondaryButtonLabel?
|
|
792
|
+
${this.secondaryButtonVariant&&this.secondaryButtonLabel?l`
|
|
789
793
|
<o-button
|
|
790
794
|
variant="${this.secondaryButtonVariant}"
|
|
791
795
|
@click=${this.handleSecondaryClick}
|
|
@@ -936,7 +940,7 @@
|
|
|
936
940
|
--line-height: var(--line-height-280);
|
|
937
941
|
}
|
|
938
942
|
}
|
|
939
|
-
`;y([a({type:Boolean,reflect:!0})],g.prototype,"open",2);y([a({type:Boolean,reflect:!0})],g.prototype,"showHeader",2);y([a({type:Boolean,reflect:!0})],g.prototype,"showFooter",2);y([a({type:Boolean,reflect:!0})],g.prototype,"showHeaderStartIcon",2);y([a({type:String,reflect:!0})],g.prototype,"headerTitle",2);y([a({type:String,reflect:!0})],g.prototype,"closeButtonLabel",2);y([a({type:String,reflect:!0})],g.prototype,"firstButtonLabel",2);y([a({type:String,reflect:!0})],g.prototype,"firstButtonVariant",2);y([a({type:Function})],g.prototype,"onFirstButtonClick",2);y([a({type:String,reflect:!0})],g.prototype,"secondaryButtonLabel",2);y([a({type:String,reflect:!0})],g.prototype,"secondaryButtonVariant",2);y([a({type:Function})],g.prototype,"onSecondaryButtonClick",2);y([a({type:Boolean,reflect:!0})],g.prototype,"disablePortal",2);y([a({type:Number,reflect:!0})],g.prototype,"zIndex",2);y([a({type:Boolean,reflect:!0})],g.prototype,"initialized",2);g=y([
|
|
943
|
+
`;y([a({type:Boolean,reflect:!0})],g.prototype,"open",2);y([a({type:Boolean,reflect:!0})],g.prototype,"showHeader",2);y([a({type:Boolean,reflect:!0})],g.prototype,"showFooter",2);y([a({type:Boolean,reflect:!0})],g.prototype,"showHeaderStartIcon",2);y([a({type:String,reflect:!0})],g.prototype,"headerTitle",2);y([a({type:String,reflect:!0})],g.prototype,"closeButtonLabel",2);y([a({type:String,reflect:!0})],g.prototype,"firstButtonLabel",2);y([a({type:String,reflect:!0})],g.prototype,"firstButtonVariant",2);y([a({type:Function})],g.prototype,"onFirstButtonClick",2);y([a({type:String,reflect:!0})],g.prototype,"secondaryButtonLabel",2);y([a({type:String,reflect:!0})],g.prototype,"secondaryButtonVariant",2);y([a({type:Function})],g.prototype,"onSecondaryButtonClick",2);y([a({type:Boolean,reflect:!0})],g.prototype,"disablePortal",2);y([a({type:Number,reflect:!0})],g.prototype,"zIndex",2);y([a({type:Boolean,reflect:!0})],g.prototype,"initialized",2);g=y([_("o-side-panel")],g);var Ke=Object.defineProperty,Ge=Object.getOwnPropertyDescriptor,R=(o,t,e,n)=>{for(var i=n>1?void 0:n?Ge(t,e):t,s=o.length-1,r;s>=0;s--)(r=o[s])&&(i=(n?r(t,e,i):r(i))||i);return n&&i&&Ke(t,e,i),i};let L=class extends f{constructor(){super(...arguments),this.thumbnails=[],this.activeIndex=0,this.disabledIndexes=[],this.maxWidth="100%",this.focusedIndex=0,this.playerIconTemplate=l`
|
|
940
944
|
<o-icon-button
|
|
941
945
|
icon="playerv"
|
|
942
946
|
size="xsmall"
|
|
@@ -945,9 +949,9 @@
|
|
|
945
949
|
status="filled"
|
|
946
950
|
strokewidth="0"
|
|
947
951
|
></o-icon-button>
|
|
948
|
-
`}handleKeyDown(o){o.key==="ArrowRight"?(o.preventDefault(),this.focusNext()):o.key==="ArrowLeft"?(o.preventDefault(),this.focusPrevious()):(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),this.selectThumbnail(this.focusedIndex))}focusNext(){let o=this.focusedIndex+1;for(;this.disabledIndexes.includes(o)&&o<this.thumbnails.length;)o++;o<this.thumbnails.length&&(this.focusedIndex=o,this.focusThumbnail(o))}focusPrevious(){let o=this.focusedIndex-1;for(;this.disabledIndexes.includes(o)&&o>=0;)o--;o>=0&&(this.focusedIndex=o,this.focusThumbnail(o))}focusThumbnail(o){const t=this.renderRoot.querySelector(`[data-index="${o}"]`);t==null||t.focus()}selectThumbnail(o){this.disabledIndexes.includes(o)||(this.activeIndex=o,this.swiperInstance&&typeof this.swiperInstance.slideTo=="function"&&this.swiperInstance.slideTo(o),this.dispatchEvent(new CustomEvent("thumbnail-select",{detail:{index:o}})))}render(){return
|
|
952
|
+
`}handleKeyDown(o){o.key==="ArrowRight"?(o.preventDefault(),this.focusNext()):o.key==="ArrowLeft"?(o.preventDefault(),this.focusPrevious()):(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),this.selectThumbnail(this.focusedIndex))}focusNext(){let o=this.focusedIndex+1;for(;this.disabledIndexes.includes(o)&&o<this.thumbnails.length;)o++;o<this.thumbnails.length&&(this.focusedIndex=o,this.focusThumbnail(o))}focusPrevious(){let o=this.focusedIndex-1;for(;this.disabledIndexes.includes(o)&&o>=0;)o--;o>=0&&(this.focusedIndex=o,this.focusThumbnail(o))}focusThumbnail(o){const t=this.renderRoot.querySelector(`[data-index="${o}"]`);t==null||t.focus()}selectThumbnail(o){this.disabledIndexes.includes(o)||(this.activeIndex=o,this.swiperInstance&&typeof this.swiperInstance.slideTo=="function"&&this.swiperInstance.slideTo(o),this.dispatchEvent(new CustomEvent("thumbnail-select",{detail:{index:o}})))}render(){return l`
|
|
949
953
|
<div class="scroll-container" style="max-width: ${this.maxWidth};">
|
|
950
|
-
${this.thumbnails.map((o,t)=>{const e=this.disabledIndexes.includes(t),n=this.activeIndex===t,i=o.type==="video";return
|
|
954
|
+
${this.thumbnails.map((o,t)=>{const e=this.disabledIndexes.includes(t),n=this.activeIndex===t,i=o.type==="video";return l`
|
|
951
955
|
<div class="thumb-wrapper">
|
|
952
956
|
<button
|
|
953
957
|
class="thumb"
|
|
@@ -960,11 +964,11 @@
|
|
|
960
964
|
>
|
|
961
965
|
<img src="${o.src}" />
|
|
962
966
|
</button>
|
|
963
|
-
${i?
|
|
967
|
+
${i?l`<div class="play-icon-wrapper">${this.playerIconTemplate}</div>`:null}
|
|
964
968
|
</div>
|
|
965
969
|
`})}
|
|
966
970
|
</div>
|
|
967
|
-
`}};
|
|
971
|
+
`}};L.styles=w`
|
|
968
972
|
:host {
|
|
969
973
|
display: flex;
|
|
970
974
|
gap: 5px;
|
|
@@ -1067,7 +1071,7 @@
|
|
|
1067
1071
|
height: 0;
|
|
1068
1072
|
width: 0;
|
|
1069
1073
|
}
|
|
1070
|
-
`;R([a({type:Array})],
|
|
1074
|
+
`;R([a({type:Array})],L.prototype,"thumbnails",2);R([a({type:Number})],L.prototype,"activeIndex",2);R([a({type:Array})],L.prototype,"disabledIndexes",2);R([a({type:String})],L.prototype,"maxWidth",2);R([a({type:Object})],L.prototype,"swiperInstance",2);R([N()],L.prototype,"focusedIndex",2);L=R([_("thumbnail-navigation")],L);var Xe=Object.defineProperty,Je=Object.getOwnPropertyDescriptor,Ct=(o,t,e,n)=>{for(var i=n>1?void 0:n?Je(t,e):t,s=o.length-1,r;s>=0;s--)(r=o[s])&&(i=(n?r(t,e,i):r(i))||i);return n&&i&&Xe(t,e,i),i};let et=class extends f{constructor(){super(...arguments),this.type="",this.bgstyle="background-white"}render(){return l`
|
|
1071
1075
|
<span class="tag ${this.bgstyle}"><slot></slot></span>
|
|
1072
1076
|
`}};et.styles=w`
|
|
1073
1077
|
.tag {
|
|
@@ -1124,7 +1128,7 @@
|
|
|
1124
1128
|
background-color: var(--color-content-success);
|
|
1125
1129
|
}
|
|
1126
1130
|
|
|
1127
|
-
`;Ct([a({type:String,reflect:!0})],et.prototype,"type",2);Ct([a({type:String,reflect:!0})],et.prototype,"bgstyle",2);et=Ct([
|
|
1131
|
+
`;Ct([a({type:String,reflect:!0})],et.prototype,"type",2);Ct([a({type:String,reflect:!0})],et.prototype,"bgstyle",2);et=Ct([_("o-tag")],et);var Ye=Object.defineProperty,Qe=Object.getOwnPropertyDescriptor,kt=(o,t,e,n)=>{for(var i=n>1?void 0:n?Qe(t,e):t,s=o.length-1,r;s>=0;s--)(r=o[s])&&(i=(n?r(t,e,i):r(i))||i);return n&&i&&Ye(t,e,i),i};let ot=class extends f{constructor(){super(...arguments),this.type="top",this.text=""}render(){return l`
|
|
1128
1132
|
<div class="tooltip">
|
|
1129
1133
|
<span class="tooltiptext">${this.text}</span>
|
|
1130
1134
|
<slot></slot>
|
|
@@ -1221,7 +1225,7 @@
|
|
|
1221
1225
|
border-color: transparent var(--color-alpha-dark-strongest) transparent transparent;
|
|
1222
1226
|
}
|
|
1223
1227
|
|
|
1224
|
-
`;kt([a({type:String,reflect:!0})],ot.prototype,"type",2);kt([a({type:String,reflect:!0})],ot.prototype,"text",2);ot=kt([
|
|
1228
|
+
`;kt([a({type:String,reflect:!0})],ot.prototype,"type",2);kt([a({type:String,reflect:!0})],ot.prototype,"text",2);ot=kt([_("o-tooltip")],ot);var to=Object.defineProperty,eo=Object.getOwnPropertyDescriptor,I=(o,t,e,n)=>{for(var i=n>1?void 0:n?eo(t,e):t,s=o.length-1,r;s>=0;s--)(r=o[s])&&(i=(n?r(t,e,i):r(i))||i);return n&&i&&to(t,e,i),i};let C=class extends f{constructor(){super(...arguments),this.options=[],this.value="",this.name="",this.disabled=!1,this.width="100%",this.open=!1,this.activeIndex=-1,this.menuWidth="",this._handleOutsideClick=o=>{this.contains(o.target)||(this.open=!1,this.activeIndex=-1)}}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._handleOutsideClick)}disconnectedCallback(){document.removeEventListener("click",this._handleOutsideClick),super.disconnectedCallback()}toggle(){var o;if(!this.disabled){if(this.open=!this.open,this.activeIndex=this.open?this.options.findIndex(t=>t.value===this.value):-1,this.open&&this.width==="auto"){const t=(o=this.renderRoot)==null?void 0:o.querySelector("button");t&&(this.menuWidth=`${t.getBoundingClientRect().width}px`)}this.open&&this.updateComplete.then(()=>{this._focusActiveOption()})}}_focusActiveOption(){var t;const o=(t=this.renderRoot)==null?void 0:t.querySelector(`#option-${this.activeIndex}`);o==null||o.focus()}selectOption(o){this.value=o.value,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value,url:o.url}})),this.open=!1,this.activeIndex=-1}handleKeydown(o){if(this.disabled){o.preventDefault();return}if(!this.open){(o.key==="ArrowDown"||o.key==="ArrowUp")&&(o.preventDefault(),this.open=!0,this.activeIndex=this.options.findIndex(t=>t.value===this.value),this.updateComplete.then(()=>this._focusActiveOption()));return}switch(o.key){case"ArrowDown":o.preventDefault(),this.activeIndex=(this.activeIndex+1)%this.options.length,this.updateComplete.then(()=>this._focusActiveOption());break;case"ArrowUp":o.preventDefault(),this.activeIndex=(this.activeIndex-1+this.options.length)%this.options.length,this.updateComplete.then(()=>this._focusActiveOption());break;case"Home":o.preventDefault(),this.activeIndex=0,this.updateComplete.then(()=>this._focusActiveOption());break;case"End":o.preventDefault(),this.activeIndex=this.options.length-1,this.updateComplete.then(()=>this._focusActiveOption());break;case"Enter":o.preventDefault(),this.activeIndex>=0&&this.selectOption(this.options[this.activeIndex]);break;case"Escape":o.preventDefault(),this.open=!1,this.activeIndex=-1;break}}updated(o){this.options.length>0&&(this.options.some(e=>e.value===this.value)||(this.value=this.options[0].value))}render(){const o=K.checkstroke.replace("<svg",'<svg aria-hidden="true" focusable="false" part="svg"'),t=this.options.find(e=>e.value===this.value);return l`
|
|
1225
1229
|
<button
|
|
1226
1230
|
role="combobox"
|
|
1227
1231
|
aria-haspopup="listbox"
|
|
@@ -1242,14 +1246,14 @@
|
|
|
1242
1246
|
</span>
|
|
1243
1247
|
</button>
|
|
1244
1248
|
|
|
1245
|
-
${this.open?
|
|
1249
|
+
${this.open?l`
|
|
1246
1250
|
<ul
|
|
1247
1251
|
id="dropdown-listbox"
|
|
1248
1252
|
role="listbox"
|
|
1249
1253
|
aria-activedescendant="${this.activeIndex>=0?"option-"+this.activeIndex:""}"
|
|
1250
1254
|
style=${`width: ${this.width};`}
|
|
1251
1255
|
>
|
|
1252
|
-
${this.options.map((e,n)=>
|
|
1256
|
+
${this.options.map((e,n)=>l`
|
|
1253
1257
|
<li
|
|
1254
1258
|
id="option-${n}"
|
|
1255
1259
|
role="option"
|
|
@@ -1258,18 +1262,18 @@
|
|
|
1258
1262
|
class="${n===this.activeIndex?"active":""} ${e.disabled?"disabled":""}"
|
|
1259
1263
|
@click=${()=>this.selectOption(e)}
|
|
1260
1264
|
>
|
|
1261
|
-
${e.url?
|
|
1265
|
+
${e.url?l`
|
|
1262
1266
|
<a href="${e.url}">
|
|
1263
1267
|
<span>${e.label}</span>
|
|
1264
|
-
${e.value===this.value?
|
|
1265
|
-
</a>`:
|
|
1268
|
+
${e.value===this.value?l`<span class="check">${D(o)}</span>`:null}
|
|
1269
|
+
</a>`:l`
|
|
1266
1270
|
<span>${e.label}</span>
|
|
1267
|
-
${e.value===this.value?
|
|
1271
|
+
${e.value===this.value?l`<span class="check">${D(o)}</span>`:null}`}
|
|
1268
1272
|
</li>`)}
|
|
1269
1273
|
</ul>`:null}
|
|
1270
1274
|
|
|
1271
1275
|
<input type="hidden" name="${this.name}" .value="${this.value}" />
|
|
1272
|
-
`}};
|
|
1276
|
+
`}};C.styles=w`
|
|
1273
1277
|
:host {
|
|
1274
1278
|
display: inline-block;
|
|
1275
1279
|
position: relative;
|
|
@@ -1408,7 +1412,7 @@
|
|
|
1408
1412
|
input[type="hidden"] {
|
|
1409
1413
|
display: none;
|
|
1410
1414
|
}
|
|
1411
|
-
`;
|
|
1415
|
+
`;I([a({type:Array,reflect:!0})],C.prototype,"options",2);I([a({type:String,reflect:!0})],C.prototype,"value",2);I([a({type:String,reflect:!0})],C.prototype,"name",2);I([a({type:Boolean,reflect:!0})],C.prototype,"disabled",2);I([a({type:String,reflect:!0})],C.prototype,"width",2);I([N()],C.prototype,"open",2);I([N()],C.prototype,"activeIndex",2);I([N()],C.prototype,"menuWidth",2);C=I([_("o-dropdown")],C);var oo=Object.getOwnPropertyDescriptor,io=(o,t,e,n)=>{for(var i=n>1?void 0:n?oo(t,e):t,s=o.length-1,r;s>=0;s--)(r=o[s])&&(i=r(i)||i);return i};let yt=class extends f{render(){return l` <span class="dots"></span> `}};yt.styles=w`
|
|
1412
1416
|
:host {
|
|
1413
1417
|
display: flex;
|
|
1414
1418
|
align-items: center;
|
|
@@ -1459,7 +1463,7 @@
|
|
|
1459
1463
|
background-color: var(--color-container-action-primary-pressed);
|
|
1460
1464
|
}
|
|
1461
1465
|
}
|
|
1462
|
-
`;yt=io([
|
|
1466
|
+
`;yt=io([_("o-dots")],yt);var no=Object.defineProperty,ro=Object.getOwnPropertyDescriptor,A=(o,t,e,n)=>{for(var i=n>1?void 0:n?ro(t,e):t,s=o.length-1,r;s>=0;s--)(r=o[s])&&(i=(n?r(t,e,i):r(i))||i);return n&&i&&no(t,e,i),i};let $=class extends f{constructor(){super(...arguments),this.options=[],this.value="",this.name="",this.additionaltext="+X variant(s)",this.disabled=!1,this.width="100%",this.open=!1,this.activeIndex=-1,this.menuWidth="",this._handleOutsideClick=o=>{this.contains(o.target)||(this.open=!1,this.activeIndex=-1)}}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._handleOutsideClick)}disconnectedCallback(){document.removeEventListener("click",this._handleOutsideClick),super.disconnectedCallback()}toggle(){var o;if(!this.disabled){if(this.open=!this.open,this.activeIndex=this.open?this.options.findIndex(t=>t.value===this.value):-1,this.open&&this.width==="auto"){const t=(o=this.renderRoot)==null?void 0:o.querySelector("button");t&&(this.menuWidth=`${t.getBoundingClientRect().width}px`)}this.open&&this.updateComplete.then(()=>this._focusActiveOption())}}_focusActiveOption(){var t;const o=(t=this.renderRoot)==null?void 0:t.querySelector(`#option-${this.activeIndex}`);o==null||o.focus()}selectOption(o){this.value=o.value,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value,url:o.url}})),this.open=!1,this.activeIndex=-1}handleKeydown(o){if(this.disabled){o.preventDefault();return}if(!this.open){(o.key==="ArrowDown"||o.key==="ArrowUp")&&(o.preventDefault(),this.open=!0,this.activeIndex=this.options.findIndex(t=>t.value===this.value),this.updateComplete.then(()=>this._focusActiveOption()));return}switch(o.key){case"ArrowDown":o.preventDefault(),this.activeIndex=(this.activeIndex+1)%this.options.length,this.updateComplete.then(()=>this._focusActiveOption());break;case"ArrowUp":o.preventDefault(),this.activeIndex=(this.activeIndex-1+this.options.length)%this.options.length,this.updateComplete.then(()=>this._focusActiveOption());break;case"Home":o.preventDefault(),this.activeIndex=0,this.updateComplete.then(()=>this._focusActiveOption());break;case"End":o.preventDefault(),this.activeIndex=this.options.length-1,this.updateComplete.then(()=>this._focusActiveOption());break;case"Enter":o.preventDefault(),this.activeIndex>=0&&this.selectOption(this.options[this.activeIndex]);break;case"Escape":o.preventDefault(),this.open=!1,this.activeIndex=-1;break}}updated(){this.options.length>0&&(this.options.some(t=>t.value===this.value)||(this.value=this.options[0].value))}render(){const o=K.checkstroke.replace("<svg",'<svg aria-hidden="true" focusable="false" part="svg"'),t=this.options.find(e=>e.value===this.value);return l`
|
|
1463
1467
|
<button
|
|
1464
1468
|
role="combobox"
|
|
1465
1469
|
aria-haspopup="listbox"
|
|
@@ -1473,7 +1477,7 @@
|
|
|
1473
1477
|
?disabled=${this.disabled}
|
|
1474
1478
|
class="btn-dropdown"
|
|
1475
1479
|
>
|
|
1476
|
-
<img alt="${
|
|
1480
|
+
<img alt="${O(t==null?void 0:t.label)}" src="${O(t==null?void 0:t.imgurl)}" />
|
|
1477
1481
|
<span id="dropdown-label" class="label">
|
|
1478
1482
|
${t?t.label:"Select an option"}
|
|
1479
1483
|
</span>
|
|
@@ -1490,14 +1494,14 @@
|
|
|
1490
1494
|
</div>
|
|
1491
1495
|
</button>
|
|
1492
1496
|
|
|
1493
|
-
${this.open?
|
|
1497
|
+
${this.open?l`
|
|
1494
1498
|
<ul
|
|
1495
1499
|
id="dropdown-listbox"
|
|
1496
1500
|
role="listbox"
|
|
1497
1501
|
aria-activedescendant="${this.activeIndex>=0?"option-"+this.activeIndex:""}"
|
|
1498
1502
|
style=${`width: ${this.width};`}
|
|
1499
1503
|
>
|
|
1500
|
-
${this.options.map((e,n)=>
|
|
1504
|
+
${this.options.map((e,n)=>l`
|
|
1501
1505
|
<li
|
|
1502
1506
|
id="option-${n}"
|
|
1503
1507
|
role="option"
|
|
@@ -1507,13 +1511,13 @@
|
|
|
1507
1511
|
class="${n===this.activeIndex?"active":""} ${e.disabled?"disabled":""}"
|
|
1508
1512
|
@click=${()=>this.selectOption(e)}
|
|
1509
1513
|
>
|
|
1510
|
-
<a href="${
|
|
1511
|
-
<img alt="${
|
|
1514
|
+
<a href="${O(e.url)}">
|
|
1515
|
+
<img alt="${O(e.label)}" src="${O(e.imgurl)}" />
|
|
1512
1516
|
<span class="label">${e.label}</span>
|
|
1513
1517
|
<div class="right">
|
|
1514
|
-
<span class="additional-text">${
|
|
1515
|
-
${e.value===this.value&&!e.additionaltext?
|
|
1516
|
-
<span class="check">${
|
|
1518
|
+
<span class="additional-text">${O(e.additionaltext)}</span>
|
|
1519
|
+
${e.value===this.value&&!e.additionaltext?l`
|
|
1520
|
+
<span class="check">${D(o)}</span>`:null}
|
|
1517
1521
|
</div>
|
|
1518
1522
|
</a>
|
|
1519
1523
|
</li>
|
|
@@ -1521,7 +1525,7 @@
|
|
|
1521
1525
|
</ul>`:null}
|
|
1522
1526
|
|
|
1523
1527
|
<input type="hidden" name="${this.name}" .value="${this.value}" />
|
|
1524
|
-
`}}
|
|
1528
|
+
`}};$.styles=w`
|
|
1525
1529
|
:host {
|
|
1526
1530
|
display: inline-block;
|
|
1527
1531
|
position: relative;
|
|
@@ -1696,4 +1700,4 @@
|
|
|
1696
1700
|
input[type="hidden"] {
|
|
1697
1701
|
display: none;
|
|
1698
1702
|
}
|
|
1699
|
-
`;
|
|
1703
|
+
`;A([a({type:Array,reflect:!0})],$.prototype,"options",2);A([a({type:String,reflect:!0})],$.prototype,"value",2);A([a({type:String,reflect:!0})],$.prototype,"name",2);A([a({type:String,reflect:!0})],$.prototype,"additionaltext",2);A([a({type:Boolean,reflect:!0})],$.prototype,"disabled",2);A([a({type:String,reflect:!0})],$.prototype,"width",2);A([N()],$.prototype,"open",2);A([N()],$.prototype,"activeIndex",2);A([N()],$.prototype,"menuWidth",2);$=A([_("o-dropdown-variant")],$);
|