Module 665985

938 characters · in 8bc28a2da3944aab.js
Dependencies
Required by (1)
Lazily required by (0)none
Lazily requires (0)none
Source Raw
function(e,t,n){n.d(t,{A:()=>u});var i=n(627968),s=n(64700),l=n(311907),r=n(397927),a=n(781763),o=n(65204),d=n(985018);class h extends s.Component{static defaultProps={includeMaster:!1};componentDidMount(){let{applicationId:e,branches:t,onHasBranchesChange:n}=this.props;(0,a.w)(e),n?.(t.length>0)}componentDidUpdate(e){let{onHasBranchesChange:t,branches:n}=this.props,i=n.length>0;null!=t&&i!==e.branches.length>0&&t(i)}handleChange=e=>{this.props.onChange(e)};render(){let{branches:e,selectedBranchId:t,applicationId:n,includeMaster:s,hide:l,label:a}=this.props;if(0===e.length||l)return null;let o=s?e:e.filter(e=>e.id!==n);return(0,i.jsx)(r.l6P,{label:a,options:o.map(e=>({id:e.id,label:e.getName(n),value:e.id})),placeholder:d.intl.string(d.t.Sw7pHF),value:t,onSelectionChange:this.handleChange,selectionMode:"single",fullWidth:!0})}}let u=l.Ay.connectStores([o.A],e=>{let{applicationId:t}=e;return{branches:o.A.getBranches(t)}})(h)}