Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
66644364b5 | |||
51febdae06 | |||
745ff299dc | |||
3606d60ba6 | |||
8970a79141 | |||
566a7ce148 | |||
362bef15e3 | |||
446c494863 | |||
dbe2f2f217 | |||
02ca92a431 | |||
a9015e787c | |||
9cd28fa819 | |||
7b3793e943 | |||
a22c04d98d |
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@design.estate/dees-catalog",
|
"name": "@design.estate/dees-catalog",
|
||||||
"version": "1.0.176",
|
"version": "1.0.183",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "website for lossless.com",
|
"description": "website for lossless.com",
|
||||||
"main": "dist_ts_web/index.js",
|
"main": "dist_ts_web/index.js",
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@design.estate/dees-catalog',
|
name: '@design.estate/dees-catalog',
|
||||||
version: '1.0.176',
|
version: '1.0.183',
|
||||||
description: 'website for lossless.com'
|
description: 'website for lossless.com'
|
||||||
}
|
}
|
||||||
|
@ -104,6 +104,9 @@ export class DeesForm extends DeesElement {
|
|||||||
const children = this.getFormElements();
|
const children = this.getFormElements();
|
||||||
const valueObject: { [key: string]: string | number | boolean } = {};
|
const valueObject: { [key: string]: string | number | boolean } = {};
|
||||||
for (const child of children) {
|
for (const child of children) {
|
||||||
|
if (!child.key) {
|
||||||
|
console.log(`form element with label "${child.label}" has no key. skipping.`);
|
||||||
|
}
|
||||||
valueObject[child.key] = child.value;
|
valueObject[child.key] = child.value;
|
||||||
}
|
}
|
||||||
return valueObject;
|
return valueObject;
|
||||||
@ -163,6 +166,19 @@ export class DeesForm extends DeesElement {
|
|||||||
submitButton.text = textStateArg;
|
submitButton.text = textStateArg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* resets the form
|
||||||
|
*/
|
||||||
|
reset() {
|
||||||
|
const inputChildren = this.getFormElements();
|
||||||
|
const submitButton = this.getSubmitButton();
|
||||||
|
|
||||||
|
for (const inputChild of inputChildren) {
|
||||||
|
inputChild.value = null;
|
||||||
|
}
|
||||||
|
this.setStatus('normal', 'Submit');
|
||||||
|
}
|
||||||
|
|
||||||
public async addBehaviours() {
|
public async addBehaviours() {
|
||||||
// Use event delegation
|
// Use event delegation
|
||||||
this.addEventListener('keydown', (event: KeyboardEvent) => {
|
this.addEventListener('keydown', (event: KeyboardEvent) => {
|
||||||
|
@ -26,6 +26,7 @@ export class DeesInputCheckbox extends DeesElement {
|
|||||||
|
|
||||||
@property({
|
@property({
|
||||||
type: String,
|
type: String,
|
||||||
|
reflect: true,
|
||||||
})
|
})
|
||||||
public key: string;
|
public key: string;
|
||||||
|
|
||||||
|
@ -22,7 +22,10 @@ export class DeesInputDropdown extends DeesElement {
|
|||||||
// INSTANCE
|
// INSTANCE
|
||||||
public changeSubject = new domtools.rxjs.Subject();
|
public changeSubject = new domtools.rxjs.Subject();
|
||||||
|
|
||||||
@property()
|
@property({
|
||||||
|
type: String,
|
||||||
|
reflect: true,
|
||||||
|
})
|
||||||
public label: string = 'Label';
|
public label: string = 'Label';
|
||||||
|
|
||||||
@property()
|
@property()
|
||||||
|
@ -32,6 +32,7 @@ export class DeesInputFileupload extends DeesElement {
|
|||||||
|
|
||||||
@property({
|
@property({
|
||||||
type: String,
|
type: String,
|
||||||
|
reflect: true,
|
||||||
})
|
})
|
||||||
public key: string;
|
public key: string;
|
||||||
|
|
||||||
|
@ -15,6 +15,12 @@ export class DeesInputQuantitySelector extends DeesElement {
|
|||||||
public changeSubject = new domtools.rxjs.Subject();
|
public changeSubject = new domtools.rxjs.Subject();
|
||||||
|
|
||||||
@property()
|
@property()
|
||||||
|
public label: string = 'Label';
|
||||||
|
|
||||||
|
@property({
|
||||||
|
type: String,
|
||||||
|
reflect: true,
|
||||||
|
})
|
||||||
public key: string;
|
public key: string;
|
||||||
|
|
||||||
@property({
|
@property({
|
||||||
|
@ -14,7 +14,10 @@ export class DeesInputRadio extends DeesElement {
|
|||||||
// INSTANCE
|
// INSTANCE
|
||||||
public changeSubject = new domtools.rxjs.Subject();
|
public changeSubject = new domtools.rxjs.Subject();
|
||||||
|
|
||||||
@property()
|
@property({
|
||||||
|
type: String,
|
||||||
|
reflect: true,
|
||||||
|
})
|
||||||
public key: string;
|
public key: string;
|
||||||
|
|
||||||
@property()
|
@property()
|
||||||
|
@ -24,7 +24,8 @@ export class DeesInputText extends DeesElement {
|
|||||||
public label: string;
|
public label: string;
|
||||||
|
|
||||||
@property({
|
@property({
|
||||||
type: String
|
type: String,
|
||||||
|
reflect: true,
|
||||||
})
|
})
|
||||||
public key: string;
|
public key: string;
|
||||||
|
|
||||||
@ -128,7 +129,7 @@ export class DeesInputText extends DeesElement {
|
|||||||
</style>
|
</style>
|
||||||
<div class="maincontainer">
|
<div class="maincontainer">
|
||||||
${this.label ? html`<div class="label">${this.label}</div>` : html``}
|
${this.label ? html`<div class="label">${this.label}</div>` : html``}
|
||||||
<input type="${this.isPasswordBool && !this.showPasswordBool ? 'password' : 'text'}" value=${this.value} @input="${this.updateValue}" .disabled=${this.disabled} />
|
<input type="${this.isPasswordBool && !this.showPasswordBool ? 'password' : 'text'}" .value=${this.value} @input="${this.updateValue}" .disabled=${this.disabled} />
|
||||||
${this.isPasswordBool ? html`
|
${this.isPasswordBool ? html`
|
||||||
<div class="showPassword" @click=${this.togglePasswordView}>
|
<div class="showPassword" @click=${this.togglePasswordView}>
|
||||||
<dees-icon .iconFA=${this.showPasswordBool ? 'eye' : 'eyeSlash'}></dees-icon>
|
<dees-icon .iconFA=${this.showPasswordBool ? 'eye' : 'eyeSlash'}></dees-icon>
|
||||||
|
@ -20,8 +20,11 @@ declare global {
|
|||||||
@customElement('dees-simple-login')
|
@customElement('dees-simple-login')
|
||||||
export class DeesSimpleLogin extends DeesElement {
|
export class DeesSimpleLogin extends DeesElement {
|
||||||
// STATIC
|
// STATIC
|
||||||
public static demo = () => html` <dees-simple-login></dees-simple-login> `;
|
public static demo = () => html`
|
||||||
|
<dees-simple-login>
|
||||||
|
Hello there
|
||||||
|
</dees-simple-login>
|
||||||
|
`;
|
||||||
// INSTANCE
|
// INSTANCE
|
||||||
|
|
||||||
@property()
|
@property()
|
||||||
@ -35,9 +38,11 @@ export class DeesSimpleLogin extends DeesElement {
|
|||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
.loginContainer {
|
.loginContainer {
|
||||||
|
position: absolute;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center; /* aligns horizontally */
|
justify-content: center; /* aligns horizontally */
|
||||||
align-items: center; /* aligns vertically */
|
align-items: center; /* aligns vertically */
|
||||||
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
.login {
|
.login {
|
||||||
@ -47,11 +52,17 @@ export class DeesSimpleLogin extends DeesElement {
|
|||||||
box-shadow: ${cssManager.bdTheme('0px 1px 4px rgba(0,0,0,0.3)', 'none')};
|
box-shadow: ${cssManager.bdTheme('0px 1px 4px rgba(0,0,0,0.3)', 'none')};
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
padding: 24px;
|
padding: 24px;
|
||||||
|
transition: opacity 0.3s, transform 0.3s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header {
|
.header {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
.slotContainer {
|
||||||
|
opacity:0;
|
||||||
|
transition: opacity 0.3s, transform 0.3s;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
`,
|
`,
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -61,13 +72,15 @@ export class DeesSimpleLogin extends DeesElement {
|
|||||||
<div class="login">
|
<div class="login">
|
||||||
<dees-form>
|
<dees-form>
|
||||||
<div class="header">Login to ${this.title}</div>
|
<div class="header">Login to ${this.title}</div>
|
||||||
<dees-input-text label="username" required></dees-input-text>
|
<dees-input-text key="username" label="username" required></dees-input-text>
|
||||||
<dees-input-text label="password" isPasswordBool required></dees-input-text>
|
<dees-input-text key="password" label="password" isPasswordBool required></dees-input-text>
|
||||||
<dees-form-submit disabled>login</dees-form-submit>
|
<dees-form-submit disabled>login</dees-form-submit>
|
||||||
</dees-form>
|
</dees-form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<slot></slot>
|
<div class="slotContainer">
|
||||||
|
<slot></slot>
|
||||||
|
</div>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,6 +94,29 @@ export class DeesSimpleLogin extends DeesElement {
|
|||||||
const submit = this.shadowRoot.querySelector('dees-form-submit');
|
const submit = this.shadowRoot.querySelector('dees-form-submit');
|
||||||
form.addEventListener('formData', (event: CustomEvent) => {
|
form.addEventListener('formData', (event: CustomEvent) => {
|
||||||
this.dispatchEvent(new CustomEvent('login', { detail: event.detail }));
|
this.dispatchEvent(new CustomEvent('login', { detail: event.detail }));
|
||||||
|
// this.switchToSlottedContent();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* allows switching to slotted content
|
||||||
|
*/
|
||||||
|
public async switchToSlottedContent() {
|
||||||
|
const domtools = await this.domtoolsPromise;
|
||||||
|
const loginDiv: HTMLDivElement = this.shadowRoot.querySelector('.login');
|
||||||
|
const loginContainerDiv: HTMLDivElement = this.shadowRoot.querySelector('.loginContainer');
|
||||||
|
const slotContainerDiv: HTMLDivElement = this.shadowRoot.querySelector('.slotContainer');
|
||||||
|
loginDiv.style.opacity = '0';
|
||||||
|
loginDiv.style.transform = 'translateY(20px)';
|
||||||
|
loginContainerDiv.style.pointerEvents = 'none';
|
||||||
|
slotContainerDiv.style.transform = 'translateY(20px)';
|
||||||
|
await domtools.convenience.smartdelay.delayFor(300);
|
||||||
|
slotContainerDiv.style.opacity = '1';
|
||||||
|
slotContainerDiv.style.transform = 'translateY(0px)';
|
||||||
|
await domtools.convenience.smartdelay.delayFor(300);
|
||||||
|
slotContainerDiv.style.pointerEvents = 'all';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user