mirror of
https://github.com/Kingsrook/qqq-frontend-material-dashboard.git
synced 2025-07-18 13:20:43 +00:00
CE-1727 - Add layout FLEX_ROW_CENTER; Add actionCallback
This commit is contained in:
@ -42,13 +42,14 @@ interface CompositeWidgetProps
|
|||||||
{
|
{
|
||||||
widgetMetaData: QWidgetMetaData;
|
widgetMetaData: QWidgetMetaData;
|
||||||
data: CompositeData;
|
data: CompositeData;
|
||||||
|
actionCallback?: (blockData: BlockData) => boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
** Widget which is a list of Blocks.
|
** Widget which is a list of Blocks.
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
export default function CompositeWidget({widgetMetaData, data}: CompositeWidgetProps): JSX.Element
|
export default function CompositeWidget({widgetMetaData, data, actionCallback}: CompositeWidgetProps): JSX.Element
|
||||||
{
|
{
|
||||||
if (!data || !data.blocks)
|
if (!data || !data.blocks)
|
||||||
{
|
{
|
||||||
@ -81,6 +82,14 @@ export default function CompositeWidget({widgetMetaData, data}: CompositeWidgetP
|
|||||||
boxStyle.justifyContent = "space-between";
|
boxStyle.justifyContent = "space-between";
|
||||||
boxStyle.gap = "0.25rem";
|
boxStyle.gap = "0.25rem";
|
||||||
}
|
}
|
||||||
|
else if (layout == "FLEX_ROW_CENTER")
|
||||||
|
{
|
||||||
|
boxStyle.display = "flex";
|
||||||
|
boxStyle.flexDirection = "row";
|
||||||
|
boxStyle.justifyContent = "center";
|
||||||
|
boxStyle.gap = "0.25rem";
|
||||||
|
boxStyle.flexWrap = "wrap";
|
||||||
|
}
|
||||||
else if (layout == "TABLE_SUB_ROW_DETAILS")
|
else if (layout == "TABLE_SUB_ROW_DETAILS")
|
||||||
{
|
{
|
||||||
boxStyle.display = "flex";
|
boxStyle.display = "flex";
|
||||||
@ -122,7 +131,7 @@ export default function CompositeWidget({widgetMetaData, data}: CompositeWidgetP
|
|||||||
{
|
{
|
||||||
data.blocks.map((block: BlockData, index) => (
|
data.blocks.map((block: BlockData, index) => (
|
||||||
<React.Fragment key={index}>
|
<React.Fragment key={index}>
|
||||||
<WidgetBlock widgetMetaData={widgetMetaData} block={block} />
|
<WidgetBlock widgetMetaData={widgetMetaData} block={block} actionCallback={actionCallback} />
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user