@gooddata/sdk-ui-dashboard 10.35.0-alpha.5 → 10.35.0-alpha.6
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/esm/__version.d.ts +1 -1
- package/esm/__version.js +1 -1
- package/esm/model/commandHandlers/layout/resizeWidthHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/layout/resizeWidthHandler.js +31 -7
- package/esm/model/commandHandlers/layout/resizeWidthHandler.js.map +1 -1
- package/package.json +15 -15
package/esm/__version.d.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export declare const LIB_VERSION = "10.35.0-alpha.
|
1
|
+
export declare const LIB_VERSION = "10.35.0-alpha.6";
|
2
2
|
//# sourceMappingURL=__version.d.ts.map
|
package/esm/__version.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"resizeWidthHandler.d.ts","sourceRoot":"","sources":["../../../../src/model/commandHandlers/layout/resizeWidthHandler.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"resizeWidthHandler.d.ts","sourceRoot":"","sources":["../../../../src/model/commandHandlers/layout/resizeWidthHandler.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG1C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAMvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,OAAO,EACH,sCAAsC,EAEzC,MAAM,wBAAwB,CAAC;AA+HhC,wBAAiB,kBAAkB,CAC/B,GAAG,EAAE,gBAAgB,EACrB,GAAG,EAAE,WAAW,GACjB,YAAY,CAAC,sCAAsC,CAAC,CAiCtD"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
// (C) 2021-2025 GoodData Corporation
|
2
|
-
import { isDashboardLayout } from "@gooddata/sdk-model";
|
2
|
+
import { isDashboardLayout, } from "@gooddata/sdk-model";
|
3
3
|
import { put, select, call } from "redux-saga/effects";
|
4
4
|
import { invalidArgumentsProvided } from "../../events/general.js";
|
5
5
|
import { determineWidthForScreen, getMinWidth } from "../../../_staging/layout/sizing.js";
|
@@ -11,9 +11,9 @@ import { layoutSectionItemWidthResized, } from "../../events/layout.js";
|
|
11
11
|
import { DASHBOARD_LAYOUT_GRID_COLUMNS_COUNT } from "../../../_staging/dashboard/flexibleLayout/config.js";
|
12
12
|
import { serializeLayoutItemPath, findSection, findItem, getSectionIndex, getItemIndex, getParentPath, } from "../../../_staging/layout/coordinates.js";
|
13
13
|
import { selectSettings } from "../../store/config/configSelectors.js";
|
14
|
-
import { getContainerDirectionAtPath } from "../../../_staging/dashboard/flexibleLayout/layoutConfiguration.js";
|
14
|
+
import { getContainerDirectionAtPath, getLayoutConfiguration, } from "../../../_staging/dashboard/flexibleLayout/layoutConfiguration.js";
|
15
15
|
import { resizeParentContainers } from "./containerHeightSanitization.js";
|
16
|
-
import {
|
16
|
+
import { getUpdatedSizesOnly } from "./containerWidthSanitization.js";
|
17
17
|
function validateLayoutIndexes(ctx, layout, command) {
|
18
18
|
const { payload: { itemPath, sectionIndex, itemIndex }, } = command;
|
19
19
|
if (itemPath === undefined) {
|
@@ -35,18 +35,42 @@ function validateLayoutIndexes(ctx, layout, command) {
|
|
35
35
|
}
|
36
36
|
}
|
37
37
|
}
|
38
|
+
function processChildren(layoutItem, itemPath, targetItemWidth) {
|
39
|
+
if (!isDashboardLayout(layoutItem.widget)) {
|
40
|
+
return []; // at this point, we only process nested layouts - this is required by the type check
|
41
|
+
}
|
42
|
+
const parentContainerDirection = getLayoutConfiguration(layoutItem.widget).direction;
|
43
|
+
return layoutItem.widget.sections.flatMap((section, sectionIndex) => {
|
44
|
+
return section.items.flatMap((item, itemIndex) => {
|
45
|
+
const currentPath = [...itemPath, { sectionIndex, itemIndex }];
|
46
|
+
const itemWidth = item.size.xl.gridWidth;
|
47
|
+
// Only the column children will get resized to the parent width (including the container itself).
|
48
|
+
// The row children will shrink when they are too big for the new parent size, but will never
|
49
|
+
// grow, otherwise they would behave as if they were inside the column container.
|
50
|
+
const newItemWidth = parentContainerDirection === "column"
|
51
|
+
? targetItemWidth
|
52
|
+
: Math.min(targetItemWidth, itemWidth);
|
53
|
+
if (isDashboardLayout(item.widget)) {
|
54
|
+
return [
|
55
|
+
{ itemPath: currentPath, width: newItemWidth },
|
56
|
+
...processChildren(item, currentPath, targetItemWidth),
|
57
|
+
];
|
58
|
+
}
|
59
|
+
return [{ itemPath: currentPath, width: newItemWidth }];
|
60
|
+
});
|
61
|
+
});
|
62
|
+
}
|
38
63
|
function mapNestedItemsToNewWidth(layout, itemPath, newItemWidth) {
|
39
64
|
const modifiedItem = findItem(layout, itemPath);
|
40
65
|
if (isDashboardLayout(modifiedItem.widget)) {
|
41
|
-
|
42
|
-
return childLayoutPaths.map((itemPath) => ({ itemPath, width: newItemWidth }));
|
66
|
+
return processChildren(modifiedItem, itemPath, newItemWidth);
|
43
67
|
}
|
44
68
|
return [];
|
45
69
|
}
|
46
70
|
function findItemsWithChangedWidth(layout, itemPath, newItemWidth, screen) {
|
71
|
+
const modifiedItemWithNewWidth = { itemPath, width: newItemWidth };
|
47
72
|
const nestedItemsWithNewWidth = mapNestedItemsToNewWidth(layout, itemPath, newItemWidth);
|
48
|
-
const
|
49
|
-
const allItemsWithNewWidth = [itemWithNewWidth, ...nestedItemsWithNewWidth];
|
73
|
+
const allItemsWithNewWidth = [modifiedItemWithNewWidth, ...nestedItemsWithNewWidth];
|
50
74
|
return getUpdatedSizesOnly(layout, allItemsWithNewWidth, screen);
|
51
75
|
}
|
52
76
|
export function* resizeWidthHandler(ctx, cmd) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"resizeWidthHandler.js","sourceRoot":"","sources":["../../../../src/model/commandHandlers/layout/resizeWidthHandler.ts"],"names":[],"mappings":"AAAA,qCAAqC;AAErC,OAAO,
|
1
|
+
{"version":3,"file":"resizeWidthHandler.js","sourceRoot":"","sources":["../../../../src/model/command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AC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC;QAC9C,CAAC,CAAC,mCAAmC,CAAC;IAE1C,MAAM,UAAU,GAAG,KAAK,IAAI,QAAQ,IAAI,KAAK,IAAI,QAAQ,CAAC;IAE1D,IAAI,CAAC,UAAU,EAAE,CAAC;QACd,MAAM,wBAAwB,CAC1B,GAAG,EACH,GAAG,EACH,0DAA0D,QAAQ,OAAO,QAAQ,GAAG,CACvF,CAAC;IACN,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@gooddata/sdk-ui-dashboard",
|
3
|
-
"version": "10.35.0-alpha.
|
3
|
+
"version": "10.35.0-alpha.6",
|
4
4
|
"description": "GoodData SDK - Dashboard Component",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -60,17 +60,17 @@
|
|
60
60
|
"@codemirror/language": "~6.11.0",
|
61
61
|
"@lezer/highlight": "~1.2.1",
|
62
62
|
"@react-aria/interactions": "^3",
|
63
|
-
"@gooddata/sdk-backend-base": "10.35.0-alpha.
|
64
|
-
"@gooddata/sdk-backend-spi": "10.35.0-alpha.
|
65
|
-
"@gooddata/sdk-ui": "10.35.0-alpha.
|
66
|
-
"@gooddata/sdk-
|
67
|
-
"@gooddata/sdk-
|
68
|
-
"@gooddata/sdk-ui-filters": "10.35.0-alpha.
|
69
|
-
"@gooddata/sdk-ui-geo": "10.35.0-alpha.
|
70
|
-
"@gooddata/sdk-ui-kit": "10.35.0-alpha.
|
71
|
-
"@gooddata/sdk-ui-
|
72
|
-
"@gooddata/
|
73
|
-
"@gooddata/
|
63
|
+
"@gooddata/sdk-backend-base": "10.35.0-alpha.6",
|
64
|
+
"@gooddata/sdk-backend-spi": "10.35.0-alpha.6",
|
65
|
+
"@gooddata/sdk-ui-ext": "10.35.0-alpha.6",
|
66
|
+
"@gooddata/sdk-ui": "10.35.0-alpha.6",
|
67
|
+
"@gooddata/sdk-model": "10.35.0-alpha.6",
|
68
|
+
"@gooddata/sdk-ui-filters": "10.35.0-alpha.6",
|
69
|
+
"@gooddata/sdk-ui-geo": "10.35.0-alpha.6",
|
70
|
+
"@gooddata/sdk-ui-kit": "10.35.0-alpha.6",
|
71
|
+
"@gooddata/sdk-ui-vis-commons": "10.35.0-alpha.6",
|
72
|
+
"@gooddata/util": "10.35.0-alpha.6",
|
73
|
+
"@gooddata/sdk-ui-theme-provider": "10.35.0-alpha.6"
|
74
74
|
},
|
75
75
|
"peerDependencies": {
|
76
76
|
"react": "^16.10.0 || ^17.0.0 || ^18.0.0",
|
@@ -122,9 +122,9 @@
|
|
122
122
|
"typescript": "5.3.3",
|
123
123
|
"vitest": "3.0.8",
|
124
124
|
"vitest-dom": "0.1.1",
|
125
|
-
"@gooddata/
|
126
|
-
"@gooddata/
|
127
|
-
"@gooddata/sdk-backend-mockingbird": "10.35.0-alpha.
|
125
|
+
"@gooddata/i18n-toolkit": "10.35.0-alpha.6",
|
126
|
+
"@gooddata/reference-workspace": "10.35.0-alpha.6",
|
127
|
+
"@gooddata/sdk-backend-mockingbird": "10.35.0-alpha.6"
|
128
128
|
},
|
129
129
|
"scripts": {
|
130
130
|
"clean": "rm -rf ci dist esm coverage *.log styles/css tsconfig.tsbuildinfo",
|