This repository was archived by the owner on Nov 6, 2025. It is now read-only.
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
99 @property ( { type : Number } )
1010 value ?: number ;
1111
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+
1221 @state ( )
1322 private _max ?: number ;
1423
@@ -48,7 +57,8 @@ export class UmbPropertyEditorUINumberElement extends UmbLitElement implements U
4857 step= ${ ifDefined ( this . _step ) }
4958 placeholder= ${ ifDefined ( this . _placeholder ) }
5059 .value = ${ this . value ?? ( this . _placeholder ? undefined : 0 ) }
51- @input = ${ this . #onInput} >
60+ @input = ${ this . #onInput}
61+ ?readonly = ${ this . readonly } >
5262 </ uui- input>
5363 ` ;
5464 }
Original file line number Diff line number Diff line change 66 state ,
77 ifDefined ,
88 type PropertyValueMap ,
9+ property ,
910} from '@umbraco-cms/backoffice/external/lit' ;
1011import type { UmbPropertyEditorUiElement } from '@umbraco-cms/backoffice/extension-registry' ;
1112import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element' ;
@@ -23,6 +24,15 @@ export class UmbPropertyEditorUITextBoxElement
2324 extends UmbFormControlMixin < string > ( UmbLitElement , undefined )
2425 implements UmbPropertyEditorUiElement
2526{
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+
2636 #defaultType: UuiInputTypeType = 'text' ;
2737
2838 @state ( )
@@ -63,7 +73,8 @@ export class UmbPropertyEditorUITextBoxElement
6373 placeholder= ${ ifDefined ( this . _placeholder ) }
6474 inputMode= ${ ifDefined ( this . _inputMode ) }
6575 maxlength= ${ ifDefined ( this . _maxChars ) }
66- @input = ${ this . onChange } > </ uui- input> ` ;
76+ @input = ${ this . onChange }
77+ ?readonly = ${ this . readonly } > </ uui- input> ` ;
6778 }
6879
6980 static styles = [
You can’t perform that action at this time.
0 commit comments