← Back
Editing: product-filter-active.js
(()=>{var e={11652:()=>{}},o={};function r(t){var c=o[t];if(void 0!==c)return c.exports;var i=o[t]={exports:{}};return e[t](i,i.exports,r),i.exports}(()=>{"use strict";const e=window.wp.blocks,o=window.wp.primitives,t=window.ReactJSXRuntime,c=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","name":"woocommerce/product-filter-active","title":"Active Filters","description":"Display all active filters.","category":"woocommerce","keywords":["WooCommerce"],"textdomain":"woocommerce","apiVersion":3,"ancestor":["woocommerce/product-filters"],"supports":{"interactivity":true,"__experimentalBorder":{"color":true,"radius":true,"style":true,"width":true,"__experimentalDefaultControls":{"color":false,"radius":false,"style":false,"width":false}},"spacing":{"margin":true,"padding":true,"blockGap":false,"__experimentalDefaultControls":{"margin":false,"padding":false,"blockGap":false}}},"usesContext":["activeFilters"],"viewScriptModule":"woocommerce/product-filter-active"}'),i=window.wp.blockEditor;r(11652);const l=({children:e})=>(0,t.jsxs)("div",{className:"wc-block-product-filter-components-initial-disabled",children:[(0,t.jsx)("div",{className:"wc-block-product-filter-components-initial-disabled-overlay"}),e]}),s=["woocommerce/product-filters","woocommerce/product-filter-attribute","woocommerce/product-filter-active","woocommerce/product-filter-price","woocommerce/product-filter-status","woocommerce/product-collection","woocommerce/add-to-cart-form","woocommerce/add-to-cart-with-options","core/query"],a=(o=[])=>(0,e.getBlockTypes)().map(e=>e.name).filter(e=>!o.includes(e)),m=window.wp.i18n,d=[{id:"color_blue",type:(0,m.__)("Color","woocommerce"),value:"blue",label:(0,m.__)("Blue","woocommerce")},{id:"color_red",type:(0,m.__)("Color","woocommerce"),value:"red",label:(0,m.__)("Red","woocommerce")},{id:"size_large",type:(0,m.__)("Size","woocommerce"),value:"large",label:(0,m.__)("Large","woocommerce")},{id:"status_instock",type:(0,m.__)("Availability","woocommerce"),value:"instock",label:(0,m.__)("In stock","woocommerce")}];(0,e.registerBlockType)(c,{icon:()=>(0,t.jsxs)(o.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)(o.Path,{d:"M9 17.5H11.5V16H9V17.5ZM5 6V7.5L17 7.5V6L5 6ZM7 12.5H15V11H7V12.5Z",fill:"currentColor"}),(0,t.jsx)(o.Path,{d:"M19.9982 13.1948L18.7945 12.2998L15.7111 16.1017L14.0969 14.8993L13.2002 16.1017L16.0185 18.2022L19.9982 13.1948Z",fill:"currentColor"})]}),edit:()=>{const{children:e,...o}=(0,i.useInnerBlocksProps)((0,i.useBlockProps)(),{allowedBlocks:a(s),template:[["woocommerce/product-filter-removable-chips"],["woocommerce/product-filter-clear-button"]]});return(0,t.jsx)("div",{...o,children:(0,t.jsx)(l,{children:(0,t.jsx)(i.BlockContextProvider,{value:{"woocommerce/removableItems":{items:d,storeNamespace:"woocommerce/product-filters"}},children:e})})})},save:()=>{const e=i.useBlockProps.save(),o=i.useInnerBlocksProps.save(e);return(0,t.jsx)("div",{...o})}})})(),((this.wc=this.wc||{}).blocks=this.wc.blocks||{})["product-filter-active"]={}})();
Save File
Cancel