From a5760ae550b395b374dfc03ca823ca769cd1cc82 Mon Sep 17 00:00:00 2001 From: guidozam Date: Mon, 2 Jun 2025 12:54:06 +0200 Subject: [PATCH 1/2] Added new rowSpan property to IWidget interface. --- docs/documentation/docs/controls/Dashboard.md | 1 + src/controls/dashboard/widget/IWidget.ts | 4 ++++ src/controls/dashboard/widget/Widget.tsx | 5 +++++ 3 files changed, 10 insertions(+) diff --git a/docs/documentation/docs/controls/Dashboard.md b/docs/documentation/docs/controls/Dashboard.md index 37e959012..fd109484f 100644 --- a/docs/documentation/docs/controls/Dashboard.md +++ b/docs/documentation/docs/controls/Dashboard.md @@ -111,6 +111,7 @@ Provides settings of Dashboard's widget | controlOptions | IWidgetControlOptions | no | Component rendering options. | | body | IWidgetBodyContent[] | no | Widget's content (children) rendered as tabs. | | link | IWidgetLink | no | Widget's link rendered at the bottom part of the widget. | +| rowSpan | number | no | Number of rows the widget should span. If specified, it will override any vertical value set from the size property. | Interface `IWidgetActionKey` diff --git a/src/controls/dashboard/widget/IWidget.ts b/src/controls/dashboard/widget/IWidget.ts index 0ccd14fa7..a621f5038 100644 --- a/src/controls/dashboard/widget/IWidget.ts +++ b/src/controls/dashboard/widget/IWidget.ts @@ -73,6 +73,10 @@ export interface IWidget { * Widget's link */ link?: IWidgetLink; + /** + * Number of rows to span (vertical extension) + */ + rowSpan?: number; } /** diff --git a/src/controls/dashboard/widget/Widget.tsx b/src/controls/dashboard/widget/Widget.tsx index a8d42df41..c7e3c3169 100644 --- a/src/controls/dashboard/widget/Widget.tsx +++ b/src/controls/dashboard/widget/Widget.tsx @@ -35,6 +35,11 @@ export const Widget = ({ break } + // Support vertical extension via rowSpan + if (widget.rowSpan && widget.rowSpan > 1) { + cardStyle.gridRowEnd = `span ${widget.rowSpan}`; + } + if(widget.controlOptions && widget.controlOptions.isHidden){ return null; } From 63093cc9f7a5992f4f3aafc076638e303ef7de96 Mon Sep 17 00:00:00 2001 From: guidozam Date: Mon, 2 Jun 2025 17:31:28 +0200 Subject: [PATCH 2/2] Updated ControlsTest for the new rowSpan widget property. --- src/webparts/controlsTest/components/ControlsTest.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/webparts/controlsTest/components/ControlsTest.tsx b/src/webparts/controlsTest/components/ControlsTest.tsx index 2354af418..476c7ca98 100644 --- a/src/webparts/controlsTest/components/ControlsTest.tsx +++ b/src/webparts/controlsTest/components/ControlsTest.tsx @@ -161,6 +161,7 @@ import { VariantType, } from '../../../controls/variantThemeProvider'; import { + IWidgetLink, WidgetSize, } from '../../../controls/dashboard'; import { debounce } from 'lodash'; @@ -1055,7 +1056,7 @@ export default class ControlsTest extends React.Component