-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
416 additions
and
232 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
'use strict'; | ||
|
||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var SortDirection = { | ||
/** | ||
* Sort items in ascending order. | ||
* This means arranging from the lowest value to the highest (e.g. a-z, 0-9). | ||
*/ | ||
ASC: 'ASC', | ||
|
||
/** | ||
* Sort items in descending order. | ||
* This means arranging from the highest value to the lowest (e.g. z-a, 9-0). | ||
*/ | ||
DESC: 'DESC' | ||
}; | ||
|
||
exports.default = SortDirection; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
'use strict'; | ||
|
||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = SortIndicator; | ||
|
||
var _react = require('react'); | ||
|
||
var _react2 = _interopRequireDefault(_react); | ||
|
||
var _classnames = require('classnames'); | ||
|
||
var _classnames2 = _interopRequireDefault(_classnames); | ||
|
||
var _SortDirection = require('./SortDirection'); | ||
|
||
var _SortDirection2 = _interopRequireDefault(_SortDirection); | ||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
|
||
/** | ||
* Displayed beside a header to indicate that a FlexTable is currently sorted by this column. | ||
*/ | ||
function SortIndicator(_ref) { | ||
var sortDirection = _ref.sortDirection; | ||
|
||
var classNames = (0, _classnames2.default)('FlexTable__sortableHeaderIcon', { | ||
'FlexTable__sortableHeaderIcon--ASC': sortDirection === _SortDirection2.default.ASC, | ||
'FlexTable__sortableHeaderIcon--DESC': sortDirection === _SortDirection2.default.DESC | ||
}); | ||
|
||
return _react2.default.createElement( | ||
'svg', | ||
{ | ||
className: classNames, | ||
width: 18, | ||
height: 18, | ||
viewBox: '0 0 24 24', | ||
xmlns: 'http://www.w3.org/2000/svg' | ||
}, | ||
sortDirection === _SortDirection2.default.ASC ? _react2.default.createElement('path', { d: 'M7 14l5-5 5 5z' }) : _react2.default.createElement('path', { d: 'M7 10l5 5 5-5z' }), | ||
_react2.default.createElement('path', { d: 'M0 0h24v24H0z', fill: 'none' }) | ||
); | ||
} | ||
SortIndicator.propTypes = { | ||
sortDirection: _react.PropTypes.oneOf([_SortDirection2.default.ASC, _SortDirection2.default.DESC]) | ||
}; |
Oops, something went wrong.