File tree Expand file tree Collapse file tree 4 files changed +75
-42
lines changed
src/components/tables/large Expand file tree Collapse file tree 4 files changed +75
-42
lines changed Original file line number Diff line number Diff line change 1
1
DATABASE_URL = postgres:///pgml_dashboard_development
2
2
DEV_MODE = true
3
3
RUST_LOG = debug,tantivy=error,rocket=info
4
+ SITE_SEARCH_DATABASE_URL = postgres:///pgml_dashboard_development
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ impl Row {
14
14
pub fn new ( columns : & [ Component ] ) -> Row {
15
15
Row {
16
16
columns : columns. to_vec ( ) ,
17
- action : "click->tables-large-table#selectRow " . to_string ( ) ,
17
+ action : "" . to_string ( ) ,
18
18
data : vec ! [ ] ,
19
19
}
20
20
}
@@ -28,6 +28,10 @@ impl Row {
28
28
self . data . push ( ( name. to_owned ( ) , value. to_owned ( ) ) ) ;
29
29
self
30
30
}
31
+
32
+ pub fn selectable ( self ) -> Self {
33
+ self . action ( "click->tables-large-table#selectRow" )
34
+ }
31
35
}
32
36
33
37
component ! ( Row ) ;
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ impl Table {
21
21
22
22
pub fn selectable ( mut self ) -> Self {
23
23
self . classes . push_str ( " selectable" ) ;
24
+ self . rows = self . rows . into_iter ( ) . map ( |r| r. selectable ( ) ) . collect ( ) ;
24
25
self
25
26
}
26
27
}
Original file line number Diff line number Diff line change 1
1
table .table.table-lg {
2
- td , tr , th {
3
- border-width : 0 ;
4
- }
2
+ td ,
3
+ tr ,
4
+ th {
5
+ border-width : 0 ;
6
+ }
5
7
6
- border-collapse : separate ;
7
- border-spacing : 0 16px ;
8
+ border-collapse : separate ;
9
+ border-spacing : 0 16px ;
8
10
9
- thead {
10
- th {
11
- color : #{$slate-shade-100 } ;
12
- background : #{$gray-800 } ;
13
- text-transform : uppercase ;
14
- font-size : 0.75rem ;
15
- padding : 16px 0 ;
11
+ thead {
12
+ th {
13
+ color : #{$slate-shade-100 } ;
14
+ background : #{$gray-800 } ;
15
+ text-transform : uppercase ;
16
+ font-size : 0.75rem ;
17
+ padding : 16px 0 ;
16
18
17
- & :first-of-type {
18
- padding-left : 67px ;
19
- }
20
- }
19
+ & :first-of-type {
20
+ padding-left : 67px ;
21
+ }
21
22
}
22
23
23
- tbody {
24
- tr {
25
- & :hover , & .active {
26
- td {
27
- background : #{$gray-800 } ;
28
- }
29
- }
30
-
31
- td {
32
- background : #{$gray-600 } ;
33
- vertical-align : middle ;
34
- padding : 20px 0 ;
35
-
36
- & :first-of-type {
37
- padding-left : 67px ;
38
- }
39
- }
40
- }
24
+ tr {
25
+ th :first-child {
26
+ border-top-left-radius : $border-radius ;
27
+ }
28
+ th :last-child {
29
+ border-top-right-radius : $border-radius ;
30
+ }
41
31
}
32
+ }
33
+
34
+ tbody {
35
+ tr {
36
+ & .active {
37
+ td {
38
+ background : #{$gray-800 } ;
39
+ }
40
+ }
42
41
43
- & .selectable {
44
- tbody {
45
- tr :hover {
46
- cursor : pointer ;
47
- }
42
+ td {
43
+ background : #{$gray-600 } ;
44
+ vertical-align : middle ;
45
+ padding : 20px 0 ;
46
+
47
+ & :first-of-type {
48
+ padding-left : 67px ;
48
49
}
50
+ }
51
+
52
+ td :first-child {
53
+ border-top-left-radius : $border-radius ;
54
+ border-bottom-left-radius : $border-radius ;
55
+ }
56
+ td :last-child {
57
+ border-top-right-radius : $border-radius ;
58
+ border-bottom-right-radius : $border-radius ;
59
+ }
49
60
}
61
+ }
62
+
63
+ & .selectable {
64
+ --bs-table-hover-bg : #{$gray-700 } ;
50
65
51
- .table-cell-content {
52
- height : 100% ;
66
+ tbody {
67
+ tr :hover {
68
+ cursor : pointer ;
69
+ background : #{$gray-800 } ;
70
+ }
53
71
}
72
+ }
73
+
74
+ & {
75
+ --bs-table-hover-bg : #{$gray-600 } ;
76
+ }
77
+
78
+ .table-cell-content {
79
+ height : 100% ;
80
+ }
54
81
}
You can’t perform that action at this time.
0 commit comments