@decidables/discountable-elements 0.6.4 → 0.6.5
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/CHANGELOG.md +9 -0
- package/lib/discountableElements.esm.js +17 -17
- package/lib/discountableElements.esm.js.map +1 -1
- package/lib/discountableElements.esm.min.js +2 -2
- package/lib/discountableElements.esm.min.js.map +1 -1
- package/lib/discountableElements.umd.js +17 -17
- package/lib/discountableElements.umd.js.map +1 -1
- package/lib/discountableElements.umd.min.js +2 -2
- package/lib/discountableElements.umd.min.js.map +1 -1
- package/package.json +5 -5
- package/src/components/htd-curves.js +1 -1
|
@@ -1033,7 +1033,7 @@ const da=2;let Ca=class{constructor(B){}get _$AU(){return this._$AM._$AU}_$AT(B,
|
|
|
1033
1033
|
* @license
|
|
1034
1034
|
* Copyright 2017 Google LLC
|
|
1035
1035
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1036
|
-
*/function Ga(B){void 0!==this._$AN?(ba(this),this._$AM=B,oa(this)):this._$AM=B}function ua(B,Q=!1,F=0){const U=this._$AH,t=this._$AN;if(void 0!==t&&0!==t.size)if(Q)if(Array.isArray(U))for(let B=F;B<U.length;B++)aa(U[B],!1),ba(U[B]);else null!=U&&(aa(U,!1),ba(U));else aa(this,B)}const ra=B=>{B.type==da&&(B._$AP??=ua,B._$AQ??=Ga)};class xa extends Ca{constructor(){super(...arguments),this._$AN=void 0}_$AT(B,Q,F){super._$AT(B,Q,F),oa(this),this.isConnected=B._$AU}_$AO(B,Q=!0){B!==this.isConnected&&(this.isConnected=B,B?this.reconnected?.():this.disconnected?.()),Q&&(aa(this,B),ba(this))}setValue(B){if((B=>void 0===B.strings)(this._$Ct))this._$Ct._$AI(B,this);else{const Q=[...this._$Ct._$AH];Q[this._$Ci]=B,this._$Ct._$AI(Q,this,0)}}disconnected(){}reconnected(){}}const Aa=new WeakMap;let La=0;const ha=new Map,ya=new WeakSet,Ra=()=>new Promise(B=>requestAnimationFrame(B)),Za=[{opacity:0},{opacity:1}],Va=(B,Q)=>{const F=B-Q;return 0===F?void 0:F},Sa=(B,Q)=>{const F=B/Q;return 1===F?void 0:F},ma={left:(B,Q)=>{const F=Va(B,Q);return{value:F,transform:null==F||isNaN(F)?void 0:`translateX(${F}px)`}},top:(B,Q)=>{const F=Va(B,Q);return{value:F,transform:null==F||isNaN(F)?void 0:`translateY(${F}px)`}},width:(B,Q)=>{let F;0===Q&&(Q=1,F={width:"1px"});const U=Sa(B,Q);return{value:U,overrideFrom:F,transform:null==U||isNaN(U)?void 0:`scaleX(${U})`}},height:(B,Q)=>{let F;0===Q&&(Q=1,F={height:"1px"});const U=Sa(B,Q);return{value:U,overrideFrom:F,transform:null==U||isNaN(U)?void 0:`scaleY(${U})`}}},Ea={duration:333,easing:"ease-in-out"},Na=["left","top","width","height","opacity","color","background"],Xa=new WeakMap;const pa=(B=>(...Q)=>({_$litDirective$:B,values:Q}))(class extends xa{constructor(B){if(super(B),this.t=!1,this.i=null,this.o=null,this.h=!0,this.shouldLog=!1,B.type===da)throw Error("The `animate` directive must be used in attribute position.");this.createFinished()}createFinished(){this.resolveFinished?.(),this.finished=new Promise(B=>{this.l=B})}async resolveFinished(){this.l?.(),this.l=void 0}render(B){return z}getController(){return Aa.get(this.u)}isDisabled(){return this.options.disabled||this.getController()?.disabled}update(B,[Q]){const F=void 0===this.u;return F&&(this.u=B.options?.host,this.u.addController(this),this.u.updateComplete.then(B=>this.t=!0),this.element=B.element,Xa.set(this.element,this)),this.optionsOrCallback=Q,(F||"function"!=typeof Q)&&this.
|
|
1036
|
+
*/function Ga(B){void 0!==this._$AN?(ba(this),this._$AM=B,oa(this)):this._$AM=B}function ua(B,Q=!1,F=0){const U=this._$AH,t=this._$AN;if(void 0!==t&&0!==t.size)if(Q)if(Array.isArray(U))for(let B=F;B<U.length;B++)aa(U[B],!1),ba(U[B]);else null!=U&&(aa(U,!1),ba(U));else aa(this,B)}const ra=B=>{B.type==da&&(B._$AP??=ua,B._$AQ??=Ga)};class xa extends Ca{constructor(){super(...arguments),this._$AN=void 0}_$AT(B,Q,F){super._$AT(B,Q,F),oa(this),this.isConnected=B._$AU}_$AO(B,Q=!0){B!==this.isConnected&&(this.isConnected=B,B?this.reconnected?.():this.disconnected?.()),Q&&(aa(this,B),ba(this))}setValue(B){if((B=>void 0===B.strings)(this._$Ct))this._$Ct._$AI(B,this);else{const Q=[...this._$Ct._$AH];Q[this._$Ci]=B,this._$Ct._$AI(Q,this,0)}}disconnected(){}reconnected(){}}const Aa=new WeakMap;let La=0;const ha=new Map,ya=new WeakSet,Ra=()=>new Promise(B=>requestAnimationFrame(B)),Za=[{opacity:0},{opacity:1}],Va=(B,Q)=>{const F=B-Q;return 0===F?void 0:F},Sa=(B,Q)=>{const F=B/Q;return 1===F?void 0:F},ma={left:(B,Q)=>{const F=Va(B,Q);return{value:F,transform:null==F||isNaN(F)?void 0:`translateX(${F}px)`}},top:(B,Q)=>{const F=Va(B,Q);return{value:F,transform:null==F||isNaN(F)?void 0:`translateY(${F}px)`}},width:(B,Q)=>{let F;0===Q&&(Q=1,F={width:"1px"});const U=Sa(B,Q);return{value:U,overrideFrom:F,transform:null==U||isNaN(U)?void 0:`scaleX(${U})`}},height:(B,Q)=>{let F;0===Q&&(Q=1,F={height:"1px"});const U=Sa(B,Q);return{value:U,overrideFrom:F,transform:null==U||isNaN(U)?void 0:`scaleY(${U})`}}},Ea={duration:333,easing:"ease-in-out"},Na=["left","top","width","height","opacity","color","background"],Xa=new WeakMap;const pa=(B=>(...Q)=>({_$litDirective$:B,values:Q}))(class extends xa{constructor(B){if(super(B),this.t=!1,this.i=null,this.o=null,this.h=!0,this.shouldLog=!1,B.type===da)throw Error("The `animate` directive must be used in attribute position.");this.createFinished()}createFinished(){this.resolveFinished?.(),this.finished=new Promise(B=>{this.l=B})}async resolveFinished(){this.l?.(),this.l=void 0}render(B){return z}getController(){return Aa.get(this.u)}isDisabled(){return this.options.disabled||this.getController()?.disabled}update(B,[Q]){const F=void 0===this.u;return F&&(this.u=B.options?.host,this.u.addController(this),this.u.updateComplete.then(B=>this.t=!0),this.element=B.element,Xa.set(this.element,this)),this.optionsOrCallback=Q,(F||"function"!=typeof Q)&&this.m(Q),this.render(Q)}m(B){B=B??{};const Q=this.getController();void 0!==Q&&((B={...Q.defaultOptions,...B}).keyframeOptions={...Q.defaultOptions.keyframeOptions,...B.keyframeOptions}),B.properties??=Na,this.options=B}p(){const B={},Q=this.element.getBoundingClientRect(),F=getComputedStyle(this.element);return this.options.properties.forEach(U=>{const t=Q[U]??(ma[U]?void 0:F[U]),s=Number(t);B[U]=isNaN(s)?t+"":s}),B}v(){let B,Q=!0;return this.options.guard&&(B=this.options.guard(),Q=((B,Q)=>{if(Array.isArray(B)){if(Array.isArray(Q)&&Q.length===B.length&&B.every((B,F)=>B===Q[F]))return!1}else if(Q===B)return!1;return!0})(B,this._)),this.h=this.t&&!this.isDisabled()&&!this.isAnimating()&&Q&&this.element.isConnected,this.h&&(this._=Array.isArray(B)?Array.from(B):B),this.h}hostUpdate(){"function"==typeof this.optionsOrCallback&&this.m(this.optionsOrCallback()),this.v()&&(this.A=this.p(),this.i=this.i??this.element.parentNode,this.o=this.element.nextSibling)}async hostUpdated(){if(!this.h||!this.element.isConnected||this.options.skipInitial&&!this.isHostRendered)return;let B;this.prepare(),await Ra;const Q=this.P(),F=this.V(this.options.keyframeOptions,Q),U=this.p();if(void 0!==this.A){const{from:F,to:t}=this.O(this.A,U,Q);this.log("measured",[this.A,U,F,t]),B=this.calculateKeyframes(F,t)}else{const F=ha.get(this.options.inId);if(F){ha.delete(this.options.inId);const{from:t,to:s}=this.O(F,U,Q);B=this.calculateKeyframes(t,s),B=this.options.in?[{...this.options.in[0],...B[0]},...this.options.in.slice(1),B[1]]:B,La++,B.forEach(B=>B.zIndex=La)}else this.options.in&&(B=[...this.options.in,{}])}this.animate(B,F)}resetStyles(){void 0!==this.j&&(this.element.setAttribute("style",this.j??""),this.j=void 0)}commitStyles(){this.j=this.element.getAttribute("style"),this.webAnimation?.commitStyles(),this.webAnimation?.cancel()}reconnected(){}async disconnected(){if(!this.h)return;if(void 0!==this.options.id&&ha.set(this.options.id,this.A),void 0===this.options.out)return;if(this.prepare(),await Ra(),this.i?.isConnected){const B=this.o&&this.o.parentNode===this.i?this.o:null;if(this.i.insertBefore(this.element,B),this.options.stabilizeOut){const B=this.p();this.log("stabilizing out");const Q=this.A.left-B.left,F=this.A.top-B.top;!("static"===getComputedStyle(this.element).position)||0===Q&&0===F||(this.element.style.position="relative"),0!==Q&&(this.element.style.left=Q+"px"),0!==F&&(this.element.style.top=F+"px")}}const B=this.V(this.options.keyframeOptions);await this.animate(this.options.out,B),this.element.remove()}prepare(){this.createFinished()}start(){this.options.onStart?.(this)}didFinish(B){B&&this.options.onComplete?.(this),this.A=void 0,this.animatingProperties=void 0,this.frames=void 0,this.resolveFinished()}P(){const B=[];for(let Q=this.element.parentNode;Q;Q=Q?.parentNode){const F=Xa.get(Q);F&&!F.isDisabled()&&F&&B.push(F)}return B}get isHostRendered(){const B=ya.has(this.u);return B||this.u.updateComplete.then(()=>{ya.add(this.u)}),B}V(B,Q=this.P()){const F={...Ea};return Q.forEach(B=>Object.assign(F,B.options.keyframeOptions)),Object.assign(F,B),F}O(B,Q,F){B={...B},Q={...Q};const U=F.map(B=>B.animatingProperties).filter(B=>void 0!==B);let t=1,s=1;return U.length>0&&(U.forEach(B=>{B.width&&(t/=B.width),B.height&&(s/=B.height)}),void 0!==B.left&&void 0!==Q.left&&(B.left=t*B.left,Q.left=t*Q.left),void 0!==B.top&&void 0!==Q.top&&(B.top=s*B.top,Q.top=s*Q.top)),{from:B,to:Q}}calculateKeyframes(B,Q,F=!1){const U={},t={};let s=!1;const I={};for(const F in Q){const g=B[F],i=Q[F];if(F in ma){const B=ma[F];if(void 0===g||void 0===i)continue;const Q=B(g,i);void 0!==Q.transform&&(I[F]=Q.value,s=!0,U.transform=`${U.transform??""} ${Q.transform}`,void 0!==Q.overrideFrom&&Object.assign(U,Q.overrideFrom))}else g!==i&&void 0!==g&&void 0!==i&&(s=!0,U[F]=g,t[F]=i)}return U.transformOrigin=t.transformOrigin=F?"center center":"top left",this.animatingProperties=I,s?[U,t]:void 0}async animate(B,Q=this.options.keyframeOptions){this.start(),this.frames=B;let F=!1;if(!this.isAnimating()&&!this.isDisabled()&&(this.options.onFrames&&(this.frames=B=this.options.onFrames(this),this.log("modified frames",B)),void 0!==B)){this.log("animate",[B,Q]),F=!0,this.webAnimation=this.element.animate(B,Q);const U=this.getController();U?.add(this);try{await this.webAnimation.finished}catch(B){}U?.remove(this)}return this.didFinish(F),F}isAnimating(){return"running"===this.webAnimation?.playState||this.webAnimation?.pending}log(B,Q){this.shouldLog&&!this.isDisabled()&&console.log(B,this.options.id,Q)}});class Wa{static k={DEFAULT:.05,MIN:0,MAX:100,STEP:.001,JUMP:.01};static adk2v(B,Q,F){return B/(1+F*Q)}static adv2k(B,Q,F){return(B-F)/(F*Q)}}class Ha extends ca{static get properties(){return{numeric:{attribute:"numeric",type:Boolean,reflect:!0}}}constructor(){super(),this.numeric=!1}static get styles(){return[super.styles,I`
|
|
1037
1037
|
:host {
|
|
1038
1038
|
display: block;
|
|
1039
1039
|
|
|
@@ -1389,7 +1389,7 @@ const da=2;let Ca=class{constructor(B){}get _$AU(){return this._$AM._$AU}_$AT(B,
|
|
|
1389
1389
|
transform: translateY(0);
|
|
1390
1390
|
}
|
|
1391
1391
|
|
|
1392
|
-
:host(.keyboard) .
|
|
1392
|
+
:host(.keyboard) .body.interactive:has(~ .point:focus-within) {
|
|
1393
1393
|
filter: url("#shadow-8");
|
|
1394
1394
|
|
|
1395
1395
|
/* HACK: This gets Safari to correctly apply the filter! */
|