11import { html , customElement , property , ifDefined } from '@umbraco-cms/backoffice/external/lit' ;
22import { UmbLitElement } from "@umbraco-cms/backoffice/lit-element" ;
3- import { type InputType , type UUIFormLayoutItemElement , type UUILabelElement } from "@umbraco-cms/backoffice/external/uui" ;
3+ import type { InputType , UUIFormLayoutItemElement } from "@umbraco-cms/backoffice/external/uui" ;
44import { umbExtensionsRegistry } from "@umbraco-cms/backoffice/extension-registry" ;
55
66import { UMB_AUTH_CONTEXT , UmbAuthContext } from "./contexts" ;
7- import type { UmbLoginInputElement } from "./components" ;
87import { UmbSlimBackofficeController } from "./controllers" ;
98
109// We import the authStyles here so that we can inline it in the shadow DOM that is created outside of the UmbAuthElement.
@@ -18,36 +17,33 @@ const createInput = (opts: {
1817 type : InputType ;
1918 name : string ;
2019 autocomplete : AutoFill ;
21- requiredMessage : string ;
2220 label : string ;
2321 inputmode : string ;
2422} ) => {
25- const input = document . createElement ( 'umb-login- input' ) ;
23+ const input = document . createElement ( 'input' ) ;
2624 input . type = opts . type ;
2725 input . name = opts . name ;
2826 input . autocomplete = opts . autocomplete ;
2927 input . id = opts . id ;
3028 input . required = true ;
31- input . requiredMessage = opts . requiredMessage ;
32- input . label = opts . label ;
33- input . spellcheck = false ;
3429 input . inputMode = opts . inputmode ;
30+ input . ariaLabel = opts . label ;
3531
3632 return input ;
3733} ;
3834
3935const createLabel = ( opts : { forId : string ; localizeAlias : string ; localizeFallback : string ; } ) => {
40- const label = document . createElement ( 'uui- label' ) ;
36+ const label = document . createElement ( 'label' ) ;
4137 const umbLocalize = document . createElement ( 'umb-localize' ) ;
4238 umbLocalize . key = opts . localizeAlias ;
4339 umbLocalize . innerHTML = opts . localizeFallback ;
44- label . for = opts . forId ;
40+ label . htmlFor = opts . forId ;
4541 label . appendChild ( umbLocalize ) ;
4642
4743 return label ;
4844} ;
4945
50- const createFormLayoutItem = ( label : UUILabelElement , input : UmbLoginInputElement ) => {
46+ const createFormLayoutItem = ( label : HTMLLabelElement , input : HTMLInputElement ) => {
5147 const formLayoutItem = document . createElement ( 'uui-form-layout-item' ) as UUIFormLayoutItemElement ;
5248 formLayoutItem . appendChild ( label ) ;
5349 formLayoutItem . appendChild ( input ) ;
@@ -61,7 +57,7 @@ const createForm = (elements: HTMLElement[]) => {
6157 const form = document . createElement ( 'form' ) ;
6258 form . id = 'umb-login-form' ;
6359 form . name = 'login-form' ;
64- form . noValidate = true ;
60+ form . spellcheck = false ;
6561
6662 elements . push ( styles ) ;
6763 elements . forEach ( ( element ) => form . appendChild ( element ) ) ;
@@ -113,10 +109,10 @@ export default class UmbAuthElement extends UmbLitElement {
113109 _form ?: HTMLFormElement ;
114110 _usernameLayoutItem ?: UUIFormLayoutItemElement ;
115111 _passwordLayoutItem ?: UUIFormLayoutItemElement ;
116- _usernameInput ?: UmbLoginInputElement ;
117- _passwordInput ?: UmbLoginInputElement ;
118- _usernameLabel ?: UUILabelElement ;
119- _passwordLabel ?: UUILabelElement ;
112+ _usernameInput ?: HTMLInputElement ;
113+ _passwordInput ?: HTMLInputElement ;
114+ _usernameLabel ?: HTMLLabelElement ;
115+ _passwordLabel ?: HTMLLabelElement ;
120116
121117 #authContext = new UmbAuthContext ( this , UMB_AUTH_CONTEXT ) ;
122118
@@ -174,7 +170,6 @@ export default class UmbAuthElement extends UmbLitElement {
174170 type : 'text' ,
175171 name : 'username' ,
176172 autocomplete : 'username' ,
177- requiredMessage,
178173 label : labelUsername ,
179174 inputmode : this . usernameIsEmail ? 'email' : '' ,
180175 } ) ;
@@ -183,7 +178,6 @@ export default class UmbAuthElement extends UmbLitElement {
183178 type : 'password' ,
184179 name : 'password' ,
185180 autocomplete : 'current-password' ,
186- requiredMessage,
187181 label : labelPassword ,
188182 inputmode : '' ,
189183 } ) ;
0 commit comments