@@ -19,7 +19,7 @@ import { Section, sectionNames } from "lowcoder-design";
19
19
import { hiddenPropertyView } from "comps/utils/propertyUtils" ;
20
20
import { trans } from "i18n" ;
21
21
import { NumberControl } from "comps/controls/codeControl" ;
22
- import { IconControl } from "comps/controls/iconControl " ;
22
+ import { ShapeControl } from "comps/controls/shapeControl " ;
23
23
import ReactResizeDetector from "react-resize-detector" ;
24
24
import { AutoHeightControl } from "../../controls/autoHeightControl" ;
25
25
import {
@@ -28,6 +28,7 @@ import {
28
28
} from "../../controls/eventHandlerControl" ;
29
29
import { useContext } from "react" ;
30
30
import { EditorContext } from "comps/editorState" ;
31
+ import { Coolshape } from "coolshapes-react" ;
31
32
32
33
const Container = styled . div < { $style : IconStyleType | undefined } > `
33
34
display: flex;
@@ -58,7 +59,7 @@ const EventOptions = [clickEvent] as const;
58
59
59
60
const childrenMap = {
60
61
style : styleControl ( IconStyle ) ,
61
- icon : withDefault ( IconControl , "/icon:antd/homefilled " ) ,
62
+ icon : withDefault ( ShapeControl , "" ) ,
62
63
autoHeight : withDefault ( AutoHeightControl , "auto" ) ,
63
64
iconSize : withDefault ( NumberControl , 20 ) ,
64
65
onEvent : eventHandlerControl ( EventOptions ) ,
@@ -80,6 +81,27 @@ const IconView = (props: RecordConstructorToView<typeof childrenMap>) => {
80
81
setWidth ( container ?. clientWidth ?? 0 ) ;
81
82
setHeight ( container ?. clientHeight ?? 0 ) ;
82
83
} ;
84
+ const getIconDetails = ( ) => {
85
+ if ( props ?. icon ) {
86
+ let { props : pp } = props ?. icon ;
87
+ console . log ( pp ) ;
88
+ }
89
+
90
+ // let shapeDetails: any = props.icon["props"];
91
+ // console.log(shapeDetails);
92
+
93
+ // if (props.icon && props.icon?.props?.value) {
94
+ // return {
95
+ // index: parseInt(props.icon?.props?.value.split("_")[1]),
96
+ // value: props.icon?.props?.value.split("_")[0],
97
+ // };
98
+ // } else {
99
+ // return {
100
+ // index: 0,
101
+ // value: "star",
102
+ // };
103
+ // }
104
+ } ;
83
105
84
106
return (
85
107
< ReactResizeDetector onResize = { onResize } >
@@ -94,7 +116,13 @@ const IconView = (props: RecordConstructorToView<typeof childrenMap>) => {
94
116
} }
95
117
onClick = { ( ) => props . onEvent ( "click" ) }
96
118
>
97
- { props . icon }
119
+ { /* {props.icon} */ }
120
+ < Coolshape
121
+ type = { getIconDetails ( ) [ "value" ] }
122
+ index = { getIconDetails ( ) [ "index" ] }
123
+ size = { 48 }
124
+ noise = { true }
125
+ />
98
126
</ Container >
99
127
</ ReactResizeDetector >
100
128
) ;
@@ -149,4 +177,6 @@ ShapeBasicComp = class extends ShapeBasicComp {
149
177
}
150
178
} ;
151
179
152
- export const ShapeComp = withExposingConfigs ( ShapeBasicComp , [ NameConfigHidden ] ) ;
180
+ export const ShapeComp = withExposingConfigs ( ShapeBasicComp , [
181
+ NameConfigHidden ,
182
+ ] ) ;
0 commit comments