fix(core): update

This commit is contained in:
Philipp Kunz 2023-08-19 18:56:32 +02:00
parent 621262fde7
commit 9d952afebb
4 changed files with 21 additions and 6 deletions

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@design.estate/dees-catalog',
version: '1.0.174',
version: '1.0.175',
description: 'website for lossless.com'
}

View File

@ -21,6 +21,7 @@ export class DeesFormSubmit extends DeesElement {
@property({
type: Boolean,
reflect: true,
})
public disabled = false;

View File

@ -45,6 +45,7 @@ export class DeesForm extends DeesElement {
public name: string = 'myform';
public changeSubject = new domtools.rxjs.Subject();
public readyDeferred = domtools.plugins.smartpromise.defer();
public render(): TemplateResult {
return html`
@ -70,6 +71,7 @@ export class DeesForm extends DeesElement {
});
}
await this.addBehaviours();
this.readyDeferred.resolve();
}
public getFormElements(): Array<TFormInputElement> {

View File

@ -11,8 +11,6 @@ import {
state,
} from '@design.estate/dees-element';
import * as domtools from '@design.estate/dees-domtools';
declare global {
interface HTMLElementTagNameMap {
'dees-simple-login': DeesSimpleLogin;
@ -34,6 +32,7 @@ export class DeesSimpleLogin extends DeesElement {
css`
:host {
color: ${cssManager.bdTheme('#333', '#fff')};
user-select: none;
}
.loginContainer {
display: flex;
@ -62,13 +61,26 @@ export class DeesSimpleLogin extends DeesElement {
<div class="login">
<dees-form>
<div class="header">Login to ${this.title}</div>
<dees-input-text label="username"></dees-input-text>
<dees-input-text label="password" isPasswordBool></dees-input-text>
<dees-form-submit>login</dees-form-submit>
<dees-input-text label="username" required></dees-input-text>
<dees-input-text label="password" isPasswordBool required></dees-input-text>
<dees-form-submit disabled>login</dees-form-submit>
</dees-form>
</div>
</div>
<slot></slot>
`;
}
public async firstUpdated(_changedProperties): Promise<void> {
const domtools = await this.domtoolsPromise;
super.firstUpdated(_changedProperties);
const form = this.shadowRoot.querySelector('dees-form');
await form.readyDeferred.promise;
const username = this.shadowRoot.querySelector('dees-input-text[label="username"]');
const password = this.shadowRoot.querySelector('dees-input-text[label="password"]');
const submit = this.shadowRoot.querySelector('dees-form-submit');
form.addEventListener('formData', (event: CustomEvent) => {
this.dispatchEvent(new CustomEvent('login', { detail: event.detail }));
});
}
}