react-tablize
Advanced tools
Comparing version 0.6.0 to 0.6.1
@@ -5,2 +5,12 @@ # React Tablize - Change Log | ||
## [0.6.1 - 2019-06-06](https://github.com/alonrbar/react-tablize/tree/v0.6.1) | ||
### Changed | ||
- Upgrade to react-window@1.8.2 and remove hacks from GridView.syncScroll. | ||
### Fixed | ||
- Fix support for grid with no head. | ||
## [0.6.0 - 2019-05-28](https://github.com/alonrbar/react-tablize/tree/v0.6.0) | ||
@@ -7,0 +17,0 @@ |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("react-tablize",[],t):"object"==typeof exports?exports["react-tablize"]=t():e["react-tablize"]=t()}(this,function(){return function(n){var r={};function o(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}return o.m=n,o.c=r,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=7)}([function(e,t){e.exports=require("react")},function(e,t){e.exports=require("react-window")},function(e,t){e.exports=require("react-virtualized-auto-sizer")},function(e,t){e.exports=require("emotion-theming")},function(e,t){e.exports=require("react-dom")},function(e,t){e.exports=require("normalize-scroll-left")},function(e,t){e.exports=require("@emotion/styled")},function(e,t,n){e.exports=n(9)},function(e,t){e.exports=require("lodash.flattendeep")},function(e,t,n){"use strict";n.r(t);var o=n(3),i=n(5),p=n(0),u=n(4),r=n(2),y=n.n(r),h=n(1);function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function f(e,t){return!t||"object"!==l(t)&&"function"!=typeof t?function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var b=function(e){function n(e){var t;return d(this,n),(t=f(this,a(n).call(this,e))).state={hasError:!1},t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(n,p["Component"]),function(e,t,n){t&&c(e.prototype,t),n&&c(e,n)}(n,[{key:"componentDidCatch",value:function(e,t){this.setState({hasError:!0}),console.error(e)}},{key:"render",value:function(){return this.state.hasError?p.createElement("span",null,"X"):void 0!==this.props.children?this.props.children:null}}]),n}();function m(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var g=function(){function r(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r)}return function(e,t,n){t&&m(e.prototype,t),n&&m(e,n)}(r,null,[{key:"getProps",value:function(e){return e&&e.props||{}}},{key:"elementInstanceOf",value:function(e,t){return!!e&&(!!e.type&&(e.type===t||e.type.prototype instanceof t||t.isPrototypeOf(e.type)))}},{key:"isReactFragment",value:function(e){return p.isValidElement(e)&&e.type===p.Fragment}},{key:"addPropsToChildren",value:function(e,r){return p.Children.map(e,function(e,t){var n=r(e,t);return p.cloneElement(e,n)})}},{key:"childrenArray",value:function(e){if(!e)return null;if(!e.props)return null;var t=e.props.children;return Array.isArray(t)?t:p.Children.map(t,function(e){return e})}},{key:"childrenOfType",value:function(e,t){var n=r.childrenArray(e);return n?n.filter(function(e){return r.elementInstanceOf(e,t)}):null}},{key:"singleChildOfType",value:function(e,t){var n=r.childrenOfType(e,t);if(!n||!n.length)return null;if(1<n.length)throw new Error("Only one ".concat(t.name," child element is allowed."));return n[0]}},{key:"singleFunctionChild",value:function(e){if(!e)return null;if(!e.props)return null;var t=e.props.children;return"function"!=typeof e.props.children?null:t}}]),r}();function v(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function O(e){return null==e}function w(e){return Number.isFinite(e)?e+"px":e}function j(e,t){var n=(e=e||{}).height,r=e.minHeight,o=e.maxHeight;return void 0===n&&void 0===r&&(n=t),{height:n=w(n),minHeight:r=w(r),maxHeight:o=w(o)}}function C(e){return v(Array(e||0).keys())}function _(e){return(_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function S(e,t){return!t||"object"!==_(t)&&"function"!=typeof t?function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}function P(e){return(P=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function x(e,t){return(x=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var E=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),S(this,P(t).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&x(e,t)}(t,p["PureComponent"]),t}();function T(e){return(T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function H(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],0<=t.indexOf(n)||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],0<=t.indexOf(n)||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function k(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function R(e,t){return!t||"object"!==T(t)&&"function"!=typeof t?function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}function I(e){return(I=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function z(e,t){return(z=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function B(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var A="__ReactTablize__GridCell__"+function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:Number.MIN_SAFE_INTEGER,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:Number.MAX_SAFE_INTEGER;return Math.floor(Math.random()*(t-e+1)+e)}(0),F=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),R(this,I(t).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&z(e,t)}(t,p["PureComponent"]),function(e,t,n){t&&k(e.prototype,t),n&&k(e,n)}(t,[{key:"render",value:function(){return this.props.children}}],[{key:"extract",value:function(e){if(e&&e.props&&e.props[A]){var t=e.props,n=t.children;return{props:H(t,["children"]),content:n}}return{props:{},content:e}}}]),t}();function W(e){return(W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function M(e,t){return!t||"object"!==W(t)&&"function"!=typeof t?function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}function N(e){return(N=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function G(e,t){return(G=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}B(F,"defaultProps",B({},A,!0));var L=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),M(this,N(t).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&G(e,t)}(t,p["PureComponent"]),t}();function q(e){return(q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function V(e,t){return!t||"object"!==q(t)&&"function"!=typeof t?function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}function D(e){return(D=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function K(e,t){return(K=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var X=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),V(this,D(t).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&K(e,t)}(t,p["PureComponent"]),t}(),J=n(6),Q=n.n(J).a;function U(){var e=te(["\n label: grid-body-cell;\n\n display: flex;\n\n height: 100%;\n\n overflow: hidden;\n text-overflow: ellipsis;\n\n align-items: center;\n vertical-align: middle;\n"]);return U=function(){return e},e}function Y(){var e=te(["\n label: grid-body;\n"]);return Y=function(){return e},e}function Z(){var e=te(["\n label: grid-head-cell;\n\n display: flex;\n\n overflow: hidden;\n text-overflow: ellipsis;\n\n align-items: flex-end;\n vertical-align: bottom;\n"]);return Z=function(){return e},e}function $(){var e=te(["\n label: grid-head;\n\n display: flex;\n\n font-weight: bold;\n vertical-align: middle;\n\n ",": ","px;\n border-bottom: ",";\n"]);return $=function(){return e},e}function ee(){var e=te(["\n label: grid-view;\n\n width: 100%;\n"]);return ee=function(){return e},e}function te(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var ne=Q.div(ee()),re=Q.div($(),function(e){return"rtl"===e.theme.dir?"padding-left":"padding-right"},17,"1px solid #ddd"),oe=Q.div(Z()),ie=Q.div(Y()),ue=Q.div(U());function le(e){return(le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ce(){return(ce=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function fe(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],0<=t.indexOf(n)||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],0<=t.indexOf(n)||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function ae(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function se(e){return(se=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function pe(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ye(e,t){return(ye=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function he(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var de=function(e){function l(){var e,o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return he(pe(o=function(e,t){return!t||"object"!==le(t)&&"function"!=typeof t?pe(e):t}(this,(e=se(l)).call.apply(e,[this].concat(n)))),"headList",p.createRef()),he(pe(o),"mainBodyGrid",p.createRef()),he(pe(o),"freezedColumnsGrid",p.createRef()),he(pe(o),"syncScroll",function(){var e=u.findDOMNode(o.mainBodyGrid.current);if(e){var t=u.findDOMNode(o.headList.current);if(t)if("rtl"===o.props.dir&&e.scrollLeft<=0&&"default"===Object(i.detectScrollType)())t.scrollLeft=e.scrollLeft=1,setTimeout(function(){return e.scrollLeft=1});else{var n=t.scrollWidth/e.scrollWidth;t.scrollLeft=n*e.scrollLeft}var r=u.findDOMNode(o.freezedColumnsGrid.current);r&&(r.scrollTop=e.scrollTop)}}),he(pe(o),"getColumnWidth",function(e){return"function"==typeof o.props.columnWidth?o.props.columnWidth(e):o.props.columnWidth}),he(pe(o),"getRowHeight",function(t){return function(e){return"function"==typeof t?t(e):t}}),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ye(e,t)}(l,p["PureComponent"]),function(e,t,n){t&&ae(e.prototype,t),n&&ae(e,n)}(l,[{key:"render",value:function(){var e=this.props,t=(e.columnCount,e.columnWidth,e.children,fe(e,["columnCount","columnWidth","children"]));return p.createElement(b,null,p.createElement(o.ThemeProvider,{theme:this.getTheme()},p.createElement(ne,ce({},t,{style:Object.assign({direction:this.props.dir},this.props.style,j(t.style,l.defaultHeight))}),this.renderHead(),this.renderBody(),this.renderFooter())))}},{key:"renderHead",value:function(){var o=this,e=g.singleChildOfType(this,X);if(!e)return null;var t=e.props,i=t.children,n=fe(t,["children"]),u=this.props.freezeColumns||0;return p.createElement(re,ce({},n,{style:Object.assign({},e.props.style,j(n.style,l.defaultHeadHeight))}),p.createElement(b,null,p.createElement(y.a,null,function(e){var t=e.width,n=e.height;return p.createElement("div",{style:{width:t,height:n,display:"flex"}},C(u).map(function(e){return o.renderHeadCell({cellRender:i,columnIndex:e,isScrolling:!1})}),p.createElement(h.VariableSizeList,{ref:o.headList,direction:o.props.dir,style:{overflow:"hidden"},layout:"horizontal",height:n,width:t-o.getFrozenColumnsWidth(),itemCount:o.props.columnCount-u,itemSize:function(e){return o.getColumnWidth(e+u)},overscanCount:o.props.overscanColumnsCount,useIsScrolling:o.props.useIsScrolling},function(e){var t=e.index,n=e.style,r=e.isScrolling;return o.renderHeadCell({cellRender:i,columnIndex:t+u,isScrolling:r,style:n})}))})))}},{key:"renderHeadCell",value:function(e){var t=e.columnIndex,n=e.cellRender,r=e.isScrolling,o=e.style,i=n({columnIndex:t,isScrolling:r}),u=F.extract(i),l=u.props,c=u.content,f=this.getColumnWidth(t);return p.createElement(oe,ce({key:t},l,{style:Object.assign({width:f},l.style,o)}),p.createElement(b,null,c))}},{key:"renderBody",value:function(){var i=this,e=g.singleChildOfType(this,E);if(!e)return null;var t=e.props,u=t.children,r=t.rowCount,o=t.rowHeight,n=fe(t,["children","rowCount","rowHeight"]),l=this.getBodyHeights(),c=this.props.freezeColumns||0,f=this.getFrozenColumnsWidth();return p.createElement(ie,ce({},n,{style:Object.assign({},n.style,l)}),p.createElement(b,null,p.createElement(y.a,null,function(e){var t=e.height,n=e.width;return p.createElement("div",{style:{width:n,height:t,display:"flex"}},p.createElement(h.VariableSizeGrid,{ref:i.freezedColumnsGrid,direction:i.props.dir,style:{overflow:"hidden"},height:t-17,width:f,columnCount:c,columnWidth:i.getColumnWidth,rowCount:r,rowHeight:i.getRowHeight(o),overscanRowsCount:i.props.overscanRowsCount,useIsScrolling:i.props.useIsScrolling},function(e){var t=e.rowIndex,n=e.columnIndex,r=e.style,o=e.isScrolling;return i.renderBodyCell({cellRender:u,rowIndex:t,columnIndex:n,isScrolling:o,style:r})}),p.createElement(h.VariableSizeGrid,{ref:i.mainBodyGrid,direction:i.props.dir,height:t,width:n-f,columnCount:i.props.columnCount-c,columnWidth:function(e){return i.getColumnWidth(e+c)},rowCount:r,rowHeight:i.getRowHeight(o),onScroll:i.syncScroll,overscanRowsCount:i.props.overscanRowsCount,overscanColumnsCount:i.props.overscanColumnsCount,useIsScrolling:i.props.useIsScrolling},function(e){var t=e.rowIndex,n=e.columnIndex,r=e.style,o=e.isScrolling;return i.renderBodyCell({cellRender:u,rowIndex:t,columnIndex:n+c,isScrolling:o,style:r})}))})))}},{key:"renderBodyCell",value:function(e){var t=e.rowIndex,n=e.columnIndex,r=e.cellRender,o=e.isScrolling,i=e.style,u=r({rowIndex:t,columnIndex:n,isScrolling:o}),l=F.extract(u),c=l.props,f=l.content;return p.createElement(ue,ce({key:"[ ".concat(t,", ").concat(n," ]")},c,{style:Object.assign({},c.style,i)}),p.createElement(b,null,f))}},{key:"renderFooter",value:function(){return g.singleChildOfType(this,L)?p.createElement("span",null,"Footer"):null}},{key:"getTheme",value:function(){return{dir:this.props.dir}}},{key:"getBodyHeights",value:function(){var e,t,n=j(this.props.style,l.defaultHeight),r=this.getHeadHeight(),o=j(this.props.style,void 0),i="calc(".concat(o.height||n.height," - ").concat(r,")");return(o.minHeight||n.minHeight)&&(e="calc(".concat(o.minHeight||n.minHeight," - ").concat(r,")")),(o.maxHeight||n.maxHeight)&&(t="calc(".concat(o.maxHeight||n.maxHeight," - ").concat(r,")")),{height:i,minHeight:e,maxHeight:t}}},{key:"getHeadHeight",value:function(){var e=g.singleChildOfType(this,X),t=0;return e&&(t=j(e.props.style,l.defaultHeadHeight).height),t}},{key:"getFrozenColumnsWidth",value:function(){return this.props.freezeColumns?C(this.props.freezeColumns).map(this.getColumnWidth).reduce(function(e,t){return e+t},0):0}}]),l}();function be(e){return(be="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function me(e,t){return!t||"object"!==be(t)&&"function"!=typeof t?function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}function ge(e){return(ge=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ve(e,t){return(ve=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Oe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}he(de,"defaultHeight","35vh"),he(de,"defaultHeadHeight","40px"),he(de,"Head",X),he(de,"Body",E),he(de,"Cell",F),he(de,"defaultProps",{overscanRowsCount:1,overscanColumnsCount:1});var we=function e(){Oe(this,e),function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(this,"children",void 0)},je=function(e){function t(){return Oe(this,t),me(this,ge(t).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ve(e,t)}(t,p["PureComponent"]),t}();function Ce(e){return(Ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _e(e,t){return!t||"object"!==Ce(t)&&"function"!=typeof t?function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}function Se(e){return(Se=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Pe(e,t){return(Pe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var xe=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),_e(this,Se(t).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Pe(e,t)}(t,p["PureComponent"]),t}();function Ee(e){return(Ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Te(e,t){return!t||"object"!==Ee(t)&&"function"!=typeof t?function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}function He(e){return(He=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ke(e,t){return(ke=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Re(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Ie=function e(){Re(this,e),function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(this,"children",void 0)},ze=function(e){function t(){return Re(this,t),Te(this,He(t).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ke(e,t)}(t,p["PureComponent"]),t}();function Be(e){return(Be="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ae(e,t){return!t||"object"!==Be(t)&&"function"!=typeof t?function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}function Fe(e){return(Fe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function We(e,t){return(We=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Me=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Ae(this,Fe(t).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&We(e,t)}(t,p["PureComponent"]),t}();function Ne(e){return(Ne="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ge(e,t){return!t||"object"!==Ne(t)&&"function"!=typeof t?function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}function Le(e){return(Le=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function qe(e,t){return(qe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ve(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var De=function e(){Ve(this,e),function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(this,"children",void 0)},Ke=function(e){function t(){return Ve(this,t),Ge(this,Le(t).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&qe(e,t)}(t,p["PureComponent"]),t}();function Xe(e){return(Xe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Je(e,t){return!t||"object"!==Xe(t)&&"function"!=typeof t?function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}function Qe(e){return(Qe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ue(e,t){return(Ue=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ye(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ze(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var $e=function e(){Ye(this,e),Ze(this,"height","40px"),Ze(this,"children",void 0)},et=function(e){function t(){return Ye(this,t),Je(this,Qe(t).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ue(e,t)}(t,p["PureComponent"]),t}();function tt(e){return(tt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function nt(e,t){return!t||"object"!==tt(t)&&"function"!=typeof t?function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}function rt(e){return(rt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ot(e,t){return(ot=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var it=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),nt(this,rt(t).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ot(e,t)}(t,p["PureComponent"]),t}();function ut(){var e=yt(["\n flex: 1;\n padding: 8px;\n overflow: hidden;\n text-overflow: ellipsis;\n"]);return ut=function(){return e},e}function lt(){var e=yt(["\n flex: 1;\n display: flex;\n justify-content: stretch;\n\n border-top: ",";\n\n &:first-of-type {\n border-top: none;\n }\n"]);return lt=function(){return e},e}function ct(){var e=yt(["\n display: flex;\n flex-flow: column;\n\n vertical-align: middle;\n"]);return ct=function(){return e},e}function ft(){var e=yt(["\n flex: 1;\n display: flex;\n padding: 8px;\n overflow: hidden;\n text-overflow: ellipsis;\n align-items: flex-end;\n vertical-align: bottom;\n"]);return ft=function(){return e},e}function at(){var e=yt(["\n flex: 1;\n display: flex;\n justify-content: stretch;\n\n ",": ",";\n\n border-bottom: ",";\n"]);return at=function(){return e},e}function st(){var e=yt(["\n display: flex;\n flex-flow: column;\n\n overflow-y: hidden;\n\n font-weight: bold;\n vertical-align: middle;\n"]);return st=function(){return e},e}function pt(){var e=yt(["\n background-color: #fff;\n width: 100%;\n overflow-y: hidden;\n"]);return pt=function(){return e},e}function yt(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var ht="1px solid #ddd",dt=Q.div(pt()),bt=Q.div(st()),mt=Q.div(at(),function(e){return"rtl"===e.theme.dir?"padding-left":"padding-dir"},"17px",ht),gt=Q.div(ft()),vt=Q.div(ct()),Ot=Q.div(lt(),ht),wt=Q.div(ut());function jt(e){return(jt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ct(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],0<=t.indexOf(n)||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],0<=t.indexOf(n)||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function _t(){return(_t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function St(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Pt(e,t){return!t||"object"!==jt(t)&&"function"!=typeof t?function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}function xt(e){return(xt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Et(e,t){return(Et=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Tt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ht(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var kt=n(8),Rt=function e(){Tt(this,e),Ht(this,"rowCount",void 0),Ht(this,"rowKey",void 0),Ht(this,"children",void 0),Ht(this,"dir","ltr"),Ht(this,"className",void 0),Ht(this,"style",void 0),Ht(this,"rowHeight",50),Ht(this,"emptyMessage","No Items to Display"),Ht(this,"overscanCount",20)},It=function(e){function r(){return Tt(this,r),Pt(this,xt(r).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Et(e,t)}(r,p["PureComponent"]),function(e,t,n){t&&St(e.prototype,t),n&&St(e,n)}(r,[{key:"render",value:function(){var e=g.singleChildOfType(this,et),t=g.singleChildOfType(this,ze),n=g.childrenOfType(this,Ke);if(n&&n.length){if(e||t)throw new Error("Can not specify head and/or body when specifying table columns.");e=this.createHeadFromColumns(n),t=this.createBodyFromColumns(n)}return p.createElement(b,null,p.createElement(o.ThemeProvider,{theme:this.getTheme()},p.createElement(dt,{className:this.props.className,style:Object.assign({},this.props.style,this.getHeights())},this.renderTableHead(e),this.renderTableBody(e,t))))}},{key:"renderTableHead",value:function(e){var i=this;return e?p.createElement(bt,{style:{height:e.props.height}},p.createElement(mt,null,p.createElement(b,null,p.Children.map(e.props.children,function(e,t){var n=e,r=i.getHeadCellProps(n);if(!1===r.visible)return null;var o=i.getHeadCellContent(n);return p.createElement(gt,_t({key:t},r),p.createElement(b,null,o))})))):null}},{key:"renderTableBody",value:function(e,t){var n=this.getHeadProps(e),r=this.getHeights(),o="calc(".concat(r.height," - ").concat(n.height,")"),i="calc(".concat(r.minHeight," - ").concat(n.height,")"),u="calc(".concat(r.maxHeight," - ").concat(n.height,")");return p.createElement(vt,{style:{direction:this.props.dir,height:o,minHeight:i,maxHeight:u}},p.createElement(b,null,this.renderTableRows(t)))}},{key:"renderTableRows",value:function(a){var s=this;return 0!==this.props.rowCount&&this.hasBody(a)?p.createElement(y.a,null,function(e){var t=e.width,n=e.height;return p.createElement(h.FixedSizeList,{style:{outline:"none"},direction:s.props.dir,layout:"vertical",height:n,width:t,itemCount:s.props.rowCount,itemSize:s.props.rowHeight},function(e){var t=e.index,n=e.style,r=a.props.children;if(!r)return null;var o=r(t),i=s.getRowProps(o),u=i.style,l=Ct(i,["style"]),c=s.getRowKey(l,t),f=s.getRowContent(o);return p.createElement(Ot,_t({style:Object.assign({},n,u||{}),key:c},l),p.createElement(b,null,function(e){return Array.isArray(e)?e:[e]}(f).map(function(e,t){var n=s.getCellProps(e);return!1===n.visible?null:p.createElement(wt,_t({key:t},n),p.createElement(b,null,s.getCellContent(e)))})))})}):this.renderItemsPlaceHolder()}},{key:"renderItemsPlaceHolder",value:function(){return p.createElement("div",null,p.createElement("div",{style:{textAlign:"center"}},this.props.emptyMessage))}},{key:"getTheme",value:function(){return{dir:this.props.dir}}},{key:"getHeights",value:function(){var e=(this.props.style||{}).height,t=(this.props.style||{}).minHeight,n=(this.props.style||{}).maxHeight;return void 0===e&&void 0===t&&(e=r.defaultHeight),{height:e=w(e),minHeight:t=w(t),maxHeight:n=w(n)}}},{key:"createHeadFromColumns",value:function(e){return e.every(function(e){return!g.singleChildOfType(e,xe)})?null:p.createElement(et,null,e.map(function(e){var t=g.singleChildOfType(e,xe);return t?p.createElement(Me,t.props):null}))}},{key:"createBodyFromColumns",value:function(e){return p.createElement(ze,null,function(r){return e.map(function(e,t){var n=g.singleChildOfType(e,je).props.children;return n?n({rowIndex:r,columnIndex:t}):null})})}},{key:"getHeadProps",value:function(e){return g.elementInstanceOf(e,it)?e.props:new $e}},{key:"getHeadCellProps",value:function(e){return g.elementInstanceOf(e,Me)&&e.props||{}}},{key:"getHeadCellContent",value:function(e){return g.elementInstanceOf(e,Me)?e.props.children:e}},{key:"hasBody",value:function(e){return!!e&&(!O(e.props.children)&&("function"==typeof e.props.children||(Array.isArray(e.props.children)?0<e.props.children.length:0<p.Children.count(e.props.children))))}},{key:"getRowProps",value:function(e){return g.elementInstanceOf(e,it)&&e.props||{}}},{key:"getRowContent",value:function(e){var t=e;if(g.isReactFragment(t))throw new Error("Can not use React.Fragment as row content. Consider wrapping your content with a row element.");return g.elementInstanceOf(t,it)&&(t=t.props.children),Array.isArray(t)&&(t=kt(t)),t}},{key:"getRowKey",value:function(e,t){return O(e.key)?"function"==typeof this.props.rowKey?this.props.rowKey(t):t:e.key}},{key:"getCellProps",value:function(e){return g.elementInstanceOf(e,Me)&&e.props||{}}},{key:"getCellContent",value:function(e){var t=e;return g.elementInstanceOf(t,Me)&&(t=t.props.children),t||null}}]),r}();Ht(It,"defaultHeight","35vh"),Ht(It,"Head",et),Ht(It,"Body",ze),Ht(It,"Row",it),Ht(It,"Cell",Me),Ht(It,"Column",Ke),Ht(It,"defaultProps",new Rt),n.d(t,"GridView",function(){return de}),n.d(t,"ColumnBodyProps",function(){return we}),n.d(t,"ColumnBody",function(){return je}),n.d(t,"ColumnHead",function(){return xe}),n.d(t,"TableBodyProps",function(){return Ie}),n.d(t,"TableBody",function(){return ze}),n.d(t,"TableCell",function(){return Me}),n.d(t,"TableColumnProps",function(){return De}),n.d(t,"TableColumn",function(){return Ke}),n.d(t,"TableHeadProps",function(){return $e}),n.d(t,"TableHead",function(){return et}),n.d(t,"TableRow",function(){return it}),n.d(t,"TableViewProps",function(){return Rt}),n.d(t,"TableView",function(){return It})}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("react-tablize",[],t):"object"==typeof exports?exports["react-tablize"]=t():e["react-tablize"]=t()}(this,function(){return function(n){var r={};function o(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}return o.m=n,o.c=r,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=5)}([function(e,t){e.exports=require("react")},function(e,t){e.exports=require("react-window")},function(e,t){e.exports=require("react-virtualized-auto-sizer")},function(e,t){e.exports=require("emotion-theming")},function(e,t){e.exports=require("@emotion/styled")},function(e,t,n){e.exports=n(7)},function(e,t){e.exports=require("lodash.flattendeep")},function(e,t,n){"use strict";n.r(t);var o=n(3),p=n(0),r=n(2),y=n.n(r),h=n(1);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var d=function(e){function n(e){var t;return a(this,n),(t=l(this,c(n).call(this,e))).state={hasError:!1},t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}(n,p["Component"]),function(e,t,n){t&&u(e.prototype,t),n&&u(e,n)}(n,[{key:"componentDidCatch",value:function(e,t){this.setState({hasError:!0}),console.error(e)}},{key:"render",value:function(){return this.state.hasError?p.createElement("span",null,"X"):void 0!==this.props.children?this.props.children:null}}]),n}();function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var b=function(){function r(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r)}return function(e,t,n){t&&s(e.prototype,t),n&&s(e,n)}(r,null,[{key:"getProps",value:function(e){return e&&e.props||{}}},{key:"elementInstanceOf",value:function(e,t){return!!e&&(!!e.type&&(e.type===t||e.type.prototype instanceof t||t.isPrototypeOf(e.type)))}},{key:"isReactFragment",value:function(e){return p.isValidElement(e)&&e.type===p.Fragment}},{key:"addPropsToChildren",value:function(e,r){return p.Children.map(e,function(e,t){var n=r(e,t);return p.cloneElement(e,n)})}},{key:"childrenArray",value:function(e){if(!e)return null;if(!e.props)return null;var t=e.props.children;return Array.isArray(t)?t:p.Children.map(t,function(e){return e})}},{key:"childrenOfType",value:function(e,t){var n=r.childrenArray(e);return n?n.filter(function(e){return r.elementInstanceOf(e,t)}):null}},{key:"singleChildOfType",value:function(e,t){var n=r.childrenOfType(e,t);if(!n||!n.length)return null;if(1<n.length)throw new Error("Only one ".concat(t.name," child element is allowed."));return n[0]}},{key:"singleFunctionChild",value:function(e){if(!e)return null;if(!e.props)return null;var t=e.props.children;return"function"!=typeof e.props.children?null:t}}]),r}();function m(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function g(e){return null==e}function v(e){return Number.isFinite(e)?e+"px":e}function w(e,t){var n=(e=e||{}).height,r=e.minHeight,o=e.maxHeight;return void 0===n&&void 0===r&&(n=t),{height:n=v(n),minHeight:r=v(r),maxHeight:o=v(o)}}function O(e){return m(Array(e||0).keys())}function j(e){return(j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function C(e,t){return!t||"object"!==j(t)&&"function"!=typeof t?function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}function _(e){return(_=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function S(e,t){return(S=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var P=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),C(this,_(t).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&S(e,t)}(t,p["PureComponent"]),t}();function E(e){return(E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function x(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],0<=t.indexOf(n)||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],0<=t.indexOf(n)||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function T(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function H(e,t){return!t||"object"!==E(t)&&"function"!=typeof t?function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}function k(e){return(k=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function R(e,t){return(R=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function I(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var z="__ReactTablize__GridCell__"+function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:Number.MIN_SAFE_INTEGER,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:Number.MAX_SAFE_INTEGER;return Math.floor(Math.random()*(t-e+1)+e)}(0),A=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),H(this,k(t).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&R(e,t)}(t,p["PureComponent"]),function(e,t,n){t&&T(e.prototype,t),n&&T(e,n)}(t,[{key:"render",value:function(){return this.props.children}}],[{key:"extract",value:function(e){if(e&&e.props&&e.props[z]){var t=e.props,n=t.children;return{props:x(t,["children"]),content:n}}return{props:{},content:e}}}]),t}();function B(e){return(B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function F(e,t){return!t||"object"!==B(t)&&"function"!=typeof t?function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}function W(e){return(W=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function G(e,t){return(G=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}I(A,"defaultProps",I({},z,!0));var M=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),F(this,W(t).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&G(e,t)}(t,p["PureComponent"]),t}();function N(e){return(N="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function L(e,t){return!t||"object"!==N(t)&&"function"!=typeof t?function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}function V(e){return(V=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function q(e,t){return(q=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var K=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),L(this,V(t).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&q(e,t)}(t,p["PureComponent"]),t}(),D=n(4),X=n.n(D).a;function J(){var e=$(["\n label: grid-body-cell;\n\n display: flex;\n\n height: 100%;\n\n overflow: hidden;\n text-overflow: ellipsis;\n\n align-items: center;\n vertical-align: middle;\n"]);return J=function(){return e},e}function Q(){var e=$(["\n label: grid-body;\n"]);return Q=function(){return e},e}function U(){var e=$(["\n label: grid-head-cell;\n\n display: flex;\n\n overflow: hidden;\n text-overflow: ellipsis;\n\n align-items: flex-end;\n vertical-align: bottom;\n"]);return U=function(){return e},e}function Y(){var e=$(["\n label: grid-head;\n\n display: flex;\n\n font-weight: bold;\n vertical-align: middle;\n\n ",": ","px;\n border-bottom: ",";\n"]);return Y=function(){return e},e}function Z(){var e=$(["\n label: grid-view;\n\n width: 100%;\n"]);return Z=function(){return e},e}function $(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var ee=X.div(Z()),te=X.div(Y(),function(e){return"rtl"===e.theme.dir?"padding-left":"padding-right"},17,"1px solid #ddd"),ne=X.div(U()),re=X.div(Q()),oe=X.div(J());function ie(e){return(ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ue(){return(ue=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function le(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],0<=t.indexOf(n)||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],0<=t.indexOf(n)||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function ce(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function fe(e){return(fe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ae(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function se(e,t){return(se=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function pe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ye=function(e){function l(){var e,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return pe(ae(r=function(e,t){return!t||"object"!==ie(t)&&"function"!=typeof t?ae(e):t}(this,(e=fe(l)).call.apply(e,[this].concat(n)))),"headList",p.createRef()),pe(ae(r),"mainBodyGrid",p.createRef()),pe(ae(r),"freezedColumnsGrid",p.createRef()),pe(ae(r),"syncScroll",function(e){var t=e.scrollTop,n=e.scrollLeft;r.headList.current&&r.headList.current.scrollTo(n),r.freezedColumnsGrid.current&&r.freezedColumnsGrid.current.scrollTo({scrollTop:t})}),pe(ae(r),"getColumnWidth",function(e){return"function"==typeof r.props.columnWidth?r.props.columnWidth(e):r.props.columnWidth}),pe(ae(r),"getRowHeight",function(t){return function(e){return"function"==typeof t?t(e):t}}),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&se(e,t)}(l,p["PureComponent"]),function(e,t,n){t&&ce(e.prototype,t),n&&ce(e,n)}(l,[{key:"render",value:function(){var e=this.props,t=(e.columnCount,e.columnWidth,e.children,le(e,["columnCount","columnWidth","children"]));return p.createElement(d,null,p.createElement(o.ThemeProvider,{theme:this.getTheme()},p.createElement(ee,ue({},t,{style:Object.assign({direction:this.props.dir},this.props.style,w(t.style,l.defaultHeight))}),this.renderHead(),this.renderBody(),this.renderFooter())))}},{key:"renderHead",value:function(){var o=this,e=b.singleChildOfType(this,K);if(!e)return null;var t=e.props,i=t.children,n=le(t,["children"]),u=this.props.freezeColumns||0;return p.createElement(te,ue({},n,{style:Object.assign({},e.props.style,w(n.style,l.defaultHeadHeight))}),p.createElement(d,null,p.createElement(y.a,null,function(e){var t=e.width,n=e.height;return p.createElement("div",{style:{width:t,height:n,display:"flex"}},O(u).map(function(e){return o.renderHeadCell({cellRender:i,columnIndex:e,isScrolling:!1})}),p.createElement(h.VariableSizeList,{ref:o.headList,direction:o.props.dir,style:{overflow:"hidden"},layout:"horizontal",height:n,width:t-o.getFrozenColumnsWidth(),itemCount:o.props.columnCount-u,itemSize:function(e){return o.getColumnWidth(e+u)},overscanCount:o.props.overscanColumnsCount,useIsScrolling:o.props.useIsScrolling},function(e){var t=e.index,n=e.style,r=e.isScrolling;return o.renderHeadCell({cellRender:i,columnIndex:t+u,isScrolling:r,style:n})}))})))}},{key:"renderHeadCell",value:function(e){var t=e.columnIndex,n=e.cellRender,r=e.isScrolling,o=e.style,i=n({columnIndex:t,isScrolling:r}),u=A.extract(i),l=u.props,c=u.content,f=this.getColumnWidth(t);return p.createElement(ne,ue({key:t},l,{style:Object.assign({width:f},l.style,o)}),p.createElement(d,null,c))}},{key:"renderBody",value:function(){var i=this,e=b.singleChildOfType(this,P);if(!e)return null;var t=e.props,u=t.children,r=t.rowCount,o=t.rowHeight,n=le(t,["children","rowCount","rowHeight"]),l=this.getBodyHeights(),c=this.props.freezeColumns||0,f=this.getFrozenColumnsWidth();return p.createElement(re,ue({},n,{style:Object.assign({},n.style,l)}),p.createElement(d,null,p.createElement(y.a,null,function(e){var t=e.height,n=e.width;return p.createElement("div",{style:{width:n,height:t,display:"flex"}},p.createElement(h.VariableSizeGrid,{ref:i.freezedColumnsGrid,direction:i.props.dir,style:{overflow:"hidden"},height:t-17,width:f,columnCount:c,columnWidth:i.getColumnWidth,rowCount:r,rowHeight:i.getRowHeight(o),overscanRowsCount:i.props.overscanRowsCount,useIsScrolling:i.props.useIsScrolling},function(e){var t=e.rowIndex,n=e.columnIndex,r=e.style,o=e.isScrolling;return i.renderBodyCell({cellRender:u,rowIndex:t,columnIndex:n,isScrolling:o,style:r})}),p.createElement(h.VariableSizeGrid,{ref:i.mainBodyGrid,direction:i.props.dir,height:t,width:n-f,columnCount:i.props.columnCount-c,columnWidth:function(e){return i.getColumnWidth(e+c)},rowCount:r,rowHeight:i.getRowHeight(o),onScroll:i.syncScroll,overscanRowsCount:i.props.overscanRowsCount,overscanColumnsCount:i.props.overscanColumnsCount,useIsScrolling:i.props.useIsScrolling},function(e){var t=e.rowIndex,n=e.columnIndex,r=e.style,o=e.isScrolling;return i.renderBodyCell({cellRender:u,rowIndex:t,columnIndex:n+c,isScrolling:o,style:r})}))})))}},{key:"renderBodyCell",value:function(e){var t=e.rowIndex,n=e.columnIndex,r=e.cellRender,o=e.isScrolling,i=e.style,u=r({rowIndex:t,columnIndex:n,isScrolling:o}),l=A.extract(u),c=l.props,f=l.content;return p.createElement(oe,ue({key:"[ ".concat(t,", ").concat(n," ]")},c,{style:Object.assign({},c.style,i)}),p.createElement(d,null,f))}},{key:"renderFooter",value:function(){return b.singleChildOfType(this,M)?p.createElement("span",null,"Footer"):null}},{key:"getTheme",value:function(){return{dir:this.props.dir}}},{key:"getBodyHeights",value:function(){var e=w(this.props.style,l.defaultHeight),t=this.getHeadHeight(),n=w(this.props.style,void 0),r=n.height||e.height,o=n.minHeight||e.minHeight,i=n.maxHeight||e.maxHeight;return t&&(r="calc(".concat(r," - ").concat(t,")"),o&&(o="calc(".concat(o," - ").concat(t,")")),i&&(i="calc(".concat(i," - ").concat(t,")"))),{height:r,minHeight:o,maxHeight:i}}},{key:"getHeadHeight",value:function(){var e=b.singleChildOfType(this,K),t=0;return e&&(t=w(e.props.style,l.defaultHeadHeight).height),t}},{key:"getFrozenColumnsWidth",value:function(){return this.props.freezeColumns?O(this.props.freezeColumns).map(this.getColumnWidth).reduce(function(e,t){return e+t},0):0}}]),l}();function he(e){return(he="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function de(e,t){return!t||"object"!==he(t)&&"function"!=typeof t?function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}function be(e){return(be=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function me(e,t){return(me=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ge(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}pe(ye,"defaultHeight","35vh"),pe(ye,"defaultHeadHeight","40px"),pe(ye,"Head",K),pe(ye,"Body",P),pe(ye,"Cell",A),pe(ye,"defaultProps",{overscanRowsCount:1,overscanColumnsCount:1});var ve=function e(){ge(this,e),function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(this,"children",void 0)},we=function(e){function t(){return ge(this,t),de(this,be(t).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&me(e,t)}(t,p["PureComponent"]),t}();function Oe(e){return(Oe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function je(e,t){return!t||"object"!==Oe(t)&&"function"!=typeof t?function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}function Ce(e){return(Ce=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _e(e,t){return(_e=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Se=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),je(this,Ce(t).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_e(e,t)}(t,p["PureComponent"]),t}();function Pe(e){return(Pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ee(e,t){return!t||"object"!==Pe(t)&&"function"!=typeof t?function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}function xe(e){return(xe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Te(e,t){return(Te=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function He(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var ke=function e(){He(this,e),function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(this,"children",void 0)},Re=function(e){function t(){return He(this,t),Ee(this,xe(t).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Te(e,t)}(t,p["PureComponent"]),t}();function Ie(e){return(Ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ze(e,t){return!t||"object"!==Ie(t)&&"function"!=typeof t?function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}function Ae(e){return(Ae=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Be(e,t){return(Be=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Fe=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ze(this,Ae(t).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Be(e,t)}(t,p["PureComponent"]),t}();function We(e){return(We="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ge(e,t){return!t||"object"!==We(t)&&"function"!=typeof t?function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}function Me(e){return(Me=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ne(e,t){return(Ne=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Le(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Ve=function e(){Le(this,e),function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(this,"children",void 0)},qe=function(e){function t(){return Le(this,t),Ge(this,Me(t).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ne(e,t)}(t,p["PureComponent"]),t}();function Ke(e){return(Ke="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function De(e,t){return!t||"object"!==Ke(t)&&"function"!=typeof t?function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}function Xe(e){return(Xe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Je(e,t){return(Je=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Qe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ue(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ye=function e(){Qe(this,e),Ue(this,"height","40px"),Ue(this,"children",void 0)},Ze=function(e){function t(){return Qe(this,t),De(this,Xe(t).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Je(e,t)}(t,p["PureComponent"]),t}();function $e(e){return($e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function et(e,t){return!t||"object"!==$e(t)&&"function"!=typeof t?function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}function tt(e){return(tt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function nt(e,t){return(nt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var rt=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),et(this,tt(t).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&nt(e,t)}(t,p["PureComponent"]),t}();function ot(){var e=st(["\n flex: 1;\n padding: 8px;\n overflow: hidden;\n text-overflow: ellipsis;\n"]);return ot=function(){return e},e}function it(){var e=st(["\n flex: 1;\n display: flex;\n justify-content: stretch;\n\n border-top: ",";\n\n &:first-of-type {\n border-top: none;\n }\n"]);return it=function(){return e},e}function ut(){var e=st(["\n display: flex;\n flex-flow: column;\n\n vertical-align: middle;\n"]);return ut=function(){return e},e}function lt(){var e=st(["\n flex: 1;\n display: flex;\n padding: 8px;\n overflow: hidden;\n text-overflow: ellipsis;\n align-items: flex-end;\n vertical-align: bottom;\n"]);return lt=function(){return e},e}function ct(){var e=st(["\n flex: 1;\n display: flex;\n justify-content: stretch;\n\n ",": ",";\n\n border-bottom: ",";\n"]);return ct=function(){return e},e}function ft(){var e=st(["\n display: flex;\n flex-flow: column;\n\n overflow-y: hidden;\n\n font-weight: bold;\n vertical-align: middle;\n"]);return ft=function(){return e},e}function at(){var e=st(["\n background-color: #fff;\n width: 100%;\n overflow-y: hidden;\n"]);return at=function(){return e},e}function st(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var pt="1px solid #ddd",yt=X.div(at()),ht=X.div(ft()),dt=X.div(ct(),function(e){return"rtl"===e.theme.dir?"padding-left":"padding-dir"},"17px",pt),bt=X.div(lt()),mt=X.div(ut()),gt=X.div(it(),pt),vt=X.div(ot());function wt(e){return(wt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ot(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],0<=t.indexOf(n)||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],0<=t.indexOf(n)||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function jt(){return(jt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Ct(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _t(e,t){return!t||"object"!==wt(t)&&"function"!=typeof t?function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}function St(e){return(St=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Pt(e,t){return(Pt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Et(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Tt=n(6),Ht=function e(){Et(this,e),xt(this,"rowCount",void 0),xt(this,"rowKey",void 0),xt(this,"children",void 0),xt(this,"dir","ltr"),xt(this,"className",void 0),xt(this,"style",void 0),xt(this,"rowHeight",50),xt(this,"emptyMessage","No Items to Display"),xt(this,"overscanCount",20)},kt=function(e){function r(){return Et(this,r),_t(this,St(r).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Pt(e,t)}(r,p["PureComponent"]),function(e,t,n){t&&Ct(e.prototype,t),n&&Ct(e,n)}(r,[{key:"render",value:function(){var e=b.singleChildOfType(this,Ze),t=b.singleChildOfType(this,Re),n=b.childrenOfType(this,qe);if(n&&n.length){if(e||t)throw new Error("Can not specify head and/or body when specifying table columns.");e=this.createHeadFromColumns(n),t=this.createBodyFromColumns(n)}return p.createElement(d,null,p.createElement(o.ThemeProvider,{theme:this.getTheme()},p.createElement(yt,{className:this.props.className,style:Object.assign({},this.props.style,this.getHeights())},this.renderTableHead(e),this.renderTableBody(e,t))))}},{key:"renderTableHead",value:function(e){var i=this;return e?p.createElement(ht,{style:{height:e.props.height}},p.createElement(dt,null,p.createElement(d,null,p.Children.map(e.props.children,function(e,t){var n=e,r=i.getHeadCellProps(n);if(!1===r.visible)return null;var o=i.getHeadCellContent(n);return p.createElement(bt,jt({key:t},r),p.createElement(d,null,o))})))):null}},{key:"renderTableBody",value:function(e,t){var n=this.getHeadProps(e),r=this.getHeights(),o="calc(".concat(r.height," - ").concat(n.height,")"),i="calc(".concat(r.minHeight," - ").concat(n.height,")"),u="calc(".concat(r.maxHeight," - ").concat(n.height,")");return p.createElement(mt,{style:{direction:this.props.dir,height:o,minHeight:i,maxHeight:u}},p.createElement(d,null,this.renderTableRows(t)))}},{key:"renderTableRows",value:function(a){var s=this;return 0!==this.props.rowCount&&this.hasBody(a)?p.createElement(y.a,null,function(e){var t=e.width,n=e.height;return p.createElement(h.FixedSizeList,{style:{outline:"none"},direction:s.props.dir,layout:"vertical",height:n,width:t,itemCount:s.props.rowCount,itemSize:s.props.rowHeight},function(e){var t=e.index,n=e.style,r=a.props.children;if(!r)return null;var o=r(t),i=s.getRowProps(o),u=i.style,l=Ot(i,["style"]),c=s.getRowKey(l,t),f=s.getRowContent(o);return p.createElement(gt,jt({style:Object.assign({},n,u||{}),key:c},l),p.createElement(d,null,function(e){return Array.isArray(e)?e:[e]}(f).map(function(e,t){var n=s.getCellProps(e);return!1===n.visible?null:p.createElement(vt,jt({key:t},n),p.createElement(d,null,s.getCellContent(e)))})))})}):this.renderItemsPlaceHolder()}},{key:"renderItemsPlaceHolder",value:function(){return p.createElement("div",null,p.createElement("div",{style:{textAlign:"center"}},this.props.emptyMessage))}},{key:"getTheme",value:function(){return{dir:this.props.dir}}},{key:"getHeights",value:function(){var e=(this.props.style||{}).height,t=(this.props.style||{}).minHeight,n=(this.props.style||{}).maxHeight;return void 0===e&&void 0===t&&(e=r.defaultHeight),{height:e=v(e),minHeight:t=v(t),maxHeight:n=v(n)}}},{key:"createHeadFromColumns",value:function(e){return e.every(function(e){return!b.singleChildOfType(e,Se)})?null:p.createElement(Ze,null,e.map(function(e){var t=b.singleChildOfType(e,Se);return t?p.createElement(Fe,t.props):null}))}},{key:"createBodyFromColumns",value:function(e){return p.createElement(Re,null,function(r){return e.map(function(e,t){var n=b.singleChildOfType(e,we).props.children;return n?n({rowIndex:r,columnIndex:t}):null})})}},{key:"getHeadProps",value:function(e){return b.elementInstanceOf(e,rt)?e.props:new Ye}},{key:"getHeadCellProps",value:function(e){return b.elementInstanceOf(e,Fe)&&e.props||{}}},{key:"getHeadCellContent",value:function(e){return b.elementInstanceOf(e,Fe)?e.props.children:e}},{key:"hasBody",value:function(e){return!!e&&(!g(e.props.children)&&("function"==typeof e.props.children||(Array.isArray(e.props.children)?0<e.props.children.length:0<p.Children.count(e.props.children))))}},{key:"getRowProps",value:function(e){return b.elementInstanceOf(e,rt)&&e.props||{}}},{key:"getRowContent",value:function(e){var t=e;if(b.isReactFragment(t))throw new Error("Can not use React.Fragment as row content. Consider wrapping your content with a row element.");return b.elementInstanceOf(t,rt)&&(t=t.props.children),Array.isArray(t)&&(t=Tt(t)),t}},{key:"getRowKey",value:function(e,t){return g(e.key)?"function"==typeof this.props.rowKey?this.props.rowKey(t):t:e.key}},{key:"getCellProps",value:function(e){return b.elementInstanceOf(e,Fe)&&e.props||{}}},{key:"getCellContent",value:function(e){var t=e;return b.elementInstanceOf(t,Fe)&&(t=t.props.children),t||null}}]),r}();xt(kt,"defaultHeight","35vh"),xt(kt,"Head",Ze),xt(kt,"Body",Re),xt(kt,"Row",rt),xt(kt,"Cell",Fe),xt(kt,"Column",qe),xt(kt,"defaultProps",new Ht),n.d(t,"GridView",function(){return ye}),n.d(t,"ColumnBodyProps",function(){return ve}),n.d(t,"ColumnBody",function(){return we}),n.d(t,"ColumnHead",function(){return Se}),n.d(t,"TableBodyProps",function(){return ke}),n.d(t,"TableBody",function(){return Re}),n.d(t,"TableCell",function(){return Fe}),n.d(t,"TableColumnProps",function(){return Ve}),n.d(t,"TableColumn",function(){return qe}),n.d(t,"TableHeadProps",function(){return Ye}),n.d(t,"TableHead",function(){return Ze}),n.d(t,"TableRow",function(){return rt}),n.d(t,"TableViewProps",function(){return Ht}),n.d(t,"TableView",function(){return kt})}])}); |
{ | ||
"name": "react-tablize", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"description": "Virtual table and grid components for React", | ||
@@ -24,5 +24,6 @@ "author": "Alon Bar", | ||
"dev": "webpack --config webpack.dev.js --watch", | ||
"typecheck": "cd src && tsc --watch && cd..", | ||
"lint": "eslint \"./{src,test}/**/!(*.d).ts\"", | ||
"release": "yarn lint && webpack --config webpack.dev.js && webpack --config webpack.release.js" | ||
"typecheck": "cd src && tsc --noEmit && cd..", | ||
"typecheck:watch": "cd src && tsc --noEmit --watch && cd..", | ||
"lint": "eslint \"./{src,test}/**/!(*.d).{js,jsx,ts,tsx}\"", | ||
"release": "yarn lint && yarn typecheck && webpack --config webpack.dev.js && webpack --config webpack.release.js" | ||
}, | ||
@@ -32,8 +33,6 @@ "dependencies": { | ||
"lodash.flattendeep": "^4.4.0", | ||
"normalize-scroll-left": "^0.1.2", | ||
"react": "^16.8.6", | ||
"react-dom": "^16.8.6", | ||
"react-scroll-sync": "0.7.0", | ||
"react-virtualized-auto-sizer": "^1.0.2", | ||
"react-window": "^1.8.1" | ||
"react-window": "^1.8.2" | ||
}, | ||
@@ -40,0 +39,0 @@ "devDependencies": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6
259719
2703
- Removednormalize-scroll-left@^0.1.2
- Removedreact-scroll-sync@0.7.0
- Removednormalize-scroll-left@0.1.2(transitive)
- Removedreact-scroll-sync@0.7.0(transitive)
Updatedreact-window@^1.8.2