"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require('./../../ext-esm/tslib/tslib.es6.js'),t=require("react/jsx-runtime"),o=require("react"),n=require("react-virtualized"),i=require("@material-ui/core"),r=require("@material-ui/icons/Settings"),s=require("./CustomizeColumnsDialog.js"),u=require("./VirtualizedTable.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=l(r),a=i.makeStyles({vtTopSetting:{position:"relative",height:"25px"},vtTopSettingIcon:{position:"fixed",right:"20px",padding:"3px",fontSize:"20px"}}),c=function(r){var l=r.columns,c=void 0===l?[]:l,h=r.data,m=void 0===h?[]:h,g=r.useColumnSetting,v=void 0!==g&&g,C=r.useFixedColumnWidth,S=void 0!==C&&C,f=r.headerHeight,p=void 0===f?50:f,x=r.rowHeight,y=void 0===x?35:x,w=r.savedColumns,j=void 0===w?[]:w,T=r.onChangeColumns,_=void 0===T?null:T,H=r.customMuiStyles,R=void 0===H?{}:H,q=r.isTopSettingIconShownAlways,z=void 0!==q&&q,b=r.CustomCellRenderer,I=void 0===b?null:b,k=r.CustomHeaderCellRenderer,D=void 0===k?null:k,M=r.customRowStyle,W=void 0===M?null:M,A=r.sort,B=void 0===A?null:A,F=r.sortBy,O=void 0===F?null:F,V=r.sortDirection,E=void 0===V?null:V,N=e.__rest(r,["columns","data","useColumnSetting","useFixedColumnWidth","headerHeight","rowHeight","savedColumns","onChangeColumns","customMuiStyles","isTopSettingIconShownAlways","CustomCellRenderer","CustomHeaderCellRenderer","customRowStyle","sort","sortBy","sortDirection"]),K=a(),P=o.useState(!1),G=P[0],J=P[1],L=o.useState(!1),Q=L[0],U=L[1],X=o.useMemo((function(){var t=[];return j.forEach((function(o){var n=c.find((function(e){return e.key===o.key}));n&&t.push(e.__assign(e.__assign({},n),{show:o.show}))})),c.forEach((function(e){t.find((function(t){return t.key===e.key}))||t.push(e)})),t}),[c,j]),Y=v&&Q?25:0;return t.jsxs(t.Fragment,{children:[v&&Q&&t.jsx("div",{className:K.vtTopSetting,children:t.jsx(i.IconButton,{size:"small",className:K.vtTopSettingIcon,onClick:function(){return J(!0)},children:t.jsx(d.default,{fontSize:"inherit"})})}),t.jsx(n.AutoSizer,{children:function(o){var n=o.width,i=o.height;return t.jsx(u.VirtualizedTableComponent,e.__assign({width:n,height:i-Y,columns:X,useColumnSetting:v,onOpenSettingDlg:function(){return J(!0)},showTopSettingIcon:function(e){return U(e)},customMuiStyles:R,data:m,useFixedColumnWidth:S,headerHeight:p,rowHeight:y,isTopSettingIconShownAlways:z,CustomCellRenderer:I,CustomHeaderCellRenderer:D,customRowStyle:W,sort:B,sortBy:O,sortDirection:E},N))}}),t.jsx(s,{open:G,columns:X,handleCloseWithCancel:function(){return J(!1)},handleCloseWithOK:function(e){_&&_(e),J(!1)}})]})};exports.VTableComponent=c,exports.default=c;
