File tree Expand file tree Collapse file tree 2 files changed +35
-12
lines changed Expand file tree Collapse file tree 2 files changed +35
-12
lines changed Original file line number Diff line number Diff line change @@ -85,14 +85,18 @@ export class UUIRefNodeElement extends UUIRefElement {
85
85
86
86
#renderContent( ) {
87
87
return html `
88
- <span id= "icon" >
89
- <slot name= "icon" @slotchange = ${ this . #onSlotIconChange} > </ slot>
90
- ${ this . _iconSlotHasContent === false ? this . #renderFallbackIcon( ) : '' }
88
+ <span id= "content" >
89
+ <span id= "icon" >
90
+ <slot name= "icon" @slotchange = ${ this . #onSlotIconChange} > </ slot>
91
+ ${ this . _iconSlotHasContent === false
92
+ ? this . #renderFallbackIcon( )
93
+ : '' }
94
+ </ span>
95
+ <div id= "info" >
96
+ <div id= "name" > ${ this . name } </ div>
97
+ ${ this . renderDetail ( ) }
98
+ </ div>
91
99
</ span>
92
- <div id= "info" >
93
- <div id= "name" > ${ this . name } </ div>
94
- ${ this . renderDetail ( ) }
95
- </ div>
96
100
` ;
97
101
}
98
102
@@ -125,7 +129,7 @@ export class UUIRefNodeElement extends UUIRefElement {
125
129
126
130
public render ( ) {
127
131
return html `
128
- ${ this . href ? this . #renderLink ( ) : this . #renderButton ( ) }
132
+ ${ this . #renderSomething ( ) }
129
133
<!- - Select bor der must be right after # open-part -- >
130
134
<div id= "select-border" > </ div>
131
135
@@ -135,6 +139,14 @@ export class UUIRefNodeElement extends UUIRefElement {
135
139
` ;
136
140
}
137
141
142
+ #renderSomething( ) {
143
+ if ( this . readonly ) {
144
+ return html `${ this . #renderContent( ) } ` ;
145
+ } else {
146
+ return this . href ? this . #renderLink( ) : this . #renderButton( ) ;
147
+ }
148
+ }
149
+
138
150
static styles = [
139
151
...UUIRefElement . styles ,
140
152
css `
@@ -143,15 +155,17 @@ export class UUIRefNodeElement extends UUIRefElement {
143
155
padding : calc (var (--uui-size-2 ) + 1px );
144
156
}
145
157
146
- # open-part {
147
- text-decoration : none;
148
- color : inherit;
158
+ # content {
149
159
align-self : stretch;
150
160
line-height : normal;
151
-
152
161
display : flex;
153
162
position : relative;
154
163
align-items : center;
164
+ }
165
+
166
+ # open-part {
167
+ color : inherit;
168
+ text-decoration : none;
155
169
cursor : pointer;
156
170
}
157
171
Original file line number Diff line number Diff line change @@ -31,6 +31,15 @@ export class UUIRefElement extends SelectOnlyMixin(
31
31
@property ( { type : Boolean , reflect : true } )
32
32
disabled = false ;
33
33
34
+ /**
35
+ * Sets the input to readonly mode, meaning value cannot be changed but still able to read and select its content.
36
+ * @type {boolean }
37
+ * @attr
38
+ * @default false
39
+ */
40
+ @property ( { type : Boolean , reflect : true } )
41
+ readonly = false ;
42
+
34
43
/**
35
44
* Set to true to display error state
36
45
* @type {boolean }
You can’t perform that action at this time.
0 commit comments