@snabcentr/client-ui 3.53.6 → 3.54.1
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/esm2022/pages/frequently-asked-questions/sc-faq-query-params.mjs +9 -0
- package/esm2022/pages/frequently-asked-questions/sc-get-faq-group-query-params.mjs +13 -0
- package/esm2022/pages/frequently-asked-questions-group-selector/sc-frequently-asked-questions-group-selector.component.mjs +46 -17
- package/esm2022/pages/frequently-asked-questions-with-groups/sc-frequently-asked-questions-with-groups.component.mjs +31 -31
- package/esm2022/pages/index.mjs +3 -1
- package/esm2022/pagination/index.mjs +2 -0
- package/esm2022/pagination/sc-pagination-links/sc-pagination-links.component.mjs +98 -0
- package/esm2022/public-api.mjs +2 -1
- package/fesm2022/snabcentr-client-ui.mjs +182 -44
- package/fesm2022/snabcentr-client-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/pages/frequently-asked-questions/sc-faq-query-params.d.ts +8 -0
- package/pages/frequently-asked-questions/sc-get-faq-group-query-params.d.ts +10 -0
- package/pages/frequently-asked-questions-group-selector/sc-frequently-asked-questions-group-selector.component.d.ts +23 -4
- package/pages/frequently-asked-questions-with-groups/sc-frequently-asked-questions-with-groups.component.d.ts +16 -14
- package/pages/index.d.ts +2 -0
- package/pagination/index.d.ts +1 -0
- package/pagination/sc-pagination-links/sc-pagination-links.component.d.ts +60 -0
- package/public-api.d.ts +1 -0
- package/release_notes.tmp +2 -4
- package/styles/tailwind/tailwind.scss +0 -4
package/esm2022/public-api.mjs
CHANGED
|
@@ -21,6 +21,7 @@ export * from './news';
|
|
|
21
21
|
export * from './noindex-wrapper';
|
|
22
22
|
export * from './order';
|
|
23
23
|
export * from './pages';
|
|
24
|
+
export * from './pagination';
|
|
24
25
|
export * from './pipes';
|
|
25
26
|
export * from './samples';
|
|
26
27
|
export * from './methods';
|
|
@@ -32,4 +33,4 @@ export * from './user';
|
|
|
32
33
|
export * from './validators';
|
|
33
34
|
export * from './verification';
|
|
34
35
|
export * from './profile';
|
|
35
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
36
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL2NsaWVudC11aS9wdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsVUFBVSxDQUFDO0FBQ3pCLGNBQWMsWUFBWSxDQUFDO0FBQzNCLGNBQWMsUUFBUSxDQUFDO0FBQ3ZCLGNBQWMsYUFBYSxDQUFDO0FBQzVCLGNBQWMsVUFBVSxDQUFDO0FBQ3pCLGNBQWMsUUFBUSxDQUFDO0FBQ3ZCLGNBQWMsV0FBVyxDQUFDO0FBQzFCLGNBQWMsaUJBQWlCLENBQUM7QUFDaEMsY0FBYyxlQUFlLENBQUM7QUFDOUIsY0FBYyxZQUFZLENBQUM7QUFDM0IsY0FBYyxvQkFBb0IsQ0FBQztBQUNuQyxjQUFjLFdBQVcsQ0FBQztBQUMxQixjQUFjLGNBQWMsQ0FBQztBQUM3QixjQUFjLGlCQUFpQixDQUFDO0FBQ2hDLGNBQWMsU0FBUyxDQUFDO0FBQ3hCLGNBQWMsZUFBZSxDQUFDO0FBQzlCLGNBQWMsU0FBUyxDQUFDO0FBQ3hCLGNBQWMsVUFBVSxDQUFDO0FBQ3pCLGNBQWMsZUFBZSxDQUFDO0FBQzlCLGNBQWMsUUFBUSxDQUFDO0FBQ3ZCLGNBQWMsbUJBQW1CLENBQUM7QUFDbEMsY0FBYyxTQUFTLENBQUM7QUFDeEIsY0FBYyxTQUFTLENBQUM7QUFDeEIsY0FBYyxjQUFjLENBQUM7QUFDN0IsY0FBYyxTQUFTLENBQUM7QUFDeEIsY0FBYyxXQUFXLENBQUM7QUFDMUIsY0FBYyxXQUFXLENBQUM7QUFDMUIsY0FBYyxhQUFhLENBQUM7QUFDNUIsY0FBYyxZQUFZLENBQUM7QUFDM0IsY0FBYyxVQUFVLENBQUM7QUFDekIsY0FBYyxnQkFBZ0IsQ0FBQztBQUMvQixjQUFjLFFBQVEsQ0FBQztBQUN2QixjQUFjLGNBQWMsQ0FBQztBQUM3QixjQUFjLGdCQUFnQixDQUFDO0FBQy9CLGNBQWMsV0FBVyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnLi9tb2RlbHMnO1xuZXhwb3J0ICogZnJvbSAnLi9zZXJ2aWNlcyc7XG5leHBvcnQgKiBmcm9tICcuL2F1dGgnO1xuZXhwb3J0ICogZnJvbSAnLi9hY2NvcmRpb24nO1xuZXhwb3J0ICogZnJvbSAnLi9iYW5uZXInO1xuZXhwb3J0ICogZnJvbSAnLi9jYXJ0JztcbmV4cG9ydCAqIGZyb20gJy4vY2F0YWxvZyc7XG5leHBvcnQgKiBmcm9tICcuL2NvbmZpZ3VyYXRvcnMnO1xuZXhwb3J0ICogZnJvbSAnLi9jb250cmFnZW50cyc7XG5leHBvcnQgKiBmcm9tICcuL2NvbnRhY3RzJztcbmV4cG9ydCAqIGZyb20gJy4vZGVsaXZlcnktYWRkcmVzcyc7XG5leHBvcnQgKiBmcm9tICcuL2RpYWxvZ3MnO1xuZXhwb3J0ICogZnJvbSAnLi9kaXJlY3RpdmVzJztcbmV4cG9ydCAqIGZyb20gJy4vZXJyb3ItaGFuZGxlcic7XG5leHBvcnQgKiBmcm9tICcuL2ZpbGVzJztcbmV4cG9ydCAqIGZyb20gJy4vZm9ybS1maWVsZHMnO1xuZXhwb3J0ICogZnJvbSAnLi9pY29ucyc7XG5leHBvcnQgKiBmcm9tICcuL2xvYWRlcic7XG5leHBvcnQgKiBmcm9tICcuL2JyYW5kcy1saXN0JztcbmV4cG9ydCAqIGZyb20gJy4vbmV3cyc7XG5leHBvcnQgKiBmcm9tICcuL25vaW5kZXgtd3JhcHBlcic7XG5leHBvcnQgKiBmcm9tICcuL29yZGVyJztcbmV4cG9ydCAqIGZyb20gJy4vcGFnZXMnO1xuZXhwb3J0ICogZnJvbSAnLi9wYWdpbmF0aW9uJztcbmV4cG9ydCAqIGZyb20gJy4vcGlwZXMnO1xuZXhwb3J0ICogZnJvbSAnLi9zYW1wbGVzJztcbmV4cG9ydCAqIGZyb20gJy4vbWV0aG9kcyc7XG5leHBvcnQgKiBmcm9tICcuL3Byb3ZpZGVycyc7XG5leHBvcnQgKiBmcm9tICcuL2ZlZWRiYWNrJztcbmV4cG9ydCAqIGZyb20gJy4vcXJjb2RlJztcbmV4cG9ydCAqIGZyb20gJy4vc2hhcmUtYnV0dG9uJztcbmV4cG9ydCAqIGZyb20gJy4vdXNlcic7XG5leHBvcnQgKiBmcm9tICcuL3ZhbGlkYXRvcnMnO1xuZXhwb3J0ICogZnJvbSAnLi92ZXJpZmljYXRpb24nO1xuZXhwb3J0ICogZnJvbSAnLi9wcm9maWxlJztcbiJdfQ==
|
|
@@ -3,18 +3,18 @@ import { InjectionToken, inject, Injectable, NgZone, signal, EventEmitter, Chang
|
|
|
3
3
|
import * as i1 from '@snabcentr/client-core';
|
|
4
4
|
import { ScContactsService, ScUserService, ScLocationsService, ScAuthService, SEARCH_TERM, ScUnitsHelper, ScImageHelper, SC_PATH_IMAGE_NOT_FOUND, ScImage, ScPhoneService, ScUserMetrikaService, ScUserMetrikaGoalsEnum, IS_RUNNING_ON_TERMINAL, ScVCardService, ScVerificationService, ScISuggestionType, SC_MIN_LENGTH_SEARCH_TERM, ScConvertersService, ScOpfList, ScReferencesService, ScContragentService, ScBannerService, ScMediaImageTransformerPipe, ScCartService, ScUploadedFile, loadingPlaceholder, SC_ORDER_LOADER, ScMimeTypes, ScCatalogService, SC_URLS, IS_SERVER, ScWarehouseService, SEARCH_TERM_PROVIDERS, ScPaginationService, SC_NEXT_PAGE_PAGINATION_CLICK, SC_PRODUCT_PAGINATION_OPTIONS, ScCatalogFilterService, ScIdOrSlugPipe, SC_CATEGORY_INFO, ScConfiguratorService, RESPONSE, ScIconTypesEnum, ScDocumentInfoTypesEnum, ScOrderDraftsService, ScRouteKeys, ScSeoService, scOrderIsLoaded, ScFrequentlyAskedQuestionsService, SchemaOrgFactory, SC_COMPANY_INFO, ScFeedbackService } from '@snabcentr/client-core';
|
|
5
5
|
import * as i5$1 from 'rxjs';
|
|
6
|
-
import { EMPTY, BehaviorSubject, switchMap, of, shareReplay, map, Subject, filter, tap, catchError, finalize, startWith, share, timer, scan, takeWhile, endWith, distinctUntilChanged, debounceTime, throwError, combineLatest, Observable, pairwise, Subscription, merge, skip, from, concatMap, noop
|
|
6
|
+
import { EMPTY, BehaviorSubject, switchMap, of, shareReplay, map, Subject, filter, tap, catchError, finalize, startWith, share, timer, scan, takeWhile, endWith, distinctUntilChanged, debounceTime, throwError, combineLatest, Observable, pairwise, Subscription, merge, skip, from, concatMap, noop } from 'rxjs';
|
|
7
7
|
import { WA_WINDOW } from '@ng-web-apis/common';
|
|
8
8
|
import { takeUntilDestroyed, toSignal, outputFromObservable, toObservable } from '@angular/core/rxjs-interop';
|
|
9
9
|
import * as i4$1 from '@taiga-ui/cdk';
|
|
10
|
-
import { TuiDay, TuiTime, TuiValueTransformer, TUI_IS_MOBILE, tuiControlValue, tuiIsPresent, tuiMarkControlAsTouchedAndValidate, tuiIsFalsy, TuiAutoFocus, TuiRepeatTimes, TuiHovered, TuiDayRange, TuiMonth, tuiPure, tuiProvide, TUI_WINDOW_SIZE, TuiValidationError, TUI_TRUE_HANDLER } from '@taiga-ui/cdk';
|
|
10
|
+
import { TuiDay, TuiTime, TuiValueTransformer, TUI_IS_MOBILE, tuiControlValue, tuiIsPresent, tuiMarkControlAsTouchedAndValidate, tuiIsFalsy, TuiAutoFocus, TuiRepeatTimes, TuiHovered, TuiDayRange, TuiMonth, tuiPure, tuiProvide, tuiClamp, TUI_WINDOW_SIZE, TuiValidationError, TUI_TRUE_HANDLER } from '@taiga-ui/cdk';
|
|
11
11
|
import * as i2$1 from '@taiga-ui/kit';
|
|
12
|
-
import { TUI_DATE_VALUE_TRANSFORMER, TuiPreview, TuiAvatar, TuiAccordionItem, TuiElasticContainer, TuiAccordion, TuiFieldErrorPipe, TuiFilterByInputPipe, TuiStringifyContentPipe, TuiDataListWrapper, TuiButtonLoading, TuiSortCountriesPipe, TuiStepper, TuiCarousel, TuiPush, TuiCheckbox, TuiFiles, TuiChip, TuiInputNumber, TuiBadge, TuiTooltip, TuiHighlight, TuiLineClamp, TuiFade, TuiRange, tuiInputNumberOptionsProvider, TuiDataListWrapperComponent, TuiChevron, TuiSelect, TuiInputSlider, TuiTreeService, TuiTreeItemContent, TUI_TREE_START, TUI_TREE_CONTENT, TUI_TREE_LOADING, TUI_TREE_LOADER, TuiTree, TuiPreviewDialogService, TUI_CONFIRM, tuiItemsHandlersProvider as tuiItemsHandlersProvider$1,
|
|
12
|
+
import { TUI_DATE_VALUE_TRANSFORMER, TuiPreview, TuiAvatar, TuiAccordionItem, TuiElasticContainer, TuiAccordion, TuiFieldErrorPipe, TuiFilterByInputPipe, TuiStringifyContentPipe, TuiDataListWrapper, TuiButtonLoading, TuiSortCountriesPipe, TuiStepper, TuiCarousel, TuiPush, TuiCheckbox, TuiFiles, TuiChip, TuiInputNumber, TuiBadge, TuiTooltip, TuiHighlight, TuiLineClamp, TuiFade, TuiRange, tuiInputNumberOptionsProvider, TuiDataListWrapperComponent, TuiChevron, TuiSelect, TuiInputSlider, TuiTreeService, TuiTreeItemContent, TUI_TREE_START, TUI_TREE_CONTENT, TUI_TREE_LOADING, TUI_TREE_LOADER, TuiTree, TuiPreviewDialogService, TUI_CONFIRM, tuiItemsHandlersProvider as tuiItemsHandlersProvider$1, TUI_PAGINATION_TEXTS, TuiAccordionDirective, TuiAccordionItemContent, tuiFilesAccepted } from '@taiga-ui/kit';
|
|
13
13
|
import { HttpClient, HttpErrorResponse } from '@angular/common/http';
|
|
14
14
|
import * as i1$1 from '@angular/forms';
|
|
15
15
|
import { FormControl, FormGroupDirective, NgControl, FormGroup, Validators, FormArray, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
16
16
|
import * as i1$2 from '@taiga-ui/core';
|
|
17
|
-
import { TuiButton, TuiDialog, TuiDialogService, TuiLink, TuiFallbackSrcPipe, TuiInitialsPipe, TuiIcon, TuiAppearance, TuiWithAppearance, TuiIcons, TuiWithIcons, TUI_DATA_LIST_HOST, tuiDropdownOptionsProvider, TuiLabel, TuiError, TuiLoader, TuiDataList, TuiNotification, TuiTextfield, TuiTitle, TuiNumberFormat, TuiHint, TUI_MONTHS, TuiScrollbar, tuiNumberFormatProvider, tuiItemsHandlersProvider, tuiTextfieldOptionsProvider, tuiHintOptionsProvider, TuiFormatNumberPipe, TuiHintDriver, TuiHintHover, TuiHintPosition, TuiHintDirective, TUI_BUTTON_OPTIONS, TUI_BUTTON_DEFAULT_OPTIONS, TuiSurface, tuiFadeIn } from '@taiga-ui/core';
|
|
17
|
+
import { TuiButton, TuiDialog, TuiDialogService, TuiLink, TuiFallbackSrcPipe, TuiInitialsPipe, TuiIcon, TuiAppearance, TuiWithAppearance, TuiIcons, TuiWithIcons, TUI_DATA_LIST_HOST, tuiDropdownOptionsProvider, TuiLabel, TuiError, TuiLoader, TuiDataList, TuiNotification, TuiTextfield, TuiTitle, TuiNumberFormat, TuiHint, TUI_MONTHS, TuiScrollbar, tuiNumberFormatProvider, tuiItemsHandlersProvider, tuiTextfieldOptionsProvider, tuiHintOptionsProvider, TuiFormatNumberPipe, TuiHintDriver, TuiHintHover, TuiHintPosition, TuiHintDirective, TUI_BUTTON_OPTIONS, TUI_BUTTON_DEFAULT_OPTIONS, TUI_SPIN_ICONS, TuiSurface, tuiFadeIn } from '@taiga-ui/core';
|
|
18
18
|
import { isValidPhoneNumber } from 'libphonenumber-js/max';
|
|
19
19
|
import * as i4 from '@taiga-ui/legacy/components/primitive-textfield';
|
|
20
20
|
import * as i3 from '@taiga-ui/legacy';
|
|
@@ -8888,6 +8888,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
8888
8888
|
}]
|
|
8889
8889
|
}] });
|
|
8890
8890
|
|
|
8891
|
+
/**
|
|
8892
|
+
* Наименование query-параметра идентификатора группы часто задаваемых вопросов.
|
|
8893
|
+
*/
|
|
8894
|
+
const SC_FAQ_GROUP_QUERY_PARAM = 'group';
|
|
8895
|
+
/**
|
|
8896
|
+
* Наименование query-параметра номера страницы пагинации часто задаваемых вопросов.
|
|
8897
|
+
*/
|
|
8898
|
+
const SC_FAQ_PAGE_QUERY_PARAM = 'page';
|
|
8899
|
+
|
|
8891
8900
|
/**
|
|
8892
8901
|
* Компонент часто задаваемых вопросов.
|
|
8893
8902
|
*/
|
|
@@ -8930,48 +8939,178 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
8930
8939
|
], host: { ngSkipHydration: 'true' }, changeDetection: ChangeDetectionStrategy.OnPush, template: "<tui-loader\n [showLoader]=\"showLoading()\"\n [overlay]=\"true\"\n>\n <tui-accordion\n class=\"accordion\"\n [closeOthers]=\"false\"\n >\n @for (item of items(); track item.id) {\n <button\n [tuiAccordion]=\"isServer\"\n class=\"!whitespace-normal !text-body-m-bold\"\n >\n {{ item.question }}\n </button>\n <tui-expand>\n <div [innerHTML]=\"item.answer\"></div>\n </tui-expand>\n }\n </tui-accordion>\n</tui-loader>\n", styles: [".accordion{border-radius:0}.accordion,.accordion[data-size=s],.accordion[data-size=m],.accordion[data-size=l],.accordion .tui-list{font:inherit}.accordion [tuiAccordion]{border-block:1px solid var(--tui-border-normal);border-block-end-color:#fff!important;font-weight:400;border-color:var(--tui-border-normal);mask:none;block-size:auto;padding-block:.5rem;min-block-size:var(--t-size)}.accordion [tuiAccordion]._open{border-block-end-color:var(--tui-border-normal)!important}.accordion tui-expand,.accordion [tuiAccordion]{box-shadow:none;white-space:normal}\n"] }]
|
|
8931
8940
|
}] });
|
|
8932
8941
|
|
|
8942
|
+
/**
|
|
8943
|
+
* Возвращает query-параметры ссылки на группу часто задаваемых вопросов.
|
|
8944
|
+
*
|
|
8945
|
+
* При смене группы пагинация сбрасывается на первую страницу.
|
|
8946
|
+
*
|
|
8947
|
+
* @param group Группа вопросов.
|
|
8948
|
+
*/
|
|
8949
|
+
const scGetFaqGroupQueryParams = (group) => ({
|
|
8950
|
+
[SC_FAQ_GROUP_QUERY_PARAM]: group.id ?? null,
|
|
8951
|
+
[SC_FAQ_PAGE_QUERY_PARAM]: null,
|
|
8952
|
+
});
|
|
8953
|
+
|
|
8933
8954
|
/**
|
|
8934
8955
|
* Компонент выбора группы часто задаваемых вопросов.
|
|
8956
|
+
*
|
|
8957
|
+
* TODO: [TAIGA:5]: Заменить legacy tui-select и tuiItemsHandlersProvider на актуальные аналоги.
|
|
8935
8958
|
*/
|
|
8936
8959
|
class ScFrequentlyAskedQuestionsGroupSelectorComponent {
|
|
8960
|
+
/**
|
|
8961
|
+
* Инициализирует экземпляр класса {@link ScFrequentlyAskedQuestionsGroupSelectorComponent}.
|
|
8962
|
+
*/
|
|
8937
8963
|
constructor() {
|
|
8964
|
+
/**
|
|
8965
|
+
* Сервис маршрутизации.
|
|
8966
|
+
*/
|
|
8967
|
+
this.router = inject(Router);
|
|
8968
|
+
/**
|
|
8969
|
+
* Активный маршрут.
|
|
8970
|
+
*/
|
|
8971
|
+
this.route = inject(ActivatedRoute);
|
|
8938
8972
|
/**
|
|
8939
8973
|
* {@link Observable} списка группы часто задаваемых вопросов.
|
|
8940
8974
|
*/
|
|
8941
|
-
this.groups$ = inject(ScFrequentlyAskedQuestionsService).groups
|
|
8942
|
-
if (groups.length > 0) {
|
|
8943
|
-
this.groupControl.setValue(groups[0]);
|
|
8944
|
-
}
|
|
8945
|
-
}));
|
|
8975
|
+
this.groups$ = inject(ScFrequentlyAskedQuestionsService).groups$;
|
|
8946
8976
|
/**
|
|
8947
8977
|
* {@link FormControl} выбранной группы.
|
|
8948
8978
|
*/
|
|
8949
8979
|
this.groupControl = new FormControl(null);
|
|
8950
8980
|
/**
|
|
8951
|
-
* {@link
|
|
8981
|
+
* {@link InputSignal} идентификатора выбранной группы.
|
|
8952
8982
|
*/
|
|
8953
|
-
this.
|
|
8954
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
8955
|
-
map((group) => group.id)));
|
|
8983
|
+
this.selectedGroupId = input(null);
|
|
8956
8984
|
/**
|
|
8957
8985
|
* Формат отображения. 'list' - в виде списка, 'select' в виде выпадающего списка.
|
|
8958
8986
|
*/
|
|
8959
8987
|
this.viewMode = input('list');
|
|
8988
|
+
/**
|
|
8989
|
+
* Возвращает query-параметры ссылки на группу вопросов.
|
|
8990
|
+
*/
|
|
8991
|
+
this.getGroupQueryParams = scGetFaqGroupQueryParams;
|
|
8992
|
+
// Синхронизирует значение выпадающего списка с выбранной группой.
|
|
8993
|
+
combineLatest([this.groups$, toObservable(this.selectedGroupId)])
|
|
8994
|
+
.pipe(takeUntilDestroyed())
|
|
8995
|
+
.subscribe(([groups, selectedGroupId]) => {
|
|
8996
|
+
this.groupControl.setValue(groups.find((group) => (group.id ?? null) === selectedGroupId) ?? null, { emitEvent: false });
|
|
8997
|
+
});
|
|
8998
|
+
// Выбор группы в выпадающем списке переводит на адрес этой группы.
|
|
8999
|
+
this.groupControl.valueChanges.pipe(filter(tuiIsPresent), takeUntilDestroyed()).subscribe((group) => {
|
|
9000
|
+
this.router
|
|
9001
|
+
.navigate([], {
|
|
9002
|
+
relativeTo: this.route,
|
|
9003
|
+
queryParams: this.getGroupQueryParams(group),
|
|
9004
|
+
queryParamsHandling: 'merge',
|
|
9005
|
+
})
|
|
9006
|
+
.catch(noop);
|
|
9007
|
+
});
|
|
8960
9008
|
}
|
|
8961
9009
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScFrequentlyAskedQuestionsGroupSelectorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
8962
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: ScFrequentlyAskedQuestionsGroupSelectorComponent, isStandalone: true, selector: "sc-frequently-asked-questions-group-selector", inputs: {
|
|
9010
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: ScFrequentlyAskedQuestionsGroupSelectorComponent, isStandalone: true, selector: "sc-frequently-asked-questions-group-selector", inputs: { selectedGroupId: { classPropertyName: "selectedGroupId", publicName: "selectedGroupId", isSignal: true, isRequired: false, transformFunction: null }, viewMode: { classPropertyName: "viewMode", publicName: "viewMode", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
8963
9011
|
tuiItemsHandlersProvider$1({
|
|
8964
9012
|
stringify: (item) => item.name,
|
|
8965
9013
|
}),
|
|
8966
|
-
], ngImport: i0, template: "@let groups = groups$ | async;\n\n@if (groups && groups.length) {\n @switch (viewMode()) {\n @case ('list') {\n <div class=\"flex flex-col items-center gap-3 rounded-xl p-4 shadow-sc\">\n <div class=\"flex w-full flex-col gap-2\">\n @for (item of groups; track $index) {\n <
|
|
9014
|
+
], ngImport: i0, template: "@let groups = groups$ | async;\n\n@if (groups && groups.length) {\n @switch (viewMode()) {\n @case ('list') {\n <div class=\"flex flex-col items-center gap-3 rounded-xl p-4 shadow-sc\">\n <div class=\"flex w-full flex-col gap-2\">\n @for (item of groups; track $index) {\n @let isSelected = item.id === selectedGroupId();\n\n <a\n tuiButton\n size=\"xs\"\n [tuiAppearanceState]=\"isSelected ? 'hover' : null\"\n [attr.aria-current]=\"isSelected ? 'page' : null\"\n [class.pointer-events-none]=\"isSelected\"\n [routerLink]=\"[]\"\n [queryParams]=\"getGroupQueryParams(item)\"\n queryParamsHandling=\"merge\"\n appearance=\"flat-grayscale\"\n class=\"!justify-start !text-body-s-bold\"\n >\n {{ item.name }}\n </a>\n }\n </div>\n </div>\n }\n\n @case ('select') {\n <form>\n <tui-select\n [formControl]=\"groupControl\"\n [tuiTextfieldLabelOutside]=\"true\"\n >\n <tui-data-list-wrapper\n *tuiDataList\n [items]=\"groups\"\n />\n </tui-select>\n </form>\n }\n }\n}\n", dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "ngmodule", type: TuiSelectModule }, { kind: "component", type: i3.TuiSelectComponent, selector: "tui-select", inputs: ["stringify", "identityMatcher", "valueContent"] }, { kind: "directive", type: i3.TuiSelectDirective, selector: "tui-select" }, { kind: "directive", type: i3$1.TuiDataListDirective, selector: "ng-template[tuiDataList]" }, { kind: "component", type: i3$3.TuiDataListWrapperComponent, selector: "tui-data-list-wrapper:not([labels]), tui-data-list-wrapper:not([labels])[new]", inputs: ["items", "disabledItemHandler", "emptyContent", "size", "itemContent"], outputs: ["itemClick"] }, { kind: "ngmodule", type: TuiTextfieldControllerModule }, { kind: "directive", type: i3.TuiTextfieldLabelOutsideDirective, selector: "[tuiTextfieldLabelOutside]", inputs: ["tuiTextfieldLabelOutside"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
8967
9015
|
}
|
|
8968
9016
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScFrequentlyAskedQuestionsGroupSelectorComponent, decorators: [{
|
|
8969
9017
|
type: Component,
|
|
8970
|
-
args: [{ standalone: true, selector: 'sc-frequently-asked-questions-group-selector', imports: [AsyncPipe, TuiSelectModule, TuiTextfieldControllerModule, ReactiveFormsModule, TuiDataList, TuiDataListWrapper, NgIf, TuiButton, FormsModule], providers: [
|
|
9018
|
+
args: [{ standalone: true, selector: 'sc-frequently-asked-questions-group-selector', imports: [AsyncPipe, TuiSelectModule, TuiTextfieldControllerModule, ReactiveFormsModule, TuiDataList, TuiDataListWrapper, NgIf, TuiButton, FormsModule, RouterLink], providers: [
|
|
8971
9019
|
tuiItemsHandlersProvider$1({
|
|
8972
9020
|
stringify: (item) => item.name,
|
|
8973
9021
|
}),
|
|
8974
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let groups = groups$ | async;\n\n@if (groups && groups.length) {\n @switch (viewMode()) {\n @case ('list') {\n <div class=\"flex flex-col items-center gap-3 rounded-xl p-4 shadow-sc\">\n <div class=\"flex w-full flex-col gap-2\">\n @for (item of groups; track $index) {\n <
|
|
9022
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let groups = groups$ | async;\n\n@if (groups && groups.length) {\n @switch (viewMode()) {\n @case ('list') {\n <div class=\"flex flex-col items-center gap-3 rounded-xl p-4 shadow-sc\">\n <div class=\"flex w-full flex-col gap-2\">\n @for (item of groups; track $index) {\n @let isSelected = item.id === selectedGroupId();\n\n <a\n tuiButton\n size=\"xs\"\n [tuiAppearanceState]=\"isSelected ? 'hover' : null\"\n [attr.aria-current]=\"isSelected ? 'page' : null\"\n [class.pointer-events-none]=\"isSelected\"\n [routerLink]=\"[]\"\n [queryParams]=\"getGroupQueryParams(item)\"\n queryParamsHandling=\"merge\"\n appearance=\"flat-grayscale\"\n class=\"!justify-start !text-body-s-bold\"\n >\n {{ item.name }}\n </a>\n }\n </div>\n </div>\n }\n\n @case ('select') {\n <form>\n <tui-select\n [formControl]=\"groupControl\"\n [tuiTextfieldLabelOutside]=\"true\"\n >\n <tui-data-list-wrapper\n *tuiDataList\n [items]=\"groups\"\n />\n </tui-select>\n </form>\n }\n }\n}\n" }]
|
|
9023
|
+
}], ctorParameters: () => [] });
|
|
9024
|
+
|
|
9025
|
+
/**
|
|
9026
|
+
* Компонент пагинации, в котором страницы являются ссылками с номером страницы в query-параметрах.
|
|
9027
|
+
*
|
|
9028
|
+
* Ссылки позволяют переходить между страницами при отключенном JavaScript и корректно работают при SSR.
|
|
9029
|
+
* Внешний вид повторяет tui-pagination из @taiga-ui/kit.
|
|
9030
|
+
*
|
|
9031
|
+
* TODO: [TAIGA:5]: Проверить, появилась ли в tui-pagination поддержка ссылок, и заменить компонент на неё.
|
|
9032
|
+
*/
|
|
9033
|
+
class ScPaginationLinksComponent {
|
|
9034
|
+
constructor() {
|
|
9035
|
+
/**
|
|
9036
|
+
* Иконки стрелок переключения страниц.
|
|
9037
|
+
*/
|
|
9038
|
+
this.icons = inject(TUI_SPIN_ICONS);
|
|
9039
|
+
/**
|
|
9040
|
+
* {@link Observable} подписей стрелок переключения страниц.
|
|
9041
|
+
*/
|
|
9042
|
+
this.texts$ = inject(TUI_PAGINATION_TEXTS);
|
|
9043
|
+
/**
|
|
9044
|
+
* {@link InputSignal} общего количества страниц.
|
|
9045
|
+
*/
|
|
9046
|
+
this.length = input.required();
|
|
9047
|
+
/**
|
|
9048
|
+
* {@link InputSignal} номера текущей страницы, начиная с единицы.
|
|
9049
|
+
*/
|
|
9050
|
+
this.index = input.required();
|
|
9051
|
+
/**
|
|
9052
|
+
* {@link InputSignal} наименования query-параметра, в котором хранится номер страницы.
|
|
9053
|
+
*/
|
|
9054
|
+
this.queryParam = input('page');
|
|
9055
|
+
/**
|
|
9056
|
+
* {@link InputSignal} количества страниц, отображаемых по обе стороны от текущей.
|
|
9057
|
+
*/
|
|
9058
|
+
this.activePadding = input(1);
|
|
9059
|
+
/**
|
|
9060
|
+
* {@link InputSignal} количества страниц, отображаемых по краям.
|
|
9061
|
+
*/
|
|
9062
|
+
this.sidePadding = input(1);
|
|
9063
|
+
/**
|
|
9064
|
+
* {@link Signal} номеров отображаемых страниц, где `null` - разделитель пропущенных страниц.
|
|
9065
|
+
*
|
|
9066
|
+
* Состав страниц рассчитывается так же, как в tui-pagination: количество отображаемых элементов постоянно,
|
|
9067
|
+
* а окно вокруг текущей страницы расширяется у краёв списка.
|
|
9068
|
+
*/
|
|
9069
|
+
this.pages = computed(() => {
|
|
9070
|
+
const length = this.length();
|
|
9071
|
+
const sidePadding = this.sidePadding();
|
|
9072
|
+
// Половина элементов: страницы у края, разделитель и страницы вокруг текущей.
|
|
9073
|
+
const maxHalfLength = sidePadding + 1 + this.activePadding();
|
|
9074
|
+
const maxElementsLength = maxHalfLength * 2 + 1;
|
|
9075
|
+
const elementsLength = Math.min(length, maxElementsLength);
|
|
9076
|
+
const lastIndex = length - 1;
|
|
9077
|
+
const index = this.index() - 1;
|
|
9078
|
+
const reverseIndex = lastIndex - index;
|
|
9079
|
+
const hasCollapsedItems = (value) => length > maxElementsLength && value > maxHalfLength;
|
|
9080
|
+
return Array.from({ length: elementsLength }, (_, elementIndex) => {
|
|
9081
|
+
const reverseElementIndex = elementsLength - 1 - elementIndex;
|
|
9082
|
+
if (elementIndex < sidePadding) {
|
|
9083
|
+
return elementIndex + 1;
|
|
9084
|
+
}
|
|
9085
|
+
if (elementIndex === sidePadding && hasCollapsedItems(index)) {
|
|
9086
|
+
return null;
|
|
9087
|
+
}
|
|
9088
|
+
if (reverseElementIndex < sidePadding) {
|
|
9089
|
+
return lastIndex - reverseElementIndex + 1;
|
|
9090
|
+
}
|
|
9091
|
+
if (reverseElementIndex === sidePadding && hasCollapsedItems(reverseIndex)) {
|
|
9092
|
+
return null;
|
|
9093
|
+
}
|
|
9094
|
+
return tuiClamp(index - maxHalfLength + elementIndex, elementIndex, lastIndex - reverseElementIndex) + 1;
|
|
9095
|
+
});
|
|
9096
|
+
});
|
|
9097
|
+
}
|
|
9098
|
+
/**
|
|
9099
|
+
* Возвращает query-параметры ссылки на страницу.
|
|
9100
|
+
*
|
|
9101
|
+
* Для первой страницы параметр удаляется, чтобы её адрес совпадал с адресом страницы без пагинации.
|
|
9102
|
+
*
|
|
9103
|
+
* @param page Номер страницы.
|
|
9104
|
+
*/
|
|
9105
|
+
getPageQueryParams(page) {
|
|
9106
|
+
return { [this.queryParam()]: page > 1 ? page : null };
|
|
9107
|
+
}
|
|
9108
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScPaginationLinksComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
9109
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: ScPaginationLinksComponent, isStandalone: true, selector: "sc-pagination-links", inputs: { length: { classPropertyName: "length", publicName: "length", isSignal: true, isRequired: true, transformFunction: null }, index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: true, transformFunction: null }, queryParam: { classPropertyName: "queryParam", publicName: "queryParam", isSignal: true, isRequired: false, transformFunction: null }, activePadding: { classPropertyName: "activePadding", publicName: "activePadding", isSignal: true, isRequired: false, transformFunction: null }, sidePadding: { classPropertyName: "sidePadding", publicName: "sidePadding", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@let texts = texts$ | async;\n\n@if (texts) {\n <div class=\"t-content\">\n @if (index() > 1) {\n <a\n tuiIconButton\n size=\"s\"\n appearance=\"flat\"\n tabIndex=\"-1\"\n class=\"t-button\"\n [iconStart]=\"icons.decrement\"\n [routerLink]=\"[]\"\n [queryParams]=\"getPageQueryParams(index() - 1)\"\n queryParamsHandling=\"merge\"\n >\n {{ texts[0] }}\n </a>\n } @else {\n <button\n tuiIconButton\n size=\"s\"\n appearance=\"flat\"\n type=\"button\"\n tabIndex=\"-1\"\n class=\"t-button\"\n [iconStart]=\"icons.decrement\"\n [disabled]=\"true\"\n >\n {{ texts[0] }}\n </button>\n }\n\n @for (page of pages(); track $index) {\n @if (page) {\n <a\n automation-id=\"sc-pagination-links__element\"\n tuiButton\n size=\"s\"\n class=\"t-button\"\n [appearance]=\"page === index() ? 'primary' : 'flat'\"\n [attr.aria-current]=\"page === index() ? 'page' : null\"\n [routerLink]=\"[]\"\n [queryParams]=\"getPageQueryParams(page)\"\n queryParamsHandling=\"merge\"\n >\n {{ page }}\n </a>\n } @else {\n <div class=\"t-dots\"></div>\n }\n }\n\n @if (index() < length()) {\n <a\n tuiIconButton\n size=\"s\"\n appearance=\"flat\"\n tabIndex=\"-1\"\n class=\"t-button\"\n [iconStart]=\"icons.increment\"\n [routerLink]=\"[]\"\n [queryParams]=\"getPageQueryParams(index() + 1)\"\n queryParamsHandling=\"merge\"\n >\n {{ texts[1] }}\n </a>\n } @else {\n <button\n tuiIconButton\n size=\"s\"\n appearance=\"flat\"\n type=\"button\"\n tabIndex=\"-1\"\n class=\"t-button\"\n [iconStart]=\"icons.increment\"\n [disabled]=\"true\"\n >\n {{ texts[1] }}\n </button>\n }\n </div>\n}\n", styles: ["@charset \"UTF-8\";:host{display:block;font:var(--tui-font-text-s);color:var(--tui-text-primary);text-align:center}.t-content{display:flex;justify-content:center}.t-button{flex-shrink:0;margin:0 .125rem}.t-button[tuiButton]{min-inline-size:var(--tui-height-s);padding:0 .5rem}.t-button:first-child{margin-inline-start:0}.t-button:last-child{margin-inline-end:0}.t-dots{flex-shrink:0;inline-size:var(--tui-height-s);block-size:var(--tui-height-s);line-height:var(--tui-height-s);margin:0 .125rem;color:var(--tui-text-action);text-align:center;cursor:default}.t-dots:before{content:\"\\2026\"}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { 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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
9110
|
+
}
|
|
9111
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScPaginationLinksComponent, decorators: [{
|
|
9112
|
+
type: Component,
|
|
9113
|
+
args: [{ standalone: true, selector: 'sc-pagination-links', imports: [AsyncPipe, RouterLink, TuiButton], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let texts = texts$ | async;\n\n@if (texts) {\n <div class=\"t-content\">\n @if (index() > 1) {\n <a\n tuiIconButton\n size=\"s\"\n appearance=\"flat\"\n tabIndex=\"-1\"\n class=\"t-button\"\n [iconStart]=\"icons.decrement\"\n [routerLink]=\"[]\"\n [queryParams]=\"getPageQueryParams(index() - 1)\"\n queryParamsHandling=\"merge\"\n >\n {{ texts[0] }}\n </a>\n } @else {\n <button\n tuiIconButton\n size=\"s\"\n appearance=\"flat\"\n type=\"button\"\n tabIndex=\"-1\"\n class=\"t-button\"\n [iconStart]=\"icons.decrement\"\n [disabled]=\"true\"\n >\n {{ texts[0] }}\n </button>\n }\n\n @for (page of pages(); track $index) {\n @if (page) {\n <a\n automation-id=\"sc-pagination-links__element\"\n tuiButton\n size=\"s\"\n class=\"t-button\"\n [appearance]=\"page === index() ? 'primary' : 'flat'\"\n [attr.aria-current]=\"page === index() ? 'page' : null\"\n [routerLink]=\"[]\"\n [queryParams]=\"getPageQueryParams(page)\"\n queryParamsHandling=\"merge\"\n >\n {{ page }}\n </a>\n } @else {\n <div class=\"t-dots\"></div>\n }\n }\n\n @if (index() < length()) {\n <a\n tuiIconButton\n size=\"s\"\n appearance=\"flat\"\n tabIndex=\"-1\"\n class=\"t-button\"\n [iconStart]=\"icons.increment\"\n [routerLink]=\"[]\"\n [queryParams]=\"getPageQueryParams(index() + 1)\"\n queryParamsHandling=\"merge\"\n >\n {{ texts[1] }}\n </a>\n } @else {\n <button\n tuiIconButton\n size=\"s\"\n appearance=\"flat\"\n type=\"button\"\n tabIndex=\"-1\"\n class=\"t-button\"\n [iconStart]=\"icons.increment\"\n [disabled]=\"true\"\n >\n {{ texts[1] }}\n </button>\n }\n </div>\n}\n", styles: ["@charset \"UTF-8\";:host{display:block;font:var(--tui-font-text-s);color:var(--tui-text-primary);text-align:center}.t-content{display:flex;justify-content:center}.t-button{flex-shrink:0;margin:0 .125rem}.t-button[tuiButton]{min-inline-size:var(--tui-height-s);padding:0 .5rem}.t-button:first-child{margin-inline-start:0}.t-button:last-child{margin-inline-end:0}.t-dots{flex-shrink:0;inline-size:var(--tui-height-s);block-size:var(--tui-height-s);line-height:var(--tui-height-s);margin:0 .125rem;color:var(--tui-text-action);text-align:center;cursor:default}.t-dots:before{content:\"\\2026\"}\n"] }]
|
|
8975
9114
|
}] });
|
|
8976
9115
|
|
|
8977
9116
|
/**
|
|
@@ -9006,6 +9145,14 @@ class ScFrequentlyAskedQuestionsWithGroupsComponent {
|
|
|
9006
9145
|
* Сервис маршрутизации.
|
|
9007
9146
|
*/
|
|
9008
9147
|
this.router = inject(Router);
|
|
9148
|
+
/**
|
|
9149
|
+
* Активный маршрут.
|
|
9150
|
+
*/
|
|
9151
|
+
this.route = inject(ActivatedRoute);
|
|
9152
|
+
/**
|
|
9153
|
+
* Признак, что приложение запущено на сервере.
|
|
9154
|
+
*/
|
|
9155
|
+
this.isServer = inject(IS_SERVER);
|
|
9009
9156
|
/**
|
|
9010
9157
|
* Индекс первой страницы.
|
|
9011
9158
|
*/
|
|
@@ -9019,13 +9166,15 @@ class ScFrequentlyAskedQuestionsWithGroupsComponent {
|
|
|
9019
9166
|
*/
|
|
9020
9167
|
this.perPage$ = new BehaviorSubject(this.pageSizeOptions[0]);
|
|
9021
9168
|
/**
|
|
9022
|
-
* {@link
|
|
9169
|
+
* {@link Observable} изменения номера страницы пагинации из query-параметров.
|
|
9023
9170
|
*/
|
|
9024
|
-
this.page$ =
|
|
9171
|
+
this.page$ = this.route.queryParamMap.pipe(map((params) => Number(params.get(SC_FAQ_PAGE_QUERY_PARAM)) || this.firstPageIndex), distinctUntilChanged());
|
|
9025
9172
|
/**
|
|
9026
|
-
* {@link
|
|
9173
|
+
* {@link Observable} изменения идентификатора выбранной группы.
|
|
9174
|
+
*
|
|
9175
|
+
* Идентификатор берётся из query-параметров, а если параметр не задан - используется первая группа списка.
|
|
9027
9176
|
*/
|
|
9028
|
-
this.groupId$ =
|
|
9177
|
+
this.groupId$ = combineLatest([this.route.queryParamMap, this.frequentlyAskedQuestionsService.groups$]).pipe(map(([params, groups]) => Number(params.get(SC_FAQ_GROUP_QUERY_PARAM)) || (groups[0]?.id ?? null)), distinctUntilChanged(), shareReplay({ refCount: true, bufferSize: 1 }));
|
|
9029
9178
|
/**
|
|
9030
9179
|
* Сигнал нажатия на кнопку "Задать вопрос".
|
|
9031
9180
|
*/
|
|
@@ -9036,7 +9185,7 @@ class ScFrequentlyAskedQuestionsWithGroupsComponent {
|
|
|
9036
9185
|
this.request$ = combineLatest({
|
|
9037
9186
|
page: this.page$,
|
|
9038
9187
|
perPage: this.perPage$,
|
|
9039
|
-
group: this.groupId
|
|
9188
|
+
group: this.groupId$.pipe(filter(tuiIsPresent)),
|
|
9040
9189
|
paginate: of(true),
|
|
9041
9190
|
}).pipe(
|
|
9042
9191
|
// Нулевой debounceTime для случая, когда меняются направление и поле сортировки одновременно.
|
|
@@ -9055,7 +9204,7 @@ class ScFrequentlyAskedQuestionsWithGroupsComponent {
|
|
|
9055
9204
|
/**
|
|
9056
9205
|
* {@link Observable} изменения номера страницы пагинации из данных пагинации запроса.
|
|
9057
9206
|
*/
|
|
9058
|
-
this.currentPage$ = this.request$.pipe(filter(tuiIsPresent), map(({ meta }) => meta.currentPage
|
|
9207
|
+
this.currentPage$ = this.request$.pipe(filter(tuiIsPresent), map(({ meta }) => meta.currentPage));
|
|
9059
9208
|
/**
|
|
9060
9209
|
* {@link Observable} изменения состояния загрузки данных.
|
|
9061
9210
|
*/
|
|
@@ -9067,31 +9216,20 @@ class ScFrequentlyAskedQuestionsWithGroupsComponent {
|
|
|
9067
9216
|
/**
|
|
9068
9217
|
* {@link Observable} изменения формата отображения фильтра групп.
|
|
9069
9218
|
*/
|
|
9070
|
-
this.viewMode$ =
|
|
9071
|
-
|
|
9072
|
-
|
|
9073
|
-
|
|
9074
|
-
|
|
9075
|
-
|
|
9076
|
-
|
|
9077
|
-
paginationChange(pageIndex) {
|
|
9078
|
-
this.page$.next(pageIndex + 1);
|
|
9079
|
-
}
|
|
9080
|
-
/**
|
|
9081
|
-
* Устанавливает идентификатор группы.
|
|
9082
|
-
*
|
|
9083
|
-
* @param id Идентификатор группы.
|
|
9084
|
-
*/
|
|
9085
|
-
groupIdChange(id) {
|
|
9086
|
-
this.groupId$.next(id);
|
|
9087
|
-
this.paginationChange(0);
|
|
9219
|
+
this.viewMode$ = this.isServer
|
|
9220
|
+
? of('list')
|
|
9221
|
+
: inject(TUI_WINDOW_SIZE).pipe(map((rect) => (rect.width > 768 ? 'list' : 'select')));
|
|
9222
|
+
/**
|
|
9223
|
+
* Наименование query-параметра номера страницы пагинации.
|
|
9224
|
+
*/
|
|
9225
|
+
this.pageQueryParam = SC_FAQ_PAGE_QUERY_PARAM;
|
|
9088
9226
|
}
|
|
9089
9227
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScFrequentlyAskedQuestionsWithGroupsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
9090
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: ScFrequentlyAskedQuestionsWithGroupsComponent, isStandalone: true, selector: "sc-frequently-asked-questions-with-groups", outputs: { clickSendQuestion: "clickSendQuestion" }, ngImport: i0, template: "@let items = data$ | async;\n@let pageCount = pageCount$ | async;\n@let viewMode = viewMode$ | async;\n\n<div\n *ngIf=\"viewMode\"\n class=\"flex gap-6\"\n [class.flex-col]=\"viewMode === 'select'\"\n>\n <div class=\"flex flex-col gap-7\">\n <sc-frequently-asked-questions-group-selector\n
|
|
9228
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: ScFrequentlyAskedQuestionsWithGroupsComponent, isStandalone: true, selector: "sc-frequently-asked-questions-with-groups", outputs: { clickSendQuestion: "clickSendQuestion" }, host: { attributes: { "ngSkipHydration": "true" } }, ngImport: i0, template: "@let items = data$ | async;\n@let pageCount = pageCount$ | async;\n@let viewMode = viewMode$ | async;\n\n<div\n *ngIf=\"viewMode\"\n class=\"flex gap-6\"\n [class.flex-col]=\"viewMode === 'select'\"\n>\n <div class=\"flex flex-col gap-7\">\n <sc-frequently-asked-questions-group-selector\n [selectedGroupId]=\"groupId$ | async\"\n [viewMode]=\"viewMode\"\n class=\"shrink-0\"\n [class.w-64]=\"viewMode !== 'select'\"\n />\n\n <button\n *ngIf=\"viewMode === 'list'\"\n tuiButton\n size=\"m\"\n type=\"button\"\n iconStart=\"@tui.circle-help\"\n appearance=\"secondary\"\n (click)=\"clickSendQuestion.emit()\"\n class=\"self-center\"\n >\n \u0417\u0430\u0434\u0430\u0442\u044C \u0432\u043E\u043F\u0440\u043E\u0441\n </button>\n </div>\n\n <div class=\"grow\">\n @if (items && items.length) {\n <sc-frequently-asked-questions\n [items]=\"items\"\n [showLoading]=\"isLoading()\"\n />\n\n <sc-pagination-links\n *ngIf=\"pageCount && pageCount > 1\"\n [length]=\"pageCount\"\n [index]=\"(currentPage$ | async) ?? 1\"\n [queryParam]=\"pageQueryParam\"\n class=\"mt-4\"\n />\n } @else {\n <p class=\"text-body-s-bold\">\u0421\u043F\u0438\u0441\u043E\u043A \u0432\u043E\u043F\u0440\u043E\u0441\u043E\u0432 \u043F\u0443\u0441\u0442</p>\n }\n </div>\n</div>\n", dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ScFrequentlyAskedQuestionsGroupSelectorComponent, selector: "sc-frequently-asked-questions-group-selector", inputs: ["selectedGroupId", "viewMode"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: ScFrequentlyAskedQuestionsComponent, selector: "sc-frequently-asked-questions", inputs: ["items", "showLoading"] }, { kind: "component", type: ScPaginationLinksComponent, selector: "sc-pagination-links", inputs: ["length", "index", "queryParam", "activePadding", "sidePadding"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
9091
9229
|
}
|
|
9092
9230
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScFrequentlyAskedQuestionsWithGroupsComponent, decorators: [{
|
|
9093
9231
|
type: Component,
|
|
9094
|
-
args: [{ standalone: true, selector: 'sc-frequently-asked-questions-with-groups', imports: [AsyncPipe, NgIf, ScFrequentlyAskedQuestionsGroupSelectorComponent, TuiButton, ScFrequentlyAskedQuestionsComponent,
|
|
9232
|
+
args: [{ standalone: true, selector: 'sc-frequently-asked-questions-with-groups', imports: [AsyncPipe, NgIf, ScFrequentlyAskedQuestionsGroupSelectorComponent, TuiButton, ScFrequentlyAskedQuestionsComponent, ScPaginationLinksComponent], host: { ngSkipHydration: 'true' }, changeDetection: ChangeDetectionStrategy.OnPush, template: "@let items = data$ | async;\n@let pageCount = pageCount$ | async;\n@let viewMode = viewMode$ | async;\n\n<div\n *ngIf=\"viewMode\"\n class=\"flex gap-6\"\n [class.flex-col]=\"viewMode === 'select'\"\n>\n <div class=\"flex flex-col gap-7\">\n <sc-frequently-asked-questions-group-selector\n [selectedGroupId]=\"groupId$ | async\"\n [viewMode]=\"viewMode\"\n class=\"shrink-0\"\n [class.w-64]=\"viewMode !== 'select'\"\n />\n\n <button\n *ngIf=\"viewMode === 'list'\"\n tuiButton\n size=\"m\"\n type=\"button\"\n iconStart=\"@tui.circle-help\"\n appearance=\"secondary\"\n (click)=\"clickSendQuestion.emit()\"\n class=\"self-center\"\n >\n \u0417\u0430\u0434\u0430\u0442\u044C \u0432\u043E\u043F\u0440\u043E\u0441\n </button>\n </div>\n\n <div class=\"grow\">\n @if (items && items.length) {\n <sc-frequently-asked-questions\n [items]=\"items\"\n [showLoading]=\"isLoading()\"\n />\n\n <sc-pagination-links\n *ngIf=\"pageCount && pageCount > 1\"\n [length]=\"pageCount\"\n [index]=\"(currentPage$ | async) ?? 1\"\n [queryParam]=\"pageQueryParam\"\n class=\"mt-4\"\n />\n } @else {\n <p class=\"text-body-s-bold\">\u0421\u043F\u0438\u0441\u043E\u043A \u0432\u043E\u043F\u0440\u043E\u0441\u043E\u0432 \u043F\u0443\u0441\u0442</p>\n }\n </div>\n</div>\n" }]
|
|
9095
9233
|
}] });
|
|
9096
9234
|
|
|
9097
9235
|
/**
|
|
@@ -10253,5 +10391,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
10253
10391
|
* Generated bundle index. Do not edit.
|
|
10254
10392
|
*/
|
|
10255
10393
|
|
|
10256
|
-
export { AbstractScPriceCard, AuthMethod, CURRENT_COUNTRY_ID, CostWithDiscountComponent, FilesAndDocumentsComponent, FilesAndDocumentsModule, 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_HELP_NOTIFICATION_CLOSE, SC_HELP_NOTIFICATION_LIMIT, SC_HIDDEN_PRINT_ELEMENTS, SC_MANAGER_QR_HANDLER, SC_NOTIFY_WHEN_IN_STOCK_REQUIRED_FIELDS, 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, ScAccordionModule, ScAddContactDialogComponent, ScAddContragentBankAccountsDialogComponent, ScAddContragentDialogComponent, ScAddDeliveryAddressDialogComponent, ScAddOrEditingCartItemDialogComponent, ScAddOrEditingCartItemFormComponent, ScAddressesSelectionFieldComponent, ScAuthModule, ScBannerComponent, ScBannerModule, ScBrandsListComponent, ScBrandsListModule, ScCartAddProductsFromCsvDialogComponent, ScCatalogFilterCollapsibleComponent, ScCatalogFiltersComponent, ScCatalogModule, ScCategoryCardComponent, ScContactsAccordionComponent, ScContactsModule, ScContragentsAccordionComponent, ScContragentsAccordionItemComponent, ScContragentsModule, ScDeliveryAddressAccordionComponent, ScDeliveryAddressAccordionItemComponent, ScDeliveryAddressModule, ScDownloadPriceListComponent, ScDraftComponent, ScEmailLinkDirective, ScErrorBlockStatusComponent, ScErrorHandlerComponent, ScFavoriteButtonComponent, ScFeedbackFormComponent, ScFocusFirstInvalidFieldDirective, ScFormFieldsModule, ScFormatDatePipe, ScFrequentlyAskedQuestionsComponent, ScFrequentlyAskedQuestionsGroupSelectorComponent, ScFrequentlyAskedQuestionsWithGroupsComponent, ScGratitudeComponent, ScHelpNotificationService, ScHoverImageCarouselComponent, ScInputQuantityComponent, ScLinks, ScManagerCardComponent, ScManagerCardPushComponent, ScNewContactFormComponent, ScNewContragentBankAccountsFormComponent, ScNewContragentFormComponent, ScNewsCardComponent, ScNewsCardSkeletonComponent, ScNewsModule, ScNextInputFocusDirective, ScNextInputFocusModule, ScNoindexDirective, ScNoindexWrapperComponent, ScNotifyWhenInStockDialogComponent, ScOrderAccessorDirective, ScOrderItemComponent, ScOrderItemsByDirection, ScOrderItemsListByDirectionsComponent, ScOrderItemsListByStockComponent, ScOrderItemsListComponent, ScOrderModule, ScPaymentStatusComponent, ScPersonalDataProcessingPolicyComponent, ScPhoneFormatPipe, ScPreviewSampleComponent, ScPreviewSampleModule, ScPreviewSamplesMosquitoComponent, ScPriceCardComponent, ScPriceCardInlineComponent, ScPriceHistoryComponent, ScPriceListPaginationComponent, ScPriceWarehouseStockComponent, ScPrintDirective, ScPrintService, ScPrivacyPolicyComponent, ScProductInAllWarehousesPipe, ScProfileAccordionsContentComponent, ScProfileModule, ScPublicOfferComponent, ScQRCodeDialogComponent, ScQRCodeModule, ScResetUserPasswordComponent, ScResourcePreviewComponent, ScSandwichComponent, ScSandwichM2Component, ScSandwichM2SkeletonComponent, ScSandwichSkeletonComponent, ScSelectOnFocusinDirective, ScSeoTagsComponent, ScShareButtonComponent, ScShareButtonModule, ScSignInFormByEmailComponent, ScSignInFormByPhoneComponent, ScSignInFormComponent, ScSignUpFormComponent, ScSimpleSignUpFormComponent, ScSuggestionFieldComponent, ScTelLinkDirective, ScTerminalLinkDirective, ScUpdateUserInfoDialogComponent, ScUserManagersComponent, ScUserModule, ScUserPhoneApproveDialogComponent, ScVerificationModule, ScVerificationPhoneCheckFormComponent, TreeDirective, TreeIconService, TreeLoaderService, TreeTopDirective, cleanupRecaptchaArtifacts, phoneValidator, scAtLeastOneRequiredValidator, scBicValidator, scClientUiIconsName, scCorrespondentAccountValidator, scGetCurrentRoute, scPasswordConfirmMatchingValidator, stepValidator, tuiDateValueTransformerDefaultProvider };
|
|
10394
|
+
export { AbstractScPriceCard, AuthMethod, CURRENT_COUNTRY_ID, CostWithDiscountComponent, FilesAndDocumentsComponent, FilesAndDocumentsModule, 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_PAGE_QUERY_PARAM, 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_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, ScAccordionModule, ScAddContactDialogComponent, ScAddContragentBankAccountsDialogComponent, ScAddContragentDialogComponent, ScAddDeliveryAddressDialogComponent, ScAddOrEditingCartItemDialogComponent, ScAddOrEditingCartItemFormComponent, ScAddressesSelectionFieldComponent, ScAuthModule, ScBannerComponent, ScBannerModule, ScBrandsListComponent, ScBrandsListModule, ScCartAddProductsFromCsvDialogComponent, ScCatalogFilterCollapsibleComponent, ScCatalogFiltersComponent, ScCatalogModule, ScCategoryCardComponent, ScContactsAccordionComponent, ScContactsModule, ScContragentsAccordionComponent, ScContragentsAccordionItemComponent, ScContragentsModule, ScDeliveryAddressAccordionComponent, ScDeliveryAddressAccordionItemComponent, ScDeliveryAddressModule, ScDownloadPriceListComponent, ScDraftComponent, ScEmailLinkDirective, ScErrorBlockStatusComponent, ScErrorHandlerComponent, ScFavoriteButtonComponent, ScFeedbackFormComponent, ScFocusFirstInvalidFieldDirective, ScFormFieldsModule, ScFormatDatePipe, ScFrequentlyAskedQuestionsComponent, ScFrequentlyAskedQuestionsGroupSelectorComponent, ScFrequentlyAskedQuestionsWithGroupsComponent, ScGratitudeComponent, ScHelpNotificationService, ScHoverImageCarouselComponent, ScInputQuantityComponent, ScLinks, ScManagerCardComponent, ScManagerCardPushComponent, ScNewContactFormComponent, ScNewContragentBankAccountsFormComponent, ScNewContragentFormComponent, ScNewsCardComponent, ScNewsCardSkeletonComponent, ScNewsModule, ScNextInputFocusDirective, ScNextInputFocusModule, ScNoindexDirective, ScNoindexWrapperComponent, ScNotifyWhenInStockDialogComponent, ScOrderAccessorDirective, ScOrderItemComponent, ScOrderItemsByDirection, ScOrderItemsListByDirectionsComponent, ScOrderItemsListByStockComponent, ScOrderItemsListComponent, ScOrderModule, ScPaginationLinksComponent, ScPaymentStatusComponent, ScPersonalDataProcessingPolicyComponent, ScPhoneFormatPipe, ScPreviewSampleComponent, ScPreviewSampleModule, ScPreviewSamplesMosquitoComponent, ScPriceCardComponent, ScPriceCardInlineComponent, ScPriceHistoryComponent, ScPriceListPaginationComponent, ScPriceWarehouseStockComponent, ScPrintDirective, ScPrintService, ScPrivacyPolicyComponent, ScProductInAllWarehousesPipe, ScProfileAccordionsContentComponent, ScProfileModule, ScPublicOfferComponent, ScQRCodeDialogComponent, ScQRCodeModule, ScResetUserPasswordComponent, ScResourcePreviewComponent, ScSandwichComponent, ScSandwichM2Component, ScSandwichM2SkeletonComponent, ScSandwichSkeletonComponent, ScSelectOnFocusinDirective, ScSeoTagsComponent, ScShareButtonComponent, ScShareButtonModule, ScSignInFormByEmailComponent, ScSignInFormByPhoneComponent, ScSignInFormComponent, ScSignUpFormComponent, ScSimpleSignUpFormComponent, ScSuggestionFieldComponent, ScTelLinkDirective, ScTerminalLinkDirective, ScUpdateUserInfoDialogComponent, ScUserManagersComponent, ScUserModule, ScUserPhoneApproveDialogComponent, ScVerificationModule, ScVerificationPhoneCheckFormComponent, TreeDirective, TreeIconService, TreeLoaderService, TreeTopDirective, cleanupRecaptchaArtifacts, phoneValidator, scAtLeastOneRequiredValidator, scBicValidator, scClientUiIconsName, scCorrespondentAccountValidator, scGetCurrentRoute, scGetFaqGroupQueryParams, scPasswordConfirmMatchingValidator, stepValidator, tuiDateValueTransformerDefaultProvider };
|
|
10257
10395
|
//# sourceMappingURL=snabcentr-client-ui.mjs.map
|