diff --git a/src/components/input-field/InputFieldElement.ts b/src/components/input-field/InputFieldElement.ts index 29ccb62..3da6361 100644 --- a/src/components/input-field/InputFieldElement.ts +++ b/src/components/input-field/InputFieldElement.ts @@ -131,7 +131,10 @@ class InputFieldElement extends BaseComponentElement { />`; }; - return html`
+ return html`
${renderMessage(this.label)}${renderError(this.error)} ${renderInput(this.type)}
`; }; diff --git a/src/components/menu-item/MenuItemElement.ts b/src/components/menu-item/MenuItemElement.ts index 0abf9bb..1b1718a 100644 --- a/src/components/menu-item/MenuItemElement.ts +++ b/src/components/menu-item/MenuItemElement.ts @@ -3,7 +3,7 @@ import { html, TemplateResult } from 'core/utils'; import { AppMainElement } from 'components/app-main/AppMainElement'; import { BaseComponentElement } from 'common/'; import { deviceWidths } from 'core/constants'; -import { MenuLayoutElement } from 'layouts'; +import { MenuLayoutElement } from 'layouts/'; @controller class MenuItemElement extends BaseComponentElement { diff --git a/src/pages/login-page/LoginPageElement.ts b/src/pages/login-page/LoginPageElement.ts index 5d75bf6..7835d72 100644 --- a/src/pages/login-page/LoginPageElement.ts +++ b/src/pages/login-page/LoginPageElement.ts @@ -41,7 +41,11 @@ class LoginPageElement extends BasePageElement { const formObject: any = {}; this.inputs.forEach((input: InputFieldElement) => { const inputType = input.inp; - formObject[input.name] = (inputType as HTMLInputElement).value; + if (input.type === 'checkbox') { + formObject[input.name] = (inputType as HTMLInputElement).checked; + } else { + formObject[input.name] = (inputType as HTMLInputElement).value; + } }); return formObject; } @@ -93,6 +97,14 @@ class LoginPageElement extends BasePageElement { data-targets="login-page.inputs" data-rules="required" > + + `; }; diff --git a/src/styles/input-field/input-field.scss b/src/styles/input-field/input-field.scss index e5f0b84..facad00 100644 --- a/src/styles/input-field/input-field.scss +++ b/src/styles/input-field/input-field.scss @@ -1,17 +1,29 @@ input-field { - label { - cursor: pointer; - } - input { - width: 100%; - box-sizing: border-box; - margin: 0; - padding: 5px 0 !important; - border: 1px solid $gray-03; - border-radius: 2px; - } - .input-error { - color: $red-04; - margin: 3px 0; + .input-main { + label { + cursor: pointer; + } + input { + width: 100%; + box-sizing: border-box; + margin: 0; + padding: 5px 0 !important; + border: 1px solid $gray-03; + border-radius: 2px; + } + .input-error { + color: $red-04; + margin: 3px 0; + } + &--checkbox { + label { + display: inline-block; + } + input { + margin-left: 12px !important; + display: inline-block !important; + width: auto !important; + } + } } }