Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@r365/react-calendar-timeline

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@r365/react-calendar-timeline - npm Package Compare versions

Comparing version 0.25.0-beta.13 to 0.25.0-beta.17

2

lib/lib/Timeline.js

@@ -571,3 +571,3 @@ 'use strict';

stackItems: _propTypes2.default.bool,
stackItems: _propTypes2.default.oneOf([false, 'space', 'lines']),

@@ -574,0 +574,0 @@ traditionalZoom: _propTypes2.default.bool,

@@ -24,2 +24,3 @@ 'use strict';

exports.collision = collision;
exports.groupStackInLines = groupStackInLines;
exports.groupStack = groupStack;

@@ -309,2 +310,19 @@ exports.groupNoStack = groupNoStack;

/**
* Calculate the position of a given item for a group that each in a line
* is being stacked
*/
function groupStackInLines(lineHeight, item, items, groupHeight, groupTop, itemIndex) {
// calculate non-overlapping positions
var verticalMargin = lineHeight - item.dimensions.height;
if (item.dimensions.stack && item.dimensions.top === null) {
item.dimensions.top = groupTop + verticalMargin + itemIndex * lineHeight;
}
return {
groupHeight: lineHeight * items.length,
verticalMargin: verticalMargin,
itemTop: item.dimensions.top
};
}
/**
* Calculate the position of a given item for a group that

@@ -410,7 +428,7 @@ * is being stacked

/**
*
* @param {*} itemsDimensions
* @param {*} isGroupStacked
* @param {*} lineHeight
* @param {*} groupTop
*
* @param {*} itemsDimensions
* @param {*} isGroupStacked
* @param {*} lineHeight
* @param {*} groupTop
*/

@@ -423,4 +441,6 @@ function stackGroup(itemsDimensions, isGroupStacked, lineHeight, groupTop) {

var r = {};
if (isGroupStacked) {
if (isGroupStacked === 'space') {
r = groupStack(lineHeight, itemsDimensions[itemIndex], itemsDimensions, groupHeight, groupTop, itemIndex);
} else if (isGroupStacked === 'lines') {
r = groupStackInLines(lineHeight, itemsDimensions[itemIndex], itemsDimensions, groupHeight, groupTop, itemIndex);
} else {

@@ -427,0 +447,0 @@ r = groupNoStack(lineHeight, itemsDimensions[itemIndex], groupHeight, groupTop);

{
"name": "@r365/react-calendar-timeline",
"version": "0.25.0-beta.13",
"version": "0.25.0-beta.17",
"description": "react calendar timeline",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -86,3 +86,3 @@ # React Calendar Timeline

rightTitle: 'title in the right sidebar',
stackItems?: true,
stackItems?: false or 'space' or 'line',
height?: 30

@@ -242,2 +242,7 @@ }

can be assigned to
- false
- space (saves space in stacking)
- line (stack each item in a line)
## traditionalZoom

@@ -244,0 +249,0 @@

@@ -64,3 +64,3 @@ import PropTypes from 'prop-types'

stackItems: PropTypes.bool,
stackItems: PropTypes.oneOf([false,'space', 'lines']),

@@ -67,0 +67,0 @@ traditionalZoom: PropTypes.bool,

@@ -301,2 +301,26 @@ import moment from 'moment'

/**
* Calculate the position of a given item for a group that each in a line
* is being stacked
*/
export function groupStackInLines(
lineHeight,
item,
items,
groupHeight,
groupTop,
itemIndex
) {
// calculate non-overlapping positions
let verticalMargin = lineHeight - item.dimensions.height
if (item.dimensions.stack && item.dimensions.top === null) {
item.dimensions.top = groupTop + verticalMargin + itemIndex * lineHeight
}
return {
groupHeight: lineHeight * items.length,
verticalMargin,
itemTop: item.dimensions.top
}
}
/**
* Calculate the position of a given item for a group that

@@ -351,3 +375,2 @@ * is being stacked

}
}

@@ -413,9 +436,14 @@

/**
*
* @param {*} itemsDimensions
* @param {*} isGroupStacked
* @param {*} lineHeight
* @param {*} groupTop
*
* @param {*} itemsDimensions
* @param {*} isGroupStacked
* @param {*} lineHeight
* @param {*} groupTop
*/
export function stackGroup(itemsDimensions, isGroupStacked, lineHeight, groupTop) {
export function stackGroup(
itemsDimensions,
isGroupStacked,
lineHeight,
groupTop
) {
var groupHeight = 0

@@ -426,3 +454,3 @@ var verticalMargin = 0

let r = {}
if (isGroupStacked) {
if (isGroupStacked === 'space') {
r = groupStack(

@@ -436,4 +464,18 @@ lineHeight,

)
} else if (isGroupStacked === 'lines') {
r = groupStackInLines(
lineHeight,
itemsDimensions[itemIndex],
itemsDimensions,
groupHeight,
groupTop,
itemIndex
)
} else {
r = groupNoStack(lineHeight, itemsDimensions[itemIndex], groupHeight, groupTop)
r = groupNoStack(
lineHeight,
itemsDimensions[itemIndex],
groupHeight,
groupTop
)
}

@@ -440,0 +482,0 @@ groupHeight = r.groupHeight

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc