streaksheet
Advanced tools
Comparing version 0.7.44 to 0.7.45
@@ -65,4 +65,3 @@ "use strict"; | ||
left: columnLeft + width, | ||
transform: 'translateX(-50%)', | ||
zIndex: 99 | ||
transform: 'translateX(-50%)' | ||
}, | ||
@@ -69,0 +68,0 @@ onClick: function onClick(e) { |
@@ -115,2 +115,8 @@ import * as React from 'react'; | ||
}): void; | ||
onExitEditMode?(event: { | ||
sectionKey: string; | ||
columnKey: string; | ||
rowKey: string | null; | ||
cancel(): void; | ||
}): void; | ||
onOpenSearch?(): void; | ||
@@ -117,0 +123,0 @@ onUnhandledKeyDown?(event: { |
@@ -81,3 +81,4 @@ "use strict"; | ||
groupbar = props.groupbar, | ||
onEnterEditMode = props.onEnterEditMode; | ||
onEnterEditMode = props.onEnterEditMode, | ||
onExitEditMode = props.onExitEditMode; | ||
var topSectionHeight = props.topSection ? (_props$topSectionHeig = props.topSectionHeight) !== null && _props$topSectionHeig !== void 0 ? _props$topSectionHeig : defaultRowHeight : 0; | ||
@@ -145,19 +146,36 @@ var styles = (0, React.useMemo)(function () { | ||
_setCellBeingEditedRef.current = function (newValue, queuedValue) { | ||
if (newValue && onEnterEditMode) { | ||
if (!cellBeingEdited || cellBeingEdited.sectionKey !== newValue.sectionKey || cellBeingEdited.rowKey !== newValue.rowKey || cellBeingEdited.columnKey !== newValue.columnKey) { | ||
var cancelled = false; | ||
var _event = { | ||
sectionKey: newValue.sectionKey, | ||
columnKey: newValue.columnKey, | ||
rowKey: newValue.rowKey, | ||
cancel: function cancel() { | ||
cancelled = true; | ||
} | ||
}; | ||
onEnterEditMode(_event); | ||
var isAttemptingToChangeEditedCell = (cellBeingEdited === null || cellBeingEdited === void 0 ? void 0 : cellBeingEdited.sectionKey) !== (newValue === null || newValue === void 0 ? void 0 : newValue.sectionKey) || (cellBeingEdited === null || cellBeingEdited === void 0 ? void 0 : cellBeingEdited.rowKey) !== (newValue === null || newValue === void 0 ? void 0 : newValue.rowKey) || (cellBeingEdited === null || cellBeingEdited === void 0 ? void 0 : cellBeingEdited.columnKey) !== (newValue === null || newValue === void 0 ? void 0 : newValue.columnKey); | ||
if (cancelled) { | ||
return false; | ||
if (newValue && isAttemptingToChangeEditedCell && onEnterEditMode) { | ||
var cancelled = false; | ||
var _event = { | ||
sectionKey: newValue.sectionKey, | ||
columnKey: newValue.columnKey, | ||
rowKey: newValue.rowKey, | ||
cancel: function cancel() { | ||
cancelled = true; | ||
} | ||
}; | ||
onEnterEditMode(_event); | ||
if (cancelled) { | ||
return false; | ||
} | ||
} | ||
if (cellBeingEdited && isAttemptingToChangeEditedCell && onExitEditMode) { | ||
var _cancelled = false; | ||
var _event2 = { | ||
sectionKey: cellBeingEdited.sectionKey, | ||
columnKey: cellBeingEdited.columnKey, | ||
rowKey: cellBeingEdited.rowKey, | ||
cancel: function cancel() { | ||
_cancelled = true; | ||
} | ||
}; | ||
onExitEditMode(_event2); | ||
if (_cancelled) { | ||
return false; | ||
} | ||
} // TODO keep in state? | ||
@@ -164,0 +182,0 @@ |
{ | ||
"name": "streaksheet", | ||
"version": "0.7.44", | ||
"version": "0.7.45", | ||
"author": "Chris Cowan <agentme49@gmail.com>", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
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
525128
4635