????
Current Path : C:/inetpub/vhost/xaydung.gdtsolutions.vn/build/static/js/ |
Current File : C:/inetpub/vhost/xaydung.gdtsolutions.vn/build/static/js/1843.a469bf3d.chunk.js |
"use strict";(self.webpackChunk_qlxd_frontend=self.webpackChunk_qlxd_frontend||[]).push([[1843],{37683:(e,t,s)=>{s.d(t,{A:()=>n});var o=s(82210),r=s(89082),i=s(6058);class l extends o.Component{render(){const{children:e,style:t,...s}=this.props;return(0,i.jsx)(r.Ay,{style:t,...s,children:e})}}l.defaultProps={};const n=l},71843:(e,t,s)=>{s.r(t),s.d(t,{MTableToolbar:()=>j,default:()=>v,styles:()=>y});var o=s(54163),r=s(90933),i=s(88323),l=s.n(i),n=s(82210),c=s(74533),a=s(49454),p=s(97887),h=s(37683),d=s(86953),u=s(6058);const x=(0,d.A)({root:{"& label.Mui-focused":{color:"white"},"& .MuiInput-underline:after":{borderBottomColor:"white"},"& .MuiOutlinedInput-root":{"& fieldset":{borderColor:"white"},"&:hover fieldset":{borderColor:"white"},"&.Mui-focused fieldset":{borderColor:"white"}}}})(a.A);class m extends n.Component{constructor(e){super(e),this.state={textSearch:""}}render(){const e={...this.props.defaultLocalization,...this.props.localization},{search:t,searchText:s,searchFieldAlignment:o,showTitle:r,classes:i,onSearchChanged:l,icons:n,searchFieldStyle:a}=this.props;return t&&(0,u.jsx)(x,{className:"left"===o&&!1===r?null:i.searchField,value:this.state.textSearch,onChange:e=>this.setState({textSearch:e.target.value}),onKeyPress:e=>13===e.charCode&&l(this.state.textSearch),placeholder:e.searchPlaceholder,color:"primary",InputProps:{startAdornment:(0,u.jsx)(c.A,{position:"start",children:(0,u.jsx)(h.A,{title:e.searchTooltip,children:(0,u.jsx)(n.Search,{color:"inherit",fontSize:"small"})})}),endAdornment:(0,u.jsx)(c.A,{position:"end",children:(0,u.jsx)(p.A,{style:{color:"white"},disabled:!s,onClick:()=>{l(""),this.setState({textSearch:""})},children:(0,u.jsx)(n.ResetSearch,{color:"inherit",fontSize:"small"})})}),style:a}})}}m.defaultProps={};const A=m;var f=s(15517),g=s(27894),w=s(40731),C=s(84278);const S=(0,f.Ay)(o.A)` min-height: 40px !important; background-color: #006fca; @media (max-width: 400px) { display: grid !important; } `;class j extends n.Component{constructor(e){super(e),this.defaultExportCsv=()=>{},this.exportCsv=()=>{this.props.exportCsv?this.props.exportCsv(this.props.columns,this.props.data):this.defaultExportCsv(),this.setState({exportButtonAnchorEl:null})},this.state={columnsButtonAnchorEl:null,exportButtonAnchorEl:null}}renderDefaultActions(){const e={...j.defaultProps.localization,...this.props.localization};return(0,u.jsxs)("div",{children:[this.props.columnsButton&&(0,u.jsx)(u.Fragment,{}),this.props.exportButton&&(0,u.jsx)(h.A,{title:e.exportTitle,children:(0,u.jsx)(p.A,{style:{color:"black",backgroundColor:"aliceblue"},onClick:e=>this.setState({exportButtonAnchorEl:e.currentTarget},(()=>this.exportCsv())),"aria-label":e.exportAriaLabel,children:(0,u.jsx)(this.props.icons.Export,{})})}),(0,u.jsx)(this.props.components.Actions,{actions:this.props.actions&&this.props.actions.filter((e=>e.isFreeAction)),components:this.props.components})]})}renderSelectedActions(){return(0,u.jsx)(this.props.components.Actions,{actions:this.props.actions.filter((e=>!e.isFreeAction)),data:this.props.selectedRows,components:this.props.components})}renderActions(){const{classes:e}=this.props;return(0,u.jsx)("div",{className:e.actions,children:this.props.selectedRows&&this.props.selectedRows.length>0?this.renderSelectedActions():this.renderDefaultActions()})}renderActionsFree(){const{classes:e}=this.props;return(0,u.jsx)("div",{className:e.actions+" d-flex justify-content-start",row:!0,children:this.props.actionsFree.map((e=>(0,u.jsx)(w.A,{style:e.style,children:e.render?e.render():(0,u.jsxs)(g.$n,{color:e.color,onClick:e.onClick,children:[(0,u.jsx)(C.Z,{style:{marginRight:"0.5rem"},fa:e.icon}),e.name]})})))})}render(){const{classes:e}=this.props,t={...j.defaultProps.localization,...this.props.localization},s=this.props.showTextRowsSelected&&this.props.selectedRows&&this.props.selectedRows.length>0?t.nRowsSelected.replace("{0}",this.props.selectedRows.length):this.props.showTitle?this.props.title:null;return(0,u.jsxs)(S,{variant:"dense",className:l()(e.root,{[e.highlight]:this.props.showTextRowsSelected&&this.props.selectedRows&&this.props.selectedRows.length>0}),children:[s&&(0,u.jsx)("div",{className:e.title,children:(0,u.jsx)("h6",{style:{fontSize:16,fontWeight:"bold",color:"white",marginBottom:0},children:s})}),(0,u.jsx)("div",{className:e.spacer}),this.props.actionsFree&&0!==this.props.actionsFree.length&&this.renderActionsFree(this.props),this.props.children,"right"===this.props.searchFieldAlignment&&(this.props.SearchAdvanced?this.props.SearchAdvanced(this.props):(0,u.jsx)(A,{...this.props,defaultLocalization:j.defaultProps.localization})),"right"===this.props.toolbarButtonAlignment&&this.renderActions()]})}}j.defaultProps={actions:[],columns:[],columnsButton:!1,localization:{addRemoveColumns:"Add or remove columns",nRowsSelected:"{0} row(s) selected",showColumnsTitle:"Show Columns",showColumnsAriaLabel:"Show Columns",exportTitle:"Export",exportAriaLabel:"Export",exportName:"Export as CSV",searchTooltip:"Search",searchPlaceholder:"Search"},search:!0,showTitle:!0,showTextRowsSelected:!0,toolbarButtonAlignment:"right",searchFieldAlignment:"right",searchText:"",selectedRows:[],title:"No Title!"};const y=e=>({highlight:"light"===e.palette.type?{color:e.palette.secondary.main,backgroundColor:e.palette.secondary.main}:{color:e.palette.text.primary,backgroundColor:e.palette.secondary.dark},spacer:{flex:"1 1 10%"},actions:{color:e.palette.text.secondary},title:{flex:"0 0 auto"}}),v=(0,r.A)(y)(j)},84278:(e,t,s)=>{s.d(t,{Z:()=>o.A});var o=s(5774)},97887:(e,t,s)=>{s.d(t,{A:()=>n});var o=s(82210),r=s(75331),i=s(6058);class l extends o.Component{render(){const{children:e,style:t,...s}=this.props;return(0,i.jsx)(r.A,{...s,style:{...t,padding:4,margin:2},children:e})}}l.defaultProps={size:"small"};const n=l}}]); //# sourceMappingURL=1843.a469bf3d.chunk.js.map