@zambezi/grid
Advanced tools
Comparing version 0.18.2 to 0.18.3-selection-changed-leak-fix.1
@@ -189,3 +189,4 @@ ### Column configuration | ||
````javascript | ||
```javascript | ||
const columns = [ | ||
@@ -201,2 +202,3 @@ , { key: "id"} | ||
] | ||
``` | ||
@@ -203,0 +205,0 @@ |
{ | ||
"name": "@zambezi/grid", | ||
"version": "0.18.2", | ||
"version": "0.18.3-selection-changed-leak-fix.1", | ||
"description": "D3 component for drawing financial grids.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -12,3 +12,3 @@ import { basicPrecisionPxFormatter as px } from './basic-precision-px-formatter' | ||
import { select } from 'd3-selection' | ||
import { selectionChanged, rebind, redispatch } from '@zambezi/d3-utils' | ||
import { rebind, redispatch } from '@zambezi/d3-utils' | ||
@@ -18,12 +18,2 @@ import './body.css' | ||
const sides = [ 'left', 'right', 'width', 'top', 'bottom', 'height' ] | ||
, verticalScrollChanged = selectionChanged() | ||
, horizontalScrollChanged = selectionChanged() | ||
, isScrolledLeft = property('isScrolledLeft') | ||
, isScrolledRight = property('isScrolledRight') | ||
, isScrolledTop = property('isScrolledTop') | ||
, isScrolledBottom = property('isScrolledBottom') | ||
, isVerticalShort = property('isVerticalShort') | ||
, isHorizontalShort = property('isHorizontalShort') | ||
, formatSingleDigitPrecision = format('.1f') | ||
, formatInteger = format('.0f') | ||
@@ -81,4 +71,2 @@ export function createBody() { | ||
, bodyBounds = bundle.bodyBounds | ||
, verticalScroll = scrollChanged(bundle.scroll.top, sizeValidationRound) | ||
, horizontalScroll = scrollChanged(bundle.scroll.left, sizeValidationRound) | ||
, updateLinesChange = onChange(dispatchLinesChange) | ||
@@ -161,10 +149,2 @@ | ||
, minWidth = px(Math.max(d.actualWidth || 0, measuredWidth)) | ||
, forceSizeTarget = select( | ||
(!isUndefined(d.scrollTop) || !isUndefined(d.scrollLeft)) | ||
&& this | ||
) | ||
.call( | ||
ensureSize.targetHeight(measuredHeight) | ||
.targetWidth(measuredWidth) | ||
) | ||
@@ -209,12 +189,2 @@ sheet(rowSelector, { minWidth: minWidth }) | ||
function updateVerticalScroll(d, i) { | ||
if (isUndefined(d.scrollTop)) return | ||
select(this).property('scrollTop', d.scrollTop) | ||
} | ||
function updateHorizontalScroll(d, i) { | ||
if (isUndefined(d.scrollLeft)) return | ||
select(this).property('scrollLeft', d.scrollLeft) | ||
} | ||
function setSectionClasses(d, i) { | ||
@@ -221,0 +191,0 @@ select(this).classed(d.className, true) |
@@ -12,5 +12,2 @@ import { appendFromTemplate, selectionChanged, rebind, forward } from '@zambezi/d3-utils' | ||
, appendRow = appendFromTemplate('<li class="zambezi-grid-row"></li>') | ||
, changed = selectionChanged() | ||
, firstLastChanged = selectionChanged().key(firstAndLast) | ||
, indexChanged = selectionChanged().key(d => d.index) | ||
, id = property('id') | ||
@@ -21,4 +18,6 @@ , isFirst = property('isFirst') | ||
export function createCells() { | ||
const dispatcher = createDispatch( | ||
const changed = selectionChanged() | ||
, firstLastChanged = selectionChanged().key(firstAndLast) | ||
, indexChanged = selectionChanged().key(d => d.index) | ||
, dispatcher = createDispatch( | ||
'cell-enter' | ||
@@ -172,8 +171,2 @@ , 'cell-exit' | ||
function useClass(rowClass) { | ||
return function oldClass(c) { | ||
return (c ? '' : ' ') + rowClass | ||
} | ||
} | ||
function top(d) { | ||
@@ -206,1 +199,2 @@ return d.top + 'px' | ||
@@ -12,3 +12,2 @@ import { range } from 'd3-array' | ||
, freeR = rightBound - d.columns.right.measuredWidth | ||
, positions = [] | ||
, isShort = ~~d.columns.free.measuredWidth < ~~d.columns.free.actualWidth | ||
@@ -46,3 +45,2 @@ | ||
, lastFreeWhenShort = isFree && isShort && isLastInBlock | ||
, firstRightWhenShort = isLockedRight && isShort && isFirstInBlock | ||
, x = ( | ||
@@ -49,0 +47,0 @@ isLastInBlock ? |
@@ -149,5 +149,3 @@ import { columnDragTargetLayout as dragTargetLayout } from './column-drag-target-layout' | ||
function onDragOver(d, i) { | ||
const target = select(this) | ||
, position = d | ||
, dropPositionX = mouse(this)[0] | ||
const dropPositionX = mouse(this)[0] | ||
, dropSide = dropPositionX - (dropWidth / 2) | ||
@@ -283,3 +281,3 @@ , dropCenter = Math.abs(dropSide) < dropCenterTolerance | ||
function notDroppingNestedInNested(column, left, right, newParent, locked) { | ||
function notDroppingNestedInNested(column, left, right, newParent) { | ||
if (newParent && column.children) return false | ||
@@ -286,0 +284,0 @@ return true |
@@ -11,4 +11,2 @@ import { createGroupRowsLayout } from './group-rows-layout' | ||
const isRollupRow = property('row.isRollup') | ||
, isRollupChanged = selectionChanged() | ||
.key(isRollupRow) | ||
@@ -18,2 +16,4 @@ export function createGroupRows() { | ||
const layout = createGroupRowsLayout() | ||
, isRollupChanged = selectionChanged() | ||
.key(isRollupRow) | ||
@@ -20,0 +20,0 @@ let cache = null |
@@ -25,5 +25,2 @@ import { functor, property } from '@zambezi/fun' | ||
, right = pixels('right') | ||
, columnCellsChanged = selectionChanged() | ||
.key(columnChangeKey) | ||
, scrollChanged = selectionChanged() | ||
, scrollLeft = property('scrollLeft') | ||
@@ -35,2 +32,5 @@ , isScrolledLeft = property('cols.isScrolledLeft') | ||
export function createHeaders() { | ||
const columnCellsChanged = selectionChanged() | ||
.key(columnChangeKey) | ||
, scrollChanged = selectionChanged() | ||
@@ -37,0 +37,0 @@ function headers(s) { |
@@ -16,5 +16,5 @@ import './nested-row-expanders.css' | ||
] | ||
, changed = selectionChanged() | ||
export function createNestedRowExpanders() { | ||
const changed = selectionChanged() | ||
@@ -21,0 +21,0 @@ function nestedRowExpanders(d, i) { |
@@ -12,6 +12,3 @@ import { basicPrecisionPxFormatter as px } from './basic-precision-px-formatter' | ||
const verticalScrollChanged = selectionChanged() | ||
, horizontalScrollChanged = selectionChanged() | ||
, clippingChanged = selectionChanged() | ||
, scrollTop = property('scroll.top') | ||
const scrollTop = property('scroll.top') | ||
, scrollLeft = property('scroll.left') | ||
@@ -22,3 +19,6 @@ , appendScrollerContent = appendIfMissing('div.scroller-content') | ||
const sheet = createGridSheet() | ||
const verticalScrollChanged = selectionChanged() | ||
, horizontalScrollChanged = selectionChanged() | ||
, clippingChanged = selectionChanged() | ||
, sheet = createGridSheet() | ||
, internalDispatcher = createDispatch('consolidate') | ||
@@ -25,0 +25,0 @@ , trackLastUpdate = debounce(() => internalDispatcher.call('consolidate'), 10) |
@@ -7,6 +7,6 @@ import './simple-nested-row-expanders.css' | ||
export function createSimpleNestedRowExpanders() { | ||
const changed = selectionChanged() | ||
function simpleNestedRowExpanders(d) { | ||
const row = d.row | ||
const changed = selectionChanged() | ||
, row = d.row | ||
, hasNested = !!(row.children && row.children.length) | ||
@@ -46,2 +46,2 @@ , isExpand = hasNested && row.expanded | ||
return simpleNestedRowExpanders | ||
} | ||
} |
@@ -8,6 +8,6 @@ import { dataset } from './dataset' | ||
const rowNestedLevelChanged = selectionChanged() | ||
.key(property('row.nestLevel')) | ||
export function createUnpackNestedRows() { | ||
const rowNestedLevelChanged = selectionChanged() | ||
.key(property('row.nestLevel')) | ||
@@ -14,0 +14,0 @@ let cache = null |
@@ -15,2 +15,4 @@ import { functor } from '@zambezi/fun' | ||
.text(text) | ||
changed.key(null) | ||
} |
Sorry, the diff of this file is too big to display
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
431516
5388