@gooddata/sdk-ui-dashboard 10.14.0-alpha.15 → 10.14.0-alpha.16
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/store/layout/layoutSelectors.d.ts.map +1 -1
- package/esm/model/store/layout/layoutSelectors.js +18 -6
- package/esm/model/store/layout/layoutSelectors.js.map +1 -1
- package/esm/presentation/constants/layout.d.ts +1 -0
- package/esm/presentation/constants/layout.d.ts.map +1 -1
- package/esm/presentation/constants/layout.js +1 -1
- package/esm/presentation/constants/layout.js.map +1 -1
- package/esm/presentation/dashboard/DefaultDashboardContent/DefaultDashboardMainContent.d.ts.map +1 -1
- package/esm/presentation/dashboard/DefaultDashboardContent/DefaultDashboardMainContent.js +7 -2
- package/esm/presentation/dashboard/DefaultDashboardContent/DefaultDashboardMainContent.js.map +1 -1
- package/esm/presentation/dashboard/components/DashboardMainContent.d.ts.map +1 -1
- package/esm/presentation/dashboard/components/DashboardMainContent.js +7 -2
- package/esm/presentation/dashboard/components/DashboardMainContent.js.map +1 -1
- package/esm/presentation/flexibleLayout/DashboardLayout.d.ts +7 -0
- package/esm/presentation/flexibleLayout/DashboardLayout.d.ts.map +1 -0
- package/esm/presentation/flexibleLayout/DashboardLayout.js +11 -0
- package/esm/presentation/flexibleLayout/DashboardLayout.js.map +1 -0
- package/esm/presentation/flexibleLayout/DashboardLayoutWidget.d.ts.map +1 -1
- package/esm/presentation/flexibleLayout/DashboardLayoutWidget.js +2 -2
- package/esm/presentation/flexibleLayout/DashboardLayoutWidget.js.map +1 -1
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayout.d.ts.map +1 -1
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayout.js +14 -17
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayout.js.map +1 -1
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutEditSectionHeaderRenderer.d.ts.map +1 -1
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutEditSectionHeaderRenderer.js +8 -5
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutEditSectionHeaderRenderer.js.map +1 -1
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutGridRow.d.ts.map +1 -1
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutGridRow.js +1 -2
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutGridRow.js.map +1 -1
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutGridRowEdit.d.ts.map +1 -1
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutGridRowEdit.js +2 -4
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutGridRowEdit.js.map +1 -1
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutItemViewRenderer.d.ts.map +1 -1
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutItemViewRenderer.js +5 -4
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutItemViewRenderer.js.map +1 -1
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutSection.d.ts +2 -1
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutSection.d.ts.map +1 -1
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutSection.js +3 -2
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutSection.js.map +1 -1
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutSectionHeaderRenderer.d.ts.map +1 -1
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutSectionHeaderRenderer.js +9 -4
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutSectionHeaderRenderer.js.map +1 -1
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutSectionRenderer.d.ts.map +1 -1
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutSectionRenderer.js +3 -5
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutSectionRenderer.js.map +1 -1
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutWidgetRenderer.d.ts.map +1 -1
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutWidgetRenderer.js +2 -12
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutWidgetRenderer.js.map +1 -1
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/EditableDashboardLayoutSectionRenderer.d.ts.map +1 -1
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/EditableDashboardLayoutSectionRenderer.js +3 -5
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/EditableDashboardLayoutSectionRenderer.js.map +1 -1
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/GridLayoutElement.d.ts +39 -0
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/GridLayoutElement.d.ts.map +1 -0
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/GridLayoutElement.js +63 -0
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/GridLayoutElement.js.map +1 -0
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/constants.d.ts +2 -0
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/constants.d.ts.map +1 -0
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/constants.js +3 -0
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/constants.js.map +1 -0
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/interfaces.d.ts +20 -14
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/interfaces.d.ts.map +1 -1
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/useScreenSize.d.ts +4 -0
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/useScreenSize.d.ts.map +1 -0
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/useScreenSize.js +34 -0
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/useScreenSize.js.map +1 -0
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/utils/emptyFacade.d.ts +1 -1
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/utils/emptyFacade.d.ts.map +1 -1
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/utils/emptyFacade.js +4 -4
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/utils/emptyFacade.js.map +1 -1
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/utils/sizing.d.ts +10 -2
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/utils/sizing.d.ts.map +1 -1
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/utils/sizing.js +19 -5
- package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/utils/sizing.js.map +1 -1
- package/esm/presentation/flexibleLayout/DefaultFlexibleDashboardLayout.d.ts.map +1 -1
- package/esm/presentation/flexibleLayout/DefaultFlexibleDashboardLayout.js +4 -4
- package/esm/presentation/flexibleLayout/DefaultFlexibleDashboardLayout.js.map +1 -1
- package/esm/presentation/flexibleLayout/index.d.ts +1 -0
- package/esm/presentation/flexibleLayout/index.d.ts.map +1 -1
- package/esm/presentation/flexibleLayout/index.js +1 -0
- package/esm/presentation/flexibleLayout/index.js.map +1 -1
- package/esm/presentation/flexibleLayout/types.d.ts +5 -1
- package/esm/presentation/flexibleLayout/types.d.ts.map +1 -1
- package/esm/presentation/widget/widget/DefaultDashboardWidget.d.ts.map +1 -1
- package/esm/presentation/widget/widget/DefaultDashboardWidget.js +8 -3
- package/esm/presentation/widget/widget/DefaultDashboardWidget.js.map +1 -1
- package/esm/presentation/widget/widget/types.d.ts +7 -1
- package/esm/presentation/widget/widget/types.d.ts.map +1 -1
- package/esm/sdk-ui-dashboard.d.ts +6 -0
- package/package.json +15 -15
- package/styles/css/dashboard.css +80 -287
- package/styles/css/dashboard.css.map +1 -1
- package/styles/css/dragAndDrop.css +5 -0
- package/styles/css/dragAndDrop.css.map +1 -1
- package/styles/css/layout.css +111 -0
- package/styles/css/layout.css.map +1 -1
- package/styles/css/main.css +92 -288
- package/styles/css/main.css.map +1 -1
- package/styles/css/visualization.css +7 -1
- package/styles/css/visualization.css.map +1 -1
- package/styles/scss/dashboard.scss +12 -1
- package/styles/scss/dragAndDrop.scss +8 -0
- package/styles/scss/layout.scss +77 -0
- package/styles/scss/visualization.scss +10 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardLayoutItemViewRenderer.js","sourceRoot":"","sources":["../../../../src/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutItemViewRenderer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DashboardLayoutItemViewRenderer.js","sourceRoot":"","sources":["../../../../src/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutItemViewRenderer.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,KAAK,MAAM,iBAAiB,CAAC;AAMpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,MAAM,aAAa,GAAG,EAAE,M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C;IAClE,MAAM,KAAK,GAAG,8BAA8B,EAAE,aAAa,CAAC;IAC5D,MAAM,MAAM,GAAG,8BAA8B,EAAE,UAAU,CAAC;IAC1D,MAAM,KAAK,GAAG,8BAA8B,EAAE,SAAS,CAAC;IAExD,OAAO;QACH,MAAM;QACN,KAAK;QACL,KAAK;QACL,IAAI;KACP,CAAC;AACN,CAAC"}
|
package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutSection.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ScreenSize } from "@gooddata/sdk-model";
|
|
2
|
+
import { ScreenSize, IDashboardLayoutSizeByScreenSize } from "@gooddata/sdk-model";
|
|
3
3
|
import { RenderMode } from "../../../types.js";
|
|
4
4
|
import { IDashboardLayoutSectionFacade } from "../../../_staging/dashboard/fluidLayout/facade/interfaces.js";
|
|
5
5
|
import { IDashboardLayoutGridRowRenderer, IDashboardLayoutItemKeyGetter, IDashboardLayoutItemRenderer, IDashboardLayoutSectionHeaderRenderer, IDashboardLayoutSectionKeyGetter, IDashboardLayoutSectionRenderer, IDashboardLayoutWidgetRenderer } from "./interfaces.js";
|
|
@@ -19,6 +19,7 @@ export interface IDashboardLayoutSectionProps<TWidget> {
|
|
|
19
19
|
screen: ScreenSize;
|
|
20
20
|
renderMode: RenderMode;
|
|
21
21
|
isDraggingWidget?: boolean;
|
|
22
|
+
parentLayoutItemSize?: IDashboardLayoutSizeByScreenSize;
|
|
22
23
|
}
|
|
23
24
|
export declare function DashboardLayoutSection<TWidget>(props: IDashboardLayoutSectionProps<TWidget>): JSX.Element;
|
|
24
25
|
//# sourceMappingURL=DashboardLayoutSection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardLayoutSection.d.ts","sourceRoot":"","sources":["../../../../src/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutSection.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"DashboardLayoutSection.d.ts","sourceRoot":"","sources":["../../../../src/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutSection.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,gCAAgC,EAAE,MAAM,qBAAqB,CAAC;AAGnF,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAEH,6BAA6B,EAChC,MAAM,8DAA8D,CAAC;AAItE,OAAO,EACH,+BAA+B,EAC/B,6BAA6B,EAC7B,4BAA4B,EAC5B,qCAAqC,EACrC,gCAAgC,EAChC,+BAA+B,EAC/B,8BAA8B,EACjC,MAAM,iBAAiB,CAAC;AAKzB;;GAEG;AACH,MAAM,WAAW,4BAA4B,CAAC,OAAO;IACjD,OAAO,EAAE,6BAA6B,CAAC,OAAO,CAAC,CAAC;IAChD,gBAAgB,CAAC,EAAE,gCAAgC,CAAC,OAAO,CAAC,CAAC;IAC7D,eAAe,CAAC,EAAE,+BAA+B,CAAC,OAAO,CAAC,CAAC;IAC3D,qBAAqB,CAAC,EAAE,qCAAqC,CAAC,OAAO,CAAC,CAAC;IACvE,aAAa,CAAC,EAAE,6BAA6B,CAAC,OAAO,CAAC,CAAC;IACvD,YAAY,CAAC,EAAE,4BAA4B,CAAC,OAAO,CAAC,CAAC;IACrD,cAAc,EAAE,8BAA8B,CAAC,OAAO,CAAC,CAAC;IACxD,eAAe,CAAC,EAAE,+BAA+B,CAAC,OAAO,CAAC,CAAC;IAC3D,mBAAmB,EAAE,MAAM,OAAO,CAAC;IACnC,MAAM,EAAE,UAAU,CAAC;IACnB,UAAU,EAAE,UAAU,CAAC;IACvB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,oBAAoB,CAAC,EAAE,gCAAgC,CAAC;CAC3D;AAYD,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,KAAK,EAAE,4BAA4B,CAAC,OAAO,CAAC,GAAG,GAAG,CAAC,OAAO,CA0FzG"}
|
package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutSection.js
CHANGED
|
@@ -10,8 +10,8 @@ const defaultSectionRenderer = (props) => (React.createElement(DashboardLayoutSe
|
|
|
10
10
|
const defaultHeaderRenderer = (props) => (React.createElement(DashboardLayoutSectionHeaderRenderer, { ...props }));
|
|
11
11
|
const defaultItemKeyGetter = ({ item }) => item.index().toString();
|
|
12
12
|
export function DashboardLayoutSection(props) {
|
|
13
|
-
const { section, sectionRenderer = defaultSectionRenderer, sectionHeaderRenderer = defaultHeaderRenderer, itemKeyGetter = defaultItemKeyGetter, gridRowRenderer, itemRenderer, widgetRenderer, getLayoutDimensions, screen, renderMode, } = props;
|
|
14
|
-
const renderProps = { section, screen, renderMode };
|
|
13
|
+
const { section, sectionRenderer = defaultSectionRenderer, sectionHeaderRenderer = defaultHeaderRenderer, itemKeyGetter = defaultItemKeyGetter, gridRowRenderer, itemRenderer, widgetRenderer, getLayoutDimensions, screen, renderMode, parentLayoutItemSize, } = props;
|
|
14
|
+
const renderProps = { section, screen, renderMode, parentLayoutItemSize };
|
|
15
15
|
const items = useMemo(() => {
|
|
16
16
|
if (renderMode === "edit") {
|
|
17
17
|
const itemsInRowsByIndex = section
|
|
@@ -42,6 +42,7 @@ export function DashboardLayoutSection(props) {
|
|
|
42
42
|
section,
|
|
43
43
|
screen,
|
|
44
44
|
DefaultSectionHeaderRenderer: DashboardLayoutSectionHeaderRenderer,
|
|
45
|
+
parentLayoutItemSize,
|
|
45
46
|
}),
|
|
46
47
|
items,
|
|
47
48
|
renderMode === "edit" ? React.createElement(DashboardLayoutSectionOverlayController, { section: section }) : null)),
|
package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutSection.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardLayoutSection.js","sourceRoot":"","sources":["../../../../src/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutSection.tsx"],"names":[],"mappings":"AAEA,OAAO,OAAO,MAAM,mBAAmB,CAAC;AACxC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAMvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,oCAAoC,EAAE,MAAM,2CAA2C,CAAC;AACjG,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAUrF,OAAO,EAAE,uCAAuC,EAAE,MAAM,2DAA2D,CAAC;AACpH,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAClC,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"DashboardLayoutSection.js","sourceRoot":"","sources":["../../../../src/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutSection.tsx"],"names":[],"mappings":"AAEA,OAAO,OAAO,MAAM,mBAAmB,CAAC;AACxC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAMvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,oCAAoC,EAAE,MAAM,2CAA2C,CAAC;AACjG,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAUrF,OAAO,EAAE,uCAAuC,EAAE,MAAM,2DAA2D,CAAC;AACpH,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAClC,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAqB7E,MAAM,sBAAsB,GAA6C,CAAC,KAAK,EAAE,EAAE,CAAC,CAChF,oBAAC,8BAA8B,OAAK,KAAK,GAAI,CAChD,CAAC;AAEF,MAAM,qBAAqB,GAAmD,CAAC,KAAK,EAAE,EAAE,CAAC,CACrF,oBAAC,oCAAoC,OAAK,KAAK,GAAI,CACtD,CAAC;AAE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AAU,EAAE,KAAK,EAAE,EAAE;YACrE,OAAO,CACH,oBAAC,sBAAsB,IACnB,GAAG,EAAE,KAAK,CAAC,QAAQ,EAAE,EACrB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,UAAU,EACjB,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,aAAa,EAC5B,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,cAAc,EAC9B,UAAU,EAAE,UAAU,EACtB,mBAAmB,EAAE,mBAAmB,GAC1C,CACL,CAAC;QACN,CAAC,CAAC,CAAC;IACP,CAAC,EAAE;QACC,mBAAmB;QACnB,eAAe;QACf,aAAa;QACb,YAAY;QACZ,UAAU;QACV,MAAM;QACN,OAAO;QACP,cAAc;KACjB,CAAC,CAAC;IAEH,OAAO,eAAe,CAAC;QACnB,GAAG,WAAW;QACd,sBAAsB,EAAE,8BAA8B;QACtD,QAAQ,EAAE,CACN;YACK,qBAAqB,CAAC;gBACnB,OAAO;gBACP,MAAM;gBACN,4BAA4B,EAAE,oCAAoC;gBAClE,oBAAoB;aACvB,CAAC;YACD,KAAK;YACL,UAAU,KAAK,MAAM,CAAC,CAAC,CAAC,oBAAC,uCAAuC,IAAC,OAAO,EAAE,OAAO,GAAI,CAAC,CAAC,CAAC,IAAI,CAC9F,CACN;KACJ,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardLayoutSectionHeaderRenderer.d.ts","sourceRoot":"","sources":["../../../../src/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutSectionHeaderRenderer.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"DashboardLayoutSectionHeaderRenderer.d.ts","sourceRoot":"","sources":["../../../../src/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutSectionHeaderRenderer.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,wCAAwC,EAAE,MAAM,iBAAiB,CAAC;AAI3E,wBAAgB,oCAAoC,CAChD,KAAK,EAAE,wCAAwC,CAAC,GAAG,CAAC,GACrD,GAAG,CAAC,OAAO,GAAG,IAAI,CAoBpB"}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
// (C) 2019-2024 GoodData Corporation
|
|
2
|
-
import
|
|
2
|
+
import React, { useMemo } from "react";
|
|
3
3
|
import { DashboardLayoutItemViewRenderer } from "./DashboardLayoutItemViewRenderer.js";
|
|
4
4
|
import { DashboardLayoutSectionHeader } from "./DashboardLayoutSectionHeader.js";
|
|
5
|
-
import {
|
|
5
|
+
import { buildEmptyItemFacadeWithSetSize } from "./utils/emptyFacade.js";
|
|
6
|
+
import { determineSizeForScreen } from "./utils/sizing.js";
|
|
6
7
|
export function DashboardLayoutSectionHeaderRenderer(props) {
|
|
7
|
-
const { section, screen } = props;
|
|
8
|
+
const { section, screen, parentLayoutItemSize } = props;
|
|
8
9
|
const sectionHeader = section.header();
|
|
9
|
-
|
|
10
|
+
const gridWidth = determineSizeForScreen(screen, parentLayoutItemSize);
|
|
11
|
+
const emptyItem = useMemo(() => {
|
|
12
|
+
return buildEmptyItemFacadeWithSetSize(gridWidth);
|
|
13
|
+
}, [gridWidth]);
|
|
14
|
+
return sectionHeader ? (React.createElement(DashboardLayoutItemViewRenderer, { DefaultItemRenderer: DashboardLayoutItemViewRenderer, item: emptyItem, screen: screen },
|
|
10
15
|
React.createElement(DashboardLayoutSectionHeader, { title: sectionHeader.title, description: sectionHeader.description }))) : null;
|
|
11
16
|
}
|
|
12
17
|
//# sourceMappingURL=DashboardLayoutSectionHeaderRenderer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardLayoutSectionHeaderRenderer.js","sourceRoot":"","sources":["../../../../src/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutSectionHeaderRenderer.tsx"],"names":[],"mappings":"AAAA,qCAAqC;
|
|
1
|
+
{"version":3,"file":"DashboardLayoutSectionHeaderRenderer.js","sourceRoot":"","sources":["../../../../src/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutSectionHeaderRenderer.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AAErC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AACvF,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAEjF,OAAO,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,MAAM,UAAU,oCAAoC,CAChD,KAAoD;IAEpD,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,oBAAoB,EAAE,GAAG,KAAK,CAAC;IACxD,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IACvC,MAAM,SAAS,GAAG,sBAAsB,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;IACvE,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,EAAE;QAC3B,OAAO,+BAA+B,CAAC,SAAS,CAAC,CAAC;IACtD,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAEhB,OAAO,aAAa,CAAC,CAAC,CAAC,CACnB,oBAAC,+BAA+B,IAC5B,mBAAmB,EAAE,+BAA+B,EACpD,IAAI,EAAE,SAAS,EACf,MAAM,EAAE,MAAM;QAEd,oBAAC,4BAA4B,IACzB,KAAK,EAAE,aAAa,CAAC,KAAK,EAC1B,WAAW,EAAE,aAAa,CAAC,WAAW,GACxC,CAC4B,CACrC,CAAC,CAAC,CAAC,IAAI,CAAC;AACb,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardLayoutSectionRenderer.d.ts","sourceRoot":"","sources":["../../../../src/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutSectionRenderer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DashboardLayoutSectionRenderer.d.ts","sourceRoot":"","sources":["../../../../src/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutSectionRenderer.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,+BAA+B,EAAE,MAAM,iBAAiB,CAAC;AAMlE,eAAO,MAAM,8BAA8B,EAAE,+BAA+B,CAAC,OAAO,CAcnF,CAAC"}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
// (C) 2007-2024 GoodData Corporation
|
|
2
2
|
import React from "react";
|
|
3
|
-
import
|
|
3
|
+
import { GridLayoutElement } from "./GridLayoutElement.js";
|
|
4
4
|
const isHiddenStyle = { height: 0, width: 0, overflow: "hidden", flex: 0 };
|
|
5
5
|
const defaultStyle = {};
|
|
6
6
|
export const DashboardLayoutSectionRenderer = (props) => {
|
|
7
|
-
const { children,
|
|
7
|
+
const { children, screen, parentLayoutItemSize, className, isHidden } = props;
|
|
8
8
|
const style = isHidden ? isHiddenStyle : defaultStyle;
|
|
9
|
-
return (React.createElement(
|
|
10
|
-
"gd-fluidlayout-row-debug": debug,
|
|
11
|
-
}), style: style }, children));
|
|
9
|
+
return (React.createElement(GridLayoutElement, { type: "section", screen: screen, layoutItemSize: parentLayoutItemSize, className: className, style: style }, children));
|
|
12
10
|
};
|
|
13
11
|
//# sourceMappingURL=DashboardLayoutSectionRenderer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardLayoutSectionRenderer.js","sourceRoot":"","sources":["../../../../src/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutSectionRenderer.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"DashboardLayoutSectionRenderer.js","sourceRoot":"","sources":["../../../../src/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutSectionRenderer.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,MAAM,aAAa,GAAG,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;AAC3E,MAAM,YAAY,GAAG,EAAE,CAAC;AAExB,MAAM,CAAC,MAAM,8BAA8B,GAA6C,CAAC,KAAK,EAAE,EAAE;IAC9F,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,oBAAoB,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAC9E,MAAM,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,CAAC;IACtD,OAAO,CACH,oBAAC,iBAAiB,IACd,IAAI,EAAC,SAAS,EACd,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,oBAAoB,EACpC,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,IAEX,QAAQ,CACO,CACvB,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardLayoutWidgetRenderer.d.ts","sourceRoot":"","sources":["../../../../src/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutWidgetRenderer.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,iCAAiC,EAAE,MAAM,iBAAiB,CAAC;AAEpE,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,iCAAiC,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"DashboardLayoutWidgetRenderer.d.ts","sourceRoot":"","sources":["../../../../src/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutWidgetRenderer.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,iCAAiC,EAAE,MAAM,iBAAiB,CAAC;AAEpE,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,iCAAiC,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,OAAO,CAwCxG"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import React, { useMemo } from "react";
|
|
3
3
|
import cx from "classnames";
|
|
4
4
|
export function DashboardLayoutWidgetRenderer(props) {
|
|
5
|
-
const { item, screen,
|
|
5
|
+
const { item, screen, className, contentRef, isResizedByLayoutSizingStrategy, minHeight, height, allowOverflow, children, } = props;
|
|
6
6
|
const { heightAsRatio, gridHeight } = item.size()[screen];
|
|
7
7
|
const style = useMemo(() => {
|
|
8
8
|
const computedStyle = {
|
|
@@ -13,18 +13,8 @@ export function DashboardLayoutWidgetRenderer(props) {
|
|
|
13
13
|
computedStyle.overflowX = "hidden";
|
|
14
14
|
computedStyle.overflowY = "auto";
|
|
15
15
|
}
|
|
16
|
-
if (debug) {
|
|
17
|
-
if (!heightAsRatio) {
|
|
18
|
-
computedStyle.outline = "solid 1px yellow";
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
computedStyle.border = isResizedByLayoutSizingStrategy
|
|
22
|
-
? "dashed 1px #d6d6d6"
|
|
23
|
-
: "solid 1px green";
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
16
|
return computedStyle;
|
|
27
|
-
}, [minHeight, height, allowOverflow,
|
|
17
|
+
}, [minHeight, height, allowOverflow, heightAsRatio, isResizedByLayoutSizingStrategy]);
|
|
28
18
|
return (React.createElement("div", { ref: contentRef, className: cx("gd-fluidlayout-column-container", className, {
|
|
29
19
|
"custom-height": !!gridHeight,
|
|
30
20
|
}), style: style }, children));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardLayoutWidgetRenderer.js","sourceRoot":"","sources":["../../../../src/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutWidgetRenderer.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,EAAE,EAAiB,OAAO,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,MAAM,YAAY,CAAC;AAG5B,MAAM,UAAU,6BAA6B,CAAC,KAA6C;IACvF,MAAM,EACF,IAAI,EACJ,MAAM,EACN,
|
|
1
|
+
{"version":3,"file":"DashboardLayoutWidgetRenderer.js","sourceRoot":"","sources":["../../../../src/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/DashboardLayoutWidgetRenderer.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,EAAE,EAAiB,OAAO,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,MAAM,YAAY,CAAC;AAG5B,MAAM,UAAU,6BAA6B,CAAC,KAA6C;IACvF,MAAM,EACF,IAAI,EACJ,MAAM,EACN,SAAS,EACT,UAAU,EACV,+BAA+B,EAC/B,SAAS,EACT,MAAM,EACN,aAAa,EACb,QAAQ,GACX,GAAG,KAAK,CAAC;IAEV,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,CAAE,CAAC;IAE3D,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,EAAE;QACvB,MAAM,aAAa,GAAkB;YACjC,SAAS;YACT,MAAM;SACT,CAAC;QAEF,IAAI,aAAa,EAAE,CAAC;YAChB,aAAa,CAAC,SAAS,GAAG,QAAQ,CAAC;YACnC,aAAa,CAAC,SAAS,GAAG,MAAM,CAAC;QACrC,CAAC;QAED,OAAO,aAAa,CAAC;IACzB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,+BAA+B,CAAC,CAAC,CAAC;IAEvF,OAAO,CACH,6BACI,GAAG,EAAE,UAAU,EACf,SAAS,EAAE,EAAE,CAAC,iCAAiC,EAAE,SAAS,EAAE;YACxD,eAAe,EAAE,CAAC,CAAC,UAAU;SAChC,CAAC,EACF,KAAK,EAAE,KAAK,IAEX,QAAQ,CACP,CACT,CAAC;AACN,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditableDashboardLayoutSectionRenderer.d.ts","sourceRoot":"","sources":["../../../../src/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/EditableDashboardLayoutSectionRenderer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,+BAA+B,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"EditableDashboardLayoutSectionRenderer.d.ts","sourceRoot":"","sources":["../../../../src/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/EditableDashboardLayoutSectionRenderer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,+BAA+B,EAAE,MAAM,iBAAiB,CAAC;AAsBlE,eAAO,MAAM,sCAAsC,EAAE,+BAA+B,CAAC,OAAO,CAe3F,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// (C) 2007-2024 GoodData Corporation
|
|
2
2
|
import React from "react";
|
|
3
|
-
import cx from "classnames";
|
|
4
3
|
import { DashboardLayoutSectionBorder, useIsDraggingWidget, } from "../../dragAndDrop/index.js";
|
|
5
4
|
import { selectActiveSectionIndex, useDashboardSelector } from "../../../model/index.js";
|
|
5
|
+
import { GridLayoutElement } from "./GridLayoutElement.js";
|
|
6
6
|
const isHiddenStyle = { height: 0, width: 0, overflow: "hidden", flex: 0 };
|
|
7
7
|
const defaultStyle = {};
|
|
8
8
|
function useBorderStatus(sectionIndex) {
|
|
@@ -15,12 +15,10 @@ function useBorderStatus(sectionIndex) {
|
|
|
15
15
|
return !isActive ? "invisible" : "muted";
|
|
16
16
|
}
|
|
17
17
|
export const EditableDashboardLayoutSectionRenderer = (props) => {
|
|
18
|
-
const { children, className,
|
|
18
|
+
const { children, className, isHidden, section, screen, parentLayoutItemSize } = props;
|
|
19
19
|
const style = isHidden ? isHiddenStyle : defaultStyle;
|
|
20
20
|
const status = useBorderStatus(section.index());
|
|
21
|
-
return (React.createElement(
|
|
22
|
-
"gd-fluidlayout-row-debug": debug,
|
|
23
|
-
}), style: style },
|
|
21
|
+
return (React.createElement(GridLayoutElement, { type: "section", screen: screen, layoutItemSize: parentLayoutItemSize, className: className, style: style },
|
|
24
22
|
React.createElement(DashboardLayoutSectionBorder, { status: status }, children)));
|
|
25
23
|
};
|
|
26
24
|
//# sourceMappingURL=EditableDashboardLayoutSectionRenderer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditableDashboardLayoutSectionRenderer.js","sourceRoot":"","sources":["../../../../src/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/EditableDashboardLayoutSectionRenderer.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,
|
|
1
|
+
{"version":3,"file":"EditableDashboardLayoutSectionRenderer.js","sourceRoot":"","sources":["../../../../src/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/EditableDashboardLayoutSectionRenderer.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACH,4BAA4B,EAE5B,mBAAmB,GACtB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AACzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,MAAM,aAAa,GAAG,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;AAC3E,MAAM,YAAY,GAAG,EAAE,CAAC;AAExB,SAAS,eAAe,CAAC,YAAoB;IACzC,MAAM,kBAAkB,GAAG,oBAAoB,CAAC,wBAAwB,CAAC,CAAC;IAC1E,MAAM,gBAAgB,GAAG,mBAAmB,EAAE,CAAC;IAC/C,IAAI,gBAAgB,EAAE,CAAC;QACnB,OAAO,OAAO,CAAC;IACnB,CAAC;IACD,MAAM,QAAQ,GAAG,kBAAkB,KAAK,YAAY,CAAC;IACrD,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC;AAC7C,CAAC;AAED,MAAM,CAAC,MAAM,sCAAsC,GAA6C,CAAC,KAAK,EAAE,EAAE;IACtG,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,oBAAoB,EAAE,GAAG,KAAK,CAAC;IACvF,MAAM,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,CAAC;IACtD,MAAM,MAAM,GAAG,eAAe,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;IAChD,OAAO,CACH,oBAAC,iBAAiB,IACd,IAAI,EAAC,SAAS,EACd,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,oBAAoB,EACpC,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK;QAEZ,oBAAC,4BAA4B,IAAC,MAAM,EAAE,MAAM,IAAG,QAAQ,CAAgC,CACvE,CACvB,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React, { CSSProperties, MouseEventHandler } from "react";
|
|
2
|
+
import { ScreenSize, IDashboardLayoutSizeByScreenSize } from "@gooddata/sdk-model";
|
|
3
|
+
export type LayoutElementType = "root" | "nested" | "section" | "item";
|
|
4
|
+
export interface IGridLayoutElementProps {
|
|
5
|
+
/**
|
|
6
|
+
* Type of grid element.
|
|
7
|
+
*/
|
|
8
|
+
type: LayoutElementType;
|
|
9
|
+
/**
|
|
10
|
+
* Element children renderer inside of the element.
|
|
11
|
+
*/
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Optional class name set on the element.
|
|
15
|
+
*/
|
|
16
|
+
className?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Optional style set on the element, used for quick hiding of the element from layout.
|
|
19
|
+
*/
|
|
20
|
+
style?: CSSProperties | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* The current scree size.
|
|
23
|
+
*/
|
|
24
|
+
screen: ScreenSize;
|
|
25
|
+
/**
|
|
26
|
+
* The sizes of the grid element per each supported screen size.
|
|
27
|
+
*/
|
|
28
|
+
layoutItemSize?: IDashboardLayoutSizeByScreenSize;
|
|
29
|
+
/**
|
|
30
|
+
* Enable to render debugging information about the element.
|
|
31
|
+
*/
|
|
32
|
+
debug?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Callback called when mouse leave the element.
|
|
35
|
+
*/
|
|
36
|
+
onMouseLeave?: MouseEventHandler;
|
|
37
|
+
}
|
|
38
|
+
export declare const GridLayoutElement: React.ForwardRefExoticComponent<IGridLayoutElementProps & React.RefAttributes<HTMLDivElement>>;
|
|
39
|
+
//# sourceMappingURL=GridLayoutElement.d.ts.map
|
package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/GridLayoutElement.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GridLayoutElement.d.ts","sourceRoot":"","sources":["../../../../src/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/GridLayoutElement.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,iBAAiB,EAAc,MAAM,OAAO,CAAC;AAE5E,OAAO,EAAE,UAAU,EAAE,gCAAgC,EAAE,MAAM,qBAAqB,CAAC;AAOnF,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;AA4CvE,MAAM,WAAW,uBAAuB;IACpC;;OAEG;IACH,IAAI,EAAE,iBAAiB,CAAC;IACxB;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAClC;;OAEG;IACH,MAAM,EAAE,UAAU,CAAC;IACnB;;OAEG;IACH,cAAc,CAAC,EAAE,gCAAgC,CAAC;IAClD;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,YAAY,CAAC,EAAE,iBAAiB,CAAC;CACpC;AAED,eAAO,MAAM,iBAAiB,gGA0B7B,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// (C) 2024 GoodData Corporation
|
|
2
|
+
import React, { forwardRef } from "react";
|
|
3
|
+
import cx from "classnames";
|
|
4
|
+
import { determineSizeForScreen } from "./utils/sizing.js";
|
|
5
|
+
// internal constant used to enable rendering of debug information that helps with layout issues debugging
|
|
6
|
+
const ENABLE_DEBUG_MODE = false;
|
|
7
|
+
const getBubbleDebugClassName = (type) => {
|
|
8
|
+
switch (type) {
|
|
9
|
+
case "root":
|
|
10
|
+
return "gd-grid-layout__debug--root";
|
|
11
|
+
case "nested":
|
|
12
|
+
return "gd-grid-layout__debug--nested";
|
|
13
|
+
case "section":
|
|
14
|
+
return "gd-grid-layout__debug--section";
|
|
15
|
+
case "item":
|
|
16
|
+
default:
|
|
17
|
+
return "gd-grid-layout__debug--item";
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
const getElementDebugClassName = (type) => {
|
|
21
|
+
switch (type) {
|
|
22
|
+
case "root":
|
|
23
|
+
return "gd-grid-layout__root--debug";
|
|
24
|
+
case "nested":
|
|
25
|
+
return "gd-grid-layout__nested--debug";
|
|
26
|
+
case "section":
|
|
27
|
+
return "gd-grid-layout__section--debug";
|
|
28
|
+
case "item":
|
|
29
|
+
default:
|
|
30
|
+
return "gd-grid-layout__item--debug";
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const getElementClassName = (type) => {
|
|
34
|
+
switch (type) {
|
|
35
|
+
case "root":
|
|
36
|
+
return "gd-grid-layout__root";
|
|
37
|
+
case "nested":
|
|
38
|
+
return "gd-grid-layout__nested";
|
|
39
|
+
case "section":
|
|
40
|
+
return "gd-grid-layout__section";
|
|
41
|
+
case "item":
|
|
42
|
+
default:
|
|
43
|
+
return "gd-grid-layout__item";
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
export const GridLayoutElement = forwardRef(({ children, className, style, type, layoutItemSize, screen, onMouseLeave }, ref) => {
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
48
|
+
// @ts-ignore
|
|
49
|
+
const enableDebugMode = window.DEBUG_LAYOUT ?? ENABLE_DEBUG_MODE;
|
|
50
|
+
const gridWidth = determineSizeForScreen(screen, layoutItemSize);
|
|
51
|
+
const classNames = cx(className, getElementClassName(type), `gd-grid-layout__item--span-${gridWidth}`, // CSS Grid columns size class name
|
|
52
|
+
{
|
|
53
|
+
[getElementDebugClassName(type)]: enableDebugMode,
|
|
54
|
+
});
|
|
55
|
+
return (React.createElement("div", { className: classNames, style: style, onMouseLeave: onMouseLeave, ref: ref },
|
|
56
|
+
enableDebugMode ? (React.createElement("div", { className: cx("gd-grid-layout__debug", getBubbleDebugClassName(type)) },
|
|
57
|
+
gridWidth,
|
|
58
|
+
" ",
|
|
59
|
+
screen)) : null,
|
|
60
|
+
children));
|
|
61
|
+
});
|
|
62
|
+
GridLayoutElement.displayName = "GridLayoutElement";
|
|
63
|
+
//# sourceMappingURL=GridLayoutElement.js.map
|
package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/GridLayoutElement.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GridLayoutElement.js","sourceRoot":"","sources":["../../../../src/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/GridLayoutElement.tsx"],"names":[],"mappings":"AAAA,gCAAgC;AAEhC,OAAO,KAAK,EAAE,EAAoC,UAAU,EAAE,MAAM,OAAO,CAAC;AAC5E,OAAO,EAAE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b,MAAM,eAAe,GAAG,MAAM,CAAC,YAAY,IAAI,iBAAiB,CAAC;IACjE,MAAM,SAAS,GAAG,sBAAsB,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IACjE,MAAM,UAAU,GAAG,EAAE,CACjB,SAAS,EACT,mBAAmB,CAAC,IAAI,CAAC,EACzB,8BAA8B,SAAS,EAAE,EAAE,mCAAmC;IAC9E;QACI,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC,EAAE,eAAe;KACpD,CACJ,CAAC;IAEF,OAAO,CACH,6BAAK,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,GAAG,EAAE,GAAG;QACzE,eAAe,CAAC,CAAC,CAAC,CACf,6BAAK,SAAS,EAAE,EAAE,CAAC,uBAAuB,EAAE,uBAAuB,CAAC,IAAI,CAAC,CAAC;YACrE,SAAS;;YAAG,MAAM,CACjB,CACT,CAAC,CAAC,CAAC,IAAI;QACP,QAAQ,CACP,CACT,CAAC;AACN,CAAC,CACJ,CAAC;AAEF,iBAAiB,CAAC,WAAW,GAAG,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB,KAAK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/constants.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAEhC,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import { IDashboardLayout, IDashboardWidget, ScreenSize } from "@gooddata/sdk-model";
|
|
1
|
+
import { IDashboardLayout, IDashboardWidget, ScreenSize, IDashboardLayoutSizeByScreenSize } from "@gooddata/sdk-model";
|
|
3
2
|
import { RenderMode } from "../../../types.js";
|
|
4
3
|
import { IDashboardLayoutItemFacade, IDashboardLayoutSectionFacade } from "../../../_staging/dashboard/fluidLayout/facade/interfaces.js";
|
|
4
|
+
import React from "react";
|
|
5
5
|
/**
|
|
6
6
|
* Default props provided to {@link IDashboardLayoutSectionKeyGetter}.
|
|
7
7
|
*
|
|
@@ -41,6 +41,10 @@ export interface IDashboardLayoutSectionRenderProps<TWidget = IDashboardWidget>
|
|
|
41
41
|
* Current screen type with respect to the set breakpoints.
|
|
42
42
|
*/
|
|
43
43
|
screen: ScreenSize;
|
|
44
|
+
/**
|
|
45
|
+
* The size of layout item in which the section is nested. Undefined, when section is in the root layout.
|
|
46
|
+
*/
|
|
47
|
+
parentLayoutItemSize?: IDashboardLayoutSizeByScreenSize;
|
|
44
48
|
/**
|
|
45
49
|
* Default renderer of the section - can be used as a fallback for custom sectionRenderer.
|
|
46
50
|
*/
|
|
@@ -57,10 +61,6 @@ export interface IDashboardLayoutSectionRenderProps<TWidget = IDashboardWidget>
|
|
|
57
61
|
* Additional section css class name.
|
|
58
62
|
*/
|
|
59
63
|
className?: string;
|
|
60
|
-
/**
|
|
61
|
-
* Enable debug mode? (In debug mode, sections & items are highlighted for better overview of the layout structure).
|
|
62
|
-
*/
|
|
63
|
-
debug?: boolean;
|
|
64
64
|
/**
|
|
65
65
|
* Is hidden section? Use this to hide the section without remounting it.
|
|
66
66
|
*/
|
|
@@ -87,6 +87,11 @@ export interface IDashboardLayoutSectionHeaderRenderProps<TWidget = IDashboardWi
|
|
|
87
87
|
* Current screen type with respect to the set breakpoints.
|
|
88
88
|
*/
|
|
89
89
|
screen: ScreenSize;
|
|
90
|
+
/**
|
|
91
|
+
* The size of layout item in which the section header is nested. Undefined, when section, to which
|
|
92
|
+
* this header belongs to, is in the root layout.
|
|
93
|
+
*/
|
|
94
|
+
parentLayoutItemSize?: IDashboardLayoutSizeByScreenSize;
|
|
90
95
|
/**
|
|
91
96
|
* Default renderer of the section header - can be used as a fallback for custom sectionHeaderRenderer.
|
|
92
97
|
*/
|
|
@@ -209,10 +214,6 @@ export interface IDashboardLayoutWidgetRenderProps<TWidget = IDashboardWidget> {
|
|
|
209
214
|
* Was item size updated by layout sizing strategy?
|
|
210
215
|
*/
|
|
211
216
|
isResizedByLayoutSizingStrategy?: boolean;
|
|
212
|
-
/**
|
|
213
|
-
* Enable debug mode? (In debug mode, sections & items are highlighted for better overview of the layout structure).
|
|
214
|
-
*/
|
|
215
|
-
debug?: boolean;
|
|
216
217
|
/**
|
|
217
218
|
* Get dimensions of layout container element
|
|
218
219
|
*/
|
|
@@ -314,10 +315,6 @@ export interface IDashboardLayoutRenderProps<TWidget = IDashboardWidget> {
|
|
|
314
315
|
* Callback called on mouse leave event.
|
|
315
316
|
*/
|
|
316
317
|
onMouseLeave?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
317
|
-
/**
|
|
318
|
-
* Enable debug mode? (In debug mode, sections & items are highlighted for better overview of the layout structure).
|
|
319
|
-
*/
|
|
320
|
-
debug?: boolean;
|
|
321
318
|
/**
|
|
322
319
|
* Checks if feature flag enableKDWidgetCustomHeight is enabled
|
|
323
320
|
*/
|
|
@@ -326,6 +323,15 @@ export interface IDashboardLayoutRenderProps<TWidget = IDashboardWidget> {
|
|
|
326
323
|
* Dashboard render mode
|
|
327
324
|
*/
|
|
328
325
|
renderMode?: RenderMode;
|
|
326
|
+
/**
|
|
327
|
+
* The current screen size.
|
|
328
|
+
* If undefined, the screen size will be determined by the layout and provided to its nested layouts.
|
|
329
|
+
*/
|
|
330
|
+
screen?: ScreenSize;
|
|
331
|
+
/**
|
|
332
|
+
* The size of layout item in which the layout is nested. Undefined, when the layout is the root layout.
|
|
333
|
+
*/
|
|
334
|
+
parentLayoutItemSize?: IDashboardLayoutSizeByScreenSize;
|
|
329
335
|
}
|
|
330
336
|
/**
|
|
331
337
|
* Dashboard layout renderer.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../src/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/interfaces.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../src/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/interfaces.ts"],"names":[],"mappings":"AACA,OAAO,EACH,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EACV,gCAAgC,EACnC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EACH,0BAA0B,EAC1B,6BAA6B,EAChC,MAAM,8DAA8D,CAAC;AACtE,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;;GAIG;AACH,MAAM,MAAM,qCAAqC,CAAC,OAAO,GAAG,gBAAgB,IAAI;IAC5E;;OAEG;IACH,OAAO,EAAE,6BAA6B,CAAC,OAAO,CAAC,CAAC;IAEhD;;OAEG;IACH,MAAM,EAAE,UAAU,CAAC;CACtB,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,gCAAgC,CAAC,OAAO,GAAG,gBAAgB,IAAI,CACvE,KAAK,EAAE,qCAAqC,CAAC,OAAO,CAAC,KACpD,MAAM,CAAC;AAEZ;;;;GAIG;AACH,MAAM,WAAW,kCAAkC,CAAC,OAAO,GAAG,gBAAgB;IAC1E;;OAEG;IACH,OAAO,EAAE,6BAA6B,CAAC,OAAO,CAAC,CAAC;IAEhD;;OAEG;IACH,MAAM,EAAE,UAAU,CAAC;IAEnB;;OAEG;IACH,oBAAoB,CAAC,EAAE,gCAAgC,CAAC;IAExD;;OAEG;IACH,sBAAsB,EAAE,+BAA+B,CAAC,OAAO,CAAC,CAAC;IAEjE;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAE1B;;OAEG;IACH,UAAU,EAAE,UAAU,CAAC;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C,OAAO,CAAC,CAAC;IAEvD;;OAEG;IACH,YAAY,CAAC,EAAE,4BAA4B,CAAC,OAAO,CAAC,CAAC;IAErD;;OAEG;IACH,cAAc,EAAE,8BAA8B,CAAC,OAAO,CAAC,CAAC;IAExD;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IAE7D;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IAExB;;;OAGG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;IAEpB;;OAEG;IACH,oBAAoB,CAAC,EAAE,gCAAgC,CAAC;CAC3D;AAED;;;;;GAKG;AACH,MAAM,MAAM,wBAAwB,CAAC,OAAO,GAAG,gBAAgB,EAAE,YAAY,GAAG,MAAM,IAAI,CACtF,WAAW,EAAE,2BAA2B,CAAC,OAAO,CAAC,GAAG,YAAY,KAC/D,GAAG,CAAC,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useScreenSize.d.ts","sourceRoot":"","sources":["../../../../src/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/useScreenSize.ts"],"names":[],"mappings":"AAEA,OAAO,KAA8B,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAwBjD,eAAO,MAAM,aAAa,QAAS,MAAM,SAAS,CAAC,cAAc,CAAC,KAAG,UAUpE,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// (C) 2024 GoodData Corporation
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
import { DASHBOARD_LAYOUT_BREAK_POINTS } from "../../constants/index.js";
|
|
4
|
+
const getScreenClass = (ref) => {
|
|
5
|
+
if (!ref.current) {
|
|
6
|
+
return "xl";
|
|
7
|
+
}
|
|
8
|
+
const viewportWidth = ref.current.clientWidth;
|
|
9
|
+
if (viewportWidth >= DASHBOARD_LAYOUT_BREAK_POINTS[3]) {
|
|
10
|
+
return "xl";
|
|
11
|
+
}
|
|
12
|
+
if (viewportWidth >= DASHBOARD_LAYOUT_BREAK_POINTS[2]) {
|
|
13
|
+
return "lg";
|
|
14
|
+
}
|
|
15
|
+
if (viewportWidth >= DASHBOARD_LAYOUT_BREAK_POINTS[1]) {
|
|
16
|
+
return "md";
|
|
17
|
+
}
|
|
18
|
+
if (viewportWidth >= DASHBOARD_LAYOUT_BREAK_POINTS[0]) {
|
|
19
|
+
return "sm";
|
|
20
|
+
}
|
|
21
|
+
return "xs";
|
|
22
|
+
};
|
|
23
|
+
export const useScreenSize = (ref) => {
|
|
24
|
+
const [screenClass, setScreenClass] = useState(() => getScreenClass(ref));
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
const handleWindowResized = () => setScreenClass(getScreenClass(ref));
|
|
27
|
+
window.addEventListener("resize", handleWindowResized, false);
|
|
28
|
+
return () => {
|
|
29
|
+
window.removeEventListener("resize", handleWindowResized, false);
|
|
30
|
+
};
|
|
31
|
+
}, [ref]);
|
|
32
|
+
return screenClass;
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=useScreenSize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useScreenSize.js","sourceRoot":"","sources":["../../../../src/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/useScreenSize.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAEhC,OAAc,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGnD,OAAO,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AAEzE,MAAM,cAAc,GAAG,CAAC,GAAoC,EAAc,EAAE;IACxE,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;QACf,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,MAAM,aAAa,GAAG,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC;IAC9C,IAAI,aAAa,IAAI,6BAA6B,CAAC,CAAC,CAAC,EAAE,CAAC;QACpD,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,IAAI,aAAa,IAAI,6BAA6B,CAAC,CAAC,CAAC,EAAE,CAAC;QACpD,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,IAAI,aAAa,IAAI,6BAA6B,CAAC,CAAC,CAAC,EAAE,CAAC;QACpD,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,IAAI,aAAa,IAAI,6BAA6B,CAAC,CAAC,CAAC,EAAE,CAAC;QACpD,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,GAAoC,EAAc,EAAE;IAC9E,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1E,SAAS,CAAC,GAAG,EAAE;QACX,MAAM,mBAAmB,GAAG,GAAG,EAAE,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;QACtE,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,mBAAmB,EAAE,KAAK,CAAC,CAAC;QAC9D,OAAO,GAAG,EAAE;YACR,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,mBAAmB,EAAE,KAAK,CAAC,CAAC;QACrE,CAAC,CAAC;IACN,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACV,OAAO,WAAW,CAAC;AACvB,CAAC,CAAC"}
|
package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/utils/emptyFacade.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { IDashboardLayoutItemFacade } from "../../../../_staging/dashboard/fluidLayout/index.js";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const buildEmptyItemFacadeWithSetSize: (gridWidth: number) => IDashboardLayoutItemFacade<unknown>;
|
|
3
3
|
//# sourceMappingURL=emptyFacade.d.ts.map
|
package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/utils/emptyFacade.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emptyFacade.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/utils/emptyFacade.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,0BAA0B,EAAE,MAAM,qDAAqD,CAAC;AAEjG,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"emptyFacade.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/utils/emptyFacade.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,0BAA0B,EAAE,MAAM,qDAAqD,CAAC;AAEjG,eAAO,MAAM,+BAA+B,cAAe,MAAM,KAAG,2BAA2B,OAAO,CA4BpG,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// (C) 2022-2024 GoodData Corporation
|
|
2
|
-
export const
|
|
2
|
+
export const buildEmptyItemFacadeWithSetSize = (gridWidth) => ({
|
|
3
3
|
index: () => 0,
|
|
4
4
|
raw: () => null, // TODO: should we allow this in the interface?
|
|
5
5
|
widget: () => null,
|
|
6
6
|
ref: () => undefined,
|
|
7
7
|
section: () => undefined, // TODO: should we allow this in the interface?
|
|
8
|
-
size: () => ({ xl: { gridWidth
|
|
9
|
-
sizeForScreen: () => ({ gridWidth
|
|
8
|
+
size: () => ({ xl: { gridWidth } }),
|
|
9
|
+
sizeForScreen: () => ({ gridWidth }),
|
|
10
10
|
isLast: () => true,
|
|
11
11
|
widgetEquals: () => false,
|
|
12
12
|
widgetIs: () => false,
|
|
@@ -27,5 +27,5 @@ export const emptyItemFacadeWithFullSize = {
|
|
|
27
27
|
isWidgetItemWithKpiRef: () => false,
|
|
28
28
|
isWidgetItemWithRef: () => false,
|
|
29
29
|
isEmpty: () => false,
|
|
30
|
-
};
|
|
30
|
+
});
|
|
31
31
|
//# sourceMappingURL=emptyFacade.js.map
|
package/esm/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/utils/emptyFacade.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emptyFacade.js","sourceRoot":"","sources":["../../../../../src/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/utils/emptyFacade.ts"],"names":[],"mappings":"AAAA,qCAAqC;AAIrC,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"emptyFacade.js","sourceRoot":"","sources":["../../../../../src/presentation/flexibleLayout/DefaultDashboardLayoutRenderer/utils/emptyFacade.ts"],"names":[],"mappings":"AAAA,qCAAqC;AAIrC,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,SAAiB,EAAuC,EAAE,CAAC,CAAC;IACxG,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;IACd,GAAG,EAAE,GAAG,EAAE,CAAC,IAAW,EAAE,+CAA+C;IACvE,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI;IAClB,GAAG,EAAE,GAAG,EAAE,CAAC,SAAS;IACpB,OAAO,EAAE,GAAG,EAAE,CAAC,SAAgB,EAAE,+CAA+C;IAChF,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,CAAC;IACnC,aAAa,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC;IACpC,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI;IAClB,YAAY,EAAE,GAAG,EAAE,CAAC,KAAK;IACzB,QAAQ,EAAE,GAAG,EAAE,CAAC,KAAK;IACrB,gBAAgB,EAAE,GAAG,EAAE,CAAC,KAAK;IAC7B,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK;IACpB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI;IACnB,IAAI,EAAE,GAAG,EAAE,CAAC,KAAK;IACjB,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK;IACpB,YAAY,EAAE,GAAG,EAAE,CAAC,KAAK;IACzB,mBAAmB,EAAE,GAAG,EAAE,CAAC,KAAK;IAChC,6BAA6B,EAAE,GAAG,EAAE,CAAC,KAAK;IAC1C,eAAe,EAAE,GAAG,EAAE,CAAC,KAAK;IAC5B,yBAAyB,EAAE,GAAG,EAAE,CAAC,KAAK;IACtC,YAAY,EAAE,GAAG,EAAE,CAAC,KAAK;IACzB,YAAY,EAAE,GAAG,EAAE,CAAC,KAAK;IACzB,sBAAsB,EAAE,GAAG,EAAE,CAAC,KAAK;IACnC,0BAA0B,EAAE,GAAG,EAAE,CAAC,KAAK;IACvC,sBAAsB,EAAE,GAAG,EAAE,CAAC,KAAK;IACnC,mBAAmB,EAAE,GAAG,EAAE,CAAC,KAAK;IAChC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK;CACvB,CAAC,CAAC"}
|
|
@@ -1,13 +1,20 @@
|
|
|
1
|
-
import { AnalyticalWidgetType, IDashboardLayout, IDashboardLayoutItem, IDashboardLayoutSize, ISettings, ScreenSize } from "@gooddata/sdk-model";
|
|
1
|
+
import { AnalyticalWidgetType, IDashboardLayout, IDashboardLayoutItem, IDashboardLayoutSize, IDashboardLayoutSizeByScreenSize, ISettings, ScreenSize } from "@gooddata/sdk-model";
|
|
2
2
|
import { IDashboardLayoutItemFacade } from "../../../../_staging/dashboard/fluidLayout/facade/interfaces.js";
|
|
3
3
|
import { MeasurableWidgetContent } from "../../../../_staging/layout/sizing.js";
|
|
4
4
|
/**
|
|
5
5
|
* Unify dashboard layout items height for all screens.
|
|
6
6
|
*
|
|
7
|
-
* @param
|
|
7
|
+
* @param layout - dashboard layout with items
|
|
8
8
|
*/
|
|
9
9
|
export declare function unifyDashboardLayoutItemHeights<TWidget>(layout: IDashboardLayout<TWidget>): IDashboardLayout<TWidget>;
|
|
10
10
|
export declare function unifyDashboardLayoutItemHeights<TWidget>(items: IDashboardLayoutItem<TWidget>[]): IDashboardLayoutItem<TWidget>[];
|
|
11
|
+
/**
|
|
12
|
+
* Derive dashboard layout size for all screens from dashboard layout size defined for xl screen.
|
|
13
|
+
* We have only xl size saved in metadata, this will create additional screen sizes based on xl.
|
|
14
|
+
*
|
|
15
|
+
* @param xlSize - dashboard layout size for xl screen
|
|
16
|
+
*/
|
|
17
|
+
export declare function implicitLayoutItemSizeFromXlSize(xlSize: IDashboardLayoutSize): IDashboardLayoutSizeByScreenSize;
|
|
11
18
|
/**
|
|
12
19
|
* Divide the items into a list representing the future rows of the grid.
|
|
13
20
|
* This is useful for performing item transformations, depending on how they really appear in the grid.
|
|
@@ -39,5 +46,6 @@ export declare function validateDashboardLayoutWidgetSize(currentWidth: number,
|
|
|
39
46
|
validWidth: number;
|
|
40
47
|
validHeight?: number;
|
|
41
48
|
};
|
|
49
|
+
export declare const determineSizeForScreen: (screen: ScreenSize, layoutItemSize?: IDashboardLayoutSizeByScreenSize) => number;
|
|
42
50
|
export {};
|
|
43
51
|
//# sourceMappingURL=sizing.d.ts.map
|