Interface: ICardBodyContentLabelBarProxy¶
A designer-facing interface that provides access to card body content label bar properties.
example
// Example rule bound to the Items property of a CardBodyContent with type CardBodyContent.Type.LabelBar
export default function GetLabelBarItems(context) {
const cardBodyContentLabelBarProxy = context;
const layout = cardBodyContentLabelBarProxy.getLayout();
const layoutType = layout.getLayoutType();
// Return different items based on layout orientation, assuming it is defined in the card metadata as static
if (layoutType === 'Horizontal') {
return [
{
"_Type": "CardBodyContentLabelBar.Type.Item",
"Text": "Status",
"Image": "sap-icon://warning"
},
{
"_Type": "CardBodyContentLabelBar.Type.Item",
"Text": "Priority"
}
];
}
return [];
}
Hierarchy¶
-
ICardBodyContentLabelBarProxy
Implemented by¶
Summary¶
Properties¶
Class Properties¶
Currently none in this class.
Inherited Properties¶
Methods¶
Class Methods¶
Inherited Methods¶
Methods¶
getItemSeparator¶
▸ getItemSeparator(): boolean
This method returns card body content label bar item separator boolean value
example
// Check if label bar items have separators
const hasSeparators = cardBodyContentLabelBarProxy.getItemSeparator();
if (hasSeparators) {
console.log('Label bar items are separated');
}
Returns: boolean
getItems¶
▸ getItems(): ICardBodyContentLabelBarItemProxy[]
This method returns array of ICardBodyContentLabelBarItemProxy proxy
example
// Access label bar items
const items = cardBodyContentLabelBarProxy.getItems();
console.log(`Label bar has ${items.length} items`);
const firstItem = items[0]; // This will be CardBodyContentLabelBarItemProxy
Returns: ICardBodyContentLabelBarItemProxy[]
getLayout¶
▸ getLayout(): ICardBodyContentLabelBarLayoutProxy
This method returns ICardBodyContentLabelBarLayout proxy
example
// Access label bar layout
const layout = cardBodyContentLabelBarProxy.getLayout();
const layoutType = layout.getLayoutType(); // Returns "Horizontal" or "Vertical"
Returns: ICardBodyContentLabelBarLayoutProxy