fix(core): update

This commit is contained in:
Philipp Kunz 2023-01-16 11:51:21 +01:00
parent 1b8577d300
commit fe15ebe82d
3 changed files with 53 additions and 6 deletions

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@designestate/dees-catalog',
version: '1.0.145',
version: '1.0.146',
description: 'website for lossless.com'
}

View File

@ -43,6 +43,8 @@ import {
faCircleXmark as faCircleXmarkSolid,
faCopy as faCopySolid,
faDesktop as faDesktopSolid,
faEye as faEyeSolid,
faEyeSlash as faEyeSlashSolid,
faGrip as faGripSolid,
faMessage as faMessageSolid,
faMinus as faMinusSolid,
@ -82,6 +84,10 @@ export const faIcons = {
copySolid: faCopySolid,
desktop: faDesktopSolid,
desktopSolid: faDesktopSolid,
eye: faEyeSolid,
eyeSolid: faEyeSolid,
eyeSlash: faEyeSlashSolid,
eyeSlashSolid: faEyeSlashSolid,
grip: faGripSolid,
gripSolid: faGripSolid,
message: faMessageRegular,
@ -181,7 +187,7 @@ export class DeesIcon extends DeesElement {
`;
}
public async firstUpdated() {
public async updated() {
if (!this.iconSize) {
this.iconSize = parseInt(globalThis.getComputedStyle(this).fontSize.replace(/\D/g,''));
}

View File

@ -9,7 +9,10 @@ declare global {
@customElement('dees-input-text')
export class DeesInputText extends DeesElement {
public static demo = () => html`<dees-input-text></dees-input-text>`;
public static demo = () => html`
<dees-input-text .label=${'this is a label'}></dees-input-text>
<dees-input-text .isPasswordBool=${true}></dees-input-text>
`;
// INSTANCE
public changeSubject = new domtools.rxjs.Subject();
@ -17,7 +20,7 @@ export class DeesInputText extends DeesElement {
@property({
type: String
})
public label: string = 'Label';
public label: string;
@property({
type: String
@ -39,6 +42,18 @@ export class DeesInputText extends DeesElement {
})
public disabled: boolean = false;
@property({
type: Boolean,
reflect: true,
})
public isPasswordBool = false;
@property({
type: Boolean,
reflect: true,
})
public showPasswordBool = false;
public render(): TemplateResult {
return html `
<style>
@ -92,10 +107,30 @@ export class DeesInputText extends DeesElement {
outline: none;
border-bottom: 1px solid #e4002b;
}
.showPassword {
position: absolute;
bottom: 8px;
right: 10px;
border: 1px dashed #444;
border-radius: 7px;
padding: 8px 0px;
width: 40px;
}
.showPassword:hover {
cursor: pointer;
background: #333;
}
</style>
<div class="maincontainer">
<div class="label">${this.label}</div>
<input type="text" value=${this.value} @input="${this.updateValue}" .disabled=${this.disabled} />
${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} />
${this.isPasswordBool ? html`
<div class="showPassword" @click=${this.togglePasswordView}>
<dees-icon .iconFA=${this.showPasswordBool ? 'eye' : 'eyeSlash'}></dees-icon>
</div>
` : html``}
</div>
`;
}
@ -113,4 +148,10 @@ export class DeesInputText extends DeesElement {
public async unfreeze() {
this.disabled = false;
}
public async togglePasswordView () {
const domtools = await this.domtoolsPromise;
this.showPasswordBool = !this.showPasswordBool;
console.log(`this.showPasswordBool is: ${this.showPasswordBool}`)
}
}