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