@atlaskit/dynamic-table
Advanced tools
Comparing version 4.0.0 to 4.0.1
@@ -1,6 +0,16 @@ | ||
<a name="4.0.0"></a> | ||
# 4.0.0 (2017-07-03) | ||
<a name="4.0.1"></a> | ||
## 4.0.1 (2017-07-10) | ||
<a name="4.0.1"></a> | ||
## 4.0.1 (2017-07-10) | ||
### Bug Fixes | ||
* **component:** fixes '0' being displayed when rows prop is empty array ([8ce1453](https://bitbucket.org/atlassian/atlaskit/commits/8ce1453)) | ||
<a name="4.0.0"></a> | ||
@@ -7,0 +17,0 @@ # 4.0.0 (2017-07-03) |
@@ -148,3 +148,3 @@ module.exports = /******/ | ||
isFixedSize: isFixedSize | ||
}, rowsExist = rows && rows.length, emptyBody = emptyView && _react2.default.createElement(_EmptyBody2.default, null, emptyView); | ||
}, rowsExist = rows && rows.length > 0, emptyBody = emptyView && _react2.default.createElement(_EmptyBody2.default, null, emptyView); | ||
return _react2.default.createElement("div", null, _react2.default.createElement(_DynamicTable.Table, { | ||
@@ -151,0 +151,0 @@ isFixedSize: isFixedSize |
@@ -1,1 +0,1 @@ | ||
module.exports=function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.DynamicTableStateless=t.default=void 0;var o=n(2);Object.defineProperty(t,"DynamicTableStateless",{enumerable:!0,get:function(){return r(o).default}});var l=n(29),a=r(l);t.default=a.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){switch(e){case x.DESC:return x.ASC;case x.ASC:return x.DESC;default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var l=n(3),a=r(l),u=n(4),i=r(u),d=n(5),s=r(d),f=n(6),c=r(f),p=n(7),h=r(p),y=n(8),b=r(y),g=n(9),S=r(g),v=n(10),x=n(11),m=n(12),w=r(m),_=n(16),C=r(_),P=n(23),O=r(P),k=n(26),E=r(k),M=n(28),z=function(e){function t(){var e,n,r,l;(0,i.default)(this,t);for(var u=arguments.length,d=Array(u),s=0;s<u;s++)d[s]=arguments[s];return n=r=(0,c.default)(this,(e=t.__proto__||(0,a.default)(t)).call.apply(e,[this].concat(d))),r.onSort=function(e){return function(){var t=r.props,n=t.sortKey,l=t.sortOrder,a=t.onSort,u=e.key;if(u){var i=u!==n?x.ASC:o(l);r.onSetPage(1),a({key:u,item:e,sortOrder:i})}}},r.onSetPage=function(e){return r.props.onSetPage(e)},l=n,(0,c.default)(r,l)}return(0,h.default)(t,e),(0,s.default)(t,[{key:"render",value:function(){var e=this.props,t=e.caption,n=e.emptyView,r=e.head,o=e.isFixedSize,l=e.page,a=e.rows,u=e.rowsPerPage,i=e.sortKey,d=e.sortOrder,s=a?Math.ceil(a.length/u):0,f={rows:a,head:r,sortKey:i,sortOrder:d,rowsPerPage:u,page:l,isFixedSize:o},c=a&&a.length,p=n&&S.default.createElement(E.default,null,n);return S.default.createElement("div",null,S.default.createElement(M.Table,{isFixedSize:o},!!t&&S.default.createElement(M.Caption,null,t),r&&S.default.createElement(C.default,{head:r,onSort:this.onSort,sortKey:i,sortOrder:d}),c&&S.default.createElement(O.default,f)),s?S.default.createElement(v.Pagination,{current:l,onSetPage:this.onSetPage,total:s}):null,!c&&p)}}]),t}(g.Component);z.propTypes={caption:b.default.node,head:w.default.head,rows:w.default.rows,emptyView:b.default.node,isFixedSize:b.default.bool,rowsPerPage:w.default.isInteger,onSetPage:b.default.func,onSort:b.default.func,page:w.default.isInteger,sortKey:w.default.sortKey,sortOrder:b.default.oneOf([x.ASC,x.DESC])},z.defaultProps={caption:null,head:null,rows:null,emptyView:null,isFixedSize:!1,rowsPerPage:1/0,onSetPage:function(){},onSort:function(){},page:1,sortKey:null,sortOrder:null},t.default=z},function(e,t){e.exports=require("babel-runtime/core-js/object/get-prototype-of")},function(e,t){e.exports=require("babel-runtime/helpers/classCallCheck")},function(e,t){e.exports=require("babel-runtime/helpers/createClass")},function(e,t){e.exports=require("babel-runtime/helpers/possibleConstructorReturn")},function(e,t){e.exports=require("babel-runtime/helpers/inherits")},function(e,t){e.exports=require("prop-types")},function(e,t){e.exports=require("react")},function(e,t){e.exports=require("@atlaskit/pagination")},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ASC="ASC",t.DESC="DESC"},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){if(void 0===e[t])return null;if(!(0,f.default)(e[t])&&e[t]!==1/0){var r="'"+t+"' should be an integer or an infinity, got "+e[t]+" instead";return(0,h.createError)(t,n,r)}return null}function l(e,t,n){for(var r=arguments.length,o=Array(r>3?r-3:0),l=3;l<r;l++)o[l-3]=arguments[l];var a=p.default.arrayOf(b).apply(void 0,[e,t,n].concat(o));if(a instanceof Error)return a;if(!e.head||!e.head.cells)return null;var u=e[t].reduce(function(t,n){return t&&n.length===e.head.cells.length},!0);return u?null:(0,h.createError)(t,n,"One of the rows has different cell-count compared to head.")}function a(e,t,n){for(var r=arguments.length,o=Array(r>3?r-3:0),l=3;l<r;l++)o[l-3]=arguments[l];var a=p.default.bool.apply(p.default,[e,t,n].concat(o));return a instanceof Error?a:e[t]&&!e.key?(0,h.createError)(t,n,"'"+t+"' can't be set to true, if the 'key' prop is missing."):null}function u(e,t,n){if(!e[t])return null;var r=e.head.cells.map(function(e){return e.key}).includes(e[t]);return r?null:(0,h.createError)(t,n,"Cell with "+e[t]+" key not found in head.")}Object.defineProperty(t,"__esModule",{value:!0});var i=n(13),d=r(i),s=n(14),f=r(s),c=n(8),p=r(c),h=n(15);o.isRequired=!1;var y={key:p.default.oneOfType([p.default.number,p.default.string,p.default.bool]),content:p.default.node},b=p.default.shape(y);a.isRequired=!1;var g=(0,d.default)({},y,{isSortable:a,width:p.default.number,shouldTruncate:p.default.bool}),S=p.default.shape(g),v=p.default.shape({cells:p.default.arrayOf(S)}),x=p.default.shape({cells:l}),m=p.default.arrayOf(x);u.isRequired=!1,t.default={head:v,isInteger:o,row:x,rows:m,sortKey:u}},function(e,t){e.exports=require("babel-runtime/helpers/extends")},function(e,t){e.exports=require("babel-runtime/core-js/number/is-integer")},function(e,t){e.exports=require("@atlaskit/util-common")},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(13),l=r(o),a=n(17),u=r(a),i=n(8),d=r(i),s=n(9),f=r(s),c=n(11),p=n(18),h=n(12),y=r(h),b=function(e){var t=e.head,n=e.sortKey,r=e.sortOrder,o=e.isFixedSize,a=e.onSort;if(!t)return null;var i=t.cells,d=(0,u.default)(t,["cells"]);return f.default.createElement(p.Head,d,f.default.createElement("tr",null,i.map(function(e,t){var i=e.isSortable,d=e.key,s=e.content,c=(0,u.default)(e,["isSortable","key","content"]);return f.default.createElement(p.HeadCell,(0,l.default)({key:d||t,onClick:i&&a(e),isFixedSize:o,isSortable:i,sortOrder:d===n&&r},c),f.default.createElement("span",null,s))})))};b.propTypes={onSort:d.default.func,head:y.default.head,sortKey:y.default.sortKey,sortOrder:d.default.oneOf([c.ASC,c.DESC]),isFixedSize:d.default.bool},t.default=b},function(e,t){e.exports=require("babel-runtime/helpers/objectWithoutProperties")},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.HeadCell=t.Head=void 0;var o=n(19),l=r(o),a=(0,l.default)(["\n border-bottom: 2px solid #DFE1E6;\n"],["\n border-bottom: 2px solid #DFE1E6;\n"]),u=(0,l.default)(["\n ","\n ","\n ","\n ","\n border: none;\n color: ",";\n font-size: 12px;\n font-weight: 600;\n position: relative;\n text-align: left;\n vertical-align: top;\n"],["\n ","\n ","\n ","\n ","\n border: none;\n color: ",";\n font-size: 12px;\n font-weight: 600;\n position: relative;\n text-align: left;\n vertical-align: top;\n"]),i=n(20),d=r(i),s=n(21),f=n(22);t.Head=d.default.thead(a),t.HeadCell=d.default.th(u,function(e){return(0,f.onClickStyle)(e)},function(e){return(0,f.truncateStyle)(e)},function(e){return(0,f.arrowsStyle)(e)},f.cellStyle,s.akColorN300)},function(e,t){e.exports=require("babel-runtime/helpers/taggedTemplateLiteral")},function(e,t){e.exports=require("styled-components")},function(e,t){e.exports=require("@atlaskit/util-shared-styles")},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.cellStyle=t.arrowsStyle=t.onClickStyle=t.truncateStyle=t.baselineUnit=t.gridUnit=void 0;var o=n(19),l=r(o),a=(0,l.default)(["\n ","\n ",";\n ","\n"],["\n ","\n ",";\n ","\n"]),u=(0,l.default)(["width: ","%;"],["width: ","%;"]),i=(0,l.default)(["overflow: hidden;"],["overflow: hidden;"]),d=(0,l.default)(["\n text-overflow: ellipsis;\n white-space: nowrap;\n "],["\n text-overflow: ellipsis;\n white-space: nowrap;\n "]),s=(0,l.default)(["\n &:hover {\n cursor: pointer;\n }\n"],["\n &:hover {\n cursor: pointer;\n }\n"]),f=(0,l.default)(["\n border: 3px solid transparent;\n display: block;\n height: 0;\n position: absolute;\n right: -","px;\n width: 0;\n "],["\n border: 3px solid transparent;\n display: block;\n height: 0;\n position: absolute;\n right: -","px;\n width: 0;\n "]),c=(0,l.default)(["\n & > span {\n position: relative;\n &:before {\n ",";\n border-bottom: 3px solid ",";\n bottom: 8px;\n content: ' ';\n };\n &:after {\n ",";\n border-top: 3px solid ",";\n bottom: 0;\n content: ' ';\n };\n }\n\n &:hover > span {\n &:before {\n border-bottom: 3px solid ",";\n }\n &:after {\n border-top: 3px solid ",";\n }\n }\n "],["\n & > span {\n position: relative;\n &:before {\n ",";\n border-bottom: 3px solid ",";\n bottom: 8px;\n content: ' ';\n };\n &:after {\n ",";\n border-top: 3px solid ",";\n bottom: 0;\n content: ' ';\n };\n }\n\n &:hover > span {\n &:before {\n border-bottom: 3px solid ",";\n }\n &:after {\n border-top: 3px solid ",";\n }\n }\n "]),p=(0,l.default)(["\n border: none;\n padding: ","px ","px;\n text-align: left;\n &:first-child {\n padding-left: 0;\n }\n &:last-child {\n padding-right: 0;\n }\n"],["\n border: none;\n padding: ","px ","px;\n text-align: left;\n &:first-child {\n padding-left: 0;\n }\n &:last-child {\n padding-right: 0;\n }\n"]),h=n(20),y=n(21),b=n(11),g=t.gridUnit=parseInt(y.akGridSize,10),S=t.baselineUnit=g/2;t.truncateStyle=function(e){var t=e.width,n=e.isFixedSize,r=e.shouldTruncate;return(0,h.css)(a,t?(0,h.css)(u,t):"",n?(0,h.css)(i):"",n&&r?(0,h.css)(d):"")},t.onClickStyle=function(e){var t=e.onClick;return t&&(0,h.css)(s)},t.arrowsStyle=function(e){var t=e.isSortable,n=e.sortOrder;if(!t)return"";var r=(0,h.css)(f,g);return(0,h.css)(c,r,n===b.ASC?y.akColorN300:y.akColorN40,r,n===b.DESC?y.akColorN300:y.akColorN40,n===b.ASC?y.akColorN300:y.akColorN60,n===b.DESC?y.akColorN300:y.akColorN60)},t.cellStyle=(0,h.css)(p,S,g)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(8),l=r(o),a=n(9),u=r(a),i=n(11),d=n(24),s=r(d),f=n(12),c=r(f),p=function(e,t,n,r){if(!n||!e)return t;var o=function(t){return t.reduce(function(t,r,o){return t||e.cells[o].key===n&&(void 0!==r.key?r.key:r.content)},null)};return t.sort(function(e,t){var n=o(e.cells),l=o(t.cells),a=r===i.ASC?1:-1;return!n||n<l?-a:!l||n>l?a:0})},h=function(e){var t=e.rows,n=e.head,r=e.sortKey,o=e.sortOrder,l=e.rowsPerPage,a=e.page,i=e.isFixedSize,d=p(n,t,r,o)||[];return u.default.createElement("tbody",null,d.slice((a-1)*l,a*l).map(function(e,t){return u.default.createElement(s.default,{row:e,rowIndex:t,head:n,isFixedSize:i})}))};h.propTypes={head:c.default.head,rows:c.default.rows,sortKey:c.default.sortKey,sortOrder:l.default.oneOf([i.ASC,i.DESC]),rowsPerPage:c.default.isInteger,page:c.default.isInteger,isFixedSize:l.default.bool},t.default=h},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(13),l=r(o),a=n(17),u=r(a),i=n(8),d=r(i),s=n(9),f=r(s),c=n(25),p=n(12),h=r(p),y=function(e){var t=e.row,n=e.rowIndex,r=e.head,o=e.isFixedSize,a=t.cells,i=(0,u.default)(t,["cells"]);return f.default.createElement(c.TableBodyRow,(0,l.default)({key:n},i),a.map(function(e,t){var n=e.content,a=(0,u.default)(e,["content"]),i=(r||{cells:[]}).cells[t]||{},d=i.shouldTruncate,s=i.width;return f.default.createElement(c.TableBodyCell,(0,l.default)({},a,{key:t,width:s,shouldTruncate:d,isFixedSize:o}),n)}))};y.propTypes={row:h.default.row,rowIndex:d.default.number,head:h.default.head,isFixedSize:d.default.bool},t.default=y},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.TableBodyCell=t.TableBodyRow=void 0;var o=n(19),l=r(o),a=(0,l.default)(["\n ","\n &:hover {\n background: ",";\n }\n"],["\n ","\n &:hover {\n background: ",";\n }\n"]),u=(0,l.default)(["\n ","\n ","\n ","\n"],["\n ","\n ","\n ","\n"]),i=n(20),d=r(i),s=n(21),f=n(22);t.TableBodyRow=d.default.tr(a,function(e){return(0,f.onClickStyle)(e)},s.akColorN10),t.TableBodyCell=d.default.td(u,function(e){return(0,f.onClickStyle)(e)},function(e){return(0,f.truncateStyle)(e)},f.cellStyle)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(8),l=r(o),a=n(9),u=r(a),i=n(27),d=r(i),s=function(e){var t=e.children;return u.default.createElement(d.default,null,t)};s.propTypes={children:l.default.node},t.default=s},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(19),l=r(o),a=(0,l.default)(["\n margin: auto;\n width: 50%;\n text-align: center;\n padding: 10px;\n"],["\n margin: auto;\n width: 50%;\n text-align: center;\n padding: 10px;\n"]),u=n(20),i=r(u);t.default=i.default.div(a)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Caption=t.Table=void 0;var o=n(19),l=r(o),a=(0,l.default)(["\n ",";\n border-collapse: collapse;\n width: 100%;\n"],["\n ",";\n border-collapse: collapse;\n width: 100%;\n"]),u=(0,l.default)(["table-layout: fixed;"],["table-layout: fixed;"]),i=(0,l.default)(["\n font-size: 1.42857143em;\n font-style: inherit;\n font-weight: 500;\n letter-spacing: -0.008em;\n line-height: 1.2;\n margin-bottom: ","px;\n margin-top: ","px;\n text-align: left;\n"],["\n font-size: 1.42857143em;\n font-style: inherit;\n font-weight: 500;\n letter-spacing: -0.008em;\n line-height: 1.2;\n margin-bottom: ","px;\n margin-top: ","px;\n text-align: left;\n"]),d=n(20),s=r(d),f=n(22);t.Table=s.default.table(a,function(e){var t=e.isFixedSize;return t&&(0,d.css)(u)}),t.Caption=s.default.caption(i,f.gridUnit,7*f.baselineUnit)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(3),l=r(o),a=n(4),u=r(a),i=n(5),d=r(i),s=n(6),f=r(s),c=n(7),p=r(c),h=n(8),y=r(h),b=n(9),g=r(b),S=n(2),v=r(S),x=n(12),m=r(x),w=n(11),_=function(e){function t(){var e,n,r,o;(0,u.default)(this,t);for(var a=arguments.length,i=Array(a),d=0;d<a;d++)i[d]=arguments[d];return n=r=(0,f.default)(this,(e=t.__proto__||(0,l.default)(t)).call.apply(e,[this].concat(i))),r.state={page:r.props.defaultPage,sortKey:r.props.defaultSortKey,sortOrder:r.props.defaultSortOrder},r.onSetPage=function(e){r.props.onSetPage(e),r.setState({page:e})},r.onSort=function(e){var t=e.key,n=e.item,o=e.sortOrder;r.props.onSort({key:t,item:n,sortOrder:o}),r.setState({sortKey:t,sortOrder:o,page:1})},o=n,(0,f.default)(r,o)}return(0,p.default)(t,e),(0,d.default)(t,[{key:"componentWillReceiveProps",value:function(e){this.setState({page:e.page,sortKey:e.defaultSortKey,sortOrder:e.defaultSortOrder})}},{key:"render",value:function(){var e=this.props,t=e.caption,n=e.emptyView,r=e.head,o=e.isFixedSize,l=e.rows,a=e.rowsPerPage,u=this.state,i=u.page,d=u.sortKey,s=u.sortOrder;return g.default.createElement(v.default,{caption:t,emptyView:n,head:r,isFixedSize:o,onSetPage:this.onSetPage,onSort:this.onSort,page:i,rows:l,rowsPerPage:a,sortKey:d,sortOrder:s})}}]),t}(b.PureComponent);_.propTypes={defaultPage:m.default.isInteger,defaultSortKey:m.default.sortKey,defaultSortOrder:y.default.oneOf([w.ASC,w.DESC])},_.defaultProps={caption:null,defaultPage:1,defaultSortKey:null,defaultSortOrder:null,emptyView:null,head:null,isFixedSize:!1,onSetPage:function(){},onSort:function(){},rows:null,rowsPerPage:1/0},t.default=_}]); | ||
module.exports=function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.DynamicTableStateless=t.default=void 0;var o=n(2);Object.defineProperty(t,"DynamicTableStateless",{enumerable:!0,get:function(){return r(o).default}});var l=n(29),a=r(l);t.default=a.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){switch(e){case x.DESC:return x.ASC;case x.ASC:return x.DESC;default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var l=n(3),a=r(l),u=n(4),i=r(u),d=n(5),s=r(d),f=n(6),c=r(f),p=n(7),h=r(p),y=n(8),b=r(y),g=n(9),S=r(g),v=n(10),x=n(11),m=n(12),w=r(m),_=n(16),C=r(_),P=n(23),O=r(P),k=n(26),E=r(k),M=n(28),z=function(e){function t(){var e,n,r,l;(0,i.default)(this,t);for(var u=arguments.length,d=Array(u),s=0;s<u;s++)d[s]=arguments[s];return n=r=(0,c.default)(this,(e=t.__proto__||(0,a.default)(t)).call.apply(e,[this].concat(d))),r.onSort=function(e){return function(){var t=r.props,n=t.sortKey,l=t.sortOrder,a=t.onSort,u=e.key;if(u){var i=u!==n?x.ASC:o(l);r.onSetPage(1),a({key:u,item:e,sortOrder:i})}}},r.onSetPage=function(e){return r.props.onSetPage(e)},l=n,(0,c.default)(r,l)}return(0,h.default)(t,e),(0,s.default)(t,[{key:"render",value:function(){var e=this.props,t=e.caption,n=e.emptyView,r=e.head,o=e.isFixedSize,l=e.page,a=e.rows,u=e.rowsPerPage,i=e.sortKey,d=e.sortOrder,s=a?Math.ceil(a.length/u):0,f={rows:a,head:r,sortKey:i,sortOrder:d,rowsPerPage:u,page:l,isFixedSize:o},c=a&&a.length>0,p=n&&S.default.createElement(E.default,null,n);return S.default.createElement("div",null,S.default.createElement(M.Table,{isFixedSize:o},!!t&&S.default.createElement(M.Caption,null,t),r&&S.default.createElement(C.default,{head:r,onSort:this.onSort,sortKey:i,sortOrder:d}),c&&S.default.createElement(O.default,f)),s?S.default.createElement(v.Pagination,{current:l,onSetPage:this.onSetPage,total:s}):null,!c&&p)}}]),t}(g.Component);z.propTypes={caption:b.default.node,head:w.default.head,rows:w.default.rows,emptyView:b.default.node,isFixedSize:b.default.bool,rowsPerPage:w.default.isInteger,onSetPage:b.default.func,onSort:b.default.func,page:w.default.isInteger,sortKey:w.default.sortKey,sortOrder:b.default.oneOf([x.ASC,x.DESC])},z.defaultProps={caption:null,head:null,rows:null,emptyView:null,isFixedSize:!1,rowsPerPage:1/0,onSetPage:function(){},onSort:function(){},page:1,sortKey:null,sortOrder:null},t.default=z},function(e,t){e.exports=require("babel-runtime/core-js/object/get-prototype-of")},function(e,t){e.exports=require("babel-runtime/helpers/classCallCheck")},function(e,t){e.exports=require("babel-runtime/helpers/createClass")},function(e,t){e.exports=require("babel-runtime/helpers/possibleConstructorReturn")},function(e,t){e.exports=require("babel-runtime/helpers/inherits")},function(e,t){e.exports=require("prop-types")},function(e,t){e.exports=require("react")},function(e,t){e.exports=require("@atlaskit/pagination")},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ASC="ASC",t.DESC="DESC"},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){if(void 0===e[t])return null;if(!(0,f.default)(e[t])&&e[t]!==1/0){var r="'"+t+"' should be an integer or an infinity, got "+e[t]+" instead";return(0,h.createError)(t,n,r)}return null}function l(e,t,n){for(var r=arguments.length,o=Array(r>3?r-3:0),l=3;l<r;l++)o[l-3]=arguments[l];var a=p.default.arrayOf(b).apply(void 0,[e,t,n].concat(o));if(a instanceof Error)return a;if(!e.head||!e.head.cells)return null;var u=e[t].reduce(function(t,n){return t&&n.length===e.head.cells.length},!0);return u?null:(0,h.createError)(t,n,"One of the rows has different cell-count compared to head.")}function a(e,t,n){for(var r=arguments.length,o=Array(r>3?r-3:0),l=3;l<r;l++)o[l-3]=arguments[l];var a=p.default.bool.apply(p.default,[e,t,n].concat(o));return a instanceof Error?a:e[t]&&!e.key?(0,h.createError)(t,n,"'"+t+"' can't be set to true, if the 'key' prop is missing."):null}function u(e,t,n){if(!e[t])return null;var r=e.head.cells.map(function(e){return e.key}).includes(e[t]);return r?null:(0,h.createError)(t,n,"Cell with "+e[t]+" key not found in head.")}Object.defineProperty(t,"__esModule",{value:!0});var i=n(13),d=r(i),s=n(14),f=r(s),c=n(8),p=r(c),h=n(15);o.isRequired=!1;var y={key:p.default.oneOfType([p.default.number,p.default.string,p.default.bool]),content:p.default.node},b=p.default.shape(y);a.isRequired=!1;var g=(0,d.default)({},y,{isSortable:a,width:p.default.number,shouldTruncate:p.default.bool}),S=p.default.shape(g),v=p.default.shape({cells:p.default.arrayOf(S)}),x=p.default.shape({cells:l}),m=p.default.arrayOf(x);u.isRequired=!1,t.default={head:v,isInteger:o,row:x,rows:m,sortKey:u}},function(e,t){e.exports=require("babel-runtime/helpers/extends")},function(e,t){e.exports=require("babel-runtime/core-js/number/is-integer")},function(e,t){e.exports=require("@atlaskit/util-common")},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(13),l=r(o),a=n(17),u=r(a),i=n(8),d=r(i),s=n(9),f=r(s),c=n(11),p=n(18),h=n(12),y=r(h),b=function(e){var t=e.head,n=e.sortKey,r=e.sortOrder,o=e.isFixedSize,a=e.onSort;if(!t)return null;var i=t.cells,d=(0,u.default)(t,["cells"]);return f.default.createElement(p.Head,d,f.default.createElement("tr",null,i.map(function(e,t){var i=e.isSortable,d=e.key,s=e.content,c=(0,u.default)(e,["isSortable","key","content"]);return f.default.createElement(p.HeadCell,(0,l.default)({key:d||t,onClick:i&&a(e),isFixedSize:o,isSortable:i,sortOrder:d===n&&r},c),f.default.createElement("span",null,s))})))};b.propTypes={onSort:d.default.func,head:y.default.head,sortKey:y.default.sortKey,sortOrder:d.default.oneOf([c.ASC,c.DESC]),isFixedSize:d.default.bool},t.default=b},function(e,t){e.exports=require("babel-runtime/helpers/objectWithoutProperties")},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.HeadCell=t.Head=void 0;var o=n(19),l=r(o),a=(0,l.default)(["\n border-bottom: 2px solid #DFE1E6;\n"],["\n border-bottom: 2px solid #DFE1E6;\n"]),u=(0,l.default)(["\n ","\n ","\n ","\n ","\n border: none;\n color: ",";\n font-size: 12px;\n font-weight: 600;\n position: relative;\n text-align: left;\n vertical-align: top;\n"],["\n ","\n ","\n ","\n ","\n border: none;\n color: ",";\n font-size: 12px;\n font-weight: 600;\n position: relative;\n text-align: left;\n vertical-align: top;\n"]),i=n(20),d=r(i),s=n(21),f=n(22);t.Head=d.default.thead(a),t.HeadCell=d.default.th(u,function(e){return(0,f.onClickStyle)(e)},function(e){return(0,f.truncateStyle)(e)},function(e){return(0,f.arrowsStyle)(e)},f.cellStyle,s.akColorN300)},function(e,t){e.exports=require("babel-runtime/helpers/taggedTemplateLiteral")},function(e,t){e.exports=require("styled-components")},function(e,t){e.exports=require("@atlaskit/util-shared-styles")},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.cellStyle=t.arrowsStyle=t.onClickStyle=t.truncateStyle=t.baselineUnit=t.gridUnit=void 0;var o=n(19),l=r(o),a=(0,l.default)(["\n ","\n ",";\n ","\n"],["\n ","\n ",";\n ","\n"]),u=(0,l.default)(["width: ","%;"],["width: ","%;"]),i=(0,l.default)(["overflow: hidden;"],["overflow: hidden;"]),d=(0,l.default)(["\n text-overflow: ellipsis;\n white-space: nowrap;\n "],["\n text-overflow: ellipsis;\n white-space: nowrap;\n "]),s=(0,l.default)(["\n &:hover {\n cursor: pointer;\n }\n"],["\n &:hover {\n cursor: pointer;\n }\n"]),f=(0,l.default)(["\n border: 3px solid transparent;\n display: block;\n height: 0;\n position: absolute;\n right: -","px;\n width: 0;\n "],["\n border: 3px solid transparent;\n display: block;\n height: 0;\n position: absolute;\n right: -","px;\n width: 0;\n "]),c=(0,l.default)(["\n & > span {\n position: relative;\n &:before {\n ",";\n border-bottom: 3px solid ",";\n bottom: 8px;\n content: ' ';\n };\n &:after {\n ",";\n border-top: 3px solid ",";\n bottom: 0;\n content: ' ';\n };\n }\n\n &:hover > span {\n &:before {\n border-bottom: 3px solid ",";\n }\n &:after {\n border-top: 3px solid ",";\n }\n }\n "],["\n & > span {\n position: relative;\n &:before {\n ",";\n border-bottom: 3px solid ",";\n bottom: 8px;\n content: ' ';\n };\n &:after {\n ",";\n border-top: 3px solid ",";\n bottom: 0;\n content: ' ';\n };\n }\n\n &:hover > span {\n &:before {\n border-bottom: 3px solid ",";\n }\n &:after {\n border-top: 3px solid ",";\n }\n }\n "]),p=(0,l.default)(["\n border: none;\n padding: ","px ","px;\n text-align: left;\n &:first-child {\n padding-left: 0;\n }\n &:last-child {\n padding-right: 0;\n }\n"],["\n border: none;\n padding: ","px ","px;\n text-align: left;\n &:first-child {\n padding-left: 0;\n }\n &:last-child {\n padding-right: 0;\n }\n"]),h=n(20),y=n(21),b=n(11),g=t.gridUnit=parseInt(y.akGridSize,10),S=t.baselineUnit=g/2;t.truncateStyle=function(e){var t=e.width,n=e.isFixedSize,r=e.shouldTruncate;return(0,h.css)(a,t?(0,h.css)(u,t):"",n?(0,h.css)(i):"",n&&r?(0,h.css)(d):"")},t.onClickStyle=function(e){var t=e.onClick;return t&&(0,h.css)(s)},t.arrowsStyle=function(e){var t=e.isSortable,n=e.sortOrder;if(!t)return"";var r=(0,h.css)(f,g);return(0,h.css)(c,r,n===b.ASC?y.akColorN300:y.akColorN40,r,n===b.DESC?y.akColorN300:y.akColorN40,n===b.ASC?y.akColorN300:y.akColorN60,n===b.DESC?y.akColorN300:y.akColorN60)},t.cellStyle=(0,h.css)(p,S,g)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(8),l=r(o),a=n(9),u=r(a),i=n(11),d=n(24),s=r(d),f=n(12),c=r(f),p=function(e,t,n,r){if(!n||!e)return t;var o=function(t){return t.reduce(function(t,r,o){return t||e.cells[o].key===n&&(void 0!==r.key?r.key:r.content)},null)};return t.sort(function(e,t){var n=o(e.cells),l=o(t.cells),a=r===i.ASC?1:-1;return!n||n<l?-a:!l||n>l?a:0})},h=function(e){var t=e.rows,n=e.head,r=e.sortKey,o=e.sortOrder,l=e.rowsPerPage,a=e.page,i=e.isFixedSize,d=p(n,t,r,o)||[];return u.default.createElement("tbody",null,d.slice((a-1)*l,a*l).map(function(e,t){return u.default.createElement(s.default,{row:e,rowIndex:t,head:n,isFixedSize:i})}))};h.propTypes={head:c.default.head,rows:c.default.rows,sortKey:c.default.sortKey,sortOrder:l.default.oneOf([i.ASC,i.DESC]),rowsPerPage:c.default.isInteger,page:c.default.isInteger,isFixedSize:l.default.bool},t.default=h},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(13),l=r(o),a=n(17),u=r(a),i=n(8),d=r(i),s=n(9),f=r(s),c=n(25),p=n(12),h=r(p),y=function(e){var t=e.row,n=e.rowIndex,r=e.head,o=e.isFixedSize,a=t.cells,i=(0,u.default)(t,["cells"]);return f.default.createElement(c.TableBodyRow,(0,l.default)({key:n},i),a.map(function(e,t){var n=e.content,a=(0,u.default)(e,["content"]),i=(r||{cells:[]}).cells[t]||{},d=i.shouldTruncate,s=i.width;return f.default.createElement(c.TableBodyCell,(0,l.default)({},a,{key:t,width:s,shouldTruncate:d,isFixedSize:o}),n)}))};y.propTypes={row:h.default.row,rowIndex:d.default.number,head:h.default.head,isFixedSize:d.default.bool},t.default=y},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.TableBodyCell=t.TableBodyRow=void 0;var o=n(19),l=r(o),a=(0,l.default)(["\n ","\n &:hover {\n background: ",";\n }\n"],["\n ","\n &:hover {\n background: ",";\n }\n"]),u=(0,l.default)(["\n ","\n ","\n ","\n"],["\n ","\n ","\n ","\n"]),i=n(20),d=r(i),s=n(21),f=n(22);t.TableBodyRow=d.default.tr(a,function(e){return(0,f.onClickStyle)(e)},s.akColorN10),t.TableBodyCell=d.default.td(u,function(e){return(0,f.onClickStyle)(e)},function(e){return(0,f.truncateStyle)(e)},f.cellStyle)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(8),l=r(o),a=n(9),u=r(a),i=n(27),d=r(i),s=function(e){var t=e.children;return u.default.createElement(d.default,null,t)};s.propTypes={children:l.default.node},t.default=s},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(19),l=r(o),a=(0,l.default)(["\n margin: auto;\n width: 50%;\n text-align: center;\n padding: 10px;\n"],["\n margin: auto;\n width: 50%;\n text-align: center;\n padding: 10px;\n"]),u=n(20),i=r(u);t.default=i.default.div(a)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Caption=t.Table=void 0;var o=n(19),l=r(o),a=(0,l.default)(["\n ",";\n border-collapse: collapse;\n width: 100%;\n"],["\n ",";\n border-collapse: collapse;\n width: 100%;\n"]),u=(0,l.default)(["table-layout: fixed;"],["table-layout: fixed;"]),i=(0,l.default)(["\n font-size: 1.42857143em;\n font-style: inherit;\n font-weight: 500;\n letter-spacing: -0.008em;\n line-height: 1.2;\n margin-bottom: ","px;\n margin-top: ","px;\n text-align: left;\n"],["\n font-size: 1.42857143em;\n font-style: inherit;\n font-weight: 500;\n letter-spacing: -0.008em;\n line-height: 1.2;\n margin-bottom: ","px;\n margin-top: ","px;\n text-align: left;\n"]),d=n(20),s=r(d),f=n(22);t.Table=s.default.table(a,function(e){var t=e.isFixedSize;return t&&(0,d.css)(u)}),t.Caption=s.default.caption(i,f.gridUnit,7*f.baselineUnit)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(3),l=r(o),a=n(4),u=r(a),i=n(5),d=r(i),s=n(6),f=r(s),c=n(7),p=r(c),h=n(8),y=r(h),b=n(9),g=r(b),S=n(2),v=r(S),x=n(12),m=r(x),w=n(11),_=function(e){function t(){var e,n,r,o;(0,u.default)(this,t);for(var a=arguments.length,i=Array(a),d=0;d<a;d++)i[d]=arguments[d];return n=r=(0,f.default)(this,(e=t.__proto__||(0,l.default)(t)).call.apply(e,[this].concat(i))),r.state={page:r.props.defaultPage,sortKey:r.props.defaultSortKey,sortOrder:r.props.defaultSortOrder},r.onSetPage=function(e){r.props.onSetPage(e),r.setState({page:e})},r.onSort=function(e){var t=e.key,n=e.item,o=e.sortOrder;r.props.onSort({key:t,item:n,sortOrder:o}),r.setState({sortKey:t,sortOrder:o,page:1})},o=n,(0,f.default)(r,o)}return(0,p.default)(t,e),(0,d.default)(t,[{key:"componentWillReceiveProps",value:function(e){this.setState({page:e.page,sortKey:e.defaultSortKey,sortOrder:e.defaultSortOrder})}},{key:"render",value:function(){var e=this.props,t=e.caption,n=e.emptyView,r=e.head,o=e.isFixedSize,l=e.rows,a=e.rowsPerPage,u=this.state,i=u.page,d=u.sortKey,s=u.sortOrder;return g.default.createElement(v.default,{caption:t,emptyView:n,head:r,isFixedSize:o,onSetPage:this.onSetPage,onSort:this.onSort,page:i,rows:l,rowsPerPage:a,sortKey:d,sortOrder:s})}}]),t}(b.PureComponent);_.propTypes={defaultPage:m.default.isInteger,defaultSortKey:m.default.sortKey,defaultSortOrder:y.default.oneOf([w.ASC,w.DESC])},_.defaultProps={caption:null,defaultPage:1,defaultSortKey:null,defaultSortOrder:null,emptyView:null,head:null,isFixedSize:!1,onSetPage:function(){},onSort:function(){},rows:null,rowsPerPage:1/0},t.default=_}]); |
@@ -151,3 +151,3 @@ !function(root, factory) { | ||
isFixedSize: isFixedSize | ||
}, rowsExist = rows && rows.length, emptyBody = emptyView && _react2.default.createElement(_EmptyBody2.default, null, emptyView); | ||
}, rowsExist = rows && rows.length > 0, emptyBody = emptyView && _react2.default.createElement(_EmptyBody2.default, null, emptyView); | ||
return _react2.default.createElement("div", null, _react2.default.createElement(_DynamicTable.Table, { | ||
@@ -154,0 +154,0 @@ isFixedSize: isFixedSize |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("babel-runtime/core-js/object/get-prototype-of"),require("babel-runtime/helpers/classCallCheck"),require("babel-runtime/helpers/createClass"),require("babel-runtime/helpers/possibleConstructorReturn"),require("babel-runtime/helpers/inherits"),require("prop-types"),require("react"),require("@atlaskit/pagination"),require("babel-runtime/helpers/extends"),require("babel-runtime/core-js/number/is-integer"),require("@atlaskit/util-common"),require("babel-runtime/helpers/objectWithoutProperties"),require("babel-runtime/helpers/taggedTemplateLiteral"),require("styled-components"),require("@atlaskit/util-shared-styles")):"function"==typeof define&&define.amd?define(["babel-runtime/core-js/object/get-prototype-of","babel-runtime/helpers/classCallCheck","babel-runtime/helpers/createClass","babel-runtime/helpers/possibleConstructorReturn","babel-runtime/helpers/inherits","prop-types","react","@atlaskit/pagination","babel-runtime/helpers/extends","babel-runtime/core-js/number/is-integer","@atlaskit/util-common","babel-runtime/helpers/objectWithoutProperties","babel-runtime/helpers/taggedTemplateLiteral","styled-components","@atlaskit/util-shared-styles"],t):"object"==typeof exports?exports["@atlaskit/dynamicTable"]=t(require("babel-runtime/core-js/object/get-prototype-of"),require("babel-runtime/helpers/classCallCheck"),require("babel-runtime/helpers/createClass"),require("babel-runtime/helpers/possibleConstructorReturn"),require("babel-runtime/helpers/inherits"),require("prop-types"),require("react"),require("@atlaskit/pagination"),require("babel-runtime/helpers/extends"),require("babel-runtime/core-js/number/is-integer"),require("@atlaskit/util-common"),require("babel-runtime/helpers/objectWithoutProperties"),require("babel-runtime/helpers/taggedTemplateLiteral"),require("styled-components"),require("@atlaskit/util-shared-styles")):e["@atlaskit/dynamicTable"]=t(e["babel-runtime/core-js/object/get-prototype-of"],e["babel-runtime/helpers/classCallCheck"],e["babel-runtime/helpers/createClass"],e["babel-runtime/helpers/possibleConstructorReturn"],e["babel-runtime/helpers/inherits"],e["prop-types"],e.react,e["@atlaskit/pagination"],e["babel-runtime/helpers/extends"],e["babel-runtime/core-js/number/is-integer"],e["@atlaskit/util-common"],e["babel-runtime/helpers/objectWithoutProperties"],e["babel-runtime/helpers/taggedTemplateLiteral"],e["styled-components"],e["@atlaskit/util-shared-styles"])}(this,function(e,t,r,n,o,l,a,i,u,s,d,f,c,p,b){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){e.exports=r(1)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.DynamicTableStateless=t.default=void 0;var o=r(2);Object.defineProperty(t,"DynamicTableStateless",{enumerable:!0,get:function(){return n(o).default}});var l=r(29),a=n(l);t.default=a.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e){switch(e){case v.DESC:return v.ASC;case v.ASC:return v.DESC;default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var l=r(3),a=n(l),i=r(4),u=n(i),s=r(5),d=n(s),f=r(6),c=n(f),p=r(7),b=n(p),h=r(8),y=n(h),m=r(9),g=n(m),S=r(10),v=r(11),x=r(12),w=n(x),C=r(16),_=n(C),k=r(23),P=n(k),O=r(26),E=n(O),j=r(28),q=function(e){function t(){var e,r,n,l;(0,u.default)(this,t);for(var i=arguments.length,s=Array(i),d=0;d<i;d++)s[d]=arguments[d];return r=n=(0,c.default)(this,(e=t.__proto__||(0,a.default)(t)).call.apply(e,[this].concat(s))),n.onSort=function(e){return function(){var t=n.props,r=t.sortKey,l=t.sortOrder,a=t.onSort,i=e.key;if(i){var u=i!==r?v.ASC:o(l);n.onSetPage(1),a({key:i,item:e,sortOrder:u})}}},n.onSetPage=function(e){return n.props.onSetPage(e)},l=r,(0,c.default)(n,l)}return(0,b.default)(t,e),(0,d.default)(t,[{key:"render",value:function(){var e=this.props,t=e.caption,r=e.emptyView,n=e.head,o=e.isFixedSize,l=e.page,a=e.rows,i=e.rowsPerPage,u=e.sortKey,s=e.sortOrder,d=a?Math.ceil(a.length/i):0,f={rows:a,head:n,sortKey:u,sortOrder:s,rowsPerPage:i,page:l,isFixedSize:o},c=a&&a.length,p=r&&g.default.createElement(E.default,null,r);return g.default.createElement("div",null,g.default.createElement(j.Table,{isFixedSize:o},!!t&&g.default.createElement(j.Caption,null,t),n&&g.default.createElement(_.default,{head:n,onSort:this.onSort,sortKey:u,sortOrder:s}),c&&g.default.createElement(P.default,f)),d?g.default.createElement(S.Pagination,{current:l,onSetPage:this.onSetPage,total:d}):null,!c&&p)}}]),t}(m.Component);q.propTypes={caption:y.default.node,head:w.default.head,rows:w.default.rows,emptyView:y.default.node,isFixedSize:y.default.bool,rowsPerPage:w.default.isInteger,onSetPage:y.default.func,onSort:y.default.func,page:w.default.isInteger,sortKey:w.default.sortKey,sortOrder:y.default.oneOf([v.ASC,v.DESC])},q.defaultProps={caption:null,head:null,rows:null,emptyView:null,isFixedSize:!1,rowsPerPage:1/0,onSetPage:function(){},onSort:function(){},page:1,sortKey:null,sortOrder:null},t.default=q},function(t,r){t.exports=e},function(e,r){e.exports=t},function(e,t){e.exports=r},function(e,t){e.exports=n},function(e,t){e.exports=o},function(e,t){e.exports=l},function(e,t){e.exports=a},function(e,t){e.exports=i},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ASC="ASC",t.DESC="DESC"},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t,r){if(void 0===e[t])return null;if(!(0,f.default)(e[t])&&e[t]!==1/0){var n="'"+t+"' should be an integer or an infinity, got "+e[t]+" instead";return(0,b.createError)(t,r,n)}return null}function l(e,t,r){for(var n=arguments.length,o=Array(n>3?n-3:0),l=3;l<n;l++)o[l-3]=arguments[l];var a=p.default.arrayOf(y).apply(void 0,[e,t,r].concat(o));if(a instanceof Error)return a;if(!e.head||!e.head.cells)return null;var i=e[t].reduce(function(t,r){return t&&r.length===e.head.cells.length},!0);return i?null:(0,b.createError)(t,r,"One of the rows has different cell-count compared to head.")}function a(e,t,r){for(var n=arguments.length,o=Array(n>3?n-3:0),l=3;l<n;l++)o[l-3]=arguments[l];var a=p.default.bool.apply(p.default,[e,t,r].concat(o));return a instanceof Error?a:e[t]&&!e.key?(0,b.createError)(t,r,"'"+t+"' can't be set to true, if the 'key' prop is missing."):null}function i(e,t,r){if(!e[t])return null;var n=e.head.cells.map(function(e){return e.key}).includes(e[t]);return n?null:(0,b.createError)(t,r,"Cell with "+e[t]+" key not found in head.")}Object.defineProperty(t,"__esModule",{value:!0});var u=r(13),s=n(u),d=r(14),f=n(d),c=r(8),p=n(c),b=r(15);o.isRequired=!1;var h={key:p.default.oneOfType([p.default.number,p.default.string,p.default.bool]),content:p.default.node},y=p.default.shape(h);a.isRequired=!1;var m=(0,s.default)({},h,{isSortable:a,width:p.default.number,shouldTruncate:p.default.bool}),g=p.default.shape(m),S=p.default.shape({cells:p.default.arrayOf(g)}),v=p.default.shape({cells:l}),x=p.default.arrayOf(v);i.isRequired=!1,t.default={head:S,isInteger:o,row:v,rows:x,sortKey:i}},function(e,t){e.exports=u},function(e,t){e.exports=s},function(e,t){e.exports=d},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=r(13),l=n(o),a=r(17),i=n(a),u=r(8),s=n(u),d=r(9),f=n(d),c=r(11),p=r(18),b=r(12),h=n(b),y=function(e){var t=e.head,r=e.sortKey,n=e.sortOrder,o=e.isFixedSize,a=e.onSort;if(!t)return null;var u=t.cells,s=(0,i.default)(t,["cells"]);return f.default.createElement(p.Head,s,f.default.createElement("tr",null,u.map(function(e,t){var u=e.isSortable,s=e.key,d=e.content,c=(0,i.default)(e,["isSortable","key","content"]);return f.default.createElement(p.HeadCell,(0,l.default)({key:s||t,onClick:u&&a(e),isFixedSize:o,isSortable:u,sortOrder:s===r&&n},c),f.default.createElement("span",null,d))})))};y.propTypes={onSort:s.default.func,head:h.default.head,sortKey:h.default.sortKey,sortOrder:s.default.oneOf([c.ASC,c.DESC]),isFixedSize:s.default.bool},t.default=y},function(e,t){e.exports=f},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.HeadCell=t.Head=void 0;var o=r(19),l=n(o),a=(0,l.default)(["\n border-bottom: 2px solid #DFE1E6;\n"],["\n border-bottom: 2px solid #DFE1E6;\n"]),i=(0,l.default)(["\n ","\n ","\n ","\n ","\n border: none;\n color: ",";\n font-size: 12px;\n font-weight: 600;\n position: relative;\n text-align: left;\n vertical-align: top;\n"],["\n ","\n ","\n ","\n ","\n border: none;\n color: ",";\n font-size: 12px;\n font-weight: 600;\n position: relative;\n text-align: left;\n vertical-align: top;\n"]),u=r(20),s=n(u),d=r(21),f=r(22);t.Head=s.default.thead(a),t.HeadCell=s.default.th(i,function(e){return(0,f.onClickStyle)(e)},function(e){return(0,f.truncateStyle)(e)},function(e){return(0,f.arrowsStyle)(e)},f.cellStyle,d.akColorN300)},function(e,t){e.exports=c},function(e,t){e.exports=p},function(e,t){e.exports=b},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.cellStyle=t.arrowsStyle=t.onClickStyle=t.truncateStyle=t.baselineUnit=t.gridUnit=void 0;var o=r(19),l=n(o),a=(0,l.default)(["\n ","\n ",";\n ","\n"],["\n ","\n ",";\n ","\n"]),i=(0,l.default)(["width: ","%;"],["width: ","%;"]),u=(0,l.default)(["overflow: hidden;"],["overflow: hidden;"]),s=(0,l.default)(["\n text-overflow: ellipsis;\n white-space: nowrap;\n "],["\n text-overflow: ellipsis;\n white-space: nowrap;\n "]),d=(0,l.default)(["\n &:hover {\n cursor: pointer;\n }\n"],["\n &:hover {\n cursor: pointer;\n }\n"]),f=(0,l.default)(["\n border: 3px solid transparent;\n display: block;\n height: 0;\n position: absolute;\n right: -","px;\n width: 0;\n "],["\n border: 3px solid transparent;\n display: block;\n height: 0;\n position: absolute;\n right: -","px;\n width: 0;\n "]),c=(0,l.default)(["\n & > span {\n position: relative;\n &:before {\n ",";\n border-bottom: 3px solid ",";\n bottom: 8px;\n content: ' ';\n };\n &:after {\n ",";\n border-top: 3px solid ",";\n bottom: 0;\n content: ' ';\n };\n }\n\n &:hover > span {\n &:before {\n border-bottom: 3px solid ",";\n }\n &:after {\n border-top: 3px solid ",";\n }\n }\n "],["\n & > span {\n position: relative;\n &:before {\n ",";\n border-bottom: 3px solid ",";\n bottom: 8px;\n content: ' ';\n };\n &:after {\n ",";\n border-top: 3px solid ",";\n bottom: 0;\n content: ' ';\n };\n }\n\n &:hover > span {\n &:before {\n border-bottom: 3px solid ",";\n }\n &:after {\n border-top: 3px solid ",";\n }\n }\n "]),p=(0,l.default)(["\n border: none;\n padding: ","px ","px;\n text-align: left;\n &:first-child {\n padding-left: 0;\n }\n &:last-child {\n padding-right: 0;\n }\n"],["\n border: none;\n padding: ","px ","px;\n text-align: left;\n &:first-child {\n padding-left: 0;\n }\n &:last-child {\n padding-right: 0;\n }\n"]),b=r(20),h=r(21),y=r(11),m=t.gridUnit=parseInt(h.akGridSize,10),g=t.baselineUnit=m/2;t.truncateStyle=function(e){var t=e.width,r=e.isFixedSize,n=e.shouldTruncate;return(0,b.css)(a,t?(0,b.css)(i,t):"",r?(0,b.css)(u):"",r&&n?(0,b.css)(s):"")},t.onClickStyle=function(e){var t=e.onClick;return t&&(0,b.css)(d)},t.arrowsStyle=function(e){var t=e.isSortable,r=e.sortOrder;if(!t)return"";var n=(0,b.css)(f,m);return(0,b.css)(c,n,r===y.ASC?h.akColorN300:h.akColorN40,n,r===y.DESC?h.akColorN300:h.akColorN40,r===y.ASC?h.akColorN300:h.akColorN60,r===y.DESC?h.akColorN300:h.akColorN60)},t.cellStyle=(0,b.css)(p,g,m)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=r(8),l=n(o),a=r(9),i=n(a),u=r(11),s=r(24),d=n(s),f=r(12),c=n(f),p=function(e,t,r,n){if(!r||!e)return t;var o=function(t){return t.reduce(function(t,n,o){return t||e.cells[o].key===r&&(void 0!==n.key?n.key:n.content)},null)};return t.sort(function(e,t){var r=o(e.cells),l=o(t.cells),a=n===u.ASC?1:-1;return!r||r<l?-a:!l||r>l?a:0})},b=function(e){var t=e.rows,r=e.head,n=e.sortKey,o=e.sortOrder,l=e.rowsPerPage,a=e.page,u=e.isFixedSize,s=p(r,t,n,o)||[];return i.default.createElement("tbody",null,s.slice((a-1)*l,a*l).map(function(e,t){return i.default.createElement(d.default,{row:e,rowIndex:t,head:r,isFixedSize:u})}))};b.propTypes={head:c.default.head,rows:c.default.rows,sortKey:c.default.sortKey,sortOrder:l.default.oneOf([u.ASC,u.DESC]),rowsPerPage:c.default.isInteger,page:c.default.isInteger,isFixedSize:l.default.bool},t.default=b},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=r(13),l=n(o),a=r(17),i=n(a),u=r(8),s=n(u),d=r(9),f=n(d),c=r(25),p=r(12),b=n(p),h=function(e){var t=e.row,r=e.rowIndex,n=e.head,o=e.isFixedSize,a=t.cells,u=(0,i.default)(t,["cells"]);return f.default.createElement(c.TableBodyRow,(0,l.default)({key:r},u),a.map(function(e,t){var r=e.content,a=(0,i.default)(e,["content"]),u=(n||{cells:[]}).cells[t]||{},s=u.shouldTruncate,d=u.width;return f.default.createElement(c.TableBodyCell,(0,l.default)({},a,{key:t,width:d,shouldTruncate:s,isFixedSize:o}),r)}))};h.propTypes={row:b.default.row,rowIndex:s.default.number,head:b.default.head,isFixedSize:s.default.bool},t.default=h},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.TableBodyCell=t.TableBodyRow=void 0;var o=r(19),l=n(o),a=(0,l.default)(["\n ","\n &:hover {\n background: ",";\n }\n"],["\n ","\n &:hover {\n background: ",";\n }\n"]),i=(0,l.default)(["\n ","\n ","\n ","\n"],["\n ","\n ","\n ","\n"]),u=r(20),s=n(u),d=r(21),f=r(22);t.TableBodyRow=s.default.tr(a,function(e){return(0,f.onClickStyle)(e)},d.akColorN10),t.TableBodyCell=s.default.td(i,function(e){return(0,f.onClickStyle)(e)},function(e){return(0,f.truncateStyle)(e)},f.cellStyle)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=r(8),l=n(o),a=r(9),i=n(a),u=r(27),s=n(u),d=function(e){var t=e.children;return i.default.createElement(s.default,null,t)};d.propTypes={children:l.default.node},t.default=d},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=r(19),l=n(o),a=(0,l.default)(["\n margin: auto;\n width: 50%;\n text-align: center;\n padding: 10px;\n"],["\n margin: auto;\n width: 50%;\n text-align: center;\n padding: 10px;\n"]),i=r(20),u=n(i);t.default=u.default.div(a)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Caption=t.Table=void 0;var o=r(19),l=n(o),a=(0,l.default)(["\n ",";\n border-collapse: collapse;\n width: 100%;\n"],["\n ",";\n border-collapse: collapse;\n width: 100%;\n"]),i=(0,l.default)(["table-layout: fixed;"],["table-layout: fixed;"]),u=(0,l.default)(["\n font-size: 1.42857143em;\n font-style: inherit;\n font-weight: 500;\n letter-spacing: -0.008em;\n line-height: 1.2;\n margin-bottom: ","px;\n margin-top: ","px;\n text-align: left;\n"],["\n font-size: 1.42857143em;\n font-style: inherit;\n font-weight: 500;\n letter-spacing: -0.008em;\n line-height: 1.2;\n margin-bottom: ","px;\n margin-top: ","px;\n text-align: left;\n"]),s=r(20),d=n(s),f=r(22);t.Table=d.default.table(a,function(e){var t=e.isFixedSize;return t&&(0,s.css)(i)}),t.Caption=d.default.caption(u,f.gridUnit,7*f.baselineUnit)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=r(3),l=n(o),a=r(4),i=n(a),u=r(5),s=n(u),d=r(6),f=n(d),c=r(7),p=n(c),b=r(8),h=n(b),y=r(9),m=n(y),g=r(2),S=n(g),v=r(12),x=n(v),w=r(11),C=function(e){function t(){var e,r,n,o;(0,i.default)(this,t);for(var a=arguments.length,u=Array(a),s=0;s<a;s++)u[s]=arguments[s];return r=n=(0,f.default)(this,(e=t.__proto__||(0,l.default)(t)).call.apply(e,[this].concat(u))),n.state={page:n.props.defaultPage,sortKey:n.props.defaultSortKey,sortOrder:n.props.defaultSortOrder},n.onSetPage=function(e){n.props.onSetPage(e),n.setState({page:e})},n.onSort=function(e){var t=e.key,r=e.item,o=e.sortOrder;n.props.onSort({key:t,item:r,sortOrder:o}),n.setState({sortKey:t,sortOrder:o,page:1})},o=r,(0,f.default)(n,o)}return(0,p.default)(t,e),(0,s.default)(t,[{key:"componentWillReceiveProps",value:function(e){this.setState({page:e.page,sortKey:e.defaultSortKey,sortOrder:e.defaultSortOrder})}},{key:"render",value:function(){var e=this.props,t=e.caption,r=e.emptyView,n=e.head,o=e.isFixedSize,l=e.rows,a=e.rowsPerPage,i=this.state,u=i.page,s=i.sortKey,d=i.sortOrder;return m.default.createElement(S.default,{caption:t,emptyView:r,head:n,isFixedSize:o,onSetPage:this.onSetPage,onSort:this.onSort,page:u,rows:l,rowsPerPage:a,sortKey:s,sortOrder:d})}}]),t}(y.PureComponent);C.propTypes={defaultPage:x.default.isInteger,defaultSortKey:x.default.sortKey,defaultSortOrder:h.default.oneOf([w.ASC,w.DESC])},C.defaultProps={caption:null,defaultPage:1,defaultSortKey:null,defaultSortOrder:null,emptyView:null,head:null,isFixedSize:!1,onSetPage:function(){},onSort:function(){},rows:null,rowsPerPage:1/0},t.default=C}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("babel-runtime/core-js/object/get-prototype-of"),require("babel-runtime/helpers/classCallCheck"),require("babel-runtime/helpers/createClass"),require("babel-runtime/helpers/possibleConstructorReturn"),require("babel-runtime/helpers/inherits"),require("prop-types"),require("react"),require("@atlaskit/pagination"),require("babel-runtime/helpers/extends"),require("babel-runtime/core-js/number/is-integer"),require("@atlaskit/util-common"),require("babel-runtime/helpers/objectWithoutProperties"),require("babel-runtime/helpers/taggedTemplateLiteral"),require("styled-components"),require("@atlaskit/util-shared-styles")):"function"==typeof define&&define.amd?define(["babel-runtime/core-js/object/get-prototype-of","babel-runtime/helpers/classCallCheck","babel-runtime/helpers/createClass","babel-runtime/helpers/possibleConstructorReturn","babel-runtime/helpers/inherits","prop-types","react","@atlaskit/pagination","babel-runtime/helpers/extends","babel-runtime/core-js/number/is-integer","@atlaskit/util-common","babel-runtime/helpers/objectWithoutProperties","babel-runtime/helpers/taggedTemplateLiteral","styled-components","@atlaskit/util-shared-styles"],t):"object"==typeof exports?exports["@atlaskit/dynamicTable"]=t(require("babel-runtime/core-js/object/get-prototype-of"),require("babel-runtime/helpers/classCallCheck"),require("babel-runtime/helpers/createClass"),require("babel-runtime/helpers/possibleConstructorReturn"),require("babel-runtime/helpers/inherits"),require("prop-types"),require("react"),require("@atlaskit/pagination"),require("babel-runtime/helpers/extends"),require("babel-runtime/core-js/number/is-integer"),require("@atlaskit/util-common"),require("babel-runtime/helpers/objectWithoutProperties"),require("babel-runtime/helpers/taggedTemplateLiteral"),require("styled-components"),require("@atlaskit/util-shared-styles")):e["@atlaskit/dynamicTable"]=t(e["babel-runtime/core-js/object/get-prototype-of"],e["babel-runtime/helpers/classCallCheck"],e["babel-runtime/helpers/createClass"],e["babel-runtime/helpers/possibleConstructorReturn"],e["babel-runtime/helpers/inherits"],e["prop-types"],e.react,e["@atlaskit/pagination"],e["babel-runtime/helpers/extends"],e["babel-runtime/core-js/number/is-integer"],e["@atlaskit/util-common"],e["babel-runtime/helpers/objectWithoutProperties"],e["babel-runtime/helpers/taggedTemplateLiteral"],e["styled-components"],e["@atlaskit/util-shared-styles"])}(this,function(e,t,r,n,o,l,a,i,u,s,d,f,c,p,b){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){e.exports=r(1)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.DynamicTableStateless=t.default=void 0;var o=r(2);Object.defineProperty(t,"DynamicTableStateless",{enumerable:!0,get:function(){return n(o).default}});var l=r(29),a=n(l);t.default=a.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e){switch(e){case v.DESC:return v.ASC;case v.ASC:return v.DESC;default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var l=r(3),a=n(l),i=r(4),u=n(i),s=r(5),d=n(s),f=r(6),c=n(f),p=r(7),b=n(p),h=r(8),y=n(h),m=r(9),g=n(m),S=r(10),v=r(11),x=r(12),w=n(x),C=r(16),_=n(C),k=r(23),P=n(k),O=r(26),E=n(O),j=r(28),q=function(e){function t(){var e,r,n,l;(0,u.default)(this,t);for(var i=arguments.length,s=Array(i),d=0;d<i;d++)s[d]=arguments[d];return r=n=(0,c.default)(this,(e=t.__proto__||(0,a.default)(t)).call.apply(e,[this].concat(s))),n.onSort=function(e){return function(){var t=n.props,r=t.sortKey,l=t.sortOrder,a=t.onSort,i=e.key;if(i){var u=i!==r?v.ASC:o(l);n.onSetPage(1),a({key:i,item:e,sortOrder:u})}}},n.onSetPage=function(e){return n.props.onSetPage(e)},l=r,(0,c.default)(n,l)}return(0,b.default)(t,e),(0,d.default)(t,[{key:"render",value:function(){var e=this.props,t=e.caption,r=e.emptyView,n=e.head,o=e.isFixedSize,l=e.page,a=e.rows,i=e.rowsPerPage,u=e.sortKey,s=e.sortOrder,d=a?Math.ceil(a.length/i):0,f={rows:a,head:n,sortKey:u,sortOrder:s,rowsPerPage:i,page:l,isFixedSize:o},c=a&&a.length>0,p=r&&g.default.createElement(E.default,null,r);return g.default.createElement("div",null,g.default.createElement(j.Table,{isFixedSize:o},!!t&&g.default.createElement(j.Caption,null,t),n&&g.default.createElement(_.default,{head:n,onSort:this.onSort,sortKey:u,sortOrder:s}),c&&g.default.createElement(P.default,f)),d?g.default.createElement(S.Pagination,{current:l,onSetPage:this.onSetPage,total:d}):null,!c&&p)}}]),t}(m.Component);q.propTypes={caption:y.default.node,head:w.default.head,rows:w.default.rows,emptyView:y.default.node,isFixedSize:y.default.bool,rowsPerPage:w.default.isInteger,onSetPage:y.default.func,onSort:y.default.func,page:w.default.isInteger,sortKey:w.default.sortKey,sortOrder:y.default.oneOf([v.ASC,v.DESC])},q.defaultProps={caption:null,head:null,rows:null,emptyView:null,isFixedSize:!1,rowsPerPage:1/0,onSetPage:function(){},onSort:function(){},page:1,sortKey:null,sortOrder:null},t.default=q},function(t,r){t.exports=e},function(e,r){e.exports=t},function(e,t){e.exports=r},function(e,t){e.exports=n},function(e,t){e.exports=o},function(e,t){e.exports=l},function(e,t){e.exports=a},function(e,t){e.exports=i},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ASC="ASC",t.DESC="DESC"},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t,r){if(void 0===e[t])return null;if(!(0,f.default)(e[t])&&e[t]!==1/0){var n="'"+t+"' should be an integer or an infinity, got "+e[t]+" instead";return(0,b.createError)(t,r,n)}return null}function l(e,t,r){for(var n=arguments.length,o=Array(n>3?n-3:0),l=3;l<n;l++)o[l-3]=arguments[l];var a=p.default.arrayOf(y).apply(void 0,[e,t,r].concat(o));if(a instanceof Error)return a;if(!e.head||!e.head.cells)return null;var i=e[t].reduce(function(t,r){return t&&r.length===e.head.cells.length},!0);return i?null:(0,b.createError)(t,r,"One of the rows has different cell-count compared to head.")}function a(e,t,r){for(var n=arguments.length,o=Array(n>3?n-3:0),l=3;l<n;l++)o[l-3]=arguments[l];var a=p.default.bool.apply(p.default,[e,t,r].concat(o));return a instanceof Error?a:e[t]&&!e.key?(0,b.createError)(t,r,"'"+t+"' can't be set to true, if the 'key' prop is missing."):null}function i(e,t,r){if(!e[t])return null;var n=e.head.cells.map(function(e){return e.key}).includes(e[t]);return n?null:(0,b.createError)(t,r,"Cell with "+e[t]+" key not found in head.")}Object.defineProperty(t,"__esModule",{value:!0});var u=r(13),s=n(u),d=r(14),f=n(d),c=r(8),p=n(c),b=r(15);o.isRequired=!1;var h={key:p.default.oneOfType([p.default.number,p.default.string,p.default.bool]),content:p.default.node},y=p.default.shape(h);a.isRequired=!1;var m=(0,s.default)({},h,{isSortable:a,width:p.default.number,shouldTruncate:p.default.bool}),g=p.default.shape(m),S=p.default.shape({cells:p.default.arrayOf(g)}),v=p.default.shape({cells:l}),x=p.default.arrayOf(v);i.isRequired=!1,t.default={head:S,isInteger:o,row:v,rows:x,sortKey:i}},function(e,t){e.exports=u},function(e,t){e.exports=s},function(e,t){e.exports=d},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=r(13),l=n(o),a=r(17),i=n(a),u=r(8),s=n(u),d=r(9),f=n(d),c=r(11),p=r(18),b=r(12),h=n(b),y=function(e){var t=e.head,r=e.sortKey,n=e.sortOrder,o=e.isFixedSize,a=e.onSort;if(!t)return null;var u=t.cells,s=(0,i.default)(t,["cells"]);return f.default.createElement(p.Head,s,f.default.createElement("tr",null,u.map(function(e,t){var u=e.isSortable,s=e.key,d=e.content,c=(0,i.default)(e,["isSortable","key","content"]);return f.default.createElement(p.HeadCell,(0,l.default)({key:s||t,onClick:u&&a(e),isFixedSize:o,isSortable:u,sortOrder:s===r&&n},c),f.default.createElement("span",null,d))})))};y.propTypes={onSort:s.default.func,head:h.default.head,sortKey:h.default.sortKey,sortOrder:s.default.oneOf([c.ASC,c.DESC]),isFixedSize:s.default.bool},t.default=y},function(e,t){e.exports=f},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.HeadCell=t.Head=void 0;var o=r(19),l=n(o),a=(0,l.default)(["\n border-bottom: 2px solid #DFE1E6;\n"],["\n border-bottom: 2px solid #DFE1E6;\n"]),i=(0,l.default)(["\n ","\n ","\n ","\n ","\n border: none;\n color: ",";\n font-size: 12px;\n font-weight: 600;\n position: relative;\n text-align: left;\n vertical-align: top;\n"],["\n ","\n ","\n ","\n ","\n border: none;\n color: ",";\n font-size: 12px;\n font-weight: 600;\n position: relative;\n text-align: left;\n vertical-align: top;\n"]),u=r(20),s=n(u),d=r(21),f=r(22);t.Head=s.default.thead(a),t.HeadCell=s.default.th(i,function(e){return(0,f.onClickStyle)(e)},function(e){return(0,f.truncateStyle)(e)},function(e){return(0,f.arrowsStyle)(e)},f.cellStyle,d.akColorN300)},function(e,t){e.exports=c},function(e,t){e.exports=p},function(e,t){e.exports=b},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.cellStyle=t.arrowsStyle=t.onClickStyle=t.truncateStyle=t.baselineUnit=t.gridUnit=void 0;var o=r(19),l=n(o),a=(0,l.default)(["\n ","\n ",";\n ","\n"],["\n ","\n ",";\n ","\n"]),i=(0,l.default)(["width: ","%;"],["width: ","%;"]),u=(0,l.default)(["overflow: hidden;"],["overflow: hidden;"]),s=(0,l.default)(["\n text-overflow: ellipsis;\n white-space: nowrap;\n "],["\n text-overflow: ellipsis;\n white-space: nowrap;\n "]),d=(0,l.default)(["\n &:hover {\n cursor: pointer;\n }\n"],["\n &:hover {\n cursor: pointer;\n }\n"]),f=(0,l.default)(["\n border: 3px solid transparent;\n display: block;\n height: 0;\n position: absolute;\n right: -","px;\n width: 0;\n "],["\n border: 3px solid transparent;\n display: block;\n height: 0;\n position: absolute;\n right: -","px;\n width: 0;\n "]),c=(0,l.default)(["\n & > span {\n position: relative;\n &:before {\n ",";\n border-bottom: 3px solid ",";\n bottom: 8px;\n content: ' ';\n };\n &:after {\n ",";\n border-top: 3px solid ",";\n bottom: 0;\n content: ' ';\n };\n }\n\n &:hover > span {\n &:before {\n border-bottom: 3px solid ",";\n }\n &:after {\n border-top: 3px solid ",";\n }\n }\n "],["\n & > span {\n position: relative;\n &:before {\n ",";\n border-bottom: 3px solid ",";\n bottom: 8px;\n content: ' ';\n };\n &:after {\n ",";\n border-top: 3px solid ",";\n bottom: 0;\n content: ' ';\n };\n }\n\n &:hover > span {\n &:before {\n border-bottom: 3px solid ",";\n }\n &:after {\n border-top: 3px solid ",";\n }\n }\n "]),p=(0,l.default)(["\n border: none;\n padding: ","px ","px;\n text-align: left;\n &:first-child {\n padding-left: 0;\n }\n &:last-child {\n padding-right: 0;\n }\n"],["\n border: none;\n padding: ","px ","px;\n text-align: left;\n &:first-child {\n padding-left: 0;\n }\n &:last-child {\n padding-right: 0;\n }\n"]),b=r(20),h=r(21),y=r(11),m=t.gridUnit=parseInt(h.akGridSize,10),g=t.baselineUnit=m/2;t.truncateStyle=function(e){var t=e.width,r=e.isFixedSize,n=e.shouldTruncate;return(0,b.css)(a,t?(0,b.css)(i,t):"",r?(0,b.css)(u):"",r&&n?(0,b.css)(s):"")},t.onClickStyle=function(e){var t=e.onClick;return t&&(0,b.css)(d)},t.arrowsStyle=function(e){var t=e.isSortable,r=e.sortOrder;if(!t)return"";var n=(0,b.css)(f,m);return(0,b.css)(c,n,r===y.ASC?h.akColorN300:h.akColorN40,n,r===y.DESC?h.akColorN300:h.akColorN40,r===y.ASC?h.akColorN300:h.akColorN60,r===y.DESC?h.akColorN300:h.akColorN60)},t.cellStyle=(0,b.css)(p,g,m)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=r(8),l=n(o),a=r(9),i=n(a),u=r(11),s=r(24),d=n(s),f=r(12),c=n(f),p=function(e,t,r,n){if(!r||!e)return t;var o=function(t){return t.reduce(function(t,n,o){return t||e.cells[o].key===r&&(void 0!==n.key?n.key:n.content)},null)};return t.sort(function(e,t){var r=o(e.cells),l=o(t.cells),a=n===u.ASC?1:-1;return!r||r<l?-a:!l||r>l?a:0})},b=function(e){var t=e.rows,r=e.head,n=e.sortKey,o=e.sortOrder,l=e.rowsPerPage,a=e.page,u=e.isFixedSize,s=p(r,t,n,o)||[];return i.default.createElement("tbody",null,s.slice((a-1)*l,a*l).map(function(e,t){return i.default.createElement(d.default,{row:e,rowIndex:t,head:r,isFixedSize:u})}))};b.propTypes={head:c.default.head,rows:c.default.rows,sortKey:c.default.sortKey,sortOrder:l.default.oneOf([u.ASC,u.DESC]),rowsPerPage:c.default.isInteger,page:c.default.isInteger,isFixedSize:l.default.bool},t.default=b},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=r(13),l=n(o),a=r(17),i=n(a),u=r(8),s=n(u),d=r(9),f=n(d),c=r(25),p=r(12),b=n(p),h=function(e){var t=e.row,r=e.rowIndex,n=e.head,o=e.isFixedSize,a=t.cells,u=(0,i.default)(t,["cells"]);return f.default.createElement(c.TableBodyRow,(0,l.default)({key:r},u),a.map(function(e,t){var r=e.content,a=(0,i.default)(e,["content"]),u=(n||{cells:[]}).cells[t]||{},s=u.shouldTruncate,d=u.width;return f.default.createElement(c.TableBodyCell,(0,l.default)({},a,{key:t,width:d,shouldTruncate:s,isFixedSize:o}),r)}))};h.propTypes={row:b.default.row,rowIndex:s.default.number,head:b.default.head,isFixedSize:s.default.bool},t.default=h},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.TableBodyCell=t.TableBodyRow=void 0;var o=r(19),l=n(o),a=(0,l.default)(["\n ","\n &:hover {\n background: ",";\n }\n"],["\n ","\n &:hover {\n background: ",";\n }\n"]),i=(0,l.default)(["\n ","\n ","\n ","\n"],["\n ","\n ","\n ","\n"]),u=r(20),s=n(u),d=r(21),f=r(22);t.TableBodyRow=s.default.tr(a,function(e){return(0,f.onClickStyle)(e)},d.akColorN10),t.TableBodyCell=s.default.td(i,function(e){return(0,f.onClickStyle)(e)},function(e){return(0,f.truncateStyle)(e)},f.cellStyle)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=r(8),l=n(o),a=r(9),i=n(a),u=r(27),s=n(u),d=function(e){var t=e.children;return i.default.createElement(s.default,null,t)};d.propTypes={children:l.default.node},t.default=d},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=r(19),l=n(o),a=(0,l.default)(["\n margin: auto;\n width: 50%;\n text-align: center;\n padding: 10px;\n"],["\n margin: auto;\n width: 50%;\n text-align: center;\n padding: 10px;\n"]),i=r(20),u=n(i);t.default=u.default.div(a)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Caption=t.Table=void 0;var o=r(19),l=n(o),a=(0,l.default)(["\n ",";\n border-collapse: collapse;\n width: 100%;\n"],["\n ",";\n border-collapse: collapse;\n width: 100%;\n"]),i=(0,l.default)(["table-layout: fixed;"],["table-layout: fixed;"]),u=(0,l.default)(["\n font-size: 1.42857143em;\n font-style: inherit;\n font-weight: 500;\n letter-spacing: -0.008em;\n line-height: 1.2;\n margin-bottom: ","px;\n margin-top: ","px;\n text-align: left;\n"],["\n font-size: 1.42857143em;\n font-style: inherit;\n font-weight: 500;\n letter-spacing: -0.008em;\n line-height: 1.2;\n margin-bottom: ","px;\n margin-top: ","px;\n text-align: left;\n"]),s=r(20),d=n(s),f=r(22);t.Table=d.default.table(a,function(e){var t=e.isFixedSize;return t&&(0,s.css)(i)}),t.Caption=d.default.caption(u,f.gridUnit,7*f.baselineUnit)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=r(3),l=n(o),a=r(4),i=n(a),u=r(5),s=n(u),d=r(6),f=n(d),c=r(7),p=n(c),b=r(8),h=n(b),y=r(9),m=n(y),g=r(2),S=n(g),v=r(12),x=n(v),w=r(11),C=function(e){function t(){var e,r,n,o;(0,i.default)(this,t);for(var a=arguments.length,u=Array(a),s=0;s<a;s++)u[s]=arguments[s];return r=n=(0,f.default)(this,(e=t.__proto__||(0,l.default)(t)).call.apply(e,[this].concat(u))),n.state={page:n.props.defaultPage,sortKey:n.props.defaultSortKey,sortOrder:n.props.defaultSortOrder},n.onSetPage=function(e){n.props.onSetPage(e),n.setState({page:e})},n.onSort=function(e){var t=e.key,r=e.item,o=e.sortOrder;n.props.onSort({key:t,item:r,sortOrder:o}),n.setState({sortKey:t,sortOrder:o,page:1})},o=r,(0,f.default)(n,o)}return(0,p.default)(t,e),(0,s.default)(t,[{key:"componentWillReceiveProps",value:function(e){this.setState({page:e.page,sortKey:e.defaultSortKey,sortOrder:e.defaultSortOrder})}},{key:"render",value:function(){var e=this.props,t=e.caption,r=e.emptyView,n=e.head,o=e.isFixedSize,l=e.rows,a=e.rowsPerPage,i=this.state,u=i.page,s=i.sortKey,d=i.sortOrder;return m.default.createElement(S.default,{caption:t,emptyView:r,head:n,isFixedSize:o,onSetPage:this.onSetPage,onSort:this.onSort,page:u,rows:l,rowsPerPage:a,sortKey:s,sortOrder:d})}}]),t}(y.PureComponent);C.propTypes={defaultPage:x.default.isInteger,defaultSortKey:x.default.sortKey,defaultSortOrder:h.default.oneOf([w.ASC,w.DESC])},C.defaultProps={caption:null,defaultPage:1,defaultSortKey:null,defaultSortOrder:null,emptyView:null,head:null,isFixedSize:!1,onSetPage:function(){},onSort:function(){},rows:null,rowsPerPage:1/0},t.default=C}])}); |
{ | ||
"name": "@atlaskit/dynamic-table", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"config": { | ||
@@ -15,3 +15,4 @@ "access": "public" | ||
"scripts": { | ||
"prepublish": "../../node_modules/.bin/in-publish && { cd ../.. && npm run prepublish/single @atlaskit/dynamic-table; } || ../../node_modules/.bin/not-in-publish" | ||
"prepublish": "../../node_modules/.bin/in-publish && { cd ../.. && npm run prepublish/single @atlaskit/dynamic-table; } || ../../node_modules/.bin/not-in-publish", | ||
"jest": "../../node_modules/.bin/jest -c ../../build/jest.config.js" | ||
}, | ||
@@ -18,0 +19,0 @@ "files": [ |
@@ -14,3 +14,3 @@ [![AtlasKit component registry](https://img.shields.io/badge/AtlasKit-components-FF5230.svg)](http://atlaskit.atlassian.com) | ||
Interact with a [live demo of the @atlaskit/dynamic-table component](https://aui-cdn.atlassian.com/atlaskit/stories/@atlaskit/dynamic-table/4.0.0/). | ||
Interact with a [live demo of the @atlaskit/dynamic-table component](https://aui-cdn.atlassian.com/atlaskit/stories/@atlaskit/dynamic-table/4.0.1/). | ||
@@ -23,3 +23,3 @@ ## Installation | ||
Detailed docs and example usage can be found [here](https://aui-cdn.atlassian.com/atlaskit/stories/@atlaskit/@atlaskit/dynamic-table/4.0.0/). | ||
Detailed docs and example usage can be found [here](https://aui-cdn.atlassian.com/atlaskit/stories/@atlaskit/@atlaskit/dynamic-table/4.0.1/). | ||
@@ -26,0 +26,0 @@ _* Please note that this module could have dependencies that are governed by the Atlassian Design Guidelines license which will be automatically included on install. Each dependency has a license file that indicates whether the Atlassian Design Guidelines license applies._ |
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
118790