PageSourceSearch

https://login.commonsku.com/dist/react/components-AddSupplierPopup.5c6fe31e.chunk.js

js commonsku.com collected 2026-10-02 03:15:03 UTC 3,742 bytes, 2 lines download raw bytes

1"use strict";(globalThis.__LOADABLE_LOADED_CHUNKS__=globalThis.__LOADABLE_LOADED_CHUNKS__||[]).push([[8105],{39581(e,s,n){n.r(s),n.d(s,{NEW_SUPPLIER_DIVISION_ID:()=>_,default:()=>v});var t=n(22224),i=n.n(t),o=n(41594),a=n(98483),l=n(89895),u=n.n(l),r=(n(33872),n(30596)),d=n(99315),c=n(39913),g=n(89861),p=n(28027),m=n(22078),h=n(63988);class S extends o.Component{constructor(e){super(e),this.handleSearch=i().debounce(function(e){(0,m.oD)("GET","company",{company_type:"SUPPLIER",search:!0,"max-results":10,company_name:this.state.value}).then(e=>{let{json:s}=e;return this.setState({companies:s.companies})}).then(e)},500),this.state={value:"",company_id:null,suggestions:[],companies:[],save:!1},i().bindAll(this,["onFormRef","onChange","onBlur","onSuggestionsFetchRequested","onSuggestionsClearRequested","getSuggestions","onSuggestionSelected"])}onFormRef(e){this._form=e}onChange(e,s){let{newValue:n,method:t}=s;this.setState({value:n,save:""!=n},function(){this.onSuggestionsClearRequested()})}onBlur(e,s){let{focusedSuggestion:n}=s}onSuggestionsFetchRequested(e){let{value:s}=e,n=this;this.handleSearch(function(){n.setState({suggestions:n.getSuggestions(s),company_id:null})})}onSuggestionsClearRequested(){this.setState({suggestions:[]})}onSuggestionSelected(e,s){let{suggestion:n}=s;this.setState({company_id:n.company_id,save:!n.account_id})}getSuggestions(e){const s=(0,m.Td)(e.trim());if(""===s)return[];const n=new RegExp("^"+s,"i");return this.state.companies.filter(e=>n.test(e.company_name)).slice(0,10)}renderLoading(){return(0,h.jsx)("div",{"data-test-name":"AddSupplierPopup.renderLoading",className:"row popup-content column",children:(0,h.jsx)("div",{className:"small-12 columns",children:(0,h.jsxs)("div",{className:"small-12 text-center",children:[(0,h.jsx)("br",{}),(0,h.jsx)("img",{src:"/images/gears.gif"}),(0,h.jsx)("br",{})]})})})}render(){const{onClosePopup:e,onAddSupplier:s,index:n}=this.props,{value:t,suggestions:i,company_id:o,save:a}=this.state,l={value:t,onChange:this.onChange,onBlur:this.onBlur};return(0,h.jsxs)("div",{"data-test-name":"AddSupplierPopup.render",className:"reveal small",style:{display:"block",height:"initial",overflow:"initial",zIndex:p.z+n},children:[(0,h.jsx)("div",{className:"row",children:(0,h.jsx)("div",{className:"small-12 columns",children:(0,h.jsx)("h3",{children:"Add New Supplier"})})}),(0,h.jsxs)("div",{className:"row",children:[(0,h.jsx)("div",{className:"small-12 medium-4 columns",children:(0,h.jsx)("strong",{children:"Company Name"})}),(0,h.jsx)("div",{className:"small-12 medium-8 columns company-autocomplete",children:(0,h.jsx)(u(),{suggestions:i,onSuggestionsFetchRequested:this.onSuggestionsFetchRequested,onSuggestionsClearRequested:this.onSuggestionsClearRequested,getSuggestionValue:e=>e.company_name,renderSuggestion:e=>e.company_name,inputProps:l,renderInputComponent:e=>(0,h.jsx)("input",{...e}),focusFirstSuggestion:!0,onSuggestionSelected:this.onSuggestionSelected})})]}),(0,h.jsx)("a",{className:"button alert",style:{position:"absolute",right:"5rem",top:"1rem"},onClick:s=>{s.preventDefault(),e()},children:"Cancel"}),(0,h.jsx)("a",{className:"button",style:{position:"absolute",right:"1rem",top:"1rem"},onClick:e=>{e.preventDefault(),t&&s(o?{company_id:o}:{company_name:t})},disabled:!a,children:"Save"})]})}}const _="NEW_SUPPLIER_DIVISION_ID",v=(0,a.Ng)(e=>({suppliers:(0,r.Yn)(e)}),(e,s)=>({onClosePopup:()=>e((0,c.fs)()),onAddSupplier:n=>e((0,d.w5)(n)).then(n=>{s.redirect?window.location.href=`/vendor.php?id=${n.payload.supplier.supplier_id}&division_id=${n.payload.supplier.division_id}`:e((0,g.Qg)(_,n.payload.supplier.division_id))}).then(()=>e((0,c.fs)()))}))(S)}}]);
2//# sourceMappingURL=components-AddSupplierPopup.5c6fe31e.chunk.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.