@handsontable/react-wrapper 0.0.0-next-accbc16-20260828 → 0.0.0-next-e7ff0da-20260901
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/commonjs/react-handsontable.js +35 -12
- package/dist/react-handsontable.js +36 -13
- package/dist/react-handsontable.js.map +1 -1
- package/dist/react-handsontable.min.js +2 -2
- package/dist/react-handsontable.min.js.map +1 -1
- package/es/react-handsontable.mjs +35 -12
- package/package.json +3 -3
- package/settingsMapper.d.ts +2 -1
|
@@ -522,12 +522,26 @@ function useUpdateEffect(effect, deps) {
|
|
|
522
522
|
}
|
|
523
523
|
|
|
524
524
|
/**
|
|
525
|
-
* Only
|
|
526
|
-
*
|
|
525
|
+
* Only these settings use deep comparison when diffing props for `updateSettings(false)`. Other
|
|
526
|
+
* object settings (for example `mergeCells`, `cell`, `nestedHeaders`, hooks) stay on strict
|
|
527
527
|
* reference equality so we avoid expensive deep walks and accidental false positives where functions
|
|
528
528
|
* or class instances would not compare meaningfully by keys alone.
|
|
529
|
+
*
|
|
530
|
+
* `rowHeights`, `minRowHeights` (its documented alias) and `colWidths` are here because passing any
|
|
531
|
+
* of them re-declares the sizes and discards the ones the user produced by dragging
|
|
532
|
+
* (`ManualRowResize` / `ManualColumnResize`). A re-render must not do that, and a React app commonly
|
|
533
|
+
* writes the value inline (`rowHeights={[50, 50]}`), which is a new array on every render and never
|
|
534
|
+
* reference-equal. All three hold plain numbers, strings or arrays of them, so the deep walk is
|
|
535
|
+
* cheap. The Vue wrapper already skips unchanged keys this way.
|
|
536
|
+
*/
|
|
537
|
+
var DEEP_COMPARABLE_SETTINGS = ['dataSchema', 'columns', 'rowHeights', 'minRowHeights', 'colWidths'];
|
|
538
|
+
|
|
539
|
+
/**
|
|
540
|
+
* The size settings are compared against the grid's live settings rather than the previous props,
|
|
541
|
+
* which is what the Angular and Vue wrappers already do. Comparing against props alone would stop
|
|
542
|
+
* re-asserting the prop after anything changed the size through the instance ref.
|
|
529
543
|
*/
|
|
530
|
-
var
|
|
544
|
+
var COMPARED_AGAINST_LIVE_SETTINGS = ['rowHeights', 'minRowHeights', 'colWidths'];
|
|
531
545
|
var SettingsMapper = /*#__PURE__*/function () {
|
|
532
546
|
function SettingsMapper() {
|
|
533
547
|
_classCallCheck(this, SettingsMapper);
|
|
@@ -551,14 +565,23 @@ var SettingsMapper = /*#__PURE__*/function () {
|
|
|
551
565
|
_ref$isInit = _ref.isInit,
|
|
552
566
|
isInit = _ref$isInit === void 0 ? false : _ref$isInit,
|
|
553
567
|
_ref$initOnlySettingK = _ref.initOnlySettingKeys,
|
|
554
|
-
initOnlySettingKeys = _ref$initOnlySettingK === void 0 ? [] : _ref$initOnlySettingK
|
|
568
|
+
initOnlySettingKeys = _ref$initOnlySettingK === void 0 ? [] : _ref$initOnlySettingK,
|
|
569
|
+
currentSettings = _ref.currentSettings;
|
|
555
570
|
var shouldSkipProp = function shouldSkipProp(key) {
|
|
556
|
-
if (
|
|
557
|
-
return
|
|
571
|
+
if (isInit) {
|
|
572
|
+
return false;
|
|
558
573
|
}
|
|
559
|
-
|
|
574
|
+
|
|
575
|
+
// Checked before the value comparison below. The two lists do not overlap today, but a
|
|
576
|
+
// changed deep-comparable key used to return early and skip this guard entirely, which would
|
|
577
|
+
// have forwarded an init-only key to `updateSettings` as soon as one joined both lists.
|
|
578
|
+
if (initOnlySettingKeys.includes(key)) {
|
|
560
579
|
return true;
|
|
561
580
|
}
|
|
581
|
+
if (DEEP_COMPARABLE_SETTINGS.includes(key)) {
|
|
582
|
+
var comparedValue = currentSettings && COMPARED_AGAINST_LIVE_SETTINGS.includes(key) ? currentSettings[key] : prevProps[key];
|
|
583
|
+
return areEquivalentSettingsValue(comparedValue, properties[key]);
|
|
584
|
+
}
|
|
562
585
|
return false;
|
|
563
586
|
};
|
|
564
587
|
var newSettings = {};
|
|
@@ -1190,7 +1213,7 @@ var HotColumn = function HotColumn(props) {
|
|
|
1190
1213
|
}, editorPortal);
|
|
1191
1214
|
};
|
|
1192
1215
|
|
|
1193
|
-
var version="0.0.0-next-
|
|
1216
|
+
var version="0.0.0-next-e7ff0da-20260901";
|
|
1194
1217
|
|
|
1195
1218
|
/**
|
|
1196
1219
|
* Component used to manage the renderer component portals.
|
|
@@ -2405,13 +2428,13 @@ var HotTableInner = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
2405
2428
|
var _getHotInstance;
|
|
2406
2429
|
var init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
2407
2430
|
var prevProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
2408
|
-
var
|
|
2409
|
-
|
|
2410
|
-
((_getHotInstance = getHotInstance()) === null || _getHotInstance === void 0 || (_getHotInstance = _getHotInstance.getSettings()) === null || _getHotInstance === void 0 ? void 0 : _getHotInstance._initOnlySettings) || [] : [];
|
|
2431
|
+
var liveSettings = !isHotInstanceDestroyed() ? (_getHotInstance = getHotInstance()) === null || _getHotInstance === void 0 ? void 0 : _getHotInstance.getSettings() : undefined;
|
|
2432
|
+
var initOnlySettingKeys = (liveSettings === null || liveSettings === void 0 ? void 0 : liveSettings._initOnlySettings) || [];
|
|
2411
2433
|
var newSettings = SettingsMapper.getSettings(props, {
|
|
2412
2434
|
prevProps: prevProps,
|
|
2413
2435
|
isInit: init,
|
|
2414
|
-
initOnlySettingKeys: initOnlySettingKeys
|
|
2436
|
+
initOnlySettingKeys: initOnlySettingKeys,
|
|
2437
|
+
currentSettings: liveSettings
|
|
2415
2438
|
});
|
|
2416
2439
|
if (context.columnsSettings.length) {
|
|
2417
2440
|
newSettings.columns = context.columnsSettings;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@handsontable/react-wrapper",
|
|
3
|
-
"version": "0.0.0-next-
|
|
3
|
+
"version": "0.0.0-next-e7ff0da-20260901",
|
|
4
4
|
"description": "Best Data Grid for React with Spreadsheet Look and Feel.",
|
|
5
5
|
"author": "Handsoncode <hello@handsoncode.net> (https://handsoncode.net)",
|
|
6
6
|
"homepage": "https://handsontable.com",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"@types/react-dom": "^18.2.0",
|
|
74
74
|
"@types/react-redux": "^7.1.7",
|
|
75
75
|
"cross-env": "^7.0.3",
|
|
76
|
-
"handsontable": "0.0.0-next-
|
|
76
|
+
"handsontable": "0.0.0-next-e7ff0da-20260901",
|
|
77
77
|
"jest": "^27.5.1",
|
|
78
78
|
"jest-environment-jsdom": "^27.5.1",
|
|
79
79
|
"prop-types": "^15.7.2",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"uglify-js": "^3.4.9"
|
|
89
89
|
},
|
|
90
90
|
"peerDependencies": {
|
|
91
|
-
"handsontable": "0.0.0-next-
|
|
91
|
+
"handsontable": "0.0.0-next-e7ff0da-20260901"
|
|
92
92
|
},
|
|
93
93
|
"scripts": {
|
|
94
94
|
"build": "npm run clean && npm run build:commonjs && npm run build:es && npm run build:umd && npm run build:min && npm run prepare:types",
|
package/settingsMapper.d.ts
CHANGED
|
@@ -10,9 +10,10 @@ export declare class SettingsMapper {
|
|
|
10
10
|
* @param {string[]} additionalSettings.initOnlySettingKeys Array of keys that can be set only during initialization.
|
|
11
11
|
* @returns {Object} Handsontable-compatible settings object.
|
|
12
12
|
*/
|
|
13
|
-
static getSettings(properties: HotTableProps, { prevProps, isInit, initOnlySettingKeys }?: {
|
|
13
|
+
static getSettings(properties: HotTableProps, { prevProps, isInit, initOnlySettingKeys, currentSettings }?: {
|
|
14
14
|
prevProps?: HotTableProps;
|
|
15
15
|
isInit?: boolean;
|
|
16
16
|
initOnlySettingKeys?: Array<keyof Handsontable.GridSettings>;
|
|
17
|
+
currentSettings?: Handsontable.GridSettings;
|
|
17
18
|
}): Handsontable.GridSettings;
|
|
18
19
|
}
|