@@ -12,46 +12,29 @@ namespace Griddly.Mvc
12
12
{
13
13
public abstract class GriddlySettings : IGriddlyFilterSettings
14
14
{
15
- public static class Css
16
- {
17
- public static string TextCenter = "text-center" ;
18
- public static string TextRight = "text-right" ;
19
- public static string FloatRight = "pull-right" ;
20
- public static string GriddlyDefault = null ;
21
- public static string TableDefault = "table table-bordered table-hover" ;
22
- public static string ButtonDefault = "btn btn-default" ;
23
-
24
- public static class Icons
25
- {
26
- public static string Calendar = "glyphicon glyphicon-calendar" ;
27
- public static string Remove = "glyphicon glyphicon-remove" ;
28
- public static string ListMultipleSelected = "glyphicon glyphicon-ok" ;
29
- public static string ListSingleSelected = "glyphicon glyphicon-record" ;
30
- public static string Check = "glyphicon glyphicon-check" ;
31
- public static string Filter = "glyphicon glyphicon-filter" ;
32
- public static string Clear = "glyphicon glyphicon-ban-circle" ;
33
- public static string CaretDown = "caret" ;
34
- }
35
- }
15
+ public static GriddlyCss DefaultCss = GriddlyCss . Bootstrap3Defaults ;
36
16
17
+ #region Obsolete shims retained only for backward compatibility
37
18
[ Obsolete ( "Use GriddlySettings.Css.GriddlyDefault" ) ]
38
- public static string DefaultClassName { get => Css . GriddlyDefault ; set => Css . GriddlyDefault = value ; }
19
+ public static string DefaultClassName { get => DefaultCss . GriddlyDefault ; set => DefaultCss . GriddlyDefault = value ; }
39
20
[ Obsolete ( "Use GriddlySettings.Css.TableDefault" ) ]
40
- public static string DefaultTableClassName { get => Css . TableDefault ; set => Css . TableDefault = value ; }
21
+ public static string DefaultTableClassName { get => DefaultCss . TableDefault ; set => DefaultCss . TableDefault = value ; }
41
22
[ Obsolete ( "Use GriddlySettings.Css.ButtonDefault" ) ]
42
- public static string DefaultButtonClassName { get => Css . ButtonDefault ; set => Css . ButtonDefault = value ; }
43
-
23
+ public static string DefaultButtonClassName { get => DefaultCss . ButtonDefault ; set => DefaultCss . ButtonDefault = value ; }
24
+ [ Obsolete ( "Use Css.IsBootstrap4" ) ]
25
+ public static bool IsBootstrap4 => DefaultCss . IsBootstrap4 ;
26
+ #endregion
27
+
44
28
public static string ButtonTemplate = "~/Views/Shared/Griddly/BootstrapButton.cshtml" ;
45
29
public static string ButtonListTemplate = "~/Views/Shared/Griddly/ButtonStrip.cshtml" ;
46
- public static HtmlString BoolTrueHtml = null ;
47
- public static HtmlString BoolFalseHtml = null ;
30
+ public static HtmlString DefaultBoolTrueHtml = null ;
31
+ public static HtmlString DefaultBoolFalseHtml = null ;
48
32
public static int ? DefaultPageSize = null ;
49
33
public static FilterMode ? DefaultInitialFilterMode = FilterMode . Form ;
50
34
//public static FilterMode? DefaultAllowedFilterModes = FilterMode.Inline;
51
35
public static bool DefaultShowRowSelectCount = true ;
52
36
public static bool ExportCurrencySymbol = true ;
53
37
public static bool DisableHistoryParameters = false ;
54
- public static bool IsBootstrap4 = false ;
55
38
56
39
public static Func < GriddlyButton , object > IconTemplate = null ;
57
40
public static Func < GriddlyResultPage , object > DefaultFooterTemplate = null ;
@@ -66,7 +49,7 @@ public static class Icons
66
49
public static Action < GriddlySettings , GriddlyResultPage , HtmlHelper , bool > OnBeforeRender = null ;
67
50
public static Action < GriddlySettings , ControllerContext > OnGriddlyResultExecuting = null ;
68
51
public static Action < GriddlySettings , GriddlyContext , ControllerContext > OnGriddlyPageExecuting = null ;
69
-
52
+
70
53
public GriddlySettings ( )
71
54
{
72
55
IdProperty = "Id" ;
@@ -79,8 +62,8 @@ public GriddlySettings()
79
62
HtmlAttributes = new RouteValueDictionary ( ) ;
80
63
TableHtmlAttributes = new RouteValueDictionary ( ) ;
81
64
82
- ClassName = Css . GriddlyDefault ;
83
- TableClassName = Css . TableDefault ;
65
+ ClassName = DefaultCss . GriddlyDefault ;
66
+ TableClassName = DefaultCss . TableDefault ;
84
67
FooterTemplate = DefaultFooterTemplate ;
85
68
HeaderTemplate = DefaultHeaderTemplate ;
86
69
EmptyGridMessageTemplate = DefaultEmptyGridMessageTemplate ;
@@ -93,22 +76,13 @@ public GriddlySettings()
93
76
94
77
public static void ConfigureBootstrap4Defaults ( )
95
78
{
96
- IsBootstrap4 = true ;
97
- Css . TextCenter = "text-center" ;
98
- Css . TextRight = "text-right" ;
99
- Css . FloatRight = "float-right" ;
100
- Css . ButtonDefault = "btn btn-outline-secondary" ;
101
-
102
- Css . Icons . Calendar = "fa fa-calendar-alt" ;
103
- Css . Icons . Remove = "fa fa-times" ;
104
- Css . Icons . ListMultipleSelected = "fa fa-check" ;
105
- Css . Icons . ListSingleSelected = "fas fa-check-circle" ;
106
- Css . Icons . Check = "fa fa-check-square" ;
107
- Css . Icons . Filter = "fa fa-filter" ;
108
- Css . Icons . Clear = "fa fa-ban" ;
109
- Css . Icons . CaretDown = "fa fa-caret-down" ;
79
+ DefaultCss = GriddlyCss . Bootstrap4Defaults ;
110
80
}
111
81
82
+ public GriddlyCss Css = DefaultCss ;
83
+ public HtmlString BoolTrueHtml = DefaultBoolTrueHtml ;
84
+ public HtmlString BoolFalseHtml = DefaultBoolFalseHtml ;
85
+
112
86
public string [ ] DefaultRowIds { get ; set ; }
113
87
public string IdProperty { get ; set ; }
114
88
public string Title { get ; set ; }
@@ -362,7 +336,7 @@ public GriddlySettings SelectColumn(Expression<Func<object, object>> id, object
362
336
{
363
337
RowId ( id , "id" ) ;
364
338
365
- return Add ( new GriddlySelectColumn ( )
339
+ return Add ( new GriddlySelectColumn ( this )
366
340
{
367
341
SummaryValue = summaryValue
368
342
} ) ;
@@ -375,7 +349,7 @@ public GriddlySettings SelectColumn(Dictionary<string, Func<object, object>> ids
375
349
RowIds [ x . Key ] = x . Value ;
376
350
}
377
351
378
- return Add ( new GriddlySelectColumn ( )
352
+ return Add ( new GriddlySelectColumn ( this )
379
353
{
380
354
SummaryValue = summaryValue
381
355
} ) ;
@@ -557,7 +531,7 @@ public GriddlySettings<TRow> SelectColumn(Expression<Func<TRow, object>> id, obj
557
531
{
558
532
RowId ( id , "id" ) ;
559
533
560
- Add ( new GriddlySelectColumn < TRow > ( )
534
+ Add ( new GriddlySelectColumn < TRow > ( this )
561
535
{
562
536
SummaryValue = summaryValue ,
563
537
InputHtmlAttributesTemplate = inputHtmlAttributesTemplate
@@ -573,7 +547,7 @@ public GriddlySettings<TRow> SelectColumn(Dictionary<string, Func<TRow, object>>
573
547
RowIds [ x . Key ] = ( z ) => x . Value ( ( TRow ) z ) ;
574
548
}
575
549
576
- Add ( new GriddlySelectColumn ( )
550
+ Add ( new GriddlySelectColumn ( this )
577
551
{
578
552
SummaryValue = summaryValue
579
553
} ) ;
0 commit comments