File tree Expand file tree Collapse file tree 3 files changed +41
-2
lines changed
QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src
testassets/BasicTestApp/QuickGridTest Expand file tree Collapse file tree 3 files changed +41
-2
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,23 @@ td.col-justify-end {
80
80
text-align : right;
81
81
}
82
82
83
+ .col-justify-start .col-options {
84
+ left : 0 ;
85
+ right : unset;
86
+ }
87
+
88
+ td .col-justify-start {
89
+ text-align : left;
90
+ }
91
+
92
+ td .col-justify-right {
93
+ text-align : right;
94
+ }
95
+
96
+ td .col-justify-left {
97
+ text-align : left;
98
+ }
99
+
83
100
/* Unfortunately we can't use the :dir pseudoselector due to lack of browser support. Instead we have to rely on
84
101
the developer setting <html dir="rtl"> to detect if we're in RTL mode. */
85
102
html [dir = rtl ] td .col-justify-end {
@@ -91,6 +108,10 @@ html[dir=rtl] .col-options {
91
108
right : 0 ;
92
109
}
93
110
111
+ html [dir = rtl ] td .col-justify-start {
112
+ text-align : right;
113
+ }
114
+
94
115
html [dir = rtl ] .col-justify-end .col-options {
95
116
right : unset;
96
117
left : 0 ;
Original file line number Diff line number Diff line change 8
8
using Microsoft . AspNetCore . Components . E2ETest . Infrastructure . ServerFixtures ;
9
9
using Microsoft . AspNetCore . E2ETesting ;
10
10
using OpenQA . Selenium ;
11
+ using OpenQA . Selenium . Support . Extensions ;
11
12
using Xunit . Abstractions ;
12
13
13
14
namespace Microsoft . AspNetCore . Components . E2ETests . Tests ;
@@ -149,6 +150,23 @@ public void RowClassApplied()
149
150
}
150
151
}
151
152
153
+ [ Fact ]
154
+ public void RowStyleApplied ( )
155
+ {
156
+ var grid = app . FindElement ( By . CssSelector ( "#grid > table" ) ) ;
157
+ var birthDateColumn = grid . FindElement ( By . CssSelector ( "thead > tr > th:nth-child(4)" ) ) ;
158
+ var ageColumn = grid . FindElement ( By . CssSelector ( "thead > tr > th:nth-child(5)" ) ) ;
159
+
160
+ Assert . Contains ( "col-justify-center" , birthDateColumn . GetAttribute ( "class" ) ) ;
161
+ Assert . Contains ( "col-justify-right" , ageColumn . GetAttribute ( "class" ) ) ;
162
+ Assert . Equal ( "center" , Browser . ExecuteJavaScript < string > ( @"
163
+ const p = document.querySelector('tbody > tr:first-child > td:nth-child(4)');
164
+ return p ? getComputedStyle(p).textAlign : null;" ) ) ;
165
+ Assert . Equal ( "right" , Browser . ExecuteJavaScript < string > ( @"
166
+ const p = document.querySelector('tbody > tr:first-child > td:nth-child(5)');
167
+ return p ? getComputedStyle(p).textAlign : null;" ) ) ;
168
+ }
169
+
152
170
[ Fact ]
153
171
public void CanOpenColumnOptions ( )
154
172
{
Original file line number Diff line number Diff line change 14
14
</ColumnOptions >
15
15
</PropertyColumn >
16
16
<PropertyColumn Property =" @(p => p.LastName)" Sortable =" true" />
17
- <PropertyColumn Property =" @(p => p.BirthDate)" Format =" yyyy-MM-dd" Sortable =" true" />
18
- <PropertyColumn Title =" Age in years" Property =" @(p => ComputeAge(p.BirthDate))" Sortable =" true" />
17
+ <PropertyColumn Property =" @(p => p.BirthDate)" Format =" yyyy-MM-dd" Sortable =" true" Align = " Align.Center " />
18
+ <PropertyColumn Title =" Age in years" Property =" @(p => ComputeAge(p.BirthDate))" Sortable =" true" Align = " Align.Right " />
19
19
</QuickGrid >
20
20
</div >
21
21
<Paginator State =" @pagination" />
You can’t perform that action at this time.
0 commit comments