@gravity-ui/dashkit 8.5.0-beta.0 → 8.5.0-beta.2
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.
|
@@ -136,7 +136,19 @@ function useMemoStateContext(props) {
|
|
|
136
136
|
const resultLayout = react_1.default.useMemo(() => {
|
|
137
137
|
return props.layout.map((item) => {
|
|
138
138
|
if (item.i in adjustedLayouts.current) {
|
|
139
|
-
|
|
139
|
+
// eslint-disable-next-line no-unused-vars
|
|
140
|
+
const _a = adjustedLayouts.current[item.i] || {}, { parent } = _a, adjustedItem = tslib_1.__rest(_a, ["parent"]);
|
|
141
|
+
adjustedItem.w = item.w;
|
|
142
|
+
adjustedItem.x = item.x;
|
|
143
|
+
adjustedItem.y = item.y;
|
|
144
|
+
if (item.parent) {
|
|
145
|
+
adjustedItem.parent = item.parent;
|
|
146
|
+
}
|
|
147
|
+
// update originalLayouts memoized item
|
|
148
|
+
if (originalLayouts.current[item.i]) {
|
|
149
|
+
originalLayouts.current[item.i] = item;
|
|
150
|
+
}
|
|
151
|
+
return adjustedItem;
|
|
140
152
|
}
|
|
141
153
|
else {
|
|
142
154
|
return Object.assign({}, item);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import isEqual from 'lodash/isEqual';
|
|
3
4
|
import pick from 'lodash/pick';
|
|
@@ -132,7 +133,19 @@ function useMemoStateContext(props) {
|
|
|
132
133
|
const resultLayout = React.useMemo(() => {
|
|
133
134
|
return props.layout.map((item) => {
|
|
134
135
|
if (item.i in adjustedLayouts.current) {
|
|
135
|
-
|
|
136
|
+
// eslint-disable-next-line no-unused-vars
|
|
137
|
+
const _a = adjustedLayouts.current[item.i] || {}, { parent } = _a, adjustedItem = __rest(_a, ["parent"]);
|
|
138
|
+
adjustedItem.w = item.w;
|
|
139
|
+
adjustedItem.x = item.x;
|
|
140
|
+
adjustedItem.y = item.y;
|
|
141
|
+
if (item.parent) {
|
|
142
|
+
adjustedItem.parent = item.parent;
|
|
143
|
+
}
|
|
144
|
+
// update originalLayouts memoized item
|
|
145
|
+
if (originalLayouts.current[item.i]) {
|
|
146
|
+
originalLayouts.current[item.i] = item;
|
|
147
|
+
}
|
|
148
|
+
return adjustedItem;
|
|
136
149
|
}
|
|
137
150
|
else {
|
|
138
151
|
return Object.assign({}, item);
|