@@ -7,10 +7,39 @@ import { SelectedColumnOptionsHandler } from "components/modals/columnSettings/h
77import { HideCompletedTaskToggleHandler } from "components/modals/columnSettings/handlers/tasks/HideCompletedTaskToggleHandler" ;
88import { LinkAliasToggleHandler } from "components/modals/columnSettings/handlers/media/LinkAliasToggleHandler" ;
99import { FormulaInputHandler } from "components/modals/columnSettings/handlers/automations/FormulaInputHandler" ;
10+ import { AlignmentSelectorHandler } from "components/modals/columnSettings/handlers/AlignmentSelectorHandler" ;
1011import { InputType } from "helpers/Constants" ;
1112import { AbstractChain } from "patterns/AbstractFactoryChain" ;
1213import { AbstractHandler } from "patterns/AbstractHandler" ;
1314
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+
1443class BehaviorSetttingsSection extends AbstractChain < ColumnSettingsHandlerResponse > {
1544 private input : string = InputType . TEXT ;
1645 protected runBefore ( columnHandlerResponse : ColumnSettingsHandlerResponse ) : ColumnSettingsHandlerResponse {
@@ -68,6 +97,7 @@ class ParticularSetttingsSection extends AbstractChain<ColumnSettingsHandlerResp
6897 break ;
6998 case InputType . TASK :
7099 particularHandlers . push ( new HideCompletedTaskToggleHandler ( ) ) ;
100+ break ;
71101 case InputType . FORMULA :
72102 particularHandlers . push ( new FormulaInputHandler ( ) ) ;
73103 break ;
0 commit comments