@@ -72,6 +79,14 @@
I am a small piece of text
+
+ Tooltip with template
+
+
+
+
+
+
@@ -208,3 +223,4 @@
Save
+
diff --git a/projects/demo/src/app/simple-comp/simple.component.html b/projects/demo/src/app/simple-comp/simple.component.html
new file mode 100644
index 0000000..d28433e
--- /dev/null
+++ b/projects/demo/src/app/simple-comp/simple.component.html
@@ -0,0 +1 @@
+Hello {{text}}!
diff --git a/projects/demo/src/app/simple-comp/simple.component.scss b/projects/demo/src/app/simple-comp/simple.component.scss
new file mode 100644
index 0000000..7dcd791
--- /dev/null
+++ b/projects/demo/src/app/simple-comp/simple.component.scss
@@ -0,0 +1,3 @@
+:host {
+ background: orange;
+}
diff --git a/projects/demo/src/app/simple-comp/simple.component.ts b/projects/demo/src/app/simple-comp/simple.component.ts
new file mode 100644
index 0000000..ddb8803
--- /dev/null
+++ b/projects/demo/src/app/simple-comp/simple.component.ts
@@ -0,0 +1,17 @@
+import { Component} from "@angular/core";
+
+@Component({
+ selector: 'app-simple',
+ templateUrl: './simple.component.html',
+ styleUrls: ['./simple.component.scss'],
+})
+export default class SimpleComponent {
+ public text = 'world';
+
+ ngOnInit(): void {
+ setTimeout(() => {
+ console.log('update plz');
+ this.text = 'hello again!';
+ }, 1000);
+ }
+}
diff --git a/projects/klippa/ngx-enhancy-forms/package.json b/projects/klippa/ngx-enhancy-forms/package.json
index 916f46d..cf2712f 100644
--- a/projects/klippa/ngx-enhancy-forms/package.json
+++ b/projects/klippa/ngx-enhancy-forms/package.json
@@ -1,6 +1,6 @@
{
"name": "@klippa/ngx-enhancy-forms",
- "version": "16.21.0",
+ "version": "16.22.12",
"publishConfig": {
"access": "public"
},
diff --git a/projects/klippa/ngx-enhancy-forms/src/lib/elements/text-input/text-input.component.html b/projects/klippa/ngx-enhancy-forms/src/lib/elements/text-input/text-input.component.html
index 33d1eee..2cc9bfd 100644
--- a/projects/klippa/ngx-enhancy-forms/src/lib/elements/text-input/text-input.component.html
+++ b/projects/klippa/ngx-enhancy-forms/src/lib/elements/text-input/text-input.component.html
@@ -3,7 +3,7 @@
0, hasClearButton: clearable, noBorderLeft: !hasBorderLeft, noBorderRight: !hasBorderRight}"
(input)="setInnerValueAndNotify($event.target.value)"
@@ -15,5 +15,8 @@
0" (click)="resetToNull()">×
+
diff --git a/projects/klippa/ngx-enhancy-forms/src/lib/elements/text-input/text-input.component.scss b/projects/klippa/ngx-enhancy-forms/src/lib/elements/text-input/text-input.component.scss
index fc74339..0364d26 100644
--- a/projects/klippa/ngx-enhancy-forms/src/lib/elements/text-input/text-input.component.scss
+++ b/projects/klippa/ngx-enhancy-forms/src/lib/elements/text-input/text-input.component.scss
@@ -56,6 +56,13 @@ input {
}
}
+.peakBtn {
+ border: none;
+ background: transparent;
+ height: 100%;
+ padding: 0;
+}
+
.showErrors {
border-color: $default-warning;
}
diff --git a/projects/klippa/ngx-enhancy-forms/src/lib/elements/text-input/text-input.component.ts b/projects/klippa/ngx-enhancy-forms/src/lib/elements/text-input/text-input.component.ts
index 2064cb6..77c76d9 100644
--- a/projects/klippa/ngx-enhancy-forms/src/lib/elements/text-input/text-input.component.ts
+++ b/projects/klippa/ngx-enhancy-forms/src/lib/elements/text-input/text-input.component.ts
@@ -1,4 +1,4 @@
-import {Component, EventEmitter, Input, Output} from '@angular/core';
+import {Component, EventEmitter, Input, Output, TemplateRef} from '@angular/core';
import {NG_VALUE_ACCESSOR} from '@angular/forms';
import {ValueAccessorBase} from '../value-accessor-base/value-accessor-base.component';
@@ -9,11 +9,25 @@ import {ValueAccessorBase} from '../value-accessor-base/value-accessor-base.comp
providers: [{provide: NG_VALUE_ACCESSOR, useExisting: TextInputComponent, multi: true}],
})
export class TextInputComponent extends ValueAccessorBase
{
+ private isPeekingPassword = false;
+
@Input() placeholder: string;
@Input() type: 'text' | 'password' = 'text';
@Input() clearable = false;
@Input() icon: 'search';
@Input() hasBorderLeft = true;
@Input() hasBorderRight = true;
+ @Input() passwordPeekIcon: TemplateRef;
@Output() onBlur = new EventEmitter();
+
+ public togglePeakPassword(): void {
+ this.isPeekingPassword = !this.isPeekingPassword;
+ }
+
+ public getType(): 'text' | 'password' {
+ if (this.type === 'text') {
+ return 'text';
+ }
+ return this.isPeekingPassword ? 'text' : 'password';
+ }
}
diff --git a/projects/klippa/ngx-enhancy-forms/src/lib/elements/toggle/toggle.component.html b/projects/klippa/ngx-enhancy-forms/src/lib/elements/toggle/toggle.component.html
index 0e4a5f8..8432128 100644
--- a/projects/klippa/ngx-enhancy-forms/src/lib/elements/toggle/toggle.component.html
+++ b/projects/klippa/ngx-enhancy-forms/src/lib/elements/toggle/toggle.component.html
@@ -6,5 +6,5 @@
[ngClass]="{showErrors: isInErrorState()}"
#nativeInputRef
/>
-
+
diff --git a/projects/klippa/ngx-enhancy-forms/src/lib/elements/toggle/toggle.component.scss b/projects/klippa/ngx-enhancy-forms/src/lib/elements/toggle/toggle.component.scss
index 7a087f8..879f7e8 100644
--- a/projects/klippa/ngx-enhancy-forms/src/lib/elements/toggle/toggle.component.scss
+++ b/projects/klippa/ngx-enhancy-forms/src/lib/elements/toggle/toggle.component.scss
@@ -31,6 +31,11 @@ $height: 20px;
height: $height;
border: 1px solid $border-color;
border-radius: $width;
+ background: #EAECF0;
+
+ &.transparentBackground {
+ background: transparent;
+ }
&:before {
content: '';
diff --git a/projects/klippa/ngx-enhancy-forms/src/lib/elements/toggle/toggle.component.ts b/projects/klippa/ngx-enhancy-forms/src/lib/elements/toggle/toggle.component.ts
index ea3df86..bc40045 100644
--- a/projects/klippa/ngx-enhancy-forms/src/lib/elements/toggle/toggle.component.ts
+++ b/projects/klippa/ngx-enhancy-forms/src/lib/elements/toggle/toggle.component.ts
@@ -9,4 +9,5 @@ import {ValueAccessorBase} from '../value-accessor-base/value-accessor-base.comp
providers: [{provide: NG_VALUE_ACCESSOR, useExisting: ToggleComponent, multi: true}],
})
export class ToggleComponent extends ValueAccessorBase