add readonly property to input

This commit is contained in:
Mads Rasmussen
2024-08-19 21:16:03 +02:00
parent 7342772dee
commit 1288034d3f

View File

@@ -17,6 +17,15 @@ export class UmbInputDateElement extends UUIFormControlMixin(UmbLitElement, '')
return undefined;
}
/**
* Sets the input to readonly mode, meaning value cannot be changed but still able to read and select its content.
* @type {boolean}
* @attr
* @default false
*/
@property({ type: Boolean, reflect: true })
readonly: boolean = false;
/**
* Specifies the type of input that will be rendered.
* @type {'date'| 'time'| 'datetime-local'}
@@ -49,7 +58,8 @@ export class UmbInputDateElement extends UUIFormControlMixin(UmbLitElement, '')
.step=${this.step}
.type=${this.type}
value=${ifDefined(this.value)}
@change=${this.#onChange}>
@change=${this.#onChange}
?readonly=${this.readonly}>
</uui-input>`;
}
}