@@ -30,6 +30,8 @@ import {
3030} from "../controls/eventHandlerControl" ;
3131import { useContext } from "react" ;
3232import { EditorContext } from "comps/editorState" ;
33+ import { AssetType , IconscoutControl } from "@lowcoder-ee/comps/controls/iconscoutControl" ;
34+ import { dropdownControl } from "../controls/dropdownControl" ;
3335
3436const Container = styled . div < {
3537 $style : IconStyleType | undefined ;
@@ -61,10 +63,17 @@ const Container = styled.div<{
6163
6264const EventOptions = [ clickEvent ] as const ;
6365
66+ const ModeOptions = [
67+ { label : "Standard" , value : "standard" } ,
68+ { label : "Asset Library" , value : "asset-library" } ,
69+ ] as const ;
70+
6471const childrenMap = {
6572 style : styleControl ( IconStyle , 'style' ) ,
6673 animationStyle : styleControl ( AnimationStyle , 'animationStyle' ) ,
74+ sourceMode : dropdownControl ( ModeOptions , "standard" ) ,
6775 icon : withDefault ( IconControl , "/icon:antd/homefilled" ) ,
76+ iconScoutAsset : IconscoutControl ( AssetType . ICON ) ,
6877 autoHeight : withDefault ( AutoHeightControl , "auto" ) ,
6978 iconSize : withDefault ( NumberControl , 20 ) ,
7079 onEvent : eventHandlerControl ( EventOptions ) ,
@@ -103,7 +112,10 @@ const IconView = (props: RecordConstructorToView<typeof childrenMap>) => {
103112 } }
104113 onClick = { ( ) => props . onEvent ( "click" ) }
105114 >
106- { props . icon }
115+ { props . sourceMode === 'standard'
116+ ? props . icon
117+ : < img src = { props . iconScoutAsset . value } />
118+ }
107119 </ Container >
108120 ) }
109121 >
@@ -117,11 +129,17 @@ let IconBasicComp = (function () {
117129 . setPropertyViewFn ( ( children ) => (
118130 < >
119131 < Section name = { sectionNames . basic } >
120- { children . icon . propertyView ( {
132+ { children . sourceMode . propertyView ( {
133+ label : "" ,
134+ radioButton : true
135+ } ) }
136+ { children . sourceMode . getView ( ) === 'standard' && children . icon . propertyView ( {
121137 label : trans ( "iconComp.icon" ) ,
122138 IconType : "All" ,
123139 } ) }
124-
140+ { children . sourceMode . getView ( ) === 'asset-library' && children . iconScoutAsset . propertyView ( {
141+ label : trans ( "button.icon" ) ,
142+ } ) }
125143 </ Section >
126144
127145 { [ "logic" , "both" ] . includes ( useContext ( EditorContext ) . editorModeStatus ) && (
0 commit comments