@@ -12,6 +12,34 @@ import { InputType } from "helpers/Constants";
1212import { AbstractChain } from "patterns/AbstractFactoryChain" ;
1313import { AbstractHandler } from "patterns/AbstractHandler" ;
1414
15+ class StyleSetttingsSection extends AbstractChain < ColumnSettingsHandlerResponse > {
16+ private input : string = InputType . TEXT ;
17+ protected runBefore ( columnHandlerResponse : ColumnSettingsHandlerResponse ) : ColumnSettingsHandlerResponse {
18+ this . input = columnHandlerResponse . column . input ;
19+ return columnHandlerResponse ;
20+ }
21+ protected customHandle ( columnHandlerResponse : ColumnSettingsHandlerResponse ) : ColumnSettingsHandlerResponse {
22+ const style_section = columnHandlerResponse . containerEl . createDiv ( "column-section-container-style" ) ;
23+ add_setting_header ( style_section , "Style" , "h3" ) ;
24+ columnHandlerResponse . containerEl = style_section ;
25+ return columnHandlerResponse ;
26+ }
27+ protected getHandlers ( ) : AbstractHandler < ColumnSettingsHandlerResponse > [ ] {
28+ const particularHandlers : AbstractHandler < ColumnSettingsHandlerResponse > [ ] = [ ] ;
29+ switch ( this . input ) {
30+ case InputType . TEXT :
31+ case InputType . NUMBER :
32+ case InputType . FORMULA :
33+ particularHandlers . push ( new AlignmentSelectorHandler ( ) ) ;
34+ break ;
35+ default :
36+ // do nothing
37+ }
38+ return particularHandlers ;
39+ }
40+ }
41+ export const style_settings_section = new StyleSetttingsSection ( ) ;
42+
1543class BehaviorSetttingsSection extends AbstractChain < ColumnSettingsHandlerResponse > {
1644 private input : string = InputType . TEXT ;
1745 protected runBefore ( columnHandlerResponse : ColumnSettingsHandlerResponse ) : ColumnSettingsHandlerResponse {
@@ -26,7 +54,6 @@ class BehaviorSetttingsSection extends AbstractChain<ColumnSettingsHandlerRespon
2654 }
2755 protected getHandlers ( ) : AbstractHandler < ColumnSettingsHandlerResponse > [ ] {
2856 const particularHandlers : AbstractHandler < ColumnSettingsHandlerResponse > [ ] = [ ] ;
29- particularHandlers . push ( new AlignmentSelectorHandler ( ) ) ;
3057 switch ( this . input ) {
3158 case InputType . TASK :
3259 // do nothing
0 commit comments