gantt-schedule-timeline-calendar
Advanced tools
Comparing version 0.0.32 to 0.0.33
{ | ||
"name": "gantt-schedule-timeline-calendar", | ||
"version": "0.0.32", | ||
"version": "0.0.33", | ||
"description": "Gantt, Scheduler, Timeline, Calendar components all in one!", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.umd.js", |
@@ -10,2 +10,3 @@ /** | ||
import ResizeObserver from 'resize-observer-polyfill'; | ||
export default function Chart(vido) { | ||
@@ -113,2 +114,22 @@ const { api, state, onDestroy, actions, update, html, createComponent } = vido; | ||
let chartWidth = 0; | ||
let ro; | ||
componentActions.push(element => { | ||
ro = new ResizeObserver((entries, observer) => { | ||
const width = element.clientWidth; | ||
const height = element.clientHeight; | ||
const innerWidth = width - state.get('_internal.scrollBarHeight'); | ||
if (chartWidth !== width) { | ||
chartWidth = width; | ||
state.update('_internal.chart.dimensions', { width, innerWidth, height }); | ||
} | ||
}); | ||
ro.observe(element); | ||
state.update('_internal.elements.main', element); | ||
}); | ||
onDestroy(() => { | ||
ro.disconnect(); | ||
}); | ||
return props => html` | ||
@@ -115,0 +136,0 @@ <div class=${className} data-actions=${actions(componentActions, { api, state })} @wheel=${onScroll}> |
@@ -86,5 +86,9 @@ /** | ||
if (isMoving) { | ||
let minWidth = state.get('config.list.columns.minWidth'); | ||
if (typeof column.minWidth === 'number') { | ||
minWidth = column.minWidth; | ||
} | ||
left += event.movementX; | ||
if (left < 0) { | ||
left = 0; | ||
if (left < minWidth) { | ||
left = minWidth; | ||
} | ||
@@ -91,0 +95,0 @@ if (inRealTime) { |
@@ -198,13 +198,7 @@ /** | ||
'_internal.scrollBarHeight', | ||
'_internal.list.width' | ||
'_internal.list.width', | ||
'_internal.chart.dimensions' | ||
], | ||
function recalculateTimesAction() { | ||
const chartWidth = state.get('_internal.dimensions.width') - state.get('_internal.list.width'); | ||
const chartInnerWidth = chartWidth - state.get('_internal.scrollBarHeight'); | ||
const chartHeight = state.get('_internal.dimensions.height') - state.get('config.headerHeight'); | ||
state.update('_internal.chart.dimensions', { | ||
width: chartWidth, | ||
innerWidth: chartInnerWidth, | ||
height: chartHeight | ||
}); | ||
const chartWidth = state.get('_internal.chart.dimensions.width'); | ||
let time = api.mergeDeep({}, state.get('config.chart.time')); | ||
@@ -211,0 +205,0 @@ time = api.time.recalculateFromTo(time); |
@@ -149,2 +149,3 @@ /** | ||
}, | ||
minWidth: 50, | ||
data: {} | ||
@@ -151,0 +152,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1126855
4855