@florid-kit/components 0.8.61 → 0.8.62
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/index.js +6 -2
- package/index.mjs +7 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -838,7 +838,7 @@
|
|
|
838
838
|
* @license
|
|
839
839
|
* Copyright 2017 Google LLC
|
|
840
840
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
841
|
-
*/const nt=(o,t)=>{var n;const e=o._$AN;if(e===void 0)return!1;for(const i of e)(n=i._$AO)==null||n.call(i,t,!1),nt(i,t);return!0},wt=o=>{let t,e;do{if((t=o._$AM)===void 0)break;e=t._$AN,e.delete(o),o=t}while((e==null?void 0:e.size)===0)},de=o=>{for(let t;t=o._$AM;o=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(o))break;e.add(o),ko(t)}};function _o(o){this._$AN!==void 0?(wt(this),this._$AM=o,de(this)):this._$AM=o}function Co(o,t=!1,e=0){const n=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(t)if(Array.isArray(n))for(let r=e;r<n.length;r++)nt(n[r],!1),wt(n[r]);else n!=null&&(nt(n,!1),wt(n));else nt(this,o)}const ko=o=>{o.type==Tt.CHILD&&(o._$AP??(o._$AP=Co),o._$AQ??(o._$AQ=_o))};class Ao extends Ft{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,n){super._$AT(t,e,n),de(this),this.isConnected=t._$AU}_$AO(t,e=!0){var n,i;t!==this.isConnected&&(this.isConnected=t,t?(n=this.reconnected)==null||n.call(this):(i=this.disconnected)==null||i.call(this)),e&&(nt(this,t),wt(this))}setValue(t){if($o(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}class Eo extends Ao{constructor(){super(...arguments),this.prevData={}}render(t){return d}update(t,[e]){var n;this.element!==t.element&&(this.element=t.element),this.host=((n=t.options)===null||n===void 0?void 0:n.host)||this.element,this.apply(e),this.groom(e),this.prevData={...e}}apply(t){if(!t)return;const{prevData:e,element:n}=this;for(const i in t){const r=t[i];r!==e[i]&&(n[i]=r)}}groom(t){const{prevData:e,element:n}=this;if(e)for(const i in e)(!t||!(i in t)&&n[i]===e[i])&&(n[i]=void 0)}}class So extends Eo{constructor(){super(...arguments),this.eventData={}}apply(t){if(t)for(const e in t){const n=t[e];n!==this.eventData[e]&&this.applyEvent(e,n)}}applyEvent(t,e){const{prevData:n,element:i}=this;this.eventData[t]=e,n[t]&&i.removeEventListener(t,this,e),i.addEventListener(t,this,e)}groom(t){const{prevData:e,element:n}=this;if(e)for(const i in e)(!t||!(i in t)&&n[i]===e[i])&&this.groomEvent(i,e[i])}groomEvent(t,e){const{element:n}=this;delete this.eventData[t],n.removeEventListener(t,this,e)}handleEvent(t){const e=this.eventData[t.type];typeof e=="function"?e.call(this.host,t):e.handleEvent(t)}disconnected(){const{eventData:t,element:e}=this;for(const n in t){const i=n.slice(1),r=t[n];e.removeEventListener(i,this,r)}}reconnected(){const{eventData:t,element:e}=this;for(const n in t){const i=n.slice(1),r=t[n];e.addEventListener(i,this,r)}}}class Lo extends So{apply(t){if(!t)return;const{prevData:e,element:n}=this;for(const i in t){const r=t[i];if(r===e[i])continue;const s=i.slice(1);switch(i[0]){case"@":this.eventData[s]=r,this.applyEvent(s,r);break;case".":n[s]=r;break;case"?":r?n.setAttribute(s,""):n.removeAttribute(s);break;default:r!=null?n.setAttribute(i,String(r)):n.removeAttribute(i);break}}}groom(t){const{prevData:e,element:n}=this;if(e)for(const i in e){const r=i.slice(1);if(!t||!(i in t)&&n[r]===e[i])switch(i[0]){case"@":this.groomEvent(r,e[i]);break;case".":n[r]=void 0;break;case"?":n.removeAttribute(r);break;default:n.removeAttribute(i);break}}}}const ne=jt(Lo);var Po=Object.defineProperty,Oo=Object.getOwnPropertyDescriptor,y=(o,t,e,n)=>{for(var i=n>1?void 0:n?Oo(t,e):t,r=o.length-1,s;r>=0;r--)(s=o[r])&&(i=(n?s(t,e,i):s(i))||i);return n&&i&&Po(t,e,i),i};let u=class extends v{constructor(){super(...arguments),this.open=!1,this.showHeader=!0,this.showFooter=!1,this.showHeaderStartIcon=!1,this.headerTitle="",this.headerTitleClassName="panel-title",this.closeButtonLabel="Close the modal",this.firstButtonLabel="Close",this.firstButtonVariant="primary",this.firstButtonProps={},this.onFirstButtonClickClose=!1,this.secondButtonLabel="",this.secondButtonVariant="secondary",this.secondButtonProps={},this.onSecondButtonClickClose=!1,this.disablePortal=!1,this.zIndex=99,this.initialized=!1,this.showDetail=!1,this.isHidingDetail=!1,this.previousFocusedElement=null,this.innerFocusedElement=null,this._onOpenDetail=()=>{this.showDetail=!0,this.showHeaderStartIcon=!0},this.handleKeyDown=o=>{this.open&&(o.key==="Escape"?this.closePanel():o.key==="Tab"&&this.trapFocus(o))},this.handleClosePanel=o=>{if(o instanceof KeyboardEvent&&o.key!=="Enter"&&o.key!==" ")return;o.preventDefault(),o.stopPropagation();const t=o.currentTarget,e=(t==null?void 0:t.getAttribute("data-role"))==="back";if(this.showDetail&&e){this.isHidingDetail=!0;const n=this.renderRoot.querySelector(".content");if(n){const i=()=>{this.showDetail=!1,this.isHidingDetail=!1,
|
|
841
|
+
*/const nt=(o,t)=>{var n;const e=o._$AN;if(e===void 0)return!1;for(const i of e)(n=i._$AO)==null||n.call(i,t,!1),nt(i,t);return!0},wt=o=>{let t,e;do{if((t=o._$AM)===void 0)break;e=t._$AN,e.delete(o),o=t}while((e==null?void 0:e.size)===0)},de=o=>{for(let t;t=o._$AM;o=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(o))break;e.add(o),ko(t)}};function _o(o){this._$AN!==void 0?(wt(this),this._$AM=o,de(this)):this._$AM=o}function Co(o,t=!1,e=0){const n=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(t)if(Array.isArray(n))for(let r=e;r<n.length;r++)nt(n[r],!1),wt(n[r]);else n!=null&&(nt(n,!1),wt(n));else nt(this,o)}const ko=o=>{o.type==Tt.CHILD&&(o._$AP??(o._$AP=Co),o._$AQ??(o._$AQ=_o))};class Ao extends Ft{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,n){super._$AT(t,e,n),de(this),this.isConnected=t._$AU}_$AO(t,e=!0){var n,i;t!==this.isConnected&&(this.isConnected=t,t?(n=this.reconnected)==null||n.call(this):(i=this.disconnected)==null||i.call(this)),e&&(nt(this,t),wt(this))}setValue(t){if($o(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}class Eo extends Ao{constructor(){super(...arguments),this.prevData={}}render(t){return d}update(t,[e]){var n;this.element!==t.element&&(this.element=t.element),this.host=((n=t.options)===null||n===void 0?void 0:n.host)||this.element,this.apply(e),this.groom(e),this.prevData={...e}}apply(t){if(!t)return;const{prevData:e,element:n}=this;for(const i in t){const r=t[i];r!==e[i]&&(n[i]=r)}}groom(t){const{prevData:e,element:n}=this;if(e)for(const i in e)(!t||!(i in t)&&n[i]===e[i])&&(n[i]=void 0)}}class So extends Eo{constructor(){super(...arguments),this.eventData={}}apply(t){if(t)for(const e in t){const n=t[e];n!==this.eventData[e]&&this.applyEvent(e,n)}}applyEvent(t,e){const{prevData:n,element:i}=this;this.eventData[t]=e,n[t]&&i.removeEventListener(t,this,e),i.addEventListener(t,this,e)}groom(t){const{prevData:e,element:n}=this;if(e)for(const i in e)(!t||!(i in t)&&n[i]===e[i])&&this.groomEvent(i,e[i])}groomEvent(t,e){const{element:n}=this;delete this.eventData[t],n.removeEventListener(t,this,e)}handleEvent(t){const e=this.eventData[t.type];typeof e=="function"?e.call(this.host,t):e.handleEvent(t)}disconnected(){const{eventData:t,element:e}=this;for(const n in t){const i=n.slice(1),r=t[n];e.removeEventListener(i,this,r)}}reconnected(){const{eventData:t,element:e}=this;for(const n in t){const i=n.slice(1),r=t[n];e.addEventListener(i,this,r)}}}class Lo extends So{apply(t){if(!t)return;const{prevData:e,element:n}=this;for(const i in t){const r=t[i];if(r===e[i])continue;const s=i.slice(1);switch(i[0]){case"@":this.eventData[s]=r,this.applyEvent(s,r);break;case".":n[s]=r;break;case"?":r?n.setAttribute(s,""):n.removeAttribute(s);break;default:r!=null?n.setAttribute(i,String(r)):n.removeAttribute(i);break}}}groom(t){const{prevData:e,element:n}=this;if(e)for(const i in e){const r=i.slice(1);if(!t||!(i in t)&&n[r]===e[i])switch(i[0]){case"@":this.groomEvent(r,e[i]);break;case".":n[r]=void 0;break;case"?":n.removeAttribute(r);break;default:n.removeAttribute(i);break}}}}const ne=jt(Lo);var Po=Object.defineProperty,Oo=Object.getOwnPropertyDescriptor,y=(o,t,e,n)=>{for(var i=n>1?void 0:n?Oo(t,e):t,r=o.length-1,s;r>=0;r--)(s=o[r])&&(i=(n?s(t,e,i):s(i))||i);return n&&i&&Po(t,e,i),i};let u=class extends v{constructor(){super(...arguments),this.open=!1,this.showHeader=!0,this.showFooter=!1,this.showHeaderStartIcon=!1,this.headerTitle="",this.headerTitleClassName="panel-title",this.closeButtonLabel="Close the modal",this.firstButtonLabel="Close",this.firstButtonVariant="primary",this.firstButtonProps={},this.onFirstButtonClickClose=!1,this.secondButtonLabel="",this.secondButtonVariant="secondary",this.secondButtonProps={},this.onSecondButtonClickClose=!1,this.disablePortal=!1,this.zIndex=99,this.initialized=!1,this.showDetail=!1,this.isHidingDetail=!1,this.previousFocusedElement=null,this.innerFocusedElement=null,this._onOpenDetail=()=>{this.showDetail=!0,this.showHeaderStartIcon=!0},this.handleKeyDown=o=>{this.open&&(o.key==="Escape"?this.closePanel():o.key==="Tab"&&this.trapFocus(o))},this.handleClosePanel=o=>{if(o instanceof KeyboardEvent&&o.key!=="Enter"&&o.key!==" ")return;o.preventDefault(),o.stopPropagation();const t=o.currentTarget,e=(t==null?void 0:t.getAttribute("data-role"))==="back";if(this.showDetail&&e){this.isHidingDetail=!0;const n=this.renderRoot.querySelector(".content");if(n){this.showHeaderStartIcon=!1;const i=()=>{this.showDetail=!1,this.isHidingDetail=!1,n.removeEventListener("animationend",i)};n.addEventListener("animationend",i)}else this.showDetail=!1,this.isHidingDetail=!1,this.showHeaderStartIcon=!1;return}this.closePanel()}}connectedCallback(){super.connectedCallback(),!this.disablePortal&&this.parentElement!==document.body&&document.body.appendChild(this),this.addEventListener("keydown",this.handleKeyDown),this.updateComplete.then(()=>{this.initialized=!0}),this.addEventListener("open-detail",this._onOpenDetail)}disconnectedCallback(){document.body.style.overflow="",document.body.removeAttribute("data-side-panel"),this.removeEventListener("keydown",this.handleKeyDown),super.disconnectedCallback(),this.removeEventListener("open-detail",this._onOpenDetail)}trapFocus(o){var i,r,s,h,c,f,m,p,$,L;this.innerFocusedElement=document.activeElement||null,this.innerFocusedElement=((r=(i=this.innerFocusedElement)==null?void 0:i.shadowRoot)==null?void 0:r.activeElement)||this.innerFocusedElement;const t=this.getFocusableElements();if(t.length===0)return;const e=t[0],n=t[t.length-1];o.shiftKey&&this.innerFocusedElement===e?(o.preventDefault(),n.shadowRoot?(c=(h=(s=n.shadowRoot)==null?void 0:s.querySelector(u.focusablesSelector))==null?void 0:h.focus)==null||c.call(h):(f=n.focus)==null||f.call(n)):!o.shiftKey&&this.innerFocusedElement===n&&(o.preventDefault(),e.shadowRoot?($=(p=(m=e.shadowRoot)==null?void 0:m.querySelector(u.focusablesSelector))==null?void 0:p.focus)==null||$.call(p):(L=e.focus)==null||L.call(e))}getFocusableElements(){const o=this.renderRoot.querySelector(".panel");if(!o)return[];function t(i){return!(i.disabled||i.hasAttribute("disabled")||i.hasAttribute("tabindex")&&i.getAttribute("tabindex")==="-1")}function e(i){var s;const r=[i.matches(u.focusablesSelector)?i:[]];if(!["o-icon-button","o-button"].includes(i.tagName.toLowerCase())){const h=Array.from(i instanceof HTMLSlotElement?i.assignedElements({flatten:!0}):[]).filter(t).flatMap(e),c=Array.from(((s=i.shadowRoot)==null?void 0:s.querySelectorAll("*"))||[]).filter(t).flatMap(e);r.push(...h,...c)}return r.flat()}return Array.from(o.querySelectorAll("*")).filter(t).flatMap(e)}openPanel(){this.previousFocusedElement=document.activeElement,this.open=!0,document.body.style.overflow="hidden",document.body.setAttribute("data-side-panel","open"),this.updateComplete.then(()=>{var o,t,e,n;if(this.showHeader){const i=((o=this.shadowRoot)==null?void 0:o.querySelector(".panel .close-btn"))||null,r=((t=i==null?void 0:i.shadowRoot)==null?void 0:t.querySelector("button"))||null;r&&((e=r.focus)==null||e.call(r))}else{const i=this.getFocusableElements()[0];(n=i==null?void 0:i.focus)==null||n.call(i)}}),this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0}))}closePanel(){var o,t,e,n,i;this.open=!1,this.showDetail=!1,document.body.style.overflow="",document.body.removeAttribute("data-side-panel"),((o=this.previousFocusedElement)==null?void 0:o.tagName.toLowerCase())==="o-button"?(n=(e=(t=this.previousFocusedElement.shadowRoot)==null?void 0:t.querySelector(".button"))==null?void 0:e.focus)==null||n.call(e):(i=this.previousFocusedElement)==null||i.focus(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}handleFirstClick(o){o instanceof KeyboardEvent&&o.key!=="Enter"&&o.key!==" "||(o.preventDefault(),o.stopPropagation(),this.onFirstButtonClickClose&&this.closePanel(),this.dispatchEvent(new CustomEvent("firstbuttonclick",{bubbles:!0,composed:!0,cancelable:!0,detail:{button:"first",target:o.target}})))}handleSecondClick(o){o instanceof KeyboardEvent&&o.key!=="Enter"&&o.key!==" "||(o.preventDefault(),o.stopPropagation(),this.onSecondButtonClickClose&&this.closePanel(),this.dispatchEvent(new CustomEvent("secondbuttonclick",{bubbles:!0,composed:!0,cancelable:!0,detail:{button:"second",target:o.target}})))}updated(){this.style.setProperty("--z-overlay",`${this.zIndex||99}`),this.style.setProperty("--z-panel",`${this.zIndex?this.zIndex+1:99}`)}render(){const o=this.showHeader?l`
|
|
842
842
|
<div class="header">
|
|
843
843
|
${this.showHeaderStartIcon?l`
|
|
844
844
|
<o-icon-button
|
|
@@ -2235,7 +2235,7 @@
|
|
|
2235
2235
|
strokewidth="0"
|
|
2236
2236
|
></o-icon-button>
|
|
2237
2237
|
`}render(){return l`
|
|
2238
|
-
<div class="tile ${this.fullwidth?"fullwidth":""}" @click=${this.onClick}>
|
|
2238
|
+
<div class="tile ${this.fullwidth?"fullwidth":""} ${this.type==="chevron"?"fullpointer":""}" @click=${this.onClick}>
|
|
2239
2239
|
${this.imageUrl?l`<img src="${this.imageUrl}" alt="${this.altImage||""}" />`:""}
|
|
2240
2240
|
<div class="info">
|
|
2241
2241
|
${this.titleProduct?l`<div class="title">${this.titleProduct}</div>`:""}
|
|
@@ -2330,6 +2330,10 @@
|
|
|
2330
2330
|
letter-spacing: var(--letter-spacing-absolute);
|
|
2331
2331
|
line-height: var(--line-height-160);
|
|
2332
2332
|
}
|
|
2333
|
+
|
|
2334
|
+
.fullpointer {
|
|
2335
|
+
cursor: pointer;
|
|
2336
|
+
}
|
|
2333
2337
|
`;let S=Wt;j([a({type:String})],S.prototype,"type");j([a({type:String})],S.prototype,"titleProduct");j([a({type:String})],S.prototype,"volume");j([a({type:String})],S.prototype,"perLiter");j([a({type:String})],S.prototype,"mainPrice");j([a({type:String})],S.prototype,"imageUrl");j([a({type:String})],S.prototype,"altImage");j([a({type:Boolean})],S.prototype,"fullwidth");j([a({type:Function})],S.prototype,"onClickTile");customElements.define("mini-tile",S);var ii=Object.defineProperty,ni=Object.getOwnPropertyDescriptor,Zt=(o,t,e,n)=>{for(var i=n>1?void 0:n?ni(t,e):t,r=o.length-1,s;r>=0;r--)(s=o[r])&&(i=(n?s(t,e,i):s(i))||i);return n&&i&&ii(t,e,i),i};let pt=class extends v{constructor(){super(...arguments),this.variant="cart",this.text=""}render(){return l`
|
|
2334
2338
|
<span class="badge">
|
|
2335
2339
|
${this.text?this.text:l`<slot></slot>`}
|
package/index.mjs
CHANGED
|
@@ -2000,8 +2000,9 @@ let u = class extends v {
|
|
|
2000
2000
|
this.isHidingDetail = !0;
|
|
2001
2001
|
const n = this.renderRoot.querySelector(".content");
|
|
2002
2002
|
if (n) {
|
|
2003
|
+
this.showHeaderStartIcon = !1;
|
|
2003
2004
|
const i = () => {
|
|
2004
|
-
this.showDetail = !1, this.isHidingDetail = !1,
|
|
2005
|
+
this.showDetail = !1, this.isHidingDetail = !1, n.removeEventListener("animationend", i);
|
|
2005
2006
|
};
|
|
2006
2007
|
n.addEventListener("animationend", i);
|
|
2007
2008
|
} else
|
|
@@ -4134,7 +4135,7 @@ const Wt = class Wt extends v {
|
|
|
4134
4135
|
}
|
|
4135
4136
|
render() {
|
|
4136
4137
|
return l`
|
|
4137
|
-
<div class="tile ${this.fullwidth ? "fullwidth" : ""}" @click=${this.onClick}>
|
|
4138
|
+
<div class="tile ${this.fullwidth ? "fullwidth" : ""} ${this.type === "chevron" ? "fullpointer" : ""}" @click=${this.onClick}>
|
|
4138
4139
|
${this.imageUrl ? l`<img src="${this.imageUrl}" alt="${this.altImage || ""}" />` : ""}
|
|
4139
4140
|
<div class="info">
|
|
4140
4141
|
${this.titleProduct ? l`<div class="title">${this.titleProduct}</div>` : ""}
|
|
@@ -4232,6 +4233,10 @@ Wt.styles = b`
|
|
|
4232
4233
|
letter-spacing: var(--letter-spacing-absolute);
|
|
4233
4234
|
line-height: var(--line-height-160);
|
|
4234
4235
|
}
|
|
4236
|
+
|
|
4237
|
+
.fullpointer {
|
|
4238
|
+
cursor: pointer;
|
|
4239
|
+
}
|
|
4235
4240
|
`;
|
|
4236
4241
|
let S = Wt;
|
|
4237
4242
|
j([
|