@@ -10,7 +10,10 @@ export class UmbMediaTreeItemElement extends UmbTreeItemElementBase<UmbMediaTree
10
10
return html `
11
11
<span id= "icon-container" slot = "icon" >
12
12
${ this . item ?. mediaType . icon
13
- ? html ` <umb- icon id= "icon" slot = "icon" name = "${ this . item . mediaType . icon } " > </ umb- icon> `
13
+ ? html `
14
+ <umb- icon id= "icon" slot = "icon" name = "${ this . item . mediaType . icon } " > </ umb- icon>
15
+ ${ this . #renderStateIcon( ) }
16
+ `
14
17
: nothing }
15
18
</ span>
16
19
` ;
@@ -20,6 +23,18 @@ export class UmbMediaTreeItemElement extends UmbTreeItemElementBase<UmbMediaTree
20
23
return html `<span id= "label" slot = "label" > ${ this . _item ?. variants [ 0 ] . name } </ span> ` ;
21
24
}
22
25
26
+ #renderStateIcon( ) {
27
+ if ( this . item ?. mediaType . collection ) {
28
+ return this . #renderIsCollectionIcon( ) ;
29
+ }
30
+
31
+ return nothing ;
32
+ }
33
+
34
+ #renderIsCollectionIcon( ) {
35
+ return html `<umb- icon id= "state-icon" slot = "icon" name = "icon-grid" title = "Collection" > </ umb- icon> ` ;
36
+ }
37
+
23
38
static override styles = [
24
39
UmbTextStyles ,
25
40
css `
@@ -36,6 +51,45 @@ export class UmbMediaTreeItemElement extends UmbTreeItemElementBase<UmbMediaTree
36
51
overflow : hidden;
37
52
text-overflow : ellipsis;
38
53
}
54
+
55
+ # state-icon {
56
+ position : absolute;
57
+ bottom : -5px ;
58
+ right : -5px ;
59
+ font-size : 10px ;
60
+ background : var (--uui-color-surface );
61
+ width : 14px ;
62
+ height : 14px ;
63
+ border-radius : 100% ;
64
+ line-height : 14px ;
65
+ }
66
+
67
+ : hover # state-icon {
68
+ background : var (--uui-color-surface-emphasis );
69
+ }
70
+
71
+ /** Active */
72
+ [active ] # state-icon {
73
+ background : var (--uui-color-current );
74
+ }
75
+
76
+ [active ]: hover # state-icon {
77
+ background : var (--uui-color-current-emphasis );
78
+ }
79
+
80
+ /** Selected */
81
+ [selected ] # state-icon {
82
+ background-color : var (--uui-color-selected );
83
+ }
84
+
85
+ [selected ]: hover # state-icon {
86
+ background-color : var (--uui-color-selected-emphasis );
87
+ }
88
+
89
+ /** Disabled */
90
+ [disabled ] # state-icon {
91
+ background-color : var (--uui-color-disabled );
92
+ }
39
93
` ,
40
94
] ;
41
95
}
0 commit comments