tonkean-react-calendar-timeline
Advanced tools
Comparing version 0.0.5 to 0.0.6
@@ -10,3 +10,7 @@ # Change Log | ||
### Added in this fork | ||
* stackItems force - set stackItems as `force` to force the items to be stacked regardless of collision | ||
* minGroupHeight - specify min group height. (optional) | ||
### 0.17.2 | ||
@@ -13,0 +17,0 @@ |
@@ -467,3 +467,3 @@ 'use strict'; | ||
var _stackingMethod = stackingMethod(dimensionItems, groupOrders, lineHeight, headerHeight), | ||
var _stackingMethod = stackingMethod(dimensionItems, groupOrders, lineHeight, headerHeight, this.props.minGroupHeight), | ||
height = _stackingMethod.height, | ||
@@ -642,2 +642,3 @@ groupHeights = _stackingMethod.groupHeights, | ||
minimumWidthForItemContentVisibility: _propTypes2.default.number, | ||
minGroupHeight: _propTypes2.default.number, | ||
@@ -655,3 +656,3 @@ minZoom: _propTypes2.default.number, | ||
stackItems: _propTypes2.default.string, | ||
stackItems: _propTypes2.default.oneOf([true, false, 'force']), | ||
@@ -658,0 +659,0 @@ traditionalZoom: _propTypes2.default.bool, |
@@ -220,3 +220,4 @@ 'use strict'; | ||
function stack(items, groupOrders, lineHeight, force) { | ||
function stack(items, groupOrders, lineHeight, force, minGroupHeight) { | ||
minGroupHeight = minGroupHeight || 0; | ||
var i, iMax; | ||
@@ -271,4 +272,5 @@ var totalHeight = 0; | ||
groupHeights.push(Math.max(groupHeight + verticalMargin, lineHeight)); | ||
totalHeight += Math.max(groupHeight + verticalMargin, lineHeight); | ||
var addedHeight = Math.max(groupHeight + verticalMargin, lineHeight, minGroupHeight); | ||
groupHeights.push(addedHeight); | ||
totalHeight += addedHeight; | ||
}); | ||
@@ -282,3 +284,4 @@ return { | ||
function forcestack(items, groupOrders, lineHeight, force) { | ||
function forcestack(items, groupOrders, lineHeight, force, minGroupHeight) { | ||
minGroupHeight = minGroupHeight || 0; | ||
var i, iMax; | ||
@@ -311,4 +314,5 @@ var totalHeight = 0; | ||
groupHeights.push(Math.max(groupHeight + verticalMargin, lineHeight)); | ||
totalHeight += Math.max(groupHeight + verticalMargin, lineHeight); | ||
var addedHeight = Math.max(groupHeight + verticalMargin, lineHeight, minGroupHeight); | ||
groupHeights.push(addedHeight); | ||
totalHeight += addedHeight; | ||
}); | ||
@@ -322,3 +326,4 @@ return { | ||
function nostack(items, groupOrders, lineHeight, force) { | ||
function nostack(items, groupOrders, lineHeight, force, minGroupHeight) { | ||
minGroupHeight = minGroupHeight || 0; | ||
var i, iMax; | ||
@@ -355,4 +360,5 @@ | ||
groupHeights.push(Math.max(groupHeight, lineHeight)); | ||
totalHeight += Math.max(groupHeight, lineHeight); | ||
var addedHeight = Math.max(groupHeight + verticalMargin, lineHeight, minGroupHeight); | ||
groupHeights.push(addedHeight); | ||
totalHeight += addedHeight; | ||
}); | ||
@@ -359,0 +365,0 @@ return { |
{ | ||
"name": "tonkean-react-calendar-timeline", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "react calendar timeline", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -0,1 +1,4 @@ | ||
THIS IS A FORKED VERSION, PLEASE USE THE ORIGINAL LIBRARY:https://github.com/namespace-ee/react-calendar-timeline | ||
AS MOST OF THE CODE HERE IS THEIR's | ||
# React Calendar Timeline | ||
@@ -239,3 +242,6 @@ | ||
Stack items under each other, so there is no visual overlap when times collide. Defaults to `false`. | ||
Stack items under each other, so there is no visual overlap when times collide. Defaults to null. | ||
if null, will not stack. | ||
if is exactly the string 'force', will always stack regardless of collisions. | ||
if exists but is not the previous options will default to stacking on collisons (to support the earlier value of true) | ||
@@ -242,0 +248,0 @@ ### traditionalZoom |
@@ -53,2 +53,3 @@ import PropTypes from 'prop-types' | ||
minimumWidthForItemContentVisibility: PropTypes.number, | ||
minGroupHeight: PropTypes.number, | ||
@@ -66,3 +67,3 @@ minZoom: PropTypes.number, | ||
stackItems: PropTypes.string, | ||
stackItems: PropTypes.oneOf([true, false, 'force']), | ||
@@ -1103,3 +1104,4 @@ traditionalZoom: PropTypes.bool, | ||
lineHeight, | ||
headerHeight | ||
headerHeight, | ||
this.props.minGroupHeight | ||
) | ||
@@ -1106,0 +1108,0 @@ |
@@ -212,3 +212,4 @@ import moment from 'moment' | ||
export function stack(items, groupOrders, lineHeight, force) { | ||
export function stack(items, groupOrders, lineHeight, force, minGroupHeight) { | ||
minGroupHeight = minGroupHeight || 0; | ||
var i, iMax | ||
@@ -271,4 +272,5 @@ var totalHeight = 0 | ||
groupHeights.push(Math.max(groupHeight + verticalMargin, lineHeight)) | ||
totalHeight += Math.max(groupHeight + verticalMargin, lineHeight) | ||
let addedHeight = Math.max(groupHeight + verticalMargin, lineHeight, minGroupHeight); | ||
groupHeights.push(addedHeight); | ||
totalHeight += addedHeight; | ||
}) | ||
@@ -282,3 +284,4 @@ return { | ||
export function forcestack(items, groupOrders, lineHeight, force) { | ||
export function forcestack(items, groupOrders, lineHeight, force, minGroupHeight) { | ||
minGroupHeight = minGroupHeight || 0; | ||
var i, iMax; | ||
@@ -311,4 +314,5 @@ var totalHeight = 0; | ||
groupHeights.push(Math.max(groupHeight + verticalMargin, lineHeight)); | ||
totalHeight += Math.max(groupHeight + verticalMargin, lineHeight); | ||
let addedHeight = Math.max(groupHeight + verticalMargin, lineHeight, minGroupHeight); | ||
groupHeights.push(addedHeight); | ||
totalHeight += addedHeight; | ||
}); | ||
@@ -322,3 +326,4 @@ return { | ||
export function nostack(items, groupOrders, lineHeight, force) { | ||
export function nostack(items, groupOrders, lineHeight, force, minGroupHeight) { | ||
minGroupHeight = minGroupHeight || 0; | ||
var i, iMax | ||
@@ -355,4 +360,5 @@ | ||
groupHeights.push(Math.max(groupHeight, lineHeight)) | ||
totalHeight += Math.max(groupHeight, lineHeight) | ||
let addedHeight = Math.max(groupHeight + verticalMargin, lineHeight, minGroupHeight); | ||
groupHeights.push(addedHeight); | ||
totalHeight += addedHeight; | ||
}) | ||
@@ -359,0 +365,0 @@ return { |
298416
6504
686