Implement displayed text

This commit is contained in:
Eric NGUYEN 2022-09-16 15:00:40 +02:00
parent ce65d448c9
commit 9f24d2d40a
4 changed files with 6 additions and 2 deletions

View file

@ -32,7 +32,7 @@ export function Sidebar(props: ISidebarProps): JSX.Element {
draggable={true} draggable={true}
onDragStart={(event) => HandleDragStart(event)} onDragStart={(event) => HandleDragStart(event)}
> >
{TruncateString(componentOption.Type, 25)} {TruncateString(componentOption.DisplayedText ?? componentOption.Type, 25)}
</button>); </button>);
if (componentOption.Category === null || componentOption.Category === undefined) { if (componentOption.Category === null || componentOption.Category === undefined) {
rootElements.push(componentButton); rootElements.push(componentButton);

View file

@ -10,6 +10,9 @@ export interface IAvailableContainer {
/** type */ /** type */
Type: string Type: string
/** displayed text */
DisplayedText?: string
/** category */ /** category */
Category?: string Category?: string

View file

@ -160,7 +160,7 @@ export function GetDefaultContainerProps(type: string,
type, type,
parentId: parent.properties.id, parentId: parent.properties.id,
linkedSymbolId: '', linkedSymbolId: '',
displayedText: `${type}-${typeCount}`, displayedText: `${containerConfig.DisplayedText ?? type}-${typeCount}`,
x, x,
y, y,
margin: containerConfig.Margin ?? {}, margin: containerConfig.Margin ?? {},

View file

@ -64,6 +64,7 @@ const GetSVGLayoutConfiguration = () => {
AvailableContainers: [ AvailableContainers: [
{ {
Type: 'Chassis', Type: 'Chassis',
DisplayedText: 'Chassis?',
MaxWidth: 500, MaxWidth: 500,
MinWidth: 200, MinWidth: 200,
Width: 200, Width: 200,