rsuite-table
Advanced tools
Comparing version 3.5.9 to 3.6.0
@@ -0,1 +1,5 @@ | ||
# 3.6.0 | ||
- Added support for RTL #101 | ||
# 3.5.9 | ||
@@ -2,0 +6,0 @@ |
@@ -83,3 +83,3 @@ 'use strict'; | ||
var _constants = require('./constants'); | ||
var _constants2 = require('./constants'); | ||
@@ -542,3 +542,3 @@ var _propTypes = require('prop-types'); | ||
var showLeftShadow = this.scrollX < 0; | ||
var showRightShadow = width - contentWidth - _constants.SCROLLBAR_WIDTH !== this.scrollX; | ||
var showRightShadow = width - contentWidth - _constants2.SCROLLBAR_WIDTH !== this.scrollX; | ||
@@ -600,3 +600,3 @@ (0, _utils.toggleClass)(fixedLeftGroups, leftShadowClassName, showLeftShadow); | ||
// 这里 -SCROLLBAR_WIDTH 是为了让滚动条不挡住内容部分 | ||
this.minScrollX = -(contentWidth - this.state.width) - _constants.SCROLLBAR_WIDTH; | ||
this.minScrollX = -(contentWidth - this.state.width) - _constants2.SCROLLBAR_WIDTH; | ||
@@ -646,3 +646,3 @@ /** | ||
// 这里 -SCROLLBAR_WIDTH 是为了让滚动条不挡住内容部分 | ||
this.minScrollY = -(contentHeight - height) - _constants.SCROLLBAR_WIDTH; | ||
this.minScrollY = -(contentHeight - height) - _constants2.SCROLLBAR_WIDTH; | ||
} | ||
@@ -657,4 +657,4 @@ | ||
// 当 Table 为 virtualized 时, wheel 事件触发每次都会进入该逻辑, 避免在滚动到底部后滚动条重置, +SCROLLBAR_WIDTH | ||
if (Math.abs(this.scrollY) + height - headerHeight > nextContentHeight + _constants.SCROLLBAR_WIDTH) { | ||
this.scrollTop(nextContentHeight + _constants.SCROLLBAR_WIDTH); | ||
if (Math.abs(this.scrollY) + height - headerHeight > nextContentHeight + _constants2.SCROLLBAR_WIDTH) { | ||
this.scrollTop(nextContentHeight + _constants2.SCROLLBAR_WIDTH); | ||
} | ||
@@ -768,3 +768,4 @@ } | ||
width: fixedLeftCellGroupWidth, | ||
updatePosition: this.translateDOMPositionXY | ||
updatePosition: this.translateDOMPositionXY, | ||
style: (0, _utils.isRTL)() ? { right: width - fixedLeftCellGroupWidth } : null | ||
}, | ||
@@ -782,3 +783,3 @@ (0, _utils.colSpanCells)(fixedLeftCells) | ||
fixed: 'right', | ||
style: { left: width - fixedRightCellGroupWidth - _constants.SCROLLBAR_WIDTH }, | ||
style: (0, _utils.isRTL)() ? { right: 0 } : { left: width - fixedRightCellGroupWidth - _constants.SCROLLBAR_WIDTH }, | ||
height: props.isHeaderRow ? props.headerHeight : props.height, | ||
@@ -898,3 +899,3 @@ width: fixedRightCellGroupWidth, | ||
var maxHeight = tableRowsMaxHeight[index]; | ||
var nextRowHeight = maxHeight ? maxHeight + _constants.CELL_PADDING_HEIGHT : rowHeight; | ||
var nextRowHeight = maxHeight ? maxHeight + _constants2.CELL_PADDING_HEIGHT : rowHeight; | ||
var shouldRenderExpandedRow = this.shouldRenderExpandedRow(_rowData); | ||
@@ -1465,4 +1466,4 @@ var depth = 0; | ||
// 滚动条的高度 | ||
var scrollbarHeight = Math.max((height - headerHeight) / (contentHeight + _constants.SCROLLBAR_WIDTH) * (height - headerHeight), _constants.SCROLLBAR_MIN_WIDTH); | ||
y = Math.max(0, top / (contentHeight + _constants.SCROLLBAR_WIDTH) * (height - headerHeight) - scrollbarHeight); | ||
var scrollbarHeight = Math.max((height - headerHeight) / (contentHeight + _constants2.SCROLLBAR_WIDTH) * (height - headerHeight), _constants2.SCROLLBAR_MIN_WIDTH); | ||
y = Math.max(0, top / (contentHeight + _constants2.SCROLLBAR_WIDTH) * (height - headerHeight) - scrollbarHeight); | ||
} | ||
@@ -1469,0 +1470,0 @@ _this3.scrollbarY.resetScrollBarPosition(y); |
@@ -6,3 +6,3 @@ 'use strict'; | ||
}); | ||
exports.translateDOMPositionXY = exports.flattenData = exports.toggleClass = exports.colSpanCells = exports.getTotalByColumns = exports.getUnhandledProps = exports.isNullOrUndefined = undefined; | ||
exports.isRTL = exports.translateDOMPositionXY = exports.flattenData = exports.toggleClass = exports.colSpanCells = exports.getTotalByColumns = exports.getUnhandledProps = exports.isNullOrUndefined = undefined; | ||
@@ -61,2 +61,6 @@ var _prefix = require('./prefix'); | ||
var _isRTL2 = require('./isRTL'); | ||
var _isRTL3 = _interopRequireDefault(_isRTL2); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -70,2 +74,3 @@ | ||
exports.flattenData = _flattenData3.default; | ||
exports.translateDOMPositionXY = _translateDOMPositionXY3.default; | ||
exports.translateDOMPositionXY = _translateDOMPositionXY3.default; | ||
exports.isRTL = _isRTL3.default; |
{ | ||
"name": "rsuite-table", | ||
"version": "3.5.9", | ||
"version": "3.6.0", | ||
"description": "A React table component", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -22,3 +22,4 @@ // @flow | ||
requestAnimationTimeout, | ||
cancelAnimationTimeout | ||
cancelAnimationTimeout, | ||
isRTL | ||
} from './utils'; | ||
@@ -1031,2 +1032,3 @@ import { SCROLLBAR_MIN_WIDTH, SCROLLBAR_WIDTH, CELL_PADDING_HEIGHT } from './constants'; | ||
updatePosition={this.translateDOMPositionXY} | ||
style={isRTL() ? { right: width - fixedLeftCellGroupWidth } : null} | ||
> | ||
@@ -1044,3 +1046,7 @@ {colSpanCells(fixedLeftCells)} | ||
fixed="right" | ||
style={{ left: width - fixedRightCellGroupWidth - SCROLLBAR_WIDTH }} | ||
style={ | ||
isRTL() | ||
? { right: 0 } | ||
: { left: width - fixedRightCellGroupWidth - _constants.SCROLLBAR_WIDTH } | ||
} | ||
height={props.isHeaderRow ? props.headerHeight : props.height} | ||
@@ -1047,0 +1053,0 @@ width={fixedRightCellGroupWidth} |
@@ -9,2 +9,3 @@ export * from './prefix'; | ||
export translateDOMPositionXY from './translateDOMPositionXY'; | ||
export isRTL from './isRTL'; | ||
export * from './requestAnimationTimeout'; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
219276
62
4639