@@ -47,6 +47,9 @@ import { timelineDate, timelineNode, TimelineDataTooltip } from "./timelineConst
47
47
import { convertTimeLineData } from "./timelineUtils" ;
48
48
import { default as Timeline } from "antd/es/timeline" ;
49
49
import { EditorContext } from "comps/editorState" ;
50
+ import { ThemeContext } from "@lowcoder-ee/comps/utils/themeContext" ;
51
+ import { CompTypeContext } from "@lowcoder-ee/comps/utils/compTypeContext" ;
52
+ import { setInitialCompStyles } from "@lowcoder-ee/comps/utils/themeUtil" ;
50
53
51
54
const EventOptions = [
52
55
clickEvent ,
@@ -64,7 +67,7 @@ const childrenMap = {
64
67
reverse : BoolControl ,
65
68
pending : withDefault ( StringControl , trans ( "timeLine.defaultPending" ) ) ,
66
69
onEvent : eventHandlerControl ( EventOptions ) ,
67
- style : styleControl ( TimeLineStyle ) ,
70
+ style : styleControl ( TimeLineStyle , 'style' ) ,
68
71
clickedObject : valueComp < timelineNode > ( { title : "" } ) ,
69
72
clickedIndex : valueComp < number > ( 0 ) ,
70
73
} ;
@@ -89,6 +92,22 @@ const TimelineComp = (
89
92
) => {
90
93
const { value, dispatch, style, mode, reverse, onEvent } = props ;
91
94
const [ icons , setIcons ] = useState < React . ReactNode [ ] > ( [ ] ) ;
95
+ const theme = useContext ( ThemeContext ) ;
96
+ const compType = useContext ( CompTypeContext ) ;
97
+ const compTheme = theme ?. theme ?. components ?. [ compType ] ;
98
+
99
+ const styleProps : Record < string , any > = { } ;
100
+ [ 'style' ] . forEach ( ( key : string ) => {
101
+ styleProps [ key ] = ( props as any ) [ key ] ;
102
+ } ) ;
103
+
104
+ useEffect ( ( ) => {
105
+ setInitialCompStyles ( {
106
+ dispatch,
107
+ compTheme,
108
+ styleProps,
109
+ } ) ;
110
+ } , [ ] ) ;
92
111
93
112
useEffect ( ( ) => {
94
113
const loadIcons = async ( ) => {
0 commit comments