aeb-ui-kit 9.1.0-preview.1093 → 9.1.0-preview.1098
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
CHANGED
|
@@ -4,7 +4,7 @@ import * as i1 from '@angular/common';
|
|
|
4
4
|
import { CommonModule, DOCUMENT, formatDate, formatNumber } from '@angular/common';
|
|
5
5
|
import * as i3 from '@angular/forms';
|
|
6
6
|
import { NG_VALUE_ACCESSOR, FormsModule, FormBuilder, FormControl, Validators, ReactiveFormsModule, NgControl } from '@angular/forms';
|
|
7
|
-
import { timer, map, takeUntil,
|
|
7
|
+
import { Subject, timer, map, takeUntil, Subscription, Observable, BehaviorSubject, withLatestFrom, filter, switchMap, take, merge, startWith, mergeMap, iif, of, tap, fromEvent, debounce, debounceTime } from 'rxjs';
|
|
8
8
|
import { trigger, state, transition, style, animate } from '@angular/animations';
|
|
9
9
|
import * as i2 from '@angular/platform-browser';
|
|
10
10
|
import { addWeeks, addDays, isSameMonth, getWeeksInMonth, startOfMonth, startOfWeek, addMonths, subMonths, eachYearOfInterval, getYear, addYears, subYears, differenceInYears, startOfYear, isToday, isValid, isSameDay, getMonth, setMonth, areIntervalsOverlapping, startOfDay, endOfDay, parse, format, getDaysInMonth, isExists, compareAsc, getDate } from 'date-fns';
|
|
@@ -317,7 +317,7 @@ class CheckboxComponent {
|
|
|
317
317
|
useExisting: forwardRef(() => CheckboxComponent),
|
|
318
318
|
multi: true
|
|
319
319
|
}
|
|
320
|
-
], viewQueries: [{ propertyName: "checkboxInput", first: true, predicate: ["checkbox"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<label [attr.for]=\"id\">\n <input\n #checkbox\n type=\"checkbox\"\n [id]=\"id\"\n [attr.name]=\"name\"\n [checked]=\"isChecked\"\n [disabled]=\"isDisabled\"\n (click)=\"handleChange($event)\"\n hidden\n />\n <div class=\"aeb-checkbox__indicator\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n >\n <rect width=\"24\" height=\"24\" rx=\"4\" />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M10.2857 16L6 12.1538L7.2 11.0769L10.2857 13.8462L16.8 8L18 9.07692L10.2857 16Z\"\n fill=\"white\"\n />\n </svg>\n </div>\n @if (hasText) {\n <div class=\"aeb-checkbox__label\">\n <ng-content />\n </div>\n }\n</label>\n", styles: [".aeb-checkbox{--checkbox-color-default: var(--color-blue-500);--checkbox-color-hover: var(--color-blue-600);--checkbox-color-active: var(--color-blue-700);--checkbox-color-disabled: var(--color-blue-100);--checkbox-color-error: var(--color-red-500);--checkbox-color-error-hover: var(--color-red-300);--checkbox-color-error-active: var(--color-red-600);--text-color-default: var(--color-mono-900);--text-color-alternate: var(--color-mono-700);display:block;box-sizing:border-box;width:fit-content;-webkit-tap-highlight-color:transparent}.aeb-checkbox label{display:flex;align-items:flex-start;justify-content:flex-start;cursor:pointer;gap:12px}.aeb-checkbox__indicator{box-sizing:border-box;display:flex;align-items:center;justify-content:center;width:24px;height:24px;background-color:transparent;border:var(--border-skinny) solid var(--checkbox-color-default);border-radius:var(--border-lightly-rounded)}.aeb-checkbox__indicator>svg{opacity:var(--100-total)}.aeb-checkbox__label{
|
|
320
|
+
], viewQueries: [{ propertyName: "checkboxInput", first: true, predicate: ["checkbox"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<label [attr.for]=\"id\">\n <input\n #checkbox\n type=\"checkbox\"\n [id]=\"id\"\n [attr.name]=\"name\"\n [checked]=\"isChecked\"\n [disabled]=\"isDisabled\"\n (click)=\"handleChange($event)\"\n hidden\n />\n <div class=\"aeb-checkbox__indicator\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n >\n <rect width=\"24\" height=\"24\" rx=\"4\" />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M10.2857 16L6 12.1538L7.2 11.0769L10.2857 13.8462L16.8 8L18 9.07692L10.2857 16Z\"\n fill=\"white\"\n />\n </svg>\n </div>\n @if (hasText) {\n <div class=\"aeb-checkbox__label\">\n <ng-content />\n </div>\n }\n</label>\n", styles: [".aeb-checkbox{--checkbox-color-default: var(--color-blue-500);--checkbox-color-hover: var(--color-blue-600);--checkbox-color-active: var(--color-blue-700);--checkbox-color-disabled: var(--color-blue-100);--checkbox-color-error: var(--color-red-500);--checkbox-color-error-hover: var(--color-red-300);--checkbox-color-error-active: var(--color-red-600);--text-color-default: var(--color-mono-900);--text-color-alternate: var(--color-mono-700);display:block;box-sizing:border-box;width:fit-content;-webkit-tap-highlight-color:transparent}.aeb-checkbox label{display:flex;align-items:flex-start;justify-content:flex-start;cursor:pointer;gap:12px}.aeb-checkbox__indicator{box-sizing:border-box;display:flex;align-items:center;justify-content:center;width:24px;height:24px;background-color:transparent;border:var(--border-skinny) solid var(--checkbox-color-default);border-radius:var(--border-lightly-rounded)}.aeb-checkbox__indicator>svg{opacity:var(--100-total)}.aeb-checkbox__label{line-height:20px;color:var(--text-color-default);-webkit-user-select:none;user-select:none;align-self:center}.aeb-checkbox--checked .aeb-checkbox__indicator{border:none;border-width:0}.aeb-checkbox--checked .aeb-checkbox__indicator>svg{opacity:var(--0-zero)}.aeb-checkbox--checked .aeb-checkbox__indicator>svg rect{fill:var(--checkbox-color-default)}.aeb-checkbox--error .aeb-checkbox__indicator{border-color:var(--checkbox-color-error)}.aeb-checkbox--error .aeb-checkbox__label{color:var(--text-color-alternate)}.aeb-checkbox--disabled{pointer-events:none}.aeb-checkbox--disabled label{cursor:default}.aeb-checkbox--disabled .aeb-checkbox__indicator{border-color:var(--checkbox-color-disabled)}.aeb-checkbox--disabled .aeb-checkbox__label{color:var(--text-color-alternate)}.aeb-checkbox.aeb-checkbox--checked.aeb-checkbox--error .aeb-checkbox__indicator>svg rect{fill:var(--checkbox-color-error)}.aeb-checkbox.aeb-checkbox--checked.aeb-checkbox--disabled .aeb-checkbox__indicator>svg rect{fill:var(--checkbox-color-disabled)}@media (hover: hover){.aeb-checkbox:hover .aeb-checkbox__indicator{border-color:var(--checkbox-color-hover)}.aeb-checkbox:hover.aeb-checkbox--checked svg rect{fill:var(--checkbox-color-hover)}.aeb-checkbox:hover.aeb-checkbox--error .aeb-checkbox__indicator{border-color:var(--checkbox-color-error-hover)}.aeb-checkbox:hover.aeb-checkbox--checked.aeb-checkbox--error svg rect{fill:var(--checkbox-color-error-hover)}}.aeb-checkbox:active .aeb-checkbox__indicator{border-color:var(--checkbox-color-active)}.aeb-checkbox:active.aeb-checkbox--checked svg rect{fill:var(--checkbox-color-active)}.aeb-checkbox:active.aeb-checkbox--error .aeb-checkbox__indicator{border-color:var(--checkbox-color-error-active)}.aeb-checkbox:active.aeb-checkbox--checked.aeb-checkbox--error svg rect{fill:var(--checkbox-color-error-active)}body.dark .aeb-checkbox{--checkbox-color-default: var(--color-blue-400);--checkbox-color-hover: var(--color-blue-500);--checkbox-color-active: var(--color-blue-600);--checkbox-color-disabled: var(--color-mono-900);--checkbox-color-error: var(--color-red-500);--checkbox-color-error-hover: var(--color-red-300);--checkbox-color-error-active: var(--color-red-600);--text-color-default: var(--color-mono-0);--text-color-alternate: var(--color-mono-300)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
321
321
|
}
|
|
322
322
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: CheckboxComponent, decorators: [{
|
|
323
323
|
type: Component,
|
|
@@ -327,7 +327,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImpor
|
|
|
327
327
|
useExisting: forwardRef(() => CheckboxComponent),
|
|
328
328
|
multi: true
|
|
329
329
|
}
|
|
330
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<label [attr.for]=\"id\">\n <input\n #checkbox\n type=\"checkbox\"\n [id]=\"id\"\n [attr.name]=\"name\"\n [checked]=\"isChecked\"\n [disabled]=\"isDisabled\"\n (click)=\"handleChange($event)\"\n hidden\n />\n <div class=\"aeb-checkbox__indicator\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n >\n <rect width=\"24\" height=\"24\" rx=\"4\" />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M10.2857 16L6 12.1538L7.2 11.0769L10.2857 13.8462L16.8 8L18 9.07692L10.2857 16Z\"\n fill=\"white\"\n />\n </svg>\n </div>\n @if (hasText) {\n <div class=\"aeb-checkbox__label\">\n <ng-content />\n </div>\n }\n</label>\n", styles: [".aeb-checkbox{--checkbox-color-default: var(--color-blue-500);--checkbox-color-hover: var(--color-blue-600);--checkbox-color-active: var(--color-blue-700);--checkbox-color-disabled: var(--color-blue-100);--checkbox-color-error: var(--color-red-500);--checkbox-color-error-hover: var(--color-red-300);--checkbox-color-error-active: var(--color-red-600);--text-color-default: var(--color-mono-900);--text-color-alternate: var(--color-mono-700);display:block;box-sizing:border-box;width:fit-content;-webkit-tap-highlight-color:transparent}.aeb-checkbox label{display:flex;align-items:flex-start;justify-content:flex-start;cursor:pointer;gap:12px}.aeb-checkbox__indicator{box-sizing:border-box;display:flex;align-items:center;justify-content:center;width:24px;height:24px;background-color:transparent;border:var(--border-skinny) solid var(--checkbox-color-default);border-radius:var(--border-lightly-rounded)}.aeb-checkbox__indicator>svg{opacity:var(--100-total)}.aeb-checkbox__label{
|
|
330
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<label [attr.for]=\"id\">\n <input\n #checkbox\n type=\"checkbox\"\n [id]=\"id\"\n [attr.name]=\"name\"\n [checked]=\"isChecked\"\n [disabled]=\"isDisabled\"\n (click)=\"handleChange($event)\"\n hidden\n />\n <div class=\"aeb-checkbox__indicator\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n >\n <rect width=\"24\" height=\"24\" rx=\"4\" />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M10.2857 16L6 12.1538L7.2 11.0769L10.2857 13.8462L16.8 8L18 9.07692L10.2857 16Z\"\n fill=\"white\"\n />\n </svg>\n </div>\n @if (hasText) {\n <div class=\"aeb-checkbox__label\">\n <ng-content />\n </div>\n }\n</label>\n", styles: [".aeb-checkbox{--checkbox-color-default: var(--color-blue-500);--checkbox-color-hover: var(--color-blue-600);--checkbox-color-active: var(--color-blue-700);--checkbox-color-disabled: var(--color-blue-100);--checkbox-color-error: var(--color-red-500);--checkbox-color-error-hover: var(--color-red-300);--checkbox-color-error-active: var(--color-red-600);--text-color-default: var(--color-mono-900);--text-color-alternate: var(--color-mono-700);display:block;box-sizing:border-box;width:fit-content;-webkit-tap-highlight-color:transparent}.aeb-checkbox label{display:flex;align-items:flex-start;justify-content:flex-start;cursor:pointer;gap:12px}.aeb-checkbox__indicator{box-sizing:border-box;display:flex;align-items:center;justify-content:center;width:24px;height:24px;background-color:transparent;border:var(--border-skinny) solid var(--checkbox-color-default);border-radius:var(--border-lightly-rounded)}.aeb-checkbox__indicator>svg{opacity:var(--100-total)}.aeb-checkbox__label{line-height:20px;color:var(--text-color-default);-webkit-user-select:none;user-select:none;align-self:center}.aeb-checkbox--checked .aeb-checkbox__indicator{border:none;border-width:0}.aeb-checkbox--checked .aeb-checkbox__indicator>svg{opacity:var(--0-zero)}.aeb-checkbox--checked .aeb-checkbox__indicator>svg rect{fill:var(--checkbox-color-default)}.aeb-checkbox--error .aeb-checkbox__indicator{border-color:var(--checkbox-color-error)}.aeb-checkbox--error .aeb-checkbox__label{color:var(--text-color-alternate)}.aeb-checkbox--disabled{pointer-events:none}.aeb-checkbox--disabled label{cursor:default}.aeb-checkbox--disabled .aeb-checkbox__indicator{border-color:var(--checkbox-color-disabled)}.aeb-checkbox--disabled .aeb-checkbox__label{color:var(--text-color-alternate)}.aeb-checkbox.aeb-checkbox--checked.aeb-checkbox--error .aeb-checkbox__indicator>svg rect{fill:var(--checkbox-color-error)}.aeb-checkbox.aeb-checkbox--checked.aeb-checkbox--disabled .aeb-checkbox__indicator>svg rect{fill:var(--checkbox-color-disabled)}@media (hover: hover){.aeb-checkbox:hover .aeb-checkbox__indicator{border-color:var(--checkbox-color-hover)}.aeb-checkbox:hover.aeb-checkbox--checked svg rect{fill:var(--checkbox-color-hover)}.aeb-checkbox:hover.aeb-checkbox--error .aeb-checkbox__indicator{border-color:var(--checkbox-color-error-hover)}.aeb-checkbox:hover.aeb-checkbox--checked.aeb-checkbox--error svg rect{fill:var(--checkbox-color-error-hover)}}.aeb-checkbox:active .aeb-checkbox__indicator{border-color:var(--checkbox-color-active)}.aeb-checkbox:active.aeb-checkbox--checked svg rect{fill:var(--checkbox-color-active)}.aeb-checkbox:active.aeb-checkbox--error .aeb-checkbox__indicator{border-color:var(--checkbox-color-error-active)}.aeb-checkbox:active.aeb-checkbox--checked.aeb-checkbox--error svg rect{fill:var(--checkbox-color-error-active)}body.dark .aeb-checkbox{--checkbox-color-default: var(--color-blue-400);--checkbox-color-hover: var(--color-blue-500);--checkbox-color-active: var(--color-blue-600);--checkbox-color-disabled: var(--color-mono-900);--checkbox-color-error: var(--color-red-500);--checkbox-color-error-hover: var(--color-red-300);--checkbox-color-error-active: var(--color-red-600);--text-color-default: var(--color-mono-0);--text-color-alternate: var(--color-mono-300)}\n"] }]
|
|
331
331
|
}], propDecorators: { checkboxInput: [{
|
|
332
332
|
type: ViewChild,
|
|
333
333
|
args: ['checkbox', { static: true }]
|
|
@@ -558,6 +558,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImpor
|
|
|
558
558
|
|
|
559
559
|
class CodeInputComponent {
|
|
560
560
|
constructor() {
|
|
561
|
+
this.destroy$ = new Subject();
|
|
561
562
|
this.secondsUntilRetry = 60;
|
|
562
563
|
this.errorMessage = 'Неверный код';
|
|
563
564
|
this.codeLength = 6;
|
|
@@ -572,13 +573,19 @@ class CodeInputComponent {
|
|
|
572
573
|
this.isFocus = false;
|
|
573
574
|
this.showTimer = false;
|
|
574
575
|
this.showCodeText = false;
|
|
576
|
+
this.onChange = () => { };
|
|
577
|
+
this.onTouch = () => { };
|
|
575
578
|
}
|
|
576
579
|
get arrayInputValue() {
|
|
577
580
|
return this.inputValue.split('');
|
|
578
581
|
}
|
|
579
582
|
ngOnInit() {
|
|
580
583
|
this.startTimer();
|
|
581
|
-
this.
|
|
584
|
+
this.handleAutofocus();
|
|
585
|
+
}
|
|
586
|
+
ngOnDestroy() {
|
|
587
|
+
this.destroy$.next();
|
|
588
|
+
this.destroy$.complete();
|
|
582
589
|
}
|
|
583
590
|
inputChangeHandler(event) {
|
|
584
591
|
const target = event.target;
|
|
@@ -614,13 +621,14 @@ class CodeInputComponent {
|
|
|
614
621
|
}
|
|
615
622
|
startTimer() {
|
|
616
623
|
this.showTimer = true;
|
|
617
|
-
|
|
624
|
+
this.showCodeText = false;
|
|
625
|
+
this.seconds$ = timer(0, 1000).pipe(map((i) => this.secondsUntilRetry - i), takeUntil(this.destroy$));
|
|
626
|
+
// Auto-stop timer when it reaches 0
|
|
627
|
+
this.seconds$.pipe(takeUntil(this.destroy$)).subscribe((seconds) => {
|
|
618
628
|
if (seconds <= 0) {
|
|
619
629
|
this.stopTimer();
|
|
620
630
|
}
|
|
621
|
-
|
|
622
|
-
}), takeUntil(timer((this.secondsUntilRetry + 1) * 1000)));
|
|
623
|
-
this.seconds$ = countdown$.pipe((i) => i);
|
|
631
|
+
});
|
|
624
632
|
}
|
|
625
633
|
stopTimer() {
|
|
626
634
|
this.showTimer = false;
|
|
@@ -638,10 +646,16 @@ class CodeInputComponent {
|
|
|
638
646
|
this.input.nativeElement.focus();
|
|
639
647
|
this.isFocus = true;
|
|
640
648
|
}
|
|
641
|
-
|
|
649
|
+
handleInputBlur() {
|
|
642
650
|
this.isFocus = false;
|
|
643
651
|
}
|
|
644
|
-
|
|
652
|
+
focus() {
|
|
653
|
+
if (this.input?.nativeElement) {
|
|
654
|
+
this.input.nativeElement.focus();
|
|
655
|
+
this.isFocus = true;
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
handleAutofocus() {
|
|
645
659
|
if (this.isAutofocus) {
|
|
646
660
|
this.isFocus = true;
|
|
647
661
|
}
|
|
@@ -653,7 +667,7 @@ class CodeInputComponent {
|
|
|
653
667
|
useExisting: forwardRef(() => CodeInputComponent),
|
|
654
668
|
multi: true
|
|
655
669
|
}
|
|
656
|
-
], viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true }], ngImport: i0, template: "<div class=\"aeb-code-input\">\n @if (title) {\n <h2 class=\"aeb-code-input__title\">{{ title }}</h2>\n }\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 [maxLength]=\"codeLength\"\n [value]=\"inputValue\"\n [disabled]=\"disabled\"\n inputmode=\"numeric\"\n [autofocus]=\"isAutofocus\"\n autocomplete=\"one-time-code\"\n pattern=\"[0-9]\"\n (blur)=\"
|
|
670
|
+
], viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true }], ngImport: i0, template: "<div class=\"aeb-code-input\">\n @if (title) {\n <h2 class=\"aeb-code-input__title\">{{ title }}</h2>\n }\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 [maxLength]=\"codeLength\"\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 (keypress)=\"numbersOnly($event)\"\n (input)=\"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 }\n @if (isResendable) {\n @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\">{{\n seconds$ | async\n }}</span>\n </div>\n }\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 }\n </div>\n }\n</div>\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:10;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: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: AutofocusDirective, selector: "[autofocus]", inputs: ["autofocus"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
657
671
|
}
|
|
658
672
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: CodeInputComponent, decorators: [{
|
|
659
673
|
type: Component,
|
|
@@ -663,7 +677,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImpor
|
|
|
663
677
|
useExisting: forwardRef(() => CodeInputComponent),
|
|
664
678
|
multi: true
|
|
665
679
|
}
|
|
666
|
-
], encapsulation: ViewEncapsulation.None, standalone: false, template: "<div class=\"aeb-code-input\">\n @if (title) {\n <h2 class=\"aeb-code-input__title\">{{ title }}</h2>\n }\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 [maxLength]=\"codeLength\"\n [value]=\"inputValue\"\n [disabled]=\"disabled\"\n inputmode=\"numeric\"\n [autofocus]=\"isAutofocus\"\n autocomplete=\"one-time-code\"\n pattern=\"[0-9]\"\n (blur)=\"
|
|
680
|
+
], encapsulation: ViewEncapsulation.None, standalone: false, template: "<div class=\"aeb-code-input\">\n @if (title) {\n <h2 class=\"aeb-code-input__title\">{{ title }}</h2>\n }\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 [maxLength]=\"codeLength\"\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 (keypress)=\"numbersOnly($event)\"\n (input)=\"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 }\n @if (isResendable) {\n @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\">{{\n seconds$ | async\n }}</span>\n </div>\n }\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 }\n </div>\n }\n</div>\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:10;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"] }]
|
|
667
681
|
}], propDecorators: { title: [{
|
|
668
682
|
type: Input
|
|
669
683
|
}], secondsUntilRetry: [{
|