@snabcentr/client-ui 5.10.0 → 5.16.0
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/snabcentr-client-ui.mjs +878 -261
- package/fesm2022/snabcentr-client-ui.mjs.map +1 -1
- package/package.json +2 -3
- package/release_notes.tmp +3 -15
- package/styles/tailwind/tailwind.scss +48 -2
- package/types/snabcentr-client-ui.d.ts +546 -103
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, Injectable, NgZone, EventEmitter, Output, Input, ChangeDetectionStrategy, Component,
|
|
3
|
-
import { ScContactsService, ScUserService, ScLocationsService, ScSuggestionService, ScISuggestionType, SC_MIN_LENGTH_SEARCH_TERM, ScAuthService, SEARCH_TERM, ScUnitsHelper, ScImageHelper, SC_PATH_IMAGE_NOT_FOUND, ScImage, ScPhoneService, ScUserMetrikaService, ScUserMetrikaGoalsEnum, ScVCardService, IS_RUNNING_ON_TERMINAL, ScVerificationService, ScConvertersService, ScReferencesService, ScOpfList, ScBannerService, ScMediaImageTransformerPipe, ScCartService, ScUploadedFile, loadingPlaceholder, SC_ORDER_LOADER, ScMimeTypes, ScCatalogService, ScWarehouseService, SEARCH_TERM_PROVIDERS, ScPaginationService, SC_NEXT_PAGE_PAGINATION_CLICK, SC_PRODUCT_PAGINATION_OPTIONS, ScCatalogFilterService, ScIdOrSlugPipe, SC_CATEGORY_INFO, ScConfiguratorService, ScContragentService, ScDeliveryAddressService, SC_URLS, IS_SERVER, ScIconTypesEnum, ScDocumentInfoTypesEnum, ScFilesService, ScOrdersService, ScUIService, SC_USER_INFO as SC_USER_INFO$1, ScPaymentType, ScDeliveryType, TERMINAL_PROVIDERS, ScOrderDraftsService, ScRouteKeys, ScSeoService, scOrderIsLoaded, SC_PAGE_QUERY_PARAM, ScFrequentlyAskedQuestionsService, SchemaOrgFactory, scGetPageQueryParamChanges, ScNewsService, SC_COMPANY_INFO, ScFeedbackService } from '@snabcentr/client-core';
|
|
4
|
-
import { EMPTY, BehaviorSubject, switchMap, of, shareReplay, filter, map, debounceTime, startWith, catchError, throwError, share, Subject, tap, finalize, timer, scan, takeWhile, endWith, distinctUntilChanged, combineLatest,
|
|
2
|
+
import { InjectionToken, inject, Injectable, NgZone, RendererFactory2, untracked, signal, EventEmitter, Output, Input, ChangeDetectionStrategy, Component, ChangeDetectorRef, Directive, Pipe, ElementRef, Renderer2, HostListener, input, computed, model, output, DestroyRef, effect, ViewChild, ContentChild, viewChild, HostBinding, ContentChildren, forwardRef, contentChild, TemplateRef, RESPONSE_INIT, ViewEncapsulation, Injector, viewChildren, afterNextRender } from '@angular/core';
|
|
3
|
+
import { ScContactsService, ScUserService, ScLocationsService, IS_BROWSER, ScSuggestionAddressQuality, ScSuggestionService, ScISuggestionType, SC_MIN_LENGTH_SEARCH_TERM, ScAuthService, SEARCH_TERM, ScUnitsHelper, ScImageHelper, SC_PATH_IMAGE_NOT_FOUND, ScImage, ScPhoneService, ScUserMetrikaService, ScUserMetrikaGoalsEnum, ScVCardService, IS_RUNNING_ON_TERMINAL, ScVerificationService, ScConvertersService, ScReferencesService, ScOpfList, ScNumberHelper, ScBannerService, ScMediaImageTransformerPipe, ScCartService, ScUploadedFile, loadingPlaceholder, SC_ORDER_LOADER, ScMimeTypes, ScCatalogService, ScWarehouseService, SEARCH_TERM_PROVIDERS, ScPaginationService, SC_NEXT_PAGE_PAGINATION_CLICK, SC_PRODUCT_PAGINATION_OPTIONS, ScCatalogFilterService, ScIdOrSlugPipe, SC_CATEGORY_INFO, ScConfiguratorService, ScContragentService, ScDeliveryAddressService, SC_URLS, IS_SERVER, ScIconTypesEnum, ScDocumentInfoTypesEnum, ScFilesService, ScOrdersService, ScUIService, SC_USER_INFO as SC_USER_INFO$1, ScPaymentType, ScDeliveryType, TERMINAL_PROVIDERS, ScOrderDraftsService, ScRouteKeys, ScSeoService, scOrderIsLoaded, SC_PAGE_QUERY_PARAM, ScFrequentlyAskedQuestionsService, SchemaOrgFactory, scGetPageQueryParamChanges, ScNewsService, SC_COMPANY_INFO, ScFeedbackService } from '@snabcentr/client-core';
|
|
4
|
+
import { EMPTY, BehaviorSubject, switchMap, of, shareReplay, filter, map, Observable, debounceTime, startWith, catchError, throwError, share, Subject, tap, finalize, timer, scan, takeWhile, endWith, distinctUntilChanged, combineLatest, pairwise, Subscription, merge, skip, from, concatMap, noop as noop$1, first, retry, fromEvent, animationFrames, take, takeUntil, defer, timeout, ignoreElements } from 'rxjs';
|
|
5
5
|
import { WA_WINDOW, WA_NAVIGATOR } from '@ng-web-apis/common';
|
|
6
6
|
import { takeUntilDestroyed, toSignal, outputFromObservable, toObservable } from '@angular/core/rxjs-interop';
|
|
7
|
-
import { tuiIsPresent, TuiDay, TuiTime, TuiValueTransformer, tuiControlValue, tuiMarkControlAsTouchedAndValidate, TuiAutoFocus, TuiHovered, TuiDayRange, TuiMonth, tuiProvide,
|
|
7
|
+
import { tuiIsPresent, TuiDay, TuiTime, TuiValueTransformer, TuiValidationError, tuiControlValue, tuiMarkControlAsTouchedAndValidate, TuiAutoFocus, TuiHovered, TuiDayRange, TuiMonth, tuiProvide, TUI_WINDOW_SIZE, tuiClamp, tuiZonefree, TUI_TRUE_HANDLER } from '@taiga-ui/cdk';
|
|
8
8
|
import * as i1$1 from '@taiga-ui/kit';
|
|
9
9
|
import { tuiInputDateOptionsProvider, TuiAvatar, TuiInitialsPipe, TuiButtonLoading, TuiSortCountriesPipe, TuiPush, TuiInputPhoneInternational, TuiPassword, TuiChevron, TuiSelect, TuiDataListWrapperComponent, TuiStringifyContentPipe, TuiComboBox, TuiStepper, TuiAccordionDirective, TuiAccordion, TuiFiles, TuiChip, TuiInputNumber, TuiLineClamp, TuiBadge, TuiInputNumberDirective, TuiTooltip, TuiHighlight, TuiFade, TuiRange, tuiInputNumberOptionsProvider, TuiInputSlider, TuiPushComponent, TuiTreeService, TuiTreeItemContent, TUI_TREE_START, TUI_TREE_CONTENT, TUI_TREE_LOADING, TuiTreeComponent, TuiTreeChildren, TuiTreeControllerDirective, TUI_TREE_LOADER, TuiPreviewDialogService, TuiPreview, tuiFilesAccepted, TuiInputDate, TuiTextarea, TUI_CONFIRM, TuiDataListWrapper, TUI_PAGINATION_TEXTS, TuiInputPhone } from '@taiga-ui/kit';
|
|
10
|
+
import * as i1$2 from '@angular/common';
|
|
11
|
+
import { DOCUMENT, AsyncPipe, NgTemplateOutlet, NgClass, CommonModule } from '@angular/common';
|
|
10
12
|
import { HttpErrorResponse, HttpClient } from '@angular/common/http';
|
|
11
13
|
import * as i1 from '@angular/forms';
|
|
12
14
|
import { NgControl, FormControl, FormGroupDirective, ReactiveFormsModule, FormGroup, Validators, FormsModule, FormArray, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
13
15
|
import * as i2 from '@taiga-ui/core';
|
|
14
|
-
import { TUI_DATA_LIST_HOST, TuiLoader, TuiDataList, TuiDialogService, TuiLink, TuiButton, TuiIcon, TuiAppearance, TuiWithAppearance, TuiIcons, TuiWithIcons, TuiLabel, TuiTextfield, TuiInput, TuiError, TuiCheckbox, tuiDropdownOptionsProvider, TuiOption, TuiFilterByInputPipe, TuiCarouselComponent, TuiCarousel, TuiNumberFormat, TuiHint, TuiHintDirective, TuiHintDriver, TuiHintHover, TuiHintPosition, TUI_MONTHS, TuiScrollbar, tuiNumberFormatProvider, tuiItemsHandlersProvider, TuiNotification, TuiTitle,
|
|
15
|
-
import
|
|
16
|
-
import { AsyncPipe, DOCUMENT, NgTemplateOutlet, NgClass, CommonModule, DecimalPipe } from '@angular/common';
|
|
16
|
+
import { TUI_DATA_LIST_HOST, TuiLoader, TuiDataList, TuiDialogService, TuiLink, TuiButton, TuiIcon, TuiAppearance, TuiWithAppearance, TuiIcons, TuiWithIcons, TuiLabel, TuiTextfield, TuiInput, TuiError, TuiCheckbox, tuiDropdownOptionsProvider, TuiOption, TuiFilterByInputPipe, TuiCarouselComponent, TuiCarousel, TuiNumberFormat, TuiFormatNumberPipe, TuiHint, TuiHintDirective, TuiHintDriver, TuiHintHover, TuiHintPosition, TUI_MONTHS, TuiScrollbar, tuiNumberFormatProvider, tuiItemsHandlersProvider, TuiNotification, TuiTitle, tuiTextfieldOptionsProvider, tuiHintOptionsProvider, TuiNotificationService, TuiIconPipe, TUI_BUTTON_DEFAULT_OPTIONS, TUI_BUTTON_OPTIONS, TUI_COMMON_ICONS } from '@taiga-ui/core';
|
|
17
|
+
import { isNil, isString, isUndefined, isObject, noop, isBoolean, isArray } from 'lodash-es';
|
|
17
18
|
import { isValidPhoneNumber } from 'libphonenumber-js/max';
|
|
18
19
|
import { MaskitoDirective } from '@maskito/angular';
|
|
19
20
|
import { getCountries } from 'libphonenumber-js';
|
|
20
|
-
import { isNil, isUndefined, isObject, noop, isBoolean, isString, isArray } from 'lodash-es';
|
|
21
21
|
import { POLYMORPHEUS_CONTEXT, PolymorpheusComponent, PolymorpheusTemplate, PolymorpheusOutlet, injectContext } from '@taiga-ui/polymorpheus';
|
|
22
22
|
import { QRCodeComponent } from 'angularx-qrcode';
|
|
23
23
|
import * as i3 from '@taiga-ui/core/portals/dropdown';
|
|
@@ -33,7 +33,6 @@ import { TuiElasticContainer, TuiCardLarge, TuiBlockStatusComponent, TuiBlockSta
|
|
|
33
33
|
import * as i2$1 from '@taiga-ui/core/components/expand';
|
|
34
34
|
import { WaIntersectionObserverService } from '@ng-web-apis/intersection-observer';
|
|
35
35
|
import * as i2$2 from '@taiga-ui/cdk/directives/item';
|
|
36
|
-
import { TuiAmountPipe, TuiCurrencyPipe } from '@taiga-ui/addon-commerce';
|
|
37
36
|
import * as i3$1 from '@taiga-ui/core/components/textfield';
|
|
38
37
|
import { RouterLink, RouterModule, ActivatedRoute, Router, NavigationStart } from '@angular/router';
|
|
39
38
|
import * as i2$3 from '@taiga-ui/core/components/label';
|
|
@@ -42,11 +41,10 @@ import { TuiAxes, TuiLineDaysChart } from '@taiga-ui/addon-charts';
|
|
|
42
41
|
import { tuiPure } from '@taiga-ui/legacy';
|
|
43
42
|
import * as i6 from '@taiga-ui/core/components/slider';
|
|
44
43
|
import { YaMapComponent } from 'angular8-yandex-maps';
|
|
44
|
+
import { TuiCurrencyPipe } from '@taiga-ui/addon-commerce';
|
|
45
45
|
import { isValid, parse, format } from 'date-fns';
|
|
46
46
|
import * as i6$1 from '@taiga-ui/core/components/calendar';
|
|
47
47
|
import { Clipboard } from '@angular/cdk/clipboard';
|
|
48
|
-
import * as i6$2 from 'ng-recaptcha-2';
|
|
49
|
-
import { RecaptchaComponent, RecaptchaFormsModule, RecaptchaModule } from 'ng-recaptcha-2';
|
|
50
48
|
|
|
51
49
|
/**
|
|
52
50
|
* Поток для закрытия уведомлений помощи.
|
|
@@ -175,6 +173,13 @@ const SC_ALLOW_SELECT_TERMINATED = new InjectionToken(ngDevMode ? 'SC_ALLOW_SELE
|
|
|
175
173
|
factory: () => false,
|
|
176
174
|
});
|
|
177
175
|
|
|
176
|
+
/**
|
|
177
|
+
* Токен признака, что отправка форм с неполным (по данным подсказок) адресом заблокирована.
|
|
178
|
+
*/
|
|
179
|
+
const SC_BLOCK_INCOMPLETE_ADDRESS = new InjectionToken('SC_BLOCK_INCOMPLETE_ADDRESS', {
|
|
180
|
+
factory: () => true,
|
|
181
|
+
});
|
|
182
|
+
|
|
178
183
|
/**
|
|
179
184
|
* Токен максимального количества файлов, отправляемых в форме в байтах.
|
|
180
185
|
*/
|
|
@@ -334,36 +339,6 @@ const SC_HIDDEN_PRINT_ELEMENTS = new InjectionToken('SC_HIDDEN_PRINT_ELEMENTS',
|
|
|
334
339
|
providedIn: 'root',
|
|
335
340
|
});
|
|
336
341
|
|
|
337
|
-
/**
|
|
338
|
-
* Селектор iframe reCAPTCHA.
|
|
339
|
-
*/
|
|
340
|
-
const RECAPTCHA_IFRAME_SELECTOR = 'iframe[src*="recaptcha"]';
|
|
341
|
-
/**
|
|
342
|
-
* Селектор хоста reCAPTCHA.
|
|
343
|
-
*/
|
|
344
|
-
const RECAPTCHA_HOST_SELECTOR = 're-captcha';
|
|
345
|
-
/**
|
|
346
|
-
* Освобождает ресурсы reCAPTCHA и удаляет осиротевшие iframe после смены маршрута.
|
|
347
|
-
*
|
|
348
|
-
* @param documentReference Объект документа.
|
|
349
|
-
* @param windowReference Объект окна браузера.
|
|
350
|
-
*/
|
|
351
|
-
function cleanupRecaptchaArtifacts(documentReference, windowReference) {
|
|
352
|
-
const windowWithRecaptcha = windowReference;
|
|
353
|
-
try {
|
|
354
|
-
windowWithRecaptcha.grecaptcha?.reset();
|
|
355
|
-
}
|
|
356
|
-
catch {
|
|
357
|
-
// Ошибки reCAPTCHA не должны блокировать навигацию.
|
|
358
|
-
}
|
|
359
|
-
documentReference.querySelectorAll(RECAPTCHA_IFRAME_SELECTOR).forEach((iframe) => {
|
|
360
|
-
if (iframe.closest(RECAPTCHA_HOST_SELECTOR)) {
|
|
361
|
-
return;
|
|
362
|
-
}
|
|
363
|
-
iframe.remove();
|
|
364
|
-
});
|
|
365
|
-
}
|
|
366
|
-
|
|
367
342
|
/**
|
|
368
343
|
* Сервис по работе с печатью страницы.
|
|
369
344
|
*/
|
|
@@ -409,6 +384,315 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
|
|
|
409
384
|
}]
|
|
410
385
|
}] });
|
|
411
386
|
|
|
387
|
+
/**
|
|
388
|
+
* Сервис для вставки в {@link Document} внешних и дополнительных скриптов.
|
|
389
|
+
*/
|
|
390
|
+
class ScScriptsService {
|
|
391
|
+
constructor() {
|
|
392
|
+
/**
|
|
393
|
+
* Объект {@link Document}, предоставляющий доступ к DOM страницы.
|
|
394
|
+
*/
|
|
395
|
+
this.document = inject(DOCUMENT);
|
|
396
|
+
/**
|
|
397
|
+
* Объект {@link Renderer2}, предоставляющий доступ к DOM страницы.
|
|
398
|
+
*/
|
|
399
|
+
this.renderer = inject(RendererFactory2).createRenderer(null, null);
|
|
400
|
+
/**
|
|
401
|
+
* Признак того, что скрипт выполняется в браузере.
|
|
402
|
+
*/
|
|
403
|
+
this.isBrowser = inject(IS_BROWSER);
|
|
404
|
+
/**
|
|
405
|
+
* {@link NgZone} для вставки скриптов вне зоны Angular.
|
|
406
|
+
*/
|
|
407
|
+
this.ngZone = inject(NgZone);
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* Вставляет в конец {@link Document.body} скрипты, заданные строками HTML, вне зоны Angular. Из каждой строки берётся первый `<script>`. На сервере ничего не делает.
|
|
411
|
+
* Принимает только доверенные строки из конфигурации приложения: строка разбирается как HTML и может выполнить код.
|
|
412
|
+
*
|
|
413
|
+
* @param scriptStrings Строки HTML скриптов.
|
|
414
|
+
*/
|
|
415
|
+
appendScripts(scriptStrings) {
|
|
416
|
+
if (!this.isBrowser) {
|
|
417
|
+
return;
|
|
418
|
+
}
|
|
419
|
+
this.ngZone.runOutsideAngular(() => {
|
|
420
|
+
scriptStrings.forEach((scriptString) => {
|
|
421
|
+
const script = this.createScript(scriptString);
|
|
422
|
+
if (script) {
|
|
423
|
+
this.renderer.appendChild(this.document.body, script);
|
|
424
|
+
}
|
|
425
|
+
});
|
|
426
|
+
});
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* Загружает внешний скрипт: при подписке добавляет его в {@link Document.head}, после загрузки выдаёт элемент скрипта и завершается.
|
|
430
|
+
* Если скрипт не загрузился или подписка отменена раньше, удаляет его со страницы; удаление не отменяет загрузку и выполнение уже вставленного скрипта. На сервере завершается без загрузки.
|
|
431
|
+
*
|
|
432
|
+
* @param url Адрес скрипта.
|
|
433
|
+
*/
|
|
434
|
+
loadScript$(url) {
|
|
435
|
+
if (!this.isBrowser) {
|
|
436
|
+
return EMPTY;
|
|
437
|
+
}
|
|
438
|
+
return new Observable((subscriber) => {
|
|
439
|
+
const script = this.renderer.createElement('script');
|
|
440
|
+
let isLoaded = false;
|
|
441
|
+
const unlistenLoad = this.renderer.listen(script, 'load', () => {
|
|
442
|
+
isLoaded = true;
|
|
443
|
+
subscriber.next(script);
|
|
444
|
+
subscriber.complete();
|
|
445
|
+
});
|
|
446
|
+
const unlistenError = this.renderer.listen(script, 'error', () => {
|
|
447
|
+
subscriber.error(new Error(`Failed to load script ${url}`));
|
|
448
|
+
});
|
|
449
|
+
this.renderer.setProperty(script, 'src', url);
|
|
450
|
+
this.renderer.appendChild(this.document.head, script);
|
|
451
|
+
return () => {
|
|
452
|
+
unlistenLoad();
|
|
453
|
+
unlistenError();
|
|
454
|
+
if (!isLoaded) {
|
|
455
|
+
this.removeScript(script);
|
|
456
|
+
}
|
|
457
|
+
};
|
|
458
|
+
});
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* Удаляет скрипт со страницы. При подключённых анимациях Angular узел удаляется при ближайшей проверке изменений.
|
|
462
|
+
*
|
|
463
|
+
* @param script Элемент скрипта.
|
|
464
|
+
*/
|
|
465
|
+
removeScript(script) {
|
|
466
|
+
this.renderer.removeChild(script.parentNode, script);
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* Создаёт {@link HTMLScriptElement} из строки HTML скрипта.
|
|
470
|
+
*
|
|
471
|
+
* @param scriptString Строка HTML скрипта.
|
|
472
|
+
*/
|
|
473
|
+
createScript(scriptString) {
|
|
474
|
+
const range = this.document.createRange();
|
|
475
|
+
const fragment = range.createContextualFragment(scriptString);
|
|
476
|
+
return fragment.querySelector('script');
|
|
477
|
+
}
|
|
478
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScScriptsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
479
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScScriptsService, providedIn: 'root' }); }
|
|
480
|
+
}
|
|
481
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScScriptsService, decorators: [{
|
|
482
|
+
type: Injectable,
|
|
483
|
+
args: [{
|
|
484
|
+
providedIn: 'root',
|
|
485
|
+
}]
|
|
486
|
+
}] });
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* Сервис-реестр качества адресов, выбранных из подсказок.
|
|
490
|
+
*
|
|
491
|
+
* Хранит качество последнего выбранного адреса для каждого контрола. Качество полного адреса
|
|
492
|
+
* действует, пока значение контрола не изменилось после выбора: ручная правка возвращает адрес
|
|
493
|
+
* в разряд непроверяемых. Качество неполного адреса и адреса с неопределённой полнотой сохраняется
|
|
494
|
+
* и при ручной правке текста: его заменяет только выбор другой подсказки по этому полю.
|
|
495
|
+
* Полная очистка поля сбрасывает качество: адрес, введённый после неё, считается ручным.
|
|
496
|
+
*/
|
|
497
|
+
class ScAddressQualityService {
|
|
498
|
+
constructor() {
|
|
499
|
+
/**
|
|
500
|
+
* Валидатор, запрещающий отправку формы с неполным адресом, пока блокировка включена токеном {@link SC_BLOCK_INCOMPLETE_ADDRESS}.
|
|
501
|
+
* Подключается к контролу адреса при его создании; директива качества адреса только показывает предупреждение.
|
|
502
|
+
*
|
|
503
|
+
* @param control Контрол адреса.
|
|
504
|
+
*/
|
|
505
|
+
this.validator = (control) => this.validate(control);
|
|
506
|
+
/**
|
|
507
|
+
* Признак, что отправка форм с неполным адресом заблокирована.
|
|
508
|
+
*/
|
|
509
|
+
this.blockIncompleteAddress = inject(SC_BLOCK_INCOMPLETE_ADDRESS);
|
|
510
|
+
/**
|
|
511
|
+
* Ошибка валидации неполного адреса.
|
|
512
|
+
*/
|
|
513
|
+
this.incompleteAddressError = new TuiValidationError('Адрес неполный, выберите более точный вариант из подсказок');
|
|
514
|
+
/**
|
|
515
|
+
* Реестр состояний качества по контролам адресов.
|
|
516
|
+
*/
|
|
517
|
+
this.states = new WeakMap();
|
|
518
|
+
/**
|
|
519
|
+
* Реестр признаков включённого контроля качества по контролам адресов.
|
|
520
|
+
*/
|
|
521
|
+
this.checkEnabledStates = new WeakMap();
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* Возвращает признак, что значение поля адреса пустое без учёта пробелов.
|
|
525
|
+
*
|
|
526
|
+
* @param value Значение поля адреса.
|
|
527
|
+
*/
|
|
528
|
+
static isEmptyAddress(value) {
|
|
529
|
+
return isNil(value) || (isString(value) && !value.trim());
|
|
530
|
+
}
|
|
531
|
+
/**
|
|
532
|
+
* Задаёт качество адреса, выбранного в контроле, и пересчитывает валидность контрола
|
|
533
|
+
* без рассылки событий, чтобы не нарушать подавление valueChanges при выборе подсказки.
|
|
534
|
+
* Контрол адреса, требующего внимания пользователя, помечается затронутым, чтобы сообщения показались сразу.
|
|
535
|
+
*
|
|
536
|
+
* @param control Контрол адреса.
|
|
537
|
+
* @param quality Качество (полнота) адреса или null, если качество неизвестно.
|
|
538
|
+
*/
|
|
539
|
+
setQuality(control, quality) {
|
|
540
|
+
this.stateOf(control).set(quality === null ? null : { quality, value: control.value });
|
|
541
|
+
if (quality === ScSuggestionAddressQuality.incomplete || quality === ScSuggestionAddressQuality.undetermined) {
|
|
542
|
+
control.markAsTouched();
|
|
543
|
+
}
|
|
544
|
+
control.updateValueAndValidity({ emitEvent: false });
|
|
545
|
+
}
|
|
546
|
+
/**
|
|
547
|
+
* Возвращает качество адреса, выбранного в контроле, либо null, если адрес из подсказок
|
|
548
|
+
* не выбирался или поле пустое. Качество полного адреса действует, только пока значение контрола не изменилось
|
|
549
|
+
* после выбора; качество неполного адреса и адреса с неопределённой полнотой действует
|
|
550
|
+
* до выбора другой подсказки или полной очистки поля, в том числе после ручной правки текста.
|
|
551
|
+
*
|
|
552
|
+
* @param control Контрол адреса.
|
|
553
|
+
*/
|
|
554
|
+
getQuality(control) {
|
|
555
|
+
const state = this.stateOf(control)();
|
|
556
|
+
if (!state || ScAddressQualityService.isEmptyAddress(control.value)) {
|
|
557
|
+
return null;
|
|
558
|
+
}
|
|
559
|
+
if (state.quality === ScSuggestionAddressQuality.complete) {
|
|
560
|
+
return state.value === control.value ? ScSuggestionAddressQuality.complete : null;
|
|
561
|
+
}
|
|
562
|
+
return state.quality;
|
|
563
|
+
}
|
|
564
|
+
/**
|
|
565
|
+
* Задаёт качество адресов организации контролам группы на основе выбранной подсказки.
|
|
566
|
+
* Качество применяется только к заполненным адресам подсказки: для пустого адреса
|
|
567
|
+
* оно сбрасывается, даже если сервис подсказок прислал для него значение.
|
|
568
|
+
*
|
|
569
|
+
* @param group Группа с контролами адресов организации.
|
|
570
|
+
* @param suggestion Объект подсказки по организации.
|
|
571
|
+
*/
|
|
572
|
+
setOrganizationAddressQualities(group, suggestion) {
|
|
573
|
+
const qualities = [
|
|
574
|
+
['legalAddress', suggestion.legalAddress, suggestion.legalAddressQuality],
|
|
575
|
+
['postalAddress', suggestion.postalAddress, suggestion.postalAddressQuality],
|
|
576
|
+
['actualAddress', suggestion.actualAddress, suggestion.actualAddressQuality],
|
|
577
|
+
];
|
|
578
|
+
qualities.forEach(([controlName, address, quality]) => {
|
|
579
|
+
const control = group.get(controlName);
|
|
580
|
+
if (control) {
|
|
581
|
+
this.setQuality(control, address ? (quality ?? null) : null);
|
|
582
|
+
}
|
|
583
|
+
});
|
|
584
|
+
}
|
|
585
|
+
/**
|
|
586
|
+
* Включает или отключает контроль качества адреса для контрола и пересчитывает его валидность без рассылки событий.
|
|
587
|
+
* Сохранённое качество при отключении не теряется и снова учитывается после включения.
|
|
588
|
+
* Вызывать при смене значения формы, а не из хуков проверки изменений (ngOnChanges и т.п.),
|
|
589
|
+
* чтобы родительские шаблоны сразу видели актуальную валидность.
|
|
590
|
+
*
|
|
591
|
+
* @param control Контрол адреса.
|
|
592
|
+
* @param enabled Признак, что контроль качества адреса включён.
|
|
593
|
+
*/
|
|
594
|
+
setQualityCheckEnabled(control, enabled) {
|
|
595
|
+
const checkEnabled = this.checkEnabledOf(control);
|
|
596
|
+
if (untracked(checkEnabled) === enabled) {
|
|
597
|
+
return;
|
|
598
|
+
}
|
|
599
|
+
// Вызов возможен во время отрисовки шаблона (первая подписка async pipe), где запись сигналов запрещена.
|
|
600
|
+
untracked(() => {
|
|
601
|
+
checkEnabled.set(enabled);
|
|
602
|
+
});
|
|
603
|
+
control.updateValueAndValidity({ emitEvent: false });
|
|
604
|
+
}
|
|
605
|
+
/**
|
|
606
|
+
* Возвращает признак, что контроль качества адреса для контрола включён.
|
|
607
|
+
*
|
|
608
|
+
* @param control Контрол адреса.
|
|
609
|
+
*/
|
|
610
|
+
isQualityCheckEnabled(control) {
|
|
611
|
+
return this.checkEnabledOf(control)();
|
|
612
|
+
}
|
|
613
|
+
/**
|
|
614
|
+
* Возвращает ошибку неполного адреса либо null, если контрол можно отправлять: контроль качества отключён,
|
|
615
|
+
* блокировка выключена токеном {@link SC_BLOCK_INCOMPLETE_ADDRESS} или адрес не неполный.
|
|
616
|
+
* Для очищенного поля сбрасывает сохранённое качество адреса.
|
|
617
|
+
*
|
|
618
|
+
* @param control Контрол адреса.
|
|
619
|
+
*/
|
|
620
|
+
validate(control) {
|
|
621
|
+
this.resetQualityOfEmptyAddress(control);
|
|
622
|
+
return this.blockIncompleteAddress && this.isQualityCheckEnabled(control) && this.getQuality(control) === ScSuggestionAddressQuality.incomplete
|
|
623
|
+
? { incompleteAddress: this.incompleteAddressError }
|
|
624
|
+
: null;
|
|
625
|
+
}
|
|
626
|
+
/**
|
|
627
|
+
* Возвращает текст предупреждения о необходимости проверить выбранный адрес либо null, когда предупреждение не требуется,
|
|
628
|
+
* в том числе для пустого поля. Для неполного адреса при включённой блокировке отправки вместо предупреждения
|
|
629
|
+
* показывается ошибка валидатора {@link validator}, если он подключён к контролу.
|
|
630
|
+
*
|
|
631
|
+
* @param control Контрол адреса.
|
|
632
|
+
*/
|
|
633
|
+
getWarningMessage(control) {
|
|
634
|
+
if (!this.isQualityCheckEnabled(control)) {
|
|
635
|
+
return null;
|
|
636
|
+
}
|
|
637
|
+
switch (this.getQuality(control)) {
|
|
638
|
+
case ScSuggestionAddressQuality.undetermined:
|
|
639
|
+
return 'Не удалось определить полноту адреса, проверьте его';
|
|
640
|
+
case ScSuggestionAddressQuality.incomplete:
|
|
641
|
+
return this.blockIncompleteAddress && control.hasValidator(this.validator) ? null : 'Адрес неполный, проверьте его';
|
|
642
|
+
default:
|
|
643
|
+
return null;
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
/**
|
|
647
|
+
* Возвращает сигнал состояния качества для контрола, создавая его при первом обращении.
|
|
648
|
+
*
|
|
649
|
+
* @param control Контрол адреса.
|
|
650
|
+
*/
|
|
651
|
+
stateOf(control) {
|
|
652
|
+
let state = this.states.get(control);
|
|
653
|
+
if (!state) {
|
|
654
|
+
state = signal(null);
|
|
655
|
+
this.states.set(control, state);
|
|
656
|
+
}
|
|
657
|
+
return state;
|
|
658
|
+
}
|
|
659
|
+
/**
|
|
660
|
+
* Возвращает сигнал признака включённого контроля качества для контрола, создавая его при первом обращении.
|
|
661
|
+
*
|
|
662
|
+
* @param control Контрол адреса.
|
|
663
|
+
*/
|
|
664
|
+
checkEnabledOf(control) {
|
|
665
|
+
let checkEnabled = this.checkEnabledStates.get(control);
|
|
666
|
+
if (!checkEnabled) {
|
|
667
|
+
checkEnabled = signal(true);
|
|
668
|
+
this.checkEnabledStates.set(control, checkEnabled);
|
|
669
|
+
}
|
|
670
|
+
return checkEnabled;
|
|
671
|
+
}
|
|
672
|
+
/**
|
|
673
|
+
* Сбрасывает сохранённое качество адреса, если поле очищено.
|
|
674
|
+
*
|
|
675
|
+
* @param control Контрол адреса.
|
|
676
|
+
*/
|
|
677
|
+
resetQualityOfEmptyAddress(control) {
|
|
678
|
+
const state = this.states.get(control);
|
|
679
|
+
if (state && untracked(state) && ScAddressQualityService.isEmptyAddress(control.value)) {
|
|
680
|
+
// Проверка возможна во время отрисовки шаблона, где запись сигналов запрещена.
|
|
681
|
+
untracked(() => {
|
|
682
|
+
state.set(null);
|
|
683
|
+
});
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScAddressQualityService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
687
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScAddressQualityService, providedIn: 'root' }); }
|
|
688
|
+
}
|
|
689
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScAddressQualityService, decorators: [{
|
|
690
|
+
type: Injectable,
|
|
691
|
+
args: [{
|
|
692
|
+
providedIn: 'root',
|
|
693
|
+
}]
|
|
694
|
+
}] });
|
|
695
|
+
|
|
412
696
|
/* eslint-disable class-methods-use-this */
|
|
413
697
|
/**
|
|
414
698
|
* Компонент подсказок для поля ввода.
|
|
@@ -421,6 +705,11 @@ class ScSuggestionFieldComponent {
|
|
|
421
705
|
* Тип подсказок.
|
|
422
706
|
*/
|
|
423
707
|
this.type = ScISuggestionType.fio;
|
|
708
|
+
/**
|
|
709
|
+
* Признак, что элементы подсказок показывают пометку о полноте адреса.
|
|
710
|
+
* Отключается там, где адреса из подсказки по организации не применяются.
|
|
711
|
+
*/
|
|
712
|
+
this.showAddressQuality = true;
|
|
424
713
|
/**
|
|
425
714
|
* Событие выбора результата подсказки.
|
|
426
715
|
*/
|
|
@@ -443,6 +732,10 @@ class ScSuggestionFieldComponent {
|
|
|
443
732
|
* Признак, что разрешено выбирать записи ликвидированных организаций.
|
|
444
733
|
*/
|
|
445
734
|
this.allowSelectTerminated = inject(SC_ALLOW_SELECT_TERMINATED);
|
|
735
|
+
/**
|
|
736
|
+
* Сервис-реестр качества адресов, выбранных из подсказок.
|
|
737
|
+
*/
|
|
738
|
+
this.addressQualityService = inject(ScAddressQualityService);
|
|
446
739
|
}
|
|
447
740
|
/** @inheritDoc */
|
|
448
741
|
ngOnInit() {
|
|
@@ -475,7 +768,7 @@ class ScSuggestionFieldComponent {
|
|
|
475
768
|
break;
|
|
476
769
|
case ScISuggestionType.address:
|
|
477
770
|
if ('addressString' in suggestion) {
|
|
478
|
-
this.
|
|
771
|
+
this.applyAddressSuggestion(suggestion);
|
|
479
772
|
}
|
|
480
773
|
break;
|
|
481
774
|
case ScISuggestionType.bank:
|
|
@@ -489,17 +782,7 @@ class ScSuggestionFieldComponent {
|
|
|
489
782
|
break;
|
|
490
783
|
case ScISuggestionType.organization:
|
|
491
784
|
if ('inn' in suggestion && !('bic' in suggestion)) {
|
|
492
|
-
|
|
493
|
-
name: suggestion.name,
|
|
494
|
-
inn: suggestion.inn,
|
|
495
|
-
kpp: suggestion.kpp,
|
|
496
|
-
okpo: suggestion.okpo,
|
|
497
|
-
directorName: suggestion.directorName,
|
|
498
|
-
directorPosition: suggestion.directorPosition,
|
|
499
|
-
legalAddress: suggestion.legalAddress,
|
|
500
|
-
postalAddress: suggestion.postalAddress,
|
|
501
|
-
actualAddress: suggestion.actualAddress,
|
|
502
|
-
}, { emitEvent: false });
|
|
785
|
+
this.applyOrganizationSuggestion(suggestion);
|
|
503
786
|
}
|
|
504
787
|
break;
|
|
505
788
|
case ScISuggestionType.email:
|
|
@@ -538,6 +821,33 @@ class ScSuggestionFieldComponent {
|
|
|
538
821
|
}
|
|
539
822
|
return false;
|
|
540
823
|
}
|
|
824
|
+
/**
|
|
825
|
+
* Возвращает текст пометки о качестве адреса для элемента выпадающего списка подсказок либо null, когда пометка не требуется.
|
|
826
|
+
*
|
|
827
|
+
* @param quality Качество (полнота) адреса.
|
|
828
|
+
*/
|
|
829
|
+
getAddressQualityWarning(quality) {
|
|
830
|
+
if (!this.showAddressQuality) {
|
|
831
|
+
return null;
|
|
832
|
+
}
|
|
833
|
+
switch (quality) {
|
|
834
|
+
case ScSuggestionAddressQuality.undetermined:
|
|
835
|
+
return 'Полнота адреса не определена';
|
|
836
|
+
case ScSuggestionAddressQuality.incomplete:
|
|
837
|
+
return 'Неполный адрес';
|
|
838
|
+
default:
|
|
839
|
+
return null;
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
/**
|
|
843
|
+
* Возвращает текст пометки о качестве юридического адреса для подсказки по организации либо null,
|
|
844
|
+
* когда пометка не требуется, в том числе когда у организации нет юридического адреса.
|
|
845
|
+
*
|
|
846
|
+
* @param suggestion Объект подсказки по организации.
|
|
847
|
+
*/
|
|
848
|
+
getOrganizationAddressQualityWarning(suggestion) {
|
|
849
|
+
return suggestion.legalAddress ? this.getAddressQualityWarning(suggestion.legalAddressQuality) : null;
|
|
850
|
+
}
|
|
541
851
|
/**
|
|
542
852
|
* Проверяет прекращена ли деятельность указанной организации.
|
|
543
853
|
*
|
|
@@ -547,14 +857,47 @@ class ScSuggestionFieldComponent {
|
|
|
547
857
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
548
858
|
return suggestion.rawData?.['state']?.status === 'LIQUIDATED';
|
|
549
859
|
}
|
|
860
|
+
/**
|
|
861
|
+
* Заполняет контрол строкой выбранного адреса и регистрирует качество адреса.
|
|
862
|
+
*
|
|
863
|
+
* @param suggestion Объект подсказки по адресу.
|
|
864
|
+
*/
|
|
865
|
+
applyAddressSuggestion(suggestion) {
|
|
866
|
+
this.control.control?.patchValue(suggestion.addressString, { emitEvent: false });
|
|
867
|
+
if (this.control.control) {
|
|
868
|
+
this.addressQualityService.setQuality(this.control.control, suggestion.quality ?? null);
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
/**
|
|
872
|
+
* Заполняет поля родительской группы данными выбранной организации и регистрирует качество её адресов.
|
|
873
|
+
*
|
|
874
|
+
* @param suggestion Объект подсказки по организации.
|
|
875
|
+
*/
|
|
876
|
+
applyOrganizationSuggestion(suggestion) {
|
|
877
|
+
const parentGroup = this.control.control?.parent;
|
|
878
|
+
parentGroup.patchValue({
|
|
879
|
+
name: suggestion.name,
|
|
880
|
+
inn: suggestion.inn,
|
|
881
|
+
kpp: suggestion.kpp,
|
|
882
|
+
okpo: suggestion.okpo,
|
|
883
|
+
directorName: suggestion.directorName,
|
|
884
|
+
directorPosition: suggestion.directorPosition,
|
|
885
|
+
legalAddress: suggestion.legalAddress,
|
|
886
|
+
postalAddress: suggestion.postalAddress,
|
|
887
|
+
actualAddress: suggestion.actualAddress,
|
|
888
|
+
}, { emitEvent: false });
|
|
889
|
+
this.addressQualityService.setOrganizationAddressQualities(parentGroup, suggestion);
|
|
890
|
+
}
|
|
550
891
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScSuggestionFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
551
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScSuggestionFieldComponent, isStandalone: true, selector: "sc-suggestion-field", inputs: { type: "type" }, outputs: { selectedClick: "selectedClick" }, ngImport: i0, template: "<tui-loader\n size=\"m\"\n [overlay]=\"true\"\n [loading]=\"!!(loading$ | async)\"\n>\n @let options = suggestions$ | async;\n <tui-data-list>\n @for (option of options; track option) {\n <button\n tuiOption\n (click)=\"onSelected(option)\"\n [disabled]=\"isDisabledSuggestion(option)\"\n class=\"flex-col !items-start\"\n >\n @let optionValue = $any(option);\n @switch (type) {\n @case (suggestionType.fio) {\n <span class=\"text-tui-link\">{{ optionValue.fio }}</span>\n }\n @case (suggestionType.organization) {\n <span class=\"text-tui-link\">\n {{ optionValue.name }}\n <span class=\"ml-1 text-tui-text-02\">\u0438\u043D\u043D: {{ optionValue.inn }}</span>\n @if (isOrgTerminated(optionValue)) {\n <span class=\"text-tui-negative\"> \u041B\u0438\u043A\u0432\u0438\u0434\u0438\u0440\u043E\u0432\u0430\u043D\u043E </span>\n }\n </span>\n <span class=\"text-tui-text-02\">{{ optionValue?.legalAddress }}</span>\n }\n @case (suggestionType.bank) {\n <span class=\"text-tui-link\">{{ optionValue.name }}</span>\n <span class=\"text-tui-text-02\">{{ optionValue.bic }}</span>\n }\n @case (suggestionType.email) {\n <span class=\"text-tui-link\">{{ optionValue.email }}</span>\n }\n @case (suggestionType.address) {\n <span class=\"text-tui-link\">{{ optionValue.addressString }}</span>\n }\n }\n </button>\n }\n </tui-data-list>\n</tui-loader>\n", dependencies: [{ kind: "component", type: TuiLoader, selector: "tui-loader", inputs: ["size", "inheritColor", "overlay", "textContent", "loading"] }, { kind: "component", type: i2.TuiDataListComponent, selector: "tui-data-list", inputs: ["emptyContent", "size"] }, { kind: "directive", type: i2.TuiOption, selector: "button[tuiOption], a[tuiOption], label[tuiOption]", inputs: ["disabled"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
892
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScSuggestionFieldComponent, isStandalone: true, selector: "sc-suggestion-field", inputs: { type: "type", showAddressQuality: "showAddressQuality" }, outputs: { selectedClick: "selectedClick" }, ngImport: i0, template: "<tui-loader\n size=\"m\"\n [overlay]=\"true\"\n [loading]=\"!!(loading$ | async)\"\n>\n @let options = suggestions$ | async;\n <tui-data-list>\n @for (option of options; track option) {\n <button\n tuiOption\n (click)=\"onSelected(option)\"\n [disabled]=\"isDisabledSuggestion(option)\"\n class=\"flex-col !items-start\"\n >\n @let optionValue = $any(option);\n @switch (type) {\n @case (suggestionType.fio) {\n <span class=\"text-tui-link\">{{ optionValue.fio }}</span>\n }\n @case (suggestionType.organization) {\n <span class=\"text-tui-link\">\n {{ optionValue.name }}\n <span class=\"ml-1 text-tui-text-02\">\u0438\u043D\u043D: {{ optionValue.inn }}</span>\n @if (isOrgTerminated(optionValue)) {\n <span class=\"text-tui-negative\"> \u041B\u0438\u043A\u0432\u0438\u0434\u0438\u0440\u043E\u0432\u0430\u043D\u043E </span>\n }\n </span>\n <span class=\"text-tui-text-02\">{{ optionValue?.legalAddress }}</span>\n @if (getOrganizationAddressQualityWarning(optionValue); as addressQualityWarning) {\n <span class=\"text-xs text-tui-status-warning\">{{ addressQualityWarning }}</span>\n }\n }\n @case (suggestionType.bank) {\n <span class=\"text-tui-link\">{{ optionValue.name }}</span>\n <span class=\"text-tui-text-02\">{{ optionValue.bic }}</span>\n }\n @case (suggestionType.email) {\n <span class=\"text-tui-link\">{{ optionValue.email }}</span>\n }\n @case (suggestionType.address) {\n <span class=\"text-tui-link\">{{ optionValue.addressString }}</span>\n @if (getAddressQualityWarning(optionValue.quality); as addressQualityWarning) {\n <span class=\"text-xs text-tui-status-warning\">{{ addressQualityWarning }}</span>\n }\n }\n }\n </button>\n }\n </tui-data-list>\n</tui-loader>\n", dependencies: [{ kind: "component", type: TuiLoader, selector: "tui-loader", inputs: ["size", "inheritColor", "overlay", "textContent", "loading"] }, { kind: "component", type: i2.TuiDataListComponent, selector: "tui-data-list", inputs: ["emptyContent", "size"] }, { kind: "directive", type: i2.TuiOption, selector: "button[tuiOption], a[tuiOption], label[tuiOption]", inputs: ["disabled"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
552
893
|
}
|
|
553
894
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScSuggestionFieldComponent, decorators: [{
|
|
554
895
|
type: Component,
|
|
555
|
-
args: [{ selector: 'sc-suggestion-field', changeDetection: ChangeDetectionStrategy.OnPush, imports: [TuiLoader, ...TuiDataList, AsyncPipe], template: "<tui-loader\n size=\"m\"\n [overlay]=\"true\"\n [loading]=\"!!(loading$ | async)\"\n>\n @let options = suggestions$ | async;\n <tui-data-list>\n @for (option of options; track option) {\n <button\n tuiOption\n (click)=\"onSelected(option)\"\n [disabled]=\"isDisabledSuggestion(option)\"\n class=\"flex-col !items-start\"\n >\n @let optionValue = $any(option);\n @switch (type) {\n @case (suggestionType.fio) {\n <span class=\"text-tui-link\">{{ optionValue.fio }}</span>\n }\n @case (suggestionType.organization) {\n <span class=\"text-tui-link\">\n {{ optionValue.name }}\n <span class=\"ml-1 text-tui-text-02\">\u0438\u043D\u043D: {{ optionValue.inn }}</span>\n @if (isOrgTerminated(optionValue)) {\n <span class=\"text-tui-negative\"> \u041B\u0438\u043A\u0432\u0438\u0434\u0438\u0440\u043E\u0432\u0430\u043D\u043E </span>\n }\n </span>\n <span class=\"text-tui-text-02\">{{ optionValue?.legalAddress }}</span>\n }\n @case (suggestionType.bank) {\n <span class=\"text-tui-link\">{{ optionValue.name }}</span>\n <span class=\"text-tui-text-02\">{{ optionValue.bic }}</span>\n }\n @case (suggestionType.email) {\n <span class=\"text-tui-link\">{{ optionValue.email }}</span>\n }\n @case (suggestionType.address) {\n <span class=\"text-tui-link\">{{ optionValue.addressString }}</span>\n }\n }\n </button>\n }\n </tui-data-list>\n</tui-loader>\n" }]
|
|
896
|
+
args: [{ selector: 'sc-suggestion-field', changeDetection: ChangeDetectionStrategy.OnPush, imports: [TuiLoader, ...TuiDataList, AsyncPipe], template: "<tui-loader\n size=\"m\"\n [overlay]=\"true\"\n [loading]=\"!!(loading$ | async)\"\n>\n @let options = suggestions$ | async;\n <tui-data-list>\n @for (option of options; track option) {\n <button\n tuiOption\n (click)=\"onSelected(option)\"\n [disabled]=\"isDisabledSuggestion(option)\"\n class=\"flex-col !items-start\"\n >\n @let optionValue = $any(option);\n @switch (type) {\n @case (suggestionType.fio) {\n <span class=\"text-tui-link\">{{ optionValue.fio }}</span>\n }\n @case (suggestionType.organization) {\n <span class=\"text-tui-link\">\n {{ optionValue.name }}\n <span class=\"ml-1 text-tui-text-02\">\u0438\u043D\u043D: {{ optionValue.inn }}</span>\n @if (isOrgTerminated(optionValue)) {\n <span class=\"text-tui-negative\"> \u041B\u0438\u043A\u0432\u0438\u0434\u0438\u0440\u043E\u0432\u0430\u043D\u043E </span>\n }\n </span>\n <span class=\"text-tui-text-02\">{{ optionValue?.legalAddress }}</span>\n @if (getOrganizationAddressQualityWarning(optionValue); as addressQualityWarning) {\n <span class=\"text-xs text-tui-status-warning\">{{ addressQualityWarning }}</span>\n }\n }\n @case (suggestionType.bank) {\n <span class=\"text-tui-link\">{{ optionValue.name }}</span>\n <span class=\"text-tui-text-02\">{{ optionValue.bic }}</span>\n }\n @case (suggestionType.email) {\n <span class=\"text-tui-link\">{{ optionValue.email }}</span>\n }\n @case (suggestionType.address) {\n <span class=\"text-tui-link\">{{ optionValue.addressString }}</span>\n @if (getAddressQualityWarning(optionValue.quality); as addressQualityWarning) {\n <span class=\"text-xs text-tui-status-warning\">{{ addressQualityWarning }}</span>\n }\n }\n }\n </button>\n }\n </tui-data-list>\n</tui-loader>\n" }]
|
|
556
897
|
}], propDecorators: { type: [{
|
|
557
898
|
type: Input
|
|
899
|
+
}], showAddressQuality: [{
|
|
900
|
+
type: Input
|
|
558
901
|
}], selectedClick: [{
|
|
559
902
|
type: Output
|
|
560
903
|
}] } });
|
|
@@ -738,6 +1081,42 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
|
|
|
738
1081
|
type: Output
|
|
739
1082
|
}] } });
|
|
740
1083
|
|
|
1084
|
+
/**
|
|
1085
|
+
* Директива предупреждения о качестве (полноте) адреса, выбранного из подсказок, для поля с контролом формы.
|
|
1086
|
+
*
|
|
1087
|
+
* Блокировку отправки формы с неполным адресом обеспечивает валидатор {@link ScAddressQualityService.validator},
|
|
1088
|
+
* подключённый к контролу адреса при его создании.
|
|
1089
|
+
*/
|
|
1090
|
+
class ScAddressQualityDirective {
|
|
1091
|
+
constructor() {
|
|
1092
|
+
/**
|
|
1093
|
+
* Контрол поля адреса.
|
|
1094
|
+
*/
|
|
1095
|
+
this.ngControl = inject(NgControl, { self: true });
|
|
1096
|
+
/**
|
|
1097
|
+
* Сервис-реестр качества адресов, выбранных из подсказок.
|
|
1098
|
+
*/
|
|
1099
|
+
this.addressQualityService = inject(ScAddressQualityService);
|
|
1100
|
+
}
|
|
1101
|
+
/**
|
|
1102
|
+
* Возвращает текст предупреждения о необходимости проверить выбранный адрес либо null, когда предупреждение не требуется.
|
|
1103
|
+
*/
|
|
1104
|
+
getWarningMessage() {
|
|
1105
|
+
const { control } = this.ngControl;
|
|
1106
|
+
return control ? this.addressQualityService.getWarningMessage(control) : null;
|
|
1107
|
+
}
|
|
1108
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScAddressQualityDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1109
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: ScAddressQualityDirective, isStandalone: true, selector: "[scAddressQuality]", exportAs: ["scAddressQuality"], ngImport: i0 }); }
|
|
1110
|
+
}
|
|
1111
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScAddressQualityDirective, decorators: [{
|
|
1112
|
+
type: Directive,
|
|
1113
|
+
args: [{
|
|
1114
|
+
standalone: true,
|
|
1115
|
+
selector: '[scAddressQuality]',
|
|
1116
|
+
exportAs: 'scAddressQuality',
|
|
1117
|
+
}]
|
|
1118
|
+
}] });
|
|
1119
|
+
|
|
741
1120
|
/**
|
|
742
1121
|
* Пайп для форматирования даты и времени.
|
|
743
1122
|
*/
|
|
@@ -1814,7 +2193,7 @@ class ScSimpleSignUpFormComponent {
|
|
|
1814
2193
|
this.helpNotificationService.closeAllHelpNotification();
|
|
1815
2194
|
}
|
|
1816
2195
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScSimpleSignUpFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1817
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScSimpleSignUpFormComponent, isStandalone: true, selector: "sc-simple-sign-up-form", outputs: { successAuth: "successAuth", clickOffer: "clickOffer" }, providers: [tuiDropdownOptionsProvider({ limitWidth: 'fixed' })], ngImport: i0, template: "<form\n [formGroup]=\"form\"\n (ngSubmit)=\"onSubmit$.next()\"\n class=\"flex flex-col gap-6\"\n>\n <div class=\"flex flex-col gap-3\">\n <sc-verification-phone-check-form\n (isBusyChange)=\"onIsBusyChange($event)\"\n (isConfirmedChange)=\"onIsConfirmedChange($event)\"\n [showCodeFields]=\"form.controls.phone.valid && form.controls.phone.valid\"\n [shouldBeConfirmed]=\"true\"\n />\n @if (isPhoneBusy() !== null && form.controls.phone.valid) {\n @if (!isPhoneBusy()) {\n <label tuiLabel>\n \u0424.\u0418.\u041E.\n <tui-textfield>\n <input\n tuiInput\n autocomplete=\"name\"\n formControlName=\"name\"\n placeholder=\"\u0424.\u0418.\u041E.\"\n />\n </tui-textfield>\n <tui-error formControlName=\"name\" />\n </label>\n\n <label tuiLabel>\n \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"email\"\n placeholder=\"\u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.email\"\n />\n </tui-textfield>\n <tui-error formControlName=\"email\" />\n </label>\n\n <label tuiLabel>\n <input\n tuiCheckbox\n type=\"checkbox\"\n formControlName=\"getNews\"\n />\n \u042F \u0445\u043E\u0447\u0443 \u043F\u043E\u043B\u0443\u0447\u0430\u0442\u044C \u0440\u0430\u0441\u0441\u044B\u043B\u043A\u0443 \u0421\u043D\u0430\u0431\u0446\u0435\u043D\u0442\u0440 \u043E \u0441\u043A\u0438\u0434\u043A\u0430\u0445 \u0438 \u043D\u043E\u0432\u043E\u0441\u0442\u044F\u0445 \u043F\u043E \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u0435.\n </label>\n\n <label tuiLabel>\n <input\n tuiCheckbox\n type=\"checkbox\"\n required=\"true\"\n formControlName=\"acceptRules\"\n />\n <div>\n <span>\n \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u044F\u0441\u044C \u043D\u0430 \u0441\u0430\u0439\u0442\u0435, \u044F \u0441\u043E\u0433\u043B\u0430\u0448\u0430\u044E\u0441\u044C \u0441\n <a\n tuiLink\n [style.text-decoration-line]=\"'underline'\"\n (click)=\"$event.preventDefault(); clickOffer.emit()\"\n >\n \u0414\u043E\u0433\u043E\u0432\u043E\u0440\u043E\u043C \u043E\u0444\u0435\u0440\u0442\u044B\n </a>\n .\n </span>\n <span class=\"text-tui-negative\">*</span>\n <tui-error formControlName=\"acceptRules\" />\n </div>\n </label>\n }\n }\n\n <tui-error\n class=\"self-center\"\n [formGroup]=\"form\"\n />\n </div>\n <button\n tuiButton\n [disabled]=\"isPhoneBusy() ? form.controls.verificationCode.invalid || form.controls.phone.invalid : form.invalid\"\n [loading]=\"loading()\"\n type=\"submit\"\n class=\"self-center\"\n >\n {{ isPhoneBusy() ? '\u0412\u043E\u0439\u0442\u0438' : '\u041A\u0443\u043F\u0438\u0442\u044C' }}\n </button>\n</form>\n", dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.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: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.CheckboxRequiredValidator, selector: "input[type=checkbox][required][formControlName],input[type=checkbox][required][formControl],input[type=checkbox][required][ngModel]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: i2.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler"] }, { kind: "directive", type: i3.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { kind: "directive", type: i2.TuiInputDirective, selector: "input[tuiInput]", inputs: ["readOnly", "invalid", "focused", "state"] }, { kind: "component", type: i2.TuiErrorComponent, selector: "tui-error", inputs: ["error"] }, { kind: "directive", type: i2.TuiErrorDirective, selector: "tui-error[ngModel], tui-error[formControlName], tui-error[formControl], tui-error[formGroup], tui-error[formGroupName], tui-error[formArrayName], tui-error[formArray]", inputs: ["order"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: TuiCheckbox, selector: "input[type=\"checkbox\"][tuiCheckbox]" }, { kind: "directive", type: TuiLink, selector: "a[tuiLink], button[tuiLink]" }, { kind: "component", type: ScVerificationPhoneCheckFormComponent, selector: "sc-verification-phone-check-form", inputs: ["showCodeFields", "readOnly", "pseudoInvalid", "required", "subtitle", "shouldBeBusy", "shouldBeConfirmed", "haveCode"], outputs: ["haveCodeChange", "isBusyChange", "isConfirmedChange"] }, { kind: "component", type: ScSuggestionFieldComponent, selector: "sc-suggestion-field", inputs: ["type"], outputs: ["selectedClick"] }, { kind: "component", type: TuiButtonLoading, selector: "[tuiButton][loading],[tuiIconButton][loading]", inputs: ["size", "loading"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2196
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScSimpleSignUpFormComponent, isStandalone: true, selector: "sc-simple-sign-up-form", outputs: { successAuth: "successAuth", clickOffer: "clickOffer" }, providers: [tuiDropdownOptionsProvider({ limitWidth: 'fixed' })], ngImport: i0, template: "<form\n [formGroup]=\"form\"\n (ngSubmit)=\"onSubmit$.next()\"\n class=\"flex flex-col gap-6\"\n>\n <div class=\"flex flex-col gap-3\">\n <sc-verification-phone-check-form\n (isBusyChange)=\"onIsBusyChange($event)\"\n (isConfirmedChange)=\"onIsConfirmedChange($event)\"\n [showCodeFields]=\"form.controls.phone.valid && form.controls.phone.valid\"\n [shouldBeConfirmed]=\"true\"\n />\n @if (isPhoneBusy() !== null && form.controls.phone.valid) {\n @if (!isPhoneBusy()) {\n <label tuiLabel>\n \u0424.\u0418.\u041E.\n <tui-textfield>\n <input\n tuiInput\n autocomplete=\"name\"\n formControlName=\"name\"\n placeholder=\"\u0424.\u0418.\u041E.\"\n />\n </tui-textfield>\n <tui-error formControlName=\"name\" />\n </label>\n\n <label tuiLabel>\n \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"email\"\n placeholder=\"\u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.email\"\n />\n </tui-textfield>\n <tui-error formControlName=\"email\" />\n </label>\n\n <label tuiLabel>\n <input\n tuiCheckbox\n type=\"checkbox\"\n formControlName=\"getNews\"\n />\n \u042F \u0445\u043E\u0447\u0443 \u043F\u043E\u043B\u0443\u0447\u0430\u0442\u044C \u0440\u0430\u0441\u0441\u044B\u043B\u043A\u0443 \u0421\u043D\u0430\u0431\u0446\u0435\u043D\u0442\u0440 \u043E \u0441\u043A\u0438\u0434\u043A\u0430\u0445 \u0438 \u043D\u043E\u0432\u043E\u0441\u0442\u044F\u0445 \u043F\u043E \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u0435.\n </label>\n\n <label tuiLabel>\n <input\n tuiCheckbox\n type=\"checkbox\"\n required=\"true\"\n formControlName=\"acceptRules\"\n />\n <div>\n <span>\n \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u044F\u0441\u044C \u043D\u0430 \u0441\u0430\u0439\u0442\u0435, \u044F \u0441\u043E\u0433\u043B\u0430\u0448\u0430\u044E\u0441\u044C \u0441\n <a\n tuiLink\n [style.text-decoration-line]=\"'underline'\"\n (click)=\"$event.preventDefault(); clickOffer.emit()\"\n >\n \u0414\u043E\u0433\u043E\u0432\u043E\u0440\u043E\u043C \u043E\u0444\u0435\u0440\u0442\u044B\n </a>\n .\n </span>\n <span class=\"text-tui-negative\">*</span>\n <tui-error formControlName=\"acceptRules\" />\n </div>\n </label>\n }\n }\n\n <tui-error\n class=\"self-center\"\n [formGroup]=\"form\"\n />\n </div>\n <button\n tuiButton\n [disabled]=\"isPhoneBusy() ? form.controls.verificationCode.invalid || form.controls.phone.invalid : form.invalid\"\n [loading]=\"loading()\"\n type=\"submit\"\n class=\"self-center\"\n >\n {{ isPhoneBusy() ? '\u0412\u043E\u0439\u0442\u0438' : '\u041A\u0443\u043F\u0438\u0442\u044C' }}\n </button>\n</form>\n", dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.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: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.CheckboxRequiredValidator, selector: "input[type=checkbox][required][formControlName],input[type=checkbox][required][formControl],input[type=checkbox][required][ngModel]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: i2.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler"] }, { kind: "directive", type: i3.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { kind: "directive", type: i2.TuiInputDirective, selector: "input[tuiInput]", inputs: ["readOnly", "invalid", "focused", "state"] }, { kind: "component", type: i2.TuiErrorComponent, selector: "tui-error", inputs: ["error"] }, { kind: "directive", type: i2.TuiErrorDirective, selector: "tui-error[ngModel], tui-error[formControlName], tui-error[formControl], tui-error[formGroup], tui-error[formGroupName], tui-error[formArrayName], tui-error[formArray]", inputs: ["order"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: TuiCheckbox, selector: "input[type=\"checkbox\"][tuiCheckbox]" }, { kind: "directive", type: TuiLink, selector: "a[tuiLink], button[tuiLink]" }, { kind: "component", type: ScVerificationPhoneCheckFormComponent, selector: "sc-verification-phone-check-form", inputs: ["showCodeFields", "readOnly", "pseudoInvalid", "required", "subtitle", "shouldBeBusy", "shouldBeConfirmed", "haveCode"], outputs: ["haveCodeChange", "isBusyChange", "isConfirmedChange"] }, { kind: "component", type: ScSuggestionFieldComponent, selector: "sc-suggestion-field", inputs: ["type", "showAddressQuality"], outputs: ["selectedClick"] }, { kind: "component", type: TuiButtonLoading, selector: "[tuiButton][loading],[tuiIconButton][loading]", inputs: ["size", "loading"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1818
2197
|
}
|
|
1819
2198
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScSimpleSignUpFormComponent, decorators: [{
|
|
1820
2199
|
type: Component,
|
|
@@ -2108,7 +2487,7 @@ class ScNewContactFormComponent {
|
|
|
2108
2487
|
this.countries = getCountries();
|
|
2109
2488
|
}
|
|
2110
2489
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScNewContactFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2111
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.16", type: ScNewContactFormComponent, isStandalone: true, selector: "sc-new-contact-form", inputs: { form: "form" }, ngImport: i0, template: "<div\n [formGroup]=\"form\"\n class=\"flex flex-col gap-3\"\n>\n <label tuiLabel>\n \u0424.\u0418.\u041E.\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"name\"\n placeholder=\"\u0424.\u0418.\u041E.\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.fio\"\n />\n </tui-textfield>\n <tui-error formControlName=\"name\" />\n </label>\n\n <label tuiLabel>\n \u0422\u0435\u043B\u0435\u0444\u043E\u043D\n <tui-textfield>\n <input\n formControlName=\"phone\"\n tuiInputPhoneInternational\n [countrySearch]=\"true\"\n [countries]=\"(countries | tuiSortCountries) || []\"\n autocomplete=\"phone\"\n placeholder=\"\u0422\u0435\u043B\u0435\u0444\u043E\u043D\"\n />\n </tui-textfield>\n <tui-error formControlName=\"phone\" />\n </label>\n\n <label tuiLabel>\n \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"email\"\n placeholder=\"\u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.email\"\n />\n </tui-textfield>\n <tui-error formControlName=\"email\" />\n </label>\n\n <label tuiLabel>\n \u0414\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C \u043A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u043E\u0433\u043E \u043B\u0438\u0446\u0430\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"position\"\n placeholder=\"\u0414\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C \u043A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u043E\u0433\u043E \u043B\u0438\u0446\u0430\"\n />\n </tui-textfield>\n <tui-error formControlName=\"position\" />\n </label>\n</div>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: i2.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler"] }, { kind: "directive", type: i3.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { kind: "directive", type: i2.TuiInputDirective, selector: "input[tuiInput]", inputs: ["readOnly", "invalid", "focused", "state"] }, { kind: "component", type: ScSuggestionFieldComponent, selector: "sc-suggestion-field", inputs: ["type"], outputs: ["selectedClick"] }, { kind: "component", type: i2.TuiErrorComponent, selector: "tui-error", inputs: ["error"] }, { kind: "directive", type: i2.TuiErrorDirective, selector: "tui-error[ngModel], tui-error[formControlName], tui-error[formControl], tui-error[formGroup], tui-error[formGroupName], tui-error[formArrayName], tui-error[formArray]", inputs: ["order"] }, { kind: "component", type: i1$1.TuiInputPhoneInternationalComponent, selector: "input[tuiInputPhoneInternational]", inputs: ["countrySearch", "countryIsoCode", "countries"], outputs: ["countryIsoCodeChange"] }, { kind: "pipe", type: TuiSortCountriesPipe, name: "tuiSortCountries" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2490
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.16", type: ScNewContactFormComponent, isStandalone: true, selector: "sc-new-contact-form", inputs: { form: "form" }, ngImport: i0, template: "<div\n [formGroup]=\"form\"\n class=\"flex flex-col gap-3\"\n>\n <label tuiLabel>\n \u0424.\u0418.\u041E.\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"name\"\n placeholder=\"\u0424.\u0418.\u041E.\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.fio\"\n />\n </tui-textfield>\n <tui-error formControlName=\"name\" />\n </label>\n\n <label tuiLabel>\n \u0422\u0435\u043B\u0435\u0444\u043E\u043D\n <tui-textfield>\n <input\n formControlName=\"phone\"\n tuiInputPhoneInternational\n [countrySearch]=\"true\"\n [countries]=\"(countries | tuiSortCountries) || []\"\n autocomplete=\"phone\"\n placeholder=\"\u0422\u0435\u043B\u0435\u0444\u043E\u043D\"\n />\n </tui-textfield>\n <tui-error formControlName=\"phone\" />\n </label>\n\n <label tuiLabel>\n \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"email\"\n placeholder=\"\u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.email\"\n />\n </tui-textfield>\n <tui-error formControlName=\"email\" />\n </label>\n\n <label tuiLabel>\n \u0414\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C \u043A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u043E\u0433\u043E \u043B\u0438\u0446\u0430\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"position\"\n placeholder=\"\u0414\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C \u043A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u043E\u0433\u043E \u043B\u0438\u0446\u0430\"\n />\n </tui-textfield>\n <tui-error formControlName=\"position\" />\n </label>\n</div>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: i2.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler"] }, { kind: "directive", type: i3.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { kind: "directive", type: i2.TuiInputDirective, selector: "input[tuiInput]", inputs: ["readOnly", "invalid", "focused", "state"] }, { kind: "component", type: ScSuggestionFieldComponent, selector: "sc-suggestion-field", inputs: ["type", "showAddressQuality"], outputs: ["selectedClick"] }, { kind: "component", type: i2.TuiErrorComponent, selector: "tui-error", inputs: ["error"] }, { kind: "directive", type: i2.TuiErrorDirective, selector: "tui-error[ngModel], tui-error[formControlName], tui-error[formControl], tui-error[formGroup], tui-error[formGroupName], tui-error[formArrayName], tui-error[formArray]", inputs: ["order"] }, { kind: "component", type: i1$1.TuiInputPhoneInternationalComponent, selector: "input[tuiInputPhoneInternational]", inputs: ["countrySearch", "countryIsoCode", "countries"], outputs: ["countryIsoCodeChange"] }, { kind: "pipe", type: TuiSortCountriesPipe, name: "tuiSortCountries" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2112
2491
|
}
|
|
2113
2492
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScNewContactFormComponent, decorators: [{
|
|
2114
2493
|
type: Component,
|
|
@@ -2186,7 +2565,7 @@ class ScNewContragentBankAccountsFormComponent {
|
|
|
2186
2565
|
return this.referencesService.getCurrencyById$(currencyId);
|
|
2187
2566
|
}
|
|
2188
2567
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScNewContragentBankAccountsFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2189
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScNewContragentBankAccountsFormComponent, isStandalone: true, selector: "sc-new-contragent-bank-account-form", inputs: { form: { classPropertyName: "form", publicName: "form", isSignal: false, isRequired: false, transformFunction: null }, opf: { classPropertyName: "opf", publicName: "opf", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div\n [formGroup]=\"form\"\n class=\"flex flex-col gap-3\"\n>\n <label tuiLabel>\n \u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u0431\u0430\u043D\u043A\u0430\n <tui-textfield>\n @if (opfListEnum[opf()] !== opfListEnum.non_resident_legal) {\n <input\n tuiInput\n formControlName=\"bankName\"\n placeholder=\"\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u0431\u0430\u043D\u043A\u0430\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.bank\"\n />\n } @else {\n <input\n tuiInput\n formControlName=\"bankName\"\n placeholder=\"\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u0431\u0430\u043D\u043A\u0430\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"bankName\" />\n </label>\n <label tuiLabel>\n \u0411\u0418\u041A\n <tui-textfield>\n @if (opfListEnum[opf()] !== opfListEnum.non_resident_legal) {\n <input\n tuiInput\n [maskito]=\"bicMask\"\n autocomplete=\"bic\"\n formControlName=\"bic\"\n placeholder=\"\u0411\u0418\u041A\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.bank\"\n />\n } @else {\n <input\n tuiInput\n [maskito]=\"bicMask\"\n autocomplete=\"bic\"\n formControlName=\"bic\"\n placeholder=\"\u0411\u0418\u041A\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"bic\" />\n </label>\n <label tuiLabel>\n \u041D\u043E\u043C\u0435\u0440 \u0441\u0447\u0435\u0442\u0430\n <tui-textfield>\n <input\n tuiInput\n [maskito]=\"accountNumberMask\"\n autocomplete=\"accountNumber\"\n formControlName=\"accountNumber\"\n placeholder=\"\u041D\u043E\u043C\u0435\u0440 \u0441\u0447\u0435\u0442\u0430\"\n />\n </tui-textfield>\n <tui-error formControlName=\"accountNumber\" />\n </label>\n <label tuiLabel>\n \u041A\u043E\u0440\u0440\u0435\u0441\u043F\u043E\u043D\u0434\u0435\u043D\u0442\u0441\u043A\u0438\u0439 \u0441\u0447\u0435\u0442\n <tui-textfield>\n <input\n tuiInput\n [maskito]=\"correspondentAccount\"\n autocomplete=\"correspondentAccount\"\n formControlName=\"correspondentAccount\"\n placeholder=\"\u041A\u043E\u0440\u0440\u0435\u0441\u043F\u043E\u043D\u0434\u0435\u043D\u0442\u0441\u043A\u0438\u0439 \u0441\u0447\u0435\u0442\"\n />\n </tui-textfield>\n <tui-error formControlName=\"correspondentAccount\" />\n </label>\n <label tuiLabel>\n \u0412\u0430\u043B\u044E\u0442\u0430 \u0440\u0430\u0441\u0447\u0451\u0442\u043E\u0432\n <tui-textfield\n tuiChevron\n [content]=\"currencyContent\"\n >\n <input\n tuiSelect\n formControlName=\"currencyId\"\n placeholder=\"\u0412\u0430\u043B\u044E\u0442\u0430 \u0440\u0430\u0441\u0447\u0451\u0442\u043E\u0432\"\n />\n <tui-data-list *tuiDropdown>\n @for (item of currencies$ | async; track item; let index = $index) {\n <button\n tuiOption\n [value]=\"item.id\"\n >\n {{ item.name }} ({{ item.symbol }})\n </button>\n }\n </tui-data-list>\n </tui-textfield>\n <ng-template\n #currencyContent\n let-data\n >\n <div>{{ (getCurrencyById$(data) | async)?.name }}</div>\n </ng-template>\n <tui-error formControlName=\"currencyId\" />\n </label>\n</div>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: i2.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler"] }, { kind: "directive", type: i3.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { kind: "directive", type: TuiChevron, selector: "[tuiChevron]", inputs: ["tuiChevron"] }, { kind: "directive", type: i2.TuiInputDirective, selector: "input[tuiInput]", inputs: ["readOnly", "invalid", "focused", "state"] }, { kind: "component", type: ScSuggestionFieldComponent, selector: "sc-suggestion-field", inputs: ["type"], outputs: ["selectedClick"] }, { kind: "component", type: i2.TuiErrorComponent, selector: "tui-error", inputs: ["error"] }, { kind: "directive", type: i2.TuiErrorDirective, selector: "tui-error[ngModel], tui-error[formControlName], tui-error[formControl], tui-error[formGroup], tui-error[formGroupName], tui-error[formArrayName], tui-error[formArray]", inputs: ["order"] }, { kind: "directive", type: MaskitoDirective, selector: "[maskito]", inputs: ["maskito", "maskitoElement"], outputs: ["maskitoChange", "maskitoElementChange"] }, { kind: "directive", type: i1$1.TuiSelectDirective, selector: "input[tuiSelect]" }, { kind: "component", type: i2.TuiDataListComponent, selector: "tui-data-list", inputs: ["emptyContent", "size"] }, { kind: "directive", type: i2.TuiOption, selector: "button[tuiOption], a[tuiOption], label[tuiOption]", inputs: ["disabled"] }, { kind: "directive", type: i2.TuiOptionWithValue, selector: "button[tuiOption][value], a[tuiOption][value], label[tuiOption][value]", inputs: ["disabled", "value"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2568
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScNewContragentBankAccountsFormComponent, isStandalone: true, selector: "sc-new-contragent-bank-account-form", inputs: { form: { classPropertyName: "form", publicName: "form", isSignal: false, isRequired: false, transformFunction: null }, opf: { classPropertyName: "opf", publicName: "opf", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div\n [formGroup]=\"form\"\n class=\"flex flex-col gap-3\"\n>\n <label tuiLabel>\n \u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u0431\u0430\u043D\u043A\u0430\n <tui-textfield>\n @if (opfListEnum[opf()] !== opfListEnum.non_resident_legal) {\n <input\n tuiInput\n formControlName=\"bankName\"\n placeholder=\"\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u0431\u0430\u043D\u043A\u0430\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.bank\"\n />\n } @else {\n <input\n tuiInput\n formControlName=\"bankName\"\n placeholder=\"\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u0431\u0430\u043D\u043A\u0430\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"bankName\" />\n </label>\n <label tuiLabel>\n \u0411\u0418\u041A\n <tui-textfield>\n @if (opfListEnum[opf()] !== opfListEnum.non_resident_legal) {\n <input\n tuiInput\n [maskito]=\"bicMask\"\n autocomplete=\"bic\"\n formControlName=\"bic\"\n placeholder=\"\u0411\u0418\u041A\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.bank\"\n />\n } @else {\n <input\n tuiInput\n [maskito]=\"bicMask\"\n autocomplete=\"bic\"\n formControlName=\"bic\"\n placeholder=\"\u0411\u0418\u041A\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"bic\" />\n </label>\n <label tuiLabel>\n \u041D\u043E\u043C\u0435\u0440 \u0441\u0447\u0435\u0442\u0430\n <tui-textfield>\n <input\n tuiInput\n [maskito]=\"accountNumberMask\"\n autocomplete=\"accountNumber\"\n formControlName=\"accountNumber\"\n placeholder=\"\u041D\u043E\u043C\u0435\u0440 \u0441\u0447\u0435\u0442\u0430\"\n />\n </tui-textfield>\n <tui-error formControlName=\"accountNumber\" />\n </label>\n <label tuiLabel>\n \u041A\u043E\u0440\u0440\u0435\u0441\u043F\u043E\u043D\u0434\u0435\u043D\u0442\u0441\u043A\u0438\u0439 \u0441\u0447\u0435\u0442\n <tui-textfield>\n <input\n tuiInput\n [maskito]=\"correspondentAccount\"\n autocomplete=\"correspondentAccount\"\n formControlName=\"correspondentAccount\"\n placeholder=\"\u041A\u043E\u0440\u0440\u0435\u0441\u043F\u043E\u043D\u0434\u0435\u043D\u0442\u0441\u043A\u0438\u0439 \u0441\u0447\u0435\u0442\"\n />\n </tui-textfield>\n <tui-error formControlName=\"correspondentAccount\" />\n </label>\n <label tuiLabel>\n \u0412\u0430\u043B\u044E\u0442\u0430 \u0440\u0430\u0441\u0447\u0451\u0442\u043E\u0432\n <tui-textfield\n tuiChevron\n [content]=\"currencyContent\"\n >\n <input\n tuiSelect\n formControlName=\"currencyId\"\n placeholder=\"\u0412\u0430\u043B\u044E\u0442\u0430 \u0440\u0430\u0441\u0447\u0451\u0442\u043E\u0432\"\n />\n <tui-data-list *tuiDropdown>\n @for (item of currencies$ | async; track item; let index = $index) {\n <button\n tuiOption\n [value]=\"item.id\"\n >\n {{ item.name }} ({{ item.symbol }})\n </button>\n }\n </tui-data-list>\n </tui-textfield>\n <ng-template\n #currencyContent\n let-data\n >\n <div>{{ (getCurrencyById$(data) | async)?.name }}</div>\n </ng-template>\n <tui-error formControlName=\"currencyId\" />\n </label>\n</div>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: i2.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler"] }, { kind: "directive", type: i3.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { kind: "directive", type: TuiChevron, selector: "[tuiChevron]", inputs: ["tuiChevron"] }, { kind: "directive", type: i2.TuiInputDirective, selector: "input[tuiInput]", inputs: ["readOnly", "invalid", "focused", "state"] }, { kind: "component", type: ScSuggestionFieldComponent, selector: "sc-suggestion-field", inputs: ["type", "showAddressQuality"], outputs: ["selectedClick"] }, { kind: "component", type: i2.TuiErrorComponent, selector: "tui-error", inputs: ["error"] }, { kind: "directive", type: i2.TuiErrorDirective, selector: "tui-error[ngModel], tui-error[formControlName], tui-error[formControl], tui-error[formGroup], tui-error[formGroupName], tui-error[formArrayName], tui-error[formArray]", inputs: ["order"] }, { kind: "directive", type: MaskitoDirective, selector: "[maskito]", inputs: ["maskito", "maskitoElement"], outputs: ["maskitoChange", "maskitoElementChange"] }, { kind: "directive", type: i1$1.TuiSelectDirective, selector: "input[tuiSelect]" }, { kind: "component", type: i2.TuiDataListComponent, selector: "tui-data-list", inputs: ["emptyContent", "size"] }, { kind: "directive", type: i2.TuiOption, selector: "button[tuiOption], a[tuiOption], label[tuiOption]", inputs: ["disabled"] }, { kind: "directive", type: i2.TuiOptionWithValue, selector: "button[tuiOption][value], a[tuiOption][value], label[tuiOption][value]", inputs: ["disabled", "value"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2190
2569
|
}
|
|
2191
2570
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScNewContragentBankAccountsFormComponent, decorators: [{
|
|
2192
2571
|
type: Component,
|
|
@@ -2250,15 +2629,14 @@ function scPasswordConfirmMatchingValidator(passwordKey, passwordConfirmKey) {
|
|
|
2250
2629
|
* Проверяет кратность значения.
|
|
2251
2630
|
*
|
|
2252
2631
|
* @param step Шаг кратности.
|
|
2253
|
-
* @param precision Точность, количество чисел после запятой.
|
|
2254
2632
|
*/
|
|
2255
|
-
function stepValidator(step
|
|
2633
|
+
function stepValidator(step) {
|
|
2256
2634
|
return ({ value }) => {
|
|
2257
2635
|
if (!step) {
|
|
2258
2636
|
return null;
|
|
2259
2637
|
}
|
|
2260
2638
|
if (value) {
|
|
2261
|
-
return
|
|
2639
|
+
return ScNumberHelper.isMultipleOf(value, step) ? null : { error: `Число не кратно ${step}` };
|
|
2262
2640
|
}
|
|
2263
2641
|
return null;
|
|
2264
2642
|
};
|
|
@@ -2289,7 +2667,7 @@ function scAtLeastOneRequiredValidator(fields, blockName) {
|
|
|
2289
2667
|
};
|
|
2290
2668
|
}
|
|
2291
2669
|
|
|
2292
|
-
/* eslint-disable class-methods-use-this,@typescript-eslint/unbound-method */
|
|
2670
|
+
/* eslint-disable class-methods-use-this,@typescript-eslint/unbound-method,security/detect-object-injection */
|
|
2293
2671
|
/**
|
|
2294
2672
|
* Форма создания нового контрагента.
|
|
2295
2673
|
*/
|
|
@@ -2303,6 +2681,10 @@ class ScNewContragentFormComponent {
|
|
|
2303
2681
|
* Сервис для получения списков стран, регионов, городов.
|
|
2304
2682
|
*/
|
|
2305
2683
|
this.locationsService = inject(ScLocationsService);
|
|
2684
|
+
/**
|
|
2685
|
+
* Сервис-реестр качества адресов, выбранных из подсказок.
|
|
2686
|
+
*/
|
|
2687
|
+
this.addressQualityService = inject(ScAddressQualityService);
|
|
2306
2688
|
/**
|
|
2307
2689
|
* Директива c `FormGroup` из DOM.
|
|
2308
2690
|
*/
|
|
@@ -2316,9 +2698,9 @@ class ScNewContragentFormComponent {
|
|
|
2316
2698
|
directorName: new FormControl(null, Validators.required),
|
|
2317
2699
|
directorPosition: new FormControl(null, Validators.required),
|
|
2318
2700
|
directorActsOn: new FormControl(null, Validators.required),
|
|
2319
|
-
legalAddress: new FormControl(null, Validators.required),
|
|
2320
|
-
postalAddress: new FormControl(null, Validators.required),
|
|
2321
|
-
actualAddress: new FormControl(null, Validators.required),
|
|
2701
|
+
legalAddress: new FormControl(null, [Validators.required, this.addressQualityService.validator]),
|
|
2702
|
+
postalAddress: new FormControl(null, [Validators.required, this.addressQualityService.validator]),
|
|
2703
|
+
actualAddress: new FormControl(null, [Validators.required, this.addressQualityService.validator]),
|
|
2322
2704
|
bankAccounts: new FormArray([
|
|
2323
2705
|
new FormGroup({
|
|
2324
2706
|
bankName: new FormControl(null, Validators.required),
|
|
@@ -2366,6 +2748,15 @@ class ScNewContragentFormComponent {
|
|
|
2366
2748
|
* {@link Observable} выбора ОПФ.
|
|
2367
2749
|
*/
|
|
2368
2750
|
this.selectOpf$ = tuiControlValue(this.form.controls.opf).pipe(distinctUntilChanged(), tap((opf) => {
|
|
2751
|
+
const opfOrder = ScOpfList[opf];
|
|
2752
|
+
const innLength = opfOrder > ScOpfList.entrepreneur ? 10 : 12;
|
|
2753
|
+
const okpoLength = opfOrder > ScOpfList.entrepreneur ? 8 : 10;
|
|
2754
|
+
// Правила задаются до включения контролов: enable и setControl проверяют сразу.
|
|
2755
|
+
this.entrepreneurGroup.controls.inn.setValidators([Validators.required, Validators.minLength(innLength), Validators.maxLength(innLength)]);
|
|
2756
|
+
this.entrepreneurGroup.controls.okpo.setValidators([Validators.required, Validators.minLength(okpoLength), Validators.maxLength(okpoLength)]);
|
|
2757
|
+
[this.entrepreneurGroup.controls.legalAddress, this.entrepreneurGroup.controls.postalAddress, this.entrepreneurGroup.controls.actualAddress].forEach((addressControl) => {
|
|
2758
|
+
this.addressQualityService.setQualityCheckEnabled(addressControl, opfOrder !== ScOpfList.non_resident_legal);
|
|
2759
|
+
});
|
|
2369
2760
|
Object.keys({ ...this.entrepreneurGroup.controls, ...this.legalGroup.controls, ...this.nonResidentLegalGroup.controls }).forEach((key) => {
|
|
2370
2761
|
this.form.get(key)?.disable();
|
|
2371
2762
|
});
|
|
@@ -2375,20 +2766,13 @@ class ScNewContragentFormComponent {
|
|
|
2375
2766
|
this.form.setControl(key, formGroup.get(key));
|
|
2376
2767
|
});
|
|
2377
2768
|
};
|
|
2378
|
-
|
|
2379
|
-
if (ScOpfList[opf] > ScOpfList.individual) {
|
|
2769
|
+
if (opfOrder > ScOpfList.individual) {
|
|
2380
2770
|
addControls(this.entrepreneurGroup);
|
|
2381
|
-
this.entrepreneurGroup.controls.inn.setValidators([Validators.required, Validators.minLength(12)]);
|
|
2382
|
-
this.entrepreneurGroup.controls.okpo.setValidators([Validators.required, Validators.minLength(10)]);
|
|
2383
2771
|
}
|
|
2384
|
-
|
|
2385
|
-
if (ScOpfList[opf] > ScOpfList.entrepreneur) {
|
|
2772
|
+
if (opfOrder > ScOpfList.entrepreneur) {
|
|
2386
2773
|
addControls(this.legalGroup);
|
|
2387
|
-
this.entrepreneurGroup.controls.inn.setValidators([Validators.required, Validators.minLength(10)]);
|
|
2388
|
-
this.entrepreneurGroup.controls.okpo.setValidators([Validators.required, Validators.minLength(8)]);
|
|
2389
2774
|
}
|
|
2390
|
-
|
|
2391
|
-
if (ScOpfList[opf] > ScOpfList.legal) {
|
|
2775
|
+
if (opfOrder > ScOpfList.legal) {
|
|
2392
2776
|
addControls(this.nonResidentLegalGroup);
|
|
2393
2777
|
this.legalGroup.controls.kpp.disable();
|
|
2394
2778
|
this.entrepreneurGroup.controls.inn.disable();
|
|
@@ -2420,14 +2804,12 @@ class ScNewContragentFormComponent {
|
|
|
2420
2804
|
*
|
|
2421
2805
|
* @param opf Организационно-правовая форма.
|
|
2422
2806
|
*/
|
|
2423
|
-
// eslint-disable-next-line security/detect-object-injection
|
|
2424
2807
|
this.innMask = (opf) => (ScOpfList[opf] > ScOpfList.entrepreneur ? scLegalInnMask : scEntrepreneurInnMask);
|
|
2425
2808
|
/**
|
|
2426
2809
|
* Маска поля ввода ОКПО.
|
|
2427
2810
|
*
|
|
2428
2811
|
* @param opf Организационно-правовая форма.
|
|
2429
2812
|
*/
|
|
2430
|
-
// eslint-disable-next-line security/detect-object-injection
|
|
2431
2813
|
this.okpoMask = (opf) => (ScOpfList[opf] > ScOpfList.entrepreneur ? scLegalOkpoMask : scEntrepreneurOkpoMask);
|
|
2432
2814
|
/**
|
|
2433
2815
|
* Функция преобразования объекта сортировки в значение, отображаемое в поле ввода.
|
|
@@ -2485,7 +2867,7 @@ class ScNewContragentFormComponent {
|
|
|
2485
2867
|
return this.locationsService.getCountries$().pipe(map((countries) => countries?.find((country) => country.id === countryId)?.name ?? ''));
|
|
2486
2868
|
}
|
|
2487
2869
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScNewContragentFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2488
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScNewContragentFormComponent, isStandalone: true, selector: "sc-new-contragent-form", inputs: { opfControl: "opfControl" }, ngImport: i0, template: "@if (selectOpf$ | async; as selectOpf) {\n <div\n [formGroup]=\"form\"\n class=\"flex flex-col gap-3 pb-1\"\n >\n <p class=\"text-lg font-bold\">\u041E\u0431\u0449\u0438\u0435 \u0434\u0430\u043D\u043D\u044B\u0435 \u043A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\u0430</p>\n <label tuiLabel>\n \u0422\u0438\u043F \u043A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\u0430 (\u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u043E\u043D\u043D\u043E-\u043F\u0440\u0430\u0432\u043E\u0432\u0430\u044F \u0444\u043E\u0440\u043C\u0430)\n <tui-textfield\n tuiChevron\n [content]=\"opfContent\"\n >\n <input\n tuiSelect\n formControlName=\"opf\"\n [readOnly]=\"!!opfControl\"\n placeholder=\"\u0422\u0438\u043F \u043A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\u0430 (\u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u043E\u043D\u043D\u043E-\u043F\u0440\u0430\u0432\u043E\u0432\u0430\u044F \u0444\u043E\u0440\u043C\u0430)\"\n />\n <tui-data-list *tuiDropdown>\n @for (item of getOpf$() | async; track item; let index = $index) {\n <button\n tuiOption\n [value]=\"item.slug\"\n >\n {{ item.name }}\n </button>\n }\n </tui-data-list>\n </tui-textfield>\n <ng-template\n #opfContent\n let-data\n >\n <div>{{ (getOpfBySlug$(data) | async)?.name }}</div>\n </ng-template>\n <tui-error formControlName=\"opf\" />\n </label>\n @let nameLabel = opfListEnum[selectOpf] === opfListEnum.individual ? '\u0424.\u0418.\u041E.' : '\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438';\n <label tuiLabel>\n {{ nameLabel }}\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"name\"\n [placeholder]=\"nameLabel\"\n />\n @if (opfListEnum[selectOpf] === opfListEnum.individual) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.fio\"\n />\n } @else if (opfListEnum[selectOpf] !== opfListEnum.non_resident_legal) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.organization\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"name\" />\n </label>\n @if (opfListEnum[selectOpf] > opfListEnum.individual) {\n <label tuiLabel>\n \u0418\u041D\u041D \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043B\u0438 \u0418\u041F\n <tui-textfield>\n <input\n tuiInput\n [maskito]=\"innMask(selectOpf)\"\n autocomplete=\"inn\"\n formControlName=\"inn\"\n placeholder=\"\u0418\u041D\u041D \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043B\u0438 \u0418\u041F\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.organization\"\n />\n </tui-textfield>\n <tui-error formControlName=\"inn\" />\n </label>\n @if (opfListEnum[selectOpf] === opfListEnum.legal) {\n <label tuiLabel>\n \u041A\u043E\u0434 \u041E\u041A\u041F\u041E\n <tui-textfield>\n <input\n tuiInput\n [maskito]=\"okpoMask(selectOpf)\"\n autocomplete=\"okpo\"\n formControlName=\"okpo\"\n placeholder=\"\u041A\u043E\u0434 \u041E\u041A\u041F\u041E\"\n />\n </tui-textfield>\n <tui-error formControlName=\"okpo\" />\n </label>\n }\n <label tuiLabel>\n \u0424.\u0418.\u041E. \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"directorName\"\n placeholder=\"\u0424.\u0418.\u041E. \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.fio\"\n />\n </tui-textfield>\n <tui-error formControlName=\"directorName\" />\n </label>\n <label tuiLabel>\n \u0414\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"directorPosition\"\n placeholder=\"\u0414\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\"\n />\n </tui-textfield>\n <tui-error formControlName=\"directorPosition\" />\n </label>\n <label tuiLabel>\n \u041E\u0441\u043D\u043E\u0432\u0430\u043D\u0438\u044F \u043F\u043E\u043B\u043D\u043E\u043C\u043E\u0447\u0438\u0439 \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"directorActsOn\"\n placeholder=\"\u041E\u0441\u043D\u043E\u0432\u0430\u043D\u0438\u044F \u043F\u043E\u043B\u043D\u043E\u043C\u043E\u0447\u0438\u0439 \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\"\n />\n </tui-textfield>\n <tui-error formControlName=\"directorActsOn\" />\n </label>\n <label tuiLabel>\n \u042E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0430\u0434\u0440\u0435\u0441\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"legalAddress\"\n placeholder=\"\u042E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0430\u0434\u0440\u0435\u0441\"\n />\n @if (opfListEnum[selectOpf] !== opfListEnum.non_resident_legal) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.address\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"legalAddress\" />\n </label>\n <label tuiLabel>\n \u041F\u043E\u0447\u0442\u043E\u0432\u044B\u0439 \u0430\u0434\u0440\u0435\u0441\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"postalAddress\"\n placeholder=\"\u041F\u043E\u0447\u0442\u043E\u0432\u044B\u0439 \u0430\u0434\u0440\u0435\u0441\"\n />\n @if (opfListEnum[selectOpf] !== opfListEnum.non_resident_legal) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.address\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"postalAddress\" />\n </label>\n <label tuiLabel>\n \u0424\u0430\u043A\u0442\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0430\u0434\u0440\u0435\u0441\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"actualAddress\"\n placeholder=\"\u0424\u0430\u043A\u0442\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0430\u0434\u0440\u0435\u0441\"\n />\n @if (opfListEnum[selectOpf] !== opfListEnum.non_resident_legal) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.address\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"actualAddress\" />\n </label>\n @if (opfListEnum[selectOpf] === opfListEnum.legal) {\n <label tuiLabel>\n \u041A\u041F\u041F \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438\n <tui-textfield>\n <input\n tuiInput\n [maskito]=\"kppMask\"\n autocomplete=\"kpp\"\n formControlName=\"kpp\"\n placeholder=\"\u041A\u041F\u041F \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438\"\n />\n </tui-textfield>\n <tui-error formControlName=\"kpp\" />\n </label>\n }\n }\n @if (opfListEnum[selectOpf] === opfListEnum.non_resident_legal) {\n @let countries = countries$ | async;\n @let countriesId = countriesId$ | async;\n @if (countries) {\n <label tuiLabel>\n \u0421\u0442\u0440\u0430\u043D\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\n <tui-textfield [stringify]=\"stringify(countries ?? [])\">\n <input\n tuiComboBox\n formControlName=\"registrationCountryId\"\n autocapitalize=\"off\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n placeholder=\"\u0421\u0442\u0440\u0430\u043D\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\"\n />\n <tui-data-list-wrapper\n *tuiDropdown\n [itemContent]=\"stringify(countries ?? []) | tuiStringifyContent\"\n [items]=\"countriesId | tuiFilterByInput\"\n />\n </tui-textfield>\n <ng-template\n #CountryContent\n let-data\n >\n <div>{{ (getCountryNameById$(data) | async) ?? '' }}</div>\n </ng-template>\n <tui-error formControlName=\"registrationCountryId\" />\n </label>\n }\n <ng-template #selectLoading> <tui-loader /> </ng-template>\n <label tuiLabel>\n \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u043E\u043D\u043D\u044B\u0439 \u043D\u043E\u043C\u0435\u0440 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"registrationNumber\"\n placeholder=\"\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u043E\u043D\u043D\u044B\u0439 \u043D\u043E\u043C\u0435\u0440 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\"\n />\n </tui-textfield>\n <tui-error formControlName=\"registrationNumber\" />\n </label>\n <label tuiLabel>\n \u041D\u0430\u043B\u043E\u0433\u043E\u0432\u044B\u0439 \u043D\u043E\u043C\u0435\u0440 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"taxNumber\"\n placeholder=\"\u041D\u0430\u043B\u043E\u0433\u043E\u0432\u044B\u0439 \u043D\u043E\u043C\u0435\u0440 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\"\n />\n </tui-textfield>\n <tui-error formControlName=\"taxNumber\" />\n </label>\n }\n </div>\n}\n", styles: ["tui-carousel{--tui-carousel-padding: .5rem}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: i2.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler"] }, { kind: "directive", type: i3.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { kind: "directive", type: i1$1.TuiSelectDirective, selector: "input[tuiSelect]" }, { kind: "directive", type: TuiChevron, selector: "[tuiChevron]", inputs: ["tuiChevron"] }, { kind: "component", type: i2.TuiDataListComponent, selector: "tui-data-list", inputs: ["emptyContent", "size"] }, { kind: "directive", type: i2.TuiOption, selector: "button[tuiOption], a[tuiOption], label[tuiOption]", inputs: ["disabled"] }, { kind: "directive", type: i2.TuiOptionWithValue, selector: "button[tuiOption][value], a[tuiOption][value], label[tuiOption][value]", inputs: ["disabled", "value"] }, { kind: "component", type: i2.TuiErrorComponent, selector: "tui-error", inputs: ["error"] }, { kind: "directive", type: i2.TuiErrorDirective, selector: "tui-error[ngModel], tui-error[formControlName], tui-error[formControl], tui-error[formGroup], tui-error[formGroupName], tui-error[formArrayName], tui-error[formArray]", inputs: ["order"] }, { kind: "directive", type: i2.TuiInputDirective, selector: "input[tuiInput]", inputs: ["readOnly", "invalid", "focused", "state"] }, { kind: "component", type: ScSuggestionFieldComponent, selector: "sc-suggestion-field", inputs: ["type"], outputs: ["selectedClick"] }, { kind: "directive", type: MaskitoDirective, selector: "[maskito]", inputs: ["maskito", "maskitoElement"], outputs: ["maskitoChange", "maskitoElementChange"] }, { kind: "directive", type: i1$1.TuiComboBoxDirective, selector: "input[tuiComboBox]", inputs: ["strict", "matcher"] }, { kind: "component", type: TuiDataListWrapperComponent, selector: "tui-data-list-wrapper:not([labels])", inputs: ["items", "emptyContent", "size", "itemContent"], outputs: ["itemClick"] }, { kind: "component", type: TuiLoader, selector: "tui-loader", inputs: ["size", "inheritColor", "overlay", "textContent", "loading"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: TuiStringifyContentPipe, name: "tuiStringifyContent" }, { kind: "pipe", type: TuiFilterByInputPipe, name: "tuiFilterByInput" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2870
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScNewContragentFormComponent, isStandalone: true, selector: "sc-new-contragent-form", inputs: { opfControl: "opfControl" }, ngImport: i0, template: "@if (selectOpf$ | async; as selectOpf) {\n <div\n [formGroup]=\"form\"\n class=\"flex flex-col gap-3 pb-1\"\n >\n <p class=\"text-lg font-bold\">\u041E\u0431\u0449\u0438\u0435 \u0434\u0430\u043D\u043D\u044B\u0435 \u043A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\u0430</p>\n <label tuiLabel>\n \u0422\u0438\u043F \u043A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\u0430 (\u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u043E\u043D\u043D\u043E-\u043F\u0440\u0430\u0432\u043E\u0432\u0430\u044F \u0444\u043E\u0440\u043C\u0430)\n <tui-textfield\n tuiChevron\n [content]=\"opfContent\"\n >\n <input\n tuiSelect\n formControlName=\"opf\"\n [readOnly]=\"!!opfControl\"\n placeholder=\"\u0422\u0438\u043F \u043A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\u0430 (\u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u043E\u043D\u043D\u043E-\u043F\u0440\u0430\u0432\u043E\u0432\u0430\u044F \u0444\u043E\u0440\u043C\u0430)\"\n />\n <tui-data-list *tuiDropdown>\n @for (item of getOpf$() | async; track item; let index = $index) {\n <button\n tuiOption\n [value]=\"item.slug\"\n >\n {{ item.name }}\n </button>\n }\n </tui-data-list>\n </tui-textfield>\n <ng-template\n #opfContent\n let-data\n >\n <div>{{ (getOpfBySlug$(data) | async)?.name }}</div>\n </ng-template>\n <tui-error formControlName=\"opf\" />\n </label>\n @let nameLabel = opfListEnum[selectOpf] === opfListEnum.individual ? '\u0424.\u0418.\u041E.' : '\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438';\n <label tuiLabel>\n {{ nameLabel }}\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"name\"\n [placeholder]=\"nameLabel\"\n />\n @if (opfListEnum[selectOpf] === opfListEnum.individual) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.fio\"\n />\n } @else if (opfListEnum[selectOpf] !== opfListEnum.non_resident_legal) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.organization\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"name\" />\n </label>\n @if (opfListEnum[selectOpf] > opfListEnum.individual) {\n <label tuiLabel>\n \u0418\u041D\u041D \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043B\u0438 \u0418\u041F\n <tui-textfield>\n <input\n tuiInput\n [maskito]=\"innMask(selectOpf)\"\n autocomplete=\"inn\"\n formControlName=\"inn\"\n placeholder=\"\u0418\u041D\u041D \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043B\u0438 \u0418\u041F\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.organization\"\n />\n </tui-textfield>\n <tui-error formControlName=\"inn\" />\n </label>\n @if (opfListEnum[selectOpf] !== opfListEnum.non_resident_legal) {\n <label tuiLabel>\n \u041A\u043E\u0434 \u041E\u041A\u041F\u041E\n <tui-textfield>\n <input\n tuiInput\n [maskito]=\"okpoMask(selectOpf)\"\n autocomplete=\"okpo\"\n formControlName=\"okpo\"\n placeholder=\"\u041A\u043E\u0434 \u041E\u041A\u041F\u041E\"\n />\n </tui-textfield>\n <tui-error formControlName=\"okpo\" />\n </label>\n }\n <label tuiLabel>\n \u0424.\u0418.\u041E. \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"directorName\"\n placeholder=\"\u0424.\u0418.\u041E. \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.fio\"\n />\n </tui-textfield>\n <tui-error formControlName=\"directorName\" />\n </label>\n <label tuiLabel>\n \u0414\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"directorPosition\"\n placeholder=\"\u0414\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\"\n />\n </tui-textfield>\n <tui-error formControlName=\"directorPosition\" />\n </label>\n <label tuiLabel>\n \u041E\u0441\u043D\u043E\u0432\u0430\u043D\u0438\u044F \u043F\u043E\u043B\u043D\u043E\u043C\u043E\u0447\u0438\u0439 \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"directorActsOn\"\n placeholder=\"\u041E\u0441\u043D\u043E\u0432\u0430\u043D\u0438\u044F \u043F\u043E\u043B\u043D\u043E\u043C\u043E\u0447\u0438\u0439 \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\"\n />\n </tui-textfield>\n <tui-error formControlName=\"directorActsOn\" />\n </label>\n <label tuiLabel>\n \u042E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0430\u0434\u0440\u0435\u0441\n <tui-textfield>\n <input\n tuiInput\n scAddressQuality\n #legalAddressQuality=\"scAddressQuality\"\n formControlName=\"legalAddress\"\n placeholder=\"\u042E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0430\u0434\u0440\u0435\u0441\"\n />\n @if (opfListEnum[selectOpf] !== opfListEnum.non_resident_legal) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.address\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"legalAddress\" />\n @if (legalAddressQuality.getWarningMessage(); as addressQualityWarning) {\n <p class=\"text-xs text-tui-status-warning\">{{ addressQualityWarning }}</p>\n }\n </label>\n <label tuiLabel>\n \u041F\u043E\u0447\u0442\u043E\u0432\u044B\u0439 \u0430\u0434\u0440\u0435\u0441\n <tui-textfield>\n <input\n tuiInput\n scAddressQuality\n #postalAddressQuality=\"scAddressQuality\"\n formControlName=\"postalAddress\"\n placeholder=\"\u041F\u043E\u0447\u0442\u043E\u0432\u044B\u0439 \u0430\u0434\u0440\u0435\u0441\"\n />\n @if (opfListEnum[selectOpf] !== opfListEnum.non_resident_legal) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.address\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"postalAddress\" />\n @if (postalAddressQuality.getWarningMessage(); as addressQualityWarning) {\n <p class=\"text-xs text-tui-status-warning\">{{ addressQualityWarning }}</p>\n }\n </label>\n <label tuiLabel>\n \u0424\u0430\u043A\u0442\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0430\u0434\u0440\u0435\u0441\n <tui-textfield>\n <input\n tuiInput\n scAddressQuality\n #actualAddressQuality=\"scAddressQuality\"\n formControlName=\"actualAddress\"\n placeholder=\"\u0424\u0430\u043A\u0442\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0430\u0434\u0440\u0435\u0441\"\n />\n @if (opfListEnum[selectOpf] !== opfListEnum.non_resident_legal) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.address\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"actualAddress\" />\n @if (actualAddressQuality.getWarningMessage(); as addressQualityWarning) {\n <p class=\"text-xs text-tui-status-warning\">{{ addressQualityWarning }}</p>\n }\n </label>\n @if (opfListEnum[selectOpf] === opfListEnum.legal) {\n <label tuiLabel>\n \u041A\u041F\u041F \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438\n <tui-textfield>\n <input\n tuiInput\n [maskito]=\"kppMask\"\n autocomplete=\"kpp\"\n formControlName=\"kpp\"\n placeholder=\"\u041A\u041F\u041F \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438\"\n />\n </tui-textfield>\n <tui-error formControlName=\"kpp\" />\n </label>\n }\n }\n @if (opfListEnum[selectOpf] === opfListEnum.non_resident_legal) {\n @let countries = countries$ | async;\n @let countriesId = countriesId$ | async;\n @if (countries) {\n <label tuiLabel>\n \u0421\u0442\u0440\u0430\u043D\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\n <tui-textfield [stringify]=\"stringify(countries ?? [])\">\n <input\n tuiComboBox\n formControlName=\"registrationCountryId\"\n autocapitalize=\"off\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n placeholder=\"\u0421\u0442\u0440\u0430\u043D\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\"\n />\n <tui-data-list-wrapper\n *tuiDropdown\n [itemContent]=\"stringify(countries ?? []) | tuiStringifyContent\"\n [items]=\"countriesId | tuiFilterByInput\"\n />\n </tui-textfield>\n <ng-template\n #CountryContent\n let-data\n >\n <div>{{ (getCountryNameById$(data) | async) ?? '' }}</div>\n </ng-template>\n <tui-error formControlName=\"registrationCountryId\" />\n </label>\n }\n <ng-template #selectLoading> <tui-loader /> </ng-template>\n <label tuiLabel>\n \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u043E\u043D\u043D\u044B\u0439 \u043D\u043E\u043C\u0435\u0440 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"registrationNumber\"\n placeholder=\"\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u043E\u043D\u043D\u044B\u0439 \u043D\u043E\u043C\u0435\u0440 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\"\n />\n </tui-textfield>\n <tui-error formControlName=\"registrationNumber\" />\n </label>\n <label tuiLabel>\n \u041D\u0430\u043B\u043E\u0433\u043E\u0432\u044B\u0439 \u043D\u043E\u043C\u0435\u0440 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"taxNumber\"\n placeholder=\"\u041D\u0430\u043B\u043E\u0433\u043E\u0432\u044B\u0439 \u043D\u043E\u043C\u0435\u0440 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\"\n />\n </tui-textfield>\n <tui-error formControlName=\"taxNumber\" />\n </label>\n }\n </div>\n}\n", styles: ["tui-carousel{--tui-carousel-padding: .5rem}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: i2.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler"] }, { kind: "directive", type: i3.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { kind: "directive", type: i1$1.TuiSelectDirective, selector: "input[tuiSelect]" }, { kind: "directive", type: TuiChevron, selector: "[tuiChevron]", inputs: ["tuiChevron"] }, { kind: "component", type: i2.TuiDataListComponent, selector: "tui-data-list", inputs: ["emptyContent", "size"] }, { kind: "directive", type: i2.TuiOption, selector: "button[tuiOption], a[tuiOption], label[tuiOption]", inputs: ["disabled"] }, { kind: "directive", type: i2.TuiOptionWithValue, selector: "button[tuiOption][value], a[tuiOption][value], label[tuiOption][value]", inputs: ["disabled", "value"] }, { kind: "component", type: i2.TuiErrorComponent, selector: "tui-error", inputs: ["error"] }, { kind: "directive", type: i2.TuiErrorDirective, selector: "tui-error[ngModel], tui-error[formControlName], tui-error[formControl], tui-error[formGroup], tui-error[formGroupName], tui-error[formArrayName], tui-error[formArray]", inputs: ["order"] }, { kind: "directive", type: i2.TuiInputDirective, selector: "input[tuiInput]", inputs: ["readOnly", "invalid", "focused", "state"] }, { kind: "component", type: ScSuggestionFieldComponent, selector: "sc-suggestion-field", inputs: ["type", "showAddressQuality"], outputs: ["selectedClick"] }, { kind: "directive", type: ScAddressQualityDirective, selector: "[scAddressQuality]", exportAs: ["scAddressQuality"] }, { kind: "directive", type: MaskitoDirective, selector: "[maskito]", inputs: ["maskito", "maskitoElement"], outputs: ["maskitoChange", "maskitoElementChange"] }, { kind: "directive", type: i1$1.TuiComboBoxDirective, selector: "input[tuiComboBox]", inputs: ["strict", "matcher"] }, { kind: "component", type: TuiDataListWrapperComponent, selector: "tui-data-list-wrapper:not([labels])", inputs: ["items", "emptyContent", "size", "itemContent"], outputs: ["itemClick"] }, { kind: "component", type: TuiLoader, selector: "tui-loader", inputs: ["size", "inheritColor", "overlay", "textContent", "loading"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: TuiStringifyContentPipe, name: "tuiStringifyContent" }, { kind: "pipe", type: TuiFilterByInputPipe, name: "tuiFilterByInput" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2489
2871
|
}
|
|
2490
2872
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScNewContragentFormComponent, decorators: [{
|
|
2491
2873
|
type: Component,
|
|
@@ -2501,6 +2883,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
|
|
|
2501
2883
|
TuiError,
|
|
2502
2884
|
TuiInput,
|
|
2503
2885
|
ScSuggestionFieldComponent,
|
|
2886
|
+
ScAddressQualityDirective,
|
|
2504
2887
|
MaskitoDirective,
|
|
2505
2888
|
TuiComboBox,
|
|
2506
2889
|
TuiDataListWrapperComponent,
|
|
@@ -2508,7 +2891,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
|
|
|
2508
2891
|
AsyncPipe,
|
|
2509
2892
|
TuiStringifyContentPipe,
|
|
2510
2893
|
TuiFilterByInputPipe,
|
|
2511
|
-
], template: "@if (selectOpf$ | async; as selectOpf) {\n <div\n [formGroup]=\"form\"\n class=\"flex flex-col gap-3 pb-1\"\n >\n <p class=\"text-lg font-bold\">\u041E\u0431\u0449\u0438\u0435 \u0434\u0430\u043D\u043D\u044B\u0435 \u043A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\u0430</p>\n <label tuiLabel>\n \u0422\u0438\u043F \u043A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\u0430 (\u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u043E\u043D\u043D\u043E-\u043F\u0440\u0430\u0432\u043E\u0432\u0430\u044F \u0444\u043E\u0440\u043C\u0430)\n <tui-textfield\n tuiChevron\n [content]=\"opfContent\"\n >\n <input\n tuiSelect\n formControlName=\"opf\"\n [readOnly]=\"!!opfControl\"\n placeholder=\"\u0422\u0438\u043F \u043A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\u0430 (\u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u043E\u043D\u043D\u043E-\u043F\u0440\u0430\u0432\u043E\u0432\u0430\u044F \u0444\u043E\u0440\u043C\u0430)\"\n />\n <tui-data-list *tuiDropdown>\n @for (item of getOpf$() | async; track item; let index = $index) {\n <button\n tuiOption\n [value]=\"item.slug\"\n >\n {{ item.name }}\n </button>\n }\n </tui-data-list>\n </tui-textfield>\n <ng-template\n #opfContent\n let-data\n >\n <div>{{ (getOpfBySlug$(data) | async)?.name }}</div>\n </ng-template>\n <tui-error formControlName=\"opf\" />\n </label>\n @let nameLabel = opfListEnum[selectOpf] === opfListEnum.individual ? '\u0424.\u0418.\u041E.' : '\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438';\n <label tuiLabel>\n {{ nameLabel }}\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"name\"\n [placeholder]=\"nameLabel\"\n />\n @if (opfListEnum[selectOpf] === opfListEnum.individual) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.fio\"\n />\n } @else if (opfListEnum[selectOpf] !== opfListEnum.non_resident_legal) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.organization\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"name\" />\n </label>\n @if (opfListEnum[selectOpf] > opfListEnum.individual) {\n <label tuiLabel>\n \u0418\u041D\u041D \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043B\u0438 \u0418\u041F\n <tui-textfield>\n <input\n tuiInput\n [maskito]=\"innMask(selectOpf)\"\n autocomplete=\"inn\"\n formControlName=\"inn\"\n placeholder=\"\u0418\u041D\u041D \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043B\u0438 \u0418\u041F\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.organization\"\n />\n </tui-textfield>\n <tui-error formControlName=\"inn\" />\n </label>\n @if (opfListEnum[selectOpf] === opfListEnum.legal) {\n <label tuiLabel>\n \u041A\u043E\u0434 \u041E\u041A\u041F\u041E\n <tui-textfield>\n <input\n tuiInput\n [maskito]=\"okpoMask(selectOpf)\"\n autocomplete=\"okpo\"\n formControlName=\"okpo\"\n placeholder=\"\u041A\u043E\u0434 \u041E\u041A\u041F\u041E\"\n />\n </tui-textfield>\n <tui-error formControlName=\"okpo\" />\n </label>\n }\n <label tuiLabel>\n \u0424.\u0418.\u041E. \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"directorName\"\n placeholder=\"\u0424.\u0418.\u041E. \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.fio\"\n />\n </tui-textfield>\n <tui-error formControlName=\"directorName\" />\n </label>\n <label tuiLabel>\n \u0414\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"directorPosition\"\n placeholder=\"\u0414\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\"\n />\n </tui-textfield>\n <tui-error formControlName=\"directorPosition\" />\n </label>\n <label tuiLabel>\n \u041E\u0441\u043D\u043E\u0432\u0430\u043D\u0438\u044F \u043F\u043E\u043B\u043D\u043E\u043C\u043E\u0447\u0438\u0439 \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"directorActsOn\"\n placeholder=\"\u041E\u0441\u043D\u043E\u0432\u0430\u043D\u0438\u044F \u043F\u043E\u043B\u043D\u043E\u043C\u043E\u0447\u0438\u0439 \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\"\n />\n </tui-textfield>\n <tui-error formControlName=\"directorActsOn\" />\n </label>\n <label tuiLabel>\n \u042E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0430\u0434\u0440\u0435\u0441\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"legalAddress\"\n placeholder=\"\u042E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0430\u0434\u0440\u0435\u0441\"\n />\n @if (opfListEnum[selectOpf] !== opfListEnum.non_resident_legal) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.address\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"legalAddress\" />\n </label>\n <label tuiLabel>\n \u041F\u043E\u0447\u0442\u043E\u0432\u044B\u0439 \u0430\u0434\u0440\u0435\u0441\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"postalAddress\"\n placeholder=\"\u041F\u043E\u0447\u0442\u043E\u0432\u044B\u0439 \u0430\u0434\u0440\u0435\u0441\"\n />\n @if (opfListEnum[selectOpf] !== opfListEnum.non_resident_legal) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.address\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"postalAddress\" />\n </label>\n <label tuiLabel>\n \u0424\u0430\u043A\u0442\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0430\u0434\u0440\u0435\u0441\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"actualAddress\"\n placeholder=\"\u0424\u0430\u043A\u0442\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0430\u0434\u0440\u0435\u0441\"\n />\n @if (opfListEnum[selectOpf] !== opfListEnum.non_resident_legal) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.address\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"actualAddress\" />\n </label>\n @if (opfListEnum[selectOpf] === opfListEnum.legal) {\n <label tuiLabel>\n \u041A\u041F\u041F \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438\n <tui-textfield>\n <input\n tuiInput\n [maskito]=\"kppMask\"\n autocomplete=\"kpp\"\n formControlName=\"kpp\"\n placeholder=\"\u041A\u041F\u041F \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438\"\n />\n </tui-textfield>\n <tui-error formControlName=\"kpp\" />\n </label>\n }\n }\n @if (opfListEnum[selectOpf] === opfListEnum.non_resident_legal) {\n @let countries = countries$ | async;\n @let countriesId = countriesId$ | async;\n @if (countries) {\n <label tuiLabel>\n \u0421\u0442\u0440\u0430\u043D\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\n <tui-textfield [stringify]=\"stringify(countries ?? [])\">\n <input\n tuiComboBox\n formControlName=\"registrationCountryId\"\n autocapitalize=\"off\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n placeholder=\"\u0421\u0442\u0440\u0430\u043D\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\"\n />\n <tui-data-list-wrapper\n *tuiDropdown\n [itemContent]=\"stringify(countries ?? []) | tuiStringifyContent\"\n [items]=\"countriesId | tuiFilterByInput\"\n />\n </tui-textfield>\n <ng-template\n #CountryContent\n let-data\n >\n <div>{{ (getCountryNameById$(data) | async) ?? '' }}</div>\n </ng-template>\n <tui-error formControlName=\"registrationCountryId\" />\n </label>\n }\n <ng-template #selectLoading> <tui-loader /> </ng-template>\n <label tuiLabel>\n \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u043E\u043D\u043D\u044B\u0439 \u043D\u043E\u043C\u0435\u0440 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"registrationNumber\"\n placeholder=\"\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u043E\u043D\u043D\u044B\u0439 \u043D\u043E\u043C\u0435\u0440 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\"\n />\n </tui-textfield>\n <tui-error formControlName=\"registrationNumber\" />\n </label>\n <label tuiLabel>\n \u041D\u0430\u043B\u043E\u0433\u043E\u0432\u044B\u0439 \u043D\u043E\u043C\u0435\u0440 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"taxNumber\"\n placeholder=\"\u041D\u0430\u043B\u043E\u0433\u043E\u0432\u044B\u0439 \u043D\u043E\u043C\u0435\u0440 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\"\n />\n </tui-textfield>\n <tui-error formControlName=\"taxNumber\" />\n </label>\n }\n </div>\n}\n", styles: ["tui-carousel{--tui-carousel-padding: .5rem}\n"] }]
|
|
2894
|
+
], template: "@if (selectOpf$ | async; as selectOpf) {\n <div\n [formGroup]=\"form\"\n class=\"flex flex-col gap-3 pb-1\"\n >\n <p class=\"text-lg font-bold\">\u041E\u0431\u0449\u0438\u0435 \u0434\u0430\u043D\u043D\u044B\u0435 \u043A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\u0430</p>\n <label tuiLabel>\n \u0422\u0438\u043F \u043A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\u0430 (\u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u043E\u043D\u043D\u043E-\u043F\u0440\u0430\u0432\u043E\u0432\u0430\u044F \u0444\u043E\u0440\u043C\u0430)\n <tui-textfield\n tuiChevron\n [content]=\"opfContent\"\n >\n <input\n tuiSelect\n formControlName=\"opf\"\n [readOnly]=\"!!opfControl\"\n placeholder=\"\u0422\u0438\u043F \u043A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\u0430 (\u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u043E\u043D\u043D\u043E-\u043F\u0440\u0430\u0432\u043E\u0432\u0430\u044F \u0444\u043E\u0440\u043C\u0430)\"\n />\n <tui-data-list *tuiDropdown>\n @for (item of getOpf$() | async; track item; let index = $index) {\n <button\n tuiOption\n [value]=\"item.slug\"\n >\n {{ item.name }}\n </button>\n }\n </tui-data-list>\n </tui-textfield>\n <ng-template\n #opfContent\n let-data\n >\n <div>{{ (getOpfBySlug$(data) | async)?.name }}</div>\n </ng-template>\n <tui-error formControlName=\"opf\" />\n </label>\n @let nameLabel = opfListEnum[selectOpf] === opfListEnum.individual ? '\u0424.\u0418.\u041E.' : '\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438';\n <label tuiLabel>\n {{ nameLabel }}\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"name\"\n [placeholder]=\"nameLabel\"\n />\n @if (opfListEnum[selectOpf] === opfListEnum.individual) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.fio\"\n />\n } @else if (opfListEnum[selectOpf] !== opfListEnum.non_resident_legal) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.organization\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"name\" />\n </label>\n @if (opfListEnum[selectOpf] > opfListEnum.individual) {\n <label tuiLabel>\n \u0418\u041D\u041D \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043B\u0438 \u0418\u041F\n <tui-textfield>\n <input\n tuiInput\n [maskito]=\"innMask(selectOpf)\"\n autocomplete=\"inn\"\n formControlName=\"inn\"\n placeholder=\"\u0418\u041D\u041D \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043B\u0438 \u0418\u041F\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.organization\"\n />\n </tui-textfield>\n <tui-error formControlName=\"inn\" />\n </label>\n @if (opfListEnum[selectOpf] !== opfListEnum.non_resident_legal) {\n <label tuiLabel>\n \u041A\u043E\u0434 \u041E\u041A\u041F\u041E\n <tui-textfield>\n <input\n tuiInput\n [maskito]=\"okpoMask(selectOpf)\"\n autocomplete=\"okpo\"\n formControlName=\"okpo\"\n placeholder=\"\u041A\u043E\u0434 \u041E\u041A\u041F\u041E\"\n />\n </tui-textfield>\n <tui-error formControlName=\"okpo\" />\n </label>\n }\n <label tuiLabel>\n \u0424.\u0418.\u041E. \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"directorName\"\n placeholder=\"\u0424.\u0418.\u041E. \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.fio\"\n />\n </tui-textfield>\n <tui-error formControlName=\"directorName\" />\n </label>\n <label tuiLabel>\n \u0414\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"directorPosition\"\n placeholder=\"\u0414\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\"\n />\n </tui-textfield>\n <tui-error formControlName=\"directorPosition\" />\n </label>\n <label tuiLabel>\n \u041E\u0441\u043D\u043E\u0432\u0430\u043D\u0438\u044F \u043F\u043E\u043B\u043D\u043E\u043C\u043E\u0447\u0438\u0439 \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"directorActsOn\"\n placeholder=\"\u041E\u0441\u043D\u043E\u0432\u0430\u043D\u0438\u044F \u043F\u043E\u043B\u043D\u043E\u043C\u043E\u0447\u0438\u0439 \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\"\n />\n </tui-textfield>\n <tui-error formControlName=\"directorActsOn\" />\n </label>\n <label tuiLabel>\n \u042E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0430\u0434\u0440\u0435\u0441\n <tui-textfield>\n <input\n tuiInput\n scAddressQuality\n #legalAddressQuality=\"scAddressQuality\"\n formControlName=\"legalAddress\"\n placeholder=\"\u042E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0430\u0434\u0440\u0435\u0441\"\n />\n @if (opfListEnum[selectOpf] !== opfListEnum.non_resident_legal) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.address\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"legalAddress\" />\n @if (legalAddressQuality.getWarningMessage(); as addressQualityWarning) {\n <p class=\"text-xs text-tui-status-warning\">{{ addressQualityWarning }}</p>\n }\n </label>\n <label tuiLabel>\n \u041F\u043E\u0447\u0442\u043E\u0432\u044B\u0439 \u0430\u0434\u0440\u0435\u0441\n <tui-textfield>\n <input\n tuiInput\n scAddressQuality\n #postalAddressQuality=\"scAddressQuality\"\n formControlName=\"postalAddress\"\n placeholder=\"\u041F\u043E\u0447\u0442\u043E\u0432\u044B\u0439 \u0430\u0434\u0440\u0435\u0441\"\n />\n @if (opfListEnum[selectOpf] !== opfListEnum.non_resident_legal) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.address\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"postalAddress\" />\n @if (postalAddressQuality.getWarningMessage(); as addressQualityWarning) {\n <p class=\"text-xs text-tui-status-warning\">{{ addressQualityWarning }}</p>\n }\n </label>\n <label tuiLabel>\n \u0424\u0430\u043A\u0442\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0430\u0434\u0440\u0435\u0441\n <tui-textfield>\n <input\n tuiInput\n scAddressQuality\n #actualAddressQuality=\"scAddressQuality\"\n formControlName=\"actualAddress\"\n placeholder=\"\u0424\u0430\u043A\u0442\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0430\u0434\u0440\u0435\u0441\"\n />\n @if (opfListEnum[selectOpf] !== opfListEnum.non_resident_legal) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.address\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"actualAddress\" />\n @if (actualAddressQuality.getWarningMessage(); as addressQualityWarning) {\n <p class=\"text-xs text-tui-status-warning\">{{ addressQualityWarning }}</p>\n }\n </label>\n @if (opfListEnum[selectOpf] === opfListEnum.legal) {\n <label tuiLabel>\n \u041A\u041F\u041F \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438\n <tui-textfield>\n <input\n tuiInput\n [maskito]=\"kppMask\"\n autocomplete=\"kpp\"\n formControlName=\"kpp\"\n placeholder=\"\u041A\u041F\u041F \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438\"\n />\n </tui-textfield>\n <tui-error formControlName=\"kpp\" />\n </label>\n }\n }\n @if (opfListEnum[selectOpf] === opfListEnum.non_resident_legal) {\n @let countries = countries$ | async;\n @let countriesId = countriesId$ | async;\n @if (countries) {\n <label tuiLabel>\n \u0421\u0442\u0440\u0430\u043D\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\n <tui-textfield [stringify]=\"stringify(countries ?? [])\">\n <input\n tuiComboBox\n formControlName=\"registrationCountryId\"\n autocapitalize=\"off\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n placeholder=\"\u0421\u0442\u0440\u0430\u043D\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\"\n />\n <tui-data-list-wrapper\n *tuiDropdown\n [itemContent]=\"stringify(countries ?? []) | tuiStringifyContent\"\n [items]=\"countriesId | tuiFilterByInput\"\n />\n </tui-textfield>\n <ng-template\n #CountryContent\n let-data\n >\n <div>{{ (getCountryNameById$(data) | async) ?? '' }}</div>\n </ng-template>\n <tui-error formControlName=\"registrationCountryId\" />\n </label>\n }\n <ng-template #selectLoading> <tui-loader /> </ng-template>\n <label tuiLabel>\n \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u043E\u043D\u043D\u044B\u0439 \u043D\u043E\u043C\u0435\u0440 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"registrationNumber\"\n placeholder=\"\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u043E\u043D\u043D\u044B\u0439 \u043D\u043E\u043C\u0435\u0440 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\"\n />\n </tui-textfield>\n <tui-error formControlName=\"registrationNumber\" />\n </label>\n <label tuiLabel>\n \u041D\u0430\u043B\u043E\u0433\u043E\u0432\u044B\u0439 \u043D\u043E\u043C\u0435\u0440 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"taxNumber\"\n placeholder=\"\u041D\u0430\u043B\u043E\u0433\u043E\u0432\u044B\u0439 \u043D\u043E\u043C\u0435\u0440 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\"\n />\n </tui-textfield>\n <tui-error formControlName=\"taxNumber\" />\n </label>\n }\n </div>\n}\n", styles: ["tui-carousel{--tui-carousel-padding: .5rem}\n"] }]
|
|
2512
2895
|
}], propDecorators: { opfControl: [{
|
|
2513
2896
|
type: Input
|
|
2514
2897
|
}] } });
|
|
@@ -2520,6 +2903,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
|
|
|
2520
2903
|
class ScAddressesSelectionFieldComponent {
|
|
2521
2904
|
/**
|
|
2522
2905
|
* Инициализирует экземпляр класса {@link ScAddressesSelectionFieldComponent}.
|
|
2906
|
+
* Включение выбора страны сохраняет выбранные страну, регион и город. При выключении выбора страна
|
|
2907
|
+
* фиксируется на текущей стране системы, поэтому регион и город сбрасываются, только если была выбрана другая страна.
|
|
2523
2908
|
*/
|
|
2524
2909
|
constructor() {
|
|
2525
2910
|
/**
|
|
@@ -2577,10 +2962,7 @@ class ScAddressesSelectionFieldComponent {
|
|
|
2577
2962
|
*/
|
|
2578
2963
|
this.stringify = (item) => item.name;
|
|
2579
2964
|
effect(() => {
|
|
2580
|
-
if (this.canSelectCountry()) {
|
|
2581
|
-
this.countryControl.setValue(null);
|
|
2582
|
-
}
|
|
2583
|
-
else {
|
|
2965
|
+
if (!this.canSelectCountry() && this.countryControl.value?.id !== this.russiaCountryId) {
|
|
2584
2966
|
this.countryControl.setValue({
|
|
2585
2967
|
id: this.russiaCountryId,
|
|
2586
2968
|
name: 'Россия',
|
|
@@ -2681,6 +3063,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
|
|
|
2681
3063
|
class ScSignUpFormComponent {
|
|
2682
3064
|
/**
|
|
2683
3065
|
* Инициализирует экземпляр класса {@link ScSignUpFormComponent}.
|
|
3066
|
+
* Название сбрасывается только при переходе между физическим лицом и организацией: у физического лица в поле Ф.И.О.,
|
|
3067
|
+
* у остальных форм название организации, поэтому прежнее значение по смыслу не подходит.
|
|
2684
3068
|
*/
|
|
2685
3069
|
constructor() {
|
|
2686
3070
|
/**
|
|
@@ -2699,6 +3083,10 @@ class ScSignUpFormComponent {
|
|
|
2699
3083
|
* Сервис для сбора метрик о действиях пользователей.
|
|
2700
3084
|
*/
|
|
2701
3085
|
this.userMetrikaService = inject(ScUserMetrikaService);
|
|
3086
|
+
/**
|
|
3087
|
+
* Сервис-реестр качества адресов, выбранных из подсказок.
|
|
3088
|
+
*/
|
|
3089
|
+
this.addressQualityService = inject(ScAddressQualityService);
|
|
2702
3090
|
/**
|
|
2703
3091
|
* Поле ввода организационно-правовых форм.
|
|
2704
3092
|
*/
|
|
@@ -2773,7 +3161,9 @@ class ScSignUpFormComponent {
|
|
|
2773
3161
|
* Список этапов регистрации.
|
|
2774
3162
|
*/
|
|
2775
3163
|
this.steps = ['Данные о клиенте', 'Общие данные контрагента', 'Контакты пользователя', 'Банковские реквизиты пользователя'];
|
|
2776
|
-
this.opfControl.valueChanges
|
|
3164
|
+
this.opfControl.valueChanges
|
|
3165
|
+
.pipe(startWith(this.opfControl.value), pairwise(), filter(([previousOpf, opf]) => (previousOpf === 'individual') !== (opf === 'individual')), takeUntilDestroyed())
|
|
3166
|
+
.subscribe(() => {
|
|
2777
3167
|
this.form.patchValue({ name: null });
|
|
2778
3168
|
});
|
|
2779
3169
|
}
|
|
@@ -2953,6 +3343,7 @@ class ScSignUpFormComponent {
|
|
|
2953
3343
|
this.form.controls.contragent.markAllAsTouched();
|
|
2954
3344
|
this.form.get(['contragent', 'contacts'])?.markAsUntouched();
|
|
2955
3345
|
this.form.get(['contragent', 'bankAccounts'])?.markAsUntouched();
|
|
3346
|
+
this.addressQualityService.setOrganizationAddressQualities(this.form.controls.contragent, suggestion);
|
|
2956
3347
|
}
|
|
2957
3348
|
}
|
|
2958
3349
|
/**
|
|
@@ -2976,7 +3367,7 @@ class ScSignUpFormComponent {
|
|
|
2976
3367
|
this.clickOfferEvent.emit();
|
|
2977
3368
|
}
|
|
2978
3369
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScSignUpFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2979
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScSignUpFormComponent, isStandalone: true, selector: "sc-sign-up-form", outputs: { successAuth: "successAuth", clickOfferEvent: "clickOfferEvent" }, host: { attributes: { "ngSkipHydration": "true" } }, providers: [tuiDropdownOptionsProvider({ limitWidth: 'fixed' })], ngImport: i0, template: "@if (opfControl.value; as selectOpf) {\n <form\n [formGroup]=\"form\"\n (ngSubmit)=\"onSubmit.next()\"\n class=\"flex flex-col gap-5\"\n >\n @let isIndividual = opfListEnum[selectOpf] === opfListEnum.individual;\n @if (!isIndividual && form.controls.contragent) {\n <tui-stepper [(activeItemIndex)]=\"stepIndex\">\n @for (_ of steps; track $index) {\n <button\n [stepState]=\"$index && !canNextStep($index) ? 'error' : 'pass'\"\n [attr.disabled]=\"$index && !canNextStep($index - 1) ? '' : null\"\n type=\"button\"\n tuiStep\n >\n {{ steps[$index] }}\n </button>\n }\n </tui-stepper>\n }\n <div\n [class.!hidden]=\"stepIndex !== 0\"\n class=\"flex flex-col gap-3\"\n >\n <label tuiLabel>\n \u0422\u0438\u043F \u043A\u043B\u0438\u0435\u043D\u0442\u0430\n <tui-textfield\n tuiChevron\n [content]=\"opfContent\"\n >\n <input\n tuiSelect\n [formControl]=\"opfControl\"\n placeholder=\"\u0422\u0438\u043F \u043A\u043B\u0438\u0435\u043D\u0442\u0430\"\n />\n <tui-data-list *tuiDropdown>\n @for (item of getOpf$() | async; track item; let index = $index) {\n <button\n tuiOption\n [value]=\"item.slug\"\n >\n {{ item.name }}\n </button>\n }\n </tui-data-list>\n </tui-textfield>\n </label>\n <ng-template\n #opfContent\n let-data\n >\n <div>{{ (getOpfBySlug$(data) | async)?.name }}</div>\n </ng-template>\n\n @let nameLabel = opfListEnum[selectOpf] === opfListEnum.individual ? '\u0424.\u0418.\u041E.' : '\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438';\n <label tuiLabel>\n {{ nameLabel }}\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"name\"\n [placeholder]=\"nameLabel\"\n />\n @if (opfListEnum[selectOpf] === opfListEnum.individual) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.fio\"\n />\n } @else if (opfListEnum[selectOpf] !== opfListEnum.non_resident_legal) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.organization\"\n (selectedClick)=\"onSelectedOrganization($event)\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"name\" />\n </label>\n\n <div class=\"grid items-start gap-5 sm:grid-cols-2\">\n <sc-verification-phone-check-form [shouldBeBusy]=\"false\" />\n <div>\n <label tuiLabel>\n \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"email\"\n placeholder=\"\u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.email\"\n />\n </tui-textfield>\n <tui-error formControlName=\"email\" />\n </label>\n </div>\n </div>\n <sc-addresses-selection-field [canSelectCountry]=\"opfListEnum[selectOpf] === opfListEnum.non_resident_legal\" />\n <div class=\"grid items-start gap-5 sm:grid-cols-2\">\n <div>\n <label tuiLabel>\n \u041F\u0430\u0440\u043E\u043B\u044C\n <tui-textfield>\n <input\n tuiInput\n type=\"password\"\n formControlName=\"password\"\n autocomplete=\"new-password\"\n placeholder=\"\u041F\u0430\u0440\u043E\u043B\u044C\"\n />\n <tui-icon tuiPassword />\n </tui-textfield>\n <tui-error formControlName=\"password\" />\n </label>\n </div>\n <div>\n <label tuiLabel>\n \u041F\u043E\u0432\u0442\u043E\u0440 \u043F\u0430\u0440\u043E\u043B\u044F\n <tui-textfield>\n <input\n tuiInput\n type=\"password\"\n formControlName=\"passwordConfirm\"\n autocomplete=\"new-password\"\n placeholder=\"\u041F\u043E\u0432\u0442\u043E\u0440 \u043F\u0430\u0440\u043E\u043B\u044F\"\n />\n <tui-icon tuiPassword />\n </tui-textfield>\n <tui-error formControlName=\"passwordConfirm\" />\n </label>\n </div>\n </div>\n <tui-error\n class=\"self-center\"\n [formGroup]=\"form\"\n />\n <div class=\"grid items-start gap-5 sm:grid-cols-2\">\n <label tuiLabel>\n <input\n tuiCheckbox\n type=\"checkbox\"\n formControlName=\"getNews\"\n />\n \u042F \u0445\u043E\u0447\u0443 \u043F\u043E\u043B\u0443\u0447\u0430\u0442\u044C \u0440\u0430\u0441\u0441\u044B\u043B\u043A\u0443 \u0421\u043D\u0430\u0431\u0446\u0435\u043D\u0442\u0440 \u043E \u0441\u043A\u0438\u0434\u043A\u0430\u0445 \u0438 \u043D\u043E\u0432\u043E\u0441\u0442\u044F\u0445 \u043F\u043E \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u0435.\n </label>\n <label tuiLabel>\n <input\n tuiCheckbox\n type=\"checkbox\"\n required=\"true\"\n formControlName=\"acceptRules\"\n />\n <div>\n <span>\n \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u044F\u0441\u044C \u043D\u0430 \u0441\u0430\u0439\u0442\u0435, \u044F \u0441\u043E\u0433\u043B\u0430\u0448\u0430\u044E\u0441\u044C \u0441\n <a\n tuiLink\n [style.text-decoration-line]=\"'underline'\"\n (click)=\"$event.preventDefault(); onClickOffer()\"\n >\n \u0414\u043E\u0433\u043E\u0432\u043E\u0440\u043E\u043C \u043E\u0444\u0435\u0440\u0442\u044B\n </a>\n .\n </span>\n <span class=\"text-tui-negative\">*</span>\n <tui-error formControlName=\"acceptRules\" />\n </div>\n </label>\n </div>\n </div>\n @if (!isIndividual) {\n <sc-new-contragent-form\n [opfControl]=\"opfControl\"\n [class.!hidden]=\"stepIndex !== 1\"\n />\n <div [class.!hidden]=\"stepIndex !== 2\">\n @if (contacts) {\n <div class=\"flex flex-col gap-5 pb-1\">\n <p class=\"text-lg font-bold\">\u041A\u043E\u043D\u0442\u0430\u043A\u0442\u044B</p>\n @for (contact of contacts.controls; track contact; let index = $index; let count = $count; let last = $last) {\n <div class=\"flex flex-col gap-3\">\n <div class=\"flex h-10 items-center justify-between\">\n <p class=\"font-bold\">\u041A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u043E\u0435 \u043B\u0438\u0446\u043E \u2116{{ index + 1 }}:</p>\n @if (count - 1) {\n <button\n tuiIconButton\n appearance=\"secondary\"\n (click)=\"removeContactGroup(index)\"\n >\n <tui-icon icon=\"@tui.trash-2\" />\n </button>\n }\n </div>\n <sc-new-contact-form [form]=\"contact\" />\n @if (!last) {\n <hr class=\"h-px w-full bg-tui-base-04\" />\n }\n </div>\n }\n <button\n tuiButton\n iconStart=\"@tui.plus\"\n appearance=\"secondary\"\n (click)=\"addContactGroup()\"\n type=\"button\"\n class=\"self-center\"\n >\n \u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043A\u043E\u043D\u0442\u0430\u043A\u0442\n </button>\n </div>\n }\n </div>\n <div [class.!hidden]=\"stepIndex !== 3\">\n @if (bankAccounts) {\n <div class=\"flex flex-col gap-5 pb-1\">\n <p class=\"text-lg font-bold\">\u0411\u0430\u043D\u043A\u043E\u0432\u0441\u043A\u0438\u0435 \u0440\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u044B</p>\n @for (bankAccount of bankAccounts.controls; track bankAccount; let index = $index; let count = $count; let last = $last) {\n <div class=\"flex flex-col gap-3\">\n <div class=\"flex h-12 items-center justify-between\">\n <p class=\"font-bold\">\u0411\u0430\u043D\u043A\u043E\u0432\u0441\u043A\u0438\u0435 \u0440\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u044B \u2116{{ index + 1 }}:</p>\n @if (count - 1) {\n <button\n tuiIconButton\n appearance=\"secondary\"\n (click)=\"removeBankAccountGroup(index)\"\n >\n <tui-icon icon=\"@tui.trash-2\" />\n </button>\n }\n </div>\n @if (opfControl.value; as selectOpf) {\n <sc-new-contragent-bank-account-form\n [opf]=\"selectOpf\"\n [form]=\"bankAccount\"\n />\n }\n @if (!last) {\n <hr class=\"h-px w-full bg-tui-base-04\" />\n }\n </div>\n }\n <button\n tuiButton\n iconStart=\"@tui.plus\"\n appearance=\"secondary\"\n (click)=\"addBankAccountGroup()\"\n type=\"button\"\n class=\"self-center\"\n >\n \u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0431\u0430\u043D\u043A\u043E\u0432\u0441\u043A\u0438\u0435 \u0440\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u044B\n </button>\n </div>\n }\n </div>\n }\n <div class=\"flex justify-center gap-2\">\n @if (stepIndex > 0) {\n <button\n tuiButton\n appearance=\"secondary\"\n type=\"button\"\n (click)=\"navigate(-1)\"\n >\n \u041D\u0430\u0437\u0430\u0434\n </button>\n }\n @if (isIndividual || (stepIndex === 2 && !form.controls.contragent.controls['bankAccounts']) || stepIndex === 3) {\n <button\n tuiButton\n [disabled]=\"form.invalid\"\n [loading]=\"!!(loading$ | async)\"\n class=\"self-center\"\n >\n \u0417\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043E\u0432\u0430\u0442\u044C\u0441\u044F\n </button>\n } @else {\n <button\n tuiButton\n type=\"button\"\n [disabled]=\"!canNextStep(stepIndex)\"\n (click)=\"navigate(1)\"\n >\n \u0414\u0430\u043B\u0435\u0435\n </button>\n }\n </div>\n </form>\n}\n", dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.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: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.CheckboxRequiredValidator, selector: "input[type=checkbox][required][formControlName],input[type=checkbox][required][formControl],input[type=checkbox][required][ngModel]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: i2.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler"] }, { kind: "directive", type: i3.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { kind: "directive", type: i2.TuiInputDirective, selector: "input[tuiInput]", inputs: ["readOnly", "invalid", "focused", "state"] }, { kind: "component", type: TuiIcon, selector: "tui-icon:not([tuiBadge])", inputs: ["background"] }, { kind: "component", type: i2.TuiErrorComponent, selector: "tui-error", inputs: ["error"] }, { kind: "directive", type: i2.TuiErrorDirective, selector: "tui-error[ngModel], tui-error[formControlName], tui-error[formControl], tui-error[formGroup], tui-error[formGroupName], tui-error[formArrayName], tui-error[formArray]", inputs: ["order"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: TuiButtonLoading, selector: "[tuiButton][loading],[tuiIconButton][loading]", inputs: ["size", "loading"] }, { kind: "component", type: TuiCheckbox, selector: "input[type=\"checkbox\"][tuiCheckbox]" }, { kind: "directive", type: TuiChevron, selector: "[tuiChevron]", inputs: ["tuiChevron"] }, { kind: "directive", type: TuiPassword, selector: "tui-icon[tuiPassword]" }, { kind: "directive", type: TuiLink, selector: "a[tuiLink], button[tuiLink]" }, { kind: "component", type: i2.TuiDataListComponent, selector: "tui-data-list", inputs: ["emptyContent", "size"] }, { kind: "directive", type: i2.TuiOption, selector: "button[tuiOption], a[tuiOption], label[tuiOption]", inputs: ["disabled"] }, { kind: "directive", type: i2.TuiOptionWithValue, selector: "button[tuiOption][value], a[tuiOption][value], label[tuiOption][value]", inputs: ["disabled", "value"] }, { kind: "directive", type: i1$1.TuiSelectDirective, selector: "input[tuiSelect]" }, { kind: "component", type: i1$1.TuiStepperComponent, selector: "tui-stepper", inputs: ["orientation", "activeItemIndex"], outputs: ["activeItemIndexChange"] }, { kind: "component", type: i1$1.TuiStep, selector: "button[tuiStep], a[tuiStep]:not([routerLink]), a[tuiStep][routerLink][routerLinkActive]", inputs: ["stepState", "icon"] }, { kind: "component", type: ScAddressesSelectionFieldComponent, selector: "sc-addresses-selection-field", inputs: ["canSelectCountry"], outputs: ["canSelectCountryChange"] }, { kind: "component", type: ScSuggestionFieldComponent, selector: "sc-suggestion-field", inputs: ["type"], outputs: ["selectedClick"] }, { kind: "component", type: ScVerificationPhoneCheckFormComponent, selector: "sc-verification-phone-check-form", inputs: ["showCodeFields", "readOnly", "pseudoInvalid", "required", "subtitle", "shouldBeBusy", "shouldBeConfirmed", "haveCode"], outputs: ["haveCodeChange", "isBusyChange", "isConfirmedChange"] }, { kind: "component", type: ScNewContragentFormComponent, selector: "sc-new-contragent-form", inputs: ["opfControl"] }, { kind: "component", type: ScNewContragentBankAccountsFormComponent, selector: "sc-new-contragent-bank-account-form", inputs: ["form", "opf"] }, { kind: "component", type: ScNewContactFormComponent, selector: "sc-new-contact-form", inputs: ["form"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3370
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScSignUpFormComponent, isStandalone: true, selector: "sc-sign-up-form", outputs: { successAuth: "successAuth", clickOfferEvent: "clickOfferEvent" }, host: { attributes: { "ngSkipHydration": "true" } }, providers: [tuiDropdownOptionsProvider({ limitWidth: 'fixed' })], ngImport: i0, template: "@if (opfControl.value; as selectOpf) {\n <form\n [formGroup]=\"form\"\n (ngSubmit)=\"onSubmit.next()\"\n class=\"flex flex-col gap-5\"\n >\n @let isIndividual = opfListEnum[selectOpf] === opfListEnum.individual;\n @if (!isIndividual && form.controls.contragent) {\n <tui-stepper [(activeItemIndex)]=\"stepIndex\">\n @for (_ of steps; track $index) {\n <button\n [stepState]=\"$index && !canNextStep($index) ? 'error' : 'pass'\"\n [attr.disabled]=\"$index && !canNextStep($index - 1) ? '' : null\"\n type=\"button\"\n tuiStep\n >\n {{ steps[$index] }}\n </button>\n }\n </tui-stepper>\n }\n <div\n [class.!hidden]=\"stepIndex !== 0\"\n class=\"flex flex-col gap-3\"\n >\n <label tuiLabel>\n \u0422\u0438\u043F \u043A\u043B\u0438\u0435\u043D\u0442\u0430\n <tui-textfield\n tuiChevron\n [content]=\"opfContent\"\n >\n <input\n tuiSelect\n [formControl]=\"opfControl\"\n placeholder=\"\u0422\u0438\u043F \u043A\u043B\u0438\u0435\u043D\u0442\u0430\"\n />\n <tui-data-list *tuiDropdown>\n @for (item of getOpf$() | async; track item; let index = $index) {\n <button\n tuiOption\n [value]=\"item.slug\"\n >\n {{ item.name }}\n </button>\n }\n </tui-data-list>\n </tui-textfield>\n </label>\n <ng-template\n #opfContent\n let-data\n >\n <div>{{ (getOpfBySlug$(data) | async)?.name }}</div>\n </ng-template>\n\n @let nameLabel = opfListEnum[selectOpf] === opfListEnum.individual ? '\u0424.\u0418.\u041E.' : '\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438';\n <label tuiLabel>\n {{ nameLabel }}\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"name\"\n [placeholder]=\"nameLabel\"\n />\n @if (opfListEnum[selectOpf] === opfListEnum.individual) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.fio\"\n />\n } @else if (opfListEnum[selectOpf] !== opfListEnum.non_resident_legal) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.organization\"\n (selectedClick)=\"onSelectedOrganization($event)\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"name\" />\n </label>\n\n <div class=\"grid items-start gap-5 sm:grid-cols-2\">\n <sc-verification-phone-check-form [shouldBeBusy]=\"false\" />\n <div>\n <label tuiLabel>\n \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"email\"\n placeholder=\"\u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.email\"\n />\n </tui-textfield>\n <tui-error formControlName=\"email\" />\n </label>\n </div>\n </div>\n <sc-addresses-selection-field [canSelectCountry]=\"opfListEnum[selectOpf] === opfListEnum.non_resident_legal\" />\n <div class=\"grid items-start gap-5 sm:grid-cols-2\">\n <div>\n <label tuiLabel>\n \u041F\u0430\u0440\u043E\u043B\u044C\n <tui-textfield>\n <input\n tuiInput\n type=\"password\"\n formControlName=\"password\"\n autocomplete=\"new-password\"\n placeholder=\"\u041F\u0430\u0440\u043E\u043B\u044C\"\n />\n <tui-icon tuiPassword />\n </tui-textfield>\n <tui-error formControlName=\"password\" />\n </label>\n </div>\n <div>\n <label tuiLabel>\n \u041F\u043E\u0432\u0442\u043E\u0440 \u043F\u0430\u0440\u043E\u043B\u044F\n <tui-textfield>\n <input\n tuiInput\n type=\"password\"\n formControlName=\"passwordConfirm\"\n autocomplete=\"new-password\"\n placeholder=\"\u041F\u043E\u0432\u0442\u043E\u0440 \u043F\u0430\u0440\u043E\u043B\u044F\"\n />\n <tui-icon tuiPassword />\n </tui-textfield>\n <tui-error formControlName=\"passwordConfirm\" />\n </label>\n </div>\n </div>\n <tui-error\n class=\"self-center\"\n [formGroup]=\"form\"\n />\n <div class=\"grid items-start gap-5 sm:grid-cols-2\">\n <label tuiLabel>\n <input\n tuiCheckbox\n type=\"checkbox\"\n formControlName=\"getNews\"\n />\n \u042F \u0445\u043E\u0447\u0443 \u043F\u043E\u043B\u0443\u0447\u0430\u0442\u044C \u0440\u0430\u0441\u0441\u044B\u043B\u043A\u0443 \u0421\u043D\u0430\u0431\u0446\u0435\u043D\u0442\u0440 \u043E \u0441\u043A\u0438\u0434\u043A\u0430\u0445 \u0438 \u043D\u043E\u0432\u043E\u0441\u0442\u044F\u0445 \u043F\u043E \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u0435.\n </label>\n <label tuiLabel>\n <input\n tuiCheckbox\n type=\"checkbox\"\n required=\"true\"\n formControlName=\"acceptRules\"\n />\n <div>\n <span>\n \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u044F\u0441\u044C \u043D\u0430 \u0441\u0430\u0439\u0442\u0435, \u044F \u0441\u043E\u0433\u043B\u0430\u0448\u0430\u044E\u0441\u044C \u0441\n <a\n tuiLink\n [style.text-decoration-line]=\"'underline'\"\n (click)=\"$event.preventDefault(); onClickOffer()\"\n >\n \u0414\u043E\u0433\u043E\u0432\u043E\u0440\u043E\u043C \u043E\u0444\u0435\u0440\u0442\u044B\n </a>\n .\n </span>\n <span class=\"text-tui-negative\">*</span>\n <tui-error formControlName=\"acceptRules\" />\n </div>\n </label>\n </div>\n </div>\n @if (!isIndividual) {\n <sc-new-contragent-form\n [opfControl]=\"opfControl\"\n [class.!hidden]=\"stepIndex !== 1\"\n />\n <div [class.!hidden]=\"stepIndex !== 2\">\n @if (contacts) {\n <div class=\"flex flex-col gap-5 pb-1\">\n <p class=\"text-lg font-bold\">\u041A\u043E\u043D\u0442\u0430\u043A\u0442\u044B</p>\n @for (contact of contacts.controls; track contact; let index = $index; let count = $count; let last = $last) {\n <div class=\"flex flex-col gap-3\">\n <div class=\"flex h-10 items-center justify-between\">\n <p class=\"font-bold\">\u041A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u043E\u0435 \u043B\u0438\u0446\u043E \u2116{{ index + 1 }}:</p>\n @if (count - 1) {\n <button\n tuiIconButton\n appearance=\"secondary\"\n (click)=\"removeContactGroup(index)\"\n >\n <tui-icon icon=\"@tui.trash-2\" />\n </button>\n }\n </div>\n <sc-new-contact-form [form]=\"contact\" />\n @if (!last) {\n <hr class=\"h-px w-full bg-tui-base-04\" />\n }\n </div>\n }\n <button\n tuiButton\n iconStart=\"@tui.plus\"\n appearance=\"secondary\"\n (click)=\"addContactGroup()\"\n type=\"button\"\n class=\"self-center\"\n >\n \u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043A\u043E\u043D\u0442\u0430\u043A\u0442\n </button>\n </div>\n }\n </div>\n <div [class.!hidden]=\"stepIndex !== 3\">\n @if (bankAccounts) {\n <div class=\"flex flex-col gap-5 pb-1\">\n <p class=\"text-lg font-bold\">\u0411\u0430\u043D\u043A\u043E\u0432\u0441\u043A\u0438\u0435 \u0440\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u044B</p>\n @for (bankAccount of bankAccounts.controls; track bankAccount; let index = $index; let count = $count; let last = $last) {\n <div class=\"flex flex-col gap-3\">\n <div class=\"flex h-12 items-center justify-between\">\n <p class=\"font-bold\">\u0411\u0430\u043D\u043A\u043E\u0432\u0441\u043A\u0438\u0435 \u0440\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u044B \u2116{{ index + 1 }}:</p>\n @if (count - 1) {\n <button\n tuiIconButton\n appearance=\"secondary\"\n (click)=\"removeBankAccountGroup(index)\"\n >\n <tui-icon icon=\"@tui.trash-2\" />\n </button>\n }\n </div>\n @if (opfControl.value; as selectOpf) {\n <sc-new-contragent-bank-account-form\n [opf]=\"selectOpf\"\n [form]=\"bankAccount\"\n />\n }\n @if (!last) {\n <hr class=\"h-px w-full bg-tui-base-04\" />\n }\n </div>\n }\n <button\n tuiButton\n iconStart=\"@tui.plus\"\n appearance=\"secondary\"\n (click)=\"addBankAccountGroup()\"\n type=\"button\"\n class=\"self-center\"\n >\n \u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0431\u0430\u043D\u043A\u043E\u0432\u0441\u043A\u0438\u0435 \u0440\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u044B\n </button>\n </div>\n }\n </div>\n }\n <div class=\"flex justify-center gap-2\">\n @if (stepIndex > 0) {\n <button\n tuiButton\n appearance=\"secondary\"\n type=\"button\"\n (click)=\"navigate(-1)\"\n >\n \u041D\u0430\u0437\u0430\u0434\n </button>\n }\n @if (isIndividual || (stepIndex === 2 && !form.controls.contragent.controls['bankAccounts']) || stepIndex === 3) {\n <button\n tuiButton\n [disabled]=\"form.invalid\"\n [loading]=\"!!(loading$ | async)\"\n class=\"self-center\"\n >\n \u0417\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043E\u0432\u0430\u0442\u044C\u0441\u044F\n </button>\n } @else {\n <button\n tuiButton\n type=\"button\"\n [disabled]=\"!canNextStep(stepIndex)\"\n (click)=\"navigate(1)\"\n >\n \u0414\u0430\u043B\u0435\u0435\n </button>\n }\n </div>\n </form>\n}\n", dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.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: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.CheckboxRequiredValidator, selector: "input[type=checkbox][required][formControlName],input[type=checkbox][required][formControl],input[type=checkbox][required][ngModel]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: i2.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler"] }, { kind: "directive", type: i3.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { kind: "directive", type: i2.TuiInputDirective, selector: "input[tuiInput]", inputs: ["readOnly", "invalid", "focused", "state"] }, { kind: "component", type: TuiIcon, selector: "tui-icon:not([tuiBadge])", inputs: ["background"] }, { kind: "component", type: i2.TuiErrorComponent, selector: "tui-error", inputs: ["error"] }, { kind: "directive", type: i2.TuiErrorDirective, selector: "tui-error[ngModel], tui-error[formControlName], tui-error[formControl], tui-error[formGroup], tui-error[formGroupName], tui-error[formArrayName], tui-error[formArray]", inputs: ["order"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: TuiButtonLoading, selector: "[tuiButton][loading],[tuiIconButton][loading]", inputs: ["size", "loading"] }, { kind: "component", type: TuiCheckbox, selector: "input[type=\"checkbox\"][tuiCheckbox]" }, { kind: "directive", type: TuiChevron, selector: "[tuiChevron]", inputs: ["tuiChevron"] }, { kind: "directive", type: TuiPassword, selector: "tui-icon[tuiPassword]" }, { kind: "directive", type: TuiLink, selector: "a[tuiLink], button[tuiLink]" }, { kind: "component", type: i2.TuiDataListComponent, selector: "tui-data-list", inputs: ["emptyContent", "size"] }, { kind: "directive", type: i2.TuiOption, selector: "button[tuiOption], a[tuiOption], label[tuiOption]", inputs: ["disabled"] }, { kind: "directive", type: i2.TuiOptionWithValue, selector: "button[tuiOption][value], a[tuiOption][value], label[tuiOption][value]", inputs: ["disabled", "value"] }, { kind: "directive", type: i1$1.TuiSelectDirective, selector: "input[tuiSelect]" }, { kind: "component", type: i1$1.TuiStepperComponent, selector: "tui-stepper", inputs: ["orientation", "activeItemIndex"], outputs: ["activeItemIndexChange"] }, { kind: "component", type: i1$1.TuiStep, selector: "button[tuiStep], a[tuiStep]:not([routerLink]), a[tuiStep][routerLink][routerLinkActive]", inputs: ["stepState", "icon"] }, { kind: "component", type: ScAddressesSelectionFieldComponent, selector: "sc-addresses-selection-field", inputs: ["canSelectCountry"], outputs: ["canSelectCountryChange"] }, { kind: "component", type: ScSuggestionFieldComponent, selector: "sc-suggestion-field", inputs: ["type", "showAddressQuality"], outputs: ["selectedClick"] }, { kind: "component", type: ScVerificationPhoneCheckFormComponent, selector: "sc-verification-phone-check-form", inputs: ["showCodeFields", "readOnly", "pseudoInvalid", "required", "subtitle", "shouldBeBusy", "shouldBeConfirmed", "haveCode"], outputs: ["haveCodeChange", "isBusyChange", "isConfirmedChange"] }, { kind: "component", type: ScNewContragentFormComponent, selector: "sc-new-contragent-form", inputs: ["opfControl"] }, { kind: "component", type: ScNewContragentBankAccountsFormComponent, selector: "sc-new-contragent-bank-account-form", inputs: ["form", "opf"] }, { kind: "component", type: ScNewContactFormComponent, selector: "sc-new-contact-form", inputs: ["form"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2980
3371
|
}
|
|
2981
3372
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScSignUpFormComponent, decorators: [{
|
|
2982
3373
|
type: Component,
|
|
@@ -3359,6 +3750,10 @@ class ScAddOrEditingCartItemFormComponent {
|
|
|
3359
3750
|
* Шаг изменения метража.
|
|
3360
3751
|
*/
|
|
3361
3752
|
this.lengthStep = computed(() => ScUnitsHelper.getProductLengthMultiplicity(this.product()), ...(ngDevMode ? [{ debugName: "lengthStep" }] : /* istanbul ignore next */ []));
|
|
3753
|
+
/**
|
|
3754
|
+
* Количество знаков после запятой в поле метража.
|
|
3755
|
+
*/
|
|
3756
|
+
this.lengthPrecision = computed(() => ScNumberHelper.getDecimalsCount(this.lengthStep()), ...(ngDevMode ? [{ debugName: "lengthPrecision" }] : /* istanbul ignore next */ []));
|
|
3362
3757
|
/**
|
|
3363
3758
|
* Подсказка по минимальному и максимальному метражу товара.
|
|
3364
3759
|
*/
|
|
@@ -3376,6 +3771,10 @@ class ScAddOrEditingCartItemFormComponent {
|
|
|
3376
3771
|
* {@link Output} события редактирования товара в корзине.
|
|
3377
3772
|
*/
|
|
3378
3773
|
this.editCartItem = output();
|
|
3774
|
+
/**
|
|
3775
|
+
* Настройки вывода сумм в рублях.
|
|
3776
|
+
*/
|
|
3777
|
+
this.moneyFormat = ScNumberHelper.getMoneyFormat();
|
|
3379
3778
|
/**
|
|
3380
3779
|
* Сервис для сбора метрик о действиях пользователей.
|
|
3381
3780
|
*/
|
|
@@ -3403,7 +3802,7 @@ class ScAddOrEditingCartItemFormComponent {
|
|
|
3403
3802
|
const step = this.lengthStep();
|
|
3404
3803
|
if (this.isLengthConfigurator() && this.lengthStep() && this.form.controls.quantity.value && step) {
|
|
3405
3804
|
// Если есть конфигуратор длины, рассчитываем начально значение длины.
|
|
3406
|
-
this.form.controls.length?.patchValue(this.form.controls.quantity.value
|
|
3805
|
+
this.form.controls.length?.patchValue(ScNumberHelper.multiplyByStep(this.form.controls.quantity.value, step));
|
|
3407
3806
|
}
|
|
3408
3807
|
// Добавляем валидацию шага для количества.
|
|
3409
3808
|
this.form.controls.quantity.addValidators(stepValidator(ScUnitsHelper.getProductMultiplicity(this.product())));
|
|
@@ -3420,12 +3819,11 @@ class ScAddOrEditingCartItemFormComponent {
|
|
|
3420
3819
|
}
|
|
3421
3820
|
// Если изменилось количество — пересчитываем длину.
|
|
3422
3821
|
if (previous.quantity !== current.quantity && this.form.controls.quantity.value) {
|
|
3423
|
-
|
|
3424
|
-
lengthControl.patchValue(newValue);
|
|
3822
|
+
lengthControl.patchValue(ScNumberHelper.multiplyByStep(this.form.controls.quantity.value, step));
|
|
3425
3823
|
}
|
|
3426
3824
|
// Если изменилась длина — пересчитываем количество и возвращаем значение длины.
|
|
3427
3825
|
if (previous.length !== current.length && lengthControl.value) {
|
|
3428
|
-
const newValue = lengthControl.value
|
|
3826
|
+
const newValue = ScNumberHelper.divideByStep(lengthControl.value, step);
|
|
3429
3827
|
this.form.controls.quantity.patchValue(newValue);
|
|
3430
3828
|
return { length: step, quantity: newValue };
|
|
3431
3829
|
}
|
|
@@ -3433,7 +3831,7 @@ class ScAddOrEditingCartItemFormComponent {
|
|
|
3433
3831
|
return { length: step, quantity: current.quantity };
|
|
3434
3832
|
}),
|
|
3435
3833
|
// Считаем стоимость: цена * длина * количество.
|
|
3436
|
-
map(({ length, quantity }) => (this.product().costRub ?? 0) * (length ?? 1) * quantity)
|
|
3834
|
+
map(({ length, quantity }) => ScNumberHelper.roundMoney((this.product().costRub ?? 0) * (length ?? 1) * quantity)));
|
|
3437
3835
|
}
|
|
3438
3836
|
/**
|
|
3439
3837
|
* Обработчик события шага метража.
|
|
@@ -3445,11 +3843,8 @@ class ScAddOrEditingCartItemFormComponent {
|
|
|
3445
3843
|
if (!this.productIsMeasurable() || !lengthControl) {
|
|
3446
3844
|
return;
|
|
3447
3845
|
}
|
|
3448
|
-
const
|
|
3449
|
-
|
|
3450
|
-
// Округляем до ближайшего кратного числа.
|
|
3451
|
-
newLength = Math.round(newLength / step) * step;
|
|
3452
|
-
lengthControl.setValue(Number(newLength.toFixed(2)));
|
|
3846
|
+
const newLength = Math.max(this.minLength() ?? step, ScNumberHelper.addStep(lengthControl.value ?? 0, step));
|
|
3847
|
+
lengthControl.setValue(ScNumberHelper.snapToStep(newLength, Math.abs(step)));
|
|
3453
3848
|
}
|
|
3454
3849
|
/**
|
|
3455
3850
|
* Обработчик события шага количества.
|
|
@@ -3458,7 +3853,8 @@ class ScAddOrEditingCartItemFormComponent {
|
|
|
3458
3853
|
*/
|
|
3459
3854
|
onStepQuantity(step) {
|
|
3460
3855
|
const quantity = this.form.controls.quantity.value ?? 0;
|
|
3461
|
-
|
|
3856
|
+
const multipleQuantity = ScNumberHelper.addStep(quantity, -ScNumberHelper.remainder(quantity, Math.abs(step)));
|
|
3857
|
+
this.form.controls.quantity.setValue(Math.max(this.productMultiplicity(), ScNumberHelper.addStep(multipleQuantity, step)));
|
|
3462
3858
|
}
|
|
3463
3859
|
/**
|
|
3464
3860
|
* Обработчик события отправки формы.
|
|
@@ -3486,11 +3882,12 @@ class ScAddOrEditingCartItemFormComponent {
|
|
|
3486
3882
|
}
|
|
3487
3883
|
}
|
|
3488
3884
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScAddOrEditingCartItemFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3489
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScAddOrEditingCartItemFormComponent, isStandalone: true, selector: "sc-add-or-editing-cart-item-form", inputs: { product: { classPropertyName: "product", publicName: "product", isSignal: true, isRequired: true, transformFunction: null }, orderItem: { classPropertyName: "orderItem", publicName: "orderItem", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { addProduct: "addProduct", editCartItem: "editCartItem" }, ngImport: i0, template: "<!-- \u0424\u043E\u0440\u043C\u0430 \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0438\u044F \u0438\u0437\u043C\u0435\u0440\u044F\u0435\u043C\u043E\u0433\u043E \u0442\u043E\u0432\u0430\u0440\u0430. -->\n@if (product()) {\n <form\n [formGroup]=\"form\"\n (ngSubmit)=\"onSubmit()\"\n ScNextInputFocus\n class=\"flex flex-col gap-2\"\n >\n @let step = lengthStep();\n <!-- \u0414\u043B\u0438\u043D\u0430 \u0442\u043E\u0432\u0430\u0440\u0430 (\u043C\u0435\u0442\u0440\u0430\u0436) -->\n @if (productIsMeasurable()) {\n <label tuiLabel>\n \u041C\u0435\u0442\u0440\u0430\u0436, {{ product().unit.name }}\n @if (!step || maxLength()) {\n {{ lengthHint() }}\n }\n <tui-textfield>\n <input\n tuiInputNumber\n formControlName=\"length\"\n [tuiNumberFormat]=\"{ precision:
|
|
3885
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScAddOrEditingCartItemFormComponent, isStandalone: true, selector: "sc-add-or-editing-cart-item-form", inputs: { product: { classPropertyName: "product", publicName: "product", isSignal: true, isRequired: true, transformFunction: null }, orderItem: { classPropertyName: "orderItem", publicName: "orderItem", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { addProduct: "addProduct", editCartItem: "editCartItem" }, ngImport: i0, template: "<!-- \u0424\u043E\u0440\u043C\u0430 \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0438\u044F \u0438\u0437\u043C\u0435\u0440\u044F\u0435\u043C\u043E\u0433\u043E \u0442\u043E\u0432\u0430\u0440\u0430. -->\n@if (product()) {\n <form\n [formGroup]=\"form\"\n (ngSubmit)=\"onSubmit()\"\n ScNextInputFocus\n class=\"flex flex-col gap-2\"\n >\n @let step = lengthStep();\n <!-- \u0414\u043B\u0438\u043D\u0430 \u0442\u043E\u0432\u0430\u0440\u0430 (\u043C\u0435\u0442\u0440\u0430\u0436) -->\n @if (productIsMeasurable()) {\n <label tuiLabel>\n \u041C\u0435\u0442\u0440\u0430\u0436, {{ product().unit.name }}\n @if (!step || maxLength()) {\n {{ lengthHint() }}\n }\n <tui-textfield>\n <input\n tuiInputNumber\n formControlName=\"length\"\n [tuiNumberFormat]=\"{ precision: lengthPrecision() }\"\n [max]=\"maxLength() || null\"\n [min]=\"minLength() || null\"\n (keydown.arrowDown)=\"onStepLength(-(lengthStep() ?? 0.01))\"\n (keydown.arrowUp)=\"onStepLength(lengthStep() ?? 0.01)\"\n autocomplete=\"length\"\n placeholder=\"\u041C\u0435\u0442\u0440\u0430\u0436\"\n />\n </tui-textfield>\n <tui-error formControlName=\"length\" />\n @if (lengthStep()) {\n <p class=\"tui-form__field-note\">\u041C\u0435\u0442\u0440\u0430\u0436 \u0434\u043E\u043B\u0436\u0435\u043D \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u0435\u043D {{ lengthStep() }}</p>\n }\n </label>\n }\n <!-- \u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0442\u043E\u0432\u0430\u0440\u0430 -->\n <label tuiLabel>\n \u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E, \u0448\u0442.\n <tui-textfield>\n @if (isLengthConfigurator() && productMultiplicity() && step) {\n <span\n tuiChip\n size=\"s\"\n appearance=\"negative\"\n class=\"font-bold\"\n >\n x {{ step }} {{ product().unit.name }}\n </span>\n }\n <input\n placeholder=\"\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E\"\n tuiInputNumber\n [tuiNumberFormat]=\"{ decimalMode: 'not-zero' }\"\n [min]=\"productMultiplicity()\"\n (keydown.arrowDown)=\"onStepQuantity(-productMultiplicity())\"\n (keydown.arrowUp)=\"onStepQuantity(productMultiplicity())\"\n formControlName=\"quantity\"\n autocomplete=\"quantity\"\n />\n </tui-textfield>\n <p class=\"tui-form__field-note\">\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u043E {{ productMultiplicity() }}</p>\n <tui-error formControlName=\"quantity\" />\n </label>\n <!-- \u041C\u0430\u0440\u043A\u0438\u0440\u043E\u0432\u043A\u0430 -->\n <label tuiLabel>\n \u041C\u0430\u0440\u043A\u0438\u0440\u043E\u0432\u043A\u0430\n <tui-textfield>\n <input\n tuiInput\n autocomplete=\"marker\"\n formControlName=\"marker\"\n placeholder=\"\u041C\u0430\u0440\u043A\u0438\u0440\u043E\u0432\u043A\u0430\"\n />\n </tui-textfield>\n <tui-error formControlName=\"marker\" />\n </label>\n <!-- \u041A\u043D\u043E\u043F\u043A\u0430 \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0438\u044F / \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0442\u043E\u0432\u0430\u0440\u0430 \u0432 \u043A\u043E\u0440\u0437\u0438\u043D\u0443 -->\n <div class=\"flex flex-col items-center\">\n @let cost = totalCost$ | async;\n @if (cost) {\n <div>\n \u0418\u0442\u043E\u0433\u043E:<span class=\"text-2xl font-bold\">\n {{ cost | tuiFormatNumber: moneyFormat }}\n {{ product().currency.symbol }}\n </span>\n </div>\n }\n <!-- \u041A\u043D\u043E\u043F\u043A\u0430 \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0438\u044F / \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0442\u043E\u0432\u0430\u0440\u0430 \u0432 \u043A\u043E\u0440\u0437\u0438\u043D\u0443 -->\n <button\n tuiButton\n iconStart=\"@tui.check\"\n [disabled]=\"form.invalid\"\n [loading]=\"isLoading()\"\n type=\"submit\"\n class=\"mt-2\"\n >\n {{ orderItem() ? '\u0418\u0437\u043C\u0435\u043D\u0438\u0442\u044C' : '\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0432 \u043A\u043E\u0440\u0437\u0438\u043D\u0443' }}\n </button>\n </div>\n </form>\n}\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: ScNextInputFocusDirective, selector: "form[ScNextInputFocus]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: TuiLabel, selector: "label[tuiLabel]" }, { kind: "directive", type: ScSelectOnFocusinDirective, selector: "tui-input-number, tui-input, tui-input-phone, tui-input-date, tui-input-password, input[tuiInput], input[tuiInputNumber], input[tuiTextfield], input[tuiInputSlider]" }, { kind: "directive", type: TuiNumberFormat, selector: "[tuiNumberFormat]", inputs: ["tuiNumberFormat"] }, { kind: "component", type: i2.TuiErrorComponent, selector: "tui-error", inputs: ["error"] }, { kind: "directive", type: i2.TuiErrorDirective, selector: "tui-error[ngModel], tui-error[formControlName], tui-error[formControl], tui-error[formGroup], tui-error[formGroupName], tui-error[formArrayName], tui-error[formArray]", inputs: ["order"] }, { kind: "component", type: i3$1.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler"] }, { kind: "directive", type: i2.TuiInputDirective, selector: "input[tuiInput]", inputs: ["readOnly", "invalid", "focused", "state"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: TuiButtonLoading, selector: "[tuiButton][loading],[tuiIconButton][loading]", inputs: ["size", "loading"] }, { kind: "directive", type: i1$1.TuiInputNumberDirective, selector: "input[tuiInputNumber]" }, { kind: "directive", type: TuiChip, selector: "[tuiChip]", inputs: ["size"] }, { kind: "pipe", type: TuiFormatNumberPipe, name: "tuiFormatNumber" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3490
3886
|
}
|
|
3491
3887
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScAddOrEditingCartItemFormComponent, decorators: [{
|
|
3492
3888
|
type: Component,
|
|
3493
3889
|
args: [{ standalone: true, selector: 'sc-add-or-editing-cart-item-form', imports: [
|
|
3890
|
+
TuiFormatNumberPipe,
|
|
3494
3891
|
FormsModule,
|
|
3495
3892
|
ScNextInputFocusDirective,
|
|
3496
3893
|
ReactiveFormsModule,
|
|
@@ -3507,9 +3904,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
|
|
|
3507
3904
|
TuiButtonLoading,
|
|
3508
3905
|
AsyncPipe,
|
|
3509
3906
|
TuiInputNumber,
|
|
3510
|
-
TuiAmountPipe,
|
|
3511
3907
|
TuiChip,
|
|
3512
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- \u0424\u043E\u0440\u043C\u0430 \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0438\u044F \u0438\u0437\u043C\u0435\u0440\u044F\u0435\u043C\u043E\u0433\u043E \u0442\u043E\u0432\u0430\u0440\u0430. -->\n@if (product()) {\n <form\n [formGroup]=\"form\"\n (ngSubmit)=\"onSubmit()\"\n ScNextInputFocus\n class=\"flex flex-col gap-2\"\n >\n @let step = lengthStep();\n <!-- \u0414\u043B\u0438\u043D\u0430 \u0442\u043E\u0432\u0430\u0440\u0430 (\u043C\u0435\u0442\u0440\u0430\u0436) -->\n @if (productIsMeasurable()) {\n <label tuiLabel>\n \u041C\u0435\u0442\u0440\u0430\u0436, {{ product().unit.name }}\n @if (!step || maxLength()) {\n {{ lengthHint() }}\n }\n <tui-textfield>\n <input\n tuiInputNumber\n formControlName=\"length\"\n [tuiNumberFormat]=\"{ precision:
|
|
3908
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- \u0424\u043E\u0440\u043C\u0430 \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0438\u044F \u0438\u0437\u043C\u0435\u0440\u044F\u0435\u043C\u043E\u0433\u043E \u0442\u043E\u0432\u0430\u0440\u0430. -->\n@if (product()) {\n <form\n [formGroup]=\"form\"\n (ngSubmit)=\"onSubmit()\"\n ScNextInputFocus\n class=\"flex flex-col gap-2\"\n >\n @let step = lengthStep();\n <!-- \u0414\u043B\u0438\u043D\u0430 \u0442\u043E\u0432\u0430\u0440\u0430 (\u043C\u0435\u0442\u0440\u0430\u0436) -->\n @if (productIsMeasurable()) {\n <label tuiLabel>\n \u041C\u0435\u0442\u0440\u0430\u0436, {{ product().unit.name }}\n @if (!step || maxLength()) {\n {{ lengthHint() }}\n }\n <tui-textfield>\n <input\n tuiInputNumber\n formControlName=\"length\"\n [tuiNumberFormat]=\"{ precision: lengthPrecision() }\"\n [max]=\"maxLength() || null\"\n [min]=\"minLength() || null\"\n (keydown.arrowDown)=\"onStepLength(-(lengthStep() ?? 0.01))\"\n (keydown.arrowUp)=\"onStepLength(lengthStep() ?? 0.01)\"\n autocomplete=\"length\"\n placeholder=\"\u041C\u0435\u0442\u0440\u0430\u0436\"\n />\n </tui-textfield>\n <tui-error formControlName=\"length\" />\n @if (lengthStep()) {\n <p class=\"tui-form__field-note\">\u041C\u0435\u0442\u0440\u0430\u0436 \u0434\u043E\u043B\u0436\u0435\u043D \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u0435\u043D {{ lengthStep() }}</p>\n }\n </label>\n }\n <!-- \u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0442\u043E\u0432\u0430\u0440\u0430 -->\n <label tuiLabel>\n \u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E, \u0448\u0442.\n <tui-textfield>\n @if (isLengthConfigurator() && productMultiplicity() && step) {\n <span\n tuiChip\n size=\"s\"\n appearance=\"negative\"\n class=\"font-bold\"\n >\n x {{ step }} {{ product().unit.name }}\n </span>\n }\n <input\n placeholder=\"\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E\"\n tuiInputNumber\n [tuiNumberFormat]=\"{ decimalMode: 'not-zero' }\"\n [min]=\"productMultiplicity()\"\n (keydown.arrowDown)=\"onStepQuantity(-productMultiplicity())\"\n (keydown.arrowUp)=\"onStepQuantity(productMultiplicity())\"\n formControlName=\"quantity\"\n autocomplete=\"quantity\"\n />\n </tui-textfield>\n <p class=\"tui-form__field-note\">\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u043E {{ productMultiplicity() }}</p>\n <tui-error formControlName=\"quantity\" />\n </label>\n <!-- \u041C\u0430\u0440\u043A\u0438\u0440\u043E\u0432\u043A\u0430 -->\n <label tuiLabel>\n \u041C\u0430\u0440\u043A\u0438\u0440\u043E\u0432\u043A\u0430\n <tui-textfield>\n <input\n tuiInput\n autocomplete=\"marker\"\n formControlName=\"marker\"\n placeholder=\"\u041C\u0430\u0440\u043A\u0438\u0440\u043E\u0432\u043A\u0430\"\n />\n </tui-textfield>\n <tui-error formControlName=\"marker\" />\n </label>\n <!-- \u041A\u043D\u043E\u043F\u043A\u0430 \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0438\u044F / \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0442\u043E\u0432\u0430\u0440\u0430 \u0432 \u043A\u043E\u0440\u0437\u0438\u043D\u0443 -->\n <div class=\"flex flex-col items-center\">\n @let cost = totalCost$ | async;\n @if (cost) {\n <div>\n \u0418\u0442\u043E\u0433\u043E:<span class=\"text-2xl font-bold\">\n {{ cost | tuiFormatNumber: moneyFormat }}\n {{ product().currency.symbol }}\n </span>\n </div>\n }\n <!-- \u041A\u043D\u043E\u043F\u043A\u0430 \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0438\u044F / \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0442\u043E\u0432\u0430\u0440\u0430 \u0432 \u043A\u043E\u0440\u0437\u0438\u043D\u0443 -->\n <button\n tuiButton\n iconStart=\"@tui.check\"\n [disabled]=\"form.invalid\"\n [loading]=\"isLoading()\"\n type=\"submit\"\n class=\"mt-2\"\n >\n {{ orderItem() ? '\u0418\u0437\u043C\u0435\u043D\u0438\u0442\u044C' : '\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0432 \u043A\u043E\u0440\u0437\u0438\u043D\u0443' }}\n </button>\n </div>\n </form>\n}\n" }]
|
|
3513
3909
|
}], propDecorators: { product: [{ type: i0.Input, args: [{ isSignal: true, alias: "product", required: true }] }], orderItem: [{ type: i0.Input, args: [{ isSignal: true, alias: "orderItem", required: false }] }], isLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "isLoading", required: false }] }], addProduct: [{ type: i0.Output, args: ["addProduct"] }], editCartItem: [{ type: i0.Output, args: ["editCartItem"] }] } });
|
|
3514
3910
|
|
|
3515
3911
|
/* eslint-disable sonarjs/no-nested-template-literals,@typescript-eslint/unbound-method,@typescript-eslint/no-unused-vars */
|
|
@@ -3986,9 +4382,9 @@ class ScInputQuantityComponent {
|
|
|
3986
4382
|
*/
|
|
3987
4383
|
incident(checkUpdateOn = false) {
|
|
3988
4384
|
const current = this.formControl.value ?? 0;
|
|
3989
|
-
const remainder = (
|
|
3990
|
-
const step = this.step -
|
|
3991
|
-
const newValue = Math.max(
|
|
4385
|
+
const remainder = ScNumberHelper.remainder(current, this.step);
|
|
4386
|
+
const step = ScNumberHelper.addStep(this.step, -remainder);
|
|
4387
|
+
const newValue = Math.max(ScNumberHelper.addStep(current, step), this._ignoreStepValidators ? 1 : Math.max(step, 0));
|
|
3992
4388
|
this.formControl.setValue(newValue);
|
|
3993
4389
|
if (checkUpdateOn) {
|
|
3994
4390
|
this.onChange(newValue);
|
|
@@ -4001,9 +4397,9 @@ class ScInputQuantityComponent {
|
|
|
4001
4397
|
*/
|
|
4002
4398
|
decrement(checkUpdateOn = false) {
|
|
4003
4399
|
const current = this.formControl.value ?? 0;
|
|
4004
|
-
const remainder = (
|
|
4400
|
+
const remainder = ScNumberHelper.remainder(current, this.step);
|
|
4005
4401
|
const step = -remainder || -this.step;
|
|
4006
|
-
const newValue = Math.max(
|
|
4402
|
+
const newValue = Math.max(ScNumberHelper.addStep(current, step), this._ignoreStepValidators ? 1 : Math.max(step, 0));
|
|
4007
4403
|
this.formControl.setValue(newValue);
|
|
4008
4404
|
if (checkUpdateOn) {
|
|
4009
4405
|
this.onChange(newValue);
|
|
@@ -4190,7 +4586,7 @@ class ScNotifyWhenInStockDialogComponent {
|
|
|
4190
4586
|
return ({ $implicit }) => itemsMap.get($implicit) ?? '';
|
|
4191
4587
|
}
|
|
4192
4588
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScNotifyWhenInStockDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4193
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScNotifyWhenInStockDialogComponent, isStandalone: true, selector: "sc-notify-when-in-stock-dialog", ngImport: i0, template: "<form\n [formGroup]=\"form\"\n (ngSubmit)=\"onSubmit$.next()\"\n class=\"flex flex-col gap-6\"\n>\n @let isPhoneVisible = requiredFields.includes('phone');\n @let isEmailVisible = requiredFields.includes('email');\n @let phoneTouched = form.get('phone')?.touched;\n @let emailTouched = form.get('email')?.touched;\n @let isShowError = form.errors?.['atLeastOneRequired'] && ((isPhoneVisible && phoneTouched) || (isEmailVisible && emailTouched));\n @let user = user$ | async;\n @let userPhone = user?.contacts?.phone;\n @let isShowCodeFields = !!form.controls.phone.value && (user?.isGuest || userPhone?.value !== form.controls.phone.value || !userPhone?.isApproved);\n\n @if (user) {\n <div class=\"flex flex-col gap-3\">\n <label tuiLabel>\n <div\n [appearance]=\"isPhoneVisible && isEmailVisible ? 'outline-grayscale' : 'flat'\"\n [tuiAppearanceMode]=\"isShowError ? 'invalid' : null\"\n tuiCardLarge\n class=\"flex flex-col !gap-1\"\n [style.padding]=\"requiredFields.length <= 1 ? '0' : undefined\"\n [style.border-radius]=\"requiredFields.length <= 1 ? '0' : undefined\"\n >\n @if (isPhoneVisible) {\n <sc-verification-phone-check-form\n [required]=\"!form.controls.email.value\"\n [showCodeFields]=\"isShowCodeFields\"\n [pseudoInvalid]=\"isShowError\"\n />\n }\n @if (isPhoneVisible && isEmailVisible) {\n <div\n class=\"tui-island__paragraph flex items-center gap-3\"\n [style.color]=\"isShowError ? 'var(--tui-text-negative)' : 'var(--tui-text-tertiary)'\"\n >\n <div\n class=\"h-px flex-1\"\n [style.background-color]=\"isShowError ? 'var(--tui-text-negative)' : 'var(--tui-text-tertiary)'\"\n ></div>\n <div class=\"text-body-s font-bold\">\n \u0418\u043B\u0438(\u0438)\n <tui-icon\n [appearance]=\"isShowError ? 'negative' : 'grayscale'\"\n tuiHintDirection=\"end\"\n tuiHintAppearance=\"dark\"\n tuiTooltip=\"\u041F\u043E\u0436\u0430\u043B\u0443\u0439\u0441\u0442\u0430, \u0443\u043A\u0430\u0436\u0438\u0442\u0435 \u043D\u043E\u043C\u0435\u0440 \u0442\u0435\u043B\u0435\u0444\u043E\u043D\u0430 \u0438\u043B\u0438(\u0438) \u0430\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\"\n />\n </div>\n <div\n class=\"h-px flex-1\"\n [style.background-color]=\"isShowError ? 'var(--tui-text-negative)' : 'var(--tui-text-tertiary)'\"\n ></div>\n </div>\n }\n @if (isEmailVisible) {\n <label tuiLabel>\n \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\n <tui-textfield>\n <input\n tuiInput\n [invalid]=\"!!isShowError\"\n formControlName=\"email\"\n placeholder=\"\u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.email\"\n />\n </tui-textfield>\n <tui-error formControlName=\"email\" />\n </label>\n }\n </div>\n @if (isShowError) {\n <tui-error error=\"\u041F\u043E\u0436\u0430\u043B\u0443\u0439\u0441\u0442\u0430, \u0443\u043A\u0430\u0436\u0438\u0442\u0435 \u043D\u043E\u043C\u0435\u0440 \u0442\u0435\u043B\u0435\u0444\u043E\u043D\u0430 \u0438(\u0438\u043B\u0438) \u0430\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B \u0434\u043B\u044F \u0443\u0432\u0435\u0434\u043E\u043C\u043B\u0435\u043D\u0438\u044F \u043E \u043F\u043E\u0441\u0442\u0443\u043F\u043B\u0435\u043D\u0438\u0438 \u0442\u043E\u0432\u0430\u0440\u0430\" />\n }\n </label>\n <label tuiLabel>\n \u0421\u043A\u043B\u0430\u0434\n <tui-textfield\n tuiChevron\n [content]=\"warehouses() ? stringify(warehouses()!) : selectLoading\"\n >\n <input\n tuiSelect\n formControlName=\"warehouseId\"\n placeholder=\"\u0421\u043A\u043B\u0430\u0434\"\n />\n <tui-data-list *tuiDropdown>\n @for (warehouse of warehouses(); track warehouse.id) {\n @if (!product.isWarehouseStockExist(warehouse.id)) {\n <button\n tuiOption\n [value]=\"warehouse.id\"\n >\n {{ warehouse.name }}\n </button>\n }\n }\n </tui-data-list>\n </tui-textfield>\n <tui-error formControlName=\"warehouseId\" />\n @if (isStock()) {\n <span [style.color]=\"'var(--tui-text-positive)'\"> \u0422\u043E\u0432\u0430\u0440 \u0438\u043C\u0435\u0435\u0442\u0441\u044F \u0432 \u043D\u0430\u043B\u0438\u0447\u0438\u0438 \u043D\u0430 \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u043E\u043C \u0441\u043A\u043B\u0430\u0434\u0435 </span>\n }\n </label>\n <ng-template #selectLoading> <tui-loader /> </ng-template>\n </div>\n }\n\n <div class=\"flex flex-wrap items-center gap-3\">\n <button\n tuiButton\n type=\"submit\"\n [disabled]=\"form.invalid || isStock() || (isShowCodeFields && !form.controls.verificationCode.value && form.controls.phone.valid)\"\n [loading]=\"loading()\"\n iconStart=\"@tui.sc.send\"\n class=\"self-center\"\n >\n \u041E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C\n </button>\n <div class=\"grow basis-60 text-body-s\">\n \u041D\u0430\u0436\u0438\u043C\u0430\u044F \u043D\u0430 \u043A\u043D\u043E\u043F\u043A\u0443, \u0432\u044B \u0441\u043E\u0433\u043B\u0430\u0448\u0430\u0435\u0442\u0435\u0441\u044C \u0441\n <button\n tuiLink\n [style.text-decoration-line]=\"'underline'\"\n type=\"button\"\n (click)=\"context.data.onClickOfferHandler()\"\n >\n \u041F\u043E\u043B\u0438\u0442\u0438\u043A\u043E\u0439 \u043A\u043E\u043D\u0444\u0438\u0434\u0435\u043D\u0446\u0438\u0430\u043B\u044C\u043D\u043E\u0441\u0442\u0438\n </button>\n </div>\n </div>\n\n <tui-error [formGroup]=\"form\" />\n</form>\n", dependencies: [{ kind: "component", type: ScVerificationPhoneCheckFormComponent, selector: "sc-verification-phone-check-form", inputs: ["showCodeFields", "readOnly", "pseudoInvalid", "required", "subtitle", "shouldBeBusy", "shouldBeConfirmed", "haveCode"], outputs: ["haveCodeChange", "isBusyChange", "isConfirmedChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i2$3.TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: i3$1.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler"] }, { kind: "directive", type: i3.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { kind: "directive", type: i2.TuiInputDirective, selector: "input[tuiInput]", inputs: ["readOnly", "invalid", "focused", "state"] }, { kind: "directive", type: TuiChevron, selector: "[tuiChevron]", inputs: ["tuiChevron"] }, { kind: "directive", type: TuiLink, selector: "a[tuiLink], button[tuiLink]" }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: i2.TuiErrorComponent, selector: "tui-error", inputs: ["error"] }, { kind: "directive", type: i2.TuiErrorDirective, selector: "tui-error[ngModel], tui-error[formControlName], tui-error[formControl], tui-error[formGroup], tui-error[formGroupName], tui-error[formArrayName], tui-error[formArray]", inputs: ["order"] }, { kind: "component", type: ScSuggestionFieldComponent, selector: "sc-suggestion-field", inputs: ["type"], outputs: ["selectedClick"] }, { kind: "component", type: i2.TuiDataListComponent, selector: "tui-data-list", inputs: ["emptyContent", "size"] }, { kind: "directive", type: i2.TuiOption, selector: "button[tuiOption], a[tuiOption], label[tuiOption]", inputs: ["disabled"] }, { kind: "directive", type: i2.TuiOptionWithValue, selector: "button[tuiOption][value], a[tuiOption][value], label[tuiOption][value]", inputs: ["disabled", "value"] }, { kind: "directive", type: i1$1.TuiSelectDirective, selector: "input[tuiSelect]" }, { kind: "component", type: TuiButtonLoading, selector: "[tuiButton][loading],[tuiIconButton][loading]", inputs: ["size", "loading"] }, { kind: "component", type: TuiLoader, selector: "tui-loader", inputs: ["size", "inheritColor", "overlay", "textContent", "loading"] }, { kind: "directive", type: TuiCardLarge, selector: "[tuiCardLarge]", inputs: ["tuiCardLarge"] }, { kind: "component", type: TuiIcon, selector: "tui-icon:not([tuiBadge])", inputs: ["background"] }, { kind: "directive", type: TuiTooltip, selector: "tui-icon[tuiTooltip]", inputs: ["size"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4589
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScNotifyWhenInStockDialogComponent, isStandalone: true, selector: "sc-notify-when-in-stock-dialog", ngImport: i0, template: "<form\n [formGroup]=\"form\"\n (ngSubmit)=\"onSubmit$.next()\"\n class=\"flex flex-col gap-6\"\n>\n @let isPhoneVisible = requiredFields.includes('phone');\n @let isEmailVisible = requiredFields.includes('email');\n @let phoneTouched = form.get('phone')?.touched;\n @let emailTouched = form.get('email')?.touched;\n @let isShowError = form.errors?.['atLeastOneRequired'] && ((isPhoneVisible && phoneTouched) || (isEmailVisible && emailTouched));\n @let user = user$ | async;\n @let userPhone = user?.contacts?.phone;\n @let isShowCodeFields = !!form.controls.phone.value && (user?.isGuest || userPhone?.value !== form.controls.phone.value || !userPhone?.isApproved);\n\n @if (user) {\n <div class=\"flex flex-col gap-3\">\n <label tuiLabel>\n <div\n [appearance]=\"isPhoneVisible && isEmailVisible ? 'outline-grayscale' : 'flat'\"\n [tuiAppearanceMode]=\"isShowError ? 'invalid' : null\"\n tuiCardLarge\n class=\"flex flex-col !gap-1\"\n [style.padding]=\"requiredFields.length <= 1 ? '0' : undefined\"\n [style.border-radius]=\"requiredFields.length <= 1 ? '0' : undefined\"\n >\n @if (isPhoneVisible) {\n <sc-verification-phone-check-form\n [required]=\"!form.controls.email.value\"\n [showCodeFields]=\"isShowCodeFields\"\n [pseudoInvalid]=\"isShowError\"\n />\n }\n @if (isPhoneVisible && isEmailVisible) {\n <div\n class=\"tui-island__paragraph flex items-center gap-3\"\n [style.color]=\"isShowError ? 'var(--tui-text-negative)' : 'var(--tui-text-tertiary)'\"\n >\n <div\n class=\"h-px flex-1\"\n [style.background-color]=\"isShowError ? 'var(--tui-text-negative)' : 'var(--tui-text-tertiary)'\"\n ></div>\n <div class=\"text-body-s font-bold\">\n \u0418\u043B\u0438(\u0438)\n <tui-icon\n [appearance]=\"isShowError ? 'negative' : 'grayscale'\"\n tuiHintDirection=\"end\"\n tuiHintAppearance=\"dark\"\n tuiTooltip=\"\u041F\u043E\u0436\u0430\u043B\u0443\u0439\u0441\u0442\u0430, \u0443\u043A\u0430\u0436\u0438\u0442\u0435 \u043D\u043E\u043C\u0435\u0440 \u0442\u0435\u043B\u0435\u0444\u043E\u043D\u0430 \u0438\u043B\u0438(\u0438) \u0430\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\"\n />\n </div>\n <div\n class=\"h-px flex-1\"\n [style.background-color]=\"isShowError ? 'var(--tui-text-negative)' : 'var(--tui-text-tertiary)'\"\n ></div>\n </div>\n }\n @if (isEmailVisible) {\n <label tuiLabel>\n \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\n <tui-textfield>\n <input\n tuiInput\n [invalid]=\"!!isShowError\"\n formControlName=\"email\"\n placeholder=\"\u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.email\"\n />\n </tui-textfield>\n <tui-error formControlName=\"email\" />\n </label>\n }\n </div>\n @if (isShowError) {\n <tui-error error=\"\u041F\u043E\u0436\u0430\u043B\u0443\u0439\u0441\u0442\u0430, \u0443\u043A\u0430\u0436\u0438\u0442\u0435 \u043D\u043E\u043C\u0435\u0440 \u0442\u0435\u043B\u0435\u0444\u043E\u043D\u0430 \u0438(\u0438\u043B\u0438) \u0430\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B \u0434\u043B\u044F \u0443\u0432\u0435\u0434\u043E\u043C\u043B\u0435\u043D\u0438\u044F \u043E \u043F\u043E\u0441\u0442\u0443\u043F\u043B\u0435\u043D\u0438\u0438 \u0442\u043E\u0432\u0430\u0440\u0430\" />\n }\n </label>\n <label tuiLabel>\n \u0421\u043A\u043B\u0430\u0434\n <tui-textfield\n tuiChevron\n [content]=\"warehouses() ? stringify(warehouses()!) : selectLoading\"\n >\n <input\n tuiSelect\n formControlName=\"warehouseId\"\n placeholder=\"\u0421\u043A\u043B\u0430\u0434\"\n />\n <tui-data-list *tuiDropdown>\n @for (warehouse of warehouses(); track warehouse.id) {\n @if (!product.isWarehouseStockExist(warehouse.id)) {\n <button\n tuiOption\n [value]=\"warehouse.id\"\n >\n {{ warehouse.name }}\n </button>\n }\n }\n </tui-data-list>\n </tui-textfield>\n <tui-error formControlName=\"warehouseId\" />\n @if (isStock()) {\n <span [style.color]=\"'var(--tui-text-positive)'\"> \u0422\u043E\u0432\u0430\u0440 \u0438\u043C\u0435\u0435\u0442\u0441\u044F \u0432 \u043D\u0430\u043B\u0438\u0447\u0438\u0438 \u043D\u0430 \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u043E\u043C \u0441\u043A\u043B\u0430\u0434\u0435 </span>\n }\n </label>\n <ng-template #selectLoading> <tui-loader /> </ng-template>\n </div>\n }\n\n <div class=\"flex flex-wrap items-center gap-3\">\n <button\n tuiButton\n type=\"submit\"\n [disabled]=\"form.invalid || isStock() || (isShowCodeFields && !form.controls.verificationCode.value && form.controls.phone.valid)\"\n [loading]=\"loading()\"\n iconStart=\"@tui.sc.send\"\n class=\"self-center\"\n >\n \u041E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C\n </button>\n <div class=\"grow basis-60 text-body-s\">\n \u041D\u0430\u0436\u0438\u043C\u0430\u044F \u043D\u0430 \u043A\u043D\u043E\u043F\u043A\u0443, \u0432\u044B \u0441\u043E\u0433\u043B\u0430\u0448\u0430\u0435\u0442\u0435\u0441\u044C \u0441\n <button\n tuiLink\n [style.text-decoration-line]=\"'underline'\"\n type=\"button\"\n (click)=\"context.data.onClickOfferHandler()\"\n >\n \u041F\u043E\u043B\u0438\u0442\u0438\u043A\u043E\u0439 \u043A\u043E\u043D\u0444\u0438\u0434\u0435\u043D\u0446\u0438\u0430\u043B\u044C\u043D\u043E\u0441\u0442\u0438\n </button>\n </div>\n </div>\n\n <tui-error [formGroup]=\"form\" />\n</form>\n", dependencies: [{ kind: "component", type: ScVerificationPhoneCheckFormComponent, selector: "sc-verification-phone-check-form", inputs: ["showCodeFields", "readOnly", "pseudoInvalid", "required", "subtitle", "shouldBeBusy", "shouldBeConfirmed", "haveCode"], outputs: ["haveCodeChange", "isBusyChange", "isConfirmedChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i2$3.TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: i3$1.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler"] }, { kind: "directive", type: i3.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { kind: "directive", type: i2.TuiInputDirective, selector: "input[tuiInput]", inputs: ["readOnly", "invalid", "focused", "state"] }, { kind: "directive", type: TuiChevron, selector: "[tuiChevron]", inputs: ["tuiChevron"] }, { kind: "directive", type: TuiLink, selector: "a[tuiLink], button[tuiLink]" }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: i2.TuiErrorComponent, selector: "tui-error", inputs: ["error"] }, { kind: "directive", type: i2.TuiErrorDirective, selector: "tui-error[ngModel], tui-error[formControlName], tui-error[formControl], tui-error[formGroup], tui-error[formGroupName], tui-error[formArrayName], tui-error[formArray]", inputs: ["order"] }, { kind: "component", type: ScSuggestionFieldComponent, selector: "sc-suggestion-field", inputs: ["type", "showAddressQuality"], outputs: ["selectedClick"] }, { kind: "component", type: i2.TuiDataListComponent, selector: "tui-data-list", inputs: ["emptyContent", "size"] }, { kind: "directive", type: i2.TuiOption, selector: "button[tuiOption], a[tuiOption], label[tuiOption]", inputs: ["disabled"] }, { kind: "directive", type: i2.TuiOptionWithValue, selector: "button[tuiOption][value], a[tuiOption][value], label[tuiOption][value]", inputs: ["disabled", "value"] }, { kind: "directive", type: i1$1.TuiSelectDirective, selector: "input[tuiSelect]" }, { kind: "component", type: TuiButtonLoading, selector: "[tuiButton][loading],[tuiIconButton][loading]", inputs: ["size", "loading"] }, { kind: "component", type: TuiLoader, selector: "tui-loader", inputs: ["size", "inheritColor", "overlay", "textContent", "loading"] }, { kind: "directive", type: TuiCardLarge, selector: "[tuiCardLarge]", inputs: ["tuiCardLarge"] }, { kind: "component", type: TuiIcon, selector: "tui-icon:not([tuiBadge])", inputs: ["background"] }, { kind: "directive", type: TuiTooltip, selector: "tui-icon[tuiTooltip]", inputs: ["size"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4194
4590
|
}
|
|
4195
4591
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScNotifyWhenInStockDialogComponent, decorators: [{
|
|
4196
4592
|
type: Component,
|
|
@@ -4460,7 +4856,11 @@ class ScPriceHistoryComponent {
|
|
|
4460
4856
|
*
|
|
4461
4857
|
* @param value Значение оси Y.
|
|
4462
4858
|
*/
|
|
4463
|
-
this.yStringify = (value) => `${
|
|
4859
|
+
this.yStringify = (value) => `${ScNumberHelper.formatMoney(value)} ₽`;
|
|
4860
|
+
/**
|
|
4861
|
+
* Настройки вывода цен в рублях.
|
|
4862
|
+
*/
|
|
4863
|
+
this.moneyFormat = ScNumberHelper.getMoneyFormat();
|
|
4464
4864
|
if (this.context) {
|
|
4465
4865
|
this.product = this.context.data.product;
|
|
4466
4866
|
}
|
|
@@ -4529,7 +4929,7 @@ class ScPriceHistoryComponent {
|
|
|
4529
4929
|
}, []));
|
|
4530
4930
|
}
|
|
4531
4931
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScPriceHistoryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4532
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScPriceHistoryComponent, isStandalone: true, selector: "sc-price-history", inputs: { product: "product" }, ngImport: i0, template: "<tui-loader [loading]=\"!!(loadingHistory$ | async)\"> </tui-loader>\n\n@if ((loadingHistory$ | async) === false) {\n <div class=\"flex flex-col items-center\">\n @if (priceInfo$ | async; as priceInfo) {\n <div class=\"w-174 mb-1 text-end text-lg font-bold\">\u043E\u0442 {{ priceInfo.min
|
|
4932
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScPriceHistoryComponent, isStandalone: true, selector: "sc-price-history", inputs: { product: "product" }, ngImport: i0, template: "<tui-loader [loading]=\"!!(loadingHistory$ | async)\"> </tui-loader>\n\n@if ((loadingHistory$ | async) === false) {\n <div class=\"flex flex-col items-center\">\n @if (priceInfo$ | async; as priceInfo) {\n <div class=\"w-174 mb-1 text-end text-lg font-bold\">\u043E\u0442 {{ priceInfo.min | tuiFormatNumber: moneyFormat }} \u20BD \u0434\u043E {{ priceInfo.max | tuiFormatNumber: moneyFormat }} \u20BD</div>\n @if (history$ | async; as history) {\n @if (range$ | async; as range) {\n <div class=\"relative h-56 w-full p-5 text-tui-primary\">\n @let labels = computeLabels(range);\n <tui-axes\n class=\"h-full\"\n [axisXLabels]=\"labels\"\n [horizontalLines]=\"5\"\n [verticalLines]=\"labels.length + 1\"\n >\n @let height = priceInfo.max - priceInfo.min;\n @if ((height / 100) * paddingPercent; as padding) {\n <tui-line-days-chart\n [height]=\"height + (height / 100) * paddingPercent * 2\"\n [smoothingFactor]=\"10\"\n [y]=\"priceInfo.min - (height / 100) * paddingPercent\"\n [value]=\"computeValue(range, history)\"\n [xStringify]=\"xStringify\"\n [yStringify]=\"yStringify\"\n [hintContent]=\"hint\"\n class=\"chart\"\n ></tui-line-days-chart>\n }\n </tui-axes>\n </div>\n }\n }\n } @else {\n <p class=\"text-base font-bold\">\u0426\u0435\u043D\u0430 \u043D\u0430 \u0442\u043E\u0432\u0430\u0440 \u043D\u0435 \u0438\u0437\u043C\u0435\u043D\u044F\u043B\u0430\u0441\u044C</p>\n }\n <ng-template\n #hint\n let-data\n >\n <div class=\"font-bold\">{{ data[1] | tuiFormatNumber: moneyFormat }} \u20BD</div>\n <div>{{ data[0] }}</div>\n </ng-template>\n </div>\n}\n", dependencies: [{ kind: "component", type: TuiLoader, selector: "tui-loader", inputs: ["size", "inheritColor", "overlay", "textContent", "loading"] }, { kind: "component", type: TuiAxes, selector: "tui-axes", inputs: ["axisXLabels", "axisYInset", "axisYLabels", "axisYName", "axisYSecondaryInset", "axisYSecondaryLabels", "axisYSecondaryName", "centeredXLabels", "horizontalLines", "horizontalLinesHandler", "verticalLines", "verticalLinesHandler"] }, { kind: "component", type: TuiLineDaysChart, selector: "tui-line-days-chart", inputs: ["y", "height", "smoothingFactor", "hintContent", "xStringify", "yStringify", "dots", "value"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: TuiFormatNumberPipe, name: "tuiFormatNumber" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4533
4933
|
}
|
|
4534
4934
|
__decorate([
|
|
4535
4935
|
tuiPure
|
|
@@ -4539,7 +4939,7 @@ __decorate([
|
|
|
4539
4939
|
], ScPriceHistoryComponent.prototype, "computeValue", null);
|
|
4540
4940
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScPriceHistoryComponent, decorators: [{
|
|
4541
4941
|
type: Component,
|
|
4542
|
-
args: [{ selector: 'sc-price-history', changeDetection: ChangeDetectionStrategy.OnPush, imports: [TuiLoader, TuiAxes, TuiLineDaysChart, AsyncPipe], template: "<tui-loader [loading]=\"!!(loadingHistory$ | async)\"> </tui-loader>\n\n@if ((loadingHistory$ | async) === false) {\n <div class=\"flex flex-col items-center\">\n @if (priceInfo$ | async; as priceInfo) {\n <div class=\"w-174 mb-1 text-end text-lg font-bold\">\u043E\u0442 {{ priceInfo.min
|
|
4942
|
+
args: [{ selector: 'sc-price-history', changeDetection: ChangeDetectionStrategy.OnPush, imports: [TuiLoader, TuiAxes, TuiLineDaysChart, AsyncPipe, TuiFormatNumberPipe], template: "<tui-loader [loading]=\"!!(loadingHistory$ | async)\"> </tui-loader>\n\n@if ((loadingHistory$ | async) === false) {\n <div class=\"flex flex-col items-center\">\n @if (priceInfo$ | async; as priceInfo) {\n <div class=\"w-174 mb-1 text-end text-lg font-bold\">\u043E\u0442 {{ priceInfo.min | tuiFormatNumber: moneyFormat }} \u20BD \u0434\u043E {{ priceInfo.max | tuiFormatNumber: moneyFormat }} \u20BD</div>\n @if (history$ | async; as history) {\n @if (range$ | async; as range) {\n <div class=\"relative h-56 w-full p-5 text-tui-primary\">\n @let labels = computeLabels(range);\n <tui-axes\n class=\"h-full\"\n [axisXLabels]=\"labels\"\n [horizontalLines]=\"5\"\n [verticalLines]=\"labels.length + 1\"\n >\n @let height = priceInfo.max - priceInfo.min;\n @if ((height / 100) * paddingPercent; as padding) {\n <tui-line-days-chart\n [height]=\"height + (height / 100) * paddingPercent * 2\"\n [smoothingFactor]=\"10\"\n [y]=\"priceInfo.min - (height / 100) * paddingPercent\"\n [value]=\"computeValue(range, history)\"\n [xStringify]=\"xStringify\"\n [yStringify]=\"yStringify\"\n [hintContent]=\"hint\"\n class=\"chart\"\n ></tui-line-days-chart>\n }\n </tui-axes>\n </div>\n }\n }\n } @else {\n <p class=\"text-base font-bold\">\u0426\u0435\u043D\u0430 \u043D\u0430 \u0442\u043E\u0432\u0430\u0440 \u043D\u0435 \u0438\u0437\u043C\u0435\u043D\u044F\u043B\u0430\u0441\u044C</p>\n }\n <ng-template\n #hint\n let-data\n >\n <div class=\"font-bold\">{{ data[1] | tuiFormatNumber: moneyFormat }} \u20BD</div>\n <div>{{ data[0] }}</div>\n </ng-template>\n </div>\n}\n" }]
|
|
4543
4943
|
}], ctorParameters: () => [], propDecorators: { product: [{
|
|
4544
4944
|
type: Input
|
|
4545
4945
|
}], computeLabels: [], computeValue: [] } });
|
|
@@ -5103,6 +5503,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
|
|
|
5103
5503
|
*/
|
|
5104
5504
|
class ScSandwichComponent {
|
|
5105
5505
|
constructor() {
|
|
5506
|
+
/**
|
|
5507
|
+
* Настройки вывода сумм в рублях.
|
|
5508
|
+
*/
|
|
5509
|
+
this.moneyFormat = ScNumberHelper.getMoneyFormat();
|
|
5106
5510
|
/**
|
|
5107
5511
|
* Данные настроек окружения.
|
|
5108
5512
|
*/
|
|
@@ -5306,7 +5710,7 @@ class ScSandwichComponent {
|
|
|
5306
5710
|
return 0;
|
|
5307
5711
|
}
|
|
5308
5712
|
const totalCost = calculateResult.quantity * this.product.value.costRub;
|
|
5309
|
-
return
|
|
5713
|
+
return ScNumberHelper.roundMoney(totalCost);
|
|
5310
5714
|
}
|
|
5311
5715
|
/**
|
|
5312
5716
|
* Обработчик добавления/редактирования продукта в корзине.
|
|
@@ -5421,11 +5825,12 @@ class ScSandwichComponent {
|
|
|
5421
5825
|
stringify: signal((x) => x.name),
|
|
5422
5826
|
identityMatcher: signal((a, b) => a.id === b.id),
|
|
5423
5827
|
}),
|
|
5424
|
-
], ngImport: i0, template: "@if (!orderItem() && settings()?.allowShowTable) {\n <div class=\"mb-5 flex justify-center\">\n <button\n tuiButton\n appearance=\"secondary\"\n (click)=\"toggleShowEvent.emit()\"\n type=\"button\"\n iconStart=\"@tui.layout-list\"\n >\n \u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0432 \u0432\u0438\u0434\u0435 \u0441\u043F\u0438\u0441\u043A\u0430\n </button>\n </div>\n}\n<div>\n @let calculateResult = calculateResult$ | async;\n @let products = products$ | async;\n @let productValue = product.value;\n @let validatorWidth = validatorWidth$ | async;\n @let validatorLength = validatorLength$ | async;\n\n <form\n [formGroup]=\"form\"\n (ngSubmit)=\"onSubmit(calculateResult)\"\n ScNextInputFocus\n class=\"flex flex-col gap-3\"\n >\n <label\n tuiLabel\n class=\"grow\"\n >\n \u0422\u043E\u0432\u0430\u0440\n <tui-textfield\n tuiChevron\n [tuiTextfieldCleaner]=\"false\"\n >\n <input\n tuiChevron\n tuiSelect\n [formControl]=\"product\"\n placeholder=\"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B\"\n />\n\n <tui-data-list-wrapper\n *tuiDropdown\n new\n [items]=\"products\"\n />\n </tui-textfield>\n <tui-error [formControl]=\"product\" />\n </label>\n\n @if (productValue && productValue.costRub) {\n <div class=\"-mt-1 text-sm text-tui-text-secondary\">\n <span class=\"font-bold\">{{ productValue.code }}</span>\n \u2014 {{ productValue.costRub.toLocaleString() }} {{ productValue.currency.symbol }}/\u0448\u0442.\n </div>\n }\n\n @if (product.value && validatorWidth && validatorLength) {\n <div class=\"mt-4 flex flex-col gap-1.5\">\n <div class=\"w-full font-bold\">\u0420\u0430\u0437\u043C\u0435\u0440\u044B \u0438\u0437\u0434\u0435\u043B\u0438\u0439</div>\n <div class=\"flex flex-col gap-1 text-sm text-tui-text-secondary\">\n @if (widthRangeText()) {\n <div>\u0428\u0438\u0440\u0438\u043D\u0430 {{ widthRangeText() }}.</div>\n }\n @if (lengthRangeText()) {\n <div>\u0414\u043B\u0438\u043D\u0430 {{ lengthRangeText() }}.</div>\n }\n </div>\n </div>\n } @else if (product.value) {\n <tui-error error=\"\u0420\u0430\u0441\u0447\u0435\u0442 \u043F\u043E \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0443 \u043D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u0435\u043D. \u041E\u0431\u0440\u0430\u0442\u0438\u0442\u0435\u0441\u044C \u043A \u043C\u0435\u043D\u0435\u0434\u0436\u0435\u0440\u0443\" />\n }\n\n <div\n formArrayName=\"items\"\n class=\"flex flex-col gap-3\"\n >\n @for (item of items.controls; track item) {\n <div\n class=\"flex grow gap-2\"\n [formGroupName]=\"$index\"\n >\n <div class=\"grid grow grid-cols-1 items-start gap-2 sm:grid-cols-3\">\n <label tuiLabel>\n \u0428\u0438\u0440\u0438\u043D\u0430, \u043C\u043C\n <tui-textfield>\n <input\n tuiInputSlider\n formControlName=\"width\"\n [min]=\"settings()?.minWidth ?? 0\"\n [max]=\"product.value?.properties?.width ?? 0\"\n [tuiNumberFormat]=\"{ precision: 0 }\"\n [readOnly]=\"!product.value\"\n placeholder=\"\u0428\u0438\u0440\u0438\u043D\u0430\"\n autocomplete=\"off\"\n />\n @if (product.value) {\n <input\n tuiSlider\n type=\"range\"\n />\n }\n </tui-textfield>\n @if (product.value) {\n <div class=\"slider-ticks-labels\">\n <span> 0 </span>\n <span>{{ product.value.properties?.width }}</span>\n </div>\n }\n <tui-error formControlName=\"width\" />\n </label>\n\n <label tuiLabel>\n \u0414\u043B\u0438\u043D\u0430, \u043C\u043C\n <tui-textfield>\n <input\n tuiInputSlider\n formControlName=\"length\"\n [min]=\"settings()?.minLength ?? 0\"\n [max]=\"product.value?.properties?.length ?? 0\"\n [tuiNumberFormat]=\"{ precision: 0 }\"\n [readOnly]=\"!product.value\"\n placeholder=\"\u0414\u043B\u0438\u043D\u0430\"\n autocomplete=\"off\"\n />\n @if (product.value) {\n <input\n tuiSlider\n type=\"range\"\n />\n }\n </tui-textfield>\n @if (product.value) {\n <div class=\"slider-ticks-labels\">\n <span> 0 </span>\n <span>{{ product.value.properties?.length }}</span>\n </div>\n }\n <tui-error formControlName=\"length\" />\n </label>\n <label tuiLabel>\n <span class=\"whitespace-nowrap\">\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E, \u0448\u0442</span>\n <tui-textfield [tuiTextfieldCleaner]=\"false\">\n <input\n tuiInputNumber\n formControlName=\"count\"\n [min]=\"1\"\n [tuiNumberFormat]=\"{ precision: 0 }\"\n [readOnly]=\"!product.value\"\n placeholder=\"\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E\"\n autocomplete=\"off\"\n />\n </tui-textfield>\n <tui-error formControlName=\"count\" />\n </label>\n </div>\n <button\n tuiIconButton\n (click)=\"removeItem($index)\"\n [disabled]=\"!product.value || items.length <= 1\"\n size=\"m\"\n type=\"button\"\n appearance=\"secondary\"\n class=\"mt-6\"\n [style.flex]=\"'0 0 auto'\"\n >\n <tui-icon icon=\"@tui.trash-2\" />\n </button>\n </div>\n }\n </div>\n @if (product.value) {\n <button\n tuiButton\n appearance=\"secondary\"\n [disabled]=\"items.invalid\"\n (click)=\"addItem()\"\n type=\"button\"\n class=\"self-center\"\n iconStart=\"@tui.plus\"\n >\n \u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0438\u0437\u0434\u0435\u043B\u0438\u0435\n </button>\n }\n\n <label tuiLabel>\n \u041C\u0430\u0440\u043A\u0438\u0440\u043E\u0432\u043A\u0430 \u0440\u0430\u0441\u043F\u0438\u043B\u0430\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"marker\"\n placeholder=\"\u041C\u0430\u0440\u043A\u0438\u0440\u043E\u0432\u043A\u0430 \u0440\u0430\u0441\u043F\u0438\u043B\u0430\"\n autocomplete=\"marker\"\n />\n </tui-textfield>\n\n <tui-error formControlName=\"marker\" />\n </label>\n\n @if (product.value) {\n <tui-loader [loading]=\"isCalculateLoading()\">\n @if (calculateResult) {\n <div class=\"mt-2 flex flex-wrap items-end gap-2\">\n <div>\n \u0418\u0442\u043E\u0433\u043E: <span class=\"whitespace-nowrap text-xl font-bold\">{{ getTotalCost(calculateResult).toLocaleString() }} {{ product.value.currency.symbol }}</span>\n </div>\n @if (calculateResult?.quantity && productValue) {\n <div class=\"whitespace-nowrap text-lg text-sc-dark-grey\">\n <span class=\"font-bold\">({{ calculateResult.quantity }} \u0448\u0442.</span> x\n <span class=\"font-bold\">{{ productValue.costRub?.toLocaleString() }} {{ productValue.currency.symbol }}/\u0448\u0442.)</span>\n </div>\n }\n </div>\n }\n </tui-loader>\n }\n\n <tui-error [formGroup]=\"form\" />\n @if (!calculateResult) {\n <button\n tuiButton\n appearance=\"secondary\"\n [disabled]=\"items.invalid || isCalculateLoading()\"\n (click)=\"triggerCalculate()\"\n type=\"button\"\n class=\"self-center\"\n iconStart=\"@tui.calculator\"\n >\n \u0420\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0442\u044C\n </button>\n } @else {\n <button\n [disabled]=\"form.invalid || isSubmitLoading()\"\n [loading]=\"isSubmitLoading()\"\n tuiButton\n class=\"self-center\"\n iconStart=\"@tui.check\"\n >\n {{ !orderItem() ? '\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0432 \u043A\u043E\u0440\u0437\u0438\u043D\u0443' : '\u0418\u0437\u043C\u0435\u043D\u0438\u0442\u044C' }}\n </button>\n }\n </form>\n</div>\n", styles: [":host{display:block;width:100%;max-width:30rem}.slider-ticks-labels{--t-offset: $thumb-radius;display:flex;font:var(--tui-typography-body-s);color:var(--tui-text-secondary);margin:.25rem var(--t-offset) 0}.slider-ticks-labels>*{position:relative;flex:2;text-align:center}.slider-ticks-labels>*:first-child{inset-inline-start:calc(-1 * var(--t-offset));flex:1;text-align:start}.slider-ticks-labels>*:last-child{inset-inline-end:calc(-1 * var(--t-offset));flex:1;text-align:end}tui-range+.slider-ticks-labels{--t-offset: $thumb-diameter}tui-textfield[data-size=l]+.slider-ticks-labels{--t-offset: calc(map-get($track-inset, \"l\") + $thumb-radius)}tui-textfield[data-size=m]+.slider-ticks-labels{--t-offset: calc(map-get($track-inset, \"m\") + $thumb-radius)}tui-textfield[data-size=s]+.slider-ticks-labels{--t-offset: calc(map-get($track-inset, \"s\") + $thumb-radius)}tui-input-range[data-size=l]+.slider-ticks-labels{--t-offset: calc(map-get($track-inset, \"l\") + $thumb-diameter)}tui-input-range[data-size=m]+.slider-ticks-labels{--t-offset: calc(map-get($track-inset, \"m\") + $thumb-diameter)}tui-input-range[data-size=s]+.slider-ticks-labels{--t-offset: calc(map-get($track-inset, \"s\") + $thumb-diameter)}.slider-ticks-labels{color:var(--tui-text-secondary)}\n"], dependencies: [{ kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: TuiIcon, selector: "tui-icon:not([tuiBadge])", inputs: ["background"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: ScNextInputFocusDirective, selector: "form[ScNextInputFocus]" }, { kind: "directive", type: TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: TuiDataListWrapperComponent, selector: "tui-data-list-wrapper:not([labels])", inputs: ["items", "emptyContent", "size", "itemContent"], outputs: ["itemClick"] }, { kind: "component", type: i2.TuiErrorComponent, selector: "tui-error", inputs: ["error"] }, { kind: "directive", type: i2.TuiErrorDirective, selector: "tui-error[ngModel], tui-error[formControlName], tui-error[formControl], tui-error[formGroup], tui-error[formGroupName], tui-error[formArrayName], tui-error[formArray]", inputs: ["order"] }, { kind: "component", type: i3$1.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler"] }, { kind: "directive", type: i3$1.TuiTextfieldOptionsDirective, selector: "[tuiTextfieldAppearance],[tuiTextfieldSize],[tuiTextfieldCleaner]", inputs: ["tuiTextfieldAppearance", "tuiTextfieldSize", "tuiTextfieldCleaner"] }, { kind: "directive", type: i3.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { kind: "directive", type: i2.TuiInputDirective, selector: "input[tuiInput]", inputs: ["readOnly", "invalid", "focused", "state"] }, { kind: "directive", type: TuiChevron, selector: "[tuiChevron]", inputs: ["tuiChevron"] }, { kind: "directive", type: i1$1.TuiSelectDirective, selector: "input[tuiSelect]" }, { kind: "directive", type: i1$1.TuiInputNumberDirective, selector: "input[tuiInputNumber]" }, { kind: "directive", type: TuiNumberFormat, selector: "[tuiNumberFormat]", inputs: ["tuiNumberFormat"] }, { kind: "component", type: i6.TuiSliderComponent, selector: "input[type=range][tuiSlider]", inputs: ["segments"] }, { kind: "directive", type: i1$1.TuiInputSliderDirective, selector: "input[tuiInputSlider]" }, { kind: "directive", type: ScSelectOnFocusinDirective, selector: "tui-input-number, tui-input, tui-input-phone, tui-input-date, tui-input-password, input[tuiInput], input[tuiInputNumber], input[tuiTextfield], input[tuiInputSlider]" }, { kind: "component", type: TuiLoader, selector: "tui-loader", inputs: ["size", "inheritColor", "overlay", "textContent", "loading"] }, { kind: "component", type: TuiButtonLoading, selector: "[tuiButton][loading],[tuiIconButton][loading]", inputs: ["size", "loading"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5828
|
+
], ngImport: i0, template: "@if (!orderItem() && settings()?.allowShowTable) {\n <div class=\"mb-5 flex justify-center\">\n <button\n tuiButton\n appearance=\"secondary\"\n (click)=\"toggleShowEvent.emit()\"\n type=\"button\"\n iconStart=\"@tui.layout-list\"\n >\n \u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0432 \u0432\u0438\u0434\u0435 \u0441\u043F\u0438\u0441\u043A\u0430\n </button>\n </div>\n}\n<div>\n @let calculateResult = calculateResult$ | async;\n @let products = products$ | async;\n @let productValue = product.value;\n @let validatorWidth = validatorWidth$ | async;\n @let validatorLength = validatorLength$ | async;\n\n <form\n [formGroup]=\"form\"\n (ngSubmit)=\"onSubmit(calculateResult)\"\n ScNextInputFocus\n class=\"flex flex-col gap-3\"\n >\n <label\n tuiLabel\n class=\"grow\"\n >\n \u0422\u043E\u0432\u0430\u0440\n <tui-textfield\n tuiChevron\n [tuiTextfieldCleaner]=\"false\"\n >\n <input\n tuiChevron\n tuiSelect\n [formControl]=\"product\"\n placeholder=\"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B\"\n />\n\n <tui-data-list-wrapper\n *tuiDropdown\n new\n [items]=\"products\"\n />\n </tui-textfield>\n <tui-error [formControl]=\"product\" />\n </label>\n\n @if (productValue && productValue.costRub) {\n <div class=\"-mt-1 text-sm text-tui-text-secondary\">\n <span class=\"font-bold\">{{ productValue.code }}</span>\n \u2014 {{ productValue.costRub | tuiFormatNumber: moneyFormat }} {{ productValue.currency.symbol }}/\u0448\u0442.\n </div>\n }\n\n @if (product.value && validatorWidth && validatorLength) {\n <div class=\"mt-4 flex flex-col gap-1.5\">\n <div class=\"w-full font-bold\">\u0420\u0430\u0437\u043C\u0435\u0440\u044B \u0438\u0437\u0434\u0435\u043B\u0438\u0439</div>\n <div class=\"flex flex-col gap-1 text-sm text-tui-text-secondary\">\n @if (widthRangeText()) {\n <div>\u0428\u0438\u0440\u0438\u043D\u0430 {{ widthRangeText() }}.</div>\n }\n @if (lengthRangeText()) {\n <div>\u0414\u043B\u0438\u043D\u0430 {{ lengthRangeText() }}.</div>\n }\n </div>\n </div>\n } @else if (product.value) {\n <tui-error error=\"\u0420\u0430\u0441\u0447\u0435\u0442 \u043F\u043E \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0443 \u043D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u0435\u043D. \u041E\u0431\u0440\u0430\u0442\u0438\u0442\u0435\u0441\u044C \u043A \u043C\u0435\u043D\u0435\u0434\u0436\u0435\u0440\u0443\" />\n }\n\n <div\n formArrayName=\"items\"\n class=\"flex flex-col gap-3\"\n >\n @for (item of items.controls; track item) {\n <div\n class=\"flex grow gap-2\"\n [formGroupName]=\"$index\"\n >\n <div class=\"grid grow grid-cols-1 items-start gap-2 sm:grid-cols-3\">\n <label tuiLabel>\n \u0428\u0438\u0440\u0438\u043D\u0430, \u043C\u043C\n <tui-textfield>\n <input\n tuiInputSlider\n formControlName=\"width\"\n [min]=\"settings()?.minWidth ?? 0\"\n [max]=\"product.value?.properties?.width ?? 0\"\n [tuiNumberFormat]=\"{ precision: 0 }\"\n [readOnly]=\"!product.value\"\n placeholder=\"\u0428\u0438\u0440\u0438\u043D\u0430\"\n autocomplete=\"off\"\n />\n @if (product.value) {\n <input\n tuiSlider\n type=\"range\"\n />\n }\n </tui-textfield>\n @if (product.value) {\n <div class=\"slider-ticks-labels\">\n <span> 0 </span>\n <span>{{ product.value.properties?.width }}</span>\n </div>\n }\n <tui-error formControlName=\"width\" />\n </label>\n\n <label tuiLabel>\n \u0414\u043B\u0438\u043D\u0430, \u043C\u043C\n <tui-textfield>\n <input\n tuiInputSlider\n formControlName=\"length\"\n [min]=\"settings()?.minLength ?? 0\"\n [max]=\"product.value?.properties?.length ?? 0\"\n [tuiNumberFormat]=\"{ precision: 0 }\"\n [readOnly]=\"!product.value\"\n placeholder=\"\u0414\u043B\u0438\u043D\u0430\"\n autocomplete=\"off\"\n />\n @if (product.value) {\n <input\n tuiSlider\n type=\"range\"\n />\n }\n </tui-textfield>\n @if (product.value) {\n <div class=\"slider-ticks-labels\">\n <span> 0 </span>\n <span>{{ product.value.properties?.length }}</span>\n </div>\n }\n <tui-error formControlName=\"length\" />\n </label>\n <label tuiLabel>\n <span class=\"whitespace-nowrap\">\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E, \u0448\u0442</span>\n <tui-textfield [tuiTextfieldCleaner]=\"false\">\n <input\n tuiInputNumber\n formControlName=\"count\"\n [min]=\"1\"\n [tuiNumberFormat]=\"{ precision: 0 }\"\n [readOnly]=\"!product.value\"\n placeholder=\"\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E\"\n autocomplete=\"off\"\n />\n </tui-textfield>\n <tui-error formControlName=\"count\" />\n </label>\n </div>\n <button\n tuiIconButton\n (click)=\"removeItem($index)\"\n [disabled]=\"!product.value || items.length <= 1\"\n size=\"m\"\n type=\"button\"\n appearance=\"secondary\"\n class=\"mt-6\"\n [style.flex]=\"'0 0 auto'\"\n >\n <tui-icon icon=\"@tui.trash-2\" />\n </button>\n </div>\n }\n </div>\n @if (product.value) {\n <button\n tuiButton\n appearance=\"secondary\"\n [disabled]=\"items.invalid\"\n (click)=\"addItem()\"\n type=\"button\"\n class=\"self-center\"\n iconStart=\"@tui.plus\"\n >\n \u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0438\u0437\u0434\u0435\u043B\u0438\u0435\n </button>\n }\n\n <label tuiLabel>\n \u041C\u0430\u0440\u043A\u0438\u0440\u043E\u0432\u043A\u0430 \u0440\u0430\u0441\u043F\u0438\u043B\u0430\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"marker\"\n placeholder=\"\u041C\u0430\u0440\u043A\u0438\u0440\u043E\u0432\u043A\u0430 \u0440\u0430\u0441\u043F\u0438\u043B\u0430\"\n autocomplete=\"marker\"\n />\n </tui-textfield>\n\n <tui-error formControlName=\"marker\" />\n </label>\n\n @if (product.value) {\n <tui-loader [loading]=\"isCalculateLoading()\">\n @if (calculateResult) {\n <div class=\"mt-2 flex flex-wrap items-end gap-2\">\n <div>\n \u0418\u0442\u043E\u0433\u043E:\n <span class=\"whitespace-nowrap text-xl font-bold\"\n >{{ getTotalCost(calculateResult) | tuiFormatNumber: moneyFormat }} {{ product.value.currency.symbol }}</span\n >\n </div>\n @if (calculateResult?.quantity && productValue) {\n <div class=\"whitespace-nowrap text-lg text-sc-dark-grey\">\n <span class=\"font-bold\">({{ calculateResult.quantity }} \u0448\u0442.</span> x\n <span class=\"font-bold\"\n >{{ productValue.costRub === undefined ? '' : (productValue.costRub | tuiFormatNumber: moneyFormat) }}\n {{ productValue.currency.symbol }}/\u0448\u0442.)</span\n >\n </div>\n }\n </div>\n }\n </tui-loader>\n }\n\n <tui-error [formGroup]=\"form\" />\n @if (!calculateResult) {\n <button\n tuiButton\n appearance=\"secondary\"\n [disabled]=\"items.invalid || isCalculateLoading()\"\n (click)=\"triggerCalculate()\"\n type=\"button\"\n class=\"self-center\"\n iconStart=\"@tui.calculator\"\n >\n \u0420\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0442\u044C\n </button>\n } @else {\n <button\n [disabled]=\"form.invalid || isSubmitLoading()\"\n [loading]=\"isSubmitLoading()\"\n tuiButton\n class=\"self-center\"\n iconStart=\"@tui.check\"\n >\n {{ !orderItem() ? '\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0432 \u043A\u043E\u0440\u0437\u0438\u043D\u0443' : '\u0418\u0437\u043C\u0435\u043D\u0438\u0442\u044C' }}\n </button>\n }\n </form>\n</div>\n", styles: [":host{display:block;width:100%;max-width:30rem}.slider-ticks-labels{--t-offset: $thumb-radius;display:flex;font:var(--tui-typography-body-s);color:var(--tui-text-secondary);margin:.25rem var(--t-offset) 0}.slider-ticks-labels>*{position:relative;flex:2;text-align:center}.slider-ticks-labels>*:first-child{inset-inline-start:calc(-1 * var(--t-offset));flex:1;text-align:start}.slider-ticks-labels>*:last-child{inset-inline-end:calc(-1 * var(--t-offset));flex:1;text-align:end}tui-range+.slider-ticks-labels{--t-offset: $thumb-diameter}tui-textfield[data-size=l]+.slider-ticks-labels{--t-offset: calc(map-get($track-inset, \"l\") + $thumb-radius)}tui-textfield[data-size=m]+.slider-ticks-labels{--t-offset: calc(map-get($track-inset, \"m\") + $thumb-radius)}tui-textfield[data-size=s]+.slider-ticks-labels{--t-offset: calc(map-get($track-inset, \"s\") + $thumb-radius)}tui-input-range[data-size=l]+.slider-ticks-labels{--t-offset: calc(map-get($track-inset, \"l\") + $thumb-diameter)}tui-input-range[data-size=m]+.slider-ticks-labels{--t-offset: calc(map-get($track-inset, \"m\") + $thumb-diameter)}tui-input-range[data-size=s]+.slider-ticks-labels{--t-offset: calc(map-get($track-inset, \"s\") + $thumb-diameter)}.slider-ticks-labels{color:var(--tui-text-secondary)}\n"], dependencies: [{ kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: TuiIcon, selector: "tui-icon:not([tuiBadge])", inputs: ["background"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: ScNextInputFocusDirective, selector: "form[ScNextInputFocus]" }, { kind: "directive", type: TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: TuiDataListWrapperComponent, selector: "tui-data-list-wrapper:not([labels])", inputs: ["items", "emptyContent", "size", "itemContent"], outputs: ["itemClick"] }, { kind: "component", type: i2.TuiErrorComponent, selector: "tui-error", inputs: ["error"] }, { kind: "directive", type: i2.TuiErrorDirective, selector: "tui-error[ngModel], tui-error[formControlName], tui-error[formControl], tui-error[formGroup], tui-error[formGroupName], tui-error[formArrayName], tui-error[formArray]", inputs: ["order"] }, { kind: "component", type: i3$1.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler"] }, { kind: "directive", type: i3$1.TuiTextfieldOptionsDirective, selector: "[tuiTextfieldAppearance],[tuiTextfieldSize],[tuiTextfieldCleaner]", inputs: ["tuiTextfieldAppearance", "tuiTextfieldSize", "tuiTextfieldCleaner"] }, { kind: "directive", type: i3.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { kind: "directive", type: i2.TuiInputDirective, selector: "input[tuiInput]", inputs: ["readOnly", "invalid", "focused", "state"] }, { kind: "directive", type: TuiChevron, selector: "[tuiChevron]", inputs: ["tuiChevron"] }, { kind: "directive", type: i1$1.TuiSelectDirective, selector: "input[tuiSelect]" }, { kind: "directive", type: i1$1.TuiInputNumberDirective, selector: "input[tuiInputNumber]" }, { kind: "directive", type: TuiNumberFormat, selector: "[tuiNumberFormat]", inputs: ["tuiNumberFormat"] }, { kind: "component", type: i6.TuiSliderComponent, selector: "input[type=range][tuiSlider]", inputs: ["segments"] }, { kind: "directive", type: i1$1.TuiInputSliderDirective, selector: "input[tuiInputSlider]" }, { kind: "directive", type: ScSelectOnFocusinDirective, selector: "tui-input-number, tui-input, tui-input-phone, tui-input-date, tui-input-password, input[tuiInput], input[tuiInputNumber], input[tuiTextfield], input[tuiInputSlider]" }, { kind: "component", type: TuiLoader, selector: "tui-loader", inputs: ["size", "inheritColor", "overlay", "textContent", "loading"] }, { kind: "component", type: TuiButtonLoading, selector: "[tuiButton][loading],[tuiIconButton][loading]", inputs: ["size", "loading"] }, { kind: "pipe", type: TuiFormatNumberPipe, name: "tuiFormatNumber" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5425
5829
|
}
|
|
5426
5830
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScSandwichComponent, decorators: [{
|
|
5427
5831
|
type: Component,
|
|
5428
5832
|
args: [{ standalone: true, selector: 'sc-sandwich', imports: [
|
|
5833
|
+
TuiFormatNumberPipe,
|
|
5429
5834
|
TuiButton,
|
|
5430
5835
|
TuiIcon,
|
|
5431
5836
|
FormsModule,
|
|
@@ -5453,7 +5858,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
|
|
|
5453
5858
|
stringify: signal((x) => x.name),
|
|
5454
5859
|
identityMatcher: signal((a, b) => a.id === b.id),
|
|
5455
5860
|
}),
|
|
5456
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (!orderItem() && settings()?.allowShowTable) {\n <div class=\"mb-5 flex justify-center\">\n <button\n tuiButton\n appearance=\"secondary\"\n (click)=\"toggleShowEvent.emit()\"\n type=\"button\"\n iconStart=\"@tui.layout-list\"\n >\n \u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0432 \u0432\u0438\u0434\u0435 \u0441\u043F\u0438\u0441\u043A\u0430\n </button>\n </div>\n}\n<div>\n @let calculateResult = calculateResult$ | async;\n @let products = products$ | async;\n @let productValue = product.value;\n @let validatorWidth = validatorWidth$ | async;\n @let validatorLength = validatorLength$ | async;\n\n <form\n [formGroup]=\"form\"\n (ngSubmit)=\"onSubmit(calculateResult)\"\n ScNextInputFocus\n class=\"flex flex-col gap-3\"\n >\n <label\n tuiLabel\n class=\"grow\"\n >\n \u0422\u043E\u0432\u0430\u0440\n <tui-textfield\n tuiChevron\n [tuiTextfieldCleaner]=\"false\"\n >\n <input\n tuiChevron\n tuiSelect\n [formControl]=\"product\"\n placeholder=\"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B\"\n />\n\n <tui-data-list-wrapper\n *tuiDropdown\n new\n [items]=\"products\"\n />\n </tui-textfield>\n <tui-error [formControl]=\"product\" />\n </label>\n\n @if (productValue && productValue.costRub) {\n <div class=\"-mt-1 text-sm text-tui-text-secondary\">\n <span class=\"font-bold\">{{ productValue.code }}</span>\n \u2014 {{ productValue.costRub.toLocaleString() }} {{ productValue.currency.symbol }}/\u0448\u0442.\n </div>\n }\n\n @if (product.value && validatorWidth && validatorLength) {\n <div class=\"mt-4 flex flex-col gap-1.5\">\n <div class=\"w-full font-bold\">\u0420\u0430\u0437\u043C\u0435\u0440\u044B \u0438\u0437\u0434\u0435\u043B\u0438\u0439</div>\n <div class=\"flex flex-col gap-1 text-sm text-tui-text-secondary\">\n @if (widthRangeText()) {\n <div>\u0428\u0438\u0440\u0438\u043D\u0430 {{ widthRangeText() }}.</div>\n }\n @if (lengthRangeText()) {\n <div>\u0414\u043B\u0438\u043D\u0430 {{ lengthRangeText() }}.</div>\n }\n </div>\n </div>\n } @else if (product.value) {\n <tui-error error=\"\u0420\u0430\u0441\u0447\u0435\u0442 \u043F\u043E \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0443 \u043D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u0435\u043D. \u041E\u0431\u0440\u0430\u0442\u0438\u0442\u0435\u0441\u044C \u043A \u043C\u0435\u043D\u0435\u0434\u0436\u0435\u0440\u0443\" />\n }\n\n <div\n formArrayName=\"items\"\n class=\"flex flex-col gap-3\"\n >\n @for (item of items.controls; track item) {\n <div\n class=\"flex grow gap-2\"\n [formGroupName]=\"$index\"\n >\n <div class=\"grid grow grid-cols-1 items-start gap-2 sm:grid-cols-3\">\n <label tuiLabel>\n \u0428\u0438\u0440\u0438\u043D\u0430, \u043C\u043C\n <tui-textfield>\n <input\n tuiInputSlider\n formControlName=\"width\"\n [min]=\"settings()?.minWidth ?? 0\"\n [max]=\"product.value?.properties?.width ?? 0\"\n [tuiNumberFormat]=\"{ precision: 0 }\"\n [readOnly]=\"!product.value\"\n placeholder=\"\u0428\u0438\u0440\u0438\u043D\u0430\"\n autocomplete=\"off\"\n />\n @if (product.value) {\n <input\n tuiSlider\n type=\"range\"\n />\n }\n </tui-textfield>\n @if (product.value) {\n <div class=\"slider-ticks-labels\">\n <span> 0 </span>\n <span>{{ product.value.properties?.width }}</span>\n </div>\n }\n <tui-error formControlName=\"width\" />\n </label>\n\n <label tuiLabel>\n \u0414\u043B\u0438\u043D\u0430, \u043C\u043C\n <tui-textfield>\n <input\n tuiInputSlider\n formControlName=\"length\"\n [min]=\"settings()?.minLength ?? 0\"\n [max]=\"product.value?.properties?.length ?? 0\"\n [tuiNumberFormat]=\"{ precision: 0 }\"\n [readOnly]=\"!product.value\"\n placeholder=\"\u0414\u043B\u0438\u043D\u0430\"\n autocomplete=\"off\"\n />\n @if (product.value) {\n <input\n tuiSlider\n type=\"range\"\n />\n }\n </tui-textfield>\n @if (product.value) {\n <div class=\"slider-ticks-labels\">\n <span> 0 </span>\n <span>{{ product.value.properties?.length }}</span>\n </div>\n }\n <tui-error formControlName=\"length\" />\n </label>\n <label tuiLabel>\n <span class=\"whitespace-nowrap\">\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E, \u0448\u0442</span>\n <tui-textfield [tuiTextfieldCleaner]=\"false\">\n <input\n tuiInputNumber\n formControlName=\"count\"\n [min]=\"1\"\n [tuiNumberFormat]=\"{ precision: 0 }\"\n [readOnly]=\"!product.value\"\n placeholder=\"\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E\"\n autocomplete=\"off\"\n />\n </tui-textfield>\n <tui-error formControlName=\"count\" />\n </label>\n </div>\n <button\n tuiIconButton\n (click)=\"removeItem($index)\"\n [disabled]=\"!product.value || items.length <= 1\"\n size=\"m\"\n type=\"button\"\n appearance=\"secondary\"\n class=\"mt-6\"\n [style.flex]=\"'0 0 auto'\"\n >\n <tui-icon icon=\"@tui.trash-2\" />\n </button>\n </div>\n }\n </div>\n @if (product.value) {\n <button\n tuiButton\n appearance=\"secondary\"\n [disabled]=\"items.invalid\"\n (click)=\"addItem()\"\n type=\"button\"\n class=\"self-center\"\n iconStart=\"@tui.plus\"\n >\n \u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0438\u0437\u0434\u0435\u043B\u0438\u0435\n </button>\n }\n\n <label tuiLabel>\n \u041C\u0430\u0440\u043A\u0438\u0440\u043E\u0432\u043A\u0430 \u0440\u0430\u0441\u043F\u0438\u043B\u0430\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"marker\"\n placeholder=\"\u041C\u0430\u0440\u043A\u0438\u0440\u043E\u0432\u043A\u0430 \u0440\u0430\u0441\u043F\u0438\u043B\u0430\"\n autocomplete=\"marker\"\n />\n </tui-textfield>\n\n <tui-error formControlName=\"marker\" />\n </label>\n\n @if (product.value) {\n <tui-loader [loading]=\"isCalculateLoading()\">\n @if (calculateResult) {\n <div class=\"mt-2 flex flex-wrap items-end gap-2\">\n <div>\n \u0418\u0442\u043E\u0433\u043E: <span class=\"whitespace-nowrap text-xl font-bold\">{{ getTotalCost(calculateResult).toLocaleString() }} {{ product.value.currency.symbol }}</span>\n </div>\n @if (calculateResult?.quantity && productValue) {\n <div class=\"whitespace-nowrap text-lg text-sc-dark-grey\">\n <span class=\"font-bold\">({{ calculateResult.quantity }} \u0448\u0442.</span> x\n <span class=\"font-bold\">{{ productValue.costRub?.toLocaleString() }} {{ productValue.currency.symbol }}/\u0448\u0442.)</span>\n </div>\n }\n </div>\n }\n </tui-loader>\n }\n\n <tui-error [formGroup]=\"form\" />\n @if (!calculateResult) {\n <button\n tuiButton\n appearance=\"secondary\"\n [disabled]=\"items.invalid || isCalculateLoading()\"\n (click)=\"triggerCalculate()\"\n type=\"button\"\n class=\"self-center\"\n iconStart=\"@tui.calculator\"\n >\n \u0420\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0442\u044C\n </button>\n } @else {\n <button\n [disabled]=\"form.invalid || isSubmitLoading()\"\n [loading]=\"isSubmitLoading()\"\n tuiButton\n class=\"self-center\"\n iconStart=\"@tui.check\"\n >\n {{ !orderItem() ? '\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0432 \u043A\u043E\u0440\u0437\u0438\u043D\u0443' : '\u0418\u0437\u043C\u0435\u043D\u0438\u0442\u044C' }}\n </button>\n }\n </form>\n</div>\n", styles: [":host{display:block;width:100%;max-width:30rem}.slider-ticks-labels{--t-offset: $thumb-radius;display:flex;font:var(--tui-typography-body-s);color:var(--tui-text-secondary);margin:.25rem var(--t-offset) 0}.slider-ticks-labels>*{position:relative;flex:2;text-align:center}.slider-ticks-labels>*:first-child{inset-inline-start:calc(-1 * var(--t-offset));flex:1;text-align:start}.slider-ticks-labels>*:last-child{inset-inline-end:calc(-1 * var(--t-offset));flex:1;text-align:end}tui-range+.slider-ticks-labels{--t-offset: $thumb-diameter}tui-textfield[data-size=l]+.slider-ticks-labels{--t-offset: calc(map-get($track-inset, \"l\") + $thumb-radius)}tui-textfield[data-size=m]+.slider-ticks-labels{--t-offset: calc(map-get($track-inset, \"m\") + $thumb-radius)}tui-textfield[data-size=s]+.slider-ticks-labels{--t-offset: calc(map-get($track-inset, \"s\") + $thumb-radius)}tui-input-range[data-size=l]+.slider-ticks-labels{--t-offset: calc(map-get($track-inset, \"l\") + $thumb-diameter)}tui-input-range[data-size=m]+.slider-ticks-labels{--t-offset: calc(map-get($track-inset, \"m\") + $thumb-diameter)}tui-input-range[data-size=s]+.slider-ticks-labels{--t-offset: calc(map-get($track-inset, \"s\") + $thumb-diameter)}.slider-ticks-labels{color:var(--tui-text-secondary)}\n"] }]
|
|
5861
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (!orderItem() && settings()?.allowShowTable) {\n <div class=\"mb-5 flex justify-center\">\n <button\n tuiButton\n appearance=\"secondary\"\n (click)=\"toggleShowEvent.emit()\"\n type=\"button\"\n iconStart=\"@tui.layout-list\"\n >\n \u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0432 \u0432\u0438\u0434\u0435 \u0441\u043F\u0438\u0441\u043A\u0430\n </button>\n </div>\n}\n<div>\n @let calculateResult = calculateResult$ | async;\n @let products = products$ | async;\n @let productValue = product.value;\n @let validatorWidth = validatorWidth$ | async;\n @let validatorLength = validatorLength$ | async;\n\n <form\n [formGroup]=\"form\"\n (ngSubmit)=\"onSubmit(calculateResult)\"\n ScNextInputFocus\n class=\"flex flex-col gap-3\"\n >\n <label\n tuiLabel\n class=\"grow\"\n >\n \u0422\u043E\u0432\u0430\u0440\n <tui-textfield\n tuiChevron\n [tuiTextfieldCleaner]=\"false\"\n >\n <input\n tuiChevron\n tuiSelect\n [formControl]=\"product\"\n placeholder=\"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B\"\n />\n\n <tui-data-list-wrapper\n *tuiDropdown\n new\n [items]=\"products\"\n />\n </tui-textfield>\n <tui-error [formControl]=\"product\" />\n </label>\n\n @if (productValue && productValue.costRub) {\n <div class=\"-mt-1 text-sm text-tui-text-secondary\">\n <span class=\"font-bold\">{{ productValue.code }}</span>\n \u2014 {{ productValue.costRub | tuiFormatNumber: moneyFormat }} {{ productValue.currency.symbol }}/\u0448\u0442.\n </div>\n }\n\n @if (product.value && validatorWidth && validatorLength) {\n <div class=\"mt-4 flex flex-col gap-1.5\">\n <div class=\"w-full font-bold\">\u0420\u0430\u0437\u043C\u0435\u0440\u044B \u0438\u0437\u0434\u0435\u043B\u0438\u0439</div>\n <div class=\"flex flex-col gap-1 text-sm text-tui-text-secondary\">\n @if (widthRangeText()) {\n <div>\u0428\u0438\u0440\u0438\u043D\u0430 {{ widthRangeText() }}.</div>\n }\n @if (lengthRangeText()) {\n <div>\u0414\u043B\u0438\u043D\u0430 {{ lengthRangeText() }}.</div>\n }\n </div>\n </div>\n } @else if (product.value) {\n <tui-error error=\"\u0420\u0430\u0441\u0447\u0435\u0442 \u043F\u043E \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0443 \u043D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u0435\u043D. \u041E\u0431\u0440\u0430\u0442\u0438\u0442\u0435\u0441\u044C \u043A \u043C\u0435\u043D\u0435\u0434\u0436\u0435\u0440\u0443\" />\n }\n\n <div\n formArrayName=\"items\"\n class=\"flex flex-col gap-3\"\n >\n @for (item of items.controls; track item) {\n <div\n class=\"flex grow gap-2\"\n [formGroupName]=\"$index\"\n >\n <div class=\"grid grow grid-cols-1 items-start gap-2 sm:grid-cols-3\">\n <label tuiLabel>\n \u0428\u0438\u0440\u0438\u043D\u0430, \u043C\u043C\n <tui-textfield>\n <input\n tuiInputSlider\n formControlName=\"width\"\n [min]=\"settings()?.minWidth ?? 0\"\n [max]=\"product.value?.properties?.width ?? 0\"\n [tuiNumberFormat]=\"{ precision: 0 }\"\n [readOnly]=\"!product.value\"\n placeholder=\"\u0428\u0438\u0440\u0438\u043D\u0430\"\n autocomplete=\"off\"\n />\n @if (product.value) {\n <input\n tuiSlider\n type=\"range\"\n />\n }\n </tui-textfield>\n @if (product.value) {\n <div class=\"slider-ticks-labels\">\n <span> 0 </span>\n <span>{{ product.value.properties?.width }}</span>\n </div>\n }\n <tui-error formControlName=\"width\" />\n </label>\n\n <label tuiLabel>\n \u0414\u043B\u0438\u043D\u0430, \u043C\u043C\n <tui-textfield>\n <input\n tuiInputSlider\n formControlName=\"length\"\n [min]=\"settings()?.minLength ?? 0\"\n [max]=\"product.value?.properties?.length ?? 0\"\n [tuiNumberFormat]=\"{ precision: 0 }\"\n [readOnly]=\"!product.value\"\n placeholder=\"\u0414\u043B\u0438\u043D\u0430\"\n autocomplete=\"off\"\n />\n @if (product.value) {\n <input\n tuiSlider\n type=\"range\"\n />\n }\n </tui-textfield>\n @if (product.value) {\n <div class=\"slider-ticks-labels\">\n <span> 0 </span>\n <span>{{ product.value.properties?.length }}</span>\n </div>\n }\n <tui-error formControlName=\"length\" />\n </label>\n <label tuiLabel>\n <span class=\"whitespace-nowrap\">\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E, \u0448\u0442</span>\n <tui-textfield [tuiTextfieldCleaner]=\"false\">\n <input\n tuiInputNumber\n formControlName=\"count\"\n [min]=\"1\"\n [tuiNumberFormat]=\"{ precision: 0 }\"\n [readOnly]=\"!product.value\"\n placeholder=\"\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E\"\n autocomplete=\"off\"\n />\n </tui-textfield>\n <tui-error formControlName=\"count\" />\n </label>\n </div>\n <button\n tuiIconButton\n (click)=\"removeItem($index)\"\n [disabled]=\"!product.value || items.length <= 1\"\n size=\"m\"\n type=\"button\"\n appearance=\"secondary\"\n class=\"mt-6\"\n [style.flex]=\"'0 0 auto'\"\n >\n <tui-icon icon=\"@tui.trash-2\" />\n </button>\n </div>\n }\n </div>\n @if (product.value) {\n <button\n tuiButton\n appearance=\"secondary\"\n [disabled]=\"items.invalid\"\n (click)=\"addItem()\"\n type=\"button\"\n class=\"self-center\"\n iconStart=\"@tui.plus\"\n >\n \u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0438\u0437\u0434\u0435\u043B\u0438\u0435\n </button>\n }\n\n <label tuiLabel>\n \u041C\u0430\u0440\u043A\u0438\u0440\u043E\u0432\u043A\u0430 \u0440\u0430\u0441\u043F\u0438\u043B\u0430\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"marker\"\n placeholder=\"\u041C\u0430\u0440\u043A\u0438\u0440\u043E\u0432\u043A\u0430 \u0440\u0430\u0441\u043F\u0438\u043B\u0430\"\n autocomplete=\"marker\"\n />\n </tui-textfield>\n\n <tui-error formControlName=\"marker\" />\n </label>\n\n @if (product.value) {\n <tui-loader [loading]=\"isCalculateLoading()\">\n @if (calculateResult) {\n <div class=\"mt-2 flex flex-wrap items-end gap-2\">\n <div>\n \u0418\u0442\u043E\u0433\u043E:\n <span class=\"whitespace-nowrap text-xl font-bold\"\n >{{ getTotalCost(calculateResult) | tuiFormatNumber: moneyFormat }} {{ product.value.currency.symbol }}</span\n >\n </div>\n @if (calculateResult?.quantity && productValue) {\n <div class=\"whitespace-nowrap text-lg text-sc-dark-grey\">\n <span class=\"font-bold\">({{ calculateResult.quantity }} \u0448\u0442.</span> x\n <span class=\"font-bold\"\n >{{ productValue.costRub === undefined ? '' : (productValue.costRub | tuiFormatNumber: moneyFormat) }}\n {{ productValue.currency.symbol }}/\u0448\u0442.)</span\n >\n </div>\n }\n </div>\n }\n </tui-loader>\n }\n\n <tui-error [formGroup]=\"form\" />\n @if (!calculateResult) {\n <button\n tuiButton\n appearance=\"secondary\"\n [disabled]=\"items.invalid || isCalculateLoading()\"\n (click)=\"triggerCalculate()\"\n type=\"button\"\n class=\"self-center\"\n iconStart=\"@tui.calculator\"\n >\n \u0420\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0442\u044C\n </button>\n } @else {\n <button\n [disabled]=\"form.invalid || isSubmitLoading()\"\n [loading]=\"isSubmitLoading()\"\n tuiButton\n class=\"self-center\"\n iconStart=\"@tui.check\"\n >\n {{ !orderItem() ? '\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0432 \u043A\u043E\u0440\u0437\u0438\u043D\u0443' : '\u0418\u0437\u043C\u0435\u043D\u0438\u0442\u044C' }}\n </button>\n }\n </form>\n</div>\n", styles: [":host{display:block;width:100%;max-width:30rem}.slider-ticks-labels{--t-offset: $thumb-radius;display:flex;font:var(--tui-typography-body-s);color:var(--tui-text-secondary);margin:.25rem var(--t-offset) 0}.slider-ticks-labels>*{position:relative;flex:2;text-align:center}.slider-ticks-labels>*:first-child{inset-inline-start:calc(-1 * var(--t-offset));flex:1;text-align:start}.slider-ticks-labels>*:last-child{inset-inline-end:calc(-1 * var(--t-offset));flex:1;text-align:end}tui-range+.slider-ticks-labels{--t-offset: $thumb-diameter}tui-textfield[data-size=l]+.slider-ticks-labels{--t-offset: calc(map-get($track-inset, \"l\") + $thumb-radius)}tui-textfield[data-size=m]+.slider-ticks-labels{--t-offset: calc(map-get($track-inset, \"m\") + $thumb-radius)}tui-textfield[data-size=s]+.slider-ticks-labels{--t-offset: calc(map-get($track-inset, \"s\") + $thumb-radius)}tui-input-range[data-size=l]+.slider-ticks-labels{--t-offset: calc(map-get($track-inset, \"l\") + $thumb-diameter)}tui-input-range[data-size=m]+.slider-ticks-labels{--t-offset: calc(map-get($track-inset, \"m\") + $thumb-diameter)}tui-input-range[data-size=s]+.slider-ticks-labels{--t-offset: calc(map-get($track-inset, \"s\") + $thumb-diameter)}.slider-ticks-labels{color:var(--tui-text-secondary)}\n"] }]
|
|
5457
5862
|
}], propDecorators: { settings: [{ type: i0.Input, args: [{ isSignal: true, alias: "settings", required: false }] }], categoryId: [{ type: i0.Input, args: [{ isSignal: true, alias: "categoryId", required: true }] }], editor: [{ type: i0.Input, args: [{ isSignal: true, alias: "editor", required: true }] }], orderItem: [{ type: i0.Input, args: [{ isSignal: true, alias: "orderItem", required: true }] }], orderId: [{
|
|
5458
5863
|
type: Input
|
|
5459
5864
|
}], toggleShowEvent: [{ type: i0.Output, args: ["toggleShowEvent"] }] } });
|
|
@@ -5513,6 +5918,14 @@ class ScSandwichM2Component {
|
|
|
5513
5918
|
* Сервис получения и редактирования списка товаров заказа (корзина / заказ / черновик = заказ).
|
|
5514
5919
|
*/
|
|
5515
5920
|
this.orderService = inject(SC_ORDER_LOADER);
|
|
5921
|
+
/**
|
|
5922
|
+
* Настройки вывода сумм в рублях.
|
|
5923
|
+
*/
|
|
5924
|
+
this.moneyFormat = ScNumberHelper.getMoneyFormat();
|
|
5925
|
+
/**
|
|
5926
|
+
* Настройки вывода площади.
|
|
5927
|
+
*/
|
|
5928
|
+
this.areaFormat = ScNumberHelper.areaFormat;
|
|
5516
5929
|
/**
|
|
5517
5930
|
* Сервис конвертации данных.
|
|
5518
5931
|
*/
|
|
@@ -5590,7 +6003,7 @@ class ScSandwichM2Component {
|
|
|
5590
6003
|
this.totalCost = computed(() => {
|
|
5591
6004
|
const cost = this.productSignal()?.costRub ?? 0;
|
|
5592
6005
|
const area = this.totalAreaM2();
|
|
5593
|
-
return
|
|
6006
|
+
return ScNumberHelper.roundMoney(area * cost);
|
|
5594
6007
|
}, ...(ngDevMode ? [{ debugName: "totalCost" }] : /* istanbul ignore next */ []));
|
|
5595
6008
|
/**
|
|
5596
6009
|
* Текст ограничения по ширине («от … до …»), пока есть выбранный товар.
|
|
@@ -5838,7 +6251,7 @@ class ScSandwichM2Component {
|
|
|
5838
6251
|
rowCost(value) {
|
|
5839
6252
|
const area = this.rowTotalPartsAreaM2(value);
|
|
5840
6253
|
const cost = this.product.value?.costRub ?? 0;
|
|
5841
|
-
return
|
|
6254
|
+
return ScNumberHelper.roundMoney(area * cost);
|
|
5842
6255
|
}
|
|
5843
6256
|
/**
|
|
5844
6257
|
* Обновляет состояние позиции на указанное значение.
|
|
@@ -5956,8 +6369,8 @@ class ScSandwichM2Component {
|
|
|
5956
6369
|
this.items.clear();
|
|
5957
6370
|
const orderItem = this.orderItem();
|
|
5958
6371
|
this.items.push(this.createItemGroup({
|
|
5959
|
-
width: (orderItem?.width ?? 0) * 1000,
|
|
5960
|
-
length: (orderItem?.length ?? 0) * 1000,
|
|
6372
|
+
width: Math.round((orderItem?.width ?? 0) * 1000),
|
|
6373
|
+
length: Math.round((orderItem?.length ?? 0) * 1000),
|
|
5961
6374
|
count: orderItem?.quantity ?? 1,
|
|
5962
6375
|
marker: orderItem?.marker ?? null,
|
|
5963
6376
|
}));
|
|
@@ -5975,11 +6388,12 @@ class ScSandwichM2Component {
|
|
|
5975
6388
|
stringify: signal((x) => x.name),
|
|
5976
6389
|
identityMatcher: signal((a, b) => a.id === b.id),
|
|
5977
6390
|
}),
|
|
5978
|
-
], ngImport: i0, template: "@if (!orderItem() && settings()?.allowShowTable) {\n <div class=\"mb-5 flex justify-center\">\n <button\n tuiButton\n appearance=\"secondary\"\n (click)=\"toggleShowEvent.emit()\"\n type=\"button\"\n iconStart=\"@tui.layout-list\"\n >\n \u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0432 \u0432\u0438\u0434\u0435 \u0441\u043F\u0438\u0441\u043A\u0430\n </button>\n </div>\n}\n<div class=\"\">\n @let products = products$ | async;\n @let productValue = product.value;\n\n <form\n [formGroup]=\"form\"\n (ngSubmit)=\"onSubmit()\"\n ScNextInputFocus\n class=\"flex flex-col gap-2\"\n >\n <label\n tuiLabel\n class=\"grow\"\n >\n \u0422\u043E\u0432\u0430\u0440\n <tui-textfield\n tuiChevron\n [tuiTextfieldCleaner]=\"false\"\n >\n <input\n tuiChevron\n tuiSelect\n [formControl]=\"product\"\n placeholder=\"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B\"\n />\n\n <tui-data-list-wrapper\n *tuiDropdown\n new\n [items]=\"products\"\n />\n </tui-textfield>\n <tui-error [formControl]=\"product\" />\n </label>\n\n @if (productValue && productValue.costRub !== undefined) {\n <div class=\"-mt-1 text-sm text-tui-text-secondary\">\n <span class=\"font-bold\">{{ productValue.code }}</span>\n \u2014\n {{ productValue.costRub.toLocaleString() }} {{ productValue.currency.symbol }}/\u043C\u00B2\n </div>\n }\n\n @if (productValue) {\n <div class=\"mt-4 mb-3 flex flex-col gap-1.5\">\n <div class=\"w-full font-bold\">\u0420\u0430\u0437\u043C\u0435\u0440\u044B \u0438\u0437\u0434\u0435\u043B\u0438\u0439</div>\n <div class=\"flex flex-col gap-1 text-sm text-tui-text-secondary\">\n @let wt = widthRangeText();\n @let lt = lengthRangeText();\n @if (wt) {\n <div>\u0428\u0438\u0440\u0438\u043D\u0430 {{ wt }}.</div>\n }\n @if (lt) {\n <div>\u0414\u043B\u0438\u043D\u0430 {{ lt }}.</div>\n }\n </div>\n </div>\n }\n\n <div class=\"flex flex-col gap-3\">\n <div\n formArrayName=\"items\"\n class=\"flex flex-col gap-3\"\n >\n @for (item of items.controls; track item) {\n @if ($index > 0) {\n <hr class=\"border-sc-grey h-px\" />\n }\n @let itemIndex = $index;\n <div\n class=\"relative flex flex-col gap-1\"\n [formGroupName]=\"itemIndex\"\n >\n @if (isItemLocked(itemIndex)) {\n <div class=\"pointer-events-none absolute right-3 bottom-0 z-10 flex size-8 items-center justify-center\">\n <tui-icon\n icon=\"@tui.check\"\n class=\"text-tui-status-positive\"\n />\n </div>\n }\n <tui-loader [loading]=\"isItemLoading(itemIndex)\">\n <div\n [class.opacity-70]=\"isItemLocked(itemIndex)\"\n class=\"flex min-w-0 items-start gap-2\"\n >\n <div class=\"flex min-w-0 flex-1 flex-col gap-3\">\n <div class=\"flex flex-col gap-3 lg:!flex-row lg:!items-start lg:!gap-6\">\n <!-- \u0413\u0440\u0443\u043F\u043F\u0430 1: \u0448\u0438\u0440\u0438\u043D\u0430 + \u0434\u043B\u0438\u043D\u0430 -->\n <div class=\"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:!flex-[2]\">\n <label tuiLabel>\n \u0428\u0438\u0440\u0438\u043D\u0430, \u043C\u043C\n <tui-textfield>\n <input\n tuiInputSlider\n formControlName=\"width\"\n [min]=\"settings()?.minWidth ?? 0\"\n [max]=\"product.value?.properties?.width ?? 0\"\n [tuiNumberFormat]=\"{ precision: 0 }\"\n [readOnly]=\"!product.value || isItemLocked(itemIndex) || isItemLoading(itemIndex)\"\n [tuiAutoFocus]=\"!$first\"\n placeholder=\"\u0428\u0438\u0440\u0438\u043D\u0430\"\n autocomplete=\"off\"\n />\n @if (product.value) {\n <input\n tuiSlider\n type=\"range\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"width\" />\n </label>\n\n <label tuiLabel>\n \u0414\u043B\u0438\u043D\u0430, \u043C\u043C\n <tui-textfield>\n <input\n tuiInputSlider\n formControlName=\"length\"\n [min]=\"settings()?.minLength ?? 0\"\n [max]=\"product.value?.properties?.length ?? 0\"\n [tuiNumberFormat]=\"{ precision: 0 }\"\n [readOnly]=\"!product.value || isItemLocked(itemIndex) || isItemLoading(itemIndex)\"\n placeholder=\"\u0414\u043B\u0438\u043D\u0430\"\n autocomplete=\"off\"\n />\n @if (product.value) {\n <input\n tuiSlider\n type=\"range\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"length\" />\n </label>\n </div>\n\n <!-- \u0413\u0440\u0443\u043F\u043F\u0430 2: \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E + \u043C\u0430\u0440\u043A\u0438\u0440\u043E\u0432\u043A\u0430 (\u043D\u0430 lg 1fr | 2fr) -->\n <div class=\"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:!grid-cols-[1fr_2fr] lg:!flex-[3]\">\n <label tuiLabel>\n <span class=\"whitespace-nowrap\">\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E, \u0448\u0442</span>\n <tui-textfield [tuiTextfieldCleaner]=\"false\">\n <input\n tuiInputNumber\n formControlName=\"count\"\n [min]=\"1\"\n [tuiNumberFormat]=\"{ precision: 0 }\"\n [readOnly]=\"!product.value || isItemLocked(itemIndex) || isItemLoading(itemIndex)\"\n placeholder=\"\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E\"\n autocomplete=\"off\"\n />\n </tui-textfield>\n <tui-error formControlName=\"count\" />\n </label>\n\n <label tuiLabel>\n \u041C\u0430\u0440\u043A\u0438\u0440\u043E\u0432\u043A\u0430\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"marker\"\n [readOnly]=\"!product.value || isItemLocked(itemIndex) || isItemLoading(itemIndex)\"\n placeholder=\"\u041C\u0430\u0440\u043A\u0438\u0440\u043E\u0432\u043A\u0430\"\n autocomplete=\"off\"\n />\n </tui-textfield>\n <tui-error formControlName=\"marker\" />\n </label>\n </div>\n </div>\n\n @let rowVal = item.getRawValue();\n\n @if (rowVal.width > 0 && rowVal.length > 0) {\n <div class=\"mt-1 flex flex-col gap-y-1 text-sm lg:!flex-row lg:!gap-6\">\n @if (pieceAreaM2(rowVal) > 0) {\n <div class=\"lg:!flex-[2]\">\n \u041F\u043B\u043E\u0449\u0430\u0434\u044C (S) =\n <span class=\"font-bold\">{{ pieceAreaM2(rowVal) | number: '1.0-4' }} \u043C\u00B2</span>\n </div>\n }\n @if (productValue && rowCost(rowVal) > 0) {\n <div class=\"lg:!flex-[3]\">\n \u0418\u0442\u043E\u0433\u043E:\n <span class=\"font-bold\">{{ rowCost(rowVal).toLocaleString() }} {{ productValue.currency.symbol }}</span>\n </div>\n }\n </div>\n }\n </div>\n\n @if (!isEditingExistingItem()) {\n <button\n tuiIconButton\n title=\"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0438\u0437\u0434\u0435\u043B\u0438\u0435\"\n (click)=\"removeItem(itemIndex)\"\n [disabled]=\"items.length <= 1 || !product.value || isItemLoading(itemIndex)\"\n size=\"m\"\n type=\"button\"\n iconStart=\"@tui.trash-2\"\n appearance=\"secondary\"\n class=\"mt-6 shrink-0 lg:!ml-4\"\n [style.flex]=\"'0 0 auto'\"\n ></button>\n }\n </div>\n </tui-loader>\n </div>\n }\n </div>\n\n @if (productValue) {\n <hr class=\"border-sc-grey h-px\" />\n <div class=\"min-w-0 gap-1 pt-2 text-right\">\n @if (totalAreaM2() > 0) {\n <div>\n \u041E\u0431\u0449\u0430\u044F \u043F\u043B\u043E\u0449\u0430\u0434\u044C:\n <span class=\"font-bold\">{{ totalAreaM2() | number: '1.0-4' }} \u043C\u00B2</span>\n </div>\n }\n @if (productValue.costRub && totalCost() > 0) {\n <div>\n \u0418\u0442\u043E\u0433\u043E:\n <span class=\"whitespace-nowrap text-xl font-bold\"> {{ totalCost().toLocaleString() }} {{ productValue.currency.symbol }} </span>\n </div>\n }\n </div>\n }\n </div>\n\n <tui-error [formGroup]=\"form\" />\n\n <div class=\"flex flex-wrap items-center gap-3\">\n @if (productValue && !isEditingExistingItem()) {\n <button\n tuiButton\n appearance=\"secondary\"\n [disabled]=\"!product.value || items.invalid\"\n (click)=\"addItem()\"\n type=\"button\"\n iconStart=\"@tui.plus\"\n >\n \u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0438\u0437\u0434\u0435\u043B\u0438\u0435\n </button>\n }\n <button\n type=\"submit\"\n [disabled]=\"form.invalid || isSubmitLoading() || hasNoPendingItems()\"\n [loading]=\"isSubmitLoading()\"\n tuiButton\n class=\"ml-auto\"\n iconStart=\"@tui.check\"\n >\n {{ !orderItem() ? '\u0412 \u043A\u043E\u0440\u0437\u0438\u043D\u0443' : '\u0418\u0437\u043C\u0435\u043D\u0438\u0442\u044C' }}\n </button>\n </div>\n </form>\n</div>\n", styles: [":host{display:block;width:100%;max-width:36rem}.row-summary{color:var(--tui-text-secondary);font-size:.75rem}\n"], dependencies: [{ kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: ScNextInputFocusDirective, selector: "form[ScNextInputFocus]" }, { kind: "directive", type: TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: TuiDataListWrapperComponent, selector: "tui-data-list-wrapper:not([labels])", inputs: ["items", "emptyContent", "size", "itemContent"], outputs: ["itemClick"] }, { kind: "component", type: i2.TuiErrorComponent, selector: "tui-error", inputs: ["error"] }, { kind: "directive", type: i2.TuiErrorDirective, selector: "tui-error[ngModel], tui-error[formControlName], tui-error[formControl], tui-error[formGroup], tui-error[formGroupName], tui-error[formArrayName], tui-error[formArray]", inputs: ["order"] }, { kind: "component", type: i3$1.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler"] }, { kind: "directive", type: i3$1.TuiTextfieldOptionsDirective, selector: "[tuiTextfieldAppearance],[tuiTextfieldSize],[tuiTextfieldCleaner]", inputs: ["tuiTextfieldAppearance", "tuiTextfieldSize", "tuiTextfieldCleaner"] }, { kind: "directive", type: i3.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { kind: "directive", type: i2.TuiInputDirective, selector: "input[tuiInput]", inputs: ["readOnly", "invalid", "focused", "state"] }, { kind: "directive", type: TuiChevron, selector: "[tuiChevron]", inputs: ["tuiChevron"] }, { kind: "directive", type: i1$1.TuiSelectDirective, selector: "input[tuiSelect]" }, { kind: "directive", type: i1$1.TuiInputNumberDirective, selector: "input[tuiInputNumber]" }, { kind: "directive", type: TuiNumberFormat, selector: "[tuiNumberFormat]", inputs: ["tuiNumberFormat"] }, { kind: "component", type: i6.TuiSliderComponent, selector: "input[type=range][tuiSlider]", inputs: ["segments"] }, { kind: "directive", type: i1$1.TuiInputSliderDirective, selector: "input[tuiInputSlider]" }, { kind: "directive", type: ScSelectOnFocusinDirective, selector: "tui-input-number, tui-input, tui-input-phone, tui-input-date, tui-input-password, input[tuiInput], input[tuiInputNumber], input[tuiTextfield], input[tuiInputSlider]" }, { kind: "component", type: TuiLoader, selector: "tui-loader", inputs: ["size", "inheritColor", "overlay", "textContent", "loading"] }, { kind: "component", type: TuiButtonLoading, selector: "[tuiButton][loading],[tuiIconButton][loading]", inputs: ["size", "loading"] }, { kind: "component", type: TuiIcon, selector: "tui-icon:not([tuiBadge])", inputs: ["background"] }, { kind: "directive", type: TuiAutoFocus, selector: "[tuiAutoFocus]", inputs: ["tuiAutoFocus"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: DecimalPipe, name: "number" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
6391
|
+
], ngImport: i0, template: "@if (!orderItem() && settings()?.allowShowTable) {\n <div class=\"mb-5 flex justify-center\">\n <button\n tuiButton\n appearance=\"secondary\"\n (click)=\"toggleShowEvent.emit()\"\n type=\"button\"\n iconStart=\"@tui.layout-list\"\n >\n \u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0432 \u0432\u0438\u0434\u0435 \u0441\u043F\u0438\u0441\u043A\u0430\n </button>\n </div>\n}\n<div class=\"\">\n @let products = products$ | async;\n @let productValue = product.value;\n\n <form\n [formGroup]=\"form\"\n (ngSubmit)=\"onSubmit()\"\n ScNextInputFocus\n class=\"flex flex-col gap-2\"\n >\n <label\n tuiLabel\n class=\"grow\"\n >\n \u0422\u043E\u0432\u0430\u0440\n <tui-textfield\n tuiChevron\n [tuiTextfieldCleaner]=\"false\"\n >\n <input\n tuiChevron\n tuiSelect\n [formControl]=\"product\"\n placeholder=\"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B\"\n />\n\n <tui-data-list-wrapper\n *tuiDropdown\n new\n [items]=\"products\"\n />\n </tui-textfield>\n <tui-error [formControl]=\"product\" />\n </label>\n\n @if (productValue && productValue.costRub !== undefined) {\n <div class=\"-mt-1 text-sm text-tui-text-secondary\">\n <span class=\"font-bold\">{{ productValue.code }}</span>\n \u2014\n {{ productValue.costRub | tuiFormatNumber: moneyFormat }} {{ productValue.currency.symbol }}/\u043C\u00B2\n </div>\n }\n\n @if (productValue) {\n <div class=\"mt-4 mb-3 flex flex-col gap-1.5\">\n <div class=\"w-full font-bold\">\u0420\u0430\u0437\u043C\u0435\u0440\u044B \u0438\u0437\u0434\u0435\u043B\u0438\u0439</div>\n <div class=\"flex flex-col gap-1 text-sm text-tui-text-secondary\">\n @let wt = widthRangeText();\n @let lt = lengthRangeText();\n @if (wt) {\n <div>\u0428\u0438\u0440\u0438\u043D\u0430 {{ wt }}.</div>\n }\n @if (lt) {\n <div>\u0414\u043B\u0438\u043D\u0430 {{ lt }}.</div>\n }\n </div>\n </div>\n }\n\n <div class=\"flex flex-col gap-3\">\n <div\n formArrayName=\"items\"\n class=\"flex flex-col gap-3\"\n >\n @for (item of items.controls; track item) {\n @if ($index > 0) {\n <hr class=\"border-sc-grey h-px\" />\n }\n @let itemIndex = $index;\n <div\n class=\"relative flex flex-col gap-1\"\n [formGroupName]=\"itemIndex\"\n >\n @if (isItemLocked(itemIndex)) {\n <div class=\"pointer-events-none absolute right-3 bottom-0 z-10 flex size-8 items-center justify-center\">\n <tui-icon\n icon=\"@tui.check\"\n class=\"text-tui-status-positive\"\n />\n </div>\n }\n <tui-loader [loading]=\"isItemLoading(itemIndex)\">\n <div\n [class.opacity-70]=\"isItemLocked(itemIndex)\"\n class=\"flex min-w-0 items-start gap-2\"\n >\n <div class=\"flex min-w-0 flex-1 flex-col gap-3\">\n <div class=\"flex flex-col gap-3 lg:!flex-row lg:!items-start lg:!gap-6\">\n <!-- \u0413\u0440\u0443\u043F\u043F\u0430 1: \u0448\u0438\u0440\u0438\u043D\u0430 + \u0434\u043B\u0438\u043D\u0430 -->\n <div class=\"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:!flex-[2]\">\n <label tuiLabel>\n \u0428\u0438\u0440\u0438\u043D\u0430, \u043C\u043C\n <tui-textfield>\n <input\n tuiInputSlider\n formControlName=\"width\"\n [min]=\"settings()?.minWidth ?? 0\"\n [max]=\"product.value?.properties?.width ?? 0\"\n [tuiNumberFormat]=\"{ precision: 0 }\"\n [readOnly]=\"!product.value || isItemLocked(itemIndex) || isItemLoading(itemIndex)\"\n [tuiAutoFocus]=\"!$first\"\n placeholder=\"\u0428\u0438\u0440\u0438\u043D\u0430\"\n autocomplete=\"off\"\n />\n @if (product.value) {\n <input\n tuiSlider\n type=\"range\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"width\" />\n </label>\n\n <label tuiLabel>\n \u0414\u043B\u0438\u043D\u0430, \u043C\u043C\n <tui-textfield>\n <input\n tuiInputSlider\n formControlName=\"length\"\n [min]=\"settings()?.minLength ?? 0\"\n [max]=\"product.value?.properties?.length ?? 0\"\n [tuiNumberFormat]=\"{ precision: 0 }\"\n [readOnly]=\"!product.value || isItemLocked(itemIndex) || isItemLoading(itemIndex)\"\n placeholder=\"\u0414\u043B\u0438\u043D\u0430\"\n autocomplete=\"off\"\n />\n @if (product.value) {\n <input\n tuiSlider\n type=\"range\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"length\" />\n </label>\n </div>\n\n <!-- \u0413\u0440\u0443\u043F\u043F\u0430 2: \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E + \u043C\u0430\u0440\u043A\u0438\u0440\u043E\u0432\u043A\u0430 (\u043D\u0430 lg 1fr | 2fr) -->\n <div class=\"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:!grid-cols-[1fr_2fr] lg:!flex-[3]\">\n <label tuiLabel>\n <span class=\"whitespace-nowrap\">\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E, \u0448\u0442</span>\n <tui-textfield [tuiTextfieldCleaner]=\"false\">\n <input\n tuiInputNumber\n formControlName=\"count\"\n [min]=\"1\"\n [tuiNumberFormat]=\"{ precision: 0 }\"\n [readOnly]=\"!product.value || isItemLocked(itemIndex) || isItemLoading(itemIndex)\"\n placeholder=\"\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E\"\n autocomplete=\"off\"\n />\n </tui-textfield>\n <tui-error formControlName=\"count\" />\n </label>\n\n <label tuiLabel>\n \u041C\u0430\u0440\u043A\u0438\u0440\u043E\u0432\u043A\u0430\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"marker\"\n [readOnly]=\"!product.value || isItemLocked(itemIndex) || isItemLoading(itemIndex)\"\n placeholder=\"\u041C\u0430\u0440\u043A\u0438\u0440\u043E\u0432\u043A\u0430\"\n autocomplete=\"off\"\n />\n </tui-textfield>\n <tui-error formControlName=\"marker\" />\n </label>\n </div>\n </div>\n\n @let rowVal = item.getRawValue();\n\n @if (rowVal.width > 0 && rowVal.length > 0) {\n <div class=\"mt-1 flex flex-col gap-y-1 text-sm lg:!flex-row lg:!gap-6\">\n @if (pieceAreaM2(rowVal) > 0) {\n <div class=\"lg:!flex-[2]\">\n \u041F\u043B\u043E\u0449\u0430\u0434\u044C (S) =\n <span class=\"font-bold\">{{ pieceAreaM2(rowVal) | tuiFormatNumber: areaFormat }} \u043C\u00B2</span>\n </div>\n }\n @if (productValue && rowCost(rowVal) > 0) {\n <div class=\"lg:!flex-[3]\">\n \u0418\u0442\u043E\u0433\u043E:\n <span class=\"font-bold\">{{ rowCost(rowVal) | tuiFormatNumber: moneyFormat }} {{ productValue.currency.symbol }}</span>\n </div>\n }\n </div>\n }\n </div>\n\n @if (!isEditingExistingItem()) {\n <button\n tuiIconButton\n title=\"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0438\u0437\u0434\u0435\u043B\u0438\u0435\"\n (click)=\"removeItem(itemIndex)\"\n [disabled]=\"items.length <= 1 || !product.value || isItemLoading(itemIndex)\"\n size=\"m\"\n type=\"button\"\n iconStart=\"@tui.trash-2\"\n appearance=\"secondary\"\n class=\"mt-6 shrink-0 lg:!ml-4\"\n [style.flex]=\"'0 0 auto'\"\n ></button>\n }\n </div>\n </tui-loader>\n </div>\n }\n </div>\n\n @if (productValue) {\n <hr class=\"border-sc-grey h-px\" />\n <div class=\"min-w-0 gap-1 pt-2 text-right\">\n @if (totalAreaM2() > 0) {\n <div>\n \u041E\u0431\u0449\u0430\u044F \u043F\u043B\u043E\u0449\u0430\u0434\u044C:\n <span class=\"font-bold\">{{ totalAreaM2() | tuiFormatNumber: areaFormat }} \u043C\u00B2</span>\n </div>\n }\n @if (productValue.costRub && totalCost() > 0) {\n <div>\n \u0418\u0442\u043E\u0433\u043E:\n <span class=\"whitespace-nowrap text-xl font-bold\"> {{ totalCost() | tuiFormatNumber: moneyFormat }} {{ productValue.currency.symbol }} </span>\n </div>\n }\n </div>\n }\n </div>\n\n <tui-error [formGroup]=\"form\" />\n\n <div class=\"flex flex-wrap items-center gap-3\">\n @if (productValue && !isEditingExistingItem()) {\n <button\n tuiButton\n appearance=\"secondary\"\n [disabled]=\"!product.value || items.invalid\"\n (click)=\"addItem()\"\n type=\"button\"\n iconStart=\"@tui.plus\"\n >\n \u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0438\u0437\u0434\u0435\u043B\u0438\u0435\n </button>\n }\n <button\n type=\"submit\"\n [disabled]=\"form.invalid || isSubmitLoading() || hasNoPendingItems()\"\n [loading]=\"isSubmitLoading()\"\n tuiButton\n class=\"ml-auto\"\n iconStart=\"@tui.check\"\n >\n {{ !orderItem() ? '\u0412 \u043A\u043E\u0440\u0437\u0438\u043D\u0443' : '\u0418\u0437\u043C\u0435\u043D\u0438\u0442\u044C' }}\n </button>\n </div>\n </form>\n</div>\n", styles: [":host{display:block;width:100%;max-width:36rem}.row-summary{color:var(--tui-text-secondary);font-size:.75rem}\n"], dependencies: [{ kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: ScNextInputFocusDirective, selector: "form[ScNextInputFocus]" }, { kind: "directive", type: TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: TuiDataListWrapperComponent, selector: "tui-data-list-wrapper:not([labels])", inputs: ["items", "emptyContent", "size", "itemContent"], outputs: ["itemClick"] }, { kind: "component", type: i2.TuiErrorComponent, selector: "tui-error", inputs: ["error"] }, { kind: "directive", type: i2.TuiErrorDirective, selector: "tui-error[ngModel], tui-error[formControlName], tui-error[formControl], tui-error[formGroup], tui-error[formGroupName], tui-error[formArrayName], tui-error[formArray]", inputs: ["order"] }, { kind: "component", type: i3$1.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler"] }, { kind: "directive", type: i3$1.TuiTextfieldOptionsDirective, selector: "[tuiTextfieldAppearance],[tuiTextfieldSize],[tuiTextfieldCleaner]", inputs: ["tuiTextfieldAppearance", "tuiTextfieldSize", "tuiTextfieldCleaner"] }, { kind: "directive", type: i3.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { kind: "directive", type: i2.TuiInputDirective, selector: "input[tuiInput]", inputs: ["readOnly", "invalid", "focused", "state"] }, { kind: "directive", type: TuiChevron, selector: "[tuiChevron]", inputs: ["tuiChevron"] }, { kind: "directive", type: i1$1.TuiSelectDirective, selector: "input[tuiSelect]" }, { kind: "directive", type: i1$1.TuiInputNumberDirective, selector: "input[tuiInputNumber]" }, { kind: "directive", type: TuiNumberFormat, selector: "[tuiNumberFormat]", inputs: ["tuiNumberFormat"] }, { kind: "component", type: i6.TuiSliderComponent, selector: "input[type=range][tuiSlider]", inputs: ["segments"] }, { kind: "directive", type: i1$1.TuiInputSliderDirective, selector: "input[tuiInputSlider]" }, { kind: "directive", type: ScSelectOnFocusinDirective, selector: "tui-input-number, tui-input, tui-input-phone, tui-input-date, tui-input-password, input[tuiInput], input[tuiInputNumber], input[tuiTextfield], input[tuiInputSlider]" }, { kind: "component", type: TuiLoader, selector: "tui-loader", inputs: ["size", "inheritColor", "overlay", "textContent", "loading"] }, { kind: "component", type: TuiButtonLoading, selector: "[tuiButton][loading],[tuiIconButton][loading]", inputs: ["size", "loading"] }, { kind: "component", type: TuiIcon, selector: "tui-icon:not([tuiBadge])", inputs: ["background"] }, { kind: "directive", type: TuiAutoFocus, selector: "[tuiAutoFocus]", inputs: ["tuiAutoFocus"] }, { kind: "pipe", type: TuiFormatNumberPipe, name: "tuiFormatNumber" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5979
6392
|
}
|
|
5980
6393
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScSandwichM2Component, decorators: [{
|
|
5981
6394
|
type: Component,
|
|
5982
6395
|
args: [{ standalone: true, selector: 'sc-sandwich-m2', imports: [
|
|
6396
|
+
TuiFormatNumberPipe,
|
|
5983
6397
|
TuiButton,
|
|
5984
6398
|
FormsModule,
|
|
5985
6399
|
ReactiveFormsModule,
|
|
@@ -5993,7 +6407,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
|
|
|
5993
6407
|
TuiInputNumber,
|
|
5994
6408
|
TuiNumberFormat,
|
|
5995
6409
|
AsyncPipe,
|
|
5996
|
-
DecimalPipe,
|
|
5997
6410
|
TuiInputSlider,
|
|
5998
6411
|
ScSelectOnFocusinDirective,
|
|
5999
6412
|
TuiLoader,
|
|
@@ -6009,7 +6422,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
|
|
|
6009
6422
|
stringify: signal((x) => x.name),
|
|
6010
6423
|
identityMatcher: signal((a, b) => a.id === b.id),
|
|
6011
6424
|
}),
|
|
6012
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (!orderItem() && settings()?.allowShowTable) {\n <div class=\"mb-5 flex justify-center\">\n <button\n tuiButton\n appearance=\"secondary\"\n (click)=\"toggleShowEvent.emit()\"\n type=\"button\"\n iconStart=\"@tui.layout-list\"\n >\n \u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0432 \u0432\u0438\u0434\u0435 \u0441\u043F\u0438\u0441\u043A\u0430\n </button>\n </div>\n}\n<div class=\"\">\n @let products = products$ | async;\n @let productValue = product.value;\n\n <form\n [formGroup]=\"form\"\n (ngSubmit)=\"onSubmit()\"\n ScNextInputFocus\n class=\"flex flex-col gap-2\"\n >\n <label\n tuiLabel\n class=\"grow\"\n >\n \u0422\u043E\u0432\u0430\u0440\n <tui-textfield\n tuiChevron\n [tuiTextfieldCleaner]=\"false\"\n >\n <input\n tuiChevron\n tuiSelect\n [formControl]=\"product\"\n placeholder=\"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B\"\n />\n\n <tui-data-list-wrapper\n *tuiDropdown\n new\n [items]=\"products\"\n />\n </tui-textfield>\n <tui-error [formControl]=\"product\" />\n </label>\n\n @if (productValue && productValue.costRub !== undefined) {\n <div class=\"-mt-1 text-sm text-tui-text-secondary\">\n <span class=\"font-bold\">{{ productValue.code }}</span>\n \u2014\n {{ productValue.costRub.toLocaleString() }} {{ productValue.currency.symbol }}/\u043C\u00B2\n </div>\n }\n\n @if (productValue) {\n <div class=\"mt-4 mb-3 flex flex-col gap-1.5\">\n <div class=\"w-full font-bold\">\u0420\u0430\u0437\u043C\u0435\u0440\u044B \u0438\u0437\u0434\u0435\u043B\u0438\u0439</div>\n <div class=\"flex flex-col gap-1 text-sm text-tui-text-secondary\">\n @let wt = widthRangeText();\n @let lt = lengthRangeText();\n @if (wt) {\n <div>\u0428\u0438\u0440\u0438\u043D\u0430 {{ wt }}.</div>\n }\n @if (lt) {\n <div>\u0414\u043B\u0438\u043D\u0430 {{ lt }}.</div>\n }\n </div>\n </div>\n }\n\n <div class=\"flex flex-col gap-3\">\n <div\n formArrayName=\"items\"\n class=\"flex flex-col gap-3\"\n >\n @for (item of items.controls; track item) {\n @if ($index > 0) {\n <hr class=\"border-sc-grey h-px\" />\n }\n @let itemIndex = $index;\n <div\n class=\"relative flex flex-col gap-1\"\n [formGroupName]=\"itemIndex\"\n >\n @if (isItemLocked(itemIndex)) {\n <div class=\"pointer-events-none absolute right-3 bottom-0 z-10 flex size-8 items-center justify-center\">\n <tui-icon\n icon=\"@tui.check\"\n class=\"text-tui-status-positive\"\n />\n </div>\n }\n <tui-loader [loading]=\"isItemLoading(itemIndex)\">\n <div\n [class.opacity-70]=\"isItemLocked(itemIndex)\"\n class=\"flex min-w-0 items-start gap-2\"\n >\n <div class=\"flex min-w-0 flex-1 flex-col gap-3\">\n <div class=\"flex flex-col gap-3 lg:!flex-row lg:!items-start lg:!gap-6\">\n <!-- \u0413\u0440\u0443\u043F\u043F\u0430 1: \u0448\u0438\u0440\u0438\u043D\u0430 + \u0434\u043B\u0438\u043D\u0430 -->\n <div class=\"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:!flex-[2]\">\n <label tuiLabel>\n \u0428\u0438\u0440\u0438\u043D\u0430, \u043C\u043C\n <tui-textfield>\n <input\n tuiInputSlider\n formControlName=\"width\"\n [min]=\"settings()?.minWidth ?? 0\"\n [max]=\"product.value?.properties?.width ?? 0\"\n [tuiNumberFormat]=\"{ precision: 0 }\"\n [readOnly]=\"!product.value || isItemLocked(itemIndex) || isItemLoading(itemIndex)\"\n [tuiAutoFocus]=\"!$first\"\n placeholder=\"\u0428\u0438\u0440\u0438\u043D\u0430\"\n autocomplete=\"off\"\n />\n @if (product.value) {\n <input\n tuiSlider\n type=\"range\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"width\" />\n </label>\n\n <label tuiLabel>\n \u0414\u043B\u0438\u043D\u0430, \u043C\u043C\n <tui-textfield>\n <input\n tuiInputSlider\n formControlName=\"length\"\n [min]=\"settings()?.minLength ?? 0\"\n [max]=\"product.value?.properties?.length ?? 0\"\n [tuiNumberFormat]=\"{ precision: 0 }\"\n [readOnly]=\"!product.value || isItemLocked(itemIndex) || isItemLoading(itemIndex)\"\n placeholder=\"\u0414\u043B\u0438\u043D\u0430\"\n autocomplete=\"off\"\n />\n @if (product.value) {\n <input\n tuiSlider\n type=\"range\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"length\" />\n </label>\n </div>\n\n <!-- \u0413\u0440\u0443\u043F\u043F\u0430 2: \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E + \u043C\u0430\u0440\u043A\u0438\u0440\u043E\u0432\u043A\u0430 (\u043D\u0430 lg 1fr | 2fr) -->\n <div class=\"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:!grid-cols-[1fr_2fr] lg:!flex-[3]\">\n <label tuiLabel>\n <span class=\"whitespace-nowrap\">\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E, \u0448\u0442</span>\n <tui-textfield [tuiTextfieldCleaner]=\"false\">\n <input\n tuiInputNumber\n formControlName=\"count\"\n [min]=\"1\"\n [tuiNumberFormat]=\"{ precision: 0 }\"\n [readOnly]=\"!product.value || isItemLocked(itemIndex) || isItemLoading(itemIndex)\"\n placeholder=\"\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E\"\n autocomplete=\"off\"\n />\n </tui-textfield>\n <tui-error formControlName=\"count\" />\n </label>\n\n <label tuiLabel>\n \u041C\u0430\u0440\u043A\u0438\u0440\u043E\u0432\u043A\u0430\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"marker\"\n [readOnly]=\"!product.value || isItemLocked(itemIndex) || isItemLoading(itemIndex)\"\n placeholder=\"\u041C\u0430\u0440\u043A\u0438\u0440\u043E\u0432\u043A\u0430\"\n autocomplete=\"off\"\n />\n </tui-textfield>\n <tui-error formControlName=\"marker\" />\n </label>\n </div>\n </div>\n\n @let rowVal = item.getRawValue();\n\n @if (rowVal.width > 0 && rowVal.length > 0) {\n <div class=\"mt-1 flex flex-col gap-y-1 text-sm lg:!flex-row lg:!gap-6\">\n @if (pieceAreaM2(rowVal) > 0) {\n <div class=\"lg:!flex-[2]\">\n \u041F\u043B\u043E\u0449\u0430\u0434\u044C (S) =\n <span class=\"font-bold\">{{ pieceAreaM2(rowVal) | number: '1.0-4' }} \u043C\u00B2</span>\n </div>\n }\n @if (productValue && rowCost(rowVal) > 0) {\n <div class=\"lg:!flex-[3]\">\n \u0418\u0442\u043E\u0433\u043E:\n <span class=\"font-bold\">{{ rowCost(rowVal).toLocaleString() }} {{ productValue.currency.symbol }}</span>\n </div>\n }\n </div>\n }\n </div>\n\n @if (!isEditingExistingItem()) {\n <button\n tuiIconButton\n title=\"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0438\u0437\u0434\u0435\u043B\u0438\u0435\"\n (click)=\"removeItem(itemIndex)\"\n [disabled]=\"items.length <= 1 || !product.value || isItemLoading(itemIndex)\"\n size=\"m\"\n type=\"button\"\n iconStart=\"@tui.trash-2\"\n appearance=\"secondary\"\n class=\"mt-6 shrink-0 lg:!ml-4\"\n [style.flex]=\"'0 0 auto'\"\n ></button>\n }\n </div>\n </tui-loader>\n </div>\n }\n </div>\n\n @if (productValue) {\n <hr class=\"border-sc-grey h-px\" />\n <div class=\"min-w-0 gap-1 pt-2 text-right\">\n @if (totalAreaM2() > 0) {\n <div>\n \u041E\u0431\u0449\u0430\u044F \u043F\u043B\u043E\u0449\u0430\u0434\u044C:\n <span class=\"font-bold\">{{ totalAreaM2() | number: '1.0-4' }} \u043C\u00B2</span>\n </div>\n }\n @if (productValue.costRub && totalCost() > 0) {\n <div>\n \u0418\u0442\u043E\u0433\u043E:\n <span class=\"whitespace-nowrap text-xl font-bold\"> {{ totalCost().toLocaleString() }} {{ productValue.currency.symbol }} </span>\n </div>\n }\n </div>\n }\n </div>\n\n <tui-error [formGroup]=\"form\" />\n\n <div class=\"flex flex-wrap items-center gap-3\">\n @if (productValue && !isEditingExistingItem()) {\n <button\n tuiButton\n appearance=\"secondary\"\n [disabled]=\"!product.value || items.invalid\"\n (click)=\"addItem()\"\n type=\"button\"\n iconStart=\"@tui.plus\"\n >\n \u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0438\u0437\u0434\u0435\u043B\u0438\u0435\n </button>\n }\n <button\n type=\"submit\"\n [disabled]=\"form.invalid || isSubmitLoading() || hasNoPendingItems()\"\n [loading]=\"isSubmitLoading()\"\n tuiButton\n class=\"ml-auto\"\n iconStart=\"@tui.check\"\n >\n {{ !orderItem() ? '\u0412 \u043A\u043E\u0440\u0437\u0438\u043D\u0443' : '\u0418\u0437\u043C\u0435\u043D\u0438\u0442\u044C' }}\n </button>\n </div>\n </form>\n</div>\n", styles: [":host{display:block;width:100%;max-width:36rem}.row-summary{color:var(--tui-text-secondary);font-size:.75rem}\n"] }]
|
|
6425
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (!orderItem() && settings()?.allowShowTable) {\n <div class=\"mb-5 flex justify-center\">\n <button\n tuiButton\n appearance=\"secondary\"\n (click)=\"toggleShowEvent.emit()\"\n type=\"button\"\n iconStart=\"@tui.layout-list\"\n >\n \u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0432 \u0432\u0438\u0434\u0435 \u0441\u043F\u0438\u0441\u043A\u0430\n </button>\n </div>\n}\n<div class=\"\">\n @let products = products$ | async;\n @let productValue = product.value;\n\n <form\n [formGroup]=\"form\"\n (ngSubmit)=\"onSubmit()\"\n ScNextInputFocus\n class=\"flex flex-col gap-2\"\n >\n <label\n tuiLabel\n class=\"grow\"\n >\n \u0422\u043E\u0432\u0430\u0440\n <tui-textfield\n tuiChevron\n [tuiTextfieldCleaner]=\"false\"\n >\n <input\n tuiChevron\n tuiSelect\n [formControl]=\"product\"\n placeholder=\"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B\"\n />\n\n <tui-data-list-wrapper\n *tuiDropdown\n new\n [items]=\"products\"\n />\n </tui-textfield>\n <tui-error [formControl]=\"product\" />\n </label>\n\n @if (productValue && productValue.costRub !== undefined) {\n <div class=\"-mt-1 text-sm text-tui-text-secondary\">\n <span class=\"font-bold\">{{ productValue.code }}</span>\n \u2014\n {{ productValue.costRub | tuiFormatNumber: moneyFormat }} {{ productValue.currency.symbol }}/\u043C\u00B2\n </div>\n }\n\n @if (productValue) {\n <div class=\"mt-4 mb-3 flex flex-col gap-1.5\">\n <div class=\"w-full font-bold\">\u0420\u0430\u0437\u043C\u0435\u0440\u044B \u0438\u0437\u0434\u0435\u043B\u0438\u0439</div>\n <div class=\"flex flex-col gap-1 text-sm text-tui-text-secondary\">\n @let wt = widthRangeText();\n @let lt = lengthRangeText();\n @if (wt) {\n <div>\u0428\u0438\u0440\u0438\u043D\u0430 {{ wt }}.</div>\n }\n @if (lt) {\n <div>\u0414\u043B\u0438\u043D\u0430 {{ lt }}.</div>\n }\n </div>\n </div>\n }\n\n <div class=\"flex flex-col gap-3\">\n <div\n formArrayName=\"items\"\n class=\"flex flex-col gap-3\"\n >\n @for (item of items.controls; track item) {\n @if ($index > 0) {\n <hr class=\"border-sc-grey h-px\" />\n }\n @let itemIndex = $index;\n <div\n class=\"relative flex flex-col gap-1\"\n [formGroupName]=\"itemIndex\"\n >\n @if (isItemLocked(itemIndex)) {\n <div class=\"pointer-events-none absolute right-3 bottom-0 z-10 flex size-8 items-center justify-center\">\n <tui-icon\n icon=\"@tui.check\"\n class=\"text-tui-status-positive\"\n />\n </div>\n }\n <tui-loader [loading]=\"isItemLoading(itemIndex)\">\n <div\n [class.opacity-70]=\"isItemLocked(itemIndex)\"\n class=\"flex min-w-0 items-start gap-2\"\n >\n <div class=\"flex min-w-0 flex-1 flex-col gap-3\">\n <div class=\"flex flex-col gap-3 lg:!flex-row lg:!items-start lg:!gap-6\">\n <!-- \u0413\u0440\u0443\u043F\u043F\u0430 1: \u0448\u0438\u0440\u0438\u043D\u0430 + \u0434\u043B\u0438\u043D\u0430 -->\n <div class=\"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:!flex-[2]\">\n <label tuiLabel>\n \u0428\u0438\u0440\u0438\u043D\u0430, \u043C\u043C\n <tui-textfield>\n <input\n tuiInputSlider\n formControlName=\"width\"\n [min]=\"settings()?.minWidth ?? 0\"\n [max]=\"product.value?.properties?.width ?? 0\"\n [tuiNumberFormat]=\"{ precision: 0 }\"\n [readOnly]=\"!product.value || isItemLocked(itemIndex) || isItemLoading(itemIndex)\"\n [tuiAutoFocus]=\"!$first\"\n placeholder=\"\u0428\u0438\u0440\u0438\u043D\u0430\"\n autocomplete=\"off\"\n />\n @if (product.value) {\n <input\n tuiSlider\n type=\"range\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"width\" />\n </label>\n\n <label tuiLabel>\n \u0414\u043B\u0438\u043D\u0430, \u043C\u043C\n <tui-textfield>\n <input\n tuiInputSlider\n formControlName=\"length\"\n [min]=\"settings()?.minLength ?? 0\"\n [max]=\"product.value?.properties?.length ?? 0\"\n [tuiNumberFormat]=\"{ precision: 0 }\"\n [readOnly]=\"!product.value || isItemLocked(itemIndex) || isItemLoading(itemIndex)\"\n placeholder=\"\u0414\u043B\u0438\u043D\u0430\"\n autocomplete=\"off\"\n />\n @if (product.value) {\n <input\n tuiSlider\n type=\"range\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"length\" />\n </label>\n </div>\n\n <!-- \u0413\u0440\u0443\u043F\u043F\u0430 2: \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E + \u043C\u0430\u0440\u043A\u0438\u0440\u043E\u0432\u043A\u0430 (\u043D\u0430 lg 1fr | 2fr) -->\n <div class=\"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:!grid-cols-[1fr_2fr] lg:!flex-[3]\">\n <label tuiLabel>\n <span class=\"whitespace-nowrap\">\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E, \u0448\u0442</span>\n <tui-textfield [tuiTextfieldCleaner]=\"false\">\n <input\n tuiInputNumber\n formControlName=\"count\"\n [min]=\"1\"\n [tuiNumberFormat]=\"{ precision: 0 }\"\n [readOnly]=\"!product.value || isItemLocked(itemIndex) || isItemLoading(itemIndex)\"\n placeholder=\"\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E\"\n autocomplete=\"off\"\n />\n </tui-textfield>\n <tui-error formControlName=\"count\" />\n </label>\n\n <label tuiLabel>\n \u041C\u0430\u0440\u043A\u0438\u0440\u043E\u0432\u043A\u0430\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"marker\"\n [readOnly]=\"!product.value || isItemLocked(itemIndex) || isItemLoading(itemIndex)\"\n placeholder=\"\u041C\u0430\u0440\u043A\u0438\u0440\u043E\u0432\u043A\u0430\"\n autocomplete=\"off\"\n />\n </tui-textfield>\n <tui-error formControlName=\"marker\" />\n </label>\n </div>\n </div>\n\n @let rowVal = item.getRawValue();\n\n @if (rowVal.width > 0 && rowVal.length > 0) {\n <div class=\"mt-1 flex flex-col gap-y-1 text-sm lg:!flex-row lg:!gap-6\">\n @if (pieceAreaM2(rowVal) > 0) {\n <div class=\"lg:!flex-[2]\">\n \u041F\u043B\u043E\u0449\u0430\u0434\u044C (S) =\n <span class=\"font-bold\">{{ pieceAreaM2(rowVal) | tuiFormatNumber: areaFormat }} \u043C\u00B2</span>\n </div>\n }\n @if (productValue && rowCost(rowVal) > 0) {\n <div class=\"lg:!flex-[3]\">\n \u0418\u0442\u043E\u0433\u043E:\n <span class=\"font-bold\">{{ rowCost(rowVal) | tuiFormatNumber: moneyFormat }} {{ productValue.currency.symbol }}</span>\n </div>\n }\n </div>\n }\n </div>\n\n @if (!isEditingExistingItem()) {\n <button\n tuiIconButton\n title=\"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0438\u0437\u0434\u0435\u043B\u0438\u0435\"\n (click)=\"removeItem(itemIndex)\"\n [disabled]=\"items.length <= 1 || !product.value || isItemLoading(itemIndex)\"\n size=\"m\"\n type=\"button\"\n iconStart=\"@tui.trash-2\"\n appearance=\"secondary\"\n class=\"mt-6 shrink-0 lg:!ml-4\"\n [style.flex]=\"'0 0 auto'\"\n ></button>\n }\n </div>\n </tui-loader>\n </div>\n }\n </div>\n\n @if (productValue) {\n <hr class=\"border-sc-grey h-px\" />\n <div class=\"min-w-0 gap-1 pt-2 text-right\">\n @if (totalAreaM2() > 0) {\n <div>\n \u041E\u0431\u0449\u0430\u044F \u043F\u043B\u043E\u0449\u0430\u0434\u044C:\n <span class=\"font-bold\">{{ totalAreaM2() | tuiFormatNumber: areaFormat }} \u043C\u00B2</span>\n </div>\n }\n @if (productValue.costRub && totalCost() > 0) {\n <div>\n \u0418\u0442\u043E\u0433\u043E:\n <span class=\"whitespace-nowrap text-xl font-bold\"> {{ totalCost() | tuiFormatNumber: moneyFormat }} {{ productValue.currency.symbol }} </span>\n </div>\n }\n </div>\n }\n </div>\n\n <tui-error [formGroup]=\"form\" />\n\n <div class=\"flex flex-wrap items-center gap-3\">\n @if (productValue && !isEditingExistingItem()) {\n <button\n tuiButton\n appearance=\"secondary\"\n [disabled]=\"!product.value || items.invalid\"\n (click)=\"addItem()\"\n type=\"button\"\n iconStart=\"@tui.plus\"\n >\n \u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0438\u0437\u0434\u0435\u043B\u0438\u0435\n </button>\n }\n <button\n type=\"submit\"\n [disabled]=\"form.invalid || isSubmitLoading() || hasNoPendingItems()\"\n [loading]=\"isSubmitLoading()\"\n tuiButton\n class=\"ml-auto\"\n iconStart=\"@tui.check\"\n >\n {{ !orderItem() ? '\u0412 \u043A\u043E\u0440\u0437\u0438\u043D\u0443' : '\u0418\u0437\u043C\u0435\u043D\u0438\u0442\u044C' }}\n </button>\n </div>\n </form>\n</div>\n", styles: [":host{display:block;width:100%;max-width:36rem}.row-summary{color:var(--tui-text-secondary);font-size:.75rem}\n"] }]
|
|
6013
6426
|
}], propDecorators: { settings: [{ type: i0.Input, args: [{ isSignal: true, alias: "settings", required: false }] }], categoryId: [{ type: i0.Input, args: [{ isSignal: true, alias: "categoryId", required: true }] }], editor: [{ type: i0.Input, args: [{ isSignal: true, alias: "editor", required: true }] }], orderItem: [{ type: i0.Input, args: [{ isSignal: true, alias: "orderItem", required: true }] }], orderId: [{
|
|
6014
6427
|
type: Input
|
|
6015
6428
|
}], toggleShowEvent: [{ type: i0.Output, args: ["toggleShowEvent"] }] } });
|
|
@@ -6704,6 +7117,10 @@ class ScAddDeliveryAddressDialogComponent {
|
|
|
6704
7117
|
* Список стран.
|
|
6705
7118
|
*/
|
|
6706
7119
|
this.countries = getCountries();
|
|
7120
|
+
/**
|
|
7121
|
+
* Сервис-реестр качества адресов, выбранных из подсказок.
|
|
7122
|
+
*/
|
|
7123
|
+
this.addressQualityService = inject(ScAddressQualityService);
|
|
6707
7124
|
/**
|
|
6708
7125
|
* {@link Observable} запроса данных добавления адрес доставки.
|
|
6709
7126
|
*/
|
|
@@ -6731,7 +7148,10 @@ class ScAddDeliveryAddressDialogComponent {
|
|
|
6731
7148
|
/**
|
|
6732
7149
|
* Группа с полями адресов.
|
|
6733
7150
|
*/
|
|
6734
|
-
this.addressControl = new FormControl(null,
|
|
7151
|
+
this.addressControl = new FormControl(null, [
|
|
7152
|
+
Validators.required,
|
|
7153
|
+
this.addressQualityService.validator,
|
|
7154
|
+
]);
|
|
6735
7155
|
/**
|
|
6736
7156
|
* Настройки карты.
|
|
6737
7157
|
*/
|
|
@@ -6757,14 +7177,6 @@ class ScAddDeliveryAddressDialogComponent {
|
|
|
6757
7177
|
}),
|
|
6758
7178
|
});
|
|
6759
7179
|
}
|
|
6760
|
-
/**
|
|
6761
|
-
* Округляет координаты до 6 цифр после запятой.
|
|
6762
|
-
*
|
|
6763
|
-
* @param coords Координаты точки.
|
|
6764
|
-
*/
|
|
6765
|
-
static roundCoordinate(coords) {
|
|
6766
|
-
return coords.map((coord) => Math.round(coord * 1e6) / 1e6);
|
|
6767
|
-
}
|
|
6768
7180
|
/** @inheritdoc */
|
|
6769
7181
|
ngAfterViewInit() {
|
|
6770
7182
|
this.userMetrikaService.emitUserMetrikaEvent({
|
|
@@ -6797,7 +7209,7 @@ class ScAddDeliveryAddressDialogComponent {
|
|
|
6797
7209
|
*/
|
|
6798
7210
|
onSelectedAddress(suggestion) {
|
|
6799
7211
|
if ('addressString' in suggestion && suggestion.geoCoordinates) {
|
|
6800
|
-
const coords =
|
|
7212
|
+
const coords = [suggestion.geoCoordinates.lat, suggestion.geoCoordinates.long].map((coord) => ScNumberHelper.roundCoordinate(coord));
|
|
6801
7213
|
this.addressPlacemark ??= this.createPlacemark(coords);
|
|
6802
7214
|
this.setGeoCoordinates(coords);
|
|
6803
7215
|
if (!this.yaMap?.geoObjects.getLength()) {
|
|
@@ -6810,6 +7222,19 @@ class ScAddDeliveryAddressDialogComponent {
|
|
|
6810
7222
|
}
|
|
6811
7223
|
}
|
|
6812
7224
|
}
|
|
7225
|
+
/**
|
|
7226
|
+
* Возвращает признак, что адрес введён, но вариант с координатами не выбран: под полем показывается ошибка «Выберите вариант из списка».
|
|
7227
|
+
*/
|
|
7228
|
+
isAddressWithoutCoordinates() {
|
|
7229
|
+
return this.addressControl.valid && this.form.controls.coordinates.invalid;
|
|
7230
|
+
}
|
|
7231
|
+
/**
|
|
7232
|
+
* Возвращает текст предупреждения о полноте выбранного адреса доставки либо null, когда предупреждение не требуется
|
|
7233
|
+
* или вместо него показана ошибка «Выберите вариант из списка».
|
|
7234
|
+
*/
|
|
7235
|
+
getAddressQualityWarning() {
|
|
7236
|
+
return this.isAddressWithoutCoordinates() ? null : this.addressQualityService.getWarningMessage(this.addressControl);
|
|
7237
|
+
}
|
|
6813
7238
|
/**
|
|
6814
7239
|
* Устанавливает {@link addressPlacemark} точку на определённые координаты.
|
|
6815
7240
|
*
|
|
@@ -6820,8 +7245,8 @@ class ScAddDeliveryAddressDialogComponent {
|
|
|
6820
7245
|
this.addressPlacemark.geometry?.setCoordinates(coords);
|
|
6821
7246
|
this.form.patchValue({
|
|
6822
7247
|
coordinates: {
|
|
6823
|
-
lat:
|
|
6824
|
-
long:
|
|
7248
|
+
lat: coords[0],
|
|
7249
|
+
long: coords[1],
|
|
6825
7250
|
},
|
|
6826
7251
|
});
|
|
6827
7252
|
}
|
|
@@ -6857,13 +7282,13 @@ class ScAddDeliveryAddressDialogComponent {
|
|
|
6857
7282
|
placemark.events.add('dragend', () => {
|
|
6858
7283
|
const coord = this.addressPlacemark?.geometry?.getCoordinates();
|
|
6859
7284
|
if (coord) {
|
|
6860
|
-
this.setGeoCoordinates(
|
|
7285
|
+
this.setGeoCoordinates(coord.map((value) => ScNumberHelper.roundCoordinate(value)));
|
|
6861
7286
|
}
|
|
6862
7287
|
});
|
|
6863
7288
|
return placemark;
|
|
6864
7289
|
}
|
|
6865
7290
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScAddDeliveryAddressDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
6866
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScAddDeliveryAddressDialogComponent, isStandalone: true, selector: "sc-add-delivery-address-dialog", ngImport: i0, template: "@let isEnabledAddDeliveryAddress = isDefaultCountry | async;\n\n@if (isEnabledAddDeliveryAddress) {\n <div class=\"relative flex flex-col gap-3 md:flex-row\">\n <form\n [formGroup]=\"form\"\n (ngSubmit)=\"onSubmit$.next()\"\n class=\"flex w-full flex-col gap-3\"\n >\n <label tuiLabel>\n \u0410\u0434\u0440\u0435\u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"address\"\n [invalid]=\"(addressControl.valid && form.controls.coordinates.invalid) || null\"\n placeholder=\"\u0410\u0434\u0440\u0435\u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.address\"\n (selectedClick)=\"onSelectedAddress($event)\"\n />\n </tui-textfield>\n <tui-error formControlName=\"address\" />\n @if (addressControl.valid && form.controls.coordinates.invalid) {\n <tui-error [error]=\"'\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0432\u0430\u0440\u0438\u0430\u043D\u0442 \u0438\u0437 \u0441\u043F\u0438\u0441\u043A\u0430'\" />\n }\n </label>\n <div\n formGroupName=\"contact\"\n class=\"flex grow flex-col gap-2\"\n >\n <p class=\"w-full font-bold\">\u041A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u043E\u0435 \u043B\u0438\u0446\u043E:</p>\n <label tuiLabel>\n \u0424.\u0418.\u041E.\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"name\"\n placeholder=\"\u0424.\u0418.\u041E.\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.fio\"\n />\n </tui-textfield>\n <tui-error formControlName=\"name\" />\n </label>\n <label tuiLabel>\n \u0422\u0435\u043B\u0435\u0444\u043E\u043D\n <tui-textfield>\n <input\n formControlName=\"phone\"\n tuiInputPhoneInternational\n [countrySearch]=\"true\"\n [countries]=\"(countries | tuiSortCountries) || []\"\n autocomplete=\"phone\"\n placeholder=\"\u0422\u0435\u043B\u0435\u0444\u043E\u043D\"\n />\n </tui-textfield>\n <tui-error formControlName=\"phone\" />\n </label>\n <label tuiLabel>\n \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\n <tui-textfield>\n <input\n tuiInput\n type=\"email\"\n formControlName=\"email\"\n placeholder=\"\u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.email\"\n />\n </tui-textfield>\n <tui-error formControlName=\"email\" />\n </label>\n <label tuiLabel>\n \u0414\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"position\"\n placeholder=\"\u0414\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C\"\n />\n </tui-textfield>\n <tui-error formControlName=\"position\" />\n </label>\n </div>\n <div class=\"flex justify-center gap-8\">\n <button\n tuiButton\n (click)=\"context.$implicit.complete()\"\n type=\"button\"\n iconStart=\"@tui.x\"\n appearance=\"secondary\"\n >\n \u041E\u0442\u043C\u0435\u043D\u0430\n </button>\n <button\n tuiButton\n iconStart=\"@tui.save\"\n [disabled]=\"form.invalid\"\n [loading]=\"!!(loading$ | async)\"\n type=\"submit\"\n >\n \u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C\n </button>\n </div>\n </form>\n\n <div\n class=\"absolute -z-10 flex size-full md:w-1/2\"\n [ngClass]=\"{ 'z-0 relative': addressPlacemark }\"\n >\n <div\n class=\"flex-auto\"\n [ngClass]=\"{ 'pointer-events-none opacity-50': form.controls.coordinates.invalid }\"\n >\n <ya-map\n [zoom]=\"11\"\n [state]=\"{ controls: [] }\"\n (ready)=\"onMapReadyHandle($event)\"\n [options]=\"options\"\n />\n </div>\n </div>\n </div>\n} @else {\n @let helpContacts = userHelpContacts$ | async;\n\n @if (helpContacts && helpContacts.length) {\n <tui-push\n type=\"\u0427\u0442\u043E\u0431\u044B \u0434\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0430\u0434\u0440\u0435\u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438, \u0441\u0432\u044F\u0436\u0438\u0442\u0435\u0441\u044C \u0441 \u043D\u0430\u043C\u0438\"\n class=\"!w-auto\"\n >\n <tui-icon icon=\"@tui.message-square\" />\n <sc-manager-card [manager]=\"helpContacts[0]\" />\n </tui-push>\n }\n}\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: i2.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler"] }, { kind: "directive", type: i3.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { kind: "directive", type: i2.TuiInputDirective, selector: "input[tuiInput]", inputs: ["readOnly", "invalid", "focused", "state"] }, { kind: "component", type: i2.TuiErrorComponent, selector: "tui-error", inputs: ["error"] }, { kind: "directive", type: i2.TuiErrorDirective, selector: "tui-error[ngModel], tui-error[formControlName], tui-error[formControl], tui-error[formGroup], tui-error[formGroupName], tui-error[formArrayName], tui-error[formArray]", inputs: ["order"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: TuiButtonLoading, selector: "[tuiButton][loading],[tuiIconButton][loading]", inputs: ["size", "loading"] }, { kind: "component", type: TuiIcon, selector: "tui-icon:not([tuiBadge])", inputs: ["background"] }, { kind: "component", type: i1$1.TuiPushComponent, selector: "tui-push", inputs: ["heading", "type", "lines", "timestamp"], outputs: ["close"] }, { kind: "component", type: i1$1.TuiInputPhoneInternationalComponent, selector: "input[tuiInputPhoneInternational]", inputs: ["countrySearch", "countryIsoCode", "countries"], outputs: ["countryIsoCodeChange"] }, { kind: "component", type: ScSuggestionFieldComponent, selector: "sc-suggestion-field", inputs: ["type"], outputs: ["selectedClick"] }, { kind: "component", type: ScManagerCardComponent, selector: "sc-manager-card", inputs: ["manager"] }, { kind: "component", type: YaMapComponent, selector: "ya-map", inputs: ["center", "zoom", "state", "options"], outputs: ["ready", "actionbegin", "actionbreak", "actionend", "actiontick", "actiontickcomplete", "balloonclose", "balloonopen", "boundschange", "yaclick", "yacontextmenu", "yadblclick", "destroy", "hintclose", "hintopen", "marginchange", "yamousedown", "yamouseenter", "yamouseleave", "yamousemove", "yamouseup", "multitouchend", "multitouchmove", "multitouchstart", "optionschange", "sizechange", "typechange", "yawheel"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: TuiSortCountriesPipe, name: "tuiSortCountries" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
7291
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScAddDeliveryAddressDialogComponent, isStandalone: true, selector: "sc-add-delivery-address-dialog", ngImport: i0, template: "@let isEnabledAddDeliveryAddress = isDefaultCountry | async;\n\n@if (isEnabledAddDeliveryAddress) {\n <div class=\"relative flex flex-col gap-3 md:flex-row\">\n <form\n [formGroup]=\"form\"\n (ngSubmit)=\"onSubmit$.next()\"\n class=\"flex w-full flex-col gap-3\"\n >\n <label tuiLabel>\n \u0410\u0434\u0440\u0435\u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"address\"\n [invalid]=\"isAddressWithoutCoordinates() || null\"\n placeholder=\"\u0410\u0434\u0440\u0435\u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.address\"\n (selectedClick)=\"onSelectedAddress($event)\"\n />\n </tui-textfield>\n <tui-error formControlName=\"address\" />\n @if (isAddressWithoutCoordinates()) {\n <tui-error [error]=\"'\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0432\u0430\u0440\u0438\u0430\u043D\u0442 \u0438\u0437 \u0441\u043F\u0438\u0441\u043A\u0430'\" />\n }\n @if (getAddressQualityWarning(); as addressQualityWarning) {\n <p class=\"text-xs text-tui-status-warning\">{{ addressQualityWarning }}</p>\n }\n </label>\n <div\n formGroupName=\"contact\"\n class=\"flex grow flex-col gap-2\"\n >\n <p class=\"w-full font-bold\">\u041A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u043E\u0435 \u043B\u0438\u0446\u043E:</p>\n <label tuiLabel>\n \u0424.\u0418.\u041E.\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"name\"\n placeholder=\"\u0424.\u0418.\u041E.\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.fio\"\n />\n </tui-textfield>\n <tui-error formControlName=\"name\" />\n </label>\n <label tuiLabel>\n \u0422\u0435\u043B\u0435\u0444\u043E\u043D\n <tui-textfield>\n <input\n formControlName=\"phone\"\n tuiInputPhoneInternational\n [countrySearch]=\"true\"\n [countries]=\"(countries | tuiSortCountries) || []\"\n autocomplete=\"phone\"\n placeholder=\"\u0422\u0435\u043B\u0435\u0444\u043E\u043D\"\n />\n </tui-textfield>\n <tui-error formControlName=\"phone\" />\n </label>\n <label tuiLabel>\n \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\n <tui-textfield>\n <input\n tuiInput\n type=\"email\"\n formControlName=\"email\"\n placeholder=\"\u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.email\"\n />\n </tui-textfield>\n <tui-error formControlName=\"email\" />\n </label>\n <label tuiLabel>\n \u0414\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"position\"\n placeholder=\"\u0414\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C\"\n />\n </tui-textfield>\n <tui-error formControlName=\"position\" />\n </label>\n </div>\n <div class=\"flex justify-center gap-8\">\n <button\n tuiButton\n (click)=\"context.$implicit.complete()\"\n type=\"button\"\n iconStart=\"@tui.x\"\n appearance=\"secondary\"\n >\n \u041E\u0442\u043C\u0435\u043D\u0430\n </button>\n <button\n tuiButton\n iconStart=\"@tui.save\"\n [disabled]=\"form.invalid\"\n [loading]=\"!!(loading$ | async)\"\n type=\"submit\"\n >\n \u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C\n </button>\n </div>\n </form>\n\n <div\n class=\"absolute -z-10 flex size-full md:w-1/2\"\n [ngClass]=\"{ 'z-0 relative': addressPlacemark }\"\n >\n <div\n class=\"flex-auto\"\n [ngClass]=\"{ 'pointer-events-none opacity-50': form.controls.coordinates.invalid }\"\n >\n <ya-map\n [zoom]=\"11\"\n [state]=\"{ controls: [] }\"\n (ready)=\"onMapReadyHandle($event)\"\n [options]=\"options\"\n />\n </div>\n </div>\n </div>\n} @else {\n @let helpContacts = userHelpContacts$ | async;\n\n @if (helpContacts && helpContacts.length) {\n <tui-push\n type=\"\u0427\u0442\u043E\u0431\u044B \u0434\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0430\u0434\u0440\u0435\u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438, \u0441\u0432\u044F\u0436\u0438\u0442\u0435\u0441\u044C \u0441 \u043D\u0430\u043C\u0438\"\n class=\"!w-auto\"\n >\n <tui-icon icon=\"@tui.message-square\" />\n <sc-manager-card [manager]=\"helpContacts[0]\" />\n </tui-push>\n }\n}\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: i2.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler"] }, { kind: "directive", type: i3.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { kind: "directive", type: i2.TuiInputDirective, selector: "input[tuiInput]", inputs: ["readOnly", "invalid", "focused", "state"] }, { kind: "component", type: i2.TuiErrorComponent, selector: "tui-error", inputs: ["error"] }, { kind: "directive", type: i2.TuiErrorDirective, selector: "tui-error[ngModel], tui-error[formControlName], tui-error[formControl], tui-error[formGroup], tui-error[formGroupName], tui-error[formArrayName], tui-error[formArray]", inputs: ["order"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: TuiButtonLoading, selector: "[tuiButton][loading],[tuiIconButton][loading]", inputs: ["size", "loading"] }, { kind: "component", type: TuiIcon, selector: "tui-icon:not([tuiBadge])", inputs: ["background"] }, { kind: "component", type: i1$1.TuiPushComponent, selector: "tui-push", inputs: ["heading", "type", "lines", "timestamp"], outputs: ["close"] }, { kind: "component", type: i1$1.TuiInputPhoneInternationalComponent, selector: "input[tuiInputPhoneInternational]", inputs: ["countrySearch", "countryIsoCode", "countries"], outputs: ["countryIsoCodeChange"] }, { kind: "component", type: ScSuggestionFieldComponent, selector: "sc-suggestion-field", inputs: ["type", "showAddressQuality"], outputs: ["selectedClick"] }, { kind: "component", type: ScManagerCardComponent, selector: "sc-manager-card", inputs: ["manager"] }, { kind: "component", type: YaMapComponent, selector: "ya-map", inputs: ["center", "zoom", "state", "options"], outputs: ["ready", "actionbegin", "actionbreak", "actionend", "actiontick", "actiontickcomplete", "balloonclose", "balloonopen", "boundschange", "yaclick", "yacontextmenu", "yadblclick", "destroy", "hintclose", "hintopen", "marginchange", "yamousedown", "yamouseenter", "yamouseleave", "yamousemove", "yamouseup", "multitouchend", "multitouchmove", "multitouchstart", "optionschange", "sizechange", "typechange", "yawheel"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: TuiSortCountriesPipe, name: "tuiSortCountries" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
6867
7292
|
}
|
|
6868
7293
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScAddDeliveryAddressDialogComponent, decorators: [{
|
|
6869
7294
|
type: Component,
|
|
@@ -6884,7 +7309,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
|
|
|
6884
7309
|
ScSuggestionFieldComponent,
|
|
6885
7310
|
ScManagerCardComponent,
|
|
6886
7311
|
YaMapComponent,
|
|
6887
|
-
], template: "@let isEnabledAddDeliveryAddress = isDefaultCountry | async;\n\n@if (isEnabledAddDeliveryAddress) {\n <div class=\"relative flex flex-col gap-3 md:flex-row\">\n <form\n [formGroup]=\"form\"\n (ngSubmit)=\"onSubmit$.next()\"\n class=\"flex w-full flex-col gap-3\"\n >\n <label tuiLabel>\n \u0410\u0434\u0440\u0435\u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"address\"\n [invalid]=\"(
|
|
7312
|
+
], template: "@let isEnabledAddDeliveryAddress = isDefaultCountry | async;\n\n@if (isEnabledAddDeliveryAddress) {\n <div class=\"relative flex flex-col gap-3 md:flex-row\">\n <form\n [formGroup]=\"form\"\n (ngSubmit)=\"onSubmit$.next()\"\n class=\"flex w-full flex-col gap-3\"\n >\n <label tuiLabel>\n \u0410\u0434\u0440\u0435\u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"address\"\n [invalid]=\"isAddressWithoutCoordinates() || null\"\n placeholder=\"\u0410\u0434\u0440\u0435\u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.address\"\n (selectedClick)=\"onSelectedAddress($event)\"\n />\n </tui-textfield>\n <tui-error formControlName=\"address\" />\n @if (isAddressWithoutCoordinates()) {\n <tui-error [error]=\"'\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0432\u0430\u0440\u0438\u0430\u043D\u0442 \u0438\u0437 \u0441\u043F\u0438\u0441\u043A\u0430'\" />\n }\n @if (getAddressQualityWarning(); as addressQualityWarning) {\n <p class=\"text-xs text-tui-status-warning\">{{ addressQualityWarning }}</p>\n }\n </label>\n <div\n formGroupName=\"contact\"\n class=\"flex grow flex-col gap-2\"\n >\n <p class=\"w-full font-bold\">\u041A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u043E\u0435 \u043B\u0438\u0446\u043E:</p>\n <label tuiLabel>\n \u0424.\u0418.\u041E.\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"name\"\n placeholder=\"\u0424.\u0418.\u041E.\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.fio\"\n />\n </tui-textfield>\n <tui-error formControlName=\"name\" />\n </label>\n <label tuiLabel>\n \u0422\u0435\u043B\u0435\u0444\u043E\u043D\n <tui-textfield>\n <input\n formControlName=\"phone\"\n tuiInputPhoneInternational\n [countrySearch]=\"true\"\n [countries]=\"(countries | tuiSortCountries) || []\"\n autocomplete=\"phone\"\n placeholder=\"\u0422\u0435\u043B\u0435\u0444\u043E\u043D\"\n />\n </tui-textfield>\n <tui-error formControlName=\"phone\" />\n </label>\n <label tuiLabel>\n \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\n <tui-textfield>\n <input\n tuiInput\n type=\"email\"\n formControlName=\"email\"\n placeholder=\"\u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.email\"\n />\n </tui-textfield>\n <tui-error formControlName=\"email\" />\n </label>\n <label tuiLabel>\n \u0414\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"position\"\n placeholder=\"\u0414\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C\"\n />\n </tui-textfield>\n <tui-error formControlName=\"position\" />\n </label>\n </div>\n <div class=\"flex justify-center gap-8\">\n <button\n tuiButton\n (click)=\"context.$implicit.complete()\"\n type=\"button\"\n iconStart=\"@tui.x\"\n appearance=\"secondary\"\n >\n \u041E\u0442\u043C\u0435\u043D\u0430\n </button>\n <button\n tuiButton\n iconStart=\"@tui.save\"\n [disabled]=\"form.invalid\"\n [loading]=\"!!(loading$ | async)\"\n type=\"submit\"\n >\n \u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C\n </button>\n </div>\n </form>\n\n <div\n class=\"absolute -z-10 flex size-full md:w-1/2\"\n [ngClass]=\"{ 'z-0 relative': addressPlacemark }\"\n >\n <div\n class=\"flex-auto\"\n [ngClass]=\"{ 'pointer-events-none opacity-50': form.controls.coordinates.invalid }\"\n >\n <ya-map\n [zoom]=\"11\"\n [state]=\"{ controls: [] }\"\n (ready)=\"onMapReadyHandle($event)\"\n [options]=\"options\"\n />\n </div>\n </div>\n </div>\n} @else {\n @let helpContacts = userHelpContacts$ | async;\n\n @if (helpContacts && helpContacts.length) {\n <tui-push\n type=\"\u0427\u0442\u043E\u0431\u044B \u0434\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0430\u0434\u0440\u0435\u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438, \u0441\u0432\u044F\u0436\u0438\u0442\u0435\u0441\u044C \u0441 \u043D\u0430\u043C\u0438\"\n class=\"!w-auto\"\n >\n <tui-icon icon=\"@tui.message-square\" />\n <sc-manager-card [manager]=\"helpContacts[0]\" />\n </tui-push>\n }\n}\n" }]
|
|
6888
7313
|
}] });
|
|
6889
7314
|
|
|
6890
7315
|
/**
|
|
@@ -7783,28 +8208,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
|
|
|
7783
8208
|
}]
|
|
7784
8209
|
}], propDecorators: { orderId: [{ type: i0.Input, args: [{ isSignal: true, alias: "orderId", required: false }] }] } });
|
|
7785
8210
|
|
|
7786
|
-
/**
|
|
7787
|
-
* Группа позиций заказа по направлению продаж.
|
|
7788
|
-
*/
|
|
7789
|
-
class ScOrderItemsByDirection {
|
|
7790
|
-
/**
|
|
7791
|
-
* @param direction Направление продаж.
|
|
7792
|
-
* @param allItems Все элементы заказа.
|
|
7793
|
-
*/
|
|
7794
|
-
constructor(direction, allItems) {
|
|
7795
|
-
this.direction = direction;
|
|
7796
|
-
this.items = allItems.filter((item) => item.salesDirection === direction.id);
|
|
7797
|
-
}
|
|
7798
|
-
/**
|
|
7799
|
-
* Получает список позиций заказа по идентификаторам.
|
|
7800
|
-
*
|
|
7801
|
-
* @param itemsIds Идентификаторы позиций.
|
|
7802
|
-
*/
|
|
7803
|
-
getItemsByIds(itemsIds) {
|
|
7804
|
-
return this.items.filter((item) => itemsIds.includes(item.id));
|
|
7805
|
-
}
|
|
7806
|
-
}
|
|
7807
|
-
|
|
7808
8211
|
/**
|
|
7809
8212
|
* Компонент карточки элемента корзины.
|
|
7810
8213
|
*/
|
|
@@ -7819,6 +8222,10 @@ class ScOrderItemComponent extends AbstractScPriceCard {
|
|
|
7819
8222
|
* Событие нажатия на кнопку редактирования конфигурации.
|
|
7820
8223
|
*/
|
|
7821
8224
|
this.clickSettings = output();
|
|
8225
|
+
/**
|
|
8226
|
+
* Настройки вывода сумм в рублях.
|
|
8227
|
+
*/
|
|
8228
|
+
this.moneyFormat = ScNumberHelper.getMoneyFormat();
|
|
7822
8229
|
/**
|
|
7823
8230
|
* Сервис диалогового окна предварительного просмотра.
|
|
7824
8231
|
*/
|
|
@@ -7862,7 +8269,7 @@ class ScOrderItemComponent extends AbstractScPriceCard {
|
|
|
7862
8269
|
appearance: signal('textfield'),
|
|
7863
8270
|
}),
|
|
7864
8271
|
tuiHintOptionsProvider({ direction: 'top', showDelay: 100, hideDelay: 100 }),
|
|
7865
|
-
], usesInheritance: true, ngImport: i0, template: "@if (product && orderItem) {\n <div class=\"@container relative flex w-full gap-4 rounded-xl p-1 text-body-s hover:bg-tui-background-neutral-1\">\n <sc-noindex-wrapper>\n @let isDisabled = product.isHidden || product.isNull;\n <sc-hover-image-carousel\n (click)=\"isDisabled ? null : clickCardEvent.emit()\"\n [images]=\"!isMobile ? getCardImagePreviewList(product) : [getCardImagePreview()]\"\n [isShowActions]=\"false\"\n class=\"aspect-square w-24 shrink-0 cursor-pointer self-start\"\n />\n <div class=\"flex w-full flex-col gap-y-1 gap-x-4 @5xl:flex-row @5xl:items-center @5xl:gap-5\">\n <div class=\"flex min-w-0 flex-1 flex-col gap-1\">\n <div\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n class=\"text-tui-text-02\"\n >\n \u0410\u0440\u0442\u0438\u043A\u0443\u043B: {{ product.code }}\n </div>\n <div class=\"flex flex-col gap-1\">\n <a\n tuiLink\n [attr.href]=\"href ?? null\"\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n (click)=\"$event.preventDefault(); clickCardEvent.emit()\"\n [class.disabled]=\"isDisabled\"\n class=\"!text-body-m-bold\"\n >\n {{ product.name }}\n </a>\n @if (product.supplierSku) {\n <span class=\"text-tui-text-02\"> \u0410\u0440\u0442\u0438\u043A\u0443\u043B \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F: {{ product.supplierSku }} </span>\n }\n @if (product.pack) {\n <div class=\"flex items-center gap-1 text-tui-text-02\">\n \u041D\u043E\u0440\u043C\u0430 \u0443\u043F\u0430\u043A\u043E\u0432\u043A\u0438: {{ product.pack }}\n @if (product.ignoreMinCountCheck) {\n <tui-icon\n icon=\"@tui.package\"\n [tuiHint]=\"minCountHint\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n class=\"text-body-xl text-tui-text-01 opacity-90\"\n />\n <ng-template #minCountHint>\n \u0414\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u0437\u0430\u043A\u0430\u0437 <br />\n \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u043B\u044C\u043D\u043E\u0433\u043E <br />\n \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430\n </ng-template>\n }\n </div>\n }\n\n <sc-cost-with-discount\n scPrint=\"cost\"\n [product]=\"product\"\n />\n </div>\n @if (orderItem.specificationImgUrl) {\n <a\n tuiLink\n (click)=\"showSpecification(specificationPreview)\"\n [class.disabled]=\"isDisabled\"\n >\n \u0421\u043F\u0435\u0446\u0438\u0444\u0438\u043A\u0430\u0446\u0438\u044F\n </a>\n }\n <ng-template\n #specificationPreview\n let-preview\n >\n <tui-preview\n [rotatable]=\"false\"\n [zoomable]=\"false\"\n >\n <img\n *polymorpheusOutlet=\"orderItem.specificationImgUrl as src\"\n alt=\"preview\"\n [src]=\"orderItem.specificationImgUrl\"\n />\n <button\n iconStart=\"@tui.x\"\n title=\"Close\"\n tuiIconButton\n tuiPreviewAction\n type=\"button\"\n (click)=\"preview.complete()\"\n ></button>\n </tui-preview>\n </ng-template>\n </div>\n <div class=\"grid grid-cols-1 @lg:grid-cols-3 gap-2 @2xl:gap-4 @2xl:grid-rows-1\">\n <div class=\"grid grid-cols-1 items-center @lg:gap-2 @2xl:grid-cols-2 @lg:col-span-2\">\n <!-- \u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0442\u043E\u0432\u0430\u0440\u0430. -->\n @if (isShowEditControls() && showQuantityControl) {\n <!-- \u041F\u043E\u043B\u0435 \u0432\u0432\u043E\u0434\u0430 \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0442\u043E\u0432\u0430\u0440\u0430. -->\n <sc-input-quantity\n #inputQuantity\n [tuiAutoFocus]=\"autoFocuseQuantityInput()\"\n [formControl]=\"quantityControl\"\n size=\"m\"\n [showCross]=\"false\"\n [isDisabled]=\"isDisabled\"\n [step]=\"getProductMultiplicity(product)\"\n [ignoreStepValidators]=\"product.ignoreMinCountCheck\"\n [showLoader]=\"showLoader()\"\n (clickClearEvent)=\"clickClearEvent.emit(orderItem)\"\n (keydown.enter)=\"inputQuantity.nativeFocusableElement?.blur()\"\n class=\"w-32 shrink-0\"\n />\n } @else {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n >\n <div class=\"!text-body-m text-start\">\n \u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E:\n <strong> {{ orderItem.quantity }} \u0448\u0442.</strong>\n </div>\n </button>\n }\n\n @let showAdditionalInfo = orderItem.configurator || orderItem.height || orderItem.length || orderItem.width || orderItem.marker;\n @if (showAdditionalInfo) {\n <div class=\"flex items-center gap-2 @lg:gap-3 max-w-min\">\n <!-- \u041A\u043D\u043E\u043F\u043A\u0430 \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0442\u043E\u0432\u0430\u0440\u0430. -->\n @if (isShowEditControls()) {\n <button\n tuiIconButton\n [disabled]=\"isDisabled\"\n [loading]=\"showLoader()\"\n (click)=\"clickSettings.emit()\"\n size=\"s\"\n [appearance]=\"isConfiguratorHintVisible() ? 'primary' : 'secondary'\"\n class=\"shrink-0\"\n >\n <tui-icon icon=\"@tui.settings\" />\n </button>\n }\n\n <!-- \u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u0430\u044F \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F \u043E \u0442\u043E\u0432\u0430\u0440\u0435. -->\n <div\n class=\"flex flex-col gap-x-1 text-tui-base-07\"\n [class.text-body-m]=\"!isShowEditControls()\"\n >\n @if (orderItem.marker) {\n <p>\u041C\u0430\u0440\u043A\u0438\u0440\u043E\u0432\u043A\u0430: {{ orderItem.marker }}</p>\n }\n @if (orderItem.width) {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0448\u0438\u0440\u0438\u043D\u044B \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n class=\"text-body-s self-start whitespace-nowrap\"\n >\n \u0428\u0438\u0440\u0438\u043D\u0430: <span class=\"text-body-s-bold\">{{ orderItem.width }} \u043C.</span>\n </button>\n }\n @if (orderItem.height) {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0432\u044B\u0441\u043E\u0442\u044B \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n class=\"text-body-s self-start whitespace-nowrap\"\n >\n \u0412\u044B\u0441\u043E\u0442\u0430: <span class=\"text-body-s-bold\">{{ orderItem.height }} \u043C.</span>\n </button>\n } @else if (orderItem.length) {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0434\u043B\u0438\u043D\u044B \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n class=\"text-body-s self-start whitespace-nowrap\"\n >\n \u0414\u043B\u0438\u043D\u0430: <span class=\"text-body-s-bold\">{{ orderItem.length }} \u043C.</span>\n </button>\n }\n </div>\n </div>\n }\n </div>\n\n <!-- \u0421\u0443\u043C\u043C\u0430 \u0442\u043E\u0432\u0430\u0440\u0430 \u0438 \u0441\u043A\u043B\u0430\u0434\u0441\u043A\u043E\u0435 \u043D\u0430\u043B\u0438\u0447\u0438\u0435. -->\n <div\n scPrint=\"cost\"\n class=\"flex min-w-[11rem] flex-col @lg:justify-end @2xl:!justify-center text-body-m\"\n >\n <p class=\"whitespace-nowrap\">\n \u0421\u0443\u043C\u043C\u0430:\n <strong> {{ orderItem.costRub | tuiFormatNumber: { precision: 2, decimalSeparator: '.', rounding: 'ceil' } }} {{ 'RUB' | tuiCurrency }}</strong>\n </p>\n <sc-price-warehouse-stock\n scPrint=\"defaultNoPrint\"\n [product]=\"product\"\n />\n </div>\n </div>\n </div>\n </sc-noindex-wrapper>\n </div>\n} @else {\n <div class=\"tui-skeleton flex h-[8.25rem] w-full overflow-hidden rounded-xl\"></div>\n}\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: TuiIcon, selector: "tui-icon:not([tuiBadge])", inputs: ["background"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.TuiHintDirective, selector: "[tuiHint]:not(ng-container):not(ng-template)", inputs: ["tuiHint", "tuiHintContext", "tuiHintAppearance"], outputs: ["tuiHintVisible"] }, { kind: "directive", type: TuiLink, selector: "a[tuiLink], button[tuiLink]" }, { kind: "directive", type: TuiHighlight, selector: "[tuiHighlight]", inputs: ["tuiHighlight", "tuiHighlightColor"] }, { kind: "directive", type: TuiAutoFocus, selector: "[tuiAutoFocus]", inputs: ["tuiAutoFocus"] }, { kind: "component", type: ScHoverImageCarouselComponent, selector: "sc-hover-image-carousel", inputs: ["images", "isShowActions", "productName"] }, { kind: "component", type: CostWithDiscountComponent, selector: "sc-cost-with-discount", inputs: ["product", "size"] }, { kind: "component", type: ScPriceWarehouseStockComponent, selector: "sc-price-warehouse-stock", inputs: ["classList", "product", "withStockHint", "fromMain"] }, { kind: "component", type: ScInputQuantityComponent, selector: "sc-input-quantity", inputs: ["step", "showLoader", "showCross", "appearance", "isDisabled", "size", "ignoreStepValidators"], outputs: ["clickClearEvent"] }, { kind: "component", type: i1$1.TuiPreviewComponent, selector: "tui-preview", inputs: ["zoomable", "rotatable", "initialScale"] }, { kind: "directive", type: i1$1.TuiPreviewAction, selector: "[tuiPreviewAction]" }, { kind: "component", type: ScNoindexWrapperComponent, selector: "sc-noindex-wrapper" }, { kind: "component", type: TuiButtonLoading, selector: "[tuiButton][loading],[tuiIconButton][loading]", inputs: ["size", "loading"] }, { kind: "directive", type: ScPrintDirective, selector: "[scPrint]", inputs: ["scPrint"] }, { kind: "pipe", type: i1$2.AsyncPipe, name: "async" }, { kind: "pipe", type: TuiCurrencyPipe, name: "tuiCurrency" }, { kind: "pipe", type: TuiFormatNumberPipe, name: "tuiFormatNumber" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
8272
|
+
], usesInheritance: true, ngImport: i0, template: "@if (product && orderItem) {\n <div class=\"@container relative flex w-full gap-4 rounded-xl p-1 text-body-s hover:bg-tui-background-neutral-1\">\n <sc-noindex-wrapper>\n @let isDisabled = product.isHidden || product.isNull;\n <sc-hover-image-carousel\n (click)=\"isDisabled ? null : clickCardEvent.emit()\"\n [images]=\"!isMobile ? getCardImagePreviewList(product) : [getCardImagePreview()]\"\n [isShowActions]=\"false\"\n class=\"aspect-square w-24 shrink-0 cursor-pointer self-start\"\n />\n <div class=\"flex w-full flex-col gap-y-1 gap-x-4 @5xl:flex-row @5xl:items-center @5xl:gap-5\">\n <div class=\"flex min-w-0 flex-1 flex-col gap-1\">\n <div\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n class=\"text-tui-text-02\"\n >\n \u0410\u0440\u0442\u0438\u043A\u0443\u043B: {{ product.code }}\n </div>\n <div class=\"flex flex-col gap-1\">\n <a\n tuiLink\n [attr.href]=\"href ?? null\"\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n (click)=\"$event.preventDefault(); clickCardEvent.emit()\"\n [class.disabled]=\"isDisabled\"\n class=\"!text-body-m-bold\"\n >\n {{ product.name }}\n </a>\n @if (product.supplierSku) {\n <span class=\"text-tui-text-02\"> \u0410\u0440\u0442\u0438\u043A\u0443\u043B \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F: {{ product.supplierSku }} </span>\n }\n @if (product.pack) {\n <div class=\"flex items-center gap-1 text-tui-text-02\">\n \u041D\u043E\u0440\u043C\u0430 \u0443\u043F\u0430\u043A\u043E\u0432\u043A\u0438: {{ product.pack }}\n @if (product.ignoreMinCountCheck) {\n <tui-icon\n icon=\"@tui.package\"\n [tuiHint]=\"minCountHint\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n class=\"text-body-xl text-tui-text-01 opacity-90\"\n />\n <ng-template #minCountHint>\n \u0414\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u0437\u0430\u043A\u0430\u0437 <br />\n \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u043B\u044C\u043D\u043E\u0433\u043E <br />\n \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430\n </ng-template>\n }\n </div>\n }\n\n <sc-cost-with-discount\n scPrint=\"cost\"\n [product]=\"product\"\n />\n </div>\n @if (orderItem.specificationImgUrl) {\n <a\n tuiLink\n (click)=\"showSpecification(specificationPreview)\"\n [class.disabled]=\"isDisabled\"\n >\n \u0421\u043F\u0435\u0446\u0438\u0444\u0438\u043A\u0430\u0446\u0438\u044F\n </a>\n }\n <ng-template\n #specificationPreview\n let-preview\n >\n <tui-preview\n [rotatable]=\"false\"\n [zoomable]=\"false\"\n >\n <img\n *polymorpheusOutlet=\"orderItem.specificationImgUrl as src\"\n alt=\"preview\"\n [src]=\"orderItem.specificationImgUrl\"\n />\n <button\n iconStart=\"@tui.x\"\n title=\"Close\"\n tuiIconButton\n tuiPreviewAction\n type=\"button\"\n (click)=\"preview.complete()\"\n ></button>\n </tui-preview>\n </ng-template>\n </div>\n <div class=\"grid grid-cols-1 @lg:grid-cols-3 gap-2 @2xl:gap-4 @2xl:grid-rows-1\">\n <div class=\"grid grid-cols-1 items-center @lg:gap-2 @2xl:grid-cols-2 @lg:col-span-2\">\n <!-- \u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0442\u043E\u0432\u0430\u0440\u0430. -->\n @if (isShowEditControls() && showQuantityControl) {\n <!-- \u041F\u043E\u043B\u0435 \u0432\u0432\u043E\u0434\u0430 \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0442\u043E\u0432\u0430\u0440\u0430. -->\n <sc-input-quantity\n #inputQuantity\n [tuiAutoFocus]=\"autoFocuseQuantityInput()\"\n [formControl]=\"quantityControl\"\n size=\"m\"\n [showCross]=\"false\"\n [isDisabled]=\"isDisabled\"\n [step]=\"getProductMultiplicity(product)\"\n [ignoreStepValidators]=\"product.ignoreMinCountCheck\"\n [showLoader]=\"showLoader()\"\n (clickClearEvent)=\"clickClearEvent.emit(orderItem)\"\n (keydown.enter)=\"inputQuantity.nativeFocusableElement?.blur()\"\n class=\"w-32 shrink-0\"\n />\n } @else {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n >\n <div class=\"!text-body-m text-start\">\n \u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E:\n <strong> {{ orderItem.quantity }} \u0448\u0442.</strong>\n </div>\n </button>\n }\n\n @let showAdditionalInfo = orderItem.configurator || orderItem.height || orderItem.length || orderItem.width || orderItem.marker;\n @if (showAdditionalInfo) {\n <div class=\"flex items-center gap-2 @lg:gap-3 max-w-min\">\n <!-- \u041A\u043D\u043E\u043F\u043A\u0430 \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0442\u043E\u0432\u0430\u0440\u0430. -->\n @if (isShowEditControls()) {\n <button\n tuiIconButton\n [disabled]=\"isDisabled\"\n [loading]=\"showLoader()\"\n (click)=\"clickSettings.emit()\"\n size=\"s\"\n [appearance]=\"isConfiguratorHintVisible() ? 'primary' : 'secondary'\"\n class=\"shrink-0\"\n >\n <tui-icon icon=\"@tui.settings\" />\n </button>\n }\n\n <!-- \u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u0430\u044F \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F \u043E \u0442\u043E\u0432\u0430\u0440\u0435. -->\n <div\n class=\"flex flex-col gap-x-1 text-tui-base-07\"\n [class.text-body-m]=\"!isShowEditControls()\"\n >\n @if (orderItem.marker) {\n <p>\u041C\u0430\u0440\u043A\u0438\u0440\u043E\u0432\u043A\u0430: {{ orderItem.marker }}</p>\n }\n @if (orderItem.width) {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0448\u0438\u0440\u0438\u043D\u044B \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n class=\"text-body-s self-start whitespace-nowrap\"\n >\n \u0428\u0438\u0440\u0438\u043D\u0430: <span class=\"text-body-s-bold\">{{ orderItem.width }} \u043C.</span>\n </button>\n }\n @if (orderItem.height) {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0432\u044B\u0441\u043E\u0442\u044B \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n class=\"text-body-s self-start whitespace-nowrap\"\n >\n \u0412\u044B\u0441\u043E\u0442\u0430: <span class=\"text-body-s-bold\">{{ orderItem.height }} \u043C.</span>\n </button>\n } @else if (orderItem.length) {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0434\u043B\u0438\u043D\u044B \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n class=\"text-body-s self-start whitespace-nowrap\"\n >\n \u0414\u043B\u0438\u043D\u0430: <span class=\"text-body-s-bold\">{{ orderItem.length }} \u043C.</span>\n </button>\n }\n </div>\n </div>\n }\n </div>\n\n <!-- \u0421\u0443\u043C\u043C\u0430 \u0442\u043E\u0432\u0430\u0440\u0430 \u0438 \u0441\u043A\u043B\u0430\u0434\u0441\u043A\u043E\u0435 \u043D\u0430\u043B\u0438\u0447\u0438\u0435. -->\n <div\n scPrint=\"cost\"\n class=\"flex min-w-[11rem] flex-col @lg:justify-end @2xl:!justify-center text-body-m\"\n >\n <p class=\"whitespace-nowrap\">\n \u0421\u0443\u043C\u043C\u0430:\n <strong> {{ orderItem.costRub | tuiFormatNumber: moneyFormat }} {{ 'RUB' | tuiCurrency }}</strong>\n </p>\n <sc-price-warehouse-stock\n scPrint=\"defaultNoPrint\"\n [product]=\"product\"\n />\n </div>\n </div>\n </div>\n </sc-noindex-wrapper>\n </div>\n} @else {\n <div class=\"tui-skeleton flex h-[8.25rem] w-full overflow-hidden rounded-xl\"></div>\n}\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: TuiIcon, selector: "tui-icon:not([tuiBadge])", inputs: ["background"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.TuiHintDirective, selector: "[tuiHint]:not(ng-container):not(ng-template)", inputs: ["tuiHint", "tuiHintContext", "tuiHintAppearance"], outputs: ["tuiHintVisible"] }, { kind: "directive", type: TuiLink, selector: "a[tuiLink], button[tuiLink]" }, { kind: "directive", type: TuiHighlight, selector: "[tuiHighlight]", inputs: ["tuiHighlight", "tuiHighlightColor"] }, { kind: "directive", type: TuiAutoFocus, selector: "[tuiAutoFocus]", inputs: ["tuiAutoFocus"] }, { kind: "component", type: ScHoverImageCarouselComponent, selector: "sc-hover-image-carousel", inputs: ["images", "isShowActions", "productName"] }, { kind: "component", type: CostWithDiscountComponent, selector: "sc-cost-with-discount", inputs: ["product", "size"] }, { kind: "component", type: ScPriceWarehouseStockComponent, selector: "sc-price-warehouse-stock", inputs: ["classList", "product", "withStockHint", "fromMain"] }, { kind: "component", type: ScInputQuantityComponent, selector: "sc-input-quantity", inputs: ["step", "showLoader", "showCross", "appearance", "isDisabled", "size", "ignoreStepValidators"], outputs: ["clickClearEvent"] }, { kind: "component", type: i1$1.TuiPreviewComponent, selector: "tui-preview", inputs: ["zoomable", "rotatable", "initialScale"] }, { kind: "directive", type: i1$1.TuiPreviewAction, selector: "[tuiPreviewAction]" }, { kind: "component", type: ScNoindexWrapperComponent, selector: "sc-noindex-wrapper" }, { kind: "component", type: TuiButtonLoading, selector: "[tuiButton][loading],[tuiIconButton][loading]", inputs: ["size", "loading"] }, { kind: "directive", type: ScPrintDirective, selector: "[scPrint]", inputs: ["scPrint"] }, { kind: "pipe", type: i1$2.AsyncPipe, name: "async" }, { kind: "pipe", type: TuiCurrencyPipe, name: "tuiCurrency" }, { kind: "pipe", type: TuiFormatNumberPipe, name: "tuiFormatNumber" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
7866
8273
|
}
|
|
7867
8274
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScOrderItemComponent, decorators: [{
|
|
7868
8275
|
type: Component,
|
|
@@ -7898,13 +8305,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
|
|
|
7898
8305
|
appearance: signal('textfield'),
|
|
7899
8306
|
}),
|
|
7900
8307
|
tuiHintOptionsProvider({ direction: 'top', showDelay: 100, hideDelay: 100 }),
|
|
7901
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (product && orderItem) {\n <div class=\"@container relative flex w-full gap-4 rounded-xl p-1 text-body-s hover:bg-tui-background-neutral-1\">\n <sc-noindex-wrapper>\n @let isDisabled = product.isHidden || product.isNull;\n <sc-hover-image-carousel\n (click)=\"isDisabled ? null : clickCardEvent.emit()\"\n [images]=\"!isMobile ? getCardImagePreviewList(product) : [getCardImagePreview()]\"\n [isShowActions]=\"false\"\n class=\"aspect-square w-24 shrink-0 cursor-pointer self-start\"\n />\n <div class=\"flex w-full flex-col gap-y-1 gap-x-4 @5xl:flex-row @5xl:items-center @5xl:gap-5\">\n <div class=\"flex min-w-0 flex-1 flex-col gap-1\">\n <div\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n class=\"text-tui-text-02\"\n >\n \u0410\u0440\u0442\u0438\u043A\u0443\u043B: {{ product.code }}\n </div>\n <div class=\"flex flex-col gap-1\">\n <a\n tuiLink\n [attr.href]=\"href ?? null\"\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n (click)=\"$event.preventDefault(); clickCardEvent.emit()\"\n [class.disabled]=\"isDisabled\"\n class=\"!text-body-m-bold\"\n >\n {{ product.name }}\n </a>\n @if (product.supplierSku) {\n <span class=\"text-tui-text-02\"> \u0410\u0440\u0442\u0438\u043A\u0443\u043B \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F: {{ product.supplierSku }} </span>\n }\n @if (product.pack) {\n <div class=\"flex items-center gap-1 text-tui-text-02\">\n \u041D\u043E\u0440\u043C\u0430 \u0443\u043F\u0430\u043A\u043E\u0432\u043A\u0438: {{ product.pack }}\n @if (product.ignoreMinCountCheck) {\n <tui-icon\n icon=\"@tui.package\"\n [tuiHint]=\"minCountHint\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n class=\"text-body-xl text-tui-text-01 opacity-90\"\n />\n <ng-template #minCountHint>\n \u0414\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u0437\u0430\u043A\u0430\u0437 <br />\n \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u043B\u044C\u043D\u043E\u0433\u043E <br />\n \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430\n </ng-template>\n }\n </div>\n }\n\n <sc-cost-with-discount\n scPrint=\"cost\"\n [product]=\"product\"\n />\n </div>\n @if (orderItem.specificationImgUrl) {\n <a\n tuiLink\n (click)=\"showSpecification(specificationPreview)\"\n [class.disabled]=\"isDisabled\"\n >\n \u0421\u043F\u0435\u0446\u0438\u0444\u0438\u043A\u0430\u0446\u0438\u044F\n </a>\n }\n <ng-template\n #specificationPreview\n let-preview\n >\n <tui-preview\n [rotatable]=\"false\"\n [zoomable]=\"false\"\n >\n <img\n *polymorpheusOutlet=\"orderItem.specificationImgUrl as src\"\n alt=\"preview\"\n [src]=\"orderItem.specificationImgUrl\"\n />\n <button\n iconStart=\"@tui.x\"\n title=\"Close\"\n tuiIconButton\n tuiPreviewAction\n type=\"button\"\n (click)=\"preview.complete()\"\n ></button>\n </tui-preview>\n </ng-template>\n </div>\n <div class=\"grid grid-cols-1 @lg:grid-cols-3 gap-2 @2xl:gap-4 @2xl:grid-rows-1\">\n <div class=\"grid grid-cols-1 items-center @lg:gap-2 @2xl:grid-cols-2 @lg:col-span-2\">\n <!-- \u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0442\u043E\u0432\u0430\u0440\u0430. -->\n @if (isShowEditControls() && showQuantityControl) {\n <!-- \u041F\u043E\u043B\u0435 \u0432\u0432\u043E\u0434\u0430 \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0442\u043E\u0432\u0430\u0440\u0430. -->\n <sc-input-quantity\n #inputQuantity\n [tuiAutoFocus]=\"autoFocuseQuantityInput()\"\n [formControl]=\"quantityControl\"\n size=\"m\"\n [showCross]=\"false\"\n [isDisabled]=\"isDisabled\"\n [step]=\"getProductMultiplicity(product)\"\n [ignoreStepValidators]=\"product.ignoreMinCountCheck\"\n [showLoader]=\"showLoader()\"\n (clickClearEvent)=\"clickClearEvent.emit(orderItem)\"\n (keydown.enter)=\"inputQuantity.nativeFocusableElement?.blur()\"\n class=\"w-32 shrink-0\"\n />\n } @else {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n >\n <div class=\"!text-body-m text-start\">\n \u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E:\n <strong> {{ orderItem.quantity }} \u0448\u0442.</strong>\n </div>\n </button>\n }\n\n @let showAdditionalInfo = orderItem.configurator || orderItem.height || orderItem.length || orderItem.width || orderItem.marker;\n @if (showAdditionalInfo) {\n <div class=\"flex items-center gap-2 @lg:gap-3 max-w-min\">\n <!-- \u041A\u043D\u043E\u043F\u043A\u0430 \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0442\u043E\u0432\u0430\u0440\u0430. -->\n @if (isShowEditControls()) {\n <button\n tuiIconButton\n [disabled]=\"isDisabled\"\n [loading]=\"showLoader()\"\n (click)=\"clickSettings.emit()\"\n size=\"s\"\n [appearance]=\"isConfiguratorHintVisible() ? 'primary' : 'secondary'\"\n class=\"shrink-0\"\n >\n <tui-icon icon=\"@tui.settings\" />\n </button>\n }\n\n <!-- \u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u0430\u044F \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F \u043E \u0442\u043E\u0432\u0430\u0440\u0435. -->\n <div\n class=\"flex flex-col gap-x-1 text-tui-base-07\"\n [class.text-body-m]=\"!isShowEditControls()\"\n >\n @if (orderItem.marker) {\n <p>\u041C\u0430\u0440\u043A\u0438\u0440\u043E\u0432\u043A\u0430: {{ orderItem.marker }}</p>\n }\n @if (orderItem.width) {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0448\u0438\u0440\u0438\u043D\u044B \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n class=\"text-body-s self-start whitespace-nowrap\"\n >\n \u0428\u0438\u0440\u0438\u043D\u0430: <span class=\"text-body-s-bold\">{{ orderItem.width }} \u043C.</span>\n </button>\n }\n @if (orderItem.height) {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0432\u044B\u0441\u043E\u0442\u044B \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n class=\"text-body-s self-start whitespace-nowrap\"\n >\n \u0412\u044B\u0441\u043E\u0442\u0430: <span class=\"text-body-s-bold\">{{ orderItem.height }} \u043C.</span>\n </button>\n } @else if (orderItem.length) {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0434\u043B\u0438\u043D\u044B \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n class=\"text-body-s self-start whitespace-nowrap\"\n >\n \u0414\u043B\u0438\u043D\u0430: <span class=\"text-body-s-bold\">{{ orderItem.length }} \u043C.</span>\n </button>\n }\n </div>\n </div>\n }\n </div>\n\n <!-- \u0421\u0443\u043C\u043C\u0430 \u0442\u043E\u0432\u0430\u0440\u0430 \u0438 \u0441\u043A\u043B\u0430\u0434\u0441\u043A\u043E\u0435 \u043D\u0430\u043B\u0438\u0447\u0438\u0435. -->\n <div\n scPrint=\"cost\"\n class=\"flex min-w-[11rem] flex-col @lg:justify-end @2xl:!justify-center text-body-m\"\n >\n <p class=\"whitespace-nowrap\">\n \u0421\u0443\u043C\u043C\u0430:\n <strong> {{ orderItem.costRub | tuiFormatNumber: { precision: 2, decimalSeparator: '.', rounding: 'ceil' } }} {{ 'RUB' | tuiCurrency }}</strong>\n </p>\n <sc-price-warehouse-stock\n scPrint=\"defaultNoPrint\"\n [product]=\"product\"\n />\n </div>\n </div>\n </div>\n </sc-noindex-wrapper>\n </div>\n} @else {\n <div class=\"tui-skeleton flex h-[8.25rem] w-full overflow-hidden rounded-xl\"></div>\n}\n" }]
|
|
8308
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (product && orderItem) {\n <div class=\"@container relative flex w-full gap-4 rounded-xl p-1 text-body-s hover:bg-tui-background-neutral-1\">\n <sc-noindex-wrapper>\n @let isDisabled = product.isHidden || product.isNull;\n <sc-hover-image-carousel\n (click)=\"isDisabled ? null : clickCardEvent.emit()\"\n [images]=\"!isMobile ? getCardImagePreviewList(product) : [getCardImagePreview()]\"\n [isShowActions]=\"false\"\n class=\"aspect-square w-24 shrink-0 cursor-pointer self-start\"\n />\n <div class=\"flex w-full flex-col gap-y-1 gap-x-4 @5xl:flex-row @5xl:items-center @5xl:gap-5\">\n <div class=\"flex min-w-0 flex-1 flex-col gap-1\">\n <div\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n class=\"text-tui-text-02\"\n >\n \u0410\u0440\u0442\u0438\u043A\u0443\u043B: {{ product.code }}\n </div>\n <div class=\"flex flex-col gap-1\">\n <a\n tuiLink\n [attr.href]=\"href ?? null\"\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n (click)=\"$event.preventDefault(); clickCardEvent.emit()\"\n [class.disabled]=\"isDisabled\"\n class=\"!text-body-m-bold\"\n >\n {{ product.name }}\n </a>\n @if (product.supplierSku) {\n <span class=\"text-tui-text-02\"> \u0410\u0440\u0442\u0438\u043A\u0443\u043B \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F: {{ product.supplierSku }} </span>\n }\n @if (product.pack) {\n <div class=\"flex items-center gap-1 text-tui-text-02\">\n \u041D\u043E\u0440\u043C\u0430 \u0443\u043F\u0430\u043A\u043E\u0432\u043A\u0438: {{ product.pack }}\n @if (product.ignoreMinCountCheck) {\n <tui-icon\n icon=\"@tui.package\"\n [tuiHint]=\"minCountHint\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n class=\"text-body-xl text-tui-text-01 opacity-90\"\n />\n <ng-template #minCountHint>\n \u0414\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u0437\u0430\u043A\u0430\u0437 <br />\n \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u043B\u044C\u043D\u043E\u0433\u043E <br />\n \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430\n </ng-template>\n }\n </div>\n }\n\n <sc-cost-with-discount\n scPrint=\"cost\"\n [product]=\"product\"\n />\n </div>\n @if (orderItem.specificationImgUrl) {\n <a\n tuiLink\n (click)=\"showSpecification(specificationPreview)\"\n [class.disabled]=\"isDisabled\"\n >\n \u0421\u043F\u0435\u0446\u0438\u0444\u0438\u043A\u0430\u0446\u0438\u044F\n </a>\n }\n <ng-template\n #specificationPreview\n let-preview\n >\n <tui-preview\n [rotatable]=\"false\"\n [zoomable]=\"false\"\n >\n <img\n *polymorpheusOutlet=\"orderItem.specificationImgUrl as src\"\n alt=\"preview\"\n [src]=\"orderItem.specificationImgUrl\"\n />\n <button\n iconStart=\"@tui.x\"\n title=\"Close\"\n tuiIconButton\n tuiPreviewAction\n type=\"button\"\n (click)=\"preview.complete()\"\n ></button>\n </tui-preview>\n </ng-template>\n </div>\n <div class=\"grid grid-cols-1 @lg:grid-cols-3 gap-2 @2xl:gap-4 @2xl:grid-rows-1\">\n <div class=\"grid grid-cols-1 items-center @lg:gap-2 @2xl:grid-cols-2 @lg:col-span-2\">\n <!-- \u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0442\u043E\u0432\u0430\u0440\u0430. -->\n @if (isShowEditControls() && showQuantityControl) {\n <!-- \u041F\u043E\u043B\u0435 \u0432\u0432\u043E\u0434\u0430 \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0442\u043E\u0432\u0430\u0440\u0430. -->\n <sc-input-quantity\n #inputQuantity\n [tuiAutoFocus]=\"autoFocuseQuantityInput()\"\n [formControl]=\"quantityControl\"\n size=\"m\"\n [showCross]=\"false\"\n [isDisabled]=\"isDisabled\"\n [step]=\"getProductMultiplicity(product)\"\n [ignoreStepValidators]=\"product.ignoreMinCountCheck\"\n [showLoader]=\"showLoader()\"\n (clickClearEvent)=\"clickClearEvent.emit(orderItem)\"\n (keydown.enter)=\"inputQuantity.nativeFocusableElement?.blur()\"\n class=\"w-32 shrink-0\"\n />\n } @else {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n >\n <div class=\"!text-body-m text-start\">\n \u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E:\n <strong> {{ orderItem.quantity }} \u0448\u0442.</strong>\n </div>\n </button>\n }\n\n @let showAdditionalInfo = orderItem.configurator || orderItem.height || orderItem.length || orderItem.width || orderItem.marker;\n @if (showAdditionalInfo) {\n <div class=\"flex items-center gap-2 @lg:gap-3 max-w-min\">\n <!-- \u041A\u043D\u043E\u043F\u043A\u0430 \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0442\u043E\u0432\u0430\u0440\u0430. -->\n @if (isShowEditControls()) {\n <button\n tuiIconButton\n [disabled]=\"isDisabled\"\n [loading]=\"showLoader()\"\n (click)=\"clickSettings.emit()\"\n size=\"s\"\n [appearance]=\"isConfiguratorHintVisible() ? 'primary' : 'secondary'\"\n class=\"shrink-0\"\n >\n <tui-icon icon=\"@tui.settings\" />\n </button>\n }\n\n <!-- \u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u0430\u044F \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F \u043E \u0442\u043E\u0432\u0430\u0440\u0435. -->\n <div\n class=\"flex flex-col gap-x-1 text-tui-base-07\"\n [class.text-body-m]=\"!isShowEditControls()\"\n >\n @if (orderItem.marker) {\n <p>\u041C\u0430\u0440\u043A\u0438\u0440\u043E\u0432\u043A\u0430: {{ orderItem.marker }}</p>\n }\n @if (orderItem.width) {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0448\u0438\u0440\u0438\u043D\u044B \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n class=\"text-body-s self-start whitespace-nowrap\"\n >\n \u0428\u0438\u0440\u0438\u043D\u0430: <span class=\"text-body-s-bold\">{{ orderItem.width }} \u043C.</span>\n </button>\n }\n @if (orderItem.height) {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0432\u044B\u0441\u043E\u0442\u044B \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n class=\"text-body-s self-start whitespace-nowrap\"\n >\n \u0412\u044B\u0441\u043E\u0442\u0430: <span class=\"text-body-s-bold\">{{ orderItem.height }} \u043C.</span>\n </button>\n } @else if (orderItem.length) {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0434\u043B\u0438\u043D\u044B \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n class=\"text-body-s self-start whitespace-nowrap\"\n >\n \u0414\u043B\u0438\u043D\u0430: <span class=\"text-body-s-bold\">{{ orderItem.length }} \u043C.</span>\n </button>\n }\n </div>\n </div>\n }\n </div>\n\n <!-- \u0421\u0443\u043C\u043C\u0430 \u0442\u043E\u0432\u0430\u0440\u0430 \u0438 \u0441\u043A\u043B\u0430\u0434\u0441\u043A\u043E\u0435 \u043D\u0430\u043B\u0438\u0447\u0438\u0435. -->\n <div\n scPrint=\"cost\"\n class=\"flex min-w-[11rem] flex-col @lg:justify-end @2xl:!justify-center text-body-m\"\n >\n <p class=\"whitespace-nowrap\">\n \u0421\u0443\u043C\u043C\u0430:\n <strong> {{ orderItem.costRub | tuiFormatNumber: moneyFormat }} {{ 'RUB' | tuiCurrency }}</strong>\n </p>\n <sc-price-warehouse-stock\n scPrint=\"defaultNoPrint\"\n [product]=\"product\"\n />\n </div>\n </div>\n </div>\n </sc-noindex-wrapper>\n </div>\n} @else {\n <div class=\"tui-skeleton flex h-[8.25rem] w-full overflow-hidden rounded-xl\"></div>\n}\n" }]
|
|
7902
8309
|
}], propDecorators: { clickSettings: [{ type: i0.Output, args: ["clickSettings"] }], isShowEditControls: [{ type: i0.Input, args: [{ isSignal: true, alias: "isShowEditControls", required: false }] }] } });
|
|
7903
8310
|
|
|
7904
8311
|
/* eslint-disable no-param-reassign */
|
|
7905
8312
|
/**
|
|
7906
8313
|
* Компонент списка товаров корзины, заказа или черновика.
|
|
7907
|
-
* Позиции разбиты.
|
|
7908
8314
|
*/
|
|
7909
8315
|
class ScOrderItemsListComponent {
|
|
7910
8316
|
constructor() {
|
|
@@ -7954,7 +8360,7 @@ class ScOrderItemsListComponent {
|
|
|
7954
8360
|
const items = this.itemsSignal();
|
|
7955
8361
|
const selectedItemsIds = this.selectedItemsIds();
|
|
7956
8362
|
const selectable = this.selectable();
|
|
7957
|
-
return items.filter((item) => !selectable || selectedItemsIds.includes(item.id)).reduce((sum, item) => sum + item.costRub, 0);
|
|
8363
|
+
return ScNumberHelper.roundMoney(items.filter((item) => !selectable || selectedItemsIds.includes(item.id)).reduce((sum, item) => sum + item.costRub, 0));
|
|
7958
8364
|
}, ...(ngDevMode ? [{ debugName: "sumSelectedItems" }] : /* istanbul ignore next */ []));
|
|
7959
8365
|
/**
|
|
7960
8366
|
* Сервис получения и редактирования списка товаров заказа (корзина / заказ / черновик = заказ).
|
|
@@ -7965,6 +8371,10 @@ class ScOrderItemsListComponent {
|
|
|
7965
8371
|
* Признак, что можно редактировать позиции.
|
|
7966
8372
|
*/
|
|
7967
8373
|
this.canEdit = computed(() => this.editable() && 'updateProduct$' in this.orderItemsListLoader, ...(ngDevMode ? [{ debugName: "canEdit" }] : /* istanbul ignore next */ []));
|
|
8374
|
+
/**
|
|
8375
|
+
* Настройки вывода сумм в рублях.
|
|
8376
|
+
*/
|
|
8377
|
+
this.moneyFormat = ScNumberHelper.getMoneyFormat();
|
|
7968
8378
|
/**
|
|
7969
8379
|
* Ссылка для автоматического управления уничтожением зависимостей.
|
|
7970
8380
|
*/
|
|
@@ -8084,20 +8494,26 @@ class ScOrderItemsListComponent {
|
|
|
8084
8494
|
this.scDialogService.openPriceHistoryChartDialog(product);
|
|
8085
8495
|
}
|
|
8086
8496
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScOrderItemsListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
8087
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScOrderItemsListComponent, isStandalone: true, selector: "sc-order-items-list", inputs: { selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: false, isRequired: true, transformFunction: null } }, outputs: { selectedItemsIdsChange: "selectedItemsIdsChange" }, ngImport: i0, template: "<div\n [formGroup]=\"selectionFormGroup\"\n class=\"flex flex-col gap-5\"\n>\n
|
|
8497
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScOrderItemsListComponent, isStandalone: true, selector: "sc-order-items-list", inputs: { selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: false, isRequired: true, transformFunction: null } }, outputs: { selectedItemsIdsChange: "selectedItemsIdsChange" }, ngImport: i0, template: "<div\n [formGroup]=\"selectionFormGroup\"\n class=\"flex flex-col gap-5\"\n>\n @for (item of itemsSignal(); track item.id) {\n @if ($index !== 0) {\n <hr class=\"mt-auto h-px w-full bg-tui-clear\" />\n }\n\n <div class=\"flex items-center gap-4 relative\">\n @let isActive = !selectable() || selectionFormGroup.get(item.id)?.value;\n\n <!-- \u0427\u0435\u043A\u0431\u043E\u043A\u0441 \u0432\u044B\u0431\u043E\u0440\u0430 \u0442\u043E\u0432\u0430\u0440\u0430. -->\n @if (selectable()) {\n <input\n tuiCheckbox\n [disabled]=\"itemComponent.showLoader()\"\n type=\"checkbox\"\n size=\"m\"\n [formControlName]=\"item.id\"\n />\n }\n\n <!-- \u041A\u0430\u0440\u0442\u043E\u0447\u043A\u0430 \u0442\u043E\u0432\u0430\u0440\u0430. -->\n <sc-order-item\n #itemComponent\n [product]=\"item.product\"\n [orderItem]=\"item\"\n [showQuantityControl]=\"canEdit() && !item.configurator\"\n [isShowEditControls]=\"canEdit()\"\n class=\"w-full duration-200\"\n [class.opacity-60]=\"selectable() && !selectionFormGroup.get(item.id)?.value\"\n (clickCardEvent)=\"openProductInfoDialog(item.product, item, orderOptions?.orderId())\"\n (quantityValueChanges)=\"patchItem($event, itemComponent)\"\n (clickPriceHistoryEvent)=\"openPriceHistoryChartDialog(item.product)\"\n (clickSettings)=\"openSettingsDialog(item)\"\n [class.pointer-events-none]=\"!isActive\"\n />\n\n <!-- \u041A\u043D\u043E\u043F\u043A\u0430 \u0443\u0434\u0430\u043B\u0435\u043D\u0438\u044F \u0442\u043E\u0432\u0430\u0440\u0430. -->\n @if (canEdit()) {\n <button\n tuiIconButton\n (click)=\"deleteItem(item, itemComponent)\"\n [loading]=\"itemComponent.showLoader()\"\n size=\"s\"\n appearance=\"secondary\"\n class=\"!absolute left-1 top-1 lg:!relative lg:left-0 lg:top-0 lg:!self-center\"\n >\n <tui-icon icon=\"@tui.trash\" />\n </button>\n }\n </div>\n }\n\n <!-- \u0424\u0443\u0442\u0435\u0440 \u0441\u043F\u0438\u0441\u043A\u0430. -->\n <div\n scPrint=\"cost\"\n class=\"flex flex-col items-end gap-2.5\"\n >\n @let totalSum = sumSelectedItems();\n <!-- \u0418\u0442\u043E\u0433\u043E\u0432\u0430\u044F \u0441\u0443\u043C\u043C\u0430. -->\n <div class=\"text-base font-bold\">\u0418\u0442\u043E\u0433\u043E: {{ totalSum | tuiFormatNumber: moneyFormat }} {{ 'RUB' | tuiCurrency }}</div>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: ScOrderItemComponent, selector: "sc-order-item", inputs: ["isShowEditControls"], outputs: ["clickSettings"] }, { kind: "directive", type: ScPrintDirective, selector: "[scPrint]", inputs: ["scPrint"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: TuiCheckbox, selector: "input[type=\"checkbox\"][tuiCheckbox]" }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: TuiIcon, selector: "tui-icon:not([tuiBadge])", inputs: ["background"] }, { kind: "component", type: TuiButtonLoading, selector: "[tuiButton][loading],[tuiIconButton][loading]", inputs: ["size", "loading"] }, { kind: "pipe", type: TuiCurrencyPipe, name: "tuiCurrency" }, { kind: "pipe", type: TuiFormatNumberPipe, name: "tuiFormatNumber" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
8088
8498
|
}
|
|
8089
8499
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScOrderItemsListComponent, decorators: [{
|
|
8090
8500
|
type: Component,
|
|
8091
|
-
args: [{ standalone: true, selector: 'sc-order-items-list', imports: [ScOrderItemComponent, ScPrintDirective, ReactiveFormsModule, TuiCheckbox, TuiButton, TuiIcon, TuiButtonLoading, TuiCurrencyPipe, AsyncPipe, TuiFormatNumberPipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n [formGroup]=\"selectionFormGroup\"\n class=\"flex flex-col gap-5\"\n>\n
|
|
8501
|
+
args: [{ standalone: true, selector: 'sc-order-items-list', imports: [ScOrderItemComponent, ScPrintDirective, ReactiveFormsModule, TuiCheckbox, TuiButton, TuiIcon, TuiButtonLoading, TuiCurrencyPipe, AsyncPipe, TuiFormatNumberPipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n [formGroup]=\"selectionFormGroup\"\n class=\"flex flex-col gap-5\"\n>\n @for (item of itemsSignal(); track item.id) {\n @if ($index !== 0) {\n <hr class=\"mt-auto h-px w-full bg-tui-clear\" />\n }\n\n <div class=\"flex items-center gap-4 relative\">\n @let isActive = !selectable() || selectionFormGroup.get(item.id)?.value;\n\n <!-- \u0427\u0435\u043A\u0431\u043E\u043A\u0441 \u0432\u044B\u0431\u043E\u0440\u0430 \u0442\u043E\u0432\u0430\u0440\u0430. -->\n @if (selectable()) {\n <input\n tuiCheckbox\n [disabled]=\"itemComponent.showLoader()\"\n type=\"checkbox\"\n size=\"m\"\n [formControlName]=\"item.id\"\n />\n }\n\n <!-- \u041A\u0430\u0440\u0442\u043E\u0447\u043A\u0430 \u0442\u043E\u0432\u0430\u0440\u0430. -->\n <sc-order-item\n #itemComponent\n [product]=\"item.product\"\n [orderItem]=\"item\"\n [showQuantityControl]=\"canEdit() && !item.configurator\"\n [isShowEditControls]=\"canEdit()\"\n class=\"w-full duration-200\"\n [class.opacity-60]=\"selectable() && !selectionFormGroup.get(item.id)?.value\"\n (clickCardEvent)=\"openProductInfoDialog(item.product, item, orderOptions?.orderId())\"\n (quantityValueChanges)=\"patchItem($event, itemComponent)\"\n (clickPriceHistoryEvent)=\"openPriceHistoryChartDialog(item.product)\"\n (clickSettings)=\"openSettingsDialog(item)\"\n [class.pointer-events-none]=\"!isActive\"\n />\n\n <!-- \u041A\u043D\u043E\u043F\u043A\u0430 \u0443\u0434\u0430\u043B\u0435\u043D\u0438\u044F \u0442\u043E\u0432\u0430\u0440\u0430. -->\n @if (canEdit()) {\n <button\n tuiIconButton\n (click)=\"deleteItem(item, itemComponent)\"\n [loading]=\"itemComponent.showLoader()\"\n size=\"s\"\n appearance=\"secondary\"\n class=\"!absolute left-1 top-1 lg:!relative lg:left-0 lg:top-0 lg:!self-center\"\n >\n <tui-icon icon=\"@tui.trash\" />\n </button>\n }\n </div>\n }\n\n <!-- \u0424\u0443\u0442\u0435\u0440 \u0441\u043F\u0438\u0441\u043A\u0430. -->\n <div\n scPrint=\"cost\"\n class=\"flex flex-col items-end gap-2.5\"\n >\n @let totalSum = sumSelectedItems();\n <!-- \u0418\u0442\u043E\u0433\u043E\u0432\u0430\u044F \u0441\u0443\u043C\u043C\u0430. -->\n <div class=\"text-base font-bold\">\u0418\u0442\u043E\u0433\u043E: {{ totalSum | tuiFormatNumber: moneyFormat }} {{ 'RUB' | tuiCurrency }}</div>\n </div>\n</div>\n" }]
|
|
8092
8502
|
}], propDecorators: { selectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectable", required: false }] }], editable: [{ type: i0.Input, args: [{ isSignal: true, alias: "editable", required: false }] }], selectedItemsIdsChange: [{ type: i0.Output, args: ["selectedItemsIdsChange"] }], items: [{
|
|
8093
8503
|
type: Input,
|
|
8094
8504
|
args: [{ required: true }]
|
|
8095
8505
|
}] } });
|
|
8096
8506
|
|
|
8097
|
-
|
|
8507
|
+
/**
|
|
8508
|
+
* Список позиций заказа с действиями и блоком позиций, которые больше не предоставляются.
|
|
8509
|
+
*/
|
|
8510
|
+
class ScOrderItemsListWithActionsComponent {
|
|
8511
|
+
/**
|
|
8512
|
+
* Инициализирует экземпляр класса {@link ScOrderItemsListWithActionsComponent}.
|
|
8513
|
+
*/
|
|
8098
8514
|
constructor() {
|
|
8099
8515
|
/**
|
|
8100
|
-
*
|
|
8516
|
+
* Товары заказа.
|
|
8101
8517
|
*/
|
|
8102
8518
|
this.items = input.required(...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
8103
8519
|
/**
|
|
@@ -8109,66 +8525,42 @@ class ScOrderItemsListByDirectionsComponent {
|
|
|
8109
8525
|
*/
|
|
8110
8526
|
this.editable = input(false, ...(ngDevMode ? [{ debugName: "editable" }] : /* istanbul ignore next */ []));
|
|
8111
8527
|
/**
|
|
8112
|
-
*
|
|
8528
|
+
* Позиции, доступные для заказа.
|
|
8113
8529
|
*/
|
|
8114
|
-
this.
|
|
8115
|
-
/**
|
|
8116
|
-
* Текст кнопки продолжения.
|
|
8117
|
-
*/
|
|
8118
|
-
this.continueButtonText = input({ title: 'Заказать', iconStart: '@tui.shopping-cart' }, ...(ngDevMode ? [{ debugName: "continueButtonText" }] : /* istanbul ignore next */ []));
|
|
8119
|
-
/**
|
|
8120
|
-
* Событие клика на кнопку продолжения.
|
|
8121
|
-
*/
|
|
8122
|
-
this.continueClick = output();
|
|
8123
|
-
/**
|
|
8124
|
-
* Список направлений продаж из справочника.
|
|
8125
|
-
*/
|
|
8126
|
-
this.directions = toSignal(inject(ScReferencesService).directions$, { initialValue: undefined });
|
|
8127
|
-
/**
|
|
8128
|
-
* Позиции корзины, сгруппированные по направлениям продаж.
|
|
8129
|
-
* Если передан cartDirections, используется он, иначе группировка выполняется автоматически.
|
|
8130
|
-
*/
|
|
8131
|
-
this.itemsByDirections = computed(() => {
|
|
8132
|
-
const items = this.items().filter((item) => !item.product.isNull && !item.product.isHidden);
|
|
8133
|
-
const directions = this.directions();
|
|
8134
|
-
return directions?.map((direction) => new ScOrderItemsByDirection(direction, items)).filter((group) => group.items.length > 0) ?? [];
|
|
8135
|
-
}, ...(ngDevMode ? [{ debugName: "itemsByDirections" }] : /* istanbul ignore next */ []));
|
|
8530
|
+
this.availableItems = computed(() => this.items().filter((item) => !item.product.isNull && !item.product.isHidden), ...(ngDevMode ? [{ debugName: "availableItems" }] : /* istanbul ignore next */ []));
|
|
8136
8531
|
/**
|
|
8137
8532
|
* Позиции корзины, которые больше не предоставляются.
|
|
8138
8533
|
*/
|
|
8139
8534
|
this.nullItems = computed(() => this.items().filter((item) => item.product.isNull || item.product.isHidden), ...(ngDevMode ? [{ debugName: "nullItems" }] : /* istanbul ignore next */ []));
|
|
8140
8535
|
/**
|
|
8141
|
-
*
|
|
8536
|
+
* Идентификаторы выбранных позиций.
|
|
8142
8537
|
*/
|
|
8143
8538
|
this.selectedItemsIds = model([], ...(ngDevMode ? [{ debugName: "selectedItemsIds" }] : /* istanbul ignore next */ []));
|
|
8539
|
+
// Оставляет в выборе только доступные позиции: без них список выбора не отрисовывается и выбор не сбрасывает.
|
|
8540
|
+
effect(() => {
|
|
8541
|
+
const availableIds = new Set(this.availableItems().map((item) => item.id));
|
|
8542
|
+
const selectedItemsIds = this.selectedItemsIds();
|
|
8543
|
+
const actualIds = selectedItemsIds.filter((id) => availableIds.has(id));
|
|
8544
|
+
if (actualIds.length !== selectedItemsIds.length) {
|
|
8545
|
+
this.selectedItemsIds.set(actualIds);
|
|
8546
|
+
}
|
|
8547
|
+
});
|
|
8144
8548
|
}
|
|
8145
|
-
|
|
8146
|
-
|
|
8147
|
-
*
|
|
8148
|
-
* @param itemsIds Идентификаторы выбранных позиций.
|
|
8149
|
-
* @param direction Направление продаж.
|
|
8150
|
-
*/
|
|
8151
|
-
selectedItemsHandler(itemsIds, direction) {
|
|
8152
|
-
this.selectedItemsIds.update((previous) => [
|
|
8153
|
-
...previous.filter((id) => !direction.items.some((item) => item.id === id) && this.items().some((item) => item.id === id)),
|
|
8154
|
-
...itemsIds,
|
|
8155
|
-
]);
|
|
8156
|
-
}
|
|
8157
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScOrderItemsListByDirectionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
8158
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScOrderItemsListByDirectionsComponent, isStandalone: true, selector: "sc-order-items-list-by-directions", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null }, showContinueButton: { classPropertyName: "showContinueButton", publicName: "showContinueButton", isSignal: true, isRequired: false, transformFunction: null }, continueButtonText: { classPropertyName: "continueButtonText", publicName: "continueButtonText", isSignal: true, isRequired: false, transformFunction: null }, selectedItemsIds: { classPropertyName: "selectedItemsIds", publicName: "selectedItemsIds", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { continueClick: "continueClick", selectedItemsIds: "selectedItemsIdsChange" }, ngImport: i0, template: "<div class=\"flex flex-col gap-5\">\n <!-- \u0413\u0440\u0443\u043F\u043F\u044B \u0442\u043E\u0432\u0430\u0440\u043E\u0432 \u043F\u043E \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F\u043C \u043F\u0440\u043E\u0434\u0430\u0436. -->\n @for (direction of itemsByDirections(); track direction.direction?.id; let groupIndex = $index) {\n <div class=\"flex flex-col gap-2.5\">\n @if (direction.direction && itemsByDirections().length > 1) {\n <div class=\"text-base font-bold\">\u041D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u043F\u0440\u043E\u0434\u0430\u0436: {{ direction.direction.description }}</div>\n }\n\n <sc-order-items-list\n [items]=\"direction.items\"\n [selectable]=\"selectable()\"\n [editable]=\"editable()\"\n (selectedItemsIdsChange)=\"selectedItemsHandler($event, direction)\"\n />\n\n <!-- \u0424\u0443\u0442\u0435\u0440 \u0433\u0440\u0443\u043F\u043F\u044B \u0442\u043E\u0432\u0430\u0440\u043E\u0432. -->\n <div class=\"flex flex-col items-center sm:flex-row sm:items-start sm:flex-wrap-reverse grow gap-x-2.5 gap-y-4\">\n <ng-content select=\"[footerActions]\" />\n\n <!-- \u041A\u043D\u043E\u043F\u043A\u0430 \u043F\u0440\u043E\u0434\u043E\u043B\u0436\u0435\u043D\u0438\u044F. -->\n @if (showContinueButton()) {\n <button\n tuiButton\n type=\"button\"\n [disabled]=\"direction.getItemsByIds(selectedItemsIds()).length === 0\"\n [iconStart]=\"continueButtonText().iconStart\"\n class=\"sm:ml-auto\"\n (click)=\"continueClick.emit(direction)\"\n >\n {{ continueButtonText().title }}\n </button>\n }\n </div>\n </div>\n }\n\n @if (nullItems().length) {\n <div class=\"flex flex-col gap-2.5\">\n <div class=\"text-base font-bold\">\u0422\u043E\u0432\u0430\u0440\u044B \u0438 \u0443\u0441\u043B\u0443\u0433\u0438, \u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0435 \u043F\u0440\u0435\u0434\u043E\u0441\u0442\u0430\u0432\u043B\u044F\u044E\u0442\u0441\u044F.</div>\n\n <sc-order-items-list\n [items]=\"nullItems()\"\n [selectable]=\"false\"\n [editable]=\"editable()\"\n />\n </div>\n }\n</div>\n", dependencies: [{ kind: "component", type: ScOrderItemsListComponent, selector: "sc-order-items-list", inputs: ["selectable", "editable", "items"], outputs: ["selectedItemsIdsChange"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
8549
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScOrderItemsListWithActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
8550
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScOrderItemsListWithActionsComponent, isStandalone: true, selector: "sc-order-items-list-with-actions", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null }, selectedItemsIds: { classPropertyName: "selectedItemsIds", publicName: "selectedItemsIds", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedItemsIds: "selectedItemsIdsChange" }, ngImport: i0, template: "<div class=\"flex flex-col gap-5\">\n <div class=\"flex flex-col gap-2.5\">\n @if (availableItems().length) {\n <sc-order-items-list\n [items]=\"availableItems()\"\n [selectable]=\"selectable()\"\n [editable]=\"editable()\"\n (selectedItemsIdsChange)=\"selectedItemsIds.set($event)\"\n />\n }\n\n <!-- \u0424\u0443\u0442\u0435\u0440 \u0441\u043F\u0438\u0441\u043A\u0430 \u0442\u043E\u0432\u0430\u0440\u043E\u0432. -->\n <div class=\"flex flex-col items-center sm:flex-row sm:items-start sm:flex-wrap-reverse grow gap-x-2.5 gap-y-4\">\n <ng-content select=\"[footerActions]\" />\n </div>\n </div>\n\n @if (nullItems().length) {\n <div class=\"flex flex-col gap-2.5\">\n <div class=\"text-base font-bold\">\u0422\u043E\u0432\u0430\u0440\u044B \u0438 \u0443\u0441\u043B\u0443\u0433\u0438, \u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0435 \u043F\u0440\u0435\u0434\u043E\u0441\u0442\u0430\u0432\u043B\u044F\u044E\u0442\u0441\u044F.</div>\n\n <sc-order-items-list\n [items]=\"nullItems()\"\n [selectable]=\"false\"\n [editable]=\"editable()\"\n />\n </div>\n }\n</div>\n", dependencies: [{ kind: "component", type: ScOrderItemsListComponent, selector: "sc-order-items-list", inputs: ["selectable", "editable", "items"], outputs: ["selectedItemsIdsChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
8159
8551
|
}
|
|
8160
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type:
|
|
8552
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScOrderItemsListWithActionsComponent, decorators: [{
|
|
8161
8553
|
type: Component,
|
|
8162
|
-
args: [{
|
|
8163
|
-
}],
|
|
8554
|
+
args: [{ selector: 'sc-order-items-list-with-actions', imports: [ScOrderItemsListComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-col gap-5\">\n <div class=\"flex flex-col gap-2.5\">\n @if (availableItems().length) {\n <sc-order-items-list\n [items]=\"availableItems()\"\n [selectable]=\"selectable()\"\n [editable]=\"editable()\"\n (selectedItemsIdsChange)=\"selectedItemsIds.set($event)\"\n />\n }\n\n <!-- \u0424\u0443\u0442\u0435\u0440 \u0441\u043F\u0438\u0441\u043A\u0430 \u0442\u043E\u0432\u0430\u0440\u043E\u0432. -->\n <div class=\"flex flex-col items-center sm:flex-row sm:items-start sm:flex-wrap-reverse grow gap-x-2.5 gap-y-4\">\n <ng-content select=\"[footerActions]\" />\n </div>\n </div>\n\n @if (nullItems().length) {\n <div class=\"flex flex-col gap-2.5\">\n <div class=\"text-base font-bold\">\u0422\u043E\u0432\u0430\u0440\u044B \u0438 \u0443\u0441\u043B\u0443\u0433\u0438, \u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0435 \u043F\u0440\u0435\u0434\u043E\u0441\u0442\u0430\u0432\u043B\u044F\u044E\u0442\u0441\u044F.</div>\n\n <sc-order-items-list\n [items]=\"nullItems()\"\n [selectable]=\"false\"\n [editable]=\"editable()\"\n />\n </div>\n }\n</div>\n" }]
|
|
8555
|
+
}], ctorParameters: () => [], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: true }] }], selectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectable", required: false }] }], editable: [{ type: i0.Input, args: [{ isSignal: true, alias: "editable", required: false }] }], selectedItemsIds: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedItemsIds", required: false }] }, { type: i0.Output, args: ["selectedItemsIdsChange"] }] } });
|
|
8164
8556
|
|
|
8165
8557
|
/**
|
|
8166
|
-
* Список товаров заказа
|
|
8558
|
+
* Список товаров оформляемого заказа с выбором позиций.
|
|
8167
8559
|
*/
|
|
8168
|
-
class
|
|
8560
|
+
class ScNewOrderItemsComponent {
|
|
8169
8561
|
constructor() {
|
|
8170
8562
|
/**
|
|
8171
|
-
* Товары
|
|
8563
|
+
* Товары заказа.
|
|
8172
8564
|
*/
|
|
8173
8565
|
this.items = input.required(...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
8174
8566
|
/**
|
|
@@ -8188,12 +8580,12 @@ class ScOrderDirectionItemsComponent {
|
|
|
8188
8580
|
*/
|
|
8189
8581
|
this.selectedItemsIdsChange = output();
|
|
8190
8582
|
}
|
|
8191
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type:
|
|
8192
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.16", type:
|
|
8583
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScNewOrderItemsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
8584
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.16", type: ScNewOrderItemsComponent, isStandalone: true, selector: "sc-new-order-items", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, orderProcessingAcceptanceTime: { classPropertyName: "orderProcessingAcceptanceTime", publicName: "orderProcessingAcceptanceTime", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedItemsIdsChange: "selectedItemsIdsChange" }, ngImport: i0, template: "<div class=\"flex flex-col gap-5\">\n <ul class=\"ml-4 list-disc text-tui-success-fill\">\n <li>\u0417\u0430\u044F\u0432\u043A\u0438 \u043F\u0440\u0438\u043D\u0438\u043C\u0430\u044E\u0442\u0441\u044F \u043D\u0435 \u043F\u043E\u0437\u0434\u043D\u0435\u0435 {{ orderProcessingAcceptanceTime() }} \u043F\u043B\u0430\u043D\u0438\u0440\u0443\u0435\u043C\u043E\u0433\u043E \u0434\u043D\u044F \u043F\u043E\u0441\u0442\u0430\u0432\u043A\u0438.</li>\n <li>\u0417\u0430\u043A\u0430\u0437\u044B \u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u043E\u0439 \u043D\u0430 \u043F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A \u043F\u0440\u0438\u043D\u0438\u043C\u0430\u044E\u0442\u0441\u044F \u0434\u043E {{ orderProcessingAcceptanceTime() }} \u043F\u044F\u0442\u043D\u0438\u0446\u044B.</li>\n <li>\u0417\u0430\u043A\u0430\u0437\u044B, \u0441\u043E\u0437\u0434\u0430\u043D\u043D\u044B\u0435 \u043F\u043E\u0437\u0434\u043D\u0435\u0435 {{ orderProcessingAcceptanceTime() }} \u043F\u044F\u0442\u043D\u0438\u0446\u044B \u0438\u043B\u0438 \u0432 \u0441\u0443\u0431\u0431\u043E\u0442\u0443/\u0432\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u0435 \u0431\u0443\u0434\u0443\u0442 \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u0430\u043D\u044B \u0432 \u0431\u0443\u0434\u043D\u0438\u0435 \u0434\u043D\u0438.</li>\n <li>\n \u0423\u043F\u0440\u0430\u0432\u043B\u044F\u0442\u044C \u0441\u043F\u0438\u0441\u043A\u043E\u043C \u043A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\u043E\u0432 \u0432\u044B \u043C\u043E\u0436\u0435\u0442\u0435 \u0432\n <a\n tuiLink\n routerLink=\"/profile\"\n >\n \u043B\u0438\u0447\u043D\u043E\u043C \u043A\u0430\u0431\u0438\u043D\u0435\u0442\u0435\n </a>\n .\n </li>\n </ul>\n\n <div class=\"sub-title\">\u0421\u043E\u0441\u0442\u0430\u0432 \u0437\u0430\u043A\u0430\u0437\u0430</div>\n\n <sc-order-items-list-with-actions\n [items]=\"items()\"\n [editable]=\"editable()\"\n [selectable]=\"selectable()\"\n (selectedItemsIdsChange)=\"selectedItemsIdsChange.emit($event)\"\n >\n <ng-content\n select=\"[footerActions]\"\n ngProjectAs=\"[footerActions]\"\n />\n </sc-order-items-list-with-actions>\n</div>\n", dependencies: [{ kind: "component", type: ScOrderItemsListWithActionsComponent, selector: "sc-order-items-list-with-actions", inputs: ["items", "selectable", "editable", "selectedItemsIds"], outputs: ["selectedItemsIdsChange"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: TuiLink, selector: "a[tuiLink], button[tuiLink]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
8193
8585
|
}
|
|
8194
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type:
|
|
8586
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScNewOrderItemsComponent, decorators: [{
|
|
8195
8587
|
type: Component,
|
|
8196
|
-
args: [{ selector: 'sc-order-
|
|
8588
|
+
args: [{ selector: 'sc-new-order-items', imports: [ScOrderItemsListWithActionsComponent, RouterLink, TuiLink], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-col gap-5\">\n <ul class=\"ml-4 list-disc text-tui-success-fill\">\n <li>\u0417\u0430\u044F\u0432\u043A\u0438 \u043F\u0440\u0438\u043D\u0438\u043C\u0430\u044E\u0442\u0441\u044F \u043D\u0435 \u043F\u043E\u0437\u0434\u043D\u0435\u0435 {{ orderProcessingAcceptanceTime() }} \u043F\u043B\u0430\u043D\u0438\u0440\u0443\u0435\u043C\u043E\u0433\u043E \u0434\u043D\u044F \u043F\u043E\u0441\u0442\u0430\u0432\u043A\u0438.</li>\n <li>\u0417\u0430\u043A\u0430\u0437\u044B \u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u043E\u0439 \u043D\u0430 \u043F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A \u043F\u0440\u0438\u043D\u0438\u043C\u0430\u044E\u0442\u0441\u044F \u0434\u043E {{ orderProcessingAcceptanceTime() }} \u043F\u044F\u0442\u043D\u0438\u0446\u044B.</li>\n <li>\u0417\u0430\u043A\u0430\u0437\u044B, \u0441\u043E\u0437\u0434\u0430\u043D\u043D\u044B\u0435 \u043F\u043E\u0437\u0434\u043D\u0435\u0435 {{ orderProcessingAcceptanceTime() }} \u043F\u044F\u0442\u043D\u0438\u0446\u044B \u0438\u043B\u0438 \u0432 \u0441\u0443\u0431\u0431\u043E\u0442\u0443/\u0432\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u0435 \u0431\u0443\u0434\u0443\u0442 \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u0430\u043D\u044B \u0432 \u0431\u0443\u0434\u043D\u0438\u0435 \u0434\u043D\u0438.</li>\n <li>\n \u0423\u043F\u0440\u0430\u0432\u043B\u044F\u0442\u044C \u0441\u043F\u0438\u0441\u043A\u043E\u043C \u043A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\u043E\u0432 \u0432\u044B \u043C\u043E\u0436\u0435\u0442\u0435 \u0432\n <a\n tuiLink\n routerLink=\"/profile\"\n >\n \u043B\u0438\u0447\u043D\u043E\u043C \u043A\u0430\u0431\u0438\u043D\u0435\u0442\u0435\n </a>\n .\n </li>\n </ul>\n\n <div class=\"sub-title\">\u0421\u043E\u0441\u0442\u0430\u0432 \u0437\u0430\u043A\u0430\u0437\u0430</div>\n\n <sc-order-items-list-with-actions\n [items]=\"items()\"\n [editable]=\"editable()\"\n [selectable]=\"selectable()\"\n (selectedItemsIdsChange)=\"selectedItemsIdsChange.emit($event)\"\n >\n <ng-content\n select=\"[footerActions]\"\n ngProjectAs=\"[footerActions]\"\n />\n </sc-order-items-list-with-actions>\n</div>\n" }]
|
|
8197
8589
|
}], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: true }] }], editable: [{ type: i0.Input, args: [{ isSignal: true, alias: "editable", required: false }] }], selectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectable", required: false }] }], orderProcessingAcceptanceTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "orderProcessingAcceptanceTime", required: false }] }], selectedItemsIdsChange: [{ type: i0.Output, args: ["selectedItemsIdsChange"] }] } });
|
|
8198
8590
|
|
|
8199
8591
|
/**
|
|
@@ -8211,19 +8603,10 @@ class ScOrderFormComponent {
|
|
|
8211
8603
|
* Инициализирует экземпляр класса {@link ScOrderFormComponent}.
|
|
8212
8604
|
*/
|
|
8213
8605
|
constructor() {
|
|
8214
|
-
/**
|
|
8215
|
-
* Идентификатор направления продаж заказа.
|
|
8216
|
-
*/
|
|
8217
|
-
this.directionId = input.required(...(ngDevMode ? [{ debugName: "directionId" }] : /* istanbul ignore next */ []));
|
|
8218
8606
|
/**
|
|
8219
8607
|
* Требовать подтверждённые контактные данные для оформления. Для черновика — `false`.
|
|
8220
8608
|
*/
|
|
8221
8609
|
this.enforceApprovedContacts = input(true, ...(ngDevMode ? [{ debugName: "enforceApprovedContacts" }] : /* istanbul ignore next */ []));
|
|
8222
|
-
/**
|
|
8223
|
-
* Сохранять и восстанавливать черновые данные формы по направлению (метаданные). Для черновика — `false`.
|
|
8224
|
-
* Работает только если предоставлен токен {@link SC_ORDER_FORM_CONFIG}.
|
|
8225
|
-
*/
|
|
8226
|
-
this.persistMetadata = input(true, ...(ngDevMode ? [{ debugName: "persistMetadata" }] : /* istanbul ignore next */ []));
|
|
8227
8610
|
/**
|
|
8228
8611
|
* Событие отправки валидной формы оформления. Полезная нагрузка — сырые значения формы.
|
|
8229
8612
|
*/
|
|
@@ -8455,10 +8838,7 @@ class ScOrderFormComponent {
|
|
|
8455
8838
|
}
|
|
8456
8839
|
/** @inheritdoc */
|
|
8457
8840
|
ngOnInit() {
|
|
8458
|
-
|
|
8459
|
-
if (this.persistMetadata()) {
|
|
8460
|
-
this.initMetadata();
|
|
8461
|
-
}
|
|
8841
|
+
this.initMetadata();
|
|
8462
8842
|
}
|
|
8463
8843
|
/**
|
|
8464
8844
|
* Преобразует объекты в значения, отображаемое в поле ввода.
|
|
@@ -8553,7 +8933,7 @@ class ScOrderFormComponent {
|
|
|
8553
8933
|
});
|
|
8554
8934
|
}
|
|
8555
8935
|
/**
|
|
8556
|
-
* Восстанавливает черновые данные формы из метаданных и инициализирует их
|
|
8936
|
+
* Восстанавливает черновые данные формы из метаданных и инициализирует их сохранение, если предоставлен токен {@link SC_ORDER_FORM_CONFIG}.
|
|
8557
8937
|
*/
|
|
8558
8938
|
initMetadata() {
|
|
8559
8939
|
const { config } = this;
|
|
@@ -8561,7 +8941,7 @@ class ScOrderFormComponent {
|
|
|
8561
8941
|
return;
|
|
8562
8942
|
}
|
|
8563
8943
|
combineLatest({
|
|
8564
|
-
orderMetadata: this.uiService.getNewOrderMetadata$(
|
|
8944
|
+
orderMetadata: this.uiService.getNewOrderMetadata$(),
|
|
8565
8945
|
user: this.user$.pipe(filter((user) => !user.isGuest)),
|
|
8566
8946
|
})
|
|
8567
8947
|
.pipe(first(), takeUntilDestroyed(this.destroyRef))
|
|
@@ -8586,7 +8966,7 @@ class ScOrderFormComponent {
|
|
|
8586
8966
|
}
|
|
8587
8967
|
});
|
|
8588
8968
|
this.form.valueChanges.pipe(debounceTime(config.debounceTime), takeUntilDestroyed(this.destroyRef)).subscribe((newOrder) => {
|
|
8589
|
-
this.uiService.setNewOrderMetadata(this.
|
|
8969
|
+
this.uiService.setNewOrderMetadata(this.convertersService.removeNull(newOrder));
|
|
8590
8970
|
});
|
|
8591
8971
|
}
|
|
8592
8972
|
/**
|
|
@@ -8717,7 +9097,7 @@ class ScOrderFormComponent {
|
|
|
8717
9097
|
reader.readAsDataURL(file);
|
|
8718
9098
|
}
|
|
8719
9099
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScOrderFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
8720
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScOrderFormComponent, isStandalone: true, selector: "sc-order-form", inputs: { directionId: { classPropertyName: "directionId", publicName: "directionId", isSignal: true, isRequired: true, transformFunction: null }, enforceApprovedContacts: { classPropertyName: "enforceApprovedContacts", publicName: "enforceApprovedContacts", isSignal: true, isRequired: false, transformFunction: null }, persistMetadata: { classPropertyName: "persistMetadata", publicName: "persistMetadata", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { orderSubmit: "orderSubmit" }, providers: [TERMINAL_PROVIDERS], viewQueries: [{ propertyName: "unconfirmedDataWarning", first: true, predicate: ["unconfirmedDataWarning"], descendants: true, isSignal: true }], ngImport: i0, template: "@let user = user$ | async;\n\n<form\n [formGroup]=\"form\"\n scFocusFirstInvalidField\n [fieldOrder]=\"['contragentId', 'paymentType', 'deliveryType', 'warehouseId', 'addressId', 'deliveryDate', 'comment']\"\n (ngSubmit)=\"submit()\"\n class=\"flex flex-col gap-4\"\n>\n <ng-template #selectLoading> <tui-loader /> </ng-template>\n\n <!-- \u041A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442. -->\n @if (contragents$ | async; as contragents) {\n @if (contragents.length > 1 || user?.isOrg) {\n <div>\n <label tuiLabel>\n \u041A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\n <tui-textfield\n tuiChevron\n [content]=\"contragents ? stringify(contragents) : selectLoading\"\n >\n <input\n tuiSelect\n formControlName=\"contragentId\"\n placeholder=\"\u041A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\"\n />\n <tui-data-list *tuiDropdown>\n @for (contragent of contragents; track contragent.id) {\n <button\n tuiOption\n [value]=\"contragent.id\"\n >\n {{ contragent.name }}\n </button>\n }\n </tui-data-list>\n </tui-textfield>\n <tui-error formControlName=\"contragentId\" />\n </label>\n <a\n tuiLink\n iconStart=\"@tui.plus\"\n (click)=\"addContragent()\"\n class=\"mt-2 block\"\n >\n \u041D\u043E\u0432\u044B\u0439\n </a>\n </div>\n }\n }\n\n <!-- \u0422\u0438\u043F \u043E\u043F\u043B\u0430\u0442\u044B. -->\n <label tuiLabel>\n \u0422\u0438\u043F \u043E\u043F\u043B\u0430\u0442\u044B\n @let paymentTypes = paymentTypes$ | async;\n <tui-textfield\n tuiChevron\n [content]=\"paymentTypes ? stringify(paymentTypes) : selectLoading\"\n >\n <input\n tuiSelect\n formControlName=\"paymentType\"\n placeholder=\"\u0422\u0438\u043F \u043E\u043F\u043B\u0430\u0442\u044B\"\n />\n <tui-data-list *tuiDropdown>\n @for (type of paymentTypes; track type.id) {\n <button\n tuiOption\n [value]=\"type.id\"\n >\n {{ type.name }}\n </button>\n }\n </tui-data-list>\n </tui-textfield>\n <tui-error formControlName=\"paymentType\" />\n @if (isCashPaymentSelected()) {\n <p class=\"text-xs text-tui-status-positive\">\u0417\u0430\u043A\u0430\u0437\u044B \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u044F\u0442\u0441\u044F \u043F\u043E \u043F\u0440\u0435\u0434\u043E\u043F\u043B\u0430\u0442\u0435</p>\n }\n </label>\n\n <!-- \u041F\u0440\u0435\u0434\u0443\u043F\u0440\u0435\u0436\u0434\u0435\u043D\u0438\u0435 \u043E \u043D\u0435\u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0451\u043D\u043D\u044B\u0445 \u043A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u044B\u0445 \u0434\u0430\u043D\u043D\u044B\u0445. -->\n @if (!isPhoneApproved() || !isEmailApproved()) {\n <div\n #unconfirmedDataWarning\n class=\"text-tui-text-negative\"\n [class.warning-shake]=\"warningShake()\"\n >\n \u0412\u043D\u0438\u043C\u0430\u043D\u0438\u0435! \u0414\u043B\u044F \u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u044F \u0437\u0430\u043A\u0430\u0437\u0430 \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044C\n @if (!isPhoneApproved()) {\n <span class=\"font-bold\"> \u043D\u043E\u043C\u0435\u0440 \u0442\u0435\u043B\u0435\u0444\u043E\u043D\u0430 </span>\n }\n @if (!isPhoneApproved() && !isEmailApproved()) {\n <span> \u0438 </span>\n }\n @if (!isEmailApproved()) {\n <span class=\"font-bold\"> \u0430\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B </span>\n }\n <a\n tuiLink\n routerLink=\"/profile\"\n >\n \u0432 \u0432\u0430\u0448\u0435\u043C \u043F\u0440\u043E\u0444\u0438\u043B\u0435\n </a>\n </div>\n }\n\n <!-- \u0421\u043F\u043E\u0441\u043E\u0431 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438. -->\n <label tuiLabel>\n \u0421\u043F\u043E\u0441\u043E\u0431 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438\n @let deliveryTypes = deliveryTypes$ | async;\n <tui-textfield\n tuiChevron\n [content]=\"deliveryTypes ? stringify(deliveryTypes) : selectLoading\"\n >\n <input\n tuiSelect\n formControlName=\"deliveryType\"\n placeholder=\"\u0421\u043F\u043E\u0441\u043E\u0431 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438\"\n />\n <tui-data-list *tuiDropdown>\n @for (delivery of deliveryTypes; track delivery.id) {\n <button\n tuiOption\n [value]=\"delivery.id\"\n >\n {{ delivery.name }}\n </button>\n }\n </tui-data-list>\n </tui-textfield>\n <tui-error formControlName=\"deliveryType\" />\n </label>\n\n <!-- \u0421\u043A\u043B\u0430\u0434. -->\n <label tuiLabel>\n \u0421\u043A\u043B\u0430\u0434\n @let warehouses = warehouses$ | async;\n <tui-textfield\n tuiChevron\n [content]=\"warehouses ? stringify(warehouses) : selectLoading\"\n >\n <input\n tuiSelect\n formControlName=\"warehouseId\"\n placeholder=\"\u0421\u043A\u043B\u0430\u0434\"\n />\n <tui-data-list *tuiDropdown>\n @if (!terminal.isRunningOnTerminal) {\n @for (warehouse of warehouses; track warehouse.id) {\n <button\n tuiOption\n [value]=\"warehouse.id\"\n >\n {{ warehouse.name }}\n </button>\n }\n } @else {\n @if (warehouseService.getCatalogWarehouseChange$() | async; as terminalWarehouse) {\n <button\n tuiOption\n [value]=\"terminalWarehouse.id\"\n >\n {{ terminalWarehouse.name }}\n </button>\n }\n }\n </tui-data-list>\n </tui-textfield>\n <tui-error formControlName=\"warehouseId\" />\n </label>\n\n <!-- \u0410\u0434\u0440\u0435\u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438. -->\n @if (isDelivery()) {\n @let addresses = addresses$ | async;\n <div>\n <label tuiLabel>\n \u0410\u0434\u0440\u0435\u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438\n <tui-textfield\n tuiChevron\n [content]=\"addresses ? stringify(addresses) : selectLoading\"\n >\n <input\n tuiSelect\n formControlName=\"addressId\"\n placeholder=\"\u0410\u0434\u0440\u0435\u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438\"\n />\n <tui-data-list *tuiDropdown>\n @for (address of addresses; track address.id) {\n <button\n tuiOption\n [value]=\"address.id\"\n >\n {{ address.address }}\n </button>\n }\n </tui-data-list>\n </tui-textfield>\n @if (addresses && addresses.length === 0) {\n <tui-error error=\"\u0423 \u043A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\u0430 \u043D\u0435\u0442 \u0430\u0434\u0440\u0435\u0441\u0430 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438\" />\n }\n <tui-error formControlName=\"addressId\" />\n </label>\n <a\n tuiLink\n iconStart=\"@tui.plus\"\n (click)=\"addDeliveryAddress()\"\n class=\"mt-2 block\"\n >\n \u041D\u043E\u0432\u044B\u0439\n </a>\n </div>\n }\n\n <!-- \u0414\u0430\u0442\u0430 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438/\u0441\u0430\u043C\u043E\u0432\u044B\u0432\u043E\u0437\u0430. -->\n <label tuiLabel>\n \u0416\u0435\u043B\u0430\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 {{ isDelivery() ? '\u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438' : '\u0441\u0430\u043C\u043E\u0432\u044B\u0432\u043E\u0437\u0430' }}\n <tui-textfield [disabledItemHandler]=\"deliveryDateFilter\">\n <input\n tuiInputDate\n formControlName=\"deliveryDate\"\n [placeholder]=\"'\u0416\u0435\u043B\u0430\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 ' + (isDelivery() ? '\u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438' : '\u0441\u0430\u043C\u043E\u0432\u044B\u0432\u043E\u0437\u0430')\"\n />\n <tui-calendar\n *tuiDropdown\n [markerHandler]=\"deliveryDateMarker\"\n [max]=\"maxDeliveryDay()\"\n [min]=\"minDeliveryDay()\"\n />\n </tui-textfield>\n <tui-error formControlName=\"deliveryDate\" />\n </label>\n\n <!-- \u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439 \u043A\u043B\u0438\u0435\u043D\u0442\u0430. -->\n <label tuiLabel>\n \u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439 \u043A\u043B\u0438\u0435\u043D\u0442\u0430 \u043A \u0437\u0430\u043A\u0430\u0437\u0443\n <tui-textfield>\n <textarea\n tuiTextarea\n formControlName=\"comment\"\n placeholder=\"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0442\u0435\u043A\u0441\u0442\"\n [max]=\"15\"\n ></textarea>\n </tui-textfield>\n <tui-error formControlName=\"comment\" />\n </label>\n\n <!-- \u041F\u0440\u0438\u043A\u0440\u0435\u043F\u043B\u0435\u043D\u0438\u0435 \u0444\u0430\u0439\u043B\u0430 \u043A \u0437\u0430\u043A\u0430\u0437\u0443. -->\n <div>\n @if (!controlFile.value) {\n <label\n tuiInputFiles\n class=\"self-start !min-h-0 !p-0\"\n >\n <input\n accept=\"image/*\"\n tuiInputFiles\n [formControl]=\"controlFile\"\n class=\"opacity-0\"\n />\n <ng-template>\n <button\n tuiButton\n type=\"button\"\n tabindex=\"-1\"\n appearance=\"secondary\"\n size=\"m\"\n iconStart=\"@tui.paperclip\"\n >\n \u041F\u0440\u0438\u043A\u0440\u0435\u043F\u0438\u0442\u044C \u0444\u0430\u0439\u043B\n </button>\n </ng-template>\n </label>\n }\n\n <tui-files class=\"tui-space_top-1\">\n @if (controlFile.value | tuiFileRejected: { accept: 'image/*' } | async; as file) {\n <tui-file\n state=\"error\"\n [file]=\"file\"\n (remove)=\"removeFile()\"\n />\n }\n\n @for (file of accepted$ | async; track file.name) {\n <tui-file\n [file]=\"file\"\n (remove)=\"removeFile()\"\n />\n }\n </tui-files>\n\n <tui-error\n [order]=\"['maxLength']\"\n [formControl]=\"controlFile\"\n />\n <p class=\"tui-form__field-note\">\u041D\u0430\u043F\u0440\u0438\u043C\u0435\u0440, \u0444\u043E\u0442\u043E\u0433\u0440\u0430\u0444\u0438\u044E \u043F\u043E\u0432\u0440\u0435\u0436\u0434\u0435\u043D\u0438\u0439 \u0438 \u0434\u0435\u0444\u0444\u0435\u043A\u0442\u043E\u0432, \u0447\u0442\u043E \u043F\u043E\u0441\u043B\u0443\u0436\u0438\u0442 \u0434\u043E\u043A\u0430\u0437\u0430\u0442\u0435\u043B\u044C\u0441\u0442\u0432\u043E\u043C \u043D\u0435\u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044F \u0437\u0430\u044F\u0432\u043B\u0435\u043D\u043D\u043E\u0433\u043E \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0442\u043E\u0432\u0430\u0440\u0430.</p>\n </div>\n</form>\n", styles: ["tui-calendar:has(.t-dots) .t-cell:has(.t-dots){opacity:1;font-weight:700;color:var(--tui-text-primary);border-radius:var(--tui-radius-m);box-shadow:inset 0 0 0 .125rem color-mix(in srgb,var(--tui-background-accent-1) 33%,transparent)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: TuiLoader, selector: "tui-loader", inputs: ["size", "inheritColor", "overlay", "textContent", "loading"] }, { kind: "directive", type: TuiLabel, selector: "label[tuiLabel]" }, { kind: "directive", type: TuiChevron, selector: "[tuiChevron]", inputs: ["tuiChevron"] }, { kind: "directive", type: i1$1.TuiSelectDirective, selector: "input[tuiSelect]" }, { kind: "component", type: i3$1.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler"] }, { kind: "directive", type: i3.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { kind: "component", type: i2.TuiDataListComponent, selector: "tui-data-list", inputs: ["emptyContent", "size"] }, { kind: "directive", type: i2.TuiOption, selector: "button[tuiOption], a[tuiOption], label[tuiOption]", inputs: ["disabled"] }, { kind: "directive", type: i2.TuiOptionWithValue, selector: "button[tuiOption][value], a[tuiOption][value], label[tuiOption][value]", inputs: ["disabled", "value"] }, { kind: "component", type: i2.TuiErrorComponent, selector: "tui-error", inputs: ["error"] }, { kind: "directive", type: i2.TuiErrorDirective, selector: "tui-error[ngModel], tui-error[formControlName], tui-error[formControl], tui-error[formGroup], tui-error[formGroupName], tui-error[formArrayName], tui-error[formArray]", inputs: ["order"] }, { kind: "directive", type: TuiLink, selector: "a[tuiLink], button[tuiLink]" }, { kind: "directive", type: i1$1.TuiInputDateDirective, selector: "input[tuiInputDate]", inputs: ["max", "min"] }, { kind: "component", type: i6$1.TuiCalendar, selector: "tui-calendar", inputs: ["disabledItemHandler", "min", "max", "minViewedMonth", "maxViewedMonth", "showAdjacent", "markerHandler", "initialView", "month", "hoveredItem", "value"], outputs: ["monthChange", "hoveredItemChange", "valueChange", "dayClick"] }, { kind: "component", type: i1$1.TuiTextareaComponent, selector: "textarea[tuiTextarea]", inputs: ["min", "max", "content"] }, { kind: "component", type: i1$1.TuiFile, selector: "tui-file,a[tuiFile],button[tuiFile]", inputs: ["file", "state", "size", "showDelete", "showSize", "leftContent"], outputs: ["remove"] }, { kind: "component", type: i1$1.TuiInputFiles, selector: "label[tuiInputFiles]", inputs: ["tuiInputFiles"] }, { kind: "component", type: i1$1.TuiFilesComponent, selector: "tui-files", inputs: ["max", "expanded"], outputs: ["expandedChange"] }, { kind: "directive", type: i1$1.TuiInputFilesDirective, selector: "input[tuiInputFiles]", outputs: ["reject"] }, { kind: "directive", type: ScFocusFirstInvalidFieldDirective, selector: "form[formGroup][scFocusFirstInvalidField]", inputs: ["fieldOrder"] }, { kind: "pipe", type: i1$1.TuiFileRejectedPipe, name: "tuiFileRejected" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
9100
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScOrderFormComponent, isStandalone: true, selector: "sc-order-form", inputs: { enforceApprovedContacts: { classPropertyName: "enforceApprovedContacts", publicName: "enforceApprovedContacts", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { orderSubmit: "orderSubmit" }, providers: [TERMINAL_PROVIDERS], viewQueries: [{ propertyName: "unconfirmedDataWarning", first: true, predicate: ["unconfirmedDataWarning"], descendants: true, isSignal: true }], ngImport: i0, template: "@let user = user$ | async;\n\n<form\n [formGroup]=\"form\"\n scFocusFirstInvalidField\n [fieldOrder]=\"['contragentId', 'paymentType', 'deliveryType', 'warehouseId', 'addressId', 'deliveryDate', 'comment']\"\n (ngSubmit)=\"submit()\"\n class=\"flex flex-col gap-4\"\n>\n <ng-template #selectLoading> <tui-loader /> </ng-template>\n\n <!-- \u041A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442. -->\n @if (contragents$ | async; as contragents) {\n @if (contragents.length > 1 || user?.isOrg) {\n <div>\n <label tuiLabel>\n \u041A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\n <tui-textfield\n tuiChevron\n [content]=\"contragents ? stringify(contragents) : selectLoading\"\n >\n <input\n tuiSelect\n formControlName=\"contragentId\"\n placeholder=\"\u041A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\"\n />\n <tui-data-list *tuiDropdown>\n @for (contragent of contragents; track contragent.id) {\n <button\n tuiOption\n [value]=\"contragent.id\"\n >\n {{ contragent.name }}\n </button>\n }\n </tui-data-list>\n </tui-textfield>\n <tui-error formControlName=\"contragentId\" />\n </label>\n <a\n tuiLink\n iconStart=\"@tui.plus\"\n (click)=\"addContragent()\"\n class=\"mt-2 block\"\n >\n \u041D\u043E\u0432\u044B\u0439\n </a>\n </div>\n }\n }\n\n <!-- \u0422\u0438\u043F \u043E\u043F\u043B\u0430\u0442\u044B. -->\n <label tuiLabel>\n \u0422\u0438\u043F \u043E\u043F\u043B\u0430\u0442\u044B\n @let paymentTypes = paymentTypes$ | async;\n <tui-textfield\n tuiChevron\n [content]=\"paymentTypes ? stringify(paymentTypes) : selectLoading\"\n >\n <input\n tuiSelect\n formControlName=\"paymentType\"\n placeholder=\"\u0422\u0438\u043F \u043E\u043F\u043B\u0430\u0442\u044B\"\n />\n <tui-data-list *tuiDropdown>\n @for (type of paymentTypes; track type.id) {\n <button\n tuiOption\n [value]=\"type.id\"\n >\n {{ type.name }}\n </button>\n }\n </tui-data-list>\n </tui-textfield>\n <tui-error formControlName=\"paymentType\" />\n @if (isCashPaymentSelected()) {\n <p class=\"text-xs text-tui-status-positive\">\u0417\u0430\u043A\u0430\u0437\u044B \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u044F\u0442\u0441\u044F \u043F\u043E \u043F\u0440\u0435\u0434\u043E\u043F\u043B\u0430\u0442\u0435</p>\n }\n </label>\n\n <!-- \u041F\u0440\u0435\u0434\u0443\u043F\u0440\u0435\u0436\u0434\u0435\u043D\u0438\u0435 \u043E \u043D\u0435\u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0451\u043D\u043D\u044B\u0445 \u043A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u044B\u0445 \u0434\u0430\u043D\u043D\u044B\u0445. -->\n @if (!isPhoneApproved() || !isEmailApproved()) {\n <div\n #unconfirmedDataWarning\n class=\"text-tui-text-negative\"\n [class.warning-shake]=\"warningShake()\"\n >\n \u0412\u043D\u0438\u043C\u0430\u043D\u0438\u0435! \u0414\u043B\u044F \u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u044F \u0437\u0430\u043A\u0430\u0437\u0430 \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044C\n @if (!isPhoneApproved()) {\n <span class=\"font-bold\"> \u043D\u043E\u043C\u0435\u0440 \u0442\u0435\u043B\u0435\u0444\u043E\u043D\u0430 </span>\n }\n @if (!isPhoneApproved() && !isEmailApproved()) {\n <span> \u0438 </span>\n }\n @if (!isEmailApproved()) {\n <span class=\"font-bold\"> \u0430\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B </span>\n }\n <a\n tuiLink\n routerLink=\"/profile\"\n >\n \u0432 \u0432\u0430\u0448\u0435\u043C \u043F\u0440\u043E\u0444\u0438\u043B\u0435\n </a>\n </div>\n }\n\n <!-- \u0421\u043F\u043E\u0441\u043E\u0431 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438. -->\n <label tuiLabel>\n \u0421\u043F\u043E\u0441\u043E\u0431 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438\n @let deliveryTypes = deliveryTypes$ | async;\n <tui-textfield\n tuiChevron\n [content]=\"deliveryTypes ? stringify(deliveryTypes) : selectLoading\"\n >\n <input\n tuiSelect\n formControlName=\"deliveryType\"\n placeholder=\"\u0421\u043F\u043E\u0441\u043E\u0431 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438\"\n />\n <tui-data-list *tuiDropdown>\n @for (delivery of deliveryTypes; track delivery.id) {\n <button\n tuiOption\n [value]=\"delivery.id\"\n >\n {{ delivery.name }}\n </button>\n }\n </tui-data-list>\n </tui-textfield>\n <tui-error formControlName=\"deliveryType\" />\n </label>\n\n <!-- \u0421\u043A\u043B\u0430\u0434. -->\n <label tuiLabel>\n \u0421\u043A\u043B\u0430\u0434\n @let warehouses = warehouses$ | async;\n <tui-textfield\n tuiChevron\n [content]=\"warehouses ? stringify(warehouses) : selectLoading\"\n >\n <input\n tuiSelect\n formControlName=\"warehouseId\"\n placeholder=\"\u0421\u043A\u043B\u0430\u0434\"\n />\n <tui-data-list *tuiDropdown>\n @if (!terminal.isRunningOnTerminal) {\n @for (warehouse of warehouses; track warehouse.id) {\n <button\n tuiOption\n [value]=\"warehouse.id\"\n >\n {{ warehouse.name }}\n </button>\n }\n } @else {\n @if (warehouseService.getCatalogWarehouseChange$() | async; as terminalWarehouse) {\n <button\n tuiOption\n [value]=\"terminalWarehouse.id\"\n >\n {{ terminalWarehouse.name }}\n </button>\n }\n }\n </tui-data-list>\n </tui-textfield>\n <tui-error formControlName=\"warehouseId\" />\n </label>\n\n <!-- \u0410\u0434\u0440\u0435\u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438. -->\n @if (isDelivery()) {\n @let addresses = addresses$ | async;\n <div>\n <label tuiLabel>\n \u0410\u0434\u0440\u0435\u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438\n <tui-textfield\n tuiChevron\n [content]=\"addresses ? stringify(addresses) : selectLoading\"\n >\n <input\n tuiSelect\n formControlName=\"addressId\"\n placeholder=\"\u0410\u0434\u0440\u0435\u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438\"\n />\n <tui-data-list *tuiDropdown>\n @for (address of addresses; track address.id) {\n <button\n tuiOption\n [value]=\"address.id\"\n >\n {{ address.address }}\n </button>\n }\n </tui-data-list>\n </tui-textfield>\n @if (addresses && addresses.length === 0) {\n <tui-error error=\"\u0423 \u043A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\u0430 \u043D\u0435\u0442 \u0430\u0434\u0440\u0435\u0441\u0430 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438\" />\n }\n <tui-error formControlName=\"addressId\" />\n </label>\n <a\n tuiLink\n iconStart=\"@tui.plus\"\n (click)=\"addDeliveryAddress()\"\n class=\"mt-2 block\"\n >\n \u041D\u043E\u0432\u044B\u0439\n </a>\n </div>\n }\n\n <!-- \u0414\u0430\u0442\u0430 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438/\u0441\u0430\u043C\u043E\u0432\u044B\u0432\u043E\u0437\u0430. -->\n <label tuiLabel>\n \u0416\u0435\u043B\u0430\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 {{ isDelivery() ? '\u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438' : '\u0441\u0430\u043C\u043E\u0432\u044B\u0432\u043E\u0437\u0430' }}\n <tui-textfield [disabledItemHandler]=\"deliveryDateFilter\">\n <input\n tuiInputDate\n formControlName=\"deliveryDate\"\n [placeholder]=\"'\u0416\u0435\u043B\u0430\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 ' + (isDelivery() ? '\u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438' : '\u0441\u0430\u043C\u043E\u0432\u044B\u0432\u043E\u0437\u0430')\"\n />\n <tui-calendar\n *tuiDropdown\n [markerHandler]=\"deliveryDateMarker\"\n [max]=\"maxDeliveryDay()\"\n [min]=\"minDeliveryDay()\"\n />\n </tui-textfield>\n <tui-error formControlName=\"deliveryDate\" />\n </label>\n\n <!-- \u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439 \u043A\u043B\u0438\u0435\u043D\u0442\u0430. -->\n <label tuiLabel>\n \u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439 \u043A\u043B\u0438\u0435\u043D\u0442\u0430 \u043A \u0437\u0430\u043A\u0430\u0437\u0443\n <tui-textfield>\n <textarea\n tuiTextarea\n formControlName=\"comment\"\n placeholder=\"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0442\u0435\u043A\u0441\u0442\"\n [max]=\"15\"\n ></textarea>\n </tui-textfield>\n <tui-error formControlName=\"comment\" />\n </label>\n\n <!-- \u041F\u0440\u0438\u043A\u0440\u0435\u043F\u043B\u0435\u043D\u0438\u0435 \u0444\u0430\u0439\u043B\u0430 \u043A \u0437\u0430\u043A\u0430\u0437\u0443. -->\n <div>\n @if (!controlFile.value) {\n <label\n tuiInputFiles\n class=\"self-start !min-h-0 !p-0\"\n >\n <input\n accept=\"image/*\"\n tuiInputFiles\n [formControl]=\"controlFile\"\n class=\"opacity-0\"\n />\n <ng-template>\n <button\n tuiButton\n type=\"button\"\n tabindex=\"-1\"\n appearance=\"secondary\"\n size=\"m\"\n iconStart=\"@tui.paperclip\"\n >\n \u041F\u0440\u0438\u043A\u0440\u0435\u043F\u0438\u0442\u044C \u0444\u0430\u0439\u043B\n </button>\n </ng-template>\n </label>\n }\n\n <tui-files class=\"tui-space_top-1\">\n @if (controlFile.value | tuiFileRejected: { accept: 'image/*' } | async; as file) {\n <tui-file\n state=\"error\"\n [file]=\"file\"\n (remove)=\"removeFile()\"\n />\n }\n\n @for (file of accepted$ | async; track file.name) {\n <tui-file\n [file]=\"file\"\n (remove)=\"removeFile()\"\n />\n }\n </tui-files>\n\n <tui-error\n [order]=\"['maxLength']\"\n [formControl]=\"controlFile\"\n />\n <p class=\"tui-form__field-note\">\u041D\u0430\u043F\u0440\u0438\u043C\u0435\u0440, \u0444\u043E\u0442\u043E\u0433\u0440\u0430\u0444\u0438\u044E \u043F\u043E\u0432\u0440\u0435\u0436\u0434\u0435\u043D\u0438\u0439 \u0438 \u0434\u0435\u0444\u0444\u0435\u043A\u0442\u043E\u0432, \u0447\u0442\u043E \u043F\u043E\u0441\u043B\u0443\u0436\u0438\u0442 \u0434\u043E\u043A\u0430\u0437\u0430\u0442\u0435\u043B\u044C\u0441\u0442\u0432\u043E\u043C \u043D\u0435\u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044F \u0437\u0430\u044F\u0432\u043B\u0435\u043D\u043D\u043E\u0433\u043E \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0442\u043E\u0432\u0430\u0440\u0430.</p>\n </div>\n</form>\n", styles: ["tui-calendar:has(.t-dots) .t-cell:has(.t-dots){opacity:1;font-weight:700;color:var(--tui-text-primary);border-radius:var(--tui-radius-m);box-shadow:inset 0 0 0 .125rem color-mix(in srgb,var(--tui-background-accent-1) 33%,transparent)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: TuiLoader, selector: "tui-loader", inputs: ["size", "inheritColor", "overlay", "textContent", "loading"] }, { kind: "directive", type: TuiLabel, selector: "label[tuiLabel]" }, { kind: "directive", type: TuiChevron, selector: "[tuiChevron]", inputs: ["tuiChevron"] }, { kind: "directive", type: i1$1.TuiSelectDirective, selector: "input[tuiSelect]" }, { kind: "component", type: i3$1.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler"] }, { kind: "directive", type: i3.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { kind: "component", type: i2.TuiDataListComponent, selector: "tui-data-list", inputs: ["emptyContent", "size"] }, { kind: "directive", type: i2.TuiOption, selector: "button[tuiOption], a[tuiOption], label[tuiOption]", inputs: ["disabled"] }, { kind: "directive", type: i2.TuiOptionWithValue, selector: "button[tuiOption][value], a[tuiOption][value], label[tuiOption][value]", inputs: ["disabled", "value"] }, { kind: "component", type: i2.TuiErrorComponent, selector: "tui-error", inputs: ["error"] }, { kind: "directive", type: i2.TuiErrorDirective, selector: "tui-error[ngModel], tui-error[formControlName], tui-error[formControl], tui-error[formGroup], tui-error[formGroupName], tui-error[formArrayName], tui-error[formArray]", inputs: ["order"] }, { kind: "directive", type: TuiLink, selector: "a[tuiLink], button[tuiLink]" }, { kind: "directive", type: i1$1.TuiInputDateDirective, selector: "input[tuiInputDate]", inputs: ["max", "min"] }, { kind: "component", type: i6$1.TuiCalendar, selector: "tui-calendar", inputs: ["disabledItemHandler", "min", "max", "minViewedMonth", "maxViewedMonth", "showAdjacent", "markerHandler", "initialView", "month", "hoveredItem", "value"], outputs: ["monthChange", "hoveredItemChange", "valueChange", "dayClick"] }, { kind: "component", type: i1$1.TuiTextareaComponent, selector: "textarea[tuiTextarea]", inputs: ["min", "max", "content"] }, { kind: "component", type: i1$1.TuiFile, selector: "tui-file,a[tuiFile],button[tuiFile]", inputs: ["file", "state", "size", "showDelete", "showSize", "leftContent"], outputs: ["remove"] }, { kind: "component", type: i1$1.TuiInputFiles, selector: "label[tuiInputFiles]", inputs: ["tuiInputFiles"] }, { kind: "component", type: i1$1.TuiFilesComponent, selector: "tui-files", inputs: ["max", "expanded"], outputs: ["expandedChange"] }, { kind: "directive", type: i1$1.TuiInputFilesDirective, selector: "input[tuiInputFiles]", outputs: ["reject"] }, { kind: "directive", type: ScFocusFirstInvalidFieldDirective, selector: "form[formGroup][scFocusFirstInvalidField]", inputs: ["fieldOrder"] }, { kind: "pipe", type: i1$1.TuiFileRejectedPipe, name: "tuiFileRejected" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
8721
9101
|
}
|
|
8722
9102
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScOrderFormComponent, decorators: [{
|
|
8723
9103
|
type: Component,
|
|
@@ -8740,7 +9120,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
|
|
|
8740
9120
|
AsyncPipe,
|
|
8741
9121
|
ScFocusFirstInvalidFieldDirective,
|
|
8742
9122
|
], providers: [TERMINAL_PROVIDERS], template: "@let user = user$ | async;\n\n<form\n [formGroup]=\"form\"\n scFocusFirstInvalidField\n [fieldOrder]=\"['contragentId', 'paymentType', 'deliveryType', 'warehouseId', 'addressId', 'deliveryDate', 'comment']\"\n (ngSubmit)=\"submit()\"\n class=\"flex flex-col gap-4\"\n>\n <ng-template #selectLoading> <tui-loader /> </ng-template>\n\n <!-- \u041A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442. -->\n @if (contragents$ | async; as contragents) {\n @if (contragents.length > 1 || user?.isOrg) {\n <div>\n <label tuiLabel>\n \u041A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\n <tui-textfield\n tuiChevron\n [content]=\"contragents ? stringify(contragents) : selectLoading\"\n >\n <input\n tuiSelect\n formControlName=\"contragentId\"\n placeholder=\"\u041A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\"\n />\n <tui-data-list *tuiDropdown>\n @for (contragent of contragents; track contragent.id) {\n <button\n tuiOption\n [value]=\"contragent.id\"\n >\n {{ contragent.name }}\n </button>\n }\n </tui-data-list>\n </tui-textfield>\n <tui-error formControlName=\"contragentId\" />\n </label>\n <a\n tuiLink\n iconStart=\"@tui.plus\"\n (click)=\"addContragent()\"\n class=\"mt-2 block\"\n >\n \u041D\u043E\u0432\u044B\u0439\n </a>\n </div>\n }\n }\n\n <!-- \u0422\u0438\u043F \u043E\u043F\u043B\u0430\u0442\u044B. -->\n <label tuiLabel>\n \u0422\u0438\u043F \u043E\u043F\u043B\u0430\u0442\u044B\n @let paymentTypes = paymentTypes$ | async;\n <tui-textfield\n tuiChevron\n [content]=\"paymentTypes ? stringify(paymentTypes) : selectLoading\"\n >\n <input\n tuiSelect\n formControlName=\"paymentType\"\n placeholder=\"\u0422\u0438\u043F \u043E\u043F\u043B\u0430\u0442\u044B\"\n />\n <tui-data-list *tuiDropdown>\n @for (type of paymentTypes; track type.id) {\n <button\n tuiOption\n [value]=\"type.id\"\n >\n {{ type.name }}\n </button>\n }\n </tui-data-list>\n </tui-textfield>\n <tui-error formControlName=\"paymentType\" />\n @if (isCashPaymentSelected()) {\n <p class=\"text-xs text-tui-status-positive\">\u0417\u0430\u043A\u0430\u0437\u044B \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u044F\u0442\u0441\u044F \u043F\u043E \u043F\u0440\u0435\u0434\u043E\u043F\u043B\u0430\u0442\u0435</p>\n }\n </label>\n\n <!-- \u041F\u0440\u0435\u0434\u0443\u043F\u0440\u0435\u0436\u0434\u0435\u043D\u0438\u0435 \u043E \u043D\u0435\u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0451\u043D\u043D\u044B\u0445 \u043A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u044B\u0445 \u0434\u0430\u043D\u043D\u044B\u0445. -->\n @if (!isPhoneApproved() || !isEmailApproved()) {\n <div\n #unconfirmedDataWarning\n class=\"text-tui-text-negative\"\n [class.warning-shake]=\"warningShake()\"\n >\n \u0412\u043D\u0438\u043C\u0430\u043D\u0438\u0435! \u0414\u043B\u044F \u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u044F \u0437\u0430\u043A\u0430\u0437\u0430 \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044C\n @if (!isPhoneApproved()) {\n <span class=\"font-bold\"> \u043D\u043E\u043C\u0435\u0440 \u0442\u0435\u043B\u0435\u0444\u043E\u043D\u0430 </span>\n }\n @if (!isPhoneApproved() && !isEmailApproved()) {\n <span> \u0438 </span>\n }\n @if (!isEmailApproved()) {\n <span class=\"font-bold\"> \u0430\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B </span>\n }\n <a\n tuiLink\n routerLink=\"/profile\"\n >\n \u0432 \u0432\u0430\u0448\u0435\u043C \u043F\u0440\u043E\u0444\u0438\u043B\u0435\n </a>\n </div>\n }\n\n <!-- \u0421\u043F\u043E\u0441\u043E\u0431 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438. -->\n <label tuiLabel>\n \u0421\u043F\u043E\u0441\u043E\u0431 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438\n @let deliveryTypes = deliveryTypes$ | async;\n <tui-textfield\n tuiChevron\n [content]=\"deliveryTypes ? stringify(deliveryTypes) : selectLoading\"\n >\n <input\n tuiSelect\n formControlName=\"deliveryType\"\n placeholder=\"\u0421\u043F\u043E\u0441\u043E\u0431 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438\"\n />\n <tui-data-list *tuiDropdown>\n @for (delivery of deliveryTypes; track delivery.id) {\n <button\n tuiOption\n [value]=\"delivery.id\"\n >\n {{ delivery.name }}\n </button>\n }\n </tui-data-list>\n </tui-textfield>\n <tui-error formControlName=\"deliveryType\" />\n </label>\n\n <!-- \u0421\u043A\u043B\u0430\u0434. -->\n <label tuiLabel>\n \u0421\u043A\u043B\u0430\u0434\n @let warehouses = warehouses$ | async;\n <tui-textfield\n tuiChevron\n [content]=\"warehouses ? stringify(warehouses) : selectLoading\"\n >\n <input\n tuiSelect\n formControlName=\"warehouseId\"\n placeholder=\"\u0421\u043A\u043B\u0430\u0434\"\n />\n <tui-data-list *tuiDropdown>\n @if (!terminal.isRunningOnTerminal) {\n @for (warehouse of warehouses; track warehouse.id) {\n <button\n tuiOption\n [value]=\"warehouse.id\"\n >\n {{ warehouse.name }}\n </button>\n }\n } @else {\n @if (warehouseService.getCatalogWarehouseChange$() | async; as terminalWarehouse) {\n <button\n tuiOption\n [value]=\"terminalWarehouse.id\"\n >\n {{ terminalWarehouse.name }}\n </button>\n }\n }\n </tui-data-list>\n </tui-textfield>\n <tui-error formControlName=\"warehouseId\" />\n </label>\n\n <!-- \u0410\u0434\u0440\u0435\u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438. -->\n @if (isDelivery()) {\n @let addresses = addresses$ | async;\n <div>\n <label tuiLabel>\n \u0410\u0434\u0440\u0435\u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438\n <tui-textfield\n tuiChevron\n [content]=\"addresses ? stringify(addresses) : selectLoading\"\n >\n <input\n tuiSelect\n formControlName=\"addressId\"\n placeholder=\"\u0410\u0434\u0440\u0435\u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438\"\n />\n <tui-data-list *tuiDropdown>\n @for (address of addresses; track address.id) {\n <button\n tuiOption\n [value]=\"address.id\"\n >\n {{ address.address }}\n </button>\n }\n </tui-data-list>\n </tui-textfield>\n @if (addresses && addresses.length === 0) {\n <tui-error error=\"\u0423 \u043A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\u0430 \u043D\u0435\u0442 \u0430\u0434\u0440\u0435\u0441\u0430 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438\" />\n }\n <tui-error formControlName=\"addressId\" />\n </label>\n <a\n tuiLink\n iconStart=\"@tui.plus\"\n (click)=\"addDeliveryAddress()\"\n class=\"mt-2 block\"\n >\n \u041D\u043E\u0432\u044B\u0439\n </a>\n </div>\n }\n\n <!-- \u0414\u0430\u0442\u0430 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438/\u0441\u0430\u043C\u043E\u0432\u044B\u0432\u043E\u0437\u0430. -->\n <label tuiLabel>\n \u0416\u0435\u043B\u0430\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 {{ isDelivery() ? '\u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438' : '\u0441\u0430\u043C\u043E\u0432\u044B\u0432\u043E\u0437\u0430' }}\n <tui-textfield [disabledItemHandler]=\"deliveryDateFilter\">\n <input\n tuiInputDate\n formControlName=\"deliveryDate\"\n [placeholder]=\"'\u0416\u0435\u043B\u0430\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 ' + (isDelivery() ? '\u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438' : '\u0441\u0430\u043C\u043E\u0432\u044B\u0432\u043E\u0437\u0430')\"\n />\n <tui-calendar\n *tuiDropdown\n [markerHandler]=\"deliveryDateMarker\"\n [max]=\"maxDeliveryDay()\"\n [min]=\"minDeliveryDay()\"\n />\n </tui-textfield>\n <tui-error formControlName=\"deliveryDate\" />\n </label>\n\n <!-- \u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439 \u043A\u043B\u0438\u0435\u043D\u0442\u0430. -->\n <label tuiLabel>\n \u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439 \u043A\u043B\u0438\u0435\u043D\u0442\u0430 \u043A \u0437\u0430\u043A\u0430\u0437\u0443\n <tui-textfield>\n <textarea\n tuiTextarea\n formControlName=\"comment\"\n placeholder=\"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0442\u0435\u043A\u0441\u0442\"\n [max]=\"15\"\n ></textarea>\n </tui-textfield>\n <tui-error formControlName=\"comment\" />\n </label>\n\n <!-- \u041F\u0440\u0438\u043A\u0440\u0435\u043F\u043B\u0435\u043D\u0438\u0435 \u0444\u0430\u0439\u043B\u0430 \u043A \u0437\u0430\u043A\u0430\u0437\u0443. -->\n <div>\n @if (!controlFile.value) {\n <label\n tuiInputFiles\n class=\"self-start !min-h-0 !p-0\"\n >\n <input\n accept=\"image/*\"\n tuiInputFiles\n [formControl]=\"controlFile\"\n class=\"opacity-0\"\n />\n <ng-template>\n <button\n tuiButton\n type=\"button\"\n tabindex=\"-1\"\n appearance=\"secondary\"\n size=\"m\"\n iconStart=\"@tui.paperclip\"\n >\n \u041F\u0440\u0438\u043A\u0440\u0435\u043F\u0438\u0442\u044C \u0444\u0430\u0439\u043B\n </button>\n </ng-template>\n </label>\n }\n\n <tui-files class=\"tui-space_top-1\">\n @if (controlFile.value | tuiFileRejected: { accept: 'image/*' } | async; as file) {\n <tui-file\n state=\"error\"\n [file]=\"file\"\n (remove)=\"removeFile()\"\n />\n }\n\n @for (file of accepted$ | async; track file.name) {\n <tui-file\n [file]=\"file\"\n (remove)=\"removeFile()\"\n />\n }\n </tui-files>\n\n <tui-error\n [order]=\"['maxLength']\"\n [formControl]=\"controlFile\"\n />\n <p class=\"tui-form__field-note\">\u041D\u0430\u043F\u0440\u0438\u043C\u0435\u0440, \u0444\u043E\u0442\u043E\u0433\u0440\u0430\u0444\u0438\u044E \u043F\u043E\u0432\u0440\u0435\u0436\u0434\u0435\u043D\u0438\u0439 \u0438 \u0434\u0435\u0444\u0444\u0435\u043A\u0442\u043E\u0432, \u0447\u0442\u043E \u043F\u043E\u0441\u043B\u0443\u0436\u0438\u0442 \u0434\u043E\u043A\u0430\u0437\u0430\u0442\u0435\u043B\u044C\u0441\u0442\u0432\u043E\u043C \u043D\u0435\u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044F \u0437\u0430\u044F\u0432\u043B\u0435\u043D\u043D\u043E\u0433\u043E \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0442\u043E\u0432\u0430\u0440\u0430.</p>\n </div>\n</form>\n", styles: ["tui-calendar:has(.t-dots) .t-cell:has(.t-dots){opacity:1;font-weight:700;color:var(--tui-text-primary);border-radius:var(--tui-radius-m);box-shadow:inset 0 0 0 .125rem color-mix(in srgb,var(--tui-background-accent-1) 33%,transparent)}\n"] }]
|
|
8743
|
-
}], ctorParameters: () => [], propDecorators: {
|
|
9123
|
+
}], ctorParameters: () => [], propDecorators: { enforceApprovedContacts: [{ type: i0.Input, args: [{ isSignal: true, alias: "enforceApprovedContacts", required: false }] }], orderSubmit: [{ type: i0.Output, args: ["orderSubmit"] }], unconfirmedDataWarning: [{ type: i0.ViewChild, args: ['unconfirmedDataWarning', { isSignal: true }] }] } });
|
|
8744
9124
|
|
|
8745
9125
|
/**
|
|
8746
9126
|
* Компонент списка товаров, разбитых по наличию на складе:
|
|
@@ -8836,9 +9216,9 @@ class ScDraftComponent {
|
|
|
8836
9216
|
*/
|
|
8837
9217
|
this.draft = model(null, ...(ngDevMode ? [{ debugName: "draft" }] : /* istanbul ignore next */ []));
|
|
8838
9218
|
/**
|
|
8839
|
-
* Идентификаторы выбранных
|
|
9219
|
+
* Идентификаторы позиций черновика, выбранных для оформления заказа.
|
|
8840
9220
|
*/
|
|
8841
|
-
this.selectedItemsIds =
|
|
9221
|
+
this.selectedItemsIds = signal([], ...(ngDevMode ? [{ debugName: "selectedItemsIds" }] : /* istanbul ignore next */ []));
|
|
8842
9222
|
/**
|
|
8843
9223
|
* Источник события удаления или отмены заказа.
|
|
8844
9224
|
*/
|
|
@@ -8873,13 +9253,10 @@ class ScDraftComponent {
|
|
|
8873
9253
|
}
|
|
8874
9254
|
}
|
|
8875
9255
|
/**
|
|
8876
|
-
* Переход к оформлению заказа
|
|
8877
|
-
*
|
|
8878
|
-
* @param direction Группа позиций по направлению продаж.
|
|
9256
|
+
* Переход к оформлению заказа из выбранных позиций.
|
|
8879
9257
|
*/
|
|
8880
|
-
goToNewOrder(
|
|
8881
|
-
|
|
8882
|
-
this.router.navigate(['orders', 'new', this.draft()?.id, direction.direction.id, 'draft'], { queryParams: { itemsIds: ids } }).catch(noop$1);
|
|
9258
|
+
goToNewOrder() {
|
|
9259
|
+
this.router.navigate(['orders', 'new', this.draft()?.id, 'draft'], { queryParams: { itemsIds: this.selectedItemsIds() } }).catch(noop$1);
|
|
8883
9260
|
}
|
|
8884
9261
|
/**
|
|
8885
9262
|
* Удаляет черновик и перенаправляет к списку черновиков.
|
|
@@ -8905,22 +9282,22 @@ class ScDraftComponent {
|
|
|
8905
9282
|
});
|
|
8906
9283
|
}
|
|
8907
9284
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScDraftComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
8908
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScDraftComponent, isStandalone: true, selector: "sc-draft", inputs: { draft: { classPropertyName: "draft", publicName: "draft", isSignal: true, isRequired: false, transformFunction: null }
|
|
9285
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScDraftComponent, isStandalone: true, selector: "sc-draft", inputs: { draft: { classPropertyName: "draft", publicName: "draft", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { draft: "draftChange", deleteEvent: "deleteEvent" }, providers: [
|
|
8909
9286
|
{
|
|
8910
9287
|
provide: SC_ORDER_LOADER,
|
|
8911
9288
|
useExisting: ScOrderDraftsService,
|
|
8912
9289
|
},
|
|
8913
|
-
], ngImport: i0, template: "@let items = draft()?.products;\n\n@if (items) {\n <div class=\"flex flex-col gap-12\">\n <div class=\"flex flex-col gap-5\">\n @if (items.length) {\n <sc-order-items-list-
|
|
9290
|
+
], ngImport: i0, template: "@let items = draft()?.products;\n\n@if (items) {\n <div class=\"flex flex-col gap-12\">\n <div class=\"flex flex-col gap-5\">\n @if (items.length) {\n <sc-order-items-list-with-actions\n scOrder\n [orderId]=\"draft()?.id\"\n [items]=\"items\"\n [editable]=\"isDraftPage()\"\n (selectedItemsIdsChange)=\"selectedItemsIds.set($event)\"\n >\n <div\n footerActions\n class=\"flex w-full flex-col items-center gap-x-2.5 gap-y-4 sm:flex-row sm:flex-wrap sm:items-start\"\n >\n <button\n tuiButton\n appearance=\"secondary\"\n (click)=\"clearDraft()\"\n iconStart=\"@tui.trash-2\"\n >\n \u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A\n </button>\n\n <button\n tuiButton\n type=\"button\"\n class=\"sm:ml-auto\"\n iconStart=\"@tui.shopping-cart\"\n [disabled]=\"selectedItemsIds().length === 0\"\n (click)=\"goToNewOrder()\"\n >\n \u0417\u0430\u043A\u0430\u0437\u0430\u0442\u044C\n </button>\n </div>\n </sc-order-items-list-with-actions>\n } @else {\n <p class=\"text-base font-bold\">\u0427\u0435\u0440\u043D\u043E\u0432\u0438\u043A \u043F\u0443\u0441\u0442.</p>\n <div\n footerActions\n class=\"flex gap-2\"\n >\n <button\n tuiButton\n appearance=\"secondary\"\n (click)=\"clearDraft()\"\n iconStart=\"@tui.trash-2\"\n >\n \u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A\n </button>\n </div>\n }\n </div>\n </div>\n} @else {\n <div class=\"flex flex-col gap-12\">\n <div class=\"flex flex-col gap-5\">\n @for (item of [1, 2, 3, 4]; track item) {\n <div class=\"tui-skeleton flex h-[8.25rem] w-full overflow-hidden rounded-xl\"></div>\n }\n <div class=\"flex gap-2\">\n <div class=\"tui-skeleton h-10 w-40 rounded-md\"></div>\n <div class=\"tui-skeleton h-10 w-36 rounded-md\"></div>\n </div>\n </div>\n </div>\n}\n", dependencies: [{ kind: "component", type: ScOrderItemsListWithActionsComponent, selector: "sc-order-items-list-with-actions", inputs: ["items", "selectable", "editable", "selectedItemsIds"], outputs: ["selectedItemsIdsChange"] }, { kind: "directive", type: ScOrderAccessorDirective, selector: "[scOrder]", inputs: ["orderId"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
8914
9291
|
}
|
|
8915
9292
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScDraftComponent, decorators: [{
|
|
8916
9293
|
type: Component,
|
|
8917
|
-
args: [{ standalone: true, selector: 'sc-draft', imports: [
|
|
9294
|
+
args: [{ standalone: true, selector: 'sc-draft', imports: [ScOrderItemsListWithActionsComponent, ScOrderAccessorDirective, TuiButton, TuiIcons], providers: [
|
|
8918
9295
|
{
|
|
8919
9296
|
provide: SC_ORDER_LOADER,
|
|
8920
9297
|
useExisting: ScOrderDraftsService,
|
|
8921
9298
|
},
|
|
8922
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let items = draft()?.products;\n\n@if (items) {\n <div class=\"flex flex-col gap-12\">\n <div class=\"flex flex-col gap-5\">\n @if (items.length) {\n <sc-order-items-list-
|
|
8923
|
-
}], propDecorators: { draft: [{ type: i0.Input, args: [{ isSignal: true, alias: "draft", required: false }] }, { type: i0.Output, args: ["draftChange"] }],
|
|
9299
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let items = draft()?.products;\n\n@if (items) {\n <div class=\"flex flex-col gap-12\">\n <div class=\"flex flex-col gap-5\">\n @if (items.length) {\n <sc-order-items-list-with-actions\n scOrder\n [orderId]=\"draft()?.id\"\n [items]=\"items\"\n [editable]=\"isDraftPage()\"\n (selectedItemsIdsChange)=\"selectedItemsIds.set($event)\"\n >\n <div\n footerActions\n class=\"flex w-full flex-col items-center gap-x-2.5 gap-y-4 sm:flex-row sm:flex-wrap sm:items-start\"\n >\n <button\n tuiButton\n appearance=\"secondary\"\n (click)=\"clearDraft()\"\n iconStart=\"@tui.trash-2\"\n >\n \u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A\n </button>\n\n <button\n tuiButton\n type=\"button\"\n class=\"sm:ml-auto\"\n iconStart=\"@tui.shopping-cart\"\n [disabled]=\"selectedItemsIds().length === 0\"\n (click)=\"goToNewOrder()\"\n >\n \u0417\u0430\u043A\u0430\u0437\u0430\u0442\u044C\n </button>\n </div>\n </sc-order-items-list-with-actions>\n } @else {\n <p class=\"text-base font-bold\">\u0427\u0435\u0440\u043D\u043E\u0432\u0438\u043A \u043F\u0443\u0441\u0442.</p>\n <div\n footerActions\n class=\"flex gap-2\"\n >\n <button\n tuiButton\n appearance=\"secondary\"\n (click)=\"clearDraft()\"\n iconStart=\"@tui.trash-2\"\n >\n \u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A\n </button>\n </div>\n }\n </div>\n </div>\n} @else {\n <div class=\"flex flex-col gap-12\">\n <div class=\"flex flex-col gap-5\">\n @for (item of [1, 2, 3, 4]; track item) {\n <div class=\"tui-skeleton flex h-[8.25rem] w-full overflow-hidden rounded-xl\"></div>\n }\n <div class=\"flex gap-2\">\n <div class=\"tui-skeleton h-10 w-40 rounded-md\"></div>\n <div class=\"tui-skeleton h-10 w-36 rounded-md\"></div>\n </div>\n </div>\n </div>\n}\n" }]
|
|
9300
|
+
}], propDecorators: { draft: [{ type: i0.Input, args: [{ isSignal: true, alias: "draft", required: false }] }, { type: i0.Output, args: ["draftChange"] }], deleteEvent: [{ type: i0.Output, args: ["deleteEvent"] }] } });
|
|
8924
9301
|
|
|
8925
9302
|
/**
|
|
8926
9303
|
* Компонент статуса оплаты заказа.
|
|
@@ -10033,6 +10410,255 @@ const scGetCurrentRoute = (route) => {
|
|
|
10033
10410
|
return currentRoute;
|
|
10034
10411
|
};
|
|
10035
10412
|
|
|
10413
|
+
/**
|
|
10414
|
+
* Токен времени ожидания загрузки скрипта Yandex SmartCaptcha в миллисекундах.
|
|
10415
|
+
*/
|
|
10416
|
+
const SC_SMART_CAPTCHA_LOAD_TIMEOUT = new InjectionToken('SC_SMART_CAPTCHA_LOAD_TIMEOUT', {
|
|
10417
|
+
factory: () => 20_000,
|
|
10418
|
+
});
|
|
10419
|
+
|
|
10420
|
+
/**
|
|
10421
|
+
* Сервис загрузки скрипта Yandex SmartCaptcha.
|
|
10422
|
+
*/
|
|
10423
|
+
class ScSmartCaptchaLoaderService {
|
|
10424
|
+
constructor() {
|
|
10425
|
+
/**
|
|
10426
|
+
* Сервис для вставки внешних скриптов.
|
|
10427
|
+
*/
|
|
10428
|
+
this.scriptsService = inject(ScScriptsService);
|
|
10429
|
+
/**
|
|
10430
|
+
* Окно браузера с API Yandex SmartCaptcha.
|
|
10431
|
+
*/
|
|
10432
|
+
this.window = inject(WA_WINDOW);
|
|
10433
|
+
/**
|
|
10434
|
+
* Признак того, что приложение запущено в браузере.
|
|
10435
|
+
*/
|
|
10436
|
+
this.isBrowser = inject(IS_BROWSER);
|
|
10437
|
+
/**
|
|
10438
|
+
* Время ожидания загрузки скрипта в миллисекундах.
|
|
10439
|
+
*/
|
|
10440
|
+
this.loadTimeout = inject(SC_SMART_CAPTCHA_LOAD_TIMEOUT);
|
|
10441
|
+
/**
|
|
10442
|
+
* Имя функции окна, которую скрипт вызывает после загрузки.
|
|
10443
|
+
*/
|
|
10444
|
+
this.onloadCallbackName = 'scSmartCaptchaOnload';
|
|
10445
|
+
/**
|
|
10446
|
+
* Адрес скрипта.
|
|
10447
|
+
*/
|
|
10448
|
+
this.scriptUrl = `https://smartcaptcha.cloud.yandex.ru/captcha.js?render=onload&onload=${this.onloadCallbackName}`;
|
|
10449
|
+
/**
|
|
10450
|
+
* Загрузка API, общая для всех виджетов. Скрипт загружается один раз; отписка и истечение ожидания у подписчика загрузку не прерывают, после ошибки следующая подписка загружает скрипт заново.
|
|
10451
|
+
*/
|
|
10452
|
+
this.loading$ = defer(() => this.load$()).pipe(shareReplay(1));
|
|
10453
|
+
/**
|
|
10454
|
+
* {@link Observable} API Yandex SmartCaptcha. Значения и ошибки приходят вне зоны Angular, ожидание первого значения ограничено {@link SC_SMART_CAPTCHA_LOAD_TIMEOUT}.
|
|
10455
|
+
*/
|
|
10456
|
+
this.api$ = this.loading$.pipe(timeout({ first: this.loadTimeout }), tuiZonefree());
|
|
10457
|
+
}
|
|
10458
|
+
/**
|
|
10459
|
+
* Возвращает API Yandex SmartCaptcha, при необходимости загружая скрипт. На сервере ничего не возвращает.
|
|
10460
|
+
*/
|
|
10461
|
+
load$() {
|
|
10462
|
+
if (!this.isBrowser) {
|
|
10463
|
+
return EMPTY;
|
|
10464
|
+
}
|
|
10465
|
+
if (this.window.smartCaptcha) {
|
|
10466
|
+
return of(this.window.smartCaptcha);
|
|
10467
|
+
}
|
|
10468
|
+
return merge(this.onload$(), this.scriptsService.loadScript$(this.scriptUrl).pipe(ignoreElements()));
|
|
10469
|
+
}
|
|
10470
|
+
/**
|
|
10471
|
+
* Ждёт вызова функции из параметра `onload` адреса скрипта и возвращает API, которое скрипт к этому моменту создал.
|
|
10472
|
+
*/
|
|
10473
|
+
onload$() {
|
|
10474
|
+
return new Observable((subscriber) => {
|
|
10475
|
+
this.window[this.onloadCallbackName] = () => {
|
|
10476
|
+
if (this.window.smartCaptcha) {
|
|
10477
|
+
subscriber.next(this.window.smartCaptcha);
|
|
10478
|
+
subscriber.complete();
|
|
10479
|
+
}
|
|
10480
|
+
else {
|
|
10481
|
+
subscriber.error(new Error('Yandex SmartCaptcha API is unavailable'));
|
|
10482
|
+
}
|
|
10483
|
+
};
|
|
10484
|
+
return () => {
|
|
10485
|
+
this.window[this.onloadCallbackName] = undefined;
|
|
10486
|
+
};
|
|
10487
|
+
});
|
|
10488
|
+
}
|
|
10489
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScSmartCaptchaLoaderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
10490
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScSmartCaptchaLoaderService, providedIn: 'root' }); }
|
|
10491
|
+
}
|
|
10492
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScSmartCaptchaLoaderService, decorators: [{
|
|
10493
|
+
type: Injectable,
|
|
10494
|
+
args: [{
|
|
10495
|
+
providedIn: 'root',
|
|
10496
|
+
}]
|
|
10497
|
+
}] });
|
|
10498
|
+
|
|
10499
|
+
/**
|
|
10500
|
+
* Токен настроек Yandex SmartCaptcha. Задаётся приложением.
|
|
10501
|
+
*/
|
|
10502
|
+
const SC_SMART_CAPTCHA_SETTINGS = new InjectionToken('SC_SMART_CAPTCHA_SETTINGS');
|
|
10503
|
+
|
|
10504
|
+
/* eslint-disable no-use-before-define */
|
|
10505
|
+
/**
|
|
10506
|
+
* Виджет Yandex SmartCaptcha. Значение поля ввода - токен прохождения проверки, `null` пока проверка не пройдена или токен истёк.
|
|
10507
|
+
*/
|
|
10508
|
+
class ScSmartCaptchaComponent {
|
|
10509
|
+
/**
|
|
10510
|
+
* Инициализирует экземпляр класса {@link ScSmartCaptchaComponent}.
|
|
10511
|
+
*/
|
|
10512
|
+
constructor() {
|
|
10513
|
+
/**
|
|
10514
|
+
* Контейнер, в котором отрисовывается виджет.
|
|
10515
|
+
*/
|
|
10516
|
+
this.container = viewChild.required('container');
|
|
10517
|
+
/**
|
|
10518
|
+
* Настройки Yandex SmartCaptcha.
|
|
10519
|
+
*/
|
|
10520
|
+
this.settings = inject(SC_SMART_CAPTCHA_SETTINGS);
|
|
10521
|
+
/**
|
|
10522
|
+
* Сервис загрузки скрипта Yandex SmartCaptcha.
|
|
10523
|
+
*/
|
|
10524
|
+
this.loader = inject(ScSmartCaptchaLoaderService);
|
|
10525
|
+
/**
|
|
10526
|
+
* {@link NgZone} для отрисовки виджета вне зоны Angular и возврата его событий в зону.
|
|
10527
|
+
*/
|
|
10528
|
+
this.ngZone = inject(NgZone);
|
|
10529
|
+
/**
|
|
10530
|
+
* Ссылка для автоматического управления уничтожением зависимостей.
|
|
10531
|
+
*/
|
|
10532
|
+
this.destroyRef = inject(DestroyRef);
|
|
10533
|
+
/**
|
|
10534
|
+
* Признак того, что капчу не удалось загрузить.
|
|
10535
|
+
*/
|
|
10536
|
+
this.hasError = signal(false, ...(ngDevMode ? [{ debugName: "hasError" }] : /* istanbul ignore next */ []));
|
|
10537
|
+
/**
|
|
10538
|
+
* Функции отписки от событий виджета.
|
|
10539
|
+
*/
|
|
10540
|
+
this.unsubscribers = [];
|
|
10541
|
+
/**
|
|
10542
|
+
* Обработчик изменения значения поля ввода.
|
|
10543
|
+
*/
|
|
10544
|
+
this.onChange = noop$1;
|
|
10545
|
+
/**
|
|
10546
|
+
* Обработчик касания поля ввода.
|
|
10547
|
+
*/
|
|
10548
|
+
this.onTouched = noop$1;
|
|
10549
|
+
afterNextRender(() => {
|
|
10550
|
+
this.load();
|
|
10551
|
+
});
|
|
10552
|
+
this.destroyRef.onDestroy(() => {
|
|
10553
|
+
this.destroyWidget();
|
|
10554
|
+
});
|
|
10555
|
+
}
|
|
10556
|
+
/** @inheritDoc */
|
|
10557
|
+
writeValue(token) {
|
|
10558
|
+
const { api, widgetId } = this;
|
|
10559
|
+
if (!token && api && widgetId !== undefined) {
|
|
10560
|
+
this.ngZone.runOutsideAngular(() => {
|
|
10561
|
+
api.reset(widgetId);
|
|
10562
|
+
});
|
|
10563
|
+
}
|
|
10564
|
+
}
|
|
10565
|
+
/** @inheritDoc */
|
|
10566
|
+
registerOnChange(onChange) {
|
|
10567
|
+
this.onChange = onChange;
|
|
10568
|
+
}
|
|
10569
|
+
/** @inheritDoc */
|
|
10570
|
+
registerOnTouched(onTouched) {
|
|
10571
|
+
this.onTouched = onTouched;
|
|
10572
|
+
}
|
|
10573
|
+
/**
|
|
10574
|
+
* Повторяет загрузку капчи после ошибки.
|
|
10575
|
+
*/
|
|
10576
|
+
retry() {
|
|
10577
|
+
this.hasError.set(false);
|
|
10578
|
+
this.load();
|
|
10579
|
+
}
|
|
10580
|
+
/**
|
|
10581
|
+
* Загружает API Yandex SmartCaptcha и отрисовывает виджет (API приходит вне зоны Angular). При ошибке загрузки или отрисовки показывает сообщение.
|
|
10582
|
+
*/
|
|
10583
|
+
load() {
|
|
10584
|
+
this.loader.api$
|
|
10585
|
+
.pipe(tap((api) => {
|
|
10586
|
+
this.render(api);
|
|
10587
|
+
}), takeUntilDestroyed(this.destroyRef))
|
|
10588
|
+
.subscribe({
|
|
10589
|
+
error: () => {
|
|
10590
|
+
this.showError();
|
|
10591
|
+
},
|
|
10592
|
+
});
|
|
10593
|
+
}
|
|
10594
|
+
/**
|
|
10595
|
+
* Отрисовывает виджет и подписывается на его события.
|
|
10596
|
+
*
|
|
10597
|
+
* @param api API Yandex SmartCaptcha.
|
|
10598
|
+
*/
|
|
10599
|
+
render(api) {
|
|
10600
|
+
const widgetId = api.render(this.container().nativeElement, { sitekey: this.settings.sitekey, hl: this.settings.language });
|
|
10601
|
+
this.api = api;
|
|
10602
|
+
this.widgetId = widgetId;
|
|
10603
|
+
this.unsubscribers = [
|
|
10604
|
+
api.subscribe(widgetId, 'success', (token) => {
|
|
10605
|
+
this.updateValue(isString(token) ? token : null);
|
|
10606
|
+
}),
|
|
10607
|
+
api.subscribe(widgetId, 'token-expired', () => {
|
|
10608
|
+
this.updateValue(null);
|
|
10609
|
+
api.reset(widgetId);
|
|
10610
|
+
}),
|
|
10611
|
+
api.subscribe(widgetId, 'javascript-error', () => {
|
|
10612
|
+
this.showError();
|
|
10613
|
+
}),
|
|
10614
|
+
];
|
|
10615
|
+
}
|
|
10616
|
+
/**
|
|
10617
|
+
* Передаёт форме новое значение токена.
|
|
10618
|
+
*
|
|
10619
|
+
* @param token Токен прохождения проверки.
|
|
10620
|
+
*/
|
|
10621
|
+
updateValue(token) {
|
|
10622
|
+
this.ngZone.run(() => {
|
|
10623
|
+
this.onChange(token);
|
|
10624
|
+
this.onTouched();
|
|
10625
|
+
});
|
|
10626
|
+
}
|
|
10627
|
+
/**
|
|
10628
|
+
* Удаляет виджет, очищает токен и показывает сообщение об ошибке.
|
|
10629
|
+
*/
|
|
10630
|
+
showError() {
|
|
10631
|
+
this.destroyWidget();
|
|
10632
|
+
this.ngZone.run(() => {
|
|
10633
|
+
this.hasError.set(true);
|
|
10634
|
+
this.onChange(null);
|
|
10635
|
+
});
|
|
10636
|
+
}
|
|
10637
|
+
/**
|
|
10638
|
+
* Удаляет виджет вместе с созданными им элементами и обработчиками.
|
|
10639
|
+
*/
|
|
10640
|
+
destroyWidget() {
|
|
10641
|
+
this.unsubscribers.forEach((unsubscribe) => {
|
|
10642
|
+
unsubscribe();
|
|
10643
|
+
});
|
|
10644
|
+
this.unsubscribers = [];
|
|
10645
|
+
const { api, widgetId } = this;
|
|
10646
|
+
if (api && widgetId !== undefined) {
|
|
10647
|
+
this.ngZone.runOutsideAngular(() => {
|
|
10648
|
+
api.destroy(widgetId);
|
|
10649
|
+
});
|
|
10650
|
+
}
|
|
10651
|
+
this.api = undefined;
|
|
10652
|
+
this.widgetId = undefined;
|
|
10653
|
+
}
|
|
10654
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScSmartCaptchaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
10655
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScSmartCaptchaComponent, isStandalone: true, selector: "sc-smart-captcha", providers: [tuiProvide(NG_VALUE_ACCESSOR, ScSmartCaptchaComponent, true)], viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n #container\n class=\"min-h-[7.375rem]\"\n [class.hidden]=\"hasError()\"\n></div>\n@if (hasError()) {\n <p\n role=\"alert\"\n class=\"text-body-s text-tui-text-negative\"\n >\n \u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0443 \u00AB\u042F \u043D\u0435 \u0440\u043E\u0431\u043E\u0442\u00BB.\n <button\n tuiLink\n type=\"button\"\n (click)=\"retry()\"\n >\n \u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C\n </button>\n </p>\n}\n", dependencies: [{ kind: "directive", type: TuiLink, selector: "a[tuiLink], button[tuiLink]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
10656
|
+
}
|
|
10657
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScSmartCaptchaComponent, decorators: [{
|
|
10658
|
+
type: Component,
|
|
10659
|
+
args: [{ standalone: true, selector: 'sc-smart-captcha', imports: [TuiLink], providers: [tuiProvide(NG_VALUE_ACCESSOR, ScSmartCaptchaComponent, true)], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n #container\n class=\"min-h-[7.375rem]\"\n [class.hidden]=\"hasError()\"\n></div>\n@if (hasError()) {\n <p\n role=\"alert\"\n class=\"text-body-s text-tui-text-negative\"\n >\n \u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0443 \u00AB\u042F \u043D\u0435 \u0440\u043E\u0431\u043E\u0442\u00BB.\n <button\n tuiLink\n type=\"button\"\n (click)=\"retry()\"\n >\n \u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C\n </button>\n </p>\n}\n" }]
|
|
10660
|
+
}], ctorParameters: () => [], propDecorators: { container: [{ type: i0.ViewChild, args: ['container', { isSignal: true }] }] } });
|
|
10661
|
+
|
|
10036
10662
|
/**
|
|
10037
10663
|
* Компонент формы обратной связи.
|
|
10038
10664
|
*/
|
|
@@ -10104,7 +10730,7 @@ class ScFeedbackFormComponent {
|
|
|
10104
10730
|
}
|
|
10105
10731
|
}));
|
|
10106
10732
|
/**
|
|
10107
|
-
* Поле ввода
|
|
10733
|
+
* Поле ввода токена капчи, имя `recaptcha` задано API.
|
|
10108
10734
|
*/
|
|
10109
10735
|
this.recaptchaControl = new FormControl(null, Validators.required);
|
|
10110
10736
|
/**
|
|
@@ -10146,8 +10772,10 @@ class ScFeedbackFormComponent {
|
|
|
10146
10772
|
}),
|
|
10147
10773
|
// eslint-disable-next-line rxjs/no-implicit-any-catch
|
|
10148
10774
|
catchError((error) => {
|
|
10775
|
+
// Токен капчи одноразовый: для повторной отправки нужна новая проверка.
|
|
10776
|
+
this.recaptchaControl.reset();
|
|
10149
10777
|
this.form.markAllAsTouched();
|
|
10150
|
-
const { errors, message } = error.error;
|
|
10778
|
+
const { errors, message } = (error.error ?? {});
|
|
10151
10779
|
if (errors) {
|
|
10152
10780
|
Object.keys(errors).forEach((key) => {
|
|
10153
10781
|
const control = this.form.get(key);
|
|
@@ -10184,16 +10812,6 @@ class ScFeedbackFormComponent {
|
|
|
10184
10812
|
* Список стран.
|
|
10185
10813
|
*/
|
|
10186
10814
|
this.countries = getCountries();
|
|
10187
|
-
/**
|
|
10188
|
-
* Это решение ошибки #4940, было @see [предложено](https://github.com/DethAriel/ng-recaptcha/issues/123#issuecomment-426112101) автором {@link RecaptchaComponent}.
|
|
10189
|
-
*/
|
|
10190
|
-
RecaptchaComponent.prototype.ngOnDestroy = function () {
|
|
10191
|
-
// eslint-disable-next-line @typescript-eslint/dot-notation
|
|
10192
|
-
if (this['subscription']) {
|
|
10193
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @typescript-eslint/dot-notation
|
|
10194
|
-
this['subscription'].unsubscribe();
|
|
10195
|
-
}
|
|
10196
|
-
};
|
|
10197
10815
|
merge(this.accepted$, this.user$, this.loadedFile.valueChanges.pipe(tap((files) => {
|
|
10198
10816
|
this.form.controls.files.reset([]);
|
|
10199
10817
|
this.onUploadFile(files);
|
|
@@ -10317,7 +10935,7 @@ class ScFeedbackFormComponent {
|
|
|
10317
10935
|
return ScPhoneService.isValidPhoneNumberForMessenger(value);
|
|
10318
10936
|
}
|
|
10319
10937
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScFeedbackFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
10320
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScFeedbackFormComponent, isStandalone: true, selector: "sc-feedback-form", inputs: { slugInput: { classPropertyName: "slugInput", publicName: "slug", isSignal: true, isRequired: false, transformFunction: null }, fieldsInput: { classPropertyName: "fieldsInput", publicName: "fields", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clickOffer: "clickOffer", sendSuccess: "sendSuccess" }, ngImport: i0, template: "@let fieldsList = fields();\n@if (fieldsList.length > 0) {\n <form\n [formGroup]=\"form\"\n (ngSubmit)=\"onSubmit.next()\"\n class=\"flex flex-col justify-between gap-4\"\n >\n <!-- \u0424\u0418\u041E -->\n @if (fieldsList.includes('name')) {\n <label tuiLabel>\n \u0424\u0418\u041E\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"name\"\n placeholder=\"\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u0412\u0430\u0448\u0438 \u0424.\u0418.\u041E.\"\n />\n </tui-textfield>\n <tui-error formControlName=\"name\" />\n </label>\n }\n <!-- \u0422\u0435\u043B\u0435\u0444\u043E\u043D -->\n @if (fieldsList.includes('phone')) {\n <label tuiLabel>\n \u0422\u0435\u043B\u0435\u0444\u043E\u043D\n <tui-textfield>\n <input\n formControlName=\"phone\"\n tuiInputPhoneInternational\n [countrySearch]=\"true\"\n [countries]=\"(countries | tuiSortCountries) || []\"\n autocomplete=\"phone\"\n placeholder=\"\u0422\u0435\u043B\u0435\u0444\u043E\u043D\"\n />\n </tui-textfield>\n <tui-error formControlName=\"phone\" />\n </label>\n @if (fieldsList.includes('isShouldUseMessenger') && form.controls.phone.value && isValidPhoneNumberForMessenger(form.controls.phone.value)) {\n <label tuiLabel>\n <input\n formControlName=\"isShouldUseMessenger\"\n tuiCheckbox\n type=\"checkbox\"\n />\n <span tuiTitle> \u041D\u0430\u043F\u0438\u0441\u0430\u0442\u044C \u0432 \u043C\u0435\u0441\u0441\u0435\u043D\u0434\u0436\u0435\u0440\u0430\u0445, \u0430 \u043D\u0435 \u0437\u0432\u043E\u043D\u0438\u0442\u044C </span>\n </label>\n }\n }\n <!-- \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B -->\n @if (fieldsList.includes('email')) {\n <label tuiLabel>\n \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"email\"\n placeholder=\"\u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.email\"\n />\n </tui-textfield>\n <tui-error formControlName=\"email\" />\n </label>\n }\n <!-- \u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439 -->\n @if (fieldsList.includes('message')) {\n <label tuiLabel>\n \u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439\n <tui-textfield>\n <textarea\n tuiTextarea\n formControlName=\"message\"\n [min]=\"3\"\n [max]=\"6\"\n placeholder=\"\u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439\"\n ></textarea>\n </tui-textfield>\n <tui-error formControlName=\"message\" />\n </label>\n }\n <!-- \u0424\u0430\u0439\u043B\u044B -->\n @if (fieldsList.includes('files')) {\n <div class=\"flex flex-col gap-1\">\n <label\n tuiInputFiles\n class=\"self-start !min-h-0 !p-0\"\n >\n <input\n #validator=\"tuiInputFilesValidator\"\n accept=\".doc,.docx,.pdf,image/*\"\n tuiInputFiles\n [formControl]=\"loadedFile\"\n [multiple]=\"true\"\n (reject)=\"onReject($event)\"\n class=\"opacity-0\"\n />\n <ng-template>\n <button\n tuiButton\n type=\"button\"\n tabindex=\"-1\"\n appearance=\"secondary\"\n size=\"m\"\n iconStart=\"@tui.paperclip\"\n >\n \u041F\u0440\u0438\u043A\u0440\u0435\u043F\u0438\u0442\u044C \u0444\u0430\u0439\u043B\n </button>\n </ng-template>\n </label>\n @if (loadedFile.invalid) {\n <tui-error\n [order]=\"['maxLength']\"\n [formControl]=\"loadedFile\"\n />\n }\n @let accepted = accepted$ | async;\n @if (accepted?.length || rejected.length) {\n <tui-files class=\"tui-space_top-1\">\n @for (file of accepted; track file) {\n <tui-file\n [file]=\"file\"\n (remove)=\"onRemove(file)\"\n />\n }\n @for (file of rejected; track file) {\n <tui-file\n state=\"error\"\n [file]=\"(file | tuiFileRejected: validator | async) || file\"\n (remove)=\"onRemove(file)\"\n />\n }\n </tui-files>\n }\n </div>\n }\n <!-- recaptcha -->\n @if (form.get('recaptcha')) {\n <div\n class=\"mb-3 max-h-20 overflow-hidden duration-500\"\n [ngClass]=\"{ '!max-h-0 !-m-2': form.get('recaptcha')?.valid }\"\n >\n <re-captcha formControlName=\"recaptcha\" />\n </div>\n }\n <!-- \u042D\u043B\u0435\u043C\u0435\u043D\u0442\u044B \u0443\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F -->\n <div class=\"flex flex-wrap items-center gap-3\">\n <button\n tuiButton\n [disabled]=\"form.invalid\"\n [loading]=\"!!(loading$ | async)\"\n type=\"submit\"\n iconStart=\"@tui.sc.send\"\n class=\"self-center\"\n >\n \u041E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C\n </button>\n <div class=\"grow basis-60 text-body-s\">\n \u041D\u0430\u0436\u0438\u043C\u0430\u044F \u043D\u0430 \u043A\u043D\u043E\u043F\u043A\u0443, \u0432\u044B \u0441\u043E\u0433\u043B\u0430\u0448\u0430\u0435\u0442\u0435\u0441\u044C \u0441\n <button\n tuiLink\n [style.text-decoration-line]=\"'underline'\"\n type=\"button\"\n (click)=\"context?.data?.onClickOfferHandler(); clickOffer.emit()\"\n >\n \u041F\u043E\u043B\u0438\u0442\u0438\u043A\u043E\u0439 \u043A\u043E\u043D\u0444\u0438\u0434\u0435\u043D\u0446\u0438\u0430\u043B\u044C\u043D\u043E\u0441\u0442\u0438\n </button>\n </div>\n </div>\n </form>\n}\n", dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.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: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: i2.TuiErrorComponent, selector: "tui-error", inputs: ["error"] }, { kind: "directive", type: i2.TuiErrorDirective, selector: "tui-error[ngModel], tui-error[formControlName], tui-error[formControl], tui-error[formGroup], tui-error[formGroupName], tui-error[formArrayName], tui-error[formArray]", inputs: ["order"] }, { kind: "component", type: ScSuggestionFieldComponent, selector: "sc-suggestion-field", inputs: ["type"], outputs: ["selectedClick"] }, { kind: "directive", type: i2$3.TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: i3$1.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler"] }, { kind: "directive", type: i3.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { kind: "directive", type: i2.TuiInputDirective, selector: "input[tuiInput]", inputs: ["readOnly", "invalid", "focused", "state"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: TuiButtonLoading, selector: "[tuiButton][loading],[tuiIconButton][loading]", inputs: ["size", "loading"] }, { kind: "ngmodule", type: RecaptchaFormsModule }, { kind: "directive", type: i6$2.RecaptchaValueAccessorDirective, selector: "re-captcha[formControlName],re-captcha[formControl],re-captcha[ngModel]" }, { kind: "ngmodule", type: RecaptchaModule }, { kind: "component", type: i6$2.RecaptchaComponent, selector: "re-captcha", inputs: ["id", "siteKey", "theme", "type", "size", "tabIndex", "badge", "errorMode"], outputs: ["resolved", "error", "errored"], exportAs: ["reCaptcha"] }, { kind: "directive", type: TuiLink, selector: "a[tuiLink], button[tuiLink]" }, { kind: "component", type: i1$1.TuiTextareaComponent, selector: "textarea[tuiTextarea]", inputs: ["min", "max", "content"] }, { kind: "component", type: TuiCheckbox, selector: "input[type=\"checkbox\"][tuiCheckbox]" }, { kind: "directive", type: TuiTitle, selector: "[tuiTitle]", inputs: ["tuiTitle"] }, { kind: "component", type: i1$1.TuiFile, selector: "tui-file,a[tuiFile],button[tuiFile]", inputs: ["file", "state", "size", "showDelete", "showSize", "leftContent"], outputs: ["remove"] }, { kind: "component", type: i1$1.TuiInputFiles, selector: "label[tuiInputFiles]", inputs: ["tuiInputFiles"] }, { kind: "component", type: i1$1.TuiFilesComponent, selector: "tui-files", inputs: ["max", "expanded"], outputs: ["expandedChange"] }, { kind: "directive", type: i1$1.TuiInputFilesDirective, selector: "input[tuiInputFiles]", outputs: ["reject"] }, { kind: "component", type: i1$1.TuiInputPhoneInternationalComponent, selector: "input[tuiInputPhoneInternational]", inputs: ["countrySearch", "countryIsoCode", "countries"], outputs: ["countryIsoCodeChange"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: i1$1.TuiFileRejectedPipe, name: "tuiFileRejected" }, { kind: "pipe", type: TuiSortCountriesPipe, name: "tuiSortCountries" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
10938
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScFeedbackFormComponent, isStandalone: true, selector: "sc-feedback-form", inputs: { slugInput: { classPropertyName: "slugInput", publicName: "slug", isSignal: true, isRequired: false, transformFunction: null }, fieldsInput: { classPropertyName: "fieldsInput", publicName: "fields", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clickOffer: "clickOffer", sendSuccess: "sendSuccess" }, ngImport: i0, template: "@let fieldsList = fields();\n@if (fieldsList.length > 0) {\n <form\n [formGroup]=\"form\"\n (ngSubmit)=\"onSubmit.next()\"\n class=\"flex flex-col justify-between gap-4\"\n >\n <!-- \u0424\u0418\u041E -->\n @if (fieldsList.includes('name')) {\n <label tuiLabel>\n \u0424\u0418\u041E\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"name\"\n placeholder=\"\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u0412\u0430\u0448\u0438 \u0424.\u0418.\u041E.\"\n />\n </tui-textfield>\n <tui-error formControlName=\"name\" />\n </label>\n }\n <!-- \u0422\u0435\u043B\u0435\u0444\u043E\u043D -->\n @if (fieldsList.includes('phone')) {\n <label tuiLabel>\n \u0422\u0435\u043B\u0435\u0444\u043E\u043D\n <tui-textfield>\n <input\n formControlName=\"phone\"\n tuiInputPhoneInternational\n [countrySearch]=\"true\"\n [countries]=\"(countries | tuiSortCountries) || []\"\n autocomplete=\"phone\"\n placeholder=\"\u0422\u0435\u043B\u0435\u0444\u043E\u043D\"\n />\n </tui-textfield>\n <tui-error formControlName=\"phone\" />\n </label>\n @if (fieldsList.includes('isShouldUseMessenger') && form.controls.phone.value && isValidPhoneNumberForMessenger(form.controls.phone.value)) {\n <label tuiLabel>\n <input\n formControlName=\"isShouldUseMessenger\"\n tuiCheckbox\n type=\"checkbox\"\n />\n <span tuiTitle> \u041D\u0430\u043F\u0438\u0441\u0430\u0442\u044C \u0432 \u043C\u0435\u0441\u0441\u0435\u043D\u0434\u0436\u0435\u0440\u0430\u0445, \u0430 \u043D\u0435 \u0437\u0432\u043E\u043D\u0438\u0442\u044C </span>\n </label>\n }\n }\n <!-- \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B -->\n @if (fieldsList.includes('email')) {\n <label tuiLabel>\n \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"email\"\n placeholder=\"\u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.email\"\n />\n </tui-textfield>\n <tui-error formControlName=\"email\" />\n </label>\n }\n <!-- \u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439 -->\n @if (fieldsList.includes('message')) {\n <label tuiLabel>\n \u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439\n <tui-textfield>\n <textarea\n tuiTextarea\n formControlName=\"message\"\n [min]=\"3\"\n [max]=\"6\"\n placeholder=\"\u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439\"\n ></textarea>\n </tui-textfield>\n <tui-error formControlName=\"message\" />\n </label>\n }\n <!-- \u0424\u0430\u0439\u043B\u044B -->\n @if (fieldsList.includes('files')) {\n <div class=\"flex flex-col gap-1\">\n <label\n tuiInputFiles\n class=\"self-start !min-h-0 !p-0\"\n >\n <input\n #validator=\"tuiInputFilesValidator\"\n accept=\".doc,.docx,.pdf,image/*\"\n tuiInputFiles\n [formControl]=\"loadedFile\"\n [multiple]=\"true\"\n (reject)=\"onReject($event)\"\n class=\"opacity-0\"\n />\n <ng-template>\n <button\n tuiButton\n type=\"button\"\n tabindex=\"-1\"\n appearance=\"secondary\"\n size=\"m\"\n iconStart=\"@tui.paperclip\"\n >\n \u041F\u0440\u0438\u043A\u0440\u0435\u043F\u0438\u0442\u044C \u0444\u0430\u0439\u043B\n </button>\n </ng-template>\n </label>\n @if (loadedFile.invalid) {\n <tui-error\n [order]=\"['maxLength']\"\n [formControl]=\"loadedFile\"\n />\n }\n @let accepted = accepted$ | async;\n @if (accepted?.length || rejected.length) {\n <tui-files class=\"tui-space_top-1\">\n @for (file of accepted; track file) {\n <tui-file\n [file]=\"file\"\n (remove)=\"onRemove(file)\"\n />\n }\n @for (file of rejected; track file) {\n <tui-file\n state=\"error\"\n [file]=\"(file | tuiFileRejected: validator | async) || file\"\n (remove)=\"onRemove(file)\"\n />\n }\n </tui-files>\n }\n </div>\n }\n <!-- \u041A\u0430\u043F\u0447\u0430 -->\n @if (form.get('recaptcha'); as recaptcha) {\n <div\n class=\"mb-3 max-h-[7.5rem] overflow-hidden duration-500\"\n [ngClass]=\"{ '!max-h-0 !-m-2': recaptcha.valid }\"\n [attr.inert]=\"recaptcha.valid ? '' : null\"\n >\n <sc-smart-captcha formControlName=\"recaptcha\" />\n </div>\n @if (recaptcha.getError('serverResponse'); as serverErrors) {\n <tui-error [error]=\"serverErrors.join(' ')\" />\n }\n }\n <!-- \u042D\u043B\u0435\u043C\u0435\u043D\u0442\u044B \u0443\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F -->\n <div class=\"flex flex-wrap items-center gap-3\">\n <button\n tuiButton\n [disabled]=\"form.invalid\"\n [loading]=\"!!(loading$ | async)\"\n type=\"submit\"\n iconStart=\"@tui.sc.send\"\n class=\"self-center\"\n >\n \u041E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C\n </button>\n <div class=\"grow basis-60 text-body-s\">\n \u041D\u0430\u0436\u0438\u043C\u0430\u044F \u043D\u0430 \u043A\u043D\u043E\u043F\u043A\u0443, \u0432\u044B \u0441\u043E\u0433\u043B\u0430\u0448\u0430\u0435\u0442\u0435\u0441\u044C \u0441\n <button\n tuiLink\n [style.text-decoration-line]=\"'underline'\"\n type=\"button\"\n (click)=\"context?.data?.onClickOfferHandler(); clickOffer.emit()\"\n >\n \u041F\u043E\u043B\u0438\u0442\u0438\u043A\u043E\u0439 \u043A\u043E\u043D\u0444\u0438\u0434\u0435\u043D\u0446\u0438\u0430\u043B\u044C\u043D\u043E\u0441\u0442\u0438\n </button>\n </div>\n </div>\n </form>\n}\n", dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.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: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: i2.TuiErrorComponent, selector: "tui-error", inputs: ["error"] }, { kind: "directive", type: i2.TuiErrorDirective, selector: "tui-error[ngModel], tui-error[formControlName], tui-error[formControl], tui-error[formGroup], tui-error[formGroupName], tui-error[formArrayName], tui-error[formArray]", inputs: ["order"] }, { kind: "component", type: ScSuggestionFieldComponent, selector: "sc-suggestion-field", inputs: ["type", "showAddressQuality"], outputs: ["selectedClick"] }, { kind: "directive", type: i2$3.TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: i3$1.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler"] }, { kind: "directive", type: i3.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { kind: "directive", type: i2.TuiInputDirective, selector: "input[tuiInput]", inputs: ["readOnly", "invalid", "focused", "state"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: TuiButtonLoading, selector: "[tuiButton][loading],[tuiIconButton][loading]", inputs: ["size", "loading"] }, { kind: "component", type: ScSmartCaptchaComponent, selector: "sc-smart-captcha" }, { kind: "directive", type: TuiLink, selector: "a[tuiLink], button[tuiLink]" }, { kind: "component", type: i1$1.TuiTextareaComponent, selector: "textarea[tuiTextarea]", inputs: ["min", "max", "content"] }, { kind: "component", type: TuiCheckbox, selector: "input[type=\"checkbox\"][tuiCheckbox]" }, { kind: "directive", type: TuiTitle, selector: "[tuiTitle]", inputs: ["tuiTitle"] }, { kind: "component", type: i1$1.TuiFile, selector: "tui-file,a[tuiFile],button[tuiFile]", inputs: ["file", "state", "size", "showDelete", "showSize", "leftContent"], outputs: ["remove"] }, { kind: "component", type: i1$1.TuiInputFiles, selector: "label[tuiInputFiles]", inputs: ["tuiInputFiles"] }, { kind: "component", type: i1$1.TuiFilesComponent, selector: "tui-files", inputs: ["max", "expanded"], outputs: ["expandedChange"] }, { kind: "directive", type: i1$1.TuiInputFilesDirective, selector: "input[tuiInputFiles]", outputs: ["reject"] }, { kind: "component", type: i1$1.TuiInputPhoneInternationalComponent, selector: "input[tuiInputPhoneInternational]", inputs: ["countrySearch", "countryIsoCode", "countries"], outputs: ["countryIsoCodeChange"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: i1$1.TuiFileRejectedPipe, name: "tuiFileRejected" }, { kind: "pipe", type: TuiSortCountriesPipe, name: "tuiSortCountries" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
10321
10939
|
}
|
|
10322
10940
|
__decorate([
|
|
10323
10941
|
tuiPure
|
|
@@ -10335,8 +10953,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
|
|
|
10335
10953
|
TuiButton,
|
|
10336
10954
|
TuiButtonLoading,
|
|
10337
10955
|
TuiLabel,
|
|
10338
|
-
|
|
10339
|
-
RecaptchaModule,
|
|
10956
|
+
ScSmartCaptchaComponent,
|
|
10340
10957
|
TuiLink,
|
|
10341
10958
|
TuiTextarea,
|
|
10342
10959
|
TuiCheckbox,
|
|
@@ -10345,7 +10962,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
|
|
|
10345
10962
|
TuiInputPhoneInternational,
|
|
10346
10963
|
...TuiInput,
|
|
10347
10964
|
TuiSortCountriesPipe,
|
|
10348
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let fieldsList = fields();\n@if (fieldsList.length > 0) {\n <form\n [formGroup]=\"form\"\n (ngSubmit)=\"onSubmit.next()\"\n class=\"flex flex-col justify-between gap-4\"\n >\n <!-- \u0424\u0418\u041E -->\n @if (fieldsList.includes('name')) {\n <label tuiLabel>\n \u0424\u0418\u041E\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"name\"\n placeholder=\"\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u0412\u0430\u0448\u0438 \u0424.\u0418.\u041E.\"\n />\n </tui-textfield>\n <tui-error formControlName=\"name\" />\n </label>\n }\n <!-- \u0422\u0435\u043B\u0435\u0444\u043E\u043D -->\n @if (fieldsList.includes('phone')) {\n <label tuiLabel>\n \u0422\u0435\u043B\u0435\u0444\u043E\u043D\n <tui-textfield>\n <input\n formControlName=\"phone\"\n tuiInputPhoneInternational\n [countrySearch]=\"true\"\n [countries]=\"(countries | tuiSortCountries) || []\"\n autocomplete=\"phone\"\n placeholder=\"\u0422\u0435\u043B\u0435\u0444\u043E\u043D\"\n />\n </tui-textfield>\n <tui-error formControlName=\"phone\" />\n </label>\n @if (fieldsList.includes('isShouldUseMessenger') && form.controls.phone.value && isValidPhoneNumberForMessenger(form.controls.phone.value)) {\n <label tuiLabel>\n <input\n formControlName=\"isShouldUseMessenger\"\n tuiCheckbox\n type=\"checkbox\"\n />\n <span tuiTitle> \u041D\u0430\u043F\u0438\u0441\u0430\u0442\u044C \u0432 \u043C\u0435\u0441\u0441\u0435\u043D\u0434\u0436\u0435\u0440\u0430\u0445, \u0430 \u043D\u0435 \u0437\u0432\u043E\u043D\u0438\u0442\u044C </span>\n </label>\n }\n }\n <!-- \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B -->\n @if (fieldsList.includes('email')) {\n <label tuiLabel>\n \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"email\"\n placeholder=\"\u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.email\"\n />\n </tui-textfield>\n <tui-error formControlName=\"email\" />\n </label>\n }\n <!-- \u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439 -->\n @if (fieldsList.includes('message')) {\n <label tuiLabel>\n \u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439\n <tui-textfield>\n <textarea\n tuiTextarea\n formControlName=\"message\"\n [min]=\"3\"\n [max]=\"6\"\n placeholder=\"\u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439\"\n ></textarea>\n </tui-textfield>\n <tui-error formControlName=\"message\" />\n </label>\n }\n <!-- \u0424\u0430\u0439\u043B\u044B -->\n @if (fieldsList.includes('files')) {\n <div class=\"flex flex-col gap-1\">\n <label\n tuiInputFiles\n class=\"self-start !min-h-0 !p-0\"\n >\n <input\n #validator=\"tuiInputFilesValidator\"\n accept=\".doc,.docx,.pdf,image/*\"\n tuiInputFiles\n [formControl]=\"loadedFile\"\n [multiple]=\"true\"\n (reject)=\"onReject($event)\"\n class=\"opacity-0\"\n />\n <ng-template>\n <button\n tuiButton\n type=\"button\"\n tabindex=\"-1\"\n appearance=\"secondary\"\n size=\"m\"\n iconStart=\"@tui.paperclip\"\n >\n \u041F\u0440\u0438\u043A\u0440\u0435\u043F\u0438\u0442\u044C \u0444\u0430\u0439\u043B\n </button>\n </ng-template>\n </label>\n @if (loadedFile.invalid) {\n <tui-error\n [order]=\"['maxLength']\"\n [formControl]=\"loadedFile\"\n />\n }\n @let accepted = accepted$ | async;\n @if (accepted?.length || rejected.length) {\n <tui-files class=\"tui-space_top-1\">\n @for (file of accepted; track file) {\n <tui-file\n [file]=\"file\"\n (remove)=\"onRemove(file)\"\n />\n }\n @for (file of rejected; track file) {\n <tui-file\n state=\"error\"\n [file]=\"(file | tuiFileRejected: validator | async) || file\"\n (remove)=\"onRemove(file)\"\n />\n }\n </tui-files>\n }\n </div>\n }\n <!--
|
|
10965
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let fieldsList = fields();\n@if (fieldsList.length > 0) {\n <form\n [formGroup]=\"form\"\n (ngSubmit)=\"onSubmit.next()\"\n class=\"flex flex-col justify-between gap-4\"\n >\n <!-- \u0424\u0418\u041E -->\n @if (fieldsList.includes('name')) {\n <label tuiLabel>\n \u0424\u0418\u041E\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"name\"\n placeholder=\"\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u0412\u0430\u0448\u0438 \u0424.\u0418.\u041E.\"\n />\n </tui-textfield>\n <tui-error formControlName=\"name\" />\n </label>\n }\n <!-- \u0422\u0435\u043B\u0435\u0444\u043E\u043D -->\n @if (fieldsList.includes('phone')) {\n <label tuiLabel>\n \u0422\u0435\u043B\u0435\u0444\u043E\u043D\n <tui-textfield>\n <input\n formControlName=\"phone\"\n tuiInputPhoneInternational\n [countrySearch]=\"true\"\n [countries]=\"(countries | tuiSortCountries) || []\"\n autocomplete=\"phone\"\n placeholder=\"\u0422\u0435\u043B\u0435\u0444\u043E\u043D\"\n />\n </tui-textfield>\n <tui-error formControlName=\"phone\" />\n </label>\n @if (fieldsList.includes('isShouldUseMessenger') && form.controls.phone.value && isValidPhoneNumberForMessenger(form.controls.phone.value)) {\n <label tuiLabel>\n <input\n formControlName=\"isShouldUseMessenger\"\n tuiCheckbox\n type=\"checkbox\"\n />\n <span tuiTitle> \u041D\u0430\u043F\u0438\u0441\u0430\u0442\u044C \u0432 \u043C\u0435\u0441\u0441\u0435\u043D\u0434\u0436\u0435\u0440\u0430\u0445, \u0430 \u043D\u0435 \u0437\u0432\u043E\u043D\u0438\u0442\u044C </span>\n </label>\n }\n }\n <!-- \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B -->\n @if (fieldsList.includes('email')) {\n <label tuiLabel>\n \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"email\"\n placeholder=\"\u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.email\"\n />\n </tui-textfield>\n <tui-error formControlName=\"email\" />\n </label>\n }\n <!-- \u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439 -->\n @if (fieldsList.includes('message')) {\n <label tuiLabel>\n \u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439\n <tui-textfield>\n <textarea\n tuiTextarea\n formControlName=\"message\"\n [min]=\"3\"\n [max]=\"6\"\n placeholder=\"\u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439\"\n ></textarea>\n </tui-textfield>\n <tui-error formControlName=\"message\" />\n </label>\n }\n <!-- \u0424\u0430\u0439\u043B\u044B -->\n @if (fieldsList.includes('files')) {\n <div class=\"flex flex-col gap-1\">\n <label\n tuiInputFiles\n class=\"self-start !min-h-0 !p-0\"\n >\n <input\n #validator=\"tuiInputFilesValidator\"\n accept=\".doc,.docx,.pdf,image/*\"\n tuiInputFiles\n [formControl]=\"loadedFile\"\n [multiple]=\"true\"\n (reject)=\"onReject($event)\"\n class=\"opacity-0\"\n />\n <ng-template>\n <button\n tuiButton\n type=\"button\"\n tabindex=\"-1\"\n appearance=\"secondary\"\n size=\"m\"\n iconStart=\"@tui.paperclip\"\n >\n \u041F\u0440\u0438\u043A\u0440\u0435\u043F\u0438\u0442\u044C \u0444\u0430\u0439\u043B\n </button>\n </ng-template>\n </label>\n @if (loadedFile.invalid) {\n <tui-error\n [order]=\"['maxLength']\"\n [formControl]=\"loadedFile\"\n />\n }\n @let accepted = accepted$ | async;\n @if (accepted?.length || rejected.length) {\n <tui-files class=\"tui-space_top-1\">\n @for (file of accepted; track file) {\n <tui-file\n [file]=\"file\"\n (remove)=\"onRemove(file)\"\n />\n }\n @for (file of rejected; track file) {\n <tui-file\n state=\"error\"\n [file]=\"(file | tuiFileRejected: validator | async) || file\"\n (remove)=\"onRemove(file)\"\n />\n }\n </tui-files>\n }\n </div>\n }\n <!-- \u041A\u0430\u043F\u0447\u0430 -->\n @if (form.get('recaptcha'); as recaptcha) {\n <div\n class=\"mb-3 max-h-[7.5rem] overflow-hidden duration-500\"\n [ngClass]=\"{ '!max-h-0 !-m-2': recaptcha.valid }\"\n [attr.inert]=\"recaptcha.valid ? '' : null\"\n >\n <sc-smart-captcha formControlName=\"recaptcha\" />\n </div>\n @if (recaptcha.getError('serverResponse'); as serverErrors) {\n <tui-error [error]=\"serverErrors.join(' ')\" />\n }\n }\n <!-- \u042D\u043B\u0435\u043C\u0435\u043D\u0442\u044B \u0443\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F -->\n <div class=\"flex flex-wrap items-center gap-3\">\n <button\n tuiButton\n [disabled]=\"form.invalid\"\n [loading]=\"!!(loading$ | async)\"\n type=\"submit\"\n iconStart=\"@tui.sc.send\"\n class=\"self-center\"\n >\n \u041E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C\n </button>\n <div class=\"grow basis-60 text-body-s\">\n \u041D\u0430\u0436\u0438\u043C\u0430\u044F \u043D\u0430 \u043A\u043D\u043E\u043F\u043A\u0443, \u0432\u044B \u0441\u043E\u0433\u043B\u0430\u0448\u0430\u0435\u0442\u0435\u0441\u044C \u0441\n <button\n tuiLink\n [style.text-decoration-line]=\"'underline'\"\n type=\"button\"\n (click)=\"context?.data?.onClickOfferHandler(); clickOffer.emit()\"\n >\n \u041F\u043E\u043B\u0438\u0442\u0438\u043A\u043E\u0439 \u043A\u043E\u043D\u0444\u0438\u0434\u0435\u043D\u0446\u0438\u0430\u043B\u044C\u043D\u043E\u0441\u0442\u0438\n </button>\n </div>\n </div>\n </form>\n}\n" }]
|
|
10349
10966
|
}], ctorParameters: () => [], propDecorators: { slugInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "slug", required: false }] }], fieldsInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "fields", required: false }] }], clickOffer: [{ type: i0.Output, args: ["clickOffer"] }], sendSuccess: [{ type: i0.Output, args: ["sendSuccess"] }], isValidPhoneNumberForMessenger: [] } });
|
|
10350
10967
|
|
|
10351
10968
|
/**
|
|
@@ -10508,7 +11125,7 @@ class ScUpdateUserInfoDialogComponent {
|
|
|
10508
11125
|
});
|
|
10509
11126
|
}
|
|
10510
11127
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScUpdateUserInfoDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
10511
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScUpdateUserInfoDialogComponent, isStandalone: true, selector: "sc-update-user-info-dialog", outputs: { cancelButtonClick: "cancelButtonClick", successUpdateDate: "successUpdateDate" }, ngImport: i0, template: "@if (user$ | async; as user) {\n <form\n [formGroup]=\"form\"\n (ngSubmit)=\"onSubmit.next()\"\n class=\"flex flex-col gap-4\"\n >\n <label tuiLabel>\n {{ user.isOrg ? '\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043B\u0438 \u0418\u041F' : '\u0424.\u0418.\u041E.' }}\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"name\"\n [placeholder]=\"user.isOrg ? '\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043B\u0438 \u0418\u041F' : '\u0424.\u0418.\u041E.'\"\n />\n @if (user.isOrg) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.organization\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"name\" />\n </label>\n @let phoneIsChange = user.contacts.phone.value === form.value.phone;\n <sc-verification-phone-check-form\n [showCodeFields]=\"!phoneIsChange\"\n [shouldBeBusy]=\"phoneIsChange\"\n class=\"w-full\"\n />\n <label\n tuiLabel\n class=\"w-full\"\n >\n \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"email\"\n placeholder=\"\u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.email\"\n />\n </tui-textfield>\n <tui-error formControlName=\"email\" />\n </label>\n <sc-addresses-selection-field />\n <label tuiLabel>\n <input\n tuiCheckbox\n type=\"checkbox\"\n formControlName=\"getNews\"\n class=\"w-full\"\n />\n \u042F \u0445\u043E\u0447\u0443 \u043F\u043E\u043B\u0443\u0447\u0430\u0442\u044C \u0440\u0430\u0441\u0441\u044B\u043B\u043A\u0443 \u0421\u043D\u0430\u0431\u0446\u0435\u043D\u0442\u0440 \u043E \u0441\u043A\u0438\u0434\u043A\u0430\u0445 \u0438 \u043D\u043E\u0432\u043E\u0441\u0442\u044F\u0445 \u043F\u043E \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u0435.\n </label>\n <div class=\"flex justify-center gap-4\">\n <button\n tuiButton\n (click)=\"context ? context.$implicit.complete() : cancelButtonClick.emit()\"\n type=\"button\"\n iconStart=\"@tui.x\"\n appearance=\"secondary\"\n >\n \u041E\u0442\u043C\u0435\u043D\u0430\n </button>\n <button\n tuiButton\n [disabled]=\"form.invalid\"\n [loading]=\"!!(loading$ | async)\"\n type=\"submit\"\n iconStart=\"@tui.save\"\n >\n \u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C\n </button>\n </div>\n </form>\n}\n", dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.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: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: i2.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler"] }, { kind: "directive", type: i3.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { kind: "directive", type: i2.TuiInputDirective, selector: "input[tuiInput]", inputs: ["readOnly", "invalid", "focused", "state"] }, { kind: "component", type: i2.TuiErrorComponent, selector: "tui-error", inputs: ["error"] }, { kind: "directive", type: i2.TuiErrorDirective, selector: "tui-error[ngModel], tui-error[formControlName], tui-error[formControl], tui-error[formGroup], tui-error[formGroupName], tui-error[formArrayName], tui-error[formArray]", inputs: ["order"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: TuiButtonLoading, selector: "[tuiButton][loading],[tuiIconButton][loading]", inputs: ["size", "loading"] }, { kind: "component", type: TuiCheckbox, selector: "input[type=\"checkbox\"][tuiCheckbox]" }, { kind: "component", type: ScSuggestionFieldComponent, selector: "sc-suggestion-field", inputs: ["type"], outputs: ["selectedClick"] }, { kind: "component", type: ScAddressesSelectionFieldComponent, selector: "sc-addresses-selection-field", inputs: ["canSelectCountry"], outputs: ["canSelectCountryChange"] }, { kind: "component", type: ScVerificationPhoneCheckFormComponent, selector: "sc-verification-phone-check-form", inputs: ["showCodeFields", "readOnly", "pseudoInvalid", "required", "subtitle", "shouldBeBusy", "shouldBeConfirmed", "haveCode"], outputs: ["haveCodeChange", "isBusyChange", "isConfirmedChange"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
11128
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScUpdateUserInfoDialogComponent, isStandalone: true, selector: "sc-update-user-info-dialog", outputs: { cancelButtonClick: "cancelButtonClick", successUpdateDate: "successUpdateDate" }, ngImport: i0, template: "@if (user$ | async; as user) {\n <form\n [formGroup]=\"form\"\n (ngSubmit)=\"onSubmit.next()\"\n class=\"flex flex-col gap-4\"\n >\n <label tuiLabel>\n {{ user.isOrg ? '\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043B\u0438 \u0418\u041F' : '\u0424.\u0418.\u041E.' }}\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"name\"\n [placeholder]=\"user.isOrg ? '\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043B\u0438 \u0418\u041F' : '\u0424.\u0418.\u041E.'\"\n />\n @if (user.isOrg) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.organization\"\n [showAddressQuality]=\"false\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"name\" />\n </label>\n @let phoneIsChange = user.contacts.phone.value === form.value.phone;\n <sc-verification-phone-check-form\n [showCodeFields]=\"!phoneIsChange\"\n [shouldBeBusy]=\"phoneIsChange\"\n class=\"w-full\"\n />\n <label\n tuiLabel\n class=\"w-full\"\n >\n \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"email\"\n placeholder=\"\u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.email\"\n />\n </tui-textfield>\n <tui-error formControlName=\"email\" />\n </label>\n <sc-addresses-selection-field />\n <label tuiLabel>\n <input\n tuiCheckbox\n type=\"checkbox\"\n formControlName=\"getNews\"\n class=\"w-full\"\n />\n \u042F \u0445\u043E\u0447\u0443 \u043F\u043E\u043B\u0443\u0447\u0430\u0442\u044C \u0440\u0430\u0441\u0441\u044B\u043B\u043A\u0443 \u0421\u043D\u0430\u0431\u0446\u0435\u043D\u0442\u0440 \u043E \u0441\u043A\u0438\u0434\u043A\u0430\u0445 \u0438 \u043D\u043E\u0432\u043E\u0441\u0442\u044F\u0445 \u043F\u043E \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u0435.\n </label>\n <div class=\"flex justify-center gap-4\">\n <button\n tuiButton\n (click)=\"context ? context.$implicit.complete() : cancelButtonClick.emit()\"\n type=\"button\"\n iconStart=\"@tui.x\"\n appearance=\"secondary\"\n >\n \u041E\u0442\u043C\u0435\u043D\u0430\n </button>\n <button\n tuiButton\n [disabled]=\"form.invalid\"\n [loading]=\"!!(loading$ | async)\"\n type=\"submit\"\n iconStart=\"@tui.save\"\n >\n \u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C\n </button>\n </div>\n </form>\n}\n", dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.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: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: i2.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler"] }, { kind: "directive", type: i3.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { kind: "directive", type: i2.TuiInputDirective, selector: "input[tuiInput]", inputs: ["readOnly", "invalid", "focused", "state"] }, { kind: "component", type: i2.TuiErrorComponent, selector: "tui-error", inputs: ["error"] }, { kind: "directive", type: i2.TuiErrorDirective, selector: "tui-error[ngModel], tui-error[formControlName], tui-error[formControl], tui-error[formGroup], tui-error[formGroupName], tui-error[formArrayName], tui-error[formArray]", inputs: ["order"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: TuiButtonLoading, selector: "[tuiButton][loading],[tuiIconButton][loading]", inputs: ["size", "loading"] }, { kind: "component", type: TuiCheckbox, selector: "input[type=\"checkbox\"][tuiCheckbox]" }, { kind: "component", type: ScSuggestionFieldComponent, selector: "sc-suggestion-field", inputs: ["type", "showAddressQuality"], outputs: ["selectedClick"] }, { kind: "component", type: ScAddressesSelectionFieldComponent, selector: "sc-addresses-selection-field", inputs: ["canSelectCountry"], outputs: ["canSelectCountryChange"] }, { kind: "component", type: ScVerificationPhoneCheckFormComponent, selector: "sc-verification-phone-check-form", inputs: ["showCodeFields", "readOnly", "pseudoInvalid", "required", "subtitle", "shouldBeBusy", "shouldBeConfirmed", "haveCode"], outputs: ["haveCodeChange", "isBusyChange", "isConfirmedChange"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
10512
11129
|
}
|
|
10513
11130
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScUpdateUserInfoDialogComponent, decorators: [{
|
|
10514
11131
|
type: Component,
|
|
@@ -10525,7 +11142,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
|
|
|
10525
11142
|
ScSuggestionFieldComponent,
|
|
10526
11143
|
ScAddressesSelectionFieldComponent,
|
|
10527
11144
|
ScVerificationPhoneCheckFormComponent,
|
|
10528
|
-
], template: "@if (user$ | async; as user) {\n <form\n [formGroup]=\"form\"\n (ngSubmit)=\"onSubmit.next()\"\n class=\"flex flex-col gap-4\"\n >\n <label tuiLabel>\n {{ user.isOrg ? '\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043B\u0438 \u0418\u041F' : '\u0424.\u0418.\u041E.' }}\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"name\"\n [placeholder]=\"user.isOrg ? '\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043B\u0438 \u0418\u041F' : '\u0424.\u0418.\u041E.'\"\n />\n @if (user.isOrg) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.organization\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"name\" />\n </label>\n @let phoneIsChange = user.contacts.phone.value === form.value.phone;\n <sc-verification-phone-check-form\n [showCodeFields]=\"!phoneIsChange\"\n [shouldBeBusy]=\"phoneIsChange\"\n class=\"w-full\"\n />\n <label\n tuiLabel\n class=\"w-full\"\n >\n \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"email\"\n placeholder=\"\u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.email\"\n />\n </tui-textfield>\n <tui-error formControlName=\"email\" />\n </label>\n <sc-addresses-selection-field />\n <label tuiLabel>\n <input\n tuiCheckbox\n type=\"checkbox\"\n formControlName=\"getNews\"\n class=\"w-full\"\n />\n \u042F \u0445\u043E\u0447\u0443 \u043F\u043E\u043B\u0443\u0447\u0430\u0442\u044C \u0440\u0430\u0441\u0441\u044B\u043B\u043A\u0443 \u0421\u043D\u0430\u0431\u0446\u0435\u043D\u0442\u0440 \u043E \u0441\u043A\u0438\u0434\u043A\u0430\u0445 \u0438 \u043D\u043E\u0432\u043E\u0441\u0442\u044F\u0445 \u043F\u043E \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u0435.\n </label>\n <div class=\"flex justify-center gap-4\">\n <button\n tuiButton\n (click)=\"context ? context.$implicit.complete() : cancelButtonClick.emit()\"\n type=\"button\"\n iconStart=\"@tui.x\"\n appearance=\"secondary\"\n >\n \u041E\u0442\u043C\u0435\u043D\u0430\n </button>\n <button\n tuiButton\n [disabled]=\"form.invalid\"\n [loading]=\"!!(loading$ | async)\"\n type=\"submit\"\n iconStart=\"@tui.save\"\n >\n \u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C\n </button>\n </div>\n </form>\n}\n" }]
|
|
11145
|
+
], template: "@if (user$ | async; as user) {\n <form\n [formGroup]=\"form\"\n (ngSubmit)=\"onSubmit.next()\"\n class=\"flex flex-col gap-4\"\n >\n <label tuiLabel>\n {{ user.isOrg ? '\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043B\u0438 \u0418\u041F' : '\u0424.\u0418.\u041E.' }}\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"name\"\n [placeholder]=\"user.isOrg ? '\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043B\u0438 \u0418\u041F' : '\u0424.\u0418.\u041E.'\"\n />\n @if (user.isOrg) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.organization\"\n [showAddressQuality]=\"false\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"name\" />\n </label>\n @let phoneIsChange = user.contacts.phone.value === form.value.phone;\n <sc-verification-phone-check-form\n [showCodeFields]=\"!phoneIsChange\"\n [shouldBeBusy]=\"phoneIsChange\"\n class=\"w-full\"\n />\n <label\n tuiLabel\n class=\"w-full\"\n >\n \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"email\"\n placeholder=\"\u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.email\"\n />\n </tui-textfield>\n <tui-error formControlName=\"email\" />\n </label>\n <sc-addresses-selection-field />\n <label tuiLabel>\n <input\n tuiCheckbox\n type=\"checkbox\"\n formControlName=\"getNews\"\n class=\"w-full\"\n />\n \u042F \u0445\u043E\u0447\u0443 \u043F\u043E\u043B\u0443\u0447\u0430\u0442\u044C \u0440\u0430\u0441\u0441\u044B\u043B\u043A\u0443 \u0421\u043D\u0430\u0431\u0446\u0435\u043D\u0442\u0440 \u043E \u0441\u043A\u0438\u0434\u043A\u0430\u0445 \u0438 \u043D\u043E\u0432\u043E\u0441\u0442\u044F\u0445 \u043F\u043E \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u0435.\n </label>\n <div class=\"flex justify-center gap-4\">\n <button\n tuiButton\n (click)=\"context ? context.$implicit.complete() : cancelButtonClick.emit()\"\n type=\"button\"\n iconStart=\"@tui.x\"\n appearance=\"secondary\"\n >\n \u041E\u0442\u043C\u0435\u043D\u0430\n </button>\n <button\n tuiButton\n [disabled]=\"form.invalid\"\n [loading]=\"!!(loading$ | async)\"\n type=\"submit\"\n iconStart=\"@tui.save\"\n >\n \u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C\n </button>\n </div>\n </form>\n}\n" }]
|
|
10529
11146
|
}], ctorParameters: () => [], propDecorators: { cancelButtonClick: [{
|
|
10530
11147
|
type: Output
|
|
10531
11148
|
}], successUpdateDate: [{
|
|
@@ -10831,5 +11448,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
|
|
|
10831
11448
|
* Generated bundle index. Do not edit.
|
|
10832
11449
|
*/
|
|
10833
11450
|
|
|
10834
|
-
export { AbstractScPriceCard, AuthMethod, CURRENT_COUNTRY_ID, CostWithDiscountComponent, FilesAndDocumentsComponent, FinishDateTimeTransformerDirective, IDLE_ITEM_STATE, IS_DEFAULT_COUNTRY, MAX_FILES_IN_FORM_INPUT, SC_ALLOW_SELECT_TERMINATED, SC_BANNER_DURATION, SC_CATALOG_PRODUCTS_FILTERS, SC_CATALOG_SHOW_PRODUCTS_RECURSIVELY, SC_DATE_FORMATTER, SC_DEBOUNCE_TIME_DEFAULT, SC_DIALOG_SERVICE_TOKEN, SC_ERROR_CHANGE_HANDLER, SC_FAQ_GROUP_QUERY_PARAM, SC_FAQ_QUESTION_ANCHOR_PREFIX, SC_HELP_NOTIFICATION_CLOSE, SC_HELP_NOTIFICATION_LIMIT, SC_HIDDEN_PRINT_ELEMENTS, SC_MANAGER_QR_HANDLER, SC_NOTIFY_WHEN_IN_STOCK_REQUIRED_FIELDS, SC_ORDER_FORM_CONFIG, SC_ORDER_OPTIONS, SC_PAGE_SIZE_OPTIONS$1 as SC_PAGE_SIZE_OPTIONS, SC_SHOW_HELP_NOTIFICATION_IN_PHONE_INPUT, SC_USER_CITY_INFO, SC_USER_INFO, SC_USER_PROVIDERS, SC_VERIFICATION_CODE_TIMEOUT, ScAccordionComponent, ScAccordionContentDirective, ScAddContactDialogComponent, ScAddContragentBankAccountsDialogComponent, ScAddContragentDialogComponent, ScAddDeliveryAddressDialogComponent, ScAddOrEditingCartItemDialogComponent, ScAddOrEditingCartItemFormComponent, ScAddressesSelectionFieldComponent, ScBannerComponent, ScBrandsListComponent, ScCartAddProductsFromCsvDialogComponent, ScCatalogFilterCollapsibleComponent, ScCatalogFiltersComponent, ScCategoryCardComponent, ScContactsAccordionComponent, ScContragentsAccordionComponent, ScContragentsAccordionItemComponent, ScDeliveryAddressAccordionComponent, ScDeliveryAddressAccordionItemComponent, ScDownloadPriceListComponent, ScDraftComponent, ScEmailLinkDirective, ScErrorBlockStatusComponent, ScErrorHandlerComponent, ScFavoriteButtonComponent, ScFeedbackFormComponent, ScFocusFirstInvalidFieldDirective, ScFormatDatePipe, ScFrequentlyAskedQuestionsComponent, ScFrequentlyAskedQuestionsGroupSelectorComponent, ScFrequentlyAskedQuestionsWithGroupsComponent, ScGratitudeComponent, ScHelpNotificationService, ScHoverImageCarouselComponent, ScInputQuantityComponent, ScLinks, ScManagerCardComponent, ScManagerCardPushComponent, ScNewContactFormComponent, ScNewContragentBankAccountsFormComponent, ScNewContragentFormComponent, ScNewsCardComponent, ScNewsCardSkeletonComponent, ScNewsListComponent, ScNextInputFocusDirective, ScNoindexDirective, ScNoindexWrapperComponent, ScNotifyWhenInStockDialogComponent, ScOrderAccessorDirective,
|
|
11451
|
+
export { AbstractScPriceCard, AuthMethod, CURRENT_COUNTRY_ID, CostWithDiscountComponent, FilesAndDocumentsComponent, FinishDateTimeTransformerDirective, IDLE_ITEM_STATE, IS_DEFAULT_COUNTRY, MAX_FILES_IN_FORM_INPUT, SC_ALLOW_SELECT_TERMINATED, SC_BANNER_DURATION, SC_BLOCK_INCOMPLETE_ADDRESS, SC_CATALOG_PRODUCTS_FILTERS, SC_CATALOG_SHOW_PRODUCTS_RECURSIVELY, SC_DATE_FORMATTER, SC_DEBOUNCE_TIME_DEFAULT, SC_DIALOG_SERVICE_TOKEN, SC_ERROR_CHANGE_HANDLER, SC_FAQ_GROUP_QUERY_PARAM, SC_FAQ_QUESTION_ANCHOR_PREFIX, SC_HELP_NOTIFICATION_CLOSE, SC_HELP_NOTIFICATION_LIMIT, SC_HIDDEN_PRINT_ELEMENTS, SC_MANAGER_QR_HANDLER, SC_NOTIFY_WHEN_IN_STOCK_REQUIRED_FIELDS, SC_ORDER_FORM_CONFIG, SC_ORDER_OPTIONS, SC_PAGE_SIZE_OPTIONS$1 as SC_PAGE_SIZE_OPTIONS, SC_SHOW_HELP_NOTIFICATION_IN_PHONE_INPUT, SC_SMART_CAPTCHA_LOAD_TIMEOUT, SC_SMART_CAPTCHA_SETTINGS, SC_USER_CITY_INFO, SC_USER_INFO, SC_USER_PROVIDERS, SC_VERIFICATION_CODE_TIMEOUT, ScAccordionComponent, ScAccordionContentDirective, ScAddContactDialogComponent, ScAddContragentBankAccountsDialogComponent, ScAddContragentDialogComponent, ScAddDeliveryAddressDialogComponent, ScAddOrEditingCartItemDialogComponent, ScAddOrEditingCartItemFormComponent, ScAddressQualityDirective, ScAddressQualityService, ScAddressesSelectionFieldComponent, ScBannerComponent, ScBrandsListComponent, ScCartAddProductsFromCsvDialogComponent, ScCatalogFilterCollapsibleComponent, ScCatalogFiltersComponent, ScCategoryCardComponent, ScContactsAccordionComponent, ScContragentsAccordionComponent, ScContragentsAccordionItemComponent, ScDeliveryAddressAccordionComponent, ScDeliveryAddressAccordionItemComponent, ScDownloadPriceListComponent, ScDraftComponent, ScEmailLinkDirective, ScErrorBlockStatusComponent, ScErrorHandlerComponent, ScFavoriteButtonComponent, ScFeedbackFormComponent, ScFocusFirstInvalidFieldDirective, ScFormatDatePipe, ScFrequentlyAskedQuestionsComponent, ScFrequentlyAskedQuestionsGroupSelectorComponent, ScFrequentlyAskedQuestionsWithGroupsComponent, ScGratitudeComponent, ScHelpNotificationService, ScHoverImageCarouselComponent, ScInputQuantityComponent, ScLinks, ScManagerCardComponent, ScManagerCardPushComponent, ScNewContactFormComponent, ScNewContragentBankAccountsFormComponent, ScNewContragentFormComponent, ScNewOrderItemsComponent, ScNewsCardComponent, ScNewsCardSkeletonComponent, ScNewsListComponent, ScNextInputFocusDirective, ScNoindexDirective, ScNoindexWrapperComponent, ScNotifyWhenInStockDialogComponent, ScOrderAccessorDirective, ScOrderFormComponent, ScOrderItemComponent, ScOrderItemsListByStockComponent, ScOrderItemsListComponent, ScOrderItemsListWithActionsComponent, ScPaginationLinksComponent, ScPaymentStatusComponent, ScPersonalDataProcessingPolicyComponent, ScPhoneFormatPipe, ScPreviewSampleComponent, ScPreviewSamplesMosquitoComponent, ScPriceCardComponent, ScPriceCardInlineComponent, ScPriceHistoryComponent, ScPriceListPaginationComponent, ScPriceWarehouseStockComponent, ScPrintDirective, ScPrintService, ScPrivacyPolicyComponent, ScProductInAllWarehousesPipe, ScProfileAccordionsContentComponent, ScPublicOfferComponent, ScQRCodeDialogComponent, ScResetUserPasswordComponent, ScResourcePreviewComponent, ScSandwichComponent, ScSandwichM2Component, ScSandwichM2SkeletonComponent, ScSandwichSkeletonComponent, ScScriptsService, ScSelectOnFocusinDirective, ScSeoTagsComponent, ScShareButtonComponent, ScShareDialogComponent, ScShareMessengersLinksComponent, ScShareService, ScSignInFormByEmailComponent, ScSignInFormByPhoneComponent, ScSignInFormComponent, ScSignUpFormComponent, ScSimpleSignUpFormComponent, ScSmartCaptchaComponent, ScSmartCaptchaLoaderService, ScSuggestionFieldComponent, ScTelLinkDirective, ScTerminalLinkDirective, ScUpdateUserInfoDialogComponent, ScUserManagersComponent, ScUserPhoneApproveDialogComponent, ScVerificationPhoneCheckFormComponent, TreeDirective, TreeIconService, TreeLoaderService, TreeTopDirective, phoneValidator, scAtLeastOneRequiredValidator, scBicValidator, scClientUiIconsName, scCorrespondentAccountValidator, scGetCurrentRoute, scGetFaqGroupQueryParams, scGetFaqQuestionAnchor, scGetFaqQuestionIdFromAnchor, scPasswordConfirmMatchingValidator, stepValidator, tuiDateValueTransformerDefaultProvider };
|
|
10835
11452
|
//# sourceMappingURL=snabcentr-client-ui.mjs.map
|