react-calendar-timeline
Advanced tools
Comparing version 0.27.7-gamma to 0.27.8-gamma
@@ -54,8 +54,2 @@ "use strict"; | ||
}); | ||
Object.defineProperty(exports, "RowColumns", { | ||
enumerable: true, | ||
get: function get() { | ||
return _Columns["default"]; | ||
} | ||
}); | ||
Object.defineProperty(exports, "RowItems", { | ||
@@ -93,4 +87,2 @@ enumerable: true, | ||
var _Columns = _interopRequireDefault(require("./lib/columns/Columns")); | ||
var _Items = _interopRequireDefault(require("./lib/items/Items")); | ||
@@ -97,0 +89,0 @@ |
@@ -16,10 +16,10 @@ "use strict"; | ||
var _ColumnsContext = require("./ColumnsContext"); | ||
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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function _extends() { _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; }; return _extends.apply(this, arguments); } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
@@ -57,3 +57,3 @@ | ||
value: function shouldComponentUpdate(nextProps) { | ||
return !(nextProps.canvasTimeStart === this.props.canvasTimeStart && nextProps.canvasTimeEnd === this.props.canvasTimeEnd && nextProps.lineCount === this.props.lineCount && nextProps.minUnit === this.props.minUnit && nextProps.timeSteps === this.props.timeSteps && nextProps.height === this.props.height && nextProps.verticalLineClassNamesForTime === this.props.verticalLineClassNamesForTime && //TODO: delete canvasWidth prop | ||
return !(nextProps.canvasTimeStart === this.props.canvasTimeStart && nextProps.canvasTimeEnd === this.props.canvasTimeEnd && nextProps.lineCount === this.props.lineCount && nextProps.minUnit === this.props.minUnit && nextProps.timeSteps === this.props.timeSteps && nextProps.verticalLineClassNamesForTime === this.props.verticalLineClassNamesForTime && //TODO: delete canvasWidth prop | ||
//needed to trigger renderer because getLeftOffsetFromDate is dependant on canvasWidth | ||
@@ -70,3 +70,2 @@ nextProps.canvasWidth === this.props.canvasWidth); | ||
timeSteps = _this$props.timeSteps, | ||
height = _this$props.height, | ||
verticalLineClassNamesForTime = _this$props.verticalLineClassNamesForTime, | ||
@@ -97,3 +96,3 @@ getLeftOffsetFromDate = _this$props.getLeftOffsetFromDate; | ||
width: "".concat(right - left, "px"), | ||
height: "".concat(height, "px") | ||
height: '100%' | ||
} | ||
@@ -119,3 +118,2 @@ })); | ||
timeSteps: _propTypes["default"].object.isRequired, | ||
height: _propTypes["default"].number.isRequired, | ||
verticalLineClassNamesForTime: _propTypes["default"].func, | ||
@@ -140,2 +138,4 @@ getLeftOffsetFromDate: _propTypes["default"].func.isRequired, | ||
value: function render() { | ||
var _this = this; | ||
return _react["default"].createElement(_TimelineStateContext.TimelineStateConsumer, null, function (_ref) { | ||
@@ -150,20 +150,5 @@ var getLeftOffsetFromDate = _ref.getLeftOffsetFromDate, | ||
return _react["default"].createElement(_ColumnsContext.ColumnsConsumer, null, function (_ref2) { | ||
var lineCount = _ref2.lineCount, | ||
minUnit = _ref2.minUnit, | ||
timeSteps = _ref2.timeSteps, | ||
height = _ref2.height, | ||
verticalLineClassNamesForTime = _ref2.verticalLineClassNamesForTime; | ||
return _react["default"].createElement(Columns, { | ||
getLeftOffsetFromDate: getLeftOffsetFromDate, | ||
canvasTimeStart: canvasTimeStart, | ||
canvasTimeEnd: canvasTimeEnd, | ||
canvasWidth: canvasWidth, | ||
lineCount: lineCount, | ||
minUnit: minUnit, | ||
timeSteps: timeSteps, | ||
height: height, | ||
verticalLineClassNamesForTime: verticalLineClassNamesForTime | ||
}); | ||
}); | ||
return _react["default"].createElement(Columns, _extends({ | ||
getLeftOffsetFromDate: getLeftOffsetFromDate | ||
}, _this.props)); | ||
}); | ||
@@ -170,0 +155,0 @@ } |
@@ -15,3 +15,3 @@ "use strict"; | ||
var DefaultLayer = function DefaultLayer() { | ||
return _react["default"].createElement(_index.GroupRow, null, _react["default"].createElement(_index.RowColumns, null), _react["default"].createElement(_index.RowItems, null)); | ||
return _react["default"].createElement(_index.GroupRow, null, _react["default"].createElement(_index.RowItems, null)); | ||
}; | ||
@@ -18,0 +18,0 @@ |
@@ -12,4 +12,2 @@ "use strict"; | ||
var _ColumnsContext = require("../columns/ColumnsContext"); | ||
var _generic = require("../utility/generic"); | ||
@@ -335,8 +333,2 @@ | ||
groupIndex: index | ||
}, _react["default"].createElement(_ColumnsContext.ColumnsContextProvider, { | ||
lineCount: (0, _generic._length)(groups), | ||
minUnit: minUnit, | ||
timeSteps: timeSteps, | ||
height: groupHeight, | ||
verticalLineClassNamesForTime: verticalLineClassNamesForTime | ||
}, _react["default"].createElement(_ItemsContext.ItemsContextProvider //TODO: fix groups with no items | ||
@@ -385,3 +377,3 @@ , { | ||
itemsWithInteractions: items | ||
})))); | ||
}))); | ||
} | ||
@@ -388,0 +380,0 @@ }]); |
@@ -40,2 +40,4 @@ "use strict"; | ||
var _Columns = _interopRequireDefault(require("./columns/Columns")); | ||
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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } } | ||
@@ -618,5 +620,3 @@ | ||
keys = _this$props2.keys, | ||
lineHeight = _this$props2.lineHeight, | ||
itemHeightRatio = _this$props2.itemHeightRatio, | ||
stackItems = _this$props2.stackItems; | ||
hideHorizontalLines = _this$props2.hideHorizontalLines; | ||
var _this$state4 = this.state, | ||
@@ -720,2 +720,10 @@ draggingItem = _this$state4.draggingItem, | ||
resizeEdge: this.state.resizingEdge | ||
}), hideHorizontalLines ? null : _react["default"].createElement(_Columns["default"], { | ||
lineCount: (0, _generic._length)(groups), | ||
minUnit: minUnit, | ||
timeSteps: timeSteps, | ||
verticalLineClassNamesForTime: this.props.verticalLineClassNamesForTime, | ||
canvasTimeStart: canvasTimeStart, | ||
canvasTimeEnd: canvasTimeEnd, | ||
canvasWidth: canvasWidth | ||
}))), rightSidebarWidth > 0 ? this.rightSidebar(height, groupHeights) : null))))); | ||
@@ -860,3 +868,4 @@ } | ||
rowRenderer: _propTypes["default"].func, | ||
rowData: _propTypes["default"].object | ||
rowData: _propTypes["default"].object, | ||
hideHorizontalLines: _propTypes["default"].bool | ||
}); | ||
@@ -922,3 +931,4 @@ | ||
rowRenderer: _DefaultLayer["default"], | ||
rowData: {} | ||
rowData: {}, | ||
hideHorizontalLines: false | ||
}); | ||
@@ -925,0 +935,0 @@ |
{ | ||
"name": "react-calendar-timeline", | ||
"version": "0.27.7-gamma", | ||
"version": "0.27.8-gamma", | ||
"description": "react calendar timeline", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -13,5 +13,4 @@ import Timeline from './lib/Timeline' | ||
export {default as DateHeader} from './lib/headers/DateHeader' | ||
export {default as RowColumns} from './lib/columns/Columns' | ||
export {default as RowItems} from './lib/items/Items' | ||
export {default as GroupRow} from './lib/rows/GroupRow' | ||
export default Timeline |
@@ -5,3 +5,2 @@ import PropTypes from 'prop-types' | ||
import { TimelineStateConsumer } from '../timeline/TimelineStateContext' | ||
import { ColumnsConsumer } from './ColumnsContext' | ||
@@ -15,6 +14,5 @@ export class Columns extends Component { | ||
timeSteps: PropTypes.object.isRequired, | ||
height: PropTypes.number.isRequired, | ||
verticalLineClassNamesForTime: PropTypes.func, | ||
getLeftOffsetFromDate: PropTypes.func.isRequired, | ||
canvasWidth: PropTypes.number.isRequired, | ||
canvasWidth: PropTypes.number.isRequired | ||
} | ||
@@ -29,5 +27,4 @@ | ||
nextProps.timeSteps === this.props.timeSteps && | ||
nextProps.height === this.props.height && | ||
nextProps.verticalLineClassNamesForTime === | ||
this.props.verticalLineClassNamesForTime && | ||
this.props.verticalLineClassNamesForTime && | ||
//TODO: delete canvasWidth prop | ||
@@ -45,3 +42,2 @@ //needed to trigger renderer because getLeftOffsetFromDate is dependant on canvasWidth | ||
timeSteps, | ||
height, | ||
verticalLineClassNamesForTime, | ||
@@ -52,3 +48,2 @@ getLeftOffsetFromDate | ||
let lines = [] | ||
iterateTimes( | ||
@@ -79,3 +74,2 @@ canvasTimeStart, | ||
classNamesForTime.join(' ') | ||
const left = getLeftOffsetFromDate(time.valueOf()) | ||
@@ -92,3 +86,3 @@ const right = getLeftOffsetFromDate(nextTime.valueOf()) | ||
width: `${right - left}px`, | ||
height: `${height}px` | ||
height: '100%' | ||
}} | ||
@@ -99,3 +93,2 @@ /> | ||
) | ||
return <div className="rct-vertical-lines">{lines}</div> | ||
@@ -110,25 +103,12 @@ } | ||
{({ getLeftOffsetFromDate, getTimelineState }) => { | ||
const { canvasTimeStart, canvasTimeEnd, canvasWidth } = getTimelineState() | ||
const { | ||
canvasTimeStart, | ||
canvasTimeEnd, | ||
canvasWidth | ||
} = getTimelineState() | ||
return ( | ||
<ColumnsConsumer> | ||
{({ | ||
lineCount, | ||
minUnit, | ||
timeSteps, | ||
height, | ||
verticalLineClassNamesForTime | ||
}) => ( | ||
<Columns | ||
getLeftOffsetFromDate={getLeftOffsetFromDate} | ||
canvasTimeStart={canvasTimeStart} | ||
canvasTimeEnd={canvasTimeEnd} | ||
canvasWidth={canvasWidth} | ||
lineCount={lineCount} | ||
minUnit={minUnit} | ||
timeSteps={timeSteps} | ||
height={height} | ||
verticalLineClassNamesForTime={verticalLineClassNamesForTime} | ||
/> | ||
)} | ||
</ColumnsConsumer> | ||
<Columns | ||
getLeftOffsetFromDate={getLeftOffsetFromDate} | ||
{...this.props} | ||
/> | ||
) | ||
@@ -135,0 +115,0 @@ }} |
@@ -6,3 +6,2 @@ import React from 'react'; | ||
return <GroupRow> | ||
<RowColumns/> | ||
<RowItems/> | ||
@@ -9,0 +8,0 @@ </GroupRow> |
import React from 'react' | ||
import TimelineStateContext from '../timeline/TimelineStateContext' | ||
import { ColumnsContextProvider } from '../columns/ColumnsContext' | ||
import { _get, _length } from '../utility/generic' | ||
@@ -260,9 +259,2 @@ import { ItemsContextProvider } from '../items/ItemsContext' | ||
> | ||
<ColumnsContextProvider | ||
lineCount={_length(groups)} | ||
minUnit={minUnit} | ||
timeSteps={timeSteps} | ||
height={groupHeight} | ||
verticalLineClassNamesForTime={verticalLineClassNamesForTime} | ||
> | ||
<ItemsContextProvider | ||
@@ -314,3 +306,2 @@ //TODO: fix groups with no items | ||
</ItemsContextProvider> | ||
</ColumnsContextProvider> | ||
</GroupRowContextProvider> | ||
@@ -317,0 +308,0 @@ ) |
@@ -32,2 +32,3 @@ import PropTypes from 'prop-types' | ||
import DefaultLayer from './rows/DefaultLayer' | ||
import Columns from './columns/Columns' | ||
@@ -161,2 +162,3 @@ export default class ReactCalendarTimeline extends Component { | ||
rowData: PropTypes.object, | ||
hideHorizontalLines : PropTypes.bool, | ||
} | ||
@@ -240,2 +242,3 @@ | ||
rowData: {}, | ||
hideHorizontalLines: false, | ||
} | ||
@@ -882,5 +885,3 @@ | ||
keys, | ||
lineHeight, | ||
itemHeightRatio, | ||
stackItems, | ||
hideHorizontalLines, | ||
} = this.props | ||
@@ -1010,2 +1011,11 @@ const { | ||
/> | ||
{ hideHorizontalLines? null : <Columns | ||
lineCount={_length(groups)} | ||
minUnit={minUnit} | ||
timeSteps={timeSteps} | ||
verticalLineClassNamesForTime={this.props.verticalLineClassNamesForTime} | ||
canvasTimeStart={canvasTimeStart} | ||
canvasTimeEnd={canvasTimeEnd} | ||
canvasWidth={canvasWidth} | ||
/> } | ||
</MarkerCanvas> | ||
@@ -1012,0 +1022,0 @@ </ScrollElement> |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
543656
94
10813