Plugin Directory

Changeset 3472745


Ignore:
Timestamp:
03/02/2026 02:03:12 PM (4 weeks ago)
Author:
wijnbergdevelopments
Message:
  • Added compatibility for WP Grid Builder
Location:
tax-switch-for-woocommerce
Files:
111 added
7 edited

Legend:

Unmodified
Added
Removed
  • tax-switch-for-woocommerce/trunk/README.txt

    r3460537 r3472745  
    44Requires at least: 5.0
    55Tested up to: 6.9
    6 Stable tag: 1.6.9
     6Stable tag: 1.6.10
    77Requires PHP: 7.2
    88License: GPL-2.0+
     
    210210* WooCommerce Dynamic Pricing and Discount Rules
    211211* Price Based on Country for WooCommerce
     212* WP Grid Builder
    212213
    213214If you encounter any compatibility issues with other plugins or themes, please let us know. Your feedback helps us improve the plugin and extend compatibility to more third-party solutions.
     
    246247
    247248== Changelog ==
     249= 1.6.10 =
     250* Added compatibility for WP Grid Builder
     251
    248252= 1.6.9 =
    249253* Added new option for setting the tax switch aria-label
  • tax-switch-for-woocommerce/trunk/build/label/block.json

    r3460537 r3472745  
    33  "apiVersion": 3,
    44  "name": "wdevs/tax-switch-label",
    5   "version": "1.6.9",
     5  "version": "1.6.10",
    66  "title": "Tax Switch text label",
    77  "category": "woocommerce",
  • tax-switch-for-woocommerce/trunk/build/shared/shared.asset.php

    r3460537 r3472745  
    1 <?php return array('dependencies' => array(), 'version' => '67d6e6021b66ee1ffc4b');
     1<?php return array('dependencies' => array(), 'version' => '1d8c1fcff7db2584165b');
  • tax-switch-for-woocommerce/trunk/build/shared/shared.js

    r3460537 r3472745  
    1 "use strict";(globalThis.webpackChunkwdevs_tax_switch=globalThis.webpackChunkwdevs_tax_switch||[]).push([[320],{67:(t,e,s)=>{s.d(e,{A:()=>o});var i=s(87),c=s(143),n=s(159),a=s(75),l=s(790);class r extends i.Component{constructor(t){super(t);const{readOnly:e,isSwitched:s}=this.getInitialState(t);this.state={readOnly:e,isSwitched:s},this.unsubscribe=(0,c.subscribe)(()=>{const t=(0,a.ir)();this.state.isSwitched!==t&&this.setState({isSwitched:t})})}getInitialState(t){const e=n.A.parseBooleanValue(t.readOnly),s=t.originalTaxDisplay||"incl";let i;return i=e?!("incl"===s):(0,a.ir)(),{readOnly:e,isSwitched:i}}componentWillUnmount(){this.unsubscribe&&this.unsubscribe()}displayIncludingVat(){const{originalTaxDisplay:t="incl"}=this.props,{isSwitched:e}=this.state;return n.A.displayIncludingVat(t,e)}getCurrentLabel(){const{labelTextIncl:t,labelTextExcl:e}=this.props;return this.displayIncludingVat()?t||"":e||""}render(){const{labelTextColor:t,labelTextColorChecked:e,labelTextIncl:s,labelTextExcl:i}=this.props;if(!s&&!i)return"";const c=this.displayIncludingVat();return(0,l.jsx)("span",{className:"wdevs-tax-switch-labels "+(c?"wts-price-incl":"wts-price-excl"),style:{"--wts-text-color":t,"--wts-text-color-checked":e},children:(0,l.jsx)("span",{className:"wdevs-tax-switch-label-text",children:this.getCurrentLabel()})})}}const o=/^(38|733)$/.test(s.j)?r:null},75:(t,e,s)=>{s.d(e,{D_:()=>u,WJ:()=>w,ir:()=>d,rj:()=>h,z6:()=>p});var i=s(143);const c="wdevs_tax_switch_is_switched",n="wdevs-tax-switch/store",a="SET_IS_SWITCHED",l="SET_IS_DISABLED",r={setIsSwitched:t=>({type:a,value:t}),saveIsSwitched:t=>(localStorage.setItem(c,JSON.stringify(t)),{type:a,value:t}),setIsDisabled:t=>({type:l,value:t})};let o=(0,i.select)(n);function d(){return(0,i.select)(n).getIsSwitched()}function h(t){return(0,i.dispatch)(n).saveIsSwitched(t)}function w(t){return(0,i.dispatch)(n).setIsSwitched(t)}function u(){return(0,i.select)(n).getIsDisabled()}function p(t){return(0,i.dispatch)(n).setIsDisabled(t)}void 0===o&&(o=(0,i.createReduxStore)(n,{reducer:(t=(()=>{const t=localStorage.getItem(c);return{isSwitched:!!t&&JSON.parse(t),isDisabled:!1}})(),e)=>{switch(e.type){case a:return{...t,isSwitched:e.value};case l:return{...t,isDisabled:e.value};default:return t}},actions:r,selectors:{getIsSwitched:t=>t.isSwitched,getIsDisabled:t=>t.isDisabled}}),(0,i.register)(o))},159:(t,e,s)=>{s.d(e,{A:()=>c});var i=s(75);const c=285!=s.j?class{static togglePriceClasses(t,e){const s=this.displayIncludingVat(t,e);document.querySelectorAll(".wts-price-wrapper").forEach(t=>{const e=t.querySelector(":scope > .wts-price-incl"),i=t.querySelector(":scope > .wts-price-excl");s?(e.classList.remove("wts-inactive"),e.classList.add("wts-active"),i.classList.remove("wts-active"),i.classList.add("wts-inactive")):(e.classList.remove("wts-active"),e.classList.add("wts-inactive"),i.classList.remove("wts-inactive"),i.classList.add("wts-active"))})}static displayIncludingVat(t,e){return null==e&&(e=(0,i.ir)()),"incl"===t&&!e||"excl"===t&&e}static parseBooleanValue(t){return!!t&&JSON.parse(t)}static setPriceClasses(t){return this.togglePriceClasses(t,(0,i.ir)())}static calculateAlternatePrice(t,e,s){if(!t||t<=0||!s)return t;const i=1+s/100;let c;return c="incl"===e?t/i:t*i,Number(c.toFixed(2))}static calculateOriginalPrice(t,e,s){let i="excl";return"excl"===e&&(i="incl"),this.calculateAlternatePrice(t,i,s)}}:null},538:(t,e,s)=>{function i(){return!(window.wtsViewObject||{checkPriceElements:!1}).checkPriceElements||document.querySelectorAll(".wts-price-wrapper").length>0}function c(t){"loading"!==document.readyState?t():document.addEventListener("DOMContentLoaded",t,{once:!0})}s.d(e,{I:()=>i,P:()=>c})},651:(t,e,s)=>{s.d(e,{A:()=>i});const i=/^(202|285|38|657|733|793|894)$/.test(s.j)?null:class{constructor(t){this.originalTaxDisplay=t}build(t,e,s,i=null){const c=this.getPricesBasedOnTaxDisplay(e,s),n=c.including,a=c.excluding;function l(t){return t?"wts-active":"wts-inactive"}function r(e,s){return`\n         <span class="wts-price-${s?"incl":"excl"} ${l(s===t)}">\n            ${e}\n         </span>\n      `}let o=`\n      <span class="wts-price-container">\n         <span class="wts-price-wrapper">\n            ${r(n,!0)}\n            ${r(a,!1)}\n         </span>\n   `;if(i){function d(e,s){return`\n            <span class="wts-price-${s?"incl":"excl"} ${l(s===t)}">\n               ${e}\n            </span>\n         `}o+=`\n         <span class="wts-price-wrapper">\n            ${d(i.including,!0)}\n            ${d(i.excluding,!1)}\n         </span>\n      `}return o+="</span>",o.trim()}getPricesBasedOnTaxDisplay(t,e){return"incl"===this.originalTaxDisplay?{including:t,excluding:e}:{including:e,excluding:t}}static getVatTexts(t=null){const e=document.createTextNode(" ").nodeValue;let s,i;if(window.wtsCompatibilityObject&&window.wtsCompatibilityObject.includingVatText&&window.wtsCompatibilityObject.excludingVatText)return s=window.wtsCompatibilityObject.includingVatText,i=window.wtsCompatibilityObject.excludingVatText,{including:e+`<span class="wts-vat-text">${s}</span>`,excluding:e+`<span class="wts-vat-text">${i}</span>`};if(t){const c=jQuery(t);if(s=c.find(".wts-price-incl .wts-vat-text").first(),i=c.find(".wts-price-excl .wts-vat-text").first(),s.length||i.length)return{including:s.length?e+s.clone().prop("outerHTML"):"",excluding:i.length?e+i.clone().prop("outerHTML"):""}}return s=jQuery(".wts-price-wrapper .wts-price-incl .wts-vat-text").first(),i=jQuery(".wts-price-wrapper .wts-price-excl .wts-vat-text").first(),{including:s.length?e+s.clone().prop("outerHTML"):"",excluding:i.length?e+i.clone().prop("outerHTML"):""}}static getVatTextElement(t,e,s){return`<span class="wts-price-wrapper">\n                    <span class="wts-price-incl ${t?"wts-active":"wts-inactive"}">\n                        ${e}\n                    </span>\n                    <span class="wts-price-excl ${t?"wts-inactive":"wts-active"}">\n                          ${s}\n                    </span>\n                </span>\n            `}}},983:(t,e,s)=>{s.d(e,{A:()=>d});var i=s(87),c=s(143),n=s(723),a=s(159),l=s(75),r=s(790);class o extends i.Component{constructor(t){super(t);const{readOnly:e,isSwitched:s}=this.getInitialState(t);this.state={readOnly:e,isSwitched:s,isDisabled:(0,l.D_)()},this.handleChange=this.handleChange.bind(this),this.unsubscribe=(0,c.subscribe)(()=>{const t=(0,l.ir)(),e=(0,l.D_)();this.state.isSwitched===t&&this.state.isDisabled===e||this.setState({isSwitched:t,isDisabled:e})})}getInitialState(t){const e=a.A.parseBooleanValue(t.readOnly),s=t.originalTaxDisplay||"incl";let i;return i=e?!("incl"===s):(0,l.ir)(),{readOnly:e,isSwitched:i}}componentWillUnmount(){this.unsubscribe&&this.unsubscribe()}handleChange(){const t=!this.state.isSwitched;this.setState({isSwitched:t},()=>{this.state.readOnly?(0,l.WJ)(t):((0,l.rj)(t),this.fireSwitchChangeEvent(t)),this.togglePriceClasses()})}displayIncludingVat(){const{originalTaxDisplay:t="incl"}=this.props,{isSwitched:e}=this.state;return a.A.displayIncludingVat(t,e)}togglePriceClasses(){const{originalTaxDisplay:t="incl"}=this.props,{isSwitched:e}=this.state;return a.A.togglePriceClasses(t,e)}getToggleSwitchAriaLabel(){const{switchAriaLabel:t,switchLabelIncl:e,switchLabelExcl:s}=this.props;return t||(e&&s?e+" / "+s:(0,n.__)("Switch between prices including and excluding VAT","tax-switch-for-woocommerce"))}getCurrentLabel(){const{switchLabelIncl:t,switchLabelExcl:e}=this.props;return this.displayIncludingVat()?t||"":e||""}fireSwitchChangeEvent(t){const e=new CustomEvent("wdevs-tax-switch-changed",{detail:{isSwitched:t,displayIncludingVat:this.displayIncludingVat()}});document.dispatchEvent(e)}renderButtons(){const{switchColor:t,switchColorChecked:e,switchBackgroundColor:s,switchBackgroundColorChecked:i,switchTextColor:c,switchLabelIncl:a,switchLabelExcl:l}=this.props,o=this.displayIncludingVat(),{isDisabled:d}=this.state;return(0,r.jsxs)("div",{className:"wdevs-tax-switch wdevs-tax-buttons",style:{"--wts-color":t,"--wts-color-checked":e,"--wts-bg-color":s,"--wts-bg-color-checked":i,"--wts-text-color":c},children:[(0,r.jsx)("button",{type:"button",className:"wdevs-tax-button "+(o?"wdevs-tax-button-active":""),disabled:d,onClick:()=>{o||this.handleChange()},children:a||(0,n.__)("Incl. VAT","tax-switch-for-woocommerce")}),(0,r.jsx)("button",{type:"button",className:"wdevs-tax-button "+(o?"":"wdevs-tax-button-active"),disabled:d,onClick:()=>{o&&this.handleChange()},children:l||(0,n.__)("Excl. VAT","tax-switch-for-woocommerce")})]})}renderToggleSwitch(){const{switchColor:t,switchColorChecked:e,switchBackgroundColor:s,switchBackgroundColorChecked:i,switchTextColor:c,switchLabelIncl:n,switchLabelExcl:a}=this.props,l=this.displayIncludingVat(),o=n||a,{isDisabled:d}=this.state;return(0,r.jsxs)("div",{className:"wdevs-tax-switch",style:{"--wts-color":t,"--wts-color-checked":e,"--wts-bg-color":s,"--wts-bg-color-checked":i,"--wts-text-color":c},children:[(0,r.jsxs)("label",{className:"wdevs-tax-switch-label",children:[(0,r.jsx)("input",{type:"checkbox",name:"wdevs-tax-switch-checkbox",onChange:this.handleChange,checked:l,disabled:d,className:"wdevs-tax-switch-checkbox","aria-label":this.getToggleSwitchAriaLabel()}),(0,r.jsx)("span",{className:"wdevs-tax-switch-slider"})]}),o&&(0,r.jsx)("span",{className:"wdevs-tax-switch-label-text",onClick:this.handleChange,role:"button",tabIndex:0,onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.handleChange())},children:this.getCurrentLabel()})]})}render(){const{switchType:t="switch"}=this.props;return"buttons"===t?this.renderButtons():this.renderToggleSwitch()}}const d=/^(202|793)$/.test(s.j)?o:null}}]);
     1"use strict";(globalThis.webpackChunkwdevs_tax_switch=globalThis.webpackChunkwdevs_tax_switch||[]).push([[320],{67:(t,e,s)=>{s.d(e,{A:()=>o});var i=s(87),c=s(143),n=s(159),a=s(75),l=s(790);class r extends i.Component{constructor(t){super(t);const{readOnly:e,isSwitched:s}=this.getInitialState(t);this.state={readOnly:e,isSwitched:s},this.unsubscribe=(0,c.subscribe)(()=>{const t=(0,a.ir)();this.state.isSwitched!==t&&this.setState({isSwitched:t})})}getInitialState(t){const e=n.A.parseBooleanValue(t.readOnly),s=t.originalTaxDisplay||"incl";let i;return i=e?!("incl"===s):(0,a.ir)(),{readOnly:e,isSwitched:i}}componentWillUnmount(){this.unsubscribe&&this.unsubscribe()}displayIncludingVat(){const{originalTaxDisplay:t="incl"}=this.props,{isSwitched:e}=this.state;return n.A.displayIncludingVat(t,e)}getCurrentLabel(){const{labelTextIncl:t,labelTextExcl:e}=this.props;return this.displayIncludingVat()?t||"":e||""}render(){const{labelTextColor:t,labelTextColorChecked:e,labelTextIncl:s,labelTextExcl:i}=this.props;if(!s&&!i)return"";const c=this.displayIncludingVat();return(0,l.jsx)("span",{className:"wdevs-tax-switch-labels "+(c?"wts-price-incl":"wts-price-excl"),style:{"--wts-text-color":t,"--wts-text-color-checked":e},children:(0,l.jsx)("span",{className:"wdevs-tax-switch-label-text",children:this.getCurrentLabel()})})}}const o=/^(38|733)$/.test(s.j)?r:null},75:(t,e,s)=>{s.d(e,{D_:()=>u,WJ:()=>w,ir:()=>d,rj:()=>h,z6:()=>p});var i=s(143);const c="wdevs_tax_switch_is_switched",n="wdevs-tax-switch/store",a="SET_IS_SWITCHED",l="SET_IS_DISABLED",r={setIsSwitched:t=>({type:a,value:t}),saveIsSwitched:t=>(localStorage.setItem(c,JSON.stringify(t)),{type:a,value:t}),setIsDisabled:t=>({type:l,value:t})};let o=(0,i.select)(n);function d(){return(0,i.select)(n).getIsSwitched()}function h(t){return(0,i.dispatch)(n).saveIsSwitched(t)}function w(t){return(0,i.dispatch)(n).setIsSwitched(t)}function u(){return(0,i.select)(n).getIsDisabled()}function p(t){return(0,i.dispatch)(n).setIsDisabled(t)}void 0===o&&(o=(0,i.createReduxStore)(n,{reducer:(t=(()=>{const t=localStorage.getItem(c);return{isSwitched:!!t&&JSON.parse(t),isDisabled:!1}})(),e)=>{switch(e.type){case a:return{...t,isSwitched:e.value};case l:return{...t,isDisabled:e.value};default:return t}},actions:r,selectors:{getIsSwitched:t=>t.isSwitched,getIsDisabled:t=>t.isDisabled}}),(0,i.register)(o))},159:(t,e,s)=>{s.d(e,{A:()=>c});var i=s(75);const c=285!=s.j?class{static togglePriceClasses(t,e){const s=this.displayIncludingVat(t,e);document.querySelectorAll(".wts-price-wrapper").forEach(t=>{const e=t.querySelector(":scope > .wts-price-incl"),i=t.querySelector(":scope > .wts-price-excl");s?(e.classList.remove("wts-inactive"),e.classList.add("wts-active"),i.classList.remove("wts-active"),i.classList.add("wts-inactive")):(e.classList.remove("wts-active"),e.classList.add("wts-inactive"),i.classList.remove("wts-inactive"),i.classList.add("wts-active"))})}static displayIncludingVat(t,e){return null==e&&(e=(0,i.ir)()),"incl"===t&&!e||"excl"===t&&e}static parseBooleanValue(t){return!!t&&JSON.parse(t)}static setPriceClasses(t){return this.togglePriceClasses(t,(0,i.ir)())}static calculateAlternatePrice(t,e,s){if(!t||t<=0||!s)return t;const i=1+s/100;let c;return c="incl"===e?t/i:t*i,Number(c.toFixed(2))}static calculateOriginalPrice(t,e,s){let i="excl";return"excl"===e&&(i="incl"),this.calculateAlternatePrice(t,i,s)}}:null},538:(t,e,s)=>{function i(){return!(window.wtsViewObject||{checkPriceElements:!1}).checkPriceElements||document.querySelectorAll(".wts-price-wrapper").length>0}function c(t){"loading"!==document.readyState?t():document.addEventListener("DOMContentLoaded",t,{once:!0})}s.d(e,{I:()=>i,P:()=>c})},651:(t,e,s)=>{s.d(e,{A:()=>i});const i=/^(154|202|285|38|657|733|793|894)$/.test(s.j)?null:class{constructor(t){this.originalTaxDisplay=t}build(t,e,s,i=null){const c=this.getPricesBasedOnTaxDisplay(e,s),n=c.including,a=c.excluding;function l(t){return t?"wts-active":"wts-inactive"}function r(e,s){return`\n         <span class="wts-price-${s?"incl":"excl"} ${l(s===t)}">\n            ${e}\n         </span>\n      `}let o=`\n      <span class="wts-price-container">\n         <span class="wts-price-wrapper">\n            ${r(n,!0)}\n            ${r(a,!1)}\n         </span>\n   `;if(i){function d(e,s){return`\n            <span class="wts-price-${s?"incl":"excl"} ${l(s===t)}">\n               ${e}\n            </span>\n         `}o+=`\n         <span class="wts-price-wrapper">\n            ${d(i.including,!0)}\n            ${d(i.excluding,!1)}\n         </span>\n      `}return o+="</span>",o.trim()}getPricesBasedOnTaxDisplay(t,e){return"incl"===this.originalTaxDisplay?{including:t,excluding:e}:{including:e,excluding:t}}static getVatTexts(t=null){const e=document.createTextNode(" ").nodeValue;let s,i;if(window.wtsCompatibilityObject&&window.wtsCompatibilityObject.includingVatText&&window.wtsCompatibilityObject.excludingVatText)return s=window.wtsCompatibilityObject.includingVatText,i=window.wtsCompatibilityObject.excludingVatText,{including:e+`<span class="wts-vat-text">${s}</span>`,excluding:e+`<span class="wts-vat-text">${i}</span>`};if(t){const c=jQuery(t);if(s=c.find(".wts-price-incl .wts-vat-text").first(),i=c.find(".wts-price-excl .wts-vat-text").first(),s.length||i.length)return{including:s.length?e+s.clone().prop("outerHTML"):"",excluding:i.length?e+i.clone().prop("outerHTML"):""}}return s=jQuery(".wts-price-wrapper .wts-price-incl .wts-vat-text").first(),i=jQuery(".wts-price-wrapper .wts-price-excl .wts-vat-text").first(),{including:s.length?e+s.clone().prop("outerHTML"):"",excluding:i.length?e+i.clone().prop("outerHTML"):""}}static getVatTextElement(t,e,s){return`<span class="wts-price-wrapper">\n                    <span class="wts-price-incl ${t?"wts-active":"wts-inactive"}">\n                        ${e}\n                    </span>\n                    <span class="wts-price-excl ${t?"wts-inactive":"wts-active"}">\n                          ${s}\n                    </span>\n                </span>\n            `}}},983:(t,e,s)=>{s.d(e,{A:()=>d});var i=s(87),c=s(143),n=s(723),a=s(159),l=s(75),r=s(790);class o extends i.Component{constructor(t){super(t);const{readOnly:e,isSwitched:s}=this.getInitialState(t);this.state={readOnly:e,isSwitched:s,isDisabled:(0,l.D_)()},this.handleChange=this.handleChange.bind(this),this.unsubscribe=(0,c.subscribe)(()=>{const t=(0,l.ir)(),e=(0,l.D_)();this.state.isSwitched===t&&this.state.isDisabled===e||this.setState({isSwitched:t,isDisabled:e})})}getInitialState(t){const e=a.A.parseBooleanValue(t.readOnly),s=t.originalTaxDisplay||"incl";let i;return i=e?!("incl"===s):(0,l.ir)(),{readOnly:e,isSwitched:i}}componentWillUnmount(){this.unsubscribe&&this.unsubscribe()}handleChange(){const t=!this.state.isSwitched;this.setState({isSwitched:t},()=>{this.state.readOnly?(0,l.WJ)(t):((0,l.rj)(t),this.fireSwitchChangeEvent(t)),this.togglePriceClasses()})}displayIncludingVat(){const{originalTaxDisplay:t="incl"}=this.props,{isSwitched:e}=this.state;return a.A.displayIncludingVat(t,e)}togglePriceClasses(){const{originalTaxDisplay:t="incl"}=this.props,{isSwitched:e}=this.state;return a.A.togglePriceClasses(t,e)}getToggleSwitchAriaLabel(){const{switchAriaLabel:t,switchLabelIncl:e,switchLabelExcl:s}=this.props;return t||(e&&s?e+" / "+s:(0,n.__)("Switch between prices including and excluding VAT","tax-switch-for-woocommerce"))}getCurrentLabel(){const{switchLabelIncl:t,switchLabelExcl:e}=this.props;return this.displayIncludingVat()?t||"":e||""}fireSwitchChangeEvent(t){const e=new CustomEvent("wdevs-tax-switch-changed",{detail:{isSwitched:t,displayIncludingVat:this.displayIncludingVat()}});document.dispatchEvent(e)}renderButtons(){const{switchColor:t,switchColorChecked:e,switchBackgroundColor:s,switchBackgroundColorChecked:i,switchTextColor:c,switchLabelIncl:a,switchLabelExcl:l}=this.props,o=this.displayIncludingVat(),{isDisabled:d}=this.state;return(0,r.jsxs)("div",{className:"wdevs-tax-switch wdevs-tax-buttons",style:{"--wts-color":t,"--wts-color-checked":e,"--wts-bg-color":s,"--wts-bg-color-checked":i,"--wts-text-color":c},children:[(0,r.jsx)("button",{type:"button",className:"wdevs-tax-button "+(o?"wdevs-tax-button-active":""),disabled:d,onClick:()=>{o||this.handleChange()},children:a||(0,n.__)("Incl. VAT","tax-switch-for-woocommerce")}),(0,r.jsx)("button",{type:"button",className:"wdevs-tax-button "+(o?"":"wdevs-tax-button-active"),disabled:d,onClick:()=>{o&&this.handleChange()},children:l||(0,n.__)("Excl. VAT","tax-switch-for-woocommerce")})]})}renderToggleSwitch(){const{switchColor:t,switchColorChecked:e,switchBackgroundColor:s,switchBackgroundColorChecked:i,switchTextColor:c,switchLabelIncl:n,switchLabelExcl:a}=this.props,l=this.displayIncludingVat(),o=n||a,{isDisabled:d}=this.state;return(0,r.jsxs)("div",{className:"wdevs-tax-switch",style:{"--wts-color":t,"--wts-color-checked":e,"--wts-bg-color":s,"--wts-bg-color-checked":i,"--wts-text-color":c},children:[(0,r.jsxs)("label",{className:"wdevs-tax-switch-label",children:[(0,r.jsx)("input",{type:"checkbox",name:"wdevs-tax-switch-checkbox",onChange:this.handleChange,checked:l,disabled:d,className:"wdevs-tax-switch-checkbox","aria-label":this.getToggleSwitchAriaLabel()}),(0,r.jsx)("span",{className:"wdevs-tax-switch-slider"})]}),o&&(0,r.jsx)("span",{className:"wdevs-tax-switch-label-text",onClick:this.handleChange,role:"button",tabIndex:0,onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.handleChange())},children:this.getCurrentLabel()})]})}render(){const{switchType:t="switch"}=this.props;return"buttons"===t?this.renderButtons():this.renderToggleSwitch()}}const d=/^(202|793)$/.test(s.j)?o:null}}]);
  • tax-switch-for-woocommerce/trunk/build/switch/block.json

    r3460537 r3472745  
    33  "apiVersion": 3,
    44  "name": "wdevs/tax-switch",
    5   "version": "1.6.9",
     5  "version": "1.6.10",
    66  "title": "Tax Switch for WooCommerce",
    77  "category": "woocommerce",
  • tax-switch-for-woocommerce/trunk/includes/class-wdevs-tax-switch-compatibility.php

    r3447052 r3472745  
    220220            );
    221221        }
     222
     223        // WP Grid Builder
     224        if ( $this->is_plugin_active( 'wp-grid-builder/wp-grid-builder.php' ) ) {
     225            $wp_grid_builder_handle = 'wdevs-tax-switch-wp-grid-builder';
     226            $wp_grid_builder_asset  = $this->enqueue_script( $wp_grid_builder_handle, 'switch', 'wp-grid-builder', [ 'wpgb' ] );
     227        }
     228
    222229    }
    223230
  • tax-switch-for-woocommerce/trunk/wdevs-tax-switch.php

    r3460537 r3472745  
    1717 * Plugin URI:           https://wijnberg.dev
    1818 * Description:          Let customers toggle between inclusive and exclusive VAT pricing in your WooCommerce store.
    19  * Version:              1.6.9
     19 * Version:              1.6.10
    2020 * Author:               Wijnberg Developments
    2121 * Author URI:           https://wijnberg.dev/
     
    4141 * Rename this for your plugin and update it as you release new versions.
    4242 */
    43 define( 'WDEVS_TAX_SWITCH_VERSION', '1.6.9' );
     43define( 'WDEVS_TAX_SWITCH_VERSION', '1.6.10' );
    4444
    4545/**
Note: See TracChangeset for help on using the changeset viewer.