From 71b195b7be47e2338dabd10344164e9b6a5861da Mon Sep 17 00:00:00 2001 From: Al Urim Date: Tue, 8 Dec 2015 17:26:53 -0800 Subject: [PATCH 01/43] Ignore oldState when dimension props have changed --- src/FixedDataTableNew.react.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/FixedDataTableNew.react.js b/src/FixedDataTableNew.react.js index f9e2bd9a..6da12f3e 100644 --- a/src/FixedDataTableNew.react.js +++ b/src/FixedDataTableNew.react.js @@ -745,6 +745,14 @@ var FixedDataTable = React.createClass({ useGroupHeader = true; } + if (oldState && ( + (props.width !== undefined && props.width !== oldState.width) || + (props.height !== undefined && props.height !== oldState.height) || + (props.maxWidth !== undefined && props.maxWidth !== oldState.maxWidth) || + (props.maxHeight !== undefined && props.maxHeight !== oldState.maxHeight))) { + oldState = null + } + var firstRowIndex = (oldState && oldState.firstRowIndex) || 0; var firstRowOffset = (oldState && oldState.firstRowOffset) || 0; var scrollX, scrollY; From c8d996b609f28be55a096bb9f1c4cb6bb872f1ce Mon Sep 17 00:00:00 2001 From: Al Urim Date: Thu, 10 Dec 2015 14:49:35 -0800 Subject: [PATCH 02/43] Update name in package to publish --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b64be063..ce441be5 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "fixed-data-table", + "name": "@buildingconnected/fixed-data-table", "version": "0.6.0", "description": "A React table component designed to allow presenting thousands of rows of data.", "main": "main.js", From 529a798025f8922f50735093865c47acaca001ef Mon Sep 17 00:00:00 2001 From: Al Urim Date: Thu, 10 Dec 2015 14:59:32 -0800 Subject: [PATCH 03/43] Update .npmrc to make publishing work --- .npmrc | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .npmrc diff --git a/.npmrc b/.npmrc new file mode 100644 index 00000000..f19c9629 --- /dev/null +++ b/.npmrc @@ -0,0 +1,2 @@ +@buildingconnected:registry=https://registry.npmjs.org/ +//registry.npmjs.org/:_authToken=${NPM_TOKEN} From 50674ff275751613fbe2903573e61b8ac255d09d Mon Sep 17 00:00:00 2001 From: Al Urim Date: Thu, 10 Dec 2015 15:12:10 -0800 Subject: [PATCH 04/43] Version 0.6.0 --- dist/fixed-data-table-base.css | 202 +++--- dist/fixed-data-table-base.min.css | 2 +- dist/fixed-data-table-style.css | 74 +-- dist/fixed-data-table-style.min.css | 2 +- dist/fixed-data-table.css | 462 ++++++------- dist/fixed-data-table.js | 985 +++++++++++++++------------- dist/fixed-data-table.min.css | 2 +- dist/fixed-data-table.min.js | 6 +- 8 files changed, 912 insertions(+), 823 deletions(-) diff --git a/dist/fixed-data-table-base.css b/dist/fixed-data-table-base.css index 292ba6d0..c6ed2e08 100644 --- a/dist/fixed-data-table-base.css +++ b/dist/fixed-data-table-base.css @@ -9,107 +9,6 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -/** - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule ScrollbarLayout - */ - -.ScrollbarLayout_main { - box-sizing: border-box; - outline: none; - overflow: hidden; - position: absolute; - -webkit-transition-duration: 250ms; - transition-duration: 250ms; - -webkit-transition-timing-function: ease; - transition-timing-function: ease; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - -.ScrollbarLayout_mainVertical { - bottom: 0; - right: 0; - top: 0; - -webkit-transition-property: background-color width; - transition-property: background-color width; - width: 15px; -} - -.ScrollbarLayout_mainVertical.public_Scrollbar_mainActive, -.ScrollbarLayout_mainVertical:hover { - width: 17px; -} - -.ScrollbarLayout_mainHorizontal { - bottom: 0; - height: 15px; - left: 0; - -webkit-transition-property: background-color height; - transition-property: background-color height; -} - -/* Touching the scroll-track directly makes the scroll-track bolder */ -.ScrollbarLayout_mainHorizontal.public_Scrollbar_mainActive, -.ScrollbarLayout_mainHorizontal:hover { - height: 17px; -} - -.ScrollbarLayout_face { - left: 0; - overflow: hidden; - position: absolute; - z-index: 1; -} - -/** - * This selector renders the "nub" of the scrollface. The nub must - * be rendered as pseudo-element so that it won't receive any UI events then - * we can get the correct `event.offsetX` and `event.offsetY` from the - * scrollface element while dragging it. - */ -.ScrollbarLayout_face:after { - border-radius: 6px; - content: ''; - display: block; - position: absolute; - -webkit-transition: background-color 250ms ease; - transition: background-color 250ms ease; -} - -.ScrollbarLayout_faceHorizontal { - bottom: 0; - left: 0; - top: 0; -} - -.ScrollbarLayout_faceHorizontal:after { - bottom: 4px; - left: 0; - top: 4px; - width: 100%; -} - -.ScrollbarLayout_faceVertical { - left: 0; - right: 0; - top: 0; -} - -.ScrollbarLayout_faceVertical:after { - height: 100%; - left: 4px; - right: 4px; - top: 0; -} /** * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -341,3 +240,104 @@ body[dir="rtl"] .fixedDataTableColumnResizerLineLayout_main { position: absolute; top: 0; } +/** + * Copyright (c) 2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ScrollbarLayout + */ + +.ScrollbarLayout_main { + box-sizing: border-box; + outline: none; + overflow: hidden; + position: absolute; + -webkit-transition-duration: 250ms; + transition-duration: 250ms; + -webkit-transition-timing-function: ease; + transition-timing-function: ease; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.ScrollbarLayout_mainVertical { + bottom: 0; + right: 0; + top: 0; + -webkit-transition-property: background-color width; + transition-property: background-color width; + width: 15px; +} + +.ScrollbarLayout_mainVertical.public_Scrollbar_mainActive, +.ScrollbarLayout_mainVertical:hover { + width: 17px; +} + +.ScrollbarLayout_mainHorizontal { + bottom: 0; + height: 15px; + left: 0; + -webkit-transition-property: background-color height; + transition-property: background-color height; +} + +/* Touching the scroll-track directly makes the scroll-track bolder */ +.ScrollbarLayout_mainHorizontal.public_Scrollbar_mainActive, +.ScrollbarLayout_mainHorizontal:hover { + height: 17px; +} + +.ScrollbarLayout_face { + left: 0; + overflow: hidden; + position: absolute; + z-index: 1; +} + +/** + * This selector renders the "nub" of the scrollface. The nub must + * be rendered as pseudo-element so that it won't receive any UI events then + * we can get the correct `event.offsetX` and `event.offsetY` from the + * scrollface element while dragging it. + */ +.ScrollbarLayout_face:after { + border-radius: 6px; + content: ''; + display: block; + position: absolute; + -webkit-transition: background-color 250ms ease; + transition: background-color 250ms ease; +} + +.ScrollbarLayout_faceHorizontal { + bottom: 0; + left: 0; + top: 0; +} + +.ScrollbarLayout_faceHorizontal:after { + bottom: 4px; + left: 0; + top: 4px; + width: 100%; +} + +.ScrollbarLayout_faceVertical { + left: 0; + right: 0; + top: 0; +} + +.ScrollbarLayout_faceVertical:after { + height: 100%; + left: 4px; + right: 4px; + top: 0; +} diff --git a/dist/fixed-data-table-base.min.css b/dist/fixed-data-table-base.min.css index 342396eb..3a7a9a66 100644 --- a/dist/fixed-data-table-base.min.css +++ b/dist/fixed-data-table-base.min.css @@ -9,4 +9,4 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -.ScrollbarLayout_main{box-sizing:border-box;outline:none;overflow:hidden;position:absolute;-webkit-transition-duration:250ms;transition-duration:250ms;-webkit-transition-timing-function:ease;transition-timing-function:ease;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ScrollbarLayout_mainVertical{bottom:0;right:0;top:0;-webkit-transition-property:background-color width;transition-property:background-color width;width:15px}.ScrollbarLayout_mainVertical.public_Scrollbar_mainActive,.ScrollbarLayout_mainVertical:hover{width:17px}.ScrollbarLayout_mainHorizontal{bottom:0;height:15px;left:0;-webkit-transition-property:background-color height;transition-property:background-color height}.ScrollbarLayout_mainHorizontal.public_Scrollbar_mainActive,.ScrollbarLayout_mainHorizontal:hover{height:17px}.ScrollbarLayout_face{left:0;overflow:hidden;position:absolute;z-index:1}.ScrollbarLayout_face:after{border-radius:6px;content:'';display:block;position:absolute;-webkit-transition:background-color 250ms ease;transition:background-color 250ms ease}.ScrollbarLayout_faceHorizontal{bottom:0;left:0;top:0}.ScrollbarLayout_faceHorizontal:after{bottom:4px;left:0;top:4px;width:100%}.ScrollbarLayout_faceVertical{left:0;right:0;top:0}.ScrollbarLayout_faceVertical:after{height:100%;left:4px;right:4px;top:0}.fixedDataTableCellGroupLayout_cellGroup{-webkit-backface-visibility:hidden;backface-visibility:hidden;left:0;overflow:hidden;position:absolute;top:0;white-space:nowrap}.fixedDataTableCellGroupLayout_cellGroup>.public_fixedDataTableCell_main{display:inline-block;vertical-align:top;white-space:normal}.fixedDataTableCellGroupLayout_cellGroupWrapper{position:absolute;top:0}.fixedDataTableCellLayout_main{border-right-style:solid;border-width:0 1px 0 0;box-sizing:border-box;display:block;overflow:hidden;position:absolute;white-space:normal}.fixedDataTableCellLayout_lastChild{border-width:0 1px 1px 0}.fixedDataTableCellLayout_alignRight{text-align:right}.fixedDataTableCellLayout_alignCenter{text-align:center}.fixedDataTableCellLayout_wrap1{display:table}.fixedDataTableCellLayout_wrap2{display:table-row}.fixedDataTableCellLayout_wrap3{display:table-cell;vertical-align:middle}.fixedDataTableCellLayout_columnResizerContainer{position:absolute;right:0;width:6px;z-index:1}.fixedDataTableCellLayout_columnResizerContainer:hover{cursor:ew-resize}.fixedDataTableCellLayout_columnResizerContainer:hover .fixedDataTableCellLayout_columnResizerKnob{visibility:visible}.fixedDataTableCellLayout_columnResizerKnob{position:absolute;right:0;visibility:hidden;width:4px}.fixedDataTableColumnResizerLineLayout_mouseArea{cursor:ew-resize;position:absolute;right:-5px;width:12px}.fixedDataTableColumnResizerLineLayout_main{border-right-style:solid;border-right-width:1px;box-sizing:border-box;position:absolute;z-index:10}body[dir="rtl"] .fixedDataTableColumnResizerLineLayout_main,.fixedDataTableColumnResizerLineLayout_hiddenElem{display:none!important}.fixedDataTableLayout_main{border-style:solid;border-width:1px;box-sizing:border-box;overflow:hidden;position:relative}.fixedDataTableLayout_header,.fixedDataTableLayout_hasBottomBorder{border-bottom-style:solid;border-bottom-width:1px}.fixedDataTableLayout_footer .public_fixedDataTableCell_main{border-top-style:solid;border-top-width:1px}.fixedDataTableLayout_topShadow,.fixedDataTableLayout_bottomShadow{height:4px;left:0;position:absolute;right:0;z-index:1}.fixedDataTableLayout_bottomShadow{margin-top:-4px}.fixedDataTableLayout_rowsContainer{overflow:hidden;position:relative}.fixedDataTableLayout_horizontalScrollbar{bottom:0;position:absolute}.fixedDataTableRowLayout_main{box-sizing:border-box;overflow:hidden;position:absolute;top:0}.fixedDataTableRowLayout_body{left:0;position:absolute;top:0}.fixedDataTableRowLayout_fixedColumnsDivider{-webkit-backface-visibility:hidden;backface-visibility:hidden;border-left-style:solid;border-left-width:1px;left:0;position:absolute;top:0;width:0}.fixedDataTableRowLayout_columnsShadow{width:4px}.fixedDataTableRowLayout_rowWrapper{position:absolute;top:0} \ No newline at end of file +.fixedDataTableCellGroupLayout_cellGroup{-webkit-backface-visibility:hidden;backface-visibility:hidden;left:0;overflow:hidden;position:absolute;top:0;white-space:nowrap}.fixedDataTableCellGroupLayout_cellGroup>.public_fixedDataTableCell_main{display:inline-block;vertical-align:top;white-space:normal}.fixedDataTableCellGroupLayout_cellGroupWrapper{position:absolute;top:0}.fixedDataTableCellLayout_main{border-right-style:solid;border-width:0 1px 0 0;box-sizing:border-box;display:block;overflow:hidden;position:absolute;white-space:normal}.fixedDataTableCellLayout_lastChild{border-width:0 1px 1px 0}.fixedDataTableCellLayout_alignRight{text-align:right}.fixedDataTableCellLayout_alignCenter{text-align:center}.fixedDataTableCellLayout_wrap1{display:table}.fixedDataTableCellLayout_wrap2{display:table-row}.fixedDataTableCellLayout_wrap3{display:table-cell;vertical-align:middle}.fixedDataTableCellLayout_columnResizerContainer{position:absolute;right:0;width:6px;z-index:1}.fixedDataTableCellLayout_columnResizerContainer:hover{cursor:ew-resize}.fixedDataTableCellLayout_columnResizerContainer:hover .fixedDataTableCellLayout_columnResizerKnob{visibility:visible}.fixedDataTableCellLayout_columnResizerKnob{position:absolute;right:0;visibility:hidden;width:4px}.fixedDataTableColumnResizerLineLayout_mouseArea{cursor:ew-resize;position:absolute;right:-5px;width:12px}.fixedDataTableColumnResizerLineLayout_main{border-right-style:solid;border-right-width:1px;box-sizing:border-box;position:absolute;z-index:10}body[dir="rtl"] .fixedDataTableColumnResizerLineLayout_main,.fixedDataTableColumnResizerLineLayout_hiddenElem{display:none!important}.fixedDataTableLayout_main{border-style:solid;border-width:1px;box-sizing:border-box;overflow:hidden;position:relative}.fixedDataTableLayout_header,.fixedDataTableLayout_hasBottomBorder{border-bottom-style:solid;border-bottom-width:1px}.fixedDataTableLayout_footer .public_fixedDataTableCell_main{border-top-style:solid;border-top-width:1px}.fixedDataTableLayout_topShadow,.fixedDataTableLayout_bottomShadow{height:4px;left:0;position:absolute;right:0;z-index:1}.fixedDataTableLayout_bottomShadow{margin-top:-4px}.fixedDataTableLayout_rowsContainer{overflow:hidden;position:relative}.fixedDataTableLayout_horizontalScrollbar{bottom:0;position:absolute}.fixedDataTableRowLayout_main{box-sizing:border-box;overflow:hidden;position:absolute;top:0}.fixedDataTableRowLayout_body{left:0;position:absolute;top:0}.fixedDataTableRowLayout_fixedColumnsDivider{-webkit-backface-visibility:hidden;backface-visibility:hidden;border-left-style:solid;border-left-width:1px;left:0;position:absolute;top:0;width:0}.fixedDataTableRowLayout_columnsShadow{width:4px}.fixedDataTableRowLayout_rowWrapper{position:absolute;top:0}.ScrollbarLayout_main{box-sizing:border-box;outline:none;overflow:hidden;position:absolute;-webkit-transition-duration:250ms;transition-duration:250ms;-webkit-transition-timing-function:ease;transition-timing-function:ease;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ScrollbarLayout_mainVertical{bottom:0;right:0;top:0;-webkit-transition-property:background-color width;transition-property:background-color width;width:15px}.ScrollbarLayout_mainVertical.public_Scrollbar_mainActive,.ScrollbarLayout_mainVertical:hover{width:17px}.ScrollbarLayout_mainHorizontal{bottom:0;height:15px;left:0;-webkit-transition-property:background-color height;transition-property:background-color height}.ScrollbarLayout_mainHorizontal.public_Scrollbar_mainActive,.ScrollbarLayout_mainHorizontal:hover{height:17px}.ScrollbarLayout_face{left:0;overflow:hidden;position:absolute;z-index:1}.ScrollbarLayout_face:after{border-radius:6px;content:'';display:block;position:absolute;-webkit-transition:background-color 250ms ease;transition:background-color 250ms ease}.ScrollbarLayout_faceHorizontal{bottom:0;left:0;top:0}.ScrollbarLayout_faceHorizontal:after{bottom:4px;left:0;top:4px;width:100%}.ScrollbarLayout_faceVertical{left:0;right:0;top:0}.ScrollbarLayout_faceVertical:after{height:100%;left:4px;right:4px;top:0} \ No newline at end of file diff --git a/dist/fixed-data-table-style.css b/dist/fixed-data-table-style.css index e41dfbaa..7262e746 100644 --- a/dist/fixed-data-table-style.css +++ b/dist/fixed-data-table-style.css @@ -9,43 +9,6 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -/** - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule Scrollbar - * - */ - -/** - * Scrollbars. - */ - -/* Touching the scroll-track directly makes the scroll-track bolder */ -.public_Scrollbar_main.public_Scrollbar_mainActive, -.public_Scrollbar_main:hover { - background-color: rgba(255, 255, 255, 0.8); -} - -.public_Scrollbar_mainOpaque, -.public_Scrollbar_mainOpaque.public_Scrollbar_mainActive, -.public_Scrollbar_mainOpaque:hover { - background-color: #fff; -} - -.public_Scrollbar_face:after { - background-color: #c2c2c2; -} - -.public_Scrollbar_main:hover .public_Scrollbar_face:after, -.public_Scrollbar_mainActive .public_Scrollbar_face:after, -.public_Scrollbar_faceActive:after { - background-color: #7d7d7d; -} /** * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -175,3 +138,40 @@ .public_fixedDataTableRow_columnsShadow { background: 0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABCAYAAAD5PA/NAAAAFklEQVQIHWPSkNeSBmJhTQVtbiDNCgASagIIuJX8OgAAAABJRU5ErkJggg==) repeat-y; } +/** + * Copyright (c) 2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule Scrollbar + * + */ + +/** + * Scrollbars. + */ + +/* Touching the scroll-track directly makes the scroll-track bolder */ +.public_Scrollbar_main.public_Scrollbar_mainActive, +.public_Scrollbar_main:hover { + background-color: rgba(255, 255, 255, 0.8); +} + +.public_Scrollbar_mainOpaque, +.public_Scrollbar_mainOpaque.public_Scrollbar_mainActive, +.public_Scrollbar_mainOpaque:hover { + background-color: #fff; +} + +.public_Scrollbar_face:after { + background-color: #c2c2c2; +} + +.public_Scrollbar_main:hover .public_Scrollbar_face:after, +.public_Scrollbar_mainActive .public_Scrollbar_face:after, +.public_Scrollbar_faceActive:after { + background-color: #7d7d7d; +} diff --git a/dist/fixed-data-table-style.min.css b/dist/fixed-data-table-style.min.css index b58ae79c..fd63fb1c 100644 --- a/dist/fixed-data-table-style.min.css +++ b/dist/fixed-data-table-style.min.css @@ -9,4 +9,4 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -.public_Scrollbar_main.public_Scrollbar_mainActive,.public_Scrollbar_main:hover{background-color:rgba(255,255,255,.8)}.public_Scrollbar_mainOpaque,.public_Scrollbar_mainOpaque.public_Scrollbar_mainActive,.public_Scrollbar_mainOpaque:hover{background-color:#fff}.public_Scrollbar_face:after{background-color:#c2c2c2}.public_Scrollbar_main:hover .public_Scrollbar_face:after,.public_Scrollbar_mainActive .public_Scrollbar_face:after,.public_Scrollbar_faceActive:after{background-color:#7d7d7d}.public_fixedDataTable_main,.public_fixedDataTable_header,.public_fixedDataTable_hasBottomBorder{border-color:#d3d3d3}.public_fixedDataTable_header .public_fixedDataTableCell_main{font-weight:700}.public_fixedDataTable_header,.public_fixedDataTable_header .public_fixedDataTableCell_main{background-color:#f6f7f8;background-image:-webkit-linear-gradient(#fff,#efefef);background-image:linear-gradient(#fff,#efefef)}.public_fixedDataTable_footer .public_fixedDataTableCell_main{background-color:#f6f7f8;border-color:#d3d3d3}.public_fixedDataTable_topShadow{background:0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAECAYAAABP2FU6AAAAF0lEQVR4AWPUkNeSBhHCjJoK2twgFisAFagCCp3pJlAAAAAASUVORK5CYII=) repeat-x}.public_fixedDataTable_bottomShadow{background:0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAECAYAAABP2FU6AAAAHElEQVQI12MwNjZmZdAT1+Nm0JDWEGZQk1GTBgAWkwIeAEp52AAAAABJRU5ErkJggg==) repeat-x}.public_fixedDataTable_horizontalScrollbar .public_Scrollbar_mainHorizontal{background-color:#fff}.public_fixedDataTableCell_main{background-color:#fff;border-color:#d3d3d3}.public_fixedDataTableCell_highlighted{background-color:#f4f4f4}.public_fixedDataTableCell_cellContent{padding:8px}.public_fixedDataTableCell_columnResizerKnob{background-color:#0284ff}.public_fixedDataTableColumnResizerLine_main{border-color:#0284ff}.public_fixedDataTableRow_main{background-color:#fff}.public_fixedDataTableRow_highlighted,.public_fixedDataTableRow_highlighted .public_fixedDataTableCell_main{background-color:#f6f7f8}.public_fixedDataTableRow_fixedColumnsDivider{border-color:#d3d3d3}.public_fixedDataTableRow_columnsShadow{background:0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABCAYAAAD5PA/NAAAAFklEQVQIHWPSkNeSBmJhTQVtbiDNCgASagIIuJX8OgAAAABJRU5ErkJggg==) repeat-y} \ No newline at end of file +.public_fixedDataTable_main,.public_fixedDataTable_header,.public_fixedDataTable_hasBottomBorder{border-color:#d3d3d3}.public_fixedDataTable_header .public_fixedDataTableCell_main{font-weight:700}.public_fixedDataTable_header,.public_fixedDataTable_header .public_fixedDataTableCell_main{background-color:#f6f7f8;background-image:-webkit-linear-gradient(#fff,#efefef);background-image:linear-gradient(#fff,#efefef)}.public_fixedDataTable_footer .public_fixedDataTableCell_main{background-color:#f6f7f8;border-color:#d3d3d3}.public_fixedDataTable_topShadow{background:0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAECAYAAABP2FU6AAAAF0lEQVR4AWPUkNeSBhHCjJoK2twgFisAFagCCp3pJlAAAAAASUVORK5CYII=) repeat-x}.public_fixedDataTable_bottomShadow{background:0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAECAYAAABP2FU6AAAAHElEQVQI12MwNjZmZdAT1+Nm0JDWEGZQk1GTBgAWkwIeAEp52AAAAABJRU5ErkJggg==) repeat-x}.public_fixedDataTable_horizontalScrollbar .public_Scrollbar_mainHorizontal{background-color:#fff}.public_fixedDataTableCell_main{background-color:#fff;border-color:#d3d3d3}.public_fixedDataTableCell_highlighted{background-color:#f4f4f4}.public_fixedDataTableCell_cellContent{padding:8px}.public_fixedDataTableCell_columnResizerKnob{background-color:#0284ff}.public_fixedDataTableColumnResizerLine_main{border-color:#0284ff}.public_fixedDataTableRow_main{background-color:#fff}.public_fixedDataTableRow_highlighted,.public_fixedDataTableRow_highlighted .public_fixedDataTableCell_main{background-color:#f6f7f8}.public_fixedDataTableRow_fixedColumnsDivider{border-color:#d3d3d3}.public_fixedDataTableRow_columnsShadow{background:0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABCAYAAAD5PA/NAAAAFklEQVQIHWPSkNeSBmJhTQVtbiDNCgASagIIuJX8OgAAAABJRU5ErkJggg==) repeat-y}.public_Scrollbar_main.public_Scrollbar_mainActive,.public_Scrollbar_main:hover{background-color:rgba(255,255,255,.8)}.public_Scrollbar_mainOpaque,.public_Scrollbar_mainOpaque.public_Scrollbar_mainActive,.public_Scrollbar_mainOpaque:hover{background-color:#fff}.public_Scrollbar_face:after{background-color:#c2c2c2}.public_Scrollbar_main:hover .public_Scrollbar_face:after,.public_Scrollbar_mainActive .public_Scrollbar_face:after,.public_Scrollbar_faceActive:after{background-color:#7d7d7d} \ No newline at end of file diff --git a/dist/fixed-data-table.css b/dist/fixed-data-table.css index d1a79eae..59d6d95a 100644 --- a/dist/fixed-data-table.css +++ b/dist/fixed-data-table.css @@ -17,34 +17,28 @@ * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * - * @providesModule Scrollbar - * - */ - -/** - * Scrollbars. + * @providesModule fixedDataTableCellGroupLayout */ -/* Touching the scroll-track directly makes the scroll-track bolder */ -.public_Scrollbar_main.public_Scrollbar_mainActive, -.public_Scrollbar_main:hover { - background-color: rgba(255, 255, 255, 0.8); -} - -.public_Scrollbar_mainOpaque, -.public_Scrollbar_mainOpaque.public_Scrollbar_mainActive, -.public_Scrollbar_mainOpaque:hover { - background-color: #fff; +.fixedDataTableCellGroupLayout_cellGroup { + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + left: 0; + overflow: hidden; + position: absolute; + top: 0; + white-space: nowrap; } -.public_Scrollbar_face:after { - background-color: #c2c2c2; +.fixedDataTableCellGroupLayout_cellGroup > .public_fixedDataTableCell_main { + display: inline-block; + vertical-align: top; + white-space: normal; } -.public_Scrollbar_main:hover .public_Scrollbar_face:after, -.public_Scrollbar_mainActive .public_Scrollbar_face:after, -.public_Scrollbar_faceActive:after { - background-color: #7d7d7d; +.fixedDataTableCellGroupLayout_cellGroupWrapper { + position: absolute; + top: 0; } /** * Copyright (c) 2015, Facebook, Inc. @@ -54,48 +48,65 @@ * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * - * @providesModule fixedDataTable - * + * @providesModule fixedDataTableCellLayout */ -/** - * Table. - */ -.public_fixedDataTable_main { - border-color: #d3d3d3; +.fixedDataTableCellLayout_main { + border-right-style: solid; + border-right-width: 1px; + border-width: 0 1px 0 0; + box-sizing: border-box; + display: block; + overflow: hidden; + position: absolute; + white-space: normal; } -.public_fixedDataTable_header, -.public_fixedDataTable_hasBottomBorder { - border-color: #d3d3d3; +.fixedDataTableCellLayout_lastChild { + border-width: 0 1px 1px 0; } -.public_fixedDataTable_header .public_fixedDataTableCell_main { - font-weight: bold; +.fixedDataTableCellLayout_alignRight { + text-align: right; } -.public_fixedDataTable_header, -.public_fixedDataTable_header .public_fixedDataTableCell_main { - background-color: #f6f7f8; - background-image: -webkit-linear-gradient(#fff, #efefef); - background-image: linear-gradient(#fff, #efefef); +.fixedDataTableCellLayout_alignCenter { + text-align: center; } -.public_fixedDataTable_footer .public_fixedDataTableCell_main { - background-color: #f6f7f8; - border-color: #d3d3d3; +.fixedDataTableCellLayout_wrap1 { + display: table; } -.public_fixedDataTable_topShadow { - background: 0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAECAYAAABP2FU6AAAAF0lEQVR4AWPUkNeSBhHCjJoK2twgFisAFagCCp3pJlAAAAAASUVORK5CYII=) repeat-x; +.fixedDataTableCellLayout_wrap2 { + display: table-row; } -.public_fixedDataTable_bottomShadow { - background: 0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAECAYAAABP2FU6AAAAHElEQVQI12MwNjZmZdAT1+Nm0JDWEGZQk1GTBgAWkwIeAEp52AAAAABJRU5ErkJggg==) repeat-x; +.fixedDataTableCellLayout_wrap3 { + display: table-cell; + vertical-align: middle; } -.public_fixedDataTable_horizontalScrollbar .public_Scrollbar_mainHorizontal { - background-color: #fff; +.fixedDataTableCellLayout_columnResizerContainer { + position: absolute; + right: 0px; + width: 6px; + z-index: 1; +} + +.fixedDataTableCellLayout_columnResizerContainer:hover { + cursor: ew-resize; +} + +.fixedDataTableCellLayout_columnResizerContainer:hover .fixedDataTableCellLayout_columnResizerKnob { + visibility: visible; +} + +.fixedDataTableCellLayout_columnResizerKnob { + position: absolute; + right: 0px; + visibility: hidden; + width: 4px; } /** * Copyright (c) 2015, Facebook, Inc. @@ -105,27 +116,34 @@ * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * - * @providesModule fixedDataTableCell + * @providesModule fixedDataTableColumnResizerLineLayout */ -/** - * Table cell. - */ -.public_fixedDataTableCell_main { - background-color: #fff; - border-color: #d3d3d3; +.fixedDataTableColumnResizerLineLayout_mouseArea { + cursor: ew-resize; + position: absolute; + right: -5px; + width: 12px; } -.public_fixedDataTableCell_highlighted { - background-color: #f4f4f4; +.fixedDataTableColumnResizerLineLayout_main { + border-right-style: solid; + border-right-width: 1px; + box-sizing: border-box; + position: absolute; + z-index: 10; } -.public_fixedDataTableCell_cellContent { - padding: 8px; +body[dir="rtl"] .fixedDataTableColumnResizerLineLayout_main { + /* the resizer line is in the wrong position in RTL with no easy fix. + * Disabling is more useful than displaying it. + * #167 (github) should look into this and come up with a permanent fix. + */ + display: none !important; } -.public_fixedDataTableCell_columnResizerKnob { - background-color: #0284ff; +.fixedDataTableColumnResizerLineLayout_hiddenElem { + display: none !important; } /** * Copyright (c) 2015, Facebook, Inc. @@ -135,15 +153,49 @@ * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * - * @providesModule fixedDataTableColumnResizerLine - * + * @providesModule fixedDataTableLayout */ -/** - * Column resizer line. - */ -.public_fixedDataTableColumnResizerLine_main { - border-color: #0284ff; +.fixedDataTableLayout_main { + border-style: solid; + border-width: 1px; + box-sizing: border-box; + overflow: hidden; + position: relative; +} + +.fixedDataTableLayout_header, +.fixedDataTableLayout_hasBottomBorder { + border-bottom-style: solid; + border-bottom-width: 1px; +} + +.fixedDataTableLayout_footer .public_fixedDataTableCell_main { + border-top-style: solid; + border-top-width: 1px; +} + +.fixedDataTableLayout_topShadow, +.fixedDataTableLayout_bottomShadow { + height: 4px; + left: 0; + position: absolute; + right: 0; + z-index: 1; +} + +.fixedDataTableLayout_bottomShadow { + margin-top: -4px; +} + +.fixedDataTableLayout_rowsContainer { + overflow: hidden; + position: relative; +} + +.fixedDataTableLayout_horizontalScrollbar { + bottom: 0; + position: absolute; } /** * Copyright (c) 2015, Facebook, Inc. @@ -153,27 +205,40 @@ * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * - * @providesModule fixedDataTableRow + * @providesModule fixedDataTableRowLayout */ -/** - * Table row. - */ -.public_fixedDataTableRow_main { - background-color: #fff; +.fixedDataTableRowLayout_main { + box-sizing: border-box; + overflow: hidden; + position: absolute; + top: 0; } -.public_fixedDataTableRow_highlighted, -.public_fixedDataTableRow_highlighted .public_fixedDataTableCell_main { - background-color: #f6f7f8; +.fixedDataTableRowLayout_body { + left: 0; + position: absolute; + top: 0; } -.public_fixedDataTableRow_fixedColumnsDivider { - border-color: #d3d3d3; +.fixedDataTableRowLayout_fixedColumnsDivider { + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + border-left-style: solid; + border-left-width: 1px; + left: 0; + position: absolute; + top: 0; + width: 0; } -.public_fixedDataTableRow_columnsShadow { - background: 0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABCAYAAAD5PA/NAAAAFklEQVQIHWPSkNeSBmJhTQVtbiDNCgASagIIuJX8OgAAAABJRU5ErkJggg==) repeat-y; +.fixedDataTableRowLayout_columnsShadow { + width: 4px; +} + +.fixedDataTableRowLayout_rowWrapper { + position: absolute; + top: 0; } /** * Copyright (c) 2015, Facebook, Inc. @@ -284,96 +349,48 @@ * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * - * @providesModule fixedDataTableCellGroupLayout + * @providesModule fixedDataTable + * */ -.fixedDataTableCellGroupLayout_cellGroup { - -webkit-backface-visibility: hidden; - backface-visibility: hidden; - left: 0; - overflow: hidden; - position: absolute; - top: 0; - white-space: nowrap; -} - -.fixedDataTableCellGroupLayout_cellGroup > .public_fixedDataTableCell_main { - display: inline-block; - vertical-align: top; - white-space: normal; -} - -.fixedDataTableCellGroupLayout_cellGroupWrapper { - position: absolute; - top: 0; -} /** - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule fixedDataTableCellLayout + * Table. */ - -.fixedDataTableCellLayout_main { - border-right-style: solid; - border-right-width: 1px; - border-width: 0 1px 0 0; - box-sizing: border-box; - display: block; - overflow: hidden; - position: absolute; - white-space: normal; -} - -.fixedDataTableCellLayout_lastChild { - border-width: 0 1px 1px 0; -} - -.fixedDataTableCellLayout_alignRight { - text-align: right; -} - -.fixedDataTableCellLayout_alignCenter { - text-align: center; +.public_fixedDataTable_main { + border-color: #d3d3d3; } -.fixedDataTableCellLayout_wrap1 { - display: table; +.public_fixedDataTable_header, +.public_fixedDataTable_hasBottomBorder { + border-color: #d3d3d3; } -.fixedDataTableCellLayout_wrap2 { - display: table-row; +.public_fixedDataTable_header .public_fixedDataTableCell_main { + font-weight: bold; } -.fixedDataTableCellLayout_wrap3 { - display: table-cell; - vertical-align: middle; +.public_fixedDataTable_header, +.public_fixedDataTable_header .public_fixedDataTableCell_main { + background-color: #f6f7f8; + background-image: -webkit-linear-gradient(#fff, #efefef); + background-image: linear-gradient(#fff, #efefef); } -.fixedDataTableCellLayout_columnResizerContainer { - position: absolute; - right: 0px; - width: 6px; - z-index: 1; +.public_fixedDataTable_footer .public_fixedDataTableCell_main { + background-color: #f6f7f8; + border-color: #d3d3d3; } -.fixedDataTableCellLayout_columnResizerContainer:hover { - cursor: ew-resize; +.public_fixedDataTable_topShadow { + background: 0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAECAYAAABP2FU6AAAAF0lEQVR4AWPUkNeSBhHCjJoK2twgFisAFagCCp3pJlAAAAAASUVORK5CYII=) repeat-x; } -.fixedDataTableCellLayout_columnResizerContainer:hover .fixedDataTableCellLayout_columnResizerKnob { - visibility: visible; +.public_fixedDataTable_bottomShadow { + background: 0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAECAYAAABP2FU6AAAAHElEQVQI12MwNjZmZdAT1+Nm0JDWEGZQk1GTBgAWkwIeAEp52AAAAABJRU5ErkJggg==) repeat-x; } -.fixedDataTableCellLayout_columnResizerKnob { - position: absolute; - right: 0px; - visibility: hidden; - width: 4px; +.public_fixedDataTable_horizontalScrollbar .public_Scrollbar_mainHorizontal { + background-color: #fff; } /** * Copyright (c) 2015, Facebook, Inc. @@ -383,34 +400,27 @@ * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * - * @providesModule fixedDataTableColumnResizerLineLayout + * @providesModule fixedDataTableCell */ -.fixedDataTableColumnResizerLineLayout_mouseArea { - cursor: ew-resize; - position: absolute; - right: -5px; - width: 12px; +/** + * Table cell. + */ +.public_fixedDataTableCell_main { + background-color: #fff; + border-color: #d3d3d3; } -.fixedDataTableColumnResizerLineLayout_main { - border-right-style: solid; - border-right-width: 1px; - box-sizing: border-box; - position: absolute; - z-index: 10; +.public_fixedDataTableCell_highlighted { + background-color: #f4f4f4; } -body[dir="rtl"] .fixedDataTableColumnResizerLineLayout_main { - /* the resizer line is in the wrong position in RTL with no easy fix. - * Disabling is more useful than displaying it. - * #167 (github) should look into this and come up with a permanent fix. - */ - display: none !important; +.public_fixedDataTableCell_cellContent { + padding: 8px; } -.fixedDataTableColumnResizerLineLayout_hiddenElem { - display: none !important; +.public_fixedDataTableCell_columnResizerKnob { + background-color: #0284ff; } /** * Copyright (c) 2015, Facebook, Inc. @@ -420,49 +430,45 @@ body[dir="rtl"] .fixedDataTableColumnResizerLineLayout_main { * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * - * @providesModule fixedDataTableLayout + * @providesModule fixedDataTableColumnResizerLine + * */ -.fixedDataTableLayout_main { - border-style: solid; - border-width: 1px; - box-sizing: border-box; - overflow: hidden; - position: relative; -} - -.fixedDataTableLayout_header, -.fixedDataTableLayout_hasBottomBorder { - border-bottom-style: solid; - border-bottom-width: 1px; -} - -.fixedDataTableLayout_footer .public_fixedDataTableCell_main { - border-top-style: solid; - border-top-width: 1px; +/** + * Column resizer line. + */ +.public_fixedDataTableColumnResizerLine_main { + border-color: #0284ff; } +/** + * Copyright (c) 2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule fixedDataTableRow + */ -.fixedDataTableLayout_topShadow, -.fixedDataTableLayout_bottomShadow { - height: 4px; - left: 0; - position: absolute; - right: 0; - z-index: 1; +/** + * Table row. + */ +.public_fixedDataTableRow_main { + background-color: #fff; } -.fixedDataTableLayout_bottomShadow { - margin-top: -4px; +.public_fixedDataTableRow_highlighted, +.public_fixedDataTableRow_highlighted .public_fixedDataTableCell_main { + background-color: #f6f7f8; } -.fixedDataTableLayout_rowsContainer { - overflow: hidden; - position: relative; +.public_fixedDataTableRow_fixedColumnsDivider { + border-color: #d3d3d3; } -.fixedDataTableLayout_horizontalScrollbar { - bottom: 0; - position: absolute; +.public_fixedDataTableRow_columnsShadow { + background: 0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABCAYAAAD5PA/NAAAAFklEQVQIHWPSkNeSBmJhTQVtbiDNCgASagIIuJX8OgAAAABJRU5ErkJggg==) repeat-y; } /** * Copyright (c) 2015, Facebook, Inc. @@ -472,38 +478,32 @@ body[dir="rtl"] .fixedDataTableColumnResizerLineLayout_main { * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * - * @providesModule fixedDataTableRowLayout + * @providesModule Scrollbar + * */ -.fixedDataTableRowLayout_main { - box-sizing: border-box; - overflow: hidden; - position: absolute; - top: 0; -} +/** + * Scrollbars. + */ -.fixedDataTableRowLayout_body { - left: 0; - position: absolute; - top: 0; +/* Touching the scroll-track directly makes the scroll-track bolder */ +.public_Scrollbar_main.public_Scrollbar_mainActive, +.public_Scrollbar_main:hover { + background-color: rgba(255, 255, 255, 0.8); } -.fixedDataTableRowLayout_fixedColumnsDivider { - -webkit-backface-visibility: hidden; - backface-visibility: hidden; - border-left-style: solid; - border-left-width: 1px; - left: 0; - position: absolute; - top: 0; - width: 0; +.public_Scrollbar_mainOpaque, +.public_Scrollbar_mainOpaque.public_Scrollbar_mainActive, +.public_Scrollbar_mainOpaque:hover { + background-color: #fff; } -.fixedDataTableRowLayout_columnsShadow { - width: 4px; +.public_Scrollbar_face:after { + background-color: #c2c2c2; } -.fixedDataTableRowLayout_rowWrapper { - position: absolute; - top: 0; +.public_Scrollbar_main:hover .public_Scrollbar_face:after, +.public_Scrollbar_mainActive .public_Scrollbar_face:after, +.public_Scrollbar_faceActive:after { + background-color: #7d7d7d; } diff --git a/dist/fixed-data-table.js b/dist/fixed-data-table.js index 29a1eafe..df48e0f6 100644 --- a/dist/fixed-data-table.js +++ b/dist/fixed-data-table.js @@ -18,7 +18,7 @@ exports["FixedDataTable"] = factory(require("react"), require("react-dom")); else root["FixedDataTable"] = factory(root["React"], root["ReactDOM"]); -})(this, function(__WEBPACK_EXTERNAL_MODULE_28__, __WEBPACK_EXTERNAL_MODULE_46__) { +})(this, function(__WEBPACK_EXTERNAL_MODULE_28__, __WEBPACK_EXTERNAL_MODULE_45__) { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; @@ -65,23 +65,23 @@ return /******/ (function(modules) { // webpackBootstrap /* 0 */ /***/ function(module, exports, __webpack_require__) { + __webpack_require__(1); + __webpack_require__(5); + __webpack_require__(7); + __webpack_require__(9); + __webpack_require__(11); __webpack_require__(13); __webpack_require__(15); __webpack_require__(17); __webpack_require__(19); __webpack_require__(21); __webpack_require__(23); - __webpack_require__(1); - __webpack_require__(5); - __webpack_require__(7); - __webpack_require__(9); - __webpack_require__(11); module.exports = __webpack_require__(25); /***/ }, /* 1 */ -/***/ function(module, exports, __webpack_require__) { +/***/ function(module, exports) { // removed by extract-text-webpack-plugin @@ -90,70 +90,70 @@ return /******/ (function(modules) { // webpackBootstrap /* 3 */, /* 4 */, /* 5 */ -/***/ function(module, exports, __webpack_require__) { +/***/ function(module, exports) { // removed by extract-text-webpack-plugin /***/ }, /* 6 */, /* 7 */ -/***/ function(module, exports, __webpack_require__) { +/***/ function(module, exports) { // removed by extract-text-webpack-plugin /***/ }, /* 8 */, /* 9 */ -/***/ function(module, exports, __webpack_require__) { +/***/ function(module, exports) { // removed by extract-text-webpack-plugin /***/ }, /* 10 */, /* 11 */ -/***/ function(module, exports, __webpack_require__) { +/***/ function(module, exports) { // removed by extract-text-webpack-plugin /***/ }, /* 12 */, /* 13 */ -/***/ function(module, exports, __webpack_require__) { +/***/ function(module, exports) { // removed by extract-text-webpack-plugin /***/ }, /* 14 */, /* 15 */ -/***/ function(module, exports, __webpack_require__) { +/***/ function(module, exports) { // removed by extract-text-webpack-plugin /***/ }, /* 16 */, /* 17 */ -/***/ function(module, exports, __webpack_require__) { +/***/ function(module, exports) { // removed by extract-text-webpack-plugin /***/ }, /* 18 */, /* 19 */ -/***/ function(module, exports, __webpack_require__) { +/***/ function(module, exports) { // removed by extract-text-webpack-plugin /***/ }, /* 20 */, /* 21 */ -/***/ function(module, exports, __webpack_require__) { +/***/ function(module, exports) { // removed by extract-text-webpack-plugin /***/ }, /* 22 */, /* 23 */ -/***/ function(module, exports, __webpack_require__) { +/***/ function(module, exports) { // removed by extract-text-webpack-plugin @@ -176,15 +176,16 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; var FixedDataTable = __webpack_require__(26); - var FixedDataTableCellDefault = __webpack_require__(66); - var FixedDataTableColumn = __webpack_require__(64); - var FixedDataTableColumnGroup = __webpack_require__(63); + var FixedDataTableCellDefault = __webpack_require__(65); + var FixedDataTableColumn = __webpack_require__(63); + var FixedDataTableColumnGroup = __webpack_require__(62); var FixedDataTableRoot = { Cell: FixedDataTableCellDefault, Column: FixedDataTableColumn, ColumnGroup: FixedDataTableColumnGroup, - Table: FixedDataTable }; + Table: FixedDataTable + }; FixedDataTableRoot.version = '0.6.0'; module.exports = FixedDataTableRoot; @@ -240,7 +241,7 @@ return /******/ (function(modules) { // webpackBootstrap */ var notified = {}; function notifyDeprecated(prop, reason) { - if (true) { + if (false) { if (!notified[prop]) { console.warn('`' + prop + '` will be DEPRECATED in version ' + NEXT_VERSION + ' of FixedDataTable and beyond. \n' + reason + '\n' + 'Read the docs at: ' + DOCUMENTATION_URL); notified[prop] = true; @@ -493,7 +494,8 @@ return /******/ (function(modules) { // webpackBootstrap /** * Whether a column is currently being resized. */ - isColumnResizing: PropTypes.bool }, + isColumnResizing: PropTypes.bool + }, getInitialState: function getInitialState() { // Throw warnings on deprecated props. @@ -707,7 +709,8 @@ return /******/ (function(modules) { // webpackBootstrap }), this._convertedColumns(this.state.needsMigration) ); - } }); + } + }); module.exports = TransitionTable; @@ -732,7 +735,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, /* 28 */ -/***/ function(module, exports, __webpack_require__) { +/***/ function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_28__; @@ -760,22 +763,22 @@ return /******/ (function(modules) { // webpackBootstrap var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var React = __webpack_require__(27); - var ReactComponentWithPureRenderMixin = __webpack_require__(31); - var ReactWheelHandler = __webpack_require__(32); - var Scrollbar = __webpack_require__(40); - var FixedDataTableBufferedRows = __webpack_require__(54); - var FixedDataTableColumnResizeHandle = __webpack_require__(68); - var FixedDataTableRow = __webpack_require__(59); - var FixedDataTableScrollHelper = __webpack_require__(69); - var FixedDataTableWidthHelper = __webpack_require__(30); - - var cx = __webpack_require__(48); + var ReactComponentWithPureRenderMixin = __webpack_require__(30); + var ReactWheelHandler = __webpack_require__(31); + var Scrollbar = __webpack_require__(39); + var FixedDataTableBufferedRows = __webpack_require__(53); + var FixedDataTableColumnResizeHandle = __webpack_require__(67); + var FixedDataTableRow = __webpack_require__(58); + var FixedDataTableScrollHelper = __webpack_require__(68); + var FixedDataTableWidthHelper = __webpack_require__(70); + + var cx = __webpack_require__(47); var debounceCore = __webpack_require__(71); - var emptyFunction = __webpack_require__(33); - var invariant = __webpack_require__(53); - var joinClasses = __webpack_require__(67); + var emptyFunction = __webpack_require__(32); + var invariant = __webpack_require__(52); + var joinClasses = __webpack_require__(66); var shallowEqual = __webpack_require__(72); - var translateDOMPositionXY = __webpack_require__(49); + var translateDOMPositionXY = __webpack_require__(48); var PropTypes = React.PropTypes; @@ -998,7 +1001,8 @@ return /******/ (function(modules) { // webpackBootstrap /** * Whether a column is currently being resized. */ - isColumnResizing: PropTypes.bool }, + isColumnResizing: PropTypes.bool + }, getDefaultProps: function getDefaultProps() /*object*/{ return { @@ -1006,7 +1010,8 @@ return /******/ (function(modules) { // webpackBootstrap groupHeaderHeight: 0, headerHeight: 0, scrollLeft: 0, - scrollTop: 0 }; + scrollTop: 0 + }; }, getInitialState: function getInitialState() /*object*/{ @@ -1400,6 +1405,10 @@ return /******/ (function(modules) { // webpackBootstrap useGroupHeader = true; } + if (oldState && (props.width !== undefined && props.width !== oldState.width || props.height !== undefined && props.height !== oldState.height || props.maxWidth !== undefined && props.maxWidth !== oldState.maxWidth || props.maxHeight !== undefined && props.maxHeight !== oldState.maxHeight)) { + oldState = null; + } + var firstRowIndex = oldState && oldState.firstRowIndex || 0; var firstRowOffset = oldState && oldState.firstRowOffset || 0; var scrollX, scrollY; @@ -1529,7 +1538,8 @@ return /******/ (function(modules) { // webpackBootstrap // The order of elements in this object metters and bringing bodyHeight, // height or useGroupHeader to the top can break various features var newState = _extends({ - isColumnResizing: oldState && oldState.isColumnResizing }, columnInfo, props, { + isColumnResizing: oldState && oldState.isColumnResizing + }, columnInfo, props, { columns: columns, columnGroups: columnGroups, @@ -1549,7 +1559,8 @@ return /******/ (function(modules) { // webpackBootstrap bodyHeight: bodyHeight, height: height, groupHeaderHeight: groupHeaderHeight, - useGroupHeader: useGroupHeader }); + useGroupHeader: useGroupHeader + }); return newState; }, @@ -1577,7 +1588,8 @@ return /******/ (function(modules) { // webpackBootstrap } return { fixed: fixedColumns, - scrollable: scrollableColumns }; + scrollable: scrollableColumns + }; }, _onWheel: function _onWheel( /*number*/deltaX, /*number*/deltaY) { @@ -1594,13 +1606,15 @@ return /******/ (function(modules) { // webpackBootstrap firstRowOffset: scrollState.offset, scrollY: scrollState.position, scrollContentHeight: scrollState.contentHeight, - maxScrollY: maxScrollY }); + maxScrollY: maxScrollY + }); } else if (deltaX && this.props.overflowX !== 'hidden') { x += deltaX; x = x < 0 ? 0 : x; x = x > this.state.maxScrollX ? this.state.maxScrollX : x; this.setState({ - scrollX: x }); + scrollX: x + }); } this._didScrollStop(); @@ -1613,7 +1627,8 @@ return /******/ (function(modules) { // webpackBootstrap this._didScrollStart(); } this.setState({ - scrollX: scrollPos }); + scrollX: scrollPos + }); this._didScrollStop(); } }, @@ -1628,7 +1643,8 @@ return /******/ (function(modules) { // webpackBootstrap firstRowIndex: scrollState.index, firstRowOffset: scrollState.offset, scrollY: scrollState.position, - scrollContentHeight: scrollState.contentHeight }); + scrollContentHeight: scrollState.contentHeight + }); this._didScrollStop(); } }, @@ -1650,7 +1666,8 @@ return /******/ (function(modules) { // webpackBootstrap this.props.onScrollEnd(this.state.scrollX, this.state.scrollY); } } - } }); + } + }); var HorizontalScrollbar = React.createClass({ displayName: 'HorizontalScrollbar', @@ -1661,17 +1678,20 @@ return /******/ (function(modules) { // webpackBootstrap offset: PropTypes.number.isRequired, onScroll: PropTypes.func.isRequired, position: PropTypes.number.isRequired, - size: PropTypes.number.isRequired }, + size: PropTypes.number.isRequired + }, render: function render() /*object*/{ var outerContainerStyle = { height: Scrollbar.SIZE, - width: this.props.size }; + width: this.props.size + }; var innerContainerStyle = { height: Scrollbar.SIZE, position: 'absolute', overflow: 'hidden', - width: this.props.size }; + width: this.props.size + }; translateDOMPositionXY(innerContainerStyle, 0, this.props.offset); return React.createElement( @@ -1689,150 +1709,16 @@ return /******/ (function(modules) { // webpackBootstrap })) ) ); - } }); + } + }); module.exports = FixedDataTable; - // isColumnResizing should be overwritten by value from props if // avaialble /***/ }, /* 30 */ -/***/ function(module, exports, __webpack_require__) { - - /** - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule FixedDataTableWidthHelper - * @typechecks - */ - - 'use strict'; - - var React = __webpack_require__(27); - - function getTotalWidth( /*array*/columns) /*number*/{ - var totalWidth = 0; - for (var i = 0; i < columns.length; ++i) { - totalWidth += columns[i].props.width; - } - return totalWidth; - } - - function getTotalFlexGrow( /*array*/columns) /*number*/{ - var totalFlexGrow = 0; - for (var i = 0; i < columns.length; ++i) { - totalFlexGrow += columns[i].props.flexGrow || 0; - } - return totalFlexGrow; - } - - function distributeFlexWidth( - /*array*/columns, - /*number*/flexWidth) /*object*/{ - if (flexWidth <= 0) { - return { - columns: columns, - width: getTotalWidth(columns) }; - } - var remainingFlexGrow = getTotalFlexGrow(columns); - var remainingFlexWidth = flexWidth; - var newColumns = []; - var totalWidth = 0; - for (var i = 0; i < columns.length; ++i) { - var column = columns[i]; - if (!column.props.flexGrow) { - totalWidth += column.props.width; - newColumns.push(column); - continue; - } - var columnFlexWidth = Math.floor(column.props.flexGrow / remainingFlexGrow * remainingFlexWidth); - var newColumnWidth = Math.floor(column.props.width + columnFlexWidth); - totalWidth += newColumnWidth; - - remainingFlexGrow -= column.props.flexGrow; - remainingFlexWidth -= columnFlexWidth; - - newColumns.push(React.cloneElement(column, { width: newColumnWidth })); - } - - return { - columns: newColumns, - width: totalWidth }; - } - - function adjustColumnGroupWidths( - /*array*/columnGroups, - /*number*/expectedWidth) /*object*/{ - var allColumns = []; - var i; - for (i = 0; i < columnGroups.length; ++i) { - React.Children.forEach(columnGroups[i].props.children, function (column) { - allColumns.push(column); - }); - } - var columnsWidth = getTotalWidth(allColumns); - var remainingFlexGrow = getTotalFlexGrow(allColumns); - var remainingFlexWidth = Math.max(expectedWidth - columnsWidth, 0); - - var newAllColumns = []; - var newColumnGroups = []; - - for (i = 0; i < columnGroups.length; ++i) { - var columnGroup = columnGroups[i]; - var currentColumns = []; - - React.Children.forEach(columnGroup.props.children, function (column) { - currentColumns.push(column); - }); - - var columnGroupFlexGrow = getTotalFlexGrow(currentColumns); - var columnGroupFlexWidth = Math.floor(columnGroupFlexGrow / remainingFlexGrow * remainingFlexWidth); - - var newColumnSettings = distributeFlexWidth(currentColumns, columnGroupFlexWidth); - - remainingFlexGrow -= columnGroupFlexGrow; - remainingFlexWidth -= columnGroupFlexWidth; - - for (var j = 0; j < newColumnSettings.columns.length; ++j) { - newAllColumns.push(newColumnSettings.columns[j]); - } - - newColumnGroups.push(React.cloneElement(columnGroup, { width: newColumnSettings.width })); - } - - return { - columns: newAllColumns, - columnGroups: newColumnGroups }; - } - - function adjustColumnWidths( - /*array*/columns, - /*number*/expectedWidth) /*array*/{ - var columnsWidth = getTotalWidth(columns); - if (columnsWidth < expectedWidth) { - return distributeFlexWidth(columns, expectedWidth - columnsWidth).columns; - } - return columns; - } - - var FixedDataTableWidthHelper = { - getTotalWidth: getTotalWidth, - getTotalFlexGrow: getTotalFlexGrow, - distributeFlexWidth: distributeFlexWidth, - adjustColumnWidths: adjustColumnWidths, - adjustColumnGroupWidths: adjustColumnGroupWidths }; - - module.exports = FixedDataTableWidthHelper; - -/***/ }, -/* 31 */ -/***/ function(module, exports, __webpack_require__) { +/***/ function(module, exports) { /** * Copyright (c) 2015, Facebook, Inc. @@ -1907,7 +1793,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = ReactComponentWithPureRenderMixin; /***/ }, -/* 32 */ +/* 31 */ /***/ function(module, exports, __webpack_require__) { /** @@ -1931,9 +1817,9 @@ return /******/ (function(modules) { // webpackBootstrap function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - var emptyFunction = __webpack_require__(33); - var normalizeWheel = __webpack_require__(34); - var requestAnimationFramePolyfill = __webpack_require__(38); + var emptyFunction = __webpack_require__(32); + var normalizeWheel = __webpack_require__(33); + var requestAnimationFramePolyfill = __webpack_require__(37); var ReactWheelHandler = (function () { /** @@ -2017,8 +1903,8 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = ReactWheelHandler; /***/ }, -/* 33 */ -/***/ function(module, exports, __webpack_require__) { +/* 32 */ +/***/ function(module, exports) { /** * Copyright (c) 2015, Facebook, Inc. @@ -2060,7 +1946,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = emptyFunction; /***/ }, -/* 34 */ +/* 33 */ /***/ function(module, exports, __webpack_require__) { /** @@ -2077,9 +1963,9 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; - var UserAgent_DEPRECATED = __webpack_require__(35); + var UserAgent_DEPRECATED = __webpack_require__(34); - var isEventSupported = __webpack_require__(36); + var isEventSupported = __webpack_require__(35); // Reasonable defaults var PIXEL_STEP = 10; @@ -2261,8 +2147,8 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = normalizeWheel; /***/ }, -/* 35 */ -/***/ function(module, exports, __webpack_require__) { +/* 34 */ +/***/ function(module, exports) { /** * Copyright 2004-present Facebook. All Rights Reserved. @@ -2524,7 +2410,7 @@ return /******/ (function(modules) { // webpackBootstrap }, mobile: function mobile() { - return _populate() || (_iphone || _ipad || _android || _mobile); + return _populate() || _iphone || _ipad || _android || _mobile; }, nativeApp: function nativeApp() { @@ -2544,7 +2430,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = UserAgent_DEPRECATED; /***/ }, -/* 36 */ +/* 35 */ /***/ function(module, exports, __webpack_require__) { /** @@ -2560,7 +2446,7 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; - var ExecutionEnvironment = __webpack_require__(37); + var ExecutionEnvironment = __webpack_require__(36); var useHasFeature; if (ExecutionEnvironment.canUseDOM) { @@ -2609,8 +2495,8 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = isEventSupported; /***/ }, -/* 37 */ -/***/ function(module, exports, __webpack_require__) { +/* 36 */ +/***/ function(module, exports) { /** * Copyright (c) 2015, Facebook, Inc. @@ -2652,7 +2538,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = ExecutionEnvironment; /***/ }, -/* 38 */ +/* 37 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {/** @@ -2668,8 +2554,8 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; - var emptyFunction = __webpack_require__(33); - var nativeRequestAnimationFrame = __webpack_require__(39); + var emptyFunction = __webpack_require__(32); + var nativeRequestAnimationFrame = __webpack_require__(38); var lastTime = 0; @@ -2693,8 +2579,8 @@ return /******/ (function(modules) { // webpackBootstrap /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) /***/ }, -/* 39 */ -/***/ function(module, exports, __webpack_require__) { +/* 38 */ +/***/ function(module, exports) { /* WEBPACK VAR INJECTION */(function(global) {/** * Copyright (c) 2015, Facebook, Inc. @@ -2715,7 +2601,7 @@ return /******/ (function(modules) { // webpackBootstrap /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) /***/ }, -/* 40 */ +/* 39 */ /***/ function(module, exports, __webpack_require__) { /** @@ -2732,23 +2618,24 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; - var DOMMouseMoveTracker = __webpack_require__(41); - var Keys = __webpack_require__(44); + var DOMMouseMoveTracker = __webpack_require__(40); + var Keys = __webpack_require__(43); var React = __webpack_require__(27); - var ReactDOM = __webpack_require__(45); - var ReactComponentWithPureRenderMixin = __webpack_require__(31); - var ReactWheelHandler = __webpack_require__(32); + var ReactDOM = __webpack_require__(44); + var ReactComponentWithPureRenderMixin = __webpack_require__(30); + var ReactWheelHandler = __webpack_require__(31); - var cssVar = __webpack_require__(47); - var cx = __webpack_require__(48); - var emptyFunction = __webpack_require__(33); - var translateDOMPositionXY = __webpack_require__(49); + var cssVar = __webpack_require__(46); + var cx = __webpack_require__(47); + var emptyFunction = __webpack_require__(32); + var translateDOMPositionXY = __webpack_require__(48); var PropTypes = React.PropTypes; var UNSCROLLABLE_STATE = { position: 0, - scrollable: false }; + scrollable: false + }; var FACE_MARGIN = parseInt(cssVar('scrollbar-face-margin'), 10); var FACE_MARGIN_2 = FACE_MARGIN * 2; @@ -2795,7 +2682,8 @@ return /******/ (function(modules) { // webpackBootstrap isOpaque: false, onScroll: emptyFunction, orientation: 'vertical', - zIndex: 99 }; + zIndex: 99 + }; }, render: function render() /*?object*/{ @@ -2819,20 +2707,23 @@ return /******/ (function(modules) { // webpackBootstrap 'ScrollbarLayout/mainHorizontal': isHorizontal, 'public/Scrollbar/main': true, 'public/Scrollbar/mainOpaque': isOpaque, - 'public/Scrollbar/mainActive': isActive }); + 'public/Scrollbar/mainActive': isActive + }); var faceClassName = cx({ 'ScrollbarLayout/face': true, 'ScrollbarLayout/faceHorizontal': isHorizontal, 'ScrollbarLayout/faceVertical': isVertical, 'public/Scrollbar/faceActive': isActive, - 'public/Scrollbar/face': true }); + 'public/Scrollbar/face': true + }); var position = this.state.position * this.state.scale + FACE_MARGIN; if (isHorizontal) { mainStyle = { - width: size }; + width: size + }; faceStyle = { width: faceSize - FACE_MARGIN_2 }; @@ -2840,9 +2731,11 @@ return /******/ (function(modules) { // webpackBootstrap } else { mainStyle = { top: verticalTop, - height: size }; + height: size + }; faceStyle = { - height: faceSize - FACE_MARGIN_2 }; + height: faceSize - FACE_MARGIN_2 + }; translateDOMPositionXY(faceStyle, 0, position); } @@ -2923,7 +2816,7 @@ return /******/ (function(modules) { // webpackBootstrap return UNSCROLLABLE_STATE; } - var stateKey = '' + position + '_' + size + '_' + contentSize + '_' + orientation; + var stateKey = position + '_' + size + '_' + contentSize + '_' + orientation; if (this._stateKey === stateKey) { return this._stateForKey; } @@ -2962,7 +2855,8 @@ return /******/ (function(modules) { // webpackBootstrap isHorizontal: isHorizontal, position: position, scale: scale, - scrollable: scrollable }; + scrollable: scrollable + }; // cache the state for later use. this._stateKey = stateKey; @@ -3103,12 +2997,14 @@ return /******/ (function(modules) { // webpackBootstrap _onFocus: function _onFocus() { this.setState({ - focused: true }); + focused: true + }); }, _onBlur: function _onBlur() { this.setState({ - focused: false }); + focused: false + }); }, _blur: function _blur() { @@ -3116,7 +3012,9 @@ return /******/ (function(modules) { // webpackBootstrap try { this._onBlur(); ReactDOM.findDOMNode(this).blur(); - } catch (oops) {} + } catch (oops) { + // pass + } } }, @@ -3146,17 +3044,16 @@ return /******/ (function(modules) { // webpackBootstrap _didScroll: function _didScroll() { this.props.onScroll(this.state.position); - } }); + } + }); Scrollbar.KEYBOARD_SCROLL_AMOUNT = KEYBOARD_SCROLL_AMOUNT; Scrollbar.SIZE = parseInt(cssVar('scrollbar-size'), 10); module.exports = Scrollbar; - // pass - /***/ }, -/* 41 */ +/* 40 */ /***/ function(module, exports, __webpack_require__) { /** @@ -3184,10 +3081,10 @@ return /******/ (function(modules) { // webpackBootstrap function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - var EventListener = __webpack_require__(42); + var EventListener = __webpack_require__(41); - var cancelAnimationFramePolyfill = __webpack_require__(43); - var requestAnimationFramePolyfill = __webpack_require__(38); + var cancelAnimationFramePolyfill = __webpack_require__(42); + var requestAnimationFramePolyfill = __webpack_require__(37); var DOMMouseMoveTracker = (function () { /** @@ -3211,15 +3108,15 @@ return /******/ (function(modules) { // webpackBootstrap this._didMouseMove = this._didMouseMove.bind(this); } + /** + * This is to set up the listeners for listening to mouse move + * and mouse up signaling the movement has ended. Please note that these + * listeners are added at the document.body level. It takes in an event + * in order to grab inital state. + */ + _createClass(DOMMouseMoveTracker, [{ key: 'captureMouseMoves', - - /** - * This is to set up the listeners for listening to mouse move - * and mouse up signaling the movement has ended. Please note that these - * listeners are added at the document.body level. It takes in an event - * in order to grab inital state. - */ value: function captureMouseMoves( /*object*/event) { if (!this._eventMoveToken && !this._eventUpToken) { this._eventMoveToken = EventListener.listen(this._domNode, 'mousemove', this._onMouseMove); @@ -3235,12 +3132,12 @@ return /******/ (function(modules) { // webpackBootstrap } event.preventDefault(); } - }, { - key: 'releaseMouseMoves', /** * These releases all of the listeners on document.body. */ + }, { + key: 'releaseMouseMoves', value: function releaseMouseMoves() { if (this._eventMoveToken && this._eventUpToken) { this._eventMoveToken.remove(); @@ -3260,21 +3157,21 @@ return /******/ (function(modules) { // webpackBootstrap this._y = null; } } - }, { - key: 'isDragging', /** * Returns whether or not if the mouse movement is being tracked. */ + }, { + key: 'isDragging', value: function isDragging() /*boolean*/{ return this._isDragging; } - }, { - key: '_onMouseMove', /** * Calls onMove passed into constructor and updates internal state. */ + }, { + key: '_onMouseMove', value: function _onMouseMove( /*object*/event) { var x = event.clientX; var y = event.clientY; @@ -3300,12 +3197,12 @@ return /******/ (function(modules) { // webpackBootstrap this._deltaX = 0; this._deltaY = 0; } - }, { - key: '_onMouseUp', /** * Calls onMoveEnd passed into constructor and updates internal state. */ + }, { + key: '_onMouseUp', value: function _onMouseUp() { if (this._animationFrameID) { this._didMouseMove(); @@ -3320,7 +3217,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = DOMMouseMoveTracker; /***/ }, -/* 42 */ +/* 41 */ /***/ function(module, exports, __webpack_require__) { /** @@ -3337,7 +3234,7 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; - var emptyFunction = __webpack_require__(33); + var emptyFunction = __webpack_require__(32); /** * Upstream version of event listener. Does not take into account specific @@ -3387,7 +3284,7 @@ return /******/ (function(modules) { // webpackBootstrap } }; } else { - if (true) { + if (false) { console.error('Attempted to listen to events during the capture phase on a ' + 'browser that does not support the capture phase. Your application ' + 'will not receive some events.'); } return { @@ -3402,8 +3299,8 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = EventListener; /***/ }, -/* 43 */ -/***/ function(module, exports, __webpack_require__) { +/* 42 */ +/***/ function(module, exports) { /* WEBPACK VAR INJECTION */(function(global) {/** * Copyright (c) 2015, Facebook, Inc. @@ -3428,8 +3325,8 @@ return /******/ (function(modules) { // webpackBootstrap /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) /***/ }, -/* 44 */ -/***/ function(module, exports, __webpack_require__) { +/* 43 */ +/***/ function(module, exports) { /** * Copyright (c) 2015, Facebook, Inc. @@ -3470,7 +3367,7 @@ return /******/ (function(modules) { // webpackBootstrap }; /***/ }, -/* 45 */ +/* 44 */ /***/ function(module, exports, __webpack_require__) { /** @@ -3486,17 +3383,17 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; - module.exports = __webpack_require__(46); + module.exports = __webpack_require__(45); /***/ }, -/* 46 */ -/***/ function(module, exports, __webpack_require__) { +/* 45 */ +/***/ function(module, exports) { - module.exports = __WEBPACK_EXTERNAL_MODULE_46__; + module.exports = __WEBPACK_EXTERNAL_MODULE_45__; /***/ }, -/* 47 */ -/***/ function(module, exports, __webpack_require__) { +/* 46 */ +/***/ function(module, exports) { /** * Copyright (c) 2015, Facebook, Inc. @@ -3510,7 +3407,7 @@ return /******/ (function(modules) { // webpackBootstrap * @typechecks */ - 'use strict'; + "use strict"; var CSS_VARS = { 'scrollbar-face-active-color': '#7d7d7d', @@ -3521,7 +3418,8 @@ return /******/ (function(modules) { // webpackBootstrap 'scrollbar-size-large': '17px', 'scrollbar-track-color': 'rgba(255, 255, 255, 0.8)', 'fbui-white': '#fff', - 'fbui-desktop-background-light': '#f6f7f8' }; + 'fbui-desktop-background-light': '#f6f7f8' + }; /** * @param {string} name @@ -3539,8 +3437,8 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = cssVar; /***/ }, -/* 48 */ -/***/ function(module, exports, __webpack_require__) { +/* 47 */ +/***/ function(module, exports) { /** * Copyright (c) 2015, Facebook, Inc. @@ -3598,7 +3496,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = cx; /***/ }, -/* 49 */ +/* 48 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {/** @@ -3615,9 +3513,9 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; - var BrowserSupportCore = __webpack_require__(50); + var BrowserSupportCore = __webpack_require__(49); - var getVendorPrefixedName = __webpack_require__(51); + var getVendorPrefixedName = __webpack_require__(50); var TRANSFORM = getVendorPrefixedName('transform'); var BACKFACE_VISIBILITY = getVendorPrefixedName('backfaceVisibility'); @@ -3652,7 +3550,7 @@ return /******/ (function(modules) { // webpackBootstrap /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) /***/ }, -/* 50 */ +/* 49 */ /***/ function(module, exports, __webpack_require__) { /** @@ -3668,7 +3566,7 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; - var getVendorPrefixedName = __webpack_require__(51); + var getVendorPrefixedName = __webpack_require__(50); var BrowserSupportCore = { /** @@ -3697,12 +3595,13 @@ return /******/ (function(modules) { // webpackBootstrap */ hasCSSTransitions: function hasCSSTransitions() { return !!getVendorPrefixedName('transition'); - } }; + } + }; module.exports = BrowserSupportCore; /***/ }, -/* 51 */ +/* 50 */ /***/ function(module, exports, __webpack_require__) { /** @@ -3719,10 +3618,10 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; - var ExecutionEnvironment = __webpack_require__(37); + var ExecutionEnvironment = __webpack_require__(36); - var camelize = __webpack_require__(52); - var invariant = __webpack_require__(53); + var camelize = __webpack_require__(51); + var invariant = __webpack_require__(52); var memoized = {}; var prefixes = ['Webkit', 'ms', 'Moz', 'O']; @@ -3759,8 +3658,8 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = getVendorPrefixedName; /***/ }, -/* 52 */ -/***/ function(module, exports, __webpack_require__) { +/* 51 */ +/***/ function(module, exports) { /** * Copyright (c) 2015, Facebook, Inc. @@ -3796,7 +3695,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = camelize; /***/ }, -/* 53 */ +/* 52 */ /***/ function(module, exports, __webpack_require__) { /** @@ -3810,7 +3709,7 @@ return /******/ (function(modules) { // webpackBootstrap * @providesModule invariant */ - 'use strict'; + "use strict"; /** * Use invariant() to assert state which your program assumes to be true. @@ -3824,7 +3723,7 @@ return /******/ (function(modules) { // webpackBootstrap */ var invariant = function invariant(condition, format, a, b, c, d, e, f) { - if (true) { + if (false) { if (format === undefined) { throw new Error('invariant requires an error message argument'); } @@ -3850,7 +3749,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = invariant; /***/ }, -/* 54 */ +/* 53 */ /***/ function(module, exports, __webpack_require__) { /** @@ -3868,13 +3767,13 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; var React = __webpack_require__(27); - var FixedDataTableRowBuffer = __webpack_require__(55); - var FixedDataTableRow = __webpack_require__(59); + var FixedDataTableRowBuffer = __webpack_require__(54); + var FixedDataTableRow = __webpack_require__(58); - var cx = __webpack_require__(48); - var emptyFunction = __webpack_require__(33); - var joinClasses = __webpack_require__(67); - var translateDOMPositionXY = __webpack_require__(49); + var cx = __webpack_require__(47); + var emptyFunction = __webpack_require__(32); + var joinClasses = __webpack_require__(66); + var translateDOMPositionXY = __webpack_require__(48); var PropTypes = React.PropTypes; @@ -3901,12 +3800,14 @@ return /******/ (function(modules) { // webpackBootstrap scrollLeft: PropTypes.number.isRequired, scrollableColumns: PropTypes.array.isRequired, showLastRowBorder: PropTypes.bool, - width: PropTypes.number.isRequired }, + width: PropTypes.number.isRequired + }, getInitialState: function getInitialState() /*object*/{ this._rowBuffer = new FixedDataTableRowBuffer(this.props.rowsCount, this.props.defaultRowHeight, this.props.height, this._getRowHeight); return { - rowsToRender: this._rowBuffer.getRows(this.props.firstRowIndex, this.props.firstRowOffset) }; + rowsToRender: this._rowBuffer.getRows(this.props.firstRowIndex, this.props.firstRowOffset) + }; }, componentWillMount: function componentWillMount() { @@ -3925,14 +3826,16 @@ return /******/ (function(modules) { // webpackBootstrap this._updateBuffer(); } else { this.setState({ - rowsToRender: this._rowBuffer.getRows(nextProps.firstRowIndex, nextProps.firstRowOffset) }); + rowsToRender: this._rowBuffer.getRows(nextProps.firstRowIndex, nextProps.firstRowOffset) + }); } }, _updateBuffer: function _updateBuffer() { if (this.isMounted()) { this.setState({ - rowsToRender: this._rowBuffer.getRowsWithUpdatedBuffer() }); + rowsToRender: this._rowBuffer.getRowsWithUpdatedBuffer() + }); } }, @@ -3977,7 +3880,8 @@ return /******/ (function(modules) { // webpackBootstrap onMouseLeave: props.onRowMouseLeave, className: joinClasses(rowClassNameGetter(rowIndex), cx('public/fixedDataTable/bodyRow'), cx({ 'fixedDataTableLayout/hasBottomBorder': hasBottomBorder, - 'public/fixedDataTable/hasBottomBorder': hasBottomBorder })) + 'public/fixedDataTable/hasBottomBorder': hasBottomBorder + })) }); } @@ -3985,7 +3889,8 @@ return /******/ (function(modules) { // webpackBootstrap var style = { position: 'absolute', - pointerEvents: props.isScrolling ? 'none' : 'auto' }; + pointerEvents: props.isScrolling ? 'none' : 'auto' + }; translateDOMPositionXY(style, 0, props.firstRowOffset - firstRowPosition + props.offsetTop); @@ -3998,12 +3903,13 @@ return /******/ (function(modules) { // webpackBootstrap _getRowHeight: function _getRowHeight( /*number*/index) /*number*/{ return this.props.rowHeightGetter ? this.props.rowHeightGetter(index) : this.props.defaultRowHeight; - } }); + } + }); module.exports = FixedDataTableBufferedRows; /***/ }, -/* 55 */ +/* 54 */ /***/ function(module, exports, __webpack_require__) { /** @@ -4024,10 +3930,10 @@ return /******/ (function(modules) { // webpackBootstrap function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - var IntegerBufferSet = __webpack_require__(56); + var IntegerBufferSet = __webpack_require__(55); - var clamp = __webpack_require__(58); - var invariant = __webpack_require__(53); + var clamp = __webpack_require__(57); + var invariant = __webpack_require__(52); var MIN_BUFFER_ROWS = 3; var MAX_BUFFER_ROWS = 6; @@ -4043,7 +3949,7 @@ return /******/ (function(modules) { // webpackBootstrap /*?function*/rowHeightGetter) { _classCallCheck(this, FixedDataTableRowBuffer); - invariant(defaultRowHeight !== 0, 'defaultRowHeight musn\'t be equal 0 in FixedDataTableRowBuffer'); + invariant(defaultRowHeight !== 0, "defaultRowHeight musn't be equal 0 in FixedDataTableRowBuffer"); this._bufferSet = new IntegerBufferSet(); this._defaultRowHeight = defaultRowHeight; @@ -4131,7 +4037,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = FixedDataTableRowBuffer; /***/ }, -/* 56 */ +/* 55 */ /***/ function(module, exports, __webpack_require__) { /** @@ -4152,9 +4058,9 @@ return /******/ (function(modules) { // webpackBootstrap function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - var Heap = __webpack_require__(57); + var Heap = __webpack_require__(56); - var invariant = __webpack_require__(53); + var invariant = __webpack_require__(52); // Data structure that allows to store values and assign positions to them // in a way to minimize changing positions of stored values when new ones are @@ -4201,7 +4107,7 @@ return /******/ (function(modules) { // webpackBootstrap }, { key: 'getNewPositionForValue', value: function getNewPositionForValue( /*number*/value) /*number*/{ - invariant(this._valueToPositionMap[value] === undefined, 'Shouldn\'t try to find new position for value already stored in BufferSet'); + invariant(this._valueToPositionMap[value] === undefined, "Shouldn't try to find new position for value already stored in BufferSet"); var newPosition = this._size; this._size++; this._pushToHeaps(newPosition, value); @@ -4214,7 +4120,7 @@ return /******/ (function(modules) { // webpackBootstrap /*number*/lowValue, /*number*/highValue, /*number*/newValue) /*?number*/{ - invariant(this._valueToPositionMap[newValue] === undefined, 'Shouldn\'t try to replace values with value already stored value in ' + 'BufferSet'); + invariant(this._valueToPositionMap[newValue] === undefined, "Shouldn't try to replace values with value already stored value in " + "BufferSet"); this._cleanHeaps(); if (this._smallValues.empty() || this._largeValues.empty()) { @@ -4251,7 +4157,8 @@ return /******/ (function(modules) { // webpackBootstrap value: function _pushToHeaps( /*number*/position, /*number*/value) { var element = { position: position, - value: value }; + value: value + }; // We can reuse the same object in both heaps, because we don't mutate them this._smallValues.push(element); this._largeValues.push(element); @@ -4315,8 +4222,8 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = IntegerBufferSet; /***/ }, -/* 57 */ -/***/ function(module, exports, __webpack_require__) { +/* 56 */ +/***/ function(module, exports) { /** * Copyright (c) 2015, Facebook, Inc. @@ -4333,15 +4240,16 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; - var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - /* * @param {*} a * @param {*} b * @return {boolean} */ + + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + function defaultComparator(a, b) { return a < b; } @@ -4356,21 +4264,21 @@ return /******/ (function(modules) { // webpackBootstrap this._heapify(); } + /* + * @return {boolean} + */ + _createClass(Heap, [{ key: 'empty', - - /* - * @return {boolean} - */ value: function empty() { return this._size === 0; } - }, { - key: 'pop', /* * @return {*} */ + }, { + key: 'pop', value: function pop() { if (this._size === 0) { return; @@ -4388,31 +4296,31 @@ return /******/ (function(modules) { // webpackBootstrap return elt; } - }, { - key: 'push', /* * @param {*} item */ + }, { + key: 'push', value: function push(item) { this._items[this._size++] = item; this._bubbleUp(this._size - 1); } - }, { - key: 'size', /* * @return {number} */ + }, { + key: 'size', value: function size() { return this._size; } - }, { - key: 'peek', /* * @return {*} */ + }, { + key: 'peek', value: function peek() { if (this._size === 0) { return; @@ -4427,12 +4335,12 @@ return /******/ (function(modules) { // webpackBootstrap this._sinkDown(index); } } - }, { - key: '_bubbleUp', /* * @parent {number} index */ + }, { + key: '_bubbleUp', value: function _bubbleUp(index) { var elt = this._items[index]; while (index > 0) { @@ -4450,12 +4358,12 @@ return /******/ (function(modules) { // webpackBootstrap index = parentIndex; } } - }, { - key: '_sinkDown', /* * @parent {number} index */ + }, { + key: '_sinkDown', value: function _sinkDown(index) { var elt = this._items[index]; @@ -4498,8 +4406,8 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = Heap; /***/ }, -/* 58 */ -/***/ function(module, exports, __webpack_require__) { +/* 57 */ +/***/ function(module, exports) { /** * Copyright (c) 2015, Facebook, Inc. @@ -4535,7 +4443,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = clamp; /***/ }, -/* 59 */ +/* 58 */ /***/ function(module, exports, __webpack_require__) { /** @@ -4555,11 +4463,11 @@ return /******/ (function(modules) { // webpackBootstrap var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var React = __webpack_require__(27); - var FixedDataTableCellGroup = __webpack_require__(60); + var FixedDataTableCellGroup = __webpack_require__(59); - var cx = __webpack_require__(48); - var joinClasses = __webpack_require__(67); - var translateDOMPositionXY = __webpack_require__(49); + var cx = __webpack_require__(47); + var joinClasses = __webpack_require__(66); + var translateDOMPositionXY = __webpack_require__(48); var PropTypes = React.PropTypes; @@ -4626,19 +4534,22 @@ return /******/ (function(modules) { // webpackBootstrap * @param number|string columnKey * @param object event */ - onColumnResize: PropTypes.func }, + onColumnResize: PropTypes.func + }, render: function render() /*object*/{ var style = { width: this.props.width, - height: this.props.height }; + height: this.props.height + }; var className = cx({ 'fixedDataTableRowLayout/main': true, 'public/fixedDataTableRow/main': true, 'public/fixedDataTableRow/highlighted': this.props.index % 2 === 1, 'public/fixedDataTableRow/odd': this.props.index % 2 === 1, - 'public/fixedDataTableRow/even': this.props.index % 2 === 0 }); + 'public/fixedDataTableRow/even': this.props.index % 2 === 0 + }); var fixedColumnsWidth = this._getColumnsWidth(this.props.fixedColumns); var fixedColumns = React.createElement(FixedDataTableCellGroup, { @@ -4702,7 +4613,8 @@ return /******/ (function(modules) { // webpackBootstrap 'fixedDataTableRowLayout/fixedColumnsDivider': true, 'fixedDataTableRowLayout/columnsShadow': this.props.scrollLeft > 0, 'public/fixedDataTableRow/fixedColumnsDivider': true, - 'public/fixedDataTableRow/columnsShadow': this.props.scrollLeft > 0 }); + 'public/fixedDataTableRow/columnsShadow': this.props.scrollLeft > 0 + }); var style = { left: left, height: this.props.height @@ -4729,7 +4641,8 @@ return /******/ (function(modules) { // webpackBootstrap _onMouseLeave: function _onMouseLeave( /*object*/event) { this.props.onMouseLeave(event, this.props.index); - } }); + } + }); var FixedDataTableRow = React.createClass({ displayName: 'FixedDataTableRow', @@ -4757,13 +4670,15 @@ return /******/ (function(modules) { // webpackBootstrap /** * Width of the row. */ - width: PropTypes.number.isRequired }, + width: PropTypes.number.isRequired + }, render: function render() /*object*/{ var style = { width: this.props.width, height: this.props.height, - zIndex: this.props.zIndex ? this.props.zIndex : 0 }; + zIndex: this.props.zIndex ? this.props.zIndex : 0 + }; translateDOMPositionXY(style, 0, this.props.offsetTop); return React.createElement( @@ -4776,12 +4691,13 @@ return /******/ (function(modules) { // webpackBootstrap zIndex: undefined })) ); - } }); + } + }); module.exports = FixedDataTableRow; /***/ }, -/* 60 */ +/* 59 */ /***/ function(module, exports, __webpack_require__) { /** @@ -4802,12 +4718,12 @@ return /******/ (function(modules) { // webpackBootstrap function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } - var FixedDataTableHelper = __webpack_require__(61); + var FixedDataTableHelper = __webpack_require__(60); var React = __webpack_require__(27); - var FixedDataTableCell = __webpack_require__(65); + var FixedDataTableCell = __webpack_require__(64); - var cx = __webpack_require__(48); - var translateDOMPositionXY = __webpack_require__(49); + var cx = __webpack_require__(47); + var translateDOMPositionXY = __webpack_require__(48); var PropTypes = React.PropTypes; @@ -4840,7 +4756,8 @@ return /******/ (function(modules) { // webpackBootstrap width: PropTypes.number.isRequired, - zIndex: PropTypes.number.isRequired }, + zIndex: PropTypes.number.isRequired + }, render: function render() /*object*/{ var props = this.props; @@ -4863,7 +4780,8 @@ return /******/ (function(modules) { // webpackBootstrap height: props.height, position: 'absolute', width: contentWidth, - zIndex: props.zIndex }; + zIndex: props.zIndex + }; translateDOMPositionXY(style, -1 * DIR_SIGN * props.left, 0); return React.createElement( @@ -4910,7 +4828,8 @@ return /******/ (function(modules) { // webpackBootstrap width += columns[i].props.width; } return width; - } }); + } + }); var FixedDataTableCellGroup = React.createClass({ displayName: 'FixedDataTableCellGroup', @@ -4934,7 +4853,8 @@ return /******/ (function(modules) { // webpackBootstrap * Z-index on which the row will be displayed. Used e.g. for keeping * header and footer in front of other rows. */ - zIndex: PropTypes.number.isRequired }, + zIndex: PropTypes.number.isRequired + }, shouldComponentUpdate: function shouldComponentUpdate( /*object*/nextProps) /*boolean*/{ return !nextProps.isScrolling || this.props.rowIndex !== nextProps.rowIndex || this.props.left !== nextProps.left; @@ -4942,7 +4862,8 @@ return /******/ (function(modules) { // webpackBootstrap getDefaultProps: function getDefaultProps() /*object*/{ return { - offsetLeft: 0 }; + offsetLeft: 0 + }; }, render: function render() /*object*/{ @@ -4952,7 +4873,8 @@ return /******/ (function(modules) { // webpackBootstrap var props = _objectWithoutProperties(_props, ['offsetLeft']); var style = { - height: props.height }; + height: props.height + }; if (DIR_SIGN === 1) { style.left = offsetLeft; @@ -4981,12 +4903,13 @@ return /******/ (function(modules) { // webpackBootstrap /*string|number*/columnKey, /*object*/event) { this.props.onColumnResize && this.props.onColumnResize(this.props.offsetLeft, left - this.props.left + width, width, minWidth, maxWidth, columnKey, event); - } }); + } + }); module.exports = FixedDataTableCellGroup; /***/ }, -/* 61 */ +/* 60 */ /***/ function(module, exports, __webpack_require__) { /** @@ -5003,10 +4926,10 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; - var Locale = __webpack_require__(62); + var Locale = __webpack_require__(61); var React = __webpack_require__(27); - var FixedDataTableColumnGroup = __webpack_require__(63); - var FixedDataTableColumn = __webpack_require__(64); + var FixedDataTableColumnGroup = __webpack_require__(62); + var FixedDataTableColumn = __webpack_require__(63); var DIR_SIGN = Locale.isRTL() ? -1 : +1; // A cell up to 5px outside of the visible area will still be considered visible @@ -5071,7 +4994,8 @@ return /******/ (function(modules) { // webpackBootstrap // new children if (haveColumnsChanged) { newChild = React.cloneElement(originalChild, { - children: newColumns }); + children: newColumns + }); } } else if (originalChild.type === FixedDataTableColumn) { newChild = callback(originalChild); @@ -5088,13 +5012,14 @@ return /******/ (function(modules) { // webpackBootstrap CELL_VISIBILITY_TOLERANCE: CELL_VISIBILITY_TOLERANCE, renderToString: renderToString, forEachColumn: forEachColumn, - mapColumns: mapColumns }; + mapColumns: mapColumns + }; module.exports = FixedDataTableHelper; /***/ }, -/* 62 */ -/***/ function(module, exports, __webpack_require__) { +/* 61 */ +/***/ function(module, exports) { /** * Copyright (c) 2015, Facebook, Inc. @@ -5115,14 +5040,14 @@ return /******/ (function(modules) { // webpackBootstrap return false; }, getDirection: function getDirection() { - return "LTR"; + return 'LTR'; } }; module.exports = Locale; /***/ }, -/* 63 */ +/* 62 */ /***/ function(module, exports, __webpack_require__) { /** @@ -5152,10 +5077,11 @@ return /******/ (function(modules) { // webpackBootstrap displayName: 'TransitionColumnGroup', statics: { - __TableColumnGroup__: true }, + __TableColumnGroup__: true + }, render: function render() { - if (true) { + if (false) { throw new Error('Component should never render'); } return null; @@ -5165,7 +5091,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = TransitionColumnGroup; /***/ }, -/* 64 */ +/* 63 */ /***/ function(module, exports, __webpack_require__) { /** @@ -5199,7 +5125,7 @@ return /******/ (function(modules) { // webpackBootstrap }, render: function render() { - if (true) { + if (false) { throw new Error('Component should never render'); } return null; @@ -5209,7 +5135,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = TransitionColumn; /***/ }, -/* 65 */ +/* 64 */ /***/ function(module, exports, __webpack_require__) { /** @@ -5228,11 +5154,11 @@ return /******/ (function(modules) { // webpackBootstrap function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } - var FixedDataTableCellDefault = __webpack_require__(66); - var FixedDataTableHelper = __webpack_require__(61); + var FixedDataTableCellDefault = __webpack_require__(65); + var FixedDataTableHelper = __webpack_require__(60); var React = __webpack_require__(27); - var cx = __webpack_require__(48); - var joinClasses = __webpack_require__(67); + var cx = __webpack_require__(47); + var joinClasses = __webpack_require__(66); var DIR_SIGN = FixedDataTableHelper.DIR_SIGN; @@ -5240,7 +5166,8 @@ return /******/ (function(modules) { // webpackBootstrap var DEFAULT_PROPS = { align: 'left', - highlighted: false }; + highlighted: false + }; var FixedDataTableCell = React.createClass({ displayName: 'FixedDataTableCell', @@ -5286,7 +5213,8 @@ return /******/ (function(modules) { // webpackBootstrap /** * The left offset in pixels of the cell. */ - left: PropTypes.number }, + left: PropTypes.number + }, shouldComponentUpdate: function shouldComponentUpdate(nextProps) { return !nextProps.isScrolling || this.props.rowIndex !== nextProps.rowIndex; @@ -5306,7 +5234,8 @@ return /******/ (function(modules) { // webpackBootstrap var style = { height: height, - width: width }; + width: width + }; if (DIR_SIGN === 1) { style.left = props.left; @@ -5321,7 +5250,8 @@ return /******/ (function(modules) { // webpackBootstrap 'fixedDataTableCellLayout/alignCenter': props.align === 'center', 'public/fixedDataTableCell/alignRight': props.align === 'right', 'public/fixedDataTableCell/highlighted': props.highlighted, - 'public/fixedDataTableCell/main': true }), props.className); + 'public/fixedDataTableCell/main': true + }), props.className); var columnResizerComponent; if (props.onColumnResize) { @@ -5374,12 +5304,13 @@ return /******/ (function(modules) { // webpackBootstrap _onColumnResizerMouseDown: function _onColumnResizerMouseDown( /*object*/event) { this.props.onColumnResize(this.props.left, this.props.width, this.props.minWidth, this.props.maxWidth, this.props.columnKey, event); - } }); + } + }); module.exports = FixedDataTableCell; /***/ }, -/* 66 */ +/* 65 */ /***/ function(module, exports, __webpack_require__) { /** @@ -5402,8 +5333,8 @@ return /******/ (function(modules) { // webpackBootstrap var React = __webpack_require__(27); - var cx = __webpack_require__(48); - var joinClasses = __webpack_require__(67); + var cx = __webpack_require__(47); + var joinClasses = __webpack_require__(66); var PropTypes = React.PropTypes; @@ -5449,7 +5380,8 @@ return /******/ (function(modules) { // webpackBootstrap * Optional prop that if specified on the `Column` will be passed to the * cell. It can be used to uniquely identify which column is the cell is in. */ - columnKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]) }, + columnKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]) + }, render: function render() { var _props = this.props; @@ -5463,7 +5395,8 @@ return /******/ (function(modules) { // webpackBootstrap var innerStyle = _extends({ height: height, - width: width }, style); + width: width + }, style); return React.createElement( 'div', @@ -5486,13 +5419,14 @@ return /******/ (function(modules) { // webpackBootstrap ) ) ); - } }); + } + }); module.exports = FixedDataTableCellDefault; /***/ }, -/* 67 */ -/***/ function(module, exports, __webpack_require__) { +/* 66 */ +/***/ function(module, exports) { /** * Copyright 2013-2015, Facebook, Inc. @@ -5535,7 +5469,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = joinClasses; /***/ }, -/* 68 */ +/* 67 */ /***/ function(module, exports, __webpack_require__) { /** @@ -5556,13 +5490,13 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; - var DOMMouseMoveTracker = __webpack_require__(41); - var Locale = __webpack_require__(62); + var DOMMouseMoveTracker = __webpack_require__(40); + var Locale = __webpack_require__(61); var React = __webpack_require__(27); - var ReactComponentWithPureRenderMixin = __webpack_require__(31); + var ReactComponentWithPureRenderMixin = __webpack_require__(30); - var clamp = __webpack_require__(58); - var cx = __webpack_require__(48); + var clamp = __webpack_require__(57); + var cx = __webpack_require__(47); var PropTypes = React.PropTypes; @@ -5621,7 +5555,8 @@ return /******/ (function(modules) { // webpackBootstrap /** * Column key for the column being resized. */ - columnKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]) }, + columnKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]) + }, getInitialState: function getInitialState() /*object*/{ return { @@ -5652,7 +5587,8 @@ return /******/ (function(modules) { // webpackBootstrap render: function render() /*object*/{ var style = { width: this.state.width, - height: this.props.height }; + height: this.props.height + }; if (Locale.isRTL()) { style.right = this.props.leftOffset; } else { @@ -5664,7 +5600,8 @@ return /******/ (function(modules) { // webpackBootstrap className: cx({ 'fixedDataTableColumnResizerLineLayout/main': true, 'fixedDataTableColumnResizerLineLayout/hiddenElem': !this.props.visible, - 'public/fixedDataTableColumnResizerLine/main': true }), + 'public/fixedDataTableColumnResizerLine/main': true + }), style: style }, React.createElement('div', { className: cx('fixedDataTableColumnResizerLineLayout/mouseArea'), @@ -5691,12 +5628,13 @@ return /******/ (function(modules) { // webpackBootstrap _onColumnResizeEnd: function _onColumnResizeEnd() { this._mouseMoveTracker.releaseMouseMoves(); this.props.onColumnResizeEnd(this.state.width, this.props.columnKey); - } }); + } + }); module.exports = FixedDataTableColumnResizeHandle; /***/ }, -/* 69 */ +/* 68 */ /***/ function(module, exports, __webpack_require__) { /** @@ -5717,15 +5655,16 @@ return /******/ (function(modules) { // webpackBootstrap function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - var PrefixIntervalTree = __webpack_require__(70); - var clamp = __webpack_require__(58); + var PrefixIntervalTree = __webpack_require__(69); + var clamp = __webpack_require__(57); var BUFFER_ROWS = 5; var NO_ROWS_SCROLL_RESULT = { index: 0, offset: 0, position: 0, - contentHeight: 0 }; + contentHeight: 0 + }; var FixedDataTableScrollHelper = (function () { function FixedDataTableScrollHelper( @@ -5890,7 +5829,8 @@ return /******/ (function(modules) { // webpackBootstrap index: firstRowIndex, offset: firstRowOffset, position: this._position, - contentHeight: this._contentHeight }; + contentHeight: this._contentHeight + }; } }, { key: '_getRowAtEndPosition', @@ -5930,7 +5870,8 @@ return /******/ (function(modules) { // webpackBootstrap index: 0, offset: 0, position: this._position, - contentHeight: this._contentHeight }; + contentHeight: this._contentHeight + }; } else if (position >= this._contentHeight - this._viewportHeight) { // If position is equal to or greater than max scroll value, we need // to make sure to have bottom border of last row visible. @@ -5951,23 +5892,22 @@ return /******/ (function(modules) { // webpackBootstrap index: firstRowIndex, offset: firstRowOffset, position: this._position, - contentHeight: this._contentHeight }; + contentHeight: this._contentHeight + }; } - }, { - key: 'scrollToRow', /** * Allows to scroll to selected row with specified offset. It always * brings that row to top of viewport with that offset */ + }, { + key: 'scrollToRow', value: function scrollToRow( /*number*/rowIndex, /*number*/offset) /*object*/{ rowIndex = clamp(rowIndex, 0, Math.max(this._rowCount - 1, 0)); offset = clamp(offset, -this._storedHeights[rowIndex], 0); var firstRow = this._rowOffsets.sumUntil(rowIndex); return this.scrollTo(firstRow - offset); } - }, { - key: 'scrollRowIntoView', /** * Allows to scroll to selected row by bringing it to viewport with minimal @@ -5977,6 +5917,8 @@ return /******/ (function(modules) { // webpackBootstrap * below end of viewport, it will be scrolled up to be fully visible on the * bottom of viewport. */ + }, { + key: 'scrollRowIntoView', value: function scrollRowIntoView( /*number*/rowIndex) /*object*/{ rowIndex = clamp(rowIndex, 0, Math.max(this._rowCount - 1, 0)); var rowBegin = this._rowOffsets.sumUntil(rowIndex); @@ -5997,7 +5939,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = FixedDataTableScrollHelper; /***/ }, -/* 70 */ +/* 69 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {/** @@ -6009,7 +5951,7 @@ return /******/ (function(modules) { // webpackBootstrap * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule PrefixIntervalTree - * @flow + * * @typechecks */ @@ -6019,7 +5961,7 @@ return /******/ (function(modules) { // webpackBootstrap function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - var invariant = __webpack_require__(53); + var invariant = __webpack_require__(52); var parent = function parent(node) { return Math.floor(node / 2); @@ -6103,12 +6045,12 @@ return /******/ (function(modules) { // webpackBootstrap value: function getSize() { return this._size; } - }, { - key: 'sumUntil', /** * Returns the sum get(0) + get(1) + ... + get(end - 1). */ + }, { + key: 'sumUntil', value: function sumUntil(end) { invariant(0 <= end && end < this._size + 1, 'Index out of range %s', end); @@ -6126,33 +6068,33 @@ return /******/ (function(modules) { // webpackBootstrap return sum; } - }, { - key: 'sumTo', /** * Returns the sum get(0) + get(1) + ... + get(inclusiveEnd). */ + }, { + key: 'sumTo', value: function sumTo(inclusiveEnd) { invariant(0 <= inclusiveEnd && inclusiveEnd < this._size, 'Index out of range %s', inclusiveEnd); return this.sumUntil(inclusiveEnd + 1); } - }, { - key: 'sum', /** * Returns the sum get(begin) + get(begin + 1) + ... + get(end - 1). */ + }, { + key: 'sum', value: function sum(begin, end) { invariant(begin <= end, 'Begin must precede end'); return this.sumUntil(end) - this.sumUntil(begin); } - }, { - key: 'greatestLowerBound', /** * Returns the smallest i such that 0 <= i <= size and sumUntil(i) <= t, or * -1 if no such i exists. */ + }, { + key: 'greatestLowerBound', value: function greatestLowerBound(t) { if (t < 0) { return -1; @@ -6175,13 +6117,13 @@ return /******/ (function(modules) { // webpackBootstrap return node - this._half; } - }, { - key: 'greatestStrictLowerBound', /** * Returns the smallest i such that 0 <= i <= size and sumUntil(i) < t, or * -1 if no such i exists. */ + }, { + key: 'greatestStrictLowerBound', value: function greatestStrictLowerBound(t) { if (t <= 0) { return -1; @@ -6204,23 +6146,23 @@ return /******/ (function(modules) { // webpackBootstrap return node - this._half; } - }, { - key: 'leastUpperBound', /** * Returns the smallest i such that 0 <= i <= size and t <= sumUntil(i), or * size + 1 if no such i exists. */ + }, { + key: 'leastUpperBound', value: function leastUpperBound(t) { return this.greatestStrictLowerBound(t) + 1; } - }, { - key: 'leastStrictUpperBound', /** * Returns the smallest i such that 0 <= i <= size and t < sumUntil(i), or * size + 1 if no such i exists. */ + }, { + key: 'leastStrictUpperBound', value: function leastStrictUpperBound(t) { return this.greatestLowerBound(t) + 1; } @@ -6261,9 +6203,147 @@ return /******/ (function(modules) { // webpackBootstrap /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) /***/ }, -/* 71 */ +/* 70 */ /***/ function(module, exports, __webpack_require__) { + /** + * Copyright (c) 2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule FixedDataTableWidthHelper + * @typechecks + */ + + 'use strict'; + + var React = __webpack_require__(27); + + function getTotalWidth( /*array*/columns) /*number*/{ + var totalWidth = 0; + for (var i = 0; i < columns.length; ++i) { + totalWidth += columns[i].props.width; + } + return totalWidth; + } + + function getTotalFlexGrow( /*array*/columns) /*number*/{ + var totalFlexGrow = 0; + for (var i = 0; i < columns.length; ++i) { + totalFlexGrow += columns[i].props.flexGrow || 0; + } + return totalFlexGrow; + } + + function distributeFlexWidth( + /*array*/columns, + /*number*/flexWidth) /*object*/{ + if (flexWidth <= 0) { + return { + columns: columns, + width: getTotalWidth(columns) + }; + } + var remainingFlexGrow = getTotalFlexGrow(columns); + var remainingFlexWidth = flexWidth; + var newColumns = []; + var totalWidth = 0; + for (var i = 0; i < columns.length; ++i) { + var column = columns[i]; + if (!column.props.flexGrow) { + totalWidth += column.props.width; + newColumns.push(column); + continue; + } + var columnFlexWidth = Math.floor(column.props.flexGrow / remainingFlexGrow * remainingFlexWidth); + var newColumnWidth = Math.floor(column.props.width + columnFlexWidth); + totalWidth += newColumnWidth; + + remainingFlexGrow -= column.props.flexGrow; + remainingFlexWidth -= columnFlexWidth; + + newColumns.push(React.cloneElement(column, { width: newColumnWidth })); + } + + return { + columns: newColumns, + width: totalWidth + }; + } + + function adjustColumnGroupWidths( + /*array*/columnGroups, + /*number*/expectedWidth) /*object*/{ + var allColumns = []; + var i; + for (i = 0; i < columnGroups.length; ++i) { + React.Children.forEach(columnGroups[i].props.children, function (column) { + allColumns.push(column); + }); + } + var columnsWidth = getTotalWidth(allColumns); + var remainingFlexGrow = getTotalFlexGrow(allColumns); + var remainingFlexWidth = Math.max(expectedWidth - columnsWidth, 0); + + var newAllColumns = []; + var newColumnGroups = []; + + for (i = 0; i < columnGroups.length; ++i) { + var columnGroup = columnGroups[i]; + var currentColumns = []; + + React.Children.forEach(columnGroup.props.children, function (column) { + currentColumns.push(column); + }); + + var columnGroupFlexGrow = getTotalFlexGrow(currentColumns); + var columnGroupFlexWidth = Math.floor(columnGroupFlexGrow / remainingFlexGrow * remainingFlexWidth); + + var newColumnSettings = distributeFlexWidth(currentColumns, columnGroupFlexWidth); + + remainingFlexGrow -= columnGroupFlexGrow; + remainingFlexWidth -= columnGroupFlexWidth; + + for (var j = 0; j < newColumnSettings.columns.length; ++j) { + newAllColumns.push(newColumnSettings.columns[j]); + } + + newColumnGroups.push(React.cloneElement(columnGroup, { width: newColumnSettings.width })); + } + + return { + columns: newAllColumns, + columnGroups: newColumnGroups + }; + } + + function adjustColumnWidths( + /*array*/columns, + /*number*/expectedWidth) /*array*/{ + var columnsWidth = getTotalWidth(columns); + if (columnsWidth < expectedWidth) { + return distributeFlexWidth(columns, expectedWidth - columnsWidth).columns; + } + return columns; + } + + var FixedDataTableWidthHelper = { + getTotalWidth: getTotalWidth, + getTotalFlexGrow: getTotalFlexGrow, + distributeFlexWidth: distributeFlexWidth, + adjustColumnWidths: adjustColumnWidths, + adjustColumnGroupWidths: adjustColumnGroupWidths + }; + + module.exports = FixedDataTableWidthHelper; + +/***/ }, +/* 71 */ +/***/ function(module, exports) { + /** * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -6334,7 +6414,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, /* 72 */ -/***/ function(module, exports, __webpack_require__) { +/***/ function(module, exports) { /** * Copyright (c) 2015, Facebook, Inc. @@ -6346,7 +6426,7 @@ return /******/ (function(modules) { // webpackBootstrap * * @providesModule shallowEqual * @typechecks - * @flow + * */ 'use strict'; @@ -6551,20 +6631,23 @@ return /******/ (function(modules) { // webpackBootstrap * Setting the property to false will keep previous behaviour and keep * cell rendered if the row it belongs to is visible. */ - allowCellsRecycling: PropTypes.bool }, + allowCellsRecycling: PropTypes.bool + }, getDefaultProps: function getDefaultProps() /*object*/{ return { allowCellsRecycling: false, - fixed: false }; + fixed: false + }; }, render: function render() { - if (true) { + if (false) { throw new Error('Component should never render'); } return null; - } }); + } + }); module.exports = FixedDataTableColumn; @@ -6597,7 +6680,8 @@ return /******/ (function(modules) { // webpackBootstrap displayName: 'FixedDataTableColumnGroup', statics: { - __TableColumnGroup__: true }, + __TableColumnGroup__: true + }, propTypes: { /** @@ -6629,19 +6713,23 @@ return /******/ (function(modules) { // webpackBootstrap * You can also pass in a function that returns a react elemnt, with the * props object above passed in as the first parameter. */ - header: PropTypes.oneOfType([PropTypes.node, PropTypes.func]) }, + header: PropTypes.oneOfType([PropTypes.node, PropTypes.func]) + + }, getDefaultProps: function getDefaultProps() /*object*/{ return { - fixed: false }; + fixed: false + }; }, render: function render() { - if (true) { + if (false) { throw new Error('Component should never render'); } return null; - } }); + } + }); module.exports = FixedDataTableColumnGroup; @@ -6675,11 +6763,11 @@ return /******/ (function(modules) { // webpackBootstrap var React = __webpack_require__(27); var PropTypes = React.PropTypes; - var cx = __webpack_require__(48); - var joinClasses = __webpack_require__(67); + var cx = __webpack_require__(47); + var joinClasses = __webpack_require__(66); var shallowEqual = __webpack_require__(72); - var CellDefault = __webpack_require__(66); + var CellDefault = __webpack_require__(65); var TransitionCell = React.createClass({ displayName: 'TransitionCell', @@ -6701,6 +6789,7 @@ return /******/ (function(modules) { // webpackBootstrap isHeaderCell: PropTypes.bool, // header isFooterCell: PropTypes.bool }, + // footer shouldComponentUpdate: function shouldComponentUpdate( /*object*/nextProps) { var update = false; var rowData; @@ -6818,7 +6907,8 @@ return /******/ (function(modules) { // webpackBootstrap var innerStyle = _extends({ height: props.height, - width: props.width }, props.style); + width: props.width + }, props.style); return React.createElement( 'div', @@ -6841,7 +6931,6 @@ return /******/ (function(modules) { // webpackBootstrap }); module.exports = TransitionCell; - // footer /***/ } /******/ ]) diff --git a/dist/fixed-data-table.min.css b/dist/fixed-data-table.min.css index e2f1a7b9..6ede2b30 100644 --- a/dist/fixed-data-table.min.css +++ b/dist/fixed-data-table.min.css @@ -9,4 +9,4 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -.public_Scrollbar_main.public_Scrollbar_mainActive,.public_Scrollbar_main:hover{background-color:rgba(255,255,255,.8)}.public_Scrollbar_mainOpaque,.public_Scrollbar_mainOpaque.public_Scrollbar_mainActive,.public_Scrollbar_mainOpaque:hover{background-color:#fff}.public_Scrollbar_face:after{background-color:#c2c2c2}.public_Scrollbar_main:hover .public_Scrollbar_face:after,.public_Scrollbar_mainActive .public_Scrollbar_face:after,.public_Scrollbar_faceActive:after{background-color:#7d7d7d}.public_fixedDataTable_main,.public_fixedDataTable_header,.public_fixedDataTable_hasBottomBorder{border-color:#d3d3d3}.public_fixedDataTable_header .public_fixedDataTableCell_main{font-weight:700}.public_fixedDataTable_header,.public_fixedDataTable_header .public_fixedDataTableCell_main{background-color:#f6f7f8;background-image:-webkit-linear-gradient(#fff,#efefef);background-image:linear-gradient(#fff,#efefef)}.public_fixedDataTable_footer .public_fixedDataTableCell_main{background-color:#f6f7f8;border-color:#d3d3d3}.public_fixedDataTable_topShadow{background:0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAECAYAAABP2FU6AAAAF0lEQVR4AWPUkNeSBhHCjJoK2twgFisAFagCCp3pJlAAAAAASUVORK5CYII=) repeat-x}.public_fixedDataTable_bottomShadow{background:0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAECAYAAABP2FU6AAAAHElEQVQI12MwNjZmZdAT1+Nm0JDWEGZQk1GTBgAWkwIeAEp52AAAAABJRU5ErkJggg==) repeat-x}.public_fixedDataTable_horizontalScrollbar .public_Scrollbar_mainHorizontal{background-color:#fff}.public_fixedDataTableCell_main{background-color:#fff;border-color:#d3d3d3}.public_fixedDataTableCell_highlighted{background-color:#f4f4f4}.public_fixedDataTableCell_cellContent{padding:8px}.public_fixedDataTableCell_columnResizerKnob{background-color:#0284ff}.public_fixedDataTableColumnResizerLine_main{border-color:#0284ff}.public_fixedDataTableRow_main{background-color:#fff}.public_fixedDataTableRow_highlighted,.public_fixedDataTableRow_highlighted .public_fixedDataTableCell_main{background-color:#f6f7f8}.public_fixedDataTableRow_fixedColumnsDivider{border-color:#d3d3d3}.public_fixedDataTableRow_columnsShadow{background:0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABCAYAAAD5PA/NAAAAFklEQVQIHWPSkNeSBmJhTQVtbiDNCgASagIIuJX8OgAAAABJRU5ErkJggg==) repeat-y}.ScrollbarLayout_main{box-sizing:border-box;outline:none;overflow:hidden;position:absolute;-webkit-transition-duration:250ms;transition-duration:250ms;-webkit-transition-timing-function:ease;transition-timing-function:ease;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ScrollbarLayout_mainVertical{bottom:0;right:0;top:0;-webkit-transition-property:background-color width;transition-property:background-color width;width:15px}.ScrollbarLayout_mainVertical.public_Scrollbar_mainActive,.ScrollbarLayout_mainVertical:hover{width:17px}.ScrollbarLayout_mainHorizontal{bottom:0;height:15px;left:0;-webkit-transition-property:background-color height;transition-property:background-color height}.ScrollbarLayout_mainHorizontal.public_Scrollbar_mainActive,.ScrollbarLayout_mainHorizontal:hover{height:17px}.ScrollbarLayout_face{left:0;overflow:hidden;position:absolute;z-index:1}.ScrollbarLayout_face:after{border-radius:6px;content:'';display:block;position:absolute;-webkit-transition:background-color 250ms ease;transition:background-color 250ms ease}.ScrollbarLayout_faceHorizontal{bottom:0;left:0;top:0}.ScrollbarLayout_faceHorizontal:after{bottom:4px;left:0;top:4px;width:100%}.ScrollbarLayout_faceVertical{left:0;right:0;top:0}.ScrollbarLayout_faceVertical:after{height:100%;left:4px;right:4px;top:0}.fixedDataTableCellGroupLayout_cellGroup{-webkit-backface-visibility:hidden;backface-visibility:hidden;left:0;overflow:hidden;position:absolute;top:0;white-space:nowrap}.fixedDataTableCellGroupLayout_cellGroup>.public_fixedDataTableCell_main{display:inline-block;vertical-align:top;white-space:normal}.fixedDataTableCellGroupLayout_cellGroupWrapper{position:absolute;top:0}.fixedDataTableCellLayout_main{border-right-style:solid;border-width:0 1px 0 0;box-sizing:border-box;display:block;overflow:hidden;position:absolute;white-space:normal}.fixedDataTableCellLayout_lastChild{border-width:0 1px 1px 0}.fixedDataTableCellLayout_alignRight{text-align:right}.fixedDataTableCellLayout_alignCenter{text-align:center}.fixedDataTableCellLayout_wrap1{display:table}.fixedDataTableCellLayout_wrap2{display:table-row}.fixedDataTableCellLayout_wrap3{display:table-cell;vertical-align:middle}.fixedDataTableCellLayout_columnResizerContainer{position:absolute;right:0;width:6px;z-index:1}.fixedDataTableCellLayout_columnResizerContainer:hover{cursor:ew-resize}.fixedDataTableCellLayout_columnResizerContainer:hover .fixedDataTableCellLayout_columnResizerKnob{visibility:visible}.fixedDataTableCellLayout_columnResizerKnob{position:absolute;right:0;visibility:hidden;width:4px}.fixedDataTableColumnResizerLineLayout_mouseArea{cursor:ew-resize;position:absolute;right:-5px;width:12px}.fixedDataTableColumnResizerLineLayout_main{border-right-style:solid;border-right-width:1px;box-sizing:border-box;position:absolute;z-index:10}body[dir="rtl"] .fixedDataTableColumnResizerLineLayout_main,.fixedDataTableColumnResizerLineLayout_hiddenElem{display:none!important}.fixedDataTableLayout_main{border-style:solid;border-width:1px;box-sizing:border-box;overflow:hidden;position:relative}.fixedDataTableLayout_header,.fixedDataTableLayout_hasBottomBorder{border-bottom-style:solid;border-bottom-width:1px}.fixedDataTableLayout_footer .public_fixedDataTableCell_main{border-top-style:solid;border-top-width:1px}.fixedDataTableLayout_topShadow,.fixedDataTableLayout_bottomShadow{height:4px;left:0;position:absolute;right:0;z-index:1}.fixedDataTableLayout_bottomShadow{margin-top:-4px}.fixedDataTableLayout_rowsContainer{overflow:hidden;position:relative}.fixedDataTableLayout_horizontalScrollbar{bottom:0;position:absolute}.fixedDataTableRowLayout_main{box-sizing:border-box;overflow:hidden;position:absolute;top:0}.fixedDataTableRowLayout_body{left:0;position:absolute;top:0}.fixedDataTableRowLayout_fixedColumnsDivider{-webkit-backface-visibility:hidden;backface-visibility:hidden;border-left-style:solid;border-left-width:1px;left:0;position:absolute;top:0;width:0}.fixedDataTableRowLayout_columnsShadow{width:4px}.fixedDataTableRowLayout_rowWrapper{position:absolute;top:0} \ No newline at end of file +.fixedDataTableCellGroupLayout_cellGroup{-webkit-backface-visibility:hidden;backface-visibility:hidden;left:0;overflow:hidden;position:absolute;top:0;white-space:nowrap}.fixedDataTableCellGroupLayout_cellGroup>.public_fixedDataTableCell_main{display:inline-block;vertical-align:top;white-space:normal}.fixedDataTableCellGroupLayout_cellGroupWrapper{position:absolute;top:0}.fixedDataTableCellLayout_main{border-right-style:solid;border-width:0 1px 0 0;box-sizing:border-box;display:block;overflow:hidden;position:absolute;white-space:normal}.fixedDataTableCellLayout_lastChild{border-width:0 1px 1px 0}.fixedDataTableCellLayout_alignRight{text-align:right}.fixedDataTableCellLayout_alignCenter{text-align:center}.fixedDataTableCellLayout_wrap1{display:table}.fixedDataTableCellLayout_wrap2{display:table-row}.fixedDataTableCellLayout_wrap3{display:table-cell;vertical-align:middle}.fixedDataTableCellLayout_columnResizerContainer{position:absolute;right:0;width:6px;z-index:1}.fixedDataTableCellLayout_columnResizerContainer:hover{cursor:ew-resize}.fixedDataTableCellLayout_columnResizerContainer:hover .fixedDataTableCellLayout_columnResizerKnob{visibility:visible}.fixedDataTableCellLayout_columnResizerKnob{position:absolute;right:0;visibility:hidden;width:4px}.fixedDataTableColumnResizerLineLayout_mouseArea{cursor:ew-resize;position:absolute;right:-5px;width:12px}.fixedDataTableColumnResizerLineLayout_main{border-right-style:solid;border-right-width:1px;box-sizing:border-box;position:absolute;z-index:10}body[dir="rtl"] .fixedDataTableColumnResizerLineLayout_main,.fixedDataTableColumnResizerLineLayout_hiddenElem{display:none!important}.fixedDataTableLayout_main{border-style:solid;border-width:1px;box-sizing:border-box;overflow:hidden;position:relative}.fixedDataTableLayout_header,.fixedDataTableLayout_hasBottomBorder{border-bottom-style:solid;border-bottom-width:1px}.fixedDataTableLayout_footer .public_fixedDataTableCell_main{border-top-style:solid;border-top-width:1px}.fixedDataTableLayout_topShadow,.fixedDataTableLayout_bottomShadow{height:4px;left:0;position:absolute;right:0;z-index:1}.fixedDataTableLayout_bottomShadow{margin-top:-4px}.fixedDataTableLayout_rowsContainer{overflow:hidden;position:relative}.fixedDataTableLayout_horizontalScrollbar{bottom:0;position:absolute}.fixedDataTableRowLayout_main{box-sizing:border-box;overflow:hidden;position:absolute;top:0}.fixedDataTableRowLayout_body{left:0;position:absolute;top:0}.fixedDataTableRowLayout_fixedColumnsDivider{-webkit-backface-visibility:hidden;backface-visibility:hidden;border-left-style:solid;border-left-width:1px;left:0;position:absolute;top:0;width:0}.fixedDataTableRowLayout_columnsShadow{width:4px}.fixedDataTableRowLayout_rowWrapper{position:absolute;top:0}.ScrollbarLayout_main{box-sizing:border-box;outline:none;overflow:hidden;position:absolute;-webkit-transition-duration:250ms;transition-duration:250ms;-webkit-transition-timing-function:ease;transition-timing-function:ease;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ScrollbarLayout_mainVertical{bottom:0;right:0;top:0;-webkit-transition-property:background-color width;transition-property:background-color width;width:15px}.ScrollbarLayout_mainVertical.public_Scrollbar_mainActive,.ScrollbarLayout_mainVertical:hover{width:17px}.ScrollbarLayout_mainHorizontal{bottom:0;height:15px;left:0;-webkit-transition-property:background-color height;transition-property:background-color height}.ScrollbarLayout_mainHorizontal.public_Scrollbar_mainActive,.ScrollbarLayout_mainHorizontal:hover{height:17px}.ScrollbarLayout_face{left:0;overflow:hidden;position:absolute;z-index:1}.ScrollbarLayout_face:after{border-radius:6px;content:'';display:block;position:absolute;-webkit-transition:background-color 250ms ease;transition:background-color 250ms ease}.ScrollbarLayout_faceHorizontal{bottom:0;left:0;top:0}.ScrollbarLayout_faceHorizontal:after{bottom:4px;left:0;top:4px;width:100%}.ScrollbarLayout_faceVertical{left:0;right:0;top:0}.ScrollbarLayout_faceVertical:after{height:100%;left:4px;right:4px;top:0}.public_fixedDataTable_main,.public_fixedDataTable_header,.public_fixedDataTable_hasBottomBorder{border-color:#d3d3d3}.public_fixedDataTable_header .public_fixedDataTableCell_main{font-weight:700}.public_fixedDataTable_header,.public_fixedDataTable_header .public_fixedDataTableCell_main{background-color:#f6f7f8;background-image:-webkit-linear-gradient(#fff,#efefef);background-image:linear-gradient(#fff,#efefef)}.public_fixedDataTable_footer .public_fixedDataTableCell_main{background-color:#f6f7f8;border-color:#d3d3d3}.public_fixedDataTable_topShadow{background:0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAECAYAAABP2FU6AAAAF0lEQVR4AWPUkNeSBhHCjJoK2twgFisAFagCCp3pJlAAAAAASUVORK5CYII=) repeat-x}.public_fixedDataTable_bottomShadow{background:0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAECAYAAABP2FU6AAAAHElEQVQI12MwNjZmZdAT1+Nm0JDWEGZQk1GTBgAWkwIeAEp52AAAAABJRU5ErkJggg==) repeat-x}.public_fixedDataTable_horizontalScrollbar .public_Scrollbar_mainHorizontal{background-color:#fff}.public_fixedDataTableCell_main{background-color:#fff;border-color:#d3d3d3}.public_fixedDataTableCell_highlighted{background-color:#f4f4f4}.public_fixedDataTableCell_cellContent{padding:8px}.public_fixedDataTableCell_columnResizerKnob{background-color:#0284ff}.public_fixedDataTableColumnResizerLine_main{border-color:#0284ff}.public_fixedDataTableRow_main{background-color:#fff}.public_fixedDataTableRow_highlighted,.public_fixedDataTableRow_highlighted .public_fixedDataTableCell_main{background-color:#f6f7f8}.public_fixedDataTableRow_fixedColumnsDivider{border-color:#d3d3d3}.public_fixedDataTableRow_columnsShadow{background:0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABCAYAAAD5PA/NAAAAFklEQVQIHWPSkNeSBmJhTQVtbiDNCgASagIIuJX8OgAAAABJRU5ErkJggg==) repeat-y}.public_Scrollbar_main.public_Scrollbar_mainActive,.public_Scrollbar_main:hover{background-color:rgba(255,255,255,.8)}.public_Scrollbar_mainOpaque,.public_Scrollbar_mainOpaque.public_Scrollbar_mainActive,.public_Scrollbar_mainOpaque:hover{background-color:#fff}.public_Scrollbar_face:after{background-color:#c2c2c2}.public_Scrollbar_main:hover .public_Scrollbar_face:after,.public_Scrollbar_mainActive .public_Scrollbar_face:after,.public_Scrollbar_faceActive:after{background-color:#7d7d7d} \ No newline at end of file diff --git a/dist/fixed-data-table.min.js b/dist/fixed-data-table.min.js index f237873d..93737707 100644 --- a/dist/fixed-data-table.min.js +++ b/dist/fixed-data-table.min.js @@ -9,6 +9,6 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.FixedDataTable=t(require("react"),require("react-dom")):e.FixedDataTable=t(e.React,e.ReactDOM)}(this,function(e,t){return function(e){function t(i){if(o[i])return o[i].exports;var n=o[i]={exports:{},id:i,loaded:!1};return e[i].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){o(13),o(15),o(17),o(19),o(21),o(23),o(1),o(5),o(7),o(9),o(11),e.exports=o(25)},function(e,t,o){},,,,function(e,t,o){},,function(e,t,o){},,function(e,t,o){},,function(e,t,o){},,function(e,t,o){},,function(e,t,o){},,function(e,t,o){},,function(e,t,o){},,function(e,t,o){},,function(e,t,o){},,function(e,t,o){"use strict";var i=o(26),n=o(66),r=o(64),s=o(63),a={Cell:n,Column:r,ColumnGroup:s,Table:i};a.version="0.6.0",e.exports=a},function(e,t,o){"use strict";function i(e,t){m[e]||(console.warn("`"+e+"` will be DEPRECATED in version "+f+" of FixedDataTable and beyond. \n"+t+"\nRead the docs at: "+p),m[e]=!0)}var n=Object.assign||function(e){for(var t=1;te&&this.state.scrollX>0||e>=0&&this.state.scrollXe&&this.state.scrollY>0||e>=0&&this.state.scrollYi?i:this.state.height>i&&this.props.ownerHeight?Math.max(i,this.props.ownerHeight):this.state.height+this.state.maxScrollY,e!==this._contentHeight&&this.props.onContentHeightChange&&this.props.onContentHeightChange(e),this._contentHeight=e},componentDidMount:function(){this._reportContentHeight()},componentWillReceiveProps:function(e){var t=e.scrollToRow;void 0!==t&&null!==t&&(this._rowToScrollTo=t);var o=e.scrollToColumn;void 0!==o&&null!==o&&(this._columnToScrollTo=o);var i=e.overflowX,n=e.overflowY;(i!==this.props.overflowX||n!==this.props.overflowY)&&(this._wheelHandler=new s(this._onWheel,"hidden"!==i,"hidden"!==n)),(this.props.ownerHeight!==e.ownerHeight||this.props.scrollTop!==e.scrollTop)&&this._didScrollStart(),this._didScrollStop(),this.setState(this._calculateState(e,this.state))},componentDidUpdate:function(){this._reportContentHeight()},render:function(){var e,t=this.state,o=this.props;t.useGroupHeader&&(e=n.createElement(h,{key:"group_header",isScrolling:this._isScrolling,className:w(p("fixedDataTableLayout/header"),p("public/fixedDataTable/header")),width:t.width,height:t.groupHeaderHeight,index:0,zIndex:1,offsetTop:0,scrollLeft:t.scrollX,fixedColumns:t.groupHeaderFixedColumns,scrollableColumns:t.groupHeaderScrollableColumns,onColumnResize:this._onColumnResize}));var i=this.state.maxScrollY,r=t.maxScrollX>0&&"hidden"!==t.overflowX,s=i>0&&"hidden"!==t.overflowY,l=r?a.SIZE:0,c=t.height-l-2*x-t.footerHeight,f=t.useGroupHeader?t.groupHeaderHeight:0,d=f+t.headerHeight;c-=d;var m=0,_=null!=o.maxHeight?d+t.bodyHeight:d+c,g=_+t.footerHeight;void 0!==o.ownerHeight&&o.ownerHeightt.ownerHeight||t.scrollY or "),o.push(e))});var n=!1;o.length&&o[0].type.__TableColumnGroup__&&(n=!0);var r,s,l=t&&t.firstRowIndex||0,u=t&&t.firstRowOffset||0;r=t&&"hidden"!==e.overflowX?t.scrollX:e.scrollLeft,t&&"hidden"!==e.overflowY?s=t.scrollY:(d=this._scrollHelper.scrollTo(e.scrollTop),l=d.index,u=d.offset,s=d.position),void 0!==this._rowToScrollTo&&(d=this._scrollHelper.scrollRowIntoView(this._rowToScrollTo),l=d.index,u=d.offset,s=d.position,delete this._rowToScrollTo);var h=n?e.groupHeaderHeight:0;if(t&&e.rowsCount!==t.rowsCount){var p=(void 0===e.height?e.maxHeight:e.height)-(e.headerHeight||0)-(e.footerHeight||0)-(e.groupHeaderHeight||0);this._scrollHelper=new c(e.rowsCount,e.rowHeight,p,e.rowHeightGetter);var d=this._scrollHelper.scrollToRow(l,u);l=d.index,u=d.offset,s=d.position}else t&&e.rowHeightGetter!==t.rowHeightGetter&&this._scrollHelper.setRowHeightGetter(e.rowHeightGetter);var m;m=e.isColumnResizing?t&&t.columnResizingData:y;var w,g;if(n){var v=f.adjustColumnGroupWidths(o,e.width);w=v.columns,g=v.columnGroups}else w=f.adjustColumnWidths(o,e.width);var b=this._populateColumnsAndColumnData(w,g,t);if(void 0!==this._columnToScrollTo){var R=b.bodyFixedColumns.length;if(this._columnToScrollTo>=R){var T,D,S=0;for(T=0;TT;++T)D=b.bodyScrollableColumns[T],M+=D.props.width;var E=e.width-S,z=b.bodyScrollableColumns[H].props.width,k=M+z-E;k>r&&(r=k),r>M&&(r=M)}delete this._columnToScrollTo}var O=void 0===e.height,P=Math.round(O?e.maxHeight:e.height),N=e.footerHeight+e.headerHeight+h+2*x,I=P-N,G=this._scrollHelper.getContentHeight(),L=G+N,F=f.getTotalWidth(w),W=F>e.width&&"hidden"!==e.overflowX;W&&(I-=a.SIZE,L+=a.SIZE,N+=a.SIZE);var A=Math.max(0,F-e.width),V=Math.max(0,G-I);r=Math.min(r,A),s=Math.min(s,V),V||(O&&(P=L),I=L-N),this._scrollHelper.setViewportHeight(I);var q=i({isColumnResizing:t&&t.isColumnResizing},b,e,{columns:w,columnGroups:g,columnResizingData:m,firstRowIndex:l,firstRowOffset:u,horizontalScrollbarVisible:W,maxScrollX:A,maxScrollY:V,reservedHeight:N,scrollContentHeight:G,scrollX:r,scrollY:s,bodyHeight:I,height:P,groupHeaderHeight:h,useGroupHeader:n});return q},_selectColumnElement:function(e,t){for(var o=[],i=0;iMath.abs(e)&&"hidden"!==this.props.overflowY){var i=this._scrollHelper.scrollBy(Math.round(t)),n=Math.max(0,i.contentHeight-this.state.bodyHeight);this.setState({firstRowIndex:i.index,firstRowOffset:i.offset,scrollY:i.position,scrollContentHeight:i.contentHeight,maxScrollY:n})}else e&&"hidden"!==this.props.overflowX&&(o+=e,o=0>o?0:o,o=o>this.state.maxScrollX?this.state.maxScrollX:o,this.setState({scrollX:o}));this._didScrollStop()}},_onHorizontalScroll:function(e){this.isMounted()&&e!==this.state.scrollX&&(this._isScrolling||this._didScrollStart(),this.setState({scrollX:e}),this._didScrollStop())},_onVerticalScroll:function(e){if(this.isMounted()&&e!==this.state.scrollY){this._isScrolling||this._didScrollStart();var t=this._scrollHelper.scrollTo(Math.round(e));this.setState({firstRowIndex:t.index,firstRowOffset:t.offset,scrollY:t.position,scrollContentHeight:t.contentHeight}),this._didScrollStop()}},_didScrollStart:function(){this.isMounted()&&!this._isScrolling&&(this._isScrolling=!0,this.props.onScrollStart&&this.props.onScrollStart(this.state.scrollX,this.state.scrollY))},_didScrollStop:function(){this.isMounted()&&this._isScrolling&&(this._isScrolling=!1,this.setState({redraw:!0}),this.props.onScrollEnd&&this.props.onScrollEnd(this.state.scrollX,this.state.scrollY))}}),H=n.createClass({displayName:"HorizontalScrollbar",mixins:[r],propTypes:{contentSize:b.number.isRequired,offset:b.number.isRequired,onScroll:b.func.isRequired,position:b.number.isRequired,size:b.number.isRequired},render:function(){var e={height:a.SIZE,width:this.props.size},t={height:a.SIZE,position:"absolute",overflow:"hidden",width:this.props.size};return v(t,0,this.props.offset),n.createElement("div",{className:w(p("fixedDataTableLayout/horizontalScrollbar"),p("public/fixedDataTable/horizontalScrollbar")),style:e},n.createElement("div",{style:t},n.createElement(a,i({},this.props,{isOpaque:!0,orientation:"horizontal",offset:void 0}))))}});e.exports=S},function(e,t,o){"use strict";function i(e){for(var t=0,o=0;o=t)return{columns:e,width:i(e)};for(var o=n(e),r=t,s=[],a=0,u=0;uo?r(e,t-o).columns:e}var l=o(27),u={getTotalWidth:i,getTotalFlexGrow:n,distributeFlexWidth:r,adjustColumnWidths:a,adjustColumnGroupWidths:s};e.exports=u},function(e,t,o){"use strict";function i(e,t){if(e===t)return!0;var o;for(o in e)if(e.hasOwnProperty(o)&&(!t.hasOwnProperty(o)||e[o]!==t[o]))return!1;for(o in t)if(t.hasOwnProperty(o)&&!e.hasOwnProperty(o))return!1;return!0}var n={shouldComponentUpdate:function(e,t){return!i(this.props,e)||!i(this.state,t)}};e.exports=n},function(e,t,o){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var o=0;oi?-1:1),n&&!o&&(o=1>n?-1:1),{spinX:t,spinY:o,pixelX:i,pixelY:n}}var n=o(35),r=o(36),s=10,a=40,l=800;i.getEventType=function(){return n.firefox()?"DOMMouseScroll":r("wheel")?"wheel":"mousewheel"},e.exports=i},function(e,t,o){"use strict";function i(){if(!v){v=!0;var e=navigator.userAgent,t=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),o=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(m=/\b(iPhone|iP[ao]d)/.exec(e),_=/\b(iP[ao]d)/.exec(e),p=/Android/i.exec(e),w=/FBAN\/\w+;/i.exec(e),g=/Mobile/i.exec(e),d=!!/Win64/.exec(e),t){n=t[1]?parseFloat(t[1]):t[5]?parseFloat(t[5]):NaN,n&&document&&document.documentMode&&(n=document.documentMode);var i=/(?:Trident\/(\d+.\d+))/.exec(e);u=i?parseFloat(i[1])+4:n,r=t[2]?parseFloat(t[2]):NaN,s=t[3]?parseFloat(t[3]):NaN,a=t[4]?parseFloat(t[4]):NaN,a?(t=/(?:Chrome\/(\d+\.\d+))/.exec(e),l=t&&t[1]?parseFloat(t[1]):NaN):l=NaN}else n=r=s=l=a=NaN;if(o){if(o[1]){var b=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);h=b?parseFloat(b[1].replace("_",".")):!0}else h=!1;c=!!o[2],f=!!o[3]}else h=c=f=!1}}var n,r,s,a,l,u,h,c,f,p,d,m,_,w,g,v=!1,b={ie:function(){return i()||n},ieCompatibilityMode:function(){return i()||u>n},ie64:function(){return b.ie()&&d},firefox:function(){return i()||r},opera:function(){return i()||s},webkit:function(){return i()||a},safari:function(){return b.webkit()},chrome:function(){return i()||l},windows:function(){return i()||c},osx:function(){return i()||h},linux:function(){return i()||f},iphone:function(){return i()||m},mobile:function(){return i()||m||_||p||g},nativeApp:function(){return i()||w},android:function(){return i()||p},ipad:function(){return i()||_}};e.exports=b},function(e,t,o){"use strict";function i(e,t){if(!r.canUseDOM||t&&!("addEventListener"in document))return!1;var o="on"+e,i=o in document;if(!i){var s=document.createElement("div");s.setAttribute(o,"return;"),i="function"==typeof s[o]}return!i&&n&&"wheel"===e&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}var n,r=o(37);r.canUseDOM&&(n=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),e.exports=i},function(e,t,o){"use strict";var i=!("undefined"==typeof window||!window.document||!window.document.createElement),n={canUseDOM:i,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:i&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:i&&!!window.screen,isInWorker:!i};e.exports=n},function(e,t,o){(function(t){"use strict";var i=o(33),n=o(39),r=0,s=n||function(e){var o=Date.now(),i=Math.max(0,16-(o-r));return r=o+i,t.setTimeout(function(){e(Date.now())},i)};s(i),e.exports=s}).call(t,function(){return this}())},function(e,t,o){(function(t){"use strict";var o=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame;e.exports=o}).call(t,function(){return this}())},function(e,t,o){"use strict";var i=o(41),n=o(44),r=o(27),s=o(45),a=o(31),l=o(32),u=o(47),h=o(48),c=o(33),f=o(49),p=r.PropTypes,d={position:0,scrollable:!1},m=parseInt(u("scrollbar-face-margin"),10),_=2*m,w=30,g=40,v=null,b=r.createClass({displayName:"Scrollbar",mixins:[a],propTypes:{contentSize:p.number.isRequired,defaultPosition:p.number,isOpaque:p.bool,orientation:p.oneOf(["vertical","horizontal"]),onScroll:p.func,position:p.number,size:p.number.isRequired,trackColor:p.oneOf(["gray"]),zIndex:p.number,verticalTop:p.number},getInitialState:function(){var e=this.props;return this._calculateState(e.position||e.defaultPosition||0,e.size,e.contentSize,e.orientation)},componentWillReceiveProps:function(e){var t=e.position;void 0===t?this._setNextState(this._calculateState(this.state.position,e.size,e.contentSize,e.orientation)):this._setNextState(this._calculateState(t,e.size,e.contentSize,e.orientation),e)},getDefaultProps:function(){return{defaultPosition:0,isOpaque:!1,onScroll:c,orientation:"vertical",zIndex:99}},render:function(){if(!this.state.scrollable)return null;var e,t,o=this.props.size,i=this.state.isHorizontal,n=!i,s=this.state.focused||this.state.isDragging,a=this.state.faceSize,l=this.props.isOpaque,c=this.props.verticalTop||0,p=h({"ScrollbarLayout/main":!0,"ScrollbarLayout/mainVertical":n,"ScrollbarLayout/mainHorizontal":i,"public/Scrollbar/main":!0,"public/Scrollbar/mainOpaque":l,"public/Scrollbar/mainActive":s}),d=h({"ScrollbarLayout/face":!0,"ScrollbarLayout/faceHorizontal":i,"ScrollbarLayout/faceVertical":n,"public/Scrollbar/faceActive":s,"public/Scrollbar/face":!0}),w=this.state.position*this.state.scale+m;return i?(e={width:o},t={width:a-_},f(t,w,0)):(e={top:c,height:o},t={height:a-_},f(t,0,w)),e.zIndex=this.props.zIndex,"gray"===this.props.trackColor&&(e.backgroundColor=u("fbui-desktop-background-light")),r.createElement("div",{onFocus:this._onFocus,onBlur:this._onBlur,onKeyDown:this._onKeyDown,onMouseDown:this._onMouseDown,onWheel:this._wheelHandler.onWheel,className:p,style:e,tabIndex:0},r.createElement("div",{ref:"face",className:d,style:t}))},componentWillMount:function(){var e="horizontal"===this.props.orientation,t=e?this._onWheelX:this._onWheelY;this._wheelHandler=new l(t,this._shouldHandleX,this._shouldHandleY)},componentDidMount:function(){this._mouseMoveTracker=new i(this._onMouseMove,this._onMouseMoveEnd,document.documentElement),void 0!==this.props.position&&this.state.position!==this.props.position&&this._didScroll()},componentWillUnmount:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),v===this&&(v=null),delete this._mouseMoveTracker},scrollBy:function(e){this._onWheel(e)},_shouldHandleX:function(e){return"horizontal"===this.props.orientation?this._shouldHandleChange(e):!1},_shouldHandleY:function(e){return"horizontal"!==this.props.orientation?this._shouldHandleChange(e):!1},_shouldHandleChange:function(e){var t=this._calculateState(this.state.position+e,this.props.size,this.props.contentSize,this.props.orientation);return t.position!==this.state.position},_calculateState:function(e,t,o,i){if(1>t||t>=o)return d;var n=""+e+"_"+t+"_"+o+"_"+i;if(this._stateKey===n)return this._stateForKey;var r="horizontal"===i,s=t/o,a=t*s;w>a&&(s=(t-w)/(o-t),a=w);var l=!0,u=o-t;0>e?e=0:e>u&&(e=u);var h=this._mouseMoveTracker?this._mouseMoveTracker.isDragging():!1,c={faceSize:a,isDragging:h,isHorizontal:r,position:e,scale:s,scrollable:l};return this._stateKey=n,this._stateForKey=c,c},_onWheelY:function(e,t){this._onWheel(t)},_onWheelX:function(e,t){this._onWheel(e)},_onWheel:function(e){var t=this.props;this._setNextState(this._calculateState(this.state.position+e,t.size,t.contentSize,t.orientation))},_onMouseDown:function(e){var t;if(e.target!==s.findDOMNode(this.refs.face)){var o=e.nativeEvent,i=this.state.isHorizontal?o.offsetX||o.layerX:o.offsetY||o.layerY,n=this.props;i/=this.state.scale,t=this._calculateState(i-.5*this.state.faceSize/this.state.scale,n.size,n.contentSize,n.orientation)}else t={};t.focused=!0,this._setNextState(t),this._mouseMoveTracker.captureMouseMoves(e),s.findDOMNode(this).focus()},_onMouseMove:function(e,t){var o=this.props,i=this.state.isHorizontal?e:t;i/=this.state.scale,this._setNextState(this._calculateState(this.state.position+i,o.size,o.contentSize,o.orientation))},_onMouseMoveEnd:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),this.setState({isDragging:!1})},_onKeyDown:function(e){var t=e.keyCode;if(t!==n.TAB){var o=g,i=0;if(this.state.isHorizontal)switch(t){case n.HOME:i=-1,o=this.props.contentSize;break;case n.LEFT:i=-1;break;case n.RIGHT:i=1;break;default:return}if(!this.state.isHorizontal)switch(t){case n.SPACE:i=e.shiftKey?-1:1;break;case n.HOME:i=-1,o=this.props.contentSize;break;case n.UP:i=-1;break;case n.DOWN:i=1;break;case n.PAGE_UP:i=-1,o=this.props.size;break;case n.PAGE_DOWN:i=1,o=this.props.size;break;default:return}e.preventDefault();var r=this.props;this._setNextState(this._calculateState(this.state.position+o*i,r.size,r.contentSize,r.orientation))}},_onFocus:function(){this.setState({focused:!0})},_onBlur:function(){this.setState({focused:!1})},_blur:function(){if(this.isMounted())try{this._onBlur(),s.findDOMNode(this).blur()}catch(e){}},_setNextState:function(e,t){t=t||this.props;var o=t.position,i=this.state.position!==e.position;if(void 0===o){var n=i?this._didScroll:void 0;this.setState(e,n)}else{if(o!==e.position)return void(void 0!==e.position&&e.position!==this.state.position&&this.props.onScroll(e.position));this.setState(e)}i&&v!==this&&(v&&v._blur(),v=this)},_didScroll:function(){this.props.onScroll(this.state.position)}});b.KEYBOARD_SCROLL_AMOUNT=g,b.SIZE=parseInt(u("scrollbar-size"),10),e.exports=b},function(e,t,o){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var o=0;o0;)this._addRowToBuffer(t,this._viewportRowsBegin,this._viewportRowsEnd-1),t++,e--;return this._rows}},{key:"getRows",value:function(e,t){var o=t,i=o,n=e,r=Math.min(e+this._maxVisibleRowCount,this._rowsCount);for(this._viewportRowsBegin=e;r>n||i=r&&(i=this._bufferSet.replaceFurthestValuePosition(t,o,e)),null===i?(i=this._bufferSet.getNewPositionForValue(e),this._rows[i]=e):this._rows[i]=e}}]),e}();e.exports=h},function(e,t,o){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var o=0;o=e&&t>=n)return null;var r;e-i>n-t?(r=i,this._smallValues.pop()):(r=n,this._largeValues.pop());var a=this._valueToPositionMap[r];return delete this._valueToPositionMap[r],this._valueToPositionMap[o]=a,this._pushToHeaps(a,o),a}},{key:"_pushToHeaps",value:function(e,t){var o={position:e,value:t};this._smallValues.push(o),this._largeValues.push(o)}},{key:"_cleanHeaps",value:function(){this._cleanHeap(this._smallValues),this._cleanHeap(this._largeValues);var e=Math.min(this._smallValues.size(),this._largeValues.size()),t=Math.max(this._smallValues.size(),this._largeValues.size());t>10*e&&this._recreateHeaps()}},{key:"_recreateHeaps",value:function(){for(var e=this._smallValues.size()t.value}}]),e}();e.exports=a},function(e,t,o){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){return t>e}var r=function(){function e(e,t){for(var o=0;o0&&(this._items[0]=t,this._sinkDown(0)),e}}},{key:"push",value:function(e){this._items[this._size++]=e,this._bubbleUp(this._size-1)}},{key:"size",value:function(){return this._size}},{key:"peek",value:function(){return 0!==this._size?this._items[0]:void 0}},{key:"_heapify",value:function(){for(var e=Math.floor((this._size+1)/2);e>=0;e--)this._sinkDown(e)}},{key:"_bubbleUp",value:function(e){for(var t=this._items[e];e>0;){var o=Math.floor((e+1)/2)-1,i=this._items[o];if(this._comparator(i,t))return;this._items[o]=t,this._items[e]=i,e=o}}},{key:"_sinkDown",value:function(e){for(var t=this._items[e];;){var o=2*(e+1)-1,i=2*(e+1),n=-1;if(oe?t:e>o?o:e}e.exports=i},function(e,t,o){"use strict";var i=Object.assign||function(e){for(var t=1;t0){var t=s({"fixedDataTableRowLayout/fixedColumnsDivider":!0,"fixedDataTableRowLayout/columnsShadow":this.props.scrollLeft>0,"public/fixedDataTableRow/fixedColumnsDivider":!0,"public/fixedDataTableRow/columnsShadow":this.props.scrollLeft>0}),o={left:e,height:this.props.height};return n.createElement("div",{className:t,style:o})}},_onClick:function(e){this.props.onClick(e,this.props.index)},_onDoubleClick:function(e){this.props.onDoubleClick(e,this.props.index)},_onMouseDown:function(e){this.props.onMouseDown(e,this.props.index)},_onMouseEnter:function(e){this.props.onMouseEnter(e,this.props.index)},_onMouseLeave:function(e){this.props.onMouseLeave(e,this.props.index)}}),c=n.createClass({displayName:"FixedDataTableRow",propTypes:{isScrolling:u.bool,height:u.number.isRequired,zIndex:u.number,offsetTop:u.number.isRequired,width:u.number.isRequired},render:function(){var e={width:this.props.width,height:this.props.height,zIndex:this.props.zIndex?this.props.zIndex:0};return l(e,0,this.props.offsetTop),n.createElement("div",{style:e,className:s("fixedDataTableRowLayout/rowWrapper")},n.createElement(h,i({},this.props,{offsetTop:void 0,zIndex:void 0})))}});e.exports=c},function(e,t,o){"use strict";function i(e,t){var o={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(o[i]=e[i]);return o}var n=Object.assign||function(e){for(var t=1;tn;n++){var a=t[n].props;if(!a.allowCellsRecycling||i-e.left<=e.width&&i-e.left+a.width>=0){var h="cell_"+n;o[n]=this._renderCell(e.rowIndex,e.rowHeight,a,i,h)}i+=a.width}var f=this._getColumnsWidth(t),p={height:e.height,position:"absolute",width:f,zIndex:e.zIndex};return u(p,-1*c*e.left,0),s.createElement("div",{className:l("fixedDataTableCellGroupLayout/cellGroup"),style:p},o)},_renderCell:function(e,t,o,i,n){var r=o.isResizable&&this.props.onColumnResize,l=r?this.props.onColumnResize:null,u=o.cellClassName;return s.createElement(a,{isScrolling:this.props.isScrolling,align:o.align,className:u,height:t,key:n,maxWidth:o.maxWidth,minWidth:o.minWidth,onColumnResize:l,rowIndex:e,columnKey:o.columnKey,width:o.width,left:i,cell:o.cell})},_getColumnsWidth:function(e){for(var t=0,o=0;o should never render")}});e.exports=n},function(e,t,o){"use strict";var i=o(27),n=i.createClass({displayName:"TransitionColumn",statics:{__TableColumn__:!0},render:function(){throw new Error("Component should never render")}});e.exports=n},function(e,t,o){"use strict";function i(e,t){var o={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(o[i]=e[i]);return o}var n=o(66),r=o(61),s=o(27),a=o(48),l=o(67),u=r.DIR_SIGN,h=s.PropTypes,c={align:"left",highlighted:!1},f=s.createClass({displayName:"FixedDataTableCell",propTypes_DISABLED_FOR_PERFORMANCE:{isScrolling:h.bool,align:h.oneOf(["left","center","right"]),className:h.string,highlighted:h.bool,width:h.number.isRequired,minWidth:h.number,maxWidth:h.number,height:h.number.isRequired,cell:h.oneOfType([h.string,h.element,h.func]),columnKey:h.oneOfType([h.string,h.number]),rowIndex:h.number.isRequired,onColumnResize:h.func,left:h.number},shouldComponentUpdate:function(e){return!e.isScrolling||this.props.rowIndex!==e.rowIndex},getDefaultProps:function(){return c},render:function(){var e=this.props,t=e.height,o=e.width,r=e.columnKey,h=i(e,["height","width","columnKey"]),c={height:t,width:o};1===u?c.left=h.left:c.right=h.left;var f,p=l(a({"fixedDataTableCellLayout/main":!0,"fixedDataTableCellLayout/lastChild":h.lastChild,"fixedDataTableCellLayout/alignRight":"right"===h.align,"fixedDataTableCellLayout/alignCenter":"center"===h.align,"public/fixedDataTableCell/alignRight":"right"===h.align,"public/fixedDataTableCell/highlighted":h.highlighted,"public/fixedDataTableCell/main":!0}),h.className);if(h.onColumnResize){var d={height:t};f=s.createElement("div",{className:a("fixedDataTableCellLayout/columnResizerContainer"),style:d,onMouseDown:this._onColumnResizerMouseDown},s.createElement("div",{className:l(a("fixedDataTableCellLayout/columnResizerKnob"),a("public/fixedDataTableCell/columnResizerKnob")),style:d}))}var m={columnKey:r,height:t,width:o};h.rowIndex>=0&&(m.rowIndex=h.rowIndex);var _;return _=s.isValidElement(h.cell)?s.cloneElement(h.cell,m):"function"==typeof h.cell?h.cell(m):s.createElement(n,m,h.cell),s.createElement("div",{className:p,style:c},f,_)},_onColumnResizerMouseDown:function(e){this.props.onColumnResize(this.props.left,this.props.width,this.props.minWidth,this.props.maxWidth,this.props.columnKey,e)}});e.exports=f},function(e,t,o){"use strict";function i(e,t){var o={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(o[i]=e[i]);return o}var n=Object.assign||function(e){for(var t=1;t1)for(var i=1;o>i;i++)t=arguments[i],t&&(e=(e?e+" ":"")+t);return e}e.exports=i},function(e,t,o){"use strict";var i=o(41),n=o(62),r=o(27),s=o(31),a=o(58),l=o(48),u=r.PropTypes,h=r.createClass({displayName:"FixedDataTableColumnResizeHandle",mixins:[s],propTypes:{visible:u.bool.isRequired,height:u.number.isRequired,leftOffset:u.number.isRequired,knobHeight:u.number.isRequired,initialWidth:u.number,minWidth:u.number,maxWidth:u.number,initialEvent:u.object,onColumnResizeEnd:u.func,columnKey:u.oneOfType([u.string,u.number])},getInitialState:function(){return{width:0,cursorDelta:0}},componentWillReceiveProps:function(e){e.initialEvent&&!this._mouseMoveTracker.isDragging()&&(this._mouseMoveTracker.captureMouseMoves(e.initialEvent),this.setState({width:e.initialWidth,cursorDelta:e.initialWidth}))},componentDidMount:function(){this._mouseMoveTracker=new i(this._onMove,this._onColumnResizeEnd,document.body)},componentWillUnmount:function(){this._mouseMoveTracker.releaseMouseMoves(),this._mouseMoveTracker=null},render:function(){var e={width:this.state.width,height:this.props.height};return n.isRTL()?e.right=this.props.leftOffset:e.left=this.props.leftOffset,r.createElement("div",{className:l({"fixedDataTableColumnResizerLineLayout/main":!0,"fixedDataTableColumnResizerLineLayout/hiddenElem":!this.props.visible,"public/fixedDataTableColumnResizerLine/main":!0}),style:e},r.createElement("div",{className:l("fixedDataTableColumnResizerLineLayout/mouseArea"),style:{height:this.props.height}}))},_onMove:function(e){n.isRTL()&&(e=-e);var t=this.state.cursorDelta+e,o=a(t,this.props.minWidth,this.props.maxWidth);this.setState({width:o,cursorDelta:t})},_onColumnResizeEnd:function(){this._mouseMoveTracker.releaseMouseMoves(),this.props.onColumnResizeEnd(this.state.width,this.props.columnKey)}});e.exports=h},function(e,t,o){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var o=0;oa;++a)this._storedHeights[a]=o;this._rowCount=t,this._position=0,this._contentHeight=t*o,this._defaultRowHeight=o,this._rowHeightGetter=s?s:function(){return o},this._viewportHeight=n,this.scrollRowIntoView=this.scrollRowIntoView.bind(this),this.setViewportHeight=this.setViewportHeight.bind(this),this.scrollBy=this.scrollBy.bind(this),this.scrollTo=this.scrollTo.bind(this),this.scrollToRow=this.scrollToRow.bind(this),this.setRowHeightGetter=this.setRowHeightGetter.bind(this),this.getContentHeight=this.getContentHeight.bind(this),this.getRowPosition=this.getRowPosition.bind(this),this._updateHeightsInViewport(0,0)}return n(e,[{key:"setRowHeightGetter",value:function(e){this._rowHeightGetter=e}},{key:"setViewportHeight",value:function(e){this._viewportHeight=e}},{key:"getContentHeight",value:function(){return this._contentHeight}},{key:"_updateHeightsInViewport",value:function(e,t){for(var o=t,i=e;o<=this._viewportHeight&&i=0&&t>=e-a;){var o=this._updateRowHeight(t);this._position+=o,t--}}},{key:"_updateRowHeight",value:function(e){if(0>e||e>=this._rowCount)return 0;var t=this._rowHeightGetter(e);if(t!==this._storedHeights[e]){var o=t-this._storedHeights[e];return this._rowOffsets.set(e,t),this._storedHeights[e]=t,this._contentHeight+=o,o}return 0}},{key:"getRowPosition",value:function(e){return this._updateRowHeight(e),this._rowOffsets.sumUntil(e)}},{key:"scrollBy",value:function(e){if(0===this._rowCount)return l;var t=this._rowOffsets.greatestLowerBound(this._position);t=s(t,0,Math.max(this._rowCount-1,0));var o=this._rowOffsets.sumUntil(t),i=t,n=this._position,r=this._updateRowHeight(i);0!==o&&(n+=r);var a=this._storedHeights[i]-(n-o);if(e>=0)for(;e>0&&ie?(n+=e,e=0):(e-=a,n+=a,i++),ie){e=-e;for(var u=this._storedHeights[i]-a;e>0&&i>=0;)if(u>e?(n-=e,e=0):(n-=u,e-=u,i--),i>=0){var h=this._updateRowHeight(i);u=this._storedHeights[i],n+=h}}var c=this._contentHeight-this._viewportHeight;n=s(n,0,c),this._position=n;var f=this._rowOffsets.greatestLowerBound(n);f=s(f,0,Math.max(this._rowCount-1,0)),o=this._rowOffsets.sumUntil(f);var p=o-n;return this._updateHeightsInViewport(f,p),this._updateHeightsAboveViewport(f),{index:f,offset:p,position:this._position,contentHeight:this._contentHeight}}},{key:"_getRowAtEndPosition",value:function(e){this._updateRowHeight(e);for(var t=e,o=this._storedHeights[t];o=0;)t--,t>=0&&(this._updateRowHeight(t),o+=this._storedHeights[t]);var i=this._rowOffsets.sumTo(e)-this._viewportHeight;return 0>i&&(i=0),i}},{key:"scrollTo",value:function(e){if(0===this._rowCount)return l;if(0>=e)return this._position=0,this._updateHeightsInViewport(0,0),{index:0,offset:0,position:this._position,contentHeight:this._contentHeight};if(e>=this._contentHeight-this._viewportHeight){var t=this._rowCount-1;e=this._getRowAtEndPosition(t)}this._position=e;var o=this._rowOffsets.greatestLowerBound(e);o=s(o,0,Math.max(this._rowCount-1,0));var i=this._rowOffsets.sumUntil(o),n=i-e;return this._updateHeightsInViewport(o,n),this._updateHeightsAboveViewport(o),{index:o,offset:n,position:this._position,contentHeight:this._contentHeight}}},{key:"scrollToRow",value:function(e,t){e=s(e,0,Math.max(this._rowCount-1,0)),t=s(t,-this._storedHeights[e],0);var o=this._rowOffsets.sumUntil(e);return this.scrollTo(o-t)}},{key:"scrollRowIntoView",value:function(e){e=s(e,0,Math.max(this._rowCount-1,0));var t=this._rowOffsets.sumUntil(e),o=t+this._storedHeights[e];if(tt;)t*=2;return t}var r=function(){function e(e,t){for(var o=0;o=0;--o)t[o]=0;return t},u=function(){function e(t){i(this,e),this._size=t.length,this._half=n(this._size),this._heap=new l(2*this._half);var o;for(o=0;o0;--o)this._heap[o]=this._heap[2*o]+this._heap[2*o+1]}return r(e,[{key:"set",value:function(e,t){s(e>=0&&e=0&&e=0&&e=0&&e=e,"Begin must precede end"),this.sumUntil(t)-this.sumUntil(e)}},{key:"greatestLowerBound",value:function(e){if(0>e)return-1;var t=1;if(this._heap[t]<=e)return this._size;for(;te?t=2*t:(t=2*t+1,e-=o)}return t-this._half}},{key:"greatestStrictLowerBound",value:function(e){if(0>=e)return-1;var t=1;if(this._heap[t]=e?t=2*t:(t=2*t+1,e-=o)}return t-this._half}},{key:"leastUpperBound",value:function(e){return this.greatestStrictLowerBound(e)+1}},{key:"leastStrictUpperBound",value:function(e){return this.greatestLowerBound(e)+1}}],[{key:"uniform",value:function(t,o){for(var i=[],n=t-1;n>=0;--n)i[n]=o;return new e(i)}},{key:"empty",value:function(t){return e.uniform(t,0)}}]),e}();e.exports=u}).call(t,function(){return this}())},function(e,t,o){"use strict";function i(e,t,o,i,n){function r(){for(var n=arguments.length,a=Array(n),l=0;n>l;l++)a[l]=arguments[l];r.reset();var u=function(){e.apply(o,a)};u.__SMmeta=e.__SMmeta,s=i(u,t)}i=i||setTimeout,n=n||clearTimeout;var s;return r.reset=function(){n(s)},r}e.exports=i},function(e,t,o){"use strict";function i(e,t){if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var o=Object.keys(e),i=Object.keys(t);if(o.length!==i.length)return!1;for(var r=n.bind(t),s=0;s should never render")}});e.exports=r},function(e,t,o){"use strict";var i=o(27),n=i.PropTypes,r=i.createClass({displayName:"FixedDataTableColumnGroup",statics:{__TableColumnGroup__:!0},propTypes:{align:n.oneOf(["left","center","right"]),fixed:n.bool,header:n.oneOfType([n.node,n.func])},getDefaultProps:function(){return{fixed:!1}},render:function(){throw new Error("Component should never render")}});e.exports=r},function(e,t,o){"use strict";var i=Object.assign||function(e){for(var t=1;te&&this.state.scrollX>0||e>=0&&this.state.scrollXe&&this.state.scrollY>0||e>=0&&this.state.scrollYi?i:this.state.height>i&&this.props.ownerHeight?Math.max(i,this.props.ownerHeight):this.state.height+this.state.maxScrollY,e!==this._contentHeight&&this.props.onContentHeightChange&&this.props.onContentHeightChange(e),this._contentHeight=e},componentDidMount:function(){this._reportContentHeight()},componentWillReceiveProps:function(e){var t=e.scrollToRow;void 0!==t&&null!==t&&(this._rowToScrollTo=t);var o=e.scrollToColumn;void 0!==o&&null!==o&&(this._columnToScrollTo=o);var i=e.overflowX,n=e.overflowY;(i!==this.props.overflowX||n!==this.props.overflowY)&&(this._wheelHandler=new s(this._onWheel,"hidden"!==i,"hidden"!==n)),(this.props.ownerHeight!==e.ownerHeight||this.props.scrollTop!==e.scrollTop)&&this._didScrollStart(),this._didScrollStop(),this.setState(this._calculateState(e,this.state))},componentDidUpdate:function(){this._reportContentHeight()},render:function(){var e,t=this.state,o=this.props;t.useGroupHeader&&(e=n.createElement(h,{key:"group_header",isScrolling:this._isScrolling,className:w(p("fixedDataTableLayout/header"),p("public/fixedDataTable/header")),width:t.width,height:t.groupHeaderHeight,index:0,zIndex:1,offsetTop:0,scrollLeft:t.scrollX,fixedColumns:t.groupHeaderFixedColumns,scrollableColumns:t.groupHeaderScrollableColumns,onColumnResize:this._onColumnResize}));var i=this.state.maxScrollY,r=t.maxScrollX>0&&"hidden"!==t.overflowX,s=i>0&&"hidden"!==t.overflowY,l=r?a.SIZE:0,c=t.height-l-2*x-t.footerHeight,f=t.useGroupHeader?t.groupHeaderHeight:0,d=f+t.headerHeight;c-=d;var m=0,_=null!=o.maxHeight?d+t.bodyHeight:d+c,g=_+t.footerHeight;void 0!==o.ownerHeight&&o.ownerHeightt.ownerHeight||t.scrollY or "),o.push(e))});var n=!1;o.length&&o[0].type.__TableColumnGroup__&&(n=!0),t&&(void 0!==e.width&&e.width!==t.width||void 0!==e.height&&e.height!==t.height||void 0!==e.maxWidth&&e.maxWidth!==t.maxWidth||void 0!==e.maxHeight&&e.maxHeight!==t.maxHeight)&&(t=null);var r,s,l=t&&t.firstRowIndex||0,u=t&&t.firstRowOffset||0;r=t&&"hidden"!==e.overflowX?t.scrollX:e.scrollLeft,t&&"hidden"!==e.overflowY?s=t.scrollY:(d=this._scrollHelper.scrollTo(e.scrollTop),l=d.index,u=d.offset,s=d.position),void 0!==this._rowToScrollTo&&(d=this._scrollHelper.scrollRowIntoView(this._rowToScrollTo),l=d.index,u=d.offset,s=d.position,delete this._rowToScrollTo);var h=n?e.groupHeaderHeight:0;if(t&&e.rowsCount!==t.rowsCount){var p=(void 0===e.height?e.maxHeight:e.height)-(e.headerHeight||0)-(e.footerHeight||0)-(e.groupHeaderHeight||0);this._scrollHelper=new c(e.rowsCount,e.rowHeight,p,e.rowHeightGetter);var d=this._scrollHelper.scrollToRow(l,u);l=d.index,u=d.offset,s=d.position}else t&&e.rowHeightGetter!==t.rowHeightGetter&&this._scrollHelper.setRowHeightGetter(e.rowHeightGetter);var m;m=e.isColumnResizing?t&&t.columnResizingData:y;var w,g;if(n){var v=f.adjustColumnGroupWidths(o,e.width);w=v.columns,g=v.columnGroups}else w=f.adjustColumnWidths(o,e.width);var b=this._populateColumnsAndColumnData(w,g,t);if(void 0!==this._columnToScrollTo){var R=b.bodyFixedColumns.length;if(this._columnToScrollTo>=R){var T,H,S=0;for(T=0;TT;++T)H=b.bodyScrollableColumns[T],M+=H.props.width;var E=e.width-S,z=b.bodyScrollableColumns[D].props.width,k=M+z-E;k>r&&(r=k),r>M&&(r=M)}delete this._columnToScrollTo}var O=void 0===e.height,P=Math.round(O?e.maxHeight:e.height),N=e.footerHeight+e.headerHeight+h+2*x,I=P-N,L=this._scrollHelper.getContentHeight(),G=L+N,F=f.getTotalWidth(w),W=F>e.width&&"hidden"!==e.overflowX;W&&(I-=a.SIZE,G+=a.SIZE,N+=a.SIZE);var A=Math.max(0,F-e.width),V=Math.max(0,L-I);r=Math.min(r,A),s=Math.min(s,V),V||(O&&(P=G),I=G-N),this._scrollHelper.setViewportHeight(I);var X=i({isColumnResizing:t&&t.isColumnResizing},b,e,{columns:w,columnGroups:g,columnResizingData:m,firstRowIndex:l,firstRowOffset:u,horizontalScrollbarVisible:W,maxScrollX:A,maxScrollY:V,reservedHeight:N,scrollContentHeight:L,scrollX:r,scrollY:s,bodyHeight:I,height:P,groupHeaderHeight:h,useGroupHeader:n});return X},_selectColumnElement:function(e,t){for(var o=[],i=0;iMath.abs(e)&&"hidden"!==this.props.overflowY){var i=this._scrollHelper.scrollBy(Math.round(t)),n=Math.max(0,i.contentHeight-this.state.bodyHeight);this.setState({firstRowIndex:i.index,firstRowOffset:i.offset,scrollY:i.position,scrollContentHeight:i.contentHeight,maxScrollY:n})}else e&&"hidden"!==this.props.overflowX&&(o+=e,o=0>o?0:o,o=o>this.state.maxScrollX?this.state.maxScrollX:o,this.setState({scrollX:o}));this._didScrollStop()}},_onHorizontalScroll:function(e){this.isMounted()&&e!==this.state.scrollX&&(this._isScrolling||this._didScrollStart(),this.setState({scrollX:e}),this._didScrollStop())},_onVerticalScroll:function(e){if(this.isMounted()&&e!==this.state.scrollY){this._isScrolling||this._didScrollStart();var t=this._scrollHelper.scrollTo(Math.round(e));this.setState({firstRowIndex:t.index,firstRowOffset:t.offset,scrollY:t.position,scrollContentHeight:t.contentHeight}),this._didScrollStop()}},_didScrollStart:function(){this.isMounted()&&!this._isScrolling&&(this._isScrolling=!0,this.props.onScrollStart&&this.props.onScrollStart(this.state.scrollX,this.state.scrollY))},_didScrollStop:function(){this.isMounted()&&this._isScrolling&&(this._isScrolling=!1,this.setState({redraw:!0}),this.props.onScrollEnd&&this.props.onScrollEnd(this.state.scrollX,this.state.scrollY))}}),D=n.createClass({displayName:"HorizontalScrollbar",mixins:[r],propTypes:{contentSize:b.number.isRequired,offset:b.number.isRequired,onScroll:b.func.isRequired,position:b.number.isRequired,size:b.number.isRequired},render:function(){var e={height:a.SIZE,width:this.props.size},t={height:a.SIZE,position:"absolute",overflow:"hidden",width:this.props.size};return v(t,0,this.props.offset),n.createElement("div",{className:w(p("fixedDataTableLayout/horizontalScrollbar"),p("public/fixedDataTable/horizontalScrollbar")),style:e},n.createElement("div",{style:t},n.createElement(a,i({},this.props,{isOpaque:!0,orientation:"horizontal",offset:void 0}))))}});e.exports=S},function(e,t){"use strict";function o(e,t){if(e===t)return!0;var o;for(o in e)if(e.hasOwnProperty(o)&&(!t.hasOwnProperty(o)||e[o]!==t[o]))return!1;for(o in t)if(t.hasOwnProperty(o)&&!e.hasOwnProperty(o))return!1;return!0}var i={shouldComponentUpdate:function(e,t){return!o(this.props,e)||!o(this.state,t)}};e.exports=i},function(e,t,o){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var o=0;oi?-1:1),n&&!o&&(o=1>n?-1:1),{spinX:t,spinY:o,pixelX:i,pixelY:n}}var n=o(34),r=o(35),s=10,a=40,l=800;i.getEventType=function(){return n.firefox()?"DOMMouseScroll":r("wheel")?"wheel":"mousewheel"},e.exports=i},function(e,t){"use strict";function o(){if(!g){g=!0;var e=navigator.userAgent,t=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),o=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(d=/\b(iPhone|iP[ao]d)/.exec(e),m=/\b(iP[ao]d)/.exec(e),f=/Android/i.exec(e),_=/FBAN\/\w+;/i.exec(e),w=/Mobile/i.exec(e),p=!!/Win64/.exec(e),t){i=t[1]?parseFloat(t[1]):t[5]?parseFloat(t[5]):NaN,i&&document&&document.documentMode&&(i=document.documentMode);var v=/(?:Trident\/(\d+.\d+))/.exec(e);l=v?parseFloat(v[1])+4:i,n=t[2]?parseFloat(t[2]):NaN,r=t[3]?parseFloat(t[3]):NaN,s=t[4]?parseFloat(t[4]):NaN,s?(t=/(?:Chrome\/(\d+\.\d+))/.exec(e),a=t&&t[1]?parseFloat(t[1]):NaN):a=NaN}else i=n=r=a=s=NaN;if(o){if(o[1]){var b=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);u=b?parseFloat(b[1].replace("_",".")):!0}else u=!1;h=!!o[2],c=!!o[3]}else u=h=c=!1}}var i,n,r,s,a,l,u,h,c,f,p,d,m,_,w,g=!1,v={ie:function(){return o()||i},ieCompatibilityMode:function(){return o()||l>i},ie64:function(){return v.ie()&&p},firefox:function(){return o()||n},opera:function(){return o()||r},webkit:function(){return o()||s},safari:function(){return v.webkit()},chrome:function(){return o()||a},windows:function(){return o()||h},osx:function(){return o()||u},linux:function(){return o()||c},iphone:function(){return o()||d},mobile:function(){return o()||d||m||f||w},nativeApp:function(){return o()||_},android:function(){return o()||f},ipad:function(){return o()||m}};e.exports=v},function(e,t,o){"use strict";function i(e,t){if(!r.canUseDOM||t&&!("addEventListener"in document))return!1;var o="on"+e,i=o in document;if(!i){var s=document.createElement("div");s.setAttribute(o,"return;"),i="function"==typeof s[o]}return!i&&n&&"wheel"===e&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}var n,r=o(36);r.canUseDOM&&(n=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),e.exports=i},function(e,t){"use strict";var o=!("undefined"==typeof window||!window.document||!window.document.createElement),i={canUseDOM:o,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:o&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:o&&!!window.screen,isInWorker:!o};e.exports=i},function(e,t,o){(function(t){"use strict";var i=o(32),n=o(38),r=0,s=n||function(e){var o=Date.now(),i=Math.max(0,16-(o-r));return r=o+i,t.setTimeout(function(){e(Date.now())},i)};s(i),e.exports=s}).call(t,function(){return this}())},function(e,t){(function(t){"use strict";var o=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame;e.exports=o}).call(t,function(){return this}())},function(e,t,o){"use strict";var i=o(40),n=o(43),r=o(27),s=o(44),a=o(30),l=o(31),u=o(46),h=o(47),c=o(32),f=o(48),p=r.PropTypes,d={position:0,scrollable:!1},m=parseInt(u("scrollbar-face-margin"),10),_=2*m,w=30,g=40,v=null,b=r.createClass({displayName:"Scrollbar",mixins:[a],propTypes:{contentSize:p.number.isRequired,defaultPosition:p.number,isOpaque:p.bool,orientation:p.oneOf(["vertical","horizontal"]),onScroll:p.func,position:p.number,size:p.number.isRequired,trackColor:p.oneOf(["gray"]),zIndex:p.number,verticalTop:p.number},getInitialState:function(){var e=this.props;return this._calculateState(e.position||e.defaultPosition||0,e.size,e.contentSize,e.orientation)},componentWillReceiveProps:function(e){var t=e.position;void 0===t?this._setNextState(this._calculateState(this.state.position,e.size,e.contentSize,e.orientation)):this._setNextState(this._calculateState(t,e.size,e.contentSize,e.orientation),e)},getDefaultProps:function(){return{defaultPosition:0,isOpaque:!1,onScroll:c,orientation:"vertical",zIndex:99}},render:function(){if(!this.state.scrollable)return null;var e,t,o=this.props.size,i=this.state.isHorizontal,n=!i,s=this.state.focused||this.state.isDragging,a=this.state.faceSize,l=this.props.isOpaque,c=this.props.verticalTop||0,p=h({"ScrollbarLayout/main":!0,"ScrollbarLayout/mainVertical":n,"ScrollbarLayout/mainHorizontal":i,"public/Scrollbar/main":!0,"public/Scrollbar/mainOpaque":l,"public/Scrollbar/mainActive":s}),d=h({"ScrollbarLayout/face":!0,"ScrollbarLayout/faceHorizontal":i,"ScrollbarLayout/faceVertical":n,"public/Scrollbar/faceActive":s,"public/Scrollbar/face":!0}),w=this.state.position*this.state.scale+m;return i?(e={width:o},t={width:a-_},f(t,w,0)):(e={top:c,height:o},t={height:a-_},f(t,0,w)),e.zIndex=this.props.zIndex,"gray"===this.props.trackColor&&(e.backgroundColor=u("fbui-desktop-background-light")),r.createElement("div",{onFocus:this._onFocus,onBlur:this._onBlur,onKeyDown:this._onKeyDown,onMouseDown:this._onMouseDown,onWheel:this._wheelHandler.onWheel,className:p,style:e,tabIndex:0},r.createElement("div",{ref:"face",className:d,style:t}))},componentWillMount:function(){var e="horizontal"===this.props.orientation,t=e?this._onWheelX:this._onWheelY;this._wheelHandler=new l(t,this._shouldHandleX,this._shouldHandleY)},componentDidMount:function(){this._mouseMoveTracker=new i(this._onMouseMove,this._onMouseMoveEnd,document.documentElement),void 0!==this.props.position&&this.state.position!==this.props.position&&this._didScroll()},componentWillUnmount:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),v===this&&(v=null),delete this._mouseMoveTracker},scrollBy:function(e){this._onWheel(e)},_shouldHandleX:function(e){return"horizontal"===this.props.orientation?this._shouldHandleChange(e):!1},_shouldHandleY:function(e){return"horizontal"!==this.props.orientation?this._shouldHandleChange(e):!1},_shouldHandleChange:function(e){var t=this._calculateState(this.state.position+e,this.props.size,this.props.contentSize,this.props.orientation);return t.position!==this.state.position},_calculateState:function(e,t,o,i){if(1>t||t>=o)return d;var n=e+"_"+t+"_"+o+"_"+i;if(this._stateKey===n)return this._stateForKey;var r="horizontal"===i,s=t/o,a=t*s;w>a&&(s=(t-w)/(o-t),a=w);var l=!0,u=o-t;0>e?e=0:e>u&&(e=u);var h=this._mouseMoveTracker?this._mouseMoveTracker.isDragging():!1,c={faceSize:a,isDragging:h,isHorizontal:r,position:e,scale:s,scrollable:l};return this._stateKey=n,this._stateForKey=c,c},_onWheelY:function(e,t){this._onWheel(t)},_onWheelX:function(e,t){this._onWheel(e)},_onWheel:function(e){var t=this.props;this._setNextState(this._calculateState(this.state.position+e,t.size,t.contentSize,t.orientation))},_onMouseDown:function(e){var t;if(e.target!==s.findDOMNode(this.refs.face)){var o=e.nativeEvent,i=this.state.isHorizontal?o.offsetX||o.layerX:o.offsetY||o.layerY,n=this.props;i/=this.state.scale,t=this._calculateState(i-.5*this.state.faceSize/this.state.scale,n.size,n.contentSize,n.orientation)}else t={};t.focused=!0,this._setNextState(t),this._mouseMoveTracker.captureMouseMoves(e),s.findDOMNode(this).focus()},_onMouseMove:function(e,t){var o=this.props,i=this.state.isHorizontal?e:t;i/=this.state.scale,this._setNextState(this._calculateState(this.state.position+i,o.size,o.contentSize,o.orientation))},_onMouseMoveEnd:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),this.setState({isDragging:!1})},_onKeyDown:function(e){var t=e.keyCode;if(t!==n.TAB){var o=g,i=0;if(this.state.isHorizontal)switch(t){case n.HOME:i=-1,o=this.props.contentSize;break;case n.LEFT:i=-1;break;case n.RIGHT:i=1;break;default:return}if(!this.state.isHorizontal)switch(t){case n.SPACE:i=e.shiftKey?-1:1;break;case n.HOME:i=-1,o=this.props.contentSize;break;case n.UP:i=-1;break;case n.DOWN:i=1;break;case n.PAGE_UP:i=-1,o=this.props.size;break;case n.PAGE_DOWN:i=1,o=this.props.size;break;default:return}e.preventDefault();var r=this.props;this._setNextState(this._calculateState(this.state.position+o*i,r.size,r.contentSize,r.orientation))}},_onFocus:function(){this.setState({focused:!0})},_onBlur:function(){this.setState({focused:!1})},_blur:function(){if(this.isMounted())try{this._onBlur(),s.findDOMNode(this).blur()}catch(e){}},_setNextState:function(e,t){t=t||this.props;var o=t.position,i=this.state.position!==e.position;if(void 0===o){var n=i?this._didScroll:void 0;this.setState(e,n)}else{if(o!==e.position)return void(void 0!==e.position&&e.position!==this.state.position&&this.props.onScroll(e.position));this.setState(e)}i&&v!==this&&(v&&v._blur(),v=this)},_didScroll:function(){this.props.onScroll(this.state.position)}});b.KEYBOARD_SCROLL_AMOUNT=g,b.SIZE=parseInt(u("scrollbar-size"),10),e.exports=b},function(e,t,o){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var o=0;o0;)this._addRowToBuffer(t,this._viewportRowsBegin,this._viewportRowsEnd-1),t++,e--;return this._rows}},{key:"getRows",value:function(e,t){var o=t,i=o,n=e,r=Math.min(e+this._maxVisibleRowCount,this._rowsCount);for(this._viewportRowsBegin=e;r>n||i=r&&(i=this._bufferSet.replaceFurthestValuePosition(t,o,e)),null===i?(i=this._bufferSet.getNewPositionForValue(e),this._rows[i]=e):this._rows[i]=e}}]),e}();e.exports=h},function(e,t,o){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var o=0;o=e&&t>=n)return null;var r;e-i>n-t?(r=i,this._smallValues.pop()):(r=n,this._largeValues.pop());var a=this._valueToPositionMap[r];return delete this._valueToPositionMap[r],this._valueToPositionMap[o]=a,this._pushToHeaps(a,o),a}},{key:"_pushToHeaps",value:function(e,t){var o={position:e,value:t};this._smallValues.push(o),this._largeValues.push(o)}},{key:"_cleanHeaps",value:function(){this._cleanHeap(this._smallValues),this._cleanHeap(this._largeValues);var e=Math.min(this._smallValues.size(),this._largeValues.size()),t=Math.max(this._smallValues.size(),this._largeValues.size());t>10*e&&this._recreateHeaps()}},{key:"_recreateHeaps",value:function(){for(var e=this._smallValues.size()t.value}}]),e}();e.exports=a},function(e,t){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){return t>e}var n=function(){function e(e,t){for(var o=0;o0&&(this._items[0]=t,this._sinkDown(0)),e}}},{key:"push",value:function(e){this._items[this._size++]=e,this._bubbleUp(this._size-1)}},{key:"size",value:function(){return this._size}},{key:"peek",value:function(){return 0!==this._size?this._items[0]:void 0}},{key:"_heapify",value:function(){for(var e=Math.floor((this._size+1)/2);e>=0;e--)this._sinkDown(e)}},{key:"_bubbleUp",value:function(e){for(var t=this._items[e];e>0;){var o=Math.floor((e+1)/2)-1,i=this._items[o];if(this._comparator(i,t))return;this._items[o]=t,this._items[e]=i,e=o}}},{key:"_sinkDown",value:function(e){for(var t=this._items[e];;){var o=2*(e+1)-1,i=2*(e+1),n=-1;if(oe?t:e>o?o:e}e.exports=o},function(e,t,o){"use strict";var i=Object.assign||function(e){for(var t=1;t0){var t=s({"fixedDataTableRowLayout/fixedColumnsDivider":!0,"fixedDataTableRowLayout/columnsShadow":this.props.scrollLeft>0,"public/fixedDataTableRow/fixedColumnsDivider":!0,"public/fixedDataTableRow/columnsShadow":this.props.scrollLeft>0}),o={left:e,height:this.props.height};return n.createElement("div",{className:t,style:o})}},_onClick:function(e){this.props.onClick(e,this.props.index)},_onDoubleClick:function(e){this.props.onDoubleClick(e,this.props.index)},_onMouseDown:function(e){this.props.onMouseDown(e,this.props.index)},_onMouseEnter:function(e){this.props.onMouseEnter(e,this.props.index)},_onMouseLeave:function(e){this.props.onMouseLeave(e,this.props.index)}}),c=n.createClass({displayName:"FixedDataTableRow",propTypes:{isScrolling:u.bool,height:u.number.isRequired,zIndex:u.number,offsetTop:u.number.isRequired,width:u.number.isRequired},render:function(){var e={width:this.props.width,height:this.props.height,zIndex:this.props.zIndex?this.props.zIndex:0};return l(e,0,this.props.offsetTop),n.createElement("div",{style:e,className:s("fixedDataTableRowLayout/rowWrapper")},n.createElement(h,i({},this.props,{offsetTop:void 0,zIndex:void 0})))}});e.exports=c},function(e,t,o){"use strict";function i(e,t){var o={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(o[i]=e[i]);return o}var n=Object.assign||function(e){for(var t=1;tn;n++){var a=t[n].props;if(!a.allowCellsRecycling||i-e.left<=e.width&&i-e.left+a.width>=0){var h="cell_"+n;o[n]=this._renderCell(e.rowIndex,e.rowHeight,a,i,h)}i+=a.width}var f=this._getColumnsWidth(t),p={height:e.height,position:"absolute",width:f,zIndex:e.zIndex};return u(p,-1*c*e.left,0),s.createElement("div",{className:l("fixedDataTableCellGroupLayout/cellGroup"),style:p},o)},_renderCell:function(e,t,o,i,n){var r=o.isResizable&&this.props.onColumnResize,l=r?this.props.onColumnResize:null,u=o.cellClassName;return s.createElement(a,{isScrolling:this.props.isScrolling,align:o.align,className:u,height:t,key:n,maxWidth:o.maxWidth,minWidth:o.minWidth,onColumnResize:l,rowIndex:e,columnKey:o.columnKey,width:o.width,left:i,cell:o.cell})},_getColumnsWidth:function(e){for(var t=0,o=0;o=0||Object.prototype.hasOwnProperty.call(e,i)&&(o[i]=e[i]);return o}var n=o(65),r=o(60),s=o(27),a=o(47),l=o(66),u=r.DIR_SIGN,h=s.PropTypes,c={align:"left",highlighted:!1},f=s.createClass({displayName:"FixedDataTableCell",propTypes_DISABLED_FOR_PERFORMANCE:{isScrolling:h.bool,align:h.oneOf(["left","center","right"]),className:h.string,highlighted:h.bool,width:h.number.isRequired,minWidth:h.number,maxWidth:h.number,height:h.number.isRequired,cell:h.oneOfType([h.string,h.element,h.func]),columnKey:h.oneOfType([h.string,h.number]),rowIndex:h.number.isRequired,onColumnResize:h.func,left:h.number},shouldComponentUpdate:function(e){return!e.isScrolling||this.props.rowIndex!==e.rowIndex},getDefaultProps:function(){return c},render:function(){var e=this.props,t=e.height,o=e.width,r=e.columnKey,h=i(e,["height","width","columnKey"]),c={height:t,width:o};1===u?c.left=h.left:c.right=h.left;var f,p=l(a({"fixedDataTableCellLayout/main":!0,"fixedDataTableCellLayout/lastChild":h.lastChild,"fixedDataTableCellLayout/alignRight":"right"===h.align,"fixedDataTableCellLayout/alignCenter":"center"===h.align,"public/fixedDataTableCell/alignRight":"right"===h.align,"public/fixedDataTableCell/highlighted":h.highlighted,"public/fixedDataTableCell/main":!0}),h.className);if(h.onColumnResize){var d={height:t};f=s.createElement("div",{className:a("fixedDataTableCellLayout/columnResizerContainer"),style:d,onMouseDown:this._onColumnResizerMouseDown},s.createElement("div",{className:l(a("fixedDataTableCellLayout/columnResizerKnob"),a("public/fixedDataTableCell/columnResizerKnob")),style:d}))}var m={columnKey:r,height:t,width:o};h.rowIndex>=0&&(m.rowIndex=h.rowIndex);var _;return _=s.isValidElement(h.cell)?s.cloneElement(h.cell,m):"function"==typeof h.cell?h.cell(m):s.createElement(n,m,h.cell),s.createElement("div",{className:p,style:c},f,_)},_onColumnResizerMouseDown:function(e){this.props.onColumnResize(this.props.left,this.props.width,this.props.minWidth,this.props.maxWidth,this.props.columnKey,e)}});e.exports=f},function(e,t,o){"use strict";function i(e,t){var o={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(o[i]=e[i]);return o}var n=Object.assign||function(e){for(var t=1;t1)for(var i=1;o>i;i++)t=arguments[i],t&&(e=(e?e+" ":"")+t);return e}e.exports=o},function(e,t,o){"use strict";var i=o(40),n=o(61),r=o(27),s=o(30),a=o(57),l=o(47),u=r.PropTypes,h=r.createClass({displayName:"FixedDataTableColumnResizeHandle",mixins:[s],propTypes:{visible:u.bool.isRequired,height:u.number.isRequired,leftOffset:u.number.isRequired,knobHeight:u.number.isRequired,initialWidth:u.number,minWidth:u.number,maxWidth:u.number,initialEvent:u.object,onColumnResizeEnd:u.func,columnKey:u.oneOfType([u.string,u.number])},getInitialState:function(){return{width:0,cursorDelta:0}},componentWillReceiveProps:function(e){e.initialEvent&&!this._mouseMoveTracker.isDragging()&&(this._mouseMoveTracker.captureMouseMoves(e.initialEvent),this.setState({width:e.initialWidth,cursorDelta:e.initialWidth}))},componentDidMount:function(){this._mouseMoveTracker=new i(this._onMove,this._onColumnResizeEnd,document.body)},componentWillUnmount:function(){this._mouseMoveTracker.releaseMouseMoves(),this._mouseMoveTracker=null},render:function(){var e={width:this.state.width,height:this.props.height};return n.isRTL()?e.right=this.props.leftOffset:e.left=this.props.leftOffset,r.createElement("div",{className:l({"fixedDataTableColumnResizerLineLayout/main":!0,"fixedDataTableColumnResizerLineLayout/hiddenElem":!this.props.visible,"public/fixedDataTableColumnResizerLine/main":!0}),style:e},r.createElement("div",{className:l("fixedDataTableColumnResizerLineLayout/mouseArea"),style:{height:this.props.height}}))},_onMove:function(e){n.isRTL()&&(e=-e);var t=this.state.cursorDelta+e,o=a(t,this.props.minWidth,this.props.maxWidth);this.setState({width:o,cursorDelta:t})},_onColumnResizeEnd:function(){this._mouseMoveTracker.releaseMouseMoves(),this.props.onColumnResizeEnd(this.state.width,this.props.columnKey)}});e.exports=h},function(e,t,o){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var o=0;oa;++a)this._storedHeights[a]=o;this._rowCount=t,this._position=0,this._contentHeight=t*o,this._defaultRowHeight=o,this._rowHeightGetter=s?s:function(){return o},this._viewportHeight=n,this.scrollRowIntoView=this.scrollRowIntoView.bind(this),this.setViewportHeight=this.setViewportHeight.bind(this),this.scrollBy=this.scrollBy.bind(this),this.scrollTo=this.scrollTo.bind(this),this.scrollToRow=this.scrollToRow.bind(this),this.setRowHeightGetter=this.setRowHeightGetter.bind(this),this.getContentHeight=this.getContentHeight.bind(this),this.getRowPosition=this.getRowPosition.bind(this),this._updateHeightsInViewport(0,0)}return n(e,[{key:"setRowHeightGetter",value:function(e){this._rowHeightGetter=e}},{key:"setViewportHeight",value:function(e){this._viewportHeight=e}},{key:"getContentHeight",value:function(){return this._contentHeight}},{key:"_updateHeightsInViewport",value:function(e,t){for(var o=t,i=e;o<=this._viewportHeight&&i=0&&t>=e-a;){var o=this._updateRowHeight(t);this._position+=o,t--}}},{key:"_updateRowHeight",value:function(e){if(0>e||e>=this._rowCount)return 0;var t=this._rowHeightGetter(e);if(t!==this._storedHeights[e]){var o=t-this._storedHeights[e];return this._rowOffsets.set(e,t),this._storedHeights[e]=t,this._contentHeight+=o,o}return 0}},{key:"getRowPosition",value:function(e){return this._updateRowHeight(e),this._rowOffsets.sumUntil(e)}},{key:"scrollBy",value:function(e){if(0===this._rowCount)return l;var t=this._rowOffsets.greatestLowerBound(this._position);t=s(t,0,Math.max(this._rowCount-1,0));var o=this._rowOffsets.sumUntil(t),i=t,n=this._position,r=this._updateRowHeight(i);0!==o&&(n+=r);var a=this._storedHeights[i]-(n-o);if(e>=0)for(;e>0&&ie?(n+=e,e=0):(e-=a,n+=a,i++),ie){e=-e;for(var u=this._storedHeights[i]-a;e>0&&i>=0;)if(u>e?(n-=e,e=0):(n-=u,e-=u,i--),i>=0){var h=this._updateRowHeight(i);u=this._storedHeights[i],n+=h}}var c=this._contentHeight-this._viewportHeight;n=s(n,0,c),this._position=n;var f=this._rowOffsets.greatestLowerBound(n);f=s(f,0,Math.max(this._rowCount-1,0)),o=this._rowOffsets.sumUntil(f);var p=o-n;return this._updateHeightsInViewport(f,p),this._updateHeightsAboveViewport(f),{index:f,offset:p,position:this._position,contentHeight:this._contentHeight}}},{key:"_getRowAtEndPosition",value:function(e){this._updateRowHeight(e);for(var t=e,o=this._storedHeights[t];o=0;)t--,t>=0&&(this._updateRowHeight(t),o+=this._storedHeights[t]);var i=this._rowOffsets.sumTo(e)-this._viewportHeight;return 0>i&&(i=0),i}},{key:"scrollTo",value:function(e){if(0===this._rowCount)return l;if(0>=e)return this._position=0,this._updateHeightsInViewport(0,0),{index:0,offset:0,position:this._position,contentHeight:this._contentHeight};if(e>=this._contentHeight-this._viewportHeight){var t=this._rowCount-1;e=this._getRowAtEndPosition(t)}this._position=e;var o=this._rowOffsets.greatestLowerBound(e);o=s(o,0,Math.max(this._rowCount-1,0));var i=this._rowOffsets.sumUntil(o),n=i-e;return this._updateHeightsInViewport(o,n),this._updateHeightsAboveViewport(o),{index:o,offset:n,position:this._position,contentHeight:this._contentHeight}}},{key:"scrollToRow",value:function(e,t){e=s(e,0,Math.max(this._rowCount-1,0)),t=s(t,-this._storedHeights[e],0);var o=this._rowOffsets.sumUntil(e);return this.scrollTo(o-t)}},{key:"scrollRowIntoView",value:function(e){e=s(e,0,Math.max(this._rowCount-1,0));var t=this._rowOffsets.sumUntil(e),o=t+this._storedHeights[e];if(tt;)t*=2;return t}var r=function(){function e(e,t){for(var o=0;o=0;--o)t[o]=0;return t},u=function(){function e(t){i(this,e),this._size=t.length,this._half=n(this._size),this._heap=new l(2*this._half);var o;for(o=0;o0;--o)this._heap[o]=this._heap[2*o]+this._heap[2*o+1]}return r(e,[{key:"set",value:function(e,t){s(e>=0&&e=0&&e=0&&e=0&&e=e,"Begin must precede end"),this.sumUntil(t)-this.sumUntil(e)}},{key:"greatestLowerBound",value:function(e){if(0>e)return-1;var t=1;if(this._heap[t]<=e)return this._size;for(;te?t=2*t:(t=2*t+1,e-=o)}return t-this._half}},{key:"greatestStrictLowerBound",value:function(e){if(0>=e)return-1;var t=1;if(this._heap[t]=e?t=2*t:(t=2*t+1,e-=o)}return t-this._half}},{key:"leastUpperBound",value:function(e){return this.greatestStrictLowerBound(e)+1}},{key:"leastStrictUpperBound",value:function(e){return this.greatestLowerBound(e)+1}}],[{key:"uniform",value:function(t,o){for(var i=[],n=t-1;n>=0;--n)i[n]=o;return new e(i)}},{key:"empty",value:function(t){return e.uniform(t,0)}}]),e}();e.exports=u}).call(t,function(){return this}())},function(e,t,o){"use strict";function i(e){for(var t=0,o=0;o=t)return{columns:e,width:i(e)};for(var o=n(e),r=t,s=[],a=0,u=0;uo?r(e,t-o).columns:e}var l=o(27),u={getTotalWidth:i,getTotalFlexGrow:n,distributeFlexWidth:r,adjustColumnWidths:a,adjustColumnGroupWidths:s};e.exports=u},function(e,t){"use strict";function o(e,t,o,i,n){function r(){for(var n=arguments.length,a=Array(n),l=0;n>l;l++)a[l]=arguments[l];r.reset();var u=function(){e.apply(o,a)};u.__SMmeta=e.__SMmeta,s=i(u,t)}i=i||setTimeout,n=n||clearTimeout;var s;return r.reset=function(){n(s)},r}e.exports=o},function(e,t){"use strict";function o(e,t){if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var o=Object.keys(e),n=Object.keys(t);if(o.length!==n.length)return!1;for(var r=i.bind(t),s=0;s Date: Thu, 10 Dec 2015 15:13:07 -0800 Subject: [PATCH 05/43] Version 0.6.1 --- dist/fixed-data-table-base.css | 2 +- dist/fixed-data-table-base.min.css | 2 +- dist/fixed-data-table-style.css | 2 +- dist/fixed-data-table-style.min.css | 2 +- dist/fixed-data-table.css | 2 +- dist/fixed-data-table.js | 4 ++-- dist/fixed-data-table.min.css | 2 +- dist/fixed-data-table.min.js | 4 ++-- package.json | 2 +- src/FixedDataTableRoot.js | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dist/fixed-data-table-base.css b/dist/fixed-data-table-base.css index c6ed2e08..6a66fc6f 100644 --- a/dist/fixed-data-table-base.css +++ b/dist/fixed-data-table-base.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.6.0 + * FixedDataTable v0.6.1 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table-base.min.css b/dist/fixed-data-table-base.min.css index 3a7a9a66..9e3984e4 100644 --- a/dist/fixed-data-table-base.min.css +++ b/dist/fixed-data-table-base.min.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.6.0 + * FixedDataTable v0.6.1 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table-style.css b/dist/fixed-data-table-style.css index 7262e746..451a59fb 100644 --- a/dist/fixed-data-table-style.css +++ b/dist/fixed-data-table-style.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.6.0 + * FixedDataTable v0.6.1 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table-style.min.css b/dist/fixed-data-table-style.min.css index fd63fb1c..763f2ee6 100644 --- a/dist/fixed-data-table-style.min.css +++ b/dist/fixed-data-table-style.min.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.6.0 + * FixedDataTable v0.6.1 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table.css b/dist/fixed-data-table.css index 59d6d95a..e8275cfa 100644 --- a/dist/fixed-data-table.css +++ b/dist/fixed-data-table.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.6.0 + * FixedDataTable v0.6.1 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table.js b/dist/fixed-data-table.js index df48e0f6..e7c6a1ca 100644 --- a/dist/fixed-data-table.js +++ b/dist/fixed-data-table.js @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.6.0 + * FixedDataTable v0.6.1 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -187,7 +187,7 @@ return /******/ (function(modules) { // webpackBootstrap Table: FixedDataTable }; - FixedDataTableRoot.version = '0.6.0'; + FixedDataTableRoot.version = '0.6.1'; module.exports = FixedDataTableRoot; /***/ }, diff --git a/dist/fixed-data-table.min.css b/dist/fixed-data-table.min.css index 6ede2b30..545c24ac 100644 --- a/dist/fixed-data-table.min.css +++ b/dist/fixed-data-table.min.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.6.0 + * FixedDataTable v0.6.1 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table.min.js b/dist/fixed-data-table.min.js index 93737707..f97921bd 100644 --- a/dist/fixed-data-table.min.js +++ b/dist/fixed-data-table.min.js @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.6.0 + * FixedDataTable v0.6.1 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -9,6 +9,6 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.FixedDataTable=t(require("react"),require("react-dom")):e.FixedDataTable=t(e.React,e.ReactDOM)}(this,function(e,t){return function(e){function t(i){if(o[i])return o[i].exports;var n=o[i]={exports:{},id:i,loaded:!1};return e[i].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){o(1),o(5),o(7),o(9),o(11),o(13),o(15),o(17),o(19),o(21),o(23),e.exports=o(25)},function(e,t){},,,,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t,o){"use strict";var i=o(26),n=o(65),r=o(63),s=o(62),a={Cell:n,Column:r,ColumnGroup:s,Table:i};a.version="0.6.0",e.exports=a},function(e,t,o){"use strict";function i(e,t){}var n=Object.assign||function(e){for(var t=1;te&&this.state.scrollX>0||e>=0&&this.state.scrollXe&&this.state.scrollY>0||e>=0&&this.state.scrollYi?i:this.state.height>i&&this.props.ownerHeight?Math.max(i,this.props.ownerHeight):this.state.height+this.state.maxScrollY,e!==this._contentHeight&&this.props.onContentHeightChange&&this.props.onContentHeightChange(e),this._contentHeight=e},componentDidMount:function(){this._reportContentHeight()},componentWillReceiveProps:function(e){var t=e.scrollToRow;void 0!==t&&null!==t&&(this._rowToScrollTo=t);var o=e.scrollToColumn;void 0!==o&&null!==o&&(this._columnToScrollTo=o);var i=e.overflowX,n=e.overflowY;(i!==this.props.overflowX||n!==this.props.overflowY)&&(this._wheelHandler=new s(this._onWheel,"hidden"!==i,"hidden"!==n)),(this.props.ownerHeight!==e.ownerHeight||this.props.scrollTop!==e.scrollTop)&&this._didScrollStart(),this._didScrollStop(),this.setState(this._calculateState(e,this.state))},componentDidUpdate:function(){this._reportContentHeight()},render:function(){var e,t=this.state,o=this.props;t.useGroupHeader&&(e=n.createElement(h,{key:"group_header",isScrolling:this._isScrolling,className:w(p("fixedDataTableLayout/header"),p("public/fixedDataTable/header")),width:t.width,height:t.groupHeaderHeight,index:0,zIndex:1,offsetTop:0,scrollLeft:t.scrollX,fixedColumns:t.groupHeaderFixedColumns,scrollableColumns:t.groupHeaderScrollableColumns,onColumnResize:this._onColumnResize}));var i=this.state.maxScrollY,r=t.maxScrollX>0&&"hidden"!==t.overflowX,s=i>0&&"hidden"!==t.overflowY,l=r?a.SIZE:0,c=t.height-l-2*x-t.footerHeight,f=t.useGroupHeader?t.groupHeaderHeight:0,d=f+t.headerHeight;c-=d;var m=0,_=null!=o.maxHeight?d+t.bodyHeight:d+c,g=_+t.footerHeight;void 0!==o.ownerHeight&&o.ownerHeightt.ownerHeight||t.scrollY or "),o.push(e))});var n=!1;o.length&&o[0].type.__TableColumnGroup__&&(n=!0),t&&(void 0!==e.width&&e.width!==t.width||void 0!==e.height&&e.height!==t.height||void 0!==e.maxWidth&&e.maxWidth!==t.maxWidth||void 0!==e.maxHeight&&e.maxHeight!==t.maxHeight)&&(t=null);var r,s,l=t&&t.firstRowIndex||0,u=t&&t.firstRowOffset||0;r=t&&"hidden"!==e.overflowX?t.scrollX:e.scrollLeft,t&&"hidden"!==e.overflowY?s=t.scrollY:(d=this._scrollHelper.scrollTo(e.scrollTop),l=d.index,u=d.offset,s=d.position),void 0!==this._rowToScrollTo&&(d=this._scrollHelper.scrollRowIntoView(this._rowToScrollTo),l=d.index,u=d.offset,s=d.position,delete this._rowToScrollTo);var h=n?e.groupHeaderHeight:0;if(t&&e.rowsCount!==t.rowsCount){var p=(void 0===e.height?e.maxHeight:e.height)-(e.headerHeight||0)-(e.footerHeight||0)-(e.groupHeaderHeight||0);this._scrollHelper=new c(e.rowsCount,e.rowHeight,p,e.rowHeightGetter);var d=this._scrollHelper.scrollToRow(l,u);l=d.index,u=d.offset,s=d.position}else t&&e.rowHeightGetter!==t.rowHeightGetter&&this._scrollHelper.setRowHeightGetter(e.rowHeightGetter);var m;m=e.isColumnResizing?t&&t.columnResizingData:y;var w,g;if(n){var v=f.adjustColumnGroupWidths(o,e.width);w=v.columns,g=v.columnGroups}else w=f.adjustColumnWidths(o,e.width);var b=this._populateColumnsAndColumnData(w,g,t);if(void 0!==this._columnToScrollTo){var R=b.bodyFixedColumns.length;if(this._columnToScrollTo>=R){var T,H,S=0;for(T=0;TT;++T)H=b.bodyScrollableColumns[T],M+=H.props.width;var E=e.width-S,z=b.bodyScrollableColumns[D].props.width,k=M+z-E;k>r&&(r=k),r>M&&(r=M)}delete this._columnToScrollTo}var O=void 0===e.height,P=Math.round(O?e.maxHeight:e.height),N=e.footerHeight+e.headerHeight+h+2*x,I=P-N,L=this._scrollHelper.getContentHeight(),G=L+N,F=f.getTotalWidth(w),W=F>e.width&&"hidden"!==e.overflowX;W&&(I-=a.SIZE,G+=a.SIZE,N+=a.SIZE);var A=Math.max(0,F-e.width),V=Math.max(0,L-I);r=Math.min(r,A),s=Math.min(s,V),V||(O&&(P=G),I=G-N),this._scrollHelper.setViewportHeight(I);var X=i({isColumnResizing:t&&t.isColumnResizing},b,e,{columns:w,columnGroups:g,columnResizingData:m,firstRowIndex:l,firstRowOffset:u,horizontalScrollbarVisible:W,maxScrollX:A,maxScrollY:V,reservedHeight:N,scrollContentHeight:L,scrollX:r,scrollY:s,bodyHeight:I,height:P,groupHeaderHeight:h,useGroupHeader:n});return X},_selectColumnElement:function(e,t){for(var o=[],i=0;iMath.abs(e)&&"hidden"!==this.props.overflowY){var i=this._scrollHelper.scrollBy(Math.round(t)),n=Math.max(0,i.contentHeight-this.state.bodyHeight);this.setState({firstRowIndex:i.index,firstRowOffset:i.offset,scrollY:i.position,scrollContentHeight:i.contentHeight,maxScrollY:n})}else e&&"hidden"!==this.props.overflowX&&(o+=e,o=0>o?0:o,o=o>this.state.maxScrollX?this.state.maxScrollX:o,this.setState({scrollX:o}));this._didScrollStop()}},_onHorizontalScroll:function(e){this.isMounted()&&e!==this.state.scrollX&&(this._isScrolling||this._didScrollStart(),this.setState({scrollX:e}),this._didScrollStop())},_onVerticalScroll:function(e){if(this.isMounted()&&e!==this.state.scrollY){this._isScrolling||this._didScrollStart();var t=this._scrollHelper.scrollTo(Math.round(e));this.setState({firstRowIndex:t.index,firstRowOffset:t.offset,scrollY:t.position,scrollContentHeight:t.contentHeight}),this._didScrollStop()}},_didScrollStart:function(){this.isMounted()&&!this._isScrolling&&(this._isScrolling=!0,this.props.onScrollStart&&this.props.onScrollStart(this.state.scrollX,this.state.scrollY))},_didScrollStop:function(){this.isMounted()&&this._isScrolling&&(this._isScrolling=!1,this.setState({redraw:!0}),this.props.onScrollEnd&&this.props.onScrollEnd(this.state.scrollX,this.state.scrollY))}}),D=n.createClass({displayName:"HorizontalScrollbar",mixins:[r],propTypes:{contentSize:b.number.isRequired,offset:b.number.isRequired,onScroll:b.func.isRequired,position:b.number.isRequired,size:b.number.isRequired},render:function(){var e={height:a.SIZE,width:this.props.size},t={height:a.SIZE,position:"absolute",overflow:"hidden",width:this.props.size};return v(t,0,this.props.offset),n.createElement("div",{className:w(p("fixedDataTableLayout/horizontalScrollbar"),p("public/fixedDataTable/horizontalScrollbar")),style:e},n.createElement("div",{style:t},n.createElement(a,i({},this.props,{isOpaque:!0,orientation:"horizontal",offset:void 0}))))}});e.exports=S},function(e,t){"use strict";function o(e,t){if(e===t)return!0;var o;for(o in e)if(e.hasOwnProperty(o)&&(!t.hasOwnProperty(o)||e[o]!==t[o]))return!1;for(o in t)if(t.hasOwnProperty(o)&&!e.hasOwnProperty(o))return!1;return!0}var i={shouldComponentUpdate:function(e,t){return!o(this.props,e)||!o(this.state,t)}};e.exports=i},function(e,t,o){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var o=0;oi?-1:1),n&&!o&&(o=1>n?-1:1),{spinX:t,spinY:o,pixelX:i,pixelY:n}}var n=o(34),r=o(35),s=10,a=40,l=800;i.getEventType=function(){return n.firefox()?"DOMMouseScroll":r("wheel")?"wheel":"mousewheel"},e.exports=i},function(e,t){"use strict";function o(){if(!g){g=!0;var e=navigator.userAgent,t=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),o=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(d=/\b(iPhone|iP[ao]d)/.exec(e),m=/\b(iP[ao]d)/.exec(e),f=/Android/i.exec(e),_=/FBAN\/\w+;/i.exec(e),w=/Mobile/i.exec(e),p=!!/Win64/.exec(e),t){i=t[1]?parseFloat(t[1]):t[5]?parseFloat(t[5]):NaN,i&&document&&document.documentMode&&(i=document.documentMode);var v=/(?:Trident\/(\d+.\d+))/.exec(e);l=v?parseFloat(v[1])+4:i,n=t[2]?parseFloat(t[2]):NaN,r=t[3]?parseFloat(t[3]):NaN,s=t[4]?parseFloat(t[4]):NaN,s?(t=/(?:Chrome\/(\d+\.\d+))/.exec(e),a=t&&t[1]?parseFloat(t[1]):NaN):a=NaN}else i=n=r=a=s=NaN;if(o){if(o[1]){var b=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);u=b?parseFloat(b[1].replace("_",".")):!0}else u=!1;h=!!o[2],c=!!o[3]}else u=h=c=!1}}var i,n,r,s,a,l,u,h,c,f,p,d,m,_,w,g=!1,v={ie:function(){return o()||i},ieCompatibilityMode:function(){return o()||l>i},ie64:function(){return v.ie()&&p},firefox:function(){return o()||n},opera:function(){return o()||r},webkit:function(){return o()||s},safari:function(){return v.webkit()},chrome:function(){return o()||a},windows:function(){return o()||h},osx:function(){return o()||u},linux:function(){return o()||c},iphone:function(){return o()||d},mobile:function(){return o()||d||m||f||w},nativeApp:function(){return o()||_},android:function(){return o()||f},ipad:function(){return o()||m}};e.exports=v},function(e,t,o){"use strict";function i(e,t){if(!r.canUseDOM||t&&!("addEventListener"in document))return!1;var o="on"+e,i=o in document;if(!i){var s=document.createElement("div");s.setAttribute(o,"return;"),i="function"==typeof s[o]}return!i&&n&&"wheel"===e&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}var n,r=o(36);r.canUseDOM&&(n=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),e.exports=i},function(e,t){"use strict";var o=!("undefined"==typeof window||!window.document||!window.document.createElement),i={canUseDOM:o,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:o&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:o&&!!window.screen,isInWorker:!o};e.exports=i},function(e,t,o){(function(t){"use strict";var i=o(32),n=o(38),r=0,s=n||function(e){var o=Date.now(),i=Math.max(0,16-(o-r));return r=o+i,t.setTimeout(function(){e(Date.now())},i)};s(i),e.exports=s}).call(t,function(){return this}())},function(e,t){(function(t){"use strict";var o=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame;e.exports=o}).call(t,function(){return this}())},function(e,t,o){"use strict";var i=o(40),n=o(43),r=o(27),s=o(44),a=o(30),l=o(31),u=o(46),h=o(47),c=o(32),f=o(48),p=r.PropTypes,d={position:0,scrollable:!1},m=parseInt(u("scrollbar-face-margin"),10),_=2*m,w=30,g=40,v=null,b=r.createClass({displayName:"Scrollbar",mixins:[a],propTypes:{contentSize:p.number.isRequired,defaultPosition:p.number,isOpaque:p.bool,orientation:p.oneOf(["vertical","horizontal"]),onScroll:p.func,position:p.number,size:p.number.isRequired,trackColor:p.oneOf(["gray"]),zIndex:p.number,verticalTop:p.number},getInitialState:function(){var e=this.props;return this._calculateState(e.position||e.defaultPosition||0,e.size,e.contentSize,e.orientation)},componentWillReceiveProps:function(e){var t=e.position;void 0===t?this._setNextState(this._calculateState(this.state.position,e.size,e.contentSize,e.orientation)):this._setNextState(this._calculateState(t,e.size,e.contentSize,e.orientation),e)},getDefaultProps:function(){return{defaultPosition:0,isOpaque:!1,onScroll:c,orientation:"vertical",zIndex:99}},render:function(){if(!this.state.scrollable)return null;var e,t,o=this.props.size,i=this.state.isHorizontal,n=!i,s=this.state.focused||this.state.isDragging,a=this.state.faceSize,l=this.props.isOpaque,c=this.props.verticalTop||0,p=h({"ScrollbarLayout/main":!0,"ScrollbarLayout/mainVertical":n,"ScrollbarLayout/mainHorizontal":i,"public/Scrollbar/main":!0,"public/Scrollbar/mainOpaque":l,"public/Scrollbar/mainActive":s}),d=h({"ScrollbarLayout/face":!0,"ScrollbarLayout/faceHorizontal":i,"ScrollbarLayout/faceVertical":n,"public/Scrollbar/faceActive":s,"public/Scrollbar/face":!0}),w=this.state.position*this.state.scale+m;return i?(e={width:o},t={width:a-_},f(t,w,0)):(e={top:c,height:o},t={height:a-_},f(t,0,w)),e.zIndex=this.props.zIndex,"gray"===this.props.trackColor&&(e.backgroundColor=u("fbui-desktop-background-light")),r.createElement("div",{onFocus:this._onFocus,onBlur:this._onBlur,onKeyDown:this._onKeyDown,onMouseDown:this._onMouseDown,onWheel:this._wheelHandler.onWheel,className:p,style:e,tabIndex:0},r.createElement("div",{ref:"face",className:d,style:t}))},componentWillMount:function(){var e="horizontal"===this.props.orientation,t=e?this._onWheelX:this._onWheelY;this._wheelHandler=new l(t,this._shouldHandleX,this._shouldHandleY)},componentDidMount:function(){this._mouseMoveTracker=new i(this._onMouseMove,this._onMouseMoveEnd,document.documentElement),void 0!==this.props.position&&this.state.position!==this.props.position&&this._didScroll()},componentWillUnmount:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),v===this&&(v=null),delete this._mouseMoveTracker},scrollBy:function(e){this._onWheel(e)},_shouldHandleX:function(e){return"horizontal"===this.props.orientation?this._shouldHandleChange(e):!1},_shouldHandleY:function(e){return"horizontal"!==this.props.orientation?this._shouldHandleChange(e):!1},_shouldHandleChange:function(e){var t=this._calculateState(this.state.position+e,this.props.size,this.props.contentSize,this.props.orientation);return t.position!==this.state.position},_calculateState:function(e,t,o,i){if(1>t||t>=o)return d;var n=e+"_"+t+"_"+o+"_"+i;if(this._stateKey===n)return this._stateForKey;var r="horizontal"===i,s=t/o,a=t*s;w>a&&(s=(t-w)/(o-t),a=w);var l=!0,u=o-t;0>e?e=0:e>u&&(e=u);var h=this._mouseMoveTracker?this._mouseMoveTracker.isDragging():!1,c={faceSize:a,isDragging:h,isHorizontal:r,position:e,scale:s,scrollable:l};return this._stateKey=n,this._stateForKey=c,c},_onWheelY:function(e,t){this._onWheel(t)},_onWheelX:function(e,t){this._onWheel(e)},_onWheel:function(e){var t=this.props;this._setNextState(this._calculateState(this.state.position+e,t.size,t.contentSize,t.orientation))},_onMouseDown:function(e){var t;if(e.target!==s.findDOMNode(this.refs.face)){var o=e.nativeEvent,i=this.state.isHorizontal?o.offsetX||o.layerX:o.offsetY||o.layerY,n=this.props;i/=this.state.scale,t=this._calculateState(i-.5*this.state.faceSize/this.state.scale,n.size,n.contentSize,n.orientation)}else t={};t.focused=!0,this._setNextState(t),this._mouseMoveTracker.captureMouseMoves(e),s.findDOMNode(this).focus()},_onMouseMove:function(e,t){var o=this.props,i=this.state.isHorizontal?e:t;i/=this.state.scale,this._setNextState(this._calculateState(this.state.position+i,o.size,o.contentSize,o.orientation))},_onMouseMoveEnd:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),this.setState({isDragging:!1})},_onKeyDown:function(e){var t=e.keyCode;if(t!==n.TAB){var o=g,i=0;if(this.state.isHorizontal)switch(t){case n.HOME:i=-1,o=this.props.contentSize;break;case n.LEFT:i=-1;break;case n.RIGHT:i=1;break;default:return}if(!this.state.isHorizontal)switch(t){case n.SPACE:i=e.shiftKey?-1:1;break;case n.HOME:i=-1,o=this.props.contentSize;break;case n.UP:i=-1;break;case n.DOWN:i=1;break;case n.PAGE_UP:i=-1,o=this.props.size;break;case n.PAGE_DOWN:i=1,o=this.props.size;break;default:return}e.preventDefault();var r=this.props;this._setNextState(this._calculateState(this.state.position+o*i,r.size,r.contentSize,r.orientation))}},_onFocus:function(){this.setState({focused:!0})},_onBlur:function(){this.setState({focused:!1})},_blur:function(){if(this.isMounted())try{this._onBlur(),s.findDOMNode(this).blur()}catch(e){}},_setNextState:function(e,t){t=t||this.props;var o=t.position,i=this.state.position!==e.position;if(void 0===o){var n=i?this._didScroll:void 0;this.setState(e,n)}else{if(o!==e.position)return void(void 0!==e.position&&e.position!==this.state.position&&this.props.onScroll(e.position));this.setState(e)}i&&v!==this&&(v&&v._blur(),v=this)},_didScroll:function(){this.props.onScroll(this.state.position)}});b.KEYBOARD_SCROLL_AMOUNT=g,b.SIZE=parseInt(u("scrollbar-size"),10),e.exports=b},function(e,t,o){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var o=0;oe&&this.state.scrollX>0||e>=0&&this.state.scrollXe&&this.state.scrollY>0||e>=0&&this.state.scrollYi?i:this.state.height>i&&this.props.ownerHeight?Math.max(i,this.props.ownerHeight):this.state.height+this.state.maxScrollY,e!==this._contentHeight&&this.props.onContentHeightChange&&this.props.onContentHeightChange(e),this._contentHeight=e},componentDidMount:function(){this._reportContentHeight()},componentWillReceiveProps:function(e){var t=e.scrollToRow;void 0!==t&&null!==t&&(this._rowToScrollTo=t);var o=e.scrollToColumn;void 0!==o&&null!==o&&(this._columnToScrollTo=o);var i=e.overflowX,n=e.overflowY;(i!==this.props.overflowX||n!==this.props.overflowY)&&(this._wheelHandler=new s(this._onWheel,"hidden"!==i,"hidden"!==n)),(this.props.ownerHeight!==e.ownerHeight||this.props.scrollTop!==e.scrollTop)&&this._didScrollStart(),this._didScrollStop(),this.setState(this._calculateState(e,this.state))},componentDidUpdate:function(){this._reportContentHeight()},render:function(){var e,t=this.state,o=this.props;t.useGroupHeader&&(e=n.createElement(h,{key:"group_header",isScrolling:this._isScrolling,className:w(p("fixedDataTableLayout/header"),p("public/fixedDataTable/header")),width:t.width,height:t.groupHeaderHeight,index:0,zIndex:1,offsetTop:0,scrollLeft:t.scrollX,fixedColumns:t.groupHeaderFixedColumns,scrollableColumns:t.groupHeaderScrollableColumns,onColumnResize:this._onColumnResize}));var i=this.state.maxScrollY,r=t.maxScrollX>0&&"hidden"!==t.overflowX,s=i>0&&"hidden"!==t.overflowY,l=r?a.SIZE:0,c=t.height-l-2*x-t.footerHeight,f=t.useGroupHeader?t.groupHeaderHeight:0,d=f+t.headerHeight;c-=d;var m=0,_=null!=o.maxHeight?d+t.bodyHeight:d+c,g=_+t.footerHeight;void 0!==o.ownerHeight&&o.ownerHeightt.ownerHeight||t.scrollY or "),o.push(e))});var n=!1;o.length&&o[0].type.__TableColumnGroup__&&(n=!0),t&&(void 0!==e.width&&e.width!==t.width||void 0!==e.height&&e.height!==t.height||void 0!==e.maxWidth&&e.maxWidth!==t.maxWidth||void 0!==e.maxHeight&&e.maxHeight!==t.maxHeight)&&(t=null);var r,s,l=t&&t.firstRowIndex||0,u=t&&t.firstRowOffset||0;r=t&&"hidden"!==e.overflowX?t.scrollX:e.scrollLeft,t&&"hidden"!==e.overflowY?s=t.scrollY:(d=this._scrollHelper.scrollTo(e.scrollTop),l=d.index,u=d.offset,s=d.position),void 0!==this._rowToScrollTo&&(d=this._scrollHelper.scrollRowIntoView(this._rowToScrollTo),l=d.index,u=d.offset,s=d.position,delete this._rowToScrollTo);var h=n?e.groupHeaderHeight:0;if(t&&e.rowsCount!==t.rowsCount){var p=(void 0===e.height?e.maxHeight:e.height)-(e.headerHeight||0)-(e.footerHeight||0)-(e.groupHeaderHeight||0);this._scrollHelper=new c(e.rowsCount,e.rowHeight,p,e.rowHeightGetter);var d=this._scrollHelper.scrollToRow(l,u);l=d.index,u=d.offset,s=d.position}else t&&e.rowHeightGetter!==t.rowHeightGetter&&this._scrollHelper.setRowHeightGetter(e.rowHeightGetter);var m;m=e.isColumnResizing?t&&t.columnResizingData:y;var w,g;if(n){var v=f.adjustColumnGroupWidths(o,e.width);w=v.columns,g=v.columnGroups}else w=f.adjustColumnWidths(o,e.width);var b=this._populateColumnsAndColumnData(w,g,t);if(void 0!==this._columnToScrollTo){var R=b.bodyFixedColumns.length;if(this._columnToScrollTo>=R){var T,H,S=0;for(T=0;TT;++T)H=b.bodyScrollableColumns[T],M+=H.props.width;var E=e.width-S,z=b.bodyScrollableColumns[D].props.width,k=M+z-E;k>r&&(r=k),r>M&&(r=M)}delete this._columnToScrollTo}var O=void 0===e.height,P=Math.round(O?e.maxHeight:e.height),N=e.footerHeight+e.headerHeight+h+2*x,I=P-N,L=this._scrollHelper.getContentHeight(),G=L+N,F=f.getTotalWidth(w),W=F>e.width&&"hidden"!==e.overflowX;W&&(I-=a.SIZE,G+=a.SIZE,N+=a.SIZE);var A=Math.max(0,F-e.width),V=Math.max(0,L-I);r=Math.min(r,A),s=Math.min(s,V),V||(O&&(P=G),I=G-N),this._scrollHelper.setViewportHeight(I);var X=i({isColumnResizing:t&&t.isColumnResizing},b,e,{columns:w,columnGroups:g,columnResizingData:m,firstRowIndex:l,firstRowOffset:u,horizontalScrollbarVisible:W,maxScrollX:A,maxScrollY:V,reservedHeight:N,scrollContentHeight:L,scrollX:r,scrollY:s,bodyHeight:I,height:P,groupHeaderHeight:h,useGroupHeader:n});return X},_selectColumnElement:function(e,t){for(var o=[],i=0;iMath.abs(e)&&"hidden"!==this.props.overflowY){var i=this._scrollHelper.scrollBy(Math.round(t)),n=Math.max(0,i.contentHeight-this.state.bodyHeight);this.setState({firstRowIndex:i.index,firstRowOffset:i.offset,scrollY:i.position,scrollContentHeight:i.contentHeight,maxScrollY:n})}else e&&"hidden"!==this.props.overflowX&&(o+=e,o=0>o?0:o,o=o>this.state.maxScrollX?this.state.maxScrollX:o,this.setState({scrollX:o}));this._didScrollStop()}},_onHorizontalScroll:function(e){this.isMounted()&&e!==this.state.scrollX&&(this._isScrolling||this._didScrollStart(),this.setState({scrollX:e}),this._didScrollStop())},_onVerticalScroll:function(e){if(this.isMounted()&&e!==this.state.scrollY){this._isScrolling||this._didScrollStart();var t=this._scrollHelper.scrollTo(Math.round(e));this.setState({firstRowIndex:t.index,firstRowOffset:t.offset,scrollY:t.position,scrollContentHeight:t.contentHeight}),this._didScrollStop()}},_didScrollStart:function(){this.isMounted()&&!this._isScrolling&&(this._isScrolling=!0,this.props.onScrollStart&&this.props.onScrollStart(this.state.scrollX,this.state.scrollY))},_didScrollStop:function(){this.isMounted()&&this._isScrolling&&(this._isScrolling=!1,this.setState({redraw:!0}),this.props.onScrollEnd&&this.props.onScrollEnd(this.state.scrollX,this.state.scrollY))}}),D=n.createClass({displayName:"HorizontalScrollbar",mixins:[r],propTypes:{contentSize:b.number.isRequired,offset:b.number.isRequired,onScroll:b.func.isRequired,position:b.number.isRequired,size:b.number.isRequired},render:function(){var e={height:a.SIZE,width:this.props.size},t={height:a.SIZE,position:"absolute",overflow:"hidden",width:this.props.size};return v(t,0,this.props.offset),n.createElement("div",{className:w(p("fixedDataTableLayout/horizontalScrollbar"),p("public/fixedDataTable/horizontalScrollbar")),style:e},n.createElement("div",{style:t},n.createElement(a,i({},this.props,{isOpaque:!0,orientation:"horizontal",offset:void 0}))))}});e.exports=S},function(e,t){"use strict";function o(e,t){if(e===t)return!0;var o;for(o in e)if(e.hasOwnProperty(o)&&(!t.hasOwnProperty(o)||e[o]!==t[o]))return!1;for(o in t)if(t.hasOwnProperty(o)&&!e.hasOwnProperty(o))return!1;return!0}var i={shouldComponentUpdate:function(e,t){return!o(this.props,e)||!o(this.state,t)}};e.exports=i},function(e,t,o){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var o=0;oi?-1:1),n&&!o&&(o=1>n?-1:1),{spinX:t,spinY:o,pixelX:i,pixelY:n}}var n=o(34),r=o(35),s=10,a=40,l=800;i.getEventType=function(){return n.firefox()?"DOMMouseScroll":r("wheel")?"wheel":"mousewheel"},e.exports=i},function(e,t){"use strict";function o(){if(!g){g=!0;var e=navigator.userAgent,t=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),o=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(d=/\b(iPhone|iP[ao]d)/.exec(e),m=/\b(iP[ao]d)/.exec(e),f=/Android/i.exec(e),_=/FBAN\/\w+;/i.exec(e),w=/Mobile/i.exec(e),p=!!/Win64/.exec(e),t){i=t[1]?parseFloat(t[1]):t[5]?parseFloat(t[5]):NaN,i&&document&&document.documentMode&&(i=document.documentMode);var v=/(?:Trident\/(\d+.\d+))/.exec(e);l=v?parseFloat(v[1])+4:i,n=t[2]?parseFloat(t[2]):NaN,r=t[3]?parseFloat(t[3]):NaN,s=t[4]?parseFloat(t[4]):NaN,s?(t=/(?:Chrome\/(\d+\.\d+))/.exec(e),a=t&&t[1]?parseFloat(t[1]):NaN):a=NaN}else i=n=r=a=s=NaN;if(o){if(o[1]){var b=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);u=b?parseFloat(b[1].replace("_",".")):!0}else u=!1;h=!!o[2],c=!!o[3]}else u=h=c=!1}}var i,n,r,s,a,l,u,h,c,f,p,d,m,_,w,g=!1,v={ie:function(){return o()||i},ieCompatibilityMode:function(){return o()||l>i},ie64:function(){return v.ie()&&p},firefox:function(){return o()||n},opera:function(){return o()||r},webkit:function(){return o()||s},safari:function(){return v.webkit()},chrome:function(){return o()||a},windows:function(){return o()||h},osx:function(){return o()||u},linux:function(){return o()||c},iphone:function(){return o()||d},mobile:function(){return o()||d||m||f||w},nativeApp:function(){return o()||_},android:function(){return o()||f},ipad:function(){return o()||m}};e.exports=v},function(e,t,o){"use strict";function i(e,t){if(!r.canUseDOM||t&&!("addEventListener"in document))return!1;var o="on"+e,i=o in document;if(!i){var s=document.createElement("div");s.setAttribute(o,"return;"),i="function"==typeof s[o]}return!i&&n&&"wheel"===e&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}var n,r=o(36);r.canUseDOM&&(n=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),e.exports=i},function(e,t){"use strict";var o=!("undefined"==typeof window||!window.document||!window.document.createElement),i={canUseDOM:o,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:o&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:o&&!!window.screen,isInWorker:!o};e.exports=i},function(e,t,o){(function(t){"use strict";var i=o(32),n=o(38),r=0,s=n||function(e){var o=Date.now(),i=Math.max(0,16-(o-r));return r=o+i,t.setTimeout(function(){e(Date.now())},i)};s(i),e.exports=s}).call(t,function(){return this}())},function(e,t){(function(t){"use strict";var o=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame;e.exports=o}).call(t,function(){return this}())},function(e,t,o){"use strict";var i=o(40),n=o(43),r=o(27),s=o(44),a=o(30),l=o(31),u=o(46),h=o(47),c=o(32),f=o(48),p=r.PropTypes,d={position:0,scrollable:!1},m=parseInt(u("scrollbar-face-margin"),10),_=2*m,w=30,g=40,v=null,b=r.createClass({displayName:"Scrollbar",mixins:[a],propTypes:{contentSize:p.number.isRequired,defaultPosition:p.number,isOpaque:p.bool,orientation:p.oneOf(["vertical","horizontal"]),onScroll:p.func,position:p.number,size:p.number.isRequired,trackColor:p.oneOf(["gray"]),zIndex:p.number,verticalTop:p.number},getInitialState:function(){var e=this.props;return this._calculateState(e.position||e.defaultPosition||0,e.size,e.contentSize,e.orientation)},componentWillReceiveProps:function(e){var t=e.position;void 0===t?this._setNextState(this._calculateState(this.state.position,e.size,e.contentSize,e.orientation)):this._setNextState(this._calculateState(t,e.size,e.contentSize,e.orientation),e)},getDefaultProps:function(){return{defaultPosition:0,isOpaque:!1,onScroll:c,orientation:"vertical",zIndex:99}},render:function(){if(!this.state.scrollable)return null;var e,t,o=this.props.size,i=this.state.isHorizontal,n=!i,s=this.state.focused||this.state.isDragging,a=this.state.faceSize,l=this.props.isOpaque,c=this.props.verticalTop||0,p=h({"ScrollbarLayout/main":!0,"ScrollbarLayout/mainVertical":n,"ScrollbarLayout/mainHorizontal":i,"public/Scrollbar/main":!0,"public/Scrollbar/mainOpaque":l,"public/Scrollbar/mainActive":s}),d=h({"ScrollbarLayout/face":!0,"ScrollbarLayout/faceHorizontal":i,"ScrollbarLayout/faceVertical":n,"public/Scrollbar/faceActive":s,"public/Scrollbar/face":!0}),w=this.state.position*this.state.scale+m;return i?(e={width:o},t={width:a-_},f(t,w,0)):(e={top:c,height:o},t={height:a-_},f(t,0,w)),e.zIndex=this.props.zIndex,"gray"===this.props.trackColor&&(e.backgroundColor=u("fbui-desktop-background-light")),r.createElement("div",{onFocus:this._onFocus,onBlur:this._onBlur,onKeyDown:this._onKeyDown,onMouseDown:this._onMouseDown,onWheel:this._wheelHandler.onWheel,className:p,style:e,tabIndex:0},r.createElement("div",{ref:"face",className:d,style:t}))},componentWillMount:function(){var e="horizontal"===this.props.orientation,t=e?this._onWheelX:this._onWheelY;this._wheelHandler=new l(t,this._shouldHandleX,this._shouldHandleY)},componentDidMount:function(){this._mouseMoveTracker=new i(this._onMouseMove,this._onMouseMoveEnd,document.documentElement),void 0!==this.props.position&&this.state.position!==this.props.position&&this._didScroll()},componentWillUnmount:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),v===this&&(v=null),delete this._mouseMoveTracker},scrollBy:function(e){this._onWheel(e)},_shouldHandleX:function(e){return"horizontal"===this.props.orientation?this._shouldHandleChange(e):!1},_shouldHandleY:function(e){return"horizontal"!==this.props.orientation?this._shouldHandleChange(e):!1},_shouldHandleChange:function(e){var t=this._calculateState(this.state.position+e,this.props.size,this.props.contentSize,this.props.orientation);return t.position!==this.state.position},_calculateState:function(e,t,o,i){if(1>t||t>=o)return d;var n=e+"_"+t+"_"+o+"_"+i;if(this._stateKey===n)return this._stateForKey;var r="horizontal"===i,s=t/o,a=t*s;w>a&&(s=(t-w)/(o-t),a=w);var l=!0,u=o-t;0>e?e=0:e>u&&(e=u);var h=this._mouseMoveTracker?this._mouseMoveTracker.isDragging():!1,c={faceSize:a,isDragging:h,isHorizontal:r,position:e,scale:s,scrollable:l};return this._stateKey=n,this._stateForKey=c,c},_onWheelY:function(e,t){this._onWheel(t)},_onWheelX:function(e,t){this._onWheel(e)},_onWheel:function(e){var t=this.props;this._setNextState(this._calculateState(this.state.position+e,t.size,t.contentSize,t.orientation))},_onMouseDown:function(e){var t;if(e.target!==s.findDOMNode(this.refs.face)){var o=e.nativeEvent,i=this.state.isHorizontal?o.offsetX||o.layerX:o.offsetY||o.layerY,n=this.props;i/=this.state.scale,t=this._calculateState(i-.5*this.state.faceSize/this.state.scale,n.size,n.contentSize,n.orientation)}else t={};t.focused=!0,this._setNextState(t),this._mouseMoveTracker.captureMouseMoves(e),s.findDOMNode(this).focus()},_onMouseMove:function(e,t){var o=this.props,i=this.state.isHorizontal?e:t;i/=this.state.scale,this._setNextState(this._calculateState(this.state.position+i,o.size,o.contentSize,o.orientation))},_onMouseMoveEnd:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),this.setState({isDragging:!1})},_onKeyDown:function(e){var t=e.keyCode;if(t!==n.TAB){var o=g,i=0;if(this.state.isHorizontal)switch(t){case n.HOME:i=-1,o=this.props.contentSize;break;case n.LEFT:i=-1;break;case n.RIGHT:i=1;break;default:return}if(!this.state.isHorizontal)switch(t){case n.SPACE:i=e.shiftKey?-1:1;break;case n.HOME:i=-1,o=this.props.contentSize;break;case n.UP:i=-1;break;case n.DOWN:i=1;break;case n.PAGE_UP:i=-1,o=this.props.size;break;case n.PAGE_DOWN:i=1,o=this.props.size;break;default:return}e.preventDefault();var r=this.props;this._setNextState(this._calculateState(this.state.position+o*i,r.size,r.contentSize,r.orientation))}},_onFocus:function(){this.setState({focused:!0})},_onBlur:function(){this.setState({focused:!1})},_blur:function(){if(this.isMounted())try{this._onBlur(),s.findDOMNode(this).blur()}catch(e){}},_setNextState:function(e,t){t=t||this.props;var o=t.position,i=this.state.position!==e.position;if(void 0===o){var n=i?this._didScroll:void 0;this.setState(e,n)}else{if(o!==e.position)return void(void 0!==e.position&&e.position!==this.state.position&&this.props.onScroll(e.position));this.setState(e)}i&&v!==this&&(v&&v._blur(),v=this)},_didScroll:function(){this.props.onScroll(this.state.position)}});b.KEYBOARD_SCROLL_AMOUNT=g,b.SIZE=parseInt(u("scrollbar-size"),10),e.exports=b},function(e,t,o){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var o=0;o0;)this._addRowToBuffer(t,this._viewportRowsBegin,this._viewportRowsEnd-1),t++,e--;return this._rows}},{key:"getRows",value:function(e,t){var o=t,i=o,n=e,r=Math.min(e+this._maxVisibleRowCount,this._rowsCount);for(this._viewportRowsBegin=e;r>n||i=r&&(i=this._bufferSet.replaceFurthestValuePosition(t,o,e)),null===i?(i=this._bufferSet.getNewPositionForValue(e),this._rows[i]=e):this._rows[i]=e}}]),e}();e.exports=h},function(e,t,o){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var o=0;o=e&&t>=n)return null;var r;e-i>n-t?(r=i,this._smallValues.pop()):(r=n,this._largeValues.pop());var a=this._valueToPositionMap[r];return delete this._valueToPositionMap[r],this._valueToPositionMap[o]=a,this._pushToHeaps(a,o),a}},{key:"_pushToHeaps",value:function(e,t){var o={position:e,value:t};this._smallValues.push(o),this._largeValues.push(o)}},{key:"_cleanHeaps",value:function(){this._cleanHeap(this._smallValues),this._cleanHeap(this._largeValues);var e=Math.min(this._smallValues.size(),this._largeValues.size()),t=Math.max(this._smallValues.size(),this._largeValues.size());t>10*e&&this._recreateHeaps()}},{key:"_recreateHeaps",value:function(){for(var e=this._smallValues.size()t.value}}]),e}();e.exports=a},function(e,t){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){return t>e}var n=function(){function e(e,t){for(var o=0;o0&&(this._items[0]=t,this._sinkDown(0)),e}}},{key:"push",value:function(e){this._items[this._size++]=e,this._bubbleUp(this._size-1)}},{key:"size",value:function(){return this._size}},{key:"peek",value:function(){return 0!==this._size?this._items[0]:void 0}},{key:"_heapify",value:function(){for(var e=Math.floor((this._size+1)/2);e>=0;e--)this._sinkDown(e)}},{key:"_bubbleUp",value:function(e){for(var t=this._items[e];e>0;){var o=Math.floor((e+1)/2)-1,i=this._items[o];if(this._comparator(i,t))return;this._items[o]=t,this._items[e]=i,e=o}}},{key:"_sinkDown",value:function(e){for(var t=this._items[e];;){var o=2*(e+1)-1,i=2*(e+1),n=-1;if(oe?t:e>o?o:e}e.exports=o},function(e,t,o){"use strict";var i=Object.assign||function(e){for(var t=1;t0){var t=s({"fixedDataTableRowLayout/fixedColumnsDivider":!0,"fixedDataTableRowLayout/columnsShadow":this.props.scrollLeft>0,"public/fixedDataTableRow/fixedColumnsDivider":!0,"public/fixedDataTableRow/columnsShadow":this.props.scrollLeft>0}),o={left:e,height:this.props.height};return n.createElement("div",{className:t,style:o})}},_onClick:function(e){this.props.onClick(e,this.props.index)},_onDoubleClick:function(e){this.props.onDoubleClick(e,this.props.index)},_onMouseDown:function(e){this.props.onMouseDown(e,this.props.index)},_onMouseEnter:function(e){this.props.onMouseEnter(e,this.props.index)},_onMouseLeave:function(e){this.props.onMouseLeave(e,this.props.index)}}),c=n.createClass({displayName:"FixedDataTableRow",propTypes:{isScrolling:u.bool,height:u.number.isRequired,zIndex:u.number,offsetTop:u.number.isRequired,width:u.number.isRequired},render:function(){var e={width:this.props.width,height:this.props.height,zIndex:this.props.zIndex?this.props.zIndex:0};return l(e,0,this.props.offsetTop),n.createElement("div",{style:e,className:s("fixedDataTableRowLayout/rowWrapper")},n.createElement(h,i({},this.props,{offsetTop:void 0,zIndex:void 0})))}});e.exports=c},function(e,t,o){"use strict";function i(e,t){var o={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(o[i]=e[i]);return o}var n=Object.assign||function(e){for(var t=1;tn;n++){var a=t[n].props;if(!a.allowCellsRecycling||i-e.left<=e.width&&i-e.left+a.width>=0){var h="cell_"+n;o[n]=this._renderCell(e.rowIndex,e.rowHeight,a,i,h)}i+=a.width}var f=this._getColumnsWidth(t),p={height:e.height,position:"absolute",width:f,zIndex:e.zIndex};return u(p,-1*c*e.left,0),s.createElement("div",{className:l("fixedDataTableCellGroupLayout/cellGroup"),style:p},o)},_renderCell:function(e,t,o,i,n){var r=o.isResizable&&this.props.onColumnResize,l=r?this.props.onColumnResize:null,u=o.cellClassName;return s.createElement(a,{isScrolling:this.props.isScrolling,align:o.align,className:u,height:t,key:n,maxWidth:o.maxWidth,minWidth:o.minWidth,onColumnResize:l,rowIndex:e,columnKey:o.columnKey,width:o.width,left:i,cell:o.cell})},_getColumnsWidth:function(e){for(var t=0,o=0;o=0||Object.prototype.hasOwnProperty.call(e,i)&&(o[i]=e[i]);return o}var n=o(65),r=o(60),s=o(27),a=o(47),l=o(66),u=r.DIR_SIGN,h=s.PropTypes,c={align:"left",highlighted:!1},f=s.createClass({displayName:"FixedDataTableCell",propTypes_DISABLED_FOR_PERFORMANCE:{isScrolling:h.bool,align:h.oneOf(["left","center","right"]),className:h.string,highlighted:h.bool,width:h.number.isRequired,minWidth:h.number,maxWidth:h.number,height:h.number.isRequired,cell:h.oneOfType([h.string,h.element,h.func]),columnKey:h.oneOfType([h.string,h.number]),rowIndex:h.number.isRequired,onColumnResize:h.func,left:h.number},shouldComponentUpdate:function(e){return!e.isScrolling||this.props.rowIndex!==e.rowIndex},getDefaultProps:function(){return c},render:function(){var e=this.props,t=e.height,o=e.width,r=e.columnKey,h=i(e,["height","width","columnKey"]),c={height:t,width:o};1===u?c.left=h.left:c.right=h.left;var f,p=l(a({"fixedDataTableCellLayout/main":!0,"fixedDataTableCellLayout/lastChild":h.lastChild,"fixedDataTableCellLayout/alignRight":"right"===h.align,"fixedDataTableCellLayout/alignCenter":"center"===h.align,"public/fixedDataTableCell/alignRight":"right"===h.align,"public/fixedDataTableCell/highlighted":h.highlighted,"public/fixedDataTableCell/main":!0}),h.className);if(h.onColumnResize){var d={height:t};f=s.createElement("div",{className:a("fixedDataTableCellLayout/columnResizerContainer"),style:d,onMouseDown:this._onColumnResizerMouseDown},s.createElement("div",{className:l(a("fixedDataTableCellLayout/columnResizerKnob"),a("public/fixedDataTableCell/columnResizerKnob")),style:d}))}var m={columnKey:r,height:t,width:o};h.rowIndex>=0&&(m.rowIndex=h.rowIndex);var _;return _=s.isValidElement(h.cell)?s.cloneElement(h.cell,m):"function"==typeof h.cell?h.cell(m):s.createElement(n,m,h.cell),s.createElement("div",{className:p,style:c},f,_)},_onColumnResizerMouseDown:function(e){this.props.onColumnResize(this.props.left,this.props.width,this.props.minWidth,this.props.maxWidth,this.props.columnKey,e)}});e.exports=f},function(e,t,o){"use strict";function i(e,t){var o={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(o[i]=e[i]);return o}var n=Object.assign||function(e){for(var t=1;t1)for(var i=1;o>i;i++)t=arguments[i],t&&(e=(e?e+" ":"")+t);return e}e.exports=o},function(e,t,o){"use strict";var i=o(40),n=o(61),r=o(27),s=o(30),a=o(57),l=o(47),u=r.PropTypes,h=r.createClass({displayName:"FixedDataTableColumnResizeHandle",mixins:[s],propTypes:{visible:u.bool.isRequired,height:u.number.isRequired,leftOffset:u.number.isRequired,knobHeight:u.number.isRequired,initialWidth:u.number,minWidth:u.number,maxWidth:u.number,initialEvent:u.object,onColumnResizeEnd:u.func,columnKey:u.oneOfType([u.string,u.number])},getInitialState:function(){return{width:0,cursorDelta:0}},componentWillReceiveProps:function(e){e.initialEvent&&!this._mouseMoveTracker.isDragging()&&(this._mouseMoveTracker.captureMouseMoves(e.initialEvent),this.setState({width:e.initialWidth,cursorDelta:e.initialWidth}))},componentDidMount:function(){this._mouseMoveTracker=new i(this._onMove,this._onColumnResizeEnd,document.body)},componentWillUnmount:function(){this._mouseMoveTracker.releaseMouseMoves(),this._mouseMoveTracker=null},render:function(){var e={width:this.state.width,height:this.props.height};return n.isRTL()?e.right=this.props.leftOffset:e.left=this.props.leftOffset,r.createElement("div",{className:l({"fixedDataTableColumnResizerLineLayout/main":!0,"fixedDataTableColumnResizerLineLayout/hiddenElem":!this.props.visible,"public/fixedDataTableColumnResizerLine/main":!0}),style:e},r.createElement("div",{className:l("fixedDataTableColumnResizerLineLayout/mouseArea"),style:{height:this.props.height}}))},_onMove:function(e){n.isRTL()&&(e=-e);var t=this.state.cursorDelta+e,o=a(t,this.props.minWidth,this.props.maxWidth);this.setState({width:o,cursorDelta:t})},_onColumnResizeEnd:function(){this._mouseMoveTracker.releaseMouseMoves(),this.props.onColumnResizeEnd(this.state.width,this.props.columnKey)}});e.exports=h},function(e,t,o){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var o=0;oa;++a)this._storedHeights[a]=o;this._rowCount=t,this._position=0,this._contentHeight=t*o,this._defaultRowHeight=o,this._rowHeightGetter=s?s:function(){return o},this._viewportHeight=n,this.scrollRowIntoView=this.scrollRowIntoView.bind(this),this.setViewportHeight=this.setViewportHeight.bind(this),this.scrollBy=this.scrollBy.bind(this),this.scrollTo=this.scrollTo.bind(this),this.scrollToRow=this.scrollToRow.bind(this),this.setRowHeightGetter=this.setRowHeightGetter.bind(this),this.getContentHeight=this.getContentHeight.bind(this),this.getRowPosition=this.getRowPosition.bind(this),this._updateHeightsInViewport(0,0)}return n(e,[{key:"setRowHeightGetter",value:function(e){this._rowHeightGetter=e}},{key:"setViewportHeight",value:function(e){this._viewportHeight=e}},{key:"getContentHeight",value:function(){return this._contentHeight}},{key:"_updateHeightsInViewport",value:function(e,t){for(var o=t,i=e;o<=this._viewportHeight&&i=0&&t>=e-a;){var o=this._updateRowHeight(t);this._position+=o,t--}}},{key:"_updateRowHeight",value:function(e){if(0>e||e>=this._rowCount)return 0;var t=this._rowHeightGetter(e);if(t!==this._storedHeights[e]){var o=t-this._storedHeights[e];return this._rowOffsets.set(e,t),this._storedHeights[e]=t,this._contentHeight+=o,o}return 0}},{key:"getRowPosition",value:function(e){return this._updateRowHeight(e),this._rowOffsets.sumUntil(e)}},{key:"scrollBy",value:function(e){if(0===this._rowCount)return l;var t=this._rowOffsets.greatestLowerBound(this._position);t=s(t,0,Math.max(this._rowCount-1,0));var o=this._rowOffsets.sumUntil(t),i=t,n=this._position,r=this._updateRowHeight(i);0!==o&&(n+=r);var a=this._storedHeights[i]-(n-o);if(e>=0)for(;e>0&&ie?(n+=e,e=0):(e-=a,n+=a,i++),ie){e=-e;for(var u=this._storedHeights[i]-a;e>0&&i>=0;)if(u>e?(n-=e,e=0):(n-=u,e-=u,i--),i>=0){var h=this._updateRowHeight(i);u=this._storedHeights[i],n+=h}}var c=this._contentHeight-this._viewportHeight;n=s(n,0,c),this._position=n;var f=this._rowOffsets.greatestLowerBound(n);f=s(f,0,Math.max(this._rowCount-1,0)),o=this._rowOffsets.sumUntil(f);var p=o-n;return this._updateHeightsInViewport(f,p),this._updateHeightsAboveViewport(f),{index:f,offset:p,position:this._position,contentHeight:this._contentHeight}}},{key:"_getRowAtEndPosition",value:function(e){this._updateRowHeight(e);for(var t=e,o=this._storedHeights[t];o=0;)t--,t>=0&&(this._updateRowHeight(t),o+=this._storedHeights[t]);var i=this._rowOffsets.sumTo(e)-this._viewportHeight;return 0>i&&(i=0),i}},{key:"scrollTo",value:function(e){if(0===this._rowCount)return l;if(0>=e)return this._position=0,this._updateHeightsInViewport(0,0),{index:0,offset:0,position:this._position,contentHeight:this._contentHeight};if(e>=this._contentHeight-this._viewportHeight){var t=this._rowCount-1;e=this._getRowAtEndPosition(t)}this._position=e;var o=this._rowOffsets.greatestLowerBound(e);o=s(o,0,Math.max(this._rowCount-1,0));var i=this._rowOffsets.sumUntil(o),n=i-e;return this._updateHeightsInViewport(o,n),this._updateHeightsAboveViewport(o),{index:o,offset:n,position:this._position,contentHeight:this._contentHeight}}},{key:"scrollToRow",value:function(e,t){e=s(e,0,Math.max(this._rowCount-1,0)),t=s(t,-this._storedHeights[e],0);var o=this._rowOffsets.sumUntil(e);return this.scrollTo(o-t)}},{key:"scrollRowIntoView",value:function(e){e=s(e,0,Math.max(this._rowCount-1,0));var t=this._rowOffsets.sumUntil(e),o=t+this._storedHeights[e];if(tt;)t*=2;return t}var r=function(){function e(e,t){for(var o=0;o=0;--o)t[o]=0;return t},u=function(){function e(t){i(this,e),this._size=t.length,this._half=n(this._size),this._heap=new l(2*this._half);var o;for(o=0;o0;--o)this._heap[o]=this._heap[2*o]+this._heap[2*o+1]}return r(e,[{key:"set",value:function(e,t){s(e>=0&&e=0&&e=0&&e=0&&e=e,"Begin must precede end"),this.sumUntil(t)-this.sumUntil(e)}},{key:"greatestLowerBound",value:function(e){if(0>e)return-1;var t=1;if(this._heap[t]<=e)return this._size;for(;te?t=2*t:(t=2*t+1,e-=o)}return t-this._half}},{key:"greatestStrictLowerBound",value:function(e){if(0>=e)return-1;var t=1;if(this._heap[t]=e?t=2*t:(t=2*t+1,e-=o)}return t-this._half}},{key:"leastUpperBound",value:function(e){return this.greatestStrictLowerBound(e)+1}},{key:"leastStrictUpperBound",value:function(e){return this.greatestLowerBound(e)+1}}],[{key:"uniform",value:function(t,o){for(var i=[],n=t-1;n>=0;--n)i[n]=o;return new e(i)}},{key:"empty",value:function(t){return e.uniform(t,0)}}]),e}();e.exports=u}).call(t,function(){return this}())},function(e,t,o){"use strict";function i(e){for(var t=0,o=0;o=t)return{columns:e,width:i(e)};for(var o=n(e),r=t,s=[],a=0,u=0;uo?r(e,t-o).columns:e}var l=o(27),u={getTotalWidth:i,getTotalFlexGrow:n,distributeFlexWidth:r,adjustColumnWidths:a,adjustColumnGroupWidths:s};e.exports=u},function(e,t){"use strict";function o(e,t,o,i,n){function r(){for(var n=arguments.length,a=Array(n),l=0;n>l;l++)a[l]=arguments[l];r.reset();var u=function(){e.apply(o,a)};u.__SMmeta=e.__SMmeta,s=i(u,t)}i=i||setTimeout,n=n||clearTimeout;var s;return r.reset=function(){n(s)},r}e.exports=o},function(e,t){"use strict";function o(e,t){if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var o=Object.keys(e),n=Object.keys(t);if(o.length!==n.length)return!1;for(var r=i.bind(t),s=0;s Date: Thu, 10 Dec 2015 15:30:18 -0800 Subject: [PATCH 06/43] Update README.md --- README.md | 100 +++--------------------------------------------------- 1 file changed, 4 insertions(+), 96 deletions(-) diff --git a/README.md b/README.md index 5e717f71..13cbbbd4 100644 --- a/README.md +++ b/README.md @@ -1,98 +1,6 @@ -Fixed Data Tables for React -==================================== +Why is there a fork of Facebook's [fixed-data-table](https://github.com/facebook/fixed-data-table/pull/331)? +==== -FixedDataTable is a React component for building and presenting data in a flexible, powerful way. It supports standard table features, like headers, columns, rows, header groupings, and both fixed-position and scrolling columns. +There's a [scroll bug](https://github.com/facebook/fixed-data-table/issues/330) in Fixed Data Table that's causing a [user facing scroll bug](https://github.com/BuildingConnected/client/pull/180#issuecomment-163759904) in the project table. -The table was designed to handle thousands of rows of data without sacrificing performance. Scrolling smoothly is a first-class goal of FixedDataTable and it's architected in a way to allow for flexibility and extensibility. - -Features of FixedDataTable: -* Fixed headers and footer -* Both fixed and scrollable columns -* Handling huge amounts of data -* Variable row heights (with adaptive scroll positions) -* Column resizing -* Performant scrolling -* Customizable styling -* Jumping to a row or column -* Controlled scroll API allows touch support - -Things the FixedDataTable **doesn't** do: -* FixedDataTable does not provide a layout reflow mechanism or calculate content layout information such as width and height of the cell contents. The developer has to provide the layout information to the table instead. -* FixedDataTable does not handle sorting of data. Instead it allows the developer to supply data getters that can be sort-, filter-, or tail-loading-aware. -* FixedDataTable does not fetch the data (see above) - -Getting started ---------------- - -Install `fixed-data-table` using npm. - -```shell -npm install fixed-data-table -``` -Add the default stylesheet `dist/fixed-data-table.css`, then import it into any module. - -### Basic Example - -```javascript -import React from 'react'; -import ReactDOM from 'react-dom'; -import {Table, Column, Cell} from 'fixed-data-table'; - -// Table data as a list of array. -const rows = [ - ['a1', 'b1', 'c1'], - ['a2', 'b2', 'c2'], - ['a3', 'b3', 'c3'], - // .... and more -]; - -// Render your table -ReactDOM.render( - - Col 1} - cell={Column 1 static content} - width={2000} - /> - Col 2} - cell={} - width={1000} - /> - Col 3} - cell={({rowIndex, ...props}) => ( - - Data for column 3: {rows[rowIndex][2]} - - )} - width={2000} - /> -
, - document.getElementById('example') -); -``` - -Contributions ------------- - -Use [GitHub issues](https://github.com/facebook/fixed-data-table/issues) for requests. - -We actively welcome pull requests; learn how to [contribute](https://github.com/facebook/fixed-data-table/blob/master/CONTRIBUTING.md). - - -Changelog ---------- - -Changes are tracked as [GitHub releases](https://github.com/facebook/fixed-data-table/releases). - - -License -------- - -`FixedDataTable` is [BSD-licensed](https://github.com/facebook/fixed-data-table/blob/master/LICENSE). We also provide an additional [patent grant](https://github.com/facebook/fixed-data-table/blob/master/PATENTS). +Until Al's [PR](https://github.com/facebook/fixed-data-table/pull/331) is accepted or this underlying bug is fixed, use this fork. From 11d136dc355d5751365b9e8bcefe97ee2d74965c Mon Sep 17 00:00:00 2001 From: Thomas Beirne Date: Fri, 20 May 2016 16:41:02 -0400 Subject: [PATCH 07/43] Add support for React 15 --- package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 2fe766c6..05e8cfc8 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,8 @@ "description": "A React table component designed to allow presenting thousands of rows of data.", "main": "main.js", "peerDependencies": { - "react": ">=0.13.0 <0.15.0 || ^0.14.0-beta3", - "react-dom": ">=0.14.0 <0.15.0 || ^0.14.0-beta3" + "react": "15.0.x", + "react-dom": "15.0.x" }, "devDependencies": { "autoprefixer": "^5.0.0", @@ -24,9 +24,9 @@ "null-loader": "^0.1.0", "postcss": "^4.0.2", "postcss-custom-properties": "3.0.1", - "react": "^0.14.0", - "react-docgen": "^1.2.0", - "react-tools": "^0.12.2", + "react": "15.0.x", + "react-docgen": "2.8.x", + "react-tools": "0.13.x", "style-loader": "^0.8.3", "url-loader": "^0.5.5", "webpack": "^1.8.3", From dde6379d4a3041a2a03883fb165653c8f4ce37f4 Mon Sep 17 00:00:00 2001 From: Thomas Beirne Date: Fri, 20 May 2016 16:41:39 -0400 Subject: [PATCH 08/43] Version 0.7.0 --- dist/fixed-data-table-base.css | 2 +- dist/fixed-data-table-base.min.css | 2 +- dist/fixed-data-table-style.css | 2 +- dist/fixed-data-table-style.min.css | 2 +- dist/fixed-data-table.css | 2 +- dist/fixed-data-table.js | 4 ++-- dist/fixed-data-table.min.css | 2 +- dist/fixed-data-table.min.js | 6 +++--- package.json | 2 +- src/FixedDataTableRoot.js | 2 +- 10 files changed, 13 insertions(+), 13 deletions(-) diff --git a/dist/fixed-data-table-base.css b/dist/fixed-data-table-base.css index 6a66fc6f..7c86002f 100644 --- a/dist/fixed-data-table-base.css +++ b/dist/fixed-data-table-base.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.6.1 + * FixedDataTable v0.7.0 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table-base.min.css b/dist/fixed-data-table-base.min.css index 9e3984e4..70d9d500 100644 --- a/dist/fixed-data-table-base.min.css +++ b/dist/fixed-data-table-base.min.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.6.1 + * FixedDataTable v0.7.0 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table-style.css b/dist/fixed-data-table-style.css index 451a59fb..00260981 100644 --- a/dist/fixed-data-table-style.css +++ b/dist/fixed-data-table-style.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.6.1 + * FixedDataTable v0.7.0 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table-style.min.css b/dist/fixed-data-table-style.min.css index 763f2ee6..85237287 100644 --- a/dist/fixed-data-table-style.min.css +++ b/dist/fixed-data-table-style.min.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.6.1 + * FixedDataTable v0.7.0 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table.css b/dist/fixed-data-table.css index e8275cfa..9f748e5b 100644 --- a/dist/fixed-data-table.css +++ b/dist/fixed-data-table.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.6.1 + * FixedDataTable v0.7.0 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table.js b/dist/fixed-data-table.js index e7c6a1ca..f2ed68f1 100644 --- a/dist/fixed-data-table.js +++ b/dist/fixed-data-table.js @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.6.1 + * FixedDataTable v0.7.0 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -187,7 +187,7 @@ return /******/ (function(modules) { // webpackBootstrap Table: FixedDataTable }; - FixedDataTableRoot.version = '0.6.1'; + FixedDataTableRoot.version = '0.7.0'; module.exports = FixedDataTableRoot; /***/ }, diff --git a/dist/fixed-data-table.min.css b/dist/fixed-data-table.min.css index 545c24ac..3243fd09 100644 --- a/dist/fixed-data-table.min.css +++ b/dist/fixed-data-table.min.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.6.1 + * FixedDataTable v0.7.0 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table.min.js b/dist/fixed-data-table.min.js index f97921bd..0f466734 100644 --- a/dist/fixed-data-table.min.js +++ b/dist/fixed-data-table.min.js @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.6.1 + * FixedDataTable v0.7.0 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -9,6 +9,6 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.FixedDataTable=t(require("react"),require("react-dom")):e.FixedDataTable=t(e.React,e.ReactDOM)}(this,function(e,t){return function(e){function t(i){if(o[i])return o[i].exports;var n=o[i]={exports:{},id:i,loaded:!1};return e[i].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){o(1),o(5),o(7),o(9),o(11),o(13),o(15),o(17),o(19),o(21),o(23),e.exports=o(25)},function(e,t){},,,,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t,o){"use strict";var i=o(26),n=o(65),r=o(63),s=o(62),a={Cell:n,Column:r,ColumnGroup:s,Table:i};a.version="0.6.1",e.exports=a},function(e,t,o){"use strict";function i(e,t){}var n=Object.assign||function(e){for(var t=1;te&&this.state.scrollX>0||e>=0&&this.state.scrollXe&&this.state.scrollY>0||e>=0&&this.state.scrollYi?i:this.state.height>i&&this.props.ownerHeight?Math.max(i,this.props.ownerHeight):this.state.height+this.state.maxScrollY,e!==this._contentHeight&&this.props.onContentHeightChange&&this.props.onContentHeightChange(e),this._contentHeight=e},componentDidMount:function(){this._reportContentHeight()},componentWillReceiveProps:function(e){var t=e.scrollToRow;void 0!==t&&null!==t&&(this._rowToScrollTo=t);var o=e.scrollToColumn;void 0!==o&&null!==o&&(this._columnToScrollTo=o);var i=e.overflowX,n=e.overflowY;(i!==this.props.overflowX||n!==this.props.overflowY)&&(this._wheelHandler=new s(this._onWheel,"hidden"!==i,"hidden"!==n)),(this.props.ownerHeight!==e.ownerHeight||this.props.scrollTop!==e.scrollTop)&&this._didScrollStart(),this._didScrollStop(),this.setState(this._calculateState(e,this.state))},componentDidUpdate:function(){this._reportContentHeight()},render:function(){var e,t=this.state,o=this.props;t.useGroupHeader&&(e=n.createElement(h,{key:"group_header",isScrolling:this._isScrolling,className:w(p("fixedDataTableLayout/header"),p("public/fixedDataTable/header")),width:t.width,height:t.groupHeaderHeight,index:0,zIndex:1,offsetTop:0,scrollLeft:t.scrollX,fixedColumns:t.groupHeaderFixedColumns,scrollableColumns:t.groupHeaderScrollableColumns,onColumnResize:this._onColumnResize}));var i=this.state.maxScrollY,r=t.maxScrollX>0&&"hidden"!==t.overflowX,s=i>0&&"hidden"!==t.overflowY,l=r?a.SIZE:0,c=t.height-l-2*x-t.footerHeight,f=t.useGroupHeader?t.groupHeaderHeight:0,d=f+t.headerHeight;c-=d;var m=0,_=null!=o.maxHeight?d+t.bodyHeight:d+c,g=_+t.footerHeight;void 0!==o.ownerHeight&&o.ownerHeightt.ownerHeight||t.scrollY or "),o.push(e))});var n=!1;o.length&&o[0].type.__TableColumnGroup__&&(n=!0),t&&(void 0!==e.width&&e.width!==t.width||void 0!==e.height&&e.height!==t.height||void 0!==e.maxWidth&&e.maxWidth!==t.maxWidth||void 0!==e.maxHeight&&e.maxHeight!==t.maxHeight)&&(t=null);var r,s,l=t&&t.firstRowIndex||0,u=t&&t.firstRowOffset||0;r=t&&"hidden"!==e.overflowX?t.scrollX:e.scrollLeft,t&&"hidden"!==e.overflowY?s=t.scrollY:(d=this._scrollHelper.scrollTo(e.scrollTop),l=d.index,u=d.offset,s=d.position),void 0!==this._rowToScrollTo&&(d=this._scrollHelper.scrollRowIntoView(this._rowToScrollTo),l=d.index,u=d.offset,s=d.position,delete this._rowToScrollTo);var h=n?e.groupHeaderHeight:0;if(t&&e.rowsCount!==t.rowsCount){var p=(void 0===e.height?e.maxHeight:e.height)-(e.headerHeight||0)-(e.footerHeight||0)-(e.groupHeaderHeight||0);this._scrollHelper=new c(e.rowsCount,e.rowHeight,p,e.rowHeightGetter);var d=this._scrollHelper.scrollToRow(l,u);l=d.index,u=d.offset,s=d.position}else t&&e.rowHeightGetter!==t.rowHeightGetter&&this._scrollHelper.setRowHeightGetter(e.rowHeightGetter);var m;m=e.isColumnResizing?t&&t.columnResizingData:y;var w,g;if(n){var v=f.adjustColumnGroupWidths(o,e.width);w=v.columns,g=v.columnGroups}else w=f.adjustColumnWidths(o,e.width);var b=this._populateColumnsAndColumnData(w,g,t);if(void 0!==this._columnToScrollTo){var R=b.bodyFixedColumns.length;if(this._columnToScrollTo>=R){var T,H,S=0;for(T=0;TT;++T)H=b.bodyScrollableColumns[T],M+=H.props.width;var E=e.width-S,z=b.bodyScrollableColumns[D].props.width,k=M+z-E;k>r&&(r=k),r>M&&(r=M)}delete this._columnToScrollTo}var O=void 0===e.height,P=Math.round(O?e.maxHeight:e.height),N=e.footerHeight+e.headerHeight+h+2*x,I=P-N,L=this._scrollHelper.getContentHeight(),G=L+N,F=f.getTotalWidth(w),W=F>e.width&&"hidden"!==e.overflowX;W&&(I-=a.SIZE,G+=a.SIZE,N+=a.SIZE);var A=Math.max(0,F-e.width),V=Math.max(0,L-I);r=Math.min(r,A),s=Math.min(s,V),V||(O&&(P=G),I=G-N),this._scrollHelper.setViewportHeight(I);var X=i({isColumnResizing:t&&t.isColumnResizing},b,e,{columns:w,columnGroups:g,columnResizingData:m,firstRowIndex:l,firstRowOffset:u,horizontalScrollbarVisible:W,maxScrollX:A,maxScrollY:V,reservedHeight:N,scrollContentHeight:L,scrollX:r,scrollY:s,bodyHeight:I,height:P,groupHeaderHeight:h,useGroupHeader:n});return X},_selectColumnElement:function(e,t){for(var o=[],i=0;iMath.abs(e)&&"hidden"!==this.props.overflowY){var i=this._scrollHelper.scrollBy(Math.round(t)),n=Math.max(0,i.contentHeight-this.state.bodyHeight);this.setState({firstRowIndex:i.index,firstRowOffset:i.offset,scrollY:i.position,scrollContentHeight:i.contentHeight,maxScrollY:n})}else e&&"hidden"!==this.props.overflowX&&(o+=e,o=0>o?0:o,o=o>this.state.maxScrollX?this.state.maxScrollX:o,this.setState({scrollX:o}));this._didScrollStop()}},_onHorizontalScroll:function(e){this.isMounted()&&e!==this.state.scrollX&&(this._isScrolling||this._didScrollStart(),this.setState({scrollX:e}),this._didScrollStop())},_onVerticalScroll:function(e){if(this.isMounted()&&e!==this.state.scrollY){this._isScrolling||this._didScrollStart();var t=this._scrollHelper.scrollTo(Math.round(e));this.setState({firstRowIndex:t.index,firstRowOffset:t.offset,scrollY:t.position,scrollContentHeight:t.contentHeight}),this._didScrollStop()}},_didScrollStart:function(){this.isMounted()&&!this._isScrolling&&(this._isScrolling=!0,this.props.onScrollStart&&this.props.onScrollStart(this.state.scrollX,this.state.scrollY))},_didScrollStop:function(){this.isMounted()&&this._isScrolling&&(this._isScrolling=!1,this.setState({redraw:!0}),this.props.onScrollEnd&&this.props.onScrollEnd(this.state.scrollX,this.state.scrollY))}}),D=n.createClass({displayName:"HorizontalScrollbar",mixins:[r],propTypes:{contentSize:b.number.isRequired,offset:b.number.isRequired,onScroll:b.func.isRequired,position:b.number.isRequired,size:b.number.isRequired},render:function(){var e={height:a.SIZE,width:this.props.size},t={height:a.SIZE,position:"absolute",overflow:"hidden",width:this.props.size};return v(t,0,this.props.offset),n.createElement("div",{className:w(p("fixedDataTableLayout/horizontalScrollbar"),p("public/fixedDataTable/horizontalScrollbar")),style:e},n.createElement("div",{style:t},n.createElement(a,i({},this.props,{isOpaque:!0,orientation:"horizontal",offset:void 0}))))}});e.exports=S},function(e,t){"use strict";function o(e,t){if(e===t)return!0;var o;for(o in e)if(e.hasOwnProperty(o)&&(!t.hasOwnProperty(o)||e[o]!==t[o]))return!1;for(o in t)if(t.hasOwnProperty(o)&&!e.hasOwnProperty(o))return!1;return!0}var i={shouldComponentUpdate:function(e,t){return!o(this.props,e)||!o(this.state,t)}};e.exports=i},function(e,t,o){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var o=0;oi?-1:1),n&&!o&&(o=1>n?-1:1),{spinX:t,spinY:o,pixelX:i,pixelY:n}}var n=o(34),r=o(35),s=10,a=40,l=800;i.getEventType=function(){return n.firefox()?"DOMMouseScroll":r("wheel")?"wheel":"mousewheel"},e.exports=i},function(e,t){"use strict";function o(){if(!g){g=!0;var e=navigator.userAgent,t=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),o=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(d=/\b(iPhone|iP[ao]d)/.exec(e),m=/\b(iP[ao]d)/.exec(e),f=/Android/i.exec(e),_=/FBAN\/\w+;/i.exec(e),w=/Mobile/i.exec(e),p=!!/Win64/.exec(e),t){i=t[1]?parseFloat(t[1]):t[5]?parseFloat(t[5]):NaN,i&&document&&document.documentMode&&(i=document.documentMode);var v=/(?:Trident\/(\d+.\d+))/.exec(e);l=v?parseFloat(v[1])+4:i,n=t[2]?parseFloat(t[2]):NaN,r=t[3]?parseFloat(t[3]):NaN,s=t[4]?parseFloat(t[4]):NaN,s?(t=/(?:Chrome\/(\d+\.\d+))/.exec(e),a=t&&t[1]?parseFloat(t[1]):NaN):a=NaN}else i=n=r=a=s=NaN;if(o){if(o[1]){var b=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);u=b?parseFloat(b[1].replace("_",".")):!0}else u=!1;h=!!o[2],c=!!o[3]}else u=h=c=!1}}var i,n,r,s,a,l,u,h,c,f,p,d,m,_,w,g=!1,v={ie:function(){return o()||i},ieCompatibilityMode:function(){return o()||l>i},ie64:function(){return v.ie()&&p},firefox:function(){return o()||n},opera:function(){return o()||r},webkit:function(){return o()||s},safari:function(){return v.webkit()},chrome:function(){return o()||a},windows:function(){return o()||h},osx:function(){return o()||u},linux:function(){return o()||c},iphone:function(){return o()||d},mobile:function(){return o()||d||m||f||w},nativeApp:function(){return o()||_},android:function(){return o()||f},ipad:function(){return o()||m}};e.exports=v},function(e,t,o){"use strict";function i(e,t){if(!r.canUseDOM||t&&!("addEventListener"in document))return!1;var o="on"+e,i=o in document;if(!i){var s=document.createElement("div");s.setAttribute(o,"return;"),i="function"==typeof s[o]}return!i&&n&&"wheel"===e&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}var n,r=o(36);r.canUseDOM&&(n=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),e.exports=i},function(e,t){"use strict";var o=!("undefined"==typeof window||!window.document||!window.document.createElement),i={canUseDOM:o,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:o&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:o&&!!window.screen,isInWorker:!o};e.exports=i},function(e,t,o){(function(t){"use strict";var i=o(32),n=o(38),r=0,s=n||function(e){var o=Date.now(),i=Math.max(0,16-(o-r));return r=o+i,t.setTimeout(function(){e(Date.now())},i)};s(i),e.exports=s}).call(t,function(){return this}())},function(e,t){(function(t){"use strict";var o=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame;e.exports=o}).call(t,function(){return this}())},function(e,t,o){"use strict";var i=o(40),n=o(43),r=o(27),s=o(44),a=o(30),l=o(31),u=o(46),h=o(47),c=o(32),f=o(48),p=r.PropTypes,d={position:0,scrollable:!1},m=parseInt(u("scrollbar-face-margin"),10),_=2*m,w=30,g=40,v=null,b=r.createClass({displayName:"Scrollbar",mixins:[a],propTypes:{contentSize:p.number.isRequired,defaultPosition:p.number,isOpaque:p.bool,orientation:p.oneOf(["vertical","horizontal"]),onScroll:p.func,position:p.number,size:p.number.isRequired,trackColor:p.oneOf(["gray"]),zIndex:p.number,verticalTop:p.number},getInitialState:function(){var e=this.props;return this._calculateState(e.position||e.defaultPosition||0,e.size,e.contentSize,e.orientation)},componentWillReceiveProps:function(e){var t=e.position;void 0===t?this._setNextState(this._calculateState(this.state.position,e.size,e.contentSize,e.orientation)):this._setNextState(this._calculateState(t,e.size,e.contentSize,e.orientation),e)},getDefaultProps:function(){return{defaultPosition:0,isOpaque:!1,onScroll:c,orientation:"vertical",zIndex:99}},render:function(){if(!this.state.scrollable)return null;var e,t,o=this.props.size,i=this.state.isHorizontal,n=!i,s=this.state.focused||this.state.isDragging,a=this.state.faceSize,l=this.props.isOpaque,c=this.props.verticalTop||0,p=h({"ScrollbarLayout/main":!0,"ScrollbarLayout/mainVertical":n,"ScrollbarLayout/mainHorizontal":i,"public/Scrollbar/main":!0,"public/Scrollbar/mainOpaque":l,"public/Scrollbar/mainActive":s}),d=h({"ScrollbarLayout/face":!0,"ScrollbarLayout/faceHorizontal":i,"ScrollbarLayout/faceVertical":n,"public/Scrollbar/faceActive":s,"public/Scrollbar/face":!0}),w=this.state.position*this.state.scale+m;return i?(e={width:o},t={width:a-_},f(t,w,0)):(e={top:c,height:o},t={height:a-_},f(t,0,w)),e.zIndex=this.props.zIndex,"gray"===this.props.trackColor&&(e.backgroundColor=u("fbui-desktop-background-light")),r.createElement("div",{onFocus:this._onFocus,onBlur:this._onBlur,onKeyDown:this._onKeyDown,onMouseDown:this._onMouseDown,onWheel:this._wheelHandler.onWheel,className:p,style:e,tabIndex:0},r.createElement("div",{ref:"face",className:d,style:t}))},componentWillMount:function(){var e="horizontal"===this.props.orientation,t=e?this._onWheelX:this._onWheelY;this._wheelHandler=new l(t,this._shouldHandleX,this._shouldHandleY)},componentDidMount:function(){this._mouseMoveTracker=new i(this._onMouseMove,this._onMouseMoveEnd,document.documentElement),void 0!==this.props.position&&this.state.position!==this.props.position&&this._didScroll()},componentWillUnmount:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),v===this&&(v=null),delete this._mouseMoveTracker},scrollBy:function(e){this._onWheel(e)},_shouldHandleX:function(e){return"horizontal"===this.props.orientation?this._shouldHandleChange(e):!1},_shouldHandleY:function(e){return"horizontal"!==this.props.orientation?this._shouldHandleChange(e):!1},_shouldHandleChange:function(e){var t=this._calculateState(this.state.position+e,this.props.size,this.props.contentSize,this.props.orientation);return t.position!==this.state.position},_calculateState:function(e,t,o,i){if(1>t||t>=o)return d;var n=e+"_"+t+"_"+o+"_"+i;if(this._stateKey===n)return this._stateForKey;var r="horizontal"===i,s=t/o,a=t*s;w>a&&(s=(t-w)/(o-t),a=w);var l=!0,u=o-t;0>e?e=0:e>u&&(e=u);var h=this._mouseMoveTracker?this._mouseMoveTracker.isDragging():!1,c={faceSize:a,isDragging:h,isHorizontal:r,position:e,scale:s,scrollable:l};return this._stateKey=n,this._stateForKey=c,c},_onWheelY:function(e,t){this._onWheel(t)},_onWheelX:function(e,t){this._onWheel(e)},_onWheel:function(e){var t=this.props;this._setNextState(this._calculateState(this.state.position+e,t.size,t.contentSize,t.orientation))},_onMouseDown:function(e){var t;if(e.target!==s.findDOMNode(this.refs.face)){var o=e.nativeEvent,i=this.state.isHorizontal?o.offsetX||o.layerX:o.offsetY||o.layerY,n=this.props;i/=this.state.scale,t=this._calculateState(i-.5*this.state.faceSize/this.state.scale,n.size,n.contentSize,n.orientation)}else t={};t.focused=!0,this._setNextState(t),this._mouseMoveTracker.captureMouseMoves(e),s.findDOMNode(this).focus()},_onMouseMove:function(e,t){var o=this.props,i=this.state.isHorizontal?e:t;i/=this.state.scale,this._setNextState(this._calculateState(this.state.position+i,o.size,o.contentSize,o.orientation))},_onMouseMoveEnd:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),this.setState({isDragging:!1})},_onKeyDown:function(e){var t=e.keyCode;if(t!==n.TAB){var o=g,i=0;if(this.state.isHorizontal)switch(t){case n.HOME:i=-1,o=this.props.contentSize;break;case n.LEFT:i=-1;break;case n.RIGHT:i=1;break;default:return}if(!this.state.isHorizontal)switch(t){case n.SPACE:i=e.shiftKey?-1:1;break;case n.HOME:i=-1,o=this.props.contentSize;break;case n.UP:i=-1;break;case n.DOWN:i=1;break;case n.PAGE_UP:i=-1,o=this.props.size;break;case n.PAGE_DOWN:i=1,o=this.props.size;break;default:return}e.preventDefault();var r=this.props;this._setNextState(this._calculateState(this.state.position+o*i,r.size,r.contentSize,r.orientation))}},_onFocus:function(){this.setState({focused:!0})},_onBlur:function(){this.setState({focused:!1})},_blur:function(){if(this.isMounted())try{this._onBlur(),s.findDOMNode(this).blur()}catch(e){}},_setNextState:function(e,t){t=t||this.props;var o=t.position,i=this.state.position!==e.position;if(void 0===o){var n=i?this._didScroll:void 0;this.setState(e,n)}else{if(o!==e.position)return void(void 0!==e.position&&e.position!==this.state.position&&this.props.onScroll(e.position));this.setState(e)}i&&v!==this&&(v&&v._blur(),v=this)},_didScroll:function(){this.props.onScroll(this.state.position)}});b.KEYBOARD_SCROLL_AMOUNT=g,b.SIZE=parseInt(u("scrollbar-size"),10),e.exports=b},function(e,t,o){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var o=0;o0;)this._addRowToBuffer(t,this._viewportRowsBegin,this._viewportRowsEnd-1),t++,e--;return this._rows}},{key:"getRows",value:function(e,t){var o=t,i=o,n=e,r=Math.min(e+this._maxVisibleRowCount,this._rowsCount);for(this._viewportRowsBegin=e;r>n||i=r&&(i=this._bufferSet.replaceFurthestValuePosition(t,o,e)),null===i?(i=this._bufferSet.getNewPositionForValue(e),this._rows[i]=e):this._rows[i]=e}}]),e}();e.exports=h},function(e,t,o){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var o=0;o=e&&t>=n)return null;var r;e-i>n-t?(r=i,this._smallValues.pop()):(r=n,this._largeValues.pop());var a=this._valueToPositionMap[r];return delete this._valueToPositionMap[r],this._valueToPositionMap[o]=a,this._pushToHeaps(a,o),a}},{key:"_pushToHeaps",value:function(e,t){var o={position:e,value:t};this._smallValues.push(o),this._largeValues.push(o)}},{key:"_cleanHeaps",value:function(){this._cleanHeap(this._smallValues),this._cleanHeap(this._largeValues);var e=Math.min(this._smallValues.size(),this._largeValues.size()),t=Math.max(this._smallValues.size(),this._largeValues.size());t>10*e&&this._recreateHeaps()}},{key:"_recreateHeaps",value:function(){for(var e=this._smallValues.size()t.value}}]),e}();e.exports=a},function(e,t){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){return t>e}var n=function(){function e(e,t){for(var o=0;o0&&(this._items[0]=t,this._sinkDown(0)),e}}},{key:"push",value:function(e){this._items[this._size++]=e,this._bubbleUp(this._size-1)}},{key:"size",value:function(){return this._size}},{key:"peek",value:function(){return 0!==this._size?this._items[0]:void 0}},{key:"_heapify",value:function(){for(var e=Math.floor((this._size+1)/2);e>=0;e--)this._sinkDown(e)}},{key:"_bubbleUp",value:function(e){for(var t=this._items[e];e>0;){var o=Math.floor((e+1)/2)-1,i=this._items[o];if(this._comparator(i,t))return;this._items[o]=t,this._items[e]=i,e=o}}},{key:"_sinkDown",value:function(e){for(var t=this._items[e];;){var o=2*(e+1)-1,i=2*(e+1),n=-1;if(oe?t:e>o?o:e}e.exports=o},function(e,t,o){"use strict";var i=Object.assign||function(e){for(var t=1;t0){var t=s({"fixedDataTableRowLayout/fixedColumnsDivider":!0,"fixedDataTableRowLayout/columnsShadow":this.props.scrollLeft>0,"public/fixedDataTableRow/fixedColumnsDivider":!0,"public/fixedDataTableRow/columnsShadow":this.props.scrollLeft>0}),o={left:e,height:this.props.height};return n.createElement("div",{className:t,style:o})}},_onClick:function(e){this.props.onClick(e,this.props.index)},_onDoubleClick:function(e){this.props.onDoubleClick(e,this.props.index)},_onMouseDown:function(e){this.props.onMouseDown(e,this.props.index)},_onMouseEnter:function(e){this.props.onMouseEnter(e,this.props.index)},_onMouseLeave:function(e){this.props.onMouseLeave(e,this.props.index)}}),c=n.createClass({displayName:"FixedDataTableRow",propTypes:{isScrolling:u.bool,height:u.number.isRequired,zIndex:u.number,offsetTop:u.number.isRequired,width:u.number.isRequired},render:function(){var e={width:this.props.width,height:this.props.height,zIndex:this.props.zIndex?this.props.zIndex:0};return l(e,0,this.props.offsetTop),n.createElement("div",{style:e,className:s("fixedDataTableRowLayout/rowWrapper")},n.createElement(h,i({},this.props,{offsetTop:void 0,zIndex:void 0})))}});e.exports=c},function(e,t,o){"use strict";function i(e,t){var o={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(o[i]=e[i]);return o}var n=Object.assign||function(e){for(var t=1;tn;n++){var a=t[n].props;if(!a.allowCellsRecycling||i-e.left<=e.width&&i-e.left+a.width>=0){var h="cell_"+n;o[n]=this._renderCell(e.rowIndex,e.rowHeight,a,i,h)}i+=a.width}var f=this._getColumnsWidth(t),p={height:e.height,position:"absolute",width:f,zIndex:e.zIndex};return u(p,-1*c*e.left,0),s.createElement("div",{className:l("fixedDataTableCellGroupLayout/cellGroup"),style:p},o)},_renderCell:function(e,t,o,i,n){var r=o.isResizable&&this.props.onColumnResize,l=r?this.props.onColumnResize:null,u=o.cellClassName;return s.createElement(a,{isScrolling:this.props.isScrolling,align:o.align,className:u,height:t,key:n,maxWidth:o.maxWidth,minWidth:o.minWidth,onColumnResize:l,rowIndex:e,columnKey:o.columnKey,width:o.width,left:i,cell:o.cell})},_getColumnsWidth:function(e){for(var t=0,o=0;o=0||Object.prototype.hasOwnProperty.call(e,i)&&(o[i]=e[i]);return o}var n=o(65),r=o(60),s=o(27),a=o(47),l=o(66),u=r.DIR_SIGN,h=s.PropTypes,c={align:"left",highlighted:!1},f=s.createClass({displayName:"FixedDataTableCell",propTypes_DISABLED_FOR_PERFORMANCE:{isScrolling:h.bool,align:h.oneOf(["left","center","right"]),className:h.string,highlighted:h.bool,width:h.number.isRequired,minWidth:h.number,maxWidth:h.number,height:h.number.isRequired,cell:h.oneOfType([h.string,h.element,h.func]),columnKey:h.oneOfType([h.string,h.number]),rowIndex:h.number.isRequired,onColumnResize:h.func,left:h.number},shouldComponentUpdate:function(e){return!e.isScrolling||this.props.rowIndex!==e.rowIndex},getDefaultProps:function(){return c},render:function(){var e=this.props,t=e.height,o=e.width,r=e.columnKey,h=i(e,["height","width","columnKey"]),c={height:t,width:o};1===u?c.left=h.left:c.right=h.left;var f,p=l(a({"fixedDataTableCellLayout/main":!0,"fixedDataTableCellLayout/lastChild":h.lastChild,"fixedDataTableCellLayout/alignRight":"right"===h.align,"fixedDataTableCellLayout/alignCenter":"center"===h.align,"public/fixedDataTableCell/alignRight":"right"===h.align,"public/fixedDataTableCell/highlighted":h.highlighted,"public/fixedDataTableCell/main":!0}),h.className);if(h.onColumnResize){var d={height:t};f=s.createElement("div",{className:a("fixedDataTableCellLayout/columnResizerContainer"),style:d,onMouseDown:this._onColumnResizerMouseDown},s.createElement("div",{className:l(a("fixedDataTableCellLayout/columnResizerKnob"),a("public/fixedDataTableCell/columnResizerKnob")),style:d}))}var m={columnKey:r,height:t,width:o};h.rowIndex>=0&&(m.rowIndex=h.rowIndex);var _;return _=s.isValidElement(h.cell)?s.cloneElement(h.cell,m):"function"==typeof h.cell?h.cell(m):s.createElement(n,m,h.cell),s.createElement("div",{className:p,style:c},f,_)},_onColumnResizerMouseDown:function(e){this.props.onColumnResize(this.props.left,this.props.width,this.props.minWidth,this.props.maxWidth,this.props.columnKey,e)}});e.exports=f},function(e,t,o){"use strict";function i(e,t){var o={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(o[i]=e[i]);return o}var n=Object.assign||function(e){for(var t=1;t1)for(var i=1;o>i;i++)t=arguments[i],t&&(e=(e?e+" ":"")+t);return e}e.exports=o},function(e,t,o){"use strict";var i=o(40),n=o(61),r=o(27),s=o(30),a=o(57),l=o(47),u=r.PropTypes,h=r.createClass({displayName:"FixedDataTableColumnResizeHandle",mixins:[s],propTypes:{visible:u.bool.isRequired,height:u.number.isRequired,leftOffset:u.number.isRequired,knobHeight:u.number.isRequired,initialWidth:u.number,minWidth:u.number,maxWidth:u.number,initialEvent:u.object,onColumnResizeEnd:u.func,columnKey:u.oneOfType([u.string,u.number])},getInitialState:function(){return{width:0,cursorDelta:0}},componentWillReceiveProps:function(e){e.initialEvent&&!this._mouseMoveTracker.isDragging()&&(this._mouseMoveTracker.captureMouseMoves(e.initialEvent),this.setState({width:e.initialWidth,cursorDelta:e.initialWidth}))},componentDidMount:function(){this._mouseMoveTracker=new i(this._onMove,this._onColumnResizeEnd,document.body)},componentWillUnmount:function(){this._mouseMoveTracker.releaseMouseMoves(),this._mouseMoveTracker=null},render:function(){var e={width:this.state.width,height:this.props.height};return n.isRTL()?e.right=this.props.leftOffset:e.left=this.props.leftOffset,r.createElement("div",{className:l({"fixedDataTableColumnResizerLineLayout/main":!0,"fixedDataTableColumnResizerLineLayout/hiddenElem":!this.props.visible,"public/fixedDataTableColumnResizerLine/main":!0}),style:e},r.createElement("div",{className:l("fixedDataTableColumnResizerLineLayout/mouseArea"),style:{height:this.props.height}}))},_onMove:function(e){n.isRTL()&&(e=-e);var t=this.state.cursorDelta+e,o=a(t,this.props.minWidth,this.props.maxWidth);this.setState({width:o,cursorDelta:t})},_onColumnResizeEnd:function(){this._mouseMoveTracker.releaseMouseMoves(),this.props.onColumnResizeEnd(this.state.width,this.props.columnKey)}});e.exports=h},function(e,t,o){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var o=0;oa;++a)this._storedHeights[a]=o;this._rowCount=t,this._position=0,this._contentHeight=t*o,this._defaultRowHeight=o,this._rowHeightGetter=s?s:function(){return o},this._viewportHeight=n,this.scrollRowIntoView=this.scrollRowIntoView.bind(this),this.setViewportHeight=this.setViewportHeight.bind(this),this.scrollBy=this.scrollBy.bind(this),this.scrollTo=this.scrollTo.bind(this),this.scrollToRow=this.scrollToRow.bind(this),this.setRowHeightGetter=this.setRowHeightGetter.bind(this),this.getContentHeight=this.getContentHeight.bind(this),this.getRowPosition=this.getRowPosition.bind(this),this._updateHeightsInViewport(0,0)}return n(e,[{key:"setRowHeightGetter",value:function(e){this._rowHeightGetter=e}},{key:"setViewportHeight",value:function(e){this._viewportHeight=e}},{key:"getContentHeight",value:function(){return this._contentHeight}},{key:"_updateHeightsInViewport",value:function(e,t){for(var o=t,i=e;o<=this._viewportHeight&&i=0&&t>=e-a;){var o=this._updateRowHeight(t);this._position+=o,t--}}},{key:"_updateRowHeight",value:function(e){if(0>e||e>=this._rowCount)return 0;var t=this._rowHeightGetter(e);if(t!==this._storedHeights[e]){var o=t-this._storedHeights[e];return this._rowOffsets.set(e,t),this._storedHeights[e]=t,this._contentHeight+=o,o}return 0}},{key:"getRowPosition",value:function(e){return this._updateRowHeight(e),this._rowOffsets.sumUntil(e)}},{key:"scrollBy",value:function(e){if(0===this._rowCount)return l;var t=this._rowOffsets.greatestLowerBound(this._position);t=s(t,0,Math.max(this._rowCount-1,0));var o=this._rowOffsets.sumUntil(t),i=t,n=this._position,r=this._updateRowHeight(i);0!==o&&(n+=r);var a=this._storedHeights[i]-(n-o);if(e>=0)for(;e>0&&ie?(n+=e,e=0):(e-=a,n+=a,i++),ie){e=-e;for(var u=this._storedHeights[i]-a;e>0&&i>=0;)if(u>e?(n-=e,e=0):(n-=u,e-=u,i--),i>=0){var h=this._updateRowHeight(i);u=this._storedHeights[i],n+=h}}var c=this._contentHeight-this._viewportHeight;n=s(n,0,c),this._position=n;var f=this._rowOffsets.greatestLowerBound(n);f=s(f,0,Math.max(this._rowCount-1,0)),o=this._rowOffsets.sumUntil(f);var p=o-n;return this._updateHeightsInViewport(f,p),this._updateHeightsAboveViewport(f),{index:f,offset:p,position:this._position,contentHeight:this._contentHeight}}},{key:"_getRowAtEndPosition",value:function(e){this._updateRowHeight(e);for(var t=e,o=this._storedHeights[t];o=0;)t--,t>=0&&(this._updateRowHeight(t),o+=this._storedHeights[t]);var i=this._rowOffsets.sumTo(e)-this._viewportHeight;return 0>i&&(i=0),i}},{key:"scrollTo",value:function(e){if(0===this._rowCount)return l;if(0>=e)return this._position=0,this._updateHeightsInViewport(0,0),{index:0,offset:0,position:this._position,contentHeight:this._contentHeight};if(e>=this._contentHeight-this._viewportHeight){var t=this._rowCount-1;e=this._getRowAtEndPosition(t)}this._position=e;var o=this._rowOffsets.greatestLowerBound(e);o=s(o,0,Math.max(this._rowCount-1,0));var i=this._rowOffsets.sumUntil(o),n=i-e;return this._updateHeightsInViewport(o,n),this._updateHeightsAboveViewport(o),{index:o,offset:n,position:this._position,contentHeight:this._contentHeight}}},{key:"scrollToRow",value:function(e,t){e=s(e,0,Math.max(this._rowCount-1,0)),t=s(t,-this._storedHeights[e],0);var o=this._rowOffsets.sumUntil(e);return this.scrollTo(o-t)}},{key:"scrollRowIntoView",value:function(e){e=s(e,0,Math.max(this._rowCount-1,0));var t=this._rowOffsets.sumUntil(e),o=t+this._storedHeights[e];if(tt;)t*=2;return t}var r=function(){function e(e,t){for(var o=0;o=0;--o)t[o]=0;return t},u=function(){function e(t){i(this,e),this._size=t.length,this._half=n(this._size),this._heap=new l(2*this._half);var o;for(o=0;o0;--o)this._heap[o]=this._heap[2*o]+this._heap[2*o+1]}return r(e,[{key:"set",value:function(e,t){s(e>=0&&e=0&&e=0&&e=0&&e=e,"Begin must precede end"),this.sumUntil(t)-this.sumUntil(e)}},{key:"greatestLowerBound",value:function(e){if(0>e)return-1;var t=1;if(this._heap[t]<=e)return this._size;for(;te?t=2*t:(t=2*t+1,e-=o)}return t-this._half}},{key:"greatestStrictLowerBound",value:function(e){if(0>=e)return-1;var t=1;if(this._heap[t]=e?t=2*t:(t=2*t+1,e-=o)}return t-this._half}},{key:"leastUpperBound",value:function(e){return this.greatestStrictLowerBound(e)+1}},{key:"leastStrictUpperBound",value:function(e){return this.greatestLowerBound(e)+1}}],[{key:"uniform",value:function(t,o){for(var i=[],n=t-1;n>=0;--n)i[n]=o;return new e(i)}},{key:"empty",value:function(t){return e.uniform(t,0)}}]),e}();e.exports=u}).call(t,function(){return this}())},function(e,t,o){"use strict";function i(e){for(var t=0,o=0;o=t)return{columns:e,width:i(e)};for(var o=n(e),r=t,s=[],a=0,u=0;ue&&this.state.scrollX>0||e>=0&&this.state.scrollXe&&this.state.scrollY>0||e>=0&&this.state.scrollYi?i:this.state.height>i&&this.props.ownerHeight?Math.max(i,this.props.ownerHeight):this.state.height+this.state.maxScrollY,e!==this._contentHeight&&this.props.onContentHeightChange&&this.props.onContentHeightChange(e),this._contentHeight=e},componentDidMount:function(){this._reportContentHeight()},componentWillReceiveProps:function(e){var t=e.scrollToRow;void 0!==t&&null!==t&&(this._rowToScrollTo=t);var o=e.scrollToColumn;void 0!==o&&null!==o&&(this._columnToScrollTo=o);var i=e.overflowX,n=e.overflowY;i===this.props.overflowX&&n===this.props.overflowY||(this._wheelHandler=new s(this._onWheel,"hidden"!==i,"hidden"!==n)),this.props.ownerHeight===e.ownerHeight&&this.props.scrollTop===e.scrollTop||this._didScrollStart(),this._didScrollStop(),this.setState(this._calculateState(e,this.state))},componentDidUpdate:function(){this._reportContentHeight()},render:function(){var e,t=this.state,o=this.props;t.useGroupHeader&&(e=n.createElement(h,{key:"group_header",isScrolling:this._isScrolling,className:w(p("fixedDataTableLayout/header"),p("public/fixedDataTable/header")),width:t.width,height:t.groupHeaderHeight,index:0,zIndex:1,offsetTop:0,scrollLeft:t.scrollX,fixedColumns:t.groupHeaderFixedColumns,scrollableColumns:t.groupHeaderScrollableColumns,onColumnResize:this._onColumnResize}));var i=this.state.maxScrollY,r=t.maxScrollX>0&&"hidden"!==t.overflowX,s=i>0&&"hidden"!==t.overflowY,l=r?a.SIZE:0,c=t.height-l-2*x-t.footerHeight,f=t.useGroupHeader?t.groupHeaderHeight:0,d=f+t.headerHeight;c-=d;var m=0,_=null!=o.maxHeight?d+t.bodyHeight:d+c,g=_+t.footerHeight;void 0!==o.ownerHeight&&o.ownerHeightt.ownerHeight||t.scrollY or "),o.push(e))});var n=!1;o.length&&o[0].type.__TableColumnGroup__&&(n=!0),t&&(void 0!==e.width&&e.width!==t.width||void 0!==e.height&&e.height!==t.height||void 0!==e.maxWidth&&e.maxWidth!==t.maxWidth||void 0!==e.maxHeight&&e.maxHeight!==t.maxHeight)&&(t=null);var r,s,l=t&&t.firstRowIndex||0,u=t&&t.firstRowOffset||0;r=t&&"hidden"!==e.overflowX?t.scrollX:e.scrollLeft,t&&"hidden"!==e.overflowY?s=t.scrollY:(d=this._scrollHelper.scrollTo(e.scrollTop),l=d.index,u=d.offset,s=d.position),void 0!==this._rowToScrollTo&&(d=this._scrollHelper.scrollRowIntoView(this._rowToScrollTo),l=d.index,u=d.offset,s=d.position,delete this._rowToScrollTo);var h=n?e.groupHeaderHeight:0;if(t&&e.rowsCount!==t.rowsCount){var p=(void 0===e.height?e.maxHeight:e.height)-(e.headerHeight||0)-(e.footerHeight||0)-(e.groupHeaderHeight||0);this._scrollHelper=new c(e.rowsCount,e.rowHeight,p,e.rowHeightGetter);var d=this._scrollHelper.scrollToRow(l,u);l=d.index,u=d.offset,s=d.position}else t&&e.rowHeightGetter!==t.rowHeightGetter&&this._scrollHelper.setRowHeightGetter(e.rowHeightGetter);var m;m=e.isColumnResizing?t&&t.columnResizingData:y;var w,g;if(n){var v=f.adjustColumnGroupWidths(o,e.width);w=v.columns,g=v.columnGroups}else w=f.adjustColumnWidths(o,e.width);var b=this._populateColumnsAndColumnData(w,g,t);if(void 0!==this._columnToScrollTo){var R=b.bodyFixedColumns.length;if(this._columnToScrollTo>=R){var T,H,S=0;for(T=0;TT;++T)H=b.bodyScrollableColumns[T],M+=H.props.width;var E=e.width-S,z=b.bodyScrollableColumns[D].props.width,k=M+z-E;k>r&&(r=k),r>M&&(r=M)}delete this._columnToScrollTo}var O=void 0===e.height,P=Math.round(O?e.maxHeight:e.height),N=e.footerHeight+e.headerHeight+h+2*x,I=P-N,L=this._scrollHelper.getContentHeight(),G=L+N,F=f.getTotalWidth(w),W=F>e.width&&"hidden"!==e.overflowX;W&&(I-=a.SIZE,G+=a.SIZE,N+=a.SIZE);var A=Math.max(0,F-e.width),V=Math.max(0,L-I);r=Math.min(r,A),s=Math.min(s,V),V||(O&&(P=G),I=G-N),this._scrollHelper.setViewportHeight(I);var X=i({isColumnResizing:t&&t.isColumnResizing},b,e,{columns:w,columnGroups:g,columnResizingData:m,firstRowIndex:l,firstRowOffset:u,horizontalScrollbarVisible:W,maxScrollX:A,maxScrollY:V,reservedHeight:N,scrollContentHeight:L,scrollX:r,scrollY:s,bodyHeight:I,height:P,groupHeaderHeight:h,useGroupHeader:n});return X},_selectColumnElement:function(e,t){for(var o=[],i=0;iMath.abs(e)&&"hidden"!==this.props.overflowY){var i=this._scrollHelper.scrollBy(Math.round(t)),n=Math.max(0,i.contentHeight-this.state.bodyHeight);this.setState({firstRowIndex:i.index,firstRowOffset:i.offset,scrollY:i.position,scrollContentHeight:i.contentHeight,maxScrollY:n})}else e&&"hidden"!==this.props.overflowX&&(o+=e,o=0>o?0:o,o=o>this.state.maxScrollX?this.state.maxScrollX:o,this.setState({scrollX:o}));this._didScrollStop()}},_onHorizontalScroll:function(e){this.isMounted()&&e!==this.state.scrollX&&(this._isScrolling||this._didScrollStart(),this.setState({scrollX:e}),this._didScrollStop())},_onVerticalScroll:function(e){if(this.isMounted()&&e!==this.state.scrollY){this._isScrolling||this._didScrollStart();var t=this._scrollHelper.scrollTo(Math.round(e));this.setState({firstRowIndex:t.index,firstRowOffset:t.offset,scrollY:t.position,scrollContentHeight:t.contentHeight}),this._didScrollStop()}},_didScrollStart:function(){this.isMounted()&&!this._isScrolling&&(this._isScrolling=!0,this.props.onScrollStart&&this.props.onScrollStart(this.state.scrollX,this.state.scrollY))},_didScrollStop:function(){this.isMounted()&&this._isScrolling&&(this._isScrolling=!1,this.setState({redraw:!0}),this.props.onScrollEnd&&this.props.onScrollEnd(this.state.scrollX,this.state.scrollY))}}),D=n.createClass({displayName:"HorizontalScrollbar",mixins:[r],propTypes:{contentSize:b.number.isRequired,offset:b.number.isRequired,onScroll:b.func.isRequired,position:b.number.isRequired,size:b.number.isRequired},render:function(){var e={height:a.SIZE,width:this.props.size},t={height:a.SIZE,position:"absolute",overflow:"hidden",width:this.props.size};return v(t,0,this.props.offset),n.createElement("div",{className:w(p("fixedDataTableLayout/horizontalScrollbar"),p("public/fixedDataTable/horizontalScrollbar")),style:e},n.createElement("div",{style:t},n.createElement(a,i({},this.props,{isOpaque:!0,orientation:"horizontal",offset:void 0}))))}});e.exports=S},function(e,t){"use strict";function o(e,t){if(e===t)return!0;var o;for(o in e)if(e.hasOwnProperty(o)&&(!t.hasOwnProperty(o)||e[o]!==t[o]))return!1;for(o in t)if(t.hasOwnProperty(o)&&!e.hasOwnProperty(o))return!1;return!0}var i={shouldComponentUpdate:function(e,t){return!o(this.props,e)||!o(this.state,t)}};e.exports=i},function(e,t,o){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var o=0;oi?-1:1),n&&!o&&(o=1>n?-1:1),{spinX:t,spinY:o,pixelX:i,pixelY:n}}var n=o(34),r=o(35),s=10,a=40,l=800;i.getEventType=function(){return n.firefox()?"DOMMouseScroll":r("wheel")?"wheel":"mousewheel"},e.exports=i},function(e,t){"use strict";function o(){if(!g){g=!0;var e=navigator.userAgent,t=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),o=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(d=/\b(iPhone|iP[ao]d)/.exec(e),m=/\b(iP[ao]d)/.exec(e),f=/Android/i.exec(e),_=/FBAN\/\w+;/i.exec(e),w=/Mobile/i.exec(e),p=!!/Win64/.exec(e),t){i=t[1]?parseFloat(t[1]):t[5]?parseFloat(t[5]):NaN,i&&document&&document.documentMode&&(i=document.documentMode);var v=/(?:Trident\/(\d+.\d+))/.exec(e);l=v?parseFloat(v[1])+4:i,n=t[2]?parseFloat(t[2]):NaN,r=t[3]?parseFloat(t[3]):NaN,s=t[4]?parseFloat(t[4]):NaN,s?(t=/(?:Chrome\/(\d+\.\d+))/.exec(e),a=t&&t[1]?parseFloat(t[1]):NaN):a=NaN}else i=n=r=a=s=NaN;if(o){if(o[1]){var b=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);u=b?parseFloat(b[1].replace("_",".")):!0}else u=!1;h=!!o[2],c=!!o[3]}else u=h=c=!1}}var i,n,r,s,a,l,u,h,c,f,p,d,m,_,w,g=!1,v={ie:function(){return o()||i},ieCompatibilityMode:function(){return o()||l>i},ie64:function(){return v.ie()&&p},firefox:function(){return o()||n},opera:function(){return o()||r},webkit:function(){return o()||s},safari:function(){return v.webkit()},chrome:function(){return o()||a},windows:function(){return o()||h},osx:function(){return o()||u},linux:function(){return o()||c},iphone:function(){return o()||d},mobile:function(){return o()||d||m||f||w},nativeApp:function(){return o()||_},android:function(){return o()||f},ipad:function(){return o()||m}};e.exports=v},function(e,t,o){"use strict";function i(e,t){if(!r.canUseDOM||t&&!("addEventListener"in document))return!1;var o="on"+e,i=o in document;if(!i){var s=document.createElement("div");s.setAttribute(o,"return;"),i="function"==typeof s[o]}return!i&&n&&"wheel"===e&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}var n,r=o(36);r.canUseDOM&&(n=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),e.exports=i},function(e,t){"use strict";var o=!("undefined"==typeof window||!window.document||!window.document.createElement),i={canUseDOM:o,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:o&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:o&&!!window.screen,isInWorker:!o};e.exports=i},function(e,t,o){(function(t){"use strict";var i=o(32),n=o(38),r=0,s=n||function(e){var o=Date.now(),i=Math.max(0,16-(o-r));return r=o+i,t.setTimeout(function(){e(Date.now())},i)};s(i),e.exports=s}).call(t,function(){return this}())},function(e,t){(function(t){"use strict";var o=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame;e.exports=o}).call(t,function(){return this}())},function(e,t,o){"use strict";var i=o(40),n=o(43),r=o(27),s=o(44),a=o(30),l=o(31),u=o(46),h=o(47),c=o(32),f=o(48),p=r.PropTypes,d={position:0,scrollable:!1},m=parseInt(u("scrollbar-face-margin"),10),_=2*m,w=30,g=40,v=null,b=r.createClass({displayName:"Scrollbar",mixins:[a],propTypes:{contentSize:p.number.isRequired,defaultPosition:p.number,isOpaque:p.bool,orientation:p.oneOf(["vertical","horizontal"]),onScroll:p.func,position:p.number,size:p.number.isRequired,trackColor:p.oneOf(["gray"]),zIndex:p.number,verticalTop:p.number},getInitialState:function(){var e=this.props;return this._calculateState(e.position||e.defaultPosition||0,e.size,e.contentSize,e.orientation)},componentWillReceiveProps:function(e){var t=e.position;void 0===t?this._setNextState(this._calculateState(this.state.position,e.size,e.contentSize,e.orientation)):this._setNextState(this._calculateState(t,e.size,e.contentSize,e.orientation),e)},getDefaultProps:function(){return{defaultPosition:0,isOpaque:!1,onScroll:c,orientation:"vertical",zIndex:99}},render:function(){if(!this.state.scrollable)return null;var e,t,o=this.props.size,i=this.state.isHorizontal,n=!i,s=this.state.focused||this.state.isDragging,a=this.state.faceSize,l=this.props.isOpaque,c=this.props.verticalTop||0,p=h({"ScrollbarLayout/main":!0,"ScrollbarLayout/mainVertical":n,"ScrollbarLayout/mainHorizontal":i,"public/Scrollbar/main":!0,"public/Scrollbar/mainOpaque":l,"public/Scrollbar/mainActive":s}),d=h({"ScrollbarLayout/face":!0,"ScrollbarLayout/faceHorizontal":i,"ScrollbarLayout/faceVertical":n,"public/Scrollbar/faceActive":s,"public/Scrollbar/face":!0}),w=this.state.position*this.state.scale+m;return i?(e={width:o},t={width:a-_},f(t,w,0)):(e={top:c,height:o},t={height:a-_},f(t,0,w)),e.zIndex=this.props.zIndex,"gray"===this.props.trackColor&&(e.backgroundColor=u("fbui-desktop-background-light")),r.createElement("div",{onFocus:this._onFocus,onBlur:this._onBlur,onKeyDown:this._onKeyDown,onMouseDown:this._onMouseDown,onWheel:this._wheelHandler.onWheel,className:p,style:e,tabIndex:0},r.createElement("div",{ref:"face",className:d,style:t}))},componentWillMount:function(){var e="horizontal"===this.props.orientation,t=e?this._onWheelX:this._onWheelY;this._wheelHandler=new l(t,this._shouldHandleX,this._shouldHandleY)},componentDidMount:function(){this._mouseMoveTracker=new i(this._onMouseMove,this._onMouseMoveEnd,document.documentElement),void 0!==this.props.position&&this.state.position!==this.props.position&&this._didScroll()},componentWillUnmount:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),v===this&&(v=null),delete this._mouseMoveTracker},scrollBy:function(e){this._onWheel(e)},_shouldHandleX:function(e){return"horizontal"===this.props.orientation?this._shouldHandleChange(e):!1},_shouldHandleY:function(e){return"horizontal"!==this.props.orientation?this._shouldHandleChange(e):!1},_shouldHandleChange:function(e){var t=this._calculateState(this.state.position+e,this.props.size,this.props.contentSize,this.props.orientation);return t.position!==this.state.position},_calculateState:function(e,t,o,i){if(1>t||t>=o)return d;var n=e+"_"+t+"_"+o+"_"+i;if(this._stateKey===n)return this._stateForKey;var r="horizontal"===i,s=t/o,a=t*s;w>a&&(s=(t-w)/(o-t),a=w);var l=!0,u=o-t;0>e?e=0:e>u&&(e=u);var h=this._mouseMoveTracker?this._mouseMoveTracker.isDragging():!1,c={faceSize:a,isDragging:h,isHorizontal:r,position:e,scale:s,scrollable:l};return this._stateKey=n,this._stateForKey=c,c},_onWheelY:function(e,t){this._onWheel(t)},_onWheelX:function(e,t){this._onWheel(e)},_onWheel:function(e){var t=this.props;this._setNextState(this._calculateState(this.state.position+e,t.size,t.contentSize,t.orientation))},_onMouseDown:function(e){var t;if(e.target!==s.findDOMNode(this.refs.face)){var o=e.nativeEvent,i=this.state.isHorizontal?o.offsetX||o.layerX:o.offsetY||o.layerY,n=this.props;i/=this.state.scale,t=this._calculateState(i-.5*this.state.faceSize/this.state.scale,n.size,n.contentSize,n.orientation)}else t={};t.focused=!0,this._setNextState(t),this._mouseMoveTracker.captureMouseMoves(e),s.findDOMNode(this).focus()},_onMouseMove:function(e,t){var o=this.props,i=this.state.isHorizontal?e:t;i/=this.state.scale,this._setNextState(this._calculateState(this.state.position+i,o.size,o.contentSize,o.orientation))},_onMouseMoveEnd:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),this.setState({isDragging:!1})},_onKeyDown:function(e){var t=e.keyCode;if(t!==n.TAB){var o=g,i=0;if(this.state.isHorizontal)switch(t){case n.HOME:i=-1,o=this.props.contentSize;break;case n.LEFT:i=-1;break;case n.RIGHT:i=1;break;default:return}if(!this.state.isHorizontal)switch(t){case n.SPACE:i=e.shiftKey?-1:1;break;case n.HOME:i=-1,o=this.props.contentSize;break;case n.UP:i=-1;break;case n.DOWN:i=1;break;case n.PAGE_UP:i=-1,o=this.props.size;break;case n.PAGE_DOWN:i=1,o=this.props.size;break;default:return}e.preventDefault();var r=this.props;this._setNextState(this._calculateState(this.state.position+o*i,r.size,r.contentSize,r.orientation))}},_onFocus:function(){this.setState({focused:!0})},_onBlur:function(){this.setState({focused:!1})},_blur:function(){if(this.isMounted())try{this._onBlur(),s.findDOMNode(this).blur()}catch(e){}},_setNextState:function(e,t){t=t||this.props;var o=t.position,i=this.state.position!==e.position;if(void 0===o){var n=i?this._didScroll:void 0;this.setState(e,n)}else{if(o!==e.position)return void(void 0!==e.position&&e.position!==this.state.position&&this.props.onScroll(e.position));this.setState(e)}i&&v!==this&&(v&&v._blur(),v=this)},_didScroll:function(){this.props.onScroll(this.state.position)}});b.KEYBOARD_SCROLL_AMOUNT=g,b.SIZE=parseInt(u("scrollbar-size"),10),e.exports=b},function(e,t,o){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var o=0;o0;)this._addRowToBuffer(t,this._viewportRowsBegin,this._viewportRowsEnd-1),t++,e--;return this._rows}},{key:"getRows",value:function(e,t){var o=t,i=o,n=e,r=Math.min(e+this._maxVisibleRowCount,this._rowsCount);for(this._viewportRowsBegin=e;r>n||i=r&&(i=this._bufferSet.replaceFurthestValuePosition(t,o,e)),null===i?(i=this._bufferSet.getNewPositionForValue(e),this._rows[i]=e):this._rows[i]=e}}]),e}();e.exports=h},function(e,t,o){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var o=0;o=e&&t>=n)return null;var r;e-i>n-t?(r=i,this._smallValues.pop()):(r=n,this._largeValues.pop());var a=this._valueToPositionMap[r];return delete this._valueToPositionMap[r],this._valueToPositionMap[o]=a,this._pushToHeaps(a,o),a}},{key:"_pushToHeaps",value:function(e,t){var o={position:e,value:t};this._smallValues.push(o),this._largeValues.push(o)}},{key:"_cleanHeaps",value:function(){this._cleanHeap(this._smallValues),this._cleanHeap(this._largeValues);var e=Math.min(this._smallValues.size(),this._largeValues.size()),t=Math.max(this._smallValues.size(),this._largeValues.size());t>10*e&&this._recreateHeaps()}},{key:"_recreateHeaps",value:function(){for(var e=this._smallValues.size()t.value}}]),e}();e.exports=a},function(e,t){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){return t>e}var n=function(){function e(e,t){for(var o=0;o0&&(this._items[0]=t,this._sinkDown(0)),e}}},{key:"push",value:function(e){this._items[this._size++]=e,this._bubbleUp(this._size-1)}},{key:"size",value:function(){return this._size}},{key:"peek",value:function(){return 0!==this._size?this._items[0]:void 0}},{key:"_heapify",value:function(){for(var e=Math.floor((this._size+1)/2);e>=0;e--)this._sinkDown(e)}},{key:"_bubbleUp",value:function(e){for(var t=this._items[e];e>0;){var o=Math.floor((e+1)/2)-1,i=this._items[o];if(this._comparator(i,t))return;this._items[o]=t,this._items[e]=i,e=o}}},{key:"_sinkDown",value:function(e){for(var t=this._items[e];;){var o=2*(e+1)-1,i=2*(e+1),n=-1;if(oe?t:e>o?o:e}e.exports=o},function(e,t,o){"use strict";var i=Object.assign||function(e){for(var t=1;t0){var t=s({"fixedDataTableRowLayout/fixedColumnsDivider":!0,"fixedDataTableRowLayout/columnsShadow":this.props.scrollLeft>0,"public/fixedDataTableRow/fixedColumnsDivider":!0,"public/fixedDataTableRow/columnsShadow":this.props.scrollLeft>0}),o={left:e,height:this.props.height};return n.createElement("div",{className:t,style:o})}},_onClick:function(e){this.props.onClick(e,this.props.index)},_onDoubleClick:function(e){this.props.onDoubleClick(e,this.props.index)},_onMouseDown:function(e){this.props.onMouseDown(e,this.props.index)},_onMouseEnter:function(e){this.props.onMouseEnter(e,this.props.index)},_onMouseLeave:function(e){this.props.onMouseLeave(e,this.props.index)}}),c=n.createClass({displayName:"FixedDataTableRow",propTypes:{isScrolling:u.bool,height:u.number.isRequired,zIndex:u.number,offsetTop:u.number.isRequired,width:u.number.isRequired},render:function(){var e={width:this.props.width,height:this.props.height,zIndex:this.props.zIndex?this.props.zIndex:0};return l(e,0,this.props.offsetTop),n.createElement("div",{style:e,className:s("fixedDataTableRowLayout/rowWrapper")},n.createElement(h,i({},this.props,{offsetTop:void 0,zIndex:void 0})))}});e.exports=c},function(e,t,o){"use strict";function i(e,t){var o={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(o[i]=e[i]);return o}var n=Object.assign||function(e){for(var t=1;tn;n++){var a=t[n].props;if(!a.allowCellsRecycling||i-e.left<=e.width&&i-e.left+a.width>=0){var h="cell_"+n;o[n]=this._renderCell(e.rowIndex,e.rowHeight,a,i,h)}i+=a.width}var f=this._getColumnsWidth(t),p={height:e.height,position:"absolute",width:f,zIndex:e.zIndex};return u(p,-1*c*e.left,0),s.createElement("div",{className:l("fixedDataTableCellGroupLayout/cellGroup"),style:p},o)},_renderCell:function(e,t,o,i,n){var r=o.isResizable&&this.props.onColumnResize,l=r?this.props.onColumnResize:null,u=o.cellClassName;return s.createElement(a,{isScrolling:this.props.isScrolling,align:o.align,className:u,height:t,key:n,maxWidth:o.maxWidth,minWidth:o.minWidth,onColumnResize:l,rowIndex:e,columnKey:o.columnKey,width:o.width,left:i,cell:o.cell})},_getColumnsWidth:function(e){for(var t=0,o=0;o=0||Object.prototype.hasOwnProperty.call(e,i)&&(o[i]=e[i]);return o}var n=o(65),r=o(60),s=o(27),a=o(47),l=o(66),u=r.DIR_SIGN,h=s.PropTypes,c={align:"left",highlighted:!1},f=s.createClass({displayName:"FixedDataTableCell",propTypes_DISABLED_FOR_PERFORMANCE:{isScrolling:h.bool,align:h.oneOf(["left","center","right"]),className:h.string,highlighted:h.bool,width:h.number.isRequired,minWidth:h.number,maxWidth:h.number,height:h.number.isRequired,cell:h.oneOfType([h.string,h.element,h.func]),columnKey:h.oneOfType([h.string,h.number]),rowIndex:h.number.isRequired,onColumnResize:h.func,left:h.number},shouldComponentUpdate:function(e){return!e.isScrolling||this.props.rowIndex!==e.rowIndex},getDefaultProps:function(){return c},render:function(){var e=this.props,t=e.height,o=e.width,r=e.columnKey,h=i(e,["height","width","columnKey"]),c={height:t,width:o};1===u?c.left=h.left:c.right=h.left;var f,p=l(a({"fixedDataTableCellLayout/main":!0,"fixedDataTableCellLayout/lastChild":h.lastChild,"fixedDataTableCellLayout/alignRight":"right"===h.align,"fixedDataTableCellLayout/alignCenter":"center"===h.align,"public/fixedDataTableCell/alignRight":"right"===h.align,"public/fixedDataTableCell/highlighted":h.highlighted,"public/fixedDataTableCell/main":!0}),h.className);if(h.onColumnResize){var d={height:t};f=s.createElement("div",{className:a("fixedDataTableCellLayout/columnResizerContainer"),style:d,onMouseDown:this._onColumnResizerMouseDown},s.createElement("div",{className:l(a("fixedDataTableCellLayout/columnResizerKnob"),a("public/fixedDataTableCell/columnResizerKnob")),style:d}))}var m={columnKey:r,height:t,width:o};h.rowIndex>=0&&(m.rowIndex=h.rowIndex);var _;return _=s.isValidElement(h.cell)?s.cloneElement(h.cell,m):"function"==typeof h.cell?h.cell(m):s.createElement(n,m,h.cell),s.createElement("div",{className:p,style:c},f,_)},_onColumnResizerMouseDown:function(e){this.props.onColumnResize(this.props.left,this.props.width,this.props.minWidth,this.props.maxWidth,this.props.columnKey,e)}});e.exports=f},function(e,t,o){"use strict";function i(e,t){var o={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(o[i]=e[i]);return o}var n=Object.assign||function(e){for(var t=1;t1)for(var i=1;o>i;i++)t=arguments[i],t&&(e=(e?e+" ":"")+t);return e}e.exports=o},function(e,t,o){"use strict";var i=o(40),n=o(61),r=o(27),s=o(30),a=o(57),l=o(47),u=r.PropTypes,h=r.createClass({displayName:"FixedDataTableColumnResizeHandle",mixins:[s],propTypes:{visible:u.bool.isRequired,height:u.number.isRequired,leftOffset:u.number.isRequired,knobHeight:u.number.isRequired,initialWidth:u.number,minWidth:u.number,maxWidth:u.number,initialEvent:u.object,onColumnResizeEnd:u.func,columnKey:u.oneOfType([u.string,u.number])},getInitialState:function(){return{width:0,cursorDelta:0}},componentWillReceiveProps:function(e){e.initialEvent&&!this._mouseMoveTracker.isDragging()&&(this._mouseMoveTracker.captureMouseMoves(e.initialEvent),this.setState({width:e.initialWidth,cursorDelta:e.initialWidth}))},componentDidMount:function(){this._mouseMoveTracker=new i(this._onMove,this._onColumnResizeEnd,document.body)},componentWillUnmount:function(){this._mouseMoveTracker.releaseMouseMoves(),this._mouseMoveTracker=null},render:function(){var e={width:this.state.width,height:this.props.height};return n.isRTL()?e.right=this.props.leftOffset:e.left=this.props.leftOffset,r.createElement("div",{className:l({"fixedDataTableColumnResizerLineLayout/main":!0,"fixedDataTableColumnResizerLineLayout/hiddenElem":!this.props.visible,"public/fixedDataTableColumnResizerLine/main":!0}),style:e},r.createElement("div",{className:l("fixedDataTableColumnResizerLineLayout/mouseArea"),style:{height:this.props.height}}))},_onMove:function(e){n.isRTL()&&(e=-e);var t=this.state.cursorDelta+e,o=a(t,this.props.minWidth,this.props.maxWidth);this.setState({width:o,cursorDelta:t})},_onColumnResizeEnd:function(){this._mouseMoveTracker.releaseMouseMoves(),this.props.onColumnResizeEnd(this.state.width,this.props.columnKey)}});e.exports=h},function(e,t,o){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var o=0;oa;++a)this._storedHeights[a]=o;this._rowCount=t,this._position=0,this._contentHeight=t*o,this._defaultRowHeight=o,this._rowHeightGetter=s?s:function(){return o},this._viewportHeight=n,this.scrollRowIntoView=this.scrollRowIntoView.bind(this),this.setViewportHeight=this.setViewportHeight.bind(this),this.scrollBy=this.scrollBy.bind(this),this.scrollTo=this.scrollTo.bind(this),this.scrollToRow=this.scrollToRow.bind(this),this.setRowHeightGetter=this.setRowHeightGetter.bind(this),this.getContentHeight=this.getContentHeight.bind(this),this.getRowPosition=this.getRowPosition.bind(this),this._updateHeightsInViewport(0,0)}return n(e,[{key:"setRowHeightGetter",value:function(e){this._rowHeightGetter=e}},{key:"setViewportHeight",value:function(e){this._viewportHeight=e}},{key:"getContentHeight",value:function(){return this._contentHeight}},{key:"_updateHeightsInViewport",value:function(e,t){for(var o=t,i=e;o<=this._viewportHeight&&i=0&&t>=e-a;){var o=this._updateRowHeight(t);this._position+=o,t--}}},{key:"_updateRowHeight",value:function(e){if(0>e||e>=this._rowCount)return 0;var t=this._rowHeightGetter(e);if(t!==this._storedHeights[e]){var o=t-this._storedHeights[e];return this._rowOffsets.set(e,t),this._storedHeights[e]=t,this._contentHeight+=o,o}return 0}},{key:"getRowPosition",value:function(e){return this._updateRowHeight(e),this._rowOffsets.sumUntil(e)}},{key:"scrollBy",value:function(e){if(0===this._rowCount)return l;var t=this._rowOffsets.greatestLowerBound(this._position);t=s(t,0,Math.max(this._rowCount-1,0));var o=this._rowOffsets.sumUntil(t),i=t,n=this._position,r=this._updateRowHeight(i);0!==o&&(n+=r);var a=this._storedHeights[i]-(n-o);if(e>=0)for(;e>0&&ie?(n+=e,e=0):(e-=a,n+=a,i++),ie){e=-e;for(var u=this._storedHeights[i]-a;e>0&&i>=0;)if(u>e?(n-=e,e=0):(n-=u,e-=u,i--),i>=0){var h=this._updateRowHeight(i);u=this._storedHeights[i],n+=h}}var c=this._contentHeight-this._viewportHeight;n=s(n,0,c),this._position=n;var f=this._rowOffsets.greatestLowerBound(n);f=s(f,0,Math.max(this._rowCount-1,0)),o=this._rowOffsets.sumUntil(f);var p=o-n;return this._updateHeightsInViewport(f,p),this._updateHeightsAboveViewport(f),{index:f,offset:p,position:this._position,contentHeight:this._contentHeight}}},{key:"_getRowAtEndPosition",value:function(e){this._updateRowHeight(e);for(var t=e,o=this._storedHeights[t];o=0;)t--,t>=0&&(this._updateRowHeight(t),o+=this._storedHeights[t]);var i=this._rowOffsets.sumTo(e)-this._viewportHeight;return 0>i&&(i=0),i}},{key:"scrollTo",value:function(e){if(0===this._rowCount)return l;if(0>=e)return this._position=0,this._updateHeightsInViewport(0,0),{index:0,offset:0,position:this._position,contentHeight:this._contentHeight};if(e>=this._contentHeight-this._viewportHeight){var t=this._rowCount-1;e=this._getRowAtEndPosition(t)}this._position=e;var o=this._rowOffsets.greatestLowerBound(e);o=s(o,0,Math.max(this._rowCount-1,0));var i=this._rowOffsets.sumUntil(o),n=i-e;return this._updateHeightsInViewport(o,n),this._updateHeightsAboveViewport(o),{index:o,offset:n,position:this._position,contentHeight:this._contentHeight}}},{key:"scrollToRow",value:function(e,t){e=s(e,0,Math.max(this._rowCount-1,0)),t=s(t,-this._storedHeights[e],0);var o=this._rowOffsets.sumUntil(e);return this.scrollTo(o-t)}},{key:"scrollRowIntoView",value:function(e){e=s(e,0,Math.max(this._rowCount-1,0));var t=this._rowOffsets.sumUntil(e),o=t+this._storedHeights[e];if(tt;)t*=2;return t}var r=function(){function e(e,t){for(var o=0;o=0;--o)t[o]=0;return t},u=function(){function e(t){i(this,e),this._size=t.length,this._half=n(this._size),this._heap=new l(2*this._half);var o;for(o=0;o0;--o)this._heap[o]=this._heap[2*o]+this._heap[2*o+1]}return r(e,[{key:"set",value:function(e,t){s(e>=0&&e=0&&e=0&&e=0&&e=e,"Begin must precede end"),this.sumUntil(t)-this.sumUntil(e)}},{key:"greatestLowerBound",value:function(e){if(0>e)return-1;var t=1;if(this._heap[t]<=e)return this._size;for(;te?t=2*t:(t=2*t+1,e-=o)}return t-this._half}},{key:"greatestStrictLowerBound",value:function(e){if(0>=e)return-1;var t=1;if(this._heap[t]=e?t=2*t:(t=2*t+1,e-=o)}return t-this._half}},{key:"leastUpperBound",value:function(e){return this.greatestStrictLowerBound(e)+1}},{key:"leastStrictUpperBound",value:function(e){return this.greatestLowerBound(e)+1}}],[{key:"uniform",value:function(t,o){for(var i=[],n=t-1;n>=0;--n)i[n]=o;return new e(i)}},{key:"empty",value:function(t){return e.uniform(t,0)}}]),e}();e.exports=u}).call(t,function(){return this}())},function(e,t,o){"use strict";function i(e){for(var t=0,o=0;o=t)return{columns:e,width:i(e)};for(var o=n(e),r=t,s=[],a=0,u=0;uo?r(e,t-o).columns:e}var l=o(27),u={getTotalWidth:i,getTotalFlexGrow:n,distributeFlexWidth:r,adjustColumnWidths:a,adjustColumnGroupWidths:s};e.exports=u},function(e,t){"use strict";function o(e,t,o,i,n){function r(){for(var n=arguments.length,a=Array(n),l=0;n>l;l++)a[l]=arguments[l];r.reset();var u=function(){e.apply(o,a)};u.__SMmeta=e.__SMmeta,s=i(u,t)}i=i||setTimeout,n=n||clearTimeout;var s;return r.reset=function(){n(s)},r}e.exports=o},function(e,t){"use strict";function o(e,t){if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var o=Object.keys(e),n=Object.keys(t);if(o.length!==n.length)return!1;for(var r=i.bind(t),s=0;s Date: Tue, 5 Jul 2016 15:23:13 -0700 Subject: [PATCH 09/43] Change react deps to work with 15.2.0 or what may come --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 9d7d4691..31b67479 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,11 @@ { "name": "@buildingconnected/fixed-data-table", - "version": "0.7.0", + "version": "0.7.1", "description": "A React table component designed to allow presenting thousands of rows of data.", "main": "main.js", "peerDependencies": { - "react": "15.0.x", - "react-dom": "15.0.x" + "react": "^15.0.0", + "react-dom": "^15.0.0" }, "devDependencies": { "autoprefixer": "^5.0.0", From f1b06baa9dd90264f321c0cd30e73d78f7c23dcf Mon Sep 17 00:00:00 2001 From: Al Urim Date: Tue, 5 Jul 2016 15:32:21 -0700 Subject: [PATCH 10/43] Version 0.7.2 --- dist/fixed-data-table-base.css | 2 +- dist/fixed-data-table-base.min.css | 2 +- dist/fixed-data-table-style.css | 2 +- dist/fixed-data-table-style.min.css | 2 +- dist/fixed-data-table.css | 2 +- dist/fixed-data-table.js | 2 +- dist/fixed-data-table.min.css | 2 +- dist/fixed-data-table.min.js | 6 +++--- package.json | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/dist/fixed-data-table-base.css b/dist/fixed-data-table-base.css index 7c86002f..c550436a 100644 --- a/dist/fixed-data-table-base.css +++ b/dist/fixed-data-table-base.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.0 + * FixedDataTable v0.7.2 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table-base.min.css b/dist/fixed-data-table-base.min.css index 70d9d500..772293ac 100644 --- a/dist/fixed-data-table-base.min.css +++ b/dist/fixed-data-table-base.min.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.0 + * FixedDataTable v0.7.2 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table-style.css b/dist/fixed-data-table-style.css index 00260981..f4f2bf60 100644 --- a/dist/fixed-data-table-style.css +++ b/dist/fixed-data-table-style.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.0 + * FixedDataTable v0.7.2 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table-style.min.css b/dist/fixed-data-table-style.min.css index 85237287..b6f8b867 100644 --- a/dist/fixed-data-table-style.min.css +++ b/dist/fixed-data-table-style.min.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.0 + * FixedDataTable v0.7.2 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table.css b/dist/fixed-data-table.css index 9f748e5b..11c330b0 100644 --- a/dist/fixed-data-table.css +++ b/dist/fixed-data-table.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.0 + * FixedDataTable v0.7.2 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table.js b/dist/fixed-data-table.js index f2ed68f1..387e2af7 100644 --- a/dist/fixed-data-table.js +++ b/dist/fixed-data-table.js @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.0 + * FixedDataTable v0.7.2 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table.min.css b/dist/fixed-data-table.min.css index 3243fd09..9a91fcae 100644 --- a/dist/fixed-data-table.min.css +++ b/dist/fixed-data-table.min.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.0 + * FixedDataTable v0.7.2 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table.min.js b/dist/fixed-data-table.min.js index 0f466734..246340c3 100644 --- a/dist/fixed-data-table.min.js +++ b/dist/fixed-data-table.min.js @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.0 + * FixedDataTable v0.7.2 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -9,6 +9,6 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.FixedDataTable=t(require("react"),require("react-dom")):e.FixedDataTable=t(e.React,e.ReactDOM)}(this,function(e,t){return function(e){function t(i){if(o[i])return o[i].exports;var n=o[i]={exports:{},id:i,loaded:!1};return e[i].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){o(1),o(5),o(7),o(9),o(11),o(13),o(15),o(17),o(19),o(21),o(23),e.exports=o(25)},function(e,t){},,,,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t,o){"use strict";var i=o(26),n=o(65),r=o(63),s=o(62),a={Cell:n,Column:r,ColumnGroup:s,Table:i};a.version="0.7.0",e.exports=a},function(e,t,o){"use strict";function i(e,t){}var n=Object.assign||function(e){for(var t=1;te&&this.state.scrollX>0||e>=0&&this.state.scrollXe&&this.state.scrollY>0||e>=0&&this.state.scrollYi?i:this.state.height>i&&this.props.ownerHeight?Math.max(i,this.props.ownerHeight):this.state.height+this.state.maxScrollY,e!==this._contentHeight&&this.props.onContentHeightChange&&this.props.onContentHeightChange(e),this._contentHeight=e},componentDidMount:function(){this._reportContentHeight()},componentWillReceiveProps:function(e){var t=e.scrollToRow;void 0!==t&&null!==t&&(this._rowToScrollTo=t);var o=e.scrollToColumn;void 0!==o&&null!==o&&(this._columnToScrollTo=o);var i=e.overflowX,n=e.overflowY;i===this.props.overflowX&&n===this.props.overflowY||(this._wheelHandler=new s(this._onWheel,"hidden"!==i,"hidden"!==n)),this.props.ownerHeight===e.ownerHeight&&this.props.scrollTop===e.scrollTop||this._didScrollStart(),this._didScrollStop(),this.setState(this._calculateState(e,this.state))},componentDidUpdate:function(){this._reportContentHeight()},render:function(){var e,t=this.state,o=this.props;t.useGroupHeader&&(e=n.createElement(h,{key:"group_header",isScrolling:this._isScrolling,className:w(p("fixedDataTableLayout/header"),p("public/fixedDataTable/header")),width:t.width,height:t.groupHeaderHeight,index:0,zIndex:1,offsetTop:0,scrollLeft:t.scrollX,fixedColumns:t.groupHeaderFixedColumns,scrollableColumns:t.groupHeaderScrollableColumns,onColumnResize:this._onColumnResize}));var i=this.state.maxScrollY,r=t.maxScrollX>0&&"hidden"!==t.overflowX,s=i>0&&"hidden"!==t.overflowY,l=r?a.SIZE:0,c=t.height-l-2*x-t.footerHeight,f=t.useGroupHeader?t.groupHeaderHeight:0,d=f+t.headerHeight;c-=d;var m=0,_=null!=o.maxHeight?d+t.bodyHeight:d+c,g=_+t.footerHeight;void 0!==o.ownerHeight&&o.ownerHeightt.ownerHeight||t.scrollY or "),o.push(e))});var n=!1;o.length&&o[0].type.__TableColumnGroup__&&(n=!0),t&&(void 0!==e.width&&e.width!==t.width||void 0!==e.height&&e.height!==t.height||void 0!==e.maxWidth&&e.maxWidth!==t.maxWidth||void 0!==e.maxHeight&&e.maxHeight!==t.maxHeight)&&(t=null);var r,s,l=t&&t.firstRowIndex||0,u=t&&t.firstRowOffset||0;r=t&&"hidden"!==e.overflowX?t.scrollX:e.scrollLeft,t&&"hidden"!==e.overflowY?s=t.scrollY:(d=this._scrollHelper.scrollTo(e.scrollTop),l=d.index,u=d.offset,s=d.position),void 0!==this._rowToScrollTo&&(d=this._scrollHelper.scrollRowIntoView(this._rowToScrollTo),l=d.index,u=d.offset,s=d.position,delete this._rowToScrollTo);var h=n?e.groupHeaderHeight:0;if(t&&e.rowsCount!==t.rowsCount){var p=(void 0===e.height?e.maxHeight:e.height)-(e.headerHeight||0)-(e.footerHeight||0)-(e.groupHeaderHeight||0);this._scrollHelper=new c(e.rowsCount,e.rowHeight,p,e.rowHeightGetter);var d=this._scrollHelper.scrollToRow(l,u);l=d.index,u=d.offset,s=d.position}else t&&e.rowHeightGetter!==t.rowHeightGetter&&this._scrollHelper.setRowHeightGetter(e.rowHeightGetter);var m;m=e.isColumnResizing?t&&t.columnResizingData:y;var w,g;if(n){var v=f.adjustColumnGroupWidths(o,e.width);w=v.columns,g=v.columnGroups}else w=f.adjustColumnWidths(o,e.width);var b=this._populateColumnsAndColumnData(w,g,t);if(void 0!==this._columnToScrollTo){var R=b.bodyFixedColumns.length;if(this._columnToScrollTo>=R){var T,H,S=0;for(T=0;TT;++T)H=b.bodyScrollableColumns[T],M+=H.props.width;var E=e.width-S,z=b.bodyScrollableColumns[D].props.width,k=M+z-E;k>r&&(r=k),r>M&&(r=M)}delete this._columnToScrollTo}var O=void 0===e.height,P=Math.round(O?e.maxHeight:e.height),N=e.footerHeight+e.headerHeight+h+2*x,I=P-N,L=this._scrollHelper.getContentHeight(),G=L+N,F=f.getTotalWidth(w),W=F>e.width&&"hidden"!==e.overflowX;W&&(I-=a.SIZE,G+=a.SIZE,N+=a.SIZE);var A=Math.max(0,F-e.width),V=Math.max(0,L-I);r=Math.min(r,A),s=Math.min(s,V),V||(O&&(P=G),I=G-N),this._scrollHelper.setViewportHeight(I);var X=i({isColumnResizing:t&&t.isColumnResizing},b,e,{columns:w,columnGroups:g,columnResizingData:m,firstRowIndex:l,firstRowOffset:u,horizontalScrollbarVisible:W,maxScrollX:A,maxScrollY:V,reservedHeight:N,scrollContentHeight:L,scrollX:r,scrollY:s,bodyHeight:I,height:P,groupHeaderHeight:h,useGroupHeader:n});return X},_selectColumnElement:function(e,t){for(var o=[],i=0;iMath.abs(e)&&"hidden"!==this.props.overflowY){var i=this._scrollHelper.scrollBy(Math.round(t)),n=Math.max(0,i.contentHeight-this.state.bodyHeight);this.setState({firstRowIndex:i.index,firstRowOffset:i.offset,scrollY:i.position,scrollContentHeight:i.contentHeight,maxScrollY:n})}else e&&"hidden"!==this.props.overflowX&&(o+=e,o=0>o?0:o,o=o>this.state.maxScrollX?this.state.maxScrollX:o,this.setState({scrollX:o}));this._didScrollStop()}},_onHorizontalScroll:function(e){this.isMounted()&&e!==this.state.scrollX&&(this._isScrolling||this._didScrollStart(),this.setState({scrollX:e}),this._didScrollStop())},_onVerticalScroll:function(e){if(this.isMounted()&&e!==this.state.scrollY){this._isScrolling||this._didScrollStart();var t=this._scrollHelper.scrollTo(Math.round(e));this.setState({firstRowIndex:t.index,firstRowOffset:t.offset,scrollY:t.position,scrollContentHeight:t.contentHeight}),this._didScrollStop()}},_didScrollStart:function(){this.isMounted()&&!this._isScrolling&&(this._isScrolling=!0,this.props.onScrollStart&&this.props.onScrollStart(this.state.scrollX,this.state.scrollY))},_didScrollStop:function(){this.isMounted()&&this._isScrolling&&(this._isScrolling=!1,this.setState({redraw:!0}),this.props.onScrollEnd&&this.props.onScrollEnd(this.state.scrollX,this.state.scrollY))}}),D=n.createClass({displayName:"HorizontalScrollbar",mixins:[r],propTypes:{contentSize:b.number.isRequired,offset:b.number.isRequired,onScroll:b.func.isRequired,position:b.number.isRequired,size:b.number.isRequired},render:function(){var e={height:a.SIZE,width:this.props.size},t={height:a.SIZE,position:"absolute",overflow:"hidden",width:this.props.size};return v(t,0,this.props.offset),n.createElement("div",{className:w(p("fixedDataTableLayout/horizontalScrollbar"),p("public/fixedDataTable/horizontalScrollbar")),style:e},n.createElement("div",{style:t},n.createElement(a,i({},this.props,{isOpaque:!0,orientation:"horizontal",offset:void 0}))))}});e.exports=S},function(e,t){"use strict";function o(e,t){if(e===t)return!0;var o;for(o in e)if(e.hasOwnProperty(o)&&(!t.hasOwnProperty(o)||e[o]!==t[o]))return!1;for(o in t)if(t.hasOwnProperty(o)&&!e.hasOwnProperty(o))return!1;return!0}var i={shouldComponentUpdate:function(e,t){return!o(this.props,e)||!o(this.state,t)}};e.exports=i},function(e,t,o){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var o=0;oi?-1:1),n&&!o&&(o=1>n?-1:1),{spinX:t,spinY:o,pixelX:i,pixelY:n}}var n=o(34),r=o(35),s=10,a=40,l=800;i.getEventType=function(){return n.firefox()?"DOMMouseScroll":r("wheel")?"wheel":"mousewheel"},e.exports=i},function(e,t){"use strict";function o(){if(!g){g=!0;var e=navigator.userAgent,t=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),o=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(d=/\b(iPhone|iP[ao]d)/.exec(e),m=/\b(iP[ao]d)/.exec(e),f=/Android/i.exec(e),_=/FBAN\/\w+;/i.exec(e),w=/Mobile/i.exec(e),p=!!/Win64/.exec(e),t){i=t[1]?parseFloat(t[1]):t[5]?parseFloat(t[5]):NaN,i&&document&&document.documentMode&&(i=document.documentMode);var v=/(?:Trident\/(\d+.\d+))/.exec(e);l=v?parseFloat(v[1])+4:i,n=t[2]?parseFloat(t[2]):NaN,r=t[3]?parseFloat(t[3]):NaN,s=t[4]?parseFloat(t[4]):NaN,s?(t=/(?:Chrome\/(\d+\.\d+))/.exec(e),a=t&&t[1]?parseFloat(t[1]):NaN):a=NaN}else i=n=r=a=s=NaN;if(o){if(o[1]){var b=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);u=b?parseFloat(b[1].replace("_",".")):!0}else u=!1;h=!!o[2],c=!!o[3]}else u=h=c=!1}}var i,n,r,s,a,l,u,h,c,f,p,d,m,_,w,g=!1,v={ie:function(){return o()||i},ieCompatibilityMode:function(){return o()||l>i},ie64:function(){return v.ie()&&p},firefox:function(){return o()||n},opera:function(){return o()||r},webkit:function(){return o()||s},safari:function(){return v.webkit()},chrome:function(){return o()||a},windows:function(){return o()||h},osx:function(){return o()||u},linux:function(){return o()||c},iphone:function(){return o()||d},mobile:function(){return o()||d||m||f||w},nativeApp:function(){return o()||_},android:function(){return o()||f},ipad:function(){return o()||m}};e.exports=v},function(e,t,o){"use strict";function i(e,t){if(!r.canUseDOM||t&&!("addEventListener"in document))return!1;var o="on"+e,i=o in document;if(!i){var s=document.createElement("div");s.setAttribute(o,"return;"),i="function"==typeof s[o]}return!i&&n&&"wheel"===e&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}var n,r=o(36);r.canUseDOM&&(n=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),e.exports=i},function(e,t){"use strict";var o=!("undefined"==typeof window||!window.document||!window.document.createElement),i={canUseDOM:o,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:o&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:o&&!!window.screen,isInWorker:!o};e.exports=i},function(e,t,o){(function(t){"use strict";var i=o(32),n=o(38),r=0,s=n||function(e){var o=Date.now(),i=Math.max(0,16-(o-r));return r=o+i,t.setTimeout(function(){e(Date.now())},i)};s(i),e.exports=s}).call(t,function(){return this}())},function(e,t){(function(t){"use strict";var o=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame;e.exports=o}).call(t,function(){return this}())},function(e,t,o){"use strict";var i=o(40),n=o(43),r=o(27),s=o(44),a=o(30),l=o(31),u=o(46),h=o(47),c=o(32),f=o(48),p=r.PropTypes,d={position:0,scrollable:!1},m=parseInt(u("scrollbar-face-margin"),10),_=2*m,w=30,g=40,v=null,b=r.createClass({displayName:"Scrollbar",mixins:[a],propTypes:{contentSize:p.number.isRequired,defaultPosition:p.number,isOpaque:p.bool,orientation:p.oneOf(["vertical","horizontal"]),onScroll:p.func,position:p.number,size:p.number.isRequired,trackColor:p.oneOf(["gray"]),zIndex:p.number,verticalTop:p.number},getInitialState:function(){var e=this.props;return this._calculateState(e.position||e.defaultPosition||0,e.size,e.contentSize,e.orientation)},componentWillReceiveProps:function(e){var t=e.position;void 0===t?this._setNextState(this._calculateState(this.state.position,e.size,e.contentSize,e.orientation)):this._setNextState(this._calculateState(t,e.size,e.contentSize,e.orientation),e)},getDefaultProps:function(){return{defaultPosition:0,isOpaque:!1,onScroll:c,orientation:"vertical",zIndex:99}},render:function(){if(!this.state.scrollable)return null;var e,t,o=this.props.size,i=this.state.isHorizontal,n=!i,s=this.state.focused||this.state.isDragging,a=this.state.faceSize,l=this.props.isOpaque,c=this.props.verticalTop||0,p=h({"ScrollbarLayout/main":!0,"ScrollbarLayout/mainVertical":n,"ScrollbarLayout/mainHorizontal":i,"public/Scrollbar/main":!0,"public/Scrollbar/mainOpaque":l,"public/Scrollbar/mainActive":s}),d=h({"ScrollbarLayout/face":!0,"ScrollbarLayout/faceHorizontal":i,"ScrollbarLayout/faceVertical":n,"public/Scrollbar/faceActive":s,"public/Scrollbar/face":!0}),w=this.state.position*this.state.scale+m;return i?(e={width:o},t={width:a-_},f(t,w,0)):(e={top:c,height:o},t={height:a-_},f(t,0,w)),e.zIndex=this.props.zIndex,"gray"===this.props.trackColor&&(e.backgroundColor=u("fbui-desktop-background-light")),r.createElement("div",{onFocus:this._onFocus,onBlur:this._onBlur,onKeyDown:this._onKeyDown,onMouseDown:this._onMouseDown,onWheel:this._wheelHandler.onWheel,className:p,style:e,tabIndex:0},r.createElement("div",{ref:"face",className:d,style:t}))},componentWillMount:function(){var e="horizontal"===this.props.orientation,t=e?this._onWheelX:this._onWheelY;this._wheelHandler=new l(t,this._shouldHandleX,this._shouldHandleY)},componentDidMount:function(){this._mouseMoveTracker=new i(this._onMouseMove,this._onMouseMoveEnd,document.documentElement),void 0!==this.props.position&&this.state.position!==this.props.position&&this._didScroll()},componentWillUnmount:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),v===this&&(v=null),delete this._mouseMoveTracker},scrollBy:function(e){this._onWheel(e)},_shouldHandleX:function(e){return"horizontal"===this.props.orientation?this._shouldHandleChange(e):!1},_shouldHandleY:function(e){return"horizontal"!==this.props.orientation?this._shouldHandleChange(e):!1},_shouldHandleChange:function(e){var t=this._calculateState(this.state.position+e,this.props.size,this.props.contentSize,this.props.orientation);return t.position!==this.state.position},_calculateState:function(e,t,o,i){if(1>t||t>=o)return d;var n=e+"_"+t+"_"+o+"_"+i;if(this._stateKey===n)return this._stateForKey;var r="horizontal"===i,s=t/o,a=t*s;w>a&&(s=(t-w)/(o-t),a=w);var l=!0,u=o-t;0>e?e=0:e>u&&(e=u);var h=this._mouseMoveTracker?this._mouseMoveTracker.isDragging():!1,c={faceSize:a,isDragging:h,isHorizontal:r,position:e,scale:s,scrollable:l};return this._stateKey=n,this._stateForKey=c,c},_onWheelY:function(e,t){this._onWheel(t)},_onWheelX:function(e,t){this._onWheel(e)},_onWheel:function(e){var t=this.props;this._setNextState(this._calculateState(this.state.position+e,t.size,t.contentSize,t.orientation))},_onMouseDown:function(e){var t;if(e.target!==s.findDOMNode(this.refs.face)){var o=e.nativeEvent,i=this.state.isHorizontal?o.offsetX||o.layerX:o.offsetY||o.layerY,n=this.props;i/=this.state.scale,t=this._calculateState(i-.5*this.state.faceSize/this.state.scale,n.size,n.contentSize,n.orientation)}else t={};t.focused=!0,this._setNextState(t),this._mouseMoveTracker.captureMouseMoves(e),s.findDOMNode(this).focus()},_onMouseMove:function(e,t){var o=this.props,i=this.state.isHorizontal?e:t;i/=this.state.scale,this._setNextState(this._calculateState(this.state.position+i,o.size,o.contentSize,o.orientation))},_onMouseMoveEnd:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),this.setState({isDragging:!1})},_onKeyDown:function(e){var t=e.keyCode;if(t!==n.TAB){var o=g,i=0;if(this.state.isHorizontal)switch(t){case n.HOME:i=-1,o=this.props.contentSize;break;case n.LEFT:i=-1;break;case n.RIGHT:i=1;break;default:return}if(!this.state.isHorizontal)switch(t){case n.SPACE:i=e.shiftKey?-1:1;break;case n.HOME:i=-1,o=this.props.contentSize;break;case n.UP:i=-1;break;case n.DOWN:i=1;break;case n.PAGE_UP:i=-1,o=this.props.size;break;case n.PAGE_DOWN:i=1,o=this.props.size;break;default:return}e.preventDefault();var r=this.props;this._setNextState(this._calculateState(this.state.position+o*i,r.size,r.contentSize,r.orientation))}},_onFocus:function(){this.setState({focused:!0})},_onBlur:function(){this.setState({focused:!1})},_blur:function(){if(this.isMounted())try{this._onBlur(),s.findDOMNode(this).blur()}catch(e){}},_setNextState:function(e,t){t=t||this.props;var o=t.position,i=this.state.position!==e.position;if(void 0===o){var n=i?this._didScroll:void 0;this.setState(e,n)}else{if(o!==e.position)return void(void 0!==e.position&&e.position!==this.state.position&&this.props.onScroll(e.position));this.setState(e)}i&&v!==this&&(v&&v._blur(),v=this)},_didScroll:function(){this.props.onScroll(this.state.position)}});b.KEYBOARD_SCROLL_AMOUNT=g,b.SIZE=parseInt(u("scrollbar-size"),10),e.exports=b},function(e,t,o){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var o=0;o0;)this._addRowToBuffer(t,this._viewportRowsBegin,this._viewportRowsEnd-1),t++,e--;return this._rows}},{key:"getRows",value:function(e,t){var o=t,i=o,n=e,r=Math.min(e+this._maxVisibleRowCount,this._rowsCount);for(this._viewportRowsBegin=e;r>n||i=r&&(i=this._bufferSet.replaceFurthestValuePosition(t,o,e)),null===i?(i=this._bufferSet.getNewPositionForValue(e),this._rows[i]=e):this._rows[i]=e}}]),e}();e.exports=h},function(e,t,o){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var o=0;o=e&&t>=n)return null;var r;e-i>n-t?(r=i,this._smallValues.pop()):(r=n,this._largeValues.pop());var a=this._valueToPositionMap[r];return delete this._valueToPositionMap[r],this._valueToPositionMap[o]=a,this._pushToHeaps(a,o),a}},{key:"_pushToHeaps",value:function(e,t){var o={position:e,value:t};this._smallValues.push(o),this._largeValues.push(o)}},{key:"_cleanHeaps",value:function(){this._cleanHeap(this._smallValues),this._cleanHeap(this._largeValues);var e=Math.min(this._smallValues.size(),this._largeValues.size()),t=Math.max(this._smallValues.size(),this._largeValues.size());t>10*e&&this._recreateHeaps()}},{key:"_recreateHeaps",value:function(){for(var e=this._smallValues.size()t.value}}]),e}();e.exports=a},function(e,t){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){return t>e}var n=function(){function e(e,t){for(var o=0;o0&&(this._items[0]=t,this._sinkDown(0)),e}}},{key:"push",value:function(e){this._items[this._size++]=e,this._bubbleUp(this._size-1)}},{key:"size",value:function(){return this._size}},{key:"peek",value:function(){return 0!==this._size?this._items[0]:void 0}},{key:"_heapify",value:function(){for(var e=Math.floor((this._size+1)/2);e>=0;e--)this._sinkDown(e)}},{key:"_bubbleUp",value:function(e){for(var t=this._items[e];e>0;){var o=Math.floor((e+1)/2)-1,i=this._items[o];if(this._comparator(i,t))return;this._items[o]=t,this._items[e]=i,e=o}}},{key:"_sinkDown",value:function(e){for(var t=this._items[e];;){var o=2*(e+1)-1,i=2*(e+1),n=-1;if(oe?t:e>o?o:e}e.exports=o},function(e,t,o){"use strict";var i=Object.assign||function(e){for(var t=1;t0){var t=s({"fixedDataTableRowLayout/fixedColumnsDivider":!0,"fixedDataTableRowLayout/columnsShadow":this.props.scrollLeft>0,"public/fixedDataTableRow/fixedColumnsDivider":!0,"public/fixedDataTableRow/columnsShadow":this.props.scrollLeft>0}),o={left:e,height:this.props.height};return n.createElement("div",{className:t,style:o})}},_onClick:function(e){this.props.onClick(e,this.props.index)},_onDoubleClick:function(e){this.props.onDoubleClick(e,this.props.index)},_onMouseDown:function(e){this.props.onMouseDown(e,this.props.index)},_onMouseEnter:function(e){this.props.onMouseEnter(e,this.props.index)},_onMouseLeave:function(e){this.props.onMouseLeave(e,this.props.index)}}),c=n.createClass({displayName:"FixedDataTableRow",propTypes:{isScrolling:u.bool,height:u.number.isRequired,zIndex:u.number,offsetTop:u.number.isRequired,width:u.number.isRequired},render:function(){var e={width:this.props.width,height:this.props.height,zIndex:this.props.zIndex?this.props.zIndex:0};return l(e,0,this.props.offsetTop),n.createElement("div",{style:e,className:s("fixedDataTableRowLayout/rowWrapper")},n.createElement(h,i({},this.props,{offsetTop:void 0,zIndex:void 0})))}});e.exports=c},function(e,t,o){"use strict";function i(e,t){var o={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(o[i]=e[i]);return o}var n=Object.assign||function(e){for(var t=1;tn;n++){var a=t[n].props;if(!a.allowCellsRecycling||i-e.left<=e.width&&i-e.left+a.width>=0){var h="cell_"+n;o[n]=this._renderCell(e.rowIndex,e.rowHeight,a,i,h)}i+=a.width}var f=this._getColumnsWidth(t),p={height:e.height,position:"absolute",width:f,zIndex:e.zIndex};return u(p,-1*c*e.left,0),s.createElement("div",{className:l("fixedDataTableCellGroupLayout/cellGroup"),style:p},o)},_renderCell:function(e,t,o,i,n){var r=o.isResizable&&this.props.onColumnResize,l=r?this.props.onColumnResize:null,u=o.cellClassName;return s.createElement(a,{isScrolling:this.props.isScrolling,align:o.align,className:u,height:t,key:n,maxWidth:o.maxWidth,minWidth:o.minWidth,onColumnResize:l,rowIndex:e,columnKey:o.columnKey,width:o.width,left:i,cell:o.cell})},_getColumnsWidth:function(e){for(var t=0,o=0;o=0||Object.prototype.hasOwnProperty.call(e,i)&&(o[i]=e[i]);return o}var n=o(65),r=o(60),s=o(27),a=o(47),l=o(66),u=r.DIR_SIGN,h=s.PropTypes,c={align:"left",highlighted:!1},f=s.createClass({displayName:"FixedDataTableCell",propTypes_DISABLED_FOR_PERFORMANCE:{isScrolling:h.bool,align:h.oneOf(["left","center","right"]),className:h.string,highlighted:h.bool,width:h.number.isRequired,minWidth:h.number,maxWidth:h.number,height:h.number.isRequired,cell:h.oneOfType([h.string,h.element,h.func]),columnKey:h.oneOfType([h.string,h.number]),rowIndex:h.number.isRequired,onColumnResize:h.func,left:h.number},shouldComponentUpdate:function(e){return!e.isScrolling||this.props.rowIndex!==e.rowIndex},getDefaultProps:function(){return c},render:function(){var e=this.props,t=e.height,o=e.width,r=e.columnKey,h=i(e,["height","width","columnKey"]),c={height:t,width:o};1===u?c.left=h.left:c.right=h.left;var f,p=l(a({"fixedDataTableCellLayout/main":!0,"fixedDataTableCellLayout/lastChild":h.lastChild,"fixedDataTableCellLayout/alignRight":"right"===h.align,"fixedDataTableCellLayout/alignCenter":"center"===h.align,"public/fixedDataTableCell/alignRight":"right"===h.align,"public/fixedDataTableCell/highlighted":h.highlighted,"public/fixedDataTableCell/main":!0}),h.className);if(h.onColumnResize){var d={height:t};f=s.createElement("div",{className:a("fixedDataTableCellLayout/columnResizerContainer"),style:d,onMouseDown:this._onColumnResizerMouseDown},s.createElement("div",{className:l(a("fixedDataTableCellLayout/columnResizerKnob"),a("public/fixedDataTableCell/columnResizerKnob")),style:d}))}var m={columnKey:r,height:t,width:o};h.rowIndex>=0&&(m.rowIndex=h.rowIndex);var _;return _=s.isValidElement(h.cell)?s.cloneElement(h.cell,m):"function"==typeof h.cell?h.cell(m):s.createElement(n,m,h.cell),s.createElement("div",{className:p,style:c},f,_)},_onColumnResizerMouseDown:function(e){this.props.onColumnResize(this.props.left,this.props.width,this.props.minWidth,this.props.maxWidth,this.props.columnKey,e)}});e.exports=f},function(e,t,o){"use strict";function i(e,t){var o={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(o[i]=e[i]);return o}var n=Object.assign||function(e){for(var t=1;t1)for(var i=1;o>i;i++)t=arguments[i],t&&(e=(e?e+" ":"")+t);return e}e.exports=o},function(e,t,o){"use strict";var i=o(40),n=o(61),r=o(27),s=o(30),a=o(57),l=o(47),u=r.PropTypes,h=r.createClass({displayName:"FixedDataTableColumnResizeHandle",mixins:[s],propTypes:{visible:u.bool.isRequired,height:u.number.isRequired,leftOffset:u.number.isRequired,knobHeight:u.number.isRequired,initialWidth:u.number,minWidth:u.number,maxWidth:u.number,initialEvent:u.object,onColumnResizeEnd:u.func,columnKey:u.oneOfType([u.string,u.number])},getInitialState:function(){return{width:0,cursorDelta:0}},componentWillReceiveProps:function(e){e.initialEvent&&!this._mouseMoveTracker.isDragging()&&(this._mouseMoveTracker.captureMouseMoves(e.initialEvent),this.setState({width:e.initialWidth,cursorDelta:e.initialWidth}))},componentDidMount:function(){this._mouseMoveTracker=new i(this._onMove,this._onColumnResizeEnd,document.body)},componentWillUnmount:function(){this._mouseMoveTracker.releaseMouseMoves(),this._mouseMoveTracker=null},render:function(){var e={width:this.state.width,height:this.props.height};return n.isRTL()?e.right=this.props.leftOffset:e.left=this.props.leftOffset,r.createElement("div",{className:l({"fixedDataTableColumnResizerLineLayout/main":!0,"fixedDataTableColumnResizerLineLayout/hiddenElem":!this.props.visible,"public/fixedDataTableColumnResizerLine/main":!0}),style:e},r.createElement("div",{className:l("fixedDataTableColumnResizerLineLayout/mouseArea"),style:{height:this.props.height}}))},_onMove:function(e){n.isRTL()&&(e=-e);var t=this.state.cursorDelta+e,o=a(t,this.props.minWidth,this.props.maxWidth);this.setState({width:o,cursorDelta:t})},_onColumnResizeEnd:function(){this._mouseMoveTracker.releaseMouseMoves(),this.props.onColumnResizeEnd(this.state.width,this.props.columnKey)}});e.exports=h},function(e,t,o){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var o=0;oa;++a)this._storedHeights[a]=o;this._rowCount=t,this._position=0,this._contentHeight=t*o,this._defaultRowHeight=o,this._rowHeightGetter=s?s:function(){return o},this._viewportHeight=n,this.scrollRowIntoView=this.scrollRowIntoView.bind(this),this.setViewportHeight=this.setViewportHeight.bind(this),this.scrollBy=this.scrollBy.bind(this),this.scrollTo=this.scrollTo.bind(this),this.scrollToRow=this.scrollToRow.bind(this),this.setRowHeightGetter=this.setRowHeightGetter.bind(this),this.getContentHeight=this.getContentHeight.bind(this),this.getRowPosition=this.getRowPosition.bind(this),this._updateHeightsInViewport(0,0)}return n(e,[{key:"setRowHeightGetter",value:function(e){this._rowHeightGetter=e}},{key:"setViewportHeight",value:function(e){this._viewportHeight=e}},{key:"getContentHeight",value:function(){return this._contentHeight}},{key:"_updateHeightsInViewport",value:function(e,t){for(var o=t,i=e;o<=this._viewportHeight&&i=0&&t>=e-a;){var o=this._updateRowHeight(t);this._position+=o,t--}}},{key:"_updateRowHeight",value:function(e){if(0>e||e>=this._rowCount)return 0;var t=this._rowHeightGetter(e);if(t!==this._storedHeights[e]){var o=t-this._storedHeights[e];return this._rowOffsets.set(e,t),this._storedHeights[e]=t,this._contentHeight+=o,o}return 0}},{key:"getRowPosition",value:function(e){return this._updateRowHeight(e),this._rowOffsets.sumUntil(e)}},{key:"scrollBy",value:function(e){if(0===this._rowCount)return l;var t=this._rowOffsets.greatestLowerBound(this._position);t=s(t,0,Math.max(this._rowCount-1,0));var o=this._rowOffsets.sumUntil(t),i=t,n=this._position,r=this._updateRowHeight(i);0!==o&&(n+=r);var a=this._storedHeights[i]-(n-o);if(e>=0)for(;e>0&&ie?(n+=e,e=0):(e-=a,n+=a,i++),ie){e=-e;for(var u=this._storedHeights[i]-a;e>0&&i>=0;)if(u>e?(n-=e,e=0):(n-=u,e-=u,i--),i>=0){var h=this._updateRowHeight(i);u=this._storedHeights[i],n+=h}}var c=this._contentHeight-this._viewportHeight;n=s(n,0,c),this._position=n;var f=this._rowOffsets.greatestLowerBound(n);f=s(f,0,Math.max(this._rowCount-1,0)),o=this._rowOffsets.sumUntil(f);var p=o-n;return this._updateHeightsInViewport(f,p),this._updateHeightsAboveViewport(f),{index:f,offset:p,position:this._position,contentHeight:this._contentHeight}}},{key:"_getRowAtEndPosition",value:function(e){this._updateRowHeight(e);for(var t=e,o=this._storedHeights[t];o=0;)t--,t>=0&&(this._updateRowHeight(t),o+=this._storedHeights[t]);var i=this._rowOffsets.sumTo(e)-this._viewportHeight;return 0>i&&(i=0),i}},{key:"scrollTo",value:function(e){if(0===this._rowCount)return l;if(0>=e)return this._position=0,this._updateHeightsInViewport(0,0),{index:0,offset:0,position:this._position,contentHeight:this._contentHeight};if(e>=this._contentHeight-this._viewportHeight){var t=this._rowCount-1;e=this._getRowAtEndPosition(t)}this._position=e;var o=this._rowOffsets.greatestLowerBound(e);o=s(o,0,Math.max(this._rowCount-1,0));var i=this._rowOffsets.sumUntil(o),n=i-e;return this._updateHeightsInViewport(o,n),this._updateHeightsAboveViewport(o),{index:o,offset:n,position:this._position,contentHeight:this._contentHeight}}},{key:"scrollToRow",value:function(e,t){e=s(e,0,Math.max(this._rowCount-1,0)),t=s(t,-this._storedHeights[e],0);var o=this._rowOffsets.sumUntil(e);return this.scrollTo(o-t)}},{key:"scrollRowIntoView",value:function(e){e=s(e,0,Math.max(this._rowCount-1,0));var t=this._rowOffsets.sumUntil(e),o=t+this._storedHeights[e];if(tt;)t*=2;return t}var r=function(){function e(e,t){for(var o=0;o=0;--o)t[o]=0;return t},u=function(){function e(t){i(this,e),this._size=t.length,this._half=n(this._size),this._heap=new l(2*this._half);var o;for(o=0;o0;--o)this._heap[o]=this._heap[2*o]+this._heap[2*o+1]}return r(e,[{key:"set",value:function(e,t){s(e>=0&&e=0&&e=0&&e=0&&e=e,"Begin must precede end"),this.sumUntil(t)-this.sumUntil(e)}},{key:"greatestLowerBound",value:function(e){if(0>e)return-1;var t=1;if(this._heap[t]<=e)return this._size;for(;te?t=2*t:(t=2*t+1,e-=o)}return t-this._half}},{key:"greatestStrictLowerBound",value:function(e){if(0>=e)return-1;var t=1;if(this._heap[t]=e?t=2*t:(t=2*t+1,e-=o)}return t-this._half}},{key:"leastUpperBound",value:function(e){return this.greatestStrictLowerBound(e)+1}},{key:"leastStrictUpperBound",value:function(e){return this.greatestLowerBound(e)+1}}],[{key:"uniform",value:function(t,o){for(var i=[],n=t-1;n>=0;--n)i[n]=o;return new e(i)}},{key:"empty",value:function(t){return e.uniform(t,0)}}]),e}();e.exports=u}).call(t,function(){return this}())},function(e,t,o){"use strict";function i(e){for(var t=0,o=0;o=t)return{columns:e,width:i(e)};for(var o=n(e),r=t,s=[],a=0,u=0;ue&&this.state.scrollX>0||e>=0&&this.state.scrollXe&&this.state.scrollY>0||e>=0&&this.state.scrollYi?i:this.state.height>i&&this.props.ownerHeight?Math.max(i,this.props.ownerHeight):this.state.height+this.state.maxScrollY,e!==this._contentHeight&&this.props.onContentHeightChange&&this.props.onContentHeightChange(e),this._contentHeight=e},componentDidMount:function(){this._reportContentHeight()},componentWillReceiveProps:function(e){var t=e.scrollToRow;void 0!==t&&null!==t&&(this._rowToScrollTo=t);var o=e.scrollToColumn;void 0!==o&&null!==o&&(this._columnToScrollTo=o);var i=e.overflowX,n=e.overflowY;(i!==this.props.overflowX||n!==this.props.overflowY)&&(this._wheelHandler=new s(this._onWheel,"hidden"!==i,"hidden"!==n)),(this.props.ownerHeight!==e.ownerHeight||this.props.scrollTop!==e.scrollTop)&&this._didScrollStart(),this._didScrollStop(),this.setState(this._calculateState(e,this.state))},componentDidUpdate:function(){this._reportContentHeight()},render:function(){var e,t=this.state,o=this.props;t.useGroupHeader&&(e=n.createElement(h,{key:"group_header",isScrolling:this._isScrolling,className:w(p("fixedDataTableLayout/header"),p("public/fixedDataTable/header")),width:t.width,height:t.groupHeaderHeight,index:0,zIndex:1,offsetTop:0,scrollLeft:t.scrollX,fixedColumns:t.groupHeaderFixedColumns,scrollableColumns:t.groupHeaderScrollableColumns,onColumnResize:this._onColumnResize}));var i=this.state.maxScrollY,r=t.maxScrollX>0&&"hidden"!==t.overflowX,s=i>0&&"hidden"!==t.overflowY,l=r?a.SIZE:0,c=t.height-l-2*x-t.footerHeight,f=t.useGroupHeader?t.groupHeaderHeight:0,d=f+t.headerHeight;c-=d;var m=0,_=null!=o.maxHeight?d+t.bodyHeight:d+c,g=_+t.footerHeight;void 0!==o.ownerHeight&&o.ownerHeightt.ownerHeight||t.scrollY or "),o.push(e))});var n=!1;o.length&&o[0].type.__TableColumnGroup__&&(n=!0),t&&(void 0!==e.width&&e.width!==t.width||void 0!==e.height&&e.height!==t.height||void 0!==e.maxWidth&&e.maxWidth!==t.maxWidth||void 0!==e.maxHeight&&e.maxHeight!==t.maxHeight)&&(t=null);var r,s,l=t&&t.firstRowIndex||0,u=t&&t.firstRowOffset||0;r=t&&"hidden"!==e.overflowX?t.scrollX:e.scrollLeft,t&&"hidden"!==e.overflowY?s=t.scrollY:(d=this._scrollHelper.scrollTo(e.scrollTop),l=d.index,u=d.offset,s=d.position),void 0!==this._rowToScrollTo&&(d=this._scrollHelper.scrollRowIntoView(this._rowToScrollTo),l=d.index,u=d.offset,s=d.position,delete this._rowToScrollTo);var h=n?e.groupHeaderHeight:0;if(t&&e.rowsCount!==t.rowsCount){var p=(void 0===e.height?e.maxHeight:e.height)-(e.headerHeight||0)-(e.footerHeight||0)-(e.groupHeaderHeight||0);this._scrollHelper=new c(e.rowsCount,e.rowHeight,p,e.rowHeightGetter);var d=this._scrollHelper.scrollToRow(l,u);l=d.index,u=d.offset,s=d.position}else t&&e.rowHeightGetter!==t.rowHeightGetter&&this._scrollHelper.setRowHeightGetter(e.rowHeightGetter);var m;m=e.isColumnResizing?t&&t.columnResizingData:y;var w,g;if(n){var v=f.adjustColumnGroupWidths(o,e.width);w=v.columns,g=v.columnGroups}else w=f.adjustColumnWidths(o,e.width);var b=this._populateColumnsAndColumnData(w,g,t);if(void 0!==this._columnToScrollTo){var R=b.bodyFixedColumns.length;if(this._columnToScrollTo>=R){var T,H,S=0;for(T=0;TT;++T)H=b.bodyScrollableColumns[T],M+=H.props.width;var E=e.width-S,z=b.bodyScrollableColumns[D].props.width,k=M+z-E;k>r&&(r=k),r>M&&(r=M)}delete this._columnToScrollTo}var O=void 0===e.height,P=Math.round(O?e.maxHeight:e.height),N=e.footerHeight+e.headerHeight+h+2*x,I=P-N,L=this._scrollHelper.getContentHeight(),G=L+N,F=f.getTotalWidth(w),W=F>e.width&&"hidden"!==e.overflowX;W&&(I-=a.SIZE,G+=a.SIZE,N+=a.SIZE);var A=Math.max(0,F-e.width),V=Math.max(0,L-I);r=Math.min(r,A),s=Math.min(s,V),V||(O&&(P=G),I=G-N),this._scrollHelper.setViewportHeight(I);var X=i({isColumnResizing:t&&t.isColumnResizing},b,e,{columns:w,columnGroups:g,columnResizingData:m,firstRowIndex:l,firstRowOffset:u,horizontalScrollbarVisible:W,maxScrollX:A,maxScrollY:V,reservedHeight:N,scrollContentHeight:L,scrollX:r,scrollY:s,bodyHeight:I,height:P,groupHeaderHeight:h,useGroupHeader:n});return X},_selectColumnElement:function(e,t){for(var o=[],i=0;iMath.abs(e)&&"hidden"!==this.props.overflowY){var i=this._scrollHelper.scrollBy(Math.round(t)),n=Math.max(0,i.contentHeight-this.state.bodyHeight);this.setState({firstRowIndex:i.index,firstRowOffset:i.offset,scrollY:i.position,scrollContentHeight:i.contentHeight,maxScrollY:n})}else e&&"hidden"!==this.props.overflowX&&(o+=e,o=0>o?0:o,o=o>this.state.maxScrollX?this.state.maxScrollX:o,this.setState({scrollX:o}));this._didScrollStop()}},_onHorizontalScroll:function(e){this.isMounted()&&e!==this.state.scrollX&&(this._isScrolling||this._didScrollStart(),this.setState({scrollX:e}),this._didScrollStop())},_onVerticalScroll:function(e){if(this.isMounted()&&e!==this.state.scrollY){this._isScrolling||this._didScrollStart();var t=this._scrollHelper.scrollTo(Math.round(e));this.setState({firstRowIndex:t.index,firstRowOffset:t.offset,scrollY:t.position,scrollContentHeight:t.contentHeight}),this._didScrollStop()}},_didScrollStart:function(){this.isMounted()&&!this._isScrolling&&(this._isScrolling=!0,this.props.onScrollStart&&this.props.onScrollStart(this.state.scrollX,this.state.scrollY))},_didScrollStop:function(){this.isMounted()&&this._isScrolling&&(this._isScrolling=!1,this.setState({redraw:!0}),this.props.onScrollEnd&&this.props.onScrollEnd(this.state.scrollX,this.state.scrollY))}}),D=n.createClass({displayName:"HorizontalScrollbar",mixins:[r],propTypes:{contentSize:b.number.isRequired,offset:b.number.isRequired,onScroll:b.func.isRequired,position:b.number.isRequired,size:b.number.isRequired},render:function(){var e={height:a.SIZE,width:this.props.size},t={height:a.SIZE,position:"absolute",overflow:"hidden",width:this.props.size};return v(t,0,this.props.offset),n.createElement("div",{className:w(p("fixedDataTableLayout/horizontalScrollbar"),p("public/fixedDataTable/horizontalScrollbar")),style:e},n.createElement("div",{style:t},n.createElement(a,i({},this.props,{isOpaque:!0,orientation:"horizontal",offset:void 0}))))}});e.exports=S},function(e,t){"use strict";function o(e,t){if(e===t)return!0;var o;for(o in e)if(e.hasOwnProperty(o)&&(!t.hasOwnProperty(o)||e[o]!==t[o]))return!1;for(o in t)if(t.hasOwnProperty(o)&&!e.hasOwnProperty(o))return!1;return!0}var i={shouldComponentUpdate:function(e,t){return!o(this.props,e)||!o(this.state,t)}};e.exports=i},function(e,t,o){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var o=0;oi?-1:1),n&&!o&&(o=1>n?-1:1),{spinX:t,spinY:o,pixelX:i,pixelY:n}}var n=o(34),r=o(35),s=10,a=40,l=800;i.getEventType=function(){return n.firefox()?"DOMMouseScroll":r("wheel")?"wheel":"mousewheel"},e.exports=i},function(e,t){"use strict";function o(){if(!g){g=!0;var e=navigator.userAgent,t=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),o=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(d=/\b(iPhone|iP[ao]d)/.exec(e),m=/\b(iP[ao]d)/.exec(e),f=/Android/i.exec(e),_=/FBAN\/\w+;/i.exec(e),w=/Mobile/i.exec(e),p=!!/Win64/.exec(e),t){i=t[1]?parseFloat(t[1]):t[5]?parseFloat(t[5]):NaN,i&&document&&document.documentMode&&(i=document.documentMode);var v=/(?:Trident\/(\d+.\d+))/.exec(e);l=v?parseFloat(v[1])+4:i,n=t[2]?parseFloat(t[2]):NaN,r=t[3]?parseFloat(t[3]):NaN,s=t[4]?parseFloat(t[4]):NaN,s?(t=/(?:Chrome\/(\d+\.\d+))/.exec(e),a=t&&t[1]?parseFloat(t[1]):NaN):a=NaN}else i=n=r=a=s=NaN;if(o){if(o[1]){var b=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);u=b?parseFloat(b[1].replace("_",".")):!0}else u=!1;h=!!o[2],c=!!o[3]}else u=h=c=!1}}var i,n,r,s,a,l,u,h,c,f,p,d,m,_,w,g=!1,v={ie:function(){return o()||i},ieCompatibilityMode:function(){return o()||l>i},ie64:function(){return v.ie()&&p},firefox:function(){return o()||n},opera:function(){return o()||r},webkit:function(){return o()||s},safari:function(){return v.webkit()},chrome:function(){return o()||a},windows:function(){return o()||h},osx:function(){return o()||u},linux:function(){return o()||c},iphone:function(){return o()||d},mobile:function(){return o()||d||m||f||w},nativeApp:function(){return o()||_},android:function(){return o()||f},ipad:function(){return o()||m}};e.exports=v},function(e,t,o){"use strict";function i(e,t){if(!r.canUseDOM||t&&!("addEventListener"in document))return!1;var o="on"+e,i=o in document;if(!i){var s=document.createElement("div");s.setAttribute(o,"return;"),i="function"==typeof s[o]}return!i&&n&&"wheel"===e&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}var n,r=o(36);r.canUseDOM&&(n=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),e.exports=i},function(e,t){"use strict";var o=!("undefined"==typeof window||!window.document||!window.document.createElement),i={canUseDOM:o,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:o&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:o&&!!window.screen,isInWorker:!o};e.exports=i},function(e,t,o){(function(t){"use strict";var i=o(32),n=o(38),r=0,s=n||function(e){var o=Date.now(),i=Math.max(0,16-(o-r));return r=o+i,t.setTimeout(function(){e(Date.now())},i)};s(i),e.exports=s}).call(t,function(){return this}())},function(e,t){(function(t){"use strict";var o=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame;e.exports=o}).call(t,function(){return this}())},function(e,t,o){"use strict";var i=o(40),n=o(43),r=o(27),s=o(44),a=o(30),l=o(31),u=o(46),h=o(47),c=o(32),f=o(48),p=r.PropTypes,d={position:0,scrollable:!1},m=parseInt(u("scrollbar-face-margin"),10),_=2*m,w=30,g=40,v=null,b=r.createClass({displayName:"Scrollbar",mixins:[a],propTypes:{contentSize:p.number.isRequired,defaultPosition:p.number,isOpaque:p.bool,orientation:p.oneOf(["vertical","horizontal"]),onScroll:p.func,position:p.number,size:p.number.isRequired,trackColor:p.oneOf(["gray"]),zIndex:p.number,verticalTop:p.number},getInitialState:function(){var e=this.props;return this._calculateState(e.position||e.defaultPosition||0,e.size,e.contentSize,e.orientation)},componentWillReceiveProps:function(e){var t=e.position;void 0===t?this._setNextState(this._calculateState(this.state.position,e.size,e.contentSize,e.orientation)):this._setNextState(this._calculateState(t,e.size,e.contentSize,e.orientation),e)},getDefaultProps:function(){return{defaultPosition:0,isOpaque:!1,onScroll:c,orientation:"vertical",zIndex:99}},render:function(){if(!this.state.scrollable)return null;var e,t,o=this.props.size,i=this.state.isHorizontal,n=!i,s=this.state.focused||this.state.isDragging,a=this.state.faceSize,l=this.props.isOpaque,c=this.props.verticalTop||0,p=h({"ScrollbarLayout/main":!0,"ScrollbarLayout/mainVertical":n,"ScrollbarLayout/mainHorizontal":i,"public/Scrollbar/main":!0,"public/Scrollbar/mainOpaque":l,"public/Scrollbar/mainActive":s}),d=h({"ScrollbarLayout/face":!0,"ScrollbarLayout/faceHorizontal":i,"ScrollbarLayout/faceVertical":n,"public/Scrollbar/faceActive":s,"public/Scrollbar/face":!0}),w=this.state.position*this.state.scale+m;return i?(e={width:o},t={width:a-_},f(t,w,0)):(e={top:c,height:o},t={height:a-_},f(t,0,w)),e.zIndex=this.props.zIndex,"gray"===this.props.trackColor&&(e.backgroundColor=u("fbui-desktop-background-light")),r.createElement("div",{onFocus:this._onFocus,onBlur:this._onBlur,onKeyDown:this._onKeyDown,onMouseDown:this._onMouseDown,onWheel:this._wheelHandler.onWheel,className:p,style:e,tabIndex:0},r.createElement("div",{ref:"face",className:d,style:t}))},componentWillMount:function(){var e="horizontal"===this.props.orientation,t=e?this._onWheelX:this._onWheelY;this._wheelHandler=new l(t,this._shouldHandleX,this._shouldHandleY)},componentDidMount:function(){this._mouseMoveTracker=new i(this._onMouseMove,this._onMouseMoveEnd,document.documentElement),void 0!==this.props.position&&this.state.position!==this.props.position&&this._didScroll()},componentWillUnmount:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),v===this&&(v=null),delete this._mouseMoveTracker},scrollBy:function(e){this._onWheel(e)},_shouldHandleX:function(e){return"horizontal"===this.props.orientation?this._shouldHandleChange(e):!1},_shouldHandleY:function(e){return"horizontal"!==this.props.orientation?this._shouldHandleChange(e):!1},_shouldHandleChange:function(e){var t=this._calculateState(this.state.position+e,this.props.size,this.props.contentSize,this.props.orientation);return t.position!==this.state.position},_calculateState:function(e,t,o,i){if(1>t||t>=o)return d;var n=e+"_"+t+"_"+o+"_"+i;if(this._stateKey===n)return this._stateForKey;var r="horizontal"===i,s=t/o,a=t*s;w>a&&(s=(t-w)/(o-t),a=w);var l=!0,u=o-t;0>e?e=0:e>u&&(e=u);var h=this._mouseMoveTracker?this._mouseMoveTracker.isDragging():!1,c={faceSize:a,isDragging:h,isHorizontal:r,position:e,scale:s,scrollable:l};return this._stateKey=n,this._stateForKey=c,c},_onWheelY:function(e,t){this._onWheel(t)},_onWheelX:function(e,t){this._onWheel(e)},_onWheel:function(e){var t=this.props;this._setNextState(this._calculateState(this.state.position+e,t.size,t.contentSize,t.orientation))},_onMouseDown:function(e){var t;if(e.target!==s.findDOMNode(this.refs.face)){var o=e.nativeEvent,i=this.state.isHorizontal?o.offsetX||o.layerX:o.offsetY||o.layerY,n=this.props;i/=this.state.scale,t=this._calculateState(i-.5*this.state.faceSize/this.state.scale,n.size,n.contentSize,n.orientation)}else t={};t.focused=!0,this._setNextState(t),this._mouseMoveTracker.captureMouseMoves(e),s.findDOMNode(this).focus()},_onMouseMove:function(e,t){var o=this.props,i=this.state.isHorizontal?e:t;i/=this.state.scale,this._setNextState(this._calculateState(this.state.position+i,o.size,o.contentSize,o.orientation))},_onMouseMoveEnd:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),this.setState({isDragging:!1})},_onKeyDown:function(e){var t=e.keyCode;if(t!==n.TAB){var o=g,i=0;if(this.state.isHorizontal)switch(t){case n.HOME:i=-1,o=this.props.contentSize;break;case n.LEFT:i=-1;break;case n.RIGHT:i=1;break;default:return}if(!this.state.isHorizontal)switch(t){case n.SPACE:i=e.shiftKey?-1:1;break;case n.HOME:i=-1,o=this.props.contentSize;break;case n.UP:i=-1;break;case n.DOWN:i=1;break;case n.PAGE_UP:i=-1,o=this.props.size;break;case n.PAGE_DOWN:i=1,o=this.props.size;break;default:return}e.preventDefault();var r=this.props;this._setNextState(this._calculateState(this.state.position+o*i,r.size,r.contentSize,r.orientation))}},_onFocus:function(){this.setState({focused:!0})},_onBlur:function(){this.setState({focused:!1})},_blur:function(){if(this.isMounted())try{this._onBlur(),s.findDOMNode(this).blur()}catch(e){}},_setNextState:function(e,t){t=t||this.props;var o=t.position,i=this.state.position!==e.position;if(void 0===o){var n=i?this._didScroll:void 0;this.setState(e,n)}else{if(o!==e.position)return void(void 0!==e.position&&e.position!==this.state.position&&this.props.onScroll(e.position));this.setState(e)}i&&v!==this&&(v&&v._blur(),v=this)},_didScroll:function(){this.props.onScroll(this.state.position)}});b.KEYBOARD_SCROLL_AMOUNT=g,b.SIZE=parseInt(u("scrollbar-size"),10),e.exports=b},function(e,t,o){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var o=0;o0;)this._addRowToBuffer(t,this._viewportRowsBegin,this._viewportRowsEnd-1),t++,e--;return this._rows}},{key:"getRows",value:function(e,t){var o=t,i=o,n=e,r=Math.min(e+this._maxVisibleRowCount,this._rowsCount);for(this._viewportRowsBegin=e;r>n||i=r&&(i=this._bufferSet.replaceFurthestValuePosition(t,o,e)),null===i?(i=this._bufferSet.getNewPositionForValue(e),this._rows[i]=e):this._rows[i]=e}}]),e}();e.exports=h},function(e,t,o){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var o=0;o=e&&t>=n)return null;var r;e-i>n-t?(r=i,this._smallValues.pop()):(r=n,this._largeValues.pop());var a=this._valueToPositionMap[r];return delete this._valueToPositionMap[r],this._valueToPositionMap[o]=a,this._pushToHeaps(a,o),a}},{key:"_pushToHeaps",value:function(e,t){var o={position:e,value:t};this._smallValues.push(o),this._largeValues.push(o)}},{key:"_cleanHeaps",value:function(){this._cleanHeap(this._smallValues),this._cleanHeap(this._largeValues);var e=Math.min(this._smallValues.size(),this._largeValues.size()),t=Math.max(this._smallValues.size(),this._largeValues.size());t>10*e&&this._recreateHeaps()}},{key:"_recreateHeaps",value:function(){for(var e=this._smallValues.size()t.value}}]),e}();e.exports=a},function(e,t){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){return t>e}var n=function(){function e(e,t){for(var o=0;o0&&(this._items[0]=t,this._sinkDown(0)),e}}},{key:"push",value:function(e){this._items[this._size++]=e,this._bubbleUp(this._size-1)}},{key:"size",value:function(){return this._size}},{key:"peek",value:function(){return 0!==this._size?this._items[0]:void 0}},{key:"_heapify",value:function(){for(var e=Math.floor((this._size+1)/2);e>=0;e--)this._sinkDown(e)}},{key:"_bubbleUp",value:function(e){for(var t=this._items[e];e>0;){var o=Math.floor((e+1)/2)-1,i=this._items[o];if(this._comparator(i,t))return;this._items[o]=t,this._items[e]=i,e=o}}},{key:"_sinkDown",value:function(e){for(var t=this._items[e];;){var o=2*(e+1)-1,i=2*(e+1),n=-1;if(oe?t:e>o?o:e}e.exports=o},function(e,t,o){"use strict";var i=Object.assign||function(e){for(var t=1;t0){var t=s({"fixedDataTableRowLayout/fixedColumnsDivider":!0,"fixedDataTableRowLayout/columnsShadow":this.props.scrollLeft>0,"public/fixedDataTableRow/fixedColumnsDivider":!0,"public/fixedDataTableRow/columnsShadow":this.props.scrollLeft>0}),o={left:e,height:this.props.height};return n.createElement("div",{className:t,style:o})}},_onClick:function(e){this.props.onClick(e,this.props.index)},_onDoubleClick:function(e){this.props.onDoubleClick(e,this.props.index)},_onMouseDown:function(e){this.props.onMouseDown(e,this.props.index)},_onMouseEnter:function(e){this.props.onMouseEnter(e,this.props.index)},_onMouseLeave:function(e){this.props.onMouseLeave(e,this.props.index)}}),c=n.createClass({displayName:"FixedDataTableRow",propTypes:{isScrolling:u.bool,height:u.number.isRequired,zIndex:u.number,offsetTop:u.number.isRequired,width:u.number.isRequired},render:function(){var e={width:this.props.width,height:this.props.height,zIndex:this.props.zIndex?this.props.zIndex:0};return l(e,0,this.props.offsetTop),n.createElement("div",{style:e,className:s("fixedDataTableRowLayout/rowWrapper")},n.createElement(h,i({},this.props,{offsetTop:void 0,zIndex:void 0})))}});e.exports=c},function(e,t,o){"use strict";function i(e,t){var o={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(o[i]=e[i]);return o}var n=Object.assign||function(e){for(var t=1;tn;n++){var a=t[n].props;if(!a.allowCellsRecycling||i-e.left<=e.width&&i-e.left+a.width>=0){var h="cell_"+n;o[n]=this._renderCell(e.rowIndex,e.rowHeight,a,i,h)}i+=a.width}var f=this._getColumnsWidth(t),p={height:e.height,position:"absolute",width:f,zIndex:e.zIndex};return u(p,-1*c*e.left,0),s.createElement("div",{className:l("fixedDataTableCellGroupLayout/cellGroup"),style:p},o)},_renderCell:function(e,t,o,i,n){var r=o.isResizable&&this.props.onColumnResize,l=r?this.props.onColumnResize:null,u=o.cellClassName;return s.createElement(a,{isScrolling:this.props.isScrolling,align:o.align,className:u,height:t,key:n,maxWidth:o.maxWidth,minWidth:o.minWidth,onColumnResize:l,rowIndex:e,columnKey:o.columnKey,width:o.width,left:i,cell:o.cell})},_getColumnsWidth:function(e){for(var t=0,o=0;o=0||Object.prototype.hasOwnProperty.call(e,i)&&(o[i]=e[i]);return o}var n=o(65),r=o(60),s=o(27),a=o(47),l=o(66),u=r.DIR_SIGN,h=s.PropTypes,c={align:"left",highlighted:!1},f=s.createClass({displayName:"FixedDataTableCell",propTypes_DISABLED_FOR_PERFORMANCE:{isScrolling:h.bool,align:h.oneOf(["left","center","right"]),className:h.string,highlighted:h.bool,width:h.number.isRequired,minWidth:h.number,maxWidth:h.number,height:h.number.isRequired,cell:h.oneOfType([h.string,h.element,h.func]),columnKey:h.oneOfType([h.string,h.number]),rowIndex:h.number.isRequired,onColumnResize:h.func,left:h.number},shouldComponentUpdate:function(e){return!e.isScrolling||this.props.rowIndex!==e.rowIndex},getDefaultProps:function(){return c},render:function(){var e=this.props,t=e.height,o=e.width,r=e.columnKey,h=i(e,["height","width","columnKey"]),c={height:t,width:o};1===u?c.left=h.left:c.right=h.left;var f,p=l(a({"fixedDataTableCellLayout/main":!0,"fixedDataTableCellLayout/lastChild":h.lastChild,"fixedDataTableCellLayout/alignRight":"right"===h.align,"fixedDataTableCellLayout/alignCenter":"center"===h.align,"public/fixedDataTableCell/alignRight":"right"===h.align,"public/fixedDataTableCell/highlighted":h.highlighted,"public/fixedDataTableCell/main":!0}),h.className);if(h.onColumnResize){var d={height:t};f=s.createElement("div",{className:a("fixedDataTableCellLayout/columnResizerContainer"),style:d,onMouseDown:this._onColumnResizerMouseDown},s.createElement("div",{className:l(a("fixedDataTableCellLayout/columnResizerKnob"),a("public/fixedDataTableCell/columnResizerKnob")),style:d}))}var m={columnKey:r,height:t,width:o};h.rowIndex>=0&&(m.rowIndex=h.rowIndex);var _;return _=s.isValidElement(h.cell)?s.cloneElement(h.cell,m):"function"==typeof h.cell?h.cell(m):s.createElement(n,m,h.cell),s.createElement("div",{className:p,style:c},f,_)},_onColumnResizerMouseDown:function(e){this.props.onColumnResize(this.props.left,this.props.width,this.props.minWidth,this.props.maxWidth,this.props.columnKey,e)}});e.exports=f},function(e,t,o){"use strict";function i(e,t){var o={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(o[i]=e[i]);return o}var n=Object.assign||function(e){for(var t=1;t1)for(var i=1;o>i;i++)t=arguments[i],t&&(e=(e?e+" ":"")+t);return e}e.exports=o},function(e,t,o){"use strict";var i=o(40),n=o(61),r=o(27),s=o(30),a=o(57),l=o(47),u=r.PropTypes,h=r.createClass({displayName:"FixedDataTableColumnResizeHandle",mixins:[s],propTypes:{visible:u.bool.isRequired,height:u.number.isRequired,leftOffset:u.number.isRequired,knobHeight:u.number.isRequired,initialWidth:u.number,minWidth:u.number,maxWidth:u.number,initialEvent:u.object,onColumnResizeEnd:u.func,columnKey:u.oneOfType([u.string,u.number])},getInitialState:function(){return{width:0,cursorDelta:0}},componentWillReceiveProps:function(e){e.initialEvent&&!this._mouseMoveTracker.isDragging()&&(this._mouseMoveTracker.captureMouseMoves(e.initialEvent),this.setState({width:e.initialWidth,cursorDelta:e.initialWidth}))},componentDidMount:function(){this._mouseMoveTracker=new i(this._onMove,this._onColumnResizeEnd,document.body)},componentWillUnmount:function(){this._mouseMoveTracker.releaseMouseMoves(),this._mouseMoveTracker=null},render:function(){var e={width:this.state.width,height:this.props.height};return n.isRTL()?e.right=this.props.leftOffset:e.left=this.props.leftOffset,r.createElement("div",{className:l({"fixedDataTableColumnResizerLineLayout/main":!0,"fixedDataTableColumnResizerLineLayout/hiddenElem":!this.props.visible,"public/fixedDataTableColumnResizerLine/main":!0}),style:e},r.createElement("div",{className:l("fixedDataTableColumnResizerLineLayout/mouseArea"),style:{height:this.props.height}}))},_onMove:function(e){n.isRTL()&&(e=-e);var t=this.state.cursorDelta+e,o=a(t,this.props.minWidth,this.props.maxWidth);this.setState({width:o,cursorDelta:t})},_onColumnResizeEnd:function(){this._mouseMoveTracker.releaseMouseMoves(),this.props.onColumnResizeEnd(this.state.width,this.props.columnKey)}});e.exports=h},function(e,t,o){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var o=0;oa;++a)this._storedHeights[a]=o;this._rowCount=t,this._position=0,this._contentHeight=t*o,this._defaultRowHeight=o,this._rowHeightGetter=s?s:function(){return o},this._viewportHeight=n,this.scrollRowIntoView=this.scrollRowIntoView.bind(this),this.setViewportHeight=this.setViewportHeight.bind(this),this.scrollBy=this.scrollBy.bind(this),this.scrollTo=this.scrollTo.bind(this),this.scrollToRow=this.scrollToRow.bind(this),this.setRowHeightGetter=this.setRowHeightGetter.bind(this),this.getContentHeight=this.getContentHeight.bind(this),this.getRowPosition=this.getRowPosition.bind(this),this._updateHeightsInViewport(0,0)}return n(e,[{key:"setRowHeightGetter",value:function(e){this._rowHeightGetter=e}},{key:"setViewportHeight",value:function(e){this._viewportHeight=e}},{key:"getContentHeight",value:function(){return this._contentHeight}},{key:"_updateHeightsInViewport",value:function(e,t){for(var o=t,i=e;o<=this._viewportHeight&&i=0&&t>=e-a;){var o=this._updateRowHeight(t);this._position+=o,t--}}},{key:"_updateRowHeight",value:function(e){if(0>e||e>=this._rowCount)return 0;var t=this._rowHeightGetter(e);if(t!==this._storedHeights[e]){var o=t-this._storedHeights[e];return this._rowOffsets.set(e,t),this._storedHeights[e]=t,this._contentHeight+=o,o}return 0}},{key:"getRowPosition",value:function(e){return this._updateRowHeight(e),this._rowOffsets.sumUntil(e)}},{key:"scrollBy",value:function(e){if(0===this._rowCount)return l;var t=this._rowOffsets.greatestLowerBound(this._position);t=s(t,0,Math.max(this._rowCount-1,0));var o=this._rowOffsets.sumUntil(t),i=t,n=this._position,r=this._updateRowHeight(i);0!==o&&(n+=r);var a=this._storedHeights[i]-(n-o);if(e>=0)for(;e>0&&ie?(n+=e,e=0):(e-=a,n+=a,i++),ie){e=-e;for(var u=this._storedHeights[i]-a;e>0&&i>=0;)if(u>e?(n-=e,e=0):(n-=u,e-=u,i--),i>=0){var h=this._updateRowHeight(i);u=this._storedHeights[i],n+=h}}var c=this._contentHeight-this._viewportHeight;n=s(n,0,c),this._position=n;var f=this._rowOffsets.greatestLowerBound(n);f=s(f,0,Math.max(this._rowCount-1,0)),o=this._rowOffsets.sumUntil(f);var p=o-n;return this._updateHeightsInViewport(f,p),this._updateHeightsAboveViewport(f),{index:f,offset:p,position:this._position,contentHeight:this._contentHeight}}},{key:"_getRowAtEndPosition",value:function(e){this._updateRowHeight(e);for(var t=e,o=this._storedHeights[t];o=0;)t--,t>=0&&(this._updateRowHeight(t),o+=this._storedHeights[t]);var i=this._rowOffsets.sumTo(e)-this._viewportHeight;return 0>i&&(i=0),i}},{key:"scrollTo",value:function(e){if(0===this._rowCount)return l;if(0>=e)return this._position=0,this._updateHeightsInViewport(0,0),{index:0,offset:0,position:this._position,contentHeight:this._contentHeight};if(e>=this._contentHeight-this._viewportHeight){var t=this._rowCount-1;e=this._getRowAtEndPosition(t)}this._position=e;var o=this._rowOffsets.greatestLowerBound(e);o=s(o,0,Math.max(this._rowCount-1,0));var i=this._rowOffsets.sumUntil(o),n=i-e;return this._updateHeightsInViewport(o,n),this._updateHeightsAboveViewport(o),{index:o,offset:n,position:this._position,contentHeight:this._contentHeight}}},{key:"scrollToRow",value:function(e,t){e=s(e,0,Math.max(this._rowCount-1,0)),t=s(t,-this._storedHeights[e],0);var o=this._rowOffsets.sumUntil(e);return this.scrollTo(o-t)}},{key:"scrollRowIntoView",value:function(e){e=s(e,0,Math.max(this._rowCount-1,0));var t=this._rowOffsets.sumUntil(e),o=t+this._storedHeights[e];if(tt;)t*=2;return t}var r=function(){function e(e,t){for(var o=0;o=0;--o)t[o]=0;return t},u=function(){function e(t){i(this,e),this._size=t.length,this._half=n(this._size),this._heap=new l(2*this._half);var o;for(o=0;o0;--o)this._heap[o]=this._heap[2*o]+this._heap[2*o+1]}return r(e,[{key:"set",value:function(e,t){s(e>=0&&e=0&&e=0&&e=0&&e=e,"Begin must precede end"),this.sumUntil(t)-this.sumUntil(e)}},{key:"greatestLowerBound",value:function(e){if(0>e)return-1;var t=1;if(this._heap[t]<=e)return this._size;for(;te?t=2*t:(t=2*t+1,e-=o)}return t-this._half}},{key:"greatestStrictLowerBound",value:function(e){if(0>=e)return-1;var t=1;if(this._heap[t]=e?t=2*t:(t=2*t+1,e-=o)}return t-this._half}},{key:"leastUpperBound",value:function(e){return this.greatestStrictLowerBound(e)+1}},{key:"leastStrictUpperBound",value:function(e){return this.greatestLowerBound(e)+1}}],[{key:"uniform",value:function(t,o){for(var i=[],n=t-1;n>=0;--n)i[n]=o;return new e(i)}},{key:"empty",value:function(t){return e.uniform(t,0)}}]),e}();e.exports=u}).call(t,function(){return this}())},function(e,t,o){"use strict";function i(e){for(var t=0,o=0;o=t)return{columns:e,width:i(e)};for(var o=n(e),r=t,s=[],a=0,u=0;uo?r(e,t-o).columns:e}var l=o(27),u={getTotalWidth:i,getTotalFlexGrow:n,distributeFlexWidth:r,adjustColumnWidths:a,adjustColumnGroupWidths:s};e.exports=u},function(e,t){"use strict";function o(e,t,o,i,n){function r(){for(var n=arguments.length,a=Array(n),l=0;n>l;l++)a[l]=arguments[l];r.reset();var u=function(){e.apply(o,a)};u.__SMmeta=e.__SMmeta,s=i(u,t)}i=i||setTimeout,n=n||clearTimeout;var s;return r.reset=function(){n(s)},r}e.exports=o},function(e,t){"use strict";function o(e,t){if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var o=Object.keys(e),n=Object.keys(t);if(o.length!==n.length)return!1;for(var r=i.bind(t),s=0;s Date: Mon, 29 Aug 2016 11:44:27 -0700 Subject: [PATCH 11/43] Take any react about 15 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 6e2ac5a4..7a1e71bc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@buildingconnected/fixed-data-table", - "version": "0.7.2", + "version": "0.7.3", "description": "A React table component designed to allow presenting thousands of rows of data.", "main": "main.js", "peerDependencies": { @@ -24,7 +24,7 @@ "null-loader": "^0.1.0", "postcss": "^4.0.2", "postcss-custom-properties": "3.0.1", - "react": "15.0.x", + "react": "^15.0.0", "react-docgen": "2.8.x", "react-tools": "0.13.x", "style-loader": "^0.8.3", From 5bc0cacbddfed10aacabf1a933fb633863081cab Mon Sep 17 00:00:00 2001 From: Steven Goldberg Date: Wed, 31 Jan 2018 16:44:47 -0800 Subject: [PATCH 12/43] Codemod React.createClass --- src/FixedDataTableBufferedRows.react.js | 6 +- src/FixedDataTableCell.react.js | 6 +- src/FixedDataTableCellDefault.react.js | 10 +- src/FixedDataTableCellGroup.react.js | 11 +- src/FixedDataTableColumnGroupNew.react.js | 22 +- src/FixedDataTableColumnNew.react.js | 332 +++++++++--------- src/FixedDataTableColumnResizeHandle.react.js | 6 +- src/FixedDataTableNew.react.js | 13 +- src/FixedDataTableRow.react.js | 50 ++- src/Scrollbar.react.js | 6 +- src/transition/FixedDataTable.react.js | 57 +-- .../FixedDataTableCellTransition.react.js | 19 +- src/transition/FixedDataTableColumn.react.js | 8 +- .../FixedDataTableColumnGroup.react.js | 22 +- 14 files changed, 284 insertions(+), 284 deletions(-) diff --git a/src/FixedDataTableBufferedRows.react.js b/src/FixedDataTableBufferedRows.react.js index 032bcbe6..2656c3e9 100644 --- a/src/FixedDataTableBufferedRows.react.js +++ b/src/FixedDataTableBufferedRows.react.js @@ -11,6 +11,7 @@ */ var React = require('React'); +var createReactClass = require('create-react-class'); var FixedDataTableRowBuffer = require('FixedDataTableRowBuffer'); var FixedDataTableRow = require('FixedDataTableRow.react'); @@ -21,7 +22,8 @@ var translateDOMPositionXY = require('translateDOMPositionXY'); var {PropTypes} = React; -var FixedDataTableBufferedRows = React.createClass({ +var FixedDataTableBufferedRows = createReactClass({ + displayName: "FixedDataTableBufferedRows", propTypes: { isScrolling: PropTypes.bool, @@ -174,7 +176,7 @@ var FixedDataTableBufferedRows = React.createClass({ return this.props.rowHeightGetter ? this.props.rowHeightGetter(index) : this.props.defaultRowHeight; - }, + } }); module.exports = FixedDataTableBufferedRows; diff --git a/src/FixedDataTableCell.react.js b/src/FixedDataTableCell.react.js index 8c2e83ba..bf820044 100644 --- a/src/FixedDataTableCell.react.js +++ b/src/FixedDataTableCell.react.js @@ -13,6 +13,7 @@ var FixedDataTableCellDefault = require('FixedDataTableCellDefault.react'); var FixedDataTableHelper = require('FixedDataTableHelper'); var React = require('React'); +var createReactClass = require('create-react-class'); var cx = require('cx'); var joinClasses = require('joinClasses'); @@ -25,7 +26,8 @@ var DEFAULT_PROPS = { highlighted: false, }; -var FixedDataTableCell = React.createClass({ +var FixedDataTableCell = createReactClass({ + displayName: "FixedDataTableCell", /** * PropTypes are disabled in this component, because having them on slows @@ -179,7 +181,7 @@ var FixedDataTableCell = React.createClass({ this.props.columnKey, event ); - }, + } }); module.exports = FixedDataTableCell; diff --git a/src/FixedDataTableCellDefault.react.js b/src/FixedDataTableCellDefault.react.js index 7435266a..74aeeb74 100644 --- a/src/FixedDataTableCellDefault.react.js +++ b/src/FixedDataTableCellDefault.react.js @@ -40,8 +40,8 @@ var {PropTypes} = React; * ); * ``` */ -var FixedDataTableCellDefault = React.createClass({ - propTypes: { +class FixedDataTableCellDefault extends React.Component { + static propTypes = { /** * Outer height of the cell. @@ -61,7 +61,7 @@ var FixedDataTableCellDefault = React.createClass({ PropTypes.string, PropTypes.number, ]), - }, + }; render() { var {height, width, style, className, children, ...props} = this.props; @@ -98,7 +98,7 @@ var FixedDataTableCellDefault = React.createClass({ ); - }, -}); + } +} module.exports = FixedDataTableCellDefault; diff --git a/src/FixedDataTableCellGroup.react.js b/src/FixedDataTableCellGroup.react.js index 81d80d7b..1fc30afe 100644 --- a/src/FixedDataTableCellGroup.react.js +++ b/src/FixedDataTableCellGroup.react.js @@ -14,6 +14,7 @@ var FixedDataTableHelper = require('FixedDataTableHelper'); var React = require('React'); +var createReactClass = require('create-react-class'); var FixedDataTableCell = require('FixedDataTableCell.react'); var cx = require('cx'); @@ -23,7 +24,8 @@ var {PropTypes} = React; var DIR_SIGN = FixedDataTableHelper.DIR_SIGN; -var FixedDataTableCellGroupImpl = React.createClass({ +var FixedDataTableCellGroupImpl = createReactClass({ + displayName: "FixedDataTableCellGroupImpl", /** * PropTypes are disabled in this component, because having them on slows @@ -133,10 +135,11 @@ var FixedDataTableCellGroupImpl = React.createClass({ width += columns[i].props.width; } return width; - }, + } }); -var FixedDataTableCellGroup = React.createClass({ +var FixedDataTableCellGroup = createReactClass({ + displayName: "FixedDataTableCellGroup", /** * PropTypes are disabled in this component, because having them on slows @@ -218,7 +221,7 @@ var FixedDataTableCellGroup = React.createClass({ columnKey, event ); - }, + } }); diff --git a/src/FixedDataTableColumnGroupNew.react.js b/src/FixedDataTableColumnGroupNew.react.js index 99dcb626..780dc893 100644 --- a/src/FixedDataTableColumnGroupNew.react.js +++ b/src/FixedDataTableColumnGroupNew.react.js @@ -17,12 +17,10 @@ var {PropTypes} = React; /** * Component that defines the attributes of a table column group. */ -var FixedDataTableColumnGroup = React.createClass({ - statics: { - __TableColumnGroup__: true, - }, +class FixedDataTableColumnGroup extends React.Component { + static __TableColumnGroup__ = true; - propTypes: { + static propTypes = { /** * The horizontal alignment of the table cell content. */ @@ -57,13 +55,11 @@ var FixedDataTableColumnGroup = React.createClass({ PropTypes.func, ]), - }, + }; - getDefaultProps() /*object*/ { - return { - fixed: false, - }; - }, + static defaultProps = { + fixed: false, + }; render() { if (__DEV__) { @@ -72,7 +68,7 @@ var FixedDataTableColumnGroup = React.createClass({ ); } return null; - }, -}); + } +} module.exports = FixedDataTableColumnGroup; diff --git a/src/FixedDataTableColumnNew.react.js b/src/FixedDataTableColumnNew.react.js index 91b0571f..ebe28094 100644 --- a/src/FixedDataTableColumnNew.react.js +++ b/src/FixedDataTableColumnNew.react.js @@ -17,173 +17,169 @@ var {PropTypes} = React; /** * Component that defines the attributes of table column. */ -var FixedDataTableColumn = React.createClass({ - statics: { - __TableColumn__: true - }, - - propTypes: { - /** - * The horizontal alignment of the table cell content. - */ - align: PropTypes.oneOf(['left', 'center', 'right']), - - /** - * Controls if the column is fixed when scrolling in the X axis. - */ - fixed: PropTypes.bool, - - /** - * The header cell for this column. - * This can either be a string a React element, or a function that generates - * a React Element. Passing in a string will render a default header cell - * with that string. By default, the React element passed in can expect to - * receive the following props: - * - * ``` - * props: { - * columnKey: string // (of the column, if given) - * height: number // (supplied from the Table or rowHeightGetter) - * width: number // (supplied from the Column) - * } - * ``` - * - * Because you are passing in your own React element, you can feel free to - * pass in whatever props you may want or need. - * - * If you pass in a function, you will receive the same props object as the - * first argument. - */ - header: PropTypes.oneOfType([ - PropTypes.node, - PropTypes.func, - ]), - - /** - * This is the body cell that will be cloned for this column. - * This can either be a string a React element, or a function that generates - * a React Element. Passing in a string will render a default header cell - * with that string. By default, the React element passed in can expect to - * receive the following props: - * - * ``` - * props: { - * rowIndex; number // (the row index of the cell) - * columnKey: string // (of the column, if given) - * height: number // (supplied from the Table or rowHeightGetter) - * width: number // (supplied from the Column) - * } - * ``` - * - * Because you are passing in your own React element, you can feel free to - * pass in whatever props you may want or need. - * - * If you pass in a function, you will receive the same props object as the - * first argument. - */ - cell: PropTypes.oneOfType([ - PropTypes.node, - PropTypes.func, - ]), - - /** - * This is the footer cell for this column. - * This can either be a string a React element, or a function that generates - * a React Element. Passing in a string will render a default header cell - * with that string. By default, the React element passed in can expect to - * receive the following props: - * - * ``` - * props: { - * columnKey: string // (of the column, if given) - * height: number // (supplied from the Table or rowHeightGetter) - * width: number // (supplied from the Column) - * } - * ``` - * - * Because you are passing in your own React element, you can feel free to - * pass in whatever props you may want or need. - * - * If you pass in a function, you will receive the same props object as the - * first argument. - */ - footer: PropTypes.oneOfType([ - PropTypes.node, - PropTypes.func, - ]), - - /** - * This is used to uniquely identify the column, and is not required unless - * you a resizing columns. This will be the key given in the - * `onColumnResizeEndCallback` on the Table. - */ - columnKey: PropTypes.oneOfType([ - PropTypes.string, - PropTypes.number, - ]), - - /** - * The pixel width of the column. - */ - width: PropTypes.number.isRequired, - - /** - * If this is a resizable column this is its minimum pixel width. - */ - minWidth: PropTypes.number, - - /** - * If this is a resizable column this is its maximum pixel width. - */ - maxWidth: PropTypes.number, - - /** - * The grow factor relative to other columns. Same as the flex-grow API - * from http://www.w3.org/TR/css3-flexbox/. Basically, take any available - * extra width and distribute it proportionally according to all columns' - * flexGrow values. Defaults to zero (no-flexing). - */ - flexGrow: PropTypes.number, - - /** - * Whether the column can be resized with the - * FixedDataTableColumnResizeHandle. Please note that if a column - * has a flex grow, once you resize the column this will be set to 0. - * - * This property only provides the UI for the column resizing. If this - * is set to true, you will need to set the onColumnResizeEndCallback table - * property and render your columns appropriately. - */ - isResizable: PropTypes.bool, - - /** - * Whether cells in this column can be removed from document when outside - * of viewport as a result of horizontal scrolling. - * Setting this property to true allows the table to not render cells in - * particular column that are outside of viewport for visible rows. This - * allows to create table with many columns and not have vertical scrolling - * performance drop. - * Setting the property to false will keep previous behaviour and keep - * cell rendered if the row it belongs to is visible. - */ - allowCellsRecycling: PropTypes.bool, - }, - - getDefaultProps() /*object*/ { - return { - allowCellsRecycling: false, - fixed: false, - }; - }, - - render() { - if (__DEV__) { - throw new Error( - 'Component should never render' - ); - } - return null; - }, -}); +class FixedDataTableColumn extends React.Component { + static __TableColumn__ = true; + + static propTypes = { + /** + * The horizontal alignment of the table cell content. + */ + align: PropTypes.oneOf(['left', 'center', 'right']), + + /** + * Controls if the column is fixed when scrolling in the X axis. + */ + fixed: PropTypes.bool, + + /** + * The header cell for this column. + * This can either be a string a React element, or a function that generates + * a React Element. Passing in a string will render a default header cell + * with that string. By default, the React element passed in can expect to + * receive the following props: + * + * ``` + * props: { + * columnKey: string // (of the column, if given) + * height: number // (supplied from the Table or rowHeightGetter) + * width: number // (supplied from the Column) + * } + * ``` + * + * Because you are passing in your own React element, you can feel free to + * pass in whatever props you may want or need. + * + * If you pass in a function, you will receive the same props object as the + * first argument. + */ + header: PropTypes.oneOfType([ + PropTypes.node, + PropTypes.func, + ]), + + /** + * This is the body cell that will be cloned for this column. + * This can either be a string a React element, or a function that generates + * a React Element. Passing in a string will render a default header cell + * with that string. By default, the React element passed in can expect to + * receive the following props: + * + * ``` + * props: { + * rowIndex; number // (the row index of the cell) + * columnKey: string // (of the column, if given) + * height: number // (supplied from the Table or rowHeightGetter) + * width: number // (supplied from the Column) + * } + * ``` + * + * Because you are passing in your own React element, you can feel free to + * pass in whatever props you may want or need. + * + * If you pass in a function, you will receive the same props object as the + * first argument. + */ + cell: PropTypes.oneOfType([ + PropTypes.node, + PropTypes.func, + ]), + + /** + * This is the footer cell for this column. + * This can either be a string a React element, or a function that generates + * a React Element. Passing in a string will render a default header cell + * with that string. By default, the React element passed in can expect to + * receive the following props: + * + * ``` + * props: { + * columnKey: string // (of the column, if given) + * height: number // (supplied from the Table or rowHeightGetter) + * width: number // (supplied from the Column) + * } + * ``` + * + * Because you are passing in your own React element, you can feel free to + * pass in whatever props you may want or need. + * + * If you pass in a function, you will receive the same props object as the + * first argument. + */ + footer: PropTypes.oneOfType([ + PropTypes.node, + PropTypes.func, + ]), + + /** + * This is used to uniquely identify the column, and is not required unless + * you a resizing columns. This will be the key given in the + * `onColumnResizeEndCallback` on the Table. + */ + columnKey: PropTypes.oneOfType([ + PropTypes.string, + PropTypes.number, + ]), + + /** + * The pixel width of the column. + */ + width: PropTypes.number.isRequired, + + /** + * If this is a resizable column this is its minimum pixel width. + */ + minWidth: PropTypes.number, + + /** + * If this is a resizable column this is its maximum pixel width. + */ + maxWidth: PropTypes.number, + + /** + * The grow factor relative to other columns. Same as the flex-grow API + * from http://www.w3.org/TR/css3-flexbox/. Basically, take any available + * extra width and distribute it proportionally according to all columns' + * flexGrow values. Defaults to zero (no-flexing). + */ + flexGrow: PropTypes.number, + + /** + * Whether the column can be resized with the + * FixedDataTableColumnResizeHandle. Please note that if a column + * has a flex grow, once you resize the column this will be set to 0. + * + * This property only provides the UI for the column resizing. If this + * is set to true, you will need to set the onColumnResizeEndCallback table + * property and render your columns appropriately. + */ + isResizable: PropTypes.bool, + + /** + * Whether cells in this column can be removed from document when outside + * of viewport as a result of horizontal scrolling. + * Setting this property to true allows the table to not render cells in + * particular column that are outside of viewport for visible rows. This + * allows to create table with many columns and not have vertical scrolling + * performance drop. + * Setting the property to false will keep previous behaviour and keep + * cell rendered if the row it belongs to is visible. + */ + allowCellsRecycling: PropTypes.bool, + }; + + static defaultProps = { + allowCellsRecycling: false, + fixed: false, + }; + + render() { + if (__DEV__) { + throw new Error( + 'Component should never render' + ); + } + return null; + } +} module.exports = FixedDataTableColumn; diff --git a/src/FixedDataTableColumnResizeHandle.react.js b/src/FixedDataTableColumnResizeHandle.react.js index e1751bd6..0860cc88 100644 --- a/src/FixedDataTableColumnResizeHandle.react.js +++ b/src/FixedDataTableColumnResizeHandle.react.js @@ -17,6 +17,7 @@ var DOMMouseMoveTracker = require('DOMMouseMoveTracker'); var Locale = require('Locale'); var React = require('React'); +var createReactClass = require('create-react-class'); var ReactComponentWithPureRenderMixin = require('ReactComponentWithPureRenderMixin'); var clamp = require('clamp'); @@ -24,7 +25,8 @@ var cx = require('cx'); var {PropTypes} = React; -var FixedDataTableColumnResizeHandle = React.createClass({ +var FixedDataTableColumnResizeHandle = createReactClass({ + displayName: "FixedDataTableColumnResizeHandle", mixins: [ReactComponentWithPureRenderMixin], propTypes: { @@ -161,7 +163,7 @@ var FixedDataTableColumnResizeHandle = React.createClass({ this.state.width, this.props.columnKey ); - }, + } }); module.exports = FixedDataTableColumnResizeHandle; diff --git a/src/FixedDataTableNew.react.js b/src/FixedDataTableNew.react.js index 6da12f3e..5ac7efce 100644 --- a/src/FixedDataTableNew.react.js +++ b/src/FixedDataTableNew.react.js @@ -14,6 +14,7 @@ /*eslint no-bitwise:1*/ var React = require('React'); +var createReactClass = require('create-react-class'); var ReactComponentWithPureRenderMixin = require('ReactComponentWithPureRenderMixin'); var ReactWheelHandler = require('ReactWheelHandler'); var Scrollbar = require('Scrollbar.react'); @@ -86,7 +87,8 @@ var CELL = 'cell'; * - Scrollable Body Columns: The body columns that move while scrolling * vertically or horizontally. */ -var FixedDataTable = React.createClass({ +var FixedDataTable = createReactClass({ + displayName: "FixedDataTable", propTypes: { @@ -1007,7 +1009,6 @@ var FixedDataTable = React.createClass({ } }, - _onHorizontalScroll(/*number*/ scrollPos) { if (this.isMounted() && scrollPos !== this.state.scrollX) { if (!this._isScrolling) { @@ -1053,11 +1054,13 @@ var FixedDataTable = React.createClass({ this.props.onScrollEnd(this.state.scrollX, this.state.scrollY); } } - }, + } }); -var HorizontalScrollbar = React.createClass({ +var HorizontalScrollbar = createReactClass({ + displayName: "HorizontalScrollbar", mixins: [ReactComponentWithPureRenderMixin], + propTypes: { contentSize: PropTypes.number.isRequired, offset: PropTypes.number.isRequired, @@ -1100,7 +1103,7 @@ var HorizontalScrollbar = React.createClass({ ); - }, + } }); module.exports = FixedDataTable; diff --git a/src/FixedDataTableRow.react.js b/src/FixedDataTableRow.react.js index ffaa60d0..099a1921 100644 --- a/src/FixedDataTableRow.react.js +++ b/src/FixedDataTableRow.react.js @@ -26,9 +26,8 @@ var {PropTypes} = React; * This component should not be used directly by developer. Instead, * only should use the component internally. */ -var FixedDataTableRowImpl = React.createClass({ - - propTypes: { +class FixedDataTableRowImpl extends React.Component { + static propTypes = { isScrolling: PropTypes.bool, @@ -84,7 +83,7 @@ var FixedDataTableRowImpl = React.createClass({ * @param object event */ onColumnResize: PropTypes.func, - }, + }; render() /*object*/ { var style = { @@ -146,17 +145,17 @@ var FixedDataTableRowImpl = React.createClass({ ); - }, + } - _getColumnsWidth(/*array*/ columns) /*number*/ { + _getColumnsWidth = /*array*/ columns => /*number*/ { var width = 0; for (var i = 0; i < columns.length; ++i) { width += columns[i].props.width; } return width; - }, + }; - _renderColumnsShadow(/*number*/ left) /*?object*/ { + _renderColumnsShadow = /*number*/ left => /*?object*/ { if (left > 0) { var className = cx({ 'fixedDataTableRowLayout/fixedColumnsDivider': true, @@ -170,32 +169,31 @@ var FixedDataTableRowImpl = React.createClass({ }; return
; } - }, + }; - _onClick(/*object*/ event) { + _onClick = /*object*/ event => { this.props.onClick(event, this.props.index); - }, + }; - _onDoubleClick(/*object*/ event) { + _onDoubleClick = /*object*/ event => { this.props.onDoubleClick(event, this.props.index); - }, + }; - _onMouseDown(/*object*/ event) { + _onMouseDown = /*object*/ event => { this.props.onMouseDown(event, this.props.index); - }, + }; - _onMouseEnter(/*object*/ event) { + _onMouseEnter = /*object*/ event => { this.props.onMouseEnter(event, this.props.index); - }, + }; - _onMouseLeave(/*object*/ event) { + _onMouseLeave = /*object*/ event => { this.props.onMouseLeave(event, this.props.index); - }, -}); - -var FixedDataTableRow = React.createClass({ + }; +} - propTypes: { +class FixedDataTableRow extends React.Component { + static propTypes = { isScrolling: PropTypes.bool, @@ -219,7 +217,7 @@ var FixedDataTableRow = React.createClass({ * Width of the row. */ width: PropTypes.number.isRequired, - }, + }; render() /*object*/ { var style = { @@ -240,8 +238,8 @@ var FixedDataTableRow = React.createClass({ />
); - }, -}); + } +} module.exports = FixedDataTableRow; diff --git a/src/Scrollbar.react.js b/src/Scrollbar.react.js index 185532f0..7cf8bac2 100644 --- a/src/Scrollbar.react.js +++ b/src/Scrollbar.react.js @@ -13,6 +13,7 @@ var DOMMouseMoveTracker = require('DOMMouseMoveTracker'); var Keys = require('Keys'); var React = require('React'); +var createReactClass = require('create-react-class'); var ReactDOM = require('ReactDOM'); var ReactComponentWithPureRenderMixin = require('ReactComponentWithPureRenderMixin'); var ReactWheelHandler = require('ReactWheelHandler'); @@ -36,7 +37,8 @@ var KEYBOARD_SCROLL_AMOUNT = 40; var _lastScrolledScrollbar = null; -var Scrollbar = React.createClass({ +var Scrollbar = createReactClass({ + displayName: "Scrollbar", mixins: [ReactComponentWithPureRenderMixin], propTypes: { @@ -502,7 +504,7 @@ var Scrollbar = React.createClass({ _didScroll() { this.props.onScroll(this.state.position); - }, + } }); Scrollbar.KEYBOARD_SCROLL_AMOUNT = KEYBOARD_SCROLL_AMOUNT; diff --git a/src/transition/FixedDataTable.react.js b/src/transition/FixedDataTable.react.js index de768dda..10838fbd 100644 --- a/src/transition/FixedDataTable.react.js +++ b/src/transition/FixedDataTable.react.js @@ -9,13 +9,13 @@ * @providesModule FixedDataTable.react */ - /** - * TRANSITION SHIM - * This acts to provide an intermediate mapping from the old API to the new API - * - * Remove this entire file and replace the two lines in FixedDataTableRoot - * when ready to continue to the new API. - */ +/** + * TRANSITION SHIM + * This acts to provide an intermediate mapping from the old API to the new API + * + * Remove this entire file and replace the two lines in FixedDataTableRoot + * when ready to continue to the new API. + */ 'use strict'; @@ -105,8 +105,8 @@ function notifyDeprecated(prop, reason) { * - Scrollable Body Columns: The body columns that move while scrolling * vertically or horizontally. */ -var TransitionTable = React.createClass({ - propTypes: { +class TransitionTable extends React.Component { + static propTypes = { /** * Pixel width of table. If all columns do not fit, * a horizontal scrollbar will appear. @@ -303,17 +303,18 @@ var TransitionTable = React.createClass({ * Whether a column is currently being resized. */ isColumnResizing: PropTypes.bool, - }, + }; - getInitialState() { - // Throw warnings on deprecated props. - var state = {}; - state.needsMigration = this._checkDeprecations(); + constructor(props, context) { + super(props, context); + // Throw warnings on deprecated props. + var state = {}; + state.needsMigration = this._checkDeprecations(); - return state; - }, + this.state = state; + } - _checkDeprecations() { + _checkDeprecations = () => { var needsMigration = false; if (this.props.rowGetter) { @@ -398,10 +399,10 @@ var TransitionTable = React.createClass({ }); return needsMigration; - }, + }; // Wrapper for onRow callbacks, since we don't have rowData at that level. - _onRowAction(props, callback) { + _onRowAction = (props, callback) => { if (!callback) { return undefined; } @@ -413,9 +414,9 @@ var TransitionTable = React.createClass({ (props.rowGetter && props.rowGetter(rowIndex)) || EMPTY_OBJECT ); }; - }, + }; - _transformColumn(column, tableProps, key) { + _transformColumn = (column, tableProps, key) => { var props = column.props; @@ -462,9 +463,9 @@ var TransitionTable = React.createClass({ /> ); } - }, + }; - _transformColumnGroup(group, tableProps, key, labels) { + _transformColumnGroup = (group, tableProps, key, labels) => { var props = group.props; var j = 0; @@ -490,9 +491,9 @@ var TransitionTable = React.createClass({ {columns} ); - }, + }; - _convertedColumns(needsMigration) { + _convertedColumns = needsMigration => { // If we don't need to migrate, map directly to the new API. if (!needsMigration) { return ReactChildren.map(this.props.children, (child) => { @@ -539,7 +540,7 @@ var TransitionTable = React.createClass({ i++; return child; }); - }, + }; render() { var props = this.props; @@ -555,7 +556,7 @@ var TransitionTable = React.createClass({ {this._convertedColumns(this.state.needsMigration)} ); - }, -}); + } +} module.exports = TransitionTable; diff --git a/src/transition/FixedDataTableCellTransition.react.js b/src/transition/FixedDataTableCellTransition.react.js index 300c376a..fe7a45e2 100644 --- a/src/transition/FixedDataTableCellTransition.react.js +++ b/src/transition/FixedDataTableCellTransition.react.js @@ -26,9 +26,8 @@ var shallowEqual = require('shallowEqual'); var CellDefault = require('FixedDataTableCellDefault.react'); -var TransitionCell = React.createClass({ - - propTypes: { +class TransitionCell extends React.Component { + static propTypes = { label: PropTypes.string, // header, footer className: PropTypes.string, rowIndex: PropTypes.number, @@ -46,7 +45,7 @@ var TransitionCell = React.createClass({ height: PropTypes.number, isHeaderCell: PropTypes.bool, // header isFooterCell: PropTypes.bool, // footer - }, + }; shouldComponentUpdate(/*object*/ nextProps): boolean { var update = false; @@ -74,9 +73,9 @@ var TransitionCell = React.createClass({ this._cellData = cellData; return update || !shallowEqual(nextProps, this.props); - }, + } - _getCellData(props) { + _getCellData = props => { var dataKey = props.dataKey; if (dataKey == null) { return null; @@ -106,9 +105,9 @@ var TransitionCell = React.createClass({ if (props.headerDataGetter) { return props.headerDataGetter[dataKey]; } - }, + }; - _getRowData(props): Object { + _getRowData = (props): Object => { if (props.rowGetter) { return props.rowGetter(props.rowIndex) || {}; } @@ -122,7 +121,7 @@ var TransitionCell = React.createClass({ } return {}; - }, + }; render() { var props = this.props; @@ -214,6 +213,6 @@ var TransitionCell = React.createClass({ ); } -}); +} module.exports = TransitionCell; diff --git a/src/transition/FixedDataTableColumn.react.js b/src/transition/FixedDataTableColumn.react.js index 25f31da1..c2d7ba19 100644 --- a/src/transition/FixedDataTableColumn.react.js +++ b/src/transition/FixedDataTableColumn.react.js @@ -19,10 +19,8 @@ var React = require('React'); -var TransitionColumn = React.createClass({ - statics: { - __TableColumn__: true - }, +class TransitionColumn extends React.Component { + static __TableColumn__ = true; render() { if (__DEV__) { @@ -32,6 +30,6 @@ var TransitionColumn = React.createClass({ } return null; } -}); +} module.exports = TransitionColumn; diff --git a/src/transition/FixedDataTableColumnGroup.react.js b/src/transition/FixedDataTableColumnGroup.react.js index 911126d9..d0c2d38c 100644 --- a/src/transition/FixedDataTableColumnGroup.react.js +++ b/src/transition/FixedDataTableColumnGroup.react.js @@ -9,20 +9,18 @@ * @providesModule FixedDataTableColumnGroup.react */ - /** - * TRANSITION SHIM - * This provides an intermediate mapping from the old API to the new API. - * - * When ready, remove this file and rename the providesModule in - * FixedDataTableColumnNew.react - */ +/** + * TRANSITION SHIM + * This provides an intermediate mapping from the old API to the new API. + * + * When ready, remove this file and rename the providesModule in + * FixedDataTableColumnNew.react + */ var React = require('React'); -var TransitionColumnGroup = React.createClass({ - statics: { - __TableColumnGroup__: true, - }, +class TransitionColumnGroup extends React.Component { + static __TableColumnGroup__ = true; render() { if (__DEV__) { @@ -32,6 +30,6 @@ var TransitionColumnGroup = React.createClass({ } return null; } -}); +} module.exports = TransitionColumnGroup; From dbd7a613661e89d8c934683488f52daaf4a0007f Mon Sep 17 00:00:00 2001 From: Steven Goldberg Date: Wed, 31 Jan 2018 17:04:55 -0800 Subject: [PATCH 13/43] Codemod PropTypes --- src/FixedDataTableBufferedRows.react.js | 3 +-- src/FixedDataTableCell.react.js | 3 +-- src/FixedDataTableCellDefault.react.js | 3 +-- src/FixedDataTableCellGroup.react.js | 3 +-- src/FixedDataTableColumnGroupNew.react.js | 3 +-- src/FixedDataTableColumnNew.react.js | 3 +-- src/FixedDataTableColumnResizeHandle.react.js | 3 +-- src/FixedDataTableNew.react.js | 2 +- src/FixedDataTableRow.react.js | 4 ++-- src/Scrollbar.react.js | 3 +-- src/transition/FixedDataTable.react.js | 4 ++-- src/transition/FixedDataTableCellTransition.react.js | 2 +- 12 files changed, 14 insertions(+), 22 deletions(-) diff --git a/src/FixedDataTableBufferedRows.react.js b/src/FixedDataTableBufferedRows.react.js index 2656c3e9..46e4c557 100644 --- a/src/FixedDataTableBufferedRows.react.js +++ b/src/FixedDataTableBufferedRows.react.js @@ -1,3 +1,4 @@ +var PropTypes = require('prop-types'); /** * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -20,8 +21,6 @@ var emptyFunction = require('emptyFunction'); var joinClasses = require('joinClasses'); var translateDOMPositionXY = require('translateDOMPositionXY'); -var {PropTypes} = React; - var FixedDataTableBufferedRows = createReactClass({ displayName: "FixedDataTableBufferedRows", diff --git a/src/FixedDataTableCell.react.js b/src/FixedDataTableCell.react.js index bf820044..bed8e2bb 100644 --- a/src/FixedDataTableCell.react.js +++ b/src/FixedDataTableCell.react.js @@ -12,6 +12,7 @@ var FixedDataTableCellDefault = require('FixedDataTableCellDefault.react'); var FixedDataTableHelper = require('FixedDataTableHelper'); +var PropTypes = require('prop-types'); var React = require('React'); var createReactClass = require('create-react-class'); var cx = require('cx'); @@ -19,8 +20,6 @@ var joinClasses = require('joinClasses'); var DIR_SIGN = FixedDataTableHelper.DIR_SIGN; -var {PropTypes} = React; - var DEFAULT_PROPS = { align: 'left', highlighted: false, diff --git a/src/FixedDataTableCellDefault.react.js b/src/FixedDataTableCellDefault.react.js index 74aeeb74..c7f8a71f 100644 --- a/src/FixedDataTableCellDefault.react.js +++ b/src/FixedDataTableCellDefault.react.js @@ -1,3 +1,4 @@ +var PropTypes = require('prop-types'); /** * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -15,8 +16,6 @@ var React = require('React'); var cx = require('cx'); var joinClasses = require('joinClasses'); -var {PropTypes} = React; - /** * Component that handles default cell layout and styling. * diff --git a/src/FixedDataTableCellGroup.react.js b/src/FixedDataTableCellGroup.react.js index 1fc30afe..8853cec7 100644 --- a/src/FixedDataTableCellGroup.react.js +++ b/src/FixedDataTableCellGroup.react.js @@ -13,6 +13,7 @@ 'use strict'; var FixedDataTableHelper = require('FixedDataTableHelper'); +var PropTypes = require('prop-types'); var React = require('React'); var createReactClass = require('create-react-class'); var FixedDataTableCell = require('FixedDataTableCell.react'); @@ -20,8 +21,6 @@ var FixedDataTableCell = require('FixedDataTableCell.react'); var cx = require('cx'); var translateDOMPositionXY = require('translateDOMPositionXY'); -var {PropTypes} = React; - var DIR_SIGN = FixedDataTableHelper.DIR_SIGN; var FixedDataTableCellGroupImpl = createReactClass({ diff --git a/src/FixedDataTableColumnGroupNew.react.js b/src/FixedDataTableColumnGroupNew.react.js index 780dc893..11a9af2d 100644 --- a/src/FixedDataTableColumnGroupNew.react.js +++ b/src/FixedDataTableColumnGroupNew.react.js @@ -1,3 +1,4 @@ +var PropTypes = require('prop-types'); /** * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -12,8 +13,6 @@ var React = require('React'); -var {PropTypes} = React; - /** * Component that defines the attributes of a table column group. */ diff --git a/src/FixedDataTableColumnNew.react.js b/src/FixedDataTableColumnNew.react.js index ebe28094..b387e89f 100644 --- a/src/FixedDataTableColumnNew.react.js +++ b/src/FixedDataTableColumnNew.react.js @@ -1,3 +1,4 @@ +var PropTypes = require('prop-types'); /** * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -12,8 +13,6 @@ var React = require('React'); -var {PropTypes} = React; - /** * Component that defines the attributes of table column. */ diff --git a/src/FixedDataTableColumnResizeHandle.react.js b/src/FixedDataTableColumnResizeHandle.react.js index 0860cc88..f5eac5be 100644 --- a/src/FixedDataTableColumnResizeHandle.react.js +++ b/src/FixedDataTableColumnResizeHandle.react.js @@ -16,6 +16,7 @@ var DOMMouseMoveTracker = require('DOMMouseMoveTracker'); var Locale = require('Locale'); +var PropTypes = require('prop-types'); var React = require('React'); var createReactClass = require('create-react-class'); var ReactComponentWithPureRenderMixin = require('ReactComponentWithPureRenderMixin'); @@ -23,8 +24,6 @@ var ReactComponentWithPureRenderMixin = require('ReactComponentWithPureRenderMix var clamp = require('clamp'); var cx = require('cx'); -var {PropTypes} = React; - var FixedDataTableColumnResizeHandle = createReactClass({ displayName: "FixedDataTableColumnResizeHandle", mixins: [ReactComponentWithPureRenderMixin], diff --git a/src/FixedDataTableNew.react.js b/src/FixedDataTableNew.react.js index 5ac7efce..2b38e2b9 100644 --- a/src/FixedDataTableNew.react.js +++ b/src/FixedDataTableNew.react.js @@ -1,3 +1,4 @@ +var PropTypes = require('prop-types'); /** * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -32,7 +33,6 @@ var joinClasses = require('joinClasses'); var shallowEqual = require('shallowEqual'); var translateDOMPositionXY = require('translateDOMPositionXY'); -var {PropTypes} = React; var ReactChildren = React.Children; var EMPTY_OBJECT = {}; diff --git a/src/FixedDataTableRow.react.js b/src/FixedDataTableRow.react.js index 099a1921..1ad72aaf 100644 --- a/src/FixedDataTableRow.react.js +++ b/src/FixedDataTableRow.react.js @@ -12,6 +12,8 @@ 'use strict'; +var PropTypes = require('prop-types'); + var React = require('React'); var FixedDataTableCellGroup = require('FixedDataTableCellGroup.react'); @@ -19,8 +21,6 @@ var cx = require('cx'); var joinClasses = require('joinClasses'); var translateDOMPositionXY = require('translateDOMPositionXY'); -var {PropTypes} = React; - /** * Component that renders the row for . * This component should not be used directly by developer. Instead, diff --git a/src/Scrollbar.react.js b/src/Scrollbar.react.js index 7cf8bac2..e54e6618 100644 --- a/src/Scrollbar.react.js +++ b/src/Scrollbar.react.js @@ -12,6 +12,7 @@ var DOMMouseMoveTracker = require('DOMMouseMoveTracker'); var Keys = require('Keys'); +var PropTypes = require('prop-types'); var React = require('React'); var createReactClass = require('create-react-class'); var ReactDOM = require('ReactDOM'); @@ -23,8 +24,6 @@ var cx = require('cx'); var emptyFunction = require('emptyFunction'); var translateDOMPositionXY = require('translateDOMPositionXY'); -var {PropTypes} = React; - var UNSCROLLABLE_STATE = { position: 0, scrollable: false, diff --git a/src/transition/FixedDataTable.react.js b/src/transition/FixedDataTable.react.js index 10838fbd..82dc2735 100644 --- a/src/transition/FixedDataTable.react.js +++ b/src/transition/FixedDataTable.react.js @@ -19,12 +19,12 @@ 'use strict'; +var PropTypes = require('prop-types'); + var React = require('React'); var ReactChildren = React.Children; -var {PropTypes} = React; - // New Table API var Table = require('FixedDataTableNew.react'); var Column = require('FixedDataTableColumnNew.react'); diff --git a/src/transition/FixedDataTableCellTransition.react.js b/src/transition/FixedDataTableCellTransition.react.js index fe7a45e2..02a4ab73 100644 --- a/src/transition/FixedDataTableCellTransition.react.js +++ b/src/transition/FixedDataTableCellTransition.react.js @@ -1,3 +1,4 @@ +var PropTypes = require('prop-types'); /** * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -18,7 +19,6 @@ */ var React = require('React'); -var {PropTypes} = React; var cx = require('cx'); var joinClasses = require('joinClasses'); From a2415d1231a6ec4bbf209254f7d1fe62fd2001cd Mon Sep 17 00:00:00 2001 From: Steven Goldberg Date: Thu, 1 Feb 2018 12:26:13 -0800 Subject: [PATCH 14/43] Replace usages of isMounted --- src/FixedDataTableBufferedRows.react.js | 4 +++- src/FixedDataTableNew.react.js | 15 ++++++++++----- src/Scrollbar.react.js | 6 +++++- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/FixedDataTableBufferedRows.react.js b/src/FixedDataTableBufferedRows.react.js index 46e4c557..1c506301 100644 --- a/src/FixedDataTableBufferedRows.react.js +++ b/src/FixedDataTableBufferedRows.react.js @@ -69,6 +69,7 @@ var FixedDataTableBufferedRows = createReactClass({ componentDidMount() { setTimeout(this._updateBuffer, 1000); + this._isMounted = true; }, componentWillReceiveProps(/*object*/ nextProps) { @@ -96,7 +97,7 @@ var FixedDataTableBufferedRows = createReactClass({ }, _updateBuffer() { - if (this.isMounted()) { + if (this._isMounted) { this.setState({ rowsToRender: this._rowBuffer.getRowsWithUpdatedBuffer(), }); @@ -110,6 +111,7 @@ var FixedDataTableBufferedRows = createReactClass({ componentWillUnmount() { this._staticRowArray.length = 0; + this._isMounted = false; }, render() /*object*/ { diff --git a/src/FixedDataTableNew.react.js b/src/FixedDataTableNew.react.js index 2b38e2b9..9685ade8 100644 --- a/src/FixedDataTableNew.react.js +++ b/src/FixedDataTableNew.react.js @@ -356,6 +356,7 @@ var FixedDataTable = createReactClass({ componentDidMount() { this._reportContentHeight(); + this._isMounted = true; }, componentWillReceiveProps(/*object*/ nextProps) { @@ -582,6 +583,10 @@ var FixedDataTable = createReactClass({ ); }, + componentWillUnmount() { + this._isMounted = false; + }, + _renderRows(/*number*/ offsetTop) /*object*/ { var state = this.state; @@ -977,7 +982,7 @@ var FixedDataTable = createReactClass({ }, _onWheel(/*number*/ deltaX, /*number*/ deltaY) { - if (this.isMounted()) { + if (this._isMounted) { if (!this._isScrolling) { this._didScrollStart(); } @@ -1010,7 +1015,7 @@ var FixedDataTable = createReactClass({ }, _onHorizontalScroll(/*number*/ scrollPos) { - if (this.isMounted() && scrollPos !== this.state.scrollX) { + if (this._isMounted && scrollPos !== this.state.scrollX) { if (!this._isScrolling) { this._didScrollStart(); } @@ -1022,7 +1027,7 @@ var FixedDataTable = createReactClass({ }, _onVerticalScroll(/*number*/ scrollPos) { - if (this.isMounted() && scrollPos !== this.state.scrollY) { + if (this._isMounted && scrollPos !== this.state.scrollY) { if (!this._isScrolling) { this._didScrollStart(); } @@ -1038,7 +1043,7 @@ var FixedDataTable = createReactClass({ }, _didScrollStart() { - if (this.isMounted() && !this._isScrolling) { + if (this._isMounted && !this._isScrolling) { this._isScrolling = true; if (this.props.onScrollStart) { this.props.onScrollStart(this.state.scrollX, this.state.scrollY); @@ -1047,7 +1052,7 @@ var FixedDataTable = createReactClass({ }, _didScrollStop() { - if (this.isMounted() && this._isScrolling) { + if (this._isMounted && this._isScrolling) { this._isScrolling = false; this.setState({redraw: true}); if (this.props.onScrollEnd) { diff --git a/src/Scrollbar.react.js b/src/Scrollbar.react.js index e54e6618..582160de 100644 --- a/src/Scrollbar.react.js +++ b/src/Scrollbar.react.js @@ -197,6 +197,8 @@ var Scrollbar = createReactClass({ this.state.position !== this.props.position) { this._didScroll(); } + + this._isMounted = true; }, componentWillUnmount() { @@ -206,6 +208,8 @@ var Scrollbar = createReactClass({ _lastScrolledScrollbar = null; } delete this._mouseMoveTracker; + + this._isMounted = false; }, scrollBy(/*number*/ delta) { @@ -466,7 +470,7 @@ var Scrollbar = createReactClass({ }, _blur() { - if (this.isMounted()) { + if (this._isMounted) { try { this._onBlur(); ReactDOM.findDOMNode(this).blur(); From 9ccc0432cede84f6107af25bdc353087e6f5c57f Mon Sep 17 00:00:00 2001 From: Steven Goldberg Date: Fri, 2 Feb 2018 10:26:46 -0800 Subject: [PATCH 15/43] Bump patch version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7a1e71bc..c3195a70 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@buildingconnected/fixed-data-table", - "version": "0.7.3", + "version": "0.7.4", "description": "A React table component designed to allow presenting thousands of rows of data.", "main": "main.js", "peerDependencies": { From 8253d782a73ef43a607b65720928f2627a74b064 Mon Sep 17 00:00:00 2001 From: Dennis Berko Date: Mon, 5 Nov 2018 14:01:25 -0800 Subject: [PATCH 16/43] Version 0.7.5 --- dist/fixed-data-table-base.css | 23 +- dist/fixed-data-table-base.min.css | 4 +- dist/fixed-data-table-style.css | 3 +- dist/fixed-data-table-style.min.css | 4 +- dist/fixed-data-table.css | 24 +- dist/fixed-data-table.js | 5432 +++++++++++++++++++------- dist/fixed-data-table.min.css | 4 +- dist/fixed-data-table.min.js | 9 +- package-lock.json | 5618 +++++++++++++++++++++++++++ package.json | 2 +- src/FixedDataTableNew.react.js | 313 +- 11 files changed, 9740 insertions(+), 1696 deletions(-) create mode 100644 package-lock.json diff --git a/dist/fixed-data-table-base.css b/dist/fixed-data-table-base.css index c550436a..6cd2aa35 100644 --- a/dist/fixed-data-table-base.css +++ b/dist/fixed-data-table-base.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.2 + * FixedDataTable v0.7.5 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -21,8 +21,7 @@ */ .fixedDataTableCellGroupLayout_cellGroup { - -webkit-backface-visibility: hidden; - backface-visibility: hidden; + backface-visibility: hidden; left: 0; overflow: hidden; position: absolute; @@ -222,8 +221,7 @@ body[dir="rtl"] .fixedDataTableColumnResizerLineLayout_main { } .fixedDataTableRowLayout_fixedColumnsDivider { - -webkit-backface-visibility: hidden; - backface-visibility: hidden; + backface-visibility: hidden; border-left-style: solid; border-left-width: 1px; left: 0; @@ -256,10 +254,8 @@ body[dir="rtl"] .fixedDataTableColumnResizerLineLayout_main { outline: none; overflow: hidden; position: absolute; - -webkit-transition-duration: 250ms; - transition-duration: 250ms; - -webkit-transition-timing-function: ease; - transition-timing-function: ease; + transition-duration: 250ms; + transition-timing-function: ease; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; @@ -270,8 +266,7 @@ body[dir="rtl"] .fixedDataTableColumnResizerLineLayout_main { bottom: 0; right: 0; top: 0; - -webkit-transition-property: background-color width; - transition-property: background-color width; + transition-property: background-color width; width: 15px; } @@ -284,8 +279,7 @@ body[dir="rtl"] .fixedDataTableColumnResizerLineLayout_main { bottom: 0; height: 15px; left: 0; - -webkit-transition-property: background-color height; - transition-property: background-color height; + transition-property: background-color height; } /* Touching the scroll-track directly makes the scroll-track bolder */ @@ -312,8 +306,7 @@ body[dir="rtl"] .fixedDataTableColumnResizerLineLayout_main { content: ''; display: block; position: absolute; - -webkit-transition: background-color 250ms ease; - transition: background-color 250ms ease; + transition: background-color 250ms ease; } .ScrollbarLayout_faceHorizontal { diff --git a/dist/fixed-data-table-base.min.css b/dist/fixed-data-table-base.min.css index 772293ac..857b1e61 100644 --- a/dist/fixed-data-table-base.min.css +++ b/dist/fixed-data-table-base.min.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.2 + * FixedDataTable v0.7.5 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -9,4 +9,4 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -.fixedDataTableCellGroupLayout_cellGroup{-webkit-backface-visibility:hidden;backface-visibility:hidden;left:0;overflow:hidden;position:absolute;top:0;white-space:nowrap}.fixedDataTableCellGroupLayout_cellGroup>.public_fixedDataTableCell_main{display:inline-block;vertical-align:top;white-space:normal}.fixedDataTableCellGroupLayout_cellGroupWrapper{position:absolute;top:0}.fixedDataTableCellLayout_main{border-right-style:solid;border-width:0 1px 0 0;box-sizing:border-box;display:block;overflow:hidden;position:absolute;white-space:normal}.fixedDataTableCellLayout_lastChild{border-width:0 1px 1px 0}.fixedDataTableCellLayout_alignRight{text-align:right}.fixedDataTableCellLayout_alignCenter{text-align:center}.fixedDataTableCellLayout_wrap1{display:table}.fixedDataTableCellLayout_wrap2{display:table-row}.fixedDataTableCellLayout_wrap3{display:table-cell;vertical-align:middle}.fixedDataTableCellLayout_columnResizerContainer{position:absolute;right:0;width:6px;z-index:1}.fixedDataTableCellLayout_columnResizerContainer:hover{cursor:ew-resize}.fixedDataTableCellLayout_columnResizerContainer:hover .fixedDataTableCellLayout_columnResizerKnob{visibility:visible}.fixedDataTableCellLayout_columnResizerKnob{position:absolute;right:0;visibility:hidden;width:4px}.fixedDataTableColumnResizerLineLayout_mouseArea{cursor:ew-resize;position:absolute;right:-5px;width:12px}.fixedDataTableColumnResizerLineLayout_main{border-right-style:solid;border-right-width:1px;box-sizing:border-box;position:absolute;z-index:10}body[dir="rtl"] .fixedDataTableColumnResizerLineLayout_main,.fixedDataTableColumnResizerLineLayout_hiddenElem{display:none!important}.fixedDataTableLayout_main{border-style:solid;border-width:1px;box-sizing:border-box;overflow:hidden;position:relative}.fixedDataTableLayout_header,.fixedDataTableLayout_hasBottomBorder{border-bottom-style:solid;border-bottom-width:1px}.fixedDataTableLayout_footer .public_fixedDataTableCell_main{border-top-style:solid;border-top-width:1px}.fixedDataTableLayout_topShadow,.fixedDataTableLayout_bottomShadow{height:4px;left:0;position:absolute;right:0;z-index:1}.fixedDataTableLayout_bottomShadow{margin-top:-4px}.fixedDataTableLayout_rowsContainer{overflow:hidden;position:relative}.fixedDataTableLayout_horizontalScrollbar{bottom:0;position:absolute}.fixedDataTableRowLayout_main{box-sizing:border-box;overflow:hidden;position:absolute;top:0}.fixedDataTableRowLayout_body{left:0;position:absolute;top:0}.fixedDataTableRowLayout_fixedColumnsDivider{-webkit-backface-visibility:hidden;backface-visibility:hidden;border-left-style:solid;border-left-width:1px;left:0;position:absolute;top:0;width:0}.fixedDataTableRowLayout_columnsShadow{width:4px}.fixedDataTableRowLayout_rowWrapper{position:absolute;top:0}.ScrollbarLayout_main{box-sizing:border-box;outline:none;overflow:hidden;position:absolute;-webkit-transition-duration:250ms;transition-duration:250ms;-webkit-transition-timing-function:ease;transition-timing-function:ease;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ScrollbarLayout_mainVertical{bottom:0;right:0;top:0;-webkit-transition-property:background-color width;transition-property:background-color width;width:15px}.ScrollbarLayout_mainVertical.public_Scrollbar_mainActive,.ScrollbarLayout_mainVertical:hover{width:17px}.ScrollbarLayout_mainHorizontal{bottom:0;height:15px;left:0;-webkit-transition-property:background-color height;transition-property:background-color height}.ScrollbarLayout_mainHorizontal.public_Scrollbar_mainActive,.ScrollbarLayout_mainHorizontal:hover{height:17px}.ScrollbarLayout_face{left:0;overflow:hidden;position:absolute;z-index:1}.ScrollbarLayout_face:after{border-radius:6px;content:'';display:block;position:absolute;-webkit-transition:background-color 250ms ease;transition:background-color 250ms ease}.ScrollbarLayout_faceHorizontal{bottom:0;left:0;top:0}.ScrollbarLayout_faceHorizontal:after{bottom:4px;left:0;top:4px;width:100%}.ScrollbarLayout_faceVertical{left:0;right:0;top:0}.ScrollbarLayout_faceVertical:after{height:100%;left:4px;right:4px;top:0} \ No newline at end of file +.fixedDataTableCellGroupLayout_cellGroup{backface-visibility:hidden;left:0;overflow:hidden;position:absolute;top:0;white-space:nowrap}.fixedDataTableCellGroupLayout_cellGroup>.public_fixedDataTableCell_main{display:inline-block;vertical-align:top;white-space:normal}.fixedDataTableCellGroupLayout_cellGroupWrapper{position:absolute;top:0}.fixedDataTableCellLayout_main{border-right-style:solid;border-width:0 1px 0 0;box-sizing:border-box;display:block;overflow:hidden;position:absolute;white-space:normal}.fixedDataTableCellLayout_lastChild{border-width:0 1px 1px 0}.fixedDataTableCellLayout_alignRight{text-align:right}.fixedDataTableCellLayout_alignCenter{text-align:center}.fixedDataTableCellLayout_wrap1{display:table}.fixedDataTableCellLayout_wrap2{display:table-row}.fixedDataTableCellLayout_wrap3{display:table-cell;vertical-align:middle}.fixedDataTableCellLayout_columnResizerContainer{position:absolute;right:0;width:6px;z-index:1}.fixedDataTableCellLayout_columnResizerContainer:hover{cursor:ew-resize}.fixedDataTableCellLayout_columnResizerContainer:hover .fixedDataTableCellLayout_columnResizerKnob{visibility:visible}.fixedDataTableCellLayout_columnResizerKnob{position:absolute;right:0;visibility:hidden;width:4px}.fixedDataTableColumnResizerLineLayout_mouseArea{cursor:ew-resize;position:absolute;right:-5px;width:12px}.fixedDataTableColumnResizerLineLayout_main{border-right-style:solid;border-right-width:1px;box-sizing:border-box;position:absolute;z-index:10}body[dir="rtl"] .fixedDataTableColumnResizerLineLayout_main,.fixedDataTableColumnResizerLineLayout_hiddenElem{display:none!important}.fixedDataTableLayout_main{border-style:solid;border-width:1px;box-sizing:border-box;overflow:hidden;position:relative}.fixedDataTableLayout_header,.fixedDataTableLayout_hasBottomBorder{border-bottom-style:solid;border-bottom-width:1px}.fixedDataTableLayout_footer .public_fixedDataTableCell_main{border-top-style:solid;border-top-width:1px}.fixedDataTableLayout_topShadow,.fixedDataTableLayout_bottomShadow{height:4px;left:0;position:absolute;right:0;z-index:1}.fixedDataTableLayout_bottomShadow{margin-top:-4px}.fixedDataTableLayout_rowsContainer{overflow:hidden;position:relative}.fixedDataTableLayout_horizontalScrollbar{bottom:0;position:absolute}.fixedDataTableRowLayout_main{box-sizing:border-box;overflow:hidden;position:absolute;top:0}.fixedDataTableRowLayout_body{left:0;position:absolute;top:0}.fixedDataTableRowLayout_fixedColumnsDivider{backface-visibility:hidden;border-left-style:solid;border-left-width:1px;left:0;position:absolute;top:0;width:0}.fixedDataTableRowLayout_columnsShadow{width:4px}.fixedDataTableRowLayout_rowWrapper{position:absolute;top:0}.ScrollbarLayout_main{box-sizing:border-box;outline:none;overflow:hidden;position:absolute;transition-duration:250ms;transition-timing-function:ease;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ScrollbarLayout_mainVertical{bottom:0;right:0;top:0;transition-property:background-color width;width:15px}.ScrollbarLayout_mainVertical.public_Scrollbar_mainActive,.ScrollbarLayout_mainVertical:hover{width:17px}.ScrollbarLayout_mainHorizontal{bottom:0;height:15px;left:0;transition-property:background-color height}.ScrollbarLayout_mainHorizontal.public_Scrollbar_mainActive,.ScrollbarLayout_mainHorizontal:hover{height:17px}.ScrollbarLayout_face{left:0;overflow:hidden;position:absolute;z-index:1}.ScrollbarLayout_face:after{border-radius:6px;content:'';display:block;position:absolute;transition:background-color 250ms ease}.ScrollbarLayout_faceHorizontal{bottom:0;left:0;top:0}.ScrollbarLayout_faceHorizontal:after{bottom:4px;left:0;top:4px;width:100%}.ScrollbarLayout_faceVertical{left:0;right:0;top:0}.ScrollbarLayout_faceVertical:after{height:100%;left:4px;right:4px;top:0} \ No newline at end of file diff --git a/dist/fixed-data-table-style.css b/dist/fixed-data-table-style.css index f4f2bf60..3b70e1c2 100644 --- a/dist/fixed-data-table-style.css +++ b/dist/fixed-data-table-style.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.2 + * FixedDataTable v0.7.5 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -40,7 +40,6 @@ .public_fixedDataTable_header, .public_fixedDataTable_header .public_fixedDataTableCell_main { background-color: #f6f7f8; - background-image: -webkit-linear-gradient(#fff, #efefef); background-image: linear-gradient(#fff, #efefef); } diff --git a/dist/fixed-data-table-style.min.css b/dist/fixed-data-table-style.min.css index b6f8b867..843d1fa3 100644 --- a/dist/fixed-data-table-style.min.css +++ b/dist/fixed-data-table-style.min.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.2 + * FixedDataTable v0.7.5 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -9,4 +9,4 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -.public_fixedDataTable_main,.public_fixedDataTable_header,.public_fixedDataTable_hasBottomBorder{border-color:#d3d3d3}.public_fixedDataTable_header .public_fixedDataTableCell_main{font-weight:700}.public_fixedDataTable_header,.public_fixedDataTable_header .public_fixedDataTableCell_main{background-color:#f6f7f8;background-image:-webkit-linear-gradient(#fff,#efefef);background-image:linear-gradient(#fff,#efefef)}.public_fixedDataTable_footer .public_fixedDataTableCell_main{background-color:#f6f7f8;border-color:#d3d3d3}.public_fixedDataTable_topShadow{background:0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAECAYAAABP2FU6AAAAF0lEQVR4AWPUkNeSBhHCjJoK2twgFisAFagCCp3pJlAAAAAASUVORK5CYII=) repeat-x}.public_fixedDataTable_bottomShadow{background:0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAECAYAAABP2FU6AAAAHElEQVQI12MwNjZmZdAT1+Nm0JDWEGZQk1GTBgAWkwIeAEp52AAAAABJRU5ErkJggg==) repeat-x}.public_fixedDataTable_horizontalScrollbar .public_Scrollbar_mainHorizontal{background-color:#fff}.public_fixedDataTableCell_main{background-color:#fff;border-color:#d3d3d3}.public_fixedDataTableCell_highlighted{background-color:#f4f4f4}.public_fixedDataTableCell_cellContent{padding:8px}.public_fixedDataTableCell_columnResizerKnob{background-color:#0284ff}.public_fixedDataTableColumnResizerLine_main{border-color:#0284ff}.public_fixedDataTableRow_main{background-color:#fff}.public_fixedDataTableRow_highlighted,.public_fixedDataTableRow_highlighted .public_fixedDataTableCell_main{background-color:#f6f7f8}.public_fixedDataTableRow_fixedColumnsDivider{border-color:#d3d3d3}.public_fixedDataTableRow_columnsShadow{background:0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABCAYAAAD5PA/NAAAAFklEQVQIHWPSkNeSBmJhTQVtbiDNCgASagIIuJX8OgAAAABJRU5ErkJggg==) repeat-y}.public_Scrollbar_main.public_Scrollbar_mainActive,.public_Scrollbar_main:hover{background-color:rgba(255,255,255,.8)}.public_Scrollbar_mainOpaque,.public_Scrollbar_mainOpaque.public_Scrollbar_mainActive,.public_Scrollbar_mainOpaque:hover{background-color:#fff}.public_Scrollbar_face:after{background-color:#c2c2c2}.public_Scrollbar_main:hover .public_Scrollbar_face:after,.public_Scrollbar_mainActive .public_Scrollbar_face:after,.public_Scrollbar_faceActive:after{background-color:#7d7d7d} \ No newline at end of file +.public_fixedDataTable_main,.public_fixedDataTable_header,.public_fixedDataTable_hasBottomBorder{border-color:#d3d3d3}.public_fixedDataTable_header .public_fixedDataTableCell_main{font-weight:700}.public_fixedDataTable_header,.public_fixedDataTable_header .public_fixedDataTableCell_main{background-color:#f6f7f8;background-image:linear-gradient(#fff,#efefef)}.public_fixedDataTable_footer .public_fixedDataTableCell_main{background-color:#f6f7f8;border-color:#d3d3d3}.public_fixedDataTable_topShadow{background:0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAECAYAAABP2FU6AAAAF0lEQVR4AWPUkNeSBhHCjJoK2twgFisAFagCCp3pJlAAAAAASUVORK5CYII=) repeat-x}.public_fixedDataTable_bottomShadow{background:0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAECAYAAABP2FU6AAAAHElEQVQI12MwNjZmZdAT1+Nm0JDWEGZQk1GTBgAWkwIeAEp52AAAAABJRU5ErkJggg==) repeat-x}.public_fixedDataTable_horizontalScrollbar .public_Scrollbar_mainHorizontal{background-color:#fff}.public_fixedDataTableCell_main{background-color:#fff;border-color:#d3d3d3}.public_fixedDataTableCell_highlighted{background-color:#f4f4f4}.public_fixedDataTableCell_cellContent{padding:8px}.public_fixedDataTableCell_columnResizerKnob{background-color:#0284ff}.public_fixedDataTableColumnResizerLine_main{border-color:#0284ff}.public_fixedDataTableRow_main{background-color:#fff}.public_fixedDataTableRow_highlighted,.public_fixedDataTableRow_highlighted .public_fixedDataTableCell_main{background-color:#f6f7f8}.public_fixedDataTableRow_fixedColumnsDivider{border-color:#d3d3d3}.public_fixedDataTableRow_columnsShadow{background:0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABCAYAAAD5PA/NAAAAFklEQVQIHWPSkNeSBmJhTQVtbiDNCgASagIIuJX8OgAAAABJRU5ErkJggg==) repeat-y}.public_Scrollbar_main.public_Scrollbar_mainActive,.public_Scrollbar_main:hover{background-color:rgba(255,255,255,.8)}.public_Scrollbar_mainOpaque,.public_Scrollbar_mainOpaque.public_Scrollbar_mainActive,.public_Scrollbar_mainOpaque:hover{background-color:#fff}.public_Scrollbar_face:after{background-color:#c2c2c2}.public_Scrollbar_main:hover .public_Scrollbar_face:after,.public_Scrollbar_mainActive .public_Scrollbar_face:after,.public_Scrollbar_faceActive:after{background-color:#7d7d7d} \ No newline at end of file diff --git a/dist/fixed-data-table.css b/dist/fixed-data-table.css index 11c330b0..87131bf2 100644 --- a/dist/fixed-data-table.css +++ b/dist/fixed-data-table.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.2 + * FixedDataTable v0.7.5 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -21,8 +21,7 @@ */ .fixedDataTableCellGroupLayout_cellGroup { - -webkit-backface-visibility: hidden; - backface-visibility: hidden; + backface-visibility: hidden; left: 0; overflow: hidden; position: absolute; @@ -222,8 +221,7 @@ body[dir="rtl"] .fixedDataTableColumnResizerLineLayout_main { } .fixedDataTableRowLayout_fixedColumnsDivider { - -webkit-backface-visibility: hidden; - backface-visibility: hidden; + backface-visibility: hidden; border-left-style: solid; border-left-width: 1px; left: 0; @@ -256,10 +254,8 @@ body[dir="rtl"] .fixedDataTableColumnResizerLineLayout_main { outline: none; overflow: hidden; position: absolute; - -webkit-transition-duration: 250ms; - transition-duration: 250ms; - -webkit-transition-timing-function: ease; - transition-timing-function: ease; + transition-duration: 250ms; + transition-timing-function: ease; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; @@ -270,8 +266,7 @@ body[dir="rtl"] .fixedDataTableColumnResizerLineLayout_main { bottom: 0; right: 0; top: 0; - -webkit-transition-property: background-color width; - transition-property: background-color width; + transition-property: background-color width; width: 15px; } @@ -284,8 +279,7 @@ body[dir="rtl"] .fixedDataTableColumnResizerLineLayout_main { bottom: 0; height: 15px; left: 0; - -webkit-transition-property: background-color height; - transition-property: background-color height; + transition-property: background-color height; } /* Touching the scroll-track directly makes the scroll-track bolder */ @@ -312,8 +306,7 @@ body[dir="rtl"] .fixedDataTableColumnResizerLineLayout_main { content: ''; display: block; position: absolute; - -webkit-transition: background-color 250ms ease; - transition: background-color 250ms ease; + transition: background-color 250ms ease; } .ScrollbarLayout_faceHorizontal { @@ -372,7 +365,6 @@ body[dir="rtl"] .fixedDataTableColumnResizerLineLayout_main { .public_fixedDataTable_header, .public_fixedDataTable_header .public_fixedDataTableCell_main { background-color: #f6f7f8; - background-image: -webkit-linear-gradient(#fff, #efefef); background-image: linear-gradient(#fff, #efefef); } diff --git a/dist/fixed-data-table.js b/dist/fixed-data-table.js index 387e2af7..1c0e11e6 100644 --- a/dist/fixed-data-table.js +++ b/dist/fixed-data-table.js @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.2 + * FixedDataTable v0.7.5 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -18,7 +18,7 @@ exports["FixedDataTable"] = factory(require("react"), require("react-dom")); else root["FixedDataTable"] = factory(root["React"], root["ReactDOM"]); -})(this, function(__WEBPACK_EXTERNAL_MODULE_28__, __WEBPACK_EXTERNAL_MODULE_45__) { +})(this, function(__WEBPACK_EXTERNAL_MODULE_35__, __WEBPACK_EXTERNAL_MODULE_58__) { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; @@ -63,7 +63,7 @@ return /******/ (function(modules) { // webpackBootstrap /************************************************************************/ /******/ ([ /* 0 */ -/***/ function(module, exports, __webpack_require__) { +/***/ (function(module, exports, __webpack_require__) { __webpack_require__(1); __webpack_require__(5); @@ -79,88 +79,88 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = __webpack_require__(25); -/***/ }, +/***/ }), /* 1 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { // removed by extract-text-webpack-plugin -/***/ }, +/***/ }), /* 2 */, /* 3 */, /* 4 */, /* 5 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { // removed by extract-text-webpack-plugin -/***/ }, +/***/ }), /* 6 */, /* 7 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { // removed by extract-text-webpack-plugin -/***/ }, +/***/ }), /* 8 */, /* 9 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { // removed by extract-text-webpack-plugin -/***/ }, +/***/ }), /* 10 */, /* 11 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { // removed by extract-text-webpack-plugin -/***/ }, +/***/ }), /* 12 */, /* 13 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { // removed by extract-text-webpack-plugin -/***/ }, +/***/ }), /* 14 */, /* 15 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { // removed by extract-text-webpack-plugin -/***/ }, +/***/ }), /* 16 */, /* 17 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { // removed by extract-text-webpack-plugin -/***/ }, +/***/ }), /* 18 */, /* 19 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { // removed by extract-text-webpack-plugin -/***/ }, +/***/ }), /* 20 */, /* 21 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { // removed by extract-text-webpack-plugin -/***/ }, +/***/ }), /* 22 */, /* 23 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { // removed by extract-text-webpack-plugin -/***/ }, +/***/ }), /* 24 */, /* 25 */ -/***/ function(module, exports, __webpack_require__) { +/***/ (function(module, exports, __webpack_require__) { /** * Copyright (c) 2015, Facebook, Inc. @@ -176,9 +176,9 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; var FixedDataTable = __webpack_require__(26); - var FixedDataTableCellDefault = __webpack_require__(65); - var FixedDataTableColumn = __webpack_require__(63); - var FixedDataTableColumnGroup = __webpack_require__(62); + var FixedDataTableCellDefault = __webpack_require__(78); + var FixedDataTableColumn = __webpack_require__(76); + var FixedDataTableColumnGroup = __webpack_require__(75); var FixedDataTableRoot = { Cell: FixedDataTableCellDefault, @@ -190,9 +190,9 @@ return /******/ (function(modules) { // webpackBootstrap FixedDataTableRoot.version = '0.7.0'; module.exports = FixedDataTableRoot; -/***/ }, +/***/ }), /* 26 */ -/***/ function(module, exports, __webpack_require__) { +/***/ (function(module, exports, __webpack_require__) { /** * Copyright (c) 2015, Facebook, Inc. @@ -217,19 +217,27 @@ return /******/ (function(modules) { // webpackBootstrap var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - var React = __webpack_require__(27); + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - var ReactChildren = React.Children; + var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - var PropTypes = React.PropTypes; + function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var PropTypes = __webpack_require__(27); + + var React = __webpack_require__(34); + + var ReactChildren = React.Children; // New Table API - var Table = __webpack_require__(29); - var Column = __webpack_require__(73); - var ColumnGroup = __webpack_require__(74); + var Table = __webpack_require__(36); + var Column = __webpack_require__(86); + var ColumnGroup = __webpack_require__(87); // Transition Cell - var TransitionCell = __webpack_require__(75); + var TransitionCell = __webpack_require__(88); var NEXT_VERSION = '0.7.0'; var DOCUMENTATION_URL = 'https://fburl.com/FixedDataTable-v0.6'; @@ -298,508 +306,1585 @@ return /******/ (function(modules) { // webpackBootstrap * - Scrollable Body Columns: The body columns that move while scrolling * vertically or horizontally. */ - var TransitionTable = React.createClass({ - displayName: 'TransitionTable', - propTypes: { - /** - * Pixel width of table. If all columns do not fit, - * a horizontal scrollbar will appear. - */ - width: PropTypes.number.isRequired, + var TransitionTable = (function (_React$Component) { + _inherits(TransitionTable, _React$Component); + + _createClass(TransitionTable, null, [{ + key: 'propTypes', + value: { + /** + * Pixel width of table. If all columns do not fit, + * a horizontal scrollbar will appear. + */ + width: PropTypes.number.isRequired, + + /** + * Pixel height of table. If all rows do not fit, + * a vertical scrollbar will appear. + * + * Either `height` or `maxHeight` must be specified. + */ + height: PropTypes.number, + + /** + * Maximum pixel height of table. If all rows do not fit, + * a vertical scrollbar will appear. + * + * Either `height` or `maxHeight` must be specified. + */ + maxHeight: PropTypes.number, + + /** + * Pixel height of table's owner, this is used in a managed scrolling + * situation when you want to slide the table up from below the fold + * without having to constantly update the height on every scroll tick. + * Instead, vary this property on scroll. By using `ownerHeight`, we + * over-render the table while making sure the footer and horizontal + * scrollbar of the table are visible when the current space for the table + * in view is smaller than the final, over-flowing height of table. It + * allows us to avoid resizing and reflowing table when it is moving in the + * view. + * + * This is used if `ownerHeight < height` (or `maxHeight`). + */ + ownerHeight: PropTypes.number, + + overflowX: PropTypes.oneOf(['hidden', 'auto']), + overflowY: PropTypes.oneOf(['hidden', 'auto']), + + /** + * Number of rows in the table. + */ + rowsCount: PropTypes.number.isRequired, + + /** + * Pixel height of rows unless `rowHeightGetter` is specified and returns + * different value. + */ + rowHeight: PropTypes.number.isRequired, + + /** + * If specified, `rowHeightGetter(index)` is called for each row and the + * returned value overrides `rowHeight` for particular row. + */ + rowHeightGetter: PropTypes.func, + + /** + * DEPRECATED + * + * To get rows to display in table, `rowGetter(index)` + * is called. `rowGetter` should be smart enough to handle async + * fetching of data and return temporary objects + * while data is being fetched. + */ + rowGetter: PropTypes.func, + + /** + * To get any additional CSS classes that should be added to a row, + * `rowClassNameGetter(index)` is called. + */ + rowClassNameGetter: PropTypes.func, + + /** + * Pixel height of the column group header. + */ + groupHeaderHeight: PropTypes.number, + + /** + * Pixel height of header. + */ + headerHeight: PropTypes.number.isRequired, + + /** + * DEPRECATED + * + * Function that is called to get the data for the header row. + * If the function returns null, the header will be set to the + * Column's label property. + */ + headerDataGetter: PropTypes.func, + + /** + * Pixel height of footer. + */ + footerHeight: PropTypes.number, + + /** + * DEPRECATED - use footerDataGetter instead. + * Data that will be passed to footer cell renderers. + */ + footerData: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), + + /** + * DEPRECATED + * + * Function that is called to get the data for the footer row. + */ + footerDataGetter: PropTypes.func, + + /** + * Value of horizontal scroll. + */ + scrollLeft: PropTypes.number, + + /** + * Index of column to scroll to. + */ + scrollToColumn: PropTypes.number, + + /** + * Value of vertical scroll. + */ + scrollTop: PropTypes.number, + + /** + * Index of row to scroll to. + */ + scrollToRow: PropTypes.number, + + /** + * Callback that is called when scrolling starts with current horizontal + * and vertical scroll values. + */ + onScrollStart: PropTypes.func, + + /** + * Callback that is called when scrolling ends or stops with new horizontal + * and vertical scroll values. + */ + onScrollEnd: PropTypes.func, + + /** + * Callback that is called when `rowHeightGetter` returns a different height + * for a row than the `rowHeight` prop. This is necessary because initially + * table estimates heights of some parts of the content. + */ + onContentHeightChange: PropTypes.func, + + /** + * Callback that is called when a row is clicked. + */ + onRowClick: PropTypes.func, + + /** + * Callback that is called when a row is double clicked. + */ + onRowDoubleClick: PropTypes.func, + + /** + * Callback that is called when a mouse-down event happens on a row. + */ + onRowMouseDown: PropTypes.func, + + /** + * Callback that is called when a mouse-enter event happens on a row. + */ + onRowMouseEnter: PropTypes.func, + + /** + * Callback that is called when a mouse-leave event happens on a row. + */ + onRowMouseLeave: PropTypes.func, + + /** + * Callback that is called when resizer has been released + * and column needs to be updated. + * + * Required if the isResizable property is true on any column. + * + * ``` + * function( + * newColumnWidth: number, + * dataKey: string, + * ) + * ``` + */ + onColumnResizeEndCallback: PropTypes.func, + + /** + * Whether a column is currently being resized. + */ + isColumnResizing: PropTypes.bool + }, + enumerable: true + }]); - /** - * Pixel height of table. If all rows do not fit, - * a vertical scrollbar will appear. - * - * Either `height` or `maxHeight` must be specified. - */ - height: PropTypes.number, + function TransitionTable(props, context) { + var _this = this; - /** - * Maximum pixel height of table. If all rows do not fit, - * a vertical scrollbar will appear. - * - * Either `height` or `maxHeight` must be specified. - */ - maxHeight: PropTypes.number, + _classCallCheck(this, TransitionTable); - /** - * Pixel height of table's owner, this is used in a managed scrolling - * situation when you want to slide the table up from below the fold - * without having to constantly update the height on every scroll tick. - * Instead, vary this property on scroll. By using `ownerHeight`, we - * over-render the table while making sure the footer and horizontal - * scrollbar of the table are visible when the current space for the table - * in view is smaller than the final, over-flowing height of table. It - * allows us to avoid resizing and reflowing table when it is moving in the - * view. - * - * This is used if `ownerHeight < height` (or `maxHeight`). - */ - ownerHeight: PropTypes.number, + _get(Object.getPrototypeOf(TransitionTable.prototype), 'constructor', this).call(this, props, context); + // Throw warnings on deprecated props. - overflowX: PropTypes.oneOf(['hidden', 'auto']), - overflowY: PropTypes.oneOf(['hidden', 'auto']), + this._checkDeprecations = function () { + var needsMigration = false; - /** - * Number of rows in the table. - */ - rowsCount: PropTypes.number.isRequired, + if (_this.props.rowGetter) { + notifyDeprecated('rowGetter', 'Please use the cell API in Column to fetch data for your cells.'); - /** - * Pixel height of rows unless `rowHeightGetter` is specified and returns - * different value. - */ - rowHeight: PropTypes.number.isRequired, + // ROWGETTER??? You need to migrate. + needsMigration = true; + } - /** - * If specified, `rowHeightGetter(index)` is called for each row and the - * returned value overrides `rowHeight` for particular row. - */ - rowHeightGetter: PropTypes.func, + if (_this.props.headerDataGetter) { + notifyDeprecated('headerDataGetter', 'Please use the header API in Column to ' + 'fetch data for your header cells.'); + } - /** - * DEPRECATED - * - * To get rows to display in table, `rowGetter(index)` - * is called. `rowGetter` should be smart enough to handle async - * fetching of data and return temporary objects - * while data is being fetched. - */ - rowGetter: PropTypes.func, + if (_this.props.footerData) { + notifyDeprecated('footerData', 'Please use the footer API in Column to ' + 'fetch data for your footer cells.'); + } - /** - * To get any additional CSS classes that should be added to a row, - * `rowClassNameGetter(index)` is called. - */ - rowClassNameGetter: PropTypes.func, + if (_this.props.footerDataGetter) { + notifyDeprecated('footerDataGetter', 'Please use the footer API in Column to ' + 'fetch data for your footer cells.'); + } - /** - * Pixel height of the column group header. - */ - groupHeaderHeight: PropTypes.number, + ReactChildren.forEach(_this.props.children, function (child) { + if (!child || !child.props) { + return; + } - /** - * Pixel height of header. - */ - headerHeight: PropTypes.number.isRequired, + var props = child.props; - /** - * DEPRECATED - * - * Function that is called to get the data for the header row. - * If the function returns null, the header will be set to the - * Column's label property. - */ - headerDataGetter: PropTypes.func, + if (props.label) { + notifyDeprecated('label', 'Please use `header` instead.'); + } - /** - * Pixel height of footer. - */ - footerHeight: PropTypes.number, + if (props.dataKey) { + notifyDeprecated('dataKey', 'Please use the `cell` API to pass in a dataKey'); + } - /** - * DEPRECATED - use footerDataGetter instead. - * Data that will be passed to footer cell renderers. - */ - footerData: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), + if (props.cellRenderer) { + notifyDeprecated('cellRenderer', 'Please use the `cell` API to pass in a React Element instead.'); + } - /** - * DEPRECATED - * - * Function that is called to get the data for the footer row. - */ - footerDataGetter: PropTypes.func, + if (props.headerRenderer) { + notifyDeprecated('headerRenderer', 'Please use the `header` API to pass in a React Element instead.'); + } - /** - * Value of horizontal scroll. - */ - scrollLeft: PropTypes.number, + if (props.columnData) { + notifyDeprecated('columnData', 'Please pass data in through props to your header, cell or footer.'); + } - /** - * Index of column to scroll to. - */ - scrollToColumn: PropTypes.number, + if (props.groupHeaderRenderer) { + notifyDeprecated('groupHeaderRenderer', 'Please use the `header` API in ColumnGroup to ' + 'pass in a React Element instead of a function that creates one.'); + } - /** - * Value of vertical scroll. - */ - scrollTop: PropTypes.number, + if (props.groupHeaderData) { + notifyDeprecated('groupHeaderData', 'Please pass in any data through props to your header.'); + } + }); - /** - * Index of row to scroll to. - */ - scrollToRow: PropTypes.number, + return needsMigration; + }; - /** - * Callback that is called when scrolling starts with current horizontal - * and vertical scroll values. - */ - onScrollStart: PropTypes.func, + this._onRowAction = function (props, callback) { + if (!callback) { + return undefined; + } - /** - * Callback that is called when scrolling ends or stops with new horizontal - * and vertical scroll values. - */ - onScrollEnd: PropTypes.func, + return function (e, rowIndex) { + callback(e, rowIndex, props.rowGetter && props.rowGetter(rowIndex) || EMPTY_OBJECT); + }; + }; - /** - * Callback that is called when `rowHeightGetter` returns a different height - * for a row than the `rowHeight` prop. This is necessary because initially - * table estimates heights of some parts of the content. - */ - onContentHeightChange: PropTypes.func, + this._transformColumn = function (column, tableProps, key) { + + var props = column.props; + + if (column.type.__TableColumn__) { + // Constuct the cell to be used using the rowGetter + return React.createElement(Column, _extends({ + key: 'column_' + key + }, props, { + header: React.createElement(TransitionCell, { + isHeaderCell: true, + label: props.label, + width: props.width, + dataKey: props.dataKey, + className: props.headerClassName, + columnData: props.columnData || EMPTY_OBJECT, + cellRenderer: props.headerRenderer, + headerDataGetter: tableProps.headerDataGetter + }), + columnKey: props.dataKey, + cell: React.createElement(TransitionCell, { + dataKey: props.dataKey, + className: props.cellClassName, + rowGetter: tableProps.rowGetter, + width: props.width, + columnData: props.columnData || EMPTY_OBJECT, + cellDataGetter: props.cellDataGetter, + cellRenderer: props.cellRenderer + }), + footer: React.createElement(TransitionCell, { + isFooterCell: true, + className: props.footerClassName, + dataKey: props.dataKey, + cellRenderer: props.footerRenderer, + footerDataGetter: tableProps.footerDataGetter, + footerData: tableProps.footerData || EMPTY_OBJECT + }) + })); + } + }; - /** - * Callback that is called when a row is clicked. - */ - onRowClick: PropTypes.func, + this._transformColumnGroup = function (group, tableProps, key, labels) { + var props = group.props; - /** - * Callback that is called when a row is double clicked. - */ - onRowDoubleClick: PropTypes.func, + var j = 0; + var columns = ReactChildren.map(props.children, function (child) { + j++; + return _this._transformColumn(child, tableProps, key + '_' + j); + }); - /** - * Callback that is called when a mouse-down event happens on a row. - */ - onRowMouseDown: PropTypes.func, + return React.createElement( + ColumnGroup, + _extends({}, props, { + key: 'group_' + key, + header: React.createElement(TransitionCell, { + isHeaderCell: true, + label: group.props.label, + dataKey: key, + groupHeaderRenderer: props.groupHeaderRenderer, + groupHeaderLabels: labels, + groupHeaderData: props.columnGroupData || EMPTY_OBJECT + }) }), + columns + ); + }; - /** - * Callback that is called when a mouse-enter event happens on a row. - */ - onRowMouseEnter: PropTypes.func, + this._convertedColumns = function (needsMigration) { + // If we don't need to migrate, map directly to the new API. + if (!needsMigration) { + return ReactChildren.map(_this.props.children, function (child) { - /** - * Callback that is called when a mouse-leave event happens on a row. - */ - onRowMouseLeave: PropTypes.func, + if (!child) { + return null; + } - /** - * Callback that is called when resizer has been released - * and column needs to be updated. - * - * Required if the isResizable property is true on any column. - * - * ``` - * function( - * newColumnWidth: number, - * dataKey: string, - * ) - * ``` - */ - onColumnResizeEndCallback: PropTypes.func, + if (child.type.__TableColumn__) { + return React.createElement(Column, child.props); + } - /** - * Whether a column is currently being resized. - */ - isColumnResizing: PropTypes.bool - }, + if (child.type.__TableColumnGroup__) { + return React.createElement(ColumnGroup, child.props); + } + }); + } - getInitialState: function getInitialState() { - // Throw warnings on deprecated props. - var state = {}; - state.needsMigration = this._checkDeprecations(); + var tableProps = _this.props; - return state; - }, + // Otherwise, if a migration is needed, we need to transform each Column + // or ColumnGroup. + var i = 0; + return ReactChildren.map(_this.props.children, function (child) { + + if (!child) { + return null; + } - _checkDeprecations: function _checkDeprecations() { - var needsMigration = false; + if (child.type.__TableColumn__) { + child = _this._transformColumn(child, tableProps, i); + } - if (this.props.rowGetter) { - notifyDeprecated('rowGetter', 'Please use the cell API in Column to fetch data for your cells.'); + if (child.type.__TableColumnGroup__) { + // Since we apparently give an array of labels to groupHeaderRenderer + var labels = []; + ReactChildren.forEach(_this.props.children, function (child) { + labels.push(child.props.label); + }); - // ROWGETTER??? You need to migrate. - needsMigration = true; - } + child = _this._transformColumnGroup(child, tableProps, i, labels); + } - if (this.props.headerDataGetter) { - notifyDeprecated('headerDataGetter', 'Please use the header API in Column to ' + 'fetch data for your header cells.'); - } + i++; + return child; + }); + }; - if (this.props.footerData) { - notifyDeprecated('footerData', 'Please use the footer API in Column to ' + 'fetch data for your footer cells.'); - } + var state = {}; + state.needsMigration = this._checkDeprecations(); + + this.state = state; + } - if (this.props.footerDataGetter) { - notifyDeprecated('footerDataGetter', 'Please use the footer API in Column to ' + 'fetch data for your footer cells.'); + _createClass(TransitionTable, [{ + key: 'render', + value: function render() { + var props = this.props; + return React.createElement( + Table, + _extends({}, props, { + onRowMouseDown: this._onRowAction(props, props.onRowMouseDown), + onRowClick: this._onRowAction(props, props.onRowClick), + onRowDoubleClick: this._onRowAction(props, props.onRowDoubleClick), + onRowMouseEnter: this._onRowAction(props, props.onRowMouseEnter), + onRowMouseLeave: this._onRowAction(props, props.onRowMouseLeave) + }), + this._convertedColumns(this.state.needsMigration) + ); } + }]); - ReactChildren.forEach(this.props.children, function (child) { - if (!child || !child.props) { - return; - } + return TransitionTable; + })(React.Component); - var props = child.props; + module.exports = TransitionTable; - if (props.label) { - notifyDeprecated('label', 'Please use `header` instead.'); - } + // Wrapper for onRow callbacks, since we don't have rowData at that level. - if (props.dataKey) { - notifyDeprecated('dataKey', 'Please use the `cell` API to pass in a dataKey'); - } +/***/ }), +/* 27 */ +/***/ (function(module, exports, __webpack_require__) { - if (props.cellRenderer) { - notifyDeprecated('cellRenderer', 'Please use the `cell` API to pass in a React Element instead.'); - } + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ - if (props.headerRenderer) { - notifyDeprecated('headerRenderer', 'Please use the `header` API to pass in a React Element instead.'); - } + if (process.env.NODE_ENV !== 'production') { + var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' && + Symbol.for && + Symbol.for('react.element')) || + 0xeac7; - if (props.columnData) { - notifyDeprecated('columnData', 'Please pass data in through props to your header, cell or footer.'); - } + var isValidElement = function(object) { + return typeof object === 'object' && + object !== null && + object.$$typeof === REACT_ELEMENT_TYPE; + }; - if (props.groupHeaderRenderer) { - notifyDeprecated('groupHeaderRenderer', 'Please use the `header` API in ColumnGroup to ' + 'pass in a React Element instead of a function that creates one.'); - } + // By explicitly using `prop-types` you are opting into new development behavior. + // http://fb.me/prop-types-in-prod + var throwOnDirectAccess = true; + module.exports = __webpack_require__(29)(isValidElement, throwOnDirectAccess); + } else { + // By explicitly using `prop-types` you are opting into new production behavior. + // http://fb.me/prop-types-in-prod + module.exports = __webpack_require__(33)(); + } - if (props.groupHeaderData) { - notifyDeprecated('groupHeaderData', 'Please pass in any data through props to your header.'); - } - }); + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(28))) - return needsMigration; - }, +/***/ }), +/* 28 */ +/***/ (function(module, exports) { - // Wrapper for onRow callbacks, since we don't have rowData at that level. - _onRowAction: function _onRowAction(props, callback) { - if (!callback) { - return undefined; + // shim for using process in browser + var process = module.exports = {}; + + // cached from whatever global is present so that test runners that stub it + // don't break things. But we need to wrap it in a try catch in case it is + // wrapped in strict mode code which doesn't define any globals. It's inside a + // function because try/catches deoptimize in certain engines. + + var cachedSetTimeout; + var cachedClearTimeout; + + function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); + } + function defaultClearTimeout () { + throw new Error('clearTimeout has not been defined'); + } + (function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } + } ()) + function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + //normal enviroments in sane situations + return setTimeout(fun, 0); + } + // if setTimeout wasn't available but was latter defined + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedSetTimeout(fun, 0); + } catch(e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedSetTimeout.call(null, fun, 0); + } catch(e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error + return cachedSetTimeout.call(this, fun, 0); + } } - return function (e, rowIndex) { - callback(e, rowIndex, props.rowGetter && props.rowGetter(rowIndex) || EMPTY_OBJECT); - }; - }, - _transformColumn: function _transformColumn(column, tableProps, key) { - - var props = column.props; - - if (column.type.__TableColumn__) { - // Constuct the cell to be used using the rowGetter - return React.createElement(Column, _extends({ - key: 'column_' + key - }, props, { - header: React.createElement(TransitionCell, { - isHeaderCell: true, - label: props.label, - width: props.width, - dataKey: props.dataKey, - className: props.headerClassName, - columnData: props.columnData || EMPTY_OBJECT, - cellRenderer: props.headerRenderer, - headerDataGetter: tableProps.headerDataGetter - }), - columnKey: props.dataKey, - cell: React.createElement(TransitionCell, { - dataKey: props.dataKey, - className: props.cellClassName, - rowGetter: tableProps.rowGetter, - width: props.width, - columnData: props.columnData || EMPTY_OBJECT, - cellDataGetter: props.cellDataGetter, - cellRenderer: props.cellRenderer - }), - footer: React.createElement(TransitionCell, { - isFooterCell: true, - className: props.footerClassName, - dataKey: props.dataKey, - cellRenderer: props.footerRenderer, - footerDataGetter: tableProps.footerDataGetter, - footerData: tableProps.footerData || EMPTY_OBJECT - }) - })); + } + function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + //normal enviroments in sane situations + return clearTimeout(marker); + } + // if clearTimeout wasn't available but was latter defined + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedClearTimeout(marker); + } catch (e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedClearTimeout.call(null, marker); + } catch (e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. + // Some versions of I.E. have different rules for clearTimeout vs setTimeout + return cachedClearTimeout.call(this, marker); + } } - }, - _transformColumnGroup: function _transformColumnGroup(group, tableProps, key, labels) { - var _this = this; - var props = group.props; - var j = 0; - var columns = ReactChildren.map(props.children, function (child) { - j++; - return _this._transformColumn(child, tableProps, key + '_' + j); - }); + } + var queue = []; + var draining = false; + var currentQueue; + var queueIndex = -1; - return React.createElement( - ColumnGroup, - _extends({}, props, { - key: 'group_' + key, - header: React.createElement(TransitionCell, { - isHeaderCell: true, - label: group.props.label, - dataKey: key, - groupHeaderRenderer: props.groupHeaderRenderer, - groupHeaderLabels: labels, - groupHeaderData: props.columnGroupData || EMPTY_OBJECT - }) }), - columns - ); - }, + function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } + } - _convertedColumns: function _convertedColumns(needsMigration) { - var _this2 = this; + function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; - // If we don't need to migrate, map directly to the new API. - if (!needsMigration) { - return ReactChildren.map(this.props.children, function (child) { + var len = queue.length; + while(len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + runClearTimeout(timeout); + } - if (!child) { - return null; + process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } + }; - if (child.type.__TableColumn__) { - return React.createElement(Column, child.props); + // v8 likes predictible objects + function Item(fun, array) { + this.fun = fun; + this.array = array; + } + Item.prototype.run = function () { + this.fun.apply(null, this.array); + }; + process.title = 'browser'; + process.browser = true; + process.env = {}; + process.argv = []; + process.version = ''; // empty string to avoid regexp issues + process.versions = {}; + + function noop() {} + + process.on = noop; + process.addListener = noop; + process.once = noop; + process.off = noop; + process.removeListener = noop; + process.removeAllListeners = noop; + process.emit = noop; + process.prependListener = noop; + process.prependOnceListener = noop; + + process.listeners = function (name) { return [] } + + process.binding = function (name) { + throw new Error('process.binding is not supported'); + }; + + process.cwd = function () { return '/' }; + process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); + }; + process.umask = function() { return 0; }; + + +/***/ }), +/* 29 */ +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + 'use strict'; + + var assign = __webpack_require__(30); + + var ReactPropTypesSecret = __webpack_require__(31); + var checkPropTypes = __webpack_require__(32); + + var printWarning = function() {}; + + if (process.env.NODE_ENV !== 'production') { + printWarning = function(text) { + var message = 'Warning: ' + text; + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; + } + + function emptyFunctionThatReturnsNull() { + return null; + } + + module.exports = function(isValidElement, throwOnDirectAccess) { + /* global Symbol */ + var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. + + /** + * Returns the iterator method function contained on the iterable object. + * + * Be sure to invoke the function with the iterable as context: + * + * var iteratorFn = getIteratorFn(myIterable); + * if (iteratorFn) { + * var iterator = iteratorFn.call(myIterable); + * ... + * } + * + * @param {?object} maybeIterable + * @return {?function} + */ + function getIteratorFn(maybeIterable) { + var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); + if (typeof iteratorFn === 'function') { + return iteratorFn; + } + } + + /** + * Collection of methods that allow declaration and validation of props that are + * supplied to React components. Example usage: + * + * var Props = require('ReactPropTypes'); + * var MyArticle = React.createClass({ + * propTypes: { + * // An optional string prop named "description". + * description: Props.string, + * + * // A required enum prop named "category". + * category: Props.oneOf(['News','Photos']).isRequired, + * + * // A prop named "dialog" that requires an instance of Dialog. + * dialog: Props.instanceOf(Dialog).isRequired + * }, + * render: function() { ... } + * }); + * + * A more formal specification of how these methods are used: + * + * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) + * decl := ReactPropTypes.{type}(.isRequired)? + * + * Each and every declaration produces a function with the same signature. This + * allows the creation of custom validation functions. For example: + * + * var MyLink = React.createClass({ + * propTypes: { + * // An optional string or URI prop named "href". + * href: function(props, propName, componentName) { + * var propValue = props[propName]; + * if (propValue != null && typeof propValue !== 'string' && + * !(propValue instanceof URI)) { + * return new Error( + * 'Expected a string or an URI for ' + propName + ' in ' + + * componentName + * ); + * } + * } + * }, + * render: function() {...} + * }); + * + * @internal + */ + + var ANONYMOUS = '<>'; + + // Important! + // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. + var ReactPropTypes = { + array: createPrimitiveTypeChecker('array'), + bool: createPrimitiveTypeChecker('boolean'), + func: createPrimitiveTypeChecker('function'), + number: createPrimitiveTypeChecker('number'), + object: createPrimitiveTypeChecker('object'), + string: createPrimitiveTypeChecker('string'), + symbol: createPrimitiveTypeChecker('symbol'), + + any: createAnyTypeChecker(), + arrayOf: createArrayOfTypeChecker, + element: createElementTypeChecker(), + instanceOf: createInstanceTypeChecker, + node: createNodeChecker(), + objectOf: createObjectOfTypeChecker, + oneOf: createEnumTypeChecker, + oneOfType: createUnionTypeChecker, + shape: createShapeTypeChecker, + exact: createStrictShapeTypeChecker, + }; + + /** + * inlined Object.is polyfill to avoid requiring consumers ship their own + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is + */ + /*eslint-disable no-self-compare*/ + function is(x, y) { + // SameValue algorithm + if (x === y) { + // Steps 1-5, 7-10 + // Steps 6.b-6.e: +0 != -0 + return x !== 0 || 1 / x === 1 / y; + } else { + // Step 6.a: NaN == NaN + return x !== x && y !== y; + } + } + /*eslint-enable no-self-compare*/ + + /** + * We use an Error-like object for backward compatibility as people may call + * PropTypes directly and inspect their output. However, we don't use real + * Errors anymore. We don't inspect their stack anyway, and creating them + * is prohibitively expensive if they are created too often, such as what + * happens in oneOfType() for any type before the one that matched. + */ + function PropTypeError(message) { + this.message = message; + this.stack = ''; + } + // Make `instanceof Error` still work for returned errors. + PropTypeError.prototype = Error.prototype; + + function createChainableTypeChecker(validate) { + if (process.env.NODE_ENV !== 'production') { + var manualPropTypeCallCache = {}; + var manualPropTypeWarningCount = 0; + } + function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { + componentName = componentName || ANONYMOUS; + propFullName = propFullName || propName; + + if (secret !== ReactPropTypesSecret) { + if (throwOnDirectAccess) { + // New behavior only for users of `prop-types` package + var err = new Error( + 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + + 'Use `PropTypes.checkPropTypes()` to call them. ' + + 'Read more at http://fb.me/use-check-prop-types' + ); + err.name = 'Invariant Violation'; + throw err; + } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') { + // Old behavior for people using React.PropTypes + var cacheKey = componentName + ':' + propName; + if ( + !manualPropTypeCallCache[cacheKey] && + // Avoid spamming the console because they are often not actionable except for lib authors + manualPropTypeWarningCount < 3 + ) { + printWarning( + 'You are manually calling a React.PropTypes validation ' + + 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + + 'and will throw in the standalone `prop-types` package. ' + + 'You may be seeing this warning due to a third-party PropTypes ' + + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.' + ); + manualPropTypeCallCache[cacheKey] = true; + manualPropTypeWarningCount++; + } } + } + if (props[propName] == null) { + if (isRequired) { + if (props[propName] === null) { + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); + } + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); + } + return null; + } else { + return validate(props, propName, componentName, location, propFullName); + } + } - if (child.type.__TableColumnGroup__) { - return React.createElement(ColumnGroup, child.props); + var chainedCheckType = checkType.bind(null, false); + chainedCheckType.isRequired = checkType.bind(null, true); + + return chainedCheckType; + } + + function createPrimitiveTypeChecker(expectedType) { + function validate(props, propName, componentName, location, propFullName, secret) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== expectedType) { + // `propValue` being instance of, say, date/regexp, pass the 'object' + // check, but we can offer a more precise error message here rather than + // 'of type `object`'. + var preciseType = getPreciseType(propValue); + + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createAnyTypeChecker() { + return createChainableTypeChecker(emptyFunctionThatReturnsNull); + } + + function createArrayOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); + } + var propValue = props[propName]; + if (!Array.isArray(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); + } + for (var i = 0; i < propValue.length; i++) { + var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); + if (error instanceof Error) { + return error; } - }); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createElementTypeChecker() { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + if (!isValidElement(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); + } + return null; } + return createChainableTypeChecker(validate); + } - var tableProps = this.props; + function createInstanceTypeChecker(expectedClass) { + function validate(props, propName, componentName, location, propFullName) { + if (!(props[propName] instanceof expectedClass)) { + var expectedClassName = expectedClass.name || ANONYMOUS; + var actualClassName = getClassName(props[propName]); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); + } + return null; + } + return createChainableTypeChecker(validate); + } - // Otherwise, if a migration is needed, we need to transform each Column - // or ColumnGroup. - var i = 0; - return ReactChildren.map(this.props.children, function (child) { + function createEnumTypeChecker(expectedValues) { + if (!Array.isArray(expectedValues)) { + process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOf, expected an instance of array.') : void 0; + return emptyFunctionThatReturnsNull; + } - if (!child) { - return null; + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + for (var i = 0; i < expectedValues.length; i++) { + if (is(propValue, expectedValues[i])) { + return null; + } } - if (child.type.__TableColumn__) { - child = _this2._transformColumn(child, tableProps, i); + var valuesString = JSON.stringify(expectedValues); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); + } + return createChainableTypeChecker(validate); + } + + function createObjectOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); + } + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); + } + for (var key in propValue) { + if (propValue.hasOwnProperty(key)) { + var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error instanceof Error) { + return error; + } + } } + return null; + } + return createChainableTypeChecker(validate); + } - if (child.type.__TableColumnGroup__) { - // Since we apparently give an array of labels to groupHeaderRenderer - var labels = []; - ReactChildren.forEach(_this2.props.children, function (child) { - labels.push(child.props.label); - }); + function createUnionTypeChecker(arrayOfTypeCheckers) { + if (!Array.isArray(arrayOfTypeCheckers)) { + process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0; + return emptyFunctionThatReturnsNull; + } - child = _this2._transformColumnGroup(child, tableProps, i, labels); + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (typeof checker !== 'function') { + printWarning( + 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.' + ); + return emptyFunctionThatReturnsNull; } + } - i++; - return child; - }); - }, + function validate(props, propName, componentName, location, propFullName) { + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) { + return null; + } + } - render: function render() { - var props = this.props; - return React.createElement( - Table, - _extends({}, props, { - onRowMouseDown: this._onRowAction(props, props.onRowMouseDown), - onRowClick: this._onRowAction(props, props.onRowClick), - onRowDoubleClick: this._onRowAction(props, props.onRowDoubleClick), - onRowMouseEnter: this._onRowAction(props, props.onRowMouseEnter), - onRowMouseLeave: this._onRowAction(props, props.onRowMouseLeave) - }), - this._convertedColumns(this.state.needsMigration) - ); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); + } + return createChainableTypeChecker(validate); } - }); - module.exports = TransitionTable; + function createNodeChecker() { + function validate(props, propName, componentName, location, propFullName) { + if (!isNode(props[propName])) { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); + } + return null; + } + return createChainableTypeChecker(validate); + } -/***/ }, -/* 27 */ -/***/ function(module, exports, __webpack_require__) { + function createShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + for (var key in shapeTypes) { + var checker = shapeTypes[key]; + if (!checker) { + continue; + } + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createStrictShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + // We need to check all keys in case some are required but missing from + // props. + var allKeys = assign({}, props[propName], shapeTypes); + for (var key in allKeys) { + var checker = shapeTypes[key]; + if (!checker) { + return new PropTypeError( + 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ') + ); + } + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error) { + return error; + } + } + return null; + } + + return createChainableTypeChecker(validate); + } + + function isNode(propValue) { + switch (typeof propValue) { + case 'number': + case 'string': + case 'undefined': + return true; + case 'boolean': + return !propValue; + case 'object': + if (Array.isArray(propValue)) { + return propValue.every(isNode); + } + if (propValue === null || isValidElement(propValue)) { + return true; + } + + var iteratorFn = getIteratorFn(propValue); + if (iteratorFn) { + var iterator = iteratorFn.call(propValue); + var step; + if (iteratorFn !== propValue.entries) { + while (!(step = iterator.next()).done) { + if (!isNode(step.value)) { + return false; + } + } + } else { + // Iterator will provide entry [k,v] tuples rather than values. + while (!(step = iterator.next()).done) { + var entry = step.value; + if (entry) { + if (!isNode(entry[1])) { + return false; + } + } + } + } + } else { + return false; + } + + return true; + default: + return false; + } + } + + function isSymbol(propType, propValue) { + // Native Symbol. + if (propType === 'symbol') { + return true; + } + + // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' + if (propValue['@@toStringTag'] === 'Symbol') { + return true; + } + + // Fallback for non-spec compliant Symbols which are polyfilled. + if (typeof Symbol === 'function' && propValue instanceof Symbol) { + return true; + } + + return false; + } + + // Equivalent of `typeof` but with special handling for array and regexp. + function getPropType(propValue) { + var propType = typeof propValue; + if (Array.isArray(propValue)) { + return 'array'; + } + if (propValue instanceof RegExp) { + // Old webkits (at least until Android 4.0) return 'function' rather than + // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ + // passes PropTypes.object. + return 'object'; + } + if (isSymbol(propType, propValue)) { + return 'symbol'; + } + return propType; + } + + // This handles more types than `getPropType`. Only used for error messages. + // See `createPrimitiveTypeChecker`. + function getPreciseType(propValue) { + if (typeof propValue === 'undefined' || propValue === null) { + return '' + propValue; + } + var propType = getPropType(propValue); + if (propType === 'object') { + if (propValue instanceof Date) { + return 'date'; + } else if (propValue instanceof RegExp) { + return 'regexp'; + } + } + return propType; + } + + // Returns a string that is postfixed to a warning about an invalid type. + // For example, "undefined" or "of type array" + function getPostfixForTypeWarning(value) { + var type = getPreciseType(value); + switch (type) { + case 'array': + case 'object': + return 'an ' + type; + case 'boolean': + case 'date': + case 'regexp': + return 'a ' + type; + default: + return type; + } + } + + // Returns class name of the object, if any. + function getClassName(propValue) { + if (!propValue.constructor || !propValue.constructor.name) { + return ANONYMOUS; + } + return propValue.constructor.name; + } + + ReactPropTypes.checkPropTypes = checkPropTypes; + ReactPropTypes.PropTypes = ReactPropTypes; + + return ReactPropTypes; + }; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(28))) + +/***/ }), +/* 30 */ +/***/ (function(module, exports) { + + /* + object-assign + (c) Sindre Sorhus + @license MIT + */ + + 'use strict'; + /* eslint-disable no-unused-vars */ + var getOwnPropertySymbols = Object.getOwnPropertySymbols; + var hasOwnProperty = Object.prototype.hasOwnProperty; + var propIsEnumerable = Object.prototype.propertyIsEnumerable; + + function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + + return Object(val); + } + + function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } + + // Detect buggy property enumeration order in older V8 versions. + + // https://bugs.chromium.org/p/v8/issues/detail?id=4118 + var test1 = new String('abc'); // eslint-disable-line no-new-wrappers + test1[5] = 'de'; + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test2 = {}; + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + if (order2.join('') !== '0123456789') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join('') !== + 'abcdefghijklmnopqrst') { + return false; + } + + return true; + } catch (err) { + // We don't expect any of the above to throw, but better to be safe. + return false; + } + } + + module.exports = shouldUseNative() ? Object.assign : function (target, source) { + var from; + var to = toObject(target); + var symbols; + + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); + + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + + if (getOwnPropertySymbols) { + symbols = getOwnPropertySymbols(from); + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } + + return to; + }; + + +/***/ }), +/* 31 */ +/***/ (function(module, exports) { /** - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * Copyright (c) 2013-present, Facebook, Inc. * - * @providesModule React + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. */ 'use strict'; - module.exports = __webpack_require__(28); + var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; -/***/ }, -/* 28 */ -/***/ function(module, exports) { + module.exports = ReactPropTypesSecret; - module.exports = __WEBPACK_EXTERNAL_MODULE_28__; -/***/ }, -/* 29 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 32 */ +/***/ (function(module, exports, __webpack_require__) { - /** - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright (c) 2013-present, Facebook, Inc. * - * @providesModule FixedDataTableNew.react - * @typechecks - * @noflow + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. */ - /*eslint no-bitwise:1*/ - 'use strict'; - var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - - var React = __webpack_require__(27); - var ReactComponentWithPureRenderMixin = __webpack_require__(30); - var ReactWheelHandler = __webpack_require__(31); - var Scrollbar = __webpack_require__(39); - var FixedDataTableBufferedRows = __webpack_require__(53); - var FixedDataTableColumnResizeHandle = __webpack_require__(67); - var FixedDataTableRow = __webpack_require__(58); - var FixedDataTableScrollHelper = __webpack_require__(68); - var FixedDataTableWidthHelper = __webpack_require__(70); - - var cx = __webpack_require__(47); - var debounceCore = __webpack_require__(71); - var emptyFunction = __webpack_require__(32); - var invariant = __webpack_require__(52); - var joinClasses = __webpack_require__(66); - var shallowEqual = __webpack_require__(72); - var translateDOMPositionXY = __webpack_require__(48); - - var PropTypes = React.PropTypes; + var printWarning = function() {}; - var ReactChildren = React.Children; + if (process.env.NODE_ENV !== 'production') { + var ReactPropTypesSecret = __webpack_require__(31); + var loggedTypeFailures = {}; - var EMPTY_OBJECT = {}; - var BORDER_HEIGHT = 1; - var HEADER = 'header'; - var FOOTER = 'footer'; - var CELL = 'cell'; + printWarning = function(text) { + var message = 'Warning: ' + text; + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; + } /** - * Data grid component with fixed or scrollable header and columns. - * - * The layout of the data table is as follows: - * - * ``` - * +---------------------------------------------------+ - * | Fixed Column Group | Scrollable Column Group | - * | Header | Header | - * | | | + * Assert that the values match with the type specs. + * Error messages are memorized and will only be shown once. + * + * @param {object} typeSpecs Map of name to a ReactPropType + * @param {object} values Runtime values that need to be type-checked + * @param {string} location e.g. "prop", "context", "child context" + * @param {string} componentName Name of the component for error messages. + * @param {?Function} getStack Returns the component stack. + * @private + */ + function checkPropTypes(typeSpecs, values, location, componentName, getStack) { + if (process.env.NODE_ENV !== 'production') { + for (var typeSpecName in typeSpecs) { + if (typeSpecs.hasOwnProperty(typeSpecName)) { + var error; + // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + if (typeof typeSpecs[typeSpecName] !== 'function') { + var err = Error( + (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + ); + err.name = 'Invariant Violation'; + throw err; + } + error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); + } catch (ex) { + error = ex; + } + if (error && !(error instanceof Error)) { + printWarning( + (componentName || 'React class') + ': type specification of ' + + location + ' `' + typeSpecName + '` is invalid; the type checker ' + + 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' + + 'You may have forgotten to pass an argument to the type checker ' + + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + + 'shape all require an argument).' + ) + + } + if (error instanceof Error && !(error.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error.message] = true; + + var stack = getStack ? getStack() : ''; + + printWarning( + 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '') + ); + } + } + } + } + } + + module.exports = checkPropTypes; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(28))) + +/***/ }), +/* 33 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + 'use strict'; + + var ReactPropTypesSecret = __webpack_require__(31); + + function emptyFunction() {} + + module.exports = function() { + function shim(props, propName, componentName, location, propFullName, secret) { + if (secret === ReactPropTypesSecret) { + // It is still safe when called from React. + return; + } + var err = new Error( + 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + + 'Use PropTypes.checkPropTypes() to call them. ' + + 'Read more at http://fb.me/use-check-prop-types' + ); + err.name = 'Invariant Violation'; + throw err; + }; + shim.isRequired = shim; + function getShim() { + return shim; + }; + // Important! + // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. + var ReactPropTypes = { + array: shim, + bool: shim, + func: shim, + number: shim, + object: shim, + string: shim, + symbol: shim, + + any: shim, + arrayOf: getShim, + element: shim, + instanceOf: getShim, + node: shim, + objectOf: getShim, + oneOf: getShim, + oneOfType: getShim, + shape: getShim, + exact: getShim + }; + + ReactPropTypes.checkPropTypes = emptyFunction; + ReactPropTypes.PropTypes = ReactPropTypes; + + return ReactPropTypes; + }; + + +/***/ }), +/* 34 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * Copyright (c) 2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule React + */ + + 'use strict'; + + module.exports = __webpack_require__(35); + +/***/ }), +/* 35 */ +/***/ (function(module, exports) { + + module.exports = __WEBPACK_EXTERNAL_MODULE_35__; + +/***/ }), +/* 36 */ +/***/ (function(module, exports, __webpack_require__) { + + "use strict"; + + var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + + var PropTypes = __webpack_require__(27); + /** + * Copyright (c) 2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule FixedDataTableNew.react + * @typechecks + * @noflow + */ + + /*eslint no-bitwise:1*/ + + var React = __webpack_require__(34); + var createReactClass = __webpack_require__(37); + var ReactComponentWithPureRenderMixin = __webpack_require__(43); + var ReactWheelHandler = __webpack_require__(44); + var Scrollbar = __webpack_require__(52); + var FixedDataTableBufferedRows = __webpack_require__(66); + var FixedDataTableColumnResizeHandle = __webpack_require__(80); + var FixedDataTableRow = __webpack_require__(71); + var FixedDataTableScrollHelper = __webpack_require__(81); + var FixedDataTableWidthHelper = __webpack_require__(83); + + var cx = __webpack_require__(60); + var debounceCore = __webpack_require__(84); + var emptyFunction = __webpack_require__(45); + var invariant = __webpack_require__(65); + var joinClasses = __webpack_require__(79); + var shallowEqual = __webpack_require__(85); + var translateDOMPositionXY = __webpack_require__(61); + + var ReactChildren = React.Children; + + var EMPTY_OBJECT = {}; + var BORDER_HEIGHT = 1; + var HEADER = "header"; + var FOOTER = "footer"; + var CELL = "cell"; + + /** + * Data grid component with fixed or scrollable header and columns. + * + * The layout of the data table is as follows: + * + * ``` + * +---------------------------------------------------+ + * | Fixed Column Group | Scrollable Column Group | + * | Header | Header | + * | | | * +---------------------------------------------------+ * | | | * | Fixed Header Columns | Scrollable Header Columns | @@ -836,11 +1921,10 @@ return /******/ (function(modules) { // webpackBootstrap * - Scrollable Body Columns: The body columns that move while scrolling * vertically or horizontally. */ - var FixedDataTable = React.createClass({ - displayName: 'FixedDataTable', + var FixedDataTable = createReactClass({ + displayName: "FixedDataTable", propTypes: { - /** * Pixel width of table. If all columns do not fit, * a horizontal scrollbar will appear. @@ -878,8 +1962,8 @@ return /******/ (function(modules) { // webpackBootstrap */ ownerHeight: PropTypes.number, - overflowX: PropTypes.oneOf(['hidden', 'auto']), - overflowY: PropTypes.oneOf(['hidden', 'auto']), + overflowX: PropTypes.oneOf(["hidden", "auto"]), + overflowY: PropTypes.oneOf(["hidden", "auto"]), /** * Number of rows in the table. @@ -1001,7 +2085,13 @@ return /******/ (function(modules) { // webpackBootstrap /** * Whether a column is currently being resized. */ - isColumnResizing: PropTypes.bool + isColumnResizing: PropTypes.bool, + + /** + * CSS style props to pass to the box shadow that shows up on the fixed + * header while scrolling + */ + topShadowStyle: PropTypes.object }, getDefaultProps: function getDefaultProps() /*object*/{ @@ -1039,7 +2129,7 @@ return /******/ (function(modules) { // webpackBootstrap }, _shouldHandleWheelX: function _shouldHandleWheelX( /*number*/delta) /*boolean*/{ - if (this.props.overflowX === 'hidden') { + if (this.props.overflowX === "hidden") { return false; } @@ -1052,7 +2142,7 @@ return /******/ (function(modules) { // webpackBootstrap }, _shouldHandleWheelY: function _shouldHandleWheelY( /*number*/delta) /*boolean*/{ - if (this.props.overflowY === 'hidden' || delta === 0) { + if (this.props.overflowY === "hidden" || delta === 0) { return false; } @@ -1085,6 +2175,7 @@ return /******/ (function(modules) { // webpackBootstrap componentDidMount: function componentDidMount() { this._reportContentHeight(); + this._isMounted = true; }, componentWillReceiveProps: function componentWillReceiveProps( /*object*/nextProps) { @@ -1100,8 +2191,8 @@ return /******/ (function(modules) { // webpackBootstrap var newOverflowX = nextProps.overflowX; var newOverflowY = nextProps.overflowY; if (newOverflowX !== this.props.overflowX || newOverflowY !== this.props.overflowY) { - this._wheelHandler = new ReactWheelHandler(this._onWheel, newOverflowX !== 'hidden', // Should handle horizontal scroll - newOverflowY !== 'hidden' // Should handle vertical scroll + this._wheelHandler = new ReactWheelHandler(this._onWheel, newOverflowX !== "hidden", // Should handle horizontal scroll + newOverflowY !== "hidden" // Should handle vertical scroll ); } @@ -1125,9 +2216,9 @@ return /******/ (function(modules) { // webpackBootstrap var groupHeader; if (state.useGroupHeader) { groupHeader = React.createElement(FixedDataTableRow, { - key: 'group_header', + key: "group_header", isScrolling: this._isScrolling, - className: joinClasses(cx('fixedDataTableLayout/header'), cx('public/fixedDataTable/header')), + className: joinClasses(cx("fixedDataTableLayout/header"), cx("public/fixedDataTable/header")), width: state.width, height: state.groupHeaderHeight, index: 0, @@ -1141,8 +2232,8 @@ return /******/ (function(modules) { // webpackBootstrap } var maxScrollY = this.state.maxScrollY; - var showScrollbarX = state.maxScrollX > 0 && state.overflowX !== 'hidden'; - var showScrollbarY = maxScrollY > 0 && state.overflowY !== 'hidden'; + var showScrollbarX = state.maxScrollX > 0 && state.overflowX !== "hidden"; + var showScrollbarY = maxScrollY > 0 && state.overflowY !== "hidden"; var scrollbarXHeight = showScrollbarX ? Scrollbar.SIZE : 0; var scrollbarYHeight = state.height - scrollbarXHeight - 2 * BORDER_HEIGHT - state.footerHeight; @@ -1200,9 +2291,9 @@ return /******/ (function(modules) { // webpackBootstrap var footer = null; if (state.footerHeight) { footer = React.createElement(FixedDataTableRow, { - key: 'footer', + key: "footer", isScrolling: this._isScrolling, - className: joinClasses(cx('fixedDataTableLayout/footer'), cx('public/fixedDataTable/footer')), + className: joinClasses(cx("fixedDataTableLayout/footer"), cx("public/fixedDataTable/footer")), width: state.width, height: state.footerHeight, index: -1, @@ -1217,9 +2308,9 @@ return /******/ (function(modules) { // webpackBootstrap var rows = this._renderRows(bodyOffsetTop); var header = React.createElement(FixedDataTableRow, { - key: 'header', + key: "header", isScrolling: this._isScrolling, - className: joinClasses(cx('fixedDataTableLayout/header'), cx('public/fixedDataTable/header')), + className: joinClasses(cx("fixedDataTableLayout/header"), cx("public/fixedDataTable/header")), width: state.width, height: state.headerHeight, index: -1, @@ -1234,30 +2325,32 @@ return /******/ (function(modules) { // webpackBootstrap var topShadow; var bottomShadow; if (state.scrollY) { - topShadow = React.createElement('div', { - className: joinClasses(cx('fixedDataTableLayout/topShadow'), cx('public/fixedDataTable/topShadow')), - style: { top: bodyOffsetTop } + topShadow = React.createElement("div", { + className: joinClasses(cx("fixedDataTableLayout/topShadow"), cx("public/fixedDataTable/topShadow")), + style: _extends({}, topShadowStyle, { top: bodyOffsetTop }) }); } if (state.ownerHeight != null && state.ownerHeight < state.height && state.scrollContentHeight + state.reservedHeight > state.ownerHeight || state.scrollY < maxScrollY) { - bottomShadow = React.createElement('div', { - className: joinClasses(cx('fixedDataTableLayout/bottomShadow'), cx('public/fixedDataTable/bottomShadow')), + bottomShadow = React.createElement("div", { + className: joinClasses(cx("fixedDataTableLayout/bottomShadow"), cx("public/fixedDataTable/bottomShadow")), style: { top: footOffsetTop } }); } return React.createElement( - 'div', + "div", { - className: joinClasses(cx('fixedDataTableLayout/main'), cx('public/fixedDataTable/main')), + className: joinClasses(cx("fixedDataTableLayout/main"), cx("public/fixedDataTable/main")), onWheel: this._wheelHandler.onWheel, - style: { height: state.height, width: state.width } }, + style: { height: state.height, width: state.width } + }, React.createElement( - 'div', + "div", { - className: cx('fixedDataTableLayout/rowsContainer'), - style: { height: rowsContainerHeight, width: state.width } }, + className: cx("fixedDataTableLayout/rowsContainer"), + style: { height: rowsContainerHeight, width: state.width } + }, dragKnob, groupHeader, header, @@ -1271,6 +2364,10 @@ return /******/ (function(modules) { // webpackBootstrap ); }, + componentWillUnmount: function componentWillUnmount() { + this._isMounted = false; + }, + _renderRows: function _renderRows( /*number*/offsetTop) /*object*/{ var state = this.state; @@ -1389,14 +2486,14 @@ return /******/ (function(modules) { // webpackBootstrap }, _calculateState: function _calculateState( /*object*/props, /*?object*/oldState) /*object*/{ - invariant(props.height !== undefined || props.maxHeight !== undefined, 'You must set either a height or a maxHeight'); + invariant(props.height !== undefined || props.maxHeight !== undefined, "You must set either a height or a maxHeight"); var children = []; ReactChildren.forEach(props.children, function (child, index) { if (child == null) { return; } - invariant(child.type.__TableColumnGroup__ || child.type.__TableColumn__, 'child type should be or ' + ''); + invariant(child.type.__TableColumnGroup__ || child.type.__TableColumn__, "child type should be or " + ""); children.push(child); }); @@ -1412,12 +2509,12 @@ return /******/ (function(modules) { // webpackBootstrap var firstRowIndex = oldState && oldState.firstRowIndex || 0; var firstRowOffset = oldState && oldState.firstRowOffset || 0; var scrollX, scrollY; - if (oldState && props.overflowX !== 'hidden') { + if (oldState && props.overflowX !== "hidden") { scrollX = oldState.scrollX; } else { scrollX = props.scrollLeft; } - if (oldState && props.overflowY !== 'hidden') { + if (oldState && props.overflowY !== "hidden") { scrollY = oldState.scrollY; } else { scrollState = this._scrollHelper.scrollTo(props.scrollTop); @@ -1511,214 +2608,1373 @@ return /******/ (function(modules) { // webpackBootstrap var totalHeightNeeded = scrollContentHeight + totalHeightReserved; var scrollContentWidth = FixedDataTableWidthHelper.getTotalWidth(columns); - var horizontalScrollbarVisible = scrollContentWidth > props.width && props.overflowX !== 'hidden'; + var horizontalScrollbarVisible = scrollContentWidth > props.width && props.overflowX !== "hidden"; + + if (horizontalScrollbarVisible) { + bodyHeight -= Scrollbar.SIZE; + totalHeightNeeded += Scrollbar.SIZE; + totalHeightReserved += Scrollbar.SIZE; + } + + var maxScrollX = Math.max(0, scrollContentWidth - props.width); + var maxScrollY = Math.max(0, scrollContentHeight - bodyHeight); + scrollX = Math.min(scrollX, maxScrollX); + scrollY = Math.min(scrollY, maxScrollY); + + if (!maxScrollY) { + // no vertical scrollbar necessary, use the totals we tracked so we + // can shrink-to-fit vertically + if (useMaxHeight) { + height = totalHeightNeeded; + } + bodyHeight = totalHeightNeeded - totalHeightReserved; + } + + this._scrollHelper.setViewportHeight(bodyHeight); + + // The order of elements in this object metters and bringing bodyHeight, + // height or useGroupHeader to the top can break various features + var newState = _extends({ + isColumnResizing: oldState && oldState.isColumnResizing + }, columnInfo, props, { + + columns: columns, + columnGroups: columnGroups, + columnResizingData: columnResizingData, + firstRowIndex: firstRowIndex, + firstRowOffset: firstRowOffset, + horizontalScrollbarVisible: horizontalScrollbarVisible, + maxScrollX: maxScrollX, + maxScrollY: maxScrollY, + reservedHeight: totalHeightReserved, + scrollContentHeight: scrollContentHeight, + scrollX: scrollX, + scrollY: scrollY, + + // These properties may overwrite properties defined in + // columnInfo and props + bodyHeight: bodyHeight, + height: height, + groupHeaderHeight: groupHeaderHeight, + useGroupHeader: useGroupHeader + }); + + return newState; + }, + + _selectColumnElement: function _selectColumnElement( /*string*/type, /*array*/columns) /*array*/{ + var newColumns = []; + for (var i = 0; i < columns.length; ++i) { + var column = columns[i]; + newColumns.push(React.cloneElement(column, { + cell: type ? column.props[type] : column.props[CELL] + })); + } + return newColumns; + }, + + _splitColumnTypes: function _splitColumnTypes( /*array*/columns) /*object*/{ + var fixedColumns = []; + var scrollableColumns = []; + for (var i = 0; i < columns.length; ++i) { + if (columns[i].props.fixed) { + fixedColumns.push(columns[i]); + } else { + scrollableColumns.push(columns[i]); + } + } + return { + fixed: fixedColumns, + scrollable: scrollableColumns + }; + }, + + _onWheel: function _onWheel( /*number*/deltaX, /*number*/deltaY) { + if (this._isMounted) { + if (!this._isScrolling) { + this._didScrollStart(); + } + var x = this.state.scrollX; + if (Math.abs(deltaY) > Math.abs(deltaX) && this.props.overflowY !== "hidden") { + var scrollState = this._scrollHelper.scrollBy(Math.round(deltaY)); + var maxScrollY = Math.max(0, scrollState.contentHeight - this.state.bodyHeight); + this.setState({ + firstRowIndex: scrollState.index, + firstRowOffset: scrollState.offset, + scrollY: scrollState.position, + scrollContentHeight: scrollState.contentHeight, + maxScrollY: maxScrollY + }); + } else if (deltaX && this.props.overflowX !== "hidden") { + x += deltaX; + x = x < 0 ? 0 : x; + x = x > this.state.maxScrollX ? this.state.maxScrollX : x; + this.setState({ + scrollX: x + }); + } + + this._didScrollStop(); + } + }, + + _onHorizontalScroll: function _onHorizontalScroll( /*number*/scrollPos) { + if (this._isMounted && scrollPos !== this.state.scrollX) { + if (!this._isScrolling) { + this._didScrollStart(); + } + this.setState({ + scrollX: scrollPos + }); + this._didScrollStop(); + } + }, + + _onVerticalScroll: function _onVerticalScroll( /*number*/scrollPos) { + if (this._isMounted && scrollPos !== this.state.scrollY) { + if (!this._isScrolling) { + this._didScrollStart(); + } + var scrollState = this._scrollHelper.scrollTo(Math.round(scrollPos)); + this.setState({ + firstRowIndex: scrollState.index, + firstRowOffset: scrollState.offset, + scrollY: scrollState.position, + scrollContentHeight: scrollState.contentHeight + }); + this._didScrollStop(); + } + }, + + _didScrollStart: function _didScrollStart() { + if (this._isMounted && !this._isScrolling) { + this._isScrolling = true; + if (this.props.onScrollStart) { + this.props.onScrollStart(this.state.scrollX, this.state.scrollY); + } + } + }, + + _didScrollStop: function _didScrollStop() { + if (this._isMounted && this._isScrolling) { + this._isScrolling = false; + this.setState({ redraw: true }); + if (this.props.onScrollEnd) { + this.props.onScrollEnd(this.state.scrollX, this.state.scrollY); + } + } + } + }); + + var HorizontalScrollbar = createReactClass({ + displayName: "HorizontalScrollbar", + mixins: [ReactComponentWithPureRenderMixin], + + propTypes: { + contentSize: PropTypes.number.isRequired, + offset: PropTypes.number.isRequired, + onScroll: PropTypes.func.isRequired, + position: PropTypes.number.isRequired, + size: PropTypes.number.isRequired + }, + + render: function render() /*object*/{ + var outerContainerStyle = { + height: Scrollbar.SIZE, + width: this.props.size + }; + var innerContainerStyle = { + height: Scrollbar.SIZE, + position: "absolute", + overflow: "hidden", + width: this.props.size + }; + translateDOMPositionXY(innerContainerStyle, 0, this.props.offset); + + return React.createElement( + "div", + { + className: joinClasses(cx("fixedDataTableLayout/horizontalScrollbar"), cx("public/fixedDataTable/horizontalScrollbar")), + style: outerContainerStyle + }, + React.createElement( + "div", + { style: innerContainerStyle }, + React.createElement(Scrollbar, _extends({}, this.props, { + isOpaque: true, + orientation: "horizontal", + offset: undefined + })) + ) + ); + } + }); + + module.exports = FixedDataTable; + // isColumnResizing should be overwritten by value from props if + // avaialble + +/***/ }), +/* 37 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + + 'use strict'; + + var React = __webpack_require__(35); + var factory = __webpack_require__(38); + + if (typeof React === 'undefined') { + throw Error( + 'create-react-class could not find the React object. If you are using script tags, ' + + 'make sure that React is being loaded before create-react-class.' + ); + } + + // Hack to grab NoopUpdateQueue from isomorphic React + var ReactNoopUpdateQueue = new React.Component().updater; + + module.exports = factory( + React.Component, + React.isValidElement, + ReactNoopUpdateQueue + ); + + +/***/ }), +/* 38 */ +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + + 'use strict'; + + var _assign = __webpack_require__(30); + + var emptyObject = __webpack_require__(39); + var _invariant = __webpack_require__(40); + + if (process.env.NODE_ENV !== 'production') { + var warning = __webpack_require__(41); + } + + var MIXINS_KEY = 'mixins'; + + // Helper function to allow the creation of anonymous functions which do not + // have .name set to the name of the variable being assigned to. + function identity(fn) { + return fn; + } + + var ReactPropTypeLocationNames; + if (process.env.NODE_ENV !== 'production') { + ReactPropTypeLocationNames = { + prop: 'prop', + context: 'context', + childContext: 'child context' + }; + } else { + ReactPropTypeLocationNames = {}; + } + + function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) { + /** + * Policies that describe methods in `ReactClassInterface`. + */ + + var injectedMixins = []; + + /** + * Composite components are higher-level components that compose other composite + * or host components. + * + * To create a new type of `ReactClass`, pass a specification of + * your new class to `React.createClass`. The only requirement of your class + * specification is that you implement a `render` method. + * + * var MyComponent = React.createClass({ + * render: function() { + * return
Hello World
; + * } + * }); + * + * The class specification supports a specific protocol of methods that have + * special meaning (e.g. `render`). See `ReactClassInterface` for + * more the comprehensive protocol. Any other properties and methods in the + * class specification will be available on the prototype. + * + * @interface ReactClassInterface + * @internal + */ + var ReactClassInterface = { + /** + * An array of Mixin objects to include when defining your component. + * + * @type {array} + * @optional + */ + mixins: 'DEFINE_MANY', + + /** + * An object containing properties and methods that should be defined on + * the component's constructor instead of its prototype (static methods). + * + * @type {object} + * @optional + */ + statics: 'DEFINE_MANY', + + /** + * Definition of prop types for this component. + * + * @type {object} + * @optional + */ + propTypes: 'DEFINE_MANY', + + /** + * Definition of context types for this component. + * + * @type {object} + * @optional + */ + contextTypes: 'DEFINE_MANY', + + /** + * Definition of context types this component sets for its children. + * + * @type {object} + * @optional + */ + childContextTypes: 'DEFINE_MANY', + + // ==== Definition methods ==== + + /** + * Invoked when the component is mounted. Values in the mapping will be set on + * `this.props` if that prop is not specified (i.e. using an `in` check). + * + * This method is invoked before `getInitialState` and therefore cannot rely + * on `this.state` or use `this.setState`. + * + * @return {object} + * @optional + */ + getDefaultProps: 'DEFINE_MANY_MERGED', + + /** + * Invoked once before the component is mounted. The return value will be used + * as the initial value of `this.state`. + * + * getInitialState: function() { + * return { + * isOn: false, + * fooBaz: new BazFoo() + * } + * } + * + * @return {object} + * @optional + */ + getInitialState: 'DEFINE_MANY_MERGED', + + /** + * @return {object} + * @optional + */ + getChildContext: 'DEFINE_MANY_MERGED', + + /** + * Uses props from `this.props` and state from `this.state` to render the + * structure of the component. + * + * No guarantees are made about when or how often this method is invoked, so + * it must not have side effects. + * + * render: function() { + * var name = this.props.name; + * return
Hello, {name}!
; + * } + * + * @return {ReactComponent} + * @required + */ + render: 'DEFINE_ONCE', + + // ==== Delegate methods ==== + + /** + * Invoked when the component is initially created and about to be mounted. + * This may have side effects, but any external subscriptions or data created + * by this method must be cleaned up in `componentWillUnmount`. + * + * @optional + */ + componentWillMount: 'DEFINE_MANY', + + /** + * Invoked when the component has been mounted and has a DOM representation. + * However, there is no guarantee that the DOM node is in the document. + * + * Use this as an opportunity to operate on the DOM when the component has + * been mounted (initialized and rendered) for the first time. + * + * @param {DOMElement} rootNode DOM element representing the component. + * @optional + */ + componentDidMount: 'DEFINE_MANY', + + /** + * Invoked before the component receives new props. + * + * Use this as an opportunity to react to a prop transition by updating the + * state using `this.setState`. Current props are accessed via `this.props`. + * + * componentWillReceiveProps: function(nextProps, nextContext) { + * this.setState({ + * likesIncreasing: nextProps.likeCount > this.props.likeCount + * }); + * } + * + * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop + * transition may cause a state change, but the opposite is not true. If you + * need it, you are probably looking for `componentWillUpdate`. + * + * @param {object} nextProps + * @optional + */ + componentWillReceiveProps: 'DEFINE_MANY', + + /** + * Invoked while deciding if the component should be updated as a result of + * receiving new props, state and/or context. + * + * Use this as an opportunity to `return false` when you're certain that the + * transition to the new props/state/context will not require a component + * update. + * + * shouldComponentUpdate: function(nextProps, nextState, nextContext) { + * return !equal(nextProps, this.props) || + * !equal(nextState, this.state) || + * !equal(nextContext, this.context); + * } + * + * @param {object} nextProps + * @param {?object} nextState + * @param {?object} nextContext + * @return {boolean} True if the component should update. + * @optional + */ + shouldComponentUpdate: 'DEFINE_ONCE', + + /** + * Invoked when the component is about to update due to a transition from + * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState` + * and `nextContext`. + * + * Use this as an opportunity to perform preparation before an update occurs. + * + * NOTE: You **cannot** use `this.setState()` in this method. + * + * @param {object} nextProps + * @param {?object} nextState + * @param {?object} nextContext + * @param {ReactReconcileTransaction} transaction + * @optional + */ + componentWillUpdate: 'DEFINE_MANY', + + /** + * Invoked when the component's DOM representation has been updated. + * + * Use this as an opportunity to operate on the DOM when the component has + * been updated. + * + * @param {object} prevProps + * @param {?object} prevState + * @param {?object} prevContext + * @param {DOMElement} rootNode DOM element representing the component. + * @optional + */ + componentDidUpdate: 'DEFINE_MANY', + + /** + * Invoked when the component is about to be removed from its parent and have + * its DOM representation destroyed. + * + * Use this as an opportunity to deallocate any external resources. + * + * NOTE: There is no `componentDidUnmount` since your component will have been + * destroyed by that point. + * + * @optional + */ + componentWillUnmount: 'DEFINE_MANY', + + /** + * Replacement for (deprecated) `componentWillMount`. + * + * @optional + */ + UNSAFE_componentWillMount: 'DEFINE_MANY', + + /** + * Replacement for (deprecated) `componentWillReceiveProps`. + * + * @optional + */ + UNSAFE_componentWillReceiveProps: 'DEFINE_MANY', + + /** + * Replacement for (deprecated) `componentWillUpdate`. + * + * @optional + */ + UNSAFE_componentWillUpdate: 'DEFINE_MANY', + + // ==== Advanced methods ==== + + /** + * Updates the component's currently mounted DOM representation. + * + * By default, this implements React's rendering and reconciliation algorithm. + * Sophisticated clients may wish to override this. + * + * @param {ReactReconcileTransaction} transaction + * @internal + * @overridable + */ + updateComponent: 'OVERRIDE_BASE' + }; + + /** + * Similar to ReactClassInterface but for static methods. + */ + var ReactClassStaticInterface = { + /** + * This method is invoked after a component is instantiated and when it + * receives new props. Return an object to update state in response to + * prop changes. Return null to indicate no change to state. + * + * If an object is returned, its keys will be merged into the existing state. + * + * @return {object || null} + * @optional + */ + getDerivedStateFromProps: 'DEFINE_MANY_MERGED' + }; + + /** + * Mapping from class specification keys to special processing functions. + * + * Although these are declared like instance properties in the specification + * when defining classes using `React.createClass`, they are actually static + * and are accessible on the constructor instead of the prototype. Despite + * being static, they must be defined outside of the "statics" key under + * which all other static methods are defined. + */ + var RESERVED_SPEC_KEYS = { + displayName: function(Constructor, displayName) { + Constructor.displayName = displayName; + }, + mixins: function(Constructor, mixins) { + if (mixins) { + for (var i = 0; i < mixins.length; i++) { + mixSpecIntoComponent(Constructor, mixins[i]); + } + } + }, + childContextTypes: function(Constructor, childContextTypes) { + if (process.env.NODE_ENV !== 'production') { + validateTypeDef(Constructor, childContextTypes, 'childContext'); + } + Constructor.childContextTypes = _assign( + {}, + Constructor.childContextTypes, + childContextTypes + ); + }, + contextTypes: function(Constructor, contextTypes) { + if (process.env.NODE_ENV !== 'production') { + validateTypeDef(Constructor, contextTypes, 'context'); + } + Constructor.contextTypes = _assign( + {}, + Constructor.contextTypes, + contextTypes + ); + }, + /** + * Special case getDefaultProps which should move into statics but requires + * automatic merging. + */ + getDefaultProps: function(Constructor, getDefaultProps) { + if (Constructor.getDefaultProps) { + Constructor.getDefaultProps = createMergedResultFunction( + Constructor.getDefaultProps, + getDefaultProps + ); + } else { + Constructor.getDefaultProps = getDefaultProps; + } + }, + propTypes: function(Constructor, propTypes) { + if (process.env.NODE_ENV !== 'production') { + validateTypeDef(Constructor, propTypes, 'prop'); + } + Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes); + }, + statics: function(Constructor, statics) { + mixStaticSpecIntoComponent(Constructor, statics); + }, + autobind: function() {} + }; + + function validateTypeDef(Constructor, typeDef, location) { + for (var propName in typeDef) { + if (typeDef.hasOwnProperty(propName)) { + // use a warning instead of an _invariant so components + // don't show up in prod but only in __DEV__ + if (process.env.NODE_ENV !== 'production') { + warning( + typeof typeDef[propName] === 'function', + '%s: %s type `%s` is invalid; it must be a function, usually from ' + + 'React.PropTypes.', + Constructor.displayName || 'ReactClass', + ReactPropTypeLocationNames[location], + propName + ); + } + } + } + } + + function validateMethodOverride(isAlreadyDefined, name) { + var specPolicy = ReactClassInterface.hasOwnProperty(name) + ? ReactClassInterface[name] + : null; + + // Disallow overriding of base class methods unless explicitly allowed. + if (ReactClassMixin.hasOwnProperty(name)) { + _invariant( + specPolicy === 'OVERRIDE_BASE', + 'ReactClassInterface: You are attempting to override ' + + '`%s` from your class specification. Ensure that your method names ' + + 'do not overlap with React methods.', + name + ); + } + + // Disallow defining methods more than once unless explicitly allowed. + if (isAlreadyDefined) { + _invariant( + specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED', + 'ReactClassInterface: You are attempting to define ' + + '`%s` on your component more than once. This conflict may be due ' + + 'to a mixin.', + name + ); + } + } + + /** + * Mixin helper which handles policy validation and reserved + * specification keys when building React classes. + */ + function mixSpecIntoComponent(Constructor, spec) { + if (!spec) { + if (process.env.NODE_ENV !== 'production') { + var typeofSpec = typeof spec; + var isMixinValid = typeofSpec === 'object' && spec !== null; + + if (process.env.NODE_ENV !== 'production') { + warning( + isMixinValid, + "%s: You're attempting to include a mixin that is either null " + + 'or not an object. Check the mixins included by the component, ' + + 'as well as any mixins they include themselves. ' + + 'Expected object but got %s.', + Constructor.displayName || 'ReactClass', + spec === null ? null : typeofSpec + ); + } + } + + return; + } + + _invariant( + typeof spec !== 'function', + "ReactClass: You're attempting to " + + 'use a component class or function as a mixin. Instead, just use a ' + + 'regular object.' + ); + _invariant( + !isValidElement(spec), + "ReactClass: You're attempting to " + + 'use a component as a mixin. Instead, just use a regular object.' + ); + + var proto = Constructor.prototype; + var autoBindPairs = proto.__reactAutoBindPairs; + + // By handling mixins before any other properties, we ensure the same + // chaining order is applied to methods with DEFINE_MANY policy, whether + // mixins are listed before or after these methods in the spec. + if (spec.hasOwnProperty(MIXINS_KEY)) { + RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins); + } + + for (var name in spec) { + if (!spec.hasOwnProperty(name)) { + continue; + } + + if (name === MIXINS_KEY) { + // We have already handled mixins in a special case above. + continue; + } + + var property = spec[name]; + var isAlreadyDefined = proto.hasOwnProperty(name); + validateMethodOverride(isAlreadyDefined, name); + + if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) { + RESERVED_SPEC_KEYS[name](Constructor, property); + } else { + // Setup methods on prototype: + // The following member methods should not be automatically bound: + // 1. Expected ReactClass methods (in the "interface"). + // 2. Overridden methods (that were mixed in). + var isReactClassMethod = ReactClassInterface.hasOwnProperty(name); + var isFunction = typeof property === 'function'; + var shouldAutoBind = + isFunction && + !isReactClassMethod && + !isAlreadyDefined && + spec.autobind !== false; + + if (shouldAutoBind) { + autoBindPairs.push(name, property); + proto[name] = property; + } else { + if (isAlreadyDefined) { + var specPolicy = ReactClassInterface[name]; + + // These cases should already be caught by validateMethodOverride. + _invariant( + isReactClassMethod && + (specPolicy === 'DEFINE_MANY_MERGED' || + specPolicy === 'DEFINE_MANY'), + 'ReactClass: Unexpected spec policy %s for key %s ' + + 'when mixing in component specs.', + specPolicy, + name + ); + + // For methods which are defined more than once, call the existing + // methods before calling the new property, merging if appropriate. + if (specPolicy === 'DEFINE_MANY_MERGED') { + proto[name] = createMergedResultFunction(proto[name], property); + } else if (specPolicy === 'DEFINE_MANY') { + proto[name] = createChainedFunction(proto[name], property); + } + } else { + proto[name] = property; + if (process.env.NODE_ENV !== 'production') { + // Add verbose displayName to the function, which helps when looking + // at profiling tools. + if (typeof property === 'function' && spec.displayName) { + proto[name].displayName = spec.displayName + '_' + name; + } + } + } + } + } + } + } + + function mixStaticSpecIntoComponent(Constructor, statics) { + if (!statics) { + return; + } + + for (var name in statics) { + var property = statics[name]; + if (!statics.hasOwnProperty(name)) { + continue; + } + + var isReserved = name in RESERVED_SPEC_KEYS; + _invariant( + !isReserved, + 'ReactClass: You are attempting to define a reserved ' + + 'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' + + 'as an instance property instead; it will still be accessible on the ' + + 'constructor.', + name + ); + + var isAlreadyDefined = name in Constructor; + if (isAlreadyDefined) { + var specPolicy = ReactClassStaticInterface.hasOwnProperty(name) + ? ReactClassStaticInterface[name] + : null; + + _invariant( + specPolicy === 'DEFINE_MANY_MERGED', + 'ReactClass: You are attempting to define ' + + '`%s` on your component more than once. This conflict may be ' + + 'due to a mixin.', + name + ); + + Constructor[name] = createMergedResultFunction(Constructor[name], property); + + return; + } + + Constructor[name] = property; + } + } + + /** + * Merge two objects, but throw if both contain the same key. + * + * @param {object} one The first object, which is mutated. + * @param {object} two The second object + * @return {object} one after it has been mutated to contain everything in two. + */ + function mergeIntoWithNoDuplicateKeys(one, two) { + _invariant( + one && two && typeof one === 'object' && typeof two === 'object', + 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.' + ); + + for (var key in two) { + if (two.hasOwnProperty(key)) { + _invariant( + one[key] === undefined, + 'mergeIntoWithNoDuplicateKeys(): ' + + 'Tried to merge two objects with the same key: `%s`. This conflict ' + + 'may be due to a mixin; in particular, this may be caused by two ' + + 'getInitialState() or getDefaultProps() methods returning objects ' + + 'with clashing keys.', + key + ); + one[key] = two[key]; + } + } + return one; + } + + /** + * Creates a function that invokes two functions and merges their return values. + * + * @param {function} one Function to invoke first. + * @param {function} two Function to invoke second. + * @return {function} Function that invokes the two argument functions. + * @private + */ + function createMergedResultFunction(one, two) { + return function mergedResult() { + var a = one.apply(this, arguments); + var b = two.apply(this, arguments); + if (a == null) { + return b; + } else if (b == null) { + return a; + } + var c = {}; + mergeIntoWithNoDuplicateKeys(c, a); + mergeIntoWithNoDuplicateKeys(c, b); + return c; + }; + } + + /** + * Creates a function that invokes two functions and ignores their return vales. + * + * @param {function} one Function to invoke first. + * @param {function} two Function to invoke second. + * @return {function} Function that invokes the two argument functions. + * @private + */ + function createChainedFunction(one, two) { + return function chainedFunction() { + one.apply(this, arguments); + two.apply(this, arguments); + }; + } + + /** + * Binds a method to the component. + * + * @param {object} component Component whose method is going to be bound. + * @param {function} method Method to be bound. + * @return {function} The bound method. + */ + function bindAutoBindMethod(component, method) { + var boundMethod = method.bind(component); + if (process.env.NODE_ENV !== 'production') { + boundMethod.__reactBoundContext = component; + boundMethod.__reactBoundMethod = method; + boundMethod.__reactBoundArguments = null; + var componentName = component.constructor.displayName; + var _bind = boundMethod.bind; + boundMethod.bind = function(newThis) { + for ( + var _len = arguments.length, + args = Array(_len > 1 ? _len - 1 : 0), + _key = 1; + _key < _len; + _key++ + ) { + args[_key - 1] = arguments[_key]; + } + + // User is trying to bind() an autobound method; we effectively will + // ignore the value of "this" that the user is trying to use, so + // let's warn. + if (newThis !== component && newThis !== null) { + if (process.env.NODE_ENV !== 'production') { + warning( + false, + 'bind(): React component methods may only be bound to the ' + + 'component instance. See %s', + componentName + ); + } + } else if (!args.length) { + if (process.env.NODE_ENV !== 'production') { + warning( + false, + 'bind(): You are binding a component method to the component. ' + + 'React does this for you automatically in a high-performance ' + + 'way, so you can safely remove this call. See %s', + componentName + ); + } + return boundMethod; + } + var reboundMethod = _bind.apply(boundMethod, arguments); + reboundMethod.__reactBoundContext = component; + reboundMethod.__reactBoundMethod = method; + reboundMethod.__reactBoundArguments = args; + return reboundMethod; + }; + } + return boundMethod; + } + + /** + * Binds all auto-bound methods in a component. + * + * @param {object} component Component whose method is going to be bound. + */ + function bindAutoBindMethods(component) { + var pairs = component.__reactAutoBindPairs; + for (var i = 0; i < pairs.length; i += 2) { + var autoBindKey = pairs[i]; + var method = pairs[i + 1]; + component[autoBindKey] = bindAutoBindMethod(component, method); + } + } + + var IsMountedPreMixin = { + componentDidMount: function() { + this.__isMounted = true; + } + }; + + var IsMountedPostMixin = { + componentWillUnmount: function() { + this.__isMounted = false; + } + }; + + /** + * Add more to the ReactClass base class. These are all legacy features and + * therefore not already part of the modern ReactComponent. + */ + var ReactClassMixin = { + /** + * TODO: This will be deprecated because state should always keep a consistent + * type signature and the only use case for this, is to avoid that. + */ + replaceState: function(newState, callback) { + this.updater.enqueueReplaceState(this, newState, callback); + }, + + /** + * Checks whether or not this composite component is mounted. + * @return {boolean} True if mounted, false otherwise. + * @protected + * @final + */ + isMounted: function() { + if (process.env.NODE_ENV !== 'production') { + warning( + this.__didWarnIsMounted, + '%s: isMounted is deprecated. Instead, make sure to clean up ' + + 'subscriptions and pending requests in componentWillUnmount to ' + + 'prevent memory leaks.', + (this.constructor && this.constructor.displayName) || + this.name || + 'Component' + ); + this.__didWarnIsMounted = true; + } + return !!this.__isMounted; + } + }; + + var ReactClassComponent = function() {}; + _assign( + ReactClassComponent.prototype, + ReactComponent.prototype, + ReactClassMixin + ); + + /** + * Creates a composite component class given a class specification. + * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass + * + * @param {object} spec Class specification (which must define `render`). + * @return {function} Component constructor function. + * @public + */ + function createClass(spec) { + // To keep our warnings more understandable, we'll use a little hack here to + // ensure that Constructor.name !== 'Constructor'. This makes sure we don't + // unnecessarily identify a class without displayName as 'Constructor'. + var Constructor = identity(function(props, context, updater) { + // This constructor gets overridden by mocks. The argument is used + // by mocks to assert on what gets mounted. + + if (process.env.NODE_ENV !== 'production') { + warning( + this instanceof Constructor, + 'Something is calling a React component directly. Use a factory or ' + + 'JSX instead. See: https://fb.me/react-legacyfactory' + ); + } + + // Wire up auto-binding + if (this.__reactAutoBindPairs.length) { + bindAutoBindMethods(this); + } + + this.props = props; + this.context = context; + this.refs = emptyObject; + this.updater = updater || ReactNoopUpdateQueue; + + this.state = null; + + // ReactClasses doesn't have constructors. Instead, they use the + // getInitialState and componentWillMount methods for initialization. + + var initialState = this.getInitialState ? this.getInitialState() : null; + if (process.env.NODE_ENV !== 'production') { + // We allow auto-mocks to proceed as if they're returning null. + if ( + initialState === undefined && + this.getInitialState._isMockFunction + ) { + // This is probably bad practice. Consider warning here and + // deprecating this convenience. + initialState = null; + } + } + _invariant( + typeof initialState === 'object' && !Array.isArray(initialState), + '%s.getInitialState(): must return an object or null', + Constructor.displayName || 'ReactCompositeComponent' + ); + + this.state = initialState; + }); + Constructor.prototype = new ReactClassComponent(); + Constructor.prototype.constructor = Constructor; + Constructor.prototype.__reactAutoBindPairs = []; + + injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor)); + + mixSpecIntoComponent(Constructor, IsMountedPreMixin); + mixSpecIntoComponent(Constructor, spec); + mixSpecIntoComponent(Constructor, IsMountedPostMixin); + + // Initialize the defaultProps property after all mixins have been merged. + if (Constructor.getDefaultProps) { + Constructor.defaultProps = Constructor.getDefaultProps(); + } + + if (process.env.NODE_ENV !== 'production') { + // This is a tag to indicate that the use of these method names is ok, + // since it's used with createClass. If it's not, then it's likely a + // mistake so we'll warn you to use the static property, property + // initializer or constructor respectively. + if (Constructor.getDefaultProps) { + Constructor.getDefaultProps.isReactClassApproved = {}; + } + if (Constructor.prototype.getInitialState) { + Constructor.prototype.getInitialState.isReactClassApproved = {}; + } + } + + _invariant( + Constructor.prototype.render, + 'createClass(...): Class specification must implement a `render` method.' + ); + + if (process.env.NODE_ENV !== 'production') { + warning( + !Constructor.prototype.componentShouldUpdate, + '%s has a method called ' + + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + + 'The name is phrased as a question because the function is ' + + 'expected to return a value.', + spec.displayName || 'A component' + ); + warning( + !Constructor.prototype.componentWillRecieveProps, + '%s has a method called ' + + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', + spec.displayName || 'A component' + ); + warning( + !Constructor.prototype.UNSAFE_componentWillRecieveProps, + '%s has a method called UNSAFE_componentWillRecieveProps(). ' + + 'Did you mean UNSAFE_componentWillReceiveProps()?', + spec.displayName || 'A component' + ); + } + + // Reduce time spent doing lookups by setting these on the prototype. + for (var methodName in ReactClassInterface) { + if (!Constructor.prototype[methodName]) { + Constructor.prototype[methodName] = null; + } + } + + return Constructor; + } + + return createClass; + } + + module.exports = factory; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(28))) + +/***/ }), +/* 39 */ +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + + 'use strict'; + + var emptyObject = {}; + + if (process.env.NODE_ENV !== 'production') { + Object.freeze(emptyObject); + } + + module.exports = emptyObject; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(28))) + +/***/ }), +/* 40 */ +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + + 'use strict'; + + /** + * Use invariant() to assert state which your program assumes to be true. + * + * Provide sprintf-style format (only %s is supported) and arguments + * to provide information about what broke and what you were + * expecting. + * + * The invariant message will be stripped in production, but the invariant + * will remain to ensure logic does not differ in production. + */ + + var validateFormat = function validateFormat(format) {}; - if (horizontalScrollbarVisible) { - bodyHeight -= Scrollbar.SIZE; - totalHeightNeeded += Scrollbar.SIZE; - totalHeightReserved += Scrollbar.SIZE; + if (process.env.NODE_ENV !== 'production') { + validateFormat = function validateFormat(format) { + if (format === undefined) { + throw new Error('invariant requires an error message argument'); } + }; + } - var maxScrollX = Math.max(0, scrollContentWidth - props.width); - var maxScrollY = Math.max(0, scrollContentHeight - bodyHeight); - scrollX = Math.min(scrollX, maxScrollX); - scrollY = Math.min(scrollY, maxScrollY); + function invariant(condition, format, a, b, c, d, e, f) { + validateFormat(format); - if (!maxScrollY) { - // no vertical scrollbar necessary, use the totals we tracked so we - // can shrink-to-fit vertically - if (useMaxHeight) { - height = totalHeightNeeded; - } - bodyHeight = totalHeightNeeded - totalHeightReserved; + if (!condition) { + var error; + if (format === undefined) { + error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); + } else { + var args = [a, b, c, d, e, f]; + var argIndex = 0; + error = new Error(format.replace(/%s/g, function () { + return args[argIndex++]; + })); + error.name = 'Invariant Violation'; } - this._scrollHelper.setViewportHeight(bodyHeight); + error.framesToPop = 1; // we don't care about invariant's own frame + throw error; + } + } - // The order of elements in this object metters and bringing bodyHeight, - // height or useGroupHeader to the top can break various features - var newState = _extends({ - isColumnResizing: oldState && oldState.isColumnResizing - }, columnInfo, props, { + module.exports = invariant; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(28))) - columns: columns, - columnGroups: columnGroups, - columnResizingData: columnResizingData, - firstRowIndex: firstRowIndex, - firstRowOffset: firstRowOffset, - horizontalScrollbarVisible: horizontalScrollbarVisible, - maxScrollX: maxScrollX, - maxScrollY: maxScrollY, - reservedHeight: totalHeightReserved, - scrollContentHeight: scrollContentHeight, - scrollX: scrollX, - scrollY: scrollY, +/***/ }), +/* 41 */ +/***/ (function(module, exports, __webpack_require__) { - // These properties may overwrite properties defined in - // columnInfo and props - bodyHeight: bodyHeight, - height: height, - groupHeaderHeight: groupHeaderHeight, - useGroupHeader: useGroupHeader - }); + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright (c) 2014-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ - return newState; - }, + 'use strict'; - _selectColumnElement: function _selectColumnElement( /*string*/type, /*array*/columns) /*array*/{ - var newColumns = []; - for (var i = 0; i < columns.length; ++i) { - var column = columns[i]; - newColumns.push(React.cloneElement(column, { - cell: type ? column.props[type] : column.props[CELL] - })); - } - return newColumns; - }, + var emptyFunction = __webpack_require__(42); - _splitColumnTypes: function _splitColumnTypes( /*array*/columns) /*object*/{ - var fixedColumns = []; - var scrollableColumns = []; - for (var i = 0; i < columns.length; ++i) { - if (columns[i].props.fixed) { - fixedColumns.push(columns[i]); - } else { - scrollableColumns.push(columns[i]); - } - } - return { - fixed: fixedColumns, - scrollable: scrollableColumns - }; - }, + /** + * Similar to invariant but only logs a warning if the condition is not met. + * This can be used to log issues in development environments in critical + * paths. Removing the logging code for production environments will keep the + * same logic and follow the same code paths. + */ - _onWheel: function _onWheel( /*number*/deltaX, /*number*/deltaY) { - if (this.isMounted()) { - if (!this._isScrolling) { - this._didScrollStart(); - } - var x = this.state.scrollX; - if (Math.abs(deltaY) > Math.abs(deltaX) && this.props.overflowY !== 'hidden') { - var scrollState = this._scrollHelper.scrollBy(Math.round(deltaY)); - var maxScrollY = Math.max(0, scrollState.contentHeight - this.state.bodyHeight); - this.setState({ - firstRowIndex: scrollState.index, - firstRowOffset: scrollState.offset, - scrollY: scrollState.position, - scrollContentHeight: scrollState.contentHeight, - maxScrollY: maxScrollY - }); - } else if (deltaX && this.props.overflowX !== 'hidden') { - x += deltaX; - x = x < 0 ? 0 : x; - x = x > this.state.maxScrollX ? this.state.maxScrollX : x; - this.setState({ - scrollX: x - }); - } + var warning = emptyFunction; - this._didScrollStop(); + if (process.env.NODE_ENV !== 'production') { + var printWarning = function printWarning(format) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; } - }, - _onHorizontalScroll: function _onHorizontalScroll( /*number*/scrollPos) { - if (this.isMounted() && scrollPos !== this.state.scrollX) { - if (!this._isScrolling) { - this._didScrollStart(); - } - this.setState({ - scrollX: scrollPos - }); - this._didScrollStop(); - } - }, + var argIndex = 0; + var message = 'Warning: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + }); + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; - _onVerticalScroll: function _onVerticalScroll( /*number*/scrollPos) { - if (this.isMounted() && scrollPos !== this.state.scrollY) { - if (!this._isScrolling) { - this._didScrollStart(); - } - var scrollState = this._scrollHelper.scrollTo(Math.round(scrollPos)); - this.setState({ - firstRowIndex: scrollState.index, - firstRowOffset: scrollState.offset, - scrollY: scrollState.position, - scrollContentHeight: scrollState.contentHeight - }); - this._didScrollStop(); + warning = function warning(condition, format) { + if (format === undefined) { + throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); } - }, - _didScrollStart: function _didScrollStart() { - if (this.isMounted() && !this._isScrolling) { - this._isScrolling = true; - if (this.props.onScrollStart) { - this.props.onScrollStart(this.state.scrollX, this.state.scrollY); - } + if (format.indexOf('Failed Composite propType: ') === 0) { + return; // Ignore CompositeComponent proptype check. } - }, - _didScrollStop: function _didScrollStop() { - if (this.isMounted() && this._isScrolling) { - this._isScrolling = false; - this.setState({ redraw: true }); - if (this.props.onScrollEnd) { - this.props.onScrollEnd(this.state.scrollX, this.state.scrollY); + if (!condition) { + for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { + args[_key2 - 2] = arguments[_key2]; } + + printWarning.apply(undefined, [format].concat(args)); } - } - }); + }; + } - var HorizontalScrollbar = React.createClass({ - displayName: 'HorizontalScrollbar', + module.exports = warning; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(28))) - mixins: [ReactComponentWithPureRenderMixin], - propTypes: { - contentSize: PropTypes.number.isRequired, - offset: PropTypes.number.isRequired, - onScroll: PropTypes.func.isRequired, - position: PropTypes.number.isRequired, - size: PropTypes.number.isRequired - }, +/***/ }), +/* 42 */ +/***/ (function(module, exports) { - render: function render() /*object*/{ - var outerContainerStyle = { - height: Scrollbar.SIZE, - width: this.props.size - }; - var innerContainerStyle = { - height: Scrollbar.SIZE, - position: 'absolute', - overflow: 'hidden', - width: this.props.size - }; - translateDOMPositionXY(innerContainerStyle, 0, this.props.offset); + "use strict"; - return React.createElement( - 'div', - { - className: joinClasses(cx('fixedDataTableLayout/horizontalScrollbar'), cx('public/fixedDataTable/horizontalScrollbar')), - style: outerContainerStyle }, - React.createElement( - 'div', - { style: innerContainerStyle }, - React.createElement(Scrollbar, _extends({}, this.props, { - isOpaque: true, - orientation: 'horizontal', - offset: undefined - })) - ) - ); - } - }); + /** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ - module.exports = FixedDataTable; - // isColumnResizing should be overwritten by value from props if - // avaialble + function makeEmptyFunction(arg) { + return function () { + return arg; + }; + } -/***/ }, -/* 30 */ -/***/ function(module, exports) { + /** + * This function accepts and discards inputs; it has no side effects. This is + * primarily useful idiomatically for overridable function endpoints which + * always need to be callable, since JS lacks a null-call idiom ala Cocoa. + */ + var emptyFunction = function emptyFunction() {}; + + emptyFunction.thatReturns = makeEmptyFunction; + emptyFunction.thatReturnsFalse = makeEmptyFunction(false); + emptyFunction.thatReturnsTrue = makeEmptyFunction(true); + emptyFunction.thatReturnsNull = makeEmptyFunction(null); + emptyFunction.thatReturnsThis = function () { + return this; + }; + emptyFunction.thatReturnsArgument = function (arg) { + return arg; + }; + + module.exports = emptyFunction; + +/***/ }), +/* 43 */ +/***/ (function(module, exports) { /** * Copyright (c) 2015, Facebook, Inc. @@ -1792,9 +4048,9 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = ReactComponentWithPureRenderMixin; -/***/ }, -/* 31 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 44 */ +/***/ (function(module, exports, __webpack_require__) { /** * Copyright (c) 2015, Facebook, Inc. @@ -1817,9 +4073,9 @@ return /******/ (function(modules) { // webpackBootstrap function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - var emptyFunction = __webpack_require__(32); - var normalizeWheel = __webpack_require__(33); - var requestAnimationFramePolyfill = __webpack_require__(37); + var emptyFunction = __webpack_require__(45); + var normalizeWheel = __webpack_require__(46); + var requestAnimationFramePolyfill = __webpack_require__(50); var ReactWheelHandler = (function () { /** @@ -1902,9 +4158,9 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = ReactWheelHandler; -/***/ }, -/* 32 */ -/***/ function(module, exports) { +/***/ }), +/* 45 */ +/***/ (function(module, exports) { /** * Copyright (c) 2015, Facebook, Inc. @@ -1945,9 +4201,9 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = emptyFunction; -/***/ }, -/* 33 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 46 */ +/***/ (function(module, exports, __webpack_require__) { /** * Copyright (c) 2015, Facebook, Inc. @@ -1963,9 +4219,9 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; - var UserAgent_DEPRECATED = __webpack_require__(34); + var UserAgent_DEPRECATED = __webpack_require__(47); - var isEventSupported = __webpack_require__(35); + var isEventSupported = __webpack_require__(48); // Reasonable defaults var PIXEL_STEP = 10; @@ -2146,9 +4402,9 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = normalizeWheel; -/***/ }, -/* 34 */ -/***/ function(module, exports) { +/***/ }), +/* 47 */ +/***/ (function(module, exports) { /** * Copyright 2004-present Facebook. All Rights Reserved. @@ -2429,9 +4685,9 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = UserAgent_DEPRECATED; -/***/ }, -/* 35 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 48 */ +/***/ (function(module, exports, __webpack_require__) { /** * Copyright 2013-2015, Facebook, Inc. @@ -2446,7 +4702,7 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; - var ExecutionEnvironment = __webpack_require__(36); + var ExecutionEnvironment = __webpack_require__(49); var useHasFeature; if (ExecutionEnvironment.canUseDOM) { @@ -2494,9 +4750,9 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = isEventSupported; -/***/ }, -/* 36 */ -/***/ function(module, exports) { +/***/ }), +/* 49 */ +/***/ (function(module, exports) { /** * Copyright (c) 2015, Facebook, Inc. @@ -2537,9 +4793,9 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = ExecutionEnvironment; -/***/ }, -/* 37 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 50 */ +/***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {/** * Copyright (c) 2015, Facebook, Inc. @@ -2554,8 +4810,8 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; - var emptyFunction = __webpack_require__(32); - var nativeRequestAnimationFrame = __webpack_require__(38); + var emptyFunction = __webpack_require__(45); + var nativeRequestAnimationFrame = __webpack_require__(51); var lastTime = 0; @@ -2578,9 +4834,9 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = requestAnimationFrame; /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) -/***/ }, -/* 38 */ -/***/ function(module, exports) { +/***/ }), +/* 51 */ +/***/ (function(module, exports) { /* WEBPACK VAR INJECTION */(function(global) {/** * Copyright (c) 2015, Facebook, Inc. @@ -2600,9 +4856,9 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = nativeRequestAnimationFrame; /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) -/***/ }, -/* 39 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 52 */ +/***/ (function(module, exports, __webpack_require__) { /** * Copyright (c) 2015, Facebook, Inc. @@ -2618,19 +4874,19 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; - var DOMMouseMoveTracker = __webpack_require__(40); - var Keys = __webpack_require__(43); - var React = __webpack_require__(27); - var ReactDOM = __webpack_require__(44); - var ReactComponentWithPureRenderMixin = __webpack_require__(30); - var ReactWheelHandler = __webpack_require__(31); + var DOMMouseMoveTracker = __webpack_require__(53); + var Keys = __webpack_require__(56); + var PropTypes = __webpack_require__(27); + var React = __webpack_require__(34); + var createReactClass = __webpack_require__(37); + var ReactDOM = __webpack_require__(57); + var ReactComponentWithPureRenderMixin = __webpack_require__(43); + var ReactWheelHandler = __webpack_require__(44); - var cssVar = __webpack_require__(46); - var cx = __webpack_require__(47); - var emptyFunction = __webpack_require__(32); - var translateDOMPositionXY = __webpack_require__(48); - - var PropTypes = React.PropTypes; + var cssVar = __webpack_require__(59); + var cx = __webpack_require__(60); + var emptyFunction = __webpack_require__(45); + var translateDOMPositionXY = __webpack_require__(61); var UNSCROLLABLE_STATE = { position: 0, @@ -2644,9 +4900,8 @@ return /******/ (function(modules) { // webpackBootstrap var _lastScrolledScrollbar = null; - var Scrollbar = React.createClass({ - displayName: 'Scrollbar', - + var Scrollbar = createReactClass({ + displayName: "Scrollbar", mixins: [ReactComponentWithPureRenderMixin], propTypes: { @@ -2779,6 +5034,8 @@ return /******/ (function(modules) { // webpackBootstrap if (this.props.position !== undefined && this.state.position !== this.props.position) { this._didScroll(); } + + this._isMounted = true; }, componentWillUnmount: function componentWillUnmount() { @@ -2788,6 +5045,8 @@ return /******/ (function(modules) { // webpackBootstrap _lastScrolledScrollbar = null; } delete this._mouseMoveTracker; + + this._isMounted = false; }, scrollBy: function scrollBy( /*number*/delta) { @@ -3008,7 +5267,7 @@ return /******/ (function(modules) { // webpackBootstrap }, _blur: function _blur() { - if (this.isMounted()) { + if (this._isMounted) { try { this._onBlur(); ReactDOM.findDOMNode(this).blur(); @@ -3052,9 +5311,9 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = Scrollbar; -/***/ }, -/* 40 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 53 */ +/***/ (function(module, exports, __webpack_require__) { /** * Copyright (c) 2015, Facebook, Inc. @@ -3081,10 +5340,10 @@ return /******/ (function(modules) { // webpackBootstrap function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - var EventListener = __webpack_require__(41); + var EventListener = __webpack_require__(54); - var cancelAnimationFramePolyfill = __webpack_require__(42); - var requestAnimationFramePolyfill = __webpack_require__(37); + var cancelAnimationFramePolyfill = __webpack_require__(55); + var requestAnimationFramePolyfill = __webpack_require__(50); var DOMMouseMoveTracker = (function () { /** @@ -3216,9 +5475,9 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = DOMMouseMoveTracker; -/***/ }, -/* 41 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 54 */ +/***/ (function(module, exports, __webpack_require__) { /** * Copyright (c) 2015, Facebook, Inc. @@ -3234,7 +5493,7 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; - var emptyFunction = __webpack_require__(32); + var emptyFunction = __webpack_require__(45); /** * Upstream version of event listener. Does not take into account specific @@ -3298,9 +5557,9 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = EventListener; -/***/ }, -/* 42 */ -/***/ function(module, exports) { +/***/ }), +/* 55 */ +/***/ (function(module, exports) { /* WEBPACK VAR INJECTION */(function(global) {/** * Copyright (c) 2015, Facebook, Inc. @@ -3324,9 +5583,9 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = cancelAnimationFrame; /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) -/***/ }, -/* 43 */ -/***/ function(module, exports) { +/***/ }), +/* 56 */ +/***/ (function(module, exports) { /** * Copyright (c) 2015, Facebook, Inc. @@ -3366,9 +5625,9 @@ return /******/ (function(modules) { // webpackBootstrap NUMPAD_9: 105 }; -/***/ }, -/* 44 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 57 */ +/***/ (function(module, exports, __webpack_require__) { /** * Copyright (c) 2015, Facebook, Inc. @@ -3383,17 +5642,17 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; - module.exports = __webpack_require__(45); + module.exports = __webpack_require__(58); -/***/ }, -/* 45 */ -/***/ function(module, exports) { +/***/ }), +/* 58 */ +/***/ (function(module, exports) { - module.exports = __WEBPACK_EXTERNAL_MODULE_45__; + module.exports = __WEBPACK_EXTERNAL_MODULE_58__; -/***/ }, -/* 46 */ -/***/ function(module, exports) { +/***/ }), +/* 59 */ +/***/ (function(module, exports) { /** * Copyright (c) 2015, Facebook, Inc. @@ -3436,9 +5695,9 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = cssVar; -/***/ }, -/* 47 */ -/***/ function(module, exports) { +/***/ }), +/* 60 */ +/***/ (function(module, exports) { /** * Copyright (c) 2015, Facebook, Inc. @@ -3495,9 +5754,9 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = cx; -/***/ }, -/* 48 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 61 */ +/***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {/** * Copyright (c) 2015, Facebook, Inc. @@ -3513,9 +5772,9 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; - var BrowserSupportCore = __webpack_require__(49); + var BrowserSupportCore = __webpack_require__(62); - var getVendorPrefixedName = __webpack_require__(50); + var getVendorPrefixedName = __webpack_require__(63); var TRANSFORM = getVendorPrefixedName('transform'); var BACKFACE_VISIBILITY = getVendorPrefixedName('backfaceVisibility'); @@ -3549,9 +5808,9 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = translateDOMPositionXY; /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) -/***/ }, -/* 49 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 62 */ +/***/ (function(module, exports, __webpack_require__) { /** * Copyright (c) 2015, Facebook, Inc. @@ -3566,7 +5825,7 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; - var getVendorPrefixedName = __webpack_require__(50); + var getVendorPrefixedName = __webpack_require__(63); var BrowserSupportCore = { /** @@ -3600,9 +5859,9 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = BrowserSupportCore; -/***/ }, -/* 50 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 63 */ +/***/ (function(module, exports, __webpack_require__) { /** * Copyright (c) 2015, Facebook, Inc. @@ -3618,10 +5877,10 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; - var ExecutionEnvironment = __webpack_require__(36); + var ExecutionEnvironment = __webpack_require__(49); - var camelize = __webpack_require__(51); - var invariant = __webpack_require__(52); + var camelize = __webpack_require__(64); + var invariant = __webpack_require__(65); var memoized = {}; var prefixes = ['Webkit', 'ms', 'Moz', 'O']; @@ -3657,9 +5916,9 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = getVendorPrefixedName; -/***/ }, -/* 51 */ -/***/ function(module, exports) { +/***/ }), +/* 64 */ +/***/ (function(module, exports) { /** * Copyright (c) 2015, Facebook, Inc. @@ -3694,9 +5953,9 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = camelize; -/***/ }, -/* 52 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 65 */ +/***/ (function(module, exports, __webpack_require__) { /** * Copyright (c) 2015, Facebook, Inc. @@ -3748,10 +6007,13 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = invariant; -/***/ }, -/* 53 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 66 */ +/***/ (function(module, exports, __webpack_require__) { + 'use strict'; + + var PropTypes = __webpack_require__(27); /** * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -3764,21 +6026,18 @@ return /******/ (function(modules) { // webpackBootstrap * @typechecks */ - 'use strict'; - - var React = __webpack_require__(27); - var FixedDataTableRowBuffer = __webpack_require__(54); - var FixedDataTableRow = __webpack_require__(58); + var React = __webpack_require__(34); + var createReactClass = __webpack_require__(37); + var FixedDataTableRowBuffer = __webpack_require__(67); + var FixedDataTableRow = __webpack_require__(71); - var cx = __webpack_require__(47); - var emptyFunction = __webpack_require__(32); - var joinClasses = __webpack_require__(66); - var translateDOMPositionXY = __webpack_require__(48); + var cx = __webpack_require__(60); + var emptyFunction = __webpack_require__(45); + var joinClasses = __webpack_require__(79); + var translateDOMPositionXY = __webpack_require__(61); - var PropTypes = React.PropTypes; - - var FixedDataTableBufferedRows = React.createClass({ - displayName: 'FixedDataTableBufferedRows', + var FixedDataTableBufferedRows = createReactClass({ + displayName: "FixedDataTableBufferedRows", propTypes: { isScrolling: PropTypes.bool, @@ -3816,6 +6075,7 @@ return /******/ (function(modules) { // webpackBootstrap componentDidMount: function componentDidMount() { setTimeout(this._updateBuffer, 1000); + this._isMounted = true; }, componentWillReceiveProps: function componentWillReceiveProps( /*object*/nextProps) { @@ -3832,7 +6092,7 @@ return /******/ (function(modules) { // webpackBootstrap }, _updateBuffer: function _updateBuffer() { - if (this.isMounted()) { + if (this._isMounted) { this.setState({ rowsToRender: this._rowBuffer.getRowsWithUpdatedBuffer() }); @@ -3846,6 +6106,7 @@ return /******/ (function(modules) { // webpackBootstrap componentWillUnmount: function componentWillUnmount() { this._staticRowArray.length = 0; + this._isMounted = false; }, render: function render() /*object*/{ @@ -3908,9 +6169,9 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = FixedDataTableBufferedRows; -/***/ }, -/* 54 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 67 */ +/***/ (function(module, exports, __webpack_require__) { /** * Copyright (c) 2015, Facebook, Inc. @@ -3930,10 +6191,10 @@ return /******/ (function(modules) { // webpackBootstrap function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - var IntegerBufferSet = __webpack_require__(55); + var IntegerBufferSet = __webpack_require__(68); - var clamp = __webpack_require__(57); - var invariant = __webpack_require__(52); + var clamp = __webpack_require__(70); + var invariant = __webpack_require__(65); var MIN_BUFFER_ROWS = 3; var MAX_BUFFER_ROWS = 6; @@ -4036,9 +6297,9 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = FixedDataTableRowBuffer; -/***/ }, -/* 55 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 68 */ +/***/ (function(module, exports, __webpack_require__) { /** * Copyright (c) 2015, Facebook, Inc. @@ -4058,9 +6319,9 @@ return /******/ (function(modules) { // webpackBootstrap function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - var Heap = __webpack_require__(56); + var Heap = __webpack_require__(69); - var invariant = __webpack_require__(52); + var invariant = __webpack_require__(65); // Data structure that allows to store values and assign positions to them // in a way to minimize changing positions of stored values when new ones are @@ -4221,9 +6482,9 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = IntegerBufferSet; -/***/ }, -/* 56 */ -/***/ function(module, exports) { +/***/ }), +/* 69 */ +/***/ (function(module, exports) { /** * Copyright (c) 2015, Facebook, Inc. @@ -4405,9 +6666,9 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = Heap; -/***/ }, -/* 57 */ -/***/ function(module, exports) { +/***/ }), +/* 70 */ +/***/ (function(module, exports) { /** * Copyright (c) 2015, Facebook, Inc. @@ -4442,9 +6703,9 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = clamp; -/***/ }, -/* 58 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 71 */ +/***/ (function(module, exports, __webpack_require__) { /** * Copyright (c) 2015, Facebook, Inc. @@ -4462,243 +6723,280 @@ return /******/ (function(modules) { // webpackBootstrap var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - var React = __webpack_require__(27); - var FixedDataTableCellGroup = __webpack_require__(59); + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + + function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - var cx = __webpack_require__(47); - var joinClasses = __webpack_require__(66); - var translateDOMPositionXY = __webpack_require__(48); + var PropTypes = __webpack_require__(27); - var PropTypes = React.PropTypes; + var React = __webpack_require__(34); + var FixedDataTableCellGroup = __webpack_require__(72); + + var cx = __webpack_require__(60); + var joinClasses = __webpack_require__(79); + var translateDOMPositionXY = __webpack_require__(61); /** * Component that renders the row for . * This component should not be used directly by developer. Instead, * only should use the component internally. */ - var FixedDataTableRowImpl = React.createClass({ - displayName: 'FixedDataTableRowImpl', - - propTypes: { - - isScrolling: PropTypes.bool, - - /** - * Array of for the fixed columns. - */ - fixedColumns: PropTypes.array.isRequired, - - /** - * Height of the row. - */ - height: PropTypes.number.isRequired, - - /** - * The row index. - */ - index: PropTypes.number.isRequired, - /** - * Array of for the scrollable columns. - */ - scrollableColumns: PropTypes.array.isRequired, + var FixedDataTableRowImpl = (function (_React$Component) { + _inherits(FixedDataTableRowImpl, _React$Component); - /** - * The distance between the left edge of the table and the leftmost portion - * of the row currently visible in the table. - */ - scrollLeft: PropTypes.number.isRequired, + function FixedDataTableRowImpl() { + var _this = this; - /** - * Width of the row. - */ - width: PropTypes.number.isRequired, + _classCallCheck(this, FixedDataTableRowImpl); - /** - * Fire when a row is clicked. - */ - onClick: PropTypes.func, + _get(Object.getPrototypeOf(FixedDataTableRowImpl.prototype), 'constructor', this).apply(this, arguments); - /** - * Fire when a row is double clicked. - */ - onDoubleClick: PropTypes.func, + this._getColumnsWidth = /*array*/function (columns) /*number*/{ + var width = 0; + for (var i = 0; i < columns.length; ++i) { + width += columns[i].props.width; + } + return width; + }; - /** - * Callback for when resizer knob (in FixedDataTableCell) is clicked - * to initialize resizing. Please note this is only on the cells - * in the header. - * @param number combinedWidth - * @param number leftOffset - * @param number cellWidth - * @param number|string columnKey - * @param object event - */ - onColumnResize: PropTypes.func - }, + this._renderColumnsShadow = /*number*/function (left) /*?object*/{ + if (left > 0) { + var className = cx({ + 'fixedDataTableRowLayout/fixedColumnsDivider': true, + 'fixedDataTableRowLayout/columnsShadow': _this.props.scrollLeft > 0, + 'public/fixedDataTableRow/fixedColumnsDivider': true, + 'public/fixedDataTableRow/columnsShadow': _this.props.scrollLeft > 0 + }); + var style = { + left: left, + height: _this.props.height + }; + return React.createElement('div', { className: className, style: style }); + } + }; - render: function render() /*object*/{ - var style = { - width: this.props.width, - height: this.props.height + this._onClick = /*object*/function (event) { + _this.props.onClick(event, _this.props.index); }; - var className = cx({ - 'fixedDataTableRowLayout/main': true, - 'public/fixedDataTableRow/main': true, - 'public/fixedDataTableRow/highlighted': this.props.index % 2 === 1, - 'public/fixedDataTableRow/odd': this.props.index % 2 === 1, - 'public/fixedDataTableRow/even': this.props.index % 2 === 0 - }); + this._onDoubleClick = /*object*/function (event) { + _this.props.onDoubleClick(event, _this.props.index); + }; - var fixedColumnsWidth = this._getColumnsWidth(this.props.fixedColumns); - var fixedColumns = React.createElement(FixedDataTableCellGroup, { - key: 'fixed_cells', - isScrolling: this.props.isScrolling, - height: this.props.height, - left: 0, - width: fixedColumnsWidth, - zIndex: 2, - columns: this.props.fixedColumns, - onColumnResize: this.props.onColumnResize, - rowHeight: this.props.height, - rowIndex: this.props.index - }); - var columnsShadow = this._renderColumnsShadow(fixedColumnsWidth); - var scrollableColumns = React.createElement(FixedDataTableCellGroup, { - key: 'scrollable_cells', - isScrolling: this.props.isScrolling, - height: this.props.height, - left: this.props.scrollLeft, - offsetLeft: fixedColumnsWidth, - width: this.props.width - fixedColumnsWidth, - zIndex: 0, - columns: this.props.scrollableColumns, - onColumnResize: this.props.onColumnResize, - rowHeight: this.props.height, - rowIndex: this.props.index - }); + this._onMouseDown = /*object*/function (event) { + _this.props.onMouseDown(event, _this.props.index); + }; - return React.createElement( - 'div', - { - className: joinClasses(className, this.props.className), - onClick: this.props.onClick ? this._onClick : null, - onDoubleClick: this.props.onDoubleClick ? this._onDoubleClick : null, - onMouseDown: this.props.onMouseDown ? this._onMouseDown : null, - onMouseEnter: this.props.onMouseEnter ? this._onMouseEnter : null, - onMouseLeave: this.props.onMouseLeave ? this._onMouseLeave : null, - style: style }, - React.createElement( - 'div', - { className: cx('fixedDataTableRowLayout/body') }, - fixedColumns, - scrollableColumns, - columnsShadow - ) - ); - }, + this._onMouseEnter = /*object*/function (event) { + _this.props.onMouseEnter(event, _this.props.index); + }; - _getColumnsWidth: function _getColumnsWidth( /*array*/columns) /*number*/{ - var width = 0; - for (var i = 0; i < columns.length; ++i) { - width += columns[i].props.width; - } - return width; - }, + this._onMouseLeave = /*object*/function (event) { + _this.props.onMouseLeave(event, _this.props.index); + }; + } - _renderColumnsShadow: function _renderColumnsShadow( /*number*/left) /*?object*/{ - if (left > 0) { - var className = cx({ - 'fixedDataTableRowLayout/fixedColumnsDivider': true, - 'fixedDataTableRowLayout/columnsShadow': this.props.scrollLeft > 0, - 'public/fixedDataTableRow/fixedColumnsDivider': true, - 'public/fixedDataTableRow/columnsShadow': this.props.scrollLeft > 0 - }); + _createClass(FixedDataTableRowImpl, [{ + key: 'render', + value: function render() /*object*/{ var style = { - left: left, + width: this.props.width, height: this.props.height }; - return React.createElement('div', { className: className, style: style }); - } - }, - - _onClick: function _onClick( /*object*/event) { - this.props.onClick(event, this.props.index); - }, - - _onDoubleClick: function _onDoubleClick( /*object*/event) { - this.props.onDoubleClick(event, this.props.index); - }, - - _onMouseDown: function _onMouseDown( /*object*/event) { - this.props.onMouseDown(event, this.props.index); - }, - - _onMouseEnter: function _onMouseEnter( /*object*/event) { - this.props.onMouseEnter(event, this.props.index); - }, - _onMouseLeave: function _onMouseLeave( /*object*/event) { - this.props.onMouseLeave(event, this.props.index); - } - }); + var className = cx({ + 'fixedDataTableRowLayout/main': true, + 'public/fixedDataTableRow/main': true, + 'public/fixedDataTableRow/highlighted': this.props.index % 2 === 1, + 'public/fixedDataTableRow/odd': this.props.index % 2 === 1, + 'public/fixedDataTableRow/even': this.props.index % 2 === 0 + }); - var FixedDataTableRow = React.createClass({ - displayName: 'FixedDataTableRow', + var fixedColumnsWidth = this._getColumnsWidth(this.props.fixedColumns); + var fixedColumns = React.createElement(FixedDataTableCellGroup, { + key: 'fixed_cells', + isScrolling: this.props.isScrolling, + height: this.props.height, + left: 0, + width: fixedColumnsWidth, + zIndex: 2, + columns: this.props.fixedColumns, + onColumnResize: this.props.onColumnResize, + rowHeight: this.props.height, + rowIndex: this.props.index + }); + var columnsShadow = this._renderColumnsShadow(fixedColumnsWidth); + var scrollableColumns = React.createElement(FixedDataTableCellGroup, { + key: 'scrollable_cells', + isScrolling: this.props.isScrolling, + height: this.props.height, + left: this.props.scrollLeft, + offsetLeft: fixedColumnsWidth, + width: this.props.width - fixedColumnsWidth, + zIndex: 0, + columns: this.props.scrollableColumns, + onColumnResize: this.props.onColumnResize, + rowHeight: this.props.height, + rowIndex: this.props.index + }); - propTypes: { + return React.createElement( + 'div', + { + className: joinClasses(className, this.props.className), + onClick: this.props.onClick ? this._onClick : null, + onDoubleClick: this.props.onDoubleClick ? this._onDoubleClick : null, + onMouseDown: this.props.onMouseDown ? this._onMouseDown : null, + onMouseEnter: this.props.onMouseEnter ? this._onMouseEnter : null, + onMouseLeave: this.props.onMouseLeave ? this._onMouseLeave : null, + style: style }, + React.createElement( + 'div', + { className: cx('fixedDataTableRowLayout/body') }, + fixedColumns, + scrollableColumns, + columnsShadow + ) + ); + } + }], [{ + key: 'propTypes', + value: { + + isScrolling: PropTypes.bool, + + /** + * Array of for the fixed columns. + */ + fixedColumns: PropTypes.array.isRequired, + + /** + * Height of the row. + */ + height: PropTypes.number.isRequired, + + /** + * The row index. + */ + index: PropTypes.number.isRequired, + + /** + * Array of for the scrollable columns. + */ + scrollableColumns: PropTypes.array.isRequired, + + /** + * The distance between the left edge of the table and the leftmost portion + * of the row currently visible in the table. + */ + scrollLeft: PropTypes.number.isRequired, + + /** + * Width of the row. + */ + width: PropTypes.number.isRequired, + + /** + * Fire when a row is clicked. + */ + onClick: PropTypes.func, + + /** + * Fire when a row is double clicked. + */ + onDoubleClick: PropTypes.func, + + /** + * Callback for when resizer knob (in FixedDataTableCell) is clicked + * to initialize resizing. Please note this is only on the cells + * in the header. + * @param number combinedWidth + * @param number leftOffset + * @param number cellWidth + * @param number|string columnKey + * @param object event + */ + onColumnResize: PropTypes.func + }, + enumerable: true + }]); - isScrolling: PropTypes.bool, + return FixedDataTableRowImpl; + })(React.Component); - /** - * Height of the row. - */ - height: PropTypes.number.isRequired, + var FixedDataTableRow = (function (_React$Component2) { + _inherits(FixedDataTableRow, _React$Component2); - /** - * Z-index on which the row will be displayed. Used e.g. for keeping - * header and footer in front of other rows. - */ - zIndex: PropTypes.number, + function FixedDataTableRow() { + _classCallCheck(this, FixedDataTableRow); - /** - * The vertical position where the row should render itself - */ - offsetTop: PropTypes.number.isRequired, + _get(Object.getPrototypeOf(FixedDataTableRow.prototype), 'constructor', this).apply(this, arguments); + } - /** - * Width of the row. - */ - width: PropTypes.number.isRequired - }, + _createClass(FixedDataTableRow, [{ + key: 'render', + value: function render() /*object*/{ + var style = { + width: this.props.width, + height: this.props.height, + zIndex: this.props.zIndex ? this.props.zIndex : 0 + }; + translateDOMPositionXY(style, 0, this.props.offsetTop); - render: function render() /*object*/{ - var style = { - width: this.props.width, - height: this.props.height, - zIndex: this.props.zIndex ? this.props.zIndex : 0 - }; - translateDOMPositionXY(style, 0, this.props.offsetTop); + return React.createElement( + 'div', + { + style: style, + className: cx('fixedDataTableRowLayout/rowWrapper') }, + React.createElement(FixedDataTableRowImpl, _extends({}, this.props, { + offsetTop: undefined, + zIndex: undefined + })) + ); + } + }], [{ + key: 'propTypes', + value: { + + isScrolling: PropTypes.bool, + + /** + * Height of the row. + */ + height: PropTypes.number.isRequired, + + /** + * Z-index on which the row will be displayed. Used e.g. for keeping + * header and footer in front of other rows. + */ + zIndex: PropTypes.number, + + /** + * The vertical position where the row should render itself + */ + offsetTop: PropTypes.number.isRequired, + + /** + * Width of the row. + */ + width: PropTypes.number.isRequired + }, + enumerable: true + }]); - return React.createElement( - 'div', - { - style: style, - className: cx('fixedDataTableRowLayout/rowWrapper') }, - React.createElement(FixedDataTableRowImpl, _extends({}, this.props, { - offsetTop: undefined, - zIndex: undefined - })) - ); - } - }); + return FixedDataTableRow; + })(React.Component); module.exports = FixedDataTableRow; -/***/ }, -/* 59 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 72 */ +/***/ (function(module, exports, __webpack_require__) { /** * Copyright (c) 2015, Facebook, Inc. @@ -4718,19 +7016,19 @@ return /******/ (function(modules) { // webpackBootstrap function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } - var FixedDataTableHelper = __webpack_require__(60); - var React = __webpack_require__(27); - var FixedDataTableCell = __webpack_require__(64); + var FixedDataTableHelper = __webpack_require__(73); + var PropTypes = __webpack_require__(27); + var React = __webpack_require__(34); + var createReactClass = __webpack_require__(37); + var FixedDataTableCell = __webpack_require__(77); - var cx = __webpack_require__(47); - var translateDOMPositionXY = __webpack_require__(48); - - var PropTypes = React.PropTypes; + var cx = __webpack_require__(60); + var translateDOMPositionXY = __webpack_require__(61); var DIR_SIGN = FixedDataTableHelper.DIR_SIGN; - var FixedDataTableCellGroupImpl = React.createClass({ - displayName: 'FixedDataTableCellGroupImpl', + var FixedDataTableCellGroupImpl = createReactClass({ + displayName: "FixedDataTableCellGroupImpl", /** * PropTypes are disabled in this component, because having them on slows @@ -4831,8 +7129,8 @@ return /******/ (function(modules) { // webpackBootstrap } }); - var FixedDataTableCellGroup = React.createClass({ - displayName: 'FixedDataTableCellGroup', + var FixedDataTableCellGroup = createReactClass({ + displayName: "FixedDataTableCellGroup", /** * PropTypes are disabled in this component, because having them on slows @@ -4908,9 +7206,9 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = FixedDataTableCellGroup; -/***/ }, -/* 60 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 73 */ +/***/ (function(module, exports, __webpack_require__) { /** * Copyright (c) 2015, Facebook, Inc. @@ -4926,10 +7224,10 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; - var Locale = __webpack_require__(61); - var React = __webpack_require__(27); - var FixedDataTableColumnGroup = __webpack_require__(62); - var FixedDataTableColumn = __webpack_require__(63); + var Locale = __webpack_require__(74); + var React = __webpack_require__(34); + var FixedDataTableColumnGroup = __webpack_require__(75); + var FixedDataTableColumn = __webpack_require__(76); var DIR_SIGN = Locale.isRTL() ? -1 : +1; // A cell up to 5px outside of the visible area will still be considered visible @@ -5017,9 +7315,9 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = FixedDataTableHelper; -/***/ }, -/* 61 */ -/***/ function(module, exports) { +/***/ }), +/* 74 */ +/***/ (function(module, exports) { /** * Copyright (c) 2015, Facebook, Inc. @@ -5046,9 +7344,9 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = Locale; -/***/ }, -/* 62 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 75 */ +/***/ (function(module, exports, __webpack_require__) { /** * Copyright (c) 2015, Facebook, Inc. @@ -5071,28 +7369,47 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; - var React = __webpack_require__(27); + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - var TransitionColumnGroup = React.createClass({ - displayName: 'TransitionColumnGroup', + var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; - statics: { - __TableColumnGroup__: true - }, + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - render: function render() { - if (false) { - throw new Error('Component should never render'); - } - return null; + function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var React = __webpack_require__(34); + + var TransitionColumnGroup = (function (_React$Component) { + _inherits(TransitionColumnGroup, _React$Component); + + function TransitionColumnGroup() { + _classCallCheck(this, TransitionColumnGroup); + + _get(Object.getPrototypeOf(TransitionColumnGroup.prototype), 'constructor', this).apply(this, arguments); } - }); + + _createClass(TransitionColumnGroup, [{ + key: 'render', + value: function render() { + if (false) { + throw new Error('Component should never render'); + } + return null; + } + }], [{ + key: '__TableColumnGroup__', + value: true, + enumerable: true + }]); + + return TransitionColumnGroup; + })(React.Component); module.exports = TransitionColumnGroup; -/***/ }, -/* 63 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 76 */ +/***/ (function(module, exports, __webpack_require__) { /** * Copyright (c) 2015, Facebook, Inc. @@ -5115,28 +7432,47 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; - var React = __webpack_require__(27); + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; - var TransitionColumn = React.createClass({ - displayName: 'TransitionColumn', + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - statics: { - __TableColumn__: true - }, + function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - render: function render() { - if (false) { - throw new Error('Component should never render'); - } - return null; + var React = __webpack_require__(34); + + var TransitionColumn = (function (_React$Component) { + _inherits(TransitionColumn, _React$Component); + + function TransitionColumn() { + _classCallCheck(this, TransitionColumn); + + _get(Object.getPrototypeOf(TransitionColumn.prototype), 'constructor', this).apply(this, arguments); } - }); + + _createClass(TransitionColumn, [{ + key: 'render', + value: function render() { + if (false) { + throw new Error('Component should never render'); + } + return null; + } + }], [{ + key: '__TableColumn__', + value: true, + enumerable: true + }]); + + return TransitionColumn; + })(React.Component); module.exports = TransitionColumn; -/***/ }, -/* 64 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 77 */ +/***/ (function(module, exports, __webpack_require__) { /** * Copyright (c) 2015, Facebook, Inc. @@ -5154,23 +7490,23 @@ return /******/ (function(modules) { // webpackBootstrap function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } - var FixedDataTableCellDefault = __webpack_require__(65); - var FixedDataTableHelper = __webpack_require__(60); - var React = __webpack_require__(27); - var cx = __webpack_require__(47); - var joinClasses = __webpack_require__(66); + var FixedDataTableCellDefault = __webpack_require__(78); + var FixedDataTableHelper = __webpack_require__(73); + var PropTypes = __webpack_require__(27); + var React = __webpack_require__(34); + var createReactClass = __webpack_require__(37); + var cx = __webpack_require__(60); + var joinClasses = __webpack_require__(79); var DIR_SIGN = FixedDataTableHelper.DIR_SIGN; - var PropTypes = React.PropTypes; - var DEFAULT_PROPS = { align: 'left', highlighted: false }; - var FixedDataTableCell = React.createClass({ - displayName: 'FixedDataTableCell', + var FixedDataTableCell = createReactClass({ + displayName: "FixedDataTableCell", /** * PropTypes are disabled in this component, because having them on slows @@ -5309,10 +7645,25 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = FixedDataTableCell; -/***/ }, -/* 65 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 78 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; + + function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + + function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var PropTypes = __webpack_require__(27); /** * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -5322,21 +7673,13 @@ return /******/ (function(modules) { // webpackBootstrap * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule FixedDataTableCellDefault.react - * @typechecks - */ - - 'use strict'; - - var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - - function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } - - var React = __webpack_require__(27); + * @typechecks + */ - var cx = __webpack_require__(47); - var joinClasses = __webpack_require__(66); + var React = __webpack_require__(34); - var PropTypes = React.PropTypes; + var cx = __webpack_require__(60); + var joinClasses = __webpack_require__(79); /** * Component that handles default cell layout and styling. @@ -5361,72 +7704,86 @@ return /******/ (function(modules) { // webpackBootstrap * ); * ``` */ - var FixedDataTableCellDefault = React.createClass({ - displayName: 'FixedDataTableCellDefault', - - propTypes: { - /** - * Outer height of the cell. - */ - height: PropTypes.number, + var FixedDataTableCellDefault = (function (_React$Component) { + _inherits(FixedDataTableCellDefault, _React$Component); - /** - * Outer width of the cell. - */ - width: PropTypes.number, + function FixedDataTableCellDefault() { + _classCallCheck(this, FixedDataTableCellDefault); - /** - * Optional prop that if specified on the `Column` will be passed to the - * cell. It can be used to uniquely identify which column is the cell is in. - */ - columnKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]) - }, + _get(Object.getPrototypeOf(FixedDataTableCellDefault.prototype), 'constructor', this).apply(this, arguments); + } - render: function render() { - var _props = this.props; - var height = _props.height; - var width = _props.width; - var style = _props.style; - var className = _props.className; - var children = _props.children; + _createClass(FixedDataTableCellDefault, [{ + key: 'render', + value: function render() { + var _props = this.props; + var height = _props.height; + var width = _props.width; + var style = _props.style; + var className = _props.className; + var children = _props.children; - var props = _objectWithoutProperties(_props, ['height', 'width', 'style', 'className', 'children']); + var props = _objectWithoutProperties(_props, ['height', 'width', 'style', 'className', 'children']); - var innerStyle = _extends({ - height: height, - width: width - }, style); + var innerStyle = _extends({ + height: height, + width: width + }, style); - return React.createElement( - 'div', - _extends({}, props, { - className: joinClasses(cx('fixedDataTableCellLayout/wrap1'), cx('public/fixedDataTableCell/wrap1'), className), - style: innerStyle }), - React.createElement( + return React.createElement( 'div', - { - className: joinClasses(cx('fixedDataTableCellLayout/wrap2'), cx('public/fixedDataTableCell/wrap2')) }, + _extends({}, props, { + className: joinClasses(cx('fixedDataTableCellLayout/wrap1'), cx('public/fixedDataTableCell/wrap1'), className), + style: innerStyle }), React.createElement( 'div', { - className: joinClasses(cx('fixedDataTableCellLayout/wrap3'), cx('public/fixedDataTableCell/wrap3')) }, + className: joinClasses(cx('fixedDataTableCellLayout/wrap2'), cx('public/fixedDataTableCell/wrap2')) }, React.createElement( 'div', - { className: cx('public/fixedDataTableCell/cellContent') }, - children + { + className: joinClasses(cx('fixedDataTableCellLayout/wrap3'), cx('public/fixedDataTableCell/wrap3')) }, + React.createElement( + 'div', + { className: cx('public/fixedDataTableCell/cellContent') }, + children + ) ) ) - ) - ); - } - }); + ); + } + }], [{ + key: 'propTypes', + value: { + + /** + * Outer height of the cell. + */ + height: PropTypes.number, + + /** + * Outer width of the cell. + */ + width: PropTypes.number, + + /** + * Optional prop that if specified on the `Column` will be passed to the + * cell. It can be used to uniquely identify which column is the cell is in. + */ + columnKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]) + }, + enumerable: true + }]); + + return FixedDataTableCellDefault; + })(React.Component); module.exports = FixedDataTableCellDefault; -/***/ }, -/* 66 */ -/***/ function(module, exports) { +/***/ }), +/* 79 */ +/***/ (function(module, exports) { /** * Copyright 2013-2015, Facebook, Inc. @@ -5468,9 +7825,9 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = joinClasses; -/***/ }, -/* 67 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 80 */ +/***/ (function(module, exports, __webpack_require__) { /** * Copyright (c) 2015, Facebook, Inc. @@ -5490,19 +7847,18 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; - var DOMMouseMoveTracker = __webpack_require__(40); - var Locale = __webpack_require__(61); - var React = __webpack_require__(27); - var ReactComponentWithPureRenderMixin = __webpack_require__(30); - - var clamp = __webpack_require__(57); - var cx = __webpack_require__(47); + var DOMMouseMoveTracker = __webpack_require__(53); + var Locale = __webpack_require__(74); + var PropTypes = __webpack_require__(27); + var React = __webpack_require__(34); + var createReactClass = __webpack_require__(37); + var ReactComponentWithPureRenderMixin = __webpack_require__(43); - var PropTypes = React.PropTypes; - - var FixedDataTableColumnResizeHandle = React.createClass({ - displayName: 'FixedDataTableColumnResizeHandle', + var clamp = __webpack_require__(70); + var cx = __webpack_require__(60); + var FixedDataTableColumnResizeHandle = createReactClass({ + displayName: "FixedDataTableColumnResizeHandle", mixins: [ReactComponentWithPureRenderMixin], propTypes: { @@ -5633,9 +7989,9 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = FixedDataTableColumnResizeHandle; -/***/ }, -/* 68 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 81 */ +/***/ (function(module, exports, __webpack_require__) { /** * Copyright (c) 2015, Facebook, Inc. @@ -5655,8 +8011,8 @@ return /******/ (function(modules) { // webpackBootstrap function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - var PrefixIntervalTree = __webpack_require__(69); - var clamp = __webpack_require__(57); + var PrefixIntervalTree = __webpack_require__(82); + var clamp = __webpack_require__(70); var BUFFER_ROWS = 5; var NO_ROWS_SCROLL_RESULT = { @@ -5938,9 +8294,9 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = FixedDataTableScrollHelper; -/***/ }, -/* 69 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 82 */ +/***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {/** * Copyright (c) 2015, Facebook, Inc. @@ -5961,7 +8317,7 @@ return /******/ (function(modules) { // webpackBootstrap function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - var invariant = __webpack_require__(52); + var invariant = __webpack_require__(65); var parent = function parent(node) { return Math.floor(node / 2); @@ -6202,9 +8558,9 @@ return /******/ (function(modules) { // webpackBootstrap */ /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) -/***/ }, -/* 70 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 83 */ +/***/ (function(module, exports, __webpack_require__) { /** * Copyright (c) 2015, Facebook, Inc. @@ -6220,7 +8576,7 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; - var React = __webpack_require__(27); + var React = __webpack_require__(34); function getTotalWidth( /*array*/columns) /*number*/{ var totalWidth = 0; @@ -6340,9 +8696,9 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = FixedDataTableWidthHelper; -/***/ }, -/* 71 */ -/***/ function(module, exports) { +/***/ }), +/* 84 */ +/***/ (function(module, exports) { /** * Copyright (c) 2015, Facebook, Inc. @@ -6412,9 +8768,9 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = debounce; -/***/ }, -/* 72 */ -/***/ function(module, exports) { +/***/ }), +/* 85 */ +/***/ (function(module, exports) { /** * Copyright (c) 2015, Facebook, Inc. @@ -6467,10 +8823,21 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = shallowEqual; -/***/ }, -/* 73 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 86 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + + function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var PropTypes = __webpack_require__(27); /** * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -6483,178 +8850,199 @@ return /******/ (function(modules) { // webpackBootstrap * @typechecks */ - 'use strict'; - - var React = __webpack_require__(27); - - var PropTypes = React.PropTypes; + var React = __webpack_require__(34); /** * Component that defines the attributes of table column. */ - var FixedDataTableColumn = React.createClass({ - displayName: 'FixedDataTableColumn', - - statics: { - __TableColumn__: true - }, - - propTypes: { - /** - * The horizontal alignment of the table cell content. - */ - align: PropTypes.oneOf(['left', 'center', 'right']), - - /** - * Controls if the column is fixed when scrolling in the X axis. - */ - fixed: PropTypes.bool, - /** - * The header cell for this column. - * This can either be a string a React element, or a function that generates - * a React Element. Passing in a string will render a default header cell - * with that string. By default, the React element passed in can expect to - * receive the following props: - * - * ``` - * props: { - * columnKey: string // (of the column, if given) - * height: number // (supplied from the Table or rowHeightGetter) - * width: number // (supplied from the Column) - * } - * ``` - * - * Because you are passing in your own React element, you can feel free to - * pass in whatever props you may want or need. - * - * If you pass in a function, you will receive the same props object as the - * first argument. - */ - header: PropTypes.oneOfType([PropTypes.node, PropTypes.func]), - - /** - * This is the body cell that will be cloned for this column. - * This can either be a string a React element, or a function that generates - * a React Element. Passing in a string will render a default header cell - * with that string. By default, the React element passed in can expect to - * receive the following props: - * - * ``` - * props: { - * rowIndex; number // (the row index of the cell) - * columnKey: string // (of the column, if given) - * height: number // (supplied from the Table or rowHeightGetter) - * width: number // (supplied from the Column) - * } - * ``` - * - * Because you are passing in your own React element, you can feel free to - * pass in whatever props you may want or need. - * - * If you pass in a function, you will receive the same props object as the - * first argument. - */ - cell: PropTypes.oneOfType([PropTypes.node, PropTypes.func]), - - /** - * This is the footer cell for this column. - * This can either be a string a React element, or a function that generates - * a React Element. Passing in a string will render a default header cell - * with that string. By default, the React element passed in can expect to - * receive the following props: - * - * ``` - * props: { - * columnKey: string // (of the column, if given) - * height: number // (supplied from the Table or rowHeightGetter) - * width: number // (supplied from the Column) - * } - * ``` - * - * Because you are passing in your own React element, you can feel free to - * pass in whatever props you may want or need. - * - * If you pass in a function, you will receive the same props object as the - * first argument. - */ - footer: PropTypes.oneOfType([PropTypes.node, PropTypes.func]), - - /** - * This is used to uniquely identify the column, and is not required unless - * you a resizing columns. This will be the key given in the - * `onColumnResizeEndCallback` on the Table. - */ - columnKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), - - /** - * The pixel width of the column. - */ - width: PropTypes.number.isRequired, - - /** - * If this is a resizable column this is its minimum pixel width. - */ - minWidth: PropTypes.number, - - /** - * If this is a resizable column this is its maximum pixel width. - */ - maxWidth: PropTypes.number, + var FixedDataTableColumn = (function (_React$Component) { + _inherits(FixedDataTableColumn, _React$Component); + + function FixedDataTableColumn() { + _classCallCheck(this, FixedDataTableColumn); + + _get(Object.getPrototypeOf(FixedDataTableColumn.prototype), 'constructor', this).apply(this, arguments); + } + + _createClass(FixedDataTableColumn, [{ + key: 'render', + value: function render() { + if (false) { + throw new Error('Component should never render'); + } + return null; + } + }], [{ + key: '__TableColumn__', + value: true, + enumerable: true + }, { + key: 'propTypes', + value: { + /** + * The horizontal alignment of the table cell content. + */ + align: PropTypes.oneOf(['left', 'center', 'right']), + + /** + * Controls if the column is fixed when scrolling in the X axis. + */ + fixed: PropTypes.bool, + + /** + * The header cell for this column. + * This can either be a string a React element, or a function that generates + * a React Element. Passing in a string will render a default header cell + * with that string. By default, the React element passed in can expect to + * receive the following props: + * + * ``` + * props: { + * columnKey: string // (of the column, if given) + * height: number // (supplied from the Table or rowHeightGetter) + * width: number // (supplied from the Column) + * } + * ``` + * + * Because you are passing in your own React element, you can feel free to + * pass in whatever props you may want or need. + * + * If you pass in a function, you will receive the same props object as the + * first argument. + */ + header: PropTypes.oneOfType([PropTypes.node, PropTypes.func]), + + /** + * This is the body cell that will be cloned for this column. + * This can either be a string a React element, or a function that generates + * a React Element. Passing in a string will render a default header cell + * with that string. By default, the React element passed in can expect to + * receive the following props: + * + * ``` + * props: { + * rowIndex; number // (the row index of the cell) + * columnKey: string // (of the column, if given) + * height: number // (supplied from the Table or rowHeightGetter) + * width: number // (supplied from the Column) + * } + * ``` + * + * Because you are passing in your own React element, you can feel free to + * pass in whatever props you may want or need. + * + * If you pass in a function, you will receive the same props object as the + * first argument. + */ + cell: PropTypes.oneOfType([PropTypes.node, PropTypes.func]), + + /** + * This is the footer cell for this column. + * This can either be a string a React element, or a function that generates + * a React Element. Passing in a string will render a default header cell + * with that string. By default, the React element passed in can expect to + * receive the following props: + * + * ``` + * props: { + * columnKey: string // (of the column, if given) + * height: number // (supplied from the Table or rowHeightGetter) + * width: number // (supplied from the Column) + * } + * ``` + * + * Because you are passing in your own React element, you can feel free to + * pass in whatever props you may want or need. + * + * If you pass in a function, you will receive the same props object as the + * first argument. + */ + footer: PropTypes.oneOfType([PropTypes.node, PropTypes.func]), + + /** + * This is used to uniquely identify the column, and is not required unless + * you a resizing columns. This will be the key given in the + * `onColumnResizeEndCallback` on the Table. + */ + columnKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), + + /** + * The pixel width of the column. + */ + width: PropTypes.number.isRequired, + + /** + * If this is a resizable column this is its minimum pixel width. + */ + minWidth: PropTypes.number, + + /** + * If this is a resizable column this is its maximum pixel width. + */ + maxWidth: PropTypes.number, + + /** + * The grow factor relative to other columns. Same as the flex-grow API + * from http://www.w3.org/TR/css3-flexbox/. Basically, take any available + * extra width and distribute it proportionally according to all columns' + * flexGrow values. Defaults to zero (no-flexing). + */ + flexGrow: PropTypes.number, + + /** + * Whether the column can be resized with the + * FixedDataTableColumnResizeHandle. Please note that if a column + * has a flex grow, once you resize the column this will be set to 0. + * + * This property only provides the UI for the column resizing. If this + * is set to true, you will need to set the onColumnResizeEndCallback table + * property and render your columns appropriately. + */ + isResizable: PropTypes.bool, + + /** + * Whether cells in this column can be removed from document when outside + * of viewport as a result of horizontal scrolling. + * Setting this property to true allows the table to not render cells in + * particular column that are outside of viewport for visible rows. This + * allows to create table with many columns and not have vertical scrolling + * performance drop. + * Setting the property to false will keep previous behaviour and keep + * cell rendered if the row it belongs to is visible. + */ + allowCellsRecycling: PropTypes.bool + }, + enumerable: true + }, { + key: 'defaultProps', + value: { + allowCellsRecycling: false, + fixed: false + }, + enumerable: true + }]); + + return FixedDataTableColumn; + })(React.Component); - /** - * The grow factor relative to other columns. Same as the flex-grow API - * from http://www.w3.org/TR/css3-flexbox/. Basically, take any available - * extra width and distribute it proportionally according to all columns' - * flexGrow values. Defaults to zero (no-flexing). - */ - flexGrow: PropTypes.number, + module.exports = FixedDataTableColumn; - /** - * Whether the column can be resized with the - * FixedDataTableColumnResizeHandle. Please note that if a column - * has a flex grow, once you resize the column this will be set to 0. - * - * This property only provides the UI for the column resizing. If this - * is set to true, you will need to set the onColumnResizeEndCallback table - * property and render your columns appropriately. - */ - isResizable: PropTypes.bool, +/***/ }), +/* 87 */ +/***/ (function(module, exports, __webpack_require__) { - /** - * Whether cells in this column can be removed from document when outside - * of viewport as a result of horizontal scrolling. - * Setting this property to true allows the table to not render cells in - * particular column that are outside of viewport for visible rows. This - * allows to create table with many columns and not have vertical scrolling - * performance drop. - * Setting the property to false will keep previous behaviour and keep - * cell rendered if the row it belongs to is visible. - */ - allowCellsRecycling: PropTypes.bool - }, + 'use strict'; - getDefaultProps: function getDefaultProps() /*object*/{ - return { - allowCellsRecycling: false, - fixed: false - }; - }, + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - render: function render() { - if (false) { - throw new Error('Component should never render'); - } - return null; - } - }); + var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; - module.exports = FixedDataTableColumn; + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } -/***/ }, -/* 74 */ -/***/ function(module, exports, __webpack_require__) { + function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + var PropTypes = __webpack_require__(27); /** * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -6667,76 +9055,99 @@ return /******/ (function(modules) { // webpackBootstrap * @typechecks */ - 'use strict'; - - var React = __webpack_require__(27); - - var PropTypes = React.PropTypes; + var React = __webpack_require__(34); /** * Component that defines the attributes of a table column group. */ - var FixedDataTableColumnGroup = React.createClass({ - displayName: 'FixedDataTableColumnGroup', - statics: { - __TableColumnGroup__: true - }, - - propTypes: { - /** - * The horizontal alignment of the table cell content. - */ - align: PropTypes.oneOf(['left', 'center', 'right']), - - /** - * Controls if the column group is fixed when scrolling in the X axis. - */ - fixed: PropTypes.bool, + var FixedDataTableColumnGroup = (function (_React$Component) { + _inherits(FixedDataTableColumnGroup, _React$Component); - /** - * This is the header cell for this column group. - * This can either be a string or a React element. Passing in a string - * will render a default footer cell with that string. By default, the React - * element passed in can expect to receive the following props: - * - * ``` - * props: { - * height: number // (supplied from the groupHeaderHeight) - * width: number // (supplied from the Column) - * } - * ``` - * - * Because you are passing in your own React element, you can feel free to - * pass in whatever props you may want or need. - * - * You can also pass in a function that returns a react elemnt, with the - * props object above passed in as the first parameter. - */ - header: PropTypes.oneOfType([PropTypes.node, PropTypes.func]) + function FixedDataTableColumnGroup() { + _classCallCheck(this, FixedDataTableColumnGroup); - }, + _get(Object.getPrototypeOf(FixedDataTableColumnGroup.prototype), 'constructor', this).apply(this, arguments); + } - getDefaultProps: function getDefaultProps() /*object*/{ - return { + _createClass(FixedDataTableColumnGroup, [{ + key: 'render', + value: function render() { + if (false) { + throw new Error('Component should never render'); + } + return null; + } + }], [{ + key: '__TableColumnGroup__', + value: true, + enumerable: true + }, { + key: 'propTypes', + value: { + /** + * The horizontal alignment of the table cell content. + */ + align: PropTypes.oneOf(['left', 'center', 'right']), + + /** + * Controls if the column group is fixed when scrolling in the X axis. + */ + fixed: PropTypes.bool, + + /** + * This is the header cell for this column group. + * This can either be a string or a React element. Passing in a string + * will render a default footer cell with that string. By default, the React + * element passed in can expect to receive the following props: + * + * ``` + * props: { + * height: number // (supplied from the groupHeaderHeight) + * width: number // (supplied from the Column) + * } + * ``` + * + * Because you are passing in your own React element, you can feel free to + * pass in whatever props you may want or need. + * + * You can also pass in a function that returns a react elemnt, with the + * props object above passed in as the first parameter. + */ + header: PropTypes.oneOfType([PropTypes.node, PropTypes.func]) + + }, + enumerable: true + }, { + key: 'defaultProps', + value: { fixed: false - }; - }, + }, + enumerable: true + }]); - render: function render() { - if (false) { - throw new Error('Component should never render'); - } - return null; - } - }); + return FixedDataTableColumnGroup; + })(React.Component); module.exports = FixedDataTableColumnGroup; -/***/ }, -/* 75 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 88 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + + function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var PropTypes = __webpack_require__(27); /** * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -6756,183 +9167,192 @@ return /******/ (function(modules) { // webpackBootstrap * FixedDataTableCellNew.react and dependency in FixedDataTableCellGroup.react */ - 'use strict'; + var React = __webpack_require__(34); - var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + var cx = __webpack_require__(60); + var joinClasses = __webpack_require__(79); + var shallowEqual = __webpack_require__(85); - var React = __webpack_require__(27); - var PropTypes = React.PropTypes; + var CellDefault = __webpack_require__(78); - var cx = __webpack_require__(47); - var joinClasses = __webpack_require__(66); - var shallowEqual = __webpack_require__(72); + var TransitionCell = (function (_React$Component) { + _inherits(TransitionCell, _React$Component); - var CellDefault = __webpack_require__(65); + function TransitionCell() { + _classCallCheck(this, TransitionCell); - var TransitionCell = React.createClass({ - displayName: 'TransitionCell', + _get(Object.getPrototypeOf(TransitionCell.prototype), 'constructor', this).apply(this, arguments); - propTypes: { - label: PropTypes.string, // header, footer - className: PropTypes.string, - rowIndex: PropTypes.number, - rowGetter: PropTypes.func, // cell - dataKey: PropTypes.oneOfType([// cell, footer - PropTypes.string, PropTypes.number]), - cellRenderer: PropTypes.func, - cellDataGetter: PropTypes.func, - footerDataGetter: PropTypes.func, // footer - footerData: PropTypes.any, // footer - columnData: PropTypes.any, // cell, header - width: PropTypes.number, - height: PropTypes.number, - isHeaderCell: PropTypes.bool, // header - isFooterCell: PropTypes.bool }, - - // footer - shouldComponentUpdate: function shouldComponentUpdate( /*object*/nextProps) { - var update = false; - var rowData; - if (nextProps.rowGetter) { - rowData = nextProps.rowGetter(nextProps.rowIndex); - if (this._rowData !== rowData) { - update = true; + this._getCellData = function (props) { + var dataKey = props.dataKey; + if (dataKey == null) { + return null; } - } - var cellData; - if (nextProps.dataKey != null) { - if (nextProps.cellDataGetter) { - cellData = nextProps.cellDataGetter(nextProps.dataKey, rowData); + var rowData; + if (props.rowGetter) { + rowData = props.rowGetter(props.rowIndex); } - if (!cellData && rowData) { - cellData = rowData[nextProps.dataKey]; + + if (props.cellDataGetter) { + return props.cellDataGetter(dataKey, rowData); } - } - if (this._cellData !== cellData) { - update = true; - } - this._rowData = rowData; - this._cellData = cellData; - return update || !shallowEqual(nextProps, this.props); - }, + if (rowData) { + return rowData[dataKey]; + } - _getCellData: function _getCellData(props) { - var dataKey = props.dataKey; - if (dataKey == null) { - return null; - } + if (props.footerDataGetter) { + return props.footerDataGetter()[dataKey]; + } - var rowData; - if (props.rowGetter) { - rowData = props.rowGetter(props.rowIndex); - } + if (props.footerData) { + return props.footerData[dataKey]; + } - if (props.cellDataGetter) { - return props.cellDataGetter(dataKey, rowData); - } + if (props.headerDataGetter) { + return props.headerDataGetter[dataKey]; + } + }; - if (rowData) { - return rowData[dataKey]; - } + this._getRowData = function (props) { + if (props.rowGetter) { + return props.rowGetter(props.rowIndex) || {}; + } - if (props.footerDataGetter) { - return props.footerDataGetter()[dataKey]; - } + if (props.footerDataGetter) { + return props.footerDataGetter() || {}; + } - if (props.footerData) { - return props.footerData[dataKey]; - } + if (props.footerData) { + return props.footerData || {}; + } - if (props.headerDataGetter) { - return props.headerDataGetter[dataKey]; - } - }, + return {}; + }; + } - _getRowData: function _getRowData(props) { - if (props.rowGetter) { - return props.rowGetter(props.rowIndex) || {}; - } + _createClass(TransitionCell, [{ + key: 'shouldComponentUpdate', + // footer + value: function shouldComponentUpdate( /*object*/nextProps) { + var update = false; + var rowData; + if (nextProps.rowGetter) { + rowData = nextProps.rowGetter(nextProps.rowIndex); + if (this._rowData !== rowData) { + update = true; + } + } - if (props.footerDataGetter) { - return props.footerDataGetter() || {}; - } + var cellData; + if (nextProps.dataKey != null) { + if (nextProps.cellDataGetter) { + cellData = nextProps.cellDataGetter(nextProps.dataKey, rowData); + } + if (!cellData && rowData) { + cellData = rowData[nextProps.dataKey]; + } + } + if (this._cellData !== cellData) { + update = true; + } + this._rowData = rowData; + this._cellData = cellData; - if (props.footerData) { - return props.footerData || {}; + return update || !shallowEqual(nextProps, this.props); } + }, { + key: 'render', + value: function render() { + var props = this.props; - return {}; - }, + var cellData = this._getCellData(props); + var content = cellData; + var rowData = this._getRowData(props); + var usingRenderer = !!(props.cellRenderer || props.groupHeaderRenderer); - render: function render() { - var props = this.props; + if (props.isHeaderCell || props.isFooterCell) { + content = content || props.label; + } - var cellData = this._getCellData(props); - var content = cellData; - var rowData = this._getRowData(props); - var usingRenderer = !!(props.cellRenderer || props.groupHeaderRenderer); + if (props.cellRenderer) { + if (props.isHeaderCell || props.isFooterCell) { + content = props.cellRenderer(props.label, props.dataKey, props.columnData, rowData, props.width) || props.label; + } else { + content = props.cellRenderer(cellData, props.dataKey, rowData, props.rowIndex, props.columnData, props.width); + } + } - if (props.isHeaderCell || props.isFooterCell) { - content = content || props.label; - } + if (props.groupHeaderRenderer) { + content = props.groupHeaderRenderer(props.label, props.dataKey, // index in children + props.groupHeaderData, props.groupHeaderLabels, props.width) || content; + } - if (props.cellRenderer) { - if (props.isHeaderCell || props.isFooterCell) { - content = props.cellRenderer(props.label, props.dataKey, props.columnData, rowData, props.width) || props.label; + var contentClass = cx('public/fixedDataTableCell/cellContent'); + + if (React.isValidElement(content) && usingRenderer) { + content = React.cloneElement(content, { + className: joinClasses(content.props.className, contentClass) + }); } else { - content = props.cellRenderer(cellData, props.dataKey, rowData, props.rowIndex, props.columnData, props.width); + return React.createElement( + CellDefault, + props, + content + ); } - } - - if (props.groupHeaderRenderer) { - content = props.groupHeaderRenderer(props.label, props.dataKey, // index in children - props.groupHeaderData, props.groupHeaderLabels, props.width) || content; - } - var contentClass = cx('public/fixedDataTableCell/cellContent'); + var innerStyle = _extends({ + height: props.height, + width: props.width + }, props.style); - if (React.isValidElement(content) && usingRenderer) { - content = React.cloneElement(content, { - className: joinClasses(content.props.className, contentClass) - }); - } else { return React.createElement( - CellDefault, - props, - content - ); - } - - var innerStyle = _extends({ - height: props.height, - width: props.width - }, props.style); - - return React.createElement( - 'div', - _extends({}, this.props, { - className: joinClasses(cx('fixedDataTableCellLayout/wrap1'), cx('public/fixedDataTableCell/wrap1'), this.props.className), - style: innerStyle }), - React.createElement( 'div', - { - className: joinClasses(cx('fixedDataTableCellLayout/wrap2'), cx('public/fixedDataTableCell/wrap2')) }, + _extends({}, this.props, { + className: joinClasses(cx('fixedDataTableCellLayout/wrap1'), cx('public/fixedDataTableCell/wrap1'), this.props.className), + style: innerStyle }), React.createElement( 'div', { - className: joinClasses(cx('fixedDataTableCellLayout/wrap3'), cx('public/fixedDataTableCell/wrap3')) }, - content + className: joinClasses(cx('fixedDataTableCellLayout/wrap2'), cx('public/fixedDataTableCell/wrap2')) }, + React.createElement( + 'div', + { + className: joinClasses(cx('fixedDataTableCellLayout/wrap3'), cx('public/fixedDataTableCell/wrap3')) }, + content + ) ) - ) - ); - } - }); + ); + } + }], [{ + key: 'propTypes', + value: { + label: PropTypes.string, // header, footer + className: PropTypes.string, + rowIndex: PropTypes.number, + rowGetter: PropTypes.func, // cell + dataKey: PropTypes.oneOfType([// cell, footer + PropTypes.string, PropTypes.number]), + cellRenderer: PropTypes.func, + cellDataGetter: PropTypes.func, + footerDataGetter: PropTypes.func, // footer + footerData: PropTypes.any, // footer + columnData: PropTypes.any, // cell, header + width: PropTypes.number, + height: PropTypes.number, + isHeaderCell: PropTypes.bool, // header + isFooterCell: PropTypes.bool }, + enumerable: true + }]); + + return TransitionCell; + })(React.Component); module.exports = TransitionCell; -/***/ } +/***/ }) /******/ ]) }); ; \ No newline at end of file diff --git a/dist/fixed-data-table.min.css b/dist/fixed-data-table.min.css index 9a91fcae..d99accec 100644 --- a/dist/fixed-data-table.min.css +++ b/dist/fixed-data-table.min.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.2 + * FixedDataTable v0.7.5 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -9,4 +9,4 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -.fixedDataTableCellGroupLayout_cellGroup{-webkit-backface-visibility:hidden;backface-visibility:hidden;left:0;overflow:hidden;position:absolute;top:0;white-space:nowrap}.fixedDataTableCellGroupLayout_cellGroup>.public_fixedDataTableCell_main{display:inline-block;vertical-align:top;white-space:normal}.fixedDataTableCellGroupLayout_cellGroupWrapper{position:absolute;top:0}.fixedDataTableCellLayout_main{border-right-style:solid;border-width:0 1px 0 0;box-sizing:border-box;display:block;overflow:hidden;position:absolute;white-space:normal}.fixedDataTableCellLayout_lastChild{border-width:0 1px 1px 0}.fixedDataTableCellLayout_alignRight{text-align:right}.fixedDataTableCellLayout_alignCenter{text-align:center}.fixedDataTableCellLayout_wrap1{display:table}.fixedDataTableCellLayout_wrap2{display:table-row}.fixedDataTableCellLayout_wrap3{display:table-cell;vertical-align:middle}.fixedDataTableCellLayout_columnResizerContainer{position:absolute;right:0;width:6px;z-index:1}.fixedDataTableCellLayout_columnResizerContainer:hover{cursor:ew-resize}.fixedDataTableCellLayout_columnResizerContainer:hover .fixedDataTableCellLayout_columnResizerKnob{visibility:visible}.fixedDataTableCellLayout_columnResizerKnob{position:absolute;right:0;visibility:hidden;width:4px}.fixedDataTableColumnResizerLineLayout_mouseArea{cursor:ew-resize;position:absolute;right:-5px;width:12px}.fixedDataTableColumnResizerLineLayout_main{border-right-style:solid;border-right-width:1px;box-sizing:border-box;position:absolute;z-index:10}body[dir="rtl"] .fixedDataTableColumnResizerLineLayout_main,.fixedDataTableColumnResizerLineLayout_hiddenElem{display:none!important}.fixedDataTableLayout_main{border-style:solid;border-width:1px;box-sizing:border-box;overflow:hidden;position:relative}.fixedDataTableLayout_header,.fixedDataTableLayout_hasBottomBorder{border-bottom-style:solid;border-bottom-width:1px}.fixedDataTableLayout_footer .public_fixedDataTableCell_main{border-top-style:solid;border-top-width:1px}.fixedDataTableLayout_topShadow,.fixedDataTableLayout_bottomShadow{height:4px;left:0;position:absolute;right:0;z-index:1}.fixedDataTableLayout_bottomShadow{margin-top:-4px}.fixedDataTableLayout_rowsContainer{overflow:hidden;position:relative}.fixedDataTableLayout_horizontalScrollbar{bottom:0;position:absolute}.fixedDataTableRowLayout_main{box-sizing:border-box;overflow:hidden;position:absolute;top:0}.fixedDataTableRowLayout_body{left:0;position:absolute;top:0}.fixedDataTableRowLayout_fixedColumnsDivider{-webkit-backface-visibility:hidden;backface-visibility:hidden;border-left-style:solid;border-left-width:1px;left:0;position:absolute;top:0;width:0}.fixedDataTableRowLayout_columnsShadow{width:4px}.fixedDataTableRowLayout_rowWrapper{position:absolute;top:0}.ScrollbarLayout_main{box-sizing:border-box;outline:none;overflow:hidden;position:absolute;-webkit-transition-duration:250ms;transition-duration:250ms;-webkit-transition-timing-function:ease;transition-timing-function:ease;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ScrollbarLayout_mainVertical{bottom:0;right:0;top:0;-webkit-transition-property:background-color width;transition-property:background-color width;width:15px}.ScrollbarLayout_mainVertical.public_Scrollbar_mainActive,.ScrollbarLayout_mainVertical:hover{width:17px}.ScrollbarLayout_mainHorizontal{bottom:0;height:15px;left:0;-webkit-transition-property:background-color height;transition-property:background-color height}.ScrollbarLayout_mainHorizontal.public_Scrollbar_mainActive,.ScrollbarLayout_mainHorizontal:hover{height:17px}.ScrollbarLayout_face{left:0;overflow:hidden;position:absolute;z-index:1}.ScrollbarLayout_face:after{border-radius:6px;content:'';display:block;position:absolute;-webkit-transition:background-color 250ms ease;transition:background-color 250ms ease}.ScrollbarLayout_faceHorizontal{bottom:0;left:0;top:0}.ScrollbarLayout_faceHorizontal:after{bottom:4px;left:0;top:4px;width:100%}.ScrollbarLayout_faceVertical{left:0;right:0;top:0}.ScrollbarLayout_faceVertical:after{height:100%;left:4px;right:4px;top:0}.public_fixedDataTable_main,.public_fixedDataTable_header,.public_fixedDataTable_hasBottomBorder{border-color:#d3d3d3}.public_fixedDataTable_header .public_fixedDataTableCell_main{font-weight:700}.public_fixedDataTable_header,.public_fixedDataTable_header .public_fixedDataTableCell_main{background-color:#f6f7f8;background-image:-webkit-linear-gradient(#fff,#efefef);background-image:linear-gradient(#fff,#efefef)}.public_fixedDataTable_footer .public_fixedDataTableCell_main{background-color:#f6f7f8;border-color:#d3d3d3}.public_fixedDataTable_topShadow{background:0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAECAYAAABP2FU6AAAAF0lEQVR4AWPUkNeSBhHCjJoK2twgFisAFagCCp3pJlAAAAAASUVORK5CYII=) repeat-x}.public_fixedDataTable_bottomShadow{background:0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAECAYAAABP2FU6AAAAHElEQVQI12MwNjZmZdAT1+Nm0JDWEGZQk1GTBgAWkwIeAEp52AAAAABJRU5ErkJggg==) repeat-x}.public_fixedDataTable_horizontalScrollbar .public_Scrollbar_mainHorizontal{background-color:#fff}.public_fixedDataTableCell_main{background-color:#fff;border-color:#d3d3d3}.public_fixedDataTableCell_highlighted{background-color:#f4f4f4}.public_fixedDataTableCell_cellContent{padding:8px}.public_fixedDataTableCell_columnResizerKnob{background-color:#0284ff}.public_fixedDataTableColumnResizerLine_main{border-color:#0284ff}.public_fixedDataTableRow_main{background-color:#fff}.public_fixedDataTableRow_highlighted,.public_fixedDataTableRow_highlighted .public_fixedDataTableCell_main{background-color:#f6f7f8}.public_fixedDataTableRow_fixedColumnsDivider{border-color:#d3d3d3}.public_fixedDataTableRow_columnsShadow{background:0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABCAYAAAD5PA/NAAAAFklEQVQIHWPSkNeSBmJhTQVtbiDNCgASagIIuJX8OgAAAABJRU5ErkJggg==) repeat-y}.public_Scrollbar_main.public_Scrollbar_mainActive,.public_Scrollbar_main:hover{background-color:rgba(255,255,255,.8)}.public_Scrollbar_mainOpaque,.public_Scrollbar_mainOpaque.public_Scrollbar_mainActive,.public_Scrollbar_mainOpaque:hover{background-color:#fff}.public_Scrollbar_face:after{background-color:#c2c2c2}.public_Scrollbar_main:hover .public_Scrollbar_face:after,.public_Scrollbar_mainActive .public_Scrollbar_face:after,.public_Scrollbar_faceActive:after{background-color:#7d7d7d} \ No newline at end of file +.fixedDataTableCellGroupLayout_cellGroup{backface-visibility:hidden;left:0;overflow:hidden;position:absolute;top:0;white-space:nowrap}.fixedDataTableCellGroupLayout_cellGroup>.public_fixedDataTableCell_main{display:inline-block;vertical-align:top;white-space:normal}.fixedDataTableCellGroupLayout_cellGroupWrapper{position:absolute;top:0}.fixedDataTableCellLayout_main{border-right-style:solid;border-width:0 1px 0 0;box-sizing:border-box;display:block;overflow:hidden;position:absolute;white-space:normal}.fixedDataTableCellLayout_lastChild{border-width:0 1px 1px 0}.fixedDataTableCellLayout_alignRight{text-align:right}.fixedDataTableCellLayout_alignCenter{text-align:center}.fixedDataTableCellLayout_wrap1{display:table}.fixedDataTableCellLayout_wrap2{display:table-row}.fixedDataTableCellLayout_wrap3{display:table-cell;vertical-align:middle}.fixedDataTableCellLayout_columnResizerContainer{position:absolute;right:0;width:6px;z-index:1}.fixedDataTableCellLayout_columnResizerContainer:hover{cursor:ew-resize}.fixedDataTableCellLayout_columnResizerContainer:hover .fixedDataTableCellLayout_columnResizerKnob{visibility:visible}.fixedDataTableCellLayout_columnResizerKnob{position:absolute;right:0;visibility:hidden;width:4px}.fixedDataTableColumnResizerLineLayout_mouseArea{cursor:ew-resize;position:absolute;right:-5px;width:12px}.fixedDataTableColumnResizerLineLayout_main{border-right-style:solid;border-right-width:1px;box-sizing:border-box;position:absolute;z-index:10}body[dir="rtl"] .fixedDataTableColumnResizerLineLayout_main,.fixedDataTableColumnResizerLineLayout_hiddenElem{display:none!important}.fixedDataTableLayout_main{border-style:solid;border-width:1px;box-sizing:border-box;overflow:hidden;position:relative}.fixedDataTableLayout_header,.fixedDataTableLayout_hasBottomBorder{border-bottom-style:solid;border-bottom-width:1px}.fixedDataTableLayout_footer .public_fixedDataTableCell_main{border-top-style:solid;border-top-width:1px}.fixedDataTableLayout_topShadow,.fixedDataTableLayout_bottomShadow{height:4px;left:0;position:absolute;right:0;z-index:1}.fixedDataTableLayout_bottomShadow{margin-top:-4px}.fixedDataTableLayout_rowsContainer{overflow:hidden;position:relative}.fixedDataTableLayout_horizontalScrollbar{bottom:0;position:absolute}.fixedDataTableRowLayout_main{box-sizing:border-box;overflow:hidden;position:absolute;top:0}.fixedDataTableRowLayout_body{left:0;position:absolute;top:0}.fixedDataTableRowLayout_fixedColumnsDivider{backface-visibility:hidden;border-left-style:solid;border-left-width:1px;left:0;position:absolute;top:0;width:0}.fixedDataTableRowLayout_columnsShadow{width:4px}.fixedDataTableRowLayout_rowWrapper{position:absolute;top:0}.ScrollbarLayout_main{box-sizing:border-box;outline:none;overflow:hidden;position:absolute;transition-duration:250ms;transition-timing-function:ease;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ScrollbarLayout_mainVertical{bottom:0;right:0;top:0;transition-property:background-color width;width:15px}.ScrollbarLayout_mainVertical.public_Scrollbar_mainActive,.ScrollbarLayout_mainVertical:hover{width:17px}.ScrollbarLayout_mainHorizontal{bottom:0;height:15px;left:0;transition-property:background-color height}.ScrollbarLayout_mainHorizontal.public_Scrollbar_mainActive,.ScrollbarLayout_mainHorizontal:hover{height:17px}.ScrollbarLayout_face{left:0;overflow:hidden;position:absolute;z-index:1}.ScrollbarLayout_face:after{border-radius:6px;content:'';display:block;position:absolute;transition:background-color 250ms ease}.ScrollbarLayout_faceHorizontal{bottom:0;left:0;top:0}.ScrollbarLayout_faceHorizontal:after{bottom:4px;left:0;top:4px;width:100%}.ScrollbarLayout_faceVertical{left:0;right:0;top:0}.ScrollbarLayout_faceVertical:after{height:100%;left:4px;right:4px;top:0}.public_fixedDataTable_main,.public_fixedDataTable_header,.public_fixedDataTable_hasBottomBorder{border-color:#d3d3d3}.public_fixedDataTable_header .public_fixedDataTableCell_main{font-weight:700}.public_fixedDataTable_header,.public_fixedDataTable_header .public_fixedDataTableCell_main{background-color:#f6f7f8;background-image:linear-gradient(#fff,#efefef)}.public_fixedDataTable_footer .public_fixedDataTableCell_main{background-color:#f6f7f8;border-color:#d3d3d3}.public_fixedDataTable_topShadow{background:0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAECAYAAABP2FU6AAAAF0lEQVR4AWPUkNeSBhHCjJoK2twgFisAFagCCp3pJlAAAAAASUVORK5CYII=) repeat-x}.public_fixedDataTable_bottomShadow{background:0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAECAYAAABP2FU6AAAAHElEQVQI12MwNjZmZdAT1+Nm0JDWEGZQk1GTBgAWkwIeAEp52AAAAABJRU5ErkJggg==) repeat-x}.public_fixedDataTable_horizontalScrollbar .public_Scrollbar_mainHorizontal{background-color:#fff}.public_fixedDataTableCell_main{background-color:#fff;border-color:#d3d3d3}.public_fixedDataTableCell_highlighted{background-color:#f4f4f4}.public_fixedDataTableCell_cellContent{padding:8px}.public_fixedDataTableCell_columnResizerKnob{background-color:#0284ff}.public_fixedDataTableColumnResizerLine_main{border-color:#0284ff}.public_fixedDataTableRow_main{background-color:#fff}.public_fixedDataTableRow_highlighted,.public_fixedDataTableRow_highlighted .public_fixedDataTableCell_main{background-color:#f6f7f8}.public_fixedDataTableRow_fixedColumnsDivider{border-color:#d3d3d3}.public_fixedDataTableRow_columnsShadow{background:0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABCAYAAAD5PA/NAAAAFklEQVQIHWPSkNeSBmJhTQVtbiDNCgASagIIuJX8OgAAAABJRU5ErkJggg==) repeat-y}.public_Scrollbar_main.public_Scrollbar_mainActive,.public_Scrollbar_main:hover{background-color:rgba(255,255,255,.8)}.public_Scrollbar_mainOpaque,.public_Scrollbar_mainOpaque.public_Scrollbar_mainActive,.public_Scrollbar_mainOpaque:hover{background-color:#fff}.public_Scrollbar_face:after{background-color:#c2c2c2}.public_Scrollbar_main:hover .public_Scrollbar_face:after,.public_Scrollbar_mainActive .public_Scrollbar_face:after,.public_Scrollbar_faceActive:after{background-color:#7d7d7d} \ No newline at end of file diff --git a/dist/fixed-data-table.min.js b/dist/fixed-data-table.min.js index 246340c3..b384fcf9 100644 --- a/dist/fixed-data-table.min.js +++ b/dist/fixed-data-table.min.js @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.2 + * FixedDataTable v0.7.5 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -9,6 +9,7 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.FixedDataTable=t(require("react"),require("react-dom")):e.FixedDataTable=t(e.React,e.ReactDOM)}(this,function(e,t){return function(e){function t(i){if(o[i])return o[i].exports;var n=o[i]={exports:{},id:i,loaded:!1};return e[i].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){o(1),o(5),o(7),o(9),o(11),o(13),o(15),o(17),o(19),o(21),o(23),e.exports=o(25)},function(e,t){},,,,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t,o){"use strict";var i=o(26),n=o(65),r=o(63),s=o(62),a={Cell:n,Column:r,ColumnGroup:s,Table:i};a.version="0.7.0",e.exports=a},function(e,t,o){"use strict";function i(e,t){}var n=Object.assign||function(e){for(var t=1;te&&this.state.scrollX>0||e>=0&&this.state.scrollXe&&this.state.scrollY>0||e>=0&&this.state.scrollYi?i:this.state.height>i&&this.props.ownerHeight?Math.max(i,this.props.ownerHeight):this.state.height+this.state.maxScrollY,e!==this._contentHeight&&this.props.onContentHeightChange&&this.props.onContentHeightChange(e),this._contentHeight=e},componentDidMount:function(){this._reportContentHeight()},componentWillReceiveProps:function(e){var t=e.scrollToRow;void 0!==t&&null!==t&&(this._rowToScrollTo=t);var o=e.scrollToColumn;void 0!==o&&null!==o&&(this._columnToScrollTo=o);var i=e.overflowX,n=e.overflowY;(i!==this.props.overflowX||n!==this.props.overflowY)&&(this._wheelHandler=new s(this._onWheel,"hidden"!==i,"hidden"!==n)),(this.props.ownerHeight!==e.ownerHeight||this.props.scrollTop!==e.scrollTop)&&this._didScrollStart(),this._didScrollStop(),this.setState(this._calculateState(e,this.state))},componentDidUpdate:function(){this._reportContentHeight()},render:function(){var e,t=this.state,o=this.props;t.useGroupHeader&&(e=n.createElement(h,{key:"group_header",isScrolling:this._isScrolling,className:w(p("fixedDataTableLayout/header"),p("public/fixedDataTable/header")),width:t.width,height:t.groupHeaderHeight,index:0,zIndex:1,offsetTop:0,scrollLeft:t.scrollX,fixedColumns:t.groupHeaderFixedColumns,scrollableColumns:t.groupHeaderScrollableColumns,onColumnResize:this._onColumnResize}));var i=this.state.maxScrollY,r=t.maxScrollX>0&&"hidden"!==t.overflowX,s=i>0&&"hidden"!==t.overflowY,l=r?a.SIZE:0,c=t.height-l-2*x-t.footerHeight,f=t.useGroupHeader?t.groupHeaderHeight:0,d=f+t.headerHeight;c-=d;var m=0,_=null!=o.maxHeight?d+t.bodyHeight:d+c,g=_+t.footerHeight;void 0!==o.ownerHeight&&o.ownerHeightt.ownerHeight||t.scrollY or "),o.push(e))});var n=!1;o.length&&o[0].type.__TableColumnGroup__&&(n=!0),t&&(void 0!==e.width&&e.width!==t.width||void 0!==e.height&&e.height!==t.height||void 0!==e.maxWidth&&e.maxWidth!==t.maxWidth||void 0!==e.maxHeight&&e.maxHeight!==t.maxHeight)&&(t=null);var r,s,l=t&&t.firstRowIndex||0,u=t&&t.firstRowOffset||0;r=t&&"hidden"!==e.overflowX?t.scrollX:e.scrollLeft,t&&"hidden"!==e.overflowY?s=t.scrollY:(d=this._scrollHelper.scrollTo(e.scrollTop),l=d.index,u=d.offset,s=d.position),void 0!==this._rowToScrollTo&&(d=this._scrollHelper.scrollRowIntoView(this._rowToScrollTo),l=d.index,u=d.offset,s=d.position,delete this._rowToScrollTo);var h=n?e.groupHeaderHeight:0;if(t&&e.rowsCount!==t.rowsCount){var p=(void 0===e.height?e.maxHeight:e.height)-(e.headerHeight||0)-(e.footerHeight||0)-(e.groupHeaderHeight||0);this._scrollHelper=new c(e.rowsCount,e.rowHeight,p,e.rowHeightGetter);var d=this._scrollHelper.scrollToRow(l,u);l=d.index,u=d.offset,s=d.position}else t&&e.rowHeightGetter!==t.rowHeightGetter&&this._scrollHelper.setRowHeightGetter(e.rowHeightGetter);var m;m=e.isColumnResizing?t&&t.columnResizingData:y;var w,g;if(n){var v=f.adjustColumnGroupWidths(o,e.width);w=v.columns,g=v.columnGroups}else w=f.adjustColumnWidths(o,e.width);var b=this._populateColumnsAndColumnData(w,g,t);if(void 0!==this._columnToScrollTo){var R=b.bodyFixedColumns.length;if(this._columnToScrollTo>=R){var T,H,S=0;for(T=0;TT;++T)H=b.bodyScrollableColumns[T],M+=H.props.width;var E=e.width-S,z=b.bodyScrollableColumns[D].props.width,k=M+z-E;k>r&&(r=k),r>M&&(r=M)}delete this._columnToScrollTo}var O=void 0===e.height,P=Math.round(O?e.maxHeight:e.height),N=e.footerHeight+e.headerHeight+h+2*x,I=P-N,L=this._scrollHelper.getContentHeight(),G=L+N,F=f.getTotalWidth(w),W=F>e.width&&"hidden"!==e.overflowX;W&&(I-=a.SIZE,G+=a.SIZE,N+=a.SIZE);var A=Math.max(0,F-e.width),V=Math.max(0,L-I);r=Math.min(r,A),s=Math.min(s,V),V||(O&&(P=G),I=G-N),this._scrollHelper.setViewportHeight(I);var X=i({isColumnResizing:t&&t.isColumnResizing},b,e,{columns:w,columnGroups:g,columnResizingData:m,firstRowIndex:l,firstRowOffset:u,horizontalScrollbarVisible:W,maxScrollX:A,maxScrollY:V,reservedHeight:N,scrollContentHeight:L,scrollX:r,scrollY:s,bodyHeight:I,height:P,groupHeaderHeight:h,useGroupHeader:n});return X},_selectColumnElement:function(e,t){for(var o=[],i=0;iMath.abs(e)&&"hidden"!==this.props.overflowY){var i=this._scrollHelper.scrollBy(Math.round(t)),n=Math.max(0,i.contentHeight-this.state.bodyHeight);this.setState({firstRowIndex:i.index,firstRowOffset:i.offset,scrollY:i.position,scrollContentHeight:i.contentHeight,maxScrollY:n})}else e&&"hidden"!==this.props.overflowX&&(o+=e,o=0>o?0:o,o=o>this.state.maxScrollX?this.state.maxScrollX:o,this.setState({scrollX:o}));this._didScrollStop()}},_onHorizontalScroll:function(e){this.isMounted()&&e!==this.state.scrollX&&(this._isScrolling||this._didScrollStart(),this.setState({scrollX:e}),this._didScrollStop())},_onVerticalScroll:function(e){if(this.isMounted()&&e!==this.state.scrollY){this._isScrolling||this._didScrollStart();var t=this._scrollHelper.scrollTo(Math.round(e));this.setState({firstRowIndex:t.index,firstRowOffset:t.offset,scrollY:t.position,scrollContentHeight:t.contentHeight}),this._didScrollStop()}},_didScrollStart:function(){this.isMounted()&&!this._isScrolling&&(this._isScrolling=!0,this.props.onScrollStart&&this.props.onScrollStart(this.state.scrollX,this.state.scrollY))},_didScrollStop:function(){this.isMounted()&&this._isScrolling&&(this._isScrolling=!1,this.setState({redraw:!0}),this.props.onScrollEnd&&this.props.onScrollEnd(this.state.scrollX,this.state.scrollY))}}),D=n.createClass({displayName:"HorizontalScrollbar",mixins:[r],propTypes:{contentSize:b.number.isRequired,offset:b.number.isRequired,onScroll:b.func.isRequired,position:b.number.isRequired,size:b.number.isRequired},render:function(){var e={height:a.SIZE,width:this.props.size},t={height:a.SIZE,position:"absolute",overflow:"hidden",width:this.props.size};return v(t,0,this.props.offset),n.createElement("div",{className:w(p("fixedDataTableLayout/horizontalScrollbar"),p("public/fixedDataTable/horizontalScrollbar")),style:e},n.createElement("div",{style:t},n.createElement(a,i({},this.props,{isOpaque:!0,orientation:"horizontal",offset:void 0}))))}});e.exports=S},function(e,t){"use strict";function o(e,t){if(e===t)return!0;var o;for(o in e)if(e.hasOwnProperty(o)&&(!t.hasOwnProperty(o)||e[o]!==t[o]))return!1;for(o in t)if(t.hasOwnProperty(o)&&!e.hasOwnProperty(o))return!1;return!0}var i={shouldComponentUpdate:function(e,t){return!o(this.props,e)||!o(this.state,t)}};e.exports=i},function(e,t,o){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var o=0;oi?-1:1),n&&!o&&(o=1>n?-1:1),{spinX:t,spinY:o,pixelX:i,pixelY:n}}var n=o(34),r=o(35),s=10,a=40,l=800;i.getEventType=function(){return n.firefox()?"DOMMouseScroll":r("wheel")?"wheel":"mousewheel"},e.exports=i},function(e,t){"use strict";function o(){if(!g){g=!0;var e=navigator.userAgent,t=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),o=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(d=/\b(iPhone|iP[ao]d)/.exec(e),m=/\b(iP[ao]d)/.exec(e),f=/Android/i.exec(e),_=/FBAN\/\w+;/i.exec(e),w=/Mobile/i.exec(e),p=!!/Win64/.exec(e),t){i=t[1]?parseFloat(t[1]):t[5]?parseFloat(t[5]):NaN,i&&document&&document.documentMode&&(i=document.documentMode);var v=/(?:Trident\/(\d+.\d+))/.exec(e);l=v?parseFloat(v[1])+4:i,n=t[2]?parseFloat(t[2]):NaN,r=t[3]?parseFloat(t[3]):NaN,s=t[4]?parseFloat(t[4]):NaN,s?(t=/(?:Chrome\/(\d+\.\d+))/.exec(e),a=t&&t[1]?parseFloat(t[1]):NaN):a=NaN}else i=n=r=a=s=NaN;if(o){if(o[1]){var b=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);u=b?parseFloat(b[1].replace("_",".")):!0}else u=!1;h=!!o[2],c=!!o[3]}else u=h=c=!1}}var i,n,r,s,a,l,u,h,c,f,p,d,m,_,w,g=!1,v={ie:function(){return o()||i},ieCompatibilityMode:function(){return o()||l>i},ie64:function(){return v.ie()&&p},firefox:function(){return o()||n},opera:function(){return o()||r},webkit:function(){return o()||s},safari:function(){return v.webkit()},chrome:function(){return o()||a},windows:function(){return o()||h},osx:function(){return o()||u},linux:function(){return o()||c},iphone:function(){return o()||d},mobile:function(){return o()||d||m||f||w},nativeApp:function(){return o()||_},android:function(){return o()||f},ipad:function(){return o()||m}};e.exports=v},function(e,t,o){"use strict";function i(e,t){if(!r.canUseDOM||t&&!("addEventListener"in document))return!1;var o="on"+e,i=o in document;if(!i){var s=document.createElement("div");s.setAttribute(o,"return;"),i="function"==typeof s[o]}return!i&&n&&"wheel"===e&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}var n,r=o(36);r.canUseDOM&&(n=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),e.exports=i},function(e,t){"use strict";var o=!("undefined"==typeof window||!window.document||!window.document.createElement),i={canUseDOM:o,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:o&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:o&&!!window.screen,isInWorker:!o};e.exports=i},function(e,t,o){(function(t){"use strict";var i=o(32),n=o(38),r=0,s=n||function(e){var o=Date.now(),i=Math.max(0,16-(o-r));return r=o+i,t.setTimeout(function(){e(Date.now())},i)};s(i),e.exports=s}).call(t,function(){return this}())},function(e,t){(function(t){"use strict";var o=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame;e.exports=o}).call(t,function(){return this}())},function(e,t,o){"use strict";var i=o(40),n=o(43),r=o(27),s=o(44),a=o(30),l=o(31),u=o(46),h=o(47),c=o(32),f=o(48),p=r.PropTypes,d={position:0,scrollable:!1},m=parseInt(u("scrollbar-face-margin"),10),_=2*m,w=30,g=40,v=null,b=r.createClass({displayName:"Scrollbar",mixins:[a],propTypes:{contentSize:p.number.isRequired,defaultPosition:p.number,isOpaque:p.bool,orientation:p.oneOf(["vertical","horizontal"]),onScroll:p.func,position:p.number,size:p.number.isRequired,trackColor:p.oneOf(["gray"]),zIndex:p.number,verticalTop:p.number},getInitialState:function(){var e=this.props;return this._calculateState(e.position||e.defaultPosition||0,e.size,e.contentSize,e.orientation)},componentWillReceiveProps:function(e){var t=e.position;void 0===t?this._setNextState(this._calculateState(this.state.position,e.size,e.contentSize,e.orientation)):this._setNextState(this._calculateState(t,e.size,e.contentSize,e.orientation),e)},getDefaultProps:function(){return{defaultPosition:0,isOpaque:!1,onScroll:c,orientation:"vertical",zIndex:99}},render:function(){if(!this.state.scrollable)return null;var e,t,o=this.props.size,i=this.state.isHorizontal,n=!i,s=this.state.focused||this.state.isDragging,a=this.state.faceSize,l=this.props.isOpaque,c=this.props.verticalTop||0,p=h({"ScrollbarLayout/main":!0,"ScrollbarLayout/mainVertical":n,"ScrollbarLayout/mainHorizontal":i,"public/Scrollbar/main":!0,"public/Scrollbar/mainOpaque":l,"public/Scrollbar/mainActive":s}),d=h({"ScrollbarLayout/face":!0,"ScrollbarLayout/faceHorizontal":i,"ScrollbarLayout/faceVertical":n,"public/Scrollbar/faceActive":s,"public/Scrollbar/face":!0}),w=this.state.position*this.state.scale+m;return i?(e={width:o},t={width:a-_},f(t,w,0)):(e={top:c,height:o},t={height:a-_},f(t,0,w)),e.zIndex=this.props.zIndex,"gray"===this.props.trackColor&&(e.backgroundColor=u("fbui-desktop-background-light")),r.createElement("div",{onFocus:this._onFocus,onBlur:this._onBlur,onKeyDown:this._onKeyDown,onMouseDown:this._onMouseDown,onWheel:this._wheelHandler.onWheel,className:p,style:e,tabIndex:0},r.createElement("div",{ref:"face",className:d,style:t}))},componentWillMount:function(){var e="horizontal"===this.props.orientation,t=e?this._onWheelX:this._onWheelY;this._wheelHandler=new l(t,this._shouldHandleX,this._shouldHandleY)},componentDidMount:function(){this._mouseMoveTracker=new i(this._onMouseMove,this._onMouseMoveEnd,document.documentElement),void 0!==this.props.position&&this.state.position!==this.props.position&&this._didScroll()},componentWillUnmount:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),v===this&&(v=null),delete this._mouseMoveTracker},scrollBy:function(e){this._onWheel(e)},_shouldHandleX:function(e){return"horizontal"===this.props.orientation?this._shouldHandleChange(e):!1},_shouldHandleY:function(e){return"horizontal"!==this.props.orientation?this._shouldHandleChange(e):!1},_shouldHandleChange:function(e){var t=this._calculateState(this.state.position+e,this.props.size,this.props.contentSize,this.props.orientation);return t.position!==this.state.position},_calculateState:function(e,t,o,i){if(1>t||t>=o)return d;var n=e+"_"+t+"_"+o+"_"+i;if(this._stateKey===n)return this._stateForKey;var r="horizontal"===i,s=t/o,a=t*s;w>a&&(s=(t-w)/(o-t),a=w);var l=!0,u=o-t;0>e?e=0:e>u&&(e=u);var h=this._mouseMoveTracker?this._mouseMoveTracker.isDragging():!1,c={faceSize:a,isDragging:h,isHorizontal:r,position:e,scale:s,scrollable:l};return this._stateKey=n,this._stateForKey=c,c},_onWheelY:function(e,t){this._onWheel(t)},_onWheelX:function(e,t){this._onWheel(e)},_onWheel:function(e){var t=this.props;this._setNextState(this._calculateState(this.state.position+e,t.size,t.contentSize,t.orientation))},_onMouseDown:function(e){var t;if(e.target!==s.findDOMNode(this.refs.face)){var o=e.nativeEvent,i=this.state.isHorizontal?o.offsetX||o.layerX:o.offsetY||o.layerY,n=this.props;i/=this.state.scale,t=this._calculateState(i-.5*this.state.faceSize/this.state.scale,n.size,n.contentSize,n.orientation)}else t={};t.focused=!0,this._setNextState(t),this._mouseMoveTracker.captureMouseMoves(e),s.findDOMNode(this).focus()},_onMouseMove:function(e,t){var o=this.props,i=this.state.isHorizontal?e:t;i/=this.state.scale,this._setNextState(this._calculateState(this.state.position+i,o.size,o.contentSize,o.orientation))},_onMouseMoveEnd:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),this.setState({isDragging:!1})},_onKeyDown:function(e){var t=e.keyCode;if(t!==n.TAB){var o=g,i=0;if(this.state.isHorizontal)switch(t){case n.HOME:i=-1,o=this.props.contentSize;break;case n.LEFT:i=-1;break;case n.RIGHT:i=1;break;default:return}if(!this.state.isHorizontal)switch(t){case n.SPACE:i=e.shiftKey?-1:1;break;case n.HOME:i=-1,o=this.props.contentSize;break;case n.UP:i=-1;break;case n.DOWN:i=1;break;case n.PAGE_UP:i=-1,o=this.props.size;break;case n.PAGE_DOWN:i=1,o=this.props.size;break;default:return}e.preventDefault();var r=this.props;this._setNextState(this._calculateState(this.state.position+o*i,r.size,r.contentSize,r.orientation))}},_onFocus:function(){this.setState({focused:!0})},_onBlur:function(){this.setState({focused:!1})},_blur:function(){if(this.isMounted())try{this._onBlur(),s.findDOMNode(this).blur()}catch(e){}},_setNextState:function(e,t){t=t||this.props;var o=t.position,i=this.state.position!==e.position;if(void 0===o){var n=i?this._didScroll:void 0;this.setState(e,n)}else{if(o!==e.position)return void(void 0!==e.position&&e.position!==this.state.position&&this.props.onScroll(e.position));this.setState(e)}i&&v!==this&&(v&&v._blur(),v=this)},_didScroll:function(){this.props.onScroll(this.state.position)}});b.KEYBOARD_SCROLL_AMOUNT=g,b.SIZE=parseInt(u("scrollbar-size"),10),e.exports=b},function(e,t,o){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var o=0;o0;)this._addRowToBuffer(t,this._viewportRowsBegin,this._viewportRowsEnd-1),t++,e--;return this._rows}},{key:"getRows",value:function(e,t){var o=t,i=o,n=e,r=Math.min(e+this._maxVisibleRowCount,this._rowsCount);for(this._viewportRowsBegin=e;r>n||i=r&&(i=this._bufferSet.replaceFurthestValuePosition(t,o,e)),null===i?(i=this._bufferSet.getNewPositionForValue(e),this._rows[i]=e):this._rows[i]=e}}]),e}();e.exports=h},function(e,t,o){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var o=0;o=e&&t>=n)return null;var r;e-i>n-t?(r=i,this._smallValues.pop()):(r=n,this._largeValues.pop());var a=this._valueToPositionMap[r];return delete this._valueToPositionMap[r],this._valueToPositionMap[o]=a,this._pushToHeaps(a,o),a}},{key:"_pushToHeaps",value:function(e,t){var o={position:e,value:t};this._smallValues.push(o),this._largeValues.push(o)}},{key:"_cleanHeaps",value:function(){this._cleanHeap(this._smallValues),this._cleanHeap(this._largeValues);var e=Math.min(this._smallValues.size(),this._largeValues.size()),t=Math.max(this._smallValues.size(),this._largeValues.size());t>10*e&&this._recreateHeaps()}},{key:"_recreateHeaps",value:function(){for(var e=this._smallValues.size()t.value}}]),e}();e.exports=a},function(e,t){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){return t>e}var n=function(){function e(e,t){for(var o=0;o0&&(this._items[0]=t,this._sinkDown(0)),e}}},{key:"push",value:function(e){this._items[this._size++]=e,this._bubbleUp(this._size-1)}},{key:"size",value:function(){return this._size}},{key:"peek",value:function(){return 0!==this._size?this._items[0]:void 0}},{key:"_heapify",value:function(){for(var e=Math.floor((this._size+1)/2);e>=0;e--)this._sinkDown(e)}},{key:"_bubbleUp",value:function(e){for(var t=this._items[e];e>0;){var o=Math.floor((e+1)/2)-1,i=this._items[o];if(this._comparator(i,t))return;this._items[o]=t,this._items[e]=i,e=o}}},{key:"_sinkDown",value:function(e){for(var t=this._items[e];;){var o=2*(e+1)-1,i=2*(e+1),n=-1;if(oe?t:e>o?o:e}e.exports=o},function(e,t,o){"use strict";var i=Object.assign||function(e){for(var t=1;t0){var t=s({"fixedDataTableRowLayout/fixedColumnsDivider":!0,"fixedDataTableRowLayout/columnsShadow":this.props.scrollLeft>0,"public/fixedDataTableRow/fixedColumnsDivider":!0,"public/fixedDataTableRow/columnsShadow":this.props.scrollLeft>0}),o={left:e,height:this.props.height};return n.createElement("div",{className:t,style:o})}},_onClick:function(e){this.props.onClick(e,this.props.index)},_onDoubleClick:function(e){this.props.onDoubleClick(e,this.props.index)},_onMouseDown:function(e){this.props.onMouseDown(e,this.props.index)},_onMouseEnter:function(e){this.props.onMouseEnter(e,this.props.index)},_onMouseLeave:function(e){this.props.onMouseLeave(e,this.props.index)}}),c=n.createClass({displayName:"FixedDataTableRow",propTypes:{isScrolling:u.bool,height:u.number.isRequired,zIndex:u.number,offsetTop:u.number.isRequired,width:u.number.isRequired},render:function(){var e={width:this.props.width,height:this.props.height,zIndex:this.props.zIndex?this.props.zIndex:0};return l(e,0,this.props.offsetTop),n.createElement("div",{style:e,className:s("fixedDataTableRowLayout/rowWrapper")},n.createElement(h,i({},this.props,{offsetTop:void 0,zIndex:void 0})))}});e.exports=c},function(e,t,o){"use strict";function i(e,t){var o={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(o[i]=e[i]);return o}var n=Object.assign||function(e){for(var t=1;tn;n++){var a=t[n].props;if(!a.allowCellsRecycling||i-e.left<=e.width&&i-e.left+a.width>=0){var h="cell_"+n;o[n]=this._renderCell(e.rowIndex,e.rowHeight,a,i,h)}i+=a.width}var f=this._getColumnsWidth(t),p={height:e.height,position:"absolute",width:f,zIndex:e.zIndex};return u(p,-1*c*e.left,0),s.createElement("div",{className:l("fixedDataTableCellGroupLayout/cellGroup"),style:p},o)},_renderCell:function(e,t,o,i,n){var r=o.isResizable&&this.props.onColumnResize,l=r?this.props.onColumnResize:null,u=o.cellClassName;return s.createElement(a,{isScrolling:this.props.isScrolling,align:o.align,className:u,height:t,key:n,maxWidth:o.maxWidth,minWidth:o.minWidth,onColumnResize:l,rowIndex:e,columnKey:o.columnKey,width:o.width,left:i,cell:o.cell})},_getColumnsWidth:function(e){for(var t=0,o=0;o=0||Object.prototype.hasOwnProperty.call(e,i)&&(o[i]=e[i]);return o}var n=o(65),r=o(60),s=o(27),a=o(47),l=o(66),u=r.DIR_SIGN,h=s.PropTypes,c={align:"left",highlighted:!1},f=s.createClass({displayName:"FixedDataTableCell",propTypes_DISABLED_FOR_PERFORMANCE:{isScrolling:h.bool,align:h.oneOf(["left","center","right"]),className:h.string,highlighted:h.bool,width:h.number.isRequired,minWidth:h.number,maxWidth:h.number,height:h.number.isRequired,cell:h.oneOfType([h.string,h.element,h.func]),columnKey:h.oneOfType([h.string,h.number]),rowIndex:h.number.isRequired,onColumnResize:h.func,left:h.number},shouldComponentUpdate:function(e){return!e.isScrolling||this.props.rowIndex!==e.rowIndex},getDefaultProps:function(){return c},render:function(){var e=this.props,t=e.height,o=e.width,r=e.columnKey,h=i(e,["height","width","columnKey"]),c={height:t,width:o};1===u?c.left=h.left:c.right=h.left;var f,p=l(a({"fixedDataTableCellLayout/main":!0,"fixedDataTableCellLayout/lastChild":h.lastChild,"fixedDataTableCellLayout/alignRight":"right"===h.align,"fixedDataTableCellLayout/alignCenter":"center"===h.align,"public/fixedDataTableCell/alignRight":"right"===h.align,"public/fixedDataTableCell/highlighted":h.highlighted,"public/fixedDataTableCell/main":!0}),h.className);if(h.onColumnResize){var d={height:t};f=s.createElement("div",{className:a("fixedDataTableCellLayout/columnResizerContainer"),style:d,onMouseDown:this._onColumnResizerMouseDown},s.createElement("div",{className:l(a("fixedDataTableCellLayout/columnResizerKnob"),a("public/fixedDataTableCell/columnResizerKnob")),style:d}))}var m={columnKey:r,height:t,width:o};h.rowIndex>=0&&(m.rowIndex=h.rowIndex);var _;return _=s.isValidElement(h.cell)?s.cloneElement(h.cell,m):"function"==typeof h.cell?h.cell(m):s.createElement(n,m,h.cell),s.createElement("div",{className:p,style:c},f,_)},_onColumnResizerMouseDown:function(e){this.props.onColumnResize(this.props.left,this.props.width,this.props.minWidth,this.props.maxWidth,this.props.columnKey,e)}});e.exports=f},function(e,t,o){"use strict";function i(e,t){var o={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(o[i]=e[i]);return o}var n=Object.assign||function(e){for(var t=1;t1)for(var i=1;o>i;i++)t=arguments[i],t&&(e=(e?e+" ":"")+t);return e}e.exports=o},function(e,t,o){"use strict";var i=o(40),n=o(61),r=o(27),s=o(30),a=o(57),l=o(47),u=r.PropTypes,h=r.createClass({displayName:"FixedDataTableColumnResizeHandle",mixins:[s],propTypes:{visible:u.bool.isRequired,height:u.number.isRequired,leftOffset:u.number.isRequired,knobHeight:u.number.isRequired,initialWidth:u.number,minWidth:u.number,maxWidth:u.number,initialEvent:u.object,onColumnResizeEnd:u.func,columnKey:u.oneOfType([u.string,u.number])},getInitialState:function(){return{width:0,cursorDelta:0}},componentWillReceiveProps:function(e){e.initialEvent&&!this._mouseMoveTracker.isDragging()&&(this._mouseMoveTracker.captureMouseMoves(e.initialEvent),this.setState({width:e.initialWidth,cursorDelta:e.initialWidth}))},componentDidMount:function(){this._mouseMoveTracker=new i(this._onMove,this._onColumnResizeEnd,document.body)},componentWillUnmount:function(){this._mouseMoveTracker.releaseMouseMoves(),this._mouseMoveTracker=null},render:function(){var e={width:this.state.width,height:this.props.height};return n.isRTL()?e.right=this.props.leftOffset:e.left=this.props.leftOffset,r.createElement("div",{className:l({"fixedDataTableColumnResizerLineLayout/main":!0,"fixedDataTableColumnResizerLineLayout/hiddenElem":!this.props.visible,"public/fixedDataTableColumnResizerLine/main":!0}),style:e},r.createElement("div",{className:l("fixedDataTableColumnResizerLineLayout/mouseArea"),style:{height:this.props.height}}))},_onMove:function(e){n.isRTL()&&(e=-e);var t=this.state.cursorDelta+e,o=a(t,this.props.minWidth,this.props.maxWidth);this.setState({width:o,cursorDelta:t})},_onColumnResizeEnd:function(){this._mouseMoveTracker.releaseMouseMoves(),this.props.onColumnResizeEnd(this.state.width,this.props.columnKey)}});e.exports=h},function(e,t,o){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var o=0;oa;++a)this._storedHeights[a]=o;this._rowCount=t,this._position=0,this._contentHeight=t*o,this._defaultRowHeight=o,this._rowHeightGetter=s?s:function(){return o},this._viewportHeight=n,this.scrollRowIntoView=this.scrollRowIntoView.bind(this),this.setViewportHeight=this.setViewportHeight.bind(this),this.scrollBy=this.scrollBy.bind(this),this.scrollTo=this.scrollTo.bind(this),this.scrollToRow=this.scrollToRow.bind(this),this.setRowHeightGetter=this.setRowHeightGetter.bind(this),this.getContentHeight=this.getContentHeight.bind(this),this.getRowPosition=this.getRowPosition.bind(this),this._updateHeightsInViewport(0,0)}return n(e,[{key:"setRowHeightGetter",value:function(e){this._rowHeightGetter=e}},{key:"setViewportHeight",value:function(e){this._viewportHeight=e}},{key:"getContentHeight",value:function(){return this._contentHeight}},{key:"_updateHeightsInViewport",value:function(e,t){for(var o=t,i=e;o<=this._viewportHeight&&i=0&&t>=e-a;){var o=this._updateRowHeight(t);this._position+=o,t--}}},{key:"_updateRowHeight",value:function(e){if(0>e||e>=this._rowCount)return 0;var t=this._rowHeightGetter(e);if(t!==this._storedHeights[e]){var o=t-this._storedHeights[e];return this._rowOffsets.set(e,t),this._storedHeights[e]=t,this._contentHeight+=o,o}return 0}},{key:"getRowPosition",value:function(e){return this._updateRowHeight(e),this._rowOffsets.sumUntil(e)}},{key:"scrollBy",value:function(e){if(0===this._rowCount)return l;var t=this._rowOffsets.greatestLowerBound(this._position);t=s(t,0,Math.max(this._rowCount-1,0));var o=this._rowOffsets.sumUntil(t),i=t,n=this._position,r=this._updateRowHeight(i);0!==o&&(n+=r);var a=this._storedHeights[i]-(n-o);if(e>=0)for(;e>0&&ie?(n+=e,e=0):(e-=a,n+=a,i++),ie){e=-e;for(var u=this._storedHeights[i]-a;e>0&&i>=0;)if(u>e?(n-=e,e=0):(n-=u,e-=u,i--),i>=0){var h=this._updateRowHeight(i);u=this._storedHeights[i],n+=h}}var c=this._contentHeight-this._viewportHeight;n=s(n,0,c),this._position=n;var f=this._rowOffsets.greatestLowerBound(n);f=s(f,0,Math.max(this._rowCount-1,0)),o=this._rowOffsets.sumUntil(f);var p=o-n;return this._updateHeightsInViewport(f,p),this._updateHeightsAboveViewport(f),{index:f,offset:p,position:this._position,contentHeight:this._contentHeight}}},{key:"_getRowAtEndPosition",value:function(e){this._updateRowHeight(e);for(var t=e,o=this._storedHeights[t];o=0;)t--,t>=0&&(this._updateRowHeight(t),o+=this._storedHeights[t]);var i=this._rowOffsets.sumTo(e)-this._viewportHeight;return 0>i&&(i=0),i}},{key:"scrollTo",value:function(e){if(0===this._rowCount)return l;if(0>=e)return this._position=0,this._updateHeightsInViewport(0,0),{index:0,offset:0,position:this._position,contentHeight:this._contentHeight};if(e>=this._contentHeight-this._viewportHeight){var t=this._rowCount-1;e=this._getRowAtEndPosition(t)}this._position=e;var o=this._rowOffsets.greatestLowerBound(e);o=s(o,0,Math.max(this._rowCount-1,0));var i=this._rowOffsets.sumUntil(o),n=i-e;return this._updateHeightsInViewport(o,n),this._updateHeightsAboveViewport(o),{index:o,offset:n,position:this._position,contentHeight:this._contentHeight}}},{key:"scrollToRow",value:function(e,t){e=s(e,0,Math.max(this._rowCount-1,0)),t=s(t,-this._storedHeights[e],0);var o=this._rowOffsets.sumUntil(e);return this.scrollTo(o-t)}},{key:"scrollRowIntoView",value:function(e){e=s(e,0,Math.max(this._rowCount-1,0));var t=this._rowOffsets.sumUntil(e),o=t+this._storedHeights[e];if(tt;)t*=2;return t}var r=function(){function e(e,t){for(var o=0;o=0;--o)t[o]=0;return t},u=function(){function e(t){i(this,e),this._size=t.length,this._half=n(this._size),this._heap=new l(2*this._half);var o;for(o=0;o0;--o)this._heap[o]=this._heap[2*o]+this._heap[2*o+1]}return r(e,[{key:"set",value:function(e,t){s(e>=0&&e=0&&e=0&&e=0&&e=e,"Begin must precede end"),this.sumUntil(t)-this.sumUntil(e)}},{key:"greatestLowerBound",value:function(e){if(0>e)return-1;var t=1;if(this._heap[t]<=e)return this._size;for(;te?t=2*t:(t=2*t+1,e-=o)}return t-this._half}},{key:"greatestStrictLowerBound",value:function(e){if(0>=e)return-1;var t=1;if(this._heap[t]=e?t=2*t:(t=2*t+1,e-=o)}return t-this._half}},{key:"leastUpperBound",value:function(e){return this.greatestStrictLowerBound(e)+1}},{key:"leastStrictUpperBound",value:function(e){return this.greatestLowerBound(e)+1}}],[{key:"uniform",value:function(t,o){for(var i=[],n=t-1;n>=0;--n)i[n]=o;return new e(i)}},{key:"empty",value:function(t){return e.uniform(t,0)}}]),e}();e.exports=u}).call(t,function(){return this}())},function(e,t,o){"use strict";function i(e){for(var t=0,o=0;o=t)return{columns:e,width:i(e)};for(var o=n(e),r=t,s=[],a=0,u=0;uo?r(e,t-o).columns:e}var l=o(27),u={getTotalWidth:i,getTotalFlexGrow:n,distributeFlexWidth:r,adjustColumnWidths:a,adjustColumnGroupWidths:s};e.exports=u},function(e,t){"use strict";function o(e,t,o,i,n){function r(){for(var n=arguments.length,a=Array(n),l=0;n>l;l++)a[l]=arguments[l];r.reset();var u=function(){e.apply(o,a)};u.__SMmeta=e.__SMmeta,s=i(u,t)}i=i||setTimeout,n=n||clearTimeout;var s;return r.reset=function(){n(s)},r}e.exports=o},function(e,t){"use strict";function o(e,t){if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var o=Object.keys(e),n=Object.keys(t);if(o.length!==n.length)return!1;for(var r=i.bind(t),s=0;s1)for(var o=1;o0||e>=0&&this.state.scrollX0||e>=0&&this.state.scrollYn?n:this.state.height>n&&this.props.ownerHeight?Math.max(n,this.props.ownerHeight):this.state.height+this.state.maxScrollY,e!==this._contentHeight&&this.props.onContentHeightChange&&this.props.onContentHeightChange(e),this._contentHeight=e},componentDidMount:function(){this._reportContentHeight(),this._isMounted=!0},componentWillReceiveProps:function(e){var t=e.scrollToRow;void 0!==t&&null!==t&&(this._rowToScrollTo=t);var o=e.scrollToColumn;void 0!==o&&null!==o&&(this._columnToScrollTo=o);var n=e.overflowX,r=e.overflowY;n===this.props.overflowX&&r===this.props.overflowY||(this._wheelHandler=new l(this._onWheel,"hidden"!==n,"hidden"!==r)),this.props.ownerHeight===e.ownerHeight&&this.props.scrollTop===e.scrollTop||this._didScrollStart(),this._didScrollStop(),this.setState(this._calculateState(e,this.state))},componentDidUpdate:function(){this._reportContentHeight()},render:function(){var e,t=this.state,o=this.props;t.useGroupHeader&&(e=i.createElement(f,{key:"group_header",isScrolling:this._isScrolling,className:y(m("fixedDataTableLayout/header"),m("public/fixedDataTable/header")),width:t.width,height:t.groupHeaderHeight,index:0,zIndex:1,offsetTop:0,scrollLeft:t.scrollX,fixedColumns:t.groupHeaderFixedColumns,scrollableColumns:t.groupHeaderScrollableColumns,onColumnResize:this._onColumnResize}));var r=this.state.maxScrollY,s=t.maxScrollX>0&&"hidden"!==t.overflowX,a=r>0&&"hidden"!==t.overflowY,l=s?u.SIZE:0,c=t.height-l-2*R-t.footerHeight,p=t.useGroupHeader?t.groupHeaderHeight:0,d=p+t.headerHeight;c-=d;var v=0,_=null!=o.maxHeight?d+t.bodyHeight:d+c,g=_+t.footerHeight;void 0!==o.ownerHeight&&o.ownerHeightt.ownerHeight||t.scrollY or "),o.push(e))});var r=!1;o.length&&o[0].type.__TableColumnGroup__&&(r=!0),t&&(void 0!==e.width&&e.width!==t.width||void 0!==e.height&&e.height!==t.height||void 0!==e.maxWidth&&e.maxWidth!==t.maxWidth||void 0!==e.maxHeight&&e.maxHeight!==t.maxHeight)&&(t=null);var i,s,a=t&&t.firstRowIndex||0,l=t&&t.firstRowOffset||0;i=t&&"hidden"!==e.overflowX?t.scrollX:e.scrollLeft,t&&"hidden"!==e.overflowY?s=t.scrollY:(f=this._scrollHelper.scrollTo(e.scrollTop),a=f.index,l=f.offset,s=f.position),void 0!==this._rowToScrollTo&&(f=this._scrollHelper.scrollRowIntoView(this._rowToScrollTo),a=f.index,l=f.offset,s=f.position,delete this._rowToScrollTo);var c=r?e.groupHeaderHeight:0;if(t&&e.rowsCount!==t.rowsCount){var h=(void 0===e.height?e.maxHeight:e.height)-(e.headerHeight||0)-(e.footerHeight||0)-(e.groupHeaderHeight||0);this._scrollHelper=new p(e.rowsCount,e.rowHeight,h,e.rowHeightGetter);var f=this._scrollHelper.scrollToRow(a,l);a=f.index,l=f.offset,s=f.position}else t&&e.rowHeightGetter!==t.rowHeightGetter&&this._scrollHelper.setRowHeightGetter(e.rowHeightGetter);var m;m=e.isColumnResizing?t&&t.columnResizingData:C;var v,_;if(r){var y=d.adjustColumnGroupWidths(o,e.width);v=y.columns,_=y.columnGroups}else v=d.adjustColumnWidths(o,e.width);var w=this._populateColumnsAndColumnData(v,_,t);if(void 0!==this._columnToScrollTo){var b=w.bodyFixedColumns.length;if(this._columnToScrollTo>=b){var E,D,T=0;for(E=0;EO&&(i=O)}delete this._columnToScrollTo}var k=void 0===e.height,P=Math.round(k?e.maxHeight:e.height),I=e.footerHeight+e.headerHeight+c+2*R,z=P-I,j=this._scrollHelper.getContentHeight(),A=j+I,F=d.getTotalWidth(v),L=F>e.width&&"hidden"!==e.overflowX;L&&(z-=u.SIZE,A+=u.SIZE,I+=u.SIZE);var G=Math.max(0,F-e.width),W=Math.max(0,j-z);i=Math.min(i,G),s=Math.min(s,W),W||(k&&(P=A),z=A-I),this._scrollHelper.setViewportHeight(z);var V=n({isColumnResizing:t&&t.isColumnResizing},w,e,{columns:v,columnGroups:_,columnResizingData:m,firstRowIndex:a,firstRowOffset:l,horizontalScrollbarVisible:L,maxScrollX:G,maxScrollY:W,reservedHeight:I,scrollContentHeight:j,scrollX:i,scrollY:s,bodyHeight:z,height:P,groupHeaderHeight:c,useGroupHeader:r});return V},_selectColumnElement:function(e,t){for(var o=[],n=0;nMath.abs(e)&&"hidden"!==this.props.overflowY){var n=this._scrollHelper.scrollBy(Math.round(t)),r=Math.max(0,n.contentHeight-this.state.bodyHeight);this.setState({firstRowIndex:n.index,firstRowOffset:n.offset,scrollY:n.position,scrollContentHeight:n.contentHeight,maxScrollY:r})}else e&&"hidden"!==this.props.overflowX&&(o+=e,o=o<0?0:o,o=o>this.state.maxScrollX?this.state.maxScrollX:o,this.setState({scrollX:o}));this._didScrollStop()}},_onHorizontalScroll:function(e){this._isMounted&&e!==this.state.scrollX&&(this._isScrolling||this._didScrollStart(),this.setState({scrollX:e}),this._didScrollStop())},_onVerticalScroll:function(e){if(this._isMounted&&e!==this.state.scrollY){this._isScrolling||this._didScrollStart();var t=this._scrollHelper.scrollTo(Math.round(e));this.setState({firstRowIndex:t.index,firstRowOffset:t.offset,scrollY:t.position,scrollContentHeight:t.contentHeight}),this._didScrollStop()}},_didScrollStart:function(){this._isMounted&&!this._isScrolling&&(this._isScrolling=!0,this.props.onScrollStart&&this.props.onScrollStart(this.state.scrollX,this.state.scrollY))},_didScrollStop:function(){this._isMounted&&this._isScrolling&&(this._isScrolling=!1,this.setState({redraw:!0}),this.props.onScrollEnd&&this.props.onScrollEnd(this.state.scrollX,this.state.scrollY))}}),O=s({displayName:"HorizontalScrollbar",mixins:[a],propTypes:{contentSize:r.number.isRequired,offset:r.number.isRequired,onScroll:r.func.isRequired,position:r.number.isRequired,size:r.number.isRequired},render:function(){var e={height:u.SIZE,width:this.props.size},t={height:u.SIZE,position:"absolute",overflow:"hidden",width:this.props.size};return b(t,0,this.props.offset),i.createElement("div",{className:y(m("fixedDataTableLayout/horizontalScrollbar"),m("public/fixedDataTable/horizontalScrollbar")),style:e},i.createElement("div",{style:t},i.createElement(u,n({},this.props,{isOpaque:!0,orientation:"horizontal",offset:void 0}))))}});e.exports=S},function(e,t,o){"use strict";var n=o(35),r=o(38);if("undefined"==typeof n)throw Error("create-react-class could not find the React object. If you are using script tags, make sure that React is being loaded before create-react-class.");var i=(new n.Component).updater;e.exports=r(n.Component,n.isValidElement,i)},function(e,t,o){(function(t){"use strict";function n(e){return e}function r(e,o,r){function h(e,o,n){for(var r in o)o.hasOwnProperty(r)&&"production"!==t.env.NODE_ENV&&l("function"==typeof o[r],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",e.displayName||"ReactClass",u[n],r)}function f(e,t){var o=x.hasOwnProperty(t)?x[t]:null;T.hasOwnProperty(t)&&a("OVERRIDE_BASE"===o,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&a("DEFINE_MANY"===o||"DEFINE_MANY_MERGED"===o,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t); +}function p(e,n){if(n){a("function"!=typeof n,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),a(!o(n),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=e.prototype,i=r.__reactAutoBindPairs;n.hasOwnProperty(c)&&R.mixins(e,n.mixins);for(var s in n)if(n.hasOwnProperty(s)&&s!==c){var u=n[s],h=r.hasOwnProperty(s);if(f(h,s),R.hasOwnProperty(s))R[s](e,u);else{var p=x.hasOwnProperty(s),d="function"==typeof u,m=d&&!p&&!h&&n.autobind!==!1;if(m)i.push(s,u),r[s]=u;else if(h){var g=x[s];a(p&&("DEFINE_MANY_MERGED"===g||"DEFINE_MANY"===g),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",g,s),"DEFINE_MANY_MERGED"===g?r[s]=v(r[s],u):"DEFINE_MANY"===g&&(r[s]=_(r[s],u))}else r[s]=u,"production"!==t.env.NODE_ENV&&"function"==typeof u&&n.displayName&&(r[s].displayName=n.displayName+"_"+s)}}}else if("production"!==t.env.NODE_ENV){var y=typeof n,w="object"===y&&null!==n;"production"!==t.env.NODE_ENV&&l(w,"%s: You're attempting to include a mixin that is either null or not an object. Check the mixins included by the component, as well as any mixins they include themselves. Expected object but got %s.",e.displayName||"ReactClass",null===n?null:y)}}function d(e,t){if(t)for(var o in t){var n=t[o];if(t.hasOwnProperty(o)){var r=o in R;a(!r,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',o);var i=o in e;if(i){var s=C.hasOwnProperty(o)?C[o]:null;return a("DEFINE_MANY_MERGED"===s,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",o),void(e[o]=v(e[o],n))}e[o]=n}}}function m(e,t){a(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var o in t)t.hasOwnProperty(o)&&(a(void 0===e[o],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",o),e[o]=t[o]);return e}function v(e,t){return function(){var o=e.apply(this,arguments),n=t.apply(this,arguments);if(null==o)return n;if(null==n)return o;var r={};return m(r,o),m(r,n),r}}function _(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function g(e,o){var n=o.bind(e);if("production"!==t.env.NODE_ENV){n.__reactBoundContext=e,n.__reactBoundMethod=o,n.__reactBoundArguments=null;var r=e.constructor.displayName,i=n.bind;n.bind=function(s){for(var a=arguments.length,u=Array(a>1?a-1:0),c=1;c1?t-1:0),n=1;n2?o-2:0),r=2;rn},ie64:function(){return y.ie()&&p},firefox:function(){return o()||r},opera:function(){return o()||i},webkit:function(){return o()||s},safari:function(){return y.webkit()},chrome:function(){return o()||a},windows:function(){return o()||c},osx:function(){return o()||u},linux:function(){return o()||h},iphone:function(){return o()||d},mobile:function(){return o()||d||m||f||_},nativeApp:function(){return o()||v},android:function(){return o()||f},ipad:function(){return o()||m}};e.exports=y},function(e,t,o){"use strict";function n(e,t){if(!i.canUseDOM||t&&!("addEventListener"in document))return!1;var o="on"+e,n=o in document;if(!n){var s=document.createElement("div");s.setAttribute(o,"return;"),n="function"==typeof s[o]}return!n&&r&&"wheel"===e&&(n=document.implementation.hasFeature("Events.wheel","3.0")),n}var r,i=o(49);i.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),e.exports=n},function(e,t){"use strict";var o=!("undefined"==typeof window||!window.document||!window.document.createElement),n={canUseDOM:o,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:o&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:o&&!!window.screen,isInWorker:!o};e.exports=n},function(e,t,o){(function(t){"use strict";var n=o(45),r=o(51),i=0,s=r||function(e){var o=Date.now(),n=Math.max(0,16-(o-i));return i=o+n,t.setTimeout(function(){e(Date.now())},n)};s(n),e.exports=s}).call(t,function(){return this}())},function(e,t){(function(t){"use strict";var o=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame;e.exports=o}).call(t,function(){return this}())},function(e,t,o){"use strict";var n=o(53),r=o(56),i=o(27),s=o(34),a=o(37),l=o(57),u=o(43),c=o(44),h=o(59),f=o(60),p=o(45),d=o(61),m={position:0,scrollable:!1},v=parseInt(h("scrollbar-face-margin"),10),_=2*v,g=30,y=40,w=null,b=a({displayName:"Scrollbar",mixins:[u],propTypes:{contentSize:i.number.isRequired,defaultPosition:i.number,isOpaque:i.bool,orientation:i.oneOf(["vertical","horizontal"]),onScroll:i.func,position:i.number,size:i.number.isRequired,trackColor:i.oneOf(["gray"]),zIndex:i.number,verticalTop:i.number},getInitialState:function(){var e=this.props;return this._calculateState(e.position||e.defaultPosition||0,e.size,e.contentSize,e.orientation)},componentWillReceiveProps:function(e){var t=e.position;void 0===t?this._setNextState(this._calculateState(this.state.position,e.size,e.contentSize,e.orientation)):this._setNextState(this._calculateState(t,e.size,e.contentSize,e.orientation),e)},getDefaultProps:function(){return{defaultPosition:0,isOpaque:!1,onScroll:p,orientation:"vertical",zIndex:99}},render:function(){if(!this.state.scrollable)return null;var e,t,o=this.props.size,n=this.state.isHorizontal,r=!n,i=this.state.focused||this.state.isDragging,a=this.state.faceSize,l=this.props.isOpaque,u=this.props.verticalTop||0,c=f({"ScrollbarLayout/main":!0,"ScrollbarLayout/mainVertical":r,"ScrollbarLayout/mainHorizontal":n,"public/Scrollbar/main":!0,"public/Scrollbar/mainOpaque":l,"public/Scrollbar/mainActive":i}),p=f({"ScrollbarLayout/face":!0,"ScrollbarLayout/faceHorizontal":n,"ScrollbarLayout/faceVertical":r,"public/Scrollbar/faceActive":i,"public/Scrollbar/face":!0}),m=this.state.position*this.state.scale+v;return n?(e={width:o},t={width:a-_},d(t,m,0)):(e={top:u,height:o},t={height:a-_},d(t,0,m)),e.zIndex=this.props.zIndex,"gray"===this.props.trackColor&&(e.backgroundColor=h("fbui-desktop-background-light")),s.createElement("div",{onFocus:this._onFocus,onBlur:this._onBlur,onKeyDown:this._onKeyDown,onMouseDown:this._onMouseDown,onWheel:this._wheelHandler.onWheel,className:c,style:e,tabIndex:0},s.createElement("div",{ref:"face",className:p,style:t}))},componentWillMount:function(){var e="horizontal"===this.props.orientation,t=e?this._onWheelX:this._onWheelY;this._wheelHandler=new c(t,this._shouldHandleX,this._shouldHandleY)},componentDidMount:function(){this._mouseMoveTracker=new n(this._onMouseMove,this._onMouseMoveEnd,document.documentElement),void 0!==this.props.position&&this.state.position!==this.props.position&&this._didScroll(),this._isMounted=!0},componentWillUnmount:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),w===this&&(w=null),delete this._mouseMoveTracker,this._isMounted=!1},scrollBy:function(e){this._onWheel(e)},_shouldHandleX:function(e){return"horizontal"===this.props.orientation&&this._shouldHandleChange(e)},_shouldHandleY:function(e){return"horizontal"!==this.props.orientation&&this._shouldHandleChange(e)},_shouldHandleChange:function(e){var t=this._calculateState(this.state.position+e,this.props.size,this.props.contentSize,this.props.orientation);return t.position!==this.state.position},_calculateState:function(e,t,o,n){if(t<1||o<=t)return m;var r=e+"_"+t+"_"+o+"_"+n;if(this._stateKey===r)return this._stateForKey;var i="horizontal"===n,s=t/o,a=t*s;au&&(e=u);var c=!!this._mouseMoveTracker&&this._mouseMoveTracker.isDragging(),h={faceSize:a,isDragging:c,isHorizontal:i,position:e,scale:s,scrollable:l};return this._stateKey=r,this._stateForKey=h,h},_onWheelY:function(e,t){this._onWheel(t)},_onWheelX:function(e,t){this._onWheel(e)},_onWheel:function(e){var t=this.props;this._setNextState(this._calculateState(this.state.position+e,t.size,t.contentSize,t.orientation))},_onMouseDown:function(e){var t;if(e.target!==l.findDOMNode(this.refs.face)){var o=e.nativeEvent,n=this.state.isHorizontal?o.offsetX||o.layerX:o.offsetY||o.layerY,r=this.props;n/=this.state.scale,t=this._calculateState(n-.5*this.state.faceSize/this.state.scale,r.size,r.contentSize,r.orientation)}else t={};t.focused=!0,this._setNextState(t),this._mouseMoveTracker.captureMouseMoves(e),l.findDOMNode(this).focus()},_onMouseMove:function(e,t){var o=this.props,n=this.state.isHorizontal?e:t;n/=this.state.scale,this._setNextState(this._calculateState(this.state.position+n,o.size,o.contentSize,o.orientation))},_onMouseMoveEnd:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),this.setState({isDragging:!1})},_onKeyDown:function(e){var t=e.keyCode;if(t!==r.TAB){var o=y,n=0;if(this.state.isHorizontal)switch(t){case r.HOME:n=-1,o=this.props.contentSize;break;case r.LEFT:n=-1;break;case r.RIGHT:n=1;break;default:return}if(!this.state.isHorizontal)switch(t){case r.SPACE:n=e.shiftKey?-1:1;break;case r.HOME:n=-1,o=this.props.contentSize;break;case r.UP:n=-1;break;case r.DOWN:n=1;break;case r.PAGE_UP:n=-1,o=this.props.size;break;case r.PAGE_DOWN:n=1,o=this.props.size;break;default:return}e.preventDefault();var i=this.props;this._setNextState(this._calculateState(this.state.position+o*n,i.size,i.contentSize,i.orientation))}},_onFocus:function(){this.setState({focused:!0})},_onBlur:function(){this.setState({focused:!1})},_blur:function(){if(this._isMounted)try{this._onBlur(),l.findDOMNode(this).blur()}catch(e){}},_setNextState:function(e,t){t=t||this.props;var o=t.position,n=this.state.position!==e.position;if(void 0===o){var r=n?this._didScroll:void 0;this.setState(e,r)}else{if(o!==e.position)return void(void 0!==e.position&&e.position!==this.state.position&&this.props.onScroll(e.position));this.setState(e)}n&&w!==this&&(w&&w._blur(),w=this)},_didScroll:function(){this.props.onScroll(this.state.position)}});b.KEYBOARD_SCROLL_AMOUNT=y,b.SIZE=parseInt(h("scrollbar-size"),10),e.exports=b},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var o=0;o0;)this._addRowToBuffer(t,this._viewportRowsBegin,this._viewportRowsEnd-1),t++,e--;return this._rows}},{key:"getRows",value:function(e,t){var o=t,n=o,r=e,i=Math.min(e+this._maxVisibleRowCount,this._rowsCount);for(this._viewportRowsBegin=e;r=i&&(n=this._bufferSet.replaceFurthestValuePosition(t,o,e)),null===n?(n=this._bufferSet.getNewPositionForValue(e),this._rows[n]=e):this._rows[n]=e}}]),e}();e.exports=c},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var o=0;o=e&&r<=t)return null;var i;e-n>r-t?(i=n,this._smallValues.pop()):(i=r,this._largeValues.pop());var a=this._valueToPositionMap[i];return delete this._valueToPositionMap[i],this._valueToPositionMap[o]=a,this._pushToHeaps(a,o),a}},{key:"_pushToHeaps",value:function(e,t){var o={position:e,value:t};this._smallValues.push(o),this._largeValues.push(o)}},{key:"_cleanHeaps",value:function(){this._cleanHeap(this._smallValues),this._cleanHeap(this._largeValues);var e=Math.min(this._smallValues.size(),this._largeValues.size()),t=Math.max(this._smallValues.size(),this._largeValues.size());t>10*e&&this._recreateHeaps()}},{key:"_recreateHeaps",value:function(){for(var e=this._smallValues.size()t.value}}]),e}();e.exports=a},function(e,t){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){return e0&&(this._items[0]=t,this._sinkDown(0)),e}}},{key:"push",value:function(e){this._items[this._size++]=e,this._bubbleUp(this._size-1)}},{key:"size",value:function(){return this._size}},{key:"peek",value:function(){if(0!==this._size)return this._items[0]}},{key:"_heapify",value:function(){for(var e=Math.floor((this._size+1)/2);e>=0;e--)this._sinkDown(e)}},{key:"_bubbleUp",value:function(e){for(var t=this._items[e];e>0;){var o=Math.floor((e+1)/2)-1,n=this._items[o];if(this._comparator(n,t))return;this._items[o]=t,this._items[e]=n,e=o}}},{key:"_sinkDown",value:function(e){for(var t=this._items[e];;){var o=2*(e+1)-1,n=2*(e+1),r=-1;if(oo?o:e}e.exports=o},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=Object.assign||function(e){for(var t=1;t0){var o=h({"fixedDataTableRowLayout/fixedColumnsDivider":!0,"fixedDataTableRowLayout/columnsShadow":e.props.scrollLeft>0,"public/fixedDataTableRow/fixedColumnsDivider":!0,"public/fixedDataTableRow/columnsShadow":e.props.scrollLeft>0}),n={left:t,height:e.props.height};return u.createElement("div",{className:o,style:n})}},this._onClick=function(t){e.props.onClick(t,e.props.index)},this._onDoubleClick=function(t){e.props.onDoubleClick(t,e.props.index)},this._onMouseDown=function(t){e.props.onMouseDown(t,e.props.index)},this._onMouseEnter=function(t){e.props.onMouseEnter(t,e.props.index)},this._onMouseLeave=function(t){e.props.onMouseLeave(t,e.props.index)}}return r(t,e),s(t,[{key:"render",value:function(){var e={width:this.props.width,height:this.props.height},t=h({"fixedDataTableRowLayout/main":!0,"public/fixedDataTableRow/main":!0,"public/fixedDataTableRow/highlighted":this.props.index%2===1,"public/fixedDataTableRow/odd":this.props.index%2===1,"public/fixedDataTableRow/even":this.props.index%2===0}),o=this._getColumnsWidth(this.props.fixedColumns),n=u.createElement(c,{key:"fixed_cells",isScrolling:this.props.isScrolling,height:this.props.height,left:0,width:o,zIndex:2,columns:this.props.fixedColumns,onColumnResize:this.props.onColumnResize,rowHeight:this.props.height,rowIndex:this.props.index}),r=this._renderColumnsShadow(o),i=u.createElement(c,{key:"scrollable_cells",isScrolling:this.props.isScrolling,height:this.props.height,left:this.props.scrollLeft,offsetLeft:o,width:this.props.width-o,zIndex:0,columns:this.props.scrollableColumns,onColumnResize:this.props.onColumnResize,rowHeight:this.props.height,rowIndex:this.props.index});return u.createElement("div",{className:f(t,this.props.className),onClick:this.props.onClick?this._onClick:null,onDoubleClick:this.props.onDoubleClick?this._onDoubleClick:null,onMouseDown:this.props.onMouseDown?this._onMouseDown:null,onMouseEnter:this.props.onMouseEnter?this._onMouseEnter:null,onMouseLeave:this.props.onMouseLeave?this._onMouseLeave:null,style:e},u.createElement("div",{className:h("fixedDataTableRowLayout/body")},n,i,r))}}],[{key:"propTypes",value:{isScrolling:l.bool,fixedColumns:l.array.isRequired,height:l.number.isRequired,index:l.number.isRequired,scrollableColumns:l.array.isRequired,scrollLeft:l.number.isRequired,width:l.number.isRequired,onClick:l.func,onDoubleClick:l.func,onColumnResize:l.func},enumerable:!0}]),t}(u.Component),m=function(e){function t(){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return r(t,e),s(t,[{key:"render",value:function(){var e={width:this.props.width,height:this.props.height,zIndex:this.props.zIndex?this.props.zIndex:0};return p(e,0,this.props.offsetTop),u.createElement("div",{style:e,className:h("fixedDataTableRowLayout/rowWrapper")},u.createElement(d,i({},this.props,{offsetTop:void 0,zIndex:void 0})))}}],[{key:"propTypes",value:{isScrolling:l.bool,height:l.number.isRequired,zIndex:l.number,offsetTop:l.number.isRequired,width:l.number.isRequired},enumerable:!0}]),t}(u.Component);e.exports=m},function(e,t,o){"use strict";function n(e,t){var o={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}var r=Object.assign||function(e){for(var t=1;t=0){var l="cell_"+r;o[r]=this._renderCell(e.rowIndex,e.rowHeight,s,n,l)}n+=s.width}var u=this._getColumnsWidth(t),p={height:e.height,position:"absolute",width:u,zIndex:e.zIndex};return h(p,-1*f*e.left,0),a.createElement("div",{className:c("fixedDataTableCellGroupLayout/cellGroup"),style:p},o)},_renderCell:function(e,t,o,n,r){var i=o.isResizable&&this.props.onColumnResize,s=i?this.props.onColumnResize:null,l=o.cellClassName;return a.createElement(u,{isScrolling:this.props.isScrolling,align:o.align,className:l,height:t,key:r,maxWidth:o.maxWidth,minWidth:o.minWidth,onColumnResize:s,rowIndex:e,columnKey:o.columnKey,width:o.width,left:n,cell:o.cell})},_getColumnsWidth:function(e){for(var t=0,o=0;o=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}var r=o(78),i=o(73),s=o(27),a=o(34),l=o(37),u=o(60),c=o(79),h=i.DIR_SIGN,f={align:"left",highlighted:!1},p=l({displayName:"FixedDataTableCell",propTypes_DISABLED_FOR_PERFORMANCE:{isScrolling:s.bool,align:s.oneOf(["left","center","right"]),className:s.string,highlighted:s.bool,width:s.number.isRequired,minWidth:s.number,maxWidth:s.number,height:s.number.isRequired,cell:s.oneOfType([s.string,s.element,s.func]),columnKey:s.oneOfType([s.string,s.number]),rowIndex:s.number.isRequired,onColumnResize:s.func,left:s.number},shouldComponentUpdate:function(e){return!e.isScrolling||this.props.rowIndex!==e.rowIndex},getDefaultProps:function(){return f},render:function(){var e=this.props,t=e.height,o=e.width,i=e.columnKey,s=n(e,["height","width","columnKey"]),l={height:t,width:o};1===h?l.left=s.left:l.right=s.left;var f,p=c(u({"fixedDataTableCellLayout/main":!0,"fixedDataTableCellLayout/lastChild":s.lastChild,"fixedDataTableCellLayout/alignRight":"right"===s.align,"fixedDataTableCellLayout/alignCenter":"center"===s.align,"public/fixedDataTableCell/alignRight":"right"===s.align,"public/fixedDataTableCell/highlighted":s.highlighted,"public/fixedDataTableCell/main":!0}),s.className);if(s.onColumnResize){var d={height:t};f=a.createElement("div",{className:u("fixedDataTableCellLayout/columnResizerContainer"),style:d,onMouseDown:this._onColumnResizerMouseDown},a.createElement("div",{className:c(u("fixedDataTableCellLayout/columnResizerKnob"),u("public/fixedDataTableCell/columnResizerKnob")),style:d}))}var m={columnKey:i,height:t,width:o};s.rowIndex>=0&&(m.rowIndex=s.rowIndex);var v;return v=a.isValidElement(s.cell)?a.cloneElement(s.cell,m):"function"==typeof s.cell?s.cell(m):a.createElement(r,m,s.cell),a.createElement("div",{className:p,style:l},f,v)},_onColumnResizerMouseDown:function(e){this.props.onColumnResize(this.props.left,this.props.width,this.props.minWidth,this.props.maxWidth,this.props.columnKey,e)}});e.exports=p},function(e,t,o){"use strict";function n(e,t){var o={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=Object.assign||function(e){for(var t=1;t1)for(var n=1;n=0&&t>=e-a;){var o=this._updateRowHeight(t);this._position+=o,t--}}},{key:"_updateRowHeight",value:function(e){if(e<0||e>=this._rowCount)return 0;var t=this._rowHeightGetter(e);if(t!==this._storedHeights[e]){var o=t-this._storedHeights[e];return this._rowOffsets.set(e,t),this._storedHeights[e]=t,this._contentHeight+=o,o}return 0}},{key:"getRowPosition",value:function(e){return this._updateRowHeight(e),this._rowOffsets.sumUntil(e)}},{key:"scrollBy",value:function(e){if(0===this._rowCount)return l;var t=this._rowOffsets.greatestLowerBound(this._position);t=s(t,0,Math.max(this._rowCount-1,0));var o=this._rowOffsets.sumUntil(t),n=t,r=this._position,i=this._updateRowHeight(n);0!==o&&(r+=i);var a=this._storedHeights[n]-(r-o);if(e>=0)for(;e>0&&n0&&n>=0;)if(e=0){var c=this._updateRowHeight(n);u=this._storedHeights[n],r+=c}}var h=this._contentHeight-this._viewportHeight;r=s(r,0,h),this._position=r;var f=this._rowOffsets.greatestLowerBound(r);f=s(f,0,Math.max(this._rowCount-1,0)),o=this._rowOffsets.sumUntil(f);var p=o-r;return this._updateHeightsInViewport(f,p),this._updateHeightsAboveViewport(f),{index:f,offset:p,position:this._position,contentHeight:this._contentHeight}}},{key:"_getRowAtEndPosition",value:function(e){this._updateRowHeight(e);for(var t=e,o=this._storedHeights[t];o=0;)t--,t>=0&&(this._updateRowHeight(t),o+=this._storedHeights[t]);var n=this._rowOffsets.sumTo(e)-this._viewportHeight;return n<0&&(n=0),n}},{key:"scrollTo",value:function(e){if(0===this._rowCount)return l;if(e<=0)return this._position=0,this._updateHeightsInViewport(0,0),{index:0,offset:0,position:this._position,contentHeight:this._contentHeight};if(e>=this._contentHeight-this._viewportHeight){var t=this._rowCount-1;e=this._getRowAtEndPosition(t)}this._position=e;var o=this._rowOffsets.greatestLowerBound(e);o=s(o,0,Math.max(this._rowCount-1,0));var n=this._rowOffsets.sumUntil(o),r=n-e;return this._updateHeightsInViewport(o,r),this._updateHeightsAboveViewport(o),{index:o,offset:r,position:this._position,contentHeight:this._contentHeight}}},{key:"scrollToRow",value:function(e,t){e=s(e,0,Math.max(this._rowCount-1,0)),t=s(t,-this._storedHeights[e],0);var o=this._rowOffsets.sumUntil(e);return this.scrollTo(o-t)}},{key:"scrollRowIntoView",value:function(e){e=s(e,0,Math.max(this._rowCount-1,0));var t=this._rowOffsets.sumUntil(e),o=t+this._storedHeights[e];if(t=0;--o)t[o]=0;return t},u=function(){function e(t){n(this,e),this._size=t.length,this._half=r(this._size),this._heap=new l(2*this._half);var o;for(o=0;o0;--o)this._heap[o]=this._heap[2*o]+this._heap[2*o+1]}return i(e,[{key:"set",value:function(e,t){s(0<=e&&e=0;--r)n[r]=o;return new e(n)}},{key:"empty",value:function(t){return e.uniform(t,0)}}]),e}();e.exports=u}).call(t,function(){return this}())},function(e,t,o){"use strict";function n(e){for(var t=0,o=0;o 0 && state.overflowX !== 'hidden'; - var showScrollbarY = maxScrollY > 0 && state.overflowY !== 'hidden'; + var showScrollbarX = state.maxScrollX > 0 && state.overflowX !== "hidden"; + var showScrollbarY = maxScrollY > 0 && state.overflowY !== "hidden"; var scrollbarXHeight = showScrollbarX ? Scrollbar.SIZE : 0; - var scrollbarYHeight = state.height - scrollbarXHeight - - (2 * BORDER_HEIGHT) - state.footerHeight; + var scrollbarYHeight = + state.height - scrollbarXHeight - 2 * BORDER_HEIGHT - state.footerHeight; var headerOffsetTop = state.useGroupHeader ? state.groupHeaderHeight : 0; var bodyOffsetTop = headerOffsetTop + state.headerHeight; scrollbarYHeight -= bodyOffsetTop; var bottomSectionOffset = 0; - var footOffsetTop = props.maxHeight != null - ? bodyOffsetTop + state.bodyHeight - : bodyOffsetTop + scrollbarYHeight; + var footOffsetTop = + props.maxHeight != null + ? bodyOffsetTop + state.bodyHeight + : bodyOffsetTop + scrollbarYHeight; var rowsContainerHeight = footOffsetTop + state.footerHeight; if (props.ownerHeight !== undefined && props.ownerHeight < state.height) { @@ -450,30 +462,32 @@ var FixedDataTable = createReactClass({ var verticalScrollbar; if (showScrollbarY) { - verticalScrollbar = + verticalScrollbar = ( ; + /> + ); } var horizontalScrollbar; if (showScrollbarX) { var scrollbarXWidth = state.width; - horizontalScrollbar = + horizontalScrollbar = ( ; + /> + ); } - var dragKnob = + var dragKnob = ( ; + /> + ); var footer = null; if (state.footerHeight) { - footer = + footer = ( ; + /> + ); } var rows = this._renderRows(bodyOffsetTop); - var header = + var header = ( ; + /> + ); var topShadow; var bottomShadow; if (state.scrollY) { - topShadow = + topShadow = (
; + style={{ ...topShadowStyle, top: bodyOffsetTop }} + /> + ); } if ( @@ -548,27 +566,30 @@ var FixedDataTable = createReactClass({ state.scrollContentHeight + state.reservedHeight > state.ownerHeight) || state.scrollY < maxScrollY ) { - bottomShadow = + bottomShadow = (
; + style={{ top: footOffsetTop }} + /> + ); } return (
+ style={{ height: state.height, width: state.width }} + >
+ className={cx("fixedDataTableLayout/rowsContainer")} + style={{ height: rowsContainerHeight, width: state.width }} + > {dragKnob} {groupHeader} {header} @@ -648,18 +669,12 @@ var FixedDataTable = createReactClass({ }); }, - _areColumnSettingsIdentical( - oldColumns: Array, - newColumns: Array - ): boolean { + _areColumnSettingsIdentical(oldColumns: Array, newColumns: Array): boolean { if (oldColumns.length !== newColumns.length) { return false; } for (var index = 0; index < oldColumns.length; ++index) { - if (!shallowEqual( - oldColumns[index].props, - newColumns[index].props - )) { + if (!shallowEqual(oldColumns[index].props, newColumns[index].props)) { return false; } } @@ -675,12 +690,16 @@ var FixedDataTable = createReactClass({ var canReuseColumnGroupSettings = false; if (oldState && oldState.columns) { - canReuseColumnSettings = - this._areColumnSettingsIdentical(columns, oldState.columns); + canReuseColumnSettings = this._areColumnSettingsIdentical( + columns, + oldState.columns + ); } if (oldState && oldState.columnGroups && columnGroups) { - canReuseColumnGroupSettings = - this._areColumnSettingsIdentical(columnGroups, oldState.columnGroups); + canReuseColumnGroupSettings = this._areColumnSettingsIdentical( + columnGroups, + oldState.columnGroups + ); } var columnInfo = {}; @@ -730,7 +749,7 @@ var FixedDataTable = createReactClass({ _calculateState(/*object*/ props, /*?object*/ oldState) /*object*/ { invariant( props.height !== undefined || props.maxHeight !== undefined, - 'You must set either a height or a maxHeight' + "You must set either a height or a maxHeight" ); var children = []; @@ -739,10 +758,9 @@ var FixedDataTable = createReactClass({ return; } invariant( - child.type.__TableColumnGroup__ || - child.type.__TableColumn__, - 'child type should be or ' + - '' + child.type.__TableColumnGroup__ || child.type.__TableColumn__, + "child type should be or " + + "" ); children.push(child); }); @@ -752,23 +770,27 @@ var FixedDataTable = createReactClass({ useGroupHeader = true; } - if (oldState && ( - (props.width !== undefined && props.width !== oldState.width) || - (props.height !== undefined && props.height !== oldState.height) || - (props.maxWidth !== undefined && props.maxWidth !== oldState.maxWidth) || - (props.maxHeight !== undefined && props.maxHeight !== oldState.maxHeight))) { - oldState = null + if ( + oldState && + ((props.width !== undefined && props.width !== oldState.width) || + (props.height !== undefined && props.height !== oldState.height) || + (props.maxWidth !== undefined && + props.maxWidth !== oldState.maxWidth) || + (props.maxHeight !== undefined && + props.maxHeight !== oldState.maxHeight)) + ) { + oldState = null; } var firstRowIndex = (oldState && oldState.firstRowIndex) || 0; var firstRowOffset = (oldState && oldState.firstRowOffset) || 0; var scrollX, scrollY; - if (oldState && props.overflowX !== 'hidden') { + if (oldState && props.overflowX !== "hidden") { scrollX = oldState.scrollX; } else { scrollX = props.scrollLeft; } - if (oldState && props.overflowY !== 'hidden') { + if (oldState && props.overflowY !== "hidden") { scrollY = oldState.scrollY; } else { scrollState = this._scrollHelper.scrollTo(props.scrollTop); @@ -778,8 +800,7 @@ var FixedDataTable = createReactClass({ } if (this._rowToScrollTo !== undefined) { - scrollState = - this._scrollHelper.scrollRowIntoView(this._rowToScrollTo); + scrollState = this._scrollHelper.scrollRowIntoView(this._rowToScrollTo); firstRowIndex = scrollState.index; firstRowOffset = scrollState.offset; scrollY = scrollState.position; @@ -802,8 +823,10 @@ var FixedDataTable = createReactClass({ viewportHeight, props.rowHeightGetter ); - var scrollState = - this._scrollHelper.scrollToRow(firstRowIndex, firstRowOffset); + var scrollState = this._scrollHelper.scrollToRow( + firstRowIndex, + firstRowOffset + ); firstRowIndex = scrollState.index; firstRowOffset = scrollState.offset; scrollY = scrollState.position; @@ -822,10 +845,9 @@ var FixedDataTable = createReactClass({ var columnGroups; if (useGroupHeader) { - var columnGroupSettings = - FixedDataTableWidthHelper.adjustColumnGroupWidths( - children, - props.width + var columnGroupSettings = FixedDataTableWidthHelper.adjustColumnGroupWidths( + children, + props.width ); columns = columnGroupSettings.columns; columnGroups = columnGroupSettings.columnGroups; @@ -855,7 +877,7 @@ var FixedDataTable = createReactClass({ var scrollableColumnIndex = Math.min( this._columnToScrollTo - fixedColumnsCount, - columnInfo.bodyScrollableColumns.length - 1, + columnInfo.bodyScrollableColumns.length - 1 ); var previousColumnsWidth = 0; @@ -865,9 +887,8 @@ var FixedDataTable = createReactClass({ } var availableScrollWidth = props.width - totalFixedColumnsWidth; - var selectedColumnWidth = columnInfo.bodyScrollableColumns[ - scrollableColumnIndex - ].props.width; + var selectedColumnWidth = + columnInfo.bodyScrollableColumns[scrollableColumnIndex].props.width; var minAcceptableScrollPosition = previousColumnsWidth + selectedColumnWidth - availableScrollWidth; @@ -884,16 +905,18 @@ var FixedDataTable = createReactClass({ var useMaxHeight = props.height === undefined; var height = Math.round(useMaxHeight ? props.maxHeight : props.height); - var totalHeightReserved = props.footerHeight + props.headerHeight + - groupHeaderHeight + 2 * BORDER_HEIGHT; + var totalHeightReserved = + props.footerHeight + + props.headerHeight + + groupHeaderHeight + + 2 * BORDER_HEIGHT; var bodyHeight = height - totalHeightReserved; var scrollContentHeight = this._scrollHelper.getContentHeight(); var totalHeightNeeded = scrollContentHeight + totalHeightReserved; - var scrollContentWidth = - FixedDataTableWidthHelper.getTotalWidth(columns); + var scrollContentWidth = FixedDataTableWidthHelper.getTotalWidth(columns); - var horizontalScrollbarVisible = scrollContentWidth > props.width && - props.overflowX !== 'hidden'; + var horizontalScrollbarVisible = + scrollContentWidth > props.width && props.overflowX !== "hidden"; if (horizontalScrollbarVisible) { bodyHeight -= Scrollbar.SIZE; @@ -945,7 +968,7 @@ var FixedDataTable = createReactClass({ bodyHeight, height, groupHeaderHeight, - useGroupHeader, + useGroupHeader }; return newState; @@ -955,12 +978,11 @@ var FixedDataTable = createReactClass({ var newColumns = []; for (var i = 0; i < columns.length; ++i) { var column = columns[i]; - newColumns.push(React.cloneElement( - column, - { - cell: type ? column.props[type] : column.props[CELL] - } - )); + newColumns.push( + React.cloneElement(column, { + cell: type ? column.props[type] : column.props[CELL] + }) + ); } return newColumns; }, @@ -977,7 +999,7 @@ var FixedDataTable = createReactClass({ } return { fixed: fixedColumns, - scrollable: scrollableColumns, + scrollable: scrollableColumns }; }, @@ -987,8 +1009,10 @@ var FixedDataTable = createReactClass({ this._didScrollStart(); } var x = this.state.scrollX; - if (Math.abs(deltaY) > Math.abs(deltaX) && - this.props.overflowY !== 'hidden') { + if ( + Math.abs(deltaY) > Math.abs(deltaX) && + this.props.overflowY !== "hidden" + ) { var scrollState = this._scrollHelper.scrollBy(Math.round(deltaY)); var maxScrollY = Math.max( 0, @@ -999,14 +1023,14 @@ var FixedDataTable = createReactClass({ firstRowOffset: scrollState.offset, scrollY: scrollState.position, scrollContentHeight: scrollState.contentHeight, - maxScrollY: maxScrollY, + maxScrollY: maxScrollY }); - } else if (deltaX && this.props.overflowX !== 'hidden') { + } else if (deltaX && this.props.overflowX !== "hidden") { x += deltaX; x = x < 0 ? 0 : x; x = x > this.state.maxScrollX ? this.state.maxScrollX : x; this.setState({ - scrollX: x, + scrollX: x }); } @@ -1020,7 +1044,7 @@ var FixedDataTable = createReactClass({ this._didScrollStart(); } this.setState({ - scrollX: scrollPos, + scrollX: scrollPos }); this._didScrollStop(); } @@ -1036,7 +1060,7 @@ var FixedDataTable = createReactClass({ firstRowIndex: scrollState.index, firstRowOffset: scrollState.offset, scrollY: scrollState.position, - scrollContentHeight: scrollState.contentHeight, + scrollContentHeight: scrollState.contentHeight }); this._didScrollStop(); } @@ -1054,7 +1078,7 @@ var FixedDataTable = createReactClass({ _didScrollStop() { if (this._isMounted && this._isScrolling) { this._isScrolling = false; - this.setState({redraw: true}); + this.setState({ redraw: true }); if (this.props.onScrollEnd) { this.props.onScrollEnd(this.state.scrollX, this.state.scrollY); } @@ -1071,33 +1095,30 @@ var HorizontalScrollbar = createReactClass({ offset: PropTypes.number.isRequired, onScroll: PropTypes.func.isRequired, position: PropTypes.number.isRequired, - size: PropTypes.number.isRequired, + size: PropTypes.number.isRequired }, render() /*object*/ { var outerContainerStyle = { height: Scrollbar.SIZE, - width: this.props.size, + width: this.props.size }; var innerContainerStyle = { height: Scrollbar.SIZE, - position: 'absolute', - overflow: 'hidden', - width: this.props.size, + position: "absolute", + overflow: "hidden", + width: this.props.size }; - translateDOMPositionXY( - innerContainerStyle, - 0, - this.props.offset - ); + translateDOMPositionXY(innerContainerStyle, 0, this.props.offset); return (
+ style={outerContainerStyle} + >
Date: Mon, 5 Nov 2018 14:06:55 -0800 Subject: [PATCH 17/43] Version 0.7.6 --- dist/fixed-data-table-base.css | 2 +- dist/fixed-data-table-base.min.css | 2 +- dist/fixed-data-table-style.css | 2 +- dist/fixed-data-table-style.min.css | 2 +- dist/fixed-data-table.css | 2 +- dist/fixed-data-table.js | 5 +++-- dist/fixed-data-table.min.css | 2 +- dist/fixed-data-table.min.js | 4 ++-- package.json | 2 +- src/FixedDataTableNew.react.js | 3 ++- 10 files changed, 14 insertions(+), 12 deletions(-) diff --git a/dist/fixed-data-table-base.css b/dist/fixed-data-table-base.css index 6cd2aa35..23e7b2ce 100644 --- a/dist/fixed-data-table-base.css +++ b/dist/fixed-data-table-base.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.5 + * FixedDataTable v0.7.6 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table-base.min.css b/dist/fixed-data-table-base.min.css index 857b1e61..52d33760 100644 --- a/dist/fixed-data-table-base.min.css +++ b/dist/fixed-data-table-base.min.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.5 + * FixedDataTable v0.7.6 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table-style.css b/dist/fixed-data-table-style.css index 3b70e1c2..f53e32c0 100644 --- a/dist/fixed-data-table-style.css +++ b/dist/fixed-data-table-style.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.5 + * FixedDataTable v0.7.6 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table-style.min.css b/dist/fixed-data-table-style.min.css index 843d1fa3..2eaedfe5 100644 --- a/dist/fixed-data-table-style.min.css +++ b/dist/fixed-data-table-style.min.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.5 + * FixedDataTable v0.7.6 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table.css b/dist/fixed-data-table.css index 87131bf2..c2979425 100644 --- a/dist/fixed-data-table.css +++ b/dist/fixed-data-table.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.5 + * FixedDataTable v0.7.6 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table.js b/dist/fixed-data-table.js index 1c0e11e6..c3f98152 100644 --- a/dist/fixed-data-table.js +++ b/dist/fixed-data-table.js @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.5 + * FixedDataTable v0.7.6 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -2100,7 +2100,8 @@ return /******/ (function(modules) { // webpackBootstrap groupHeaderHeight: 0, headerHeight: 0, scrollLeft: 0, - scrollTop: 0 + scrollTop: 0, + topShadowStyle: {} }; }, diff --git a/dist/fixed-data-table.min.css b/dist/fixed-data-table.min.css index d99accec..5cf99e4b 100644 --- a/dist/fixed-data-table.min.css +++ b/dist/fixed-data-table.min.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.5 + * FixedDataTable v0.7.6 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table.min.js b/dist/fixed-data-table.min.js index b384fcf9..f2dc28d4 100644 --- a/dist/fixed-data-table.min.js +++ b/dist/fixed-data-table.min.js @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.5 + * FixedDataTable v0.7.6 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -9,7 +9,7 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.FixedDataTable=t(require("react"),require("react-dom")):e.FixedDataTable=t(e.React,e.ReactDOM)}(this,function(e,t){return function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){o(1),o(5),o(7),o(9),o(11),o(13),o(15),o(17),o(19),o(21),o(23),e.exports=o(25)},function(e,t){},,,,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t,o){"use strict";var n=o(26),r=o(78),i=o(76),s=o(75),a={Cell:r,Column:i,ColumnGroup:s,Table:n};a.version="0.7.0",e.exports=a},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e,t){}var s=Object.assign||function(e){for(var t=1;t1)for(var o=1;o0||e>=0&&this.state.scrollX0||e>=0&&this.state.scrollYn?n:this.state.height>n&&this.props.ownerHeight?Math.max(n,this.props.ownerHeight):this.state.height+this.state.maxScrollY,e!==this._contentHeight&&this.props.onContentHeightChange&&this.props.onContentHeightChange(e),this._contentHeight=e},componentDidMount:function(){this._reportContentHeight(),this._isMounted=!0},componentWillReceiveProps:function(e){var t=e.scrollToRow;void 0!==t&&null!==t&&(this._rowToScrollTo=t);var o=e.scrollToColumn;void 0!==o&&null!==o&&(this._columnToScrollTo=o);var n=e.overflowX,r=e.overflowY;n===this.props.overflowX&&r===this.props.overflowY||(this._wheelHandler=new l(this._onWheel,"hidden"!==n,"hidden"!==r)),this.props.ownerHeight===e.ownerHeight&&this.props.scrollTop===e.scrollTop||this._didScrollStart(),this._didScrollStop(),this.setState(this._calculateState(e,this.state))},componentDidUpdate:function(){this._reportContentHeight()},render:function(){var e,t=this.state,o=this.props;t.useGroupHeader&&(e=i.createElement(f,{key:"group_header",isScrolling:this._isScrolling,className:y(m("fixedDataTableLayout/header"),m("public/fixedDataTable/header")),width:t.width,height:t.groupHeaderHeight,index:0,zIndex:1,offsetTop:0,scrollLeft:t.scrollX,fixedColumns:t.groupHeaderFixedColumns,scrollableColumns:t.groupHeaderScrollableColumns,onColumnResize:this._onColumnResize}));var r=this.state.maxScrollY,s=t.maxScrollX>0&&"hidden"!==t.overflowX,a=r>0&&"hidden"!==t.overflowY,l=s?u.SIZE:0,c=t.height-l-2*R-t.footerHeight,p=t.useGroupHeader?t.groupHeaderHeight:0,d=p+t.headerHeight;c-=d;var v=0,_=null!=o.maxHeight?d+t.bodyHeight:d+c,g=_+t.footerHeight;void 0!==o.ownerHeight&&o.ownerHeightt.ownerHeight||t.scrollY or "),o.push(e))});var r=!1;o.length&&o[0].type.__TableColumnGroup__&&(r=!0),t&&(void 0!==e.width&&e.width!==t.width||void 0!==e.height&&e.height!==t.height||void 0!==e.maxWidth&&e.maxWidth!==t.maxWidth||void 0!==e.maxHeight&&e.maxHeight!==t.maxHeight)&&(t=null);var i,s,a=t&&t.firstRowIndex||0,l=t&&t.firstRowOffset||0;i=t&&"hidden"!==e.overflowX?t.scrollX:e.scrollLeft,t&&"hidden"!==e.overflowY?s=t.scrollY:(f=this._scrollHelper.scrollTo(e.scrollTop),a=f.index,l=f.offset,s=f.position),void 0!==this._rowToScrollTo&&(f=this._scrollHelper.scrollRowIntoView(this._rowToScrollTo),a=f.index,l=f.offset,s=f.position,delete this._rowToScrollTo);var c=r?e.groupHeaderHeight:0;if(t&&e.rowsCount!==t.rowsCount){var h=(void 0===e.height?e.maxHeight:e.height)-(e.headerHeight||0)-(e.footerHeight||0)-(e.groupHeaderHeight||0);this._scrollHelper=new p(e.rowsCount,e.rowHeight,h,e.rowHeightGetter);var f=this._scrollHelper.scrollToRow(a,l);a=f.index,l=f.offset,s=f.position}else t&&e.rowHeightGetter!==t.rowHeightGetter&&this._scrollHelper.setRowHeightGetter(e.rowHeightGetter);var m;m=e.isColumnResizing?t&&t.columnResizingData:C;var v,_;if(r){var y=d.adjustColumnGroupWidths(o,e.width);v=y.columns,_=y.columnGroups}else v=d.adjustColumnWidths(o,e.width);var w=this._populateColumnsAndColumnData(v,_,t);if(void 0!==this._columnToScrollTo){var b=w.bodyFixedColumns.length;if(this._columnToScrollTo>=b){var E,D,T=0;for(E=0;EO&&(i=O)}delete this._columnToScrollTo}var k=void 0===e.height,P=Math.round(k?e.maxHeight:e.height),I=e.footerHeight+e.headerHeight+c+2*R,z=P-I,j=this._scrollHelper.getContentHeight(),A=j+I,F=d.getTotalWidth(v),L=F>e.width&&"hidden"!==e.overflowX;L&&(z-=u.SIZE,A+=u.SIZE,I+=u.SIZE);var G=Math.max(0,F-e.width),W=Math.max(0,j-z);i=Math.min(i,G),s=Math.min(s,W),W||(k&&(P=A),z=A-I),this._scrollHelper.setViewportHeight(z);var V=n({isColumnResizing:t&&t.isColumnResizing},w,e,{columns:v,columnGroups:_,columnResizingData:m,firstRowIndex:a,firstRowOffset:l,horizontalScrollbarVisible:L,maxScrollX:G,maxScrollY:W,reservedHeight:I,scrollContentHeight:j,scrollX:i,scrollY:s,bodyHeight:z,height:P,groupHeaderHeight:c,useGroupHeader:r});return V},_selectColumnElement:function(e,t){for(var o=[],n=0;nMath.abs(e)&&"hidden"!==this.props.overflowY){var n=this._scrollHelper.scrollBy(Math.round(t)),r=Math.max(0,n.contentHeight-this.state.bodyHeight);this.setState({firstRowIndex:n.index,firstRowOffset:n.offset,scrollY:n.position,scrollContentHeight:n.contentHeight,maxScrollY:r})}else e&&"hidden"!==this.props.overflowX&&(o+=e,o=o<0?0:o,o=o>this.state.maxScrollX?this.state.maxScrollX:o,this.setState({scrollX:o}));this._didScrollStop()}},_onHorizontalScroll:function(e){this._isMounted&&e!==this.state.scrollX&&(this._isScrolling||this._didScrollStart(),this.setState({scrollX:e}),this._didScrollStop())},_onVerticalScroll:function(e){if(this._isMounted&&e!==this.state.scrollY){this._isScrolling||this._didScrollStart();var t=this._scrollHelper.scrollTo(Math.round(e));this.setState({firstRowIndex:t.index,firstRowOffset:t.offset,scrollY:t.position,scrollContentHeight:t.contentHeight}),this._didScrollStop()}},_didScrollStart:function(){this._isMounted&&!this._isScrolling&&(this._isScrolling=!0,this.props.onScrollStart&&this.props.onScrollStart(this.state.scrollX,this.state.scrollY))},_didScrollStop:function(){this._isMounted&&this._isScrolling&&(this._isScrolling=!1,this.setState({redraw:!0}),this.props.onScrollEnd&&this.props.onScrollEnd(this.state.scrollX,this.state.scrollY))}}),O=s({displayName:"HorizontalScrollbar",mixins:[a],propTypes:{contentSize:r.number.isRequired,offset:r.number.isRequired,onScroll:r.func.isRequired,position:r.number.isRequired,size:r.number.isRequired},render:function(){var e={height:u.SIZE,width:this.props.size},t={height:u.SIZE,position:"absolute",overflow:"hidden",width:this.props.size};return b(t,0,this.props.offset),i.createElement("div",{className:y(m("fixedDataTableLayout/horizontalScrollbar"),m("public/fixedDataTable/horizontalScrollbar")),style:e},i.createElement("div",{style:t},i.createElement(u,n({},this.props,{isOpaque:!0,orientation:"horizontal",offset:void 0}))))}});e.exports=S},function(e,t,o){"use strict";var n=o(35),r=o(38);if("undefined"==typeof n)throw Error("create-react-class could not find the React object. If you are using script tags, make sure that React is being loaded before create-react-class.");var i=(new n.Component).updater;e.exports=r(n.Component,n.isValidElement,i)},function(e,t,o){(function(t){"use strict";function n(e){return e}function r(e,o,r){function h(e,o,n){for(var r in o)o.hasOwnProperty(r)&&"production"!==t.env.NODE_ENV&&l("function"==typeof o[r],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",e.displayName||"ReactClass",u[n],r)}function f(e,t){var o=x.hasOwnProperty(t)?x[t]:null;T.hasOwnProperty(t)&&a("OVERRIDE_BASE"===o,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&a("DEFINE_MANY"===o||"DEFINE_MANY_MERGED"===o,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t); +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.FixedDataTable=t(require("react"),require("react-dom")):e.FixedDataTable=t(e.React,e.ReactDOM)}(this,function(e,t){return function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){o(1),o(5),o(7),o(9),o(11),o(13),o(15),o(17),o(19),o(21),o(23),e.exports=o(25)},function(e,t){},,,,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t,o){"use strict";var n=o(26),r=o(78),i=o(76),s=o(75),a={Cell:r,Column:i,ColumnGroup:s,Table:n};a.version="0.7.0",e.exports=a},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e,t){}var s=Object.assign||function(e){for(var t=1;t1)for(var o=1;o0||e>=0&&this.state.scrollX0||e>=0&&this.state.scrollYn?n:this.state.height>n&&this.props.ownerHeight?Math.max(n,this.props.ownerHeight):this.state.height+this.state.maxScrollY,e!==this._contentHeight&&this.props.onContentHeightChange&&this.props.onContentHeightChange(e),this._contentHeight=e},componentDidMount:function(){this._reportContentHeight(),this._isMounted=!0},componentWillReceiveProps:function(e){var t=e.scrollToRow;void 0!==t&&null!==t&&(this._rowToScrollTo=t);var o=e.scrollToColumn;void 0!==o&&null!==o&&(this._columnToScrollTo=o);var n=e.overflowX,r=e.overflowY;n===this.props.overflowX&&r===this.props.overflowY||(this._wheelHandler=new l(this._onWheel,"hidden"!==n,"hidden"!==r)),this.props.ownerHeight===e.ownerHeight&&this.props.scrollTop===e.scrollTop||this._didScrollStart(),this._didScrollStop(),this.setState(this._calculateState(e,this.state))},componentDidUpdate:function(){this._reportContentHeight()},render:function(){var e,t=this.state,o=this.props;t.useGroupHeader&&(e=i.createElement(f,{key:"group_header",isScrolling:this._isScrolling,className:y(m("fixedDataTableLayout/header"),m("public/fixedDataTable/header")),width:t.width,height:t.groupHeaderHeight,index:0,zIndex:1,offsetTop:0,scrollLeft:t.scrollX,fixedColumns:t.groupHeaderFixedColumns,scrollableColumns:t.groupHeaderScrollableColumns,onColumnResize:this._onColumnResize}));var r=this.state.maxScrollY,s=t.maxScrollX>0&&"hidden"!==t.overflowX,a=r>0&&"hidden"!==t.overflowY,l=s?u.SIZE:0,c=t.height-l-2*R-t.footerHeight,p=t.useGroupHeader?t.groupHeaderHeight:0,d=p+t.headerHeight;c-=d;var v=0,_=null!=o.maxHeight?d+t.bodyHeight:d+c,g=_+t.footerHeight;void 0!==o.ownerHeight&&o.ownerHeightt.ownerHeight||t.scrollY or "),o.push(e))});var r=!1;o.length&&o[0].type.__TableColumnGroup__&&(r=!0),t&&(void 0!==e.width&&e.width!==t.width||void 0!==e.height&&e.height!==t.height||void 0!==e.maxWidth&&e.maxWidth!==t.maxWidth||void 0!==e.maxHeight&&e.maxHeight!==t.maxHeight)&&(t=null);var i,s,a=t&&t.firstRowIndex||0,l=t&&t.firstRowOffset||0;i=t&&"hidden"!==e.overflowX?t.scrollX:e.scrollLeft,t&&"hidden"!==e.overflowY?s=t.scrollY:(f=this._scrollHelper.scrollTo(e.scrollTop),a=f.index,l=f.offset,s=f.position),void 0!==this._rowToScrollTo&&(f=this._scrollHelper.scrollRowIntoView(this._rowToScrollTo),a=f.index,l=f.offset,s=f.position,delete this._rowToScrollTo);var c=r?e.groupHeaderHeight:0;if(t&&e.rowsCount!==t.rowsCount){var h=(void 0===e.height?e.maxHeight:e.height)-(e.headerHeight||0)-(e.footerHeight||0)-(e.groupHeaderHeight||0);this._scrollHelper=new p(e.rowsCount,e.rowHeight,h,e.rowHeightGetter);var f=this._scrollHelper.scrollToRow(a,l);a=f.index,l=f.offset,s=f.position}else t&&e.rowHeightGetter!==t.rowHeightGetter&&this._scrollHelper.setRowHeightGetter(e.rowHeightGetter);var m;m=e.isColumnResizing?t&&t.columnResizingData:C;var v,_;if(r){var y=d.adjustColumnGroupWidths(o,e.width);v=y.columns,_=y.columnGroups}else v=d.adjustColumnWidths(o,e.width);var w=this._populateColumnsAndColumnData(v,_,t);if(void 0!==this._columnToScrollTo){var b=w.bodyFixedColumns.length;if(this._columnToScrollTo>=b){var E,D,T=0;for(E=0;EO&&(i=O)}delete this._columnToScrollTo}var k=void 0===e.height,P=Math.round(k?e.maxHeight:e.height),I=e.footerHeight+e.headerHeight+c+2*R,z=P-I,j=this._scrollHelper.getContentHeight(),A=j+I,F=d.getTotalWidth(v),L=F>e.width&&"hidden"!==e.overflowX;L&&(z-=u.SIZE,A+=u.SIZE,I+=u.SIZE);var G=Math.max(0,F-e.width),W=Math.max(0,j-z);i=Math.min(i,G),s=Math.min(s,W),W||(k&&(P=A),z=A-I),this._scrollHelper.setViewportHeight(z);var V=n({isColumnResizing:t&&t.isColumnResizing},w,e,{columns:v,columnGroups:_,columnResizingData:m,firstRowIndex:a,firstRowOffset:l,horizontalScrollbarVisible:L,maxScrollX:G,maxScrollY:W,reservedHeight:I,scrollContentHeight:j,scrollX:i,scrollY:s,bodyHeight:z,height:P,groupHeaderHeight:c,useGroupHeader:r});return V},_selectColumnElement:function(e,t){for(var o=[],n=0;nMath.abs(e)&&"hidden"!==this.props.overflowY){var n=this._scrollHelper.scrollBy(Math.round(t)),r=Math.max(0,n.contentHeight-this.state.bodyHeight);this.setState({firstRowIndex:n.index,firstRowOffset:n.offset,scrollY:n.position,scrollContentHeight:n.contentHeight,maxScrollY:r})}else e&&"hidden"!==this.props.overflowX&&(o+=e,o=o<0?0:o,o=o>this.state.maxScrollX?this.state.maxScrollX:o,this.setState({scrollX:o}));this._didScrollStop()}},_onHorizontalScroll:function(e){this._isMounted&&e!==this.state.scrollX&&(this._isScrolling||this._didScrollStart(),this.setState({scrollX:e}),this._didScrollStop())},_onVerticalScroll:function(e){if(this._isMounted&&e!==this.state.scrollY){this._isScrolling||this._didScrollStart();var t=this._scrollHelper.scrollTo(Math.round(e));this.setState({firstRowIndex:t.index,firstRowOffset:t.offset,scrollY:t.position,scrollContentHeight:t.contentHeight}),this._didScrollStop()}},_didScrollStart:function(){this._isMounted&&!this._isScrolling&&(this._isScrolling=!0,this.props.onScrollStart&&this.props.onScrollStart(this.state.scrollX,this.state.scrollY))},_didScrollStop:function(){this._isMounted&&this._isScrolling&&(this._isScrolling=!1,this.setState({redraw:!0}),this.props.onScrollEnd&&this.props.onScrollEnd(this.state.scrollX,this.state.scrollY))}}),O=s({displayName:"HorizontalScrollbar",mixins:[a],propTypes:{contentSize:r.number.isRequired,offset:r.number.isRequired,onScroll:r.func.isRequired,position:r.number.isRequired,size:r.number.isRequired},render:function(){var e={height:u.SIZE,width:this.props.size},t={height:u.SIZE,position:"absolute",overflow:"hidden",width:this.props.size};return b(t,0,this.props.offset),i.createElement("div",{className:y(m("fixedDataTableLayout/horizontalScrollbar"),m("public/fixedDataTable/horizontalScrollbar")),style:e},i.createElement("div",{style:t},i.createElement(u,n({},this.props,{isOpaque:!0,orientation:"horizontal",offset:void 0}))))}});e.exports=S},function(e,t,o){"use strict";var n=o(35),r=o(38);if("undefined"==typeof n)throw Error("create-react-class could not find the React object. If you are using script tags, make sure that React is being loaded before create-react-class.");var i=(new n.Component).updater;e.exports=r(n.Component,n.isValidElement,i)},function(e,t,o){(function(t){"use strict";function n(e){return e}function r(e,o,r){function h(e,o,n){for(var r in o)o.hasOwnProperty(r)&&"production"!==t.env.NODE_ENV&&l("function"==typeof o[r],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",e.displayName||"ReactClass",u[n],r)}function f(e,t){var o=x.hasOwnProperty(t)?x[t]:null;T.hasOwnProperty(t)&&a("OVERRIDE_BASE"===o,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&a("DEFINE_MANY"===o||"DEFINE_MANY_MERGED"===o,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t); }function p(e,n){if(n){a("function"!=typeof n,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),a(!o(n),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=e.prototype,i=r.__reactAutoBindPairs;n.hasOwnProperty(c)&&R.mixins(e,n.mixins);for(var s in n)if(n.hasOwnProperty(s)&&s!==c){var u=n[s],h=r.hasOwnProperty(s);if(f(h,s),R.hasOwnProperty(s))R[s](e,u);else{var p=x.hasOwnProperty(s),d="function"==typeof u,m=d&&!p&&!h&&n.autobind!==!1;if(m)i.push(s,u),r[s]=u;else if(h){var g=x[s];a(p&&("DEFINE_MANY_MERGED"===g||"DEFINE_MANY"===g),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",g,s),"DEFINE_MANY_MERGED"===g?r[s]=v(r[s],u):"DEFINE_MANY"===g&&(r[s]=_(r[s],u))}else r[s]=u,"production"!==t.env.NODE_ENV&&"function"==typeof u&&n.displayName&&(r[s].displayName=n.displayName+"_"+s)}}}else if("production"!==t.env.NODE_ENV){var y=typeof n,w="object"===y&&null!==n;"production"!==t.env.NODE_ENV&&l(w,"%s: You're attempting to include a mixin that is either null or not an object. Check the mixins included by the component, as well as any mixins they include themselves. Expected object but got %s.",e.displayName||"ReactClass",null===n?null:y)}}function d(e,t){if(t)for(var o in t){var n=t[o];if(t.hasOwnProperty(o)){var r=o in R;a(!r,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',o);var i=o in e;if(i){var s=C.hasOwnProperty(o)?C[o]:null;return a("DEFINE_MANY_MERGED"===s,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",o),void(e[o]=v(e[o],n))}e[o]=n}}}function m(e,t){a(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var o in t)t.hasOwnProperty(o)&&(a(void 0===e[o],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",o),e[o]=t[o]);return e}function v(e,t){return function(){var o=e.apply(this,arguments),n=t.apply(this,arguments);if(null==o)return n;if(null==n)return o;var r={};return m(r,o),m(r,n),r}}function _(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function g(e,o){var n=o.bind(e);if("production"!==t.env.NODE_ENV){n.__reactBoundContext=e,n.__reactBoundMethod=o,n.__reactBoundArguments=null;var r=e.constructor.displayName,i=n.bind;n.bind=function(s){for(var a=arguments.length,u=Array(a>1?a-1:0),c=1;c1?t-1:0),n=1;n2?o-2:0),r=2;rn},ie64:function(){return y.ie()&&p},firefox:function(){return o()||r},opera:function(){return o()||i},webkit:function(){return o()||s},safari:function(){return y.webkit()},chrome:function(){return o()||a},windows:function(){return o()||c},osx:function(){return o()||u},linux:function(){return o()||h},iphone:function(){return o()||d},mobile:function(){return o()||d||m||f||_},nativeApp:function(){return o()||v},android:function(){return o()||f},ipad:function(){return o()||m}};e.exports=y},function(e,t,o){"use strict";function n(e,t){if(!i.canUseDOM||t&&!("addEventListener"in document))return!1;var o="on"+e,n=o in document;if(!n){var s=document.createElement("div");s.setAttribute(o,"return;"),n="function"==typeof s[o]}return!n&&r&&"wheel"===e&&(n=document.implementation.hasFeature("Events.wheel","3.0")),n}var r,i=o(49);i.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),e.exports=n},function(e,t){"use strict";var o=!("undefined"==typeof window||!window.document||!window.document.createElement),n={canUseDOM:o,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:o&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:o&&!!window.screen,isInWorker:!o};e.exports=n},function(e,t,o){(function(t){"use strict";var n=o(45),r=o(51),i=0,s=r||function(e){var o=Date.now(),n=Math.max(0,16-(o-i));return i=o+n,t.setTimeout(function(){e(Date.now())},n)};s(n),e.exports=s}).call(t,function(){return this}())},function(e,t){(function(t){"use strict";var o=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame;e.exports=o}).call(t,function(){return this}())},function(e,t,o){"use strict";var n=o(53),r=o(56),i=o(27),s=o(34),a=o(37),l=o(57),u=o(43),c=o(44),h=o(59),f=o(60),p=o(45),d=o(61),m={position:0,scrollable:!1},v=parseInt(h("scrollbar-face-margin"),10),_=2*v,g=30,y=40,w=null,b=a({displayName:"Scrollbar",mixins:[u],propTypes:{contentSize:i.number.isRequired,defaultPosition:i.number,isOpaque:i.bool,orientation:i.oneOf(["vertical","horizontal"]),onScroll:i.func,position:i.number,size:i.number.isRequired,trackColor:i.oneOf(["gray"]),zIndex:i.number,verticalTop:i.number},getInitialState:function(){var e=this.props;return this._calculateState(e.position||e.defaultPosition||0,e.size,e.contentSize,e.orientation)},componentWillReceiveProps:function(e){var t=e.position;void 0===t?this._setNextState(this._calculateState(this.state.position,e.size,e.contentSize,e.orientation)):this._setNextState(this._calculateState(t,e.size,e.contentSize,e.orientation),e)},getDefaultProps:function(){return{defaultPosition:0,isOpaque:!1,onScroll:p,orientation:"vertical",zIndex:99}},render:function(){if(!this.state.scrollable)return null;var e,t,o=this.props.size,n=this.state.isHorizontal,r=!n,i=this.state.focused||this.state.isDragging,a=this.state.faceSize,l=this.props.isOpaque,u=this.props.verticalTop||0,c=f({"ScrollbarLayout/main":!0,"ScrollbarLayout/mainVertical":r,"ScrollbarLayout/mainHorizontal":n,"public/Scrollbar/main":!0,"public/Scrollbar/mainOpaque":l,"public/Scrollbar/mainActive":i}),p=f({"ScrollbarLayout/face":!0,"ScrollbarLayout/faceHorizontal":n,"ScrollbarLayout/faceVertical":r,"public/Scrollbar/faceActive":i,"public/Scrollbar/face":!0}),m=this.state.position*this.state.scale+v;return n?(e={width:o},t={width:a-_},d(t,m,0)):(e={top:u,height:o},t={height:a-_},d(t,0,m)),e.zIndex=this.props.zIndex,"gray"===this.props.trackColor&&(e.backgroundColor=h("fbui-desktop-background-light")),s.createElement("div",{onFocus:this._onFocus,onBlur:this._onBlur,onKeyDown:this._onKeyDown,onMouseDown:this._onMouseDown,onWheel:this._wheelHandler.onWheel,className:c,style:e,tabIndex:0},s.createElement("div",{ref:"face",className:p,style:t}))},componentWillMount:function(){var e="horizontal"===this.props.orientation,t=e?this._onWheelX:this._onWheelY;this._wheelHandler=new c(t,this._shouldHandleX,this._shouldHandleY)},componentDidMount:function(){this._mouseMoveTracker=new n(this._onMouseMove,this._onMouseMoveEnd,document.documentElement),void 0!==this.props.position&&this.state.position!==this.props.position&&this._didScroll(),this._isMounted=!0},componentWillUnmount:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),w===this&&(w=null),delete this._mouseMoveTracker,this._isMounted=!1},scrollBy:function(e){this._onWheel(e)},_shouldHandleX:function(e){return"horizontal"===this.props.orientation&&this._shouldHandleChange(e)},_shouldHandleY:function(e){return"horizontal"!==this.props.orientation&&this._shouldHandleChange(e)},_shouldHandleChange:function(e){var t=this._calculateState(this.state.position+e,this.props.size,this.props.contentSize,this.props.orientation);return t.position!==this.state.position},_calculateState:function(e,t,o,n){if(t<1||o<=t)return m;var r=e+"_"+t+"_"+o+"_"+n;if(this._stateKey===r)return this._stateForKey;var i="horizontal"===n,s=t/o,a=t*s;au&&(e=u);var c=!!this._mouseMoveTracker&&this._mouseMoveTracker.isDragging(),h={faceSize:a,isDragging:c,isHorizontal:i,position:e,scale:s,scrollable:l};return this._stateKey=r,this._stateForKey=h,h},_onWheelY:function(e,t){this._onWheel(t)},_onWheelX:function(e,t){this._onWheel(e)},_onWheel:function(e){var t=this.props;this._setNextState(this._calculateState(this.state.position+e,t.size,t.contentSize,t.orientation))},_onMouseDown:function(e){var t;if(e.target!==l.findDOMNode(this.refs.face)){var o=e.nativeEvent,n=this.state.isHorizontal?o.offsetX||o.layerX:o.offsetY||o.layerY,r=this.props;n/=this.state.scale,t=this._calculateState(n-.5*this.state.faceSize/this.state.scale,r.size,r.contentSize,r.orientation)}else t={};t.focused=!0,this._setNextState(t),this._mouseMoveTracker.captureMouseMoves(e),l.findDOMNode(this).focus()},_onMouseMove:function(e,t){var o=this.props,n=this.state.isHorizontal?e:t;n/=this.state.scale,this._setNextState(this._calculateState(this.state.position+n,o.size,o.contentSize,o.orientation))},_onMouseMoveEnd:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),this.setState({isDragging:!1})},_onKeyDown:function(e){var t=e.keyCode;if(t!==r.TAB){var o=y,n=0;if(this.state.isHorizontal)switch(t){case r.HOME:n=-1,o=this.props.contentSize;break;case r.LEFT:n=-1;break;case r.RIGHT:n=1;break;default:return}if(!this.state.isHorizontal)switch(t){case r.SPACE:n=e.shiftKey?-1:1;break;case r.HOME:n=-1,o=this.props.contentSize;break;case r.UP:n=-1;break;case r.DOWN:n=1;break;case r.PAGE_UP:n=-1,o=this.props.size;break;case r.PAGE_DOWN:n=1,o=this.props.size;break;default:return}e.preventDefault();var i=this.props;this._setNextState(this._calculateState(this.state.position+o*n,i.size,i.contentSize,i.orientation))}},_onFocus:function(){this.setState({focused:!0})},_onBlur:function(){this.setState({focused:!1})},_blur:function(){if(this._isMounted)try{this._onBlur(),l.findDOMNode(this).blur()}catch(e){}},_setNextState:function(e,t){t=t||this.props;var o=t.position,n=this.state.position!==e.position;if(void 0===o){var r=n?this._didScroll:void 0;this.setState(e,r)}else{if(o!==e.position)return void(void 0!==e.position&&e.position!==this.state.position&&this.props.onScroll(e.position));this.setState(e)}n&&w!==this&&(w&&w._blur(),w=this)},_didScroll:function(){this.props.onScroll(this.state.position)}});b.KEYBOARD_SCROLL_AMOUNT=y,b.SIZE=parseInt(h("scrollbar-size"),10),e.exports=b},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var o=0;o0;)this._addRowToBuffer(t,this._viewportRowsBegin,this._viewportRowsEnd-1),t++,e--;return this._rows}},{key:"getRows",value:function(e,t){var o=t,n=o,r=e,i=Math.min(e+this._maxVisibleRowCount,this._rowsCount);for(this._viewportRowsBegin=e;r=i&&(n=this._bufferSet.replaceFurthestValuePosition(t,o,e)),null===n?(n=this._bufferSet.getNewPositionForValue(e),this._rows[n]=e):this._rows[n]=e}}]),e}();e.exports=c},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var o=0;o=e&&r<=t)return null;var i;e-n>r-t?(i=n,this._smallValues.pop()):(i=r,this._largeValues.pop());var a=this._valueToPositionMap[i];return delete this._valueToPositionMap[i],this._valueToPositionMap[o]=a,this._pushToHeaps(a,o),a}},{key:"_pushToHeaps",value:function(e,t){var o={position:e,value:t};this._smallValues.push(o),this._largeValues.push(o)}},{key:"_cleanHeaps",value:function(){this._cleanHeap(this._smallValues),this._cleanHeap(this._largeValues);var e=Math.min(this._smallValues.size(),this._largeValues.size()),t=Math.max(this._smallValues.size(),this._largeValues.size());t>10*e&&this._recreateHeaps()}},{key:"_recreateHeaps",value:function(){for(var e=this._smallValues.size()t.value}}]),e}();e.exports=a},function(e,t){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){return e0&&(this._items[0]=t,this._sinkDown(0)),e}}},{key:"push",value:function(e){this._items[this._size++]=e,this._bubbleUp(this._size-1)}},{key:"size",value:function(){return this._size}},{key:"peek",value:function(){if(0!==this._size)return this._items[0]}},{key:"_heapify",value:function(){for(var e=Math.floor((this._size+1)/2);e>=0;e--)this._sinkDown(e)}},{key:"_bubbleUp",value:function(e){for(var t=this._items[e];e>0;){var o=Math.floor((e+1)/2)-1,n=this._items[o];if(this._comparator(n,t))return;this._items[o]=t,this._items[e]=n,e=o}}},{key:"_sinkDown",value:function(e){for(var t=this._items[e];;){var o=2*(e+1)-1,n=2*(e+1),r=-1;if(oo?o:e}e.exports=o},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=Object.assign||function(e){for(var t=1;t0){var o=h({"fixedDataTableRowLayout/fixedColumnsDivider":!0,"fixedDataTableRowLayout/columnsShadow":e.props.scrollLeft>0,"public/fixedDataTableRow/fixedColumnsDivider":!0,"public/fixedDataTableRow/columnsShadow":e.props.scrollLeft>0}),n={left:t,height:e.props.height};return u.createElement("div",{className:o,style:n})}},this._onClick=function(t){e.props.onClick(t,e.props.index)},this._onDoubleClick=function(t){e.props.onDoubleClick(t,e.props.index)},this._onMouseDown=function(t){e.props.onMouseDown(t,e.props.index)},this._onMouseEnter=function(t){e.props.onMouseEnter(t,e.props.index)},this._onMouseLeave=function(t){e.props.onMouseLeave(t,e.props.index)}}return r(t,e),s(t,[{key:"render",value:function(){var e={width:this.props.width,height:this.props.height},t=h({"fixedDataTableRowLayout/main":!0,"public/fixedDataTableRow/main":!0,"public/fixedDataTableRow/highlighted":this.props.index%2===1,"public/fixedDataTableRow/odd":this.props.index%2===1,"public/fixedDataTableRow/even":this.props.index%2===0}),o=this._getColumnsWidth(this.props.fixedColumns),n=u.createElement(c,{key:"fixed_cells",isScrolling:this.props.isScrolling,height:this.props.height,left:0,width:o,zIndex:2,columns:this.props.fixedColumns,onColumnResize:this.props.onColumnResize,rowHeight:this.props.height,rowIndex:this.props.index}),r=this._renderColumnsShadow(o),i=u.createElement(c,{key:"scrollable_cells",isScrolling:this.props.isScrolling,height:this.props.height,left:this.props.scrollLeft,offsetLeft:o,width:this.props.width-o,zIndex:0,columns:this.props.scrollableColumns,onColumnResize:this.props.onColumnResize,rowHeight:this.props.height,rowIndex:this.props.index});return u.createElement("div",{className:f(t,this.props.className),onClick:this.props.onClick?this._onClick:null,onDoubleClick:this.props.onDoubleClick?this._onDoubleClick:null,onMouseDown:this.props.onMouseDown?this._onMouseDown:null,onMouseEnter:this.props.onMouseEnter?this._onMouseEnter:null,onMouseLeave:this.props.onMouseLeave?this._onMouseLeave:null,style:e},u.createElement("div",{className:h("fixedDataTableRowLayout/body")},n,i,r))}}],[{key:"propTypes",value:{isScrolling:l.bool,fixedColumns:l.array.isRequired,height:l.number.isRequired,index:l.number.isRequired,scrollableColumns:l.array.isRequired,scrollLeft:l.number.isRequired,width:l.number.isRequired,onClick:l.func,onDoubleClick:l.func,onColumnResize:l.func},enumerable:!0}]),t}(u.Component),m=function(e){function t(){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return r(t,e),s(t,[{key:"render",value:function(){var e={width:this.props.width,height:this.props.height,zIndex:this.props.zIndex?this.props.zIndex:0};return p(e,0,this.props.offsetTop),u.createElement("div",{style:e,className:h("fixedDataTableRowLayout/rowWrapper")},u.createElement(d,i({},this.props,{offsetTop:void 0,zIndex:void 0})))}}],[{key:"propTypes",value:{isScrolling:l.bool,height:l.number.isRequired,zIndex:l.number,offsetTop:l.number.isRequired,width:l.number.isRequired},enumerable:!0}]),t}(u.Component);e.exports=m},function(e,t,o){"use strict";function n(e,t){var o={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}var r=Object.assign||function(e){for(var t=1;t=0){var l="cell_"+r;o[r]=this._renderCell(e.rowIndex,e.rowHeight,s,n,l)}n+=s.width}var u=this._getColumnsWidth(t),p={height:e.height,position:"absolute",width:u,zIndex:e.zIndex};return h(p,-1*f*e.left,0),a.createElement("div",{className:c("fixedDataTableCellGroupLayout/cellGroup"),style:p},o)},_renderCell:function(e,t,o,n,r){var i=o.isResizable&&this.props.onColumnResize,s=i?this.props.onColumnResize:null,l=o.cellClassName;return a.createElement(u,{isScrolling:this.props.isScrolling,align:o.align,className:l,height:t,key:r,maxWidth:o.maxWidth,minWidth:o.minWidth,onColumnResize:s,rowIndex:e,columnKey:o.columnKey,width:o.width,left:n,cell:o.cell})},_getColumnsWidth:function(e){for(var t=0,o=0;o=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}var r=o(78),i=o(73),s=o(27),a=o(34),l=o(37),u=o(60),c=o(79),h=i.DIR_SIGN,f={align:"left",highlighted:!1},p=l({displayName:"FixedDataTableCell",propTypes_DISABLED_FOR_PERFORMANCE:{isScrolling:s.bool,align:s.oneOf(["left","center","right"]),className:s.string,highlighted:s.bool,width:s.number.isRequired,minWidth:s.number,maxWidth:s.number,height:s.number.isRequired,cell:s.oneOfType([s.string,s.element,s.func]),columnKey:s.oneOfType([s.string,s.number]),rowIndex:s.number.isRequired,onColumnResize:s.func,left:s.number},shouldComponentUpdate:function(e){return!e.isScrolling||this.props.rowIndex!==e.rowIndex},getDefaultProps:function(){return f},render:function(){var e=this.props,t=e.height,o=e.width,i=e.columnKey,s=n(e,["height","width","columnKey"]),l={height:t,width:o};1===h?l.left=s.left:l.right=s.left;var f,p=c(u({"fixedDataTableCellLayout/main":!0,"fixedDataTableCellLayout/lastChild":s.lastChild,"fixedDataTableCellLayout/alignRight":"right"===s.align,"fixedDataTableCellLayout/alignCenter":"center"===s.align,"public/fixedDataTableCell/alignRight":"right"===s.align,"public/fixedDataTableCell/highlighted":s.highlighted,"public/fixedDataTableCell/main":!0}),s.className);if(s.onColumnResize){var d={height:t};f=a.createElement("div",{className:u("fixedDataTableCellLayout/columnResizerContainer"),style:d,onMouseDown:this._onColumnResizerMouseDown},a.createElement("div",{className:c(u("fixedDataTableCellLayout/columnResizerKnob"),u("public/fixedDataTableCell/columnResizerKnob")),style:d}))}var m={columnKey:i,height:t,width:o};s.rowIndex>=0&&(m.rowIndex=s.rowIndex);var v;return v=a.isValidElement(s.cell)?a.cloneElement(s.cell,m):"function"==typeof s.cell?s.cell(m):a.createElement(r,m,s.cell),a.createElement("div",{className:p,style:l},f,v)},_onColumnResizerMouseDown:function(e){this.props.onColumnResize(this.props.left,this.props.width,this.props.minWidth,this.props.maxWidth,this.props.columnKey,e)}});e.exports=p},function(e,t,o){"use strict";function n(e,t){var o={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=Object.assign||function(e){for(var t=1;t1)for(var n=1;n=0&&t>=e-a;){var o=this._updateRowHeight(t);this._position+=o,t--}}},{key:"_updateRowHeight",value:function(e){if(e<0||e>=this._rowCount)return 0;var t=this._rowHeightGetter(e);if(t!==this._storedHeights[e]){var o=t-this._storedHeights[e];return this._rowOffsets.set(e,t),this._storedHeights[e]=t,this._contentHeight+=o,o}return 0}},{key:"getRowPosition",value:function(e){return this._updateRowHeight(e),this._rowOffsets.sumUntil(e)}},{key:"scrollBy",value:function(e){if(0===this._rowCount)return l;var t=this._rowOffsets.greatestLowerBound(this._position);t=s(t,0,Math.max(this._rowCount-1,0));var o=this._rowOffsets.sumUntil(t),n=t,r=this._position,i=this._updateRowHeight(n);0!==o&&(r+=i);var a=this._storedHeights[n]-(r-o);if(e>=0)for(;e>0&&n0&&n>=0;)if(e=0){var c=this._updateRowHeight(n);u=this._storedHeights[n],r+=c}}var h=this._contentHeight-this._viewportHeight;r=s(r,0,h),this._position=r;var f=this._rowOffsets.greatestLowerBound(r);f=s(f,0,Math.max(this._rowCount-1,0)),o=this._rowOffsets.sumUntil(f);var p=o-r;return this._updateHeightsInViewport(f,p),this._updateHeightsAboveViewport(f),{index:f,offset:p,position:this._position,contentHeight:this._contentHeight}}},{key:"_getRowAtEndPosition",value:function(e){this._updateRowHeight(e);for(var t=e,o=this._storedHeights[t];o=0;)t--,t>=0&&(this._updateRowHeight(t),o+=this._storedHeights[t]);var n=this._rowOffsets.sumTo(e)-this._viewportHeight;return n<0&&(n=0),n}},{key:"scrollTo",value:function(e){if(0===this._rowCount)return l;if(e<=0)return this._position=0,this._updateHeightsInViewport(0,0),{index:0,offset:0,position:this._position,contentHeight:this._contentHeight};if(e>=this._contentHeight-this._viewportHeight){var t=this._rowCount-1;e=this._getRowAtEndPosition(t)}this._position=e;var o=this._rowOffsets.greatestLowerBound(e);o=s(o,0,Math.max(this._rowCount-1,0));var n=this._rowOffsets.sumUntil(o),r=n-e;return this._updateHeightsInViewport(o,r),this._updateHeightsAboveViewport(o),{index:o,offset:r,position:this._position,contentHeight:this._contentHeight}}},{key:"scrollToRow",value:function(e,t){e=s(e,0,Math.max(this._rowCount-1,0)),t=s(t,-this._storedHeights[e],0);var o=this._rowOffsets.sumUntil(e);return this.scrollTo(o-t)}},{key:"scrollRowIntoView",value:function(e){e=s(e,0,Math.max(this._rowCount-1,0));var t=this._rowOffsets.sumUntil(e),o=t+this._storedHeights[e];if(t=0;--o)t[o]=0;return t},u=function(){function e(t){n(this,e),this._size=t.length,this._half=r(this._size),this._heap=new l(2*this._half);var o;for(o=0;o0;--o)this._heap[o]=this._heap[2*o]+this._heap[2*o+1]}return i(e,[{key:"set",value:function(e,t){s(0<=e&&e=0;--r)n[r]=o;return new e(n)}},{key:"empty",value:function(t){return e.uniform(t,0)}}]),e}();e.exports=u}).call(t,function(){return this}())},function(e,t,o){"use strict";function n(e){for(var t=0,o=0;o Date: Mon, 5 Nov 2018 14:10:08 -0800 Subject: [PATCH 18/43] Version 0.7.7 --- dist/fixed-data-table-base.css | 2 +- dist/fixed-data-table-base.min.css | 2 +- dist/fixed-data-table-style.css | 2 +- dist/fixed-data-table-style.min.css | 2 +- dist/fixed-data-table.css | 2 +- dist/fixed-data-table.js | 4 ++-- dist/fixed-data-table.min.css | 2 +- dist/fixed-data-table.min.js | 4 ++-- package.json | 2 +- src/FixedDataTableNew.react.js | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dist/fixed-data-table-base.css b/dist/fixed-data-table-base.css index 23e7b2ce..1b6d0ab9 100644 --- a/dist/fixed-data-table-base.css +++ b/dist/fixed-data-table-base.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.6 + * FixedDataTable v0.7.7 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table-base.min.css b/dist/fixed-data-table-base.min.css index 52d33760..e1d0bc23 100644 --- a/dist/fixed-data-table-base.min.css +++ b/dist/fixed-data-table-base.min.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.6 + * FixedDataTable v0.7.7 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table-style.css b/dist/fixed-data-table-style.css index f53e32c0..48ead796 100644 --- a/dist/fixed-data-table-style.css +++ b/dist/fixed-data-table-style.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.6 + * FixedDataTable v0.7.7 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table-style.min.css b/dist/fixed-data-table-style.min.css index 2eaedfe5..c54de2c5 100644 --- a/dist/fixed-data-table-style.min.css +++ b/dist/fixed-data-table-style.min.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.6 + * FixedDataTable v0.7.7 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table.css b/dist/fixed-data-table.css index c2979425..24fa513c 100644 --- a/dist/fixed-data-table.css +++ b/dist/fixed-data-table.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.6 + * FixedDataTable v0.7.7 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table.js b/dist/fixed-data-table.js index c3f98152..fc201b88 100644 --- a/dist/fixed-data-table.js +++ b/dist/fixed-data-table.js @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.6 + * FixedDataTable v0.7.7 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -2328,7 +2328,7 @@ return /******/ (function(modules) { // webpackBootstrap if (state.scrollY) { topShadow = React.createElement("div", { className: joinClasses(cx("fixedDataTableLayout/topShadow"), cx("public/fixedDataTable/topShadow")), - style: _extends({}, topShadowStyle, { top: bodyOffsetTop }) + style: _extends({}, props.topShadowStyle, { top: bodyOffsetTop }) }); } diff --git a/dist/fixed-data-table.min.css b/dist/fixed-data-table.min.css index 5cf99e4b..21c5fae2 100644 --- a/dist/fixed-data-table.min.css +++ b/dist/fixed-data-table.min.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.6 + * FixedDataTable v0.7.7 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table.min.js b/dist/fixed-data-table.min.js index f2dc28d4..b5670863 100644 --- a/dist/fixed-data-table.min.js +++ b/dist/fixed-data-table.min.js @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.6 + * FixedDataTable v0.7.7 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -9,7 +9,7 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.FixedDataTable=t(require("react"),require("react-dom")):e.FixedDataTable=t(e.React,e.ReactDOM)}(this,function(e,t){return function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){o(1),o(5),o(7),o(9),o(11),o(13),o(15),o(17),o(19),o(21),o(23),e.exports=o(25)},function(e,t){},,,,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t,o){"use strict";var n=o(26),r=o(78),i=o(76),s=o(75),a={Cell:r,Column:i,ColumnGroup:s,Table:n};a.version="0.7.0",e.exports=a},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e,t){}var s=Object.assign||function(e){for(var t=1;t1)for(var o=1;o0||e>=0&&this.state.scrollX0||e>=0&&this.state.scrollYn?n:this.state.height>n&&this.props.ownerHeight?Math.max(n,this.props.ownerHeight):this.state.height+this.state.maxScrollY,e!==this._contentHeight&&this.props.onContentHeightChange&&this.props.onContentHeightChange(e),this._contentHeight=e},componentDidMount:function(){this._reportContentHeight(),this._isMounted=!0},componentWillReceiveProps:function(e){var t=e.scrollToRow;void 0!==t&&null!==t&&(this._rowToScrollTo=t);var o=e.scrollToColumn;void 0!==o&&null!==o&&(this._columnToScrollTo=o);var n=e.overflowX,r=e.overflowY;n===this.props.overflowX&&r===this.props.overflowY||(this._wheelHandler=new l(this._onWheel,"hidden"!==n,"hidden"!==r)),this.props.ownerHeight===e.ownerHeight&&this.props.scrollTop===e.scrollTop||this._didScrollStart(),this._didScrollStop(),this.setState(this._calculateState(e,this.state))},componentDidUpdate:function(){this._reportContentHeight()},render:function(){var e,t=this.state,o=this.props;t.useGroupHeader&&(e=i.createElement(f,{key:"group_header",isScrolling:this._isScrolling,className:y(m("fixedDataTableLayout/header"),m("public/fixedDataTable/header")),width:t.width,height:t.groupHeaderHeight,index:0,zIndex:1,offsetTop:0,scrollLeft:t.scrollX,fixedColumns:t.groupHeaderFixedColumns,scrollableColumns:t.groupHeaderScrollableColumns,onColumnResize:this._onColumnResize}));var r=this.state.maxScrollY,s=t.maxScrollX>0&&"hidden"!==t.overflowX,a=r>0&&"hidden"!==t.overflowY,l=s?u.SIZE:0,c=t.height-l-2*R-t.footerHeight,p=t.useGroupHeader?t.groupHeaderHeight:0,d=p+t.headerHeight;c-=d;var v=0,_=null!=o.maxHeight?d+t.bodyHeight:d+c,g=_+t.footerHeight;void 0!==o.ownerHeight&&o.ownerHeightt.ownerHeight||t.scrollY or "),o.push(e))});var r=!1;o.length&&o[0].type.__TableColumnGroup__&&(r=!0),t&&(void 0!==e.width&&e.width!==t.width||void 0!==e.height&&e.height!==t.height||void 0!==e.maxWidth&&e.maxWidth!==t.maxWidth||void 0!==e.maxHeight&&e.maxHeight!==t.maxHeight)&&(t=null);var i,s,a=t&&t.firstRowIndex||0,l=t&&t.firstRowOffset||0;i=t&&"hidden"!==e.overflowX?t.scrollX:e.scrollLeft,t&&"hidden"!==e.overflowY?s=t.scrollY:(f=this._scrollHelper.scrollTo(e.scrollTop),a=f.index,l=f.offset,s=f.position),void 0!==this._rowToScrollTo&&(f=this._scrollHelper.scrollRowIntoView(this._rowToScrollTo),a=f.index,l=f.offset,s=f.position,delete this._rowToScrollTo);var c=r?e.groupHeaderHeight:0;if(t&&e.rowsCount!==t.rowsCount){var h=(void 0===e.height?e.maxHeight:e.height)-(e.headerHeight||0)-(e.footerHeight||0)-(e.groupHeaderHeight||0);this._scrollHelper=new p(e.rowsCount,e.rowHeight,h,e.rowHeightGetter);var f=this._scrollHelper.scrollToRow(a,l);a=f.index,l=f.offset,s=f.position}else t&&e.rowHeightGetter!==t.rowHeightGetter&&this._scrollHelper.setRowHeightGetter(e.rowHeightGetter);var m;m=e.isColumnResizing?t&&t.columnResizingData:C;var v,_;if(r){var y=d.adjustColumnGroupWidths(o,e.width);v=y.columns,_=y.columnGroups}else v=d.adjustColumnWidths(o,e.width);var w=this._populateColumnsAndColumnData(v,_,t);if(void 0!==this._columnToScrollTo){var b=w.bodyFixedColumns.length;if(this._columnToScrollTo>=b){var E,D,T=0;for(E=0;EO&&(i=O)}delete this._columnToScrollTo}var k=void 0===e.height,P=Math.round(k?e.maxHeight:e.height),I=e.footerHeight+e.headerHeight+c+2*R,z=P-I,j=this._scrollHelper.getContentHeight(),A=j+I,F=d.getTotalWidth(v),L=F>e.width&&"hidden"!==e.overflowX;L&&(z-=u.SIZE,A+=u.SIZE,I+=u.SIZE);var G=Math.max(0,F-e.width),W=Math.max(0,j-z);i=Math.min(i,G),s=Math.min(s,W),W||(k&&(P=A),z=A-I),this._scrollHelper.setViewportHeight(z);var V=n({isColumnResizing:t&&t.isColumnResizing},w,e,{columns:v,columnGroups:_,columnResizingData:m,firstRowIndex:a,firstRowOffset:l,horizontalScrollbarVisible:L,maxScrollX:G,maxScrollY:W,reservedHeight:I,scrollContentHeight:j,scrollX:i,scrollY:s,bodyHeight:z,height:P,groupHeaderHeight:c,useGroupHeader:r});return V},_selectColumnElement:function(e,t){for(var o=[],n=0;nMath.abs(e)&&"hidden"!==this.props.overflowY){var n=this._scrollHelper.scrollBy(Math.round(t)),r=Math.max(0,n.contentHeight-this.state.bodyHeight);this.setState({firstRowIndex:n.index,firstRowOffset:n.offset,scrollY:n.position,scrollContentHeight:n.contentHeight,maxScrollY:r})}else e&&"hidden"!==this.props.overflowX&&(o+=e,o=o<0?0:o,o=o>this.state.maxScrollX?this.state.maxScrollX:o,this.setState({scrollX:o}));this._didScrollStop()}},_onHorizontalScroll:function(e){this._isMounted&&e!==this.state.scrollX&&(this._isScrolling||this._didScrollStart(),this.setState({scrollX:e}),this._didScrollStop())},_onVerticalScroll:function(e){if(this._isMounted&&e!==this.state.scrollY){this._isScrolling||this._didScrollStart();var t=this._scrollHelper.scrollTo(Math.round(e));this.setState({firstRowIndex:t.index,firstRowOffset:t.offset,scrollY:t.position,scrollContentHeight:t.contentHeight}),this._didScrollStop()}},_didScrollStart:function(){this._isMounted&&!this._isScrolling&&(this._isScrolling=!0,this.props.onScrollStart&&this.props.onScrollStart(this.state.scrollX,this.state.scrollY))},_didScrollStop:function(){this._isMounted&&this._isScrolling&&(this._isScrolling=!1,this.setState({redraw:!0}),this.props.onScrollEnd&&this.props.onScrollEnd(this.state.scrollX,this.state.scrollY))}}),O=s({displayName:"HorizontalScrollbar",mixins:[a],propTypes:{contentSize:r.number.isRequired,offset:r.number.isRequired,onScroll:r.func.isRequired,position:r.number.isRequired,size:r.number.isRequired},render:function(){var e={height:u.SIZE,width:this.props.size},t={height:u.SIZE,position:"absolute",overflow:"hidden",width:this.props.size};return b(t,0,this.props.offset),i.createElement("div",{className:y(m("fixedDataTableLayout/horizontalScrollbar"),m("public/fixedDataTable/horizontalScrollbar")),style:e},i.createElement("div",{style:t},i.createElement(u,n({},this.props,{isOpaque:!0,orientation:"horizontal",offset:void 0}))))}});e.exports=S},function(e,t,o){"use strict";var n=o(35),r=o(38);if("undefined"==typeof n)throw Error("create-react-class could not find the React object. If you are using script tags, make sure that React is being loaded before create-react-class.");var i=(new n.Component).updater;e.exports=r(n.Component,n.isValidElement,i)},function(e,t,o){(function(t){"use strict";function n(e){return e}function r(e,o,r){function h(e,o,n){for(var r in o)o.hasOwnProperty(r)&&"production"!==t.env.NODE_ENV&&l("function"==typeof o[r],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",e.displayName||"ReactClass",u[n],r)}function f(e,t){var o=x.hasOwnProperty(t)?x[t]:null;T.hasOwnProperty(t)&&a("OVERRIDE_BASE"===o,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&a("DEFINE_MANY"===o||"DEFINE_MANY_MERGED"===o,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t); +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.FixedDataTable=t(require("react"),require("react-dom")):e.FixedDataTable=t(e.React,e.ReactDOM)}(this,function(e,t){return function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){o(1),o(5),o(7),o(9),o(11),o(13),o(15),o(17),o(19),o(21),o(23),e.exports=o(25)},function(e,t){},,,,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t,o){"use strict";var n=o(26),r=o(78),i=o(76),s=o(75),a={Cell:r,Column:i,ColumnGroup:s,Table:n};a.version="0.7.0",e.exports=a},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e,t){}var s=Object.assign||function(e){for(var t=1;t1)for(var o=1;o0||e>=0&&this.state.scrollX0||e>=0&&this.state.scrollYn?n:this.state.height>n&&this.props.ownerHeight?Math.max(n,this.props.ownerHeight):this.state.height+this.state.maxScrollY,e!==this._contentHeight&&this.props.onContentHeightChange&&this.props.onContentHeightChange(e),this._contentHeight=e},componentDidMount:function(){this._reportContentHeight(),this._isMounted=!0},componentWillReceiveProps:function(e){var t=e.scrollToRow;void 0!==t&&null!==t&&(this._rowToScrollTo=t);var o=e.scrollToColumn;void 0!==o&&null!==o&&(this._columnToScrollTo=o);var n=e.overflowX,r=e.overflowY;n===this.props.overflowX&&r===this.props.overflowY||(this._wheelHandler=new l(this._onWheel,"hidden"!==n,"hidden"!==r)),this.props.ownerHeight===e.ownerHeight&&this.props.scrollTop===e.scrollTop||this._didScrollStart(),this._didScrollStop(),this.setState(this._calculateState(e,this.state))},componentDidUpdate:function(){this._reportContentHeight()},render:function(){var e,t=this.state,o=this.props;t.useGroupHeader&&(e=i.createElement(f,{key:"group_header",isScrolling:this._isScrolling,className:y(m("fixedDataTableLayout/header"),m("public/fixedDataTable/header")),width:t.width,height:t.groupHeaderHeight,index:0,zIndex:1,offsetTop:0,scrollLeft:t.scrollX,fixedColumns:t.groupHeaderFixedColumns,scrollableColumns:t.groupHeaderScrollableColumns,onColumnResize:this._onColumnResize}));var r=this.state.maxScrollY,s=t.maxScrollX>0&&"hidden"!==t.overflowX,a=r>0&&"hidden"!==t.overflowY,l=s?u.SIZE:0,c=t.height-l-2*R-t.footerHeight,p=t.useGroupHeader?t.groupHeaderHeight:0,d=p+t.headerHeight;c-=d;var v=0,_=null!=o.maxHeight?d+t.bodyHeight:d+c,g=_+t.footerHeight;void 0!==o.ownerHeight&&o.ownerHeightt.ownerHeight||t.scrollY or "),o.push(e))});var r=!1;o.length&&o[0].type.__TableColumnGroup__&&(r=!0),t&&(void 0!==e.width&&e.width!==t.width||void 0!==e.height&&e.height!==t.height||void 0!==e.maxWidth&&e.maxWidth!==t.maxWidth||void 0!==e.maxHeight&&e.maxHeight!==t.maxHeight)&&(t=null);var i,s,a=t&&t.firstRowIndex||0,l=t&&t.firstRowOffset||0;i=t&&"hidden"!==e.overflowX?t.scrollX:e.scrollLeft,t&&"hidden"!==e.overflowY?s=t.scrollY:(f=this._scrollHelper.scrollTo(e.scrollTop),a=f.index,l=f.offset,s=f.position),void 0!==this._rowToScrollTo&&(f=this._scrollHelper.scrollRowIntoView(this._rowToScrollTo),a=f.index,l=f.offset,s=f.position,delete this._rowToScrollTo);var c=r?e.groupHeaderHeight:0;if(t&&e.rowsCount!==t.rowsCount){var h=(void 0===e.height?e.maxHeight:e.height)-(e.headerHeight||0)-(e.footerHeight||0)-(e.groupHeaderHeight||0);this._scrollHelper=new p(e.rowsCount,e.rowHeight,h,e.rowHeightGetter);var f=this._scrollHelper.scrollToRow(a,l);a=f.index,l=f.offset,s=f.position}else t&&e.rowHeightGetter!==t.rowHeightGetter&&this._scrollHelper.setRowHeightGetter(e.rowHeightGetter);var m;m=e.isColumnResizing?t&&t.columnResizingData:C;var v,_;if(r){var y=d.adjustColumnGroupWidths(o,e.width);v=y.columns,_=y.columnGroups}else v=d.adjustColumnWidths(o,e.width);var w=this._populateColumnsAndColumnData(v,_,t);if(void 0!==this._columnToScrollTo){var b=w.bodyFixedColumns.length;if(this._columnToScrollTo>=b){var E,D,T=0;for(E=0;EO&&(i=O)}delete this._columnToScrollTo}var k=void 0===e.height,P=Math.round(k?e.maxHeight:e.height),I=e.footerHeight+e.headerHeight+c+2*R,z=P-I,j=this._scrollHelper.getContentHeight(),A=j+I,F=d.getTotalWidth(v),L=F>e.width&&"hidden"!==e.overflowX;L&&(z-=u.SIZE,A+=u.SIZE,I+=u.SIZE);var G=Math.max(0,F-e.width),W=Math.max(0,j-z);i=Math.min(i,G),s=Math.min(s,W),W||(k&&(P=A),z=A-I),this._scrollHelper.setViewportHeight(z);var V=n({isColumnResizing:t&&t.isColumnResizing},w,e,{columns:v,columnGroups:_,columnResizingData:m,firstRowIndex:a,firstRowOffset:l,horizontalScrollbarVisible:L,maxScrollX:G,maxScrollY:W,reservedHeight:I,scrollContentHeight:j,scrollX:i,scrollY:s,bodyHeight:z,height:P,groupHeaderHeight:c,useGroupHeader:r});return V},_selectColumnElement:function(e,t){for(var o=[],n=0;nMath.abs(e)&&"hidden"!==this.props.overflowY){var n=this._scrollHelper.scrollBy(Math.round(t)),r=Math.max(0,n.contentHeight-this.state.bodyHeight);this.setState({firstRowIndex:n.index,firstRowOffset:n.offset,scrollY:n.position,scrollContentHeight:n.contentHeight,maxScrollY:r})}else e&&"hidden"!==this.props.overflowX&&(o+=e,o=o<0?0:o,o=o>this.state.maxScrollX?this.state.maxScrollX:o,this.setState({scrollX:o}));this._didScrollStop()}},_onHorizontalScroll:function(e){this._isMounted&&e!==this.state.scrollX&&(this._isScrolling||this._didScrollStart(),this.setState({scrollX:e}),this._didScrollStop())},_onVerticalScroll:function(e){if(this._isMounted&&e!==this.state.scrollY){this._isScrolling||this._didScrollStart();var t=this._scrollHelper.scrollTo(Math.round(e));this.setState({firstRowIndex:t.index,firstRowOffset:t.offset,scrollY:t.position,scrollContentHeight:t.contentHeight}),this._didScrollStop()}},_didScrollStart:function(){this._isMounted&&!this._isScrolling&&(this._isScrolling=!0,this.props.onScrollStart&&this.props.onScrollStart(this.state.scrollX,this.state.scrollY))},_didScrollStop:function(){this._isMounted&&this._isScrolling&&(this._isScrolling=!1,this.setState({redraw:!0}),this.props.onScrollEnd&&this.props.onScrollEnd(this.state.scrollX,this.state.scrollY))}}),O=s({displayName:"HorizontalScrollbar",mixins:[a],propTypes:{contentSize:r.number.isRequired,offset:r.number.isRequired,onScroll:r.func.isRequired,position:r.number.isRequired,size:r.number.isRequired},render:function(){var e={height:u.SIZE,width:this.props.size},t={height:u.SIZE,position:"absolute",overflow:"hidden",width:this.props.size};return b(t,0,this.props.offset),i.createElement("div",{className:y(m("fixedDataTableLayout/horizontalScrollbar"),m("public/fixedDataTable/horizontalScrollbar")),style:e},i.createElement("div",{style:t},i.createElement(u,n({},this.props,{isOpaque:!0,orientation:"horizontal",offset:void 0}))))}});e.exports=S},function(e,t,o){"use strict";var n=o(35),r=o(38);if("undefined"==typeof n)throw Error("create-react-class could not find the React object. If you are using script tags, make sure that React is being loaded before create-react-class.");var i=(new n.Component).updater;e.exports=r(n.Component,n.isValidElement,i)},function(e,t,o){(function(t){"use strict";function n(e){return e}function r(e,o,r){function h(e,o,n){for(var r in o)o.hasOwnProperty(r)&&"production"!==t.env.NODE_ENV&&l("function"==typeof o[r],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",e.displayName||"ReactClass",u[n],r)}function f(e,t){var o=x.hasOwnProperty(t)?x[t]:null;T.hasOwnProperty(t)&&a("OVERRIDE_BASE"===o,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&a("DEFINE_MANY"===o||"DEFINE_MANY_MERGED"===o,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t); }function p(e,n){if(n){a("function"!=typeof n,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),a(!o(n),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=e.prototype,i=r.__reactAutoBindPairs;n.hasOwnProperty(c)&&R.mixins(e,n.mixins);for(var s in n)if(n.hasOwnProperty(s)&&s!==c){var u=n[s],h=r.hasOwnProperty(s);if(f(h,s),R.hasOwnProperty(s))R[s](e,u);else{var p=x.hasOwnProperty(s),d="function"==typeof u,m=d&&!p&&!h&&n.autobind!==!1;if(m)i.push(s,u),r[s]=u;else if(h){var g=x[s];a(p&&("DEFINE_MANY_MERGED"===g||"DEFINE_MANY"===g),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",g,s),"DEFINE_MANY_MERGED"===g?r[s]=v(r[s],u):"DEFINE_MANY"===g&&(r[s]=_(r[s],u))}else r[s]=u,"production"!==t.env.NODE_ENV&&"function"==typeof u&&n.displayName&&(r[s].displayName=n.displayName+"_"+s)}}}else if("production"!==t.env.NODE_ENV){var y=typeof n,w="object"===y&&null!==n;"production"!==t.env.NODE_ENV&&l(w,"%s: You're attempting to include a mixin that is either null or not an object. Check the mixins included by the component, as well as any mixins they include themselves. Expected object but got %s.",e.displayName||"ReactClass",null===n?null:y)}}function d(e,t){if(t)for(var o in t){var n=t[o];if(t.hasOwnProperty(o)){var r=o in R;a(!r,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',o);var i=o in e;if(i){var s=C.hasOwnProperty(o)?C[o]:null;return a("DEFINE_MANY_MERGED"===s,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",o),void(e[o]=v(e[o],n))}e[o]=n}}}function m(e,t){a(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var o in t)t.hasOwnProperty(o)&&(a(void 0===e[o],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",o),e[o]=t[o]);return e}function v(e,t){return function(){var o=e.apply(this,arguments),n=t.apply(this,arguments);if(null==o)return n;if(null==n)return o;var r={};return m(r,o),m(r,n),r}}function _(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function g(e,o){var n=o.bind(e);if("production"!==t.env.NODE_ENV){n.__reactBoundContext=e,n.__reactBoundMethod=o,n.__reactBoundArguments=null;var r=e.constructor.displayName,i=n.bind;n.bind=function(s){for(var a=arguments.length,u=Array(a>1?a-1:0),c=1;c1?t-1:0),n=1;n2?o-2:0),r=2;rn},ie64:function(){return y.ie()&&p},firefox:function(){return o()||r},opera:function(){return o()||i},webkit:function(){return o()||s},safari:function(){return y.webkit()},chrome:function(){return o()||a},windows:function(){return o()||c},osx:function(){return o()||u},linux:function(){return o()||h},iphone:function(){return o()||d},mobile:function(){return o()||d||m||f||_},nativeApp:function(){return o()||v},android:function(){return o()||f},ipad:function(){return o()||m}};e.exports=y},function(e,t,o){"use strict";function n(e,t){if(!i.canUseDOM||t&&!("addEventListener"in document))return!1;var o="on"+e,n=o in document;if(!n){var s=document.createElement("div");s.setAttribute(o,"return;"),n="function"==typeof s[o]}return!n&&r&&"wheel"===e&&(n=document.implementation.hasFeature("Events.wheel","3.0")),n}var r,i=o(49);i.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),e.exports=n},function(e,t){"use strict";var o=!("undefined"==typeof window||!window.document||!window.document.createElement),n={canUseDOM:o,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:o&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:o&&!!window.screen,isInWorker:!o};e.exports=n},function(e,t,o){(function(t){"use strict";var n=o(45),r=o(51),i=0,s=r||function(e){var o=Date.now(),n=Math.max(0,16-(o-i));return i=o+n,t.setTimeout(function(){e(Date.now())},n)};s(n),e.exports=s}).call(t,function(){return this}())},function(e,t){(function(t){"use strict";var o=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame;e.exports=o}).call(t,function(){return this}())},function(e,t,o){"use strict";var n=o(53),r=o(56),i=o(27),s=o(34),a=o(37),l=o(57),u=o(43),c=o(44),h=o(59),f=o(60),p=o(45),d=o(61),m={position:0,scrollable:!1},v=parseInt(h("scrollbar-face-margin"),10),_=2*v,g=30,y=40,w=null,b=a({displayName:"Scrollbar",mixins:[u],propTypes:{contentSize:i.number.isRequired,defaultPosition:i.number,isOpaque:i.bool,orientation:i.oneOf(["vertical","horizontal"]),onScroll:i.func,position:i.number,size:i.number.isRequired,trackColor:i.oneOf(["gray"]),zIndex:i.number,verticalTop:i.number},getInitialState:function(){var e=this.props;return this._calculateState(e.position||e.defaultPosition||0,e.size,e.contentSize,e.orientation)},componentWillReceiveProps:function(e){var t=e.position;void 0===t?this._setNextState(this._calculateState(this.state.position,e.size,e.contentSize,e.orientation)):this._setNextState(this._calculateState(t,e.size,e.contentSize,e.orientation),e)},getDefaultProps:function(){return{defaultPosition:0,isOpaque:!1,onScroll:p,orientation:"vertical",zIndex:99}},render:function(){if(!this.state.scrollable)return null;var e,t,o=this.props.size,n=this.state.isHorizontal,r=!n,i=this.state.focused||this.state.isDragging,a=this.state.faceSize,l=this.props.isOpaque,u=this.props.verticalTop||0,c=f({"ScrollbarLayout/main":!0,"ScrollbarLayout/mainVertical":r,"ScrollbarLayout/mainHorizontal":n,"public/Scrollbar/main":!0,"public/Scrollbar/mainOpaque":l,"public/Scrollbar/mainActive":i}),p=f({"ScrollbarLayout/face":!0,"ScrollbarLayout/faceHorizontal":n,"ScrollbarLayout/faceVertical":r,"public/Scrollbar/faceActive":i,"public/Scrollbar/face":!0}),m=this.state.position*this.state.scale+v;return n?(e={width:o},t={width:a-_},d(t,m,0)):(e={top:u,height:o},t={height:a-_},d(t,0,m)),e.zIndex=this.props.zIndex,"gray"===this.props.trackColor&&(e.backgroundColor=h("fbui-desktop-background-light")),s.createElement("div",{onFocus:this._onFocus,onBlur:this._onBlur,onKeyDown:this._onKeyDown,onMouseDown:this._onMouseDown,onWheel:this._wheelHandler.onWheel,className:c,style:e,tabIndex:0},s.createElement("div",{ref:"face",className:p,style:t}))},componentWillMount:function(){var e="horizontal"===this.props.orientation,t=e?this._onWheelX:this._onWheelY;this._wheelHandler=new c(t,this._shouldHandleX,this._shouldHandleY)},componentDidMount:function(){this._mouseMoveTracker=new n(this._onMouseMove,this._onMouseMoveEnd,document.documentElement),void 0!==this.props.position&&this.state.position!==this.props.position&&this._didScroll(),this._isMounted=!0},componentWillUnmount:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),w===this&&(w=null),delete this._mouseMoveTracker,this._isMounted=!1},scrollBy:function(e){this._onWheel(e)},_shouldHandleX:function(e){return"horizontal"===this.props.orientation&&this._shouldHandleChange(e)},_shouldHandleY:function(e){return"horizontal"!==this.props.orientation&&this._shouldHandleChange(e)},_shouldHandleChange:function(e){var t=this._calculateState(this.state.position+e,this.props.size,this.props.contentSize,this.props.orientation);return t.position!==this.state.position},_calculateState:function(e,t,o,n){if(t<1||o<=t)return m;var r=e+"_"+t+"_"+o+"_"+n;if(this._stateKey===r)return this._stateForKey;var i="horizontal"===n,s=t/o,a=t*s;au&&(e=u);var c=!!this._mouseMoveTracker&&this._mouseMoveTracker.isDragging(),h={faceSize:a,isDragging:c,isHorizontal:i,position:e,scale:s,scrollable:l};return this._stateKey=r,this._stateForKey=h,h},_onWheelY:function(e,t){this._onWheel(t)},_onWheelX:function(e,t){this._onWheel(e)},_onWheel:function(e){var t=this.props;this._setNextState(this._calculateState(this.state.position+e,t.size,t.contentSize,t.orientation))},_onMouseDown:function(e){var t;if(e.target!==l.findDOMNode(this.refs.face)){var o=e.nativeEvent,n=this.state.isHorizontal?o.offsetX||o.layerX:o.offsetY||o.layerY,r=this.props;n/=this.state.scale,t=this._calculateState(n-.5*this.state.faceSize/this.state.scale,r.size,r.contentSize,r.orientation)}else t={};t.focused=!0,this._setNextState(t),this._mouseMoveTracker.captureMouseMoves(e),l.findDOMNode(this).focus()},_onMouseMove:function(e,t){var o=this.props,n=this.state.isHorizontal?e:t;n/=this.state.scale,this._setNextState(this._calculateState(this.state.position+n,o.size,o.contentSize,o.orientation))},_onMouseMoveEnd:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),this.setState({isDragging:!1})},_onKeyDown:function(e){var t=e.keyCode;if(t!==r.TAB){var o=y,n=0;if(this.state.isHorizontal)switch(t){case r.HOME:n=-1,o=this.props.contentSize;break;case r.LEFT:n=-1;break;case r.RIGHT:n=1;break;default:return}if(!this.state.isHorizontal)switch(t){case r.SPACE:n=e.shiftKey?-1:1;break;case r.HOME:n=-1,o=this.props.contentSize;break;case r.UP:n=-1;break;case r.DOWN:n=1;break;case r.PAGE_UP:n=-1,o=this.props.size;break;case r.PAGE_DOWN:n=1,o=this.props.size;break;default:return}e.preventDefault();var i=this.props;this._setNextState(this._calculateState(this.state.position+o*n,i.size,i.contentSize,i.orientation))}},_onFocus:function(){this.setState({focused:!0})},_onBlur:function(){this.setState({focused:!1})},_blur:function(){if(this._isMounted)try{this._onBlur(),l.findDOMNode(this).blur()}catch(e){}},_setNextState:function(e,t){t=t||this.props;var o=t.position,n=this.state.position!==e.position;if(void 0===o){var r=n?this._didScroll:void 0;this.setState(e,r)}else{if(o!==e.position)return void(void 0!==e.position&&e.position!==this.state.position&&this.props.onScroll(e.position));this.setState(e)}n&&w!==this&&(w&&w._blur(),w=this)},_didScroll:function(){this.props.onScroll(this.state.position)}});b.KEYBOARD_SCROLL_AMOUNT=y,b.SIZE=parseInt(h("scrollbar-size"),10),e.exports=b},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var o=0;o0;)this._addRowToBuffer(t,this._viewportRowsBegin,this._viewportRowsEnd-1),t++,e--;return this._rows}},{key:"getRows",value:function(e,t){var o=t,n=o,r=e,i=Math.min(e+this._maxVisibleRowCount,this._rowsCount);for(this._viewportRowsBegin=e;r=i&&(n=this._bufferSet.replaceFurthestValuePosition(t,o,e)),null===n?(n=this._bufferSet.getNewPositionForValue(e),this._rows[n]=e):this._rows[n]=e}}]),e}();e.exports=c},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var o=0;o=e&&r<=t)return null;var i;e-n>r-t?(i=n,this._smallValues.pop()):(i=r,this._largeValues.pop());var a=this._valueToPositionMap[i];return delete this._valueToPositionMap[i],this._valueToPositionMap[o]=a,this._pushToHeaps(a,o),a}},{key:"_pushToHeaps",value:function(e,t){var o={position:e,value:t};this._smallValues.push(o),this._largeValues.push(o)}},{key:"_cleanHeaps",value:function(){this._cleanHeap(this._smallValues),this._cleanHeap(this._largeValues);var e=Math.min(this._smallValues.size(),this._largeValues.size()),t=Math.max(this._smallValues.size(),this._largeValues.size());t>10*e&&this._recreateHeaps()}},{key:"_recreateHeaps",value:function(){for(var e=this._smallValues.size()t.value}}]),e}();e.exports=a},function(e,t){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){return e0&&(this._items[0]=t,this._sinkDown(0)),e}}},{key:"push",value:function(e){this._items[this._size++]=e,this._bubbleUp(this._size-1)}},{key:"size",value:function(){return this._size}},{key:"peek",value:function(){if(0!==this._size)return this._items[0]}},{key:"_heapify",value:function(){for(var e=Math.floor((this._size+1)/2);e>=0;e--)this._sinkDown(e)}},{key:"_bubbleUp",value:function(e){for(var t=this._items[e];e>0;){var o=Math.floor((e+1)/2)-1,n=this._items[o];if(this._comparator(n,t))return;this._items[o]=t,this._items[e]=n,e=o}}},{key:"_sinkDown",value:function(e){for(var t=this._items[e];;){var o=2*(e+1)-1,n=2*(e+1),r=-1;if(oo?o:e}e.exports=o},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=Object.assign||function(e){for(var t=1;t0){var o=h({"fixedDataTableRowLayout/fixedColumnsDivider":!0,"fixedDataTableRowLayout/columnsShadow":e.props.scrollLeft>0,"public/fixedDataTableRow/fixedColumnsDivider":!0,"public/fixedDataTableRow/columnsShadow":e.props.scrollLeft>0}),n={left:t,height:e.props.height};return u.createElement("div",{className:o,style:n})}},this._onClick=function(t){e.props.onClick(t,e.props.index)},this._onDoubleClick=function(t){e.props.onDoubleClick(t,e.props.index)},this._onMouseDown=function(t){e.props.onMouseDown(t,e.props.index)},this._onMouseEnter=function(t){e.props.onMouseEnter(t,e.props.index)},this._onMouseLeave=function(t){e.props.onMouseLeave(t,e.props.index)}}return r(t,e),s(t,[{key:"render",value:function(){var e={width:this.props.width,height:this.props.height},t=h({"fixedDataTableRowLayout/main":!0,"public/fixedDataTableRow/main":!0,"public/fixedDataTableRow/highlighted":this.props.index%2===1,"public/fixedDataTableRow/odd":this.props.index%2===1,"public/fixedDataTableRow/even":this.props.index%2===0}),o=this._getColumnsWidth(this.props.fixedColumns),n=u.createElement(c,{key:"fixed_cells",isScrolling:this.props.isScrolling,height:this.props.height,left:0,width:o,zIndex:2,columns:this.props.fixedColumns,onColumnResize:this.props.onColumnResize,rowHeight:this.props.height,rowIndex:this.props.index}),r=this._renderColumnsShadow(o),i=u.createElement(c,{key:"scrollable_cells",isScrolling:this.props.isScrolling,height:this.props.height,left:this.props.scrollLeft,offsetLeft:o,width:this.props.width-o,zIndex:0,columns:this.props.scrollableColumns,onColumnResize:this.props.onColumnResize,rowHeight:this.props.height,rowIndex:this.props.index});return u.createElement("div",{className:f(t,this.props.className),onClick:this.props.onClick?this._onClick:null,onDoubleClick:this.props.onDoubleClick?this._onDoubleClick:null,onMouseDown:this.props.onMouseDown?this._onMouseDown:null,onMouseEnter:this.props.onMouseEnter?this._onMouseEnter:null,onMouseLeave:this.props.onMouseLeave?this._onMouseLeave:null,style:e},u.createElement("div",{className:h("fixedDataTableRowLayout/body")},n,i,r))}}],[{key:"propTypes",value:{isScrolling:l.bool,fixedColumns:l.array.isRequired,height:l.number.isRequired,index:l.number.isRequired,scrollableColumns:l.array.isRequired,scrollLeft:l.number.isRequired,width:l.number.isRequired,onClick:l.func,onDoubleClick:l.func,onColumnResize:l.func},enumerable:!0}]),t}(u.Component),m=function(e){function t(){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return r(t,e),s(t,[{key:"render",value:function(){var e={width:this.props.width,height:this.props.height,zIndex:this.props.zIndex?this.props.zIndex:0};return p(e,0,this.props.offsetTop),u.createElement("div",{style:e,className:h("fixedDataTableRowLayout/rowWrapper")},u.createElement(d,i({},this.props,{offsetTop:void 0,zIndex:void 0})))}}],[{key:"propTypes",value:{isScrolling:l.bool,height:l.number.isRequired,zIndex:l.number,offsetTop:l.number.isRequired,width:l.number.isRequired},enumerable:!0}]),t}(u.Component);e.exports=m},function(e,t,o){"use strict";function n(e,t){var o={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}var r=Object.assign||function(e){for(var t=1;t=0){var l="cell_"+r;o[r]=this._renderCell(e.rowIndex,e.rowHeight,s,n,l)}n+=s.width}var u=this._getColumnsWidth(t),p={height:e.height,position:"absolute",width:u,zIndex:e.zIndex};return h(p,-1*f*e.left,0),a.createElement("div",{className:c("fixedDataTableCellGroupLayout/cellGroup"),style:p},o)},_renderCell:function(e,t,o,n,r){var i=o.isResizable&&this.props.onColumnResize,s=i?this.props.onColumnResize:null,l=o.cellClassName;return a.createElement(u,{isScrolling:this.props.isScrolling,align:o.align,className:l,height:t,key:r,maxWidth:o.maxWidth,minWidth:o.minWidth,onColumnResize:s,rowIndex:e,columnKey:o.columnKey,width:o.width,left:n,cell:o.cell})},_getColumnsWidth:function(e){for(var t=0,o=0;o=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}var r=o(78),i=o(73),s=o(27),a=o(34),l=o(37),u=o(60),c=o(79),h=i.DIR_SIGN,f={align:"left",highlighted:!1},p=l({displayName:"FixedDataTableCell",propTypes_DISABLED_FOR_PERFORMANCE:{isScrolling:s.bool,align:s.oneOf(["left","center","right"]),className:s.string,highlighted:s.bool,width:s.number.isRequired,minWidth:s.number,maxWidth:s.number,height:s.number.isRequired,cell:s.oneOfType([s.string,s.element,s.func]),columnKey:s.oneOfType([s.string,s.number]),rowIndex:s.number.isRequired,onColumnResize:s.func,left:s.number},shouldComponentUpdate:function(e){return!e.isScrolling||this.props.rowIndex!==e.rowIndex},getDefaultProps:function(){return f},render:function(){var e=this.props,t=e.height,o=e.width,i=e.columnKey,s=n(e,["height","width","columnKey"]),l={height:t,width:o};1===h?l.left=s.left:l.right=s.left;var f,p=c(u({"fixedDataTableCellLayout/main":!0,"fixedDataTableCellLayout/lastChild":s.lastChild,"fixedDataTableCellLayout/alignRight":"right"===s.align,"fixedDataTableCellLayout/alignCenter":"center"===s.align,"public/fixedDataTableCell/alignRight":"right"===s.align,"public/fixedDataTableCell/highlighted":s.highlighted,"public/fixedDataTableCell/main":!0}),s.className);if(s.onColumnResize){var d={height:t};f=a.createElement("div",{className:u("fixedDataTableCellLayout/columnResizerContainer"),style:d,onMouseDown:this._onColumnResizerMouseDown},a.createElement("div",{className:c(u("fixedDataTableCellLayout/columnResizerKnob"),u("public/fixedDataTableCell/columnResizerKnob")),style:d}))}var m={columnKey:i,height:t,width:o};s.rowIndex>=0&&(m.rowIndex=s.rowIndex);var v;return v=a.isValidElement(s.cell)?a.cloneElement(s.cell,m):"function"==typeof s.cell?s.cell(m):a.createElement(r,m,s.cell),a.createElement("div",{className:p,style:l},f,v)},_onColumnResizerMouseDown:function(e){this.props.onColumnResize(this.props.left,this.props.width,this.props.minWidth,this.props.maxWidth,this.props.columnKey,e)}});e.exports=p},function(e,t,o){"use strict";function n(e,t){var o={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=Object.assign||function(e){for(var t=1;t1)for(var n=1;n=0&&t>=e-a;){var o=this._updateRowHeight(t);this._position+=o,t--}}},{key:"_updateRowHeight",value:function(e){if(e<0||e>=this._rowCount)return 0;var t=this._rowHeightGetter(e);if(t!==this._storedHeights[e]){var o=t-this._storedHeights[e];return this._rowOffsets.set(e,t),this._storedHeights[e]=t,this._contentHeight+=o,o}return 0}},{key:"getRowPosition",value:function(e){return this._updateRowHeight(e),this._rowOffsets.sumUntil(e)}},{key:"scrollBy",value:function(e){if(0===this._rowCount)return l;var t=this._rowOffsets.greatestLowerBound(this._position);t=s(t,0,Math.max(this._rowCount-1,0));var o=this._rowOffsets.sumUntil(t),n=t,r=this._position,i=this._updateRowHeight(n);0!==o&&(r+=i);var a=this._storedHeights[n]-(r-o);if(e>=0)for(;e>0&&n0&&n>=0;)if(e=0){var c=this._updateRowHeight(n);u=this._storedHeights[n],r+=c}}var h=this._contentHeight-this._viewportHeight;r=s(r,0,h),this._position=r;var f=this._rowOffsets.greatestLowerBound(r);f=s(f,0,Math.max(this._rowCount-1,0)),o=this._rowOffsets.sumUntil(f);var p=o-r;return this._updateHeightsInViewport(f,p),this._updateHeightsAboveViewport(f),{index:f,offset:p,position:this._position,contentHeight:this._contentHeight}}},{key:"_getRowAtEndPosition",value:function(e){this._updateRowHeight(e);for(var t=e,o=this._storedHeights[t];o=0;)t--,t>=0&&(this._updateRowHeight(t),o+=this._storedHeights[t]);var n=this._rowOffsets.sumTo(e)-this._viewportHeight;return n<0&&(n=0),n}},{key:"scrollTo",value:function(e){if(0===this._rowCount)return l;if(e<=0)return this._position=0,this._updateHeightsInViewport(0,0),{index:0,offset:0,position:this._position,contentHeight:this._contentHeight};if(e>=this._contentHeight-this._viewportHeight){var t=this._rowCount-1;e=this._getRowAtEndPosition(t)}this._position=e;var o=this._rowOffsets.greatestLowerBound(e);o=s(o,0,Math.max(this._rowCount-1,0));var n=this._rowOffsets.sumUntil(o),r=n-e;return this._updateHeightsInViewport(o,r),this._updateHeightsAboveViewport(o),{index:o,offset:r,position:this._position,contentHeight:this._contentHeight}}},{key:"scrollToRow",value:function(e,t){e=s(e,0,Math.max(this._rowCount-1,0)),t=s(t,-this._storedHeights[e],0);var o=this._rowOffsets.sumUntil(e);return this.scrollTo(o-t)}},{key:"scrollRowIntoView",value:function(e){e=s(e,0,Math.max(this._rowCount-1,0));var t=this._rowOffsets.sumUntil(e),o=t+this._storedHeights[e];if(t=0;--o)t[o]=0;return t},u=function(){function e(t){n(this,e),this._size=t.length,this._half=r(this._size),this._heap=new l(2*this._half);var o;for(o=0;o0;--o)this._heap[o]=this._heap[2*o]+this._heap[2*o+1]}return i(e,[{key:"set",value:function(e,t){s(0<=e&&e=0;--r)n[r]=o;return new e(n)}},{key:"empty",value:function(t){return e.uniform(t,0)}}]),e}();e.exports=u}).call(t,function(){return this}())},function(e,t,o){"use strict";function n(e){for(var t=0,o=0;o ); } From 9b8615134c525ad00a0802a37f8ba8f010a8d3de Mon Sep 17 00:00:00 2001 From: Kevin Chang Date: Fri, 16 Nov 2018 15:30:53 -0800 Subject: [PATCH 19/43] Allow horizontalScrollbar styling to be injected. --- dist/fixed-data-table.css | 2 +- dist/fixed-data-table.js | 19 +++++++++++++------ dist/fixed-data-table.min.css | 2 +- dist/fixed-data-table.min.js | 10 +++++----- package-lock.json | 2 +- package.json | 2 +- src/FixedDataTableNew.react.js | 16 ++++++++++++---- 7 files changed, 34 insertions(+), 19 deletions(-) diff --git a/dist/fixed-data-table.css b/dist/fixed-data-table.css index 24fa513c..25c0eb9b 100644 --- a/dist/fixed-data-table.css +++ b/dist/fixed-data-table.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.7 + * FixedDataTable v0.7.8 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table.js b/dist/fixed-data-table.js index fc201b88..855ee860 100644 --- a/dist/fixed-data-table.js +++ b/dist/fixed-data-table.js @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.7 + * FixedDataTable v0.7.8 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -2091,7 +2091,12 @@ return /******/ (function(modules) { // webpackBootstrap * CSS style props to pass to the box shadow that shows up on the fixed * header while scrolling */ - topShadowStyle: PropTypes.object + topShadowStyle: PropTypes.object, + + /** + * CSS style props to pass to the horizontal scrollbar + */ + horizontalScrollbarStyle: PropTypes.object }, getDefaultProps: function getDefaultProps() /*object*/{ @@ -2101,7 +2106,8 @@ return /******/ (function(modules) { // webpackBootstrap headerHeight: 0, scrollLeft: 0, scrollTop: 0, - topShadowStyle: {} + topShadowStyle: {}, + horizontalScrollbarStyle: {} }; }, @@ -2272,7 +2278,8 @@ return /******/ (function(modules) { // webpackBootstrap offset: bottomSectionOffset, onScroll: this._onHorizontalScroll, position: state.scrollX, - size: scrollbarXWidth + size: scrollbarXWidth, + horizontalScrollbarStyle: props.horizontalScrollbarStyle }); } @@ -2780,10 +2787,10 @@ return /******/ (function(modules) { // webpackBootstrap }, render: function render() /*object*/{ - var outerContainerStyle = { + var outerContainerStyle = _extends({ height: Scrollbar.SIZE, width: this.props.size - }; + }, this.props.horizontalScrollbarStyle); var innerContainerStyle = { height: Scrollbar.SIZE, position: "absolute", diff --git a/dist/fixed-data-table.min.css b/dist/fixed-data-table.min.css index 21c5fae2..754ff713 100644 --- a/dist/fixed-data-table.min.css +++ b/dist/fixed-data-table.min.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.7 + * FixedDataTable v0.7.8 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table.min.js b/dist/fixed-data-table.min.js index b5670863..eb565dbd 100644 --- a/dist/fixed-data-table.min.js +++ b/dist/fixed-data-table.min.js @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.7 + * FixedDataTable v0.7.8 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -9,7 +9,7 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.FixedDataTable=t(require("react"),require("react-dom")):e.FixedDataTable=t(e.React,e.ReactDOM)}(this,function(e,t){return function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){o(1),o(5),o(7),o(9),o(11),o(13),o(15),o(17),o(19),o(21),o(23),e.exports=o(25)},function(e,t){},,,,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t,o){"use strict";var n=o(26),r=o(78),i=o(76),s=o(75),a={Cell:r,Column:i,ColumnGroup:s,Table:n};a.version="0.7.0",e.exports=a},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e,t){}var s=Object.assign||function(e){for(var t=1;t1)for(var o=1;o0||e>=0&&this.state.scrollX0||e>=0&&this.state.scrollYn?n:this.state.height>n&&this.props.ownerHeight?Math.max(n,this.props.ownerHeight):this.state.height+this.state.maxScrollY,e!==this._contentHeight&&this.props.onContentHeightChange&&this.props.onContentHeightChange(e),this._contentHeight=e},componentDidMount:function(){this._reportContentHeight(),this._isMounted=!0},componentWillReceiveProps:function(e){var t=e.scrollToRow;void 0!==t&&null!==t&&(this._rowToScrollTo=t);var o=e.scrollToColumn;void 0!==o&&null!==o&&(this._columnToScrollTo=o);var n=e.overflowX,r=e.overflowY;n===this.props.overflowX&&r===this.props.overflowY||(this._wheelHandler=new l(this._onWheel,"hidden"!==n,"hidden"!==r)),this.props.ownerHeight===e.ownerHeight&&this.props.scrollTop===e.scrollTop||this._didScrollStart(),this._didScrollStop(),this.setState(this._calculateState(e,this.state))},componentDidUpdate:function(){this._reportContentHeight()},render:function(){var e,t=this.state,o=this.props;t.useGroupHeader&&(e=i.createElement(f,{key:"group_header",isScrolling:this._isScrolling,className:y(m("fixedDataTableLayout/header"),m("public/fixedDataTable/header")),width:t.width,height:t.groupHeaderHeight,index:0,zIndex:1,offsetTop:0,scrollLeft:t.scrollX,fixedColumns:t.groupHeaderFixedColumns,scrollableColumns:t.groupHeaderScrollableColumns,onColumnResize:this._onColumnResize}));var r=this.state.maxScrollY,s=t.maxScrollX>0&&"hidden"!==t.overflowX,a=r>0&&"hidden"!==t.overflowY,l=s?u.SIZE:0,c=t.height-l-2*R-t.footerHeight,p=t.useGroupHeader?t.groupHeaderHeight:0,d=p+t.headerHeight;c-=d;var v=0,_=null!=o.maxHeight?d+t.bodyHeight:d+c,g=_+t.footerHeight;void 0!==o.ownerHeight&&o.ownerHeightt.ownerHeight||t.scrollY or "),o.push(e))});var r=!1;o.length&&o[0].type.__TableColumnGroup__&&(r=!0),t&&(void 0!==e.width&&e.width!==t.width||void 0!==e.height&&e.height!==t.height||void 0!==e.maxWidth&&e.maxWidth!==t.maxWidth||void 0!==e.maxHeight&&e.maxHeight!==t.maxHeight)&&(t=null);var i,s,a=t&&t.firstRowIndex||0,l=t&&t.firstRowOffset||0;i=t&&"hidden"!==e.overflowX?t.scrollX:e.scrollLeft,t&&"hidden"!==e.overflowY?s=t.scrollY:(f=this._scrollHelper.scrollTo(e.scrollTop),a=f.index,l=f.offset,s=f.position),void 0!==this._rowToScrollTo&&(f=this._scrollHelper.scrollRowIntoView(this._rowToScrollTo),a=f.index,l=f.offset,s=f.position,delete this._rowToScrollTo);var c=r?e.groupHeaderHeight:0;if(t&&e.rowsCount!==t.rowsCount){var h=(void 0===e.height?e.maxHeight:e.height)-(e.headerHeight||0)-(e.footerHeight||0)-(e.groupHeaderHeight||0);this._scrollHelper=new p(e.rowsCount,e.rowHeight,h,e.rowHeightGetter);var f=this._scrollHelper.scrollToRow(a,l);a=f.index,l=f.offset,s=f.position}else t&&e.rowHeightGetter!==t.rowHeightGetter&&this._scrollHelper.setRowHeightGetter(e.rowHeightGetter);var m;m=e.isColumnResizing?t&&t.columnResizingData:C;var v,_;if(r){var y=d.adjustColumnGroupWidths(o,e.width);v=y.columns,_=y.columnGroups}else v=d.adjustColumnWidths(o,e.width);var w=this._populateColumnsAndColumnData(v,_,t);if(void 0!==this._columnToScrollTo){var b=w.bodyFixedColumns.length;if(this._columnToScrollTo>=b){var E,D,T=0;for(E=0;EO&&(i=O)}delete this._columnToScrollTo}var k=void 0===e.height,P=Math.round(k?e.maxHeight:e.height),I=e.footerHeight+e.headerHeight+c+2*R,z=P-I,j=this._scrollHelper.getContentHeight(),A=j+I,F=d.getTotalWidth(v),L=F>e.width&&"hidden"!==e.overflowX;L&&(z-=u.SIZE,A+=u.SIZE,I+=u.SIZE);var G=Math.max(0,F-e.width),W=Math.max(0,j-z);i=Math.min(i,G),s=Math.min(s,W),W||(k&&(P=A),z=A-I),this._scrollHelper.setViewportHeight(z);var V=n({isColumnResizing:t&&t.isColumnResizing},w,e,{columns:v,columnGroups:_,columnResizingData:m,firstRowIndex:a,firstRowOffset:l,horizontalScrollbarVisible:L,maxScrollX:G,maxScrollY:W,reservedHeight:I,scrollContentHeight:j,scrollX:i,scrollY:s,bodyHeight:z,height:P,groupHeaderHeight:c,useGroupHeader:r});return V},_selectColumnElement:function(e,t){for(var o=[],n=0;nMath.abs(e)&&"hidden"!==this.props.overflowY){var n=this._scrollHelper.scrollBy(Math.round(t)),r=Math.max(0,n.contentHeight-this.state.bodyHeight);this.setState({firstRowIndex:n.index,firstRowOffset:n.offset,scrollY:n.position,scrollContentHeight:n.contentHeight,maxScrollY:r})}else e&&"hidden"!==this.props.overflowX&&(o+=e,o=o<0?0:o,o=o>this.state.maxScrollX?this.state.maxScrollX:o,this.setState({scrollX:o}));this._didScrollStop()}},_onHorizontalScroll:function(e){this._isMounted&&e!==this.state.scrollX&&(this._isScrolling||this._didScrollStart(),this.setState({scrollX:e}),this._didScrollStop())},_onVerticalScroll:function(e){if(this._isMounted&&e!==this.state.scrollY){this._isScrolling||this._didScrollStart();var t=this._scrollHelper.scrollTo(Math.round(e));this.setState({firstRowIndex:t.index,firstRowOffset:t.offset,scrollY:t.position,scrollContentHeight:t.contentHeight}),this._didScrollStop()}},_didScrollStart:function(){this._isMounted&&!this._isScrolling&&(this._isScrolling=!0,this.props.onScrollStart&&this.props.onScrollStart(this.state.scrollX,this.state.scrollY))},_didScrollStop:function(){this._isMounted&&this._isScrolling&&(this._isScrolling=!1,this.setState({redraw:!0}),this.props.onScrollEnd&&this.props.onScrollEnd(this.state.scrollX,this.state.scrollY))}}),O=s({displayName:"HorizontalScrollbar",mixins:[a],propTypes:{contentSize:r.number.isRequired,offset:r.number.isRequired,onScroll:r.func.isRequired,position:r.number.isRequired,size:r.number.isRequired},render:function(){var e={height:u.SIZE,width:this.props.size},t={height:u.SIZE,position:"absolute",overflow:"hidden",width:this.props.size};return b(t,0,this.props.offset),i.createElement("div",{className:y(m("fixedDataTableLayout/horizontalScrollbar"),m("public/fixedDataTable/horizontalScrollbar")),style:e},i.createElement("div",{style:t},i.createElement(u,n({},this.props,{isOpaque:!0,orientation:"horizontal",offset:void 0}))))}});e.exports=S},function(e,t,o){"use strict";var n=o(35),r=o(38);if("undefined"==typeof n)throw Error("create-react-class could not find the React object. If you are using script tags, make sure that React is being loaded before create-react-class.");var i=(new n.Component).updater;e.exports=r(n.Component,n.isValidElement,i)},function(e,t,o){(function(t){"use strict";function n(e){return e}function r(e,o,r){function h(e,o,n){for(var r in o)o.hasOwnProperty(r)&&"production"!==t.env.NODE_ENV&&l("function"==typeof o[r],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",e.displayName||"ReactClass",u[n],r)}function f(e,t){var o=x.hasOwnProperty(t)?x[t]:null;T.hasOwnProperty(t)&&a("OVERRIDE_BASE"===o,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&a("DEFINE_MANY"===o||"DEFINE_MANY_MERGED"===o,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t); -}function p(e,n){if(n){a("function"!=typeof n,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),a(!o(n),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=e.prototype,i=r.__reactAutoBindPairs;n.hasOwnProperty(c)&&R.mixins(e,n.mixins);for(var s in n)if(n.hasOwnProperty(s)&&s!==c){var u=n[s],h=r.hasOwnProperty(s);if(f(h,s),R.hasOwnProperty(s))R[s](e,u);else{var p=x.hasOwnProperty(s),d="function"==typeof u,m=d&&!p&&!h&&n.autobind!==!1;if(m)i.push(s,u),r[s]=u;else if(h){var g=x[s];a(p&&("DEFINE_MANY_MERGED"===g||"DEFINE_MANY"===g),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",g,s),"DEFINE_MANY_MERGED"===g?r[s]=v(r[s],u):"DEFINE_MANY"===g&&(r[s]=_(r[s],u))}else r[s]=u,"production"!==t.env.NODE_ENV&&"function"==typeof u&&n.displayName&&(r[s].displayName=n.displayName+"_"+s)}}}else if("production"!==t.env.NODE_ENV){var y=typeof n,w="object"===y&&null!==n;"production"!==t.env.NODE_ENV&&l(w,"%s: You're attempting to include a mixin that is either null or not an object. Check the mixins included by the component, as well as any mixins they include themselves. Expected object but got %s.",e.displayName||"ReactClass",null===n?null:y)}}function d(e,t){if(t)for(var o in t){var n=t[o];if(t.hasOwnProperty(o)){var r=o in R;a(!r,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',o);var i=o in e;if(i){var s=C.hasOwnProperty(o)?C[o]:null;return a("DEFINE_MANY_MERGED"===s,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",o),void(e[o]=v(e[o],n))}e[o]=n}}}function m(e,t){a(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var o in t)t.hasOwnProperty(o)&&(a(void 0===e[o],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",o),e[o]=t[o]);return e}function v(e,t){return function(){var o=e.apply(this,arguments),n=t.apply(this,arguments);if(null==o)return n;if(null==n)return o;var r={};return m(r,o),m(r,n),r}}function _(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function g(e,o){var n=o.bind(e);if("production"!==t.env.NODE_ENV){n.__reactBoundContext=e,n.__reactBoundMethod=o,n.__reactBoundArguments=null;var r=e.constructor.displayName,i=n.bind;n.bind=function(s){for(var a=arguments.length,u=Array(a>1?a-1:0),c=1;c1?t-1:0),n=1;n2?o-2:0),r=2;rn},ie64:function(){return y.ie()&&p},firefox:function(){return o()||r},opera:function(){return o()||i},webkit:function(){return o()||s},safari:function(){return y.webkit()},chrome:function(){return o()||a},windows:function(){return o()||c},osx:function(){return o()||u},linux:function(){return o()||h},iphone:function(){return o()||d},mobile:function(){return o()||d||m||f||_},nativeApp:function(){return o()||v},android:function(){return o()||f},ipad:function(){return o()||m}};e.exports=y},function(e,t,o){"use strict";function n(e,t){if(!i.canUseDOM||t&&!("addEventListener"in document))return!1;var o="on"+e,n=o in document;if(!n){var s=document.createElement("div");s.setAttribute(o,"return;"),n="function"==typeof s[o]}return!n&&r&&"wheel"===e&&(n=document.implementation.hasFeature("Events.wheel","3.0")),n}var r,i=o(49);i.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),e.exports=n},function(e,t){"use strict";var o=!("undefined"==typeof window||!window.document||!window.document.createElement),n={canUseDOM:o,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:o&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:o&&!!window.screen,isInWorker:!o};e.exports=n},function(e,t,o){(function(t){"use strict";var n=o(45),r=o(51),i=0,s=r||function(e){var o=Date.now(),n=Math.max(0,16-(o-i));return i=o+n,t.setTimeout(function(){e(Date.now())},n)};s(n),e.exports=s}).call(t,function(){return this}())},function(e,t){(function(t){"use strict";var o=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame;e.exports=o}).call(t,function(){return this}())},function(e,t,o){"use strict";var n=o(53),r=o(56),i=o(27),s=o(34),a=o(37),l=o(57),u=o(43),c=o(44),h=o(59),f=o(60),p=o(45),d=o(61),m={position:0,scrollable:!1},v=parseInt(h("scrollbar-face-margin"),10),_=2*v,g=30,y=40,w=null,b=a({displayName:"Scrollbar",mixins:[u],propTypes:{contentSize:i.number.isRequired,defaultPosition:i.number,isOpaque:i.bool,orientation:i.oneOf(["vertical","horizontal"]),onScroll:i.func,position:i.number,size:i.number.isRequired,trackColor:i.oneOf(["gray"]),zIndex:i.number,verticalTop:i.number},getInitialState:function(){var e=this.props;return this._calculateState(e.position||e.defaultPosition||0,e.size,e.contentSize,e.orientation)},componentWillReceiveProps:function(e){var t=e.position;void 0===t?this._setNextState(this._calculateState(this.state.position,e.size,e.contentSize,e.orientation)):this._setNextState(this._calculateState(t,e.size,e.contentSize,e.orientation),e)},getDefaultProps:function(){return{defaultPosition:0,isOpaque:!1,onScroll:p,orientation:"vertical",zIndex:99}},render:function(){if(!this.state.scrollable)return null;var e,t,o=this.props.size,n=this.state.isHorizontal,r=!n,i=this.state.focused||this.state.isDragging,a=this.state.faceSize,l=this.props.isOpaque,u=this.props.verticalTop||0,c=f({"ScrollbarLayout/main":!0,"ScrollbarLayout/mainVertical":r,"ScrollbarLayout/mainHorizontal":n,"public/Scrollbar/main":!0,"public/Scrollbar/mainOpaque":l,"public/Scrollbar/mainActive":i}),p=f({"ScrollbarLayout/face":!0,"ScrollbarLayout/faceHorizontal":n,"ScrollbarLayout/faceVertical":r,"public/Scrollbar/faceActive":i,"public/Scrollbar/face":!0}),m=this.state.position*this.state.scale+v;return n?(e={width:o},t={width:a-_},d(t,m,0)):(e={top:u,height:o},t={height:a-_},d(t,0,m)),e.zIndex=this.props.zIndex,"gray"===this.props.trackColor&&(e.backgroundColor=h("fbui-desktop-background-light")),s.createElement("div",{onFocus:this._onFocus,onBlur:this._onBlur,onKeyDown:this._onKeyDown,onMouseDown:this._onMouseDown,onWheel:this._wheelHandler.onWheel,className:c,style:e,tabIndex:0},s.createElement("div",{ref:"face",className:p,style:t}))},componentWillMount:function(){var e="horizontal"===this.props.orientation,t=e?this._onWheelX:this._onWheelY;this._wheelHandler=new c(t,this._shouldHandleX,this._shouldHandleY)},componentDidMount:function(){this._mouseMoveTracker=new n(this._onMouseMove,this._onMouseMoveEnd,document.documentElement),void 0!==this.props.position&&this.state.position!==this.props.position&&this._didScroll(),this._isMounted=!0},componentWillUnmount:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),w===this&&(w=null),delete this._mouseMoveTracker,this._isMounted=!1},scrollBy:function(e){this._onWheel(e)},_shouldHandleX:function(e){return"horizontal"===this.props.orientation&&this._shouldHandleChange(e)},_shouldHandleY:function(e){return"horizontal"!==this.props.orientation&&this._shouldHandleChange(e)},_shouldHandleChange:function(e){var t=this._calculateState(this.state.position+e,this.props.size,this.props.contentSize,this.props.orientation);return t.position!==this.state.position},_calculateState:function(e,t,o,n){if(t<1||o<=t)return m;var r=e+"_"+t+"_"+o+"_"+n;if(this._stateKey===r)return this._stateForKey;var i="horizontal"===n,s=t/o,a=t*s;au&&(e=u);var c=!!this._mouseMoveTracker&&this._mouseMoveTracker.isDragging(),h={faceSize:a,isDragging:c,isHorizontal:i,position:e,scale:s,scrollable:l};return this._stateKey=r,this._stateForKey=h,h},_onWheelY:function(e,t){this._onWheel(t)},_onWheelX:function(e,t){this._onWheel(e)},_onWheel:function(e){var t=this.props;this._setNextState(this._calculateState(this.state.position+e,t.size,t.contentSize,t.orientation))},_onMouseDown:function(e){var t;if(e.target!==l.findDOMNode(this.refs.face)){var o=e.nativeEvent,n=this.state.isHorizontal?o.offsetX||o.layerX:o.offsetY||o.layerY,r=this.props;n/=this.state.scale,t=this._calculateState(n-.5*this.state.faceSize/this.state.scale,r.size,r.contentSize,r.orientation)}else t={};t.focused=!0,this._setNextState(t),this._mouseMoveTracker.captureMouseMoves(e),l.findDOMNode(this).focus()},_onMouseMove:function(e,t){var o=this.props,n=this.state.isHorizontal?e:t;n/=this.state.scale,this._setNextState(this._calculateState(this.state.position+n,o.size,o.contentSize,o.orientation))},_onMouseMoveEnd:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),this.setState({isDragging:!1})},_onKeyDown:function(e){var t=e.keyCode;if(t!==r.TAB){var o=y,n=0;if(this.state.isHorizontal)switch(t){case r.HOME:n=-1,o=this.props.contentSize;break;case r.LEFT:n=-1;break;case r.RIGHT:n=1;break;default:return}if(!this.state.isHorizontal)switch(t){case r.SPACE:n=e.shiftKey?-1:1;break;case r.HOME:n=-1,o=this.props.contentSize;break;case r.UP:n=-1;break;case r.DOWN:n=1;break;case r.PAGE_UP:n=-1,o=this.props.size;break;case r.PAGE_DOWN:n=1,o=this.props.size;break;default:return}e.preventDefault();var i=this.props;this._setNextState(this._calculateState(this.state.position+o*n,i.size,i.contentSize,i.orientation))}},_onFocus:function(){this.setState({focused:!0})},_onBlur:function(){this.setState({focused:!1})},_blur:function(){if(this._isMounted)try{this._onBlur(),l.findDOMNode(this).blur()}catch(e){}},_setNextState:function(e,t){t=t||this.props;var o=t.position,n=this.state.position!==e.position;if(void 0===o){var r=n?this._didScroll:void 0;this.setState(e,r)}else{if(o!==e.position)return void(void 0!==e.position&&e.position!==this.state.position&&this.props.onScroll(e.position));this.setState(e)}n&&w!==this&&(w&&w._blur(),w=this)},_didScroll:function(){this.props.onScroll(this.state.position)}});b.KEYBOARD_SCROLL_AMOUNT=y,b.SIZE=parseInt(h("scrollbar-size"),10),e.exports=b},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var o=0;o0;)this._addRowToBuffer(t,this._viewportRowsBegin,this._viewportRowsEnd-1),t++,e--;return this._rows}},{key:"getRows",value:function(e,t){var o=t,n=o,r=e,i=Math.min(e+this._maxVisibleRowCount,this._rowsCount);for(this._viewportRowsBegin=e;r=i&&(n=this._bufferSet.replaceFurthestValuePosition(t,o,e)),null===n?(n=this._bufferSet.getNewPositionForValue(e),this._rows[n]=e):this._rows[n]=e}}]),e}();e.exports=c},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var o=0;o=e&&r<=t)return null;var i;e-n>r-t?(i=n,this._smallValues.pop()):(i=r,this._largeValues.pop());var a=this._valueToPositionMap[i];return delete this._valueToPositionMap[i],this._valueToPositionMap[o]=a,this._pushToHeaps(a,o),a}},{key:"_pushToHeaps",value:function(e,t){var o={position:e,value:t};this._smallValues.push(o),this._largeValues.push(o)}},{key:"_cleanHeaps",value:function(){this._cleanHeap(this._smallValues),this._cleanHeap(this._largeValues);var e=Math.min(this._smallValues.size(),this._largeValues.size()),t=Math.max(this._smallValues.size(),this._largeValues.size());t>10*e&&this._recreateHeaps()}},{key:"_recreateHeaps",value:function(){for(var e=this._smallValues.size()t.value}}]),e}();e.exports=a},function(e,t){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){return e0&&(this._items[0]=t,this._sinkDown(0)),e}}},{key:"push",value:function(e){this._items[this._size++]=e,this._bubbleUp(this._size-1)}},{key:"size",value:function(){return this._size}},{key:"peek",value:function(){if(0!==this._size)return this._items[0]}},{key:"_heapify",value:function(){for(var e=Math.floor((this._size+1)/2);e>=0;e--)this._sinkDown(e)}},{key:"_bubbleUp",value:function(e){for(var t=this._items[e];e>0;){var o=Math.floor((e+1)/2)-1,n=this._items[o];if(this._comparator(n,t))return;this._items[o]=t,this._items[e]=n,e=o}}},{key:"_sinkDown",value:function(e){for(var t=this._items[e];;){var o=2*(e+1)-1,n=2*(e+1),r=-1;if(oo?o:e}e.exports=o},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=Object.assign||function(e){for(var t=1;t0){var o=h({"fixedDataTableRowLayout/fixedColumnsDivider":!0,"fixedDataTableRowLayout/columnsShadow":e.props.scrollLeft>0,"public/fixedDataTableRow/fixedColumnsDivider":!0,"public/fixedDataTableRow/columnsShadow":e.props.scrollLeft>0}),n={left:t,height:e.props.height};return u.createElement("div",{className:o,style:n})}},this._onClick=function(t){e.props.onClick(t,e.props.index)},this._onDoubleClick=function(t){e.props.onDoubleClick(t,e.props.index)},this._onMouseDown=function(t){e.props.onMouseDown(t,e.props.index)},this._onMouseEnter=function(t){e.props.onMouseEnter(t,e.props.index)},this._onMouseLeave=function(t){e.props.onMouseLeave(t,e.props.index)}}return r(t,e),s(t,[{key:"render",value:function(){var e={width:this.props.width,height:this.props.height},t=h({"fixedDataTableRowLayout/main":!0,"public/fixedDataTableRow/main":!0,"public/fixedDataTableRow/highlighted":this.props.index%2===1,"public/fixedDataTableRow/odd":this.props.index%2===1,"public/fixedDataTableRow/even":this.props.index%2===0}),o=this._getColumnsWidth(this.props.fixedColumns),n=u.createElement(c,{key:"fixed_cells",isScrolling:this.props.isScrolling,height:this.props.height,left:0,width:o,zIndex:2,columns:this.props.fixedColumns,onColumnResize:this.props.onColumnResize,rowHeight:this.props.height,rowIndex:this.props.index}),r=this._renderColumnsShadow(o),i=u.createElement(c,{key:"scrollable_cells",isScrolling:this.props.isScrolling,height:this.props.height,left:this.props.scrollLeft,offsetLeft:o,width:this.props.width-o,zIndex:0,columns:this.props.scrollableColumns,onColumnResize:this.props.onColumnResize,rowHeight:this.props.height,rowIndex:this.props.index});return u.createElement("div",{className:f(t,this.props.className),onClick:this.props.onClick?this._onClick:null,onDoubleClick:this.props.onDoubleClick?this._onDoubleClick:null,onMouseDown:this.props.onMouseDown?this._onMouseDown:null,onMouseEnter:this.props.onMouseEnter?this._onMouseEnter:null,onMouseLeave:this.props.onMouseLeave?this._onMouseLeave:null,style:e},u.createElement("div",{className:h("fixedDataTableRowLayout/body")},n,i,r))}}],[{key:"propTypes",value:{isScrolling:l.bool,fixedColumns:l.array.isRequired,height:l.number.isRequired,index:l.number.isRequired,scrollableColumns:l.array.isRequired,scrollLeft:l.number.isRequired,width:l.number.isRequired,onClick:l.func,onDoubleClick:l.func,onColumnResize:l.func},enumerable:!0}]),t}(u.Component),m=function(e){function t(){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return r(t,e),s(t,[{key:"render",value:function(){var e={width:this.props.width,height:this.props.height,zIndex:this.props.zIndex?this.props.zIndex:0};return p(e,0,this.props.offsetTop),u.createElement("div",{style:e,className:h("fixedDataTableRowLayout/rowWrapper")},u.createElement(d,i({},this.props,{offsetTop:void 0,zIndex:void 0})))}}],[{key:"propTypes",value:{isScrolling:l.bool,height:l.number.isRequired,zIndex:l.number,offsetTop:l.number.isRequired,width:l.number.isRequired},enumerable:!0}]),t}(u.Component);e.exports=m},function(e,t,o){"use strict";function n(e,t){var o={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}var r=Object.assign||function(e){for(var t=1;t=0){var l="cell_"+r;o[r]=this._renderCell(e.rowIndex,e.rowHeight,s,n,l)}n+=s.width}var u=this._getColumnsWidth(t),p={height:e.height,position:"absolute",width:u,zIndex:e.zIndex};return h(p,-1*f*e.left,0),a.createElement("div",{className:c("fixedDataTableCellGroupLayout/cellGroup"),style:p},o)},_renderCell:function(e,t,o,n,r){var i=o.isResizable&&this.props.onColumnResize,s=i?this.props.onColumnResize:null,l=o.cellClassName;return a.createElement(u,{isScrolling:this.props.isScrolling,align:o.align,className:l,height:t,key:r,maxWidth:o.maxWidth,minWidth:o.minWidth,onColumnResize:s,rowIndex:e,columnKey:o.columnKey,width:o.width,left:n,cell:o.cell})},_getColumnsWidth:function(e){for(var t=0,o=0;o=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}var r=o(78),i=o(73),s=o(27),a=o(34),l=o(37),u=o(60),c=o(79),h=i.DIR_SIGN,f={align:"left",highlighted:!1},p=l({displayName:"FixedDataTableCell",propTypes_DISABLED_FOR_PERFORMANCE:{isScrolling:s.bool,align:s.oneOf(["left","center","right"]),className:s.string,highlighted:s.bool,width:s.number.isRequired,minWidth:s.number,maxWidth:s.number,height:s.number.isRequired,cell:s.oneOfType([s.string,s.element,s.func]),columnKey:s.oneOfType([s.string,s.number]),rowIndex:s.number.isRequired,onColumnResize:s.func,left:s.number},shouldComponentUpdate:function(e){return!e.isScrolling||this.props.rowIndex!==e.rowIndex},getDefaultProps:function(){return f},render:function(){var e=this.props,t=e.height,o=e.width,i=e.columnKey,s=n(e,["height","width","columnKey"]),l={height:t,width:o};1===h?l.left=s.left:l.right=s.left;var f,p=c(u({"fixedDataTableCellLayout/main":!0,"fixedDataTableCellLayout/lastChild":s.lastChild,"fixedDataTableCellLayout/alignRight":"right"===s.align,"fixedDataTableCellLayout/alignCenter":"center"===s.align,"public/fixedDataTableCell/alignRight":"right"===s.align,"public/fixedDataTableCell/highlighted":s.highlighted,"public/fixedDataTableCell/main":!0}),s.className);if(s.onColumnResize){var d={height:t};f=a.createElement("div",{className:u("fixedDataTableCellLayout/columnResizerContainer"),style:d,onMouseDown:this._onColumnResizerMouseDown},a.createElement("div",{className:c(u("fixedDataTableCellLayout/columnResizerKnob"),u("public/fixedDataTableCell/columnResizerKnob")),style:d}))}var m={columnKey:i,height:t,width:o};s.rowIndex>=0&&(m.rowIndex=s.rowIndex);var v;return v=a.isValidElement(s.cell)?a.cloneElement(s.cell,m):"function"==typeof s.cell?s.cell(m):a.createElement(r,m,s.cell),a.createElement("div",{className:p,style:l},f,v)},_onColumnResizerMouseDown:function(e){this.props.onColumnResize(this.props.left,this.props.width,this.props.minWidth,this.props.maxWidth,this.props.columnKey,e)}});e.exports=p},function(e,t,o){"use strict";function n(e,t){var o={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=Object.assign||function(e){for(var t=1;t1)for(var n=1;n=0&&t>=e-a;){var o=this._updateRowHeight(t);this._position+=o,t--}}},{key:"_updateRowHeight",value:function(e){if(e<0||e>=this._rowCount)return 0;var t=this._rowHeightGetter(e);if(t!==this._storedHeights[e]){var o=t-this._storedHeights[e];return this._rowOffsets.set(e,t),this._storedHeights[e]=t,this._contentHeight+=o,o}return 0}},{key:"getRowPosition",value:function(e){return this._updateRowHeight(e),this._rowOffsets.sumUntil(e)}},{key:"scrollBy",value:function(e){if(0===this._rowCount)return l;var t=this._rowOffsets.greatestLowerBound(this._position);t=s(t,0,Math.max(this._rowCount-1,0));var o=this._rowOffsets.sumUntil(t),n=t,r=this._position,i=this._updateRowHeight(n);0!==o&&(r+=i);var a=this._storedHeights[n]-(r-o);if(e>=0)for(;e>0&&n0&&n>=0;)if(e=0){var c=this._updateRowHeight(n);u=this._storedHeights[n],r+=c}}var h=this._contentHeight-this._viewportHeight;r=s(r,0,h),this._position=r;var f=this._rowOffsets.greatestLowerBound(r);f=s(f,0,Math.max(this._rowCount-1,0)),o=this._rowOffsets.sumUntil(f);var p=o-r;return this._updateHeightsInViewport(f,p),this._updateHeightsAboveViewport(f),{index:f,offset:p,position:this._position,contentHeight:this._contentHeight}}},{key:"_getRowAtEndPosition",value:function(e){this._updateRowHeight(e);for(var t=e,o=this._storedHeights[t];o=0;)t--,t>=0&&(this._updateRowHeight(t),o+=this._storedHeights[t]);var n=this._rowOffsets.sumTo(e)-this._viewportHeight;return n<0&&(n=0),n}},{key:"scrollTo",value:function(e){if(0===this._rowCount)return l;if(e<=0)return this._position=0,this._updateHeightsInViewport(0,0),{index:0,offset:0,position:this._position,contentHeight:this._contentHeight};if(e>=this._contentHeight-this._viewportHeight){var t=this._rowCount-1;e=this._getRowAtEndPosition(t)}this._position=e;var o=this._rowOffsets.greatestLowerBound(e);o=s(o,0,Math.max(this._rowCount-1,0));var n=this._rowOffsets.sumUntil(o),r=n-e;return this._updateHeightsInViewport(o,r),this._updateHeightsAboveViewport(o),{index:o,offset:r,position:this._position,contentHeight:this._contentHeight}}},{key:"scrollToRow",value:function(e,t){e=s(e,0,Math.max(this._rowCount-1,0)),t=s(t,-this._storedHeights[e],0);var o=this._rowOffsets.sumUntil(e);return this.scrollTo(o-t)}},{key:"scrollRowIntoView",value:function(e){e=s(e,0,Math.max(this._rowCount-1,0));var t=this._rowOffsets.sumUntil(e),o=t+this._storedHeights[e];if(t=0;--o)t[o]=0;return t},u=function(){function e(t){n(this,e),this._size=t.length,this._half=r(this._size),this._heap=new l(2*this._half);var o;for(o=0;o0;--o)this._heap[o]=this._heap[2*o]+this._heap[2*o+1]}return i(e,[{key:"set",value:function(e,t){s(0<=e&&e=0;--r)n[r]=o;return new e(n)}},{key:"empty",value:function(t){return e.uniform(t,0)}}]),e}();e.exports=u}).call(t,function(){return this}())},function(e,t,o){"use strict";function n(e){for(var t=0,o=0;o1)for(var o=1;o0||e>=0&&this.state.scrollX0||e>=0&&this.state.scrollYn?n:this.state.height>n&&this.props.ownerHeight?Math.max(n,this.props.ownerHeight):this.state.height+this.state.maxScrollY,e!==this._contentHeight&&this.props.onContentHeightChange&&this.props.onContentHeightChange(e),this._contentHeight=e},componentDidMount:function(){this._reportContentHeight(),this._isMounted=!0},componentWillReceiveProps:function(e){var t=e.scrollToRow;void 0!==t&&null!==t&&(this._rowToScrollTo=t);var o=e.scrollToColumn;void 0!==o&&null!==o&&(this._columnToScrollTo=o);var n=e.overflowX,r=e.overflowY;n===this.props.overflowX&&r===this.props.overflowY||(this._wheelHandler=new l(this._onWheel,"hidden"!==n,"hidden"!==r)),this.props.ownerHeight===e.ownerHeight&&this.props.scrollTop===e.scrollTop||this._didScrollStart(),this._didScrollStop(),this.setState(this._calculateState(e,this.state))},componentDidUpdate:function(){this._reportContentHeight()},render:function(){var e,t=this.state,o=this.props;t.useGroupHeader&&(e=i.createElement(f,{key:"group_header",isScrolling:this._isScrolling,className:y(m("fixedDataTableLayout/header"),m("public/fixedDataTable/header")),width:t.width,height:t.groupHeaderHeight,index:0,zIndex:1,offsetTop:0,scrollLeft:t.scrollX,fixedColumns:t.groupHeaderFixedColumns,scrollableColumns:t.groupHeaderScrollableColumns,onColumnResize:this._onColumnResize}));var r=this.state.maxScrollY,s=t.maxScrollX>0&&"hidden"!==t.overflowX,a=r>0&&"hidden"!==t.overflowY,l=s?u.SIZE:0,c=t.height-l-2*R-t.footerHeight,p=t.useGroupHeader?t.groupHeaderHeight:0,d=p+t.headerHeight;c-=d;var v=0,_=null!=o.maxHeight?d+t.bodyHeight:d+c,g=_+t.footerHeight;void 0!==o.ownerHeight&&o.ownerHeightt.ownerHeight||t.scrollY or "),o.push(e))});var r=!1;o.length&&o[0].type.__TableColumnGroup__&&(r=!0),t&&(void 0!==e.width&&e.width!==t.width||void 0!==e.height&&e.height!==t.height||void 0!==e.maxWidth&&e.maxWidth!==t.maxWidth||void 0!==e.maxHeight&&e.maxHeight!==t.maxHeight)&&(t=null);var i,s,a=t&&t.firstRowIndex||0,l=t&&t.firstRowOffset||0;i=t&&"hidden"!==e.overflowX?t.scrollX:e.scrollLeft,t&&"hidden"!==e.overflowY?s=t.scrollY:(f=this._scrollHelper.scrollTo(e.scrollTop),a=f.index,l=f.offset,s=f.position),void 0!==this._rowToScrollTo&&(f=this._scrollHelper.scrollRowIntoView(this._rowToScrollTo),a=f.index,l=f.offset,s=f.position,delete this._rowToScrollTo);var c=r?e.groupHeaderHeight:0;if(t&&e.rowsCount!==t.rowsCount){var h=(void 0===e.height?e.maxHeight:e.height)-(e.headerHeight||0)-(e.footerHeight||0)-(e.groupHeaderHeight||0);this._scrollHelper=new p(e.rowsCount,e.rowHeight,h,e.rowHeightGetter);var f=this._scrollHelper.scrollToRow(a,l);a=f.index,l=f.offset,s=f.position}else t&&e.rowHeightGetter!==t.rowHeightGetter&&this._scrollHelper.setRowHeightGetter(e.rowHeightGetter);var m;m=e.isColumnResizing?t&&t.columnResizingData:C;var v,_;if(r){var y=d.adjustColumnGroupWidths(o,e.width);v=y.columns,_=y.columnGroups}else v=d.adjustColumnWidths(o,e.width);var w=this._populateColumnsAndColumnData(v,_,t);if(void 0!==this._columnToScrollTo){var b=w.bodyFixedColumns.length;if(this._columnToScrollTo>=b){var E,D,T=0;for(E=0;EO&&(i=O)}delete this._columnToScrollTo}var k=void 0===e.height,P=Math.round(k?e.maxHeight:e.height),I=e.footerHeight+e.headerHeight+c+2*R,z=P-I,j=this._scrollHelper.getContentHeight(),A=j+I,F=d.getTotalWidth(v),L=F>e.width&&"hidden"!==e.overflowX;L&&(z-=u.SIZE,A+=u.SIZE,I+=u.SIZE);var G=Math.max(0,F-e.width),W=Math.max(0,j-z);i=Math.min(i,G),s=Math.min(s,W),W||(k&&(P=A),z=A-I),this._scrollHelper.setViewportHeight(z);var V=n({isColumnResizing:t&&t.isColumnResizing},w,e,{columns:v,columnGroups:_,columnResizingData:m,firstRowIndex:a,firstRowOffset:l,horizontalScrollbarVisible:L,maxScrollX:G,maxScrollY:W,reservedHeight:I,scrollContentHeight:j,scrollX:i,scrollY:s,bodyHeight:z,height:P,groupHeaderHeight:c,useGroupHeader:r});return V},_selectColumnElement:function(e,t){for(var o=[],n=0;nMath.abs(e)&&"hidden"!==this.props.overflowY){var n=this._scrollHelper.scrollBy(Math.round(t)),r=Math.max(0,n.contentHeight-this.state.bodyHeight);this.setState({firstRowIndex:n.index,firstRowOffset:n.offset,scrollY:n.position,scrollContentHeight:n.contentHeight,maxScrollY:r})}else e&&"hidden"!==this.props.overflowX&&(o+=e,o=o<0?0:o,o=o>this.state.maxScrollX?this.state.maxScrollX:o,this.setState({scrollX:o}));this._didScrollStop()}},_onHorizontalScroll:function(e){this._isMounted&&e!==this.state.scrollX&&(this._isScrolling||this._didScrollStart(),this.setState({scrollX:e}),this._didScrollStop())},_onVerticalScroll:function(e){if(this._isMounted&&e!==this.state.scrollY){this._isScrolling||this._didScrollStart();var t=this._scrollHelper.scrollTo(Math.round(e));this.setState({firstRowIndex:t.index,firstRowOffset:t.offset,scrollY:t.position,scrollContentHeight:t.contentHeight}),this._didScrollStop()}},_didScrollStart:function(){this._isMounted&&!this._isScrolling&&(this._isScrolling=!0,this.props.onScrollStart&&this.props.onScrollStart(this.state.scrollX,this.state.scrollY))},_didScrollStop:function(){this._isMounted&&this._isScrolling&&(this._isScrolling=!1,this.setState({redraw:!0}),this.props.onScrollEnd&&this.props.onScrollEnd(this.state.scrollX,this.state.scrollY))}}),O=s({displayName:"HorizontalScrollbar",mixins:[a],propTypes:{contentSize:r.number.isRequired,offset:r.number.isRequired,onScroll:r.func.isRequired,position:r.number.isRequired,size:r.number.isRequired},render:function(){var e=n({height:u.SIZE,width:this.props.size},this.props.horizontalScrollbarStyle),t={height:u.SIZE,position:"absolute",overflow:"hidden",width:this.props.size};return b(t,0,this.props.offset),i.createElement("div",{className:y(m("fixedDataTableLayout/horizontalScrollbar"),m("public/fixedDataTable/horizontalScrollbar")),style:e},i.createElement("div",{style:t},i.createElement(u,n({},this.props,{isOpaque:!0,orientation:"horizontal",offset:void 0}))))}});e.exports=S},function(e,t,o){"use strict";var n=o(35),r=o(38);if("undefined"==typeof n)throw Error("create-react-class could not find the React object. If you are using script tags, make sure that React is being loaded before create-react-class.");var i=(new n.Component).updater;e.exports=r(n.Component,n.isValidElement,i)},function(e,t,o){(function(t){"use strict";function n(e){return e}function r(e,o,r){function h(e,o,n){for(var r in o)o.hasOwnProperty(r)&&"production"!==t.env.NODE_ENV&&l("function"==typeof o[r],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",e.displayName||"ReactClass",u[n],r)}function f(e,t){var o=x.hasOwnProperty(t)?x[t]:null;T.hasOwnProperty(t)&&a("OVERRIDE_BASE"===o,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t), +e&&a("DEFINE_MANY"===o||"DEFINE_MANY_MERGED"===o,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function p(e,n){if(n){a("function"!=typeof n,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),a(!o(n),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=e.prototype,i=r.__reactAutoBindPairs;n.hasOwnProperty(c)&&R.mixins(e,n.mixins);for(var s in n)if(n.hasOwnProperty(s)&&s!==c){var u=n[s],h=r.hasOwnProperty(s);if(f(h,s),R.hasOwnProperty(s))R[s](e,u);else{var p=x.hasOwnProperty(s),d="function"==typeof u,m=d&&!p&&!h&&n.autobind!==!1;if(m)i.push(s,u),r[s]=u;else if(h){var g=x[s];a(p&&("DEFINE_MANY_MERGED"===g||"DEFINE_MANY"===g),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",g,s),"DEFINE_MANY_MERGED"===g?r[s]=v(r[s],u):"DEFINE_MANY"===g&&(r[s]=_(r[s],u))}else r[s]=u,"production"!==t.env.NODE_ENV&&"function"==typeof u&&n.displayName&&(r[s].displayName=n.displayName+"_"+s)}}}else if("production"!==t.env.NODE_ENV){var y=typeof n,w="object"===y&&null!==n;"production"!==t.env.NODE_ENV&&l(w,"%s: You're attempting to include a mixin that is either null or not an object. Check the mixins included by the component, as well as any mixins they include themselves. Expected object but got %s.",e.displayName||"ReactClass",null===n?null:y)}}function d(e,t){if(t)for(var o in t){var n=t[o];if(t.hasOwnProperty(o)){var r=o in R;a(!r,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',o);var i=o in e;if(i){var s=C.hasOwnProperty(o)?C[o]:null;return a("DEFINE_MANY_MERGED"===s,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",o),void(e[o]=v(e[o],n))}e[o]=n}}}function m(e,t){a(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var o in t)t.hasOwnProperty(o)&&(a(void 0===e[o],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",o),e[o]=t[o]);return e}function v(e,t){return function(){var o=e.apply(this,arguments),n=t.apply(this,arguments);if(null==o)return n;if(null==n)return o;var r={};return m(r,o),m(r,n),r}}function _(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function g(e,o){var n=o.bind(e);if("production"!==t.env.NODE_ENV){n.__reactBoundContext=e,n.__reactBoundMethod=o,n.__reactBoundArguments=null;var r=e.constructor.displayName,i=n.bind;n.bind=function(s){for(var a=arguments.length,u=Array(a>1?a-1:0),c=1;c1?t-1:0),n=1;n2?o-2:0),r=2;rn},ie64:function(){return y.ie()&&p},firefox:function(){return o()||r},opera:function(){return o()||i},webkit:function(){return o()||s},safari:function(){return y.webkit()},chrome:function(){return o()||a},windows:function(){return o()||c},osx:function(){return o()||u},linux:function(){return o()||h},iphone:function(){return o()||d},mobile:function(){return o()||d||m||f||_},nativeApp:function(){return o()||v},android:function(){return o()||f},ipad:function(){return o()||m}};e.exports=y},function(e,t,o){"use strict";function n(e,t){if(!i.canUseDOM||t&&!("addEventListener"in document))return!1;var o="on"+e,n=o in document;if(!n){var s=document.createElement("div");s.setAttribute(o,"return;"),n="function"==typeof s[o]}return!n&&r&&"wheel"===e&&(n=document.implementation.hasFeature("Events.wheel","3.0")),n}var r,i=o(49);i.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),e.exports=n},function(e,t){"use strict";var o=!("undefined"==typeof window||!window.document||!window.document.createElement),n={canUseDOM:o,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:o&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:o&&!!window.screen,isInWorker:!o};e.exports=n},function(e,t,o){(function(t){"use strict";var n=o(45),r=o(51),i=0,s=r||function(e){var o=Date.now(),n=Math.max(0,16-(o-i));return i=o+n,t.setTimeout(function(){e(Date.now())},n)};s(n),e.exports=s}).call(t,function(){return this}())},function(e,t){(function(t){"use strict";var o=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame;e.exports=o}).call(t,function(){return this}())},function(e,t,o){"use strict";var n=o(53),r=o(56),i=o(27),s=o(34),a=o(37),l=o(57),u=o(43),c=o(44),h=o(59),f=o(60),p=o(45),d=o(61),m={position:0,scrollable:!1},v=parseInt(h("scrollbar-face-margin"),10),_=2*v,g=30,y=40,w=null,b=a({displayName:"Scrollbar",mixins:[u],propTypes:{contentSize:i.number.isRequired,defaultPosition:i.number,isOpaque:i.bool,orientation:i.oneOf(["vertical","horizontal"]),onScroll:i.func,position:i.number,size:i.number.isRequired,trackColor:i.oneOf(["gray"]),zIndex:i.number,verticalTop:i.number},getInitialState:function(){var e=this.props;return this._calculateState(e.position||e.defaultPosition||0,e.size,e.contentSize,e.orientation)},componentWillReceiveProps:function(e){var t=e.position;void 0===t?this._setNextState(this._calculateState(this.state.position,e.size,e.contentSize,e.orientation)):this._setNextState(this._calculateState(t,e.size,e.contentSize,e.orientation),e)},getDefaultProps:function(){return{defaultPosition:0,isOpaque:!1,onScroll:p,orientation:"vertical",zIndex:99}},render:function(){if(!this.state.scrollable)return null;var e,t,o=this.props.size,n=this.state.isHorizontal,r=!n,i=this.state.focused||this.state.isDragging,a=this.state.faceSize,l=this.props.isOpaque,u=this.props.verticalTop||0,c=f({"ScrollbarLayout/main":!0,"ScrollbarLayout/mainVertical":r,"ScrollbarLayout/mainHorizontal":n,"public/Scrollbar/main":!0,"public/Scrollbar/mainOpaque":l,"public/Scrollbar/mainActive":i}),p=f({"ScrollbarLayout/face":!0,"ScrollbarLayout/faceHorizontal":n,"ScrollbarLayout/faceVertical":r,"public/Scrollbar/faceActive":i,"public/Scrollbar/face":!0}),m=this.state.position*this.state.scale+v;return n?(e={width:o},t={width:a-_},d(t,m,0)):(e={top:u,height:o},t={height:a-_},d(t,0,m)),e.zIndex=this.props.zIndex,"gray"===this.props.trackColor&&(e.backgroundColor=h("fbui-desktop-background-light")),s.createElement("div",{onFocus:this._onFocus,onBlur:this._onBlur,onKeyDown:this._onKeyDown,onMouseDown:this._onMouseDown,onWheel:this._wheelHandler.onWheel,className:c,style:e,tabIndex:0},s.createElement("div",{ref:"face",className:p,style:t}))},componentWillMount:function(){var e="horizontal"===this.props.orientation,t=e?this._onWheelX:this._onWheelY;this._wheelHandler=new c(t,this._shouldHandleX,this._shouldHandleY)},componentDidMount:function(){this._mouseMoveTracker=new n(this._onMouseMove,this._onMouseMoveEnd,document.documentElement),void 0!==this.props.position&&this.state.position!==this.props.position&&this._didScroll(),this._isMounted=!0},componentWillUnmount:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),w===this&&(w=null),delete this._mouseMoveTracker,this._isMounted=!1},scrollBy:function(e){this._onWheel(e)},_shouldHandleX:function(e){return"horizontal"===this.props.orientation&&this._shouldHandleChange(e)},_shouldHandleY:function(e){return"horizontal"!==this.props.orientation&&this._shouldHandleChange(e)},_shouldHandleChange:function(e){var t=this._calculateState(this.state.position+e,this.props.size,this.props.contentSize,this.props.orientation);return t.position!==this.state.position},_calculateState:function(e,t,o,n){if(t<1||o<=t)return m;var r=e+"_"+t+"_"+o+"_"+n;if(this._stateKey===r)return this._stateForKey;var i="horizontal"===n,s=t/o,a=t*s;au&&(e=u);var c=!!this._mouseMoveTracker&&this._mouseMoveTracker.isDragging(),h={faceSize:a,isDragging:c,isHorizontal:i,position:e,scale:s,scrollable:l};return this._stateKey=r,this._stateForKey=h,h},_onWheelY:function(e,t){this._onWheel(t)},_onWheelX:function(e,t){this._onWheel(e)},_onWheel:function(e){var t=this.props;this._setNextState(this._calculateState(this.state.position+e,t.size,t.contentSize,t.orientation))},_onMouseDown:function(e){var t;if(e.target!==l.findDOMNode(this.refs.face)){var o=e.nativeEvent,n=this.state.isHorizontal?o.offsetX||o.layerX:o.offsetY||o.layerY,r=this.props;n/=this.state.scale,t=this._calculateState(n-.5*this.state.faceSize/this.state.scale,r.size,r.contentSize,r.orientation)}else t={};t.focused=!0,this._setNextState(t),this._mouseMoveTracker.captureMouseMoves(e),l.findDOMNode(this).focus()},_onMouseMove:function(e,t){var o=this.props,n=this.state.isHorizontal?e:t;n/=this.state.scale,this._setNextState(this._calculateState(this.state.position+n,o.size,o.contentSize,o.orientation))},_onMouseMoveEnd:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),this.setState({isDragging:!1})},_onKeyDown:function(e){var t=e.keyCode;if(t!==r.TAB){var o=y,n=0;if(this.state.isHorizontal)switch(t){case r.HOME:n=-1,o=this.props.contentSize;break;case r.LEFT:n=-1;break;case r.RIGHT:n=1;break;default:return}if(!this.state.isHorizontal)switch(t){case r.SPACE:n=e.shiftKey?-1:1;break;case r.HOME:n=-1,o=this.props.contentSize;break;case r.UP:n=-1;break;case r.DOWN:n=1;break;case r.PAGE_UP:n=-1,o=this.props.size;break;case r.PAGE_DOWN:n=1,o=this.props.size;break;default:return}e.preventDefault();var i=this.props;this._setNextState(this._calculateState(this.state.position+o*n,i.size,i.contentSize,i.orientation))}},_onFocus:function(){this.setState({focused:!0})},_onBlur:function(){this.setState({focused:!1})},_blur:function(){if(this._isMounted)try{this._onBlur(),l.findDOMNode(this).blur()}catch(e){}},_setNextState:function(e,t){t=t||this.props;var o=t.position,n=this.state.position!==e.position;if(void 0===o){var r=n?this._didScroll:void 0;this.setState(e,r)}else{if(o!==e.position)return void(void 0!==e.position&&e.position!==this.state.position&&this.props.onScroll(e.position));this.setState(e)}n&&w!==this&&(w&&w._blur(),w=this)},_didScroll:function(){this.props.onScroll(this.state.position)}});b.KEYBOARD_SCROLL_AMOUNT=y,b.SIZE=parseInt(h("scrollbar-size"),10),e.exports=b},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var o=0;o0;)this._addRowToBuffer(t,this._viewportRowsBegin,this._viewportRowsEnd-1),t++,e--;return this._rows}},{key:"getRows",value:function(e,t){var o=t,n=o,r=e,i=Math.min(e+this._maxVisibleRowCount,this._rowsCount);for(this._viewportRowsBegin=e;r=i&&(n=this._bufferSet.replaceFurthestValuePosition(t,o,e)),null===n?(n=this._bufferSet.getNewPositionForValue(e),this._rows[n]=e):this._rows[n]=e}}]),e}();e.exports=c},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var o=0;o=e&&r<=t)return null;var i;e-n>r-t?(i=n,this._smallValues.pop()):(i=r,this._largeValues.pop());var a=this._valueToPositionMap[i];return delete this._valueToPositionMap[i],this._valueToPositionMap[o]=a,this._pushToHeaps(a,o),a}},{key:"_pushToHeaps",value:function(e,t){var o={position:e,value:t};this._smallValues.push(o),this._largeValues.push(o)}},{key:"_cleanHeaps",value:function(){this._cleanHeap(this._smallValues),this._cleanHeap(this._largeValues);var e=Math.min(this._smallValues.size(),this._largeValues.size()),t=Math.max(this._smallValues.size(),this._largeValues.size());t>10*e&&this._recreateHeaps()}},{key:"_recreateHeaps",value:function(){for(var e=this._smallValues.size()t.value}}]),e}();e.exports=a},function(e,t){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){return e0&&(this._items[0]=t,this._sinkDown(0)),e}}},{key:"push",value:function(e){this._items[this._size++]=e,this._bubbleUp(this._size-1)}},{key:"size",value:function(){return this._size}},{key:"peek",value:function(){if(0!==this._size)return this._items[0]}},{key:"_heapify",value:function(){for(var e=Math.floor((this._size+1)/2);e>=0;e--)this._sinkDown(e)}},{key:"_bubbleUp",value:function(e){for(var t=this._items[e];e>0;){var o=Math.floor((e+1)/2)-1,n=this._items[o];if(this._comparator(n,t))return;this._items[o]=t,this._items[e]=n,e=o}}},{key:"_sinkDown",value:function(e){for(var t=this._items[e];;){var o=2*(e+1)-1,n=2*(e+1),r=-1;if(oo?o:e}e.exports=o},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=Object.assign||function(e){for(var t=1;t0){var o=h({"fixedDataTableRowLayout/fixedColumnsDivider":!0,"fixedDataTableRowLayout/columnsShadow":e.props.scrollLeft>0,"public/fixedDataTableRow/fixedColumnsDivider":!0,"public/fixedDataTableRow/columnsShadow":e.props.scrollLeft>0}),n={left:t,height:e.props.height};return u.createElement("div",{className:o,style:n})}},this._onClick=function(t){e.props.onClick(t,e.props.index)},this._onDoubleClick=function(t){e.props.onDoubleClick(t,e.props.index)},this._onMouseDown=function(t){e.props.onMouseDown(t,e.props.index)},this._onMouseEnter=function(t){e.props.onMouseEnter(t,e.props.index)},this._onMouseLeave=function(t){e.props.onMouseLeave(t,e.props.index)}}return r(t,e),s(t,[{key:"render",value:function(){var e={width:this.props.width,height:this.props.height},t=h({"fixedDataTableRowLayout/main":!0,"public/fixedDataTableRow/main":!0,"public/fixedDataTableRow/highlighted":this.props.index%2===1,"public/fixedDataTableRow/odd":this.props.index%2===1,"public/fixedDataTableRow/even":this.props.index%2===0}),o=this._getColumnsWidth(this.props.fixedColumns),n=u.createElement(c,{key:"fixed_cells",isScrolling:this.props.isScrolling,height:this.props.height,left:0,width:o,zIndex:2,columns:this.props.fixedColumns,onColumnResize:this.props.onColumnResize,rowHeight:this.props.height,rowIndex:this.props.index}),r=this._renderColumnsShadow(o),i=u.createElement(c,{key:"scrollable_cells",isScrolling:this.props.isScrolling,height:this.props.height,left:this.props.scrollLeft,offsetLeft:o,width:this.props.width-o,zIndex:0,columns:this.props.scrollableColumns,onColumnResize:this.props.onColumnResize,rowHeight:this.props.height,rowIndex:this.props.index});return u.createElement("div",{className:f(t,this.props.className),onClick:this.props.onClick?this._onClick:null,onDoubleClick:this.props.onDoubleClick?this._onDoubleClick:null,onMouseDown:this.props.onMouseDown?this._onMouseDown:null,onMouseEnter:this.props.onMouseEnter?this._onMouseEnter:null,onMouseLeave:this.props.onMouseLeave?this._onMouseLeave:null,style:e},u.createElement("div",{className:h("fixedDataTableRowLayout/body")},n,i,r))}}],[{key:"propTypes",value:{isScrolling:l.bool,fixedColumns:l.array.isRequired,height:l.number.isRequired,index:l.number.isRequired,scrollableColumns:l.array.isRequired,scrollLeft:l.number.isRequired,width:l.number.isRequired,onClick:l.func,onDoubleClick:l.func,onColumnResize:l.func},enumerable:!0}]),t}(u.Component),m=function(e){function t(){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return r(t,e),s(t,[{key:"render",value:function(){var e={width:this.props.width,height:this.props.height,zIndex:this.props.zIndex?this.props.zIndex:0};return p(e,0,this.props.offsetTop),u.createElement("div",{style:e,className:h("fixedDataTableRowLayout/rowWrapper")},u.createElement(d,i({},this.props,{offsetTop:void 0,zIndex:void 0})))}}],[{key:"propTypes",value:{isScrolling:l.bool,height:l.number.isRequired,zIndex:l.number,offsetTop:l.number.isRequired,width:l.number.isRequired},enumerable:!0}]),t}(u.Component);e.exports=m},function(e,t,o){"use strict";function n(e,t){var o={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}var r=Object.assign||function(e){for(var t=1;t=0){var l="cell_"+r;o[r]=this._renderCell(e.rowIndex,e.rowHeight,s,n,l)}n+=s.width}var u=this._getColumnsWidth(t),p={height:e.height,position:"absolute",width:u,zIndex:e.zIndex};return h(p,-1*f*e.left,0),a.createElement("div",{className:c("fixedDataTableCellGroupLayout/cellGroup"),style:p},o)},_renderCell:function(e,t,o,n,r){var i=o.isResizable&&this.props.onColumnResize,s=i?this.props.onColumnResize:null,l=o.cellClassName;return a.createElement(u,{isScrolling:this.props.isScrolling,align:o.align,className:l,height:t,key:r,maxWidth:o.maxWidth,minWidth:o.minWidth,onColumnResize:s,rowIndex:e,columnKey:o.columnKey,width:o.width,left:n,cell:o.cell})},_getColumnsWidth:function(e){for(var t=0,o=0;o=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}var r=o(78),i=o(73),s=o(27),a=o(34),l=o(37),u=o(60),c=o(79),h=i.DIR_SIGN,f={align:"left",highlighted:!1},p=l({displayName:"FixedDataTableCell",propTypes_DISABLED_FOR_PERFORMANCE:{isScrolling:s.bool,align:s.oneOf(["left","center","right"]),className:s.string,highlighted:s.bool,width:s.number.isRequired,minWidth:s.number,maxWidth:s.number,height:s.number.isRequired,cell:s.oneOfType([s.string,s.element,s.func]),columnKey:s.oneOfType([s.string,s.number]),rowIndex:s.number.isRequired,onColumnResize:s.func,left:s.number},shouldComponentUpdate:function(e){return!e.isScrolling||this.props.rowIndex!==e.rowIndex},getDefaultProps:function(){return f},render:function(){var e=this.props,t=e.height,o=e.width,i=e.columnKey,s=n(e,["height","width","columnKey"]),l={height:t,width:o};1===h?l.left=s.left:l.right=s.left;var f,p=c(u({"fixedDataTableCellLayout/main":!0,"fixedDataTableCellLayout/lastChild":s.lastChild,"fixedDataTableCellLayout/alignRight":"right"===s.align,"fixedDataTableCellLayout/alignCenter":"center"===s.align,"public/fixedDataTableCell/alignRight":"right"===s.align,"public/fixedDataTableCell/highlighted":s.highlighted,"public/fixedDataTableCell/main":!0}),s.className);if(s.onColumnResize){var d={height:t};f=a.createElement("div",{className:u("fixedDataTableCellLayout/columnResizerContainer"),style:d,onMouseDown:this._onColumnResizerMouseDown},a.createElement("div",{className:c(u("fixedDataTableCellLayout/columnResizerKnob"),u("public/fixedDataTableCell/columnResizerKnob")),style:d}))}var m={columnKey:i,height:t,width:o};s.rowIndex>=0&&(m.rowIndex=s.rowIndex);var v;return v=a.isValidElement(s.cell)?a.cloneElement(s.cell,m):"function"==typeof s.cell?s.cell(m):a.createElement(r,m,s.cell),a.createElement("div",{className:p,style:l},f,v)},_onColumnResizerMouseDown:function(e){this.props.onColumnResize(this.props.left,this.props.width,this.props.minWidth,this.props.maxWidth,this.props.columnKey,e)}});e.exports=p},function(e,t,o){"use strict";function n(e,t){var o={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=Object.assign||function(e){for(var t=1;t1)for(var n=1;n=0&&t>=e-a;){var o=this._updateRowHeight(t);this._position+=o,t--}}},{key:"_updateRowHeight",value:function(e){if(e<0||e>=this._rowCount)return 0;var t=this._rowHeightGetter(e);if(t!==this._storedHeights[e]){var o=t-this._storedHeights[e];return this._rowOffsets.set(e,t),this._storedHeights[e]=t,this._contentHeight+=o,o}return 0}},{key:"getRowPosition",value:function(e){return this._updateRowHeight(e),this._rowOffsets.sumUntil(e)}},{key:"scrollBy",value:function(e){if(0===this._rowCount)return l;var t=this._rowOffsets.greatestLowerBound(this._position);t=s(t,0,Math.max(this._rowCount-1,0));var o=this._rowOffsets.sumUntil(t),n=t,r=this._position,i=this._updateRowHeight(n);0!==o&&(r+=i);var a=this._storedHeights[n]-(r-o);if(e>=0)for(;e>0&&n0&&n>=0;)if(e=0){var c=this._updateRowHeight(n);u=this._storedHeights[n],r+=c}}var h=this._contentHeight-this._viewportHeight;r=s(r,0,h),this._position=r;var f=this._rowOffsets.greatestLowerBound(r);f=s(f,0,Math.max(this._rowCount-1,0)),o=this._rowOffsets.sumUntil(f);var p=o-r;return this._updateHeightsInViewport(f,p),this._updateHeightsAboveViewport(f),{index:f,offset:p,position:this._position,contentHeight:this._contentHeight}}},{key:"_getRowAtEndPosition",value:function(e){this._updateRowHeight(e);for(var t=e,o=this._storedHeights[t];o=0;)t--,t>=0&&(this._updateRowHeight(t),o+=this._storedHeights[t]);var n=this._rowOffsets.sumTo(e)-this._viewportHeight;return n<0&&(n=0),n}},{key:"scrollTo",value:function(e){if(0===this._rowCount)return l;if(e<=0)return this._position=0,this._updateHeightsInViewport(0,0),{index:0,offset:0,position:this._position,contentHeight:this._contentHeight};if(e>=this._contentHeight-this._viewportHeight){var t=this._rowCount-1;e=this._getRowAtEndPosition(t)}this._position=e;var o=this._rowOffsets.greatestLowerBound(e);o=s(o,0,Math.max(this._rowCount-1,0));var n=this._rowOffsets.sumUntil(o),r=n-e;return this._updateHeightsInViewport(o,r),this._updateHeightsAboveViewport(o),{index:o,offset:r,position:this._position,contentHeight:this._contentHeight}}},{key:"scrollToRow",value:function(e,t){e=s(e,0,Math.max(this._rowCount-1,0)),t=s(t,-this._storedHeights[e],0);var o=this._rowOffsets.sumUntil(e);return this.scrollTo(o-t)}},{key:"scrollRowIntoView",value:function(e){e=s(e,0,Math.max(this._rowCount-1,0));var t=this._rowOffsets.sumUntil(e),o=t+this._storedHeights[e];if(t=0;--o)t[o]=0;return t},u=function(){function e(t){n(this,e),this._size=t.length,this._half=r(this._size),this._heap=new l(2*this._half);var o;for(o=0;o0;--o)this._heap[o]=this._heap[2*o]+this._heap[2*o+1]}return i(e,[{key:"set",value:function(e,t){s(0<=e&&e=0;--r)n[r]=o;return new e(n)}},{key:"empty",value:function(t){return e.uniform(t,0)}}]),e}();e.exports=u}).call(t,function(){return this}())},function(e,t,o){"use strict";function n(e){for(var t=0,o=0;o ); } @@ -1102,13 +1109,14 @@ var HorizontalScrollbar = createReactClass({ render() /*object*/ { var outerContainerStyle = { height: Scrollbar.SIZE, - width: this.props.size + width: this.props.size, + ...this.props.horizontalScrollbarStyle, }; var innerContainerStyle = { height: Scrollbar.SIZE, position: "absolute", overflow: "hidden", - width: this.props.size + width: this.props.size, }; translateDOMPositionXY(innerContainerStyle, 0, this.props.offset); From 192be4e6914d5ab9e4dd25b57c819c3c576c75d9 Mon Sep 17 00:00:00 2001 From: Kevin Chang Date: Fri, 16 Nov 2018 16:05:07 -0800 Subject: [PATCH 20/43] Version 0.7.8 --- .idea/fixed-data-table.iml | 12 + .idea/misc.xml | 6 + .idea/modules.xml | 8 + .idea/vcs.xml | 6 + .idea/workspace.xml | 510 ++++++++++++++++++++++++++++ dist/fixed-data-table-base.css | 2 +- dist/fixed-data-table-base.min.css | 2 +- dist/fixed-data-table-style.css | 2 +- dist/fixed-data-table-style.min.css | 2 +- 9 files changed, 546 insertions(+), 4 deletions(-) create mode 100644 .idea/fixed-data-table.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml diff --git a/.idea/fixed-data-table.iml b/.idea/fixed-data-table.iml new file mode 100644 index 00000000..24643cc3 --- /dev/null +++ b/.idea/fixed-data-table.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000..3668dc8c --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..46a9ced6 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..94a25f7f --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 00000000..ad008644 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,510 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + topShadowStyle + Scrollbar + <Scrollbar + HorizontalScrollbar + horizontalScrollbar + fixed-data-table + + + $PROJECT_DIR$/src + + + + + + + + + + + + + false + $USER_HOME$/.nvm/versions/node/v8.9.0/lib/node_modules/flow-bin + true + true + + + true + DEFINITION_ORDER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1542407316667 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dist/fixed-data-table-base.css b/dist/fixed-data-table-base.css index 1b6d0ab9..9b261d1b 100644 --- a/dist/fixed-data-table-base.css +++ b/dist/fixed-data-table-base.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.7 + * FixedDataTable v0.7.8 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table-base.min.css b/dist/fixed-data-table-base.min.css index e1d0bc23..5083f7ef 100644 --- a/dist/fixed-data-table-base.min.css +++ b/dist/fixed-data-table-base.min.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.7 + * FixedDataTable v0.7.8 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table-style.css b/dist/fixed-data-table-style.css index 48ead796..599b41f9 100644 --- a/dist/fixed-data-table-style.css +++ b/dist/fixed-data-table-style.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.7 + * FixedDataTable v0.7.8 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table-style.min.css b/dist/fixed-data-table-style.min.css index c54de2c5..0a49acee 100644 --- a/dist/fixed-data-table-style.min.css +++ b/dist/fixed-data-table-style.min.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.7 + * FixedDataTable v0.7.8 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. From 179a0b7abadccef9ee41343106d93aac05d130c8 Mon Sep 17 00:00:00 2001 From: Kevin Chang Date: Fri, 16 Nov 2018 16:17:04 -0800 Subject: [PATCH 21/43] Un-modify xml and iml changes --- .idea/fixed-data-table.iml | 12 - .idea/misc.xml | 6 - .idea/modules.xml | 8 - .idea/vcs.xml | 6 - .idea/workspace.xml | 510 ------------------------------------- 5 files changed, 542 deletions(-) delete mode 100644 .idea/fixed-data-table.iml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/vcs.xml delete mode 100644 .idea/workspace.xml diff --git a/.idea/fixed-data-table.iml b/.idea/fixed-data-table.iml deleted file mode 100644 index 24643cc3..00000000 --- a/.idea/fixed-data-table.iml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 3668dc8c..00000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 46a9ced6..00000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7f..00000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index ad008644..00000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,510 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - topShadowStyle - Scrollbar - <Scrollbar - HorizontalScrollbar - horizontalScrollbar - fixed-data-table - - - $PROJECT_DIR$/src - - - - - - - - - - - - - false - $USER_HOME$/.nvm/versions/node/v8.9.0/lib/node_modules/flow-bin - true - true - - - true - DEFINITION_ORDER - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1542407316667 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From abf5f04641597642c729cd2686147c379a3f903c Mon Sep 17 00:00:00 2001 From: Dennis Berko Date: Tue, 27 Nov 2018 12:08:18 -0800 Subject: [PATCH 22/43] Fire off a throttled onScroll event --- README.md | 18 +- build_helpers/buildMove.sh | 6 + dist/fixed-data-table-base.css | 2 +- dist/fixed-data-table-base.min.css | 2 +- dist/fixed-data-table-style.css | 2 +- dist/fixed-data-table-style.min.css | 2 +- dist/fixed-data-table.css | 2 +- dist/fixed-data-table.js | 484 +++++++++++++++++++++++++++- dist/fixed-data-table.min.css | 2 +- dist/fixed-data-table.min.js | 10 +- package-lock.json | 23 +- package.json | 8 +- src/FixedDataTableNew.react.js | 37 ++- 13 files changed, 566 insertions(+), 32 deletions(-) create mode 100755 build_helpers/buildMove.sh diff --git a/README.md b/README.md index 13cbbbd4..5a8a88dd 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,20 @@ -Why is there a fork of Facebook's [fixed-data-table](https://github.com/facebook/fixed-data-table/pull/331)? -==== +# Why is there a fork of Facebook's [fixed-data-table](https://github.com/facebook/fixed-data-table/pull/331)? There's a [scroll bug](https://github.com/facebook/fixed-data-table/issues/330) in Fixed Data Table that's causing a [user facing scroll bug](https://github.com/BuildingConnected/client/pull/180#issuecomment-163759904) in the project table. Until Al's [PR](https://github.com/facebook/fixed-data-table/pull/331) is accepted or this underlying bug is fixed, use this fork. + +## Local Testing + +To test changes locally without publishing to npm you can run the following +command + +``` +npm run build-move +``` + +## Publishing to NPM + +``` +npm run publish-package +``` diff --git a/build_helpers/buildMove.sh b/build_helpers/buildMove.sh new file mode 100755 index 00000000..5413ccd5 --- /dev/null +++ b/build_helpers/buildMove.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +client='../client/node_modules/@buildingconnected/fixed-data-table' + +rm -rf $client/internal +cp -r internal $client diff --git a/dist/fixed-data-table-base.css b/dist/fixed-data-table-base.css index 9b261d1b..b55b0be3 100644 --- a/dist/fixed-data-table-base.css +++ b/dist/fixed-data-table-base.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.8 + * FixedDataTable v0.7.9 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table-base.min.css b/dist/fixed-data-table-base.min.css index 5083f7ef..85217f32 100644 --- a/dist/fixed-data-table-base.min.css +++ b/dist/fixed-data-table-base.min.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.8 + * FixedDataTable v0.7.9 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table-style.css b/dist/fixed-data-table-style.css index 599b41f9..8384218a 100644 --- a/dist/fixed-data-table-style.css +++ b/dist/fixed-data-table-style.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.8 + * FixedDataTable v0.7.9 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table-style.min.css b/dist/fixed-data-table-style.min.css index 0a49acee..d244a8f4 100644 --- a/dist/fixed-data-table-style.min.css +++ b/dist/fixed-data-table-style.min.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.8 + * FixedDataTable v0.7.9 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table.css b/dist/fixed-data-table.css index 25c0eb9b..c91949fc 100644 --- a/dist/fixed-data-table.css +++ b/dist/fixed-data-table.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.8 + * FixedDataTable v0.7.9 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table.js b/dist/fixed-data-table.js index 855ee860..49bd38c7 100644 --- a/dist/fixed-data-table.js +++ b/dist/fixed-data-table.js @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.8 + * FixedDataTable v0.7.9 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -233,11 +233,11 @@ return /******/ (function(modules) { // webpackBootstrap // New Table API var Table = __webpack_require__(36); - var Column = __webpack_require__(86); - var ColumnGroup = __webpack_require__(87); + var Column = __webpack_require__(87); + var ColumnGroup = __webpack_require__(88); // Transition Cell - var TransitionCell = __webpack_require__(88); + var TransitionCell = __webpack_require__(89); var NEXT_VERSION = '0.7.0'; var DOCUMENTATION_URL = 'https://fburl.com/FixedDataTable-v0.6'; @@ -1866,6 +1866,7 @@ return /******/ (function(modules) { // webpackBootstrap var joinClasses = __webpack_require__(79); var shallowEqual = __webpack_require__(85); var translateDOMPositionXY = __webpack_require__(61); + var throttle = __webpack_require__(86); var ReactChildren = React.Children; @@ -2029,6 +2030,17 @@ return /******/ (function(modules) { // webpackBootstrap */ onScrollStart: PropTypes.func, + /** + * Callback that is called during scrolling with current horizontal + * and vertical scroll values. + */ + onScroll: PropTypes.func, + + /** + * Number of milliseconds to throttle the onScroll event + */ + onScrollThrottle: PropTypes.number, + /** * Callback that is called when scrolling ends or stops with new horizontal * and vertical scroll values. @@ -2133,6 +2145,7 @@ return /******/ (function(modules) { // webpackBootstrap this._columnToScrollTo = scrollToColumn; } this._wheelHandler = new ReactWheelHandler(this._onWheel, this._shouldHandleWheelX, this._shouldHandleWheelY); + this._onScroll = throttle(this._onScroll, this.props.onScrollThrottle || 0); }, _shouldHandleWheelX: function _shouldHandleWheelX( /*number*/delta) /*boolean*/{ @@ -2207,6 +2220,7 @@ return /******/ (function(modules) { // webpackBootstrap if (this.props.ownerHeight !== nextProps.ownerHeight || this.props.scrollTop !== nextProps.scrollTop) { this._didScrollStart(); } + this._didScroll(); this._didScrollStop(); this.setState(this._calculateState(nextProps, this.state)); @@ -2721,7 +2735,7 @@ return /******/ (function(modules) { // webpackBootstrap scrollX: x }); } - + this._didScroll(); this._didScrollStop(); } }, @@ -2734,6 +2748,7 @@ return /******/ (function(modules) { // webpackBootstrap this.setState({ scrollX: scrollPos }); + this._didScroll(); this._didScrollStop(); } }, @@ -2750,6 +2765,7 @@ return /******/ (function(modules) { // webpackBootstrap scrollY: scrollState.position, scrollContentHeight: scrollState.contentHeight }); + this._didScroll(); this._didScrollStop(); } }, @@ -2763,6 +2779,14 @@ return /******/ (function(modules) { // webpackBootstrap } }, + _didScroll: function _didScroll() { + if (this._isMounted && this._isScrolling) { + if (this.props.onScroll) { + this.props.onScroll(this.state.scrollX, this.state.scrollY); + } + } + }, + _didScrollStop: function _didScrollStop() { if (this._isMounted && this._isScrolling) { this._isScrolling = false; @@ -8833,6 +8857,452 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }), /* 86 */ +/***/ (function(module, exports) { + + /* WEBPACK VAR INJECTION */(function(global) {/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + + /** Used as the `TypeError` message for "Functions" methods. */ + var FUNC_ERROR_TEXT = 'Expected a function'; + + /** Used as references for various `Number` constants. */ + var NAN = 0 / 0; + + /** `Object#toString` result references. */ + var symbolTag = '[object Symbol]'; + + /** Used to match leading and trailing whitespace. */ + var reTrim = /^\s+|\s+$/g; + + /** Used to detect bad signed hexadecimal string values. */ + var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + + /** Used to detect binary string values. */ + var reIsBinary = /^0b[01]+$/i; + + /** Used to detect octal string values. */ + var reIsOctal = /^0o[0-7]+$/i; + + /** Built-in method references without a dependency on `root`. */ + var freeParseInt = parseInt; + + /** Detect free variable `global` from Node.js. */ + var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + + /** Detect free variable `self`. */ + var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + + /** Used as a reference to the global object. */ + var root = freeGlobal || freeSelf || Function('return this')(); + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var objectToString = objectProto.toString; + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeMax = Math.max, + nativeMin = Math.min; + + /** + * Gets the timestamp of the number of milliseconds that have elapsed since + * the Unix epoch (1 January 1970 00:00:00 UTC). + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Date + * @returns {number} Returns the timestamp. + * @example + * + * _.defer(function(stamp) { + * console.log(_.now() - stamp); + * }, _.now()); + * // => Logs the number of milliseconds it took for the deferred invocation. + */ + var now = function() { + return root.Date.now(); + }; + + /** + * Creates a debounced function that delays invoking `func` until after `wait` + * milliseconds have elapsed since the last time the debounced function was + * invoked. The debounced function comes with a `cancel` method to cancel + * delayed `func` invocations and a `flush` method to immediately invoke them. + * Provide `options` to indicate whether `func` should be invoked on the + * leading and/or trailing edge of the `wait` timeout. The `func` is invoked + * with the last arguments provided to the debounced function. Subsequent + * calls to the debounced function return the result of the last `func` + * invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the debounced function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.debounce` and `_.throttle`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to debounce. + * @param {number} [wait=0] The number of milliseconds to delay. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=false] + * Specify invoking on the leading edge of the timeout. + * @param {number} [options.maxWait] + * The maximum time `func` is allowed to be delayed before it's invoked. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * // Avoid costly calculations while the window size is in flux. + * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); + * + * // Invoke `sendMail` when clicked, debouncing subsequent calls. + * jQuery(element).on('click', _.debounce(sendMail, 300, { + * 'leading': true, + * 'trailing': false + * })); + * + * // Ensure `batchLog` is invoked once after 1 second of debounced calls. + * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); + * var source = new EventSource('/stream'); + * jQuery(source).on('message', debounced); + * + * // Cancel the trailing debounced invocation. + * jQuery(window).on('popstate', debounced.cancel); + */ + function debounce(func, wait, options) { + var lastArgs, + lastThis, + maxWait, + result, + timerId, + lastCallTime, + lastInvokeTime = 0, + leading = false, + maxing = false, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + wait = toNumber(wait) || 0; + if (isObject(options)) { + leading = !!options.leading; + maxing = 'maxWait' in options; + maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + + function invokeFunc(time) { + var args = lastArgs, + thisArg = lastThis; + + lastArgs = lastThis = undefined; + lastInvokeTime = time; + result = func.apply(thisArg, args); + return result; + } + + function leadingEdge(time) { + // Reset any `maxWait` timer. + lastInvokeTime = time; + // Start the timer for the trailing edge. + timerId = setTimeout(timerExpired, wait); + // Invoke the leading edge. + return leading ? invokeFunc(time) : result; + } + + function remainingWait(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime, + result = wait - timeSinceLastCall; + + return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result; + } + + function shouldInvoke(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime; + + // Either this is the first call, activity has stopped and we're at the + // trailing edge, the system time has gone backwards and we're treating + // it as the trailing edge, or we've hit the `maxWait` limit. + return (lastCallTime === undefined || (timeSinceLastCall >= wait) || + (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); + } + + function timerExpired() { + var time = now(); + if (shouldInvoke(time)) { + return trailingEdge(time); + } + // Restart the timer. + timerId = setTimeout(timerExpired, remainingWait(time)); + } + + function trailingEdge(time) { + timerId = undefined; + + // Only invoke if we have `lastArgs` which means `func` has been + // debounced at least once. + if (trailing && lastArgs) { + return invokeFunc(time); + } + lastArgs = lastThis = undefined; + return result; + } + + function cancel() { + if (timerId !== undefined) { + clearTimeout(timerId); + } + lastInvokeTime = 0; + lastArgs = lastCallTime = lastThis = timerId = undefined; + } + + function flush() { + return timerId === undefined ? result : trailingEdge(now()); + } + + function debounced() { + var time = now(), + isInvoking = shouldInvoke(time); + + lastArgs = arguments; + lastThis = this; + lastCallTime = time; + + if (isInvoking) { + if (timerId === undefined) { + return leadingEdge(lastCallTime); + } + if (maxing) { + // Handle invocations in a tight loop. + timerId = setTimeout(timerExpired, wait); + return invokeFunc(lastCallTime); + } + } + if (timerId === undefined) { + timerId = setTimeout(timerExpired, wait); + } + return result; + } + debounced.cancel = cancel; + debounced.flush = flush; + return debounced; + } + + /** + * Creates a throttled function that only invokes `func` at most once per + * every `wait` milliseconds. The throttled function comes with a `cancel` + * method to cancel delayed `func` invocations and a `flush` method to + * immediately invoke them. Provide `options` to indicate whether `func` + * should be invoked on the leading and/or trailing edge of the `wait` + * timeout. The `func` is invoked with the last arguments provided to the + * throttled function. Subsequent calls to the throttled function return the + * result of the last `func` invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the throttled function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.throttle` and `_.debounce`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to throttle. + * @param {number} [wait=0] The number of milliseconds to throttle invocations to. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=true] + * Specify invoking on the leading edge of the timeout. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new throttled function. + * @example + * + * // Avoid excessively updating the position while scrolling. + * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); + * + * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. + * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); + * jQuery(element).on('click', throttled); + * + * // Cancel the trailing throttled invocation. + * jQuery(window).on('popstate', throttled.cancel); + */ + function throttle(func, wait, options) { + var leading = true, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (isObject(options)) { + leading = 'leading' in options ? !!options.leading : leading; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + return debounce(func, wait, { + 'leading': leading, + 'maxWait': wait, + 'trailing': trailing + }); + } + + /** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ + function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); + } + + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + function isObjectLike(value) { + return !!value && typeof value == 'object'; + } + + /** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ + function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); + } + + /** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */ + function toNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = typeof value.valueOf == 'function' ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); + } + + module.exports = throttle; + + /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) + +/***/ }), +/* 87 */ /***/ (function(module, exports, __webpack_require__) { 'use strict'; @@ -9037,7 +9507,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = FixedDataTableColumn; /***/ }), -/* 87 */ +/* 88 */ /***/ (function(module, exports, __webpack_require__) { 'use strict'; @@ -9140,7 +9610,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = FixedDataTableColumnGroup; /***/ }), -/* 88 */ +/* 89 */ /***/ (function(module, exports, __webpack_require__) { 'use strict'; diff --git a/dist/fixed-data-table.min.css b/dist/fixed-data-table.min.css index 754ff713..8fc6712c 100644 --- a/dist/fixed-data-table.min.css +++ b/dist/fixed-data-table.min.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.8 + * FixedDataTable v0.7.9 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table.min.js b/dist/fixed-data-table.min.js index eb565dbd..28c949fc 100644 --- a/dist/fixed-data-table.min.js +++ b/dist/fixed-data-table.min.js @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.8 + * FixedDataTable v0.7.9 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -9,7 +9,7 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.FixedDataTable=t(require("react"),require("react-dom")):e.FixedDataTable=t(e.React,e.ReactDOM)}(this,function(e,t){return function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){o(1),o(5),o(7),o(9),o(11),o(13),o(15),o(17),o(19),o(21),o(23),e.exports=o(25)},function(e,t){},,,,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t,o){"use strict";var n=o(26),r=o(78),i=o(76),s=o(75),a={Cell:r,Column:i,ColumnGroup:s,Table:n};a.version="0.7.0",e.exports=a},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e,t){}var s=Object.assign||function(e){for(var t=1;t1)for(var o=1;o0||e>=0&&this.state.scrollX0||e>=0&&this.state.scrollYn?n:this.state.height>n&&this.props.ownerHeight?Math.max(n,this.props.ownerHeight):this.state.height+this.state.maxScrollY,e!==this._contentHeight&&this.props.onContentHeightChange&&this.props.onContentHeightChange(e),this._contentHeight=e},componentDidMount:function(){this._reportContentHeight(),this._isMounted=!0},componentWillReceiveProps:function(e){var t=e.scrollToRow;void 0!==t&&null!==t&&(this._rowToScrollTo=t);var o=e.scrollToColumn;void 0!==o&&null!==o&&(this._columnToScrollTo=o);var n=e.overflowX,r=e.overflowY;n===this.props.overflowX&&r===this.props.overflowY||(this._wheelHandler=new l(this._onWheel,"hidden"!==n,"hidden"!==r)),this.props.ownerHeight===e.ownerHeight&&this.props.scrollTop===e.scrollTop||this._didScrollStart(),this._didScrollStop(),this.setState(this._calculateState(e,this.state))},componentDidUpdate:function(){this._reportContentHeight()},render:function(){var e,t=this.state,o=this.props;t.useGroupHeader&&(e=i.createElement(f,{key:"group_header",isScrolling:this._isScrolling,className:y(m("fixedDataTableLayout/header"),m("public/fixedDataTable/header")),width:t.width,height:t.groupHeaderHeight,index:0,zIndex:1,offsetTop:0,scrollLeft:t.scrollX,fixedColumns:t.groupHeaderFixedColumns,scrollableColumns:t.groupHeaderScrollableColumns,onColumnResize:this._onColumnResize}));var r=this.state.maxScrollY,s=t.maxScrollX>0&&"hidden"!==t.overflowX,a=r>0&&"hidden"!==t.overflowY,l=s?u.SIZE:0,c=t.height-l-2*R-t.footerHeight,p=t.useGroupHeader?t.groupHeaderHeight:0,d=p+t.headerHeight;c-=d;var v=0,_=null!=o.maxHeight?d+t.bodyHeight:d+c,g=_+t.footerHeight;void 0!==o.ownerHeight&&o.ownerHeightt.ownerHeight||t.scrollY or "),o.push(e))});var r=!1;o.length&&o[0].type.__TableColumnGroup__&&(r=!0),t&&(void 0!==e.width&&e.width!==t.width||void 0!==e.height&&e.height!==t.height||void 0!==e.maxWidth&&e.maxWidth!==t.maxWidth||void 0!==e.maxHeight&&e.maxHeight!==t.maxHeight)&&(t=null);var i,s,a=t&&t.firstRowIndex||0,l=t&&t.firstRowOffset||0;i=t&&"hidden"!==e.overflowX?t.scrollX:e.scrollLeft,t&&"hidden"!==e.overflowY?s=t.scrollY:(f=this._scrollHelper.scrollTo(e.scrollTop),a=f.index,l=f.offset,s=f.position),void 0!==this._rowToScrollTo&&(f=this._scrollHelper.scrollRowIntoView(this._rowToScrollTo),a=f.index,l=f.offset,s=f.position,delete this._rowToScrollTo);var c=r?e.groupHeaderHeight:0;if(t&&e.rowsCount!==t.rowsCount){var h=(void 0===e.height?e.maxHeight:e.height)-(e.headerHeight||0)-(e.footerHeight||0)-(e.groupHeaderHeight||0);this._scrollHelper=new p(e.rowsCount,e.rowHeight,h,e.rowHeightGetter);var f=this._scrollHelper.scrollToRow(a,l);a=f.index,l=f.offset,s=f.position}else t&&e.rowHeightGetter!==t.rowHeightGetter&&this._scrollHelper.setRowHeightGetter(e.rowHeightGetter);var m;m=e.isColumnResizing?t&&t.columnResizingData:C;var v,_;if(r){var y=d.adjustColumnGroupWidths(o,e.width);v=y.columns,_=y.columnGroups}else v=d.adjustColumnWidths(o,e.width);var w=this._populateColumnsAndColumnData(v,_,t);if(void 0!==this._columnToScrollTo){var b=w.bodyFixedColumns.length;if(this._columnToScrollTo>=b){var E,D,T=0;for(E=0;EO&&(i=O)}delete this._columnToScrollTo}var k=void 0===e.height,P=Math.round(k?e.maxHeight:e.height),I=e.footerHeight+e.headerHeight+c+2*R,z=P-I,j=this._scrollHelper.getContentHeight(),A=j+I,F=d.getTotalWidth(v),L=F>e.width&&"hidden"!==e.overflowX;L&&(z-=u.SIZE,A+=u.SIZE,I+=u.SIZE);var G=Math.max(0,F-e.width),W=Math.max(0,j-z);i=Math.min(i,G),s=Math.min(s,W),W||(k&&(P=A),z=A-I),this._scrollHelper.setViewportHeight(z);var V=n({isColumnResizing:t&&t.isColumnResizing},w,e,{columns:v,columnGroups:_,columnResizingData:m,firstRowIndex:a,firstRowOffset:l,horizontalScrollbarVisible:L,maxScrollX:G,maxScrollY:W,reservedHeight:I,scrollContentHeight:j,scrollX:i,scrollY:s,bodyHeight:z,height:P,groupHeaderHeight:c,useGroupHeader:r});return V},_selectColumnElement:function(e,t){for(var o=[],n=0;nMath.abs(e)&&"hidden"!==this.props.overflowY){var n=this._scrollHelper.scrollBy(Math.round(t)),r=Math.max(0,n.contentHeight-this.state.bodyHeight);this.setState({firstRowIndex:n.index,firstRowOffset:n.offset,scrollY:n.position,scrollContentHeight:n.contentHeight,maxScrollY:r})}else e&&"hidden"!==this.props.overflowX&&(o+=e,o=o<0?0:o,o=o>this.state.maxScrollX?this.state.maxScrollX:o,this.setState({scrollX:o}));this._didScrollStop()}},_onHorizontalScroll:function(e){this._isMounted&&e!==this.state.scrollX&&(this._isScrolling||this._didScrollStart(),this.setState({scrollX:e}),this._didScrollStop())},_onVerticalScroll:function(e){if(this._isMounted&&e!==this.state.scrollY){this._isScrolling||this._didScrollStart();var t=this._scrollHelper.scrollTo(Math.round(e));this.setState({firstRowIndex:t.index,firstRowOffset:t.offset,scrollY:t.position,scrollContentHeight:t.contentHeight}),this._didScrollStop()}},_didScrollStart:function(){this._isMounted&&!this._isScrolling&&(this._isScrolling=!0,this.props.onScrollStart&&this.props.onScrollStart(this.state.scrollX,this.state.scrollY))},_didScrollStop:function(){this._isMounted&&this._isScrolling&&(this._isScrolling=!1,this.setState({redraw:!0}),this.props.onScrollEnd&&this.props.onScrollEnd(this.state.scrollX,this.state.scrollY))}}),O=s({displayName:"HorizontalScrollbar",mixins:[a],propTypes:{contentSize:r.number.isRequired,offset:r.number.isRequired,onScroll:r.func.isRequired,position:r.number.isRequired,size:r.number.isRequired},render:function(){var e=n({height:u.SIZE,width:this.props.size},this.props.horizontalScrollbarStyle),t={height:u.SIZE,position:"absolute",overflow:"hidden",width:this.props.size};return b(t,0,this.props.offset),i.createElement("div",{className:y(m("fixedDataTableLayout/horizontalScrollbar"),m("public/fixedDataTable/horizontalScrollbar")),style:e},i.createElement("div",{style:t},i.createElement(u,n({},this.props,{isOpaque:!0,orientation:"horizontal",offset:void 0}))))}});e.exports=S},function(e,t,o){"use strict";var n=o(35),r=o(38);if("undefined"==typeof n)throw Error("create-react-class could not find the React object. If you are using script tags, make sure that React is being loaded before create-react-class.");var i=(new n.Component).updater;e.exports=r(n.Component,n.isValidElement,i)},function(e,t,o){(function(t){"use strict";function n(e){return e}function r(e,o,r){function h(e,o,n){for(var r in o)o.hasOwnProperty(r)&&"production"!==t.env.NODE_ENV&&l("function"==typeof o[r],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",e.displayName||"ReactClass",u[n],r)}function f(e,t){var o=x.hasOwnProperty(t)?x[t]:null;T.hasOwnProperty(t)&&a("OVERRIDE_BASE"===o,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t), -e&&a("DEFINE_MANY"===o||"DEFINE_MANY_MERGED"===o,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function p(e,n){if(n){a("function"!=typeof n,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),a(!o(n),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=e.prototype,i=r.__reactAutoBindPairs;n.hasOwnProperty(c)&&R.mixins(e,n.mixins);for(var s in n)if(n.hasOwnProperty(s)&&s!==c){var u=n[s],h=r.hasOwnProperty(s);if(f(h,s),R.hasOwnProperty(s))R[s](e,u);else{var p=x.hasOwnProperty(s),d="function"==typeof u,m=d&&!p&&!h&&n.autobind!==!1;if(m)i.push(s,u),r[s]=u;else if(h){var g=x[s];a(p&&("DEFINE_MANY_MERGED"===g||"DEFINE_MANY"===g),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",g,s),"DEFINE_MANY_MERGED"===g?r[s]=v(r[s],u):"DEFINE_MANY"===g&&(r[s]=_(r[s],u))}else r[s]=u,"production"!==t.env.NODE_ENV&&"function"==typeof u&&n.displayName&&(r[s].displayName=n.displayName+"_"+s)}}}else if("production"!==t.env.NODE_ENV){var y=typeof n,w="object"===y&&null!==n;"production"!==t.env.NODE_ENV&&l(w,"%s: You're attempting to include a mixin that is either null or not an object. Check the mixins included by the component, as well as any mixins they include themselves. Expected object but got %s.",e.displayName||"ReactClass",null===n?null:y)}}function d(e,t){if(t)for(var o in t){var n=t[o];if(t.hasOwnProperty(o)){var r=o in R;a(!r,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',o);var i=o in e;if(i){var s=C.hasOwnProperty(o)?C[o]:null;return a("DEFINE_MANY_MERGED"===s,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",o),void(e[o]=v(e[o],n))}e[o]=n}}}function m(e,t){a(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var o in t)t.hasOwnProperty(o)&&(a(void 0===e[o],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",o),e[o]=t[o]);return e}function v(e,t){return function(){var o=e.apply(this,arguments),n=t.apply(this,arguments);if(null==o)return n;if(null==n)return o;var r={};return m(r,o),m(r,n),r}}function _(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function g(e,o){var n=o.bind(e);if("production"!==t.env.NODE_ENV){n.__reactBoundContext=e,n.__reactBoundMethod=o,n.__reactBoundArguments=null;var r=e.constructor.displayName,i=n.bind;n.bind=function(s){for(var a=arguments.length,u=Array(a>1?a-1:0),c=1;c1?t-1:0),n=1;n2?o-2:0),r=2;rn},ie64:function(){return y.ie()&&p},firefox:function(){return o()||r},opera:function(){return o()||i},webkit:function(){return o()||s},safari:function(){return y.webkit()},chrome:function(){return o()||a},windows:function(){return o()||c},osx:function(){return o()||u},linux:function(){return o()||h},iphone:function(){return o()||d},mobile:function(){return o()||d||m||f||_},nativeApp:function(){return o()||v},android:function(){return o()||f},ipad:function(){return o()||m}};e.exports=y},function(e,t,o){"use strict";function n(e,t){if(!i.canUseDOM||t&&!("addEventListener"in document))return!1;var o="on"+e,n=o in document;if(!n){var s=document.createElement("div");s.setAttribute(o,"return;"),n="function"==typeof s[o]}return!n&&r&&"wheel"===e&&(n=document.implementation.hasFeature("Events.wheel","3.0")),n}var r,i=o(49);i.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),e.exports=n},function(e,t){"use strict";var o=!("undefined"==typeof window||!window.document||!window.document.createElement),n={canUseDOM:o,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:o&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:o&&!!window.screen,isInWorker:!o};e.exports=n},function(e,t,o){(function(t){"use strict";var n=o(45),r=o(51),i=0,s=r||function(e){var o=Date.now(),n=Math.max(0,16-(o-i));return i=o+n,t.setTimeout(function(){e(Date.now())},n)};s(n),e.exports=s}).call(t,function(){return this}())},function(e,t){(function(t){"use strict";var o=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame;e.exports=o}).call(t,function(){return this}())},function(e,t,o){"use strict";var n=o(53),r=o(56),i=o(27),s=o(34),a=o(37),l=o(57),u=o(43),c=o(44),h=o(59),f=o(60),p=o(45),d=o(61),m={position:0,scrollable:!1},v=parseInt(h("scrollbar-face-margin"),10),_=2*v,g=30,y=40,w=null,b=a({displayName:"Scrollbar",mixins:[u],propTypes:{contentSize:i.number.isRequired,defaultPosition:i.number,isOpaque:i.bool,orientation:i.oneOf(["vertical","horizontal"]),onScroll:i.func,position:i.number,size:i.number.isRequired,trackColor:i.oneOf(["gray"]),zIndex:i.number,verticalTop:i.number},getInitialState:function(){var e=this.props;return this._calculateState(e.position||e.defaultPosition||0,e.size,e.contentSize,e.orientation)},componentWillReceiveProps:function(e){var t=e.position;void 0===t?this._setNextState(this._calculateState(this.state.position,e.size,e.contentSize,e.orientation)):this._setNextState(this._calculateState(t,e.size,e.contentSize,e.orientation),e)},getDefaultProps:function(){return{defaultPosition:0,isOpaque:!1,onScroll:p,orientation:"vertical",zIndex:99}},render:function(){if(!this.state.scrollable)return null;var e,t,o=this.props.size,n=this.state.isHorizontal,r=!n,i=this.state.focused||this.state.isDragging,a=this.state.faceSize,l=this.props.isOpaque,u=this.props.verticalTop||0,c=f({"ScrollbarLayout/main":!0,"ScrollbarLayout/mainVertical":r,"ScrollbarLayout/mainHorizontal":n,"public/Scrollbar/main":!0,"public/Scrollbar/mainOpaque":l,"public/Scrollbar/mainActive":i}),p=f({"ScrollbarLayout/face":!0,"ScrollbarLayout/faceHorizontal":n,"ScrollbarLayout/faceVertical":r,"public/Scrollbar/faceActive":i,"public/Scrollbar/face":!0}),m=this.state.position*this.state.scale+v;return n?(e={width:o},t={width:a-_},d(t,m,0)):(e={top:u,height:o},t={height:a-_},d(t,0,m)),e.zIndex=this.props.zIndex,"gray"===this.props.trackColor&&(e.backgroundColor=h("fbui-desktop-background-light")),s.createElement("div",{onFocus:this._onFocus,onBlur:this._onBlur,onKeyDown:this._onKeyDown,onMouseDown:this._onMouseDown,onWheel:this._wheelHandler.onWheel,className:c,style:e,tabIndex:0},s.createElement("div",{ref:"face",className:p,style:t}))},componentWillMount:function(){var e="horizontal"===this.props.orientation,t=e?this._onWheelX:this._onWheelY;this._wheelHandler=new c(t,this._shouldHandleX,this._shouldHandleY)},componentDidMount:function(){this._mouseMoveTracker=new n(this._onMouseMove,this._onMouseMoveEnd,document.documentElement),void 0!==this.props.position&&this.state.position!==this.props.position&&this._didScroll(),this._isMounted=!0},componentWillUnmount:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),w===this&&(w=null),delete this._mouseMoveTracker,this._isMounted=!1},scrollBy:function(e){this._onWheel(e)},_shouldHandleX:function(e){return"horizontal"===this.props.orientation&&this._shouldHandleChange(e)},_shouldHandleY:function(e){return"horizontal"!==this.props.orientation&&this._shouldHandleChange(e)},_shouldHandleChange:function(e){var t=this._calculateState(this.state.position+e,this.props.size,this.props.contentSize,this.props.orientation);return t.position!==this.state.position},_calculateState:function(e,t,o,n){if(t<1||o<=t)return m;var r=e+"_"+t+"_"+o+"_"+n;if(this._stateKey===r)return this._stateForKey;var i="horizontal"===n,s=t/o,a=t*s;au&&(e=u);var c=!!this._mouseMoveTracker&&this._mouseMoveTracker.isDragging(),h={faceSize:a,isDragging:c,isHorizontal:i,position:e,scale:s,scrollable:l};return this._stateKey=r,this._stateForKey=h,h},_onWheelY:function(e,t){this._onWheel(t)},_onWheelX:function(e,t){this._onWheel(e)},_onWheel:function(e){var t=this.props;this._setNextState(this._calculateState(this.state.position+e,t.size,t.contentSize,t.orientation))},_onMouseDown:function(e){var t;if(e.target!==l.findDOMNode(this.refs.face)){var o=e.nativeEvent,n=this.state.isHorizontal?o.offsetX||o.layerX:o.offsetY||o.layerY,r=this.props;n/=this.state.scale,t=this._calculateState(n-.5*this.state.faceSize/this.state.scale,r.size,r.contentSize,r.orientation)}else t={};t.focused=!0,this._setNextState(t),this._mouseMoveTracker.captureMouseMoves(e),l.findDOMNode(this).focus()},_onMouseMove:function(e,t){var o=this.props,n=this.state.isHorizontal?e:t;n/=this.state.scale,this._setNextState(this._calculateState(this.state.position+n,o.size,o.contentSize,o.orientation))},_onMouseMoveEnd:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),this.setState({isDragging:!1})},_onKeyDown:function(e){var t=e.keyCode;if(t!==r.TAB){var o=y,n=0;if(this.state.isHorizontal)switch(t){case r.HOME:n=-1,o=this.props.contentSize;break;case r.LEFT:n=-1;break;case r.RIGHT:n=1;break;default:return}if(!this.state.isHorizontal)switch(t){case r.SPACE:n=e.shiftKey?-1:1;break;case r.HOME:n=-1,o=this.props.contentSize;break;case r.UP:n=-1;break;case r.DOWN:n=1;break;case r.PAGE_UP:n=-1,o=this.props.size;break;case r.PAGE_DOWN:n=1,o=this.props.size;break;default:return}e.preventDefault();var i=this.props;this._setNextState(this._calculateState(this.state.position+o*n,i.size,i.contentSize,i.orientation))}},_onFocus:function(){this.setState({focused:!0})},_onBlur:function(){this.setState({focused:!1})},_blur:function(){if(this._isMounted)try{this._onBlur(),l.findDOMNode(this).blur()}catch(e){}},_setNextState:function(e,t){t=t||this.props;var o=t.position,n=this.state.position!==e.position;if(void 0===o){var r=n?this._didScroll:void 0;this.setState(e,r)}else{if(o!==e.position)return void(void 0!==e.position&&e.position!==this.state.position&&this.props.onScroll(e.position));this.setState(e)}n&&w!==this&&(w&&w._blur(),w=this)},_didScroll:function(){this.props.onScroll(this.state.position)}});b.KEYBOARD_SCROLL_AMOUNT=y,b.SIZE=parseInt(h("scrollbar-size"),10),e.exports=b},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var o=0;o0;)this._addRowToBuffer(t,this._viewportRowsBegin,this._viewportRowsEnd-1),t++,e--;return this._rows}},{key:"getRows",value:function(e,t){var o=t,n=o,r=e,i=Math.min(e+this._maxVisibleRowCount,this._rowsCount);for(this._viewportRowsBegin=e;r=i&&(n=this._bufferSet.replaceFurthestValuePosition(t,o,e)),null===n?(n=this._bufferSet.getNewPositionForValue(e),this._rows[n]=e):this._rows[n]=e}}]),e}();e.exports=c},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var o=0;o=e&&r<=t)return null;var i;e-n>r-t?(i=n,this._smallValues.pop()):(i=r,this._largeValues.pop());var a=this._valueToPositionMap[i];return delete this._valueToPositionMap[i],this._valueToPositionMap[o]=a,this._pushToHeaps(a,o),a}},{key:"_pushToHeaps",value:function(e,t){var o={position:e,value:t};this._smallValues.push(o),this._largeValues.push(o)}},{key:"_cleanHeaps",value:function(){this._cleanHeap(this._smallValues),this._cleanHeap(this._largeValues);var e=Math.min(this._smallValues.size(),this._largeValues.size()),t=Math.max(this._smallValues.size(),this._largeValues.size());t>10*e&&this._recreateHeaps()}},{key:"_recreateHeaps",value:function(){for(var e=this._smallValues.size()t.value}}]),e}();e.exports=a},function(e,t){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){return e0&&(this._items[0]=t,this._sinkDown(0)),e}}},{key:"push",value:function(e){this._items[this._size++]=e,this._bubbleUp(this._size-1)}},{key:"size",value:function(){return this._size}},{key:"peek",value:function(){if(0!==this._size)return this._items[0]}},{key:"_heapify",value:function(){for(var e=Math.floor((this._size+1)/2);e>=0;e--)this._sinkDown(e)}},{key:"_bubbleUp",value:function(e){for(var t=this._items[e];e>0;){var o=Math.floor((e+1)/2)-1,n=this._items[o];if(this._comparator(n,t))return;this._items[o]=t,this._items[e]=n,e=o}}},{key:"_sinkDown",value:function(e){for(var t=this._items[e];;){var o=2*(e+1)-1,n=2*(e+1),r=-1;if(oo?o:e}e.exports=o},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=Object.assign||function(e){for(var t=1;t0){var o=h({"fixedDataTableRowLayout/fixedColumnsDivider":!0,"fixedDataTableRowLayout/columnsShadow":e.props.scrollLeft>0,"public/fixedDataTableRow/fixedColumnsDivider":!0,"public/fixedDataTableRow/columnsShadow":e.props.scrollLeft>0}),n={left:t,height:e.props.height};return u.createElement("div",{className:o,style:n})}},this._onClick=function(t){e.props.onClick(t,e.props.index)},this._onDoubleClick=function(t){e.props.onDoubleClick(t,e.props.index)},this._onMouseDown=function(t){e.props.onMouseDown(t,e.props.index)},this._onMouseEnter=function(t){e.props.onMouseEnter(t,e.props.index)},this._onMouseLeave=function(t){e.props.onMouseLeave(t,e.props.index)}}return r(t,e),s(t,[{key:"render",value:function(){var e={width:this.props.width,height:this.props.height},t=h({"fixedDataTableRowLayout/main":!0,"public/fixedDataTableRow/main":!0,"public/fixedDataTableRow/highlighted":this.props.index%2===1,"public/fixedDataTableRow/odd":this.props.index%2===1,"public/fixedDataTableRow/even":this.props.index%2===0}),o=this._getColumnsWidth(this.props.fixedColumns),n=u.createElement(c,{key:"fixed_cells",isScrolling:this.props.isScrolling,height:this.props.height,left:0,width:o,zIndex:2,columns:this.props.fixedColumns,onColumnResize:this.props.onColumnResize,rowHeight:this.props.height,rowIndex:this.props.index}),r=this._renderColumnsShadow(o),i=u.createElement(c,{key:"scrollable_cells",isScrolling:this.props.isScrolling,height:this.props.height,left:this.props.scrollLeft,offsetLeft:o,width:this.props.width-o,zIndex:0,columns:this.props.scrollableColumns,onColumnResize:this.props.onColumnResize,rowHeight:this.props.height,rowIndex:this.props.index});return u.createElement("div",{className:f(t,this.props.className),onClick:this.props.onClick?this._onClick:null,onDoubleClick:this.props.onDoubleClick?this._onDoubleClick:null,onMouseDown:this.props.onMouseDown?this._onMouseDown:null,onMouseEnter:this.props.onMouseEnter?this._onMouseEnter:null,onMouseLeave:this.props.onMouseLeave?this._onMouseLeave:null,style:e},u.createElement("div",{className:h("fixedDataTableRowLayout/body")},n,i,r))}}],[{key:"propTypes",value:{isScrolling:l.bool,fixedColumns:l.array.isRequired,height:l.number.isRequired,index:l.number.isRequired,scrollableColumns:l.array.isRequired,scrollLeft:l.number.isRequired,width:l.number.isRequired,onClick:l.func,onDoubleClick:l.func,onColumnResize:l.func},enumerable:!0}]),t}(u.Component),m=function(e){function t(){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return r(t,e),s(t,[{key:"render",value:function(){var e={width:this.props.width,height:this.props.height,zIndex:this.props.zIndex?this.props.zIndex:0};return p(e,0,this.props.offsetTop),u.createElement("div",{style:e,className:h("fixedDataTableRowLayout/rowWrapper")},u.createElement(d,i({},this.props,{offsetTop:void 0,zIndex:void 0})))}}],[{key:"propTypes",value:{isScrolling:l.bool,height:l.number.isRequired,zIndex:l.number,offsetTop:l.number.isRequired,width:l.number.isRequired},enumerable:!0}]),t}(u.Component);e.exports=m},function(e,t,o){"use strict";function n(e,t){var o={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}var r=Object.assign||function(e){for(var t=1;t=0){var l="cell_"+r;o[r]=this._renderCell(e.rowIndex,e.rowHeight,s,n,l)}n+=s.width}var u=this._getColumnsWidth(t),p={height:e.height,position:"absolute",width:u,zIndex:e.zIndex};return h(p,-1*f*e.left,0),a.createElement("div",{className:c("fixedDataTableCellGroupLayout/cellGroup"),style:p},o)},_renderCell:function(e,t,o,n,r){var i=o.isResizable&&this.props.onColumnResize,s=i?this.props.onColumnResize:null,l=o.cellClassName;return a.createElement(u,{isScrolling:this.props.isScrolling,align:o.align,className:l,height:t,key:r,maxWidth:o.maxWidth,minWidth:o.minWidth,onColumnResize:s,rowIndex:e,columnKey:o.columnKey,width:o.width,left:n,cell:o.cell})},_getColumnsWidth:function(e){for(var t=0,o=0;o=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}var r=o(78),i=o(73),s=o(27),a=o(34),l=o(37),u=o(60),c=o(79),h=i.DIR_SIGN,f={align:"left",highlighted:!1},p=l({displayName:"FixedDataTableCell",propTypes_DISABLED_FOR_PERFORMANCE:{isScrolling:s.bool,align:s.oneOf(["left","center","right"]),className:s.string,highlighted:s.bool,width:s.number.isRequired,minWidth:s.number,maxWidth:s.number,height:s.number.isRequired,cell:s.oneOfType([s.string,s.element,s.func]),columnKey:s.oneOfType([s.string,s.number]),rowIndex:s.number.isRequired,onColumnResize:s.func,left:s.number},shouldComponentUpdate:function(e){return!e.isScrolling||this.props.rowIndex!==e.rowIndex},getDefaultProps:function(){return f},render:function(){var e=this.props,t=e.height,o=e.width,i=e.columnKey,s=n(e,["height","width","columnKey"]),l={height:t,width:o};1===h?l.left=s.left:l.right=s.left;var f,p=c(u({"fixedDataTableCellLayout/main":!0,"fixedDataTableCellLayout/lastChild":s.lastChild,"fixedDataTableCellLayout/alignRight":"right"===s.align,"fixedDataTableCellLayout/alignCenter":"center"===s.align,"public/fixedDataTableCell/alignRight":"right"===s.align,"public/fixedDataTableCell/highlighted":s.highlighted,"public/fixedDataTableCell/main":!0}),s.className);if(s.onColumnResize){var d={height:t};f=a.createElement("div",{className:u("fixedDataTableCellLayout/columnResizerContainer"),style:d,onMouseDown:this._onColumnResizerMouseDown},a.createElement("div",{className:c(u("fixedDataTableCellLayout/columnResizerKnob"),u("public/fixedDataTableCell/columnResizerKnob")),style:d}))}var m={columnKey:i,height:t,width:o};s.rowIndex>=0&&(m.rowIndex=s.rowIndex);var v;return v=a.isValidElement(s.cell)?a.cloneElement(s.cell,m):"function"==typeof s.cell?s.cell(m):a.createElement(r,m,s.cell),a.createElement("div",{className:p,style:l},f,v)},_onColumnResizerMouseDown:function(e){this.props.onColumnResize(this.props.left,this.props.width,this.props.minWidth,this.props.maxWidth,this.props.columnKey,e)}});e.exports=p},function(e,t,o){"use strict";function n(e,t){var o={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=Object.assign||function(e){for(var t=1;t1)for(var n=1;n=0&&t>=e-a;){var o=this._updateRowHeight(t);this._position+=o,t--}}},{key:"_updateRowHeight",value:function(e){if(e<0||e>=this._rowCount)return 0;var t=this._rowHeightGetter(e);if(t!==this._storedHeights[e]){var o=t-this._storedHeights[e];return this._rowOffsets.set(e,t),this._storedHeights[e]=t,this._contentHeight+=o,o}return 0}},{key:"getRowPosition",value:function(e){return this._updateRowHeight(e),this._rowOffsets.sumUntil(e)}},{key:"scrollBy",value:function(e){if(0===this._rowCount)return l;var t=this._rowOffsets.greatestLowerBound(this._position);t=s(t,0,Math.max(this._rowCount-1,0));var o=this._rowOffsets.sumUntil(t),n=t,r=this._position,i=this._updateRowHeight(n);0!==o&&(r+=i);var a=this._storedHeights[n]-(r-o);if(e>=0)for(;e>0&&n0&&n>=0;)if(e=0){var c=this._updateRowHeight(n);u=this._storedHeights[n],r+=c}}var h=this._contentHeight-this._viewportHeight;r=s(r,0,h),this._position=r;var f=this._rowOffsets.greatestLowerBound(r);f=s(f,0,Math.max(this._rowCount-1,0)),o=this._rowOffsets.sumUntil(f);var p=o-r;return this._updateHeightsInViewport(f,p),this._updateHeightsAboveViewport(f),{index:f,offset:p,position:this._position,contentHeight:this._contentHeight}}},{key:"_getRowAtEndPosition",value:function(e){this._updateRowHeight(e);for(var t=e,o=this._storedHeights[t];o=0;)t--,t>=0&&(this._updateRowHeight(t),o+=this._storedHeights[t]);var n=this._rowOffsets.sumTo(e)-this._viewportHeight;return n<0&&(n=0),n}},{key:"scrollTo",value:function(e){if(0===this._rowCount)return l;if(e<=0)return this._position=0,this._updateHeightsInViewport(0,0),{index:0,offset:0,position:this._position,contentHeight:this._contentHeight};if(e>=this._contentHeight-this._viewportHeight){var t=this._rowCount-1;e=this._getRowAtEndPosition(t)}this._position=e;var o=this._rowOffsets.greatestLowerBound(e);o=s(o,0,Math.max(this._rowCount-1,0));var n=this._rowOffsets.sumUntil(o),r=n-e;return this._updateHeightsInViewport(o,r),this._updateHeightsAboveViewport(o),{index:o,offset:r,position:this._position,contentHeight:this._contentHeight}}},{key:"scrollToRow",value:function(e,t){e=s(e,0,Math.max(this._rowCount-1,0)),t=s(t,-this._storedHeights[e],0);var o=this._rowOffsets.sumUntil(e);return this.scrollTo(o-t)}},{key:"scrollRowIntoView",value:function(e){e=s(e,0,Math.max(this._rowCount-1,0));var t=this._rowOffsets.sumUntil(e),o=t+this._storedHeights[e];if(t=0;--o)t[o]=0;return t},u=function(){function e(t){n(this,e),this._size=t.length,this._half=r(this._size),this._heap=new l(2*this._half);var o;for(o=0;o0;--o)this._heap[o]=this._heap[2*o]+this._heap[2*o+1]}return i(e,[{key:"set",value:function(e,t){s(0<=e&&e=0;--r)n[r]=o;return new e(n)}},{key:"empty",value:function(t){return e.uniform(t,0)}}]),e}();e.exports=u}).call(t,function(){return this}())},function(e,t,o){"use strict";function n(e){for(var t=0,o=0;o1)for(var o=1;o0||e>=0&&this.state.scrollX0||e>=0&&this.state.scrollYn?n:this.state.height>n&&this.props.ownerHeight?Math.max(n,this.props.ownerHeight):this.state.height+this.state.maxScrollY,e!==this._contentHeight&&this.props.onContentHeightChange&&this.props.onContentHeightChange(e),this._contentHeight=e},componentDidMount:function(){this._reportContentHeight(),this._isMounted=!0},componentWillReceiveProps:function(e){var t=e.scrollToRow;void 0!==t&&null!==t&&(this._rowToScrollTo=t);var o=e.scrollToColumn;void 0!==o&&null!==o&&(this._columnToScrollTo=o);var n=e.overflowX,r=e.overflowY;n===this.props.overflowX&&r===this.props.overflowY||(this._wheelHandler=new l(this._onWheel,"hidden"!==n,"hidden"!==r)),this.props.ownerHeight===e.ownerHeight&&this.props.scrollTop===e.scrollTop||this._didScrollStart(),this._didScroll(),this._didScrollStop(),this.setState(this._calculateState(e,this.state))},componentDidUpdate:function(){this._reportContentHeight()},render:function(){var e,t=this.state,o=this.props;t.useGroupHeader&&(e=i.createElement(f,{key:"group_header",isScrolling:this._isScrolling,className:y(m("fixedDataTableLayout/header"),m("public/fixedDataTable/header")),width:t.width,height:t.groupHeaderHeight,index:0,zIndex:1,offsetTop:0,scrollLeft:t.scrollX,fixedColumns:t.groupHeaderFixedColumns,scrollableColumns:t.groupHeaderScrollableColumns,onColumnResize:this._onColumnResize}));var r=this.state.maxScrollY,s=t.maxScrollX>0&&"hidden"!==t.overflowX,a=r>0&&"hidden"!==t.overflowY,l=s?u.SIZE:0,c=t.height-l-2*E-t.footerHeight,p=t.useGroupHeader?t.groupHeaderHeight:0,d=p+t.headerHeight;c-=d;var v=0,_=null!=o.maxHeight?d+t.bodyHeight:d+c,g=_+t.footerHeight;void 0!==o.ownerHeight&&o.ownerHeightt.ownerHeight||t.scrollY or "),o.push(e))});var r=!1;o.length&&o[0].type.__TableColumnGroup__&&(r=!0),t&&(void 0!==e.width&&e.width!==t.width||void 0!==e.height&&e.height!==t.height||void 0!==e.maxWidth&&e.maxWidth!==t.maxWidth||void 0!==e.maxHeight&&e.maxHeight!==t.maxHeight)&&(t=null);var i,s,a=t&&t.firstRowIndex||0,l=t&&t.firstRowOffset||0;i=t&&"hidden"!==e.overflowX?t.scrollX:e.scrollLeft,t&&"hidden"!==e.overflowY?s=t.scrollY:(f=this._scrollHelper.scrollTo(e.scrollTop),a=f.index,l=f.offset,s=f.position),void 0!==this._rowToScrollTo&&(f=this._scrollHelper.scrollRowIntoView(this._rowToScrollTo),a=f.index,l=f.offset,s=f.position,delete this._rowToScrollTo);var c=r?e.groupHeaderHeight:0;if(t&&e.rowsCount!==t.rowsCount){var h=(void 0===e.height?e.maxHeight:e.height)-(e.headerHeight||0)-(e.footerHeight||0)-(e.groupHeaderHeight||0);this._scrollHelper=new p(e.rowsCount,e.rowHeight,h,e.rowHeightGetter);var f=this._scrollHelper.scrollToRow(a,l);a=f.index,l=f.offset,s=f.position}else t&&e.rowHeightGetter!==t.rowHeightGetter&&this._scrollHelper.setRowHeightGetter(e.rowHeightGetter);var m;m=e.isColumnResizing?t&&t.columnResizingData:R;var v,_;if(r){var y=d.adjustColumnGroupWidths(o,e.width);v=y.columns,_=y.columnGroups}else v=d.adjustColumnWidths(o,e.width);var w=this._populateColumnsAndColumnData(v,_,t);if(void 0!==this._columnToScrollTo){var b=w.bodyFixedColumns.length;if(this._columnToScrollTo>=b){var x,T,D=0;for(x=0;xO&&(i=O)}delete this._columnToScrollTo}var k=void 0===e.height,P=Math.round(k?e.maxHeight:e.height),I=e.footerHeight+e.headerHeight+c+2*E,z=P-I,j=this._scrollHelper.getContentHeight(),A=j+I,F=d.getTotalWidth(v),L=F>e.width&&"hidden"!==e.overflowX;L&&(z-=u.SIZE,A+=u.SIZE,I+=u.SIZE);var G=Math.max(0,F-e.width),W=Math.max(0,j-z);i=Math.min(i,G),s=Math.min(s,W),W||(k&&(P=A),z=A-I),this._scrollHelper.setViewportHeight(z);var V=n({isColumnResizing:t&&t.isColumnResizing},w,e,{columns:v,columnGroups:_,columnResizingData:m,firstRowIndex:a,firstRowOffset:l,horizontalScrollbarVisible:L,maxScrollX:G,maxScrollY:W,reservedHeight:I,scrollContentHeight:j,scrollX:i,scrollY:s,bodyHeight:z,height:P,groupHeaderHeight:c,useGroupHeader:r});return V},_selectColumnElement:function(e,t){for(var o=[],n=0;nMath.abs(e)&&"hidden"!==this.props.overflowY){var n=this._scrollHelper.scrollBy(Math.round(t)),r=Math.max(0,n.contentHeight-this.state.bodyHeight);this.setState({firstRowIndex:n.index,firstRowOffset:n.offset,scrollY:n.position,scrollContentHeight:n.contentHeight,maxScrollY:r})}else e&&"hidden"!==this.props.overflowX&&(o+=e,o=o<0?0:o,o=o>this.state.maxScrollX?this.state.maxScrollX:o,this.setState({scrollX:o}));this._didScroll(),this._didScrollStop()}},_onHorizontalScroll:function(e){this._isMounted&&e!==this.state.scrollX&&(this._isScrolling||this._didScrollStart(),this.setState({scrollX:e}),this._didScroll(),this._didScrollStop())},_onVerticalScroll:function(e){if(this._isMounted&&e!==this.state.scrollY){this._isScrolling||this._didScrollStart();var t=this._scrollHelper.scrollTo(Math.round(e));this.setState({firstRowIndex:t.index,firstRowOffset:t.offset,scrollY:t.position,scrollContentHeight:t.contentHeight}),this._didScroll(),this._didScrollStop()}},_didScrollStart:function(){this._isMounted&&!this._isScrolling&&(this._isScrolling=!0,this.props.onScrollStart&&this.props.onScrollStart(this.state.scrollX,this.state.scrollY))},_didScroll:function(){this._isMounted&&this._isScrolling&&this.props.onScroll&&this.props.onScroll(this.state.scrollX,this.state.scrollY)},_didScrollStop:function(){this._isMounted&&this._isScrolling&&(this._isScrolling=!1,this.setState({redraw:!0}),this.props.onScrollEnd&&this.props.onScrollEnd(this.state.scrollX,this.state.scrollY))}}),H=s({displayName:"HorizontalScrollbar",mixins:[a],propTypes:{contentSize:r.number.isRequired,offset:r.number.isRequired,onScroll:r.func.isRequired,position:r.number.isRequired,size:r.number.isRequired},render:function(){var e=n({height:u.SIZE,width:this.props.size},this.props.horizontalScrollbarStyle),t={height:u.SIZE,position:"absolute",overflow:"hidden",width:this.props.size};return b(t,0,this.props.offset),i.createElement("div",{className:y(m("fixedDataTableLayout/horizontalScrollbar"),m("public/fixedDataTable/horizontalScrollbar")),style:e},i.createElement("div",{style:t},i.createElement(u,n({},this.props,{isOpaque:!0,orientation:"horizontal",offset:void 0}))))}});e.exports=O},function(e,t,o){"use strict";var n=o(35),r=o(38);if("undefined"==typeof n)throw Error("create-react-class could not find the React object. If you are using script tags, make sure that React is being loaded before create-react-class.");var i=(new n.Component).updater;e.exports=r(n.Component,n.isValidElement,i)},function(e,t,o){(function(t){"use strict";function n(e){return e}function r(e,o,r){function h(e,o,n){for(var r in o)o.hasOwnProperty(r)&&"production"!==t.env.NODE_ENV&&l("function"==typeof o[r],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",e.displayName||"ReactClass",u[n],r); +}function f(e,t){var o=x.hasOwnProperty(t)?x[t]:null;D.hasOwnProperty(t)&&a("OVERRIDE_BASE"===o,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&a("DEFINE_MANY"===o||"DEFINE_MANY_MERGED"===o,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function p(e,n){if(n){a("function"!=typeof n,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),a(!o(n),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=e.prototype,i=r.__reactAutoBindPairs;n.hasOwnProperty(c)&&R.mixins(e,n.mixins);for(var s in n)if(n.hasOwnProperty(s)&&s!==c){var u=n[s],h=r.hasOwnProperty(s);if(f(h,s),R.hasOwnProperty(s))R[s](e,u);else{var p=x.hasOwnProperty(s),d="function"==typeof u,m=d&&!p&&!h&&n.autobind!==!1;if(m)i.push(s,u),r[s]=u;else if(h){var g=x[s];a(p&&("DEFINE_MANY_MERGED"===g||"DEFINE_MANY"===g),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",g,s),"DEFINE_MANY_MERGED"===g?r[s]=v(r[s],u):"DEFINE_MANY"===g&&(r[s]=_(r[s],u))}else r[s]=u,"production"!==t.env.NODE_ENV&&"function"==typeof u&&n.displayName&&(r[s].displayName=n.displayName+"_"+s)}}}else if("production"!==t.env.NODE_ENV){var y=typeof n,w="object"===y&&null!==n;"production"!==t.env.NODE_ENV&&l(w,"%s: You're attempting to include a mixin that is either null or not an object. Check the mixins included by the component, as well as any mixins they include themselves. Expected object but got %s.",e.displayName||"ReactClass",null===n?null:y)}}function d(e,t){if(t)for(var o in t){var n=t[o];if(t.hasOwnProperty(o)){var r=o in R;a(!r,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',o);var i=o in e;if(i){var s=C.hasOwnProperty(o)?C[o]:null;return a("DEFINE_MANY_MERGED"===s,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",o),void(e[o]=v(e[o],n))}e[o]=n}}}function m(e,t){a(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var o in t)t.hasOwnProperty(o)&&(a(void 0===e[o],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",o),e[o]=t[o]);return e}function v(e,t){return function(){var o=e.apply(this,arguments),n=t.apply(this,arguments);if(null==o)return n;if(null==n)return o;var r={};return m(r,o),m(r,n),r}}function _(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function g(e,o){var n=o.bind(e);if("production"!==t.env.NODE_ENV){n.__reactBoundContext=e,n.__reactBoundMethod=o,n.__reactBoundArguments=null;var r=e.constructor.displayName,i=n.bind;n.bind=function(s){for(var a=arguments.length,u=Array(a>1?a-1:0),c=1;c1?t-1:0),n=1;n2?o-2:0),r=2;rn},ie64:function(){return y.ie()&&p},firefox:function(){return o()||r},opera:function(){return o()||i},webkit:function(){return o()||s},safari:function(){return y.webkit()},chrome:function(){return o()||a},windows:function(){return o()||c},osx:function(){return o()||u},linux:function(){return o()||h},iphone:function(){return o()||d},mobile:function(){return o()||d||m||f||_},nativeApp:function(){return o()||v},android:function(){return o()||f},ipad:function(){return o()||m}};e.exports=y},function(e,t,o){"use strict";function n(e,t){if(!i.canUseDOM||t&&!("addEventListener"in document))return!1;var o="on"+e,n=o in document;if(!n){var s=document.createElement("div");s.setAttribute(o,"return;"),n="function"==typeof s[o]}return!n&&r&&"wheel"===e&&(n=document.implementation.hasFeature("Events.wheel","3.0")),n}var r,i=o(49);i.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),e.exports=n},function(e,t){"use strict";var o=!("undefined"==typeof window||!window.document||!window.document.createElement),n={canUseDOM:o,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:o&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:o&&!!window.screen,isInWorker:!o};e.exports=n},function(e,t,o){(function(t){"use strict";var n=o(45),r=o(51),i=0,s=r||function(e){var o=Date.now(),n=Math.max(0,16-(o-i));return i=o+n,t.setTimeout(function(){e(Date.now())},n)};s(n),e.exports=s}).call(t,function(){return this}())},function(e,t){(function(t){"use strict";var o=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame;e.exports=o}).call(t,function(){return this}())},function(e,t,o){"use strict";var n=o(53),r=o(56),i=o(27),s=o(34),a=o(37),l=o(57),u=o(43),c=o(44),h=o(59),f=o(60),p=o(45),d=o(61),m={position:0,scrollable:!1},v=parseInt(h("scrollbar-face-margin"),10),_=2*v,g=30,y=40,w=null,b=a({displayName:"Scrollbar",mixins:[u],propTypes:{contentSize:i.number.isRequired,defaultPosition:i.number,isOpaque:i.bool,orientation:i.oneOf(["vertical","horizontal"]),onScroll:i.func,position:i.number,size:i.number.isRequired,trackColor:i.oneOf(["gray"]),zIndex:i.number,verticalTop:i.number},getInitialState:function(){var e=this.props;return this._calculateState(e.position||e.defaultPosition||0,e.size,e.contentSize,e.orientation)},componentWillReceiveProps:function(e){var t=e.position;void 0===t?this._setNextState(this._calculateState(this.state.position,e.size,e.contentSize,e.orientation)):this._setNextState(this._calculateState(t,e.size,e.contentSize,e.orientation),e)},getDefaultProps:function(){return{defaultPosition:0,isOpaque:!1,onScroll:p,orientation:"vertical",zIndex:99}},render:function(){if(!this.state.scrollable)return null;var e,t,o=this.props.size,n=this.state.isHorizontal,r=!n,i=this.state.focused||this.state.isDragging,a=this.state.faceSize,l=this.props.isOpaque,u=this.props.verticalTop||0,c=f({"ScrollbarLayout/main":!0,"ScrollbarLayout/mainVertical":r,"ScrollbarLayout/mainHorizontal":n,"public/Scrollbar/main":!0,"public/Scrollbar/mainOpaque":l,"public/Scrollbar/mainActive":i}),p=f({"ScrollbarLayout/face":!0,"ScrollbarLayout/faceHorizontal":n,"ScrollbarLayout/faceVertical":r,"public/Scrollbar/faceActive":i,"public/Scrollbar/face":!0}),m=this.state.position*this.state.scale+v;return n?(e={width:o},t={width:a-_},d(t,m,0)):(e={top:u,height:o},t={height:a-_},d(t,0,m)),e.zIndex=this.props.zIndex,"gray"===this.props.trackColor&&(e.backgroundColor=h("fbui-desktop-background-light")),s.createElement("div",{onFocus:this._onFocus,onBlur:this._onBlur,onKeyDown:this._onKeyDown,onMouseDown:this._onMouseDown,onWheel:this._wheelHandler.onWheel,className:c,style:e,tabIndex:0},s.createElement("div",{ref:"face",className:p,style:t}))},componentWillMount:function(){var e="horizontal"===this.props.orientation,t=e?this._onWheelX:this._onWheelY;this._wheelHandler=new c(t,this._shouldHandleX,this._shouldHandleY)},componentDidMount:function(){this._mouseMoveTracker=new n(this._onMouseMove,this._onMouseMoveEnd,document.documentElement),void 0!==this.props.position&&this.state.position!==this.props.position&&this._didScroll(),this._isMounted=!0},componentWillUnmount:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),w===this&&(w=null),delete this._mouseMoveTracker,this._isMounted=!1},scrollBy:function(e){this._onWheel(e)},_shouldHandleX:function(e){return"horizontal"===this.props.orientation&&this._shouldHandleChange(e)},_shouldHandleY:function(e){return"horizontal"!==this.props.orientation&&this._shouldHandleChange(e)},_shouldHandleChange:function(e){var t=this._calculateState(this.state.position+e,this.props.size,this.props.contentSize,this.props.orientation);return t.position!==this.state.position},_calculateState:function(e,t,o,n){if(t<1||o<=t)return m;var r=e+"_"+t+"_"+o+"_"+n;if(this._stateKey===r)return this._stateForKey;var i="horizontal"===n,s=t/o,a=t*s;au&&(e=u);var c=!!this._mouseMoveTracker&&this._mouseMoveTracker.isDragging(),h={faceSize:a,isDragging:c,isHorizontal:i,position:e,scale:s,scrollable:l};return this._stateKey=r,this._stateForKey=h,h},_onWheelY:function(e,t){this._onWheel(t)},_onWheelX:function(e,t){this._onWheel(e)},_onWheel:function(e){var t=this.props;this._setNextState(this._calculateState(this.state.position+e,t.size,t.contentSize,t.orientation))},_onMouseDown:function(e){var t;if(e.target!==l.findDOMNode(this.refs.face)){var o=e.nativeEvent,n=this.state.isHorizontal?o.offsetX||o.layerX:o.offsetY||o.layerY,r=this.props;n/=this.state.scale,t=this._calculateState(n-.5*this.state.faceSize/this.state.scale,r.size,r.contentSize,r.orientation)}else t={};t.focused=!0,this._setNextState(t),this._mouseMoveTracker.captureMouseMoves(e),l.findDOMNode(this).focus()},_onMouseMove:function(e,t){var o=this.props,n=this.state.isHorizontal?e:t;n/=this.state.scale,this._setNextState(this._calculateState(this.state.position+n,o.size,o.contentSize,o.orientation))},_onMouseMoveEnd:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),this.setState({isDragging:!1})},_onKeyDown:function(e){var t=e.keyCode;if(t!==r.TAB){var o=y,n=0;if(this.state.isHorizontal)switch(t){case r.HOME:n=-1,o=this.props.contentSize;break;case r.LEFT:n=-1;break;case r.RIGHT:n=1;break;default:return}if(!this.state.isHorizontal)switch(t){case r.SPACE:n=e.shiftKey?-1:1;break;case r.HOME:n=-1,o=this.props.contentSize;break;case r.UP:n=-1;break;case r.DOWN:n=1;break;case r.PAGE_UP:n=-1,o=this.props.size;break;case r.PAGE_DOWN:n=1,o=this.props.size;break;default:return}e.preventDefault();var i=this.props;this._setNextState(this._calculateState(this.state.position+o*n,i.size,i.contentSize,i.orientation))}},_onFocus:function(){this.setState({focused:!0})},_onBlur:function(){this.setState({focused:!1})},_blur:function(){if(this._isMounted)try{this._onBlur(),l.findDOMNode(this).blur()}catch(e){}},_setNextState:function(e,t){t=t||this.props;var o=t.position,n=this.state.position!==e.position;if(void 0===o){var r=n?this._didScroll:void 0;this.setState(e,r)}else{if(o!==e.position)return void(void 0!==e.position&&e.position!==this.state.position&&this.props.onScroll(e.position));this.setState(e)}n&&w!==this&&(w&&w._blur(),w=this)},_didScroll:function(){this.props.onScroll(this.state.position)}});b.KEYBOARD_SCROLL_AMOUNT=y,b.SIZE=parseInt(h("scrollbar-size"),10),e.exports=b},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var o=0;o0;)this._addRowToBuffer(t,this._viewportRowsBegin,this._viewportRowsEnd-1),t++,e--;return this._rows}},{key:"getRows",value:function(e,t){var o=t,n=o,r=e,i=Math.min(e+this._maxVisibleRowCount,this._rowsCount);for(this._viewportRowsBegin=e;r=i&&(n=this._bufferSet.replaceFurthestValuePosition(t,o,e)),null===n?(n=this._bufferSet.getNewPositionForValue(e),this._rows[n]=e):this._rows[n]=e}}]),e}();e.exports=c},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var o=0;o=e&&r<=t)return null;var i;e-n>r-t?(i=n,this._smallValues.pop()):(i=r,this._largeValues.pop());var a=this._valueToPositionMap[i];return delete this._valueToPositionMap[i],this._valueToPositionMap[o]=a,this._pushToHeaps(a,o),a}},{key:"_pushToHeaps",value:function(e,t){var o={position:e,value:t};this._smallValues.push(o),this._largeValues.push(o)}},{key:"_cleanHeaps",value:function(){this._cleanHeap(this._smallValues),this._cleanHeap(this._largeValues);var e=Math.min(this._smallValues.size(),this._largeValues.size()),t=Math.max(this._smallValues.size(),this._largeValues.size());t>10*e&&this._recreateHeaps()}},{key:"_recreateHeaps",value:function(){for(var e=this._smallValues.size()t.value}}]),e}();e.exports=a},function(e,t){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){return e0&&(this._items[0]=t,this._sinkDown(0)),e}}},{key:"push",value:function(e){this._items[this._size++]=e,this._bubbleUp(this._size-1)}},{key:"size",value:function(){return this._size}},{key:"peek",value:function(){if(0!==this._size)return this._items[0]}},{key:"_heapify",value:function(){for(var e=Math.floor((this._size+1)/2);e>=0;e--)this._sinkDown(e)}},{key:"_bubbleUp",value:function(e){for(var t=this._items[e];e>0;){var o=Math.floor((e+1)/2)-1,n=this._items[o];if(this._comparator(n,t))return;this._items[o]=t,this._items[e]=n,e=o}}},{key:"_sinkDown",value:function(e){for(var t=this._items[e];;){var o=2*(e+1)-1,n=2*(e+1),r=-1;if(oo?o:e}e.exports=o},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=Object.assign||function(e){for(var t=1;t0){var o=h({"fixedDataTableRowLayout/fixedColumnsDivider":!0,"fixedDataTableRowLayout/columnsShadow":e.props.scrollLeft>0,"public/fixedDataTableRow/fixedColumnsDivider":!0,"public/fixedDataTableRow/columnsShadow":e.props.scrollLeft>0}),n={left:t,height:e.props.height};return u.createElement("div",{className:o,style:n})}},this._onClick=function(t){e.props.onClick(t,e.props.index)},this._onDoubleClick=function(t){e.props.onDoubleClick(t,e.props.index)},this._onMouseDown=function(t){e.props.onMouseDown(t,e.props.index)},this._onMouseEnter=function(t){e.props.onMouseEnter(t,e.props.index)},this._onMouseLeave=function(t){e.props.onMouseLeave(t,e.props.index)}}return r(t,e),s(t,[{key:"render",value:function(){var e={width:this.props.width,height:this.props.height},t=h({"fixedDataTableRowLayout/main":!0,"public/fixedDataTableRow/main":!0,"public/fixedDataTableRow/highlighted":this.props.index%2===1,"public/fixedDataTableRow/odd":this.props.index%2===1,"public/fixedDataTableRow/even":this.props.index%2===0}),o=this._getColumnsWidth(this.props.fixedColumns),n=u.createElement(c,{key:"fixed_cells",isScrolling:this.props.isScrolling,height:this.props.height,left:0,width:o,zIndex:2,columns:this.props.fixedColumns,onColumnResize:this.props.onColumnResize,rowHeight:this.props.height,rowIndex:this.props.index}),r=this._renderColumnsShadow(o),i=u.createElement(c,{key:"scrollable_cells",isScrolling:this.props.isScrolling,height:this.props.height,left:this.props.scrollLeft,offsetLeft:o,width:this.props.width-o,zIndex:0,columns:this.props.scrollableColumns,onColumnResize:this.props.onColumnResize,rowHeight:this.props.height,rowIndex:this.props.index});return u.createElement("div",{className:f(t,this.props.className),onClick:this.props.onClick?this._onClick:null,onDoubleClick:this.props.onDoubleClick?this._onDoubleClick:null,onMouseDown:this.props.onMouseDown?this._onMouseDown:null,onMouseEnter:this.props.onMouseEnter?this._onMouseEnter:null,onMouseLeave:this.props.onMouseLeave?this._onMouseLeave:null,style:e},u.createElement("div",{className:h("fixedDataTableRowLayout/body")},n,i,r))}}],[{key:"propTypes",value:{isScrolling:l.bool,fixedColumns:l.array.isRequired,height:l.number.isRequired,index:l.number.isRequired,scrollableColumns:l.array.isRequired,scrollLeft:l.number.isRequired,width:l.number.isRequired,onClick:l.func,onDoubleClick:l.func,onColumnResize:l.func},enumerable:!0}]),t}(u.Component),m=function(e){function t(){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return r(t,e),s(t,[{key:"render",value:function(){var e={width:this.props.width,height:this.props.height,zIndex:this.props.zIndex?this.props.zIndex:0};return p(e,0,this.props.offsetTop),u.createElement("div",{style:e,className:h("fixedDataTableRowLayout/rowWrapper")},u.createElement(d,i({},this.props,{offsetTop:void 0,zIndex:void 0})))}}],[{key:"propTypes",value:{isScrolling:l.bool,height:l.number.isRequired,zIndex:l.number,offsetTop:l.number.isRequired,width:l.number.isRequired},enumerable:!0}]),t}(u.Component);e.exports=m},function(e,t,o){"use strict";function n(e,t){var o={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}var r=Object.assign||function(e){for(var t=1;t=0){var l="cell_"+r;o[r]=this._renderCell(e.rowIndex,e.rowHeight,s,n,l)}n+=s.width}var u=this._getColumnsWidth(t),p={height:e.height,position:"absolute",width:u,zIndex:e.zIndex};return h(p,-1*f*e.left,0),a.createElement("div",{className:c("fixedDataTableCellGroupLayout/cellGroup"),style:p},o)},_renderCell:function(e,t,o,n,r){var i=o.isResizable&&this.props.onColumnResize,s=i?this.props.onColumnResize:null,l=o.cellClassName;return a.createElement(u,{isScrolling:this.props.isScrolling,align:o.align,className:l,height:t,key:r,maxWidth:o.maxWidth,minWidth:o.minWidth,onColumnResize:s,rowIndex:e,columnKey:o.columnKey,width:o.width,left:n,cell:o.cell})},_getColumnsWidth:function(e){for(var t=0,o=0;o=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}var r=o(78),i=o(73),s=o(27),a=o(34),l=o(37),u=o(60),c=o(79),h=i.DIR_SIGN,f={align:"left",highlighted:!1},p=l({displayName:"FixedDataTableCell",propTypes_DISABLED_FOR_PERFORMANCE:{isScrolling:s.bool,align:s.oneOf(["left","center","right"]),className:s.string,highlighted:s.bool,width:s.number.isRequired,minWidth:s.number,maxWidth:s.number,height:s.number.isRequired,cell:s.oneOfType([s.string,s.element,s.func]),columnKey:s.oneOfType([s.string,s.number]),rowIndex:s.number.isRequired,onColumnResize:s.func,left:s.number},shouldComponentUpdate:function(e){return!e.isScrolling||this.props.rowIndex!==e.rowIndex},getDefaultProps:function(){return f},render:function(){var e=this.props,t=e.height,o=e.width,i=e.columnKey,s=n(e,["height","width","columnKey"]),l={height:t,width:o};1===h?l.left=s.left:l.right=s.left;var f,p=c(u({"fixedDataTableCellLayout/main":!0,"fixedDataTableCellLayout/lastChild":s.lastChild,"fixedDataTableCellLayout/alignRight":"right"===s.align,"fixedDataTableCellLayout/alignCenter":"center"===s.align,"public/fixedDataTableCell/alignRight":"right"===s.align,"public/fixedDataTableCell/highlighted":s.highlighted,"public/fixedDataTableCell/main":!0}),s.className);if(s.onColumnResize){var d={height:t};f=a.createElement("div",{className:u("fixedDataTableCellLayout/columnResizerContainer"),style:d,onMouseDown:this._onColumnResizerMouseDown},a.createElement("div",{className:c(u("fixedDataTableCellLayout/columnResizerKnob"),u("public/fixedDataTableCell/columnResizerKnob")),style:d}))}var m={columnKey:i,height:t,width:o};s.rowIndex>=0&&(m.rowIndex=s.rowIndex);var v;return v=a.isValidElement(s.cell)?a.cloneElement(s.cell,m):"function"==typeof s.cell?s.cell(m):a.createElement(r,m,s.cell),a.createElement("div",{className:p,style:l},f,v)},_onColumnResizerMouseDown:function(e){this.props.onColumnResize(this.props.left,this.props.width,this.props.minWidth,this.props.maxWidth,this.props.columnKey,e)}});e.exports=p},function(e,t,o){"use strict";function n(e,t){var o={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=Object.assign||function(e){for(var t=1;t1)for(var n=1;n=0&&t>=e-a;){var o=this._updateRowHeight(t);this._position+=o,t--}}},{key:"_updateRowHeight",value:function(e){if(e<0||e>=this._rowCount)return 0;var t=this._rowHeightGetter(e);if(t!==this._storedHeights[e]){var o=t-this._storedHeights[e];return this._rowOffsets.set(e,t),this._storedHeights[e]=t,this._contentHeight+=o,o}return 0}},{key:"getRowPosition",value:function(e){return this._updateRowHeight(e),this._rowOffsets.sumUntil(e)}},{key:"scrollBy",value:function(e){if(0===this._rowCount)return l;var t=this._rowOffsets.greatestLowerBound(this._position);t=s(t,0,Math.max(this._rowCount-1,0));var o=this._rowOffsets.sumUntil(t),n=t,r=this._position,i=this._updateRowHeight(n);0!==o&&(r+=i);var a=this._storedHeights[n]-(r-o);if(e>=0)for(;e>0&&n0&&n>=0;)if(e=0){var c=this._updateRowHeight(n);u=this._storedHeights[n],r+=c}}var h=this._contentHeight-this._viewportHeight;r=s(r,0,h),this._position=r;var f=this._rowOffsets.greatestLowerBound(r);f=s(f,0,Math.max(this._rowCount-1,0)),o=this._rowOffsets.sumUntil(f);var p=o-r;return this._updateHeightsInViewport(f,p),this._updateHeightsAboveViewport(f),{index:f,offset:p,position:this._position,contentHeight:this._contentHeight}}},{key:"_getRowAtEndPosition",value:function(e){this._updateRowHeight(e);for(var t=e,o=this._storedHeights[t];o=0;)t--,t>=0&&(this._updateRowHeight(t),o+=this._storedHeights[t]);var n=this._rowOffsets.sumTo(e)-this._viewportHeight;return n<0&&(n=0),n}},{key:"scrollTo",value:function(e){if(0===this._rowCount)return l;if(e<=0)return this._position=0,this._updateHeightsInViewport(0,0),{index:0,offset:0,position:this._position,contentHeight:this._contentHeight};if(e>=this._contentHeight-this._viewportHeight){var t=this._rowCount-1;e=this._getRowAtEndPosition(t)}this._position=e;var o=this._rowOffsets.greatestLowerBound(e);o=s(o,0,Math.max(this._rowCount-1,0));var n=this._rowOffsets.sumUntil(o),r=n-e;return this._updateHeightsInViewport(o,r),this._updateHeightsAboveViewport(o),{index:o,offset:r,position:this._position,contentHeight:this._contentHeight}}},{key:"scrollToRow",value:function(e,t){e=s(e,0,Math.max(this._rowCount-1,0)),t=s(t,-this._storedHeights[e],0);var o=this._rowOffsets.sumUntil(e);return this.scrollTo(o-t)}},{key:"scrollRowIntoView",value:function(e){e=s(e,0,Math.max(this._rowCount-1,0));var t=this._rowOffsets.sumUntil(e),o=t+this._storedHeights[e];if(t=0;--o)t[o]=0;return t},u=function(){function e(t){n(this,e),this._size=t.length,this._half=r(this._size),this._heap=new l(2*this._half);var o;for(o=0;o0;--o)this._heap[o]=this._heap[2*o]+this._heap[2*o+1]}return i(e,[{key:"set",value:function(e,t){s(0<=e&&e=0;--r)n[r]=o;return new e(n)}},{key:"empty",value:function(t){return e.uniform(t,0)}}]),e}();e.exports=u}).call(t,function(){return this}())},function(e,t,o){"use strict";function n(e){for(var t=0,o=0;o=t||o<0||T&&n>=_}function c(){var e=C();return u(e)?h(e):void(y=setTimeout(c,s(e)))}function h(e){return y=void 0,D&&m?n(e):(m=v=void 0,g)}function f(){void 0!==y&&clearTimeout(y),R=0,m=w=v=y=void 0}function p(){return void 0===y?g:h(C())}function d(){var e=C(),o=u(e);if(m=arguments,v=this,w=e,o){if(void 0===y)return i(w);if(T)return y=setTimeout(c,t),n(w)}return void 0===y&&(y=setTimeout(c,t)),g}var m,v,_,g,y,w,R=0,E=!1,T=!1,D=!0;if("function"!=typeof e)throw new TypeError(l);return t=a(t)||0,r(o)&&(E=!!o.leading,T="maxWait"in o,_=T?b(a(o.maxWait)||0,t):_,D="trailing"in o?!!o.trailing:D),d.cancel=f,d.flush=p,d}function n(e,t,n){var i=!0,s=!0;if("function"!=typeof e)throw new TypeError(l);return r(n)&&(i="leading"in n?!!n.leading:i,s="trailing"in n?!!n.trailing:s),o(e,t,{leading:i,maxWait:t,trailing:s})}function r(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function i(e){return!!e&&"object"==typeof e}function s(e){return"symbol"==typeof e||i(e)&&w.call(e)==c}function a(e){if("number"==typeof e)return e;if(s(e))return u;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(h,"");var o=p.test(e);return o||d.test(e)?m(e.slice(2),o?2:8):f.test(e)?u:+e}var l="Expected a function",u=NaN,c="[object Symbol]",h=/^\s+|\s+$/g,f=/^[-+]0x[0-9a-f]+$/i,p=/^0b[01]+$/i,d=/^0o[0-7]+$/i,m=parseInt,v="object"==typeof t&&t&&t.Object===Object&&t,_="object"==typeof self&&self&&self.Object===Object&&self,g=v||_||Function("return this")(),y=Object.prototype,w=y.toString,b=Math.max,x=Math.min,C=function(){return g.Date.now()};e.exports=n}).call(t,function(){return this}())},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=function(){function e(e,t){for(var o=0;o Date: Tue, 27 Nov 2018 12:08:52 -0800 Subject: [PATCH 23/43] Version 0.7.9 --- dist/fixed-data-table.js | 2 +- dist/fixed-data-table.min.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/fixed-data-table.js b/dist/fixed-data-table.js index 49bd38c7..5843d175 100644 --- a/dist/fixed-data-table.js +++ b/dist/fixed-data-table.js @@ -2145,7 +2145,7 @@ return /******/ (function(modules) { // webpackBootstrap this._columnToScrollTo = scrollToColumn; } this._wheelHandler = new ReactWheelHandler(this._onWheel, this._shouldHandleWheelX, this._shouldHandleWheelY); - this._onScroll = throttle(this._onScroll, this.props.onScrollThrottle || 0); + this._didScroll = throttle(this._didScroll, this.props.onScrollThrottle || 0); }, _shouldHandleWheelX: function _shouldHandleWheelX( /*number*/delta) /*boolean*/{ diff --git a/dist/fixed-data-table.min.js b/dist/fixed-data-table.min.js index 28c949fc..7d7f4c74 100644 --- a/dist/fixed-data-table.min.js +++ b/dist/fixed-data-table.min.js @@ -9,7 +9,7 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.FixedDataTable=t(require("react"),require("react-dom")):e.FixedDataTable=t(e.React,e.ReactDOM)}(this,function(e,t){return function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){o(1),o(5),o(7),o(9),o(11),o(13),o(15),o(17),o(19),o(21),o(23),e.exports=o(25)},function(e,t){},,,,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t,o){"use strict";var n=o(26),r=o(78),i=o(76),s=o(75),a={Cell:r,Column:i,ColumnGroup:s,Table:n};a.version="0.7.0",e.exports=a},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e,t){}var s=Object.assign||function(e){for(var t=1;t1)for(var o=1;o0||e>=0&&this.state.scrollX0||e>=0&&this.state.scrollYn?n:this.state.height>n&&this.props.ownerHeight?Math.max(n,this.props.ownerHeight):this.state.height+this.state.maxScrollY,e!==this._contentHeight&&this.props.onContentHeightChange&&this.props.onContentHeightChange(e),this._contentHeight=e},componentDidMount:function(){this._reportContentHeight(),this._isMounted=!0},componentWillReceiveProps:function(e){var t=e.scrollToRow;void 0!==t&&null!==t&&(this._rowToScrollTo=t);var o=e.scrollToColumn;void 0!==o&&null!==o&&(this._columnToScrollTo=o);var n=e.overflowX,r=e.overflowY;n===this.props.overflowX&&r===this.props.overflowY||(this._wheelHandler=new l(this._onWheel,"hidden"!==n,"hidden"!==r)),this.props.ownerHeight===e.ownerHeight&&this.props.scrollTop===e.scrollTop||this._didScrollStart(),this._didScroll(),this._didScrollStop(),this.setState(this._calculateState(e,this.state))},componentDidUpdate:function(){this._reportContentHeight()},render:function(){var e,t=this.state,o=this.props;t.useGroupHeader&&(e=i.createElement(f,{key:"group_header",isScrolling:this._isScrolling,className:y(m("fixedDataTableLayout/header"),m("public/fixedDataTable/header")),width:t.width,height:t.groupHeaderHeight,index:0,zIndex:1,offsetTop:0,scrollLeft:t.scrollX,fixedColumns:t.groupHeaderFixedColumns,scrollableColumns:t.groupHeaderScrollableColumns,onColumnResize:this._onColumnResize}));var r=this.state.maxScrollY,s=t.maxScrollX>0&&"hidden"!==t.overflowX,a=r>0&&"hidden"!==t.overflowY,l=s?u.SIZE:0,c=t.height-l-2*E-t.footerHeight,p=t.useGroupHeader?t.groupHeaderHeight:0,d=p+t.headerHeight;c-=d;var v=0,_=null!=o.maxHeight?d+t.bodyHeight:d+c,g=_+t.footerHeight;void 0!==o.ownerHeight&&o.ownerHeightt.ownerHeight||t.scrollY or "),o.push(e))});var r=!1;o.length&&o[0].type.__TableColumnGroup__&&(r=!0),t&&(void 0!==e.width&&e.width!==t.width||void 0!==e.height&&e.height!==t.height||void 0!==e.maxWidth&&e.maxWidth!==t.maxWidth||void 0!==e.maxHeight&&e.maxHeight!==t.maxHeight)&&(t=null);var i,s,a=t&&t.firstRowIndex||0,l=t&&t.firstRowOffset||0;i=t&&"hidden"!==e.overflowX?t.scrollX:e.scrollLeft,t&&"hidden"!==e.overflowY?s=t.scrollY:(f=this._scrollHelper.scrollTo(e.scrollTop),a=f.index,l=f.offset,s=f.position),void 0!==this._rowToScrollTo&&(f=this._scrollHelper.scrollRowIntoView(this._rowToScrollTo),a=f.index,l=f.offset,s=f.position,delete this._rowToScrollTo);var c=r?e.groupHeaderHeight:0;if(t&&e.rowsCount!==t.rowsCount){var h=(void 0===e.height?e.maxHeight:e.height)-(e.headerHeight||0)-(e.footerHeight||0)-(e.groupHeaderHeight||0);this._scrollHelper=new p(e.rowsCount,e.rowHeight,h,e.rowHeightGetter);var f=this._scrollHelper.scrollToRow(a,l);a=f.index,l=f.offset,s=f.position}else t&&e.rowHeightGetter!==t.rowHeightGetter&&this._scrollHelper.setRowHeightGetter(e.rowHeightGetter);var m;m=e.isColumnResizing?t&&t.columnResizingData:R;var v,_;if(r){var y=d.adjustColumnGroupWidths(o,e.width);v=y.columns,_=y.columnGroups}else v=d.adjustColumnWidths(o,e.width);var w=this._populateColumnsAndColumnData(v,_,t);if(void 0!==this._columnToScrollTo){var b=w.bodyFixedColumns.length;if(this._columnToScrollTo>=b){var x,T,D=0;for(x=0;xO&&(i=O)}delete this._columnToScrollTo}var k=void 0===e.height,P=Math.round(k?e.maxHeight:e.height),I=e.footerHeight+e.headerHeight+c+2*E,z=P-I,j=this._scrollHelper.getContentHeight(),A=j+I,F=d.getTotalWidth(v),L=F>e.width&&"hidden"!==e.overflowX;L&&(z-=u.SIZE,A+=u.SIZE,I+=u.SIZE);var G=Math.max(0,F-e.width),W=Math.max(0,j-z);i=Math.min(i,G),s=Math.min(s,W),W||(k&&(P=A),z=A-I),this._scrollHelper.setViewportHeight(z);var V=n({isColumnResizing:t&&t.isColumnResizing},w,e,{columns:v,columnGroups:_,columnResizingData:m,firstRowIndex:a,firstRowOffset:l,horizontalScrollbarVisible:L,maxScrollX:G,maxScrollY:W,reservedHeight:I,scrollContentHeight:j,scrollX:i,scrollY:s,bodyHeight:z,height:P,groupHeaderHeight:c,useGroupHeader:r});return V},_selectColumnElement:function(e,t){for(var o=[],n=0;nMath.abs(e)&&"hidden"!==this.props.overflowY){var n=this._scrollHelper.scrollBy(Math.round(t)),r=Math.max(0,n.contentHeight-this.state.bodyHeight);this.setState({firstRowIndex:n.index,firstRowOffset:n.offset,scrollY:n.position,scrollContentHeight:n.contentHeight,maxScrollY:r})}else e&&"hidden"!==this.props.overflowX&&(o+=e,o=o<0?0:o,o=o>this.state.maxScrollX?this.state.maxScrollX:o,this.setState({scrollX:o}));this._didScroll(),this._didScrollStop()}},_onHorizontalScroll:function(e){this._isMounted&&e!==this.state.scrollX&&(this._isScrolling||this._didScrollStart(),this.setState({scrollX:e}),this._didScroll(),this._didScrollStop())},_onVerticalScroll:function(e){if(this._isMounted&&e!==this.state.scrollY){this._isScrolling||this._didScrollStart();var t=this._scrollHelper.scrollTo(Math.round(e));this.setState({firstRowIndex:t.index,firstRowOffset:t.offset,scrollY:t.position,scrollContentHeight:t.contentHeight}),this._didScroll(),this._didScrollStop()}},_didScrollStart:function(){this._isMounted&&!this._isScrolling&&(this._isScrolling=!0,this.props.onScrollStart&&this.props.onScrollStart(this.state.scrollX,this.state.scrollY))},_didScroll:function(){this._isMounted&&this._isScrolling&&this.props.onScroll&&this.props.onScroll(this.state.scrollX,this.state.scrollY)},_didScrollStop:function(){this._isMounted&&this._isScrolling&&(this._isScrolling=!1,this.setState({redraw:!0}),this.props.onScrollEnd&&this.props.onScrollEnd(this.state.scrollX,this.state.scrollY))}}),H=s({displayName:"HorizontalScrollbar",mixins:[a],propTypes:{contentSize:r.number.isRequired,offset:r.number.isRequired,onScroll:r.func.isRequired,position:r.number.isRequired,size:r.number.isRequired},render:function(){var e=n({height:u.SIZE,width:this.props.size},this.props.horizontalScrollbarStyle),t={height:u.SIZE,position:"absolute",overflow:"hidden",width:this.props.size};return b(t,0,this.props.offset),i.createElement("div",{className:y(m("fixedDataTableLayout/horizontalScrollbar"),m("public/fixedDataTable/horizontalScrollbar")),style:e},i.createElement("div",{style:t},i.createElement(u,n({},this.props,{isOpaque:!0,orientation:"horizontal",offset:void 0}))))}});e.exports=O},function(e,t,o){"use strict";var n=o(35),r=o(38);if("undefined"==typeof n)throw Error("create-react-class could not find the React object. If you are using script tags, make sure that React is being loaded before create-react-class.");var i=(new n.Component).updater;e.exports=r(n.Component,n.isValidElement,i)},function(e,t,o){(function(t){"use strict";function n(e){return e}function r(e,o,r){function h(e,o,n){for(var r in o)o.hasOwnProperty(r)&&"production"!==t.env.NODE_ENV&&l("function"==typeof o[r],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",e.displayName||"ReactClass",u[n],r); +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.FixedDataTable=t(require("react"),require("react-dom")):e.FixedDataTable=t(e.React,e.ReactDOM)}(this,function(e,t){return function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){o(1),o(5),o(7),o(9),o(11),o(13),o(15),o(17),o(19),o(21),o(23),e.exports=o(25)},function(e,t){},,,,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t,o){"use strict";var n=o(26),r=o(78),i=o(76),s=o(75),a={Cell:r,Column:i,ColumnGroup:s,Table:n};a.version="0.7.0",e.exports=a},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e,t){}var s=Object.assign||function(e){for(var t=1;t1)for(var o=1;o0||e>=0&&this.state.scrollX0||e>=0&&this.state.scrollYn?n:this.state.height>n&&this.props.ownerHeight?Math.max(n,this.props.ownerHeight):this.state.height+this.state.maxScrollY,e!==this._contentHeight&&this.props.onContentHeightChange&&this.props.onContentHeightChange(e),this._contentHeight=e},componentDidMount:function(){this._reportContentHeight(),this._isMounted=!0},componentWillReceiveProps:function(e){var t=e.scrollToRow;void 0!==t&&null!==t&&(this._rowToScrollTo=t);var o=e.scrollToColumn;void 0!==o&&null!==o&&(this._columnToScrollTo=o);var n=e.overflowX,r=e.overflowY;n===this.props.overflowX&&r===this.props.overflowY||(this._wheelHandler=new l(this._onWheel,"hidden"!==n,"hidden"!==r)),this.props.ownerHeight===e.ownerHeight&&this.props.scrollTop===e.scrollTop||this._didScrollStart(),this._didScroll(),this._didScrollStop(),this.setState(this._calculateState(e,this.state))},componentDidUpdate:function(){this._reportContentHeight()},render:function(){var e,t=this.state,o=this.props;t.useGroupHeader&&(e=i.createElement(f,{key:"group_header",isScrolling:this._isScrolling,className:y(m("fixedDataTableLayout/header"),m("public/fixedDataTable/header")),width:t.width,height:t.groupHeaderHeight,index:0,zIndex:1,offsetTop:0,scrollLeft:t.scrollX,fixedColumns:t.groupHeaderFixedColumns,scrollableColumns:t.groupHeaderScrollableColumns,onColumnResize:this._onColumnResize}));var r=this.state.maxScrollY,s=t.maxScrollX>0&&"hidden"!==t.overflowX,a=r>0&&"hidden"!==t.overflowY,l=s?u.SIZE:0,c=t.height-l-2*E-t.footerHeight,p=t.useGroupHeader?t.groupHeaderHeight:0,d=p+t.headerHeight;c-=d;var v=0,_=null!=o.maxHeight?d+t.bodyHeight:d+c,g=_+t.footerHeight;void 0!==o.ownerHeight&&o.ownerHeightt.ownerHeight||t.scrollY or "),o.push(e))});var r=!1;o.length&&o[0].type.__TableColumnGroup__&&(r=!0),t&&(void 0!==e.width&&e.width!==t.width||void 0!==e.height&&e.height!==t.height||void 0!==e.maxWidth&&e.maxWidth!==t.maxWidth||void 0!==e.maxHeight&&e.maxHeight!==t.maxHeight)&&(t=null);var i,s,a=t&&t.firstRowIndex||0,l=t&&t.firstRowOffset||0;i=t&&"hidden"!==e.overflowX?t.scrollX:e.scrollLeft,t&&"hidden"!==e.overflowY?s=t.scrollY:(f=this._scrollHelper.scrollTo(e.scrollTop),a=f.index,l=f.offset,s=f.position),void 0!==this._rowToScrollTo&&(f=this._scrollHelper.scrollRowIntoView(this._rowToScrollTo),a=f.index,l=f.offset,s=f.position,delete this._rowToScrollTo);var c=r?e.groupHeaderHeight:0;if(t&&e.rowsCount!==t.rowsCount){var h=(void 0===e.height?e.maxHeight:e.height)-(e.headerHeight||0)-(e.footerHeight||0)-(e.groupHeaderHeight||0);this._scrollHelper=new p(e.rowsCount,e.rowHeight,h,e.rowHeightGetter);var f=this._scrollHelper.scrollToRow(a,l);a=f.index,l=f.offset,s=f.position}else t&&e.rowHeightGetter!==t.rowHeightGetter&&this._scrollHelper.setRowHeightGetter(e.rowHeightGetter);var m;m=e.isColumnResizing?t&&t.columnResizingData:R;var v,_;if(r){var y=d.adjustColumnGroupWidths(o,e.width);v=y.columns,_=y.columnGroups}else v=d.adjustColumnWidths(o,e.width);var w=this._populateColumnsAndColumnData(v,_,t);if(void 0!==this._columnToScrollTo){var b=w.bodyFixedColumns.length;if(this._columnToScrollTo>=b){var x,T,D=0;for(x=0;xO&&(i=O)}delete this._columnToScrollTo}var k=void 0===e.height,P=Math.round(k?e.maxHeight:e.height),I=e.footerHeight+e.headerHeight+c+2*E,z=P-I,j=this._scrollHelper.getContentHeight(),A=j+I,F=d.getTotalWidth(v),L=F>e.width&&"hidden"!==e.overflowX;L&&(z-=u.SIZE,A+=u.SIZE,I+=u.SIZE);var G=Math.max(0,F-e.width),W=Math.max(0,j-z);i=Math.min(i,G),s=Math.min(s,W),W||(k&&(P=A),z=A-I),this._scrollHelper.setViewportHeight(z);var V=n({isColumnResizing:t&&t.isColumnResizing},w,e,{columns:v,columnGroups:_,columnResizingData:m,firstRowIndex:a,firstRowOffset:l,horizontalScrollbarVisible:L,maxScrollX:G,maxScrollY:W,reservedHeight:I,scrollContentHeight:j,scrollX:i,scrollY:s,bodyHeight:z,height:P,groupHeaderHeight:c,useGroupHeader:r});return V},_selectColumnElement:function(e,t){for(var o=[],n=0;nMath.abs(e)&&"hidden"!==this.props.overflowY){var n=this._scrollHelper.scrollBy(Math.round(t)),r=Math.max(0,n.contentHeight-this.state.bodyHeight);this.setState({firstRowIndex:n.index,firstRowOffset:n.offset,scrollY:n.position,scrollContentHeight:n.contentHeight,maxScrollY:r})}else e&&"hidden"!==this.props.overflowX&&(o+=e,o=o<0?0:o,o=o>this.state.maxScrollX?this.state.maxScrollX:o,this.setState({scrollX:o}));this._didScroll(),this._didScrollStop()}},_onHorizontalScroll:function(e){this._isMounted&&e!==this.state.scrollX&&(this._isScrolling||this._didScrollStart(),this.setState({scrollX:e}),this._didScroll(),this._didScrollStop())},_onVerticalScroll:function(e){if(this._isMounted&&e!==this.state.scrollY){this._isScrolling||this._didScrollStart();var t=this._scrollHelper.scrollTo(Math.round(e));this.setState({firstRowIndex:t.index,firstRowOffset:t.offset,scrollY:t.position,scrollContentHeight:t.contentHeight}),this._didScroll(),this._didScrollStop()}},_didScrollStart:function(){this._isMounted&&!this._isScrolling&&(this._isScrolling=!0,this.props.onScrollStart&&this.props.onScrollStart(this.state.scrollX,this.state.scrollY))},_didScroll:function(){this._isMounted&&this._isScrolling&&this.props.onScroll&&this.props.onScroll(this.state.scrollX,this.state.scrollY)},_didScrollStop:function(){this._isMounted&&this._isScrolling&&(this._isScrolling=!1,this.setState({redraw:!0}),this.props.onScrollEnd&&this.props.onScrollEnd(this.state.scrollX,this.state.scrollY))}}),H=s({displayName:"HorizontalScrollbar",mixins:[a],propTypes:{contentSize:r.number.isRequired,offset:r.number.isRequired,onScroll:r.func.isRequired,position:r.number.isRequired,size:r.number.isRequired},render:function(){var e=n({height:u.SIZE,width:this.props.size},this.props.horizontalScrollbarStyle),t={height:u.SIZE,position:"absolute",overflow:"hidden",width:this.props.size};return b(t,0,this.props.offset),i.createElement("div",{className:y(m("fixedDataTableLayout/horizontalScrollbar"),m("public/fixedDataTable/horizontalScrollbar")),style:e},i.createElement("div",{style:t},i.createElement(u,n({},this.props,{isOpaque:!0,orientation:"horizontal",offset:void 0}))))}});e.exports=O},function(e,t,o){"use strict";var n=o(35),r=o(38);if("undefined"==typeof n)throw Error("create-react-class could not find the React object. If you are using script tags, make sure that React is being loaded before create-react-class.");var i=(new n.Component).updater;e.exports=r(n.Component,n.isValidElement,i)},function(e,t,o){(function(t){"use strict";function n(e){return e}function r(e,o,r){function h(e,o,n){for(var r in o)o.hasOwnProperty(r)&&"production"!==t.env.NODE_ENV&&l("function"==typeof o[r],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",e.displayName||"ReactClass",u[n],r); }function f(e,t){var o=x.hasOwnProperty(t)?x[t]:null;D.hasOwnProperty(t)&&a("OVERRIDE_BASE"===o,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&a("DEFINE_MANY"===o||"DEFINE_MANY_MERGED"===o,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function p(e,n){if(n){a("function"!=typeof n,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),a(!o(n),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=e.prototype,i=r.__reactAutoBindPairs;n.hasOwnProperty(c)&&R.mixins(e,n.mixins);for(var s in n)if(n.hasOwnProperty(s)&&s!==c){var u=n[s],h=r.hasOwnProperty(s);if(f(h,s),R.hasOwnProperty(s))R[s](e,u);else{var p=x.hasOwnProperty(s),d="function"==typeof u,m=d&&!p&&!h&&n.autobind!==!1;if(m)i.push(s,u),r[s]=u;else if(h){var g=x[s];a(p&&("DEFINE_MANY_MERGED"===g||"DEFINE_MANY"===g),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",g,s),"DEFINE_MANY_MERGED"===g?r[s]=v(r[s],u):"DEFINE_MANY"===g&&(r[s]=_(r[s],u))}else r[s]=u,"production"!==t.env.NODE_ENV&&"function"==typeof u&&n.displayName&&(r[s].displayName=n.displayName+"_"+s)}}}else if("production"!==t.env.NODE_ENV){var y=typeof n,w="object"===y&&null!==n;"production"!==t.env.NODE_ENV&&l(w,"%s: You're attempting to include a mixin that is either null or not an object. Check the mixins included by the component, as well as any mixins they include themselves. Expected object but got %s.",e.displayName||"ReactClass",null===n?null:y)}}function d(e,t){if(t)for(var o in t){var n=t[o];if(t.hasOwnProperty(o)){var r=o in R;a(!r,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',o);var i=o in e;if(i){var s=C.hasOwnProperty(o)?C[o]:null;return a("DEFINE_MANY_MERGED"===s,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",o),void(e[o]=v(e[o],n))}e[o]=n}}}function m(e,t){a(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var o in t)t.hasOwnProperty(o)&&(a(void 0===e[o],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",o),e[o]=t[o]);return e}function v(e,t){return function(){var o=e.apply(this,arguments),n=t.apply(this,arguments);if(null==o)return n;if(null==n)return o;var r={};return m(r,o),m(r,n),r}}function _(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function g(e,o){var n=o.bind(e);if("production"!==t.env.NODE_ENV){n.__reactBoundContext=e,n.__reactBoundMethod=o,n.__reactBoundArguments=null;var r=e.constructor.displayName,i=n.bind;n.bind=function(s){for(var a=arguments.length,u=Array(a>1?a-1:0),c=1;c1?t-1:0),n=1;n2?o-2:0),r=2;rn},ie64:function(){return y.ie()&&p},firefox:function(){return o()||r},opera:function(){return o()||i},webkit:function(){return o()||s},safari:function(){return y.webkit()},chrome:function(){return o()||a},windows:function(){return o()||c},osx:function(){return o()||u},linux:function(){return o()||h},iphone:function(){return o()||d},mobile:function(){return o()||d||m||f||_},nativeApp:function(){return o()||v},android:function(){return o()||f},ipad:function(){return o()||m}};e.exports=y},function(e,t,o){"use strict";function n(e,t){if(!i.canUseDOM||t&&!("addEventListener"in document))return!1;var o="on"+e,n=o in document;if(!n){var s=document.createElement("div");s.setAttribute(o,"return;"),n="function"==typeof s[o]}return!n&&r&&"wheel"===e&&(n=document.implementation.hasFeature("Events.wheel","3.0")),n}var r,i=o(49);i.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),e.exports=n},function(e,t){"use strict";var o=!("undefined"==typeof window||!window.document||!window.document.createElement),n={canUseDOM:o,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:o&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:o&&!!window.screen,isInWorker:!o};e.exports=n},function(e,t,o){(function(t){"use strict";var n=o(45),r=o(51),i=0,s=r||function(e){var o=Date.now(),n=Math.max(0,16-(o-i));return i=o+n,t.setTimeout(function(){e(Date.now())},n)};s(n),e.exports=s}).call(t,function(){return this}())},function(e,t){(function(t){"use strict";var o=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame;e.exports=o}).call(t,function(){return this}())},function(e,t,o){"use strict";var n=o(53),r=o(56),i=o(27),s=o(34),a=o(37),l=o(57),u=o(43),c=o(44),h=o(59),f=o(60),p=o(45),d=o(61),m={position:0,scrollable:!1},v=parseInt(h("scrollbar-face-margin"),10),_=2*v,g=30,y=40,w=null,b=a({displayName:"Scrollbar",mixins:[u],propTypes:{contentSize:i.number.isRequired,defaultPosition:i.number,isOpaque:i.bool,orientation:i.oneOf(["vertical","horizontal"]),onScroll:i.func,position:i.number,size:i.number.isRequired,trackColor:i.oneOf(["gray"]),zIndex:i.number,verticalTop:i.number},getInitialState:function(){var e=this.props;return this._calculateState(e.position||e.defaultPosition||0,e.size,e.contentSize,e.orientation)},componentWillReceiveProps:function(e){var t=e.position;void 0===t?this._setNextState(this._calculateState(this.state.position,e.size,e.contentSize,e.orientation)):this._setNextState(this._calculateState(t,e.size,e.contentSize,e.orientation),e)},getDefaultProps:function(){return{defaultPosition:0,isOpaque:!1,onScroll:p,orientation:"vertical",zIndex:99}},render:function(){if(!this.state.scrollable)return null;var e,t,o=this.props.size,n=this.state.isHorizontal,r=!n,i=this.state.focused||this.state.isDragging,a=this.state.faceSize,l=this.props.isOpaque,u=this.props.verticalTop||0,c=f({"ScrollbarLayout/main":!0,"ScrollbarLayout/mainVertical":r,"ScrollbarLayout/mainHorizontal":n,"public/Scrollbar/main":!0,"public/Scrollbar/mainOpaque":l,"public/Scrollbar/mainActive":i}),p=f({"ScrollbarLayout/face":!0,"ScrollbarLayout/faceHorizontal":n,"ScrollbarLayout/faceVertical":r,"public/Scrollbar/faceActive":i,"public/Scrollbar/face":!0}),m=this.state.position*this.state.scale+v;return n?(e={width:o},t={width:a-_},d(t,m,0)):(e={top:u,height:o},t={height:a-_},d(t,0,m)),e.zIndex=this.props.zIndex,"gray"===this.props.trackColor&&(e.backgroundColor=h("fbui-desktop-background-light")),s.createElement("div",{onFocus:this._onFocus,onBlur:this._onBlur,onKeyDown:this._onKeyDown,onMouseDown:this._onMouseDown,onWheel:this._wheelHandler.onWheel,className:c,style:e,tabIndex:0},s.createElement("div",{ref:"face",className:p,style:t}))},componentWillMount:function(){var e="horizontal"===this.props.orientation,t=e?this._onWheelX:this._onWheelY;this._wheelHandler=new c(t,this._shouldHandleX,this._shouldHandleY)},componentDidMount:function(){this._mouseMoveTracker=new n(this._onMouseMove,this._onMouseMoveEnd,document.documentElement),void 0!==this.props.position&&this.state.position!==this.props.position&&this._didScroll(),this._isMounted=!0},componentWillUnmount:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),w===this&&(w=null),delete this._mouseMoveTracker,this._isMounted=!1},scrollBy:function(e){this._onWheel(e)},_shouldHandleX:function(e){return"horizontal"===this.props.orientation&&this._shouldHandleChange(e)},_shouldHandleY:function(e){return"horizontal"!==this.props.orientation&&this._shouldHandleChange(e)},_shouldHandleChange:function(e){var t=this._calculateState(this.state.position+e,this.props.size,this.props.contentSize,this.props.orientation);return t.position!==this.state.position},_calculateState:function(e,t,o,n){if(t<1||o<=t)return m;var r=e+"_"+t+"_"+o+"_"+n;if(this._stateKey===r)return this._stateForKey;var i="horizontal"===n,s=t/o,a=t*s;au&&(e=u);var c=!!this._mouseMoveTracker&&this._mouseMoveTracker.isDragging(),h={faceSize:a,isDragging:c,isHorizontal:i,position:e,scale:s,scrollable:l};return this._stateKey=r,this._stateForKey=h,h},_onWheelY:function(e,t){this._onWheel(t)},_onWheelX:function(e,t){this._onWheel(e)},_onWheel:function(e){var t=this.props;this._setNextState(this._calculateState(this.state.position+e,t.size,t.contentSize,t.orientation))},_onMouseDown:function(e){var t;if(e.target!==l.findDOMNode(this.refs.face)){var o=e.nativeEvent,n=this.state.isHorizontal?o.offsetX||o.layerX:o.offsetY||o.layerY,r=this.props;n/=this.state.scale,t=this._calculateState(n-.5*this.state.faceSize/this.state.scale,r.size,r.contentSize,r.orientation)}else t={};t.focused=!0,this._setNextState(t),this._mouseMoveTracker.captureMouseMoves(e),l.findDOMNode(this).focus()},_onMouseMove:function(e,t){var o=this.props,n=this.state.isHorizontal?e:t;n/=this.state.scale,this._setNextState(this._calculateState(this.state.position+n,o.size,o.contentSize,o.orientation))},_onMouseMoveEnd:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),this.setState({isDragging:!1})},_onKeyDown:function(e){var t=e.keyCode;if(t!==r.TAB){var o=y,n=0;if(this.state.isHorizontal)switch(t){case r.HOME:n=-1,o=this.props.contentSize;break;case r.LEFT:n=-1;break;case r.RIGHT:n=1;break;default:return}if(!this.state.isHorizontal)switch(t){case r.SPACE:n=e.shiftKey?-1:1;break;case r.HOME:n=-1,o=this.props.contentSize;break;case r.UP:n=-1;break;case r.DOWN:n=1;break;case r.PAGE_UP:n=-1,o=this.props.size;break;case r.PAGE_DOWN:n=1,o=this.props.size;break;default:return}e.preventDefault();var i=this.props;this._setNextState(this._calculateState(this.state.position+o*n,i.size,i.contentSize,i.orientation))}},_onFocus:function(){this.setState({focused:!0})},_onBlur:function(){this.setState({focused:!1})},_blur:function(){if(this._isMounted)try{this._onBlur(),l.findDOMNode(this).blur()}catch(e){}},_setNextState:function(e,t){t=t||this.props;var o=t.position,n=this.state.position!==e.position;if(void 0===o){var r=n?this._didScroll:void 0;this.setState(e,r)}else{if(o!==e.position)return void(void 0!==e.position&&e.position!==this.state.position&&this.props.onScroll(e.position));this.setState(e)}n&&w!==this&&(w&&w._blur(),w=this)},_didScroll:function(){this.props.onScroll(this.state.position)}});b.KEYBOARD_SCROLL_AMOUNT=y,b.SIZE=parseInt(h("scrollbar-size"),10),e.exports=b},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var o=0;o0;)this._addRowToBuffer(t,this._viewportRowsBegin,this._viewportRowsEnd-1),t++,e--;return this._rows}},{key:"getRows",value:function(e,t){var o=t,n=o,r=e,i=Math.min(e+this._maxVisibleRowCount,this._rowsCount);for(this._viewportRowsBegin=e;r=i&&(n=this._bufferSet.replaceFurthestValuePosition(t,o,e)),null===n?(n=this._bufferSet.getNewPositionForValue(e),this._rows[n]=e):this._rows[n]=e}}]),e}();e.exports=c},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var o=0;o=e&&r<=t)return null;var i;e-n>r-t?(i=n,this._smallValues.pop()):(i=r,this._largeValues.pop());var a=this._valueToPositionMap[i];return delete this._valueToPositionMap[i],this._valueToPositionMap[o]=a,this._pushToHeaps(a,o),a}},{key:"_pushToHeaps",value:function(e,t){var o={position:e,value:t};this._smallValues.push(o),this._largeValues.push(o)}},{key:"_cleanHeaps",value:function(){this._cleanHeap(this._smallValues),this._cleanHeap(this._largeValues);var e=Math.min(this._smallValues.size(),this._largeValues.size()),t=Math.max(this._smallValues.size(),this._largeValues.size());t>10*e&&this._recreateHeaps()}},{key:"_recreateHeaps",value:function(){for(var e=this._smallValues.size()t.value}}]),e}();e.exports=a},function(e,t){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){return e0&&(this._items[0]=t,this._sinkDown(0)),e}}},{key:"push",value:function(e){this._items[this._size++]=e,this._bubbleUp(this._size-1)}},{key:"size",value:function(){return this._size}},{key:"peek",value:function(){if(0!==this._size)return this._items[0]}},{key:"_heapify",value:function(){for(var e=Math.floor((this._size+1)/2);e>=0;e--)this._sinkDown(e)}},{key:"_bubbleUp",value:function(e){for(var t=this._items[e];e>0;){var o=Math.floor((e+1)/2)-1,n=this._items[o];if(this._comparator(n,t))return;this._items[o]=t,this._items[e]=n,e=o}}},{key:"_sinkDown",value:function(e){for(var t=this._items[e];;){var o=2*(e+1)-1,n=2*(e+1),r=-1;if(oo?o:e}e.exports=o},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=Object.assign||function(e){for(var t=1;t0){var o=h({"fixedDataTableRowLayout/fixedColumnsDivider":!0,"fixedDataTableRowLayout/columnsShadow":e.props.scrollLeft>0,"public/fixedDataTableRow/fixedColumnsDivider":!0,"public/fixedDataTableRow/columnsShadow":e.props.scrollLeft>0}),n={left:t,height:e.props.height};return u.createElement("div",{className:o,style:n})}},this._onClick=function(t){e.props.onClick(t,e.props.index)},this._onDoubleClick=function(t){e.props.onDoubleClick(t,e.props.index)},this._onMouseDown=function(t){e.props.onMouseDown(t,e.props.index)},this._onMouseEnter=function(t){e.props.onMouseEnter(t,e.props.index)},this._onMouseLeave=function(t){e.props.onMouseLeave(t,e.props.index)}}return r(t,e),s(t,[{key:"render",value:function(){var e={width:this.props.width,height:this.props.height},t=h({"fixedDataTableRowLayout/main":!0,"public/fixedDataTableRow/main":!0,"public/fixedDataTableRow/highlighted":this.props.index%2===1,"public/fixedDataTableRow/odd":this.props.index%2===1,"public/fixedDataTableRow/even":this.props.index%2===0}),o=this._getColumnsWidth(this.props.fixedColumns),n=u.createElement(c,{key:"fixed_cells",isScrolling:this.props.isScrolling,height:this.props.height,left:0,width:o,zIndex:2,columns:this.props.fixedColumns,onColumnResize:this.props.onColumnResize,rowHeight:this.props.height,rowIndex:this.props.index}),r=this._renderColumnsShadow(o),i=u.createElement(c,{key:"scrollable_cells",isScrolling:this.props.isScrolling,height:this.props.height,left:this.props.scrollLeft,offsetLeft:o,width:this.props.width-o,zIndex:0,columns:this.props.scrollableColumns,onColumnResize:this.props.onColumnResize,rowHeight:this.props.height,rowIndex:this.props.index});return u.createElement("div",{className:f(t,this.props.className),onClick:this.props.onClick?this._onClick:null,onDoubleClick:this.props.onDoubleClick?this._onDoubleClick:null,onMouseDown:this.props.onMouseDown?this._onMouseDown:null,onMouseEnter:this.props.onMouseEnter?this._onMouseEnter:null,onMouseLeave:this.props.onMouseLeave?this._onMouseLeave:null,style:e},u.createElement("div",{className:h("fixedDataTableRowLayout/body")},n,i,r))}}],[{key:"propTypes",value:{isScrolling:l.bool,fixedColumns:l.array.isRequired,height:l.number.isRequired,index:l.number.isRequired,scrollableColumns:l.array.isRequired,scrollLeft:l.number.isRequired,width:l.number.isRequired,onClick:l.func,onDoubleClick:l.func,onColumnResize:l.func},enumerable:!0}]),t}(u.Component),m=function(e){function t(){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return r(t,e),s(t,[{key:"render",value:function(){var e={width:this.props.width,height:this.props.height,zIndex:this.props.zIndex?this.props.zIndex:0};return p(e,0,this.props.offsetTop),u.createElement("div",{style:e,className:h("fixedDataTableRowLayout/rowWrapper")},u.createElement(d,i({},this.props,{offsetTop:void 0,zIndex:void 0})))}}],[{key:"propTypes",value:{isScrolling:l.bool,height:l.number.isRequired,zIndex:l.number,offsetTop:l.number.isRequired,width:l.number.isRequired},enumerable:!0}]),t}(u.Component);e.exports=m},function(e,t,o){"use strict";function n(e,t){var o={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}var r=Object.assign||function(e){for(var t=1;t=0){var l="cell_"+r;o[r]=this._renderCell(e.rowIndex,e.rowHeight,s,n,l)}n+=s.width}var u=this._getColumnsWidth(t),p={height:e.height,position:"absolute",width:u,zIndex:e.zIndex};return h(p,-1*f*e.left,0),a.createElement("div",{className:c("fixedDataTableCellGroupLayout/cellGroup"),style:p},o)},_renderCell:function(e,t,o,n,r){var i=o.isResizable&&this.props.onColumnResize,s=i?this.props.onColumnResize:null,l=o.cellClassName;return a.createElement(u,{isScrolling:this.props.isScrolling,align:o.align,className:l,height:t,key:r,maxWidth:o.maxWidth,minWidth:o.minWidth,onColumnResize:s,rowIndex:e,columnKey:o.columnKey,width:o.width,left:n,cell:o.cell})},_getColumnsWidth:function(e){for(var t=0,o=0;o=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}var r=o(78),i=o(73),s=o(27),a=o(34),l=o(37),u=o(60),c=o(79),h=i.DIR_SIGN,f={align:"left",highlighted:!1},p=l({displayName:"FixedDataTableCell",propTypes_DISABLED_FOR_PERFORMANCE:{isScrolling:s.bool,align:s.oneOf(["left","center","right"]),className:s.string,highlighted:s.bool,width:s.number.isRequired,minWidth:s.number,maxWidth:s.number,height:s.number.isRequired,cell:s.oneOfType([s.string,s.element,s.func]),columnKey:s.oneOfType([s.string,s.number]),rowIndex:s.number.isRequired,onColumnResize:s.func,left:s.number},shouldComponentUpdate:function(e){return!e.isScrolling||this.props.rowIndex!==e.rowIndex},getDefaultProps:function(){return f},render:function(){var e=this.props,t=e.height,o=e.width,i=e.columnKey,s=n(e,["height","width","columnKey"]),l={height:t,width:o};1===h?l.left=s.left:l.right=s.left;var f,p=c(u({"fixedDataTableCellLayout/main":!0,"fixedDataTableCellLayout/lastChild":s.lastChild,"fixedDataTableCellLayout/alignRight":"right"===s.align,"fixedDataTableCellLayout/alignCenter":"center"===s.align,"public/fixedDataTableCell/alignRight":"right"===s.align,"public/fixedDataTableCell/highlighted":s.highlighted,"public/fixedDataTableCell/main":!0}),s.className);if(s.onColumnResize){var d={height:t};f=a.createElement("div",{className:u("fixedDataTableCellLayout/columnResizerContainer"),style:d,onMouseDown:this._onColumnResizerMouseDown},a.createElement("div",{className:c(u("fixedDataTableCellLayout/columnResizerKnob"),u("public/fixedDataTableCell/columnResizerKnob")),style:d}))}var m={columnKey:i,height:t,width:o};s.rowIndex>=0&&(m.rowIndex=s.rowIndex);var v;return v=a.isValidElement(s.cell)?a.cloneElement(s.cell,m):"function"==typeof s.cell?s.cell(m):a.createElement(r,m,s.cell),a.createElement("div",{className:p,style:l},f,v)},_onColumnResizerMouseDown:function(e){this.props.onColumnResize(this.props.left,this.props.width,this.props.minWidth,this.props.maxWidth,this.props.columnKey,e)}});e.exports=p},function(e,t,o){"use strict";function n(e,t){var o={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=Object.assign||function(e){for(var t=1;t1)for(var n=1;n=0&&t>=e-a;){var o=this._updateRowHeight(t);this._position+=o,t--}}},{key:"_updateRowHeight",value:function(e){if(e<0||e>=this._rowCount)return 0;var t=this._rowHeightGetter(e);if(t!==this._storedHeights[e]){var o=t-this._storedHeights[e];return this._rowOffsets.set(e,t),this._storedHeights[e]=t,this._contentHeight+=o,o}return 0}},{key:"getRowPosition",value:function(e){return this._updateRowHeight(e),this._rowOffsets.sumUntil(e)}},{key:"scrollBy",value:function(e){if(0===this._rowCount)return l;var t=this._rowOffsets.greatestLowerBound(this._position);t=s(t,0,Math.max(this._rowCount-1,0));var o=this._rowOffsets.sumUntil(t),n=t,r=this._position,i=this._updateRowHeight(n);0!==o&&(r+=i);var a=this._storedHeights[n]-(r-o);if(e>=0)for(;e>0&&n0&&n>=0;)if(e=0){var c=this._updateRowHeight(n);u=this._storedHeights[n],r+=c}}var h=this._contentHeight-this._viewportHeight;r=s(r,0,h),this._position=r;var f=this._rowOffsets.greatestLowerBound(r);f=s(f,0,Math.max(this._rowCount-1,0)),o=this._rowOffsets.sumUntil(f);var p=o-r;return this._updateHeightsInViewport(f,p),this._updateHeightsAboveViewport(f),{index:f,offset:p,position:this._position,contentHeight:this._contentHeight}}},{key:"_getRowAtEndPosition",value:function(e){this._updateRowHeight(e);for(var t=e,o=this._storedHeights[t];o=0;)t--,t>=0&&(this._updateRowHeight(t),o+=this._storedHeights[t]);var n=this._rowOffsets.sumTo(e)-this._viewportHeight;return n<0&&(n=0),n}},{key:"scrollTo",value:function(e){if(0===this._rowCount)return l;if(e<=0)return this._position=0,this._updateHeightsInViewport(0,0),{index:0,offset:0,position:this._position,contentHeight:this._contentHeight};if(e>=this._contentHeight-this._viewportHeight){var t=this._rowCount-1;e=this._getRowAtEndPosition(t)}this._position=e;var o=this._rowOffsets.greatestLowerBound(e);o=s(o,0,Math.max(this._rowCount-1,0));var n=this._rowOffsets.sumUntil(o),r=n-e;return this._updateHeightsInViewport(o,r),this._updateHeightsAboveViewport(o),{index:o,offset:r,position:this._position,contentHeight:this._contentHeight}}},{key:"scrollToRow",value:function(e,t){e=s(e,0,Math.max(this._rowCount-1,0)),t=s(t,-this._storedHeights[e],0);var o=this._rowOffsets.sumUntil(e);return this.scrollTo(o-t)}},{key:"scrollRowIntoView",value:function(e){e=s(e,0,Math.max(this._rowCount-1,0));var t=this._rowOffsets.sumUntil(e),o=t+this._storedHeights[e];if(t=0;--o)t[o]=0;return t},u=function(){function e(t){n(this,e),this._size=t.length,this._half=r(this._size),this._heap=new l(2*this._half);var o;for(o=0;o0;--o)this._heap[o]=this._heap[2*o]+this._heap[2*o+1]}return i(e,[{key:"set",value:function(e,t){s(0<=e&&e=0;--r)n[r]=o;return new e(n)}},{key:"empty",value:function(t){return e.uniform(t,0)}}]),e}();e.exports=u}).call(t,function(){return this}())},function(e,t,o){"use strict";function n(e){for(var t=0,o=0;o=t||o<0||T&&n>=_}function c(){var e=C();return u(e)?h(e):void(y=setTimeout(c,s(e)))}function h(e){return y=void 0,D&&m?n(e):(m=v=void 0,g)}function f(){void 0!==y&&clearTimeout(y),R=0,m=w=v=y=void 0}function p(){return void 0===y?g:h(C())}function d(){var e=C(),o=u(e);if(m=arguments,v=this,w=e,o){if(void 0===y)return i(w);if(T)return y=setTimeout(c,t),n(w)}return void 0===y&&(y=setTimeout(c,t)),g}var m,v,_,g,y,w,R=0,E=!1,T=!1,D=!0;if("function"!=typeof e)throw new TypeError(l);return t=a(t)||0,r(o)&&(E=!!o.leading,T="maxWait"in o,_=T?b(a(o.maxWait)||0,t):_,D="trailing"in o?!!o.trailing:D),d.cancel=f,d.flush=p,d}function n(e,t,n){var i=!0,s=!0;if("function"!=typeof e)throw new TypeError(l);return r(n)&&(i="leading"in n?!!n.leading:i,s="trailing"in n?!!n.trailing:s),o(e,t,{leading:i,maxWait:t,trailing:s})}function r(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function i(e){return!!e&&"object"==typeof e}function s(e){return"symbol"==typeof e||i(e)&&w.call(e)==c}function a(e){if("number"==typeof e)return e;if(s(e))return u;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(h,"");var o=p.test(e);return o||d.test(e)?m(e.slice(2),o?2:8):f.test(e)?u:+e}var l="Expected a function",u=NaN,c="[object Symbol]",h=/^\s+|\s+$/g,f=/^[-+]0x[0-9a-f]+$/i,p=/^0b[01]+$/i,d=/^0o[0-7]+$/i,m=parseInt,v="object"==typeof t&&t&&t.Object===Object&&t,_="object"==typeof self&&self&&self.Object===Object&&self,g=v||_||Function("return this")(),y=Object.prototype,w=y.toString,b=Math.max,x=Math.min,C=function(){return g.Date.now()};e.exports=n}).call(t,function(){return this}())},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=function(){function e(e,t){for(var o=0;o Date: Tue, 27 Nov 2018 13:44:48 -0800 Subject: [PATCH 24/43] Version 0.7.10 --- build_helpers/buildNPMInternals.sh | 31 +++++++++++++++-------------- dist/fixed-data-table-base.css | 2 +- dist/fixed-data-table-base.min.css | 2 +- dist/fixed-data-table-style.css | 2 +- dist/fixed-data-table-style.min.css | 2 +- dist/fixed-data-table.css | 2 +- dist/fixed-data-table.js | 2 +- dist/fixed-data-table.min.css | 2 +- dist/fixed-data-table.min.js | 2 +- package.json | 2 +- 10 files changed, 25 insertions(+), 24 deletions(-) diff --git a/build_helpers/buildNPMInternals.sh b/build_helpers/buildNPMInternals.sh index 8ad0e19f..4c198d96 100755 --- a/build_helpers/buildNPMInternals.sh +++ b/build_helpers/buildNPMInternals.sh @@ -2,47 +2,48 @@ // -*- mode: js -*- "use strict"; -var glob = require('glob'); -var path = require('path'); -var fs = require('fs'); -var babel = require('babel-core'); +var glob = require("glob"); +var path = require("path"); +var fs = require("fs"); +var babel = require("babel-core"); -var internalPath = path.join(__dirname, '../internal'); +var internalPath = path.join(__dirname, "../internal"); if (!fs.existsSync(internalPath)) { fs.mkdirSync(internalPath); } var providesModuleRegex = /@providesModule ([^\s*]+)/; var moduleRequireRegex = /=\s+require\((?:'|")([\w\.\/]+)(?:'|")\);/gm; -var excludePathRegex = /^react($|\/)/; +var excludePathRegex = /^react($|\/)|lodash/; var findDEVRegex = /__DEV__/g; function replaceRequirePath(match, modulePath) { var path = modulePath; if (!excludePathRegex.test(path)) { - path = './' + path; + path = "./" + path; } - return '= require(\'' + path + '\');'; + return "= require('" + path + "');"; } -var babelConf = JSON.parse( - fs.readFileSync('.babelrc', {encoding: 'utf8'}) -); +var babelConf = JSON.parse(fs.readFileSync(".babelrc", { encoding: "utf8" })); function processFile(fileName) { - var contents = fs.readFileSync(fileName, {encoding: 'utf8'}); + var contents = fs.readFileSync(fileName, { encoding: "utf8" }); var providesModule = providesModuleRegex.exec(contents); if (providesModule) { contents = babel.transform(contents, babelConf).code; contents = contents.replace(moduleRequireRegex, replaceRequirePath); - contents = contents.replace(findDEVRegex, 'process.env.NODE_ENV !== \'production\''); + contents = contents.replace( + findDEVRegex, + "process.env.NODE_ENV !== 'production'" + ); fs.writeFileSync( - path.join(internalPath, providesModule[1] + '.js'), + path.join(internalPath, providesModule[1] + ".js"), contents ); } } -glob.sync(path.join(__dirname, '../src/**/*.js')).forEach(processFile); +glob.sync(path.join(__dirname, "../src/**/*.js")).forEach(processFile); diff --git a/dist/fixed-data-table-base.css b/dist/fixed-data-table-base.css index b55b0be3..242061ed 100644 --- a/dist/fixed-data-table-base.css +++ b/dist/fixed-data-table-base.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.9 + * FixedDataTable v0.7.10 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table-base.min.css b/dist/fixed-data-table-base.min.css index 85217f32..b0d6732a 100644 --- a/dist/fixed-data-table-base.min.css +++ b/dist/fixed-data-table-base.min.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.9 + * FixedDataTable v0.7.10 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table-style.css b/dist/fixed-data-table-style.css index 8384218a..170a8c5a 100644 --- a/dist/fixed-data-table-style.css +++ b/dist/fixed-data-table-style.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.9 + * FixedDataTable v0.7.10 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table-style.min.css b/dist/fixed-data-table-style.min.css index d244a8f4..05deec19 100644 --- a/dist/fixed-data-table-style.min.css +++ b/dist/fixed-data-table-style.min.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.9 + * FixedDataTable v0.7.10 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table.css b/dist/fixed-data-table.css index c91949fc..e38b906a 100644 --- a/dist/fixed-data-table.css +++ b/dist/fixed-data-table.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.9 + * FixedDataTable v0.7.10 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table.js b/dist/fixed-data-table.js index 5843d175..2895974e 100644 --- a/dist/fixed-data-table.js +++ b/dist/fixed-data-table.js @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.9 + * FixedDataTable v0.7.10 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table.min.css b/dist/fixed-data-table.min.css index 8fc6712c..e4f4503b 100644 --- a/dist/fixed-data-table.min.css +++ b/dist/fixed-data-table.min.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.9 + * FixedDataTable v0.7.10 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table.min.js b/dist/fixed-data-table.min.js index 7d7f4c74..283f13c1 100644 --- a/dist/fixed-data-table.min.js +++ b/dist/fixed-data-table.min.js @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.9 + * FixedDataTable v0.7.10 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/package.json b/package.json index 4d196c97..8921ea2b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@buildingconnected/fixed-data-table", - "version": "0.7.9", + "version": "0.7.10", "description": "A React table component designed to allow presenting thousands of rows of data.", "main": "main.js", "peerDependencies": { From 65262353a491b40359ad9271ebe3e145e6d5ce46 Mon Sep 17 00:00:00 2001 From: Cary Li Date: Tue, 15 Jan 2019 16:45:28 -0800 Subject: [PATCH 25/43] [BLT-1033] Fix columnKey warning FixedDataTableCell clones a React element and passes some props to the clone. When a React element is a React DOM element, React will interpret passed props as HTML attributes and attempt to apply them if they are valid HTML attributes. In our case, FixedDataTableCell clones props.cell and passes the columnKey prop, but if props.cell is a 'div', React will apply columnKey as a HTML attribute and because it isn't a valid HTML attribute, it will give a warning. This commit fixes that by deleting the columnKey prop if props.cell is a 'div'. --- src/FixedDataTableCell.react.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/FixedDataTableCell.react.js b/src/FixedDataTableCell.react.js index bed8e2bb..228bc95b 100644 --- a/src/FixedDataTableCell.react.js +++ b/src/FixedDataTableCell.react.js @@ -151,6 +151,10 @@ var FixedDataTableCell = createReactClass({ var content; if (React.isValidElement(props.cell)) { + if (props.cell.type === 'div') { + delete cellProps.columnKey; + } + content = React.cloneElement(props.cell, cellProps); } else if (typeof props.cell === 'function') { content = props.cell(cellProps); From 9c3d4cfce5b15c0dbde9354709002dc5dec48ba7 Mon Sep 17 00:00:00 2001 From: Cary Li Date: Wed, 16 Jan 2019 16:11:24 -0800 Subject: [PATCH 26/43] Update package.json version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d1550b72..a0d43115 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@buildingconnected/fixed-data-table", - "version": "0.7.8", + "version": "0.7.9", "description": "A React table component designed to allow presenting thousands of rows of data.", "main": "main.js", "peerDependencies": { From a80f463db658fe7c847f98c0d562794ac1757c44 Mon Sep 17 00:00:00 2001 From: Cary Li Date: Wed, 16 Jan 2019 16:24:35 -0800 Subject: [PATCH 27/43] Bump version from 0.7.9 -> 0.7.11 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a0d43115..3e0343cf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@buildingconnected/fixed-data-table", - "version": "0.7.9", + "version": "0.7.11", "description": "A React table component designed to allow presenting thousands of rows of data.", "main": "main.js", "peerDependencies": { From f080e4a222b4fdae4b38f929d797635ccde0691a Mon Sep 17 00:00:00 2001 From: Cary Li Date: Wed, 16 Jan 2019 16:57:34 -0800 Subject: [PATCH 28/43] Bump version from 0.7.11 -> 0.7.12 to properly publish with npm publish-package instead of npm publish --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3e0343cf..c84f3686 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@buildingconnected/fixed-data-table", - "version": "0.7.11", + "version": "0.7.12", "description": "A React table component designed to allow presenting thousands of rows of data.", "main": "main.js", "peerDependencies": { From 83b04f169c7d34fbe814f40736216862b9ebf780 Mon Sep 17 00:00:00 2001 From: Cary Li Date: Wed, 16 Jan 2019 17:03:47 -0800 Subject: [PATCH 29/43] Version 0.7.12 --- dist/fixed-data-table-base.css | 2 +- dist/fixed-data-table-base.min.css | 2 +- dist/fixed-data-table-style.css | 2 +- dist/fixed-data-table-style.min.css | 2 +- dist/fixed-data-table.css | 2 +- dist/fixed-data-table.js | 6 +++++- dist/fixed-data-table.min.css | 2 +- dist/fixed-data-table.min.js | 6 +++--- 8 files changed, 14 insertions(+), 10 deletions(-) diff --git a/dist/fixed-data-table-base.css b/dist/fixed-data-table-base.css index 9b261d1b..b09236b3 100644 --- a/dist/fixed-data-table-base.css +++ b/dist/fixed-data-table-base.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.8 + * FixedDataTable v0.7.12 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table-base.min.css b/dist/fixed-data-table-base.min.css index 5083f7ef..8c384950 100644 --- a/dist/fixed-data-table-base.min.css +++ b/dist/fixed-data-table-base.min.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.8 + * FixedDataTable v0.7.12 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table-style.css b/dist/fixed-data-table-style.css index 599b41f9..ea45a99e 100644 --- a/dist/fixed-data-table-style.css +++ b/dist/fixed-data-table-style.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.8 + * FixedDataTable v0.7.12 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table-style.min.css b/dist/fixed-data-table-style.min.css index 0a49acee..1fcaeac9 100644 --- a/dist/fixed-data-table-style.min.css +++ b/dist/fixed-data-table-style.min.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.8 + * FixedDataTable v0.7.12 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table.css b/dist/fixed-data-table.css index 25c0eb9b..92ba9431 100644 --- a/dist/fixed-data-table.css +++ b/dist/fixed-data-table.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.8 + * FixedDataTable v0.7.12 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table.js b/dist/fixed-data-table.js index 855ee860..6c2c20fb 100644 --- a/dist/fixed-data-table.js +++ b/dist/fixed-data-table.js @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.8 + * FixedDataTable v0.7.12 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -7627,6 +7627,10 @@ return /******/ (function(modules) { // webpackBootstrap var content; if (React.isValidElement(props.cell)) { + if (props.cell.type === 'div') { + delete cellProps.columnKey; + } + content = React.cloneElement(props.cell, cellProps); } else if (typeof props.cell === 'function') { content = props.cell(cellProps); diff --git a/dist/fixed-data-table.min.css b/dist/fixed-data-table.min.css index 754ff713..1821865f 100644 --- a/dist/fixed-data-table.min.css +++ b/dist/fixed-data-table.min.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.8 + * FixedDataTable v0.7.12 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table.min.js b/dist/fixed-data-table.min.js index eb565dbd..18197da4 100644 --- a/dist/fixed-data-table.min.js +++ b/dist/fixed-data-table.min.js @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.8 + * FixedDataTable v0.7.12 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -11,5 +11,5 @@ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.FixedDataTable=t(require("react"),require("react-dom")):e.FixedDataTable=t(e.React,e.ReactDOM)}(this,function(e,t){return function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){o(1),o(5),o(7),o(9),o(11),o(13),o(15),o(17),o(19),o(21),o(23),e.exports=o(25)},function(e,t){},,,,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t,o){"use strict";var n=o(26),r=o(78),i=o(76),s=o(75),a={Cell:r,Column:i,ColumnGroup:s,Table:n};a.version="0.7.0",e.exports=a},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e,t){}var s=Object.assign||function(e){for(var t=1;t1)for(var o=1;o0||e>=0&&this.state.scrollX0||e>=0&&this.state.scrollYn?n:this.state.height>n&&this.props.ownerHeight?Math.max(n,this.props.ownerHeight):this.state.height+this.state.maxScrollY,e!==this._contentHeight&&this.props.onContentHeightChange&&this.props.onContentHeightChange(e),this._contentHeight=e},componentDidMount:function(){this._reportContentHeight(),this._isMounted=!0},componentWillReceiveProps:function(e){var t=e.scrollToRow;void 0!==t&&null!==t&&(this._rowToScrollTo=t);var o=e.scrollToColumn;void 0!==o&&null!==o&&(this._columnToScrollTo=o);var n=e.overflowX,r=e.overflowY;n===this.props.overflowX&&r===this.props.overflowY||(this._wheelHandler=new l(this._onWheel,"hidden"!==n,"hidden"!==r)),this.props.ownerHeight===e.ownerHeight&&this.props.scrollTop===e.scrollTop||this._didScrollStart(),this._didScrollStop(),this.setState(this._calculateState(e,this.state))},componentDidUpdate:function(){this._reportContentHeight()},render:function(){var e,t=this.state,o=this.props;t.useGroupHeader&&(e=i.createElement(f,{key:"group_header",isScrolling:this._isScrolling,className:y(m("fixedDataTableLayout/header"),m("public/fixedDataTable/header")),width:t.width,height:t.groupHeaderHeight,index:0,zIndex:1,offsetTop:0,scrollLeft:t.scrollX,fixedColumns:t.groupHeaderFixedColumns,scrollableColumns:t.groupHeaderScrollableColumns,onColumnResize:this._onColumnResize}));var r=this.state.maxScrollY,s=t.maxScrollX>0&&"hidden"!==t.overflowX,a=r>0&&"hidden"!==t.overflowY,l=s?u.SIZE:0,c=t.height-l-2*R-t.footerHeight,p=t.useGroupHeader?t.groupHeaderHeight:0,d=p+t.headerHeight;c-=d;var v=0,_=null!=o.maxHeight?d+t.bodyHeight:d+c,g=_+t.footerHeight;void 0!==o.ownerHeight&&o.ownerHeightt.ownerHeight||t.scrollY or "),o.push(e))});var r=!1;o.length&&o[0].type.__TableColumnGroup__&&(r=!0),t&&(void 0!==e.width&&e.width!==t.width||void 0!==e.height&&e.height!==t.height||void 0!==e.maxWidth&&e.maxWidth!==t.maxWidth||void 0!==e.maxHeight&&e.maxHeight!==t.maxHeight)&&(t=null);var i,s,a=t&&t.firstRowIndex||0,l=t&&t.firstRowOffset||0;i=t&&"hidden"!==e.overflowX?t.scrollX:e.scrollLeft,t&&"hidden"!==e.overflowY?s=t.scrollY:(f=this._scrollHelper.scrollTo(e.scrollTop),a=f.index,l=f.offset,s=f.position),void 0!==this._rowToScrollTo&&(f=this._scrollHelper.scrollRowIntoView(this._rowToScrollTo),a=f.index,l=f.offset,s=f.position,delete this._rowToScrollTo);var c=r?e.groupHeaderHeight:0;if(t&&e.rowsCount!==t.rowsCount){var h=(void 0===e.height?e.maxHeight:e.height)-(e.headerHeight||0)-(e.footerHeight||0)-(e.groupHeaderHeight||0);this._scrollHelper=new p(e.rowsCount,e.rowHeight,h,e.rowHeightGetter);var f=this._scrollHelper.scrollToRow(a,l);a=f.index,l=f.offset,s=f.position}else t&&e.rowHeightGetter!==t.rowHeightGetter&&this._scrollHelper.setRowHeightGetter(e.rowHeightGetter);var m;m=e.isColumnResizing?t&&t.columnResizingData:C;var v,_;if(r){var y=d.adjustColumnGroupWidths(o,e.width);v=y.columns,_=y.columnGroups}else v=d.adjustColumnWidths(o,e.width);var w=this._populateColumnsAndColumnData(v,_,t);if(void 0!==this._columnToScrollTo){var b=w.bodyFixedColumns.length;if(this._columnToScrollTo>=b){var E,D,T=0;for(E=0;EO&&(i=O)}delete this._columnToScrollTo}var k=void 0===e.height,P=Math.round(k?e.maxHeight:e.height),I=e.footerHeight+e.headerHeight+c+2*R,z=P-I,j=this._scrollHelper.getContentHeight(),A=j+I,F=d.getTotalWidth(v),L=F>e.width&&"hidden"!==e.overflowX;L&&(z-=u.SIZE,A+=u.SIZE,I+=u.SIZE);var G=Math.max(0,F-e.width),W=Math.max(0,j-z);i=Math.min(i,G),s=Math.min(s,W),W||(k&&(P=A),z=A-I),this._scrollHelper.setViewportHeight(z);var V=n({isColumnResizing:t&&t.isColumnResizing},w,e,{columns:v,columnGroups:_,columnResizingData:m,firstRowIndex:a,firstRowOffset:l,horizontalScrollbarVisible:L,maxScrollX:G,maxScrollY:W,reservedHeight:I,scrollContentHeight:j,scrollX:i,scrollY:s,bodyHeight:z,height:P,groupHeaderHeight:c,useGroupHeader:r});return V},_selectColumnElement:function(e,t){for(var o=[],n=0;nMath.abs(e)&&"hidden"!==this.props.overflowY){var n=this._scrollHelper.scrollBy(Math.round(t)),r=Math.max(0,n.contentHeight-this.state.bodyHeight);this.setState({firstRowIndex:n.index,firstRowOffset:n.offset,scrollY:n.position,scrollContentHeight:n.contentHeight,maxScrollY:r})}else e&&"hidden"!==this.props.overflowX&&(o+=e,o=o<0?0:o,o=o>this.state.maxScrollX?this.state.maxScrollX:o,this.setState({scrollX:o}));this._didScrollStop()}},_onHorizontalScroll:function(e){this._isMounted&&e!==this.state.scrollX&&(this._isScrolling||this._didScrollStart(),this.setState({scrollX:e}),this._didScrollStop())},_onVerticalScroll:function(e){if(this._isMounted&&e!==this.state.scrollY){this._isScrolling||this._didScrollStart();var t=this._scrollHelper.scrollTo(Math.round(e));this.setState({firstRowIndex:t.index,firstRowOffset:t.offset,scrollY:t.position,scrollContentHeight:t.contentHeight}),this._didScrollStop()}},_didScrollStart:function(){this._isMounted&&!this._isScrolling&&(this._isScrolling=!0,this.props.onScrollStart&&this.props.onScrollStart(this.state.scrollX,this.state.scrollY))},_didScrollStop:function(){this._isMounted&&this._isScrolling&&(this._isScrolling=!1,this.setState({redraw:!0}),this.props.onScrollEnd&&this.props.onScrollEnd(this.state.scrollX,this.state.scrollY))}}),O=s({displayName:"HorizontalScrollbar",mixins:[a],propTypes:{contentSize:r.number.isRequired,offset:r.number.isRequired,onScroll:r.func.isRequired,position:r.number.isRequired,size:r.number.isRequired},render:function(){var e=n({height:u.SIZE,width:this.props.size},this.props.horizontalScrollbarStyle),t={height:u.SIZE,position:"absolute",overflow:"hidden",width:this.props.size};return b(t,0,this.props.offset),i.createElement("div",{className:y(m("fixedDataTableLayout/horizontalScrollbar"),m("public/fixedDataTable/horizontalScrollbar")),style:e},i.createElement("div",{style:t},i.createElement(u,n({},this.props,{isOpaque:!0,orientation:"horizontal",offset:void 0}))))}});e.exports=S},function(e,t,o){"use strict";var n=o(35),r=o(38);if("undefined"==typeof n)throw Error("create-react-class could not find the React object. If you are using script tags, make sure that React is being loaded before create-react-class.");var i=(new n.Component).updater;e.exports=r(n.Component,n.isValidElement,i)},function(e,t,o){(function(t){"use strict";function n(e){return e}function r(e,o,r){function h(e,o,n){for(var r in o)o.hasOwnProperty(r)&&"production"!==t.env.NODE_ENV&&l("function"==typeof o[r],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",e.displayName||"ReactClass",u[n],r)}function f(e,t){var o=x.hasOwnProperty(t)?x[t]:null;T.hasOwnProperty(t)&&a("OVERRIDE_BASE"===o,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t), e&&a("DEFINE_MANY"===o||"DEFINE_MANY_MERGED"===o,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function p(e,n){if(n){a("function"!=typeof n,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),a(!o(n),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=e.prototype,i=r.__reactAutoBindPairs;n.hasOwnProperty(c)&&R.mixins(e,n.mixins);for(var s in n)if(n.hasOwnProperty(s)&&s!==c){var u=n[s],h=r.hasOwnProperty(s);if(f(h,s),R.hasOwnProperty(s))R[s](e,u);else{var p=x.hasOwnProperty(s),d="function"==typeof u,m=d&&!p&&!h&&n.autobind!==!1;if(m)i.push(s,u),r[s]=u;else if(h){var g=x[s];a(p&&("DEFINE_MANY_MERGED"===g||"DEFINE_MANY"===g),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",g,s),"DEFINE_MANY_MERGED"===g?r[s]=v(r[s],u):"DEFINE_MANY"===g&&(r[s]=_(r[s],u))}else r[s]=u,"production"!==t.env.NODE_ENV&&"function"==typeof u&&n.displayName&&(r[s].displayName=n.displayName+"_"+s)}}}else if("production"!==t.env.NODE_ENV){var y=typeof n,w="object"===y&&null!==n;"production"!==t.env.NODE_ENV&&l(w,"%s: You're attempting to include a mixin that is either null or not an object. Check the mixins included by the component, as well as any mixins they include themselves. Expected object but got %s.",e.displayName||"ReactClass",null===n?null:y)}}function d(e,t){if(t)for(var o in t){var n=t[o];if(t.hasOwnProperty(o)){var r=o in R;a(!r,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',o);var i=o in e;if(i){var s=C.hasOwnProperty(o)?C[o]:null;return a("DEFINE_MANY_MERGED"===s,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",o),void(e[o]=v(e[o],n))}e[o]=n}}}function m(e,t){a(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var o in t)t.hasOwnProperty(o)&&(a(void 0===e[o],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",o),e[o]=t[o]);return e}function v(e,t){return function(){var o=e.apply(this,arguments),n=t.apply(this,arguments);if(null==o)return n;if(null==n)return o;var r={};return m(r,o),m(r,n),r}}function _(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function g(e,o){var n=o.bind(e);if("production"!==t.env.NODE_ENV){n.__reactBoundContext=e,n.__reactBoundMethod=o,n.__reactBoundArguments=null;var r=e.constructor.displayName,i=n.bind;n.bind=function(s){for(var a=arguments.length,u=Array(a>1?a-1:0),c=1;c1?t-1:0),n=1;n2?o-2:0),r=2;rn},ie64:function(){return y.ie()&&p},firefox:function(){return o()||r},opera:function(){return o()||i},webkit:function(){return o()||s},safari:function(){return y.webkit()},chrome:function(){return o()||a},windows:function(){return o()||c},osx:function(){return o()||u},linux:function(){return o()||h},iphone:function(){return o()||d},mobile:function(){return o()||d||m||f||_},nativeApp:function(){return o()||v},android:function(){return o()||f},ipad:function(){return o()||m}};e.exports=y},function(e,t,o){"use strict";function n(e,t){if(!i.canUseDOM||t&&!("addEventListener"in document))return!1;var o="on"+e,n=o in document;if(!n){var s=document.createElement("div");s.setAttribute(o,"return;"),n="function"==typeof s[o]}return!n&&r&&"wheel"===e&&(n=document.implementation.hasFeature("Events.wheel","3.0")),n}var r,i=o(49);i.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),e.exports=n},function(e,t){"use strict";var o=!("undefined"==typeof window||!window.document||!window.document.createElement),n={canUseDOM:o,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:o&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:o&&!!window.screen,isInWorker:!o};e.exports=n},function(e,t,o){(function(t){"use strict";var n=o(45),r=o(51),i=0,s=r||function(e){var o=Date.now(),n=Math.max(0,16-(o-i));return i=o+n,t.setTimeout(function(){e(Date.now())},n)};s(n),e.exports=s}).call(t,function(){return this}())},function(e,t){(function(t){"use strict";var o=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame;e.exports=o}).call(t,function(){return this}())},function(e,t,o){"use strict";var n=o(53),r=o(56),i=o(27),s=o(34),a=o(37),l=o(57),u=o(43),c=o(44),h=o(59),f=o(60),p=o(45),d=o(61),m={position:0,scrollable:!1},v=parseInt(h("scrollbar-face-margin"),10),_=2*v,g=30,y=40,w=null,b=a({displayName:"Scrollbar",mixins:[u],propTypes:{contentSize:i.number.isRequired,defaultPosition:i.number,isOpaque:i.bool,orientation:i.oneOf(["vertical","horizontal"]),onScroll:i.func,position:i.number,size:i.number.isRequired,trackColor:i.oneOf(["gray"]),zIndex:i.number,verticalTop:i.number},getInitialState:function(){var e=this.props;return this._calculateState(e.position||e.defaultPosition||0,e.size,e.contentSize,e.orientation)},componentWillReceiveProps:function(e){var t=e.position;void 0===t?this._setNextState(this._calculateState(this.state.position,e.size,e.contentSize,e.orientation)):this._setNextState(this._calculateState(t,e.size,e.contentSize,e.orientation),e)},getDefaultProps:function(){return{defaultPosition:0,isOpaque:!1,onScroll:p,orientation:"vertical",zIndex:99}},render:function(){if(!this.state.scrollable)return null;var e,t,o=this.props.size,n=this.state.isHorizontal,r=!n,i=this.state.focused||this.state.isDragging,a=this.state.faceSize,l=this.props.isOpaque,u=this.props.verticalTop||0,c=f({"ScrollbarLayout/main":!0,"ScrollbarLayout/mainVertical":r,"ScrollbarLayout/mainHorizontal":n,"public/Scrollbar/main":!0,"public/Scrollbar/mainOpaque":l,"public/Scrollbar/mainActive":i}),p=f({"ScrollbarLayout/face":!0,"ScrollbarLayout/faceHorizontal":n,"ScrollbarLayout/faceVertical":r,"public/Scrollbar/faceActive":i,"public/Scrollbar/face":!0}),m=this.state.position*this.state.scale+v;return n?(e={width:o},t={width:a-_},d(t,m,0)):(e={top:u,height:o},t={height:a-_},d(t,0,m)),e.zIndex=this.props.zIndex,"gray"===this.props.trackColor&&(e.backgroundColor=h("fbui-desktop-background-light")),s.createElement("div",{onFocus:this._onFocus,onBlur:this._onBlur,onKeyDown:this._onKeyDown,onMouseDown:this._onMouseDown,onWheel:this._wheelHandler.onWheel,className:c,style:e,tabIndex:0},s.createElement("div",{ref:"face",className:p,style:t}))},componentWillMount:function(){var e="horizontal"===this.props.orientation,t=e?this._onWheelX:this._onWheelY;this._wheelHandler=new c(t,this._shouldHandleX,this._shouldHandleY)},componentDidMount:function(){this._mouseMoveTracker=new n(this._onMouseMove,this._onMouseMoveEnd,document.documentElement),void 0!==this.props.position&&this.state.position!==this.props.position&&this._didScroll(),this._isMounted=!0},componentWillUnmount:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),w===this&&(w=null),delete this._mouseMoveTracker,this._isMounted=!1},scrollBy:function(e){this._onWheel(e)},_shouldHandleX:function(e){return"horizontal"===this.props.orientation&&this._shouldHandleChange(e)},_shouldHandleY:function(e){return"horizontal"!==this.props.orientation&&this._shouldHandleChange(e)},_shouldHandleChange:function(e){var t=this._calculateState(this.state.position+e,this.props.size,this.props.contentSize,this.props.orientation);return t.position!==this.state.position},_calculateState:function(e,t,o,n){if(t<1||o<=t)return m;var r=e+"_"+t+"_"+o+"_"+n;if(this._stateKey===r)return this._stateForKey;var i="horizontal"===n,s=t/o,a=t*s;au&&(e=u);var c=!!this._mouseMoveTracker&&this._mouseMoveTracker.isDragging(),h={faceSize:a,isDragging:c,isHorizontal:i,position:e,scale:s,scrollable:l};return this._stateKey=r,this._stateForKey=h,h},_onWheelY:function(e,t){this._onWheel(t)},_onWheelX:function(e,t){this._onWheel(e)},_onWheel:function(e){var t=this.props;this._setNextState(this._calculateState(this.state.position+e,t.size,t.contentSize,t.orientation))},_onMouseDown:function(e){var t;if(e.target!==l.findDOMNode(this.refs.face)){var o=e.nativeEvent,n=this.state.isHorizontal?o.offsetX||o.layerX:o.offsetY||o.layerY,r=this.props;n/=this.state.scale,t=this._calculateState(n-.5*this.state.faceSize/this.state.scale,r.size,r.contentSize,r.orientation)}else t={};t.focused=!0,this._setNextState(t),this._mouseMoveTracker.captureMouseMoves(e),l.findDOMNode(this).focus()},_onMouseMove:function(e,t){var o=this.props,n=this.state.isHorizontal?e:t;n/=this.state.scale,this._setNextState(this._calculateState(this.state.position+n,o.size,o.contentSize,o.orientation))},_onMouseMoveEnd:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),this.setState({isDragging:!1})},_onKeyDown:function(e){var t=e.keyCode;if(t!==r.TAB){var o=y,n=0;if(this.state.isHorizontal)switch(t){case r.HOME:n=-1,o=this.props.contentSize;break;case r.LEFT:n=-1;break;case r.RIGHT:n=1;break;default:return}if(!this.state.isHorizontal)switch(t){case r.SPACE:n=e.shiftKey?-1:1;break;case r.HOME:n=-1,o=this.props.contentSize;break;case r.UP:n=-1;break;case r.DOWN:n=1;break;case r.PAGE_UP:n=-1,o=this.props.size;break;case r.PAGE_DOWN:n=1,o=this.props.size;break;default:return}e.preventDefault();var i=this.props;this._setNextState(this._calculateState(this.state.position+o*n,i.size,i.contentSize,i.orientation))}},_onFocus:function(){this.setState({focused:!0})},_onBlur:function(){this.setState({focused:!1})},_blur:function(){if(this._isMounted)try{this._onBlur(),l.findDOMNode(this).blur()}catch(e){}},_setNextState:function(e,t){t=t||this.props;var o=t.position,n=this.state.position!==e.position;if(void 0===o){var r=n?this._didScroll:void 0;this.setState(e,r)}else{if(o!==e.position)return void(void 0!==e.position&&e.position!==this.state.position&&this.props.onScroll(e.position));this.setState(e)}n&&w!==this&&(w&&w._blur(),w=this)},_didScroll:function(){this.props.onScroll(this.state.position)}});b.KEYBOARD_SCROLL_AMOUNT=y,b.SIZE=parseInt(h("scrollbar-size"),10),e.exports=b},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var o=0;o0;)this._addRowToBuffer(t,this._viewportRowsBegin,this._viewportRowsEnd-1),t++,e--;return this._rows}},{key:"getRows",value:function(e,t){var o=t,n=o,r=e,i=Math.min(e+this._maxVisibleRowCount,this._rowsCount);for(this._viewportRowsBegin=e;r=i&&(n=this._bufferSet.replaceFurthestValuePosition(t,o,e)),null===n?(n=this._bufferSet.getNewPositionForValue(e),this._rows[n]=e):this._rows[n]=e}}]),e}();e.exports=c},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var o=0;o=e&&r<=t)return null;var i;e-n>r-t?(i=n,this._smallValues.pop()):(i=r,this._largeValues.pop());var a=this._valueToPositionMap[i];return delete this._valueToPositionMap[i],this._valueToPositionMap[o]=a,this._pushToHeaps(a,o),a}},{key:"_pushToHeaps",value:function(e,t){var o={position:e,value:t};this._smallValues.push(o),this._largeValues.push(o)}},{key:"_cleanHeaps",value:function(){this._cleanHeap(this._smallValues),this._cleanHeap(this._largeValues);var e=Math.min(this._smallValues.size(),this._largeValues.size()),t=Math.max(this._smallValues.size(),this._largeValues.size());t>10*e&&this._recreateHeaps()}},{key:"_recreateHeaps",value:function(){for(var e=this._smallValues.size()t.value}}]),e}();e.exports=a},function(e,t){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){return e0&&(this._items[0]=t,this._sinkDown(0)),e}}},{key:"push",value:function(e){this._items[this._size++]=e,this._bubbleUp(this._size-1)}},{key:"size",value:function(){return this._size}},{key:"peek",value:function(){if(0!==this._size)return this._items[0]}},{key:"_heapify",value:function(){for(var e=Math.floor((this._size+1)/2);e>=0;e--)this._sinkDown(e)}},{key:"_bubbleUp",value:function(e){for(var t=this._items[e];e>0;){var o=Math.floor((e+1)/2)-1,n=this._items[o];if(this._comparator(n,t))return;this._items[o]=t,this._items[e]=n,e=o}}},{key:"_sinkDown",value:function(e){for(var t=this._items[e];;){var o=2*(e+1)-1,n=2*(e+1),r=-1;if(oo?o:e}e.exports=o},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=Object.assign||function(e){for(var t=1;t0){var o=h({"fixedDataTableRowLayout/fixedColumnsDivider":!0,"fixedDataTableRowLayout/columnsShadow":e.props.scrollLeft>0,"public/fixedDataTableRow/fixedColumnsDivider":!0,"public/fixedDataTableRow/columnsShadow":e.props.scrollLeft>0}),n={left:t,height:e.props.height};return u.createElement("div",{className:o,style:n})}},this._onClick=function(t){e.props.onClick(t,e.props.index)},this._onDoubleClick=function(t){e.props.onDoubleClick(t,e.props.index)},this._onMouseDown=function(t){e.props.onMouseDown(t,e.props.index)},this._onMouseEnter=function(t){e.props.onMouseEnter(t,e.props.index)},this._onMouseLeave=function(t){e.props.onMouseLeave(t,e.props.index)}}return r(t,e),s(t,[{key:"render",value:function(){var e={width:this.props.width,height:this.props.height},t=h({"fixedDataTableRowLayout/main":!0,"public/fixedDataTableRow/main":!0,"public/fixedDataTableRow/highlighted":this.props.index%2===1,"public/fixedDataTableRow/odd":this.props.index%2===1,"public/fixedDataTableRow/even":this.props.index%2===0}),o=this._getColumnsWidth(this.props.fixedColumns),n=u.createElement(c,{key:"fixed_cells",isScrolling:this.props.isScrolling,height:this.props.height,left:0,width:o,zIndex:2,columns:this.props.fixedColumns,onColumnResize:this.props.onColumnResize,rowHeight:this.props.height,rowIndex:this.props.index}),r=this._renderColumnsShadow(o),i=u.createElement(c,{key:"scrollable_cells",isScrolling:this.props.isScrolling,height:this.props.height,left:this.props.scrollLeft,offsetLeft:o,width:this.props.width-o,zIndex:0,columns:this.props.scrollableColumns,onColumnResize:this.props.onColumnResize,rowHeight:this.props.height,rowIndex:this.props.index});return u.createElement("div",{className:f(t,this.props.className),onClick:this.props.onClick?this._onClick:null,onDoubleClick:this.props.onDoubleClick?this._onDoubleClick:null,onMouseDown:this.props.onMouseDown?this._onMouseDown:null,onMouseEnter:this.props.onMouseEnter?this._onMouseEnter:null,onMouseLeave:this.props.onMouseLeave?this._onMouseLeave:null,style:e},u.createElement("div",{className:h("fixedDataTableRowLayout/body")},n,i,r))}}],[{key:"propTypes",value:{isScrolling:l.bool,fixedColumns:l.array.isRequired,height:l.number.isRequired,index:l.number.isRequired,scrollableColumns:l.array.isRequired,scrollLeft:l.number.isRequired,width:l.number.isRequired,onClick:l.func,onDoubleClick:l.func,onColumnResize:l.func},enumerable:!0}]),t}(u.Component),m=function(e){function t(){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return r(t,e),s(t,[{key:"render",value:function(){var e={width:this.props.width,height:this.props.height,zIndex:this.props.zIndex?this.props.zIndex:0};return p(e,0,this.props.offsetTop),u.createElement("div",{style:e,className:h("fixedDataTableRowLayout/rowWrapper")},u.createElement(d,i({},this.props,{offsetTop:void 0,zIndex:void 0})))}}],[{key:"propTypes",value:{isScrolling:l.bool,height:l.number.isRequired,zIndex:l.number,offsetTop:l.number.isRequired,width:l.number.isRequired},enumerable:!0}]),t}(u.Component);e.exports=m},function(e,t,o){"use strict";function n(e,t){var o={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}var r=Object.assign||function(e){for(var t=1;t=0){var l="cell_"+r;o[r]=this._renderCell(e.rowIndex,e.rowHeight,s,n,l)}n+=s.width}var u=this._getColumnsWidth(t),p={height:e.height,position:"absolute",width:u,zIndex:e.zIndex};return h(p,-1*f*e.left,0),a.createElement("div",{className:c("fixedDataTableCellGroupLayout/cellGroup"),style:p},o)},_renderCell:function(e,t,o,n,r){var i=o.isResizable&&this.props.onColumnResize,s=i?this.props.onColumnResize:null,l=o.cellClassName;return a.createElement(u,{isScrolling:this.props.isScrolling,align:o.align,className:l,height:t,key:r,maxWidth:o.maxWidth,minWidth:o.minWidth,onColumnResize:s,rowIndex:e,columnKey:o.columnKey,width:o.width,left:n,cell:o.cell})},_getColumnsWidth:function(e){for(var t=0,o=0;o=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}var r=o(78),i=o(73),s=o(27),a=o(34),l=o(37),u=o(60),c=o(79),h=i.DIR_SIGN,f={align:"left",highlighted:!1},p=l({displayName:"FixedDataTableCell",propTypes_DISABLED_FOR_PERFORMANCE:{isScrolling:s.bool,align:s.oneOf(["left","center","right"]),className:s.string,highlighted:s.bool,width:s.number.isRequired,minWidth:s.number,maxWidth:s.number,height:s.number.isRequired,cell:s.oneOfType([s.string,s.element,s.func]),columnKey:s.oneOfType([s.string,s.number]),rowIndex:s.number.isRequired,onColumnResize:s.func,left:s.number},shouldComponentUpdate:function(e){return!e.isScrolling||this.props.rowIndex!==e.rowIndex},getDefaultProps:function(){return f},render:function(){var e=this.props,t=e.height,o=e.width,i=e.columnKey,s=n(e,["height","width","columnKey"]),l={height:t,width:o};1===h?l.left=s.left:l.right=s.left;var f,p=c(u({"fixedDataTableCellLayout/main":!0,"fixedDataTableCellLayout/lastChild":s.lastChild,"fixedDataTableCellLayout/alignRight":"right"===s.align,"fixedDataTableCellLayout/alignCenter":"center"===s.align,"public/fixedDataTableCell/alignRight":"right"===s.align,"public/fixedDataTableCell/highlighted":s.highlighted,"public/fixedDataTableCell/main":!0}),s.className);if(s.onColumnResize){var d={height:t};f=a.createElement("div",{className:u("fixedDataTableCellLayout/columnResizerContainer"),style:d,onMouseDown:this._onColumnResizerMouseDown},a.createElement("div",{className:c(u("fixedDataTableCellLayout/columnResizerKnob"),u("public/fixedDataTableCell/columnResizerKnob")),style:d}))}var m={columnKey:i,height:t,width:o};s.rowIndex>=0&&(m.rowIndex=s.rowIndex);var v;return v=a.isValidElement(s.cell)?a.cloneElement(s.cell,m):"function"==typeof s.cell?s.cell(m):a.createElement(r,m,s.cell),a.createElement("div",{className:p,style:l},f,v)},_onColumnResizerMouseDown:function(e){this.props.onColumnResize(this.props.left,this.props.width,this.props.minWidth,this.props.maxWidth,this.props.columnKey,e)}});e.exports=p},function(e,t,o){"use strict";function n(e,t){var o={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=Object.assign||function(e){for(var t=1;t1)for(var n=1;n=0&&t>=e-a;){var o=this._updateRowHeight(t);this._position+=o,t--}}},{key:"_updateRowHeight",value:function(e){if(e<0||e>=this._rowCount)return 0;var t=this._rowHeightGetter(e);if(t!==this._storedHeights[e]){var o=t-this._storedHeights[e];return this._rowOffsets.set(e,t),this._storedHeights[e]=t,this._contentHeight+=o,o}return 0}},{key:"getRowPosition",value:function(e){return this._updateRowHeight(e),this._rowOffsets.sumUntil(e)}},{key:"scrollBy",value:function(e){if(0===this._rowCount)return l;var t=this._rowOffsets.greatestLowerBound(this._position);t=s(t,0,Math.max(this._rowCount-1,0));var o=this._rowOffsets.sumUntil(t),n=t,r=this._position,i=this._updateRowHeight(n);0!==o&&(r+=i);var a=this._storedHeights[n]-(r-o);if(e>=0)for(;e>0&&n0&&n>=0;)if(e=0){var c=this._updateRowHeight(n);u=this._storedHeights[n],r+=c}}var h=this._contentHeight-this._viewportHeight;r=s(r,0,h),this._position=r;var f=this._rowOffsets.greatestLowerBound(r);f=s(f,0,Math.max(this._rowCount-1,0)),o=this._rowOffsets.sumUntil(f);var p=o-r;return this._updateHeightsInViewport(f,p),this._updateHeightsAboveViewport(f),{index:f,offset:p,position:this._position,contentHeight:this._contentHeight}}},{key:"_getRowAtEndPosition",value:function(e){this._updateRowHeight(e);for(var t=e,o=this._storedHeights[t];o=0;)t--,t>=0&&(this._updateRowHeight(t),o+=this._storedHeights[t]);var n=this._rowOffsets.sumTo(e)-this._viewportHeight;return n<0&&(n=0),n}},{key:"scrollTo",value:function(e){if(0===this._rowCount)return l;if(e<=0)return this._position=0,this._updateHeightsInViewport(0,0),{index:0,offset:0,position:this._position,contentHeight:this._contentHeight};if(e>=this._contentHeight-this._viewportHeight){var t=this._rowCount-1;e=this._getRowAtEndPosition(t)}this._position=e;var o=this._rowOffsets.greatestLowerBound(e);o=s(o,0,Math.max(this._rowCount-1,0));var n=this._rowOffsets.sumUntil(o),r=n-e;return this._updateHeightsInViewport(o,r),this._updateHeightsAboveViewport(o),{index:o,offset:r,position:this._position,contentHeight:this._contentHeight}}},{key:"scrollToRow",value:function(e,t){e=s(e,0,Math.max(this._rowCount-1,0)),t=s(t,-this._storedHeights[e],0);var o=this._rowOffsets.sumUntil(e);return this.scrollTo(o-t)}},{key:"scrollRowIntoView",value:function(e){e=s(e,0,Math.max(this._rowCount-1,0));var t=this._rowOffsets.sumUntil(e),o=t+this._storedHeights[e];if(t=0;--o)t[o]=0;return t},u=function(){function e(t){n(this,e),this._size=t.length,this._half=r(this._size),this._heap=new l(2*this._half);var o;for(o=0;o0;--o)this._heap[o]=this._heap[2*o]+this._heap[2*o+1]}return i(e,[{key:"set",value:function(e,t){s(0<=e&&e=0;--r)n[r]=o;return new e(n)}},{key:"empty",value:function(t){return e.uniform(t,0)}}]),e}();e.exports=u}).call(t,function(){return this}())},function(e,t,o){"use strict";function n(e){for(var t=0,o=0;o=e&&r<=t)return null;var i;e-n>r-t?(i=n,this._smallValues.pop()):(i=r,this._largeValues.pop());var a=this._valueToPositionMap[i];return delete this._valueToPositionMap[i],this._valueToPositionMap[o]=a,this._pushToHeaps(a,o),a}},{key:"_pushToHeaps",value:function(e,t){var o={position:e,value:t};this._smallValues.push(o),this._largeValues.push(o)}},{key:"_cleanHeaps",value:function(){this._cleanHeap(this._smallValues),this._cleanHeap(this._largeValues);var e=Math.min(this._smallValues.size(),this._largeValues.size()),t=Math.max(this._smallValues.size(),this._largeValues.size());t>10*e&&this._recreateHeaps()}},{key:"_recreateHeaps",value:function(){for(var e=this._smallValues.size()t.value}}]),e}();e.exports=a},function(e,t){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){return e0&&(this._items[0]=t,this._sinkDown(0)),e}}},{key:"push",value:function(e){this._items[this._size++]=e,this._bubbleUp(this._size-1)}},{key:"size",value:function(){return this._size}},{key:"peek",value:function(){if(0!==this._size)return this._items[0]}},{key:"_heapify",value:function(){for(var e=Math.floor((this._size+1)/2);e>=0;e--)this._sinkDown(e)}},{key:"_bubbleUp",value:function(e){for(var t=this._items[e];e>0;){var o=Math.floor((e+1)/2)-1,n=this._items[o];if(this._comparator(n,t))return;this._items[o]=t,this._items[e]=n,e=o}}},{key:"_sinkDown",value:function(e){for(var t=this._items[e];;){var o=2*(e+1)-1,n=2*(e+1),r=-1;if(oo?o:e}e.exports=o},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=Object.assign||function(e){for(var t=1;t0){var o=h({"fixedDataTableRowLayout/fixedColumnsDivider":!0,"fixedDataTableRowLayout/columnsShadow":e.props.scrollLeft>0,"public/fixedDataTableRow/fixedColumnsDivider":!0,"public/fixedDataTableRow/columnsShadow":e.props.scrollLeft>0}),n={left:t,height:e.props.height};return u.createElement("div",{className:o,style:n})}},this._onClick=function(t){e.props.onClick(t,e.props.index)},this._onDoubleClick=function(t){e.props.onDoubleClick(t,e.props.index)},this._onMouseDown=function(t){e.props.onMouseDown(t,e.props.index)},this._onMouseEnter=function(t){e.props.onMouseEnter(t,e.props.index)},this._onMouseLeave=function(t){e.props.onMouseLeave(t,e.props.index)}}return r(t,e),s(t,[{key:"render",value:function(){var e={width:this.props.width,height:this.props.height},t=h({"fixedDataTableRowLayout/main":!0,"public/fixedDataTableRow/main":!0,"public/fixedDataTableRow/highlighted":this.props.index%2===1,"public/fixedDataTableRow/odd":this.props.index%2===1,"public/fixedDataTableRow/even":this.props.index%2===0}),o=this._getColumnsWidth(this.props.fixedColumns),n=u.createElement(c,{key:"fixed_cells",isScrolling:this.props.isScrolling,height:this.props.height,left:0,width:o,zIndex:2,columns:this.props.fixedColumns,onColumnResize:this.props.onColumnResize,rowHeight:this.props.height,rowIndex:this.props.index}),r=this._renderColumnsShadow(o),i=u.createElement(c,{key:"scrollable_cells",isScrolling:this.props.isScrolling,height:this.props.height,left:this.props.scrollLeft,offsetLeft:o,width:this.props.width-o,zIndex:0,columns:this.props.scrollableColumns,onColumnResize:this.props.onColumnResize,rowHeight:this.props.height,rowIndex:this.props.index});return u.createElement("div",{className:f(t,this.props.className),onClick:this.props.onClick?this._onClick:null,onDoubleClick:this.props.onDoubleClick?this._onDoubleClick:null,onMouseDown:this.props.onMouseDown?this._onMouseDown:null,onMouseEnter:this.props.onMouseEnter?this._onMouseEnter:null,onMouseLeave:this.props.onMouseLeave?this._onMouseLeave:null,style:e},u.createElement("div",{className:h("fixedDataTableRowLayout/body")},n,i,r))}}],[{key:"propTypes",value:{isScrolling:l.bool,fixedColumns:l.array.isRequired,height:l.number.isRequired,index:l.number.isRequired,scrollableColumns:l.array.isRequired,scrollLeft:l.number.isRequired,width:l.number.isRequired,onClick:l.func,onDoubleClick:l.func,onColumnResize:l.func},enumerable:!0}]),t}(u.Component),m=function(e){function t(){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return r(t,e),s(t,[{key:"render",value:function(){var e={width:this.props.width,height:this.props.height,zIndex:this.props.zIndex?this.props.zIndex:0};return p(e,0,this.props.offsetTop),u.createElement("div",{style:e,className:h("fixedDataTableRowLayout/rowWrapper")},u.createElement(d,i({},this.props,{offsetTop:void 0,zIndex:void 0})))}}],[{key:"propTypes",value:{isScrolling:l.bool,height:l.number.isRequired,zIndex:l.number,offsetTop:l.number.isRequired,width:l.number.isRequired},enumerable:!0}]),t}(u.Component);e.exports=m},function(e,t,o){"use strict";function n(e,t){var o={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}var r=Object.assign||function(e){for(var t=1;t=0){var l="cell_"+r;o[r]=this._renderCell(e.rowIndex,e.rowHeight,s,n,l)}n+=s.width}var u=this._getColumnsWidth(t),p={height:e.height,position:"absolute",width:u,zIndex:e.zIndex};return h(p,-1*f*e.left,0),a.createElement("div",{className:c("fixedDataTableCellGroupLayout/cellGroup"),style:p},o)},_renderCell:function(e,t,o,n,r){var i=o.isResizable&&this.props.onColumnResize,s=i?this.props.onColumnResize:null,l=o.cellClassName;return a.createElement(u,{isScrolling:this.props.isScrolling,align:o.align,className:l,height:t,key:r,maxWidth:o.maxWidth,minWidth:o.minWidth,onColumnResize:s,rowIndex:e,columnKey:o.columnKey,width:o.width,left:n,cell:o.cell})},_getColumnsWidth:function(e){for(var t=0,o=0;o=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}var r=o(78),i=o(73),s=o(27),a=o(34),l=o(37),u=o(60),c=o(79),h=i.DIR_SIGN,f={align:"left",highlighted:!1},p=l({displayName:"FixedDataTableCell",propTypes_DISABLED_FOR_PERFORMANCE:{isScrolling:s.bool,align:s.oneOf(["left","center","right"]),className:s.string,highlighted:s.bool,width:s.number.isRequired,minWidth:s.number,maxWidth:s.number,height:s.number.isRequired,cell:s.oneOfType([s.string,s.element,s.func]),columnKey:s.oneOfType([s.string,s.number]),rowIndex:s.number.isRequired,onColumnResize:s.func,left:s.number},shouldComponentUpdate:function(e){return!e.isScrolling||this.props.rowIndex!==e.rowIndex},getDefaultProps:function(){return f},render:function(){var e=this.props,t=e.height,o=e.width,i=e.columnKey,s=n(e,["height","width","columnKey"]),l={height:t,width:o};1===h?l.left=s.left:l.right=s.left;var f,p=c(u({"fixedDataTableCellLayout/main":!0,"fixedDataTableCellLayout/lastChild":s.lastChild,"fixedDataTableCellLayout/alignRight":"right"===s.align,"fixedDataTableCellLayout/alignCenter":"center"===s.align,"public/fixedDataTableCell/alignRight":"right"===s.align,"public/fixedDataTableCell/highlighted":s.highlighted,"public/fixedDataTableCell/main":!0}),s.className);if(s.onColumnResize){var d={height:t};f=a.createElement("div",{className:u("fixedDataTableCellLayout/columnResizerContainer"),style:d,onMouseDown:this._onColumnResizerMouseDown},a.createElement("div",{className:c(u("fixedDataTableCellLayout/columnResizerKnob"),u("public/fixedDataTableCell/columnResizerKnob")),style:d}))}var m={columnKey:i,height:t,width:o};s.rowIndex>=0&&(m.rowIndex=s.rowIndex);var v;return a.isValidElement(s.cell)?("div"===s.cell.type&&delete m.columnKey,v=a.cloneElement(s.cell,m)):v="function"==typeof s.cell?s.cell(m):a.createElement(r,m,s.cell),a.createElement("div",{className:p,style:l},f,v)},_onColumnResizerMouseDown:function(e){this.props.onColumnResize(this.props.left,this.props.width,this.props.minWidth,this.props.maxWidth,this.props.columnKey,e)}});e.exports=p},function(e,t,o){"use strict";function n(e,t){var o={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=Object.assign||function(e){for(var t=1;t1)for(var n=1;n=0&&t>=e-a;){var o=this._updateRowHeight(t);this._position+=o,t--}}},{key:"_updateRowHeight",value:function(e){if(e<0||e>=this._rowCount)return 0;var t=this._rowHeightGetter(e);if(t!==this._storedHeights[e]){var o=t-this._storedHeights[e];return this._rowOffsets.set(e,t),this._storedHeights[e]=t,this._contentHeight+=o,o}return 0}},{key:"getRowPosition",value:function(e){return this._updateRowHeight(e),this._rowOffsets.sumUntil(e)}},{key:"scrollBy",value:function(e){if(0===this._rowCount)return l;var t=this._rowOffsets.greatestLowerBound(this._position);t=s(t,0,Math.max(this._rowCount-1,0));var o=this._rowOffsets.sumUntil(t),n=t,r=this._position,i=this._updateRowHeight(n);0!==o&&(r+=i);var a=this._storedHeights[n]-(r-o);if(e>=0)for(;e>0&&n0&&n>=0;)if(e=0){var c=this._updateRowHeight(n);u=this._storedHeights[n],r+=c}}var h=this._contentHeight-this._viewportHeight;r=s(r,0,h),this._position=r;var f=this._rowOffsets.greatestLowerBound(r);f=s(f,0,Math.max(this._rowCount-1,0)),o=this._rowOffsets.sumUntil(f);var p=o-r;return this._updateHeightsInViewport(f,p),this._updateHeightsAboveViewport(f),{index:f,offset:p,position:this._position,contentHeight:this._contentHeight}}},{key:"_getRowAtEndPosition",value:function(e){this._updateRowHeight(e);for(var t=e,o=this._storedHeights[t];o=0;)t--,t>=0&&(this._updateRowHeight(t),o+=this._storedHeights[t]);var n=this._rowOffsets.sumTo(e)-this._viewportHeight;return n<0&&(n=0),n}},{key:"scrollTo",value:function(e){if(0===this._rowCount)return l;if(e<=0)return this._position=0,this._updateHeightsInViewport(0,0),{index:0,offset:0,position:this._position,contentHeight:this._contentHeight};if(e>=this._contentHeight-this._viewportHeight){var t=this._rowCount-1;e=this._getRowAtEndPosition(t)}this._position=e;var o=this._rowOffsets.greatestLowerBound(e);o=s(o,0,Math.max(this._rowCount-1,0));var n=this._rowOffsets.sumUntil(o),r=n-e;return this._updateHeightsInViewport(o,r),this._updateHeightsAboveViewport(o),{index:o,offset:r,position:this._position,contentHeight:this._contentHeight}}},{key:"scrollToRow",value:function(e,t){e=s(e,0,Math.max(this._rowCount-1,0)),t=s(t,-this._storedHeights[e],0);var o=this._rowOffsets.sumUntil(e);return this.scrollTo(o-t)}},{key:"scrollRowIntoView",value:function(e){e=s(e,0,Math.max(this._rowCount-1,0));var t=this._rowOffsets.sumUntil(e),o=t+this._storedHeights[e];if(t=0;--o)t[o]=0;return t},u=function(){function e(t){n(this,e),this._size=t.length,this._half=r(this._size),this._heap=new l(2*this._half);var o;for(o=0;o0;--o)this._heap[o]=this._heap[2*o]+this._heap[2*o+1]}return i(e,[{key:"set",value:function(e,t){s(0<=e&&e=0;--r)n[r]=o;return new e(n)}},{key:"empty",value:function(t){return e.uniform(t,0)}}]),e}();e.exports=u}).call(t,function(){return this}())},function(e,t,o){"use strict";function n(e){for(var t=0,o=0;o Date: Mon, 1 Jul 2019 22:10:16 -0700 Subject: [PATCH 30/43] Make column resizer span full height of column. --- src/FixedDataTableBufferedRows.react.js | 3 +++ src/FixedDataTableCell.react.js | 9 +++++++-- src/FixedDataTableCellGroup.react.js | 2 ++ src/FixedDataTableNew.react.js | 15 ++++++++++++++- src/FixedDataTableRow.react.js | 2 ++ src/css/layout/fixedDataTableCellLayout.css | 5 ----- 6 files changed, 28 insertions(+), 8 deletions(-) diff --git a/src/FixedDataTableBufferedRows.react.js b/src/FixedDataTableBufferedRows.react.js index 1c506301..1fc7266c 100644 --- a/src/FixedDataTableBufferedRows.react.js +++ b/src/FixedDataTableBufferedRows.react.js @@ -154,6 +154,9 @@ var FixedDataTableBufferedRows = createReactClass({ 'public/fixedDataTable/hasBottomBorder': hasBottomBorder, }) )} + onColumnResize={props.onColumnResize} + isHoveringResizerKnob={props.isHoveringResizerKnob} + setHoverState={props.setHoverState} />; } diff --git a/src/FixedDataTableCell.react.js b/src/FixedDataTableCell.react.js index 228bc95b..73c61659 100644 --- a/src/FixedDataTableCell.react.js +++ b/src/FixedDataTableCell.react.js @@ -121,13 +121,18 @@ var FixedDataTableCell = createReactClass({ var columnResizerComponent; if (props.onColumnResize) { var columnResizerStyle = { - height + height, + opacity: props.isHoveringResizerKnob ? 1 : 0, }; + console.log('isHovering: ', props.isHoveringResizerKnob) + console.log('isHoveringResizerKnob: ', props.isHoveringResizerKnob) columnResizerComponent = (
+ onMouseDown={this._onColumnResizerMouseDown} + onMouseEnter={() => props.setHoverState(true)} + onMouseLeave={() => props.setHoverState(false)}>
); } @@ -568,6 +572,8 @@ var FixedDataTable = createReactClass({ fixedColumns={state.headFixedColumns} scrollableColumns={state.headScrollableColumns} onColumnResize={this._onColumnResize} + isHoveringResizerKnob={state.isHoveringResizerKnob} + setHoverState={this.setHoverState} /> ); @@ -659,6 +665,9 @@ var FixedDataTable = createReactClass({ showLastRowBorder={true} width={state.width} rowPositionGetter={this._scrollHelper.getRowPosition} + onColumnResize={this._onColumnResize} + isHoveringResizerKnob={state.isHoveringResizerKnob} + setHoverState={this.setHoverState} /> ); }, @@ -1118,6 +1127,10 @@ var FixedDataTable = createReactClass({ this.props.onScrollEnd(this.state.scrollX, this.state.scrollY); } } + }, + + setHoverState(hoverState) { + this.setState({ isHoveringResizerKnob: hoverState }) } }); diff --git a/src/FixedDataTableRow.react.js b/src/FixedDataTableRow.react.js index 1ad72aaf..18914729 100644 --- a/src/FixedDataTableRow.react.js +++ b/src/FixedDataTableRow.react.js @@ -110,6 +110,8 @@ class FixedDataTableRowImpl extends React.Component { zIndex={2} columns={this.props.fixedColumns} onColumnResize={this.props.onColumnResize} + isHoveringResizerKnob={this.props.isHoveringResizerKnob} + setHoverState={this.props.setHoverState} rowHeight={this.props.height} rowIndex={this.props.index} />; diff --git a/src/css/layout/fixedDataTableCellLayout.css b/src/css/layout/fixedDataTableCellLayout.css index 90fc2f1d..c78f864f 100644 --- a/src/css/layout/fixedDataTableCellLayout.css +++ b/src/css/layout/fixedDataTableCellLayout.css @@ -56,13 +56,8 @@ cursor: ew-resize; } -.fixedDataTableCellLayout/columnResizerContainer:hover .fixedDataTableCellLayout/columnResizerKnob { - visibility: visible; -} - .fixedDataTableCellLayout/columnResizerKnob { position: absolute; right: 0px; - visibility: hidden; width: 4px; } From e979240b85beb9bbe8cb9f084662d8993254091c Mon Sep 17 00:00:00 2001 From: Kevin Chang Date: Mon, 1 Jul 2019 22:10:31 -0700 Subject: [PATCH 31/43] Make git ignore idea project metadata files. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index dc28ea22..de517881 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ internal docs/api dist *.swp +.idea/ \ No newline at end of file From 8e809a3d6d915aa8c12a7d0f6b1012240302a39d Mon Sep 17 00:00:00 2001 From: Kevin Chang Date: Mon, 1 Jul 2019 22:11:12 -0700 Subject: [PATCH 32/43] Change resize icon. --- src/css/layout/fixedDataTableCellLayout.css | 2 +- src/css/layout/fixedDataTableColumnResizerLineLayout.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/css/layout/fixedDataTableCellLayout.css b/src/css/layout/fixedDataTableCellLayout.css index c78f864f..74f76845 100644 --- a/src/css/layout/fixedDataTableCellLayout.css +++ b/src/css/layout/fixedDataTableCellLayout.css @@ -53,7 +53,7 @@ } .fixedDataTableCellLayout/columnResizerContainer:hover { - cursor: ew-resize; + cursor: col-resize; } .fixedDataTableCellLayout/columnResizerKnob { diff --git a/src/css/layout/fixedDataTableColumnResizerLineLayout.css b/src/css/layout/fixedDataTableColumnResizerLineLayout.css index e724497c..2d1f0a25 100644 --- a/src/css/layout/fixedDataTableColumnResizerLineLayout.css +++ b/src/css/layout/fixedDataTableColumnResizerLineLayout.css @@ -10,7 +10,7 @@ */ .fixedDataTableColumnResizerLineLayout/mouseArea { - cursor: ew-resize; + cursor: col-resize; position: absolute; right: -5px; width: 12px; From 6eaed421a54b5e8468a5f2344ba334a76d6fb03b Mon Sep 17 00:00:00 2001 From: Kevin Chang Date: Mon, 1 Jul 2019 22:12:43 -0700 Subject: [PATCH 33/43] Change resizer knob color to orange. --- src/css/style/fixedDataTableCell.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/css/style/fixedDataTableCell.css b/src/css/style/fixedDataTableCell.css index 7c878046..ed5e6cbc 100644 --- a/src/css/style/fixedDataTableCell.css +++ b/src/css/style/fixedDataTableCell.css @@ -26,5 +26,5 @@ } .public/fixedDataTableCell/columnResizerKnob { - background-color: #0284ff; + background-color: #f57c00; } From 473b94e0ad707e96b55a6c890de7de5a1868ac2b Mon Sep 17 00:00:00 2001 From: Kevin Chang Date: Mon, 1 Jul 2019 22:13:18 -0700 Subject: [PATCH 34/43] Change resizer line color to orange. --- src/css/style/fixedDataTableColumnResizerLine.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/css/style/fixedDataTableColumnResizerLine.css b/src/css/style/fixedDataTableColumnResizerLine.css index 42a975fd..3f9653f6 100644 --- a/src/css/style/fixedDataTableColumnResizerLine.css +++ b/src/css/style/fixedDataTableColumnResizerLine.css @@ -14,5 +14,5 @@ * Column resizer line. */ .public/fixedDataTableColumnResizerLine/main { - border-color: #0284ff; + border-color: #f57c00; } From 1f8458de8ca3e2aeb8383faf8e5e857eb1b3e436 Mon Sep 17 00:00:00 2001 From: Kevin Chang Date: Mon, 1 Jul 2019 22:33:41 -0700 Subject: [PATCH 35/43] Add opacity layer while resizing. --- src/FixedDataTableBufferedRows.react.js | 1 + src/FixedDataTableNew.react.js | 3 +++ src/FixedDataTableRow.react.js | 1 + 3 files changed, 5 insertions(+) diff --git a/src/FixedDataTableBufferedRows.react.js b/src/FixedDataTableBufferedRows.react.js index 1fc7266c..c40a31e6 100644 --- a/src/FixedDataTableBufferedRows.react.js +++ b/src/FixedDataTableBufferedRows.react.js @@ -157,6 +157,7 @@ var FixedDataTableBufferedRows = createReactClass({ onColumnResize={props.onColumnResize} isHoveringResizerKnob={props.isHoveringResizerKnob} setHoverState={props.setHoverState} + isColumnResizing={props.isColumnResizing} />; } diff --git a/src/FixedDataTableNew.react.js b/src/FixedDataTableNew.react.js index c0a4f8e3..a77bc1a9 100644 --- a/src/FixedDataTableNew.react.js +++ b/src/FixedDataTableNew.react.js @@ -456,6 +456,7 @@ var FixedDataTable = createReactClass({ scrollableColumns={state.groupHeaderScrollableColumns} onColumnResize={this._onColumnResize} setHoverState={this.setHoverState} + isColumnResizing={state.isColumnResizing} /> ); } @@ -574,6 +575,7 @@ var FixedDataTable = createReactClass({ onColumnResize={this._onColumnResize} isHoveringResizerKnob={state.isHoveringResizerKnob} setHoverState={this.setHoverState} + isColumnResizing={state.isColumnResizing} /> ); @@ -668,6 +670,7 @@ var FixedDataTable = createReactClass({ onColumnResize={this._onColumnResize} isHoveringResizerKnob={state.isHoveringResizerKnob} setHoverState={this.setHoverState} + isColumnResizing={state.isColumnResizing} /> ); }, diff --git a/src/FixedDataTableRow.react.js b/src/FixedDataTableRow.react.js index 18914729..25d183b5 100644 --- a/src/FixedDataTableRow.react.js +++ b/src/FixedDataTableRow.react.js @@ -226,6 +226,7 @@ class FixedDataTableRow extends React.Component { width: this.props.width, height: this.props.height, zIndex: (this.props.zIndex ? this.props.zIndex : 0), + opacity: this.props.isColumnResizing ? .4 : 1, }; translateDOMPositionXY(style, 0, this.props.offsetTop); From ae99ab82ba1570742d570bcebdacfb018946e295 Mon Sep 17 00:00:00 2001 From: Kevin Chang Date: Mon, 1 Jul 2019 22:34:36 -0700 Subject: [PATCH 36/43] Change resizer knob width to 1px. --- src/css/layout/fixedDataTableCellLayout.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/css/layout/fixedDataTableCellLayout.css b/src/css/layout/fixedDataTableCellLayout.css index 74f76845..3844e7b9 100644 --- a/src/css/layout/fixedDataTableCellLayout.css +++ b/src/css/layout/fixedDataTableCellLayout.css @@ -59,5 +59,5 @@ .fixedDataTableCellLayout/columnResizerKnob { position: absolute; right: 0px; - width: 4px; + width: 1px; } From 6ba73a3a75d4fe7f3110355947f1712544a19c36 Mon Sep 17 00:00:00 2001 From: Kevin Chang Date: Mon, 15 Jul 2019 16:45:11 -0700 Subject: [PATCH 37/43] Bump package.json version. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8e484e3f..e5cffa78 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@buildingconnected/fixed-data-table", - "version": "0.7.13", + "version": "0.8.0", "description": "A React table component designed to allow presenting thousands of rows of data.", "main": "main.js", "peerDependencies": { From c98a3bd067919293031e7b284b87053097d5321a Mon Sep 17 00:00:00 2001 From: Kevin Chang Date: Mon, 15 Jul 2019 16:46:02 -0700 Subject: [PATCH 38/43] Version 0.8.0 --- dist/fixed-data-table-base.css | 13 +- dist/fixed-data-table-base.min.css | 4 +- dist/fixed-data-table-style.css | 6 +- dist/fixed-data-table-style.min.css | 4 +- dist/fixed-data-table.css | 17 +- dist/fixed-data-table.js | 509 +++------------------------- dist/fixed-data-table.min.css | 4 +- dist/fixed-data-table.min.js | 10 +- 8 files changed, 72 insertions(+), 495 deletions(-) diff --git a/dist/fixed-data-table-base.css b/dist/fixed-data-table-base.css index 10949182..546f4521 100644 --- a/dist/fixed-data-table-base.css +++ b/dist/fixed-data-table-base.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.13 + * FixedDataTable v0.8.0 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -94,18 +94,13 @@ } .fixedDataTableCellLayout_columnResizerContainer:hover { - cursor: ew-resize; -} - -.fixedDataTableCellLayout_columnResizerContainer:hover .fixedDataTableCellLayout_columnResizerKnob { - visibility: visible; + cursor: col-resize; } .fixedDataTableCellLayout_columnResizerKnob { position: absolute; right: 0px; - visibility: hidden; - width: 4px; + width: 1px; } /** * Copyright (c) 2015, Facebook, Inc. @@ -119,7 +114,7 @@ */ .fixedDataTableColumnResizerLineLayout_mouseArea { - cursor: ew-resize; + cursor: col-resize; position: absolute; right: -5px; width: 12px; diff --git a/dist/fixed-data-table-base.min.css b/dist/fixed-data-table-base.min.css index 2dc94e31..40bc8f26 100644 --- a/dist/fixed-data-table-base.min.css +++ b/dist/fixed-data-table-base.min.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.13 + * FixedDataTable v0.8.0 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -9,4 +9,4 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -.fixedDataTableCellGroupLayout_cellGroup{backface-visibility:hidden;left:0;overflow:hidden;position:absolute;top:0;white-space:nowrap}.fixedDataTableCellGroupLayout_cellGroup>.public_fixedDataTableCell_main{display:inline-block;vertical-align:top;white-space:normal}.fixedDataTableCellGroupLayout_cellGroupWrapper{position:absolute;top:0}.fixedDataTableCellLayout_main{border-right-style:solid;border-width:0 1px 0 0;box-sizing:border-box;display:block;overflow:hidden;position:absolute;white-space:normal}.fixedDataTableCellLayout_lastChild{border-width:0 1px 1px 0}.fixedDataTableCellLayout_alignRight{text-align:right}.fixedDataTableCellLayout_alignCenter{text-align:center}.fixedDataTableCellLayout_wrap1{display:table}.fixedDataTableCellLayout_wrap2{display:table-row}.fixedDataTableCellLayout_wrap3{display:table-cell;vertical-align:middle}.fixedDataTableCellLayout_columnResizerContainer{position:absolute;right:0;width:6px;z-index:1}.fixedDataTableCellLayout_columnResizerContainer:hover{cursor:ew-resize}.fixedDataTableCellLayout_columnResizerContainer:hover .fixedDataTableCellLayout_columnResizerKnob{visibility:visible}.fixedDataTableCellLayout_columnResizerKnob{position:absolute;right:0;visibility:hidden;width:4px}.fixedDataTableColumnResizerLineLayout_mouseArea{cursor:ew-resize;position:absolute;right:-5px;width:12px}.fixedDataTableColumnResizerLineLayout_main{border-right-style:solid;border-right-width:1px;box-sizing:border-box;position:absolute;z-index:10}body[dir="rtl"] .fixedDataTableColumnResizerLineLayout_main,.fixedDataTableColumnResizerLineLayout_hiddenElem{display:none!important}.fixedDataTableLayout_main{border-style:solid;border-width:1px;box-sizing:border-box;overflow:hidden;position:relative}.fixedDataTableLayout_header,.fixedDataTableLayout_hasBottomBorder{border-bottom-style:solid;border-bottom-width:1px}.fixedDataTableLayout_footer .public_fixedDataTableCell_main{border-top-style:solid;border-top-width:1px}.fixedDataTableLayout_topShadow,.fixedDataTableLayout_bottomShadow{height:4px;left:0;position:absolute;right:0;z-index:1}.fixedDataTableLayout_bottomShadow{margin-top:-4px}.fixedDataTableLayout_rowsContainer{overflow:hidden;position:relative}.fixedDataTableLayout_horizontalScrollbar{bottom:0;position:absolute}.fixedDataTableRowLayout_main{box-sizing:border-box;overflow:hidden;position:absolute;top:0}.fixedDataTableRowLayout_body{left:0;position:absolute;top:0}.fixedDataTableRowLayout_fixedColumnsDivider{backface-visibility:hidden;border-left-style:solid;border-left-width:1px;left:0;position:absolute;top:0;width:0}.fixedDataTableRowLayout_columnsShadow{width:4px}.fixedDataTableRowLayout_rowWrapper{position:absolute;top:0}.ScrollbarLayout_main{box-sizing:border-box;outline:none;overflow:hidden;position:absolute;transition-duration:250ms;transition-timing-function:ease;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ScrollbarLayout_mainVertical{bottom:0;right:0;top:0;transition-property:background-color width;width:15px}.ScrollbarLayout_mainVertical.public_Scrollbar_mainActive,.ScrollbarLayout_mainVertical:hover{width:17px}.ScrollbarLayout_mainHorizontal{bottom:0;height:15px;left:0;transition-property:background-color height}.ScrollbarLayout_mainHorizontal.public_Scrollbar_mainActive,.ScrollbarLayout_mainHorizontal:hover{height:17px}.ScrollbarLayout_face{left:0;overflow:hidden;position:absolute;z-index:1}.ScrollbarLayout_face:after{border-radius:6px;content:'';display:block;position:absolute;transition:background-color 250ms ease}.ScrollbarLayout_faceHorizontal{bottom:0;left:0;top:0}.ScrollbarLayout_faceHorizontal:after{bottom:4px;left:0;top:4px;width:100%}.ScrollbarLayout_faceVertical{left:0;right:0;top:0}.ScrollbarLayout_faceVertical:after{height:100%;left:4px;right:4px;top:0} \ No newline at end of file +.fixedDataTableCellGroupLayout_cellGroup{backface-visibility:hidden;left:0;overflow:hidden;position:absolute;top:0;white-space:nowrap}.fixedDataTableCellGroupLayout_cellGroup>.public_fixedDataTableCell_main{display:inline-block;vertical-align:top;white-space:normal}.fixedDataTableCellGroupLayout_cellGroupWrapper{position:absolute;top:0}.fixedDataTableCellLayout_main{border-right-style:solid;border-width:0 1px 0 0;box-sizing:border-box;display:block;overflow:hidden;position:absolute;white-space:normal}.fixedDataTableCellLayout_lastChild{border-width:0 1px 1px 0}.fixedDataTableCellLayout_alignRight{text-align:right}.fixedDataTableCellLayout_alignCenter{text-align:center}.fixedDataTableCellLayout_wrap1{display:table}.fixedDataTableCellLayout_wrap2{display:table-row}.fixedDataTableCellLayout_wrap3{display:table-cell;vertical-align:middle}.fixedDataTableCellLayout_columnResizerContainer{position:absolute;right:0;width:6px;z-index:1}.fixedDataTableCellLayout_columnResizerContainer:hover{cursor:col-resize}.fixedDataTableCellLayout_columnResizerKnob{position:absolute;right:0;width:1px}.fixedDataTableColumnResizerLineLayout_mouseArea{cursor:col-resize;position:absolute;right:-5px;width:12px}.fixedDataTableColumnResizerLineLayout_main{border-right-style:solid;border-right-width:1px;box-sizing:border-box;position:absolute;z-index:10}body[dir="rtl"] .fixedDataTableColumnResizerLineLayout_main,.fixedDataTableColumnResizerLineLayout_hiddenElem{display:none!important}.fixedDataTableLayout_main{border-style:solid;border-width:1px;box-sizing:border-box;overflow:hidden;position:relative}.fixedDataTableLayout_header,.fixedDataTableLayout_hasBottomBorder{border-bottom-style:solid;border-bottom-width:1px}.fixedDataTableLayout_footer .public_fixedDataTableCell_main{border-top-style:solid;border-top-width:1px}.fixedDataTableLayout_topShadow,.fixedDataTableLayout_bottomShadow{height:4px;left:0;position:absolute;right:0;z-index:1}.fixedDataTableLayout_bottomShadow{margin-top:-4px}.fixedDataTableLayout_rowsContainer{overflow:hidden;position:relative}.fixedDataTableLayout_horizontalScrollbar{bottom:0;position:absolute}.fixedDataTableRowLayout_main{box-sizing:border-box;overflow:hidden;position:absolute;top:0}.fixedDataTableRowLayout_body{left:0;position:absolute;top:0}.fixedDataTableRowLayout_fixedColumnsDivider{backface-visibility:hidden;border-left-style:solid;border-left-width:1px;left:0;position:absolute;top:0;width:0}.fixedDataTableRowLayout_columnsShadow{width:4px}.fixedDataTableRowLayout_rowWrapper{position:absolute;top:0}.ScrollbarLayout_main{box-sizing:border-box;outline:none;overflow:hidden;position:absolute;transition-duration:250ms;transition-timing-function:ease;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ScrollbarLayout_mainVertical{bottom:0;right:0;top:0;transition-property:background-color width;width:15px}.ScrollbarLayout_mainVertical.public_Scrollbar_mainActive,.ScrollbarLayout_mainVertical:hover{width:17px}.ScrollbarLayout_mainHorizontal{bottom:0;height:15px;left:0;transition-property:background-color height}.ScrollbarLayout_mainHorizontal.public_Scrollbar_mainActive,.ScrollbarLayout_mainHorizontal:hover{height:17px}.ScrollbarLayout_face{left:0;overflow:hidden;position:absolute;z-index:1}.ScrollbarLayout_face:after{border-radius:6px;content:'';display:block;position:absolute;transition:background-color 250ms ease}.ScrollbarLayout_faceHorizontal{bottom:0;left:0;top:0}.ScrollbarLayout_faceHorizontal:after{bottom:4px;left:0;top:4px;width:100%}.ScrollbarLayout_faceVertical{left:0;right:0;top:0}.ScrollbarLayout_faceVertical:after{height:100%;left:4px;right:4px;top:0} \ No newline at end of file diff --git a/dist/fixed-data-table-style.css b/dist/fixed-data-table-style.css index 634ad612..22906652 100644 --- a/dist/fixed-data-table-style.css +++ b/dist/fixed-data-table-style.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.13 + * FixedDataTable v0.8.0 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -87,7 +87,7 @@ } .public_fixedDataTableCell_columnResizerKnob { - background-color: #0284ff; + background-color: #f57c00; } /** * Copyright (c) 2015, Facebook, Inc. @@ -105,7 +105,7 @@ * Column resizer line. */ .public_fixedDataTableColumnResizerLine_main { - border-color: #0284ff; + border-color: #f57c00; } /** * Copyright (c) 2015, Facebook, Inc. diff --git a/dist/fixed-data-table-style.min.css b/dist/fixed-data-table-style.min.css index e18a7fef..10e16467 100644 --- a/dist/fixed-data-table-style.min.css +++ b/dist/fixed-data-table-style.min.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.13 + * FixedDataTable v0.8.0 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -9,4 +9,4 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -.public_fixedDataTable_main,.public_fixedDataTable_header,.public_fixedDataTable_hasBottomBorder{border-color:#d3d3d3}.public_fixedDataTable_header .public_fixedDataTableCell_main{font-weight:700}.public_fixedDataTable_header,.public_fixedDataTable_header .public_fixedDataTableCell_main{background-color:#f6f7f8;background-image:linear-gradient(#fff,#efefef)}.public_fixedDataTable_footer .public_fixedDataTableCell_main{background-color:#f6f7f8;border-color:#d3d3d3}.public_fixedDataTable_topShadow{background:0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAECAYAAABP2FU6AAAAF0lEQVR4AWPUkNeSBhHCjJoK2twgFisAFagCCp3pJlAAAAAASUVORK5CYII=) repeat-x}.public_fixedDataTable_bottomShadow{background:0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAECAYAAABP2FU6AAAAHElEQVQI12MwNjZmZdAT1+Nm0JDWEGZQk1GTBgAWkwIeAEp52AAAAABJRU5ErkJggg==) repeat-x}.public_fixedDataTable_horizontalScrollbar .public_Scrollbar_mainHorizontal{background-color:#fff}.public_fixedDataTableCell_main{background-color:#fff;border-color:#d3d3d3}.public_fixedDataTableCell_highlighted{background-color:#f4f4f4}.public_fixedDataTableCell_cellContent{padding:8px}.public_fixedDataTableCell_columnResizerKnob{background-color:#0284ff}.public_fixedDataTableColumnResizerLine_main{border-color:#0284ff}.public_fixedDataTableRow_main{background-color:#fff}.public_fixedDataTableRow_highlighted,.public_fixedDataTableRow_highlighted .public_fixedDataTableCell_main{background-color:#f6f7f8}.public_fixedDataTableRow_fixedColumnsDivider{border-color:#d3d3d3}.public_fixedDataTableRow_columnsShadow{background:0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABCAYAAAD5PA/NAAAAFklEQVQIHWPSkNeSBmJhTQVtbiDNCgASagIIuJX8OgAAAABJRU5ErkJggg==) repeat-y}.public_Scrollbar_main.public_Scrollbar_mainActive,.public_Scrollbar_main:hover{background-color:rgba(255,255,255,.8)}.public_Scrollbar_mainOpaque,.public_Scrollbar_mainOpaque.public_Scrollbar_mainActive,.public_Scrollbar_mainOpaque:hover{background-color:#fff}.public_Scrollbar_face:after{background-color:#c2c2c2}.public_Scrollbar_main:hover .public_Scrollbar_face:after,.public_Scrollbar_mainActive .public_Scrollbar_face:after,.public_Scrollbar_faceActive:after{background-color:#7d7d7d} \ No newline at end of file +.public_fixedDataTable_main,.public_fixedDataTable_header,.public_fixedDataTable_hasBottomBorder{border-color:#d3d3d3}.public_fixedDataTable_header .public_fixedDataTableCell_main{font-weight:700}.public_fixedDataTable_header,.public_fixedDataTable_header .public_fixedDataTableCell_main{background-color:#f6f7f8;background-image:linear-gradient(#fff,#efefef)}.public_fixedDataTable_footer .public_fixedDataTableCell_main{background-color:#f6f7f8;border-color:#d3d3d3}.public_fixedDataTable_topShadow{background:0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAECAYAAABP2FU6AAAAF0lEQVR4AWPUkNeSBhHCjJoK2twgFisAFagCCp3pJlAAAAAASUVORK5CYII=) repeat-x}.public_fixedDataTable_bottomShadow{background:0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAECAYAAABP2FU6AAAAHElEQVQI12MwNjZmZdAT1+Nm0JDWEGZQk1GTBgAWkwIeAEp52AAAAABJRU5ErkJggg==) repeat-x}.public_fixedDataTable_horizontalScrollbar .public_Scrollbar_mainHorizontal{background-color:#fff}.public_fixedDataTableCell_main{background-color:#fff;border-color:#d3d3d3}.public_fixedDataTableCell_highlighted{background-color:#f4f4f4}.public_fixedDataTableCell_cellContent{padding:8px}.public_fixedDataTableCell_columnResizerKnob{background-color:#f57c00}.public_fixedDataTableColumnResizerLine_main{border-color:#f57c00}.public_fixedDataTableRow_main{background-color:#fff}.public_fixedDataTableRow_highlighted,.public_fixedDataTableRow_highlighted .public_fixedDataTableCell_main{background-color:#f6f7f8}.public_fixedDataTableRow_fixedColumnsDivider{border-color:#d3d3d3}.public_fixedDataTableRow_columnsShadow{background:0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABCAYAAAD5PA/NAAAAFklEQVQIHWPSkNeSBmJhTQVtbiDNCgASagIIuJX8OgAAAABJRU5ErkJggg==) repeat-y}.public_Scrollbar_main.public_Scrollbar_mainActive,.public_Scrollbar_main:hover{background-color:rgba(255,255,255,.8)}.public_Scrollbar_mainOpaque,.public_Scrollbar_mainOpaque.public_Scrollbar_mainActive,.public_Scrollbar_mainOpaque:hover{background-color:#fff}.public_Scrollbar_face:after{background-color:#c2c2c2}.public_Scrollbar_main:hover .public_Scrollbar_face:after,.public_Scrollbar_mainActive .public_Scrollbar_face:after,.public_Scrollbar_faceActive:after{background-color:#7d7d7d} \ No newline at end of file diff --git a/dist/fixed-data-table.css b/dist/fixed-data-table.css index 058de86e..181bb3b5 100644 --- a/dist/fixed-data-table.css +++ b/dist/fixed-data-table.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.13 + * FixedDataTable v0.8.0 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -94,18 +94,13 @@ } .fixedDataTableCellLayout_columnResizerContainer:hover { - cursor: ew-resize; -} - -.fixedDataTableCellLayout_columnResizerContainer:hover .fixedDataTableCellLayout_columnResizerKnob { - visibility: visible; + cursor: col-resize; } .fixedDataTableCellLayout_columnResizerKnob { position: absolute; right: 0px; - visibility: hidden; - width: 4px; + width: 1px; } /** * Copyright (c) 2015, Facebook, Inc. @@ -119,7 +114,7 @@ */ .fixedDataTableColumnResizerLineLayout_mouseArea { - cursor: ew-resize; + cursor: col-resize; position: absolute; right: -5px; width: 12px; @@ -412,7 +407,7 @@ body[dir="rtl"] .fixedDataTableColumnResizerLineLayout_main { } .public_fixedDataTableCell_columnResizerKnob { - background-color: #0284ff; + background-color: #f57c00; } /** * Copyright (c) 2015, Facebook, Inc. @@ -430,7 +425,7 @@ body[dir="rtl"] .fixedDataTableColumnResizerLineLayout_main { * Column resizer line. */ .public_fixedDataTableColumnResizerLine_main { - border-color: #0284ff; + border-color: #f57c00; } /** * Copyright (c) 2015, Facebook, Inc. diff --git a/dist/fixed-data-table.js b/dist/fixed-data-table.js index 929fa2ec..52eb3f8d 100644 --- a/dist/fixed-data-table.js +++ b/dist/fixed-data-table.js @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.13 + * FixedDataTable v0.8.0 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -233,11 +233,11 @@ return /******/ (function(modules) { // webpackBootstrap // New Table API var Table = __webpack_require__(36); - var Column = __webpack_require__(87); - var ColumnGroup = __webpack_require__(88); + var Column = __webpack_require__(86); + var ColumnGroup = __webpack_require__(87); // Transition Cell - var TransitionCell = __webpack_require__(89); + var TransitionCell = __webpack_require__(88); var NEXT_VERSION = '0.7.0'; var DOCUMENTATION_URL = 'https://fburl.com/FixedDataTable-v0.6'; @@ -1866,7 +1866,7 @@ return /******/ (function(modules) { // webpackBootstrap var joinClasses = __webpack_require__(79); var shallowEqual = __webpack_require__(85); var translateDOMPositionXY = __webpack_require__(61); - var throttle = __webpack_require__(86); + var throttle = __webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module \"lodash.throttle\""); e.code = 'MODULE_NOT_FOUND'; throw e; }())); var ReactChildren = React.Children; @@ -2132,7 +2132,9 @@ return /******/ (function(modules) { // webpackBootstrap } this._didScrollStop = debounceCore(this._didScrollStop, 200, this); - return this._calculateState(this.props); + return _extends({}, this._calculateState(this.props), { + isHoveringResizerKnob: false + }); }, componentWillMount: function componentWillMount() { @@ -2248,7 +2250,9 @@ return /******/ (function(modules) { // webpackBootstrap scrollLeft: state.scrollX, fixedColumns: state.groupHeaderFixedColumns, scrollableColumns: state.groupHeaderScrollableColumns, - onColumnResize: this._onColumnResize + onColumnResize: this._onColumnResize, + setHoverState: this.setHoverState, + isColumnResizing: state.isColumnResizing }); } @@ -2341,7 +2345,10 @@ return /******/ (function(modules) { // webpackBootstrap scrollLeft: state.scrollX, fixedColumns: state.headFixedColumns, scrollableColumns: state.headScrollableColumns, - onColumnResize: this._onColumnResize + onColumnResize: this._onColumnResize, + isHoveringResizerKnob: state.isHoveringResizerKnob, + setHoverState: this.setHoverState, + isColumnResizing: state.isColumnResizing }); var topShadow; @@ -2414,7 +2421,11 @@ return /******/ (function(modules) { // webpackBootstrap scrollableColumns: state.bodyScrollableColumns, showLastRowBorder: true, width: state.width, - rowPositionGetter: this._scrollHelper.getRowPosition + rowPositionGetter: this._scrollHelper.getRowPosition, + onColumnResize: this._onColumnResize, + isHoveringResizerKnob: state.isHoveringResizerKnob, + setHoverState: this.setHoverState, + isColumnResizing: state.isColumnResizing }); }, @@ -2795,6 +2806,10 @@ return /******/ (function(modules) { // webpackBootstrap this.props.onScrollEnd(this.state.scrollX, this.state.scrollY); } } + }, + + setHoverState: function setHoverState(hoverState) { + this.setState({ isHoveringResizerKnob: hoverState }); } }); @@ -6174,7 +6189,11 @@ return /******/ (function(modules) { // webpackBootstrap className: joinClasses(rowClassNameGetter(rowIndex), cx('public/fixedDataTable/bodyRow'), cx({ 'fixedDataTableLayout/hasBottomBorder': hasBottomBorder, 'public/fixedDataTable/hasBottomBorder': hasBottomBorder - })) + })), + onColumnResize: props.onColumnResize, + isHoveringResizerKnob: props.isHoveringResizerKnob, + setHoverState: props.setHoverState, + isColumnResizing: props.isColumnResizing }); } @@ -6859,6 +6878,8 @@ return /******/ (function(modules) { // webpackBootstrap zIndex: 2, columns: this.props.fixedColumns, onColumnResize: this.props.onColumnResize, + isHoveringResizerKnob: this.props.isHoveringResizerKnob, + setHoverState: this.props.setHoverState, rowHeight: this.props.height, rowIndex: this.props.index }); @@ -6976,7 +6997,8 @@ return /******/ (function(modules) { // webpackBootstrap var style = { width: this.props.width, height: this.props.height, - zIndex: this.props.zIndex ? this.props.zIndex : 0 + zIndex: this.props.zIndex ? this.props.zIndex : 0, + opacity: this.props.isColumnResizing ? .4 : 1 }; translateDOMPositionXY(style, 0, this.props.offsetTop); @@ -7144,6 +7166,8 @@ return /******/ (function(modules) { // webpackBootstrap maxWidth: columnProps.maxWidth, minWidth: columnProps.minWidth, onColumnResize: onColumnResize, + isHoveringResizerKnob: this.props.isHoveringResizerKnob, + setHoverState: this.props.setHoverState, rowIndex: rowIndex, columnKey: columnProps.columnKey, width: columnProps.width, @@ -7624,14 +7648,23 @@ return /******/ (function(modules) { // webpackBootstrap var columnResizerComponent; if (props.onColumnResize) { var columnResizerStyle = { - height: height + height: height, + opacity: props.isHoveringResizerKnob ? 1 : 0 }; + console.log('isHovering: ', props.isHoveringResizerKnob); + console.log('isHoveringResizerKnob: ', props.isHoveringResizerKnob); columnResizerComponent = React.createElement( 'div', { className: cx('fixedDataTableCellLayout/columnResizerContainer'), style: columnResizerStyle, - onMouseDown: this._onColumnResizerMouseDown }, + onMouseDown: this._onColumnResizerMouseDown, + onMouseEnter: function () { + return props.setHoverState(true); + }, + onMouseLeave: function () { + return props.setHoverState(false); + } }, React.createElement('div', { className: joinClasses(cx('fixedDataTableCellLayout/columnResizerKnob'), cx('public/fixedDataTableCell/columnResizerKnob')), style: columnResizerStyle @@ -8861,452 +8894,6 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }), /* 86 */ -/***/ (function(module, exports) { - - /* WEBPACK VAR INJECTION */(function(global) {/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - - /** Used as the `TypeError` message for "Functions" methods. */ - var FUNC_ERROR_TEXT = 'Expected a function'; - - /** Used as references for various `Number` constants. */ - var NAN = 0 / 0; - - /** `Object#toString` result references. */ - var symbolTag = '[object Symbol]'; - - /** Used to match leading and trailing whitespace. */ - var reTrim = /^\s+|\s+$/g; - - /** Used to detect bad signed hexadecimal string values. */ - var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; - - /** Used to detect binary string values. */ - var reIsBinary = /^0b[01]+$/i; - - /** Used to detect octal string values. */ - var reIsOctal = /^0o[0-7]+$/i; - - /** Built-in method references without a dependency on `root`. */ - var freeParseInt = parseInt; - - /** Detect free variable `global` from Node.js. */ - var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; - - /** Detect free variable `self`. */ - var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - - /** Used as a reference to the global object. */ - var root = freeGlobal || freeSelf || Function('return this')(); - - /** Used for built-in method references. */ - var objectProto = Object.prototype; - - /** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ - var objectToString = objectProto.toString; - - /* Built-in method references for those with the same name as other `lodash` methods. */ - var nativeMax = Math.max, - nativeMin = Math.min; - - /** - * Gets the timestamp of the number of milliseconds that have elapsed since - * the Unix epoch (1 January 1970 00:00:00 UTC). - * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Date - * @returns {number} Returns the timestamp. - * @example - * - * _.defer(function(stamp) { - * console.log(_.now() - stamp); - * }, _.now()); - * // => Logs the number of milliseconds it took for the deferred invocation. - */ - var now = function() { - return root.Date.now(); - }; - - /** - * Creates a debounced function that delays invoking `func` until after `wait` - * milliseconds have elapsed since the last time the debounced function was - * invoked. The debounced function comes with a `cancel` method to cancel - * delayed `func` invocations and a `flush` method to immediately invoke them. - * Provide `options` to indicate whether `func` should be invoked on the - * leading and/or trailing edge of the `wait` timeout. The `func` is invoked - * with the last arguments provided to the debounced function. Subsequent - * calls to the debounced function return the result of the last `func` - * invocation. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is - * invoked on the trailing edge of the timeout only if the debounced function - * is invoked more than once during the `wait` timeout. - * - * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred - * until to the next tick, similar to `setTimeout` with a timeout of `0`. - * - * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) - * for details over the differences between `_.debounce` and `_.throttle`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to debounce. - * @param {number} [wait=0] The number of milliseconds to delay. - * @param {Object} [options={}] The options object. - * @param {boolean} [options.leading=false] - * Specify invoking on the leading edge of the timeout. - * @param {number} [options.maxWait] - * The maximum time `func` is allowed to be delayed before it's invoked. - * @param {boolean} [options.trailing=true] - * Specify invoking on the trailing edge of the timeout. - * @returns {Function} Returns the new debounced function. - * @example - * - * // Avoid costly calculations while the window size is in flux. - * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); - * - * // Invoke `sendMail` when clicked, debouncing subsequent calls. - * jQuery(element).on('click', _.debounce(sendMail, 300, { - * 'leading': true, - * 'trailing': false - * })); - * - * // Ensure `batchLog` is invoked once after 1 second of debounced calls. - * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); - * var source = new EventSource('/stream'); - * jQuery(source).on('message', debounced); - * - * // Cancel the trailing debounced invocation. - * jQuery(window).on('popstate', debounced.cancel); - */ - function debounce(func, wait, options) { - var lastArgs, - lastThis, - maxWait, - result, - timerId, - lastCallTime, - lastInvokeTime = 0, - leading = false, - maxing = false, - trailing = true; - - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - wait = toNumber(wait) || 0; - if (isObject(options)) { - leading = !!options.leading; - maxing = 'maxWait' in options; - maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; - trailing = 'trailing' in options ? !!options.trailing : trailing; - } - - function invokeFunc(time) { - var args = lastArgs, - thisArg = lastThis; - - lastArgs = lastThis = undefined; - lastInvokeTime = time; - result = func.apply(thisArg, args); - return result; - } - - function leadingEdge(time) { - // Reset any `maxWait` timer. - lastInvokeTime = time; - // Start the timer for the trailing edge. - timerId = setTimeout(timerExpired, wait); - // Invoke the leading edge. - return leading ? invokeFunc(time) : result; - } - - function remainingWait(time) { - var timeSinceLastCall = time - lastCallTime, - timeSinceLastInvoke = time - lastInvokeTime, - result = wait - timeSinceLastCall; - - return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result; - } - - function shouldInvoke(time) { - var timeSinceLastCall = time - lastCallTime, - timeSinceLastInvoke = time - lastInvokeTime; - - // Either this is the first call, activity has stopped and we're at the - // trailing edge, the system time has gone backwards and we're treating - // it as the trailing edge, or we've hit the `maxWait` limit. - return (lastCallTime === undefined || (timeSinceLastCall >= wait) || - (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); - } - - function timerExpired() { - var time = now(); - if (shouldInvoke(time)) { - return trailingEdge(time); - } - // Restart the timer. - timerId = setTimeout(timerExpired, remainingWait(time)); - } - - function trailingEdge(time) { - timerId = undefined; - - // Only invoke if we have `lastArgs` which means `func` has been - // debounced at least once. - if (trailing && lastArgs) { - return invokeFunc(time); - } - lastArgs = lastThis = undefined; - return result; - } - - function cancel() { - if (timerId !== undefined) { - clearTimeout(timerId); - } - lastInvokeTime = 0; - lastArgs = lastCallTime = lastThis = timerId = undefined; - } - - function flush() { - return timerId === undefined ? result : trailingEdge(now()); - } - - function debounced() { - var time = now(), - isInvoking = shouldInvoke(time); - - lastArgs = arguments; - lastThis = this; - lastCallTime = time; - - if (isInvoking) { - if (timerId === undefined) { - return leadingEdge(lastCallTime); - } - if (maxing) { - // Handle invocations in a tight loop. - timerId = setTimeout(timerExpired, wait); - return invokeFunc(lastCallTime); - } - } - if (timerId === undefined) { - timerId = setTimeout(timerExpired, wait); - } - return result; - } - debounced.cancel = cancel; - debounced.flush = flush; - return debounced; - } - - /** - * Creates a throttled function that only invokes `func` at most once per - * every `wait` milliseconds. The throttled function comes with a `cancel` - * method to cancel delayed `func` invocations and a `flush` method to - * immediately invoke them. Provide `options` to indicate whether `func` - * should be invoked on the leading and/or trailing edge of the `wait` - * timeout. The `func` is invoked with the last arguments provided to the - * throttled function. Subsequent calls to the throttled function return the - * result of the last `func` invocation. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is - * invoked on the trailing edge of the timeout only if the throttled function - * is invoked more than once during the `wait` timeout. - * - * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred - * until to the next tick, similar to `setTimeout` with a timeout of `0`. - * - * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) - * for details over the differences between `_.throttle` and `_.debounce`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to throttle. - * @param {number} [wait=0] The number of milliseconds to throttle invocations to. - * @param {Object} [options={}] The options object. - * @param {boolean} [options.leading=true] - * Specify invoking on the leading edge of the timeout. - * @param {boolean} [options.trailing=true] - * Specify invoking on the trailing edge of the timeout. - * @returns {Function} Returns the new throttled function. - * @example - * - * // Avoid excessively updating the position while scrolling. - * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); - * - * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. - * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); - * jQuery(element).on('click', throttled); - * - * // Cancel the trailing throttled invocation. - * jQuery(window).on('popstate', throttled.cancel); - */ - function throttle(func, wait, options) { - var leading = true, - trailing = true; - - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - if (isObject(options)) { - leading = 'leading' in options ? !!options.leading : leading; - trailing = 'trailing' in options ? !!options.trailing : trailing; - } - return debounce(func, wait, { - 'leading': leading, - 'maxWait': wait, - 'trailing': trailing - }); - } - - /** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ - function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); - } - - /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ - function isObjectLike(value) { - return !!value && typeof value == 'object'; - } - - /** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ - function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag); - } - - /** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3.2); - * // => 3.2 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3.2'); - * // => 3.2 - */ - function toNumber(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol(value)) { - return NAN; - } - if (isObject(value)) { - var other = typeof value.valueOf == 'function' ? value.valueOf() : value; - value = isObject(other) ? (other + '') : other; - } - if (typeof value != 'string') { - return value === 0 ? value : +value; - } - value = value.replace(reTrim, ''); - var isBinary = reIsBinary.test(value); - return (isBinary || reIsOctal.test(value)) - ? freeParseInt(value.slice(2), isBinary ? 2 : 8) - : (reIsBadHex.test(value) ? NAN : +value); - } - - module.exports = throttle; - - /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) - -/***/ }), -/* 87 */ /***/ (function(module, exports, __webpack_require__) { 'use strict'; @@ -9511,7 +9098,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = FixedDataTableColumn; /***/ }), -/* 88 */ +/* 87 */ /***/ (function(module, exports, __webpack_require__) { 'use strict'; @@ -9614,7 +9201,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = FixedDataTableColumnGroup; /***/ }), -/* 89 */ +/* 88 */ /***/ (function(module, exports, __webpack_require__) { 'use strict'; diff --git a/dist/fixed-data-table.min.css b/dist/fixed-data-table.min.css index 86f5495b..855b25a8 100644 --- a/dist/fixed-data-table.min.css +++ b/dist/fixed-data-table.min.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.13 + * FixedDataTable v0.8.0 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -9,4 +9,4 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -.fixedDataTableCellGroupLayout_cellGroup{backface-visibility:hidden;left:0;overflow:hidden;position:absolute;top:0;white-space:nowrap}.fixedDataTableCellGroupLayout_cellGroup>.public_fixedDataTableCell_main{display:inline-block;vertical-align:top;white-space:normal}.fixedDataTableCellGroupLayout_cellGroupWrapper{position:absolute;top:0}.fixedDataTableCellLayout_main{border-right-style:solid;border-width:0 1px 0 0;box-sizing:border-box;display:block;overflow:hidden;position:absolute;white-space:normal}.fixedDataTableCellLayout_lastChild{border-width:0 1px 1px 0}.fixedDataTableCellLayout_alignRight{text-align:right}.fixedDataTableCellLayout_alignCenter{text-align:center}.fixedDataTableCellLayout_wrap1{display:table}.fixedDataTableCellLayout_wrap2{display:table-row}.fixedDataTableCellLayout_wrap3{display:table-cell;vertical-align:middle}.fixedDataTableCellLayout_columnResizerContainer{position:absolute;right:0;width:6px;z-index:1}.fixedDataTableCellLayout_columnResizerContainer:hover{cursor:ew-resize}.fixedDataTableCellLayout_columnResizerContainer:hover .fixedDataTableCellLayout_columnResizerKnob{visibility:visible}.fixedDataTableCellLayout_columnResizerKnob{position:absolute;right:0;visibility:hidden;width:4px}.fixedDataTableColumnResizerLineLayout_mouseArea{cursor:ew-resize;position:absolute;right:-5px;width:12px}.fixedDataTableColumnResizerLineLayout_main{border-right-style:solid;border-right-width:1px;box-sizing:border-box;position:absolute;z-index:10}body[dir="rtl"] .fixedDataTableColumnResizerLineLayout_main,.fixedDataTableColumnResizerLineLayout_hiddenElem{display:none!important}.fixedDataTableLayout_main{border-style:solid;border-width:1px;box-sizing:border-box;overflow:hidden;position:relative}.fixedDataTableLayout_header,.fixedDataTableLayout_hasBottomBorder{border-bottom-style:solid;border-bottom-width:1px}.fixedDataTableLayout_footer .public_fixedDataTableCell_main{border-top-style:solid;border-top-width:1px}.fixedDataTableLayout_topShadow,.fixedDataTableLayout_bottomShadow{height:4px;left:0;position:absolute;right:0;z-index:1}.fixedDataTableLayout_bottomShadow{margin-top:-4px}.fixedDataTableLayout_rowsContainer{overflow:hidden;position:relative}.fixedDataTableLayout_horizontalScrollbar{bottom:0;position:absolute}.fixedDataTableRowLayout_main{box-sizing:border-box;overflow:hidden;position:absolute;top:0}.fixedDataTableRowLayout_body{left:0;position:absolute;top:0}.fixedDataTableRowLayout_fixedColumnsDivider{backface-visibility:hidden;border-left-style:solid;border-left-width:1px;left:0;position:absolute;top:0;width:0}.fixedDataTableRowLayout_columnsShadow{width:4px}.fixedDataTableRowLayout_rowWrapper{position:absolute;top:0}.ScrollbarLayout_main{box-sizing:border-box;outline:none;overflow:hidden;position:absolute;transition-duration:250ms;transition-timing-function:ease;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ScrollbarLayout_mainVertical{bottom:0;right:0;top:0;transition-property:background-color width;width:15px}.ScrollbarLayout_mainVertical.public_Scrollbar_mainActive,.ScrollbarLayout_mainVertical:hover{width:17px}.ScrollbarLayout_mainHorizontal{bottom:0;height:15px;left:0;transition-property:background-color height}.ScrollbarLayout_mainHorizontal.public_Scrollbar_mainActive,.ScrollbarLayout_mainHorizontal:hover{height:17px}.ScrollbarLayout_face{left:0;overflow:hidden;position:absolute;z-index:1}.ScrollbarLayout_face:after{border-radius:6px;content:'';display:block;position:absolute;transition:background-color 250ms ease}.ScrollbarLayout_faceHorizontal{bottom:0;left:0;top:0}.ScrollbarLayout_faceHorizontal:after{bottom:4px;left:0;top:4px;width:100%}.ScrollbarLayout_faceVertical{left:0;right:0;top:0}.ScrollbarLayout_faceVertical:after{height:100%;left:4px;right:4px;top:0}.public_fixedDataTable_main,.public_fixedDataTable_header,.public_fixedDataTable_hasBottomBorder{border-color:#d3d3d3}.public_fixedDataTable_header .public_fixedDataTableCell_main{font-weight:700}.public_fixedDataTable_header,.public_fixedDataTable_header .public_fixedDataTableCell_main{background-color:#f6f7f8;background-image:linear-gradient(#fff,#efefef)}.public_fixedDataTable_footer .public_fixedDataTableCell_main{background-color:#f6f7f8;border-color:#d3d3d3}.public_fixedDataTable_topShadow{background:0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAECAYAAABP2FU6AAAAF0lEQVR4AWPUkNeSBhHCjJoK2twgFisAFagCCp3pJlAAAAAASUVORK5CYII=) repeat-x}.public_fixedDataTable_bottomShadow{background:0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAECAYAAABP2FU6AAAAHElEQVQI12MwNjZmZdAT1+Nm0JDWEGZQk1GTBgAWkwIeAEp52AAAAABJRU5ErkJggg==) repeat-x}.public_fixedDataTable_horizontalScrollbar .public_Scrollbar_mainHorizontal{background-color:#fff}.public_fixedDataTableCell_main{background-color:#fff;border-color:#d3d3d3}.public_fixedDataTableCell_highlighted{background-color:#f4f4f4}.public_fixedDataTableCell_cellContent{padding:8px}.public_fixedDataTableCell_columnResizerKnob{background-color:#0284ff}.public_fixedDataTableColumnResizerLine_main{border-color:#0284ff}.public_fixedDataTableRow_main{background-color:#fff}.public_fixedDataTableRow_highlighted,.public_fixedDataTableRow_highlighted .public_fixedDataTableCell_main{background-color:#f6f7f8}.public_fixedDataTableRow_fixedColumnsDivider{border-color:#d3d3d3}.public_fixedDataTableRow_columnsShadow{background:0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABCAYAAAD5PA/NAAAAFklEQVQIHWPSkNeSBmJhTQVtbiDNCgASagIIuJX8OgAAAABJRU5ErkJggg==) repeat-y}.public_Scrollbar_main.public_Scrollbar_mainActive,.public_Scrollbar_main:hover{background-color:rgba(255,255,255,.8)}.public_Scrollbar_mainOpaque,.public_Scrollbar_mainOpaque.public_Scrollbar_mainActive,.public_Scrollbar_mainOpaque:hover{background-color:#fff}.public_Scrollbar_face:after{background-color:#c2c2c2}.public_Scrollbar_main:hover .public_Scrollbar_face:after,.public_Scrollbar_mainActive .public_Scrollbar_face:after,.public_Scrollbar_faceActive:after{background-color:#7d7d7d} \ No newline at end of file +.fixedDataTableCellGroupLayout_cellGroup{backface-visibility:hidden;left:0;overflow:hidden;position:absolute;top:0;white-space:nowrap}.fixedDataTableCellGroupLayout_cellGroup>.public_fixedDataTableCell_main{display:inline-block;vertical-align:top;white-space:normal}.fixedDataTableCellGroupLayout_cellGroupWrapper{position:absolute;top:0}.fixedDataTableCellLayout_main{border-right-style:solid;border-width:0 1px 0 0;box-sizing:border-box;display:block;overflow:hidden;position:absolute;white-space:normal}.fixedDataTableCellLayout_lastChild{border-width:0 1px 1px 0}.fixedDataTableCellLayout_alignRight{text-align:right}.fixedDataTableCellLayout_alignCenter{text-align:center}.fixedDataTableCellLayout_wrap1{display:table}.fixedDataTableCellLayout_wrap2{display:table-row}.fixedDataTableCellLayout_wrap3{display:table-cell;vertical-align:middle}.fixedDataTableCellLayout_columnResizerContainer{position:absolute;right:0;width:6px;z-index:1}.fixedDataTableCellLayout_columnResizerContainer:hover{cursor:col-resize}.fixedDataTableCellLayout_columnResizerKnob{position:absolute;right:0;width:1px}.fixedDataTableColumnResizerLineLayout_mouseArea{cursor:col-resize;position:absolute;right:-5px;width:12px}.fixedDataTableColumnResizerLineLayout_main{border-right-style:solid;border-right-width:1px;box-sizing:border-box;position:absolute;z-index:10}body[dir="rtl"] .fixedDataTableColumnResizerLineLayout_main,.fixedDataTableColumnResizerLineLayout_hiddenElem{display:none!important}.fixedDataTableLayout_main{border-style:solid;border-width:1px;box-sizing:border-box;overflow:hidden;position:relative}.fixedDataTableLayout_header,.fixedDataTableLayout_hasBottomBorder{border-bottom-style:solid;border-bottom-width:1px}.fixedDataTableLayout_footer .public_fixedDataTableCell_main{border-top-style:solid;border-top-width:1px}.fixedDataTableLayout_topShadow,.fixedDataTableLayout_bottomShadow{height:4px;left:0;position:absolute;right:0;z-index:1}.fixedDataTableLayout_bottomShadow{margin-top:-4px}.fixedDataTableLayout_rowsContainer{overflow:hidden;position:relative}.fixedDataTableLayout_horizontalScrollbar{bottom:0;position:absolute}.fixedDataTableRowLayout_main{box-sizing:border-box;overflow:hidden;position:absolute;top:0}.fixedDataTableRowLayout_body{left:0;position:absolute;top:0}.fixedDataTableRowLayout_fixedColumnsDivider{backface-visibility:hidden;border-left-style:solid;border-left-width:1px;left:0;position:absolute;top:0;width:0}.fixedDataTableRowLayout_columnsShadow{width:4px}.fixedDataTableRowLayout_rowWrapper{position:absolute;top:0}.ScrollbarLayout_main{box-sizing:border-box;outline:none;overflow:hidden;position:absolute;transition-duration:250ms;transition-timing-function:ease;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ScrollbarLayout_mainVertical{bottom:0;right:0;top:0;transition-property:background-color width;width:15px}.ScrollbarLayout_mainVertical.public_Scrollbar_mainActive,.ScrollbarLayout_mainVertical:hover{width:17px}.ScrollbarLayout_mainHorizontal{bottom:0;height:15px;left:0;transition-property:background-color height}.ScrollbarLayout_mainHorizontal.public_Scrollbar_mainActive,.ScrollbarLayout_mainHorizontal:hover{height:17px}.ScrollbarLayout_face{left:0;overflow:hidden;position:absolute;z-index:1}.ScrollbarLayout_face:after{border-radius:6px;content:'';display:block;position:absolute;transition:background-color 250ms ease}.ScrollbarLayout_faceHorizontal{bottom:0;left:0;top:0}.ScrollbarLayout_faceHorizontal:after{bottom:4px;left:0;top:4px;width:100%}.ScrollbarLayout_faceVertical{left:0;right:0;top:0}.ScrollbarLayout_faceVertical:after{height:100%;left:4px;right:4px;top:0}.public_fixedDataTable_main,.public_fixedDataTable_header,.public_fixedDataTable_hasBottomBorder{border-color:#d3d3d3}.public_fixedDataTable_header .public_fixedDataTableCell_main{font-weight:700}.public_fixedDataTable_header,.public_fixedDataTable_header .public_fixedDataTableCell_main{background-color:#f6f7f8;background-image:linear-gradient(#fff,#efefef)}.public_fixedDataTable_footer .public_fixedDataTableCell_main{background-color:#f6f7f8;border-color:#d3d3d3}.public_fixedDataTable_topShadow{background:0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAECAYAAABP2FU6AAAAF0lEQVR4AWPUkNeSBhHCjJoK2twgFisAFagCCp3pJlAAAAAASUVORK5CYII=) repeat-x}.public_fixedDataTable_bottomShadow{background:0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAECAYAAABP2FU6AAAAHElEQVQI12MwNjZmZdAT1+Nm0JDWEGZQk1GTBgAWkwIeAEp52AAAAABJRU5ErkJggg==) repeat-x}.public_fixedDataTable_horizontalScrollbar .public_Scrollbar_mainHorizontal{background-color:#fff}.public_fixedDataTableCell_main{background-color:#fff;border-color:#d3d3d3}.public_fixedDataTableCell_highlighted{background-color:#f4f4f4}.public_fixedDataTableCell_cellContent{padding:8px}.public_fixedDataTableCell_columnResizerKnob{background-color:#f57c00}.public_fixedDataTableColumnResizerLine_main{border-color:#f57c00}.public_fixedDataTableRow_main{background-color:#fff}.public_fixedDataTableRow_highlighted,.public_fixedDataTableRow_highlighted .public_fixedDataTableCell_main{background-color:#f6f7f8}.public_fixedDataTableRow_fixedColumnsDivider{border-color:#d3d3d3}.public_fixedDataTableRow_columnsShadow{background:0 0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABCAYAAAD5PA/NAAAAFklEQVQIHWPSkNeSBmJhTQVtbiDNCgASagIIuJX8OgAAAABJRU5ErkJggg==) repeat-y}.public_Scrollbar_main.public_Scrollbar_mainActive,.public_Scrollbar_main:hover{background-color:rgba(255,255,255,.8)}.public_Scrollbar_mainOpaque,.public_Scrollbar_mainOpaque.public_Scrollbar_mainActive,.public_Scrollbar_mainOpaque:hover{background-color:#fff}.public_Scrollbar_face:after{background-color:#c2c2c2}.public_Scrollbar_main:hover .public_Scrollbar_face:after,.public_Scrollbar_mainActive .public_Scrollbar_face:after,.public_Scrollbar_faceActive:after{background-color:#7d7d7d} \ No newline at end of file diff --git a/dist/fixed-data-table.min.js b/dist/fixed-data-table.min.js index 149dcb4f..1a2642ef 100644 --- a/dist/fixed-data-table.min.js +++ b/dist/fixed-data-table.min.js @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.7.13 + * FixedDataTable v0.8.0 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -9,7 +9,7 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.FixedDataTable=t(require("react"),require("react-dom")):e.FixedDataTable=t(e.React,e.ReactDOM)}(this,function(e,t){return function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){o(1),o(5),o(7),o(9),o(11),o(13),o(15),o(17),o(19),o(21),o(23),e.exports=o(25)},function(e,t){},,,,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t,o){"use strict";var n=o(26),r=o(78),i=o(76),s=o(75),a={Cell:r,Column:i,ColumnGroup:s,Table:n};a.version="0.7.0",e.exports=a},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e,t){}var s=Object.assign||function(e){for(var t=1;t1)for(var o=1;o0||e>=0&&this.state.scrollX0||e>=0&&this.state.scrollYn?n:this.state.height>n&&this.props.ownerHeight?Math.max(n,this.props.ownerHeight):this.state.height+this.state.maxScrollY,e!==this._contentHeight&&this.props.onContentHeightChange&&this.props.onContentHeightChange(e),this._contentHeight=e},componentDidMount:function(){this._reportContentHeight(),this._isMounted=!0},componentWillReceiveProps:function(e){var t=e.scrollToRow;void 0!==t&&null!==t&&(this._rowToScrollTo=t);var o=e.scrollToColumn;void 0!==o&&null!==o&&(this._columnToScrollTo=o);var n=e.overflowX,r=e.overflowY;n===this.props.overflowX&&r===this.props.overflowY||(this._wheelHandler=new l(this._onWheel,"hidden"!==n,"hidden"!==r)),this.props.ownerHeight===e.ownerHeight&&this.props.scrollTop===e.scrollTop||this._didScrollStart(),this._didScroll(),this._didScrollStop(),this.setState(this._calculateState(e,this.state))},componentDidUpdate:function(){this._reportContentHeight()},render:function(){var e,t=this.state,o=this.props;t.useGroupHeader&&(e=i.createElement(f,{key:"group_header",isScrolling:this._isScrolling,className:y(m("fixedDataTableLayout/header"),m("public/fixedDataTable/header")),width:t.width,height:t.groupHeaderHeight,index:0,zIndex:1,offsetTop:0,scrollLeft:t.scrollX,fixedColumns:t.groupHeaderFixedColumns,scrollableColumns:t.groupHeaderScrollableColumns,onColumnResize:this._onColumnResize}));var r=this.state.maxScrollY,s=t.maxScrollX>0&&"hidden"!==t.overflowX,a=r>0&&"hidden"!==t.overflowY,l=s?u.SIZE:0,c=t.height-l-2*E-t.footerHeight,p=t.useGroupHeader?t.groupHeaderHeight:0,d=p+t.headerHeight;c-=d;var v=0,_=null!=o.maxHeight?d+t.bodyHeight:d+c,g=_+t.footerHeight;void 0!==o.ownerHeight&&o.ownerHeightt.ownerHeight||t.scrollY or "),o.push(e))});var r=!1;o.length&&o[0].type.__TableColumnGroup__&&(r=!0),t&&(void 0!==e.width&&e.width!==t.width||void 0!==e.height&&e.height!==t.height||void 0!==e.maxWidth&&e.maxWidth!==t.maxWidth||void 0!==e.maxHeight&&e.maxHeight!==t.maxHeight)&&(t=null);var i,s,a=t&&t.firstRowIndex||0,l=t&&t.firstRowOffset||0;i=t&&"hidden"!==e.overflowX?t.scrollX:e.scrollLeft,t&&"hidden"!==e.overflowY?s=t.scrollY:(f=this._scrollHelper.scrollTo(e.scrollTop),a=f.index,l=f.offset,s=f.position),void 0!==this._rowToScrollTo&&(f=this._scrollHelper.scrollRowIntoView(this._rowToScrollTo),a=f.index,l=f.offset,s=f.position,delete this._rowToScrollTo);var c=r?e.groupHeaderHeight:0;if(t&&e.rowsCount!==t.rowsCount){var h=(void 0===e.height?e.maxHeight:e.height)-(e.headerHeight||0)-(e.footerHeight||0)-(e.groupHeaderHeight||0);this._scrollHelper=new p(e.rowsCount,e.rowHeight,h,e.rowHeightGetter);var f=this._scrollHelper.scrollToRow(a,l);a=f.index,l=f.offset,s=f.position}else t&&e.rowHeightGetter!==t.rowHeightGetter&&this._scrollHelper.setRowHeightGetter(e.rowHeightGetter);var m;m=e.isColumnResizing?t&&t.columnResizingData:R;var v,_;if(r){var y=d.adjustColumnGroupWidths(o,e.width);v=y.columns,_=y.columnGroups}else v=d.adjustColumnWidths(o,e.width);var w=this._populateColumnsAndColumnData(v,_,t);if(void 0!==this._columnToScrollTo){var b=w.bodyFixedColumns.length;if(this._columnToScrollTo>=b){var x,T,D=0;for(x=0;xO&&(i=O)}delete this._columnToScrollTo}var k=void 0===e.height,P=Math.round(k?e.maxHeight:e.height),I=e.footerHeight+e.headerHeight+c+2*E,z=P-I,j=this._scrollHelper.getContentHeight(),A=j+I,F=d.getTotalWidth(v),L=F>e.width&&"hidden"!==e.overflowX;L&&(z-=u.SIZE,A+=u.SIZE,I+=u.SIZE);var G=Math.max(0,F-e.width),W=Math.max(0,j-z);i=Math.min(i,G),s=Math.min(s,W),W||(k&&(P=A),z=A-I),this._scrollHelper.setViewportHeight(z);var V=n({isColumnResizing:t&&t.isColumnResizing},w,e,{columns:v,columnGroups:_,columnResizingData:m,firstRowIndex:a,firstRowOffset:l,horizontalScrollbarVisible:L,maxScrollX:G,maxScrollY:W,reservedHeight:I,scrollContentHeight:j,scrollX:i,scrollY:s,bodyHeight:z,height:P,groupHeaderHeight:c,useGroupHeader:r});return V},_selectColumnElement:function(e,t){for(var o=[],n=0;nMath.abs(e)&&"hidden"!==this.props.overflowY){var n=this._scrollHelper.scrollBy(Math.round(t)),r=Math.max(0,n.contentHeight-this.state.bodyHeight);this.setState({firstRowIndex:n.index,firstRowOffset:n.offset,scrollY:n.position,scrollContentHeight:n.contentHeight,maxScrollY:r})}else e&&"hidden"!==this.props.overflowX&&(o+=e,o=o<0?0:o,o=o>this.state.maxScrollX?this.state.maxScrollX:o,this.setState({scrollX:o}));this._didScroll(),this._didScrollStop()}},_onHorizontalScroll:function(e){this._isMounted&&e!==this.state.scrollX&&(this._isScrolling||this._didScrollStart(),this.setState({scrollX:e}),this._didScroll(),this._didScrollStop())},_onVerticalScroll:function(e){if(this._isMounted&&e!==this.state.scrollY){this._isScrolling||this._didScrollStart();var t=this._scrollHelper.scrollTo(Math.round(e));this.setState({firstRowIndex:t.index,firstRowOffset:t.offset,scrollY:t.position,scrollContentHeight:t.contentHeight}),this._didScroll(),this._didScrollStop()}},_didScrollStart:function(){this._isMounted&&!this._isScrolling&&(this._isScrolling=!0,this.props.onScrollStart&&this.props.onScrollStart(this.state.scrollX,this.state.scrollY))},_didScroll:function(){this._isMounted&&this._isScrolling&&this.props.onScroll&&this.props.onScroll(this.state.scrollX,this.state.scrollY)},_didScrollStop:function(){this._isMounted&&this._isScrolling&&(this._isScrolling=!1,this.setState({redraw:!0}),this.props.onScrollEnd&&this.props.onScrollEnd(this.state.scrollX,this.state.scrollY))}}),H=s({displayName:"HorizontalScrollbar",mixins:[a],propTypes:{contentSize:r.number.isRequired,offset:r.number.isRequired,onScroll:r.func.isRequired,position:r.number.isRequired,size:r.number.isRequired},render:function(){var e=n({height:u.SIZE,width:this.props.size},this.props.horizontalScrollbarStyle),t={height:u.SIZE,position:"absolute",overflow:"hidden",width:this.props.size};return b(t,0,this.props.offset),i.createElement("div",{className:y(m("fixedDataTableLayout/horizontalScrollbar"),m("public/fixedDataTable/horizontalScrollbar")),style:e},i.createElement("div",{style:t},i.createElement(u,n({},this.props,{isOpaque:!0,orientation:"horizontal",offset:void 0}))))}});e.exports=O},function(e,t,o){"use strict";var n=o(35),r=o(38);if("undefined"==typeof n)throw Error("create-react-class could not find the React object. If you are using script tags, make sure that React is being loaded before create-react-class.");var i=(new n.Component).updater;e.exports=r(n.Component,n.isValidElement,i)},function(e,t,o){(function(t){"use strict";function n(e){return e}function r(e,o,r){function h(e,o,n){for(var r in o)o.hasOwnProperty(r)&&"production"!==t.env.NODE_ENV&&l("function"==typeof o[r],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",e.displayName||"ReactClass",u[n],r); -}function f(e,t){var o=x.hasOwnProperty(t)?x[t]:null;D.hasOwnProperty(t)&&a("OVERRIDE_BASE"===o,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&a("DEFINE_MANY"===o||"DEFINE_MANY_MERGED"===o,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function p(e,n){if(n){a("function"!=typeof n,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),a(!o(n),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=e.prototype,i=r.__reactAutoBindPairs;n.hasOwnProperty(c)&&R.mixins(e,n.mixins);for(var s in n)if(n.hasOwnProperty(s)&&s!==c){var u=n[s],h=r.hasOwnProperty(s);if(f(h,s),R.hasOwnProperty(s))R[s](e,u);else{var p=x.hasOwnProperty(s),d="function"==typeof u,m=d&&!p&&!h&&n.autobind!==!1;if(m)i.push(s,u),r[s]=u;else if(h){var g=x[s];a(p&&("DEFINE_MANY_MERGED"===g||"DEFINE_MANY"===g),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",g,s),"DEFINE_MANY_MERGED"===g?r[s]=v(r[s],u):"DEFINE_MANY"===g&&(r[s]=_(r[s],u))}else r[s]=u,"production"!==t.env.NODE_ENV&&"function"==typeof u&&n.displayName&&(r[s].displayName=n.displayName+"_"+s)}}}else if("production"!==t.env.NODE_ENV){var y=typeof n,w="object"===y&&null!==n;"production"!==t.env.NODE_ENV&&l(w,"%s: You're attempting to include a mixin that is either null or not an object. Check the mixins included by the component, as well as any mixins they include themselves. Expected object but got %s.",e.displayName||"ReactClass",null===n?null:y)}}function d(e,t){if(t)for(var o in t){var n=t[o];if(t.hasOwnProperty(o)){var r=o in R;a(!r,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',o);var i=o in e;if(i){var s=C.hasOwnProperty(o)?C[o]:null;return a("DEFINE_MANY_MERGED"===s,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",o),void(e[o]=v(e[o],n))}e[o]=n}}}function m(e,t){a(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var o in t)t.hasOwnProperty(o)&&(a(void 0===e[o],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",o),e[o]=t[o]);return e}function v(e,t){return function(){var o=e.apply(this,arguments),n=t.apply(this,arguments);if(null==o)return n;if(null==n)return o;var r={};return m(r,o),m(r,n),r}}function _(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function g(e,o){var n=o.bind(e);if("production"!==t.env.NODE_ENV){n.__reactBoundContext=e,n.__reactBoundMethod=o,n.__reactBoundArguments=null;var r=e.constructor.displayName,i=n.bind;n.bind=function(s){for(var a=arguments.length,u=Array(a>1?a-1:0),c=1;c1?t-1:0),n=1;n2?o-2:0),r=2;rn},ie64:function(){return y.ie()&&p},firefox:function(){return o()||r},opera:function(){return o()||i},webkit:function(){return o()||s},safari:function(){return y.webkit()},chrome:function(){return o()||a},windows:function(){return o()||c},osx:function(){return o()||u},linux:function(){return o()||h},iphone:function(){return o()||d},mobile:function(){return o()||d||m||f||_},nativeApp:function(){return o()||v},android:function(){return o()||f},ipad:function(){return o()||m}};e.exports=y},function(e,t,o){"use strict";function n(e,t){if(!i.canUseDOM||t&&!("addEventListener"in document))return!1;var o="on"+e,n=o in document;if(!n){var s=document.createElement("div");s.setAttribute(o,"return;"),n="function"==typeof s[o]}return!n&&r&&"wheel"===e&&(n=document.implementation.hasFeature("Events.wheel","3.0")),n}var r,i=o(49);i.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),e.exports=n},function(e,t){"use strict";var o=!("undefined"==typeof window||!window.document||!window.document.createElement),n={canUseDOM:o,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:o&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:o&&!!window.screen,isInWorker:!o};e.exports=n},function(e,t,o){(function(t){"use strict";var n=o(45),r=o(51),i=0,s=r||function(e){var o=Date.now(),n=Math.max(0,16-(o-i));return i=o+n,t.setTimeout(function(){e(Date.now())},n)};s(n),e.exports=s}).call(t,function(){return this}())},function(e,t){(function(t){"use strict";var o=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame;e.exports=o}).call(t,function(){return this}())},function(e,t,o){"use strict";var n=o(53),r=o(56),i=o(27),s=o(34),a=o(37),l=o(57),u=o(43),c=o(44),h=o(59),f=o(60),p=o(45),d=o(61),m={position:0,scrollable:!1},v=parseInt(h("scrollbar-face-margin"),10),_=2*v,g=30,y=40,w=null,b=a({displayName:"Scrollbar",mixins:[u],propTypes:{contentSize:i.number.isRequired,defaultPosition:i.number,isOpaque:i.bool,orientation:i.oneOf(["vertical","horizontal"]),onScroll:i.func,position:i.number,size:i.number.isRequired,trackColor:i.oneOf(["gray"]),zIndex:i.number,verticalTop:i.number},getInitialState:function(){var e=this.props;return this._calculateState(e.position||e.defaultPosition||0,e.size,e.contentSize,e.orientation)},componentWillReceiveProps:function(e){var t=e.position;void 0===t?this._setNextState(this._calculateState(this.state.position,e.size,e.contentSize,e.orientation)):this._setNextState(this._calculateState(t,e.size,e.contentSize,e.orientation),e)},getDefaultProps:function(){return{defaultPosition:0,isOpaque:!1,onScroll:p,orientation:"vertical",zIndex:99}},render:function(){if(!this.state.scrollable)return null;var e,t,o=this.props.size,n=this.state.isHorizontal,r=!n,i=this.state.focused||this.state.isDragging,a=this.state.faceSize,l=this.props.isOpaque,u=this.props.verticalTop||0,c=f({"ScrollbarLayout/main":!0,"ScrollbarLayout/mainVertical":r,"ScrollbarLayout/mainHorizontal":n,"public/Scrollbar/main":!0,"public/Scrollbar/mainOpaque":l,"public/Scrollbar/mainActive":i}),p=f({"ScrollbarLayout/face":!0,"ScrollbarLayout/faceHorizontal":n,"ScrollbarLayout/faceVertical":r,"public/Scrollbar/faceActive":i,"public/Scrollbar/face":!0}),m=this.state.position*this.state.scale+v;return n?(e={width:o},t={width:a-_},d(t,m,0)):(e={top:u,height:o},t={height:a-_},d(t,0,m)),e.zIndex=this.props.zIndex,"gray"===this.props.trackColor&&(e.backgroundColor=h("fbui-desktop-background-light")),s.createElement("div",{onFocus:this._onFocus,onBlur:this._onBlur,onKeyDown:this._onKeyDown,onMouseDown:this._onMouseDown,onWheel:this._wheelHandler.onWheel,className:c,style:e,tabIndex:0},s.createElement("div",{ref:"face",className:p,style:t}))},componentWillMount:function(){var e="horizontal"===this.props.orientation,t=e?this._onWheelX:this._onWheelY;this._wheelHandler=new c(t,this._shouldHandleX,this._shouldHandleY)},componentDidMount:function(){this._mouseMoveTracker=new n(this._onMouseMove,this._onMouseMoveEnd,document.documentElement),void 0!==this.props.position&&this.state.position!==this.props.position&&this._didScroll(),this._isMounted=!0},componentWillUnmount:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),w===this&&(w=null),delete this._mouseMoveTracker,this._isMounted=!1},scrollBy:function(e){this._onWheel(e)},_shouldHandleX:function(e){return"horizontal"===this.props.orientation&&this._shouldHandleChange(e)},_shouldHandleY:function(e){return"horizontal"!==this.props.orientation&&this._shouldHandleChange(e)},_shouldHandleChange:function(e){var t=this._calculateState(this.state.position+e,this.props.size,this.props.contentSize,this.props.orientation);return t.position!==this.state.position},_calculateState:function(e,t,o,n){if(t<1||o<=t)return m;var r=e+"_"+t+"_"+o+"_"+n;if(this._stateKey===r)return this._stateForKey;var i="horizontal"===n,s=t/o,a=t*s;au&&(e=u);var c=!!this._mouseMoveTracker&&this._mouseMoveTracker.isDragging(),h={faceSize:a,isDragging:c,isHorizontal:i,position:e,scale:s,scrollable:l};return this._stateKey=r,this._stateForKey=h,h},_onWheelY:function(e,t){this._onWheel(t)},_onWheelX:function(e,t){this._onWheel(e)},_onWheel:function(e){var t=this.props;this._setNextState(this._calculateState(this.state.position+e,t.size,t.contentSize,t.orientation))},_onMouseDown:function(e){var t;if(e.target!==l.findDOMNode(this.refs.face)){var o=e.nativeEvent,n=this.state.isHorizontal?o.offsetX||o.layerX:o.offsetY||o.layerY,r=this.props;n/=this.state.scale,t=this._calculateState(n-.5*this.state.faceSize/this.state.scale,r.size,r.contentSize,r.orientation)}else t={};t.focused=!0,this._setNextState(t),this._mouseMoveTracker.captureMouseMoves(e),l.findDOMNode(this).focus()},_onMouseMove:function(e,t){var o=this.props,n=this.state.isHorizontal?e:t;n/=this.state.scale,this._setNextState(this._calculateState(this.state.position+n,o.size,o.contentSize,o.orientation))},_onMouseMoveEnd:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),this.setState({isDragging:!1})},_onKeyDown:function(e){var t=e.keyCode;if(t!==r.TAB){var o=y,n=0;if(this.state.isHorizontal)switch(t){case r.HOME:n=-1,o=this.props.contentSize;break;case r.LEFT:n=-1;break;case r.RIGHT:n=1;break;default:return}if(!this.state.isHorizontal)switch(t){case r.SPACE:n=e.shiftKey?-1:1;break;case r.HOME:n=-1,o=this.props.contentSize;break;case r.UP:n=-1;break;case r.DOWN:n=1;break;case r.PAGE_UP:n=-1,o=this.props.size;break;case r.PAGE_DOWN:n=1,o=this.props.size;break;default:return}e.preventDefault();var i=this.props;this._setNextState(this._calculateState(this.state.position+o*n,i.size,i.contentSize,i.orientation))}},_onFocus:function(){this.setState({focused:!0})},_onBlur:function(){this.setState({focused:!1})},_blur:function(){if(this._isMounted)try{this._onBlur(),l.findDOMNode(this).blur()}catch(e){}},_setNextState:function(e,t){t=t||this.props;var o=t.position,n=this.state.position!==e.position;if(void 0===o){var r=n?this._didScroll:void 0;this.setState(e,r)}else{if(o!==e.position)return void(void 0!==e.position&&e.position!==this.state.position&&this.props.onScroll(e.position));this.setState(e)}n&&w!==this&&(w&&w._blur(),w=this)},_didScroll:function(){this.props.onScroll(this.state.position)}});b.KEYBOARD_SCROLL_AMOUNT=y,b.SIZE=parseInt(h("scrollbar-size"),10),e.exports=b},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var o=0;o0;)this._addRowToBuffer(t,this._viewportRowsBegin,this._viewportRowsEnd-1),t++,e--;return this._rows}},{key:"getRows",value:function(e,t){var o=t,n=o,r=e,i=Math.min(e+this._maxVisibleRowCount,this._rowsCount);for(this._viewportRowsBegin=e;r=i&&(n=this._bufferSet.replaceFurthestValuePosition(t,o,e)),null===n?(n=this._bufferSet.getNewPositionForValue(e),this._rows[n]=e):this._rows[n]=e}}]),e}();e.exports=c},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var o=0;o=e&&r<=t)return null;var i;e-n>r-t?(i=n,this._smallValues.pop()):(i=r,this._largeValues.pop());var a=this._valueToPositionMap[i];return delete this._valueToPositionMap[i],this._valueToPositionMap[o]=a,this._pushToHeaps(a,o),a}},{key:"_pushToHeaps",value:function(e,t){var o={position:e,value:t};this._smallValues.push(o),this._largeValues.push(o)}},{key:"_cleanHeaps",value:function(){this._cleanHeap(this._smallValues),this._cleanHeap(this._largeValues);var e=Math.min(this._smallValues.size(),this._largeValues.size()),t=Math.max(this._smallValues.size(),this._largeValues.size());t>10*e&&this._recreateHeaps()}},{key:"_recreateHeaps",value:function(){for(var e=this._smallValues.size()t.value}}]),e}();e.exports=a},function(e,t){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){return e0&&(this._items[0]=t,this._sinkDown(0)),e}}},{key:"push",value:function(e){this._items[this._size++]=e,this._bubbleUp(this._size-1)}},{key:"size",value:function(){return this._size}},{key:"peek",value:function(){if(0!==this._size)return this._items[0]}},{key:"_heapify",value:function(){for(var e=Math.floor((this._size+1)/2);e>=0;e--)this._sinkDown(e)}},{key:"_bubbleUp",value:function(e){for(var t=this._items[e];e>0;){var o=Math.floor((e+1)/2)-1,n=this._items[o];if(this._comparator(n,t))return;this._items[o]=t,this._items[e]=n,e=o}}},{key:"_sinkDown",value:function(e){for(var t=this._items[e];;){var o=2*(e+1)-1,n=2*(e+1),r=-1;if(oo?o:e}e.exports=o},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=Object.assign||function(e){for(var t=1;t0){var o=h({"fixedDataTableRowLayout/fixedColumnsDivider":!0,"fixedDataTableRowLayout/columnsShadow":e.props.scrollLeft>0,"public/fixedDataTableRow/fixedColumnsDivider":!0,"public/fixedDataTableRow/columnsShadow":e.props.scrollLeft>0}),n={left:t,height:e.props.height};return u.createElement("div",{className:o,style:n})}},this._onClick=function(t){e.props.onClick(t,e.props.index)},this._onDoubleClick=function(t){e.props.onDoubleClick(t,e.props.index)},this._onMouseDown=function(t){e.props.onMouseDown(t,e.props.index)},this._onMouseEnter=function(t){e.props.onMouseEnter(t,e.props.index)},this._onMouseLeave=function(t){e.props.onMouseLeave(t,e.props.index)}}return r(t,e),s(t,[{key:"render",value:function(){var e={width:this.props.width,height:this.props.height},t=h({"fixedDataTableRowLayout/main":!0,"public/fixedDataTableRow/main":!0,"public/fixedDataTableRow/highlighted":this.props.index%2===1,"public/fixedDataTableRow/odd":this.props.index%2===1,"public/fixedDataTableRow/even":this.props.index%2===0}),o=this._getColumnsWidth(this.props.fixedColumns),n=u.createElement(c,{key:"fixed_cells",isScrolling:this.props.isScrolling,height:this.props.height,left:0,width:o,zIndex:2,columns:this.props.fixedColumns,onColumnResize:this.props.onColumnResize,rowHeight:this.props.height,rowIndex:this.props.index}),r=this._renderColumnsShadow(o),i=u.createElement(c,{key:"scrollable_cells",isScrolling:this.props.isScrolling,height:this.props.height,left:this.props.scrollLeft,offsetLeft:o,width:this.props.width-o,zIndex:0,columns:this.props.scrollableColumns,onColumnResize:this.props.onColumnResize,rowHeight:this.props.height,rowIndex:this.props.index});return u.createElement("div",{className:f(t,this.props.className),onClick:this.props.onClick?this._onClick:null,onDoubleClick:this.props.onDoubleClick?this._onDoubleClick:null,onMouseDown:this.props.onMouseDown?this._onMouseDown:null,onMouseEnter:this.props.onMouseEnter?this._onMouseEnter:null,onMouseLeave:this.props.onMouseLeave?this._onMouseLeave:null,style:e},u.createElement("div",{className:h("fixedDataTableRowLayout/body")},n,i,r))}}],[{key:"propTypes",value:{isScrolling:l.bool,fixedColumns:l.array.isRequired,height:l.number.isRequired,index:l.number.isRequired,scrollableColumns:l.array.isRequired,scrollLeft:l.number.isRequired,width:l.number.isRequired,onClick:l.func,onDoubleClick:l.func,onColumnResize:l.func},enumerable:!0}]),t}(u.Component),m=function(e){function t(){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return r(t,e),s(t,[{key:"render",value:function(){var e={width:this.props.width,height:this.props.height,zIndex:this.props.zIndex?this.props.zIndex:0};return p(e,0,this.props.offsetTop),u.createElement("div",{style:e,className:h("fixedDataTableRowLayout/rowWrapper")},u.createElement(d,i({},this.props,{offsetTop:void 0,zIndex:void 0})))}}],[{key:"propTypes",value:{isScrolling:l.bool,height:l.number.isRequired,zIndex:l.number,offsetTop:l.number.isRequired,width:l.number.isRequired},enumerable:!0}]),t}(u.Component);e.exports=m},function(e,t,o){"use strict";function n(e,t){var o={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}var r=Object.assign||function(e){for(var t=1;t=0){var l="cell_"+r;o[r]=this._renderCell(e.rowIndex,e.rowHeight,s,n,l)}n+=s.width}var u=this._getColumnsWidth(t),p={height:e.height,position:"absolute",width:u,zIndex:e.zIndex};return h(p,-1*f*e.left,0),a.createElement("div",{className:c("fixedDataTableCellGroupLayout/cellGroup"),style:p},o)},_renderCell:function(e,t,o,n,r){var i=o.isResizable&&this.props.onColumnResize,s=i?this.props.onColumnResize:null,l=o.cellClassName;return a.createElement(u,{isScrolling:this.props.isScrolling,align:o.align,className:l,height:t,key:r,maxWidth:o.maxWidth,minWidth:o.minWidth,onColumnResize:s,rowIndex:e,columnKey:o.columnKey,width:o.width,left:n,cell:o.cell})},_getColumnsWidth:function(e){for(var t=0,o=0;o=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}var r=o(78),i=o(73),s=o(27),a=o(34),l=o(37),u=o(60),c=o(79),h=i.DIR_SIGN,f={align:"left",highlighted:!1},p=l({displayName:"FixedDataTableCell",propTypes_DISABLED_FOR_PERFORMANCE:{isScrolling:s.bool,align:s.oneOf(["left","center","right"]),className:s.string,highlighted:s.bool,width:s.number.isRequired,minWidth:s.number,maxWidth:s.number,height:s.number.isRequired,cell:s.oneOfType([s.string,s.element,s.func]),columnKey:s.oneOfType([s.string,s.number]),rowIndex:s.number.isRequired,onColumnResize:s.func,left:s.number},shouldComponentUpdate:function(e){return!e.isScrolling||this.props.rowIndex!==e.rowIndex},getDefaultProps:function(){return f},render:function(){var e=this.props,t=e.height,o=e.width,i=e.columnKey,s=n(e,["height","width","columnKey"]),l={height:t,width:o};1===h?l.left=s.left:l.right=s.left;var f,p=c(u({"fixedDataTableCellLayout/main":!0,"fixedDataTableCellLayout/lastChild":s.lastChild,"fixedDataTableCellLayout/alignRight":"right"===s.align,"fixedDataTableCellLayout/alignCenter":"center"===s.align,"public/fixedDataTableCell/alignRight":"right"===s.align,"public/fixedDataTableCell/highlighted":s.highlighted,"public/fixedDataTableCell/main":!0}),s.className);if(s.onColumnResize){var d={height:t};f=a.createElement("div",{className:u("fixedDataTableCellLayout/columnResizerContainer"),style:d,onMouseDown:this._onColumnResizerMouseDown},a.createElement("div",{className:c(u("fixedDataTableCellLayout/columnResizerKnob"),u("public/fixedDataTableCell/columnResizerKnob")),style:d}))}var m={columnKey:i,height:t,width:o};s.rowIndex>=0&&(m.rowIndex=s.rowIndex);var v;return a.isValidElement(s.cell)?("div"===s.cell.type&&delete m.columnKey,v=a.cloneElement(s.cell,m)):v="function"==typeof s.cell?s.cell(m):a.createElement(r,m,s.cell),a.createElement("div",{className:p,style:l},f,v)},_onColumnResizerMouseDown:function(e){this.props.onColumnResize(this.props.left,this.props.width,this.props.minWidth,this.props.maxWidth,this.props.columnKey,e)}});e.exports=p},function(e,t,o){"use strict";function n(e,t){var o={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=Object.assign||function(e){for(var t=1;t1)for(var n=1;n=0&&t>=e-a;){var o=this._updateRowHeight(t);this._position+=o,t--}}},{key:"_updateRowHeight",value:function(e){if(e<0||e>=this._rowCount)return 0;var t=this._rowHeightGetter(e);if(t!==this._storedHeights[e]){var o=t-this._storedHeights[e];return this._rowOffsets.set(e,t),this._storedHeights[e]=t,this._contentHeight+=o,o}return 0}},{key:"getRowPosition",value:function(e){return this._updateRowHeight(e),this._rowOffsets.sumUntil(e)}},{key:"scrollBy",value:function(e){if(0===this._rowCount)return l;var t=this._rowOffsets.greatestLowerBound(this._position);t=s(t,0,Math.max(this._rowCount-1,0));var o=this._rowOffsets.sumUntil(t),n=t,r=this._position,i=this._updateRowHeight(n);0!==o&&(r+=i);var a=this._storedHeights[n]-(r-o);if(e>=0)for(;e>0&&n0&&n>=0;)if(e=0){var c=this._updateRowHeight(n);u=this._storedHeights[n],r+=c}}var h=this._contentHeight-this._viewportHeight;r=s(r,0,h),this._position=r;var f=this._rowOffsets.greatestLowerBound(r);f=s(f,0,Math.max(this._rowCount-1,0)),o=this._rowOffsets.sumUntil(f);var p=o-r;return this._updateHeightsInViewport(f,p),this._updateHeightsAboveViewport(f),{index:f,offset:p,position:this._position,contentHeight:this._contentHeight}}},{key:"_getRowAtEndPosition",value:function(e){this._updateRowHeight(e);for(var t=e,o=this._storedHeights[t];o=0;)t--,t>=0&&(this._updateRowHeight(t),o+=this._storedHeights[t]);var n=this._rowOffsets.sumTo(e)-this._viewportHeight;return n<0&&(n=0),n}},{key:"scrollTo",value:function(e){if(0===this._rowCount)return l;if(e<=0)return this._position=0,this._updateHeightsInViewport(0,0),{index:0,offset:0,position:this._position,contentHeight:this._contentHeight};if(e>=this._contentHeight-this._viewportHeight){var t=this._rowCount-1;e=this._getRowAtEndPosition(t)}this._position=e;var o=this._rowOffsets.greatestLowerBound(e);o=s(o,0,Math.max(this._rowCount-1,0));var n=this._rowOffsets.sumUntil(o),r=n-e;return this._updateHeightsInViewport(o,r),this._updateHeightsAboveViewport(o),{index:o,offset:r,position:this._position,contentHeight:this._contentHeight}}},{key:"scrollToRow",value:function(e,t){e=s(e,0,Math.max(this._rowCount-1,0)),t=s(t,-this._storedHeights[e],0);var o=this._rowOffsets.sumUntil(e);return this.scrollTo(o-t)}},{key:"scrollRowIntoView",value:function(e){e=s(e,0,Math.max(this._rowCount-1,0));var t=this._rowOffsets.sumUntil(e),o=t+this._storedHeights[e];if(t=0;--o)t[o]=0;return t},u=function(){function e(t){n(this,e),this._size=t.length,this._half=r(this._size),this._heap=new l(2*this._half);var o;for(o=0;o0;--o)this._heap[o]=this._heap[2*o]+this._heap[2*o+1]}return i(e,[{key:"set",value:function(e,t){s(0<=e&&e=0;--r)n[r]=o;return new e(n)}},{key:"empty",value:function(t){return e.uniform(t,0)}}]),e}();e.exports=u}).call(t,function(){return this}())},function(e,t,o){"use strict";function n(e){for(var t=0,o=0;o=t||o<0||T&&n>=_}function c(){var e=C();return u(e)?h(e):void(y=setTimeout(c,s(e)))}function h(e){return y=void 0,D&&m?n(e):(m=v=void 0,g)}function f(){void 0!==y&&clearTimeout(y),R=0,m=w=v=y=void 0}function p(){return void 0===y?g:h(C())}function d(){var e=C(),o=u(e);if(m=arguments,v=this,w=e,o){if(void 0===y)return i(w);if(T)return y=setTimeout(c,t),n(w)}return void 0===y&&(y=setTimeout(c,t)),g}var m,v,_,g,y,w,R=0,E=!1,T=!1,D=!0;if("function"!=typeof e)throw new TypeError(l);return t=a(t)||0,r(o)&&(E=!!o.leading,T="maxWait"in o,_=T?b(a(o.maxWait)||0,t):_,D="trailing"in o?!!o.trailing:D),d.cancel=f,d.flush=p,d}function n(e,t,n){var i=!0,s=!0;if("function"!=typeof e)throw new TypeError(l);return r(n)&&(i="leading"in n?!!n.leading:i,s="trailing"in n?!!n.trailing:s),o(e,t,{leading:i,maxWait:t,trailing:s})}function r(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function i(e){return!!e&&"object"==typeof e}function s(e){return"symbol"==typeof e||i(e)&&w.call(e)==c}function a(e){if("number"==typeof e)return e;if(s(e))return u;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(h,"");var o=p.test(e);return o||d.test(e)?m(e.slice(2),o?2:8):f.test(e)?u:+e}var l="Expected a function",u=NaN,c="[object Symbol]",h=/^\s+|\s+$/g,f=/^[-+]0x[0-9a-f]+$/i,p=/^0b[01]+$/i,d=/^0o[0-7]+$/i,m=parseInt,v="object"==typeof t&&t&&t.Object===Object&&t,_="object"==typeof self&&self&&self.Object===Object&&self,g=v||_||Function("return this")(),y=Object.prototype,w=y.toString,b=Math.max,x=Math.min,C=function(){return g.Date.now()};e.exports=n}).call(t,function(){return this}())},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=function(){function e(e,t){for(var o=0;o1)for(var o=1;o0||e>=0&&this.state.scrollX0||e>=0&&this.state.scrollYn?n:this.state.height>n&&this.props.ownerHeight?Math.max(n,this.props.ownerHeight):this.state.height+this.state.maxScrollY,e!==this._contentHeight&&this.props.onContentHeightChange&&this.props.onContentHeightChange(e),this._contentHeight=e},componentDidMount:function(){this._reportContentHeight(),this._isMounted=!0},componentWillReceiveProps:function(e){var t=e.scrollToRow;void 0!==t&&null!==t&&(this._rowToScrollTo=t);var o=e.scrollToColumn;void 0!==o&&null!==o&&(this._columnToScrollTo=o);var n=e.overflowX,r=e.overflowY;n===this.props.overflowX&&r===this.props.overflowY||(this._wheelHandler=new l(this._onWheel,"hidden"!==n,"hidden"!==r)),this.props.ownerHeight===e.ownerHeight&&this.props.scrollTop===e.scrollTop||this._didScrollStart(),this._didScroll(),this._didScrollStop(),this.setState(this._calculateState(e,this.state))},componentDidUpdate:function(){this._reportContentHeight()},render:function(){var e,t=this.state,o=this.props;t.useGroupHeader&&(e=i.createElement(f,{key:"group_header",isScrolling:this._isScrolling,className:y(m("fixedDataTableLayout/header"),m("public/fixedDataTable/header")),width:t.width,height:t.groupHeaderHeight,index:0,zIndex:1,offsetTop:0,scrollLeft:t.scrollX,fixedColumns:t.groupHeaderFixedColumns,scrollableColumns:t.groupHeaderScrollableColumns,onColumnResize:this._onColumnResize,setHoverState:this.setHoverState,isColumnResizing:t.isColumnResizing}));var r=this.state.maxScrollY,s=t.maxScrollX>0&&"hidden"!==t.overflowX,a=r>0&&"hidden"!==t.overflowY,l=s?u.SIZE:0,c=t.height-l-2*E-t.footerHeight,p=t.useGroupHeader?t.groupHeaderHeight:0,d=p+t.headerHeight;c-=d;var v=0,g=null!=o.maxHeight?d+t.bodyHeight:d+c,_=g+t.footerHeight;void 0!==o.ownerHeight&&o.ownerHeightt.ownerHeight||t.scrollY or "),o.push(e))});var r=!1;o.length&&o[0].type.__TableColumnGroup__&&(r=!0),t&&(void 0!==e.width&&e.width!==t.width||void 0!==e.height&&e.height!==t.height||void 0!==e.maxWidth&&e.maxWidth!==t.maxWidth||void 0!==e.maxHeight&&e.maxHeight!==t.maxHeight)&&(t=null);var i,s,a=t&&t.firstRowIndex||0,l=t&&t.firstRowOffset||0;i=t&&"hidden"!==e.overflowX?t.scrollX:e.scrollLeft,t&&"hidden"!==e.overflowY?s=t.scrollY:(f=this._scrollHelper.scrollTo(e.scrollTop),a=f.index,l=f.offset,s=f.position),void 0!==this._rowToScrollTo&&(f=this._scrollHelper.scrollRowIntoView(this._rowToScrollTo),a=f.index,l=f.offset,s=f.position,delete this._rowToScrollTo);var c=r?e.groupHeaderHeight:0;if(t&&e.rowsCount!==t.rowsCount){var h=(void 0===e.height?e.maxHeight:e.height)-(e.headerHeight||0)-(e.footerHeight||0)-(e.groupHeaderHeight||0);this._scrollHelper=new p(e.rowsCount,e.rowHeight,h,e.rowHeightGetter);var f=this._scrollHelper.scrollToRow(a,l);a=f.index,l=f.offset,s=f.position}else t&&e.rowHeightGetter!==t.rowHeightGetter&&this._scrollHelper.setRowHeightGetter(e.rowHeightGetter);var m;m=e.isColumnResizing?t&&t.columnResizingData:x;var v,g;if(r){var y=d.adjustColumnGroupWidths(o,e.width);v=y.columns,g=y.columnGroups}else v=d.adjustColumnWidths(o,e.width);var w=this._populateColumnsAndColumnData(v,g,t);if(void 0!==this._columnToScrollTo){var b=w.bodyFixedColumns.length;if(this._columnToScrollTo>=b){var C,S,D=0;for(C=0;CO&&(i=O)}delete this._columnToScrollTo}var k=void 0===e.height,P=Math.round(k?e.maxHeight:e.height),z=e.footerHeight+e.headerHeight+c+2*E,I=P-z,j=this._scrollHelper.getContentHeight(),A=j+z,F=d.getTotalWidth(v),L=F>e.width&&"hidden"!==e.overflowX;L&&(I-=u.SIZE,A+=u.SIZE,z+=u.SIZE);var G=Math.max(0,F-e.width),W=Math.max(0,j-I);i=Math.min(i,G),s=Math.min(s,W),W||(k&&(P=A),I=A-z),this._scrollHelper.setViewportHeight(I);var V=n({isColumnResizing:t&&t.isColumnResizing},w,e,{columns:v,columnGroups:g,columnResizingData:m,firstRowIndex:a,firstRowOffset:l,horizontalScrollbarVisible:L,maxScrollX:G,maxScrollY:W,reservedHeight:z,scrollContentHeight:j,scrollX:i,scrollY:s,bodyHeight:I,height:P,groupHeaderHeight:c,useGroupHeader:r});return V},_selectColumnElement:function(e,t){for(var o=[],n=0;nMath.abs(e)&&"hidden"!==this.props.overflowY){var n=this._scrollHelper.scrollBy(Math.round(t)),r=Math.max(0,n.contentHeight-this.state.bodyHeight);this.setState({firstRowIndex:n.index,firstRowOffset:n.offset,scrollY:n.position,scrollContentHeight:n.contentHeight,maxScrollY:r})}else e&&"hidden"!==this.props.overflowX&&(o+=e,o=o<0?0:o,o=o>this.state.maxScrollX?this.state.maxScrollX:o,this.setState({scrollX:o}));this._didScroll(),this._didScrollStop()}},_onHorizontalScroll:function(e){this._isMounted&&e!==this.state.scrollX&&(this._isScrolling||this._didScrollStart(),this.setState({scrollX:e}),this._didScroll(),this._didScrollStop())},_onVerticalScroll:function(e){if(this._isMounted&&e!==this.state.scrollY){this._isScrolling||this._didScrollStart();var t=this._scrollHelper.scrollTo(Math.round(e));this.setState({firstRowIndex:t.index,firstRowOffset:t.offset,scrollY:t.position,scrollContentHeight:t.contentHeight}),this._didScroll(),this._didScrollStop()}},_didScrollStart:function(){this._isMounted&&!this._isScrolling&&(this._isScrolling=!0,this.props.onScrollStart&&this.props.onScrollStart(this.state.scrollX,this.state.scrollY))},_didScroll:function(){this._isMounted&&this._isScrolling&&this.props.onScroll&&this.props.onScroll(this.state.scrollX,this.state.scrollY)},_didScrollStop:function(){this._isMounted&&this._isScrolling&&(this._isScrolling=!1,this.setState({redraw:!0}),this.props.onScrollEnd&&this.props.onScrollEnd(this.state.scrollX,this.state.scrollY))},setHoverState:function(e){this.setState({isHoveringResizerKnob:e})}}),H=s({displayName:"HorizontalScrollbar",mixins:[a],propTypes:{contentSize:r.number.isRequired,offset:r.number.isRequired,onScroll:r.func.isRequired,position:r.number.isRequired,size:r.number.isRequired},render:function(){var e=n({height:u.SIZE,width:this.props.size},this.props.horizontalScrollbarStyle),t={height:u.SIZE,position:"absolute",overflow:"hidden",width:this.props.size};return b(t,0,this.props.offset),i.createElement("div",{className:y(m("fixedDataTableLayout/horizontalScrollbar"),m("public/fixedDataTable/horizontalScrollbar")),style:e},i.createElement("div",{ +style:t},i.createElement(u,n({},this.props,{isOpaque:!0,orientation:"horizontal",offset:void 0}))))}});e.exports=O},function(e,t,o){"use strict";var n=o(35),r=o(38);if("undefined"==typeof n)throw Error("create-react-class could not find the React object. If you are using script tags, make sure that React is being loaded before create-react-class.");var i=(new n.Component).updater;e.exports=r(n.Component,n.isValidElement,i)},function(e,t,o){(function(t){"use strict";function n(e){return e}function r(e,o,r){function h(e,o,n){for(var r in o)o.hasOwnProperty(r)&&"production"!==t.env.NODE_ENV&&l("function"==typeof o[r],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",e.displayName||"ReactClass",u[n],r)}function f(e,t){var o=C.hasOwnProperty(t)?C[t]:null;D.hasOwnProperty(t)&&a("OVERRIDE_BASE"===o,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&a("DEFINE_MANY"===o||"DEFINE_MANY_MERGED"===o,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function p(e,n){if(n){a("function"!=typeof n,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),a(!o(n),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=e.prototype,i=r.__reactAutoBindPairs;n.hasOwnProperty(c)&&x.mixins(e,n.mixins);for(var s in n)if(n.hasOwnProperty(s)&&s!==c){var u=n[s],h=r.hasOwnProperty(s);if(f(h,s),x.hasOwnProperty(s))x[s](e,u);else{var p=C.hasOwnProperty(s),d="function"==typeof u,m=d&&!p&&!h&&n.autobind!==!1;if(m)i.push(s,u),r[s]=u;else if(h){var _=C[s];a(p&&("DEFINE_MANY_MERGED"===_||"DEFINE_MANY"===_),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",_,s),"DEFINE_MANY_MERGED"===_?r[s]=v(r[s],u):"DEFINE_MANY"===_&&(r[s]=g(r[s],u))}else r[s]=u,"production"!==t.env.NODE_ENV&&"function"==typeof u&&n.displayName&&(r[s].displayName=n.displayName+"_"+s)}}}else if("production"!==t.env.NODE_ENV){var y=typeof n,w="object"===y&&null!==n;"production"!==t.env.NODE_ENV&&l(w,"%s: You're attempting to include a mixin that is either null or not an object. Check the mixins included by the component, as well as any mixins they include themselves. Expected object but got %s.",e.displayName||"ReactClass",null===n?null:y)}}function d(e,t){if(t)for(var o in t){var n=t[o];if(t.hasOwnProperty(o)){var r=o in x;a(!r,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',o);var i=o in e;if(i){var s=R.hasOwnProperty(o)?R[o]:null;return a("DEFINE_MANY_MERGED"===s,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",o),void(e[o]=v(e[o],n))}e[o]=n}}}function m(e,t){a(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var o in t)t.hasOwnProperty(o)&&(a(void 0===e[o],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",o),e[o]=t[o]);return e}function v(e,t){return function(){var o=e.apply(this,arguments),n=t.apply(this,arguments);if(null==o)return n;if(null==n)return o;var r={};return m(r,o),m(r,n),r}}function g(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function _(e,o){var n=o.bind(e);if("production"!==t.env.NODE_ENV){n.__reactBoundContext=e,n.__reactBoundMethod=o,n.__reactBoundArguments=null;var r=e.constructor.displayName,i=n.bind;n.bind=function(s){for(var a=arguments.length,u=Array(a>1?a-1:0),c=1;c1?t-1:0),n=1;n2?o-2:0),r=2;rn},ie64:function(){return y.ie()&&p},firefox:function(){return o()||r},opera:function(){return o()||i},webkit:function(){return o()||s},safari:function(){return y.webkit()},chrome:function(){return o()||a},windows:function(){return o()||c},osx:function(){return o()||u},linux:function(){return o()||h},iphone:function(){return o()||d},mobile:function(){return o()||d||m||f||g},nativeApp:function(){return o()||v},android:function(){return o()||f},ipad:function(){return o()||m}};e.exports=y},function(e,t,o){"use strict";function n(e,t){if(!i.canUseDOM||t&&!("addEventListener"in document))return!1;var o="on"+e,n=o in document;if(!n){var s=document.createElement("div");s.setAttribute(o,"return;"),n="function"==typeof s[o]}return!n&&r&&"wheel"===e&&(n=document.implementation.hasFeature("Events.wheel","3.0")),n}var r,i=o(49);i.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),e.exports=n},function(e,t){"use strict";var o=!("undefined"==typeof window||!window.document||!window.document.createElement),n={canUseDOM:o,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:o&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:o&&!!window.screen,isInWorker:!o};e.exports=n},function(e,t,o){(function(t){"use strict";var n=o(45),r=o(51),i=0,s=r||function(e){var o=Date.now(),n=Math.max(0,16-(o-i));return i=o+n,t.setTimeout(function(){e(Date.now())},n)};s(n),e.exports=s}).call(t,function(){return this}())},function(e,t){(function(t){"use strict";var o=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame;e.exports=o}).call(t,function(){return this}())},function(e,t,o){"use strict";var n=o(53),r=o(56),i=o(27),s=o(34),a=o(37),l=o(57),u=o(43),c=o(44),h=o(59),f=o(60),p=o(45),d=o(61),m={position:0,scrollable:!1},v=parseInt(h("scrollbar-face-margin"),10),g=2*v,_=30,y=40,w=null,b=a({displayName:"Scrollbar",mixins:[u],propTypes:{contentSize:i.number.isRequired,defaultPosition:i.number,isOpaque:i.bool,orientation:i.oneOf(["vertical","horizontal"]),onScroll:i.func,position:i.number,size:i.number.isRequired,trackColor:i.oneOf(["gray"]),zIndex:i.number,verticalTop:i.number},getInitialState:function(){var e=this.props;return this._calculateState(e.position||e.defaultPosition||0,e.size,e.contentSize,e.orientation)},componentWillReceiveProps:function(e){var t=e.position;void 0===t?this._setNextState(this._calculateState(this.state.position,e.size,e.contentSize,e.orientation)):this._setNextState(this._calculateState(t,e.size,e.contentSize,e.orientation),e)},getDefaultProps:function(){return{defaultPosition:0,isOpaque:!1,onScroll:p,orientation:"vertical",zIndex:99}},render:function(){if(!this.state.scrollable)return null;var e,t,o=this.props.size,n=this.state.isHorizontal,r=!n,i=this.state.focused||this.state.isDragging,a=this.state.faceSize,l=this.props.isOpaque,u=this.props.verticalTop||0,c=f({"ScrollbarLayout/main":!0,"ScrollbarLayout/mainVertical":r,"ScrollbarLayout/mainHorizontal":n,"public/Scrollbar/main":!0,"public/Scrollbar/mainOpaque":l,"public/Scrollbar/mainActive":i}),p=f({"ScrollbarLayout/face":!0,"ScrollbarLayout/faceHorizontal":n,"ScrollbarLayout/faceVertical":r,"public/Scrollbar/faceActive":i,"public/Scrollbar/face":!0}),m=this.state.position*this.state.scale+v;return n?(e={width:o},t={width:a-g},d(t,m,0)):(e={top:u,height:o},t={height:a-g},d(t,0,m)),e.zIndex=this.props.zIndex,"gray"===this.props.trackColor&&(e.backgroundColor=h("fbui-desktop-background-light")),s.createElement("div",{onFocus:this._onFocus,onBlur:this._onBlur,onKeyDown:this._onKeyDown,onMouseDown:this._onMouseDown,onWheel:this._wheelHandler.onWheel,className:c,style:e,tabIndex:0},s.createElement("div",{ref:"face",className:p,style:t}))},componentWillMount:function(){var e="horizontal"===this.props.orientation,t=e?this._onWheelX:this._onWheelY;this._wheelHandler=new c(t,this._shouldHandleX,this._shouldHandleY)},componentDidMount:function(){this._mouseMoveTracker=new n(this._onMouseMove,this._onMouseMoveEnd,document.documentElement),void 0!==this.props.position&&this.state.position!==this.props.position&&this._didScroll(),this._isMounted=!0},componentWillUnmount:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),w===this&&(w=null),delete this._mouseMoveTracker,this._isMounted=!1},scrollBy:function(e){this._onWheel(e)},_shouldHandleX:function(e){return"horizontal"===this.props.orientation&&this._shouldHandleChange(e)},_shouldHandleY:function(e){return"horizontal"!==this.props.orientation&&this._shouldHandleChange(e)},_shouldHandleChange:function(e){var t=this._calculateState(this.state.position+e,this.props.size,this.props.contentSize,this.props.orientation);return t.position!==this.state.position},_calculateState:function(e,t,o,n){if(t<1||o<=t)return m;var r=e+"_"+t+"_"+o+"_"+n;if(this._stateKey===r)return this._stateForKey;var i="horizontal"===n,s=t/o,a=t*s;a<_&&(s=(t-_)/(o-t),a=_);var l=!0,u=o-t;e<0?e=0:e>u&&(e=u);var c=!!this._mouseMoveTracker&&this._mouseMoveTracker.isDragging(),h={faceSize:a,isDragging:c,isHorizontal:i,position:e,scale:s,scrollable:l};return this._stateKey=r,this._stateForKey=h,h},_onWheelY:function(e,t){this._onWheel(t)},_onWheelX:function(e,t){this._onWheel(e)},_onWheel:function(e){var t=this.props;this._setNextState(this._calculateState(this.state.position+e,t.size,t.contentSize,t.orientation))},_onMouseDown:function(e){var t;if(e.target!==l.findDOMNode(this.refs.face)){var o=e.nativeEvent,n=this.state.isHorizontal?o.offsetX||o.layerX:o.offsetY||o.layerY,r=this.props;n/=this.state.scale,t=this._calculateState(n-.5*this.state.faceSize/this.state.scale,r.size,r.contentSize,r.orientation)}else t={};t.focused=!0,this._setNextState(t),this._mouseMoveTracker.captureMouseMoves(e),l.findDOMNode(this).focus()},_onMouseMove:function(e,t){var o=this.props,n=this.state.isHorizontal?e:t;n/=this.state.scale,this._setNextState(this._calculateState(this.state.position+n,o.size,o.contentSize,o.orientation))},_onMouseMoveEnd:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),this.setState({isDragging:!1})},_onKeyDown:function(e){var t=e.keyCode;if(t!==r.TAB){var o=y,n=0;if(this.state.isHorizontal)switch(t){case r.HOME:n=-1,o=this.props.contentSize;break;case r.LEFT:n=-1;break;case r.RIGHT:n=1;break;default:return}if(!this.state.isHorizontal)switch(t){case r.SPACE:n=e.shiftKey?-1:1;break;case r.HOME:n=-1,o=this.props.contentSize;break;case r.UP:n=-1;break;case r.DOWN:n=1;break;case r.PAGE_UP:n=-1,o=this.props.size;break;case r.PAGE_DOWN:n=1,o=this.props.size;break;default:return}e.preventDefault();var i=this.props;this._setNextState(this._calculateState(this.state.position+o*n,i.size,i.contentSize,i.orientation))}},_onFocus:function(){this.setState({focused:!0})},_onBlur:function(){this.setState({focused:!1})},_blur:function(){if(this._isMounted)try{this._onBlur(),l.findDOMNode(this).blur()}catch(e){}},_setNextState:function(e,t){t=t||this.props;var o=t.position,n=this.state.position!==e.position;if(void 0===o){var r=n?this._didScroll:void 0;this.setState(e,r)}else{if(o!==e.position)return void(void 0!==e.position&&e.position!==this.state.position&&this.props.onScroll(e.position));this.setState(e)}n&&w!==this&&(w&&w._blur(),w=this)},_didScroll:function(){this.props.onScroll(this.state.position)}});b.KEYBOARD_SCROLL_AMOUNT=y,b.SIZE=parseInt(h("scrollbar-size"),10),e.exports=b},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var o=0;o0;)this._addRowToBuffer(t,this._viewportRowsBegin,this._viewportRowsEnd-1),t++,e--;return this._rows}},{key:"getRows",value:function(e,t){var o=t,n=o,r=e,i=Math.min(e+this._maxVisibleRowCount,this._rowsCount);for(this._viewportRowsBegin=e;r=i&&(n=this._bufferSet.replaceFurthestValuePosition(t,o,e)),null===n?(n=this._bufferSet.getNewPositionForValue(e),this._rows[n]=e):this._rows[n]=e}}]),e}();e.exports=c},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var o=0;o=e&&r<=t)return null;var i;e-n>r-t?(i=n,this._smallValues.pop()):(i=r,this._largeValues.pop());var a=this._valueToPositionMap[i];return delete this._valueToPositionMap[i],this._valueToPositionMap[o]=a,this._pushToHeaps(a,o),a}},{key:"_pushToHeaps",value:function(e,t){var o={position:e,value:t};this._smallValues.push(o),this._largeValues.push(o)}},{key:"_cleanHeaps",value:function(){this._cleanHeap(this._smallValues),this._cleanHeap(this._largeValues);var e=Math.min(this._smallValues.size(),this._largeValues.size()),t=Math.max(this._smallValues.size(),this._largeValues.size());t>10*e&&this._recreateHeaps()}},{key:"_recreateHeaps",value:function(){for(var e=this._smallValues.size()t.value}}]),e}();e.exports=a},function(e,t){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){return e0&&(this._items[0]=t,this._sinkDown(0)),e}}},{key:"push",value:function(e){this._items[this._size++]=e,this._bubbleUp(this._size-1)}},{key:"size",value:function(){return this._size}},{key:"peek",value:function(){if(0!==this._size)return this._items[0]}},{key:"_heapify",value:function(){for(var e=Math.floor((this._size+1)/2);e>=0;e--)this._sinkDown(e)}},{key:"_bubbleUp",value:function(e){for(var t=this._items[e];e>0;){var o=Math.floor((e+1)/2)-1,n=this._items[o];if(this._comparator(n,t))return;this._items[o]=t,this._items[e]=n,e=o}}},{key:"_sinkDown",value:function(e){for(var t=this._items[e];;){var o=2*(e+1)-1,n=2*(e+1),r=-1;if(oo?o:e}e.exports=o},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=Object.assign||function(e){for(var t=1;t0){var o=h({"fixedDataTableRowLayout/fixedColumnsDivider":!0,"fixedDataTableRowLayout/columnsShadow":e.props.scrollLeft>0,"public/fixedDataTableRow/fixedColumnsDivider":!0,"public/fixedDataTableRow/columnsShadow":e.props.scrollLeft>0}),n={left:t,height:e.props.height};return u.createElement("div",{className:o,style:n})}},this._onClick=function(t){e.props.onClick(t,e.props.index)},this._onDoubleClick=function(t){e.props.onDoubleClick(t,e.props.index)},this._onMouseDown=function(t){e.props.onMouseDown(t,e.props.index)},this._onMouseEnter=function(t){e.props.onMouseEnter(t,e.props.index)},this._onMouseLeave=function(t){e.props.onMouseLeave(t,e.props.index)}}return r(t,e),s(t,[{key:"render",value:function(){var e={width:this.props.width,height:this.props.height},t=h({"fixedDataTableRowLayout/main":!0,"public/fixedDataTableRow/main":!0,"public/fixedDataTableRow/highlighted":this.props.index%2===1,"public/fixedDataTableRow/odd":this.props.index%2===1,"public/fixedDataTableRow/even":this.props.index%2===0}),o=this._getColumnsWidth(this.props.fixedColumns),n=u.createElement(c,{key:"fixed_cells",isScrolling:this.props.isScrolling,height:this.props.height,left:0,width:o,zIndex:2,columns:this.props.fixedColumns,onColumnResize:this.props.onColumnResize,isHoveringResizerKnob:this.props.isHoveringResizerKnob,setHoverState:this.props.setHoverState,rowHeight:this.props.height,rowIndex:this.props.index}),r=this._renderColumnsShadow(o),i=u.createElement(c,{key:"scrollable_cells",isScrolling:this.props.isScrolling,height:this.props.height,left:this.props.scrollLeft,offsetLeft:o,width:this.props.width-o,zIndex:0,columns:this.props.scrollableColumns,onColumnResize:this.props.onColumnResize,rowHeight:this.props.height,rowIndex:this.props.index});return u.createElement("div",{className:f(t,this.props.className),onClick:this.props.onClick?this._onClick:null,onDoubleClick:this.props.onDoubleClick?this._onDoubleClick:null,onMouseDown:this.props.onMouseDown?this._onMouseDown:null,onMouseEnter:this.props.onMouseEnter?this._onMouseEnter:null,onMouseLeave:this.props.onMouseLeave?this._onMouseLeave:null,style:e},u.createElement("div",{className:h("fixedDataTableRowLayout/body")},n,i,r))}}],[{key:"propTypes",value:{isScrolling:l.bool,fixedColumns:l.array.isRequired,height:l.number.isRequired,index:l.number.isRequired,scrollableColumns:l.array.isRequired,scrollLeft:l.number.isRequired,width:l.number.isRequired,onClick:l.func,onDoubleClick:l.func,onColumnResize:l.func},enumerable:!0}]),t}(u.Component),m=function(e){function t(){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return r(t,e),s(t,[{key:"render",value:function(){var e={width:this.props.width,height:this.props.height,zIndex:this.props.zIndex?this.props.zIndex:0,opacity:this.props.isColumnResizing?.4:1};return p(e,0,this.props.offsetTop),u.createElement("div",{style:e,className:h("fixedDataTableRowLayout/rowWrapper")},u.createElement(d,i({},this.props,{offsetTop:void 0,zIndex:void 0})))}}],[{key:"propTypes",value:{isScrolling:l.bool,height:l.number.isRequired,zIndex:l.number,offsetTop:l.number.isRequired,width:l.number.isRequired},enumerable:!0}]),t}(u.Component);e.exports=m},function(e,t,o){"use strict";function n(e,t){var o={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}var r=Object.assign||function(e){for(var t=1;t=0){var l="cell_"+r;o[r]=this._renderCell(e.rowIndex,e.rowHeight,s,n,l)}n+=s.width}var u=this._getColumnsWidth(t),p={height:e.height,position:"absolute",width:u,zIndex:e.zIndex};return h(p,-1*f*e.left,0),a.createElement("div",{className:c("fixedDataTableCellGroupLayout/cellGroup"),style:p},o)},_renderCell:function(e,t,o,n,r){var i=o.isResizable&&this.props.onColumnResize,s=i?this.props.onColumnResize:null,l=o.cellClassName;return a.createElement(u,{isScrolling:this.props.isScrolling,align:o.align,className:l,height:t,key:r,maxWidth:o.maxWidth,minWidth:o.minWidth,onColumnResize:s,isHoveringResizerKnob:this.props.isHoveringResizerKnob,setHoverState:this.props.setHoverState,rowIndex:e,columnKey:o.columnKey,width:o.width,left:n,cell:o.cell})},_getColumnsWidth:function(e){for(var t=0,o=0;o=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}var r=o(78),i=o(73),s=o(27),a=o(34),l=o(37),u=o(60),c=o(79),h=i.DIR_SIGN,f={align:"left",highlighted:!1},p=l({displayName:"FixedDataTableCell",propTypes_DISABLED_FOR_PERFORMANCE:{isScrolling:s.bool,align:s.oneOf(["left","center","right"]),className:s.string,highlighted:s.bool,width:s.number.isRequired,minWidth:s.number,maxWidth:s.number,height:s.number.isRequired,cell:s.oneOfType([s.string,s.element,s.func]),columnKey:s.oneOfType([s.string,s.number]),rowIndex:s.number.isRequired,onColumnResize:s.func,left:s.number},shouldComponentUpdate:function(e){return!e.isScrolling||this.props.rowIndex!==e.rowIndex},getDefaultProps:function(){return f},render:function(){var e=this.props,t=e.height,o=e.width,i=e.columnKey,s=n(e,["height","width","columnKey"]),l={height:t,width:o};1===h?l.left=s.left:l.right=s.left;var f,p=c(u({"fixedDataTableCellLayout/main":!0,"fixedDataTableCellLayout/lastChild":s.lastChild,"fixedDataTableCellLayout/alignRight":"right"===s.align,"fixedDataTableCellLayout/alignCenter":"center"===s.align,"public/fixedDataTableCell/alignRight":"right"===s.align,"public/fixedDataTableCell/highlighted":s.highlighted,"public/fixedDataTableCell/main":!0}),s.className);if(s.onColumnResize){var d={height:t,opacity:s.isHoveringResizerKnob?1:0};console.log("isHovering: ",s.isHoveringResizerKnob),console.log("isHoveringResizerKnob: ",s.isHoveringResizerKnob),f=a.createElement("div",{className:u("fixedDataTableCellLayout/columnResizerContainer"),style:d,onMouseDown:this._onColumnResizerMouseDown,onMouseEnter:function(){return s.setHoverState(!0)},onMouseLeave:function(){return s.setHoverState(!1)}},a.createElement("div",{className:c(u("fixedDataTableCellLayout/columnResizerKnob"),u("public/fixedDataTableCell/columnResizerKnob")),style:d}))}var m={columnKey:i,height:t,width:o};s.rowIndex>=0&&(m.rowIndex=s.rowIndex);var v;return a.isValidElement(s.cell)?("div"===s.cell.type&&delete m.columnKey,v=a.cloneElement(s.cell,m)):v="function"==typeof s.cell?s.cell(m):a.createElement(r,m,s.cell),a.createElement("div",{className:p,style:l},f,v)},_onColumnResizerMouseDown:function(e){this.props.onColumnResize(this.props.left,this.props.width,this.props.minWidth,this.props.maxWidth,this.props.columnKey,e)}});e.exports=p},function(e,t,o){"use strict";function n(e,t){var o={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=Object.assign||function(e){for(var t=1;t1)for(var n=1;n=0&&t>=e-a;){var o=this._updateRowHeight(t);this._position+=o,t--}}},{key:"_updateRowHeight",value:function(e){if(e<0||e>=this._rowCount)return 0;var t=this._rowHeightGetter(e);if(t!==this._storedHeights[e]){var o=t-this._storedHeights[e];return this._rowOffsets.set(e,t),this._storedHeights[e]=t,this._contentHeight+=o,o}return 0}},{key:"getRowPosition",value:function(e){return this._updateRowHeight(e),this._rowOffsets.sumUntil(e)}},{key:"scrollBy",value:function(e){if(0===this._rowCount)return l;var t=this._rowOffsets.greatestLowerBound(this._position);t=s(t,0,Math.max(this._rowCount-1,0));var o=this._rowOffsets.sumUntil(t),n=t,r=this._position,i=this._updateRowHeight(n);0!==o&&(r+=i);var a=this._storedHeights[n]-(r-o);if(e>=0)for(;e>0&&n0&&n>=0;)if(e=0){var c=this._updateRowHeight(n);u=this._storedHeights[n],r+=c}}var h=this._contentHeight-this._viewportHeight;r=s(r,0,h),this._position=r;var f=this._rowOffsets.greatestLowerBound(r);f=s(f,0,Math.max(this._rowCount-1,0)),o=this._rowOffsets.sumUntil(f);var p=o-r;return this._updateHeightsInViewport(f,p),this._updateHeightsAboveViewport(f),{index:f,offset:p,position:this._position,contentHeight:this._contentHeight}}},{key:"_getRowAtEndPosition",value:function(e){this._updateRowHeight(e);for(var t=e,o=this._storedHeights[t];o=0;)t--,t>=0&&(this._updateRowHeight(t),o+=this._storedHeights[t]);var n=this._rowOffsets.sumTo(e)-this._viewportHeight;return n<0&&(n=0),n}},{key:"scrollTo",value:function(e){if(0===this._rowCount)return l;if(e<=0)return this._position=0,this._updateHeightsInViewport(0,0),{index:0,offset:0,position:this._position,contentHeight:this._contentHeight};if(e>=this._contentHeight-this._viewportHeight){var t=this._rowCount-1;e=this._getRowAtEndPosition(t)}this._position=e;var o=this._rowOffsets.greatestLowerBound(e);o=s(o,0,Math.max(this._rowCount-1,0));var n=this._rowOffsets.sumUntil(o),r=n-e;return this._updateHeightsInViewport(o,r),this._updateHeightsAboveViewport(o),{index:o,offset:r,position:this._position,contentHeight:this._contentHeight}}},{key:"scrollToRow",value:function(e,t){e=s(e,0,Math.max(this._rowCount-1,0)),t=s(t,-this._storedHeights[e],0);var o=this._rowOffsets.sumUntil(e);return this.scrollTo(o-t)}},{key:"scrollRowIntoView",value:function(e){e=s(e,0,Math.max(this._rowCount-1,0));var t=this._rowOffsets.sumUntil(e),o=t+this._storedHeights[e];if(t=0;--o)t[o]=0;return t},u=function(){function e(t){n(this,e),this._size=t.length,this._half=r(this._size),this._heap=new l(2*this._half);var o;for(o=0;o0;--o)this._heap[o]=this._heap[2*o]+this._heap[2*o+1]}return i(e,[{key:"set",value:function(e,t){s(0<=e&&e=0;--r)n[r]=o;return new e(n)}},{key:"empty",value:function(t){return e.uniform(t,0)}}]),e}();e.exports=u}).call(t,function(){return this}())},function(e,t,o){"use strict";function n(e){for(var t=0,o=0;o Date: Wed, 17 Jul 2019 21:25:23 -0700 Subject: [PATCH 39/43] Remove console logs. --- src/FixedDataTableCell.react.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/FixedDataTableCell.react.js b/src/FixedDataTableCell.react.js index 73c61659..09e77e6f 100644 --- a/src/FixedDataTableCell.react.js +++ b/src/FixedDataTableCell.react.js @@ -124,8 +124,7 @@ var FixedDataTableCell = createReactClass({ height, opacity: props.isHoveringResizerKnob ? 1 : 0, }; - console.log('isHovering: ', props.isHoveringResizerKnob) - console.log('isHoveringResizerKnob: ', props.isHoveringResizerKnob) + columnResizerComponent = (
Date: Thu, 18 Jul 2019 16:42:19 -0700 Subject: [PATCH 40/43] Polish around opacity. --- src/FixedDataTableNew.react.js | 2 +- src/FixedDataTableRow.react.js | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/FixedDataTableNew.react.js b/src/FixedDataTableNew.react.js index a77bc1a9..b5a264b5 100644 --- a/src/FixedDataTableNew.react.js +++ b/src/FixedDataTableNew.react.js @@ -617,7 +617,7 @@ var FixedDataTable = createReactClass({ cx("public/fixedDataTable/main") )} onWheel={this._wheelHandler.onWheel} - style={{ height: state.height, width: state.width }} + style={{ height: state.height, width: state.width, opacity: this.state.isColumnResizing ? .4 : 1 }} >
Date: Thu, 18 Jul 2019 18:57:50 -0700 Subject: [PATCH 41/43] Fix top shadow styling. --- src/FixedDataTableNew.react.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/FixedDataTableNew.react.js b/src/FixedDataTableNew.react.js index b5a264b5..f5f1b11b 100644 --- a/src/FixedDataTableNew.react.js +++ b/src/FixedDataTableNew.react.js @@ -582,13 +582,27 @@ var FixedDataTable = createReactClass({ var topShadow; var bottomShadow; if (state.scrollY) { + let topShadowStyle = {} + // Kinda hacky, but we'll use the header columns to apply this styling + // fix for a renegade border style. + if (props.useTopShadow) { + const sumOfColumnWidths = [...state.headFixedColumns, ...state.headScrollableColumns].reduce( + (acc, column) => acc + column.props.width, + 0 + ) + topShadowStyle = { + marginLeft: '3px', + width: sumOfColumnWidths + 'px', + maxWidth: 'calc(100% - 6px)', + } + } topShadow = (
); } From ab8e7bed2618f1270474287d4ae71eae2a2efaa3 Mon Sep 17 00:00:00 2001 From: Kevin Chang Date: Thu, 18 Jul 2019 18:59:31 -0700 Subject: [PATCH 42/43] Bump patch version. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e5cffa78..cd3c4f99 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@buildingconnected/fixed-data-table", - "version": "0.8.0", + "version": "0.8.1", "description": "A React table component designed to allow presenting thousands of rows of data.", "main": "main.js", "peerDependencies": { From b9d63eec0e930ff13298b598e0f70cb75e787fcf Mon Sep 17 00:00:00 2001 From: Nicholas Lawrence Date: Mon, 10 Jan 2022 10:51:24 -0800 Subject: [PATCH 43/43] Version 0.8.2 --- dist/fixed-data-table-base.css | 2 +- dist/fixed-data-table-base.min.css | 2 +- dist/fixed-data-table-style.css | 2 +- dist/fixed-data-table-style.min.css | 2 +- dist/fixed-data-table.css | 2 +- dist/fixed-data-table.js | 485 +++++++++++++++++++++++++++- dist/fixed-data-table.min.css | 2 +- dist/fixed-data-table.min.js | 10 +- package.json | 2 +- 9 files changed, 484 insertions(+), 25 deletions(-) diff --git a/dist/fixed-data-table-base.css b/dist/fixed-data-table-base.css index 546f4521..7e09c365 100644 --- a/dist/fixed-data-table-base.css +++ b/dist/fixed-data-table-base.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.8.0 + * FixedDataTable v0.8.2 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table-base.min.css b/dist/fixed-data-table-base.min.css index 40bc8f26..5350aa77 100644 --- a/dist/fixed-data-table-base.min.css +++ b/dist/fixed-data-table-base.min.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.8.0 + * FixedDataTable v0.8.2 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table-style.css b/dist/fixed-data-table-style.css index 22906652..057f6478 100644 --- a/dist/fixed-data-table-style.css +++ b/dist/fixed-data-table-style.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.8.0 + * FixedDataTable v0.8.2 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table-style.min.css b/dist/fixed-data-table-style.min.css index 10e16467..dcf6901f 100644 --- a/dist/fixed-data-table-style.min.css +++ b/dist/fixed-data-table-style.min.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.8.0 + * FixedDataTable v0.8.2 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table.css b/dist/fixed-data-table.css index 181bb3b5..ff3b49ee 100644 --- a/dist/fixed-data-table.css +++ b/dist/fixed-data-table.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.8.0 + * FixedDataTable v0.8.2 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table.js b/dist/fixed-data-table.js index 52eb3f8d..fd061ac1 100644 --- a/dist/fixed-data-table.js +++ b/dist/fixed-data-table.js @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.8.0 + * FixedDataTable v0.8.2 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -233,11 +233,11 @@ return /******/ (function(modules) { // webpackBootstrap // New Table API var Table = __webpack_require__(36); - var Column = __webpack_require__(86); - var ColumnGroup = __webpack_require__(87); + var Column = __webpack_require__(87); + var ColumnGroup = __webpack_require__(88); // Transition Cell - var TransitionCell = __webpack_require__(88); + var TransitionCell = __webpack_require__(89); var NEXT_VERSION = '0.7.0'; var DOCUMENTATION_URL = 'https://fburl.com/FixedDataTable-v0.6'; @@ -1832,6 +1832,8 @@ return /******/ (function(modules) { // webpackBootstrap var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } } + var PropTypes = __webpack_require__(27); /** * Copyright (c) 2015, Facebook, Inc. @@ -1866,7 +1868,7 @@ return /******/ (function(modules) { // webpackBootstrap var joinClasses = __webpack_require__(79); var shallowEqual = __webpack_require__(85); var translateDOMPositionXY = __webpack_require__(61); - var throttle = __webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module \"lodash.throttle\""); e.code = 'MODULE_NOT_FOUND'; throw e; }())); + var throttle = __webpack_require__(86); var ReactChildren = React.Children; @@ -2354,9 +2356,22 @@ return /******/ (function(modules) { // webpackBootstrap var topShadow; var bottomShadow; if (state.scrollY) { + var topShadowStyle = {}; + // Kinda hacky, but we'll use the header columns to apply this styling + // fix for a renegade border style. + if (props.useTopShadow) { + var sumOfColumnWidths = [].concat(_toConsumableArray(state.headFixedColumns), _toConsumableArray(state.headScrollableColumns)).reduce(function (acc, column) { + return acc + column.props.width; + }, 0); + topShadowStyle = { + marginLeft: '3px', + width: sumOfColumnWidths + 'px', + maxWidth: 'calc(100% - 6px)' + }; + } topShadow = React.createElement("div", { className: joinClasses(cx("fixedDataTableLayout/topShadow"), cx("public/fixedDataTable/topShadow")), - style: _extends({}, props.topShadowStyle, { top: bodyOffsetTop }) + style: _extends({}, topShadowStyle, { top: bodyOffsetTop }) }); } @@ -2372,7 +2387,7 @@ return /******/ (function(modules) { // webpackBootstrap { className: joinClasses(cx("fixedDataTableLayout/main"), cx("public/fixedDataTable/main")), onWheel: this._wheelHandler.onWheel, - style: { height: state.height, width: state.width } + style: { height: state.height, width: state.width, opacity: this.state.isColumnResizing ? .4 : 1 } }, React.createElement( "div", @@ -6997,8 +7012,7 @@ return /******/ (function(modules) { // webpackBootstrap var style = { width: this.props.width, height: this.props.height, - zIndex: this.props.zIndex ? this.props.zIndex : 0, - opacity: this.props.isColumnResizing ? .4 : 1 + zIndex: this.props.zIndex ? this.props.zIndex : 0 }; translateDOMPositionXY(style, 0, this.props.offsetTop); @@ -7651,8 +7665,7 @@ return /******/ (function(modules) { // webpackBootstrap height: height, opacity: props.isHoveringResizerKnob ? 1 : 0 }; - console.log('isHovering: ', props.isHoveringResizerKnob); - console.log('isHoveringResizerKnob: ', props.isHoveringResizerKnob); + columnResizerComponent = React.createElement( 'div', { @@ -8894,6 +8907,452 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }), /* 86 */ +/***/ (function(module, exports) { + + /* WEBPACK VAR INJECTION */(function(global) {/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + + /** Used as the `TypeError` message for "Functions" methods. */ + var FUNC_ERROR_TEXT = 'Expected a function'; + + /** Used as references for various `Number` constants. */ + var NAN = 0 / 0; + + /** `Object#toString` result references. */ + var symbolTag = '[object Symbol]'; + + /** Used to match leading and trailing whitespace. */ + var reTrim = /^\s+|\s+$/g; + + /** Used to detect bad signed hexadecimal string values. */ + var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + + /** Used to detect binary string values. */ + var reIsBinary = /^0b[01]+$/i; + + /** Used to detect octal string values. */ + var reIsOctal = /^0o[0-7]+$/i; + + /** Built-in method references without a dependency on `root`. */ + var freeParseInt = parseInt; + + /** Detect free variable `global` from Node.js. */ + var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + + /** Detect free variable `self`. */ + var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + + /** Used as a reference to the global object. */ + var root = freeGlobal || freeSelf || Function('return this')(); + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var objectToString = objectProto.toString; + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeMax = Math.max, + nativeMin = Math.min; + + /** + * Gets the timestamp of the number of milliseconds that have elapsed since + * the Unix epoch (1 January 1970 00:00:00 UTC). + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Date + * @returns {number} Returns the timestamp. + * @example + * + * _.defer(function(stamp) { + * console.log(_.now() - stamp); + * }, _.now()); + * // => Logs the number of milliseconds it took for the deferred invocation. + */ + var now = function() { + return root.Date.now(); + }; + + /** + * Creates a debounced function that delays invoking `func` until after `wait` + * milliseconds have elapsed since the last time the debounced function was + * invoked. The debounced function comes with a `cancel` method to cancel + * delayed `func` invocations and a `flush` method to immediately invoke them. + * Provide `options` to indicate whether `func` should be invoked on the + * leading and/or trailing edge of the `wait` timeout. The `func` is invoked + * with the last arguments provided to the debounced function. Subsequent + * calls to the debounced function return the result of the last `func` + * invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the debounced function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.debounce` and `_.throttle`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to debounce. + * @param {number} [wait=0] The number of milliseconds to delay. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=false] + * Specify invoking on the leading edge of the timeout. + * @param {number} [options.maxWait] + * The maximum time `func` is allowed to be delayed before it's invoked. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * // Avoid costly calculations while the window size is in flux. + * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); + * + * // Invoke `sendMail` when clicked, debouncing subsequent calls. + * jQuery(element).on('click', _.debounce(sendMail, 300, { + * 'leading': true, + * 'trailing': false + * })); + * + * // Ensure `batchLog` is invoked once after 1 second of debounced calls. + * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); + * var source = new EventSource('/stream'); + * jQuery(source).on('message', debounced); + * + * // Cancel the trailing debounced invocation. + * jQuery(window).on('popstate', debounced.cancel); + */ + function debounce(func, wait, options) { + var lastArgs, + lastThis, + maxWait, + result, + timerId, + lastCallTime, + lastInvokeTime = 0, + leading = false, + maxing = false, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + wait = toNumber(wait) || 0; + if (isObject(options)) { + leading = !!options.leading; + maxing = 'maxWait' in options; + maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + + function invokeFunc(time) { + var args = lastArgs, + thisArg = lastThis; + + lastArgs = lastThis = undefined; + lastInvokeTime = time; + result = func.apply(thisArg, args); + return result; + } + + function leadingEdge(time) { + // Reset any `maxWait` timer. + lastInvokeTime = time; + // Start the timer for the trailing edge. + timerId = setTimeout(timerExpired, wait); + // Invoke the leading edge. + return leading ? invokeFunc(time) : result; + } + + function remainingWait(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime, + result = wait - timeSinceLastCall; + + return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result; + } + + function shouldInvoke(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime; + + // Either this is the first call, activity has stopped and we're at the + // trailing edge, the system time has gone backwards and we're treating + // it as the trailing edge, or we've hit the `maxWait` limit. + return (lastCallTime === undefined || (timeSinceLastCall >= wait) || + (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); + } + + function timerExpired() { + var time = now(); + if (shouldInvoke(time)) { + return trailingEdge(time); + } + // Restart the timer. + timerId = setTimeout(timerExpired, remainingWait(time)); + } + + function trailingEdge(time) { + timerId = undefined; + + // Only invoke if we have `lastArgs` which means `func` has been + // debounced at least once. + if (trailing && lastArgs) { + return invokeFunc(time); + } + lastArgs = lastThis = undefined; + return result; + } + + function cancel() { + if (timerId !== undefined) { + clearTimeout(timerId); + } + lastInvokeTime = 0; + lastArgs = lastCallTime = lastThis = timerId = undefined; + } + + function flush() { + return timerId === undefined ? result : trailingEdge(now()); + } + + function debounced() { + var time = now(), + isInvoking = shouldInvoke(time); + + lastArgs = arguments; + lastThis = this; + lastCallTime = time; + + if (isInvoking) { + if (timerId === undefined) { + return leadingEdge(lastCallTime); + } + if (maxing) { + // Handle invocations in a tight loop. + timerId = setTimeout(timerExpired, wait); + return invokeFunc(lastCallTime); + } + } + if (timerId === undefined) { + timerId = setTimeout(timerExpired, wait); + } + return result; + } + debounced.cancel = cancel; + debounced.flush = flush; + return debounced; + } + + /** + * Creates a throttled function that only invokes `func` at most once per + * every `wait` milliseconds. The throttled function comes with a `cancel` + * method to cancel delayed `func` invocations and a `flush` method to + * immediately invoke them. Provide `options` to indicate whether `func` + * should be invoked on the leading and/or trailing edge of the `wait` + * timeout. The `func` is invoked with the last arguments provided to the + * throttled function. Subsequent calls to the throttled function return the + * result of the last `func` invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the throttled function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.throttle` and `_.debounce`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to throttle. + * @param {number} [wait=0] The number of milliseconds to throttle invocations to. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=true] + * Specify invoking on the leading edge of the timeout. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new throttled function. + * @example + * + * // Avoid excessively updating the position while scrolling. + * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); + * + * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. + * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); + * jQuery(element).on('click', throttled); + * + * // Cancel the trailing throttled invocation. + * jQuery(window).on('popstate', throttled.cancel); + */ + function throttle(func, wait, options) { + var leading = true, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (isObject(options)) { + leading = 'leading' in options ? !!options.leading : leading; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + return debounce(func, wait, { + 'leading': leading, + 'maxWait': wait, + 'trailing': trailing + }); + } + + /** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ + function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); + } + + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + function isObjectLike(value) { + return !!value && typeof value == 'object'; + } + + /** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ + function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); + } + + /** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */ + function toNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = typeof value.valueOf == 'function' ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); + } + + module.exports = throttle; + + /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) + +/***/ }), +/* 87 */ /***/ (function(module, exports, __webpack_require__) { 'use strict'; @@ -9098,7 +9557,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = FixedDataTableColumn; /***/ }), -/* 87 */ +/* 88 */ /***/ (function(module, exports, __webpack_require__) { 'use strict'; @@ -9201,7 +9660,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = FixedDataTableColumnGroup; /***/ }), -/* 88 */ +/* 89 */ /***/ (function(module, exports, __webpack_require__) { 'use strict'; diff --git a/dist/fixed-data-table.min.css b/dist/fixed-data-table.min.css index 855b25a8..ed65b4ea 100644 --- a/dist/fixed-data-table.min.css +++ b/dist/fixed-data-table.min.css @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.8.0 + * FixedDataTable v0.8.2 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. diff --git a/dist/fixed-data-table.min.js b/dist/fixed-data-table.min.js index 1a2642ef..5c9195b4 100644 --- a/dist/fixed-data-table.min.js +++ b/dist/fixed-data-table.min.js @@ -1,5 +1,5 @@ /** - * FixedDataTable v0.8.0 + * FixedDataTable v0.8.2 * * Copyright (c) 2015, Facebook, Inc. * All rights reserved. @@ -9,7 +9,7 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.FixedDataTable=t(require("react"),require("react-dom")):e.FixedDataTable=t(e.React,e.ReactDOM)}(this,function(e,t){return function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){o(1),o(5),o(7),o(9),o(11),o(13),o(15),o(17),o(19),o(21),o(23),e.exports=o(25)},function(e,t){},,,,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t){},,function(e,t,o){"use strict";var n=o(26),r=o(78),i=o(76),s=o(75),a={Cell:r,Column:i,ColumnGroup:s,Table:n};a.version="0.7.0",e.exports=a},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e,t){}var s=Object.assign||function(e){for(var t=1;t1)for(var o=1;o0||e>=0&&this.state.scrollX0||e>=0&&this.state.scrollYn?n:this.state.height>n&&this.props.ownerHeight?Math.max(n,this.props.ownerHeight):this.state.height+this.state.maxScrollY,e!==this._contentHeight&&this.props.onContentHeightChange&&this.props.onContentHeightChange(e),this._contentHeight=e},componentDidMount:function(){this._reportContentHeight(),this._isMounted=!0},componentWillReceiveProps:function(e){var t=e.scrollToRow;void 0!==t&&null!==t&&(this._rowToScrollTo=t);var o=e.scrollToColumn;void 0!==o&&null!==o&&(this._columnToScrollTo=o);var n=e.overflowX,r=e.overflowY;n===this.props.overflowX&&r===this.props.overflowY||(this._wheelHandler=new l(this._onWheel,"hidden"!==n,"hidden"!==r)),this.props.ownerHeight===e.ownerHeight&&this.props.scrollTop===e.scrollTop||this._didScrollStart(),this._didScroll(),this._didScrollStop(),this.setState(this._calculateState(e,this.state))},componentDidUpdate:function(){this._reportContentHeight()},render:function(){var e,t=this.state,o=this.props;t.useGroupHeader&&(e=i.createElement(f,{key:"group_header",isScrolling:this._isScrolling,className:y(m("fixedDataTableLayout/header"),m("public/fixedDataTable/header")),width:t.width,height:t.groupHeaderHeight,index:0,zIndex:1,offsetTop:0,scrollLeft:t.scrollX,fixedColumns:t.groupHeaderFixedColumns,scrollableColumns:t.groupHeaderScrollableColumns,onColumnResize:this._onColumnResize,setHoverState:this.setHoverState,isColumnResizing:t.isColumnResizing}));var r=this.state.maxScrollY,s=t.maxScrollX>0&&"hidden"!==t.overflowX,a=r>0&&"hidden"!==t.overflowY,l=s?u.SIZE:0,c=t.height-l-2*E-t.footerHeight,p=t.useGroupHeader?t.groupHeaderHeight:0,d=p+t.headerHeight;c-=d;var v=0,g=null!=o.maxHeight?d+t.bodyHeight:d+c,_=g+t.footerHeight;void 0!==o.ownerHeight&&o.ownerHeightt.ownerHeight||t.scrollY or "),o.push(e))});var r=!1;o.length&&o[0].type.__TableColumnGroup__&&(r=!0),t&&(void 0!==e.width&&e.width!==t.width||void 0!==e.height&&e.height!==t.height||void 0!==e.maxWidth&&e.maxWidth!==t.maxWidth||void 0!==e.maxHeight&&e.maxHeight!==t.maxHeight)&&(t=null);var i,s,a=t&&t.firstRowIndex||0,l=t&&t.firstRowOffset||0;i=t&&"hidden"!==e.overflowX?t.scrollX:e.scrollLeft,t&&"hidden"!==e.overflowY?s=t.scrollY:(f=this._scrollHelper.scrollTo(e.scrollTop),a=f.index,l=f.offset,s=f.position),void 0!==this._rowToScrollTo&&(f=this._scrollHelper.scrollRowIntoView(this._rowToScrollTo),a=f.index,l=f.offset,s=f.position,delete this._rowToScrollTo);var c=r?e.groupHeaderHeight:0;if(t&&e.rowsCount!==t.rowsCount){var h=(void 0===e.height?e.maxHeight:e.height)-(e.headerHeight||0)-(e.footerHeight||0)-(e.groupHeaderHeight||0);this._scrollHelper=new p(e.rowsCount,e.rowHeight,h,e.rowHeightGetter);var f=this._scrollHelper.scrollToRow(a,l);a=f.index,l=f.offset,s=f.position}else t&&e.rowHeightGetter!==t.rowHeightGetter&&this._scrollHelper.setRowHeightGetter(e.rowHeightGetter);var m;m=e.isColumnResizing?t&&t.columnResizingData:x;var v,g;if(r){var y=d.adjustColumnGroupWidths(o,e.width);v=y.columns,g=y.columnGroups}else v=d.adjustColumnWidths(o,e.width);var w=this._populateColumnsAndColumnData(v,g,t);if(void 0!==this._columnToScrollTo){var b=w.bodyFixedColumns.length;if(this._columnToScrollTo>=b){var C,S,D=0;for(C=0;CO&&(i=O)}delete this._columnToScrollTo}var k=void 0===e.height,P=Math.round(k?e.maxHeight:e.height),z=e.footerHeight+e.headerHeight+c+2*E,I=P-z,j=this._scrollHelper.getContentHeight(),A=j+z,F=d.getTotalWidth(v),L=F>e.width&&"hidden"!==e.overflowX;L&&(I-=u.SIZE,A+=u.SIZE,z+=u.SIZE);var G=Math.max(0,F-e.width),W=Math.max(0,j-I);i=Math.min(i,G),s=Math.min(s,W),W||(k&&(P=A),I=A-z),this._scrollHelper.setViewportHeight(I);var V=n({isColumnResizing:t&&t.isColumnResizing},w,e,{columns:v,columnGroups:g,columnResizingData:m,firstRowIndex:a,firstRowOffset:l,horizontalScrollbarVisible:L,maxScrollX:G,maxScrollY:W,reservedHeight:z,scrollContentHeight:j,scrollX:i,scrollY:s,bodyHeight:I,height:P,groupHeaderHeight:c,useGroupHeader:r});return V},_selectColumnElement:function(e,t){for(var o=[],n=0;nMath.abs(e)&&"hidden"!==this.props.overflowY){var n=this._scrollHelper.scrollBy(Math.round(t)),r=Math.max(0,n.contentHeight-this.state.bodyHeight);this.setState({firstRowIndex:n.index,firstRowOffset:n.offset,scrollY:n.position,scrollContentHeight:n.contentHeight,maxScrollY:r})}else e&&"hidden"!==this.props.overflowX&&(o+=e,o=o<0?0:o,o=o>this.state.maxScrollX?this.state.maxScrollX:o,this.setState({scrollX:o}));this._didScroll(),this._didScrollStop()}},_onHorizontalScroll:function(e){this._isMounted&&e!==this.state.scrollX&&(this._isScrolling||this._didScrollStart(),this.setState({scrollX:e}),this._didScroll(),this._didScrollStop())},_onVerticalScroll:function(e){if(this._isMounted&&e!==this.state.scrollY){this._isScrolling||this._didScrollStart();var t=this._scrollHelper.scrollTo(Math.round(e));this.setState({firstRowIndex:t.index,firstRowOffset:t.offset,scrollY:t.position,scrollContentHeight:t.contentHeight}),this._didScroll(),this._didScrollStop()}},_didScrollStart:function(){this._isMounted&&!this._isScrolling&&(this._isScrolling=!0,this.props.onScrollStart&&this.props.onScrollStart(this.state.scrollX,this.state.scrollY))},_didScroll:function(){this._isMounted&&this._isScrolling&&this.props.onScroll&&this.props.onScroll(this.state.scrollX,this.state.scrollY)},_didScrollStop:function(){this._isMounted&&this._isScrolling&&(this._isScrolling=!1,this.setState({redraw:!0}),this.props.onScrollEnd&&this.props.onScrollEnd(this.state.scrollX,this.state.scrollY))},setHoverState:function(e){this.setState({isHoveringResizerKnob:e})}}),H=s({displayName:"HorizontalScrollbar",mixins:[a],propTypes:{contentSize:r.number.isRequired,offset:r.number.isRequired,onScroll:r.func.isRequired,position:r.number.isRequired,size:r.number.isRequired},render:function(){var e=n({height:u.SIZE,width:this.props.size},this.props.horizontalScrollbarStyle),t={height:u.SIZE,position:"absolute",overflow:"hidden",width:this.props.size};return b(t,0,this.props.offset),i.createElement("div",{className:y(m("fixedDataTableLayout/horizontalScrollbar"),m("public/fixedDataTable/horizontalScrollbar")),style:e},i.createElement("div",{ -style:t},i.createElement(u,n({},this.props,{isOpaque:!0,orientation:"horizontal",offset:void 0}))))}});e.exports=O},function(e,t,o){"use strict";var n=o(35),r=o(38);if("undefined"==typeof n)throw Error("create-react-class could not find the React object. If you are using script tags, make sure that React is being loaded before create-react-class.");var i=(new n.Component).updater;e.exports=r(n.Component,n.isValidElement,i)},function(e,t,o){(function(t){"use strict";function n(e){return e}function r(e,o,r){function h(e,o,n){for(var r in o)o.hasOwnProperty(r)&&"production"!==t.env.NODE_ENV&&l("function"==typeof o[r],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",e.displayName||"ReactClass",u[n],r)}function f(e,t){var o=C.hasOwnProperty(t)?C[t]:null;D.hasOwnProperty(t)&&a("OVERRIDE_BASE"===o,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&a("DEFINE_MANY"===o||"DEFINE_MANY_MERGED"===o,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function p(e,n){if(n){a("function"!=typeof n,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),a(!o(n),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=e.prototype,i=r.__reactAutoBindPairs;n.hasOwnProperty(c)&&x.mixins(e,n.mixins);for(var s in n)if(n.hasOwnProperty(s)&&s!==c){var u=n[s],h=r.hasOwnProperty(s);if(f(h,s),x.hasOwnProperty(s))x[s](e,u);else{var p=C.hasOwnProperty(s),d="function"==typeof u,m=d&&!p&&!h&&n.autobind!==!1;if(m)i.push(s,u),r[s]=u;else if(h){var _=C[s];a(p&&("DEFINE_MANY_MERGED"===_||"DEFINE_MANY"===_),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",_,s),"DEFINE_MANY_MERGED"===_?r[s]=v(r[s],u):"DEFINE_MANY"===_&&(r[s]=g(r[s],u))}else r[s]=u,"production"!==t.env.NODE_ENV&&"function"==typeof u&&n.displayName&&(r[s].displayName=n.displayName+"_"+s)}}}else if("production"!==t.env.NODE_ENV){var y=typeof n,w="object"===y&&null!==n;"production"!==t.env.NODE_ENV&&l(w,"%s: You're attempting to include a mixin that is either null or not an object. Check the mixins included by the component, as well as any mixins they include themselves. Expected object but got %s.",e.displayName||"ReactClass",null===n?null:y)}}function d(e,t){if(t)for(var o in t){var n=t[o];if(t.hasOwnProperty(o)){var r=o in x;a(!r,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',o);var i=o in e;if(i){var s=R.hasOwnProperty(o)?R[o]:null;return a("DEFINE_MANY_MERGED"===s,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",o),void(e[o]=v(e[o],n))}e[o]=n}}}function m(e,t){a(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var o in t)t.hasOwnProperty(o)&&(a(void 0===e[o],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",o),e[o]=t[o]);return e}function v(e,t){return function(){var o=e.apply(this,arguments),n=t.apply(this,arguments);if(null==o)return n;if(null==n)return o;var r={};return m(r,o),m(r,n),r}}function g(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function _(e,o){var n=o.bind(e);if("production"!==t.env.NODE_ENV){n.__reactBoundContext=e,n.__reactBoundMethod=o,n.__reactBoundArguments=null;var r=e.constructor.displayName,i=n.bind;n.bind=function(s){for(var a=arguments.length,u=Array(a>1?a-1:0),c=1;c1?t-1:0),n=1;n2?o-2:0),r=2;rn},ie64:function(){return y.ie()&&p},firefox:function(){return o()||r},opera:function(){return o()||i},webkit:function(){return o()||s},safari:function(){return y.webkit()},chrome:function(){return o()||a},windows:function(){return o()||c},osx:function(){return o()||u},linux:function(){return o()||h},iphone:function(){return o()||d},mobile:function(){return o()||d||m||f||g},nativeApp:function(){return o()||v},android:function(){return o()||f},ipad:function(){return o()||m}};e.exports=y},function(e,t,o){"use strict";function n(e,t){if(!i.canUseDOM||t&&!("addEventListener"in document))return!1;var o="on"+e,n=o in document;if(!n){var s=document.createElement("div");s.setAttribute(o,"return;"),n="function"==typeof s[o]}return!n&&r&&"wheel"===e&&(n=document.implementation.hasFeature("Events.wheel","3.0")),n}var r,i=o(49);i.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),e.exports=n},function(e,t){"use strict";var o=!("undefined"==typeof window||!window.document||!window.document.createElement),n={canUseDOM:o,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:o&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:o&&!!window.screen,isInWorker:!o};e.exports=n},function(e,t,o){(function(t){"use strict";var n=o(45),r=o(51),i=0,s=r||function(e){var o=Date.now(),n=Math.max(0,16-(o-i));return i=o+n,t.setTimeout(function(){e(Date.now())},n)};s(n),e.exports=s}).call(t,function(){return this}())},function(e,t){(function(t){"use strict";var o=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame;e.exports=o}).call(t,function(){return this}())},function(e,t,o){"use strict";var n=o(53),r=o(56),i=o(27),s=o(34),a=o(37),l=o(57),u=o(43),c=o(44),h=o(59),f=o(60),p=o(45),d=o(61),m={position:0,scrollable:!1},v=parseInt(h("scrollbar-face-margin"),10),g=2*v,_=30,y=40,w=null,b=a({displayName:"Scrollbar",mixins:[u],propTypes:{contentSize:i.number.isRequired,defaultPosition:i.number,isOpaque:i.bool,orientation:i.oneOf(["vertical","horizontal"]),onScroll:i.func,position:i.number,size:i.number.isRequired,trackColor:i.oneOf(["gray"]),zIndex:i.number,verticalTop:i.number},getInitialState:function(){var e=this.props;return this._calculateState(e.position||e.defaultPosition||0,e.size,e.contentSize,e.orientation)},componentWillReceiveProps:function(e){var t=e.position;void 0===t?this._setNextState(this._calculateState(this.state.position,e.size,e.contentSize,e.orientation)):this._setNextState(this._calculateState(t,e.size,e.contentSize,e.orientation),e)},getDefaultProps:function(){return{defaultPosition:0,isOpaque:!1,onScroll:p,orientation:"vertical",zIndex:99}},render:function(){if(!this.state.scrollable)return null;var e,t,o=this.props.size,n=this.state.isHorizontal,r=!n,i=this.state.focused||this.state.isDragging,a=this.state.faceSize,l=this.props.isOpaque,u=this.props.verticalTop||0,c=f({"ScrollbarLayout/main":!0,"ScrollbarLayout/mainVertical":r,"ScrollbarLayout/mainHorizontal":n,"public/Scrollbar/main":!0,"public/Scrollbar/mainOpaque":l,"public/Scrollbar/mainActive":i}),p=f({"ScrollbarLayout/face":!0,"ScrollbarLayout/faceHorizontal":n,"ScrollbarLayout/faceVertical":r,"public/Scrollbar/faceActive":i,"public/Scrollbar/face":!0}),m=this.state.position*this.state.scale+v;return n?(e={width:o},t={width:a-g},d(t,m,0)):(e={top:u,height:o},t={height:a-g},d(t,0,m)),e.zIndex=this.props.zIndex,"gray"===this.props.trackColor&&(e.backgroundColor=h("fbui-desktop-background-light")),s.createElement("div",{onFocus:this._onFocus,onBlur:this._onBlur,onKeyDown:this._onKeyDown,onMouseDown:this._onMouseDown,onWheel:this._wheelHandler.onWheel,className:c,style:e,tabIndex:0},s.createElement("div",{ref:"face",className:p,style:t}))},componentWillMount:function(){var e="horizontal"===this.props.orientation,t=e?this._onWheelX:this._onWheelY;this._wheelHandler=new c(t,this._shouldHandleX,this._shouldHandleY)},componentDidMount:function(){this._mouseMoveTracker=new n(this._onMouseMove,this._onMouseMoveEnd,document.documentElement),void 0!==this.props.position&&this.state.position!==this.props.position&&this._didScroll(),this._isMounted=!0},componentWillUnmount:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),w===this&&(w=null),delete this._mouseMoveTracker,this._isMounted=!1},scrollBy:function(e){this._onWheel(e)},_shouldHandleX:function(e){return"horizontal"===this.props.orientation&&this._shouldHandleChange(e)},_shouldHandleY:function(e){return"horizontal"!==this.props.orientation&&this._shouldHandleChange(e)},_shouldHandleChange:function(e){var t=this._calculateState(this.state.position+e,this.props.size,this.props.contentSize,this.props.orientation);return t.position!==this.state.position},_calculateState:function(e,t,o,n){if(t<1||o<=t)return m;var r=e+"_"+t+"_"+o+"_"+n;if(this._stateKey===r)return this._stateForKey;var i="horizontal"===n,s=t/o,a=t*s;a<_&&(s=(t-_)/(o-t),a=_);var l=!0,u=o-t;e<0?e=0:e>u&&(e=u);var c=!!this._mouseMoveTracker&&this._mouseMoveTracker.isDragging(),h={faceSize:a,isDragging:c,isHorizontal:i,position:e,scale:s,scrollable:l};return this._stateKey=r,this._stateForKey=h,h},_onWheelY:function(e,t){this._onWheel(t)},_onWheelX:function(e,t){this._onWheel(e)},_onWheel:function(e){var t=this.props;this._setNextState(this._calculateState(this.state.position+e,t.size,t.contentSize,t.orientation))},_onMouseDown:function(e){var t;if(e.target!==l.findDOMNode(this.refs.face)){var o=e.nativeEvent,n=this.state.isHorizontal?o.offsetX||o.layerX:o.offsetY||o.layerY,r=this.props;n/=this.state.scale,t=this._calculateState(n-.5*this.state.faceSize/this.state.scale,r.size,r.contentSize,r.orientation)}else t={};t.focused=!0,this._setNextState(t),this._mouseMoveTracker.captureMouseMoves(e),l.findDOMNode(this).focus()},_onMouseMove:function(e,t){var o=this.props,n=this.state.isHorizontal?e:t;n/=this.state.scale,this._setNextState(this._calculateState(this.state.position+n,o.size,o.contentSize,o.orientation))},_onMouseMoveEnd:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),this.setState({isDragging:!1})},_onKeyDown:function(e){var t=e.keyCode;if(t!==r.TAB){var o=y,n=0;if(this.state.isHorizontal)switch(t){case r.HOME:n=-1,o=this.props.contentSize;break;case r.LEFT:n=-1;break;case r.RIGHT:n=1;break;default:return}if(!this.state.isHorizontal)switch(t){case r.SPACE:n=e.shiftKey?-1:1;break;case r.HOME:n=-1,o=this.props.contentSize;break;case r.UP:n=-1;break;case r.DOWN:n=1;break;case r.PAGE_UP:n=-1,o=this.props.size;break;case r.PAGE_DOWN:n=1,o=this.props.size;break;default:return}e.preventDefault();var i=this.props;this._setNextState(this._calculateState(this.state.position+o*n,i.size,i.contentSize,i.orientation))}},_onFocus:function(){this.setState({focused:!0})},_onBlur:function(){this.setState({focused:!1})},_blur:function(){if(this._isMounted)try{this._onBlur(),l.findDOMNode(this).blur()}catch(e){}},_setNextState:function(e,t){t=t||this.props;var o=t.position,n=this.state.position!==e.position;if(void 0===o){var r=n?this._didScroll:void 0;this.setState(e,r)}else{if(o!==e.position)return void(void 0!==e.position&&e.position!==this.state.position&&this.props.onScroll(e.position));this.setState(e)}n&&w!==this&&(w&&w._blur(),w=this)},_didScroll:function(){this.props.onScroll(this.state.position)}});b.KEYBOARD_SCROLL_AMOUNT=y,b.SIZE=parseInt(h("scrollbar-size"),10),e.exports=b},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var o=0;o0;)this._addRowToBuffer(t,this._viewportRowsBegin,this._viewportRowsEnd-1),t++,e--;return this._rows}},{key:"getRows",value:function(e,t){var o=t,n=o,r=e,i=Math.min(e+this._maxVisibleRowCount,this._rowsCount);for(this._viewportRowsBegin=e;r=i&&(n=this._bufferSet.replaceFurthestValuePosition(t,o,e)),null===n?(n=this._bufferSet.getNewPositionForValue(e),this._rows[n]=e):this._rows[n]=e}}]),e}();e.exports=c},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var o=0;o=e&&r<=t)return null;var i;e-n>r-t?(i=n,this._smallValues.pop()):(i=r,this._largeValues.pop());var a=this._valueToPositionMap[i];return delete this._valueToPositionMap[i],this._valueToPositionMap[o]=a,this._pushToHeaps(a,o),a}},{key:"_pushToHeaps",value:function(e,t){var o={position:e,value:t};this._smallValues.push(o),this._largeValues.push(o)}},{key:"_cleanHeaps",value:function(){this._cleanHeap(this._smallValues),this._cleanHeap(this._largeValues);var e=Math.min(this._smallValues.size(),this._largeValues.size()),t=Math.max(this._smallValues.size(),this._largeValues.size());t>10*e&&this._recreateHeaps()}},{key:"_recreateHeaps",value:function(){for(var e=this._smallValues.size()t.value}}]),e}();e.exports=a},function(e,t){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){return e0&&(this._items[0]=t,this._sinkDown(0)),e}}},{key:"push",value:function(e){this._items[this._size++]=e,this._bubbleUp(this._size-1)}},{key:"size",value:function(){return this._size}},{key:"peek",value:function(){if(0!==this._size)return this._items[0]}},{key:"_heapify",value:function(){for(var e=Math.floor((this._size+1)/2);e>=0;e--)this._sinkDown(e)}},{key:"_bubbleUp",value:function(e){for(var t=this._items[e];e>0;){var o=Math.floor((e+1)/2)-1,n=this._items[o];if(this._comparator(n,t))return;this._items[o]=t,this._items[e]=n,e=o}}},{key:"_sinkDown",value:function(e){for(var t=this._items[e];;){var o=2*(e+1)-1,n=2*(e+1),r=-1;if(oo?o:e}e.exports=o},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=Object.assign||function(e){for(var t=1;t0){var o=h({"fixedDataTableRowLayout/fixedColumnsDivider":!0,"fixedDataTableRowLayout/columnsShadow":e.props.scrollLeft>0,"public/fixedDataTableRow/fixedColumnsDivider":!0,"public/fixedDataTableRow/columnsShadow":e.props.scrollLeft>0}),n={left:t,height:e.props.height};return u.createElement("div",{className:o,style:n})}},this._onClick=function(t){e.props.onClick(t,e.props.index)},this._onDoubleClick=function(t){e.props.onDoubleClick(t,e.props.index)},this._onMouseDown=function(t){e.props.onMouseDown(t,e.props.index)},this._onMouseEnter=function(t){e.props.onMouseEnter(t,e.props.index)},this._onMouseLeave=function(t){e.props.onMouseLeave(t,e.props.index)}}return r(t,e),s(t,[{key:"render",value:function(){var e={width:this.props.width,height:this.props.height},t=h({"fixedDataTableRowLayout/main":!0,"public/fixedDataTableRow/main":!0,"public/fixedDataTableRow/highlighted":this.props.index%2===1,"public/fixedDataTableRow/odd":this.props.index%2===1,"public/fixedDataTableRow/even":this.props.index%2===0}),o=this._getColumnsWidth(this.props.fixedColumns),n=u.createElement(c,{key:"fixed_cells",isScrolling:this.props.isScrolling,height:this.props.height,left:0,width:o,zIndex:2,columns:this.props.fixedColumns,onColumnResize:this.props.onColumnResize,isHoveringResizerKnob:this.props.isHoveringResizerKnob,setHoverState:this.props.setHoverState,rowHeight:this.props.height,rowIndex:this.props.index}),r=this._renderColumnsShadow(o),i=u.createElement(c,{key:"scrollable_cells",isScrolling:this.props.isScrolling,height:this.props.height,left:this.props.scrollLeft,offsetLeft:o,width:this.props.width-o,zIndex:0,columns:this.props.scrollableColumns,onColumnResize:this.props.onColumnResize,rowHeight:this.props.height,rowIndex:this.props.index});return u.createElement("div",{className:f(t,this.props.className),onClick:this.props.onClick?this._onClick:null,onDoubleClick:this.props.onDoubleClick?this._onDoubleClick:null,onMouseDown:this.props.onMouseDown?this._onMouseDown:null,onMouseEnter:this.props.onMouseEnter?this._onMouseEnter:null,onMouseLeave:this.props.onMouseLeave?this._onMouseLeave:null,style:e},u.createElement("div",{className:h("fixedDataTableRowLayout/body")},n,i,r))}}],[{key:"propTypes",value:{isScrolling:l.bool,fixedColumns:l.array.isRequired,height:l.number.isRequired,index:l.number.isRequired,scrollableColumns:l.array.isRequired,scrollLeft:l.number.isRequired,width:l.number.isRequired,onClick:l.func,onDoubleClick:l.func,onColumnResize:l.func},enumerable:!0}]),t}(u.Component),m=function(e){function t(){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return r(t,e),s(t,[{key:"render",value:function(){var e={width:this.props.width,height:this.props.height,zIndex:this.props.zIndex?this.props.zIndex:0,opacity:this.props.isColumnResizing?.4:1};return p(e,0,this.props.offsetTop),u.createElement("div",{style:e,className:h("fixedDataTableRowLayout/rowWrapper")},u.createElement(d,i({},this.props,{offsetTop:void 0,zIndex:void 0})))}}],[{key:"propTypes",value:{isScrolling:l.bool,height:l.number.isRequired,zIndex:l.number,offsetTop:l.number.isRequired,width:l.number.isRequired},enumerable:!0}]),t}(u.Component);e.exports=m},function(e,t,o){"use strict";function n(e,t){var o={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}var r=Object.assign||function(e){for(var t=1;t=0){var l="cell_"+r;o[r]=this._renderCell(e.rowIndex,e.rowHeight,s,n,l)}n+=s.width}var u=this._getColumnsWidth(t),p={height:e.height,position:"absolute",width:u,zIndex:e.zIndex};return h(p,-1*f*e.left,0),a.createElement("div",{className:c("fixedDataTableCellGroupLayout/cellGroup"),style:p},o)},_renderCell:function(e,t,o,n,r){var i=o.isResizable&&this.props.onColumnResize,s=i?this.props.onColumnResize:null,l=o.cellClassName;return a.createElement(u,{isScrolling:this.props.isScrolling,align:o.align,className:l,height:t,key:r,maxWidth:o.maxWidth,minWidth:o.minWidth,onColumnResize:s,isHoveringResizerKnob:this.props.isHoveringResizerKnob,setHoverState:this.props.setHoverState,rowIndex:e,columnKey:o.columnKey,width:o.width,left:n,cell:o.cell})},_getColumnsWidth:function(e){for(var t=0,o=0;o=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}var r=o(78),i=o(73),s=o(27),a=o(34),l=o(37),u=o(60),c=o(79),h=i.DIR_SIGN,f={align:"left",highlighted:!1},p=l({displayName:"FixedDataTableCell",propTypes_DISABLED_FOR_PERFORMANCE:{isScrolling:s.bool,align:s.oneOf(["left","center","right"]),className:s.string,highlighted:s.bool,width:s.number.isRequired,minWidth:s.number,maxWidth:s.number,height:s.number.isRequired,cell:s.oneOfType([s.string,s.element,s.func]),columnKey:s.oneOfType([s.string,s.number]),rowIndex:s.number.isRequired,onColumnResize:s.func,left:s.number},shouldComponentUpdate:function(e){return!e.isScrolling||this.props.rowIndex!==e.rowIndex},getDefaultProps:function(){return f},render:function(){var e=this.props,t=e.height,o=e.width,i=e.columnKey,s=n(e,["height","width","columnKey"]),l={height:t,width:o};1===h?l.left=s.left:l.right=s.left;var f,p=c(u({"fixedDataTableCellLayout/main":!0,"fixedDataTableCellLayout/lastChild":s.lastChild,"fixedDataTableCellLayout/alignRight":"right"===s.align,"fixedDataTableCellLayout/alignCenter":"center"===s.align,"public/fixedDataTableCell/alignRight":"right"===s.align,"public/fixedDataTableCell/highlighted":s.highlighted,"public/fixedDataTableCell/main":!0}),s.className);if(s.onColumnResize){var d={height:t,opacity:s.isHoveringResizerKnob?1:0};console.log("isHovering: ",s.isHoveringResizerKnob),console.log("isHoveringResizerKnob: ",s.isHoveringResizerKnob),f=a.createElement("div",{className:u("fixedDataTableCellLayout/columnResizerContainer"),style:d,onMouseDown:this._onColumnResizerMouseDown,onMouseEnter:function(){return s.setHoverState(!0)},onMouseLeave:function(){return s.setHoverState(!1)}},a.createElement("div",{className:c(u("fixedDataTableCellLayout/columnResizerKnob"),u("public/fixedDataTableCell/columnResizerKnob")),style:d}))}var m={columnKey:i,height:t,width:o};s.rowIndex>=0&&(m.rowIndex=s.rowIndex);var v;return a.isValidElement(s.cell)?("div"===s.cell.type&&delete m.columnKey,v=a.cloneElement(s.cell,m)):v="function"==typeof s.cell?s.cell(m):a.createElement(r,m,s.cell),a.createElement("div",{className:p,style:l},f,v)},_onColumnResizerMouseDown:function(e){this.props.onColumnResize(this.props.left,this.props.width,this.props.minWidth,this.props.maxWidth,this.props.columnKey,e)}});e.exports=p},function(e,t,o){"use strict";function n(e,t){var o={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=Object.assign||function(e){for(var t=1;t1)for(var n=1;n=0&&t>=e-a;){var o=this._updateRowHeight(t);this._position+=o,t--}}},{key:"_updateRowHeight",value:function(e){if(e<0||e>=this._rowCount)return 0;var t=this._rowHeightGetter(e);if(t!==this._storedHeights[e]){var o=t-this._storedHeights[e];return this._rowOffsets.set(e,t),this._storedHeights[e]=t,this._contentHeight+=o,o}return 0}},{key:"getRowPosition",value:function(e){return this._updateRowHeight(e),this._rowOffsets.sumUntil(e)}},{key:"scrollBy",value:function(e){if(0===this._rowCount)return l;var t=this._rowOffsets.greatestLowerBound(this._position);t=s(t,0,Math.max(this._rowCount-1,0));var o=this._rowOffsets.sumUntil(t),n=t,r=this._position,i=this._updateRowHeight(n);0!==o&&(r+=i);var a=this._storedHeights[n]-(r-o);if(e>=0)for(;e>0&&n0&&n>=0;)if(e=0){var c=this._updateRowHeight(n);u=this._storedHeights[n],r+=c}}var h=this._contentHeight-this._viewportHeight;r=s(r,0,h),this._position=r;var f=this._rowOffsets.greatestLowerBound(r);f=s(f,0,Math.max(this._rowCount-1,0)),o=this._rowOffsets.sumUntil(f);var p=o-r;return this._updateHeightsInViewport(f,p),this._updateHeightsAboveViewport(f),{index:f,offset:p,position:this._position,contentHeight:this._contentHeight}}},{key:"_getRowAtEndPosition",value:function(e){this._updateRowHeight(e);for(var t=e,o=this._storedHeights[t];o=0;)t--,t>=0&&(this._updateRowHeight(t),o+=this._storedHeights[t]);var n=this._rowOffsets.sumTo(e)-this._viewportHeight;return n<0&&(n=0),n}},{key:"scrollTo",value:function(e){if(0===this._rowCount)return l;if(e<=0)return this._position=0,this._updateHeightsInViewport(0,0),{index:0,offset:0,position:this._position,contentHeight:this._contentHeight};if(e>=this._contentHeight-this._viewportHeight){var t=this._rowCount-1;e=this._getRowAtEndPosition(t)}this._position=e;var o=this._rowOffsets.greatestLowerBound(e);o=s(o,0,Math.max(this._rowCount-1,0));var n=this._rowOffsets.sumUntil(o),r=n-e;return this._updateHeightsInViewport(o,r),this._updateHeightsAboveViewport(o),{index:o,offset:r,position:this._position,contentHeight:this._contentHeight}}},{key:"scrollToRow",value:function(e,t){e=s(e,0,Math.max(this._rowCount-1,0)),t=s(t,-this._storedHeights[e],0);var o=this._rowOffsets.sumUntil(e);return this.scrollTo(o-t)}},{key:"scrollRowIntoView",value:function(e){e=s(e,0,Math.max(this._rowCount-1,0));var t=this._rowOffsets.sumUntil(e),o=t+this._storedHeights[e];if(t=0;--o)t[o]=0;return t},u=function(){function e(t){n(this,e),this._size=t.length,this._half=r(this._size),this._heap=new l(2*this._half);var o;for(o=0;o0;--o)this._heap[o]=this._heap[2*o]+this._heap[2*o+1]}return i(e,[{key:"set",value:function(e,t){s(0<=e&&e=0;--r)n[r]=o;return new e(n)}},{key:"empty",value:function(t){return e.uniform(t,0)}}]),e}();e.exports=u}).call(t,function(){return this}())},function(e,t,o){"use strict";function n(e){for(var t=0,o=0;o1)for(var o=1;o0||e>=0&&this.state.scrollX0||e>=0&&this.state.scrollYn?n:this.state.height>n&&this.props.ownerHeight?Math.max(n,this.props.ownerHeight):this.state.height+this.state.maxScrollY,e!==this._contentHeight&&this.props.onContentHeightChange&&this.props.onContentHeightChange(e),this._contentHeight=e},componentDidMount:function(){this._reportContentHeight(),this._isMounted=!0},componentWillReceiveProps:function(e){var t=e.scrollToRow;void 0!==t&&null!==t&&(this._rowToScrollTo=t);var o=e.scrollToColumn;void 0!==o&&null!==o&&(this._columnToScrollTo=o);var n=e.overflowX,r=e.overflowY;n===this.props.overflowX&&r===this.props.overflowY||(this._wheelHandler=new u(this._onWheel,"hidden"!==n,"hidden"!==r)),this.props.ownerHeight===e.ownerHeight&&this.props.scrollTop===e.scrollTop||this._didScrollStart(),this._didScroll(),this._didScrollStop(),this.setState(this._calculateState(e,this.state))},componentDidUpdate:function(){this._reportContentHeight()},render:function(){var e,t=this.state,o=this.props;t.useGroupHeader&&(e=s.createElement(p,{key:"group_header",isScrolling:this._isScrolling,className:w(v("fixedDataTableLayout/header"),v("public/fixedDataTable/header")),width:t.width,height:t.groupHeaderHeight,index:0,zIndex:1,offsetTop:0,scrollLeft:t.scrollX,fixedColumns:t.groupHeaderFixedColumns,scrollableColumns:t.groupHeaderScrollableColumns,onColumnResize:this._onColumnResize,setHoverState:this.setHoverState,isColumnResizing:t.isColumnResizing}));var i=this.state.maxScrollY,a=t.maxScrollX>0&&"hidden"!==t.overflowX,l=i>0&&"hidden"!==t.overflowY,u=a?c.SIZE:0,h=t.height-u-2*S-t.footerHeight,d=t.useGroupHeader?t.groupHeaderHeight:0,m=d+t.headerHeight;h-=m;var g=0,_=null!=o.maxHeight?m+t.bodyHeight:m+h,y=_+t.footerHeight;void 0!==o.ownerHeight&&o.ownerHeightt.ownerHeight||t.scrollY or "),o.push(e))});var n=!1;o.length&&o[0].type.__TableColumnGroup__&&(n=!0),t&&(void 0!==e.width&&e.width!==t.width||void 0!==e.height&&e.height!==t.height||void 0!==e.maxWidth&&e.maxWidth!==t.maxWidth||void 0!==e.maxHeight&&e.maxHeight!==t.maxHeight)&&(t=null);var i,s,a=t&&t.firstRowIndex||0,l=t&&t.firstRowOffset||0;i=t&&"hidden"!==e.overflowX?t.scrollX:e.scrollLeft,t&&"hidden"!==e.overflowY?s=t.scrollY:(f=this._scrollHelper.scrollTo(e.scrollTop),a=f.index,l=f.offset,s=f.position),void 0!==this._rowToScrollTo&&(f=this._scrollHelper.scrollRowIntoView(this._rowToScrollTo),a=f.index,l=f.offset,s=f.position,delete this._rowToScrollTo);var u=n?e.groupHeaderHeight:0;if(t&&e.rowsCount!==t.rowsCount){var h=(void 0===e.height?e.maxHeight:e.height)-(e.headerHeight||0)-(e.footerHeight||0)-(e.groupHeaderHeight||0);this._scrollHelper=new d(e.rowsCount,e.rowHeight,h,e.rowHeightGetter);var f=this._scrollHelper.scrollToRow(a,l);a=f.index,l=f.offset,s=f.position}else t&&e.rowHeightGetter!==t.rowHeightGetter&&this._scrollHelper.setRowHeightGetter(e.rowHeightGetter);var p;p=e.isColumnResizing?t&&t.columnResizingData:E;var v,g;if(n){var _=m.adjustColumnGroupWidths(o,e.width);v=_.columns,g=_.columnGroups}else v=m.adjustColumnWidths(o,e.width);var w=this._populateColumnsAndColumnData(v,g,t);if(void 0!==this._columnToScrollTo){var b=w.bodyFixedColumns.length;if(this._columnToScrollTo>=b){var x,C,T=0;for(x=0;xO&&(i=O)}delete this._columnToScrollTo}var k=void 0===e.height,P=Math.round(k?e.maxHeight:e.height),z=e.footerHeight+e.headerHeight+u+2*S,I=P-z,j=this._scrollHelper.getContentHeight(),A=j+z,F=m.getTotalWidth(v),L=F>e.width&&"hidden"!==e.overflowX;L&&(I-=c.SIZE,A+=c.SIZE,z+=c.SIZE);var G=Math.max(0,F-e.width),W=Math.max(0,j-I);i=Math.min(i,G),s=Math.min(s,W),W||(k&&(P=A),I=A-z),this._scrollHelper.setViewportHeight(I);var V=r({isColumnResizing:t&&t.isColumnResizing},w,e,{columns:v,columnGroups:g,columnResizingData:p,firstRowIndex:a,firstRowOffset:l,horizontalScrollbarVisible:L,maxScrollX:G,maxScrollY:W,reservedHeight:z,scrollContentHeight:j,scrollX:i,scrollY:s,bodyHeight:I,height:P,groupHeaderHeight:u,useGroupHeader:n});return V},_selectColumnElement:function(e,t){for(var o=[],n=0;nMath.abs(e)&&"hidden"!==this.props.overflowY){var n=this._scrollHelper.scrollBy(Math.round(t)),r=Math.max(0,n.contentHeight-this.state.bodyHeight);this.setState({firstRowIndex:n.index,firstRowOffset:n.offset,scrollY:n.position,scrollContentHeight:n.contentHeight,maxScrollY:r})}else e&&"hidden"!==this.props.overflowX&&(o+=e,o=o<0?0:o,o=o>this.state.maxScrollX?this.state.maxScrollX:o,this.setState({scrollX:o}));this._didScroll(),this._didScrollStop()}},_onHorizontalScroll:function(e){this._isMounted&&e!==this.state.scrollX&&(this._isScrolling||this._didScrollStart(),this.setState({scrollX:e}),this._didScroll(),this._didScrollStop())},_onVerticalScroll:function(e){if(this._isMounted&&e!==this.state.scrollY){this._isScrolling||this._didScrollStart();var t=this._scrollHelper.scrollTo(Math.round(e));this.setState({firstRowIndex:t.index,firstRowOffset:t.offset,scrollY:t.position,scrollContentHeight:t.contentHeight}),this._didScroll(),this._didScrollStop()}},_didScrollStart:function(){this._isMounted&&!this._isScrolling&&(this._isScrolling=!0,this.props.onScrollStart&&this.props.onScrollStart(this.state.scrollX,this.state.scrollY))},_didScroll:function(){this._isMounted&&this._isScrolling&&this.props.onScroll&&this.props.onScroll(this.state.scrollX,this.state.scrollY)},_didScrollStop:function(){this._isMounted&&this._isScrolling&&(this._isScrolling=!1,this.setState({redraw:!0}),this.props.onScrollEnd&&this.props.onScrollEnd(this.state.scrollX,this.state.scrollY))},setHoverState:function(e){this.setState({isHoveringResizerKnob:e})}}),M=a({displayName:"HorizontalScrollbar",mixins:[l],propTypes:{contentSize:i.number.isRequired,offset:i.number.isRequired,onScroll:i.func.isRequired,position:i.number.isRequired,size:i.number.isRequired},render:function(){var e=r({height:c.SIZE,width:this.props.size},this.props.horizontalScrollbarStyle),t={height:c.SIZE, +position:"absolute",overflow:"hidden",width:this.props.size};return x(t,0,this.props.offset),s.createElement("div",{className:w(v("fixedDataTableLayout/horizontalScrollbar"),v("public/fixedDataTable/horizontalScrollbar")),style:e},s.createElement("div",{style:t},s.createElement(c,r({},this.props,{isOpaque:!0,orientation:"horizontal",offset:void 0}))))}});e.exports=H},function(e,t,o){"use strict";var n=o(35),r=o(38);if("undefined"==typeof n)throw Error("create-react-class could not find the React object. If you are using script tags, make sure that React is being loaded before create-react-class.");var i=(new n.Component).updater;e.exports=r(n.Component,n.isValidElement,i)},function(e,t,o){(function(t){"use strict";function n(e){return e}function r(e,o,r){function h(e,o,n){for(var r in o)o.hasOwnProperty(r)&&"production"!==t.env.NODE_ENV&&l("function"==typeof o[r],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",e.displayName||"ReactClass",u[n],r)}function f(e,t){var o=x.hasOwnProperty(t)?x[t]:null;T.hasOwnProperty(t)&&a("OVERRIDE_BASE"===o,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&a("DEFINE_MANY"===o||"DEFINE_MANY_MERGED"===o,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function p(e,n){if(n){a("function"!=typeof n,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),a(!o(n),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=e.prototype,i=r.__reactAutoBindPairs;n.hasOwnProperty(c)&&R.mixins(e,n.mixins);for(var s in n)if(n.hasOwnProperty(s)&&s!==c){var u=n[s],h=r.hasOwnProperty(s);if(f(h,s),R.hasOwnProperty(s))R[s](e,u);else{var p=x.hasOwnProperty(s),d="function"==typeof u,m=d&&!p&&!h&&n.autobind!==!1;if(m)i.push(s,u),r[s]=u;else if(h){var _=x[s];a(p&&("DEFINE_MANY_MERGED"===_||"DEFINE_MANY"===_),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",_,s),"DEFINE_MANY_MERGED"===_?r[s]=v(r[s],u):"DEFINE_MANY"===_&&(r[s]=g(r[s],u))}else r[s]=u,"production"!==t.env.NODE_ENV&&"function"==typeof u&&n.displayName&&(r[s].displayName=n.displayName+"_"+s)}}}else if("production"!==t.env.NODE_ENV){var y=typeof n,w="object"===y&&null!==n;"production"!==t.env.NODE_ENV&&l(w,"%s: You're attempting to include a mixin that is either null or not an object. Check the mixins included by the component, as well as any mixins they include themselves. Expected object but got %s.",e.displayName||"ReactClass",null===n?null:y)}}function d(e,t){if(t)for(var o in t){var n=t[o];if(t.hasOwnProperty(o)){var r=o in R;a(!r,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',o);var i=o in e;if(i){var s=C.hasOwnProperty(o)?C[o]:null;return a("DEFINE_MANY_MERGED"===s,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",o),void(e[o]=v(e[o],n))}e[o]=n}}}function m(e,t){a(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var o in t)t.hasOwnProperty(o)&&(a(void 0===e[o],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",o),e[o]=t[o]);return e}function v(e,t){return function(){var o=e.apply(this,arguments),n=t.apply(this,arguments);if(null==o)return n;if(null==n)return o;var r={};return m(r,o),m(r,n),r}}function g(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function _(e,o){var n=o.bind(e);if("production"!==t.env.NODE_ENV){n.__reactBoundContext=e,n.__reactBoundMethod=o,n.__reactBoundArguments=null;var r=e.constructor.displayName,i=n.bind;n.bind=function(s){for(var a=arguments.length,u=Array(a>1?a-1:0),c=1;c1?t-1:0),n=1;n2?o-2:0),r=2;rn},ie64:function(){return y.ie()&&p},firefox:function(){return o()||r},opera:function(){return o()||i},webkit:function(){return o()||s},safari:function(){return y.webkit()},chrome:function(){return o()||a},windows:function(){return o()||c},osx:function(){return o()||u},linux:function(){return o()||h},iphone:function(){return o()||d},mobile:function(){return o()||d||m||f||g},nativeApp:function(){return o()||v},android:function(){return o()||f},ipad:function(){return o()||m}};e.exports=y},function(e,t,o){"use strict";function n(e,t){if(!i.canUseDOM||t&&!("addEventListener"in document))return!1;var o="on"+e,n=o in document;if(!n){var s=document.createElement("div");s.setAttribute(o,"return;"),n="function"==typeof s[o]}return!n&&r&&"wheel"===e&&(n=document.implementation.hasFeature("Events.wheel","3.0")),n}var r,i=o(49);i.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),e.exports=n},function(e,t){"use strict";var o=!("undefined"==typeof window||!window.document||!window.document.createElement),n={canUseDOM:o,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:o&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:o&&!!window.screen,isInWorker:!o};e.exports=n},function(e,t,o){(function(t){"use strict";var n=o(45),r=o(51),i=0,s=r||function(e){var o=Date.now(),n=Math.max(0,16-(o-i));return i=o+n,t.setTimeout(function(){e(Date.now())},n)};s(n),e.exports=s}).call(t,function(){return this}())},function(e,t){(function(t){"use strict";var o=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame;e.exports=o}).call(t,function(){return this}())},function(e,t,o){"use strict";var n=o(53),r=o(56),i=o(27),s=o(34),a=o(37),l=o(57),u=o(43),c=o(44),h=o(59),f=o(60),p=o(45),d=o(61),m={position:0,scrollable:!1},v=parseInt(h("scrollbar-face-margin"),10),g=2*v,_=30,y=40,w=null,b=a({displayName:"Scrollbar",mixins:[u],propTypes:{contentSize:i.number.isRequired,defaultPosition:i.number,isOpaque:i.bool,orientation:i.oneOf(["vertical","horizontal"]),onScroll:i.func,position:i.number,size:i.number.isRequired,trackColor:i.oneOf(["gray"]),zIndex:i.number,verticalTop:i.number},getInitialState:function(){var e=this.props;return this._calculateState(e.position||e.defaultPosition||0,e.size,e.contentSize,e.orientation)},componentWillReceiveProps:function(e){var t=e.position;void 0===t?this._setNextState(this._calculateState(this.state.position,e.size,e.contentSize,e.orientation)):this._setNextState(this._calculateState(t,e.size,e.contentSize,e.orientation),e)},getDefaultProps:function(){return{defaultPosition:0,isOpaque:!1,onScroll:p,orientation:"vertical",zIndex:99}},render:function(){if(!this.state.scrollable)return null;var e,t,o=this.props.size,n=this.state.isHorizontal,r=!n,i=this.state.focused||this.state.isDragging,a=this.state.faceSize,l=this.props.isOpaque,u=this.props.verticalTop||0,c=f({"ScrollbarLayout/main":!0,"ScrollbarLayout/mainVertical":r,"ScrollbarLayout/mainHorizontal":n,"public/Scrollbar/main":!0,"public/Scrollbar/mainOpaque":l,"public/Scrollbar/mainActive":i}),p=f({"ScrollbarLayout/face":!0,"ScrollbarLayout/faceHorizontal":n,"ScrollbarLayout/faceVertical":r,"public/Scrollbar/faceActive":i,"public/Scrollbar/face":!0}),m=this.state.position*this.state.scale+v;return n?(e={width:o},t={width:a-g},d(t,m,0)):(e={top:u,height:o},t={height:a-g},d(t,0,m)),e.zIndex=this.props.zIndex,"gray"===this.props.trackColor&&(e.backgroundColor=h("fbui-desktop-background-light")),s.createElement("div",{onFocus:this._onFocus,onBlur:this._onBlur,onKeyDown:this._onKeyDown,onMouseDown:this._onMouseDown,onWheel:this._wheelHandler.onWheel,className:c,style:e,tabIndex:0},s.createElement("div",{ref:"face",className:p,style:t}))},componentWillMount:function(){var e="horizontal"===this.props.orientation,t=e?this._onWheelX:this._onWheelY;this._wheelHandler=new c(t,this._shouldHandleX,this._shouldHandleY)},componentDidMount:function(){this._mouseMoveTracker=new n(this._onMouseMove,this._onMouseMoveEnd,document.documentElement),void 0!==this.props.position&&this.state.position!==this.props.position&&this._didScroll(),this._isMounted=!0},componentWillUnmount:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),w===this&&(w=null),delete this._mouseMoveTracker,this._isMounted=!1},scrollBy:function(e){this._onWheel(e)},_shouldHandleX:function(e){return"horizontal"===this.props.orientation&&this._shouldHandleChange(e)},_shouldHandleY:function(e){return"horizontal"!==this.props.orientation&&this._shouldHandleChange(e)},_shouldHandleChange:function(e){var t=this._calculateState(this.state.position+e,this.props.size,this.props.contentSize,this.props.orientation);return t.position!==this.state.position},_calculateState:function(e,t,o,n){if(t<1||o<=t)return m;var r=e+"_"+t+"_"+o+"_"+n;if(this._stateKey===r)return this._stateForKey;var i="horizontal"===n,s=t/o,a=t*s;a<_&&(s=(t-_)/(o-t),a=_);var l=!0,u=o-t;e<0?e=0:e>u&&(e=u);var c=!!this._mouseMoveTracker&&this._mouseMoveTracker.isDragging(),h={faceSize:a,isDragging:c,isHorizontal:i,position:e,scale:s,scrollable:l};return this._stateKey=r,this._stateForKey=h,h},_onWheelY:function(e,t){this._onWheel(t)},_onWheelX:function(e,t){this._onWheel(e)},_onWheel:function(e){var t=this.props;this._setNextState(this._calculateState(this.state.position+e,t.size,t.contentSize,t.orientation))},_onMouseDown:function(e){var t;if(e.target!==l.findDOMNode(this.refs.face)){var o=e.nativeEvent,n=this.state.isHorizontal?o.offsetX||o.layerX:o.offsetY||o.layerY,r=this.props;n/=this.state.scale,t=this._calculateState(n-.5*this.state.faceSize/this.state.scale,r.size,r.contentSize,r.orientation)}else t={};t.focused=!0,this._setNextState(t),this._mouseMoveTracker.captureMouseMoves(e),l.findDOMNode(this).focus()},_onMouseMove:function(e,t){var o=this.props,n=this.state.isHorizontal?e:t;n/=this.state.scale,this._setNextState(this._calculateState(this.state.position+n,o.size,o.contentSize,o.orientation))},_onMouseMoveEnd:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),this.setState({isDragging:!1})},_onKeyDown:function(e){var t=e.keyCode;if(t!==r.TAB){var o=y,n=0;if(this.state.isHorizontal)switch(t){case r.HOME:n=-1,o=this.props.contentSize;break;case r.LEFT:n=-1;break;case r.RIGHT:n=1;break;default:return}if(!this.state.isHorizontal)switch(t){case r.SPACE:n=e.shiftKey?-1:1;break;case r.HOME:n=-1,o=this.props.contentSize;break;case r.UP:n=-1;break;case r.DOWN:n=1;break;case r.PAGE_UP:n=-1,o=this.props.size;break;case r.PAGE_DOWN:n=1,o=this.props.size;break;default:return}e.preventDefault();var i=this.props;this._setNextState(this._calculateState(this.state.position+o*n,i.size,i.contentSize,i.orientation))}},_onFocus:function(){this.setState({focused:!0})},_onBlur:function(){this.setState({focused:!1})},_blur:function(){if(this._isMounted)try{this._onBlur(),l.findDOMNode(this).blur()}catch(e){}},_setNextState:function(e,t){t=t||this.props;var o=t.position,n=this.state.position!==e.position;if(void 0===o){var r=n?this._didScroll:void 0;this.setState(e,r)}else{if(o!==e.position)return void(void 0!==e.position&&e.position!==this.state.position&&this.props.onScroll(e.position));this.setState(e)}n&&w!==this&&(w&&w._blur(),w=this)},_didScroll:function(){this.props.onScroll(this.state.position)}});b.KEYBOARD_SCROLL_AMOUNT=y,b.SIZE=parseInt(h("scrollbar-size"),10),e.exports=b},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var o=0;o0;)this._addRowToBuffer(t,this._viewportRowsBegin,this._viewportRowsEnd-1),t++,e--;return this._rows}},{key:"getRows",value:function(e,t){var o=t,n=o,r=e,i=Math.min(e+this._maxVisibleRowCount,this._rowsCount);for(this._viewportRowsBegin=e;r=i&&(n=this._bufferSet.replaceFurthestValuePosition(t,o,e)),null===n?(n=this._bufferSet.getNewPositionForValue(e),this._rows[n]=e):this._rows[n]=e}}]),e}();e.exports=c},function(e,t,o){ +"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var o=0;o=e&&r<=t)return null;var i;e-n>r-t?(i=n,this._smallValues.pop()):(i=r,this._largeValues.pop());var a=this._valueToPositionMap[i];return delete this._valueToPositionMap[i],this._valueToPositionMap[o]=a,this._pushToHeaps(a,o),a}},{key:"_pushToHeaps",value:function(e,t){var o={position:e,value:t};this._smallValues.push(o),this._largeValues.push(o)}},{key:"_cleanHeaps",value:function(){this._cleanHeap(this._smallValues),this._cleanHeap(this._largeValues);var e=Math.min(this._smallValues.size(),this._largeValues.size()),t=Math.max(this._smallValues.size(),this._largeValues.size());t>10*e&&this._recreateHeaps()}},{key:"_recreateHeaps",value:function(){for(var e=this._smallValues.size()t.value}}]),e}();e.exports=a},function(e,t){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){return e0&&(this._items[0]=t,this._sinkDown(0)),e}}},{key:"push",value:function(e){this._items[this._size++]=e,this._bubbleUp(this._size-1)}},{key:"size",value:function(){return this._size}},{key:"peek",value:function(){if(0!==this._size)return this._items[0]}},{key:"_heapify",value:function(){for(var e=Math.floor((this._size+1)/2);e>=0;e--)this._sinkDown(e)}},{key:"_bubbleUp",value:function(e){for(var t=this._items[e];e>0;){var o=Math.floor((e+1)/2)-1,n=this._items[o];if(this._comparator(n,t))return;this._items[o]=t,this._items[e]=n,e=o}}},{key:"_sinkDown",value:function(e){for(var t=this._items[e];;){var o=2*(e+1)-1,n=2*(e+1),r=-1;if(oo?o:e}e.exports=o},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=Object.assign||function(e){for(var t=1;t0){var o=h({"fixedDataTableRowLayout/fixedColumnsDivider":!0,"fixedDataTableRowLayout/columnsShadow":e.props.scrollLeft>0,"public/fixedDataTableRow/fixedColumnsDivider":!0,"public/fixedDataTableRow/columnsShadow":e.props.scrollLeft>0}),n={left:t,height:e.props.height};return u.createElement("div",{className:o,style:n})}},this._onClick=function(t){e.props.onClick(t,e.props.index)},this._onDoubleClick=function(t){e.props.onDoubleClick(t,e.props.index)},this._onMouseDown=function(t){e.props.onMouseDown(t,e.props.index)},this._onMouseEnter=function(t){e.props.onMouseEnter(t,e.props.index)},this._onMouseLeave=function(t){e.props.onMouseLeave(t,e.props.index)}}return r(t,e),s(t,[{key:"render",value:function(){var e={width:this.props.width,height:this.props.height},t=h({"fixedDataTableRowLayout/main":!0,"public/fixedDataTableRow/main":!0,"public/fixedDataTableRow/highlighted":this.props.index%2===1,"public/fixedDataTableRow/odd":this.props.index%2===1,"public/fixedDataTableRow/even":this.props.index%2===0}),o=this._getColumnsWidth(this.props.fixedColumns),n=u.createElement(c,{key:"fixed_cells",isScrolling:this.props.isScrolling,height:this.props.height,left:0,width:o,zIndex:2,columns:this.props.fixedColumns,onColumnResize:this.props.onColumnResize,isHoveringResizerKnob:this.props.isHoveringResizerKnob,setHoverState:this.props.setHoverState,rowHeight:this.props.height,rowIndex:this.props.index}),r=this._renderColumnsShadow(o),i=u.createElement(c,{key:"scrollable_cells",isScrolling:this.props.isScrolling,height:this.props.height,left:this.props.scrollLeft,offsetLeft:o,width:this.props.width-o,zIndex:0,columns:this.props.scrollableColumns,onColumnResize:this.props.onColumnResize,rowHeight:this.props.height,rowIndex:this.props.index});return u.createElement("div",{className:f(t,this.props.className),onClick:this.props.onClick?this._onClick:null,onDoubleClick:this.props.onDoubleClick?this._onDoubleClick:null,onMouseDown:this.props.onMouseDown?this._onMouseDown:null,onMouseEnter:this.props.onMouseEnter?this._onMouseEnter:null,onMouseLeave:this.props.onMouseLeave?this._onMouseLeave:null,style:e},u.createElement("div",{className:h("fixedDataTableRowLayout/body")},n,i,r))}}],[{key:"propTypes",value:{isScrolling:l.bool,fixedColumns:l.array.isRequired,height:l.number.isRequired,index:l.number.isRequired,scrollableColumns:l.array.isRequired,scrollLeft:l.number.isRequired,width:l.number.isRequired,onClick:l.func,onDoubleClick:l.func,onColumnResize:l.func},enumerable:!0}]),t}(u.Component),m=function(e){function t(){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return r(t,e),s(t,[{key:"render",value:function(){var e={width:this.props.width,height:this.props.height,zIndex:this.props.zIndex?this.props.zIndex:0};return p(e,0,this.props.offsetTop),u.createElement("div",{style:e,className:h("fixedDataTableRowLayout/rowWrapper")},u.createElement(d,i({},this.props,{offsetTop:void 0,zIndex:void 0})))}}],[{key:"propTypes",value:{isScrolling:l.bool,height:l.number.isRequired,zIndex:l.number,offsetTop:l.number.isRequired,width:l.number.isRequired},enumerable:!0}]),t}(u.Component);e.exports=m},function(e,t,o){"use strict";function n(e,t){var o={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}var r=Object.assign||function(e){for(var t=1;t=0){var l="cell_"+r;o[r]=this._renderCell(e.rowIndex,e.rowHeight,s,n,l)}n+=s.width}var u=this._getColumnsWidth(t),p={height:e.height,position:"absolute",width:u,zIndex:e.zIndex};return h(p,-1*f*e.left,0),a.createElement("div",{className:c("fixedDataTableCellGroupLayout/cellGroup"),style:p},o)},_renderCell:function(e,t,o,n,r){var i=o.isResizable&&this.props.onColumnResize,s=i?this.props.onColumnResize:null,l=o.cellClassName;return a.createElement(u,{isScrolling:this.props.isScrolling,align:o.align,className:l,height:t,key:r,maxWidth:o.maxWidth,minWidth:o.minWidth,onColumnResize:s,isHoveringResizerKnob:this.props.isHoveringResizerKnob,setHoverState:this.props.setHoverState,rowIndex:e,columnKey:o.columnKey,width:o.width,left:n,cell:o.cell})},_getColumnsWidth:function(e){for(var t=0,o=0;o=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}var r=o(78),i=o(73),s=o(27),a=o(34),l=o(37),u=o(60),c=o(79),h=i.DIR_SIGN,f={align:"left",highlighted:!1},p=l({displayName:"FixedDataTableCell",propTypes_DISABLED_FOR_PERFORMANCE:{isScrolling:s.bool,align:s.oneOf(["left","center","right"]),className:s.string,highlighted:s.bool,width:s.number.isRequired,minWidth:s.number,maxWidth:s.number,height:s.number.isRequired,cell:s.oneOfType([s.string,s.element,s.func]),columnKey:s.oneOfType([s.string,s.number]),rowIndex:s.number.isRequired,onColumnResize:s.func,left:s.number},shouldComponentUpdate:function(e){return!e.isScrolling||this.props.rowIndex!==e.rowIndex},getDefaultProps:function(){return f},render:function(){var e=this.props,t=e.height,o=e.width,i=e.columnKey,s=n(e,["height","width","columnKey"]),l={height:t,width:o};1===h?l.left=s.left:l.right=s.left;var f,p=c(u({"fixedDataTableCellLayout/main":!0,"fixedDataTableCellLayout/lastChild":s.lastChild,"fixedDataTableCellLayout/alignRight":"right"===s.align,"fixedDataTableCellLayout/alignCenter":"center"===s.align,"public/fixedDataTableCell/alignRight":"right"===s.align,"public/fixedDataTableCell/highlighted":s.highlighted,"public/fixedDataTableCell/main":!0}),s.className);if(s.onColumnResize){var d={height:t,opacity:s.isHoveringResizerKnob?1:0};f=a.createElement("div",{className:u("fixedDataTableCellLayout/columnResizerContainer"),style:d,onMouseDown:this._onColumnResizerMouseDown,onMouseEnter:function(){return s.setHoverState(!0)},onMouseLeave:function(){return s.setHoverState(!1)}},a.createElement("div",{className:c(u("fixedDataTableCellLayout/columnResizerKnob"),u("public/fixedDataTableCell/columnResizerKnob")),style:d}))}var m={columnKey:i,height:t,width:o};s.rowIndex>=0&&(m.rowIndex=s.rowIndex);var v;return a.isValidElement(s.cell)?("div"===s.cell.type&&delete m.columnKey,v=a.cloneElement(s.cell,m)):v="function"==typeof s.cell?s.cell(m):a.createElement(r,m,s.cell),a.createElement("div",{className:p,style:l},f,v)},_onColumnResizerMouseDown:function(e){this.props.onColumnResize(this.props.left,this.props.width,this.props.minWidth,this.props.maxWidth,this.props.columnKey,e)}});e.exports=p},function(e,t,o){"use strict";function n(e,t){var o={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=Object.assign||function(e){for(var t=1;t1)for(var n=1;n=0&&t>=e-a;){var o=this._updateRowHeight(t);this._position+=o,t--}}},{key:"_updateRowHeight",value:function(e){if(e<0||e>=this._rowCount)return 0;var t=this._rowHeightGetter(e);if(t!==this._storedHeights[e]){var o=t-this._storedHeights[e];return this._rowOffsets.set(e,t),this._storedHeights[e]=t,this._contentHeight+=o,o}return 0}},{key:"getRowPosition",value:function(e){return this._updateRowHeight(e),this._rowOffsets.sumUntil(e)}},{key:"scrollBy",value:function(e){if(0===this._rowCount)return l;var t=this._rowOffsets.greatestLowerBound(this._position);t=s(t,0,Math.max(this._rowCount-1,0));var o=this._rowOffsets.sumUntil(t),n=t,r=this._position,i=this._updateRowHeight(n);0!==o&&(r+=i);var a=this._storedHeights[n]-(r-o);if(e>=0)for(;e>0&&n0&&n>=0;)if(e=0){var c=this._updateRowHeight(n);u=this._storedHeights[n],r+=c}}var h=this._contentHeight-this._viewportHeight;r=s(r,0,h),this._position=r;var f=this._rowOffsets.greatestLowerBound(r);f=s(f,0,Math.max(this._rowCount-1,0)),o=this._rowOffsets.sumUntil(f);var p=o-r;return this._updateHeightsInViewport(f,p),this._updateHeightsAboveViewport(f),{index:f,offset:p,position:this._position,contentHeight:this._contentHeight}}},{key:"_getRowAtEndPosition",value:function(e){this._updateRowHeight(e);for(var t=e,o=this._storedHeights[t];o=0;)t--,t>=0&&(this._updateRowHeight(t),o+=this._storedHeights[t]);var n=this._rowOffsets.sumTo(e)-this._viewportHeight;return n<0&&(n=0),n}},{key:"scrollTo",value:function(e){if(0===this._rowCount)return l;if(e<=0)return this._position=0,this._updateHeightsInViewport(0,0),{index:0,offset:0,position:this._position,contentHeight:this._contentHeight};if(e>=this._contentHeight-this._viewportHeight){var t=this._rowCount-1;e=this._getRowAtEndPosition(t)}this._position=e;var o=this._rowOffsets.greatestLowerBound(e);o=s(o,0,Math.max(this._rowCount-1,0));var n=this._rowOffsets.sumUntil(o),r=n-e;return this._updateHeightsInViewport(o,r),this._updateHeightsAboveViewport(o),{index:o,offset:r,position:this._position,contentHeight:this._contentHeight}}},{key:"scrollToRow",value:function(e,t){e=s(e,0,Math.max(this._rowCount-1,0)),t=s(t,-this._storedHeights[e],0);var o=this._rowOffsets.sumUntil(e);return this.scrollTo(o-t)}},{key:"scrollRowIntoView",value:function(e){e=s(e,0,Math.max(this._rowCount-1,0));var t=this._rowOffsets.sumUntil(e),o=t+this._storedHeights[e];if(t=0;--o)t[o]=0;return t},u=function(){function e(t){n(this,e),this._size=t.length,this._half=r(this._size),this._heap=new l(2*this._half);var o;for(o=0;o0;--o)this._heap[o]=this._heap[2*o]+this._heap[2*o+1]}return i(e,[{key:"set",value:function(e,t){s(0<=e&&e=0;--r)n[r]=o;return new e(n)}},{key:"empty",value:function(t){return e.uniform(t,0)}}]),e}();e.exports=u}).call(t,function(){return this}())},function(e,t,o){"use strict";function n(e){for(var t=0,o=0;o=t||o<0||S&&n>=g}function c(){var e=C();return u(e)?h(e):void(y=setTimeout(c,s(e)))}function h(e){return y=void 0,T&&m?n(e):(m=v=void 0,_)}function f(){void 0!==y&&clearTimeout(y),R=0,m=w=v=y=void 0}function p(){return void 0===y?_:h(C())}function d(){var e=C(),o=u(e);if(m=arguments,v=this,w=e,o){if(void 0===y)return i(w);if(S)return y=setTimeout(c,t),n(w)}return void 0===y&&(y=setTimeout(c,t)),_}var m,v,g,_,y,w,R=0,E=!1,S=!1,T=!0;if("function"!=typeof e)throw new TypeError(l);return t=a(t)||0,r(o)&&(E=!!o.leading,S="maxWait"in o,g=S?b(a(o.maxWait)||0,t):g,T="trailing"in o?!!o.trailing:T),d.cancel=f,d.flush=p,d}function n(e,t,n){var i=!0,s=!0;if("function"!=typeof e)throw new TypeError(l);return r(n)&&(i="leading"in n?!!n.leading:i,s="trailing"in n?!!n.trailing:s),o(e,t,{leading:i,maxWait:t,trailing:s})}function r(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function i(e){return!!e&&"object"==typeof e}function s(e){return"symbol"==typeof e||i(e)&&w.call(e)==c}function a(e){if("number"==typeof e)return e;if(s(e))return u;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(h,"");var o=p.test(e);return o||d.test(e)?m(e.slice(2),o?2:8):f.test(e)?u:+e}var l="Expected a function",u=NaN,c="[object Symbol]",h=/^\s+|\s+$/g,f=/^[-+]0x[0-9a-f]+$/i,p=/^0b[01]+$/i,d=/^0o[0-7]+$/i,m=parseInt,v="object"==typeof t&&t&&t.Object===Object&&t,g="object"==typeof self&&self&&self.Object===Object&&self,_=v||g||Function("return this")(),y=Object.prototype,w=y.toString,b=Math.max,x=Math.min,C=function(){return _.Date.now()};e.exports=n}).call(t,function(){return this}())},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{ +constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=function(){function e(e,t){for(var o=0;o