@@ -460,6 +460,21 @@ function getStaticBackground(color: string) {
460460 } as const ;
461461}
462462
463+
464+ function replaceAndMergeMultipleStyles ( originalArray : any [ ] , styleToReplace : string , replacingStyles : any [ ] ) : any [ ] {
465+ let temp = [ ]
466+ let foundIndex = originalArray . findIndex ( ( element ) => element . name === styleToReplace )
467+
468+ if ( foundIndex !== - 1 ) {
469+ let elementsBeforeFoundIndex = originalArray . filter ( ( item , index ) => index < foundIndex )
470+ let elementsAfterFoundIndex = originalArray . filter ( ( item , index ) => index > foundIndex )
471+ temp = [ ...elementsBeforeFoundIndex , ...replacingStyles , ...elementsAfterFoundIndex ]
472+ } else
473+ temp = [ ...originalArray ]
474+
475+ return temp
476+ }
477+
463478export const ButtonStyle = [
464479 ...getBgBorderRadiusByBg ( "primary" ) ,
465480 ...STYLING_FIELDS_SEQUENCE
@@ -674,14 +689,6 @@ export const SliderStyle = [
674689export const InputLikeStyle = [
675690 LABEL ,
676691 getStaticBackground ( SURFACE_COLOR ) ,
677- // TEXT,
678- // TEXT_SIZE,
679- // TEXT_WEIGHT,
680- // FONT_FAMILY,
681- // FONT_STYLE,
682- // MARGIN,
683- // PADDING,
684- // BORDER_WIDTH,
685692 ...STYLING_FIELDS_SEQUENCE ,
686693 ...ACCENT_VALIDATE ,
687694] as const ;
@@ -1047,8 +1054,7 @@ export const LinkStyle = [
10471054 depType : DEP_TYPE . SELF ,
10481055 transformer : toSelf ,
10491056 } ,
1050- ...LinkTextStyle ,
1051- ...STYLING_FIELDS_SEQUENCE . filter ( ( style ) => style . name !== 'text' )
1057+ ...replaceAndMergeMultipleStyles ( STYLING_FIELDS_SEQUENCE , 'text' , [ ...LinkTextStyle ] )
10521058] as const ;
10531059
10541060export const DividerStyle = [
@@ -1070,19 +1076,18 @@ export const DividerStyle = [
10701076 } )
10711077] as const ;
10721078
1079+ // Hidden border and borderWidth properties as AntD doesnt allow these properties for progress bar
10731080export const ProgressStyle = [
1074- {
1081+ ... replaceAndMergeMultipleStyles ( STYLING_FIELDS_SEQUENCE , 'text' , [ {
10751082 name : "text" ,
10761083 label : trans ( "text" ) ,
10771084 depTheme : "canvas" ,
10781085 depType : DEP_TYPE . CONTRAST_TEXT ,
10791086 transformer : contrastText ,
1080- } ,
1087+ } ] ) . filter ( ( style ) => [ 'border' , 'borderWidth' ] . includes ( style . name ) === false ) ,
10811088 TRACK ,
10821089 FILL ,
10831090 SUCCESS ,
1084- MARGIN ,
1085- PADDING ,
10861091] as const ;
10871092
10881093export const NavigationStyle = [
0 commit comments