11
22import * as React from 'react'
33import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" ;
4- import { ValueLine , EntityLine , RenderEntity } from '@framework/Lines'
4+ import { ValueLine , EntityLine , RenderEntity , OptionItem } from '@framework/Lines'
55import { tryGetTypeInfos , New , getTypeInfos } from '@framework/Reflection'
66import SelectorModal from '@framework/SelectorModal'
77import { TypeContext } from '@framework/TypeContext'
@@ -13,6 +13,7 @@ import { ColorTypeaheadLine } from "../../Basics/Templates/ColorTypeahead";
1313import "../Dashboard.css"
1414import { getToString } from '@framework/Signum.Entities' ;
1515import { useForceUpdate } from '@framework/Hooks'
16+ import { softCast } from '../../../Signum.React/Scripts/Globals' ;
1617
1718export default function Dashboard ( p : { ctx : TypeContext < DashboardEntity > } ) {
1819 const forceUpdate = useForceUpdate ( ) ;
@@ -45,6 +46,7 @@ export default function Dashboard(p : { ctx: TypeContext<DashboardEntity> }){
4546 } ) ;
4647 }
4748
49+ var colors = [ "#DFFF00" , "#FFBF00" , "#FF7F50" , "#DE3163" , "#9FE2BF" , "#40E0D0" , "#6495ED" , "#CCCCFF" ]
4850
4951 function renderPart ( tc : TypeContext < PanelPartEmbedded > ) {
5052 const tcs = tc . subCtx ( { formGroupStyle : "SrOnly" , formSize : "ExtraSmall" , placeholderLabels : true } ) ;
@@ -56,7 +58,17 @@ export default function Dashboard(p : { ctx: TypeContext<DashboardEntity> }){
5658 < div className = "d-flex" >
5759 { icon && < div className = "mx-2" > < FontAwesomeIcon icon = { icon } style = { { color : tc . value . iconColor ?? undefined , fontSize : "25px" , marginTop : "17px" } } /> </ div > }
5860 < div style = { { flexGrow : 1 } } className = "mr-2" >
59- < ValueLine ctx = { tcs . subCtx ( pp => pp . title ) } labelText = { getToString ( tcs . value . content ) ?? tcs . niceName ( pp => pp . title ) } />
61+
62+ < div className = "row" >
63+ < div className = "col-sm-8" >
64+ < ValueLine ctx = { tcs . subCtx ( pp => pp . title ) } labelText = { getToString ( tcs . value . content ) ?? tcs . niceName ( pp => pp . title ) } />
65+ </ div >
66+ < div className = "col-sm-4" >
67+ < ValueLine ctx = { tcs . subCtx ( pp => pp . interactionGroup ) }
68+ optionItems = { colors . map ( ( c , i ) => ( { label : "Group " + ( i + 1 ) , value : "Group" + ( i + 1 ) , color : c } ) ) } onRenderDropDownListItem = { ( io ) => < span > < span className = "sf-dot" style = { { backgroundColor : ( io as any ) . color } } /> { io . label } </ span > } />
69+ </ div >
70+ </ div >
71+
6072 < div className = "row" >
6173 < div className = "col-sm-4" >
6274 < ValueLine ctx = { tcs . subCtx ( pp => pp . style ) } onChange = { ( ) => forceUpdate ( ) } />
0 commit comments