{"version":3,"file":"PlainText_Plus.CHi6BiKJ.mjs","names":["useRef","_Fragment","BaseControls"],"sources":["https:/framerusercontent.com/modules/cRZO67Az1mtYGYwheHno/n1y3DIZ8ft84iLDLsu71/SearchplusOverride.js","https:/framerusercontent.com/modules/rh6e2sb1Jywsg0Jg5MC9/nU76KIngapLuixkcwZx7/PlainText_Plus.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useEffect,useRef}from\"react\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";// Learn more: https://www.framer.com/developers/overrides/\n// Create a shared store to track the search input value\n// createStore returns a custom hook that can be used in any override\nconst useStore=createStore({searchValue:\"\"});/**\n * Override for the Search+ component\n * Captures input changes and updates the shared store\n * Apply this to your Search+ component\n */export function SearchInput(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[store,setStore]=useStore();const hasInteracted=useRef(false);// Clear store on mount if this is a fresh page load\n// This prevents stale values from other pages showing the close button\nuseEffect(()=>{if(!hasInteracted.current){setStore({searchValue:\"\"});}},[]);// Create the onInput handler\nconst handleInput=event=>{hasInteracted.current=true;// Get the current input value\nconst value=event.target.value||\"\";// Update the store with the new value\nsetStore({searchValue:value});// Call the original onInput if it exists\nif(props.onInput){props.onInput(event);}};return /*#__PURE__*/_jsx(Component,{ref:ref,...props,onInput:handleInput});});}/**\n * Override for the close button stack\n * Controls visibility based on whether there's actual user input\n * Apply this to the stack containing your close+ component\n */export function CloseButtonVisibility(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[store,setStore]=useStore();// Handle click to clear the store\nconst handleClick=event=>{// Clear the store value when close button is clicked\nsetStore({searchValue:\"\"});// Call the original onClick if it exists\nif(props.onClick){props.onClick(event);}};return /*#__PURE__*/_jsx(Component,{ref:ref,...props,style:{...props.style,opacity:store.searchValue.length>0?1:0,pointerEvents:store.searchValue.length>0?\"auto\":\"none\"},onClick:handleClick});});}/**\n * Override for the clear+ component\n * Clears the store when the clear+ button is clicked\n * Apply this to your clear+ component that clears all filters\n */export function ClearAllFilters(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[store,setStore]=useStore();// Handle click to clear the store\nconst handleClick=event=>{// Clear the store value when clear+ button is clicked\nsetStore({searchValue:\"\"});// Call the original onClick if it exists\nif(props.onClick){props.onClick(event);}};return /*#__PURE__*/_jsx(Component,{ref:ref,...props,onClick:handleClick});});}\nexport const __FramerMetadata__ = {\"exports\":{\"ClearAllFilters\":{\"type\":\"reactHoc\",\"name\":\"ClearAllFilters\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"CloseButtonVisibility\":{\"type\":\"reactHoc\",\"name\":\"CloseButtonVisibility\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"SearchInput\":{\"type\":\"reactHoc\",\"name\":\"SearchInput\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SearchplusOverride.map","import{jsx as _jsx,Fragment as _Fragment}from\"react/jsx-runtime\";import{addPropertyControls,// @ts-ignore\ngetPropertyControls,ControlType}from\"framer\";import{useFilter}from\"https://framerusercontent.com/modules/uaC9hWf3ec7HqMv3sXMc/fThGQnEUZeWwDLSQMzea/Hooks.js\";import BaseControls from\"https://framerusercontent.com/modules/1abSdslctova79WmNQRw/3fHstYFUOpeaxageGRMz/Filter_Base.js\";import CollectionIDControl from\"https://framerusercontent.com/modules/Hxho9sUnioBkMjGbLBed/csoxszrftuhmv2NyuE1c/collectionID.js\";import CMSFieldNameControl from\"https://framerusercontent.com/modules/xPWn77sAdxuRvon75kLo/B2UIyi7WVbdsZJvHIaDR/cmsFieldName.js\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n *\n * @framerDisableUnlink\n */export default function PlainTextFilterPlus(props){const{applyFilter,cmsFieldName,collectionID,condition,interactionActiveFilter,interactionInactiveFilter,preserveActiveFilter,value}=props;const cmsPlusComponentName=\"Filter+ PlainText\";useFilter({cmsFieldName,cmsPlusComponentName,collectionID,condition,interactionActiveFilter,interactionInactiveFilter,isPreserving:preserveActiveFilter,value:value.trim()?value:undefined,isFilterActive:applyFilter,controlType:\"string\",valueIsRequired:!condition.includes(\"IS_SET\")});return /*#__PURE__*/_jsx(_Fragment,{});}PlainTextFilterPlus.displayName=\"Filter+ PlainText\";addPropertyControls(PlainTextFilterPlus,{...getPropertyControls(CollectionIDControl),...getPropertyControls(BaseControls),...getPropertyControls(CMSFieldNameControl),condition:{type:ControlType.Enum,title:\"Condition\",defaultValue:\"==\",optionTitles:[\"Is Set\",\"Isn't Set\",\"Equals\",\"Doesn't Equal\",\"Starts With\",\"Doesn't Start With\",\"Ends With\",\"Doesn't End With\",\"Contains\",\"Doesn't Contain\"],options:[\"IS_SET\",\"!IS_SET\",\"==\",\"!=\",\"STARTS_WITH\",\"!STARTS_WITH\",\"ENDS_WITH\",\"!ENDS_WITH\",\"CONTAINS\",\"!CONTAINS\"]},value:{type:ControlType.String,title:\"Value\",defaultValue:\"\",placeholder:\"case-sensitive\",hidden:props=>props.condition.includes(\"IS_SET\")}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PlainTextFilterPlus\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\",\"framerDisableUnlink\":\"\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"ulBAOG,SAAgB,EAAY,EAAU,CAAC,OAAoB,GAAY,EAAM,IAAM,CAAC,GAAK,CAAC,EAAM,GAAU,GAAU,CAAO,EAAcA,EAAO,GAAM,CAEzJ,MAAc,CAAK,EAAc,SAAS,EAAS,CAAC,YAAY,GAAG,CAAC,EAAI,EAAE,CAAC,CAC3E,IAAM,EAAY,GAAO,CAAC,EAAc,QAAQ,GAChD,IAAM,EAAM,EAAM,OAAO,OAAO,GAChC,EAAS,CAAC,YAAY,EAAM,CAAC,CAC1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