input mode for property editor text box

This commit is contained in:
Lone Iversen
2023-10-02 12:17:20 +02:00
committed by Jacob Overgaard
parent 83fed49f66
commit 84035d75b3
2 changed files with 6 additions and 1 deletions

View File

@@ -269,7 +269,7 @@ export const data: Array<DataTypeResponseModel | FolderTreeItemResponseModel> =
propertyEditorUiAlias: 'Umb.PropertyEditorUi.Email',
values: [
{
alias: 'inputType',
alias: 'inputMode',
value: 'email',
},
],

View File

@@ -17,12 +17,16 @@ export class UmbPropertyEditorUITextBoxElement extends UmbLitElement implements
@state()
private _type: UuiInputTypeType = this.#defaultType;
@state()
private _inputMode?: string;
@state()
private _maxChars?: number;
@property({ attribute: false })
public set config(config: UmbPropertyEditorConfigCollection | undefined) {
this._type = config?.getValueByAlias<UuiInputTypeType>('inputType') ?? this.#defaultType;
this._inputMode = config?.getValueByAlias('inputMode');
this._maxChars = config?.getValueByAlias('maxChars');
}
@@ -35,6 +39,7 @@ export class UmbPropertyEditorUITextBoxElement extends UmbLitElement implements
return html`<uui-input
.value=${this.value ?? ''}
.type=${this._type}
inputMode=${ifDefined(this._inputMode)}
maxlength=${ifDefined(this._maxChars)}
@change=${this.onChange}></uui-input>`;
}