1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 |
|
7 | 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; }; }();
|
8 |
|
9 | var _style = require('./style.css');
|
10 |
|
11 | var _style2 = _interopRequireDefault(_style);
|
12 |
|
13 | var _tableItem = require('../table-item');
|
14 |
|
15 | var _tableItem2 = _interopRequireDefault(_tableItem);
|
16 |
|
17 | var _icon = require('../icon');
|
18 |
|
19 | var Icons = _interopRequireWildcard(_icon);
|
20 |
|
21 | var _capitalize = require('lodash/capitalize');
|
22 |
|
23 | var _capitalize2 = _interopRequireDefault(_capitalize);
|
24 |
|
25 | var _react = require('react');
|
26 |
|
27 | var _react2 = _interopRequireDefault(_react);
|
28 |
|
29 | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
30 |
|
31 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
32 |
|
33 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
34 |
|
35 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
36 |
|
37 | 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; }
|
38 |
|
39 | var NavigationColumn = function (_Component) {
|
40 | _inherits(NavigationColumn, _Component);
|
41 |
|
42 | function NavigationColumn() {
|
43 | _classCallCheck(this, NavigationColumn);
|
44 |
|
45 | return _possibleConstructorReturn(this, (NavigationColumn.__proto__ || Object.getPrototypeOf(NavigationColumn)).apply(this, arguments));
|
46 | }
|
47 |
|
48 | _createClass(NavigationColumn, [{
|
49 | key: 'render',
|
50 |
|
51 |
|
52 | |
53 |
|
54 |
|
55 |
|
56 |
|
57 | value: function render() {
|
58 | var Icon = Icons['Arrow' + (0, _capitalize2.default)(this.props.direction)];
|
59 |
|
60 | return _react2.default.createElement(
|
61 | 'tr',
|
62 | { ref: 'component', className: _style2.default.column },
|
63 | _react2.default.createElement(
|
64 | 'th',
|
65 | { ref: 'header', className: _style2.default.navigation },
|
66 | _react2.default.createElement(Icon, { height: 16, style: { opacity: this.props.visible ? '1' : '0' } })
|
67 | ),
|
68 | this.props.entries.map(function (entry) {
|
69 | return _react2.default.createElement(
|
70 | _tableItem2.default,
|
71 | { key: entry.code, className: _style2.default.head_item },
|
72 | '\xA0'
|
73 | );
|
74 | })
|
75 | );
|
76 | }
|
77 |
|
78 | |
79 |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 | }]);
|
85 |
|
86 | return NavigationColumn;
|
87 | }(_react.Component);
|
88 |
|
89 | NavigationColumn.propTypes = {
|
90 | visible: _react.PropTypes.bool.isRequired,
|
91 | entries: _react.PropTypes.array.isRequired,
|
92 | direction: _react.PropTypes.oneOf(['left', 'right']).isRequired
|
93 | };
|
94 | exports.default = NavigationColumn; |
\ | No newline at end of file |