@klippa/ngx-enhancy-forms 14.16.1 → 14.16.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/elementIsTruncatedCb.component.mjs +54 -0
- package/esm2020/lib/elements/file-input/file-input.component.mjs +3 -3
- package/esm2020/lib/elements/text-input/text-input.component.mjs +3 -3
- package/esm2020/lib/elements/value-accessor-base/value-accessor-base.component.mjs +8 -1
- package/esm2020/lib/form/form-caption/form-caption.component.mjs +1 -1
- package/esm2020/lib/form/form-element/form-element.component.mjs +100 -9
- package/esm2020/lib/form/form-error/form-error.component.mjs +1 -1
- package/esm2020/lib/form/form.component.mjs +8 -2
- package/esm2020/lib/ngx-enhancy-forms.module.mjs +11 -3
- package/esm2020/lib/warning-icon/warning-icon.component.mjs +17 -0
- package/esm2020/public-api.mjs +2 -1
- package/fesm2015/klippa-ngx-enhancy-forms.mjs +270 -93
- package/fesm2015/klippa-ngx-enhancy-forms.mjs.map +1 -1
- package/fesm2020/klippa-ngx-enhancy-forms.mjs +265 -94
- package/fesm2020/klippa-ngx-enhancy-forms.mjs.map +1 -1
- package/lib/elementIsTruncatedCb.component.d.ts +13 -0
- package/lib/elements/value-accessor-base/value-accessor-base.component.d.ts +4 -1
- package/lib/form/form-caption/form-caption.component.d.ts +2 -2
- package/lib/form/form-element/form-element.component.d.ts +23 -8
- package/lib/form/form-error/form-error.component.d.ts +2 -2
- package/lib/form/form.component.d.ts +4 -2
- package/lib/ngx-enhancy-forms.module.d.ts +8 -6
- package/lib/warning-icon/warning-icon.component.d.ts +6 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Directive, Input, EventEmitter, Component, SkipSelf, Optional, Output, InjectionToken, Inject, ViewChild, Host, HostBinding, TemplateRef,
|
|
2
|
+
import { Directive, Input, EventEmitter, Component, SkipSelf, Optional, Output, InjectionToken, Inject, ViewChild, ContentChild, Host, HostBinding, TemplateRef, inject, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
5
|
import * as i2 from '@angular/forms';
|
|
@@ -90,6 +90,15 @@ function isArrayOf(arr, kind) {
|
|
|
90
90
|
return arr.reduce((acc, val) => acc && val instanceof kind, true);
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
+
function runNextRenderCycle(fn) {
|
|
94
|
+
setTimeout(fn);
|
|
95
|
+
}
|
|
96
|
+
function awaitableForNextCycle() {
|
|
97
|
+
return new Promise((resolve) => {
|
|
98
|
+
setTimeout(resolve);
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
|
|
93
102
|
function mergeArray(arrA, arrB) {
|
|
94
103
|
var _a;
|
|
95
104
|
const arr = new Array(Math.max(arrA.length, arrB.length));
|
|
@@ -152,6 +161,7 @@ class FormComponent {
|
|
|
152
161
|
this.readOnly = false;
|
|
153
162
|
this.showErrorMessages = true;
|
|
154
163
|
this.errorMessageLocation = 'belowCaption';
|
|
164
|
+
this.warnings = new Map();
|
|
155
165
|
this.onInjected = new EventEmitter();
|
|
156
166
|
// we keep track of what form controls are actually rendered. Only those count when looking at form validation
|
|
157
167
|
this.activeControls = [];
|
|
@@ -291,6 +301,9 @@ class FormComponent {
|
|
|
291
301
|
var _a;
|
|
292
302
|
return (_a = this.activeControls.find((e) => e.formControl === control)) === null || _a === void 0 ? void 0 : _a.formElement;
|
|
293
303
|
}
|
|
304
|
+
getWarningToShow(control) {
|
|
305
|
+
return this.warnings.get(control);
|
|
306
|
+
}
|
|
294
307
|
trySubmit() {
|
|
295
308
|
this.formGroup.markAllAsTouched();
|
|
296
309
|
const allControls = this.getAllFormControls();
|
|
@@ -378,7 +391,7 @@ class FormComponent {
|
|
|
378
391
|
}
|
|
379
392
|
}
|
|
380
393
|
FormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: FormComponent, deps: [{ token: FormComponent, optional: true, skipSelf: true }, { token: SubFormDirective, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
381
|
-
FormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: FormComponent, selector: "klp-form", inputs: { readOnly: "readOnly", showErrorMessages: "showErrorMessages", errorMessageLocation: "errorMessageLocation", formGroup: "formGroup", patchValueInterceptor: "patchValueInterceptor" }, outputs: { onInjected: "onInjected" }, usesOnChanges: true, ngImport: i0, template: "<form>\n\t<ng-content></ng-content>\n</form>\n\n\n", styles: [":host{display:block}:host.row{display:flex}:host form{height:inherit}\n"], dependencies: [{ kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }] });
|
|
394
|
+
FormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: FormComponent, selector: "klp-form", inputs: { readOnly: "readOnly", showErrorMessages: "showErrorMessages", errorMessageLocation: "errorMessageLocation", formGroup: "formGroup", warnings: "warnings", patchValueInterceptor: "patchValueInterceptor" }, outputs: { onInjected: "onInjected" }, usesOnChanges: true, ngImport: i0, template: "<form>\n\t<ng-content></ng-content>\n</form>\n\n\n", styles: [":host{display:block}:host.row{display:flex}:host form{height:inherit}\n"], dependencies: [{ kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }] });
|
|
382
395
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: FormComponent, decorators: [{
|
|
383
396
|
type: Component,
|
|
384
397
|
args: [{ selector: 'klp-form', template: "<form>\n\t<ng-content></ng-content>\n</form>\n\n\n", styles: [":host{display:block}:host.row{display:flex}:host form{height:inherit}\n"] }]
|
|
@@ -398,89 +411,77 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImpor
|
|
|
398
411
|
type: Input
|
|
399
412
|
}], formGroup: [{
|
|
400
413
|
type: Input
|
|
414
|
+
}], warnings: [{
|
|
415
|
+
type: Input
|
|
401
416
|
}], patchValueInterceptor: [{
|
|
402
417
|
type: Input
|
|
403
418
|
}], onInjected: [{
|
|
404
419
|
type: Output
|
|
405
420
|
}] } });
|
|
406
421
|
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
this.triangle = document.createElement('div');
|
|
436
|
-
this.triangle.style.zIndex = '1';
|
|
437
|
-
this.triangle.style.position = 'fixed';
|
|
438
|
-
this.triangle.style.left = `calc(${el.nativeElement.getBoundingClientRect().x + el.nativeElement.getBoundingClientRect().width}px - 2rem)`;
|
|
439
|
-
this.triangle.style.top = `${el.nativeElement.getBoundingClientRect().y}px`;
|
|
440
|
-
this.triangle.style.transform = `translate(-50%, calc(-100% + 0.1rem))`;
|
|
441
|
-
this.triangle.style.width = '0';
|
|
442
|
-
this.triangle.style.height = '0';
|
|
443
|
-
this.triangle.style.borderLeft = `${triangleSize} solid transparent`;
|
|
444
|
-
this.triangle.style.borderRight = `${triangleSize} solid transparent`;
|
|
445
|
-
this.triangle.style.borderTop = `${triangleSize} solid rgba(255, 128, 0, 0.1254901961)`;
|
|
446
|
-
el.nativeElement.prepend(this.triangle);
|
|
447
|
-
this.triangleWhite = document.createElement('div');
|
|
448
|
-
this.triangleWhite.style.zIndex = '3';
|
|
449
|
-
this.triangleWhite.style.position = 'fixed';
|
|
450
|
-
this.triangleWhite.style.left = `calc(${el.nativeElement.getBoundingClientRect().x + el.nativeElement.getBoundingClientRect().width}px - 2rem)`;
|
|
451
|
-
this.triangleWhite.style.top = `${el.nativeElement.getBoundingClientRect().y}px`;
|
|
452
|
-
this.triangleWhite.style.transform = `translate(-50%, calc(-100% + 0.1rem - 2px))`;
|
|
453
|
-
this.triangleWhite.style.width = '0';
|
|
454
|
-
this.triangleWhite.style.height = '0';
|
|
455
|
-
this.triangleWhite.style.borderLeft = `${triangleSize} solid transparent`;
|
|
456
|
-
this.triangleWhite.style.borderRight = `${triangleSize} solid transparent`;
|
|
457
|
-
this.triangleWhite.style.borderTop = `${triangleSize} solid white`;
|
|
458
|
-
el.nativeElement.prepend(this.triangleWhite);
|
|
459
|
-
});
|
|
460
|
-
el.nativeElement.addEventListener('mouseout', () => {
|
|
461
|
-
try {
|
|
462
|
-
el.nativeElement.removeChild(this.div);
|
|
463
|
-
}
|
|
464
|
-
catch (ex) { }
|
|
465
|
-
try {
|
|
466
|
-
el.nativeElement.removeChild(this.triangle);
|
|
422
|
+
class WarningIconComponent {
|
|
423
|
+
constructor() {
|
|
424
|
+
this.variant = 'line';
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
WarningIconComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WarningIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
428
|
+
WarningIconComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: WarningIconComponent, selector: "klp-form-warning-icon", inputs: { variant: "variant" }, ngImport: i0, template: "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" *ngIf=\"variant === 'line'\">\n\t<path d=\"M9.99976 7.49995V10.8333M9.99976 14.1666H10.0081M8.84585 3.24305L1.99178 15.0819C1.61161 15.7386 1.42153 16.0669 1.44962 16.3364C1.47412 16.5714 1.59727 16.785 1.7884 16.924C2.00753 17.0833 2.38691 17.0833 3.14569 17.0833H16.8538C17.6126 17.0833 17.992 17.0833 18.2111 16.924C18.4022 16.785 18.5254 16.5714 18.5499 16.3364C18.578 16.0669 18.3879 15.7386 18.0077 15.0819L11.1537 3.24305C10.7749 2.58875 10.5854 2.26159 10.3383 2.15172C10.1228 2.05587 9.87672 2.05587 9.66117 2.15172C9.41407 2.26159 9.22466 2.58875 8.84585 3.24305Z\" stroke=\"#ff8000\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>\n<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" *ngIf=\"variant === 'fill'\">\n\t<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M10.6771 1.39035C10.246 1.19866 9.75387 1.19866 9.32277 1.39035C8.98983 1.53839 8.77355 1.79916 8.62305 2.01164C8.47508 2.22055 8.31666 2.49423 8.14243 2.79523L1.25313 14.6949C1.07821 14.997 0.919248 15.2715 0.811464 15.5045C0.701923 15.7413 0.583086 16.0596 0.62096 16.4229C0.669969 16.8929 0.916253 17.3201 1.29852 17.598C1.59393 17.8128 1.92892 17.8695 2.18872 17.8933C2.44435 17.9167 2.76156 17.9167 3.11063 17.9167H16.8892C17.2383 17.9167 17.5555 17.9167 17.8111 17.8933C18.0709 17.8695 18.4059 17.8128 18.7014 17.598C19.0836 17.3201 19.3299 16.8929 19.3789 16.4229C19.4168 16.0596 19.2979 15.7413 19.1884 15.5045C19.0806 15.2715 18.9217 14.997 18.7468 14.695L11.8574 2.7952C11.6832 2.49422 11.5248 2.22053 11.3768 2.01164C11.2263 1.79916 11.01 1.53839 10.6771 1.39035ZM10.8333 7.50004C10.8333 7.0398 10.4602 6.66671 9.99996 6.66671C9.53972 6.66671 9.16663 7.0398 9.16663 7.50004V10.8334C9.16663 11.2936 9.53972 11.6667 9.99996 11.6667C10.4602 11.6667 10.8333 11.2936 10.8333 10.8334V7.50004ZM9.99996 13.3334C9.53972 13.3334 9.16663 13.7065 9.16663 14.1667C9.16663 14.6269 9.53972 15 9.99996 15H10.0083C10.4685 15 10.8416 14.6269 10.8416 14.1667C10.8416 13.7065 10.4685 13.3334 10.0083 13.3334H9.99996Z\" fill=\"#ff8000\"/>\n</svg>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
429
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WarningIconComponent, decorators: [{
|
|
430
|
+
type: Component,
|
|
431
|
+
args: [{ selector: 'klp-form-warning-icon', template: "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" *ngIf=\"variant === 'line'\">\n\t<path d=\"M9.99976 7.49995V10.8333M9.99976 14.1666H10.0081M8.84585 3.24305L1.99178 15.0819C1.61161 15.7386 1.42153 16.0669 1.44962 16.3364C1.47412 16.5714 1.59727 16.785 1.7884 16.924C2.00753 17.0833 2.38691 17.0833 3.14569 17.0833H16.8538C17.6126 17.0833 17.992 17.0833 18.2111 16.924C18.4022 16.785 18.5254 16.5714 18.5499 16.3364C18.578 16.0669 18.3879 15.7386 18.0077 15.0819L11.1537 3.24305C10.7749 2.58875 10.5854 2.26159 10.3383 2.15172C10.1228 2.05587 9.87672 2.05587 9.66117 2.15172C9.41407 2.26159 9.22466 2.58875 8.84585 3.24305Z\" stroke=\"#ff8000\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>\n<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" *ngIf=\"variant === 'fill'\">\n\t<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M10.6771 1.39035C10.246 1.19866 9.75387 1.19866 9.32277 1.39035C8.98983 1.53839 8.77355 1.79916 8.62305 2.01164C8.47508 2.22055 8.31666 2.49423 8.14243 2.79523L1.25313 14.6949C1.07821 14.997 0.919248 15.2715 0.811464 15.5045C0.701923 15.7413 0.583086 16.0596 0.62096 16.4229C0.669969 16.8929 0.916253 17.3201 1.29852 17.598C1.59393 17.8128 1.92892 17.8695 2.18872 17.8933C2.44435 17.9167 2.76156 17.9167 3.11063 17.9167H16.8892C17.2383 17.9167 17.5555 17.9167 17.8111 17.8933C18.0709 17.8695 18.4059 17.8128 18.7014 17.598C19.0836 17.3201 19.3299 16.8929 19.3789 16.4229C19.4168 16.0596 19.2979 15.7413 19.1884 15.5045C19.0806 15.2715 18.9217 14.997 18.7468 14.695L11.8574 2.7952C11.6832 2.49422 11.5248 2.22053 11.3768 2.01164C11.2263 1.79916 11.01 1.53839 10.6771 1.39035ZM10.8333 7.50004C10.8333 7.0398 10.4602 6.66671 9.99996 6.66671C9.53972 6.66671 9.16663 7.0398 9.16663 7.50004V10.8334C9.16663 11.2936 9.53972 11.6667 9.99996 11.6667C10.4602 11.6667 10.8333 11.2936 10.8333 10.8334V7.50004ZM9.99996 13.3334C9.53972 13.3334 9.16663 13.7065 9.16663 14.1667C9.16663 14.6269 9.53972 15 9.99996 15H10.0083C10.4685 15 10.8416 14.6269 10.8416 14.1667C10.8416 13.7065 10.4685 13.3334 10.0083 13.3334H9.99996Z\" fill=\"#ff8000\"/>\n</svg>\n", styles: [":host{display:block}\n"] }]
|
|
432
|
+
}], propDecorators: { variant: [{
|
|
433
|
+
type: Input
|
|
434
|
+
}] } });
|
|
435
|
+
|
|
436
|
+
class ElementIsTruncatedCbComponent {
|
|
437
|
+
constructor(elementRef) {
|
|
438
|
+
this.elementRef = elementRef;
|
|
439
|
+
this.elementIsTruncatedCb = (isTruncated) => { };
|
|
440
|
+
}
|
|
441
|
+
ngAfterViewInit() {
|
|
442
|
+
if (!isValueSet(this.elementIsTruncatedCb)) {
|
|
443
|
+
console.log('nope');
|
|
444
|
+
return;
|
|
445
|
+
}
|
|
446
|
+
console.log('yes');
|
|
447
|
+
this.elementRef.nativeElement.addEventListener('DOMCharacterDataModified', (event) => {
|
|
448
|
+
if (isValueSet(event.target.wholeText)) {
|
|
449
|
+
this.checkForTruncation();
|
|
467
450
|
}
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
451
|
+
}, false);
|
|
452
|
+
this.checkForTruncation();
|
|
453
|
+
}
|
|
454
|
+
ngOnDestroy() {
|
|
455
|
+
console.log('destroyed');
|
|
456
|
+
}
|
|
457
|
+
checkForTruncation() {
|
|
458
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
459
|
+
yield awaitableForNextCycle();
|
|
460
|
+
const isTruncated = this.isTruncated(this.elementRef.nativeElement);
|
|
461
|
+
if (isValueSet(isTruncated)) {
|
|
462
|
+
this.elementIsTruncatedCb(isTruncated);
|
|
471
463
|
}
|
|
472
|
-
catch (ex) { }
|
|
473
464
|
});
|
|
474
465
|
}
|
|
466
|
+
isTruncated(element) {
|
|
467
|
+
if (!(element.scrollWidth > 0)) {
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
const thisElementIsTruncated = element.scrollWidth > element.clientWidth;
|
|
471
|
+
if (!thisElementIsTruncated) {
|
|
472
|
+
return Array.from(element.children).some((child) => this.isTruncated(child));
|
|
473
|
+
}
|
|
474
|
+
return thisElementIsTruncated;
|
|
475
|
+
}
|
|
475
476
|
}
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type:
|
|
477
|
+
ElementIsTruncatedCbComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ElementIsTruncatedCbComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
478
|
+
ElementIsTruncatedCbComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.8", type: ElementIsTruncatedCbComponent, selector: "[elementIsTruncatedCb]", inputs: { elementIsTruncatedCb: "elementIsTruncatedCb" }, ngImport: i0 });
|
|
479
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ElementIsTruncatedCbComponent, decorators: [{
|
|
479
480
|
type: Directive,
|
|
480
481
|
args: [{
|
|
481
|
-
selector: '[
|
|
482
|
+
selector: '[elementIsTruncatedCb]'
|
|
482
483
|
}]
|
|
483
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: {
|
|
484
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { elementIsTruncatedCb: [{
|
|
484
485
|
type: Input
|
|
485
486
|
}] } });
|
|
486
487
|
|
|
@@ -507,6 +508,20 @@ class FormElementComponent {
|
|
|
507
508
|
this.errorMessageAsTooltip = false;
|
|
508
509
|
this.errorMessages = DEFAULT_ERROR_MESSAGES;
|
|
509
510
|
this.customErrorHandlers = [];
|
|
511
|
+
this.popupState = 'onHover';
|
|
512
|
+
this.setErrorMessageIsTruncated = (isTruncated) => {
|
|
513
|
+
this.errorFullyVisible = !isTruncated;
|
|
514
|
+
};
|
|
515
|
+
}
|
|
516
|
+
ngAfterViewInit() {
|
|
517
|
+
var _a, _b;
|
|
518
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
519
|
+
yield awaitableForNextCycle();
|
|
520
|
+
(_a = this.fieldInput) === null || _a === void 0 ? void 0 : _a.setTailTpl(this.tailTpl);
|
|
521
|
+
(_b = this.fieldInput) === null || _b === void 0 ? void 0 : _b.onTouch.asObservable().subscribe((e) => {
|
|
522
|
+
this.determinePopupState();
|
|
523
|
+
});
|
|
524
|
+
});
|
|
510
525
|
}
|
|
511
526
|
shouldShowErrorMessages() {
|
|
512
527
|
var _a;
|
|
@@ -521,6 +536,20 @@ class FormElementComponent {
|
|
|
521
536
|
this.attachedControl = formControl;
|
|
522
537
|
this.parent.registerControl(formControl, this);
|
|
523
538
|
this.input = input;
|
|
539
|
+
this.attachedControl.statusChanges.subscribe((e) => {
|
|
540
|
+
this.determinePopupState();
|
|
541
|
+
});
|
|
542
|
+
this.determinePopupState();
|
|
543
|
+
}
|
|
544
|
+
determinePopupState() {
|
|
545
|
+
if (stringIsSetAndFilled(this.getErrorToShow())) {
|
|
546
|
+
this.popupState = 'onHover';
|
|
547
|
+
return;
|
|
548
|
+
}
|
|
549
|
+
if (stringIsSetAndFilled(this.getWarningToShow())) {
|
|
550
|
+
this.popupState = 'lockedOpen';
|
|
551
|
+
return;
|
|
552
|
+
}
|
|
524
553
|
}
|
|
525
554
|
unregisterControl(formControl) {
|
|
526
555
|
this.attachedControl = null;
|
|
@@ -538,12 +567,20 @@ class FormElementComponent {
|
|
|
538
567
|
registerCaption(templateRef) {
|
|
539
568
|
this.captionRef = templateRef;
|
|
540
569
|
}
|
|
570
|
+
getWarningToShow() {
|
|
571
|
+
var _a;
|
|
572
|
+
return (_a = this.parent) === null || _a === void 0 ? void 0 : _a.getWarningToShow(this.attachedControl);
|
|
573
|
+
}
|
|
541
574
|
getErrorToShow() {
|
|
542
|
-
var _a, _b, _c;
|
|
543
|
-
|
|
544
|
-
|
|
575
|
+
var _a, _b, _c, _d;
|
|
576
|
+
const firstError = Object.keys((_b = (_a = this.attachedControl) === null || _a === void 0 ? void 0 : _a.errors) !== null && _b !== void 0 ? _b : {})[0];
|
|
577
|
+
if (((_c = this.attachedControl) === null || _c === void 0 ? void 0 : _c.touched) !== true) {
|
|
578
|
+
return null;
|
|
545
579
|
}
|
|
546
|
-
|
|
580
|
+
if (!((_d = this.attachedControl) === null || _d === void 0 ? void 0 : _d.errors)) {
|
|
581
|
+
return null;
|
|
582
|
+
}
|
|
583
|
+
return firstError;
|
|
547
584
|
}
|
|
548
585
|
getCustomErrorHandler(error) {
|
|
549
586
|
return this.customErrorHandlers.find((e) => e.error === error);
|
|
@@ -582,12 +619,59 @@ class FormElementComponent {
|
|
|
582
619
|
var _a, _b;
|
|
583
620
|
return (_b = (_a = this.parent) === null || _a === void 0 ? void 0 : _a.errorMessageLocation) !== null && _b !== void 0 ? _b : 'belowCaption';
|
|
584
621
|
}
|
|
622
|
+
shouldShowErrorTooltipOpened() {
|
|
623
|
+
return this.popupState === 'lockedOpen';
|
|
624
|
+
}
|
|
625
|
+
hasHoverableErrorTooltip() {
|
|
626
|
+
if (!this.hasRightOfCaptionError() && !this.errorMessageAsTooltip) {
|
|
627
|
+
return false;
|
|
628
|
+
}
|
|
629
|
+
if (this.popupState !== 'onHover') {
|
|
630
|
+
return false;
|
|
631
|
+
}
|
|
632
|
+
if (stringIsSetAndFilled(this.getErrorToShow())) {
|
|
633
|
+
return !this.errorFullyVisible;
|
|
634
|
+
}
|
|
635
|
+
if (stringIsSetAndFilled(this.getWarningToShow())) {
|
|
636
|
+
return true;
|
|
637
|
+
}
|
|
638
|
+
return false;
|
|
639
|
+
}
|
|
640
|
+
hasRightOfCaptionError() {
|
|
641
|
+
if (this.errorMessageAsTooltip) {
|
|
642
|
+
return false;
|
|
643
|
+
}
|
|
644
|
+
if (this.direction !== 'vertical' || this.getErrorLocation() !== 'rightOfCaption') {
|
|
645
|
+
return false;
|
|
646
|
+
}
|
|
647
|
+
return true;
|
|
648
|
+
}
|
|
649
|
+
shouldShowWarningPopup() {
|
|
650
|
+
return stringIsSetAndFilled(this.getWarningToShow());
|
|
651
|
+
}
|
|
652
|
+
closePopup() {
|
|
653
|
+
this.popupState = 'onHover';
|
|
654
|
+
}
|
|
655
|
+
togglePopup() {
|
|
656
|
+
if (!this.hasRightOfCaptionError()) {
|
|
657
|
+
return;
|
|
658
|
+
}
|
|
659
|
+
if (this.errorFullyVisible) {
|
|
660
|
+
return;
|
|
661
|
+
}
|
|
662
|
+
if (this.popupState === 'lockedOpen') {
|
|
663
|
+
this.popupState = 'onHover';
|
|
664
|
+
}
|
|
665
|
+
else {
|
|
666
|
+
this.popupState = 'lockedOpen';
|
|
667
|
+
}
|
|
668
|
+
}
|
|
585
669
|
}
|
|
586
670
|
FormElementComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: FormElementComponent, deps: [{ token: FormComponent, optional: true }, { token: FORM_ERROR_MESSAGES, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
587
|
-
FormElementComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: FormElementComponent, selector: "klp-form-element", inputs: { caption: "caption", direction: "direction", captionSpacing: "captionSpacing", spaceDistribution: "spaceDistribution", swapInputAndCaption: "swapInputAndCaption", errorMessageAsTooltip: "errorMessageAsTooltip" }, viewQueries: [{ propertyName: "internalComponentRef", first: true, predicate: ["internalComponentRef"], descendants: true }], ngImport: i0, template: "<ng-template #errorRef>\n\t<div *ngIf=\"shouldShowErrorMessages() && getErrorToShow()\" class=\"errorContainer\" [ngClass]=\"{hasCaption: caption || captionRef, 'd30-70': spaceDistribution === '30-70', 'd34-66': spaceDistribution === '34-66'}\" [klpWithTooltip]=\"!errorMessageAsTooltip && getErrorLocation() === 'rightOfCaption'\">\n\t\t<div *ngIf=\"showDefaultError('min')\">{{substituteParameters(getErrorMessage(\"min\"), {min: attachedControl.errors.min.min})}}</div>\n\t\t<div *ngIf=\"showDefaultError('max')\">{{substituteParameters(getErrorMessage(\"max\"), {max: attachedControl.errors.max.max})}}</div>\n\t\t<div *ngIf=\"showDefaultError('required')\">{{getErrorMessage(\"required\")}}</div>\n\t\t<div *ngIf=\"showDefaultError('email')\">{{getErrorMessage(\"email\")}}</div>\n\t\t<div *ngIf=\"showDefaultError('minlength')\">{{substituteParameters(getErrorMessage(\"minLength\"), {minLength: attachedControl.errors.minlength.requiredLength})}}</div>\n\t\t<div *ngIf=\"showDefaultError('maxlength')\">{{substituteParameters(getErrorMessage(\"maxLength\"), {maxLength: attachedControl.errors.maxlength.requiredLength})}}</div>\n\t\t<div *ngIf=\"showDefaultError('pattern')\">{{getErrorMessage(\"pattern\")}}</div>\n\t\t<div *ngIf=\"showDefaultError('MatchPassword')\">{{getErrorMessage(\"matchPassword\")}}</div>\n\t\t<div *ngIf=\"showDefaultError('date')\">{{getErrorMessage(\"date\")}}</div>\n\t\t<div *ngIf=\"showDefaultError('message')\">{{attachedControl.errors.message.value}}</div>\n\t\t<div [ngTemplateOutlet]=\"getCustomErrorHandler(getErrorToShow())?.templateRef\"></div>\n\t</div>\n</ng-template>\n\n<ng-container *ngIf=\"direction === 'horizontal' && !errorMessageAsTooltip\" [ngTemplateOutlet]=\"errorRef\"></ng-container>\n\n<div class=\"componentContainer\" [ngClass]=\"{hasCaption: caption || captionRef, vertical: direction === 'vertical', reverseOrder: swapInputAndCaption}\" #internalComponentRef>\n\t<div class=\"caption\" *ngIf=\"caption || captionRef\"\n\t\t[ngClass]=\"{\n\t\t\thasErrors: getErrorToShow() && attachedControl.touched,\n\t\t\tpercentageSpacing: captionSpacing === 'percentages' && spaceDistribution !== 'fixedInputWidth',\n\t\t\t'd30-70': spaceDistribution === '30-70',\n\t\t\t'd34-66': spaceDistribution === '34-66',\n\t\t\t'fixedInputWidth': spaceDistribution === 'fixedInputWidth',\n\t\t\twithErrorRightOfCaption: getErrorLocation() === 'rightOfCaption'\n\t\t}\"\n\t>\n\t\t<div *ngIf=\"captionRef\" class=\"captionRefContainer\">\n\t\t\t<ng-container [ngTemplateOutlet]=\"captionRef\"></ng-container>\n\t\t\t<div *ngIf=\"isRequired()\"> *</div>\n\t\t</div>\n\t\t<div *ngIf=\"!captionRef\" class=\"captionText\">{{caption}}<span *ngIf=\"isRequired()\"> *</span></div>\n\t\t<div class=\"rightOfCaptionError\">\n\t\t\t<ng-container *ngIf=\"direction === 'vertical' && getErrorLocation() === 'rightOfCaption' && !errorMessageAsTooltip\" [ngTemplateOutlet]=\"errorRef\"></ng-container>\n\t\t</div>\n\t</div>\n\t<ng-container *ngIf=\"direction === 'vertical' && getErrorLocation() === 'belowCaption' && !errorMessageAsTooltip\" [ngTemplateOutlet]=\"errorRef\"></ng-container>\n\t<div class=\"inputContainer\" [ngClass]=\"{\n\t\tpercentageSpacing: captionSpacing === 'percentages' && spaceDistribution !== 'fixedInputWidth',\n\t\t'd30-70': spaceDistribution === '30-70',\n\t\t'd34-66': spaceDistribution === '34-66',\n\t\t'fixedInputWidth': spaceDistribution === 'fixedInputWidth'\n\t}\">\n\t\t<ng-container *ngIf=\"errorMessageAsTooltip && shouldShowErrorMessages() && getErrorToShow()\">\n\t\t\t<div class=\"errorTooltipTriangle\"></div>\n\t\t\t<div class=\"errorTooltipTriangleWhite\"></div>\n\t\t\t<div class=\"errorTooltip\">\n\t\t\t\t<ng-container [ngTemplateOutlet]=\"errorRef\"></ng-container>\n\t\t\t</div>\n\t\t</ng-container>\n\t\t<ng-content></ng-content>\n\t</div>\n</div>\n", styles: [":host{display:block}.componentContainer{display:flex;align-items:center;min-height:42px}.componentContainer:not(.hasCaption){display:block}.componentContainer:not(.hasCaption) .inputContainer{margin-top:0}.componentContainer.reverseOrder{flex-direction:row-reverse;justify-content:flex-end}.componentContainer.vertical{display:block}.componentContainer.vertical .inputContainer{margin-top:.3125rem}.componentContainer.vertical .errorContainer{margin-left:0}.componentContainer.vertical .caption{padding-right:0}.captionRefContainer{display:flex}.caption{font-weight:700;flex:0 0 auto;padding-right:1.25rem;color:#515365}.caption.percentageSpacing{flex:40}.caption.percentageSpacing.d30-70{flex:30}.caption.percentageSpacing.d34-66{flex:34}.caption.fixedInputWidth{flex:1 1 0px;overflow:hidden}.caption.hasErrors{color:#ff8000}.caption.hasErrors.withErrorRightOfCaption .rightOfCaptionError{display:block}.caption.withErrorRightOfCaption{display:flex;justify-content:space-between;gap:1rem}.caption.withErrorRightOfCaption .captionText{flex:1 2 auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.caption.withErrorRightOfCaption .rightOfCaptionError{display:none;font-weight:400;overflow:hidden;flex:1 1 auto;text-align:right}.caption.withErrorRightOfCaption .rightOfCaptionError ::ng-deep *{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.inputContainer{position:relative;flex:1}.inputContainer .errorTooltipTriangle{z-index:1;position:absolute;display:none;right:0;transform:translate(-50%,calc(-100% + .1rem));width:0px;height:0px;border-left:12px solid transparent;border-right:12px solid transparent;border-top:12px solid rgba(255,128,0,.125)}.inputContainer .errorTooltipTriangleWhite{z-index:3;position:absolute;display:none;right:0;transform:translate(-50%,calc(-100% + .1rem - 2px));width:0px;height:0px;border-left:12px solid transparent;border-right:12px solid transparent;border-top:12px solid white}.inputContainer .errorTooltip{position:absolute;top:-.6rem;right:0;display:none;z-index:2;color:#515365;transform:translateY(-100%);max-width:20rem;white-space:break-spaces;background-color:#fff;border:1px solid rgba(255,128,0,.125);box-shadow:#ff800020 2px 3px 10px;padding:.3rem .5rem;box-sizing:border-box;border-radius:3px}.inputContainer .errorTooltip .errorContainer{margin-left:initial}.inputContainer:hover .errorTooltip,.inputContainer:hover .errorTooltipTriangle,.inputContainer:hover .errorTooltipTriangleWhite{display:block}.inputContainer.percentageSpacing{flex:60}.inputContainer.percentageSpacing.d30-70{flex:70}.inputContainer.percentageSpacing.d34-66{flex:66}.inputContainer.fixedInputWidth{flex:0 0 auto}.errorContainer{color:#ff8000}.errorContainer.hasCaption{margin-left:calc(40% + 1.25rem)}.errorContainer.hasCaption.d30-70{margin-left:calc(30% + 1.25rem)}.errorContainer.hasCaption.d34-66{margin-left:calc(34% + 1.25rem)}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: WithTooltipDirective, selector: "[klpWithTooltip]", inputs: ["klpWithTooltip"] }] });
|
|
671
|
+
FormElementComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: FormElementComponent, selector: "klp-form-element", inputs: { caption: "caption", direction: "direction", captionSpacing: "captionSpacing", spaceDistribution: "spaceDistribution", swapInputAndCaption: "swapInputAndCaption", errorMessageAsTooltip: "errorMessageAsTooltip" }, queries: [{ propertyName: "fieldInput", first: true, predicate: NG_VALUE_ACCESSOR, descendants: true }], viewQueries: [{ propertyName: "internalComponentRef", first: true, predicate: ["internalComponentRef"], descendants: true }, { propertyName: "tailTpl", first: true, predicate: ["tailTpl"], descendants: true }, { propertyName: "captionDummyForSpaceCalculation", first: true, predicate: ["captionDummyForSpaceCalculation"], descendants: true }], ngImport: i0, template: "<div\n\tclass=\"componentContainer\"\n\t[ngClass]=\"{\n\t\thasCaption: caption || captionRef,\n\t\tvertical: direction === 'vertical',\n\t\thorizontal: direction === 'horizontal',\n\t\treverseOrder: swapInputAndCaption,\n\t\thasErrors: getErrorToShow() && attachedControl.touched,\n\t\tpercentageSpacing: captionSpacing === 'percentages' && spaceDistribution !== 'fixedInputWidth',\n\t\t'd40-60': spaceDistribution === '40-60',\n\t\t'd30-70': spaceDistribution === '30-70',\n\t\t'd34-66': spaceDistribution === '34-66',\n\t\t'fixedInputWidth': spaceDistribution === 'fixedInputWidth'\n\t}\"\n>\n\t<div class=\"errorAboveInputContainer\" *ngIf=\"direction === 'horizontal' && !errorMessageAsTooltip\">\n\t\t<div class=\"spacer\"></div>\n\t\t<ng-container [ngTemplateOutlet]=\"errorRef\"></ng-container>\n\t</div>\n\n\t<div class=\"captionInputAndError\" #internalComponentRef>\n\t\t<div class=\"captionDummyForSpaceCalculation\" #captionDummyForSpaceCalculation *ngIf=\"hasRightOfCaptionError()\">\n\t\t\t<ng-container [ngTemplateOutlet]=\"captionTpl\" [ngTemplateOutletContext]=\"{forCalculation: true}\"></ng-container>\n\t\t</div>\n\t\t<ng-container [ngTemplateOutlet]=\"captionTpl\"></ng-container>\n\t\t<ng-container *ngIf=\"direction === 'vertical' && getErrorLocation() === 'belowCaption' && !errorMessageAsTooltip\" [ngTemplateOutlet]=\"errorRef\"></ng-container>\n\t\t<div class=\"inputContainer\">\n\t\t\t<ng-container *ngIf=\"errorMessageAsTooltip && shouldShowErrorMessages() && getErrorToShow()\">\n\t\t\t\t<div class=\"errorTooltipTriangle\"></div>\n\t\t\t\t<div class=\"errorTooltipTriangleWhite\"></div>\n\t\t\t\t<div class=\"errorTooltip\">\n\t\t\t\t\t<ng-container [ngTemplateOutlet]=\"errorRef\"></ng-container>\n\t\t\t\t</div>\n\t\t\t</ng-container>\n\t\t\t<ng-content></ng-content>\n\t\t</div>\n\t</div>\n</div>\n\n<ng-template #captionTpl let-forCalculation=\"forCalculation\">\n\t<div class=\"caption\"\n\t\t*ngIf=\"caption || captionRef\"\n\t\t[ngClass]=\"{\n\t\t\twithErrorRightOfCaption: getErrorLocation() === 'rightOfCaption'\n\t\t}\"\n\t>\n\t\t<div *ngIf=\"captionRef\" class=\"captionRefContainer\">\n\t\t\t<ng-container [ngTemplateOutlet]=\"captionRef\"></ng-container>\n\t\t\t<div *ngIf=\"isRequired()\"> *</div>\n\t\t</div>\n\t\t<div *ngIf=\"!captionRef\" class=\"captionText\">{{caption}}<span *ngIf=\"isRequired()\"> *</span></div>\n\t\t<div class=\"rightOfCaptionError\" *ngIf=\"hasRightOfCaptionError()\" [ngClass]=\"{errorFullyVisible: errorFullyVisible}\">\n\t\t\t<ng-container [ngTemplateOutlet]=\"errorRef\" [ngTemplateOutletContext]=\"{forCalculation: forCalculation}\"></ng-container>\n\t\t</div>\n\t</div>\n</ng-template>\n\n<ng-template #errorRef let-forCalculation=\"forCalculation\">\n\t<div *ngIf=\"shouldShowErrorMessages() && getErrorToShow()\" class=\"errorContainer\" [elementIsTruncatedCb]=\"forCalculation ? setErrorMessageIsTruncated : null\" [ngClass]=\"{horizontal: direction === 'horizontal', hasCaption: caption || captionRef, 'd30-70': spaceDistribution === '30-70', 'd34-66': spaceDistribution === '34-66'}\">\n\t\t<div *ngIf=\"showDefaultError('min')\">{{substituteParameters(getErrorMessage(\"min\"), {min: attachedControl.errors.min.min})}}</div>\n\t\t<div *ngIf=\"showDefaultError('max')\">{{substituteParameters(getErrorMessage(\"max\"), {max: attachedControl.errors.max.max})}}</div>\n\t\t<div *ngIf=\"showDefaultError('required')\">{{getErrorMessage(\"required\")}}</div>\n\t\t<div *ngIf=\"showDefaultError('email')\">{{getErrorMessage(\"email\")}}</div>\n\t\t<div *ngIf=\"showDefaultError('minlength')\">{{substituteParameters(getErrorMessage(\"minLength\"), {minLength: attachedControl.errors.minlength.requiredLength})}}</div>\n\t\t<div *ngIf=\"showDefaultError('maxlength')\">{{substituteParameters(getErrorMessage(\"maxLength\"), {maxLength: attachedControl.errors.maxlength.requiredLength})}}</div>\n\t\t<div *ngIf=\"showDefaultError('pattern')\">{{getErrorMessage(\"pattern\")}}</div>\n\t\t<div *ngIf=\"showDefaultError('MatchPassword')\">{{getErrorMessage(\"matchPassword\")}}</div>\n\t\t<div *ngIf=\"showDefaultError('date')\">{{getErrorMessage(\"date\")}}</div>\n\t\t<div *ngIf=\"showDefaultError('message')\">{{attachedControl.errors.message.value}}</div>\n\t\t<div [ngTemplateOutlet]=\"getCustomErrorHandler(getErrorToShow())?.templateRef\"></div>\n\t</div>\n</ng-template>\n\n<ng-template #tailTpl>\n\t<div class=\"errorTooltipContainer\" [ngClass]=\"{alwaysOpen: shouldShowErrorTooltipOpened()}\">\n\t\t<ng-container *ngIf=\"hasHoverableErrorTooltip() || shouldShowErrorTooltipOpened()\">\n\t\t\t<div class=\"errorTooltipTriangle\"></div>\n\t\t\t<div class=\"errorTooltipTriangleWhite\"></div>\n\t\t\t<div class=\"errorTooltip\" [ngClass]=\"{noPointerEvents: !shouldShowErrorTooltipOpened()}\">\n\t\t\t\t<i class=\"closeBtn\" (click)=\"closePopup();\">\u00D7</i>\n\t\t\t\t<ng-container *ngIf=\"getErrorToShow()\" [ngTemplateOutlet]=\"errorRef\"></ng-container>\n\t\t\t\t<div *ngIf=\"!getErrorToShow() && shouldShowWarningPopup()\">{{getWarningToShow()}}</div>\n\t\t\t</div>\n\t\t</ng-container>\n\t\t<klp-form-warning-icon variant=\"fill\" *ngIf=\"getErrorToShow()\" (click)=\"togglePopup()\"></klp-form-warning-icon>\n\t\t<klp-form-warning-icon variant=\"line\" *ngIf=\"!getErrorToShow() && getWarningToShow()\" (click)=\"togglePopup()\"></klp-form-warning-icon>\n\t</div>\n</ng-template>\n", styles: [":host{display:block}.componentContainer:not(.hasCaption) .captionInputAndError{display:block}.componentContainer:not(.hasCaption) .captionInputAndError .inputContainer{margin-top:0}.componentContainer.hasCaption .errorAboveInputContainer .spacer{display:block}.componentContainer.reverseOrder .captionInputAndError{flex-direction:row-reverse;justify-content:flex-end}.componentContainer.horizontal .captionInputAndError{gap:1rem}.componentContainer.vertical .captionInputAndError{display:block}.componentContainer.vertical .captionInputAndError .inputContainer{margin-top:.3125rem}.componentContainer.vertical .captionInputAndError .errorContainer{margin-left:0}.componentContainer.d40-60 .errorAboveInputContainer .spacer{flex:40 1 0px}.componentContainer.d40-60 .errorAboveInputContainer .errorContainer{flex:60 1 0px}.componentContainer.d40-60 .caption{flex:40 1 0px}.componentContainer.d40-60 .inputContainer{flex:60 1 0px}.componentContainer.d34-66 .errorAboveInputContainer .spacer{flex:34 1 0px}.componentContainer.d34-66 .errorAboveInputContainer .errorContainer{flex:66 1 0px}.componentContainer.d34-66 .caption{flex:34 1 0px}.componentContainer.d34-66 .inputContainer{flex:66 1 0px}.componentContainer.d30-70 .errorAboveInputContainer .spacer{flex:30 1 0px}.componentContainer.d30-70 .errorAboveInputContainer .errorContainer{flex:70 1 0px}.componentContainer.d30-70 .caption{flex:30 1 0px}.componentContainer.d30-70 .inputContainer{flex:70 1 0px}.componentContainer.fixedInputWidth .caption{flex:1 1 0px;overflow:hidden}.componentContainer.fixedInputWidth .inputContainer{flex:0 0 auto}.captionInputAndError{display:flex;align-items:center;min-height:42px}.errorAboveInputContainer{display:flex;gap:1rem}.errorAboveInputContainer .spacer{display:none}.captionDummyForSpaceCalculation .caption.withErrorRightOfCaption{height:0px;overflow:hidden}.captionDummyForSpaceCalculation .caption.withErrorRightOfCaption .rightOfCaptionError{display:block}.captionRefContainer{display:flex}.caption{font-weight:700;flex:0 0 auto;color:#515365;overflow:hidden}.caption.percentageSpacing{flex:40 1 0px}.caption.percentageSpacing.d30-70{flex:30 1 0px}.caption.percentageSpacing.d34-66{flex:34 1 0px}.caption.withErrorRightOfCaption{display:flex;justify-content:space-between;gap:1rem}.caption.withErrorRightOfCaption .captionText{flex:1 2 auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.caption.withErrorRightOfCaption .rightOfCaptionError{display:none;max-width:40%;font-weight:400;overflow:hidden;flex:1 0 auto;text-align:right}.caption.withErrorRightOfCaption .rightOfCaptionError.errorFullyVisible{display:block}.caption.withErrorRightOfCaption .rightOfCaptionError ::ng-deep *{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.inputContainer{position:relative;flex:1}.inputContainer .errorTooltipContainer{position:relative}.inputContainer .errorTooltipContainer.alwaysOpen .errorTooltipTriangle,.inputContainer .errorTooltipContainer.alwaysOpen .errorTooltipTriangleWhite,.inputContainer .errorTooltipContainer.alwaysOpen .errorTooltip,.inputContainer .errorTooltipContainer.alwaysOpen .closeBtn{display:block}.inputContainer .errorTooltipContainer.alwaysOpen .errorTooltip{padding-right:1.4rem}.inputContainer .errorTooltipContainer klp-form-warning-icon{cursor:pointer}.inputContainer .errorTooltipTriangle{display:none;z-index:1;position:absolute;right:0;transform:translate(-.15rem,calc(-100% - .1rem)) scaleX(.8);width:0px;height:0px;border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid rgba(0,0,0,.13)}.inputContainer .errorTooltipTriangleWhite{display:none;z-index:3;position:absolute;right:0;transform:translate(-.15rem,calc(-100% - .1rem - 2px)) scaleX(.8);width:0px;height:0px;border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid white}.inputContainer .errorTooltip{display:none;word-wrap:break-word;position:absolute;top:-.6rem;right:-.625rem;background:white;transform:translateY(-100%);width:12rem;white-space:break-spaces;padding:.4rem .6rem;border-radius:.4rem;border:1px solid rgba(0,0,0,.13);box-shadow:#00000021 2px 3px 10px}.inputContainer .errorTooltip.noPointerEvents{pointer-events:none}.inputContainer .errorTooltip .closeBtn{display:none;position:absolute;top:.2rem;right:.2rem;padding:.2rem .4rem;cursor:pointer;color:#666;font-size:1rem}.inputContainer .errorTooltip .closeBtn:hover{color:#515365}.inputContainer:hover .errorTooltipContainer .errorTooltip,.inputContainer:hover .errorTooltipContainer .errorTooltipTriangle,.inputContainer:hover .errorTooltipContainer .errorTooltipTriangleWhite{display:block}.errorContainer{color:#ff8000}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: WarningIconComponent, selector: "klp-form-warning-icon", inputs: ["variant"] }, { kind: "directive", type: ElementIsTruncatedCbComponent, selector: "[elementIsTruncatedCb]", inputs: ["elementIsTruncatedCb"] }] });
|
|
588
672
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: FormElementComponent, decorators: [{
|
|
589
673
|
type: Component,
|
|
590
|
-
args: [{ selector: 'klp-form-element', template: "<ng-template #errorRef>\n\t<div *ngIf=\"shouldShowErrorMessages() && getErrorToShow()\" class=\"errorContainer\" [ngClass]=\"{hasCaption: caption || captionRef, 'd30-70': spaceDistribution === '30-70', 'd34-66': spaceDistribution === '34-66'}\" [klpWithTooltip]=\"!errorMessageAsTooltip && getErrorLocation() === 'rightOfCaption'\">\n\t\t<div *ngIf=\"showDefaultError('min')\">{{substituteParameters(getErrorMessage(\"min\"), {min: attachedControl.errors.min.min})}}</div>\n\t\t<div *ngIf=\"showDefaultError('max')\">{{substituteParameters(getErrorMessage(\"max\"), {max: attachedControl.errors.max.max})}}</div>\n\t\t<div *ngIf=\"showDefaultError('required')\">{{getErrorMessage(\"required\")}}</div>\n\t\t<div *ngIf=\"showDefaultError('email')\">{{getErrorMessage(\"email\")}}</div>\n\t\t<div *ngIf=\"showDefaultError('minlength')\">{{substituteParameters(getErrorMessage(\"minLength\"), {minLength: attachedControl.errors.minlength.requiredLength})}}</div>\n\t\t<div *ngIf=\"showDefaultError('maxlength')\">{{substituteParameters(getErrorMessage(\"maxLength\"), {maxLength: attachedControl.errors.maxlength.requiredLength})}}</div>\n\t\t<div *ngIf=\"showDefaultError('pattern')\">{{getErrorMessage(\"pattern\")}}</div>\n\t\t<div *ngIf=\"showDefaultError('MatchPassword')\">{{getErrorMessage(\"matchPassword\")}}</div>\n\t\t<div *ngIf=\"showDefaultError('date')\">{{getErrorMessage(\"date\")}}</div>\n\t\t<div *ngIf=\"showDefaultError('message')\">{{attachedControl.errors.message.value}}</div>\n\t\t<div [ngTemplateOutlet]=\"getCustomErrorHandler(getErrorToShow())?.templateRef\"></div>\n\t</div>\n</ng-template>\n\n<ng-container *ngIf=\"direction === 'horizontal' && !errorMessageAsTooltip\" [ngTemplateOutlet]=\"errorRef\"></ng-container>\n\n<div class=\"componentContainer\" [ngClass]=\"{hasCaption: caption || captionRef, vertical: direction === 'vertical', reverseOrder: swapInputAndCaption}\" #internalComponentRef>\n\t<div class=\"caption\" *ngIf=\"caption || captionRef\"\n\t\t[ngClass]=\"{\n\t\t\thasErrors: getErrorToShow() && attachedControl.touched,\n\t\t\tpercentageSpacing: captionSpacing === 'percentages' && spaceDistribution !== 'fixedInputWidth',\n\t\t\t'd30-70': spaceDistribution === '30-70',\n\t\t\t'd34-66': spaceDistribution === '34-66',\n\t\t\t'fixedInputWidth': spaceDistribution === 'fixedInputWidth',\n\t\t\twithErrorRightOfCaption: getErrorLocation() === 'rightOfCaption'\n\t\t}\"\n\t>\n\t\t<div *ngIf=\"captionRef\" class=\"captionRefContainer\">\n\t\t\t<ng-container [ngTemplateOutlet]=\"captionRef\"></ng-container>\n\t\t\t<div *ngIf=\"isRequired()\"> *</div>\n\t\t</div>\n\t\t<div *ngIf=\"!captionRef\" class=\"captionText\">{{caption}}<span *ngIf=\"isRequired()\"> *</span></div>\n\t\t<div class=\"rightOfCaptionError\">\n\t\t\t<ng-container *ngIf=\"direction === 'vertical' && getErrorLocation() === 'rightOfCaption' && !errorMessageAsTooltip\" [ngTemplateOutlet]=\"errorRef\"></ng-container>\n\t\t</div>\n\t</div>\n\t<ng-container *ngIf=\"direction === 'vertical' && getErrorLocation() === 'belowCaption' && !errorMessageAsTooltip\" [ngTemplateOutlet]=\"errorRef\"></ng-container>\n\t<div class=\"inputContainer\" [ngClass]=\"{\n\t\tpercentageSpacing: captionSpacing === 'percentages' && spaceDistribution !== 'fixedInputWidth',\n\t\t'd30-70': spaceDistribution === '30-70',\n\t\t'd34-66': spaceDistribution === '34-66',\n\t\t'fixedInputWidth': spaceDistribution === 'fixedInputWidth'\n\t}\">\n\t\t<ng-container *ngIf=\"errorMessageAsTooltip && shouldShowErrorMessages() && getErrorToShow()\">\n\t\t\t<div class=\"errorTooltipTriangle\"></div>\n\t\t\t<div class=\"errorTooltipTriangleWhite\"></div>\n\t\t\t<div class=\"errorTooltip\">\n\t\t\t\t<ng-container [ngTemplateOutlet]=\"errorRef\"></ng-container>\n\t\t\t</div>\n\t\t</ng-container>\n\t\t<ng-content></ng-content>\n\t</div>\n</div>\n", styles: [":host{display:block}.componentContainer{display:flex;align-items:center;min-height:42px}.componentContainer:not(.hasCaption){display:block}.componentContainer:not(.hasCaption) .inputContainer{margin-top:0}.componentContainer.reverseOrder{flex-direction:row-reverse;justify-content:flex-end}.componentContainer.vertical{display:block}.componentContainer.vertical .inputContainer{margin-top:.3125rem}.componentContainer.vertical .errorContainer{margin-left:0}.componentContainer.vertical .caption{padding-right:0}.captionRefContainer{display:flex}.caption{font-weight:700;flex:0 0 auto;padding-right:1.25rem;color:#515365}.caption.percentageSpacing{flex:40}.caption.percentageSpacing.d30-70{flex:30}.caption.percentageSpacing.d34-66{flex:34}.caption.fixedInputWidth{flex:1 1 0px;overflow:hidden}.caption.hasErrors{color:#ff8000}.caption.hasErrors.withErrorRightOfCaption .rightOfCaptionError{display:block}.caption.withErrorRightOfCaption{display:flex;justify-content:space-between;gap:1rem}.caption.withErrorRightOfCaption .captionText{flex:1 2 auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.caption.withErrorRightOfCaption .rightOfCaptionError{display:none;font-weight:400;overflow:hidden;flex:1 1 auto;text-align:right}.caption.withErrorRightOfCaption .rightOfCaptionError ::ng-deep *{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.inputContainer{position:relative;flex:1}.inputContainer .errorTooltipTriangle{z-index:1;position:absolute;display:none;right:0;transform:translate(-50%,calc(-100% + .1rem));width:0px;height:0px;border-left:12px solid transparent;border-right:12px solid transparent;border-top:12px solid rgba(255,128,0,.125)}.inputContainer .errorTooltipTriangleWhite{z-index:3;position:absolute;display:none;right:0;transform:translate(-50%,calc(-100% + .1rem - 2px));width:0px;height:0px;border-left:12px solid transparent;border-right:12px solid transparent;border-top:12px solid white}.inputContainer .errorTooltip{position:absolute;top:-.6rem;right:0;display:none;z-index:2;color:#515365;transform:translateY(-100%);max-width:20rem;white-space:break-spaces;background-color:#fff;border:1px solid rgba(255,128,0,.125);box-shadow:#ff800020 2px 3px 10px;padding:.3rem .5rem;box-sizing:border-box;border-radius:3px}.inputContainer .errorTooltip .errorContainer{margin-left:initial}.inputContainer:hover .errorTooltip,.inputContainer:hover .errorTooltipTriangle,.inputContainer:hover .errorTooltipTriangleWhite{display:block}.inputContainer.percentageSpacing{flex:60}.inputContainer.percentageSpacing.d30-70{flex:70}.inputContainer.percentageSpacing.d34-66{flex:66}.inputContainer.fixedInputWidth{flex:0 0 auto}.errorContainer{color:#ff8000}.errorContainer.hasCaption{margin-left:calc(40% + 1.25rem)}.errorContainer.hasCaption.d30-70{margin-left:calc(30% + 1.25rem)}.errorContainer.hasCaption.d34-66{margin-left:calc(34% + 1.25rem)}\n"] }]
|
|
674
|
+
args: [{ selector: 'klp-form-element', template: "<div\n\tclass=\"componentContainer\"\n\t[ngClass]=\"{\n\t\thasCaption: caption || captionRef,\n\t\tvertical: direction === 'vertical',\n\t\thorizontal: direction === 'horizontal',\n\t\treverseOrder: swapInputAndCaption,\n\t\thasErrors: getErrorToShow() && attachedControl.touched,\n\t\tpercentageSpacing: captionSpacing === 'percentages' && spaceDistribution !== 'fixedInputWidth',\n\t\t'd40-60': spaceDistribution === '40-60',\n\t\t'd30-70': spaceDistribution === '30-70',\n\t\t'd34-66': spaceDistribution === '34-66',\n\t\t'fixedInputWidth': spaceDistribution === 'fixedInputWidth'\n\t}\"\n>\n\t<div class=\"errorAboveInputContainer\" *ngIf=\"direction === 'horizontal' && !errorMessageAsTooltip\">\n\t\t<div class=\"spacer\"></div>\n\t\t<ng-container [ngTemplateOutlet]=\"errorRef\"></ng-container>\n\t</div>\n\n\t<div class=\"captionInputAndError\" #internalComponentRef>\n\t\t<div class=\"captionDummyForSpaceCalculation\" #captionDummyForSpaceCalculation *ngIf=\"hasRightOfCaptionError()\">\n\t\t\t<ng-container [ngTemplateOutlet]=\"captionTpl\" [ngTemplateOutletContext]=\"{forCalculation: true}\"></ng-container>\n\t\t</div>\n\t\t<ng-container [ngTemplateOutlet]=\"captionTpl\"></ng-container>\n\t\t<ng-container *ngIf=\"direction === 'vertical' && getErrorLocation() === 'belowCaption' && !errorMessageAsTooltip\" [ngTemplateOutlet]=\"errorRef\"></ng-container>\n\t\t<div class=\"inputContainer\">\n\t\t\t<ng-container *ngIf=\"errorMessageAsTooltip && shouldShowErrorMessages() && getErrorToShow()\">\n\t\t\t\t<div class=\"errorTooltipTriangle\"></div>\n\t\t\t\t<div class=\"errorTooltipTriangleWhite\"></div>\n\t\t\t\t<div class=\"errorTooltip\">\n\t\t\t\t\t<ng-container [ngTemplateOutlet]=\"errorRef\"></ng-container>\n\t\t\t\t</div>\n\t\t\t</ng-container>\n\t\t\t<ng-content></ng-content>\n\t\t</div>\n\t</div>\n</div>\n\n<ng-template #captionTpl let-forCalculation=\"forCalculation\">\n\t<div class=\"caption\"\n\t\t*ngIf=\"caption || captionRef\"\n\t\t[ngClass]=\"{\n\t\t\twithErrorRightOfCaption: getErrorLocation() === 'rightOfCaption'\n\t\t}\"\n\t>\n\t\t<div *ngIf=\"captionRef\" class=\"captionRefContainer\">\n\t\t\t<ng-container [ngTemplateOutlet]=\"captionRef\"></ng-container>\n\t\t\t<div *ngIf=\"isRequired()\"> *</div>\n\t\t</div>\n\t\t<div *ngIf=\"!captionRef\" class=\"captionText\">{{caption}}<span *ngIf=\"isRequired()\"> *</span></div>\n\t\t<div class=\"rightOfCaptionError\" *ngIf=\"hasRightOfCaptionError()\" [ngClass]=\"{errorFullyVisible: errorFullyVisible}\">\n\t\t\t<ng-container [ngTemplateOutlet]=\"errorRef\" [ngTemplateOutletContext]=\"{forCalculation: forCalculation}\"></ng-container>\n\t\t</div>\n\t</div>\n</ng-template>\n\n<ng-template #errorRef let-forCalculation=\"forCalculation\">\n\t<div *ngIf=\"shouldShowErrorMessages() && getErrorToShow()\" class=\"errorContainer\" [elementIsTruncatedCb]=\"forCalculation ? setErrorMessageIsTruncated : null\" [ngClass]=\"{horizontal: direction === 'horizontal', hasCaption: caption || captionRef, 'd30-70': spaceDistribution === '30-70', 'd34-66': spaceDistribution === '34-66'}\">\n\t\t<div *ngIf=\"showDefaultError('min')\">{{substituteParameters(getErrorMessage(\"min\"), {min: attachedControl.errors.min.min})}}</div>\n\t\t<div *ngIf=\"showDefaultError('max')\">{{substituteParameters(getErrorMessage(\"max\"), {max: attachedControl.errors.max.max})}}</div>\n\t\t<div *ngIf=\"showDefaultError('required')\">{{getErrorMessage(\"required\")}}</div>\n\t\t<div *ngIf=\"showDefaultError('email')\">{{getErrorMessage(\"email\")}}</div>\n\t\t<div *ngIf=\"showDefaultError('minlength')\">{{substituteParameters(getErrorMessage(\"minLength\"), {minLength: attachedControl.errors.minlength.requiredLength})}}</div>\n\t\t<div *ngIf=\"showDefaultError('maxlength')\">{{substituteParameters(getErrorMessage(\"maxLength\"), {maxLength: attachedControl.errors.maxlength.requiredLength})}}</div>\n\t\t<div *ngIf=\"showDefaultError('pattern')\">{{getErrorMessage(\"pattern\")}}</div>\n\t\t<div *ngIf=\"showDefaultError('MatchPassword')\">{{getErrorMessage(\"matchPassword\")}}</div>\n\t\t<div *ngIf=\"showDefaultError('date')\">{{getErrorMessage(\"date\")}}</div>\n\t\t<div *ngIf=\"showDefaultError('message')\">{{attachedControl.errors.message.value}}</div>\n\t\t<div [ngTemplateOutlet]=\"getCustomErrorHandler(getErrorToShow())?.templateRef\"></div>\n\t</div>\n</ng-template>\n\n<ng-template #tailTpl>\n\t<div class=\"errorTooltipContainer\" [ngClass]=\"{alwaysOpen: shouldShowErrorTooltipOpened()}\">\n\t\t<ng-container *ngIf=\"hasHoverableErrorTooltip() || shouldShowErrorTooltipOpened()\">\n\t\t\t<div class=\"errorTooltipTriangle\"></div>\n\t\t\t<div class=\"errorTooltipTriangleWhite\"></div>\n\t\t\t<div class=\"errorTooltip\" [ngClass]=\"{noPointerEvents: !shouldShowErrorTooltipOpened()}\">\n\t\t\t\t<i class=\"closeBtn\" (click)=\"closePopup();\">\u00D7</i>\n\t\t\t\t<ng-container *ngIf=\"getErrorToShow()\" [ngTemplateOutlet]=\"errorRef\"></ng-container>\n\t\t\t\t<div *ngIf=\"!getErrorToShow() && shouldShowWarningPopup()\">{{getWarningToShow()}}</div>\n\t\t\t</div>\n\t\t</ng-container>\n\t\t<klp-form-warning-icon variant=\"fill\" *ngIf=\"getErrorToShow()\" (click)=\"togglePopup()\"></klp-form-warning-icon>\n\t\t<klp-form-warning-icon variant=\"line\" *ngIf=\"!getErrorToShow() && getWarningToShow()\" (click)=\"togglePopup()\"></klp-form-warning-icon>\n\t</div>\n</ng-template>\n", styles: [":host{display:block}.componentContainer:not(.hasCaption) .captionInputAndError{display:block}.componentContainer:not(.hasCaption) .captionInputAndError .inputContainer{margin-top:0}.componentContainer.hasCaption .errorAboveInputContainer .spacer{display:block}.componentContainer.reverseOrder .captionInputAndError{flex-direction:row-reverse;justify-content:flex-end}.componentContainer.horizontal .captionInputAndError{gap:1rem}.componentContainer.vertical .captionInputAndError{display:block}.componentContainer.vertical .captionInputAndError .inputContainer{margin-top:.3125rem}.componentContainer.vertical .captionInputAndError .errorContainer{margin-left:0}.componentContainer.d40-60 .errorAboveInputContainer .spacer{flex:40 1 0px}.componentContainer.d40-60 .errorAboveInputContainer .errorContainer{flex:60 1 0px}.componentContainer.d40-60 .caption{flex:40 1 0px}.componentContainer.d40-60 .inputContainer{flex:60 1 0px}.componentContainer.d34-66 .errorAboveInputContainer .spacer{flex:34 1 0px}.componentContainer.d34-66 .errorAboveInputContainer .errorContainer{flex:66 1 0px}.componentContainer.d34-66 .caption{flex:34 1 0px}.componentContainer.d34-66 .inputContainer{flex:66 1 0px}.componentContainer.d30-70 .errorAboveInputContainer .spacer{flex:30 1 0px}.componentContainer.d30-70 .errorAboveInputContainer .errorContainer{flex:70 1 0px}.componentContainer.d30-70 .caption{flex:30 1 0px}.componentContainer.d30-70 .inputContainer{flex:70 1 0px}.componentContainer.fixedInputWidth .caption{flex:1 1 0px;overflow:hidden}.componentContainer.fixedInputWidth .inputContainer{flex:0 0 auto}.captionInputAndError{display:flex;align-items:center;min-height:42px}.errorAboveInputContainer{display:flex;gap:1rem}.errorAboveInputContainer .spacer{display:none}.captionDummyForSpaceCalculation .caption.withErrorRightOfCaption{height:0px;overflow:hidden}.captionDummyForSpaceCalculation .caption.withErrorRightOfCaption .rightOfCaptionError{display:block}.captionRefContainer{display:flex}.caption{font-weight:700;flex:0 0 auto;color:#515365;overflow:hidden}.caption.percentageSpacing{flex:40 1 0px}.caption.percentageSpacing.d30-70{flex:30 1 0px}.caption.percentageSpacing.d34-66{flex:34 1 0px}.caption.withErrorRightOfCaption{display:flex;justify-content:space-between;gap:1rem}.caption.withErrorRightOfCaption .captionText{flex:1 2 auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.caption.withErrorRightOfCaption .rightOfCaptionError{display:none;max-width:40%;font-weight:400;overflow:hidden;flex:1 0 auto;text-align:right}.caption.withErrorRightOfCaption .rightOfCaptionError.errorFullyVisible{display:block}.caption.withErrorRightOfCaption .rightOfCaptionError ::ng-deep *{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.inputContainer{position:relative;flex:1}.inputContainer .errorTooltipContainer{position:relative}.inputContainer .errorTooltipContainer.alwaysOpen .errorTooltipTriangle,.inputContainer .errorTooltipContainer.alwaysOpen .errorTooltipTriangleWhite,.inputContainer .errorTooltipContainer.alwaysOpen .errorTooltip,.inputContainer .errorTooltipContainer.alwaysOpen .closeBtn{display:block}.inputContainer .errorTooltipContainer.alwaysOpen .errorTooltip{padding-right:1.4rem}.inputContainer .errorTooltipContainer klp-form-warning-icon{cursor:pointer}.inputContainer .errorTooltipTriangle{display:none;z-index:1;position:absolute;right:0;transform:translate(-.15rem,calc(-100% - .1rem)) scaleX(.8);width:0px;height:0px;border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid rgba(0,0,0,.13)}.inputContainer .errorTooltipTriangleWhite{display:none;z-index:3;position:absolute;right:0;transform:translate(-.15rem,calc(-100% - .1rem - 2px)) scaleX(.8);width:0px;height:0px;border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid white}.inputContainer .errorTooltip{display:none;word-wrap:break-word;position:absolute;top:-.6rem;right:-.625rem;background:white;transform:translateY(-100%);width:12rem;white-space:break-spaces;padding:.4rem .6rem;border-radius:.4rem;border:1px solid rgba(0,0,0,.13);box-shadow:#00000021 2px 3px 10px}.inputContainer .errorTooltip.noPointerEvents{pointer-events:none}.inputContainer .errorTooltip .closeBtn{display:none;position:absolute;top:.2rem;right:.2rem;padding:.2rem .4rem;cursor:pointer;color:#666;font-size:1rem}.inputContainer .errorTooltip .closeBtn:hover{color:#515365}.inputContainer:hover .errorTooltipContainer .errorTooltip,.inputContainer:hover .errorTooltipContainer .errorTooltipTriangle,.inputContainer:hover .errorTooltipContainer .errorTooltipTriangleWhite{display:block}.errorContainer{color:#ff8000}\n"] }]
|
|
591
675
|
}], ctorParameters: function () {
|
|
592
676
|
return [{ type: FormComponent, decorators: [{
|
|
593
677
|
type: Optional
|
|
@@ -612,6 +696,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImpor
|
|
|
612
696
|
}], internalComponentRef: [{
|
|
613
697
|
type: ViewChild,
|
|
614
698
|
args: ['internalComponentRef']
|
|
699
|
+
}], tailTpl: [{
|
|
700
|
+
type: ViewChild,
|
|
701
|
+
args: ['tailTpl']
|
|
702
|
+
}], captionDummyForSpaceCalculation: [{
|
|
703
|
+
type: ViewChild,
|
|
704
|
+
args: ['captionDummyForSpaceCalculation']
|
|
705
|
+
}], fieldInput: [{
|
|
706
|
+
type: ContentChild,
|
|
707
|
+
args: [NG_VALUE_ACCESSOR]
|
|
615
708
|
}] } });
|
|
616
709
|
|
|
617
710
|
/**
|
|
@@ -645,6 +738,12 @@ class ValueAccessorBase {
|
|
|
645
738
|
throw new Error('the focus() method is not implemented in this element!');
|
|
646
739
|
}
|
|
647
740
|
};
|
|
741
|
+
this.setTailTpl = (tpl) => {
|
|
742
|
+
this.tailTpl = tpl;
|
|
743
|
+
};
|
|
744
|
+
this.getTailTpl = () => {
|
|
745
|
+
return this.tailTpl;
|
|
746
|
+
};
|
|
648
747
|
}
|
|
649
748
|
ngOnInit() {
|
|
650
749
|
var _a, _b, _c;
|
|
@@ -679,6 +778,7 @@ class ValueAccessorBase {
|
|
|
679
778
|
}
|
|
680
779
|
touch() {
|
|
681
780
|
this.touched.forEach((f) => f());
|
|
781
|
+
this.onTouch.emit();
|
|
682
782
|
}
|
|
683
783
|
writeValue(value) {
|
|
684
784
|
this.innerValue = value;
|
|
@@ -909,15 +1009,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImpor
|
|
|
909
1009
|
type: Input
|
|
910
1010
|
}] } });
|
|
911
1011
|
|
|
912
|
-
function runNextRenderCycle(fn) {
|
|
913
|
-
setTimeout(fn);
|
|
914
|
-
}
|
|
915
|
-
function awaitableForNextCycle() {
|
|
916
|
-
return new Promise((resolve) => {
|
|
917
|
-
setTimeout(resolve);
|
|
918
|
-
});
|
|
919
|
-
}
|
|
920
|
-
|
|
921
1012
|
const SELECT_TRANSLATIONS = new InjectionToken('klp.form.select.translations');
|
|
922
1013
|
class KlpSelectOptionTemplateDirective {
|
|
923
1014
|
}
|
|
@@ -1329,10 +1420,10 @@ class TextInputComponent extends ValueAccessorBase {
|
|
|
1329
1420
|
}
|
|
1330
1421
|
}
|
|
1331
1422
|
TextInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: TextInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1332
|
-
TextInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: TextInputComponent, selector: "klp-form-text-input", inputs: { placeholder: "placeholder", type: "type", clearable: "clearable", icon: "icon", hasBorderLeft: "hasBorderLeft", hasBorderRight: "hasBorderRight" }, outputs: { onBlur: "onBlur" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: TextInputComponent, multi: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"componentContainer\">\n\t<ng-container *ngIf=\"icon?.length > 0\">\n\t\t<i class=\"ti-search\" *ngIf=\"icon === 'search'\"></i>\n\t</ng-container>\n\t<input\n\t\t[type]=\"type\"\n\t\t[(ngModel)]=\"innerValue\"\n\t\t[ngClass]=\"{showErrors: isInErrorState(), hasIcon: icon?.length > 0, hasClearButton: clearable, noBorderLeft: !hasBorderLeft, noBorderRight: !hasBorderRight}\"\n\t\t(input)=\"setInnerValueAndNotify($event.target.value)\"\n\t\t[placeholder]=\"placeholder ? placeholder : ''\"\n\t\t(blur)=\"touch(); onBlur.emit()\"\n\t\t[disabled]='disabled'\n\t\t#nativeInputRef\n\t/>\n\t<div class=\"clearIcon\" *ngIf=\"clearable && innerValue?.length > 0\" (click)=\"resetToNull()\">\u00D7</div>\n</div>\n", styles: [":host{display:block}:host input:disabled{cursor:not-allowed}.componentContainer{position:relative}i{position:absolute;left:.625rem;top:14px}input{outline:none;display:block;border:1px solid #e6ecf5;border-radius:2px;box-shadow:none;height:42px;width:100%;padding:.375rem .625rem;font-size:14px;color:#888da8;transition:all .2s ease-in;-webkit-transition:all .2s ease-in;-moz-transition:all .2s ease-in;-o-transition:all .2s ease-in;-ms-transition:all .2s ease-in}input::-webkit-input-placeholder{color:#adadad}input:-moz-placeholder{color:#adadad}input::-moz-placeholder{color:#adadad}input:-ms-input-placeholder{color:#adadad}input:focus{outline:0 none;box-shadow:none;border-color:#3ed778}input.input-sm{height:30px}input.input-lg{height:50px}input.error{border-color:#dc3545;background-color:#f6cdd1}input.valid{border-color:#37c936;background-color:#ebfaeb;color:#278d26}input.hasIcon{padding-left:1.875rem}input.hasClearButton{padding-right:1.875rem}input.noBorderLeft{border-left:none}input.noBorderRight{border-right:none}.
|
|
1423
|
+
TextInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: TextInputComponent, selector: "klp-form-text-input", inputs: { placeholder: "placeholder", type: "type", clearable: "clearable", icon: "icon", hasBorderLeft: "hasBorderLeft", hasBorderRight: "hasBorderRight" }, outputs: { onBlur: "onBlur" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: TextInputComponent, multi: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"componentContainer\">\n\t<ng-container *ngIf=\"icon?.length > 0\">\n\t\t<i class=\"ti-search\" *ngIf=\"icon === 'search'\"></i>\n\t</ng-container>\n\t<input\n\t\t[type]=\"type\"\n\t\t[(ngModel)]=\"innerValue\"\n\t\t[ngClass]=\"{showErrors: isInErrorState(), hasIcon: icon?.length > 0, hasClearButton: clearable, noBorderLeft: !hasBorderLeft, noBorderRight: !hasBorderRight}\"\n\t\t(input)=\"setInnerValueAndNotify($event.target.value)\"\n\t\t[placeholder]=\"placeholder ? placeholder : ''\"\n\t\t(blur)=\"touch(); onBlur.emit()\"\n\t\t[disabled]='disabled'\n\t\t#nativeInputRef\n\t/>\n\t<div class=\"tail\">\n\t\t<ng-container [ngTemplateOutlet]=\"getTailTpl()\"></ng-container>\n\t\t<div class=\"clearIcon\" *ngIf=\"clearable && innerValue?.length > 0\" (click)=\"resetToNull()\">\u00D7</div>\n\t</div>\n</div>\n", styles: [":host{display:block}:host input:disabled{cursor:not-allowed}.componentContainer{position:relative}i{position:absolute;left:.625rem;top:14px}input{outline:none;display:block;border:1px solid #e6ecf5;border-radius:2px;box-shadow:none;height:42px;width:100%;padding:.375rem .625rem;font-size:14px;color:#888da8;transition:all .2s ease-in;-webkit-transition:all .2s ease-in;-moz-transition:all .2s ease-in;-o-transition:all .2s ease-in;-ms-transition:all .2s ease-in}input::-webkit-input-placeholder{color:#adadad}input:-moz-placeholder{color:#adadad}input::-moz-placeholder{color:#adadad}input:-ms-input-placeholder{color:#adadad}input:focus{outline:0 none;box-shadow:none;border-color:#3ed778}input.input-sm{height:30px}input.input-lg{height:50px}input.error{border-color:#dc3545;background-color:#f6cdd1}input.valid{border-color:#37c936;background-color:#ebfaeb;color:#278d26}input.hasIcon{padding-left:1.875rem}input.hasClearButton{padding-right:1.875rem}input.noBorderLeft{border-left:none}input.noBorderRight{border-right:none}.tail{position:absolute;right:.625rem;display:flex;align-items:center;top:0;bottom:0;gap:.625rem}.tail .clearIcon{transform:translateY(-2px);font-size:18px;cursor:pointer}.showErrors{border-color:#ff8000}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
|
|
1333
1424
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: TextInputComponent, decorators: [{
|
|
1334
1425
|
type: Component,
|
|
1335
|
-
args: [{ selector: 'klp-form-text-input', providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: TextInputComponent, multi: true }], template: "<div class=\"componentContainer\">\n\t<ng-container *ngIf=\"icon?.length > 0\">\n\t\t<i class=\"ti-search\" *ngIf=\"icon === 'search'\"></i>\n\t</ng-container>\n\t<input\n\t\t[type]=\"type\"\n\t\t[(ngModel)]=\"innerValue\"\n\t\t[ngClass]=\"{showErrors: isInErrorState(), hasIcon: icon?.length > 0, hasClearButton: clearable, noBorderLeft: !hasBorderLeft, noBorderRight: !hasBorderRight}\"\n\t\t(input)=\"setInnerValueAndNotify($event.target.value)\"\n\t\t[placeholder]=\"placeholder ? placeholder : ''\"\n\t\t(blur)=\"touch(); onBlur.emit()\"\n\t\t[disabled]='disabled'\n\t\t#nativeInputRef\n\t/>\n\t<div class=\"clearIcon\" *ngIf=\"clearable && innerValue?.length > 0\" (click)=\"resetToNull()\">\u00D7</div>\n</div>\n", styles: [":host{display:block}:host input:disabled{cursor:not-allowed}.componentContainer{position:relative}i{position:absolute;left:.625rem;top:14px}input{outline:none;display:block;border:1px solid #e6ecf5;border-radius:2px;box-shadow:none;height:42px;width:100%;padding:.375rem .625rem;font-size:14px;color:#888da8;transition:all .2s ease-in;-webkit-transition:all .2s ease-in;-moz-transition:all .2s ease-in;-o-transition:all .2s ease-in;-ms-transition:all .2s ease-in}input::-webkit-input-placeholder{color:#adadad}input:-moz-placeholder{color:#adadad}input::-moz-placeholder{color:#adadad}input:-ms-input-placeholder{color:#adadad}input:focus{outline:0 none;box-shadow:none;border-color:#3ed778}input.input-sm{height:30px}input.input-lg{height:50px}input.error{border-color:#dc3545;background-color:#f6cdd1}input.valid{border-color:#37c936;background-color:#ebfaeb;color:#278d26}input.hasIcon{padding-left:1.875rem}input.hasClearButton{padding-right:1.875rem}input.noBorderLeft{border-left:none}input.noBorderRight{border-right:none}.
|
|
1426
|
+
args: [{ selector: 'klp-form-text-input', providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: TextInputComponent, multi: true }], template: "<div class=\"componentContainer\">\n\t<ng-container *ngIf=\"icon?.length > 0\">\n\t\t<i class=\"ti-search\" *ngIf=\"icon === 'search'\"></i>\n\t</ng-container>\n\t<input\n\t\t[type]=\"type\"\n\t\t[(ngModel)]=\"innerValue\"\n\t\t[ngClass]=\"{showErrors: isInErrorState(), hasIcon: icon?.length > 0, hasClearButton: clearable, noBorderLeft: !hasBorderLeft, noBorderRight: !hasBorderRight}\"\n\t\t(input)=\"setInnerValueAndNotify($event.target.value)\"\n\t\t[placeholder]=\"placeholder ? placeholder : ''\"\n\t\t(blur)=\"touch(); onBlur.emit()\"\n\t\t[disabled]='disabled'\n\t\t#nativeInputRef\n\t/>\n\t<div class=\"tail\">\n\t\t<ng-container [ngTemplateOutlet]=\"getTailTpl()\"></ng-container>\n\t\t<div class=\"clearIcon\" *ngIf=\"clearable && innerValue?.length > 0\" (click)=\"resetToNull()\">\u00D7</div>\n\t</div>\n</div>\n", styles: [":host{display:block}:host input:disabled{cursor:not-allowed}.componentContainer{position:relative}i{position:absolute;left:.625rem;top:14px}input{outline:none;display:block;border:1px solid #e6ecf5;border-radius:2px;box-shadow:none;height:42px;width:100%;padding:.375rem .625rem;font-size:14px;color:#888da8;transition:all .2s ease-in;-webkit-transition:all .2s ease-in;-moz-transition:all .2s ease-in;-o-transition:all .2s ease-in;-ms-transition:all .2s ease-in}input::-webkit-input-placeholder{color:#adadad}input:-moz-placeholder{color:#adadad}input::-moz-placeholder{color:#adadad}input:-ms-input-placeholder{color:#adadad}input:focus{outline:0 none;box-shadow:none;border-color:#3ed778}input.input-sm{height:30px}input.input-lg{height:50px}input.error{border-color:#dc3545;background-color:#f6cdd1}input.valid{border-color:#37c936;background-color:#ebfaeb;color:#278d26}input.hasIcon{padding-left:1.875rem}input.hasClearButton{padding-right:1.875rem}input.noBorderLeft{border-left:none}input.noBorderRight{border-right:none}.tail{position:absolute;right:.625rem;display:flex;align-items:center;top:0;bottom:0;gap:.625rem}.tail .clearIcon{transform:translateY(-2px);font-size:18px;cursor:pointer}.showErrors{border-color:#ff8000}\n"] }]
|
|
1336
1427
|
}], propDecorators: { placeholder: [{
|
|
1337
1428
|
type: Input
|
|
1338
1429
|
}], type: [{
|
|
@@ -2081,10 +2172,10 @@ class FileInputComponent extends MultipleValueAccessorBase {
|
|
|
2081
2172
|
}
|
|
2082
2173
|
}
|
|
2083
2174
|
FileInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: FileInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2084
|
-
FileInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: FileInputComponent, selector: "klp-form-file-input", inputs: { isLoading: "isLoading", clearable: "clearable", onlyShowUploadButton: "onlyShowUploadButton", useFullParentSize: "useFullParentSize", buttonText: "buttonText" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: FileInputComponent, multi: true }], viewQueries: [{ propertyName: "nativeInputRef", first: true, predicate: ["nativeInputRef"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"componentContainer\" [ngClass]=\"{fullParentSize: useFullParentSize}\">\n\t<div class=\"buttonContainer\">\n\t\t<input\n\t\t\ttype=\"file\"\n\t\t\t#nativeInputRef\n\t\t\t(change)=\"onChange($event.target.files)\"\n\t\t\t[multiple]=\"multiple\"\n\t\t\t[disabled]=\"disabled\"\n\t\t>\n\t\t<klp-form-button class=\"uploadButton\" [isLoading]=\"isLoading\" (click)=\"uploadFileClicked()\">\n\t\t\t{{buttonText}}\n\t\t</klp-form-button>\n\t</div>\n\t<div class=\"fileName\" *ngIf=\"!onlyShowUploadButton\">\n\t\t{{getFileNames()}}\n\t</div>\n\t<klp-form-button class=\"clearButton\" variant=\"white\" *ngIf=\"shouldShowClearButton()\" (click)=\"resetToNull()\">X</klp-form-button>\n</div>\n", styles: [":host{display:block}:host input:disabled{cursor:not-allowed}.componentContainer{display:flex;align-items:center}.componentContainer.fullParentSize{height:100%;justify-content:center;position:relative}.componentContainer:not(.fullParentSize) .buttonContainer{position:relative}.componentContainer .buttonContainer{flex:0 0 auto}input{position:absolute;cursor:pointer;opacity:0;inset:0}.fileName{flex:1 1 0px;margin-left:.625rem;color:#515365;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.clearButton{flex:0 0 auto}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ButtonComponent, selector: "klp-form-button", inputs: ["variant", "size", "fullWidth", "hasBorder", "disabled", "isLoading", "type", "clickCallback"] }] });
|
|
2175
|
+
FileInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: FileInputComponent, selector: "klp-form-file-input", inputs: { isLoading: "isLoading", clearable: "clearable", onlyShowUploadButton: "onlyShowUploadButton", useFullParentSize: "useFullParentSize", buttonText: "buttonText" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: FileInputComponent, multi: true }], viewQueries: [{ propertyName: "nativeInputRef", first: true, predicate: ["nativeInputRef"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"componentContainer\" [ngClass]=\"{fullParentSize: useFullParentSize}\">\n\t<div class=\"buttonContainer\">\n\t\t<input\n\t\t\ttype=\"file\"\n\t\t\t#nativeInputRef\n\t\t\t(change)=\"onChange($event.target.files)\"\n\t\t\t[multiple]=\"multiple\"\n\t\t\t[disabled]=\"disabled\"\n\t\t>\n\t\t<klp-form-button class=\"uploadButton\" [isLoading]=\"isLoading\" [disabled]=\"disabled\" (click)=\"uploadFileClicked()\">\n\t\t\t{{buttonText}}\n\t\t</klp-form-button>\n\t</div>\n\t<div class=\"fileName\" *ngIf=\"!onlyShowUploadButton\">\n\t\t{{getFileNames()}}\n\t</div>\n\t<klp-form-button class=\"clearButton\" variant=\"white\" *ngIf=\"shouldShowClearButton()\" (click)=\"resetToNull()\">X</klp-form-button>\n</div>\n", styles: [":host{display:block}:host input:disabled{cursor:not-allowed}.componentContainer{display:flex;align-items:center}.componentContainer.fullParentSize{height:100%;justify-content:center;position:relative}.componentContainer:not(.fullParentSize) .buttonContainer{position:relative}.componentContainer .buttonContainer{flex:0 0 auto}input{position:absolute;cursor:pointer;opacity:0;inset:0}.fileName{flex:1 1 0px;margin-left:.625rem;color:#515365;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.clearButton{flex:0 0 auto}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ButtonComponent, selector: "klp-form-button", inputs: ["variant", "size", "fullWidth", "hasBorder", "disabled", "isLoading", "type", "clickCallback"] }] });
|
|
2085
2176
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: FileInputComponent, decorators: [{
|
|
2086
2177
|
type: Component,
|
|
2087
|
-
args: [{ selector: 'klp-form-file-input', providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: FileInputComponent, multi: true }], template: "<div class=\"componentContainer\" [ngClass]=\"{fullParentSize: useFullParentSize}\">\n\t<div class=\"buttonContainer\">\n\t\t<input\n\t\t\ttype=\"file\"\n\t\t\t#nativeInputRef\n\t\t\t(change)=\"onChange($event.target.files)\"\n\t\t\t[multiple]=\"multiple\"\n\t\t\t[disabled]=\"disabled\"\n\t\t>\n\t\t<klp-form-button class=\"uploadButton\" [isLoading]=\"isLoading\" (click)=\"uploadFileClicked()\">\n\t\t\t{{buttonText}}\n\t\t</klp-form-button>\n\t</div>\n\t<div class=\"fileName\" *ngIf=\"!onlyShowUploadButton\">\n\t\t{{getFileNames()}}\n\t</div>\n\t<klp-form-button class=\"clearButton\" variant=\"white\" *ngIf=\"shouldShowClearButton()\" (click)=\"resetToNull()\">X</klp-form-button>\n</div>\n", styles: [":host{display:block}:host input:disabled{cursor:not-allowed}.componentContainer{display:flex;align-items:center}.componentContainer.fullParentSize{height:100%;justify-content:center;position:relative}.componentContainer:not(.fullParentSize) .buttonContainer{position:relative}.componentContainer .buttonContainer{flex:0 0 auto}input{position:absolute;cursor:pointer;opacity:0;inset:0}.fileName{flex:1 1 0px;margin-left:.625rem;color:#515365;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.clearButton{flex:0 0 auto}\n"] }]
|
|
2178
|
+
args: [{ selector: 'klp-form-file-input', providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: FileInputComponent, multi: true }], template: "<div class=\"componentContainer\" [ngClass]=\"{fullParentSize: useFullParentSize}\">\n\t<div class=\"buttonContainer\">\n\t\t<input\n\t\t\ttype=\"file\"\n\t\t\t#nativeInputRef\n\t\t\t(change)=\"onChange($event.target.files)\"\n\t\t\t[multiple]=\"multiple\"\n\t\t\t[disabled]=\"disabled\"\n\t\t>\n\t\t<klp-form-button class=\"uploadButton\" [isLoading]=\"isLoading\" [disabled]=\"disabled\" (click)=\"uploadFileClicked()\">\n\t\t\t{{buttonText}}\n\t\t</klp-form-button>\n\t</div>\n\t<div class=\"fileName\" *ngIf=\"!onlyShowUploadButton\">\n\t\t{{getFileNames()}}\n\t</div>\n\t<klp-form-button class=\"clearButton\" variant=\"white\" *ngIf=\"shouldShowClearButton()\" (click)=\"resetToNull()\">X</klp-form-button>\n</div>\n", styles: [":host{display:block}:host input:disabled{cursor:not-allowed}.componentContainer{display:flex;align-items:center}.componentContainer.fullParentSize{height:100%;justify-content:center;position:relative}.componentContainer:not(.fullParentSize) .buttonContainer{position:relative}.componentContainer .buttonContainer{flex:0 0 auto}input{position:absolute;cursor:pointer;opacity:0;inset:0}.fileName{flex:1 1 0px;margin-left:.625rem;color:#515365;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.clearButton{flex:0 0 auto}\n"] }]
|
|
2088
2179
|
}], propDecorators: { isLoading: [{
|
|
2089
2180
|
type: Input
|
|
2090
2181
|
}], clearable: [{
|
|
@@ -2257,6 +2348,86 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImpor
|
|
|
2257
2348
|
type: Input
|
|
2258
2349
|
}] } });
|
|
2259
2350
|
|
|
2351
|
+
const triangleSize = '12px';
|
|
2352
|
+
class WithTooltipDirective {
|
|
2353
|
+
constructor(el) {
|
|
2354
|
+
this.klpWithTooltip = true;
|
|
2355
|
+
el.nativeElement.addEventListener('mouseenter', () => {
|
|
2356
|
+
if (!this.klpWithTooltip) {
|
|
2357
|
+
return;
|
|
2358
|
+
}
|
|
2359
|
+
if (getComputedStyle(el.nativeElement).position === 'static') {
|
|
2360
|
+
el.nativeElement.style.position = 'relative';
|
|
2361
|
+
}
|
|
2362
|
+
this.div = document.createElement('div');
|
|
2363
|
+
this.div.style.zIndex = '2';
|
|
2364
|
+
this.div.style.color = '#ff8000';
|
|
2365
|
+
this.div.style.position = 'fixed';
|
|
2366
|
+
this.div.style.left = `${el.nativeElement.getBoundingClientRect().x}px`;
|
|
2367
|
+
this.div.style.top = `${el.nativeElement.getBoundingClientRect().y}px`;
|
|
2368
|
+
this.div.style.transform = `translate(calc(-100% + ${el.nativeElement.getBoundingClientRect().width}px), calc(-100% - 0.3rem))`;
|
|
2369
|
+
this.div.style.maxWidth = '200px';
|
|
2370
|
+
this.div.style.whiteSpace = 'break-spaces';
|
|
2371
|
+
this.div.style.backgroundColor = 'white';
|
|
2372
|
+
this.div.style.border = '1px solid rgba(255, 128, 0, 0.1254901961)';
|
|
2373
|
+
this.div.style.boxShadow = `2px 3px 10px 0px rgba(255, 128, 0, 0.1254901961)`;
|
|
2374
|
+
this.div.style.padding = '0.3rem 0.5rem';
|
|
2375
|
+
this.div.style.boxSizing = 'border-box';
|
|
2376
|
+
this.div.style.borderRadius = '3px';
|
|
2377
|
+
this.div.textContent = el.nativeElement.innerText;
|
|
2378
|
+
el.nativeElement.prepend(this.div);
|
|
2379
|
+
this.triangle = document.createElement('div');
|
|
2380
|
+
this.triangle.style.zIndex = '1';
|
|
2381
|
+
this.triangle.style.position = 'fixed';
|
|
2382
|
+
this.triangle.style.left = `calc(${el.nativeElement.getBoundingClientRect().x + el.nativeElement.getBoundingClientRect().width}px - 2rem)`;
|
|
2383
|
+
this.triangle.style.top = `${el.nativeElement.getBoundingClientRect().y}px`;
|
|
2384
|
+
this.triangle.style.transform = `translate(-50%, calc(-100% + 0.1rem))`;
|
|
2385
|
+
this.triangle.style.width = '0';
|
|
2386
|
+
this.triangle.style.height = '0';
|
|
2387
|
+
this.triangle.style.borderLeft = `${triangleSize} solid transparent`;
|
|
2388
|
+
this.triangle.style.borderRight = `${triangleSize} solid transparent`;
|
|
2389
|
+
this.triangle.style.borderTop = `${triangleSize} solid rgba(255, 128, 0, 0.1254901961)`;
|
|
2390
|
+
el.nativeElement.prepend(this.triangle);
|
|
2391
|
+
this.triangleWhite = document.createElement('div');
|
|
2392
|
+
this.triangleWhite.style.zIndex = '3';
|
|
2393
|
+
this.triangleWhite.style.position = 'fixed';
|
|
2394
|
+
this.triangleWhite.style.left = `calc(${el.nativeElement.getBoundingClientRect().x + el.nativeElement.getBoundingClientRect().width}px - 2rem)`;
|
|
2395
|
+
this.triangleWhite.style.top = `${el.nativeElement.getBoundingClientRect().y}px`;
|
|
2396
|
+
this.triangleWhite.style.transform = `translate(-50%, calc(-100% + 0.1rem - 2px))`;
|
|
2397
|
+
this.triangleWhite.style.width = '0';
|
|
2398
|
+
this.triangleWhite.style.height = '0';
|
|
2399
|
+
this.triangleWhite.style.borderLeft = `${triangleSize} solid transparent`;
|
|
2400
|
+
this.triangleWhite.style.borderRight = `${triangleSize} solid transparent`;
|
|
2401
|
+
this.triangleWhite.style.borderTop = `${triangleSize} solid white`;
|
|
2402
|
+
el.nativeElement.prepend(this.triangleWhite);
|
|
2403
|
+
});
|
|
2404
|
+
el.nativeElement.addEventListener('mouseout', () => {
|
|
2405
|
+
try {
|
|
2406
|
+
el.nativeElement.removeChild(this.div);
|
|
2407
|
+
}
|
|
2408
|
+
catch (ex) { }
|
|
2409
|
+
try {
|
|
2410
|
+
el.nativeElement.removeChild(this.triangle);
|
|
2411
|
+
}
|
|
2412
|
+
catch (ex) { }
|
|
2413
|
+
try {
|
|
2414
|
+
el.nativeElement.removeChild(this.triangleWhite);
|
|
2415
|
+
}
|
|
2416
|
+
catch (ex) { }
|
|
2417
|
+
});
|
|
2418
|
+
}
|
|
2419
|
+
}
|
|
2420
|
+
WithTooltipDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WithTooltipDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2421
|
+
WithTooltipDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.8", type: WithTooltipDirective, selector: "[klpWithTooltip]", inputs: { klpWithTooltip: "klpWithTooltip" }, ngImport: i0 });
|
|
2422
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WithTooltipDirective, decorators: [{
|
|
2423
|
+
type: Directive,
|
|
2424
|
+
args: [{
|
|
2425
|
+
selector: '[klpWithTooltip]'
|
|
2426
|
+
}]
|
|
2427
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { klpWithTooltip: [{
|
|
2428
|
+
type: Input
|
|
2429
|
+
}] } });
|
|
2430
|
+
|
|
2260
2431
|
class NgxEnhancyFormsModule {
|
|
2261
2432
|
}
|
|
2262
2433
|
NgxEnhancyFormsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: NgxEnhancyFormsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
@@ -2286,7 +2457,9 @@ NgxEnhancyFormsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", v
|
|
|
2286
2457
|
SubFormDirective,
|
|
2287
2458
|
HourMinuteInputComponent,
|
|
2288
2459
|
RadioComponent,
|
|
2289
|
-
WithTooltipDirective
|
|
2460
|
+
WithTooltipDirective,
|
|
2461
|
+
WarningIconComponent,
|
|
2462
|
+
ElementIsTruncatedCbComponent], imports: [CommonModule,
|
|
2290
2463
|
FormsModule,
|
|
2291
2464
|
NgSelectModule,
|
|
2292
2465
|
SortablejsModule,
|
|
@@ -2316,7 +2489,8 @@ NgxEnhancyFormsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", v
|
|
|
2316
2489
|
SubFormDirective,
|
|
2317
2490
|
HourMinuteInputComponent,
|
|
2318
2491
|
RadioComponent,
|
|
2319
|
-
WithTooltipDirective
|
|
2492
|
+
WithTooltipDirective,
|
|
2493
|
+
ElementIsTruncatedCbComponent] });
|
|
2320
2494
|
NgxEnhancyFormsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: NgxEnhancyFormsModule, imports: [CommonModule,
|
|
2321
2495
|
FormsModule,
|
|
2322
2496
|
NgSelectModule,
|
|
@@ -2360,6 +2534,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImpor
|
|
|
2360
2534
|
HourMinuteInputComponent,
|
|
2361
2535
|
RadioComponent,
|
|
2362
2536
|
WithTooltipDirective,
|
|
2537
|
+
WarningIconComponent,
|
|
2538
|
+
ElementIsTruncatedCbComponent,
|
|
2363
2539
|
],
|
|
2364
2540
|
exports: [
|
|
2365
2541
|
ValueAccessorBase,
|
|
@@ -2389,6 +2565,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImpor
|
|
|
2389
2565
|
HourMinuteInputComponent,
|
|
2390
2566
|
RadioComponent,
|
|
2391
2567
|
WithTooltipDirective,
|
|
2568
|
+
ElementIsTruncatedCbComponent,
|
|
2392
2569
|
]
|
|
2393
2570
|
}]
|
|
2394
2571
|
}] });
|
|
@@ -2401,5 +2578,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImpor
|
|
|
2401
2578
|
* Generated bundle index. Do not edit.
|
|
2402
2579
|
*/
|
|
2403
2580
|
|
|
2404
|
-
export { ButtonComponent, CheckboxComponent, DATE_PICKER_LOCALE, DATE_PICKER_TRANSLATIONS, DATE_TIME_PICKER_TRANSLATIONS, DEFAULT_ERROR_MESSAGES, DatePickerComponent, DateTimePickerComponent, DefaultErrorHandler, EmailInputComponent, FORM_ERROR_MESSAGES, FileInputComponent, FormCaptionComponent, FormComponent, FormElementComponent, FormErrorComponent, FormSubmitButtonComponent, FormValidationError, HourMinuteInputComponent, KLP_DATE_FORMATS, KLP_FORM_ERROR_HANDLER, KlpSelectOptionTemplateDirective, LoadingIndicatorComponent, MultipleValueAccessorBase, NgxEnhancyFormsModule, NumberInputComponent, Orientation, PasswordFieldComponent, RadioComponent, SELECT_TRANSLATIONS, SelectComponent, SelectFooterComponent, SortableGroupedItemsComponent, SortableItemsComponent, SubFormDirective, TextInputComponent, ToggleComponent, ValueAccessorBase, WithTooltipDirective, dateValidator, invalidDateKey, invalidFieldsSymbol, matDateFormatsFactory };
|
|
2581
|
+
export { ButtonComponent, CheckboxComponent, DATE_PICKER_LOCALE, DATE_PICKER_TRANSLATIONS, DATE_TIME_PICKER_TRANSLATIONS, DEFAULT_ERROR_MESSAGES, DatePickerComponent, DateTimePickerComponent, DefaultErrorHandler, ElementIsTruncatedCbComponent, EmailInputComponent, FORM_ERROR_MESSAGES, FileInputComponent, FormCaptionComponent, FormComponent, FormElementComponent, FormErrorComponent, FormSubmitButtonComponent, FormValidationError, HourMinuteInputComponent, KLP_DATE_FORMATS, KLP_FORM_ERROR_HANDLER, KlpSelectOptionTemplateDirective, LoadingIndicatorComponent, MultipleValueAccessorBase, NgxEnhancyFormsModule, NumberInputComponent, Orientation, PasswordFieldComponent, RadioComponent, SELECT_TRANSLATIONS, SelectComponent, SelectFooterComponent, SortableGroupedItemsComponent, SortableItemsComponent, SubFormDirective, TextInputComponent, ToggleComponent, ValueAccessorBase, WithTooltipDirective, dateValidator, invalidDateKey, invalidFieldsSymbol, matDateFormatsFactory };
|
|
2405
2582
|
//# sourceMappingURL=klippa-ngx-enhancy-forms.mjs.map
|