1 line
1.1 KiB
JavaScript
1 line
1.1 KiB
JavaScript
|
(()=>{"use strict";var e={};(e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})})(e),(0,window.wc.__experimentalInteractivity.store)({state:{},selectors:{woocommerceDropdown:{placeholderText:({context:e})=>{const{woocommerceDropdown:{selectedItem:o}}=e;return o.label||"Select an option"},isSelected:({context:e})=>{const{woocommerceDropdown:{currentItem:{value:o}}}=e;return e.woocommerceDropdown.selectedItem.value===o||e.woocommerceDropdown.hoveredItem.value===o}}},actions:{woocommerceDropdown:{toggleIsOpen:e=>{const{context:{woocommerceDropdown:o}}=e;o.isOpen=!o.isOpen},selectDropdownItem:({context:e})=>{const{woocommerceDropdown:{currentItem:{label:o,value:t}}}=e;e.woocommerceDropdown.selectedItem={label:o,value:t},e.woocommerceDropdown.isOpen=!1},addHoverClass:({context:e})=>{const{woocommerceDropdown:{currentItem:{label:o,value:t}}}=e;e.woocommerceDropdown.hoveredItem={label:o,value:t}},removeHoverClass:({context:e})=>{e.woocommerceDropdown.hoveredItem={label:null,value:null}}}}}),(this.wc=this.wc||{})["wc-interactivity-dropdown"]=e})();
|