streaksheet
Advanced tools
Comparing version 0.9.5 to 0.9.6
@@ -115,2 +115,4 @@ import * as React from 'react'; | ||
frozenColumns?: number; | ||
initialScrollTop?: number; | ||
initialScrollLeft?: number; | ||
renderOverscanColumnCount?: number; | ||
@@ -130,2 +132,6 @@ renderOverscanRowCount?: number; | ||
onRowSelectionChanged?: (selectedRowsManager: SelectedRowsManager) => void; | ||
onScroll?: (scrollProps: { | ||
scrollTop: number; | ||
scrollLeft: number; | ||
}) => void; | ||
onUnhandledKeyDown?(event: { | ||
@@ -156,2 +162,6 @@ domEvent: React.KeyboardEvent; | ||
getSelectedCells(): CellKeys[]; | ||
getScrollPosition(): { | ||
scrollTop: number; | ||
scrollLeft: number; | ||
}; | ||
isRowSelected(sectionKey: string, rowKey: string): boolean; | ||
@@ -177,2 +187,6 @@ isSectionSelected(sectionKey: string): 'all' | 'some' | 'none'; | ||
scrollToSection(sectionKey: string): void; | ||
scrollTo(scrollArgs: { | ||
scrollTop: number; | ||
scrollLeft: number; | ||
}): void; | ||
} | ||
@@ -179,0 +193,0 @@ declare const StreakSheet: <T, C extends ComponentType<CellProps<T>>>(props: Props<T, C> & { |
@@ -105,4 +105,7 @@ "use strict"; | ||
groupbar = props.groupbar, | ||
initialScrollLeft = props.initialScrollLeft, | ||
initialScrollTop = props.initialScrollTop, | ||
onEnterEditMode = props.onEnterEditMode, | ||
onExitEditMode = props.onExitEditMode, | ||
onScroll = props.onScroll, | ||
rowHoveredClassName = props.rowHoveredClassName; | ||
@@ -583,2 +586,8 @@ var groupbarHeightVarName = (groupbar === null || groupbar === void 0 ? void 0 : groupbar.heightVarName) || '--streaksheet-groupbar-height'; | ||
}, | ||
getScrollPosition: function getScrollPosition() { | ||
return { | ||
scrollTop: outerElementRef.current.scrollTop, | ||
scrollLeft: outerElementRef.current.scrollLeft | ||
}; | ||
}, | ||
highlightNextSearchResult: function highlightNextSearchResult() { | ||
@@ -903,9 +912,14 @@ throw new Error('unimplemented'); | ||
}, | ||
scrollToSection: function scrollToSection(sectionKey) { | ||
scrollTo: function scrollTo(scrollArgs) { | ||
var _gridRef$current7; | ||
(_gridRef$current7 = gridRef.current) === null || _gridRef$current7 === void 0 ? void 0 : _gridRef$current7.scrollTo(scrollArgs); | ||
}, | ||
scrollToSection: function scrollToSection(sectionKey) { | ||
var _gridRef$current8; | ||
var rowIndex = (0, _getSectionRawRowIndex["default"])(columnAndOverviewData.sections, sectionKey, getEffectiveSectionRowCount) - 3; // subtract a few so topSection and header row doesn't cover anything. | ||
// TODO handle topSectionHeight correctly | ||
(_gridRef$current7 = gridRef.current) === null || _gridRef$current7 === void 0 ? void 0 : _gridRef$current7.scrollToItem({ | ||
(_gridRef$current8 = gridRef.current) === null || _gridRef$current8 === void 0 ? void 0 : _gridRef$current8.scrollToItem({ | ||
align: 'start', | ||
@@ -959,2 +973,4 @@ rowIndex: rowIndex | ||
}, | ||
initialScrollLeft: initialScrollLeft, | ||
initialScrollTop: initialScrollTop, | ||
rowCount: totalRowCount, | ||
@@ -1005,15 +1021,24 @@ rowHeight: function rowHeight(index) { | ||
onScroll: // Only set up the onscroll handler if we need it | ||
(groupbar === null || groupbar === void 0 ? void 0 : groupbar.minHeight) != null && groupbar.minHeight !== groupbar.maxHeight ? function (_ref5) { | ||
var scrollTop = _ref5.scrollTop; | ||
dispatchGroupbarHeight({ | ||
type: 'SCROLL', | ||
scrollTop: scrollTop | ||
(groupbar === null || groupbar === void 0 ? void 0 : groupbar.minHeight) != null && groupbar.minHeight !== groupbar.maxHeight || onScroll ? function (_ref5) { | ||
var scrollTop = _ref5.scrollTop, | ||
scrollLeft = _ref5.scrollLeft; | ||
if (groupbar) { | ||
dispatchGroupbarHeight({ | ||
type: 'SCROLL', | ||
scrollTop: scrollTop | ||
}); | ||
} | ||
onScroll === null || onScroll === void 0 ? void 0 : onScroll({ | ||
scrollTop: scrollTop, | ||
scrollLeft: scrollLeft | ||
}); | ||
} : undefined | ||
}, _CellContainer["default"]); | ||
}, [cellIndexesToKeys, columnAndOverviewData, defaultRowHeight, height, itemData, onItemsRendered, renderOverscanColumnCount, renderOverscanRowCount, sectionRowMatcher, styles, topSectionHeight, totalRowCount, width, groupbar === null || groupbar === void 0 ? void 0 : groupbar.maxHeight, groupbar === null || groupbar === void 0 ? void 0 : groupbar.minHeight, visibleColumns]); | ||
}, [visibleColumns, initialScrollLeft, initialScrollTop, totalRowCount, defaultRowHeight, width, height, itemData, renderOverscanColumnCount, renderOverscanRowCount, onItemsRendered, styles, groupbar, onScroll, sectionRowMatcher, topSectionHeight, columnAndOverviewData.sections, cellIndexesToKeys]); | ||
var resetAfterColumnIndex = (0, React.useCallback)(function (index, shouldForceUpdate) { | ||
var _gridRef$current8; | ||
var _gridRef$current9; | ||
return (_gridRef$current8 = gridRef.current) === null || _gridRef$current8 === void 0 ? void 0 : _gridRef$current8.resetAfterColumnIndex(index, shouldForceUpdate); | ||
return (_gridRef$current9 = gridRef.current) === null || _gridRef$current9 === void 0 ? void 0 : _gridRef$current9.resetAfterColumnIndex(index, shouldForceUpdate); | ||
}, []); | ||
@@ -1020,0 +1045,0 @@ return /*#__PURE__*/React.createElement("div", { |
{ | ||
"name": "streaksheet", | ||
"version": "0.9.5", | ||
"version": "0.9.6", | ||
"author": "Chris Cowan <agentme49@gmail.com>", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
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
831571
7381