File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed
src/packages/property-editors Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,15 @@ export class UmbPropertyEditorUINumberElement extends UmbLitElement implements U
9
9
@property ( { type : Number } )
10
10
value ?: number ;
11
11
12
+ /**
13
+ * Sets the input to readonly mode, meaning value cannot be changed but still able to read and select its content.
14
+ * @type {boolean }
15
+ * @attr
16
+ * @default false
17
+ */
18
+ @property ( { type : Boolean , reflect : true } )
19
+ readonly = false ;
20
+
12
21
@state ( )
13
22
private _max ?: number ;
14
23
@@ -48,7 +57,8 @@ export class UmbPropertyEditorUINumberElement extends UmbLitElement implements U
48
57
step= ${ ifDefined ( this . _step ) }
49
58
placeholder= ${ ifDefined ( this . _placeholder ) }
50
59
.value = ${ this . value ?? ( this . _placeholder ? undefined : 0 ) }
51
- @input = ${ this . #onInput} >
60
+ @input = ${ this . #onInput}
61
+ ?readonly = ${ this . readonly } >
52
62
</ uui- input>
53
63
` ;
54
64
}
Original file line number Diff line number Diff line change 6
6
state ,
7
7
ifDefined ,
8
8
type PropertyValueMap ,
9
+ property ,
9
10
} from '@umbraco-cms/backoffice/external/lit' ;
10
11
import type { UmbPropertyEditorUiElement } from '@umbraco-cms/backoffice/extension-registry' ;
11
12
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element' ;
@@ -23,6 +24,15 @@ export class UmbPropertyEditorUITextBoxElement
23
24
extends UmbFormControlMixin < string > ( UmbLitElement , undefined )
24
25
implements UmbPropertyEditorUiElement
25
26
{
27
+ /**
28
+ * Sets the input to readonly mode, meaning value cannot be changed but still able to read and select its content.
29
+ * @type {boolean }
30
+ * @attr
31
+ * @default false
32
+ */
33
+ @property ( { type : Boolean , reflect : true } )
34
+ readonly = false ;
35
+
26
36
#defaultType: UuiInputTypeType = 'text' ;
27
37
28
38
@state ( )
@@ -63,7 +73,8 @@ export class UmbPropertyEditorUITextBoxElement
63
73
placeholder= ${ ifDefined ( this . _placeholder ) }
64
74
inputMode= ${ ifDefined ( this . _inputMode ) }
65
75
maxlength= ${ ifDefined ( this . _maxChars ) }
66
- @input = ${ this . onChange } > </ uui- input> ` ;
76
+ @input = ${ this . onChange }
77
+ ?readonly = ${ this . readonly } > </ uui- input> ` ;
67
78
}
68
79
69
80
static styles = [
You can’t perform that action at this time.
0 commit comments