react-tablize
Advanced tools
Comparing version 0.4.0 to 0.5.0
@@ -5,2 +5,15 @@ # React Tablize - Change Log | ||
## [0.5.0 - 2019-05-15](https://github.com/alonrbar/react-tablize/tree/v0.5.0) | ||
### Added | ||
- Grid overscan items props. | ||
- Grid 'isScrolling' property. | ||
### Fixed | ||
- Fix support for multiple frozen columns. | ||
- Fix body height calculation. | ||
- Improve RTL scrolling. | ||
## [0.4.0 - 2019-05-12](https://github.com/alonrbar/react-tablize/tree/v0.4.0) | ||
@@ -7,0 +20,0 @@ |
@@ -130,2 +130,3 @@ import * as React from 'react'; | ||
columnIndex: number; | ||
isScrolling?: boolean; | ||
} | ||
@@ -148,2 +149,3 @@ | ||
columnIndex: number; | ||
isScrolling?: boolean; | ||
} | ||
@@ -198,2 +200,29 @@ | ||
/** | ||
* Number of extra rows to render above/below the visible items. | ||
* Tweaking this can help reduce scroll flickering on certain | ||
* browsers/devices. | ||
* | ||
* Default: 20 | ||
*/ | ||
overscanRowsCount?: number; | ||
/** | ||
* Number of extra columns to render before/after the visible items. | ||
* Tweaking this can help reduce scroll flickering on certain | ||
* browsers/devices. | ||
* | ||
* Default: 20 | ||
*/ | ||
overscanColumnsCount?: number; | ||
/** | ||
* Adds an additional isScrolling parameter to the children render function. | ||
* This parameter can be used to show a placeholder row or column while the | ||
* list is being scrolled. | ||
* | ||
* Note that using this parameter will result in an additional render call | ||
* after scrolling has stopped (when isScrolling changes from true to | ||
* false). | ||
*/ | ||
useIsScrolling?: boolean; | ||
children?: GridChildren; | ||
@@ -200,0 +229,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=6)}([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("react-scroll-sync")},function(e,t){e.exports=require("emotion-theming")},function(e,t){e.exports=require("@emotion/styled")},function(e,t,n){e.exports=n(8)},function(e,t){e.exports=require("lodash.flattendeep")},function(e,t,n){"use strict";n.r(t);var o=n(4),y=n(0),a=n(3),r=n(2),h=n.n(r),d=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 c(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 l(e){return(l=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 s(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 s(this,n),(t=c(this,l(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,y["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?y.createElement("span",null,"X"):void 0!==this.props.children?this.props.children:null}}]),n}();function p(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 m=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&&p(e.prototype,t),n&&p(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 y.isValidElement(e)&&e.type===y.Fragment}},{key:"addPropsToChildren",value:function(e,r){return y.Children.map(e,function(e,t){var n=r(e,t);return y.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:y.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 g(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 v(e){return null==e}function O(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=O(n),minHeight:r=O(r),maxHeight:o=O(o)}}function j(e){return g(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 P(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 S(e){return(S=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function C(e,t){return(C=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),P(this,S(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&&C(e,t)}(t,y["PureComponent"]),t}();function x(e){return(x="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 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 k(e,t){return!t||"object"!==x(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 R(e){return(R=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function I(e,t){return(I=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function z(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),B=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),k(this,R(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&&I(e,t)}(t,y["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[A]){var t=e.props,n=t.children;return{props:H(t,["children"]),content:n}}return{props:{},content:e}}}]),t}();function F(e){return(F="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 W(e,t){return!t||"object"!==F(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 M(e){return(M=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function N(e,t){return(N=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}z(B,"defaultProps",z({},A,!0));var q=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),W(this,M(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&&N(e,t)}(t,y["PureComponent"]),t}();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 V(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 G(e){return(G=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function D(e,t){return(D=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),V(this,G(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&&D(e,t)}(t,y["PureComponent"]),t}(),X=n(5),J=n.n(X).a;function Q(){var e=ee(["\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 Q=function(){return e},e}function U(){var e=ee(["\n label: grid-body;\n"]);return U=function(){return e},e}function Y(){var e=ee(["\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 Y=function(){return e},e}function Z(){var e=ee(["\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 Z=function(){return e},e}function $(){var e=ee(["\n label: grid-view;\n\n width: 100%;\n"]);return $=function(){return e},e}function ee(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var te=J.div($()),ne=J.div(Z(),function(e){return"rtl"===e.theme.dir?"padding-left":"padding-right"},17,"1px solid #ddd"),re=J.div(Y()),oe=J.div(U()),ie=J.div(Q());function ue(e){return(ue="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 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 fe(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 ae(e){return(ae=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function se(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pe(e,t){return(pe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ye(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var he=function(e){function u(){var e,t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return ye(se(t=function(e,t){return!t||"object"!==ue(t)&&"function"!=typeof t?se(e):t}(this,(e=ae(u)).call.apply(e,[this].concat(r)))),"headList",y.createRef()),ye(se(t),"freezedColumnsList",y.createRef()),ye(se(t),"getColumnWidth",function(e){return"function"==typeof t.props.columnWidth?t.props.columnWidth(e):t.props.columnWidth}),ye(se(t),"getRowHeight",function(t){return function(e){return"function"==typeof t?t(e):t}}),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&&pe(e,t)}(u,y["PureComponent"]),function(e,t,n){t&&fe(e.prototype,t),n&&fe(e,n)}(u,[{key:"render",value:function(){var e=this.props,t=(e.columnCount,e.columnWidth,e.children,le(e,["columnCount","columnWidth","children"]));return y.createElement(b,null,y.createElement(o.ThemeProvider,{theme:this.getTheme()},y.createElement(a.ScrollSync,null,y.createElement(te,ce({},t,{style:Object.assign({direction:this.props.dir},this.props.style,w(t.style,u.defaultHeight))}),this.renderHead(),this.renderBody(),this.renderFooter()))))}},{key:"renderHead",value:function(){var r=this,e=m.singleChildOfType(this,K);if(!e)return null;var t=e.props,o=t.children,n=le(t,["children"]),i=this.props.freezeColumns||0;return y.createElement(ne,ce({},n,{style:Object.assign({},e.props.style,w(n.style,u.defaultHeadHeight))}),y.createElement(b,null,y.createElement(h.a,null,function(e){var t=e.width,n=e.height;return y.createElement("div",{style:{width:t,height:n,display:"flex"}},j(i).map(function(e){return r.renderHeadCell(o,e)}),y.createElement(a.ScrollSyncPane,null,y.createElement(d.VariableSizeList,{ref:r.headList,direction:r.props.dir,style:{overflow:"hidden"},layout:"horizontal",height:n,width:t-r.getFrozenColumnsWidth(),itemCount:r.props.columnCount-i,itemSize:function(e){return r.getColumnWidth(e+i)}},function(e){var t=e.index,n=e.style;return r.renderHeadCell(o,t+i,n)})))})))}},{key:"renderHeadCell",value:function(e,t,n){var r=e({columnIndex:t}),o=B.extract(r),i=o.props,u=o.content,c=this.getColumnWidth(t);return y.createElement(re,ce({key:t},i,{style:Object.assign({width:c},i.style,n)}),y.createElement(b,null,u))}},{key:"renderBody",value:function(){var o=this,e=m.singleChildOfType(this,E);if(!e)return null;var t=e.props,i=t.children,r=t.rowCount,u=t.rowHeight,n=le(t,["children","rowCount","rowHeight"]),c=this.getBodyHeights(),l=this.props.freezeColumns||0,f=this.getFrozenColumnsWidth();return y.createElement(oe,ce({},n,{style:Object.assign({},n.style,c)}),y.createElement(b,null,y.createElement(h.a,null,function(e){var t=e.height,n=e.width;return y.createElement("div",{style:{width:n,height:t,display:"flex"}},y.createElement(a.ScrollSyncPane,null,y.createElement(d.VariableSizeList,{ref:o.freezedColumnsList,style:{overflow:"hidden"},height:t-17,width:f,itemCount:r,itemSize:o.getRowHeight(u)},function(e){var t=e.index,n=e.style;return y.createElement("div",{style:n},j(l).map(function(e){return o.renderBodyCell(i,t,e)}))})),y.createElement(a.ScrollSyncPane,null,y.createElement(d.VariableSizeGrid,{direction:o.props.dir,height:t,width:n-f,columnCount:o.props.columnCount-l,columnWidth:function(e){return o.getColumnWidth(e+l)},rowCount:r,rowHeight:o.getRowHeight(u)},function(e){var t=e.rowIndex,n=e.columnIndex,r=e.style;return o.renderBodyCell(i,t,n+l,r)})))})))}},{key:"renderBodyCell",value:function(e,t,n,r){var o=e({rowIndex:t,columnIndex:n}),i=B.extract(o),u=i.props,c=i.content;return y.createElement(ie,ce({key:"[ ".concat(t,", ").concat(n," ]")},u,{style:Object.assign({},u.style,r)}),y.createElement(b,null,c))}},{key:"renderFooter",value:function(){return m.singleChildOfType(this,q)?y.createElement("span",null,"Footer"):null}},{key:"getTheme",value:function(){return{dir:this.props.dir}}},{key:"getBodyHeights",value:function(){var e,t,n=w(this.props.style,u.defaultHeight),r=this.getHeadHeight(),o=w(this.props.style,void 0),i=o.height||"calc(".concat(n.height," - ").concat(r,")");return(o.minHeight||n.minHeight)&&(e=o.minHeight||"calc(".concat(n.minHeight," - ").concat(r,")")),(o.maxHeight||n.maxHeight)&&(t=o.maxHeight||"calc(".concat(n.maxHeight," - ").concat(r,")")),{height:i,minHeight:e,maxHeight:t}}},{key:"getHeadHeight",value:function(){var e=m.singleChildOfType(this,K),t=0;return e&&(t=w(e.props.style,u.defaultHeadHeight).height),t}},{key:"getFrozenColumnsWidth",value:function(){return this.props.freezeColumns?j(this.props.freezeColumns).map(this.getColumnWidth).reduce(function(e,t){return e+t},0):0}}]),u}();function de(e){return(de="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 be(e,t){return!t||"object"!==de(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 ge(e,t){return(ge=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")}ye(he,"defaultHeight","35vh"),ye(he,"defaultHeadHeight","40px"),ye(he,"Head",K),ye(he,"Body",E),ye(he,"Cell",B);var Oe=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)},we=function(e){function t(){return ve(this,t),be(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&&ge(e,t)}(t,y["PureComponent"]),t}();function je(e){return(je="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"!==je(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 Pe(e){return(Pe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Se(e,t){return(Se=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ee(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var xe=function e(){Ce(this,e),Ee(this,"height","40px"),Ee(this,"children",void 0)},He=function(e){function t(){return Ce(this,t),_e(this,Pe(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&&Se(e,t)}(t,y["PureComponent"]),t}();function Te(e){return(Te="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 ke(e,t){return!t||"object"!==Te(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 Re(e){return(Re=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ie(e,t){return(Ie=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ze(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Ae=function e(){ze(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)},Be=function(e){function t(){return ze(this,t),ke(this,Re(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&&Ie(e,t)}(t,y["PureComponent"]),t}();function Fe(e){return(Fe="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 We(e,t){return!t||"object"!==Fe(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)}var qe=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),We(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,y["PureComponent"]),t}();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 Ve(e,t){return!t||"object"!==Le(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 De(e,t){return(De=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ke(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Xe=function e(){Ke(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 Ke(this,t),Ve(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&&De(e,t)}(t,y["PureComponent"]),t}();function Qe(e){return(Qe="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(e,t){return!t||"object"!==Qe(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 Ye(e){return(Ye=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ze(e,t){return(Ze=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function $e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function et(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=function e(){$e(this,e),et(this,"height","40px"),et(this,"children",void 0)},nt=function(e){function t(){return $e(this,t),Ue(this,Ye(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&&Ze(e,t)}(t,y["PureComponent"]),t}();function rt(e){return(rt="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){return!t||"object"!==rt(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 it(e){return(it=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ut(e,t){return(ut=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var ct=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ot(this,it(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&&ut(e,t)}(t,y["PureComponent"]),t}();function lt(){var e=dt(["\n flex: 1;\n padding: 8px;\n overflow: hidden;\n text-overflow: ellipsis;\n"]);return lt=function(){return e},e}function ft(){var e=dt(["\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 ft=function(){return e},e}function at(){var e=dt(["\n display: flex;\n flex-flow: column;\n\n vertical-align: middle;\n"]);return at=function(){return e},e}function st(){var e=dt(["\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 st=function(){return e},e}function pt(){var e=dt(["\n flex: 1;\n display: flex;\n justify-content: stretch;\n\n ",": ",";\n\n border-bottom: ",";\n"]);return pt=function(){return e},e}function yt(){var e=dt(["\n display: flex;\n flex-flow: column;\n\n overflow-y: hidden;\n\n font-weight: bold;\n vertical-align: middle;\n"]);return yt=function(){return e},e}function ht(){var e=dt(["\n background-color: #fff;\n width: 100%;\n overflow-y: hidden;\n"]);return ht=function(){return e},e}function dt(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var bt="1px solid #ddd",mt=J.div(ht()),gt=J.div(yt()),vt=J.div(pt(),function(e){return"rtl"===e.theme.dir?"padding-left":"padding-dir"},"17px",bt),Ot=J.div(st()),wt=J.div(at()),jt=J.div(ft(),bt),_t=J.div(lt());function Pt(e){return(Pt="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 St(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 Ct(){return(Ct=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 Et(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 xt(e,t){return!t||"object"!==Pt(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 Ht(e){return(Ht=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Tt(e,t){return(Tt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function kt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Rt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var It=n(7),zt=function e(){kt(this,e),Rt(this,"items",void 0),Rt(this,"itemId",void 0),Rt(this,"children",void 0),Rt(this,"dir","ltr"),Rt(this,"className",void 0),Rt(this,"style",void 0),Rt(this,"rowHeight",50),Rt(this,"emptyMessage","No Items to Display"),Rt(this,"overscanCount",20)},At=function e(){kt(this,e),Rt(this,"selectedItems",{})},Bt=function(e){function r(e){var t;return kt(this,r),(t=xt(this,Ht(r).call(this,e))).state=new At,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&&Tt(e,t)}(r,y["PureComponent"]),function(e,t,n){t&&Et(e.prototype,t),n&&Et(e,n)}(r,[{key:"render",value:function(){var e=m.singleChildOfType(this,nt),t=m.singleChildOfType(this,Be),n=m.childrenOfType(this,Je);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 y.createElement(b,null,y.createElement(o.ThemeProvider,{theme:this.getTheme()},y.createElement(mt,{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?y.createElement(gt,{style:{height:e.props.height}},y.createElement(vt,null,y.createElement(b,null,y.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 y.createElement(Ot,Ct({key:t},r),y.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 y.createElement(wt,{style:{direction:this.props.dir,height:o,minHeight:i,maxHeight:u}},y.createElement(b,null,this.renderTableRows(t)))}},{key:"renderTableRows",value:function(s){var p=this;return 0!==this.props.items.length&&this.hasBody(s)?y.createElement(h.a,null,function(e){var t=e.width,n=e.height;return y.createElement(d.FixedSizeList,{style:{outline:"none"},direction:p.props.dir,layout:"vertical",height:n,width:t,itemCount:p.props.items.length,itemSize:p.props.rowHeight},function(e){var t=e.index,n=e.style,r=s.props.children;if(!r)return null;var o=p.props.items[t],i=r(o,t),u=p.getRowProps(i),c=u.style,l=St(u,["style"]),f=p.getRowKey(l,o,t),a=p.getRowContent(i);return y.createElement(jt,Ct({style:Object.assign({},n,c||{}),key:f},l),y.createElement(b,null,function(e){return Array.isArray(e)?e:[e]}(a).map(function(e,t){var n=p.getCellProps(e);return!1===n.visible?null:y.createElement(_t,Ct({key:t},n),y.createElement(b,null,p.getCellContent(e)))})))})}):this.renderItemsPlaceHolder()}},{key:"renderItemsPlaceHolder",value:function(){return y.createElement("div",null,y.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=O(e),minHeight:t=O(t),maxHeight:n=O(n)}}},{key:"getItemId",value:function(e,t){return"function"==typeof this.props.itemId?this.props.itemId(e,t):e.id}},{key:"createHeadFromColumns",value:function(e){return y.createElement(nt,null,e.map(function(e){return m.singleChildOfType(e,He).props.children}))}},{key:"createBodyFromColumns",value:function(e){return y.createElement(Be,null,function(r,o){return e.map(function(e,t){var n=m.singleChildOfType(e,we).props.children;return n?n(r,o,t):null})})}},{key:"getHeadProps",value:function(e){return m.elementInstanceOf(e,ct)?e.props:new tt}},{key:"getHeadCellProps",value:function(e){return m.elementInstanceOf(e,qe)&&e.props||{}}},{key:"getHeadCellContent",value:function(e){return m.elementInstanceOf(e,qe)?e.props.children:e}},{key:"hasBody",value:function(e){return!!e&&(!v(e.props.children)&&("function"==typeof e.props.children||(Array.isArray(e.props.children)?0<e.props.children.length:0<y.Children.count(e.props.children))))}},{key:"getRowProps",value:function(e){return m.elementInstanceOf(e,ct)&&e.props||{}}},{key:"getRowContent",value:function(e){var t=e;if(m.isReactFragment(t))throw new Error("Can not use React.Fragment as row content. Consider wrapping your content with a row element.");return m.elementInstanceOf(t,ct)&&(t=t.props.children),Array.isArray(t)&&(t=It(t)),t}},{key:"getRowKey",value:function(e,t,n){if(!v(e.key))return e.key;var r=this.getItemId(t,n);return v(r)?n:r}},{key:"getCellProps",value:function(e){return m.elementInstanceOf(e,qe)&&e.props||{}}},{key:"getCellContent",value:function(e){var t=e;return m.elementInstanceOf(t,qe)&&(t=t.props.children),t||null}}]),r}();Rt(Bt,"defaultHeight","35vh"),Rt(Bt,"Head",nt),Rt(Bt,"Body",Be),Rt(Bt,"Row",ct),Rt(Bt,"Cell",qe),Rt(Bt,"Column",Je),Rt(Bt,"defaultProps",new zt),n.d(t,"GridView",function(){return he}),n.d(t,"ColumnBodyProps",function(){return Oe}),n.d(t,"ColumnBody",function(){return we}),n.d(t,"ColumnHeadProps",function(){return xe}),n.d(t,"ColumnHead",function(){return He}),n.d(t,"TableBodyProps",function(){return Ae}),n.d(t,"TableBody",function(){return Be}),n.d(t,"TableCell",function(){return qe}),n.d(t,"TableColumnProps",function(){return Xe}),n.d(t,"TableColumn",function(){return Je}),n.d(t,"TableHeadProps",function(){return tt}),n.d(t,"TableHead",function(){return nt}),n.d(t,"TableRow",function(){return ct}),n.d(t,"TableViewProps",function(){return zt}),n.d(t,"TableView",function(){return Bt})}])}); | ||
!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),y=n(0),u=n(4),r=n(2),a=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 s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e,t){return(p=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,s(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&&p(e,t)}(n,y["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?y.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 y.isValidElement(e)&&e.type===y.Fragment}},{key:"addPropsToChildren",value:function(e,r){return y.Children.map(e,function(e,t){var n=r(e,t);return y.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:y.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 _(e){return v(Array(e||0).keys())}function S(e){return(S="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"!==S(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),C(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,y["PureComponent"]),t}();function H(e){return(H="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 T(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 I(e,t){return!t||"object"!==H(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 R(e){return(R=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),I(this,R(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,y["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:T(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,y["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,y["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",y.createRef()),he(pe(o),"mainBodyGrid",y.createRef()),he(pe(o),"freezedColumnsGrid",y.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,y["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 y.createElement(b,null,y.createElement(o.ThemeProvider,{theme:this.getTheme()},y.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 y.createElement(re,ce({},n,{style:Object.assign({},e.props.style,j(n.style,l.defaultHeadHeight))}),y.createElement(b,null,y.createElement(a.a,null,function(e){var t=e.width,n=e.height;return y.createElement("div",{style:{width:t,height:n,display:"flex"}},_(u).map(function(e){return o.renderHeadCell({cellRender:i,columnIndex:e,isScrolling:!1})}),y.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 y.createElement(oe,ce({key:t},l,{style:Object.assign({width:f},l.style,o)}),y.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 y.createElement(ie,ce({},n,{style:Object.assign({},n.style,l)}),y.createElement(b,null,y.createElement(a.a,null,function(e){var t=e.height,n=e.width;return y.createElement("div",{style:{width:n,height:t,display:"flex"}},y.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})}),y.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 y.createElement(ue,ce({key:"[ ".concat(t,", ").concat(n," ]")},c,{style:Object.assign({},c.style,i)}),y.createElement(b,null,f))}},{key:"renderFooter",value:function(){return g.singleChildOfType(this,L)?y.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?_(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,y["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 Se(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 Ce(e){return(Ce=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)}function xe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ee(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var He=function e(){xe(this,e),Ee(this,"height","40px"),Ee(this,"children",void 0)},Te=function(e){function t(){return xe(this,t),Se(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&&Pe(e,t)}(t,y["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 Ie(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 Re(e){return(Re=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ze(e,t){return(ze=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Be(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Ae=function e(){Be(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)},Fe=function(e){function t(){return Be(this,t),Ie(this,Re(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&&ze(e,t)}(t,y["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 Me(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 Ne(e){return(Ne=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ge(e,t){return(Ge=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Le=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Me(this,Ne(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&&Ge(e,t)}(t,y["PureComponent"]),t}();function qe(e){return(qe="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 Ve(e,t){return!t||"object"!==qe(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 De(e){return(De=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 Xe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Je=function e(){Xe(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 Xe(this,t),Ve(this,De(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,y["PureComponent"]),t}();function Ue(e){return(Ue="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 Ye(e,t){return!t||"object"!==Ue(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 Ze(e){return(Ze=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)}function et(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var nt=function e(){et(this,e),tt(this,"height","40px"),tt(this,"children",void 0)},rt=function(e){function t(){return et(this,t),Ye(this,Ze(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,y["PureComponent"]),t}();function ot(e){return(ot="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 it(e,t){return!t||"object"!==ot(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 ut(e){return(ut=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function lt(e,t){return(lt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var ct=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),it(this,ut(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,t)}(t,y["PureComponent"]),t}();function ft(){var e=bt(["\n flex: 1;\n padding: 8px;\n overflow: hidden;\n text-overflow: ellipsis;\n"]);return ft=function(){return e},e}function at(){var e=bt(["\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 at=function(){return e},e}function st(){var e=bt(["\n display: flex;\n flex-flow: column;\n\n vertical-align: middle;\n"]);return st=function(){return e},e}function pt(){var e=bt(["\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 pt=function(){return e},e}function yt(){var e=bt(["\n flex: 1;\n display: flex;\n justify-content: stretch;\n\n ",": ",";\n\n border-bottom: ",";\n"]);return yt=function(){return e},e}function ht(){var e=bt(["\n display: flex;\n flex-flow: column;\n\n overflow-y: hidden;\n\n font-weight: bold;\n vertical-align: middle;\n"]);return ht=function(){return e},e}function dt(){var e=bt(["\n background-color: #fff;\n width: 100%;\n overflow-y: hidden;\n"]);return dt=function(){return e},e}function bt(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var mt="1px solid #ddd",gt=Q.div(dt()),vt=Q.div(ht()),Ot=Q.div(yt(),function(e){return"rtl"===e.theme.dir?"padding-left":"padding-dir"},"17px",mt),wt=Q.div(pt()),jt=Q.div(st()),_t=Q.div(at(),mt),St=Q.div(ft());function Ct(e){return(Ct="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 Pt(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 xt(){return(xt=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 Et(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 Ht(e,t){return!t||"object"!==Ct(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 kt(e,t){return(kt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function It(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Rt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var zt=n(8),Bt=function e(){It(this,e),Rt(this,"items",void 0),Rt(this,"itemId",void 0),Rt(this,"children",void 0),Rt(this,"dir","ltr"),Rt(this,"className",void 0),Rt(this,"style",void 0),Rt(this,"rowHeight",50),Rt(this,"emptyMessage","No Items to Display"),Rt(this,"overscanCount",20)},At=function e(){It(this,e),Rt(this,"selectedItems",{})},Ft=function(e){function r(e){var t;return It(this,r),(t=Ht(this,Tt(r).call(this,e))).state=new At,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&&kt(e,t)}(r,y["PureComponent"]),function(e,t,n){t&&Et(e.prototype,t),n&&Et(e,n)}(r,[{key:"render",value:function(){var e=g.singleChildOfType(this,rt),t=g.singleChildOfType(this,Fe),n=g.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 y.createElement(b,null,y.createElement(o.ThemeProvider,{theme:this.getTheme()},y.createElement(gt,{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?y.createElement(vt,{style:{height:e.props.height}},y.createElement(Ot,null,y.createElement(b,null,y.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 y.createElement(wt,xt({key:t},r),y.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 y.createElement(jt,{style:{direction:this.props.dir,height:o,minHeight:i,maxHeight:u}},y.createElement(b,null,this.renderTableRows(t)))}},{key:"renderTableRows",value:function(s){var p=this;return 0!==this.props.items.length&&this.hasBody(s)?y.createElement(a.a,null,function(e){var t=e.width,n=e.height;return y.createElement(h.FixedSizeList,{style:{outline:"none"},direction:p.props.dir,layout:"vertical",height:n,width:t,itemCount:p.props.items.length,itemSize:p.props.rowHeight},function(e){var t=e.index,n=e.style,r=s.props.children;if(!r)return null;var o=p.props.items[t],i=r(o,t),u=p.getRowProps(i),l=u.style,c=Pt(u,["style"]),f=p.getRowKey(c,o,t),a=p.getRowContent(i);return y.createElement(_t,xt({style:Object.assign({},n,l||{}),key:f},c),y.createElement(b,null,function(e){return Array.isArray(e)?e:[e]}(a).map(function(e,t){var n=p.getCellProps(e);return!1===n.visible?null:y.createElement(St,xt({key:t},n),y.createElement(b,null,p.getCellContent(e)))})))})}):this.renderItemsPlaceHolder()}},{key:"renderItemsPlaceHolder",value:function(){return y.createElement("div",null,y.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:"getItemId",value:function(e,t){return"function"==typeof this.props.itemId?this.props.itemId(e,t):e.id}},{key:"createHeadFromColumns",value:function(e){return y.createElement(rt,null,e.map(function(e){return g.singleChildOfType(e,Te).props.children}))}},{key:"createBodyFromColumns",value:function(e){return y.createElement(Fe,null,function(r,o){return e.map(function(e,t){var n=g.singleChildOfType(e,je).props.children;return n?n(r,o,t):null})})}},{key:"getHeadProps",value:function(e){return g.elementInstanceOf(e,ct)?e.props:new nt}},{key:"getHeadCellProps",value:function(e){return g.elementInstanceOf(e,Le)&&e.props||{}}},{key:"getHeadCellContent",value:function(e){return g.elementInstanceOf(e,Le)?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<y.Children.count(e.props.children))))}},{key:"getRowProps",value:function(e){return g.elementInstanceOf(e,ct)&&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,ct)&&(t=t.props.children),Array.isArray(t)&&(t=zt(t)),t}},{key:"getRowKey",value:function(e,t,n){if(!O(e.key))return e.key;var r=this.getItemId(t,n);return O(r)?n:r}},{key:"getCellProps",value:function(e){return g.elementInstanceOf(e,Le)&&e.props||{}}},{key:"getCellContent",value:function(e){var t=e;return g.elementInstanceOf(t,Le)&&(t=t.props.children),t||null}}]),r}();Rt(Ft,"defaultHeight","35vh"),Rt(Ft,"Head",rt),Rt(Ft,"Body",Fe),Rt(Ft,"Row",ct),Rt(Ft,"Cell",Le),Rt(Ft,"Column",Qe),Rt(Ft,"defaultProps",new Bt),n.d(t,"GridView",function(){return de}),n.d(t,"ColumnBodyProps",function(){return we}),n.d(t,"ColumnBody",function(){return je}),n.d(t,"ColumnHeadProps",function(){return He}),n.d(t,"ColumnHead",function(){return Te}),n.d(t,"TableBodyProps",function(){return Ae}),n.d(t,"TableBody",function(){return Fe}),n.d(t,"TableCell",function(){return Le}),n.d(t,"TableColumnProps",function(){return Je}),n.d(t,"TableColumn",function(){return Qe}),n.d(t,"TableHeadProps",function(){return nt}),n.d(t,"TableHead",function(){return rt}),n.d(t,"TableRow",function(){return ct}),n.d(t,"TableViewProps",function(){return Bt}),n.d(t,"TableView",function(){return Ft})}])}); |
{ | ||
"name": "react-tablize", | ||
"version": "0.4.0", | ||
"version": "0.5.0", | ||
"description": "React virtual table component", | ||
@@ -31,2 +31,3 @@ "author": "Alon Bar", | ||
"lodash.flattendeep": "^4.4.0", | ||
"normalize-scroll-left": "^0.1.2", | ||
"react": "^16.8.6", | ||
@@ -33,0 +34,0 @@ "react-dom": "^16.8.6", |
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
265385
2786
8
+ Addednormalize-scroll-left@^0.1.2
+ Addednormalize-scroll-left@0.1.2(transitive)