aeb-ui-kit 10.0.0-preview.1204 → 10.0.0-preview.1210
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/fesm2022/aeb-ui-kit.mjs +87 -33
- package/package.json +1 -1
- package/types/aeb-ui-kit.d.ts +11 -6
package/fesm2022/aeb-ui-kit.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { signal, viewChild, input, computed, effect, ChangeDetectionStrategy, ViewEncapsulation, Component, NgModule, Directive, inject, ElementRef, contentChild, output, forwardRef, Input, EnvironmentInjector, ApplicationRef, RendererFactory2, createComponent, Injectable, Renderer2, DestroyRef, Pipe, viewChildren, LOCALE_ID, contentChildren, TemplateRef,
|
|
2
|
+
import { signal, viewChild, input, computed, effect, ChangeDetectionStrategy, ViewEncapsulation, Component, NgModule, Directive, inject, ElementRef, contentChild, output, forwardRef, Input, ChangeDetectorRef, EnvironmentInjector, ApplicationRef, RendererFactory2, createComponent, Injectable, Renderer2, DestroyRef, Pipe, viewChildren, LOCALE_ID, contentChildren, TemplateRef, Injector } from '@angular/core';
|
|
3
3
|
import { NgClass, DOCUMENT, TitleCasePipe, DatePipe, NgStyle, NgTemplateOutlet, DecimalPipe, formatDate, formatNumber } from '@angular/common';
|
|
4
4
|
import * as i1 from '@angular/forms';
|
|
5
5
|
import { NG_VALUE_ACCESSOR, FormBuilder, FormControl, Validators, FormsModule, ReactiveFormsModule, NgControl } from '@angular/forms';
|
|
6
|
-
import { Subject, timer, map, takeUntil, Subscription, filter, fromEvent, debounce, debounceTime } from 'rxjs';
|
|
7
|
-
import { trigger,
|
|
6
|
+
import { Subject, timer, map, takeUntil, merge, Subscription, filter, fromEvent, debounce, debounceTime } from 'rxjs';
|
|
7
|
+
import { trigger, state, style, transition, animate, query, stagger } from '@angular/animations';
|
|
8
8
|
import '@angular/common/locales/global/ru';
|
|
9
9
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
10
10
|
|
|
@@ -341,6 +341,7 @@ class CodeInput {
|
|
|
341
341
|
constructor() {
|
|
342
342
|
this._destroy$ = new Subject();
|
|
343
343
|
this._timerSub = null;
|
|
344
|
+
this._isComposing = false;
|
|
344
345
|
this._disabled = signal(false, ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
345
346
|
this._isFocus = signal(false, ...(ngDevMode ? [{ debugName: "_isFocus" }] : /* istanbul ignore next */ []));
|
|
346
347
|
this._inputValue = signal('', ...(ngDevMode ? [{ debugName: "_inputValue" }] : /* istanbul ignore next */ []));
|
|
@@ -377,27 +378,47 @@ class CodeInput {
|
|
|
377
378
|
this._destroy$.complete();
|
|
378
379
|
}
|
|
379
380
|
inputChangeHandler(event) {
|
|
381
|
+
if (!(event.target instanceof HTMLInputElement)) {
|
|
382
|
+
return;
|
|
383
|
+
}
|
|
384
|
+
if (event.type === 'compositionstart') {
|
|
385
|
+
this._isComposing = true;
|
|
386
|
+
return;
|
|
387
|
+
}
|
|
388
|
+
if (event.type === 'compositionend') {
|
|
389
|
+
this._isComposing = false;
|
|
390
|
+
}
|
|
391
|
+
else if (this._isComposing ||
|
|
392
|
+
(event instanceof InputEvent && event.isComposing)) {
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
380
395
|
const target = event.target;
|
|
381
|
-
|
|
382
|
-
this.
|
|
383
|
-
if (
|
|
384
|
-
|
|
396
|
+
const rawValue = target.value;
|
|
397
|
+
const value = this.normalizeValue(rawValue);
|
|
398
|
+
if (rawValue !== value) {
|
|
399
|
+
const start = target.selectionStart;
|
|
400
|
+
const end = target.selectionEnd;
|
|
401
|
+
const direction = target.selectionDirection;
|
|
402
|
+
target.value = value;
|
|
403
|
+
if (start !== null && end !== null) {
|
|
404
|
+
target.setSelectionRange(this.normalizeValue(rawValue.slice(0, start)).length, this.normalizeValue(rawValue.slice(0, end)).length, direction ?? undefined);
|
|
405
|
+
}
|
|
385
406
|
}
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
const key = e.key;
|
|
389
|
-
if (/\d/.test(key)) {
|
|
390
|
-
return true;
|
|
407
|
+
if (value === this.inputValue) {
|
|
408
|
+
return;
|
|
391
409
|
}
|
|
392
|
-
|
|
393
|
-
|
|
410
|
+
this.inputValue = value;
|
|
411
|
+
this.onChange(value);
|
|
412
|
+
if (this.inputValue === value && value.length === this.codeLength()) {
|
|
413
|
+
this.codeCompleted.emit(value);
|
|
394
414
|
}
|
|
395
415
|
}
|
|
396
416
|
writeValue(value) {
|
|
397
|
-
this.
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
417
|
+
const normalizedValue = this.normalizeValue(value ?? '');
|
|
418
|
+
this._inputValue.set(normalizedValue);
|
|
419
|
+
const target = this.input()?.nativeElement;
|
|
420
|
+
if (target && target.value !== normalizedValue) {
|
|
421
|
+
target.value = normalizedValue;
|
|
401
422
|
}
|
|
402
423
|
}
|
|
403
424
|
setDisabledState(isDisabled) {
|
|
@@ -452,6 +473,9 @@ class CodeInput {
|
|
|
452
473
|
this.isFocus = true;
|
|
453
474
|
}
|
|
454
475
|
}
|
|
476
|
+
normalizeValue(value) {
|
|
477
|
+
return value.replace(/[^0-9]/g, '').slice(0, this.codeLength());
|
|
478
|
+
}
|
|
455
479
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: CodeInput, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
456
480
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: CodeInput, isStandalone: true, selector: "aeb-code-input", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, tip: { classPropertyName: "tip", publicName: "tip", isSignal: true, isRequired: false, transformFunction: null }, initialDisabled: { classPropertyName: "initialDisabled", publicName: "initialDisabled", isSignal: true, isRequired: false, transformFunction: null }, hasError: { classPropertyName: "hasError", publicName: "hasError", isSignal: true, isRequired: false, transformFunction: null }, isResendable: { classPropertyName: "isResendable", publicName: "isResendable", isSignal: true, isRequired: false, transformFunction: null }, secondsUntilRetry: { classPropertyName: "secondsUntilRetry", publicName: "secondsUntilRetry", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, codeLength: { classPropertyName: "codeLength", publicName: "codeLength", isSignal: true, isRequired: false, transformFunction: null }, isAutofocus: { classPropertyName: "isAutofocus", publicName: "isAutofocus", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { codeCompleted: "codeCompleted", timeOut: "timeOut", resendClick: "resendClick" }, host: { classAttribute: "aeb-code-input" }, providers: [
|
|
457
481
|
{
|
|
@@ -459,7 +483,7 @@ class CodeInput {
|
|
|
459
483
|
useExisting: forwardRef(() => CodeInput),
|
|
460
484
|
multi: true
|
|
461
485
|
}
|
|
462
|
-
], viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (title()) {\n<h2 class=\"aeb-code-input__title\">{{ title() }}</h2>\n} @if (tip()) {\n<span class=\"aeb-code-input__tip\">{{ tip() }}</span>\n}\n<div\n class=\"aeb-code-input__field-wrapper\"\n (click)=\"input.focus(); isFocus = true\"\n>\n <input\n class=\"aeb-code-input__field\"\n #input\n [
|
|
486
|
+
], viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (title()) {\n<h2 class=\"aeb-code-input__title\">{{ title() }}</h2>\n} @if (tip()) {\n<span class=\"aeb-code-input__tip\">{{ tip() }}</span>\n}\n<div\n class=\"aeb-code-input__field-wrapper\"\n (click)=\"input.focus(); isFocus = true\"\n>\n <input\n class=\"aeb-code-input__field\"\n #input\n [value]=\"inputValue\"\n [disabled]=\"disabled\"\n inputmode=\"numeric\"\n [autofocus]=\"isAutofocus()\"\n autocomplete=\"one-time-code\"\n pattern=\"[0-9]*\"\n (blur)=\"handleInputBlur()\"\n (input)=\"inputChangeHandler($event)\"\n (compositionstart)=\"inputChangeHandler($event)\"\n (compositionend)=\"inputChangeHandler($event)\"\n />\n @for (value of [].constructor(codeLength()); track $index) {\n <span\n class=\"aeb-code-input__field-input\"\n [ngClass]=\"{\n 'aeb-code-input__field-input--active':\n inputValue.length === $index && isFocus && !disabled,\n 'aeb-code-input__field-input--has-error': hasError()\n }\"\n >\n {{ arrayInputValue[$index] }}\n <div\n [ngClass]=\"{\n 'aeb-code-input__field-input-caret':\n inputValue.length === $index && isFocus && !disabled,\n 'aeb-code-input__field-input-caret--has-error':\n inputValue.length === $index && isFocus && !disabled && hasError()\n }\"\n ></div>\n </span>\n }\n</div>\n@if (hasError() || isResendable()) {\n<div class=\"aeb-code-input__text\">\n @if (hasError()) {\n <span class=\"aeb-code-input__text-wrong\">{{ errorMessage() }}</span>\n } @if (isResendable()) { @if (showTimer()) {\n <div class=\"aeb-code-input__text-wrapper\">\n <span class=\"aeb-code-input__text-info\"\n >\u0417\u0430\u043F\u0440\u043E\u0441\u0438\u0442\u044C \u043F\u043E\u0432\u0442\u043E\u0440\u043D\u0443\u044E \u043E\u0442\u043F\u0440\u0430\u0432\u043A\u0443 \u043C\u043E\u0436\u043D\u043E \u0447\u0435\u0440\u0435\u0437\n </span>\n <span class=\"aeb-code-input__text-time\">{{ seconds() }}</span>\n </div>\n } @if (showCodeText()) {\n <span class=\"aeb-code-input__text-again\" (click)=\"resend()\"\n >\u041E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C \u043A\u043E\u0434 \u043F\u043E\u0432\u0442\u043E\u0440\u043D\u043E</span\n >\n } }\n</div>\n}\n", styles: [".aeb-code-input{display:flex;flex-direction:column;align-items:center;color:var(--c-t-primary);background-color:none}@media screen and (max-width:599px){.aeb-code-input{width:100%;box-sizing:border-box}}.aeb-code-input__field-wrapper{position:relative;display:flex;justify-content:center;gap:16px}.aeb-code-input__field{position:absolute;width:100%;height:56px;box-sizing:border-box;background:transparent;border:none;color:transparent;outline:none;-webkit-user-select:none;user-select:none;caret-color:transparent;z-index:var(--z-dropdown);pointer-events:none}.aeb-code-input__field::selection{background:transparent}.aeb-code-input__field-input{width:56px;height:64px;display:flex;justify-content:center;align-items:center;border:var(--border-skinny) solid var(--c-bg-surface-medium);border-radius:var(--border-rounded);box-sizing:border-box;font-size:var(--font-size-lm);font-weight:500;cursor:text}@media screen and (max-width:599px){.aeb-code-input__field-input{width:48px;height:56px;font-size:var(--font-size-l)}}.aeb-code-input__field-input--active{border:var(--border-skinny) solid var(--c-t-links)}.aeb-code-input__field-input--has-error{border:var(--border-skinny) solid var(--c-t-critical);background-color:var(--c-btn-ws-default)}.aeb-code-input__field-input-caret{width:2px;height:24px;background-color:var(--c-t-links);animation-name:flicker;animation-duration:1s;animation-iteration-count:infinite}.aeb-code-input__field-input-caret--has-error{background-color:var(--c-t-critical)}@keyframes flicker{0%{opacity:0}to{opacity:1}}.aeb-code-input__title{width:fit-content;margin:0 0 16px;font-size:var(--font-size-l);text-align:center;font-weight:500}@media screen and (max-width:599px){.aeb-code-input__title{font-size:18px;margin:0 0 8px}}.aeb-code-input__tip{margin-bottom:32px;text-align:center;color:var(--c-t-secondary)}@media screen and (max-width:599px){.aeb-code-input__tip{font-size:14px;margin-bottom:24px}}.aeb-code-input__text{display:flex;flex-direction:column;align-items:center;margin-top:32px;font-size:var(--font-size-s);line-height:20px}@media screen and (max-width:599px){.aeb-code-input__text{margin-top:24px;font-size:14px}}.aeb-code-input__text-wrapper{text-align:center}.aeb-code-input__text-info{color:var(--c-t-secondary)}.aeb-code-input__text-time{color:var(--c-t-links)}.aeb-code-input__text-again{color:var(--c-t-links);cursor:pointer}.aeb-code-input__text-wrong{color:var(--c-t-critical);text-align:center;font-size:16px}@media screen and (max-width:599px){.aeb-code-input__text-wrong{font-size:12px}}\n"], dependencies: [{ kind: "directive", type: AutofocusDirective, selector: "[autofocus]", inputs: ["autofocus"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
463
487
|
}
|
|
464
488
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: CodeInput, decorators: [{
|
|
465
489
|
type: Component,
|
|
@@ -471,7 +495,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
471
495
|
}
|
|
472
496
|
], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [AutofocusDirective, NgClass], host: {
|
|
473
497
|
class: 'aeb-code-input'
|
|
474
|
-
}, template: "@if (title()) {\n<h2 class=\"aeb-code-input__title\">{{ title() }}</h2>\n} @if (tip()) {\n<span class=\"aeb-code-input__tip\">{{ tip() }}</span>\n}\n<div\n class=\"aeb-code-input__field-wrapper\"\n (click)=\"input.focus(); isFocus = true\"\n>\n <input\n class=\"aeb-code-input__field\"\n #input\n [
|
|
498
|
+
}, template: "@if (title()) {\n<h2 class=\"aeb-code-input__title\">{{ title() }}</h2>\n} @if (tip()) {\n<span class=\"aeb-code-input__tip\">{{ tip() }}</span>\n}\n<div\n class=\"aeb-code-input__field-wrapper\"\n (click)=\"input.focus(); isFocus = true\"\n>\n <input\n class=\"aeb-code-input__field\"\n #input\n [value]=\"inputValue\"\n [disabled]=\"disabled\"\n inputmode=\"numeric\"\n [autofocus]=\"isAutofocus()\"\n autocomplete=\"one-time-code\"\n pattern=\"[0-9]*\"\n (blur)=\"handleInputBlur()\"\n (input)=\"inputChangeHandler($event)\"\n (compositionstart)=\"inputChangeHandler($event)\"\n (compositionend)=\"inputChangeHandler($event)\"\n />\n @for (value of [].constructor(codeLength()); track $index) {\n <span\n class=\"aeb-code-input__field-input\"\n [ngClass]=\"{\n 'aeb-code-input__field-input--active':\n inputValue.length === $index && isFocus && !disabled,\n 'aeb-code-input__field-input--has-error': hasError()\n }\"\n >\n {{ arrayInputValue[$index] }}\n <div\n [ngClass]=\"{\n 'aeb-code-input__field-input-caret':\n inputValue.length === $index && isFocus && !disabled,\n 'aeb-code-input__field-input-caret--has-error':\n inputValue.length === $index && isFocus && !disabled && hasError()\n }\"\n ></div>\n </span>\n }\n</div>\n@if (hasError() || isResendable()) {\n<div class=\"aeb-code-input__text\">\n @if (hasError()) {\n <span class=\"aeb-code-input__text-wrong\">{{ errorMessage() }}</span>\n } @if (isResendable()) { @if (showTimer()) {\n <div class=\"aeb-code-input__text-wrapper\">\n <span class=\"aeb-code-input__text-info\"\n >\u0417\u0430\u043F\u0440\u043E\u0441\u0438\u0442\u044C \u043F\u043E\u0432\u0442\u043E\u0440\u043D\u0443\u044E \u043E\u0442\u043F\u0440\u0430\u0432\u043A\u0443 \u043C\u043E\u0436\u043D\u043E \u0447\u0435\u0440\u0435\u0437\n </span>\n <span class=\"aeb-code-input__text-time\">{{ seconds() }}</span>\n </div>\n } @if (showCodeText()) {\n <span class=\"aeb-code-input__text-again\" (click)=\"resend()\"\n >\u041E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C \u043A\u043E\u0434 \u043F\u043E\u0432\u0442\u043E\u0440\u043D\u043E</span\n >\n } }\n</div>\n}\n", styles: [".aeb-code-input{display:flex;flex-direction:column;align-items:center;color:var(--c-t-primary);background-color:none}@media screen and (max-width:599px){.aeb-code-input{width:100%;box-sizing:border-box}}.aeb-code-input__field-wrapper{position:relative;display:flex;justify-content:center;gap:16px}.aeb-code-input__field{position:absolute;width:100%;height:56px;box-sizing:border-box;background:transparent;border:none;color:transparent;outline:none;-webkit-user-select:none;user-select:none;caret-color:transparent;z-index:var(--z-dropdown);pointer-events:none}.aeb-code-input__field::selection{background:transparent}.aeb-code-input__field-input{width:56px;height:64px;display:flex;justify-content:center;align-items:center;border:var(--border-skinny) solid var(--c-bg-surface-medium);border-radius:var(--border-rounded);box-sizing:border-box;font-size:var(--font-size-lm);font-weight:500;cursor:text}@media screen and (max-width:599px){.aeb-code-input__field-input{width:48px;height:56px;font-size:var(--font-size-l)}}.aeb-code-input__field-input--active{border:var(--border-skinny) solid var(--c-t-links)}.aeb-code-input__field-input--has-error{border:var(--border-skinny) solid var(--c-t-critical);background-color:var(--c-btn-ws-default)}.aeb-code-input__field-input-caret{width:2px;height:24px;background-color:var(--c-t-links);animation-name:flicker;animation-duration:1s;animation-iteration-count:infinite}.aeb-code-input__field-input-caret--has-error{background-color:var(--c-t-critical)}@keyframes flicker{0%{opacity:0}to{opacity:1}}.aeb-code-input__title{width:fit-content;margin:0 0 16px;font-size:var(--font-size-l);text-align:center;font-weight:500}@media screen and (max-width:599px){.aeb-code-input__title{font-size:18px;margin:0 0 8px}}.aeb-code-input__tip{margin-bottom:32px;text-align:center;color:var(--c-t-secondary)}@media screen and (max-width:599px){.aeb-code-input__tip{font-size:14px;margin-bottom:24px}}.aeb-code-input__text{display:flex;flex-direction:column;align-items:center;margin-top:32px;font-size:var(--font-size-s);line-height:20px}@media screen and (max-width:599px){.aeb-code-input__text{margin-top:24px;font-size:14px}}.aeb-code-input__text-wrapper{text-align:center}.aeb-code-input__text-info{color:var(--c-t-secondary)}.aeb-code-input__text-time{color:var(--c-t-links)}.aeb-code-input__text-again{color:var(--c-t-links);cursor:pointer}.aeb-code-input__text-wrong{color:var(--c-t-critical);text-align:center;font-size:16px}@media screen and (max-width:599px){.aeb-code-input__text-wrong{font-size:12px}}\n"] }]
|
|
475
499
|
}], ctorParameters: () => [], propDecorators: { input: [{ type: i0.ViewChild, args: ['input', { isSignal: true }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], tip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tip", required: false }] }], initialDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialDisabled", required: false }] }], hasError: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasError", required: false }] }], isResendable: [{ type: i0.Input, args: [{ isSignal: true, alias: "isResendable", required: false }] }], secondsUntilRetry: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondsUntilRetry", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], codeLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "codeLength", required: false }] }], isAutofocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "isAutofocus", required: false }] }], codeCompleted: [{ type: i0.Output, args: ["codeCompleted"] }], timeOut: [{ type: i0.Output, args: ["timeOut"] }], resendClick: [{ type: i0.Output, args: ["resendClick"] }] } });
|
|
476
500
|
|
|
477
501
|
class CodeInputModule {
|
|
@@ -502,11 +526,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
502
526
|
class FormFieldDirective {
|
|
503
527
|
constructor() {
|
|
504
528
|
this.elementRef = inject(ElementRef);
|
|
529
|
+
this.focused = signal(false, ...(ngDevMode ? [{ debugName: "focused" }] : /* istanbul ignore next */ []));
|
|
505
530
|
this._value = '';
|
|
506
531
|
this.ngControl = inject(NgControl, { optional: true, self: true });
|
|
507
|
-
this.isFocused = false;
|
|
508
532
|
this.hasValue = false;
|
|
509
533
|
}
|
|
534
|
+
get isFocused() {
|
|
535
|
+
return this.focused();
|
|
536
|
+
}
|
|
510
537
|
get isDisabled() {
|
|
511
538
|
if (this.ngControl) {
|
|
512
539
|
return this.ngControl?.disabled || null;
|
|
@@ -543,10 +570,10 @@ class FormFieldDirective {
|
|
|
543
570
|
this.value = target.value;
|
|
544
571
|
}
|
|
545
572
|
focus() {
|
|
546
|
-
this.
|
|
573
|
+
this.focused.set(true);
|
|
547
574
|
}
|
|
548
575
|
blur() {
|
|
549
|
-
this.
|
|
576
|
+
this.focused.set(false);
|
|
550
577
|
}
|
|
551
578
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: FormFieldDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
552
579
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.12", type: FormFieldDirective, isStandalone: true, selector: "input[aebInput], textarea[aebTextarea]", inputs: { value: "value" }, host: { listeners: { "input": " change($any($event.target))", "focus": "focus()", "blur": "blur()" }, properties: { "attr.disabled": "isDisabled" }, classAttribute: "aeb-input" }, ngImport: i0 }); }
|
|
@@ -594,6 +621,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
594
621
|
class FormField {
|
|
595
622
|
constructor() {
|
|
596
623
|
this._formField = contentChild(FormFieldDirective, ...(ngDevMode ? [{ debugName: "_formField" }] : /* istanbul ignore next */ []));
|
|
624
|
+
this.changeDetectorRef = inject(ChangeDetectorRef);
|
|
597
625
|
this.showDescription = input(false, ...(ngDevMode ? [{ debugName: "showDescription" }] : /* istanbul ignore next */ []));
|
|
598
626
|
this.showErrorMessage = input(true, ...(ngDevMode ? [{ debugName: "showErrorMessage" }] : /* istanbul ignore next */ []));
|
|
599
627
|
this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
@@ -603,6 +631,15 @@ class FormField {
|
|
|
603
631
|
effect(() => {
|
|
604
632
|
this.applyDisabledState();
|
|
605
633
|
});
|
|
634
|
+
effect((onCleanup) => {
|
|
635
|
+
const control = this.formField?.ngControl?.control;
|
|
636
|
+
if (!control) {
|
|
637
|
+
return;
|
|
638
|
+
}
|
|
639
|
+
const events = control.events ?? merge(control.statusChanges, control.valueChanges);
|
|
640
|
+
const subscription = events.subscribe(() => this.changeDetectorRef.markForCheck());
|
|
641
|
+
onCleanup(() => subscription.unsubscribe());
|
|
642
|
+
});
|
|
606
643
|
}
|
|
607
644
|
get formField() {
|
|
608
645
|
return this._formField();
|
|
@@ -637,6 +674,15 @@ class FormField {
|
|
|
637
674
|
}
|
|
638
675
|
return false;
|
|
639
676
|
}
|
|
677
|
+
get errorMessageVisible() {
|
|
678
|
+
return (this.showErrorMessage() &&
|
|
679
|
+
this.error &&
|
|
680
|
+
!this.isDisabled &&
|
|
681
|
+
!this.isFocused);
|
|
682
|
+
}
|
|
683
|
+
get descriptionVisible() {
|
|
684
|
+
return this.showDescription() && !this.error && !this.isDisabled;
|
|
685
|
+
}
|
|
640
686
|
get isDisabled() {
|
|
641
687
|
if (this.disabled()) {
|
|
642
688
|
return true;
|
|
@@ -668,13 +714,17 @@ class FormField {
|
|
|
668
714
|
}
|
|
669
715
|
}
|
|
670
716
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: FormField, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
671
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
717
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.12", type: FormField, isStandalone: true, selector: "aeb-form-field", inputs: { showDescription: { classPropertyName: "showDescription", publicName: "showDescription", isSignal: true, isRequired: false, transformFunction: null }, showErrorMessage: { classPropertyName: "showErrorMessage", publicName: "showErrorMessage", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, isInvalid: { classPropertyName: "isInvalid", publicName: "isInvalid", isSignal: true, isRequired: false, transformFunction: null }, showIcon: { classPropertyName: "showIcon", publicName: "showIcon", isSignal: true, isRequired: false, transformFunction: null }, validateOnDirty: { classPropertyName: "validateOnDirty", publicName: "validateOnDirty", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.aeb-form-field--focused": "focused", "class.aeb-form-field--has-value": "hasValue", "class.aeb-form-field--error": "error", "class.aeb-form-field--disabled": "isDisabled", "class.aeb-form-field--has-icon": "hasIcon" }, classAttribute: "aeb-form-field" }, queries: [{ propertyName: "_formField", first: true, predicate: FormFieldDirective, descendants: true, isSignal: true }], ngImport: i0, template: "<ng-content />\n\n<div class=\"aeb-label__container\">\n <ng-content select=\"[aebLabel]\" />\n</div>\n\n<ng-content select=\"[aebIcon]\" />\n<div\n [@labelVisibility]=\"errorMessageVisible ? 'visible' : 'hidden'\"\n class=\"aeb-form-field--error-message\"\n>\n <ng-content select=\"[errorMessage]\" />\n</div>\n<div\n [@labelVisibility]=\"descriptionVisible ? 'visible' : 'hidden'\"\n class=\"aeb-form-field--description\"\n>\n <ng-content select=\"[description]\" />\n</div>\n", styles: [".aeb-form-field{--border-color-default: var(--c-bg-surface-medium);--border-color-hovered: var(--c-bg-surface);--border-color-active: var(--c-btn-p-default);--border-color-disabled: var(--c-bg-surface-medium);--border-color-warning-default: var(--c-btn-ws-pressed);--border-color-warning-hovered: var(--c-btn-ws-default);--border-color-warning-focused: var(--c-btn-w-default);--border-color-warning-disabled: var(--c-btn-ws-pressed);--background-color-default: var(--c-bg-surface-medium);--background-color-hovered: var(--c-bg-surface);--background-color-focused: var(--c-bg-default);--background-color-disabled: var(--c-bg-surface-medium);--background-color-warning-default: var(--c-btn-ws-pressed);--background-color-warning-hovered: var(--c-btn-ws-default);--background-color-warning-focused: var(--c-bg-default);--background-color-warning-disabled: var(--c-btn-ws-pressed);--label-color-default: var(--c-t-secondary);--label-color-active: var(--c-t-secondary);--label-color-disabled: var(--c-t-secondary);--input-text-color-default: var(--c-t-primary);--input-text-color-disabled: var(--c-t-secondary);--error-text-color: var(--c-t-critical);position:relative;display:flex;flex-direction:column;color:var(--label-color-default)}.aeb-form-field.aeb-form-field--error .aeb-input{border-color:var(--border-color-warning-default);background-color:var(--background-color-warning-default)}.aeb-form-field.aeb-form-field--error .aeb-input:hover{border-color:var(--border-color-warning-hovered);background-color:var(--background-color-warning-hovered)}.aeb-form-field.aeb-form-field--error .aeb-input:focus{border-color:var(--border-color-warning-focused);background-color:var(--background-color-warning-focused)}.aeb-form-field.aeb-form-field--error .aeb-input:disabled{border-color:var(--border-color-warning-disabled);background-color:var(--background-color-warning-disabled)}.aeb-form-field.aeb-form-field--error .aeb-label__container{color:var(--label-color-error)}.aeb-form-field--focused .aeb-form-field--description{color:var(--label-color-active)}.aeb-form-field--error-message{padding:8px 0;font-size:var(--font-size-xxs);color:var(--error-text-color);overflow-wrap:break-word}.aeb-form-field--error-message:has(*:empty){display:none}.aeb-form-field--description{padding:8px 0;font-size:var(--font-size-xxs);color:var(--input-text-color-disabled);overflow-wrap:break-word}.aeb-form-field.aeb-form-field--disabled .aeb-input{border:var(--border-thin) solid var(--border-color-disabled);color:var(--input-text-color-disabled);background-color:var(--background-color-disabled)}.aeb-form-field.aeb-form-field--disabled .aeb-label__container{color:var(--label-color-disabled)}.aeb-form-field .aeb-input{display:block;box-sizing:border-box;width:100%;min-height:auto;color:var(--input-text-color-default);padding:24px 16px 7px;font-size:16px;border:var(--border-thin) solid var(--border-color-default);background-color:var(--background-color-default);border-radius:var(--border-medium-rounded);box-shadow:none;transition:all ease-in-out .2s linear;font-weight:300}.aeb-form-field .aeb-input:hover{background-color:var(--background-color-hovered);border:var(--border-thin) solid var(--border-color-hovered)}.aeb-form-field .aeb-input:focus{outline:none;background-color:var(--background-color-focused);border:var(--border-thin) solid var(--background-color-focused)}.aeb-form-field .aeb-input,.aeb-form-field .aeb-input::-webkit-search-cancel-button,.aeb-form-field .aeb-input::-webkit-search-decoration,.aeb-form-field .aeb-input::-webkit-search-results-button,.aeb-form-field .aeb-input::-webkit-search-results-decoration{appearance:none}.aeb-form-field .aeb-input::-webkit-contacts-auto-fill-button,.aeb-form-field .aeb-input::-webkit-caps-lock-indicator,.aeb-form-field .aeb-input::-webkit-credentials-auto-fill-button{visibility:hidden}.aeb-form-field .aeb-input::-webkit-outer-spin-button,.aeb-form-field .aeb-input::-webkit-inner-spin-button{appearance:none;margin:0}.aeb-form-field .aeb-input[type=number]{appearance:textfield}.aeb-form-field textarea{resize:vertical;cursor:auto;scroll-behavior:smooth}.aeb-form-field textarea.aeb-input{min-height:70px;scrollbar-color:var(--color-blue-50) transparent;scrollbar-width:thin}.aeb-form-field textarea.aeb-input::-webkit-scrollbar{width:16px}.aeb-form-field textarea.aeb-input::-webkit-scrollbar-thumb{border:6px solid rgba(0,0,0,0);background-color:var(--color-blue-50);background-clip:padding-box;border-radius:9999px}.aeb-form-field textarea.aeb-input::-webkit-scrollbar-corner{background-color:transparent}.aeb-form-field textarea.aeb-input::-webkit-resizer{background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNSIgaGVpZ2h0PSI1IiB2aWV3Qm94PSIwIDAgNSA1IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPg0KPHBhdGggZD0iTTMuMjc5NTMgNC44Mzg1NkMzLjA2NDI3IDUuMDUzODEgMi43MTUyNyA1LjA1MzgxIDIuNTAwMDEgNC44Mzg1NkMyLjI4NDc1IDQuNjIzMyAyLjI4NDc1IDQuMjc0MyAyLjUwMDAxIDQuMDU5MDVMNC4wNTkwNCAyLjUwMDAzQzQuMjc0MyAyLjI4NDc3IDQuNjIzMyAyLjI4NDc3IDQuODM4NTYgMi41MDAwM0M1LjA1MzgxIDIuNzE1MjggNS4wNTM4MSAzLjA2NDI4IDQuODM4NTYgMy4yNzk1NEwzLjI3OTUzIDQuODM4NTZaIiBmaWxsPSIjM0I0MDRBIi8+DQo8cGF0aCBkPSJNMC45NDA5NTkgNC4wNTlDMC43MjU3MDIgNC4yNzQyNSAwLjM3NjcgNC4yNzQyNSAwLjE2MTQ0MyA0LjA1OUMtMC4wNTM4MTQzIDMuODQzNzQgLTAuMDUzODE0NCAzLjQ5NDc0IDAuMTYxNDQzIDMuMjc5NDlMMy4yNzk1MSAwLjE2MTQ0MkMzLjQ5NDc2IC0wLjA1MzgxNCAzLjg0Mzc2IC0wLjA1MzgxNCA0LjA1OTAyIDAuMTYxNDQyQzQuMjc0MjggMC4zNzY2OTggNC4yNzQyOCAwLjcyNTY5NyA0LjA1OTAyIDAuOTQwOTUzTDAuOTQwOTU5IDQuMDU5WiIgZmlsbD0iIzNCNDA0QSIvPg0KPC9zdmc+DQo=);background-repeat:no-repeat;background-position:center}.aeb-form-field .aeb-label__container{display:inline-block;position:absolute;top:16px;left:16px;max-width:calc(100% - 32px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:16px;pointer-events:none;background-color:#0000;transition:all .2s ease-out;box-sizing:border-box;-webkit-user-select:none;user-select:none;font-weight:300}.aeb-form-field.aeb-form-field--focused .aeb-label__container,.aeb-form-field.aeb-form-field--has-value .aeb-label__container{line-height:14px;top:8px;font-size:var(--font-size-xxs)}.aeb-form-field.aeb-form-field--focused .aeb-input{border-color:var(--border-color-active)}.aeb-form-field.aeb-form-field--focused .aeb-label__container{color:var(--label-color-active)}.aeb-form-field.aeb-form-field--has-icon .aeb-input{padding-right:38px}.aeb-form-field.aeb-form-field--has-icon .aeb-label__container{max-width:calc(100% - 56px)}.aeb-form-field:not(.aeb-form-field--has-icon) *[aebIcon]{display:none}.aeb-form-field *[aebIcon]{position:absolute;top:16px;right:12px;width:24px;height:24px;-webkit-user-select:none;user-select:none}.aeb-form-field *[aebIcon] img{width:24px;height:24px}\n"], animations: [
|
|
672
718
|
trigger('labelVisibility', [
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
719
|
+
state('visible', style({ display: 'block', 'font-size': 'var(--font-size-xxs)' })),
|
|
720
|
+
state('hidden', style({ display: 'none', 'font-size': '0' })),
|
|
721
|
+
transition('void => visible, hidden => visible', [
|
|
722
|
+
style({ display: 'block', 'font-size': '0' }),
|
|
723
|
+
animate('.1s')
|
|
676
724
|
]),
|
|
677
|
-
transition('
|
|
725
|
+
transition('visible => hidden', [
|
|
726
|
+
animate('.05s', style({ 'font-size': '0' }))
|
|
727
|
+
])
|
|
678
728
|
])
|
|
679
729
|
], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
680
730
|
}
|
|
@@ -689,13 +739,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
689
739
|
'[class.aeb-form-field--has-icon]': 'hasIcon'
|
|
690
740
|
}, animations: [
|
|
691
741
|
trigger('labelVisibility', [
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
742
|
+
state('visible', style({ display: 'block', 'font-size': 'var(--font-size-xxs)' })),
|
|
743
|
+
state('hidden', style({ display: 'none', 'font-size': '0' })),
|
|
744
|
+
transition('void => visible, hidden => visible', [
|
|
745
|
+
style({ display: 'block', 'font-size': '0' }),
|
|
746
|
+
animate('.1s')
|
|
695
747
|
]),
|
|
696
|
-
transition('
|
|
748
|
+
transition('visible => hidden', [
|
|
749
|
+
animate('.05s', style({ 'font-size': '0' }))
|
|
750
|
+
])
|
|
697
751
|
])
|
|
698
|
-
], template: "<ng-content />\n\n<div class=\"aeb-label__container\">\n <ng-content select=\"[aebLabel]\" />\n</div>\n\n
|
|
752
|
+
], template: "<ng-content />\n\n<div class=\"aeb-label__container\">\n <ng-content select=\"[aebLabel]\" />\n</div>\n\n<ng-content select=\"[aebIcon]\" />\n<div\n [@labelVisibility]=\"errorMessageVisible ? 'visible' : 'hidden'\"\n class=\"aeb-form-field--error-message\"\n>\n <ng-content select=\"[errorMessage]\" />\n</div>\n<div\n [@labelVisibility]=\"descriptionVisible ? 'visible' : 'hidden'\"\n class=\"aeb-form-field--description\"\n>\n <ng-content select=\"[description]\" />\n</div>\n", styles: [".aeb-form-field{--border-color-default: var(--c-bg-surface-medium);--border-color-hovered: var(--c-bg-surface);--border-color-active: var(--c-btn-p-default);--border-color-disabled: var(--c-bg-surface-medium);--border-color-warning-default: var(--c-btn-ws-pressed);--border-color-warning-hovered: var(--c-btn-ws-default);--border-color-warning-focused: var(--c-btn-w-default);--border-color-warning-disabled: var(--c-btn-ws-pressed);--background-color-default: var(--c-bg-surface-medium);--background-color-hovered: var(--c-bg-surface);--background-color-focused: var(--c-bg-default);--background-color-disabled: var(--c-bg-surface-medium);--background-color-warning-default: var(--c-btn-ws-pressed);--background-color-warning-hovered: var(--c-btn-ws-default);--background-color-warning-focused: var(--c-bg-default);--background-color-warning-disabled: var(--c-btn-ws-pressed);--label-color-default: var(--c-t-secondary);--label-color-active: var(--c-t-secondary);--label-color-disabled: var(--c-t-secondary);--input-text-color-default: var(--c-t-primary);--input-text-color-disabled: var(--c-t-secondary);--error-text-color: var(--c-t-critical);position:relative;display:flex;flex-direction:column;color:var(--label-color-default)}.aeb-form-field.aeb-form-field--error .aeb-input{border-color:var(--border-color-warning-default);background-color:var(--background-color-warning-default)}.aeb-form-field.aeb-form-field--error .aeb-input:hover{border-color:var(--border-color-warning-hovered);background-color:var(--background-color-warning-hovered)}.aeb-form-field.aeb-form-field--error .aeb-input:focus{border-color:var(--border-color-warning-focused);background-color:var(--background-color-warning-focused)}.aeb-form-field.aeb-form-field--error .aeb-input:disabled{border-color:var(--border-color-warning-disabled);background-color:var(--background-color-warning-disabled)}.aeb-form-field.aeb-form-field--error .aeb-label__container{color:var(--label-color-error)}.aeb-form-field--focused .aeb-form-field--description{color:var(--label-color-active)}.aeb-form-field--error-message{padding:8px 0;font-size:var(--font-size-xxs);color:var(--error-text-color);overflow-wrap:break-word}.aeb-form-field--error-message:has(*:empty){display:none}.aeb-form-field--description{padding:8px 0;font-size:var(--font-size-xxs);color:var(--input-text-color-disabled);overflow-wrap:break-word}.aeb-form-field.aeb-form-field--disabled .aeb-input{border:var(--border-thin) solid var(--border-color-disabled);color:var(--input-text-color-disabled);background-color:var(--background-color-disabled)}.aeb-form-field.aeb-form-field--disabled .aeb-label__container{color:var(--label-color-disabled)}.aeb-form-field .aeb-input{display:block;box-sizing:border-box;width:100%;min-height:auto;color:var(--input-text-color-default);padding:24px 16px 7px;font-size:16px;border:var(--border-thin) solid var(--border-color-default);background-color:var(--background-color-default);border-radius:var(--border-medium-rounded);box-shadow:none;transition:all ease-in-out .2s linear;font-weight:300}.aeb-form-field .aeb-input:hover{background-color:var(--background-color-hovered);border:var(--border-thin) solid var(--border-color-hovered)}.aeb-form-field .aeb-input:focus{outline:none;background-color:var(--background-color-focused);border:var(--border-thin) solid var(--background-color-focused)}.aeb-form-field .aeb-input,.aeb-form-field .aeb-input::-webkit-search-cancel-button,.aeb-form-field .aeb-input::-webkit-search-decoration,.aeb-form-field .aeb-input::-webkit-search-results-button,.aeb-form-field .aeb-input::-webkit-search-results-decoration{appearance:none}.aeb-form-field .aeb-input::-webkit-contacts-auto-fill-button,.aeb-form-field .aeb-input::-webkit-caps-lock-indicator,.aeb-form-field .aeb-input::-webkit-credentials-auto-fill-button{visibility:hidden}.aeb-form-field .aeb-input::-webkit-outer-spin-button,.aeb-form-field .aeb-input::-webkit-inner-spin-button{appearance:none;margin:0}.aeb-form-field .aeb-input[type=number]{appearance:textfield}.aeb-form-field textarea{resize:vertical;cursor:auto;scroll-behavior:smooth}.aeb-form-field textarea.aeb-input{min-height:70px;scrollbar-color:var(--color-blue-50) transparent;scrollbar-width:thin}.aeb-form-field textarea.aeb-input::-webkit-scrollbar{width:16px}.aeb-form-field textarea.aeb-input::-webkit-scrollbar-thumb{border:6px solid rgba(0,0,0,0);background-color:var(--color-blue-50);background-clip:padding-box;border-radius:9999px}.aeb-form-field textarea.aeb-input::-webkit-scrollbar-corner{background-color:transparent}.aeb-form-field textarea.aeb-input::-webkit-resizer{background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNSIgaGVpZ2h0PSI1IiB2aWV3Qm94PSIwIDAgNSA1IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPg0KPHBhdGggZD0iTTMuMjc5NTMgNC44Mzg1NkMzLjA2NDI3IDUuMDUzODEgMi43MTUyNyA1LjA1MzgxIDIuNTAwMDEgNC44Mzg1NkMyLjI4NDc1IDQuNjIzMyAyLjI4NDc1IDQuMjc0MyAyLjUwMDAxIDQuMDU5MDVMNC4wNTkwNCAyLjUwMDAzQzQuMjc0MyAyLjI4NDc3IDQuNjIzMyAyLjI4NDc3IDQuODM4NTYgMi41MDAwM0M1LjA1MzgxIDIuNzE1MjggNS4wNTM4MSAzLjA2NDI4IDQuODM4NTYgMy4yNzk1NEwzLjI3OTUzIDQuODM4NTZaIiBmaWxsPSIjM0I0MDRBIi8+DQo8cGF0aCBkPSJNMC45NDA5NTkgNC4wNTlDMC43MjU3MDIgNC4yNzQyNSAwLjM3NjcgNC4yNzQyNSAwLjE2MTQ0MyA0LjA1OUMtMC4wNTM4MTQzIDMuODQzNzQgLTAuMDUzODE0NCAzLjQ5NDc0IDAuMTYxNDQzIDMuMjc5NDlMMy4yNzk1MSAwLjE2MTQ0MkMzLjQ5NDc2IC0wLjA1MzgxNCAzLjg0Mzc2IC0wLjA1MzgxNCA0LjA1OTAyIDAuMTYxNDQyQzQuMjc0MjggMC4zNzY2OTggNC4yNzQyOCAwLjcyNTY5NyA0LjA1OTAyIDAuOTQwOTUzTDAuOTQwOTU5IDQuMDU5WiIgZmlsbD0iIzNCNDA0QSIvPg0KPC9zdmc+DQo=);background-repeat:no-repeat;background-position:center}.aeb-form-field .aeb-label__container{display:inline-block;position:absolute;top:16px;left:16px;max-width:calc(100% - 32px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:16px;pointer-events:none;background-color:#0000;transition:all .2s ease-out;box-sizing:border-box;-webkit-user-select:none;user-select:none;font-weight:300}.aeb-form-field.aeb-form-field--focused .aeb-label__container,.aeb-form-field.aeb-form-field--has-value .aeb-label__container{line-height:14px;top:8px;font-size:var(--font-size-xxs)}.aeb-form-field.aeb-form-field--focused .aeb-input{border-color:var(--border-color-active)}.aeb-form-field.aeb-form-field--focused .aeb-label__container{color:var(--label-color-active)}.aeb-form-field.aeb-form-field--has-icon .aeb-input{padding-right:38px}.aeb-form-field.aeb-form-field--has-icon .aeb-label__container{max-width:calc(100% - 56px)}.aeb-form-field:not(.aeb-form-field--has-icon) *[aebIcon]{display:none}.aeb-form-field *[aebIcon]{position:absolute;top:16px;right:12px;width:24px;height:24px;-webkit-user-select:none;user-select:none}.aeb-form-field *[aebIcon] img{width:24px;height:24px}\n"] }]
|
|
699
753
|
}], ctorParameters: () => [], propDecorators: { _formField: [{ type: i0.ContentChild, args: [i0.forwardRef(() => FormFieldDirective), { isSignal: true }] }], showDescription: [{ type: i0.Input, args: [{ isSignal: true, alias: "showDescription", required: false }] }], showErrorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "showErrorMessage", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], isInvalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "isInvalid", required: false }] }], showIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "showIcon", required: false }] }], validateOnDirty: [{ type: i0.Input, args: [{ isSignal: true, alias: "validateOnDirty", required: false }] }] } });
|
|
700
754
|
|
|
701
755
|
class FormFieldModule {
|
package/package.json
CHANGED
package/types/aeb-ui-kit.d.ts
CHANGED
|
@@ -37,14 +37,15 @@ declare class ButtonModule {
|
|
|
37
37
|
static ɵinj: _angular_core.ɵɵInjectorDeclaration<ButtonModule>;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
type CodeLength = 4 | 6;
|
|
40
|
+
type CodeLength = 2 | 4 | 6;
|
|
41
41
|
declare class CodeInput implements OnInit, OnDestroy, ControlValueAccessor {
|
|
42
42
|
private readonly _destroy$;
|
|
43
43
|
private _timerSub;
|
|
44
|
+
private _isComposing;
|
|
44
45
|
private _disabled;
|
|
45
46
|
private _isFocus;
|
|
46
47
|
private _inputValue;
|
|
47
|
-
readonly input: _angular_core.Signal<ElementRef<
|
|
48
|
+
readonly input: _angular_core.Signal<ElementRef<HTMLInputElement> | undefined>;
|
|
48
49
|
readonly title: _angular_core.InputSignal<string | undefined>;
|
|
49
50
|
readonly tip: _angular_core.InputSignal<string | undefined>;
|
|
50
51
|
readonly initialDisabled: _angular_core.InputSignal<boolean>;
|
|
@@ -72,10 +73,9 @@ declare class CodeInput implements OnInit, OnDestroy, ControlValueAccessor {
|
|
|
72
73
|
ngOnInit(): void;
|
|
73
74
|
ngOnDestroy(): void;
|
|
74
75
|
inputChangeHandler(event: Event): void;
|
|
75
|
-
|
|
76
|
-
writeValue(value: string): void;
|
|
76
|
+
writeValue(value: string | null | undefined): void;
|
|
77
77
|
setDisabledState(isDisabled: boolean): void;
|
|
78
|
-
registerOnChange(fn: () => void): void;
|
|
78
|
+
registerOnChange(fn: (value: string) => void): void;
|
|
79
79
|
registerOnTouched(fn: () => void): void;
|
|
80
80
|
startTimer(): void;
|
|
81
81
|
stopTimer(): void;
|
|
@@ -84,6 +84,7 @@ declare class CodeInput implements OnInit, OnDestroy, ControlValueAccessor {
|
|
|
84
84
|
handleInputBlur(): void;
|
|
85
85
|
focus(): void;
|
|
86
86
|
private handleAutofocus;
|
|
87
|
+
private normalizeValue;
|
|
87
88
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CodeInput, never>;
|
|
88
89
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CodeInput, "aeb-code-input", never, { "title": { "alias": "title"; "required": false; "isSignal": true; }; "tip": { "alias": "tip"; "required": false; "isSignal": true; }; "initialDisabled": { "alias": "initialDisabled"; "required": false; "isSignal": true; }; "hasError": { "alias": "hasError"; "required": false; "isSignal": true; }; "isResendable": { "alias": "isResendable"; "required": false; "isSignal": true; }; "secondsUntilRetry": { "alias": "secondsUntilRetry"; "required": false; "isSignal": true; }; "errorMessage": { "alias": "errorMessage"; "required": false; "isSignal": true; }; "codeLength": { "alias": "codeLength"; "required": false; "isSignal": true; }; "isAutofocus": { "alias": "isAutofocus"; "required": false; "isSignal": true; }; }, { "codeCompleted": "codeCompleted"; "timeOut": "timeOut"; "resendClick": "resendClick"; }, never, never, true, never>;
|
|
89
90
|
}
|
|
@@ -192,10 +193,11 @@ declare class SidebarModule {
|
|
|
192
193
|
|
|
193
194
|
declare class FormFieldDirective {
|
|
194
195
|
private elementRef;
|
|
196
|
+
private readonly focused;
|
|
195
197
|
_value: string;
|
|
196
198
|
ngControl: NgControl | null;
|
|
197
|
-
isFocused: boolean;
|
|
198
199
|
hasValue: boolean;
|
|
200
|
+
get isFocused(): boolean;
|
|
199
201
|
get isDisabled(): true | null | undefined;
|
|
200
202
|
get value(): string;
|
|
201
203
|
set value(value: string);
|
|
@@ -210,6 +212,7 @@ declare class FormFieldDirective {
|
|
|
210
212
|
|
|
211
213
|
declare class FormField {
|
|
212
214
|
private readonly _formField;
|
|
215
|
+
private readonly changeDetectorRef;
|
|
213
216
|
readonly showDescription: _angular_core.InputSignal<boolean>;
|
|
214
217
|
readonly showErrorMessage: _angular_core.InputSignal<boolean>;
|
|
215
218
|
readonly disabled: _angular_core.InputSignal<boolean>;
|
|
@@ -221,6 +224,8 @@ declare class FormField {
|
|
|
221
224
|
get focused(): boolean;
|
|
222
225
|
get hasValue(): boolean;
|
|
223
226
|
get error(): boolean;
|
|
227
|
+
get errorMessageVisible(): boolean;
|
|
228
|
+
get descriptionVisible(): boolean;
|
|
224
229
|
get isDisabled(): boolean;
|
|
225
230
|
get hasIcon(): boolean;
|
|
226
231
|
get isFocused(): boolean;
|