wt-front-shared 1.0.41 → 1.0.43

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.
Files changed (25) hide show
  1. package/esm2020/lib/core/+state/static-data/static-data.selectors.mjs +5 -2
  2. package/esm2020/lib/core/components/auto-form/components/form-field-select/form-field-select.component.mjs +1 -6
  3. package/esm2020/lib/core/components/index.mjs +3 -1
  4. package/esm2020/lib/core/components/site-helper/configs/config.mjs +8 -0
  5. package/esm2020/lib/core/components/site-helper/configs/firm-tour.config.mjs +66 -0
  6. package/esm2020/lib/core/components/site-helper/configs/main-tour.config.mjs +30 -0
  7. package/esm2020/lib/core/components/site-helper/configs/publication-error-tour.config.mjs +61 -0
  8. package/esm2020/lib/core/components/site-helper/configs/unpublish-tour.config.mjs +22 -0
  9. package/esm2020/lib/core/components/site-helper/interfaces/config.interfaces.mjs +2 -0
  10. package/esm2020/lib/core/components/site-helper/site-helper.component.mjs +273 -0
  11. package/esm2020/lib/core/components/site-helper/site-helper.module.mjs +18 -0
  12. package/fesm2015/wt-front-shared.mjs +474 -8
  13. package/fesm2015/wt-front-shared.mjs.map +1 -1
  14. package/fesm2020/wt-front-shared.mjs +465 -8
  15. package/fesm2020/wt-front-shared.mjs.map +1 -1
  16. package/lib/core/components/index.d.ts +2 -0
  17. package/lib/core/components/site-helper/configs/config.d.ts +5 -0
  18. package/lib/core/components/site-helper/configs/firm-tour.config.d.ts +3 -0
  19. package/lib/core/components/site-helper/configs/main-tour.config.d.ts +2 -0
  20. package/lib/core/components/site-helper/configs/publication-error-tour.config.d.ts +2 -0
  21. package/lib/core/components/site-helper/configs/unpublish-tour.config.d.ts +2 -0
  22. package/lib/core/components/site-helper/interfaces/config.interfaces.d.ts +21 -0
  23. package/lib/core/components/site-helper/site-helper.component.d.ts +45 -0
  24. package/lib/core/components/site-helper/site-helper.module.d.ts +8 -0
  25. package/package.json +1 -1
@@ -4,7 +4,7 @@ import * as i1$3 from '@angular/common';
4
4
  import { isPlatformBrowser, isPlatformServer, APP_BASE_HREF, CommonModule } from '@angular/common';
5
5
  import { BehaviorSubject, of, throwError, ReplaySubject, Subject, EMPTY, Subscription, merge, fromEvent } from 'rxjs';
6
6
  import * as i3 from '@angular/router';
7
- import { RouterModule } from '@angular/router';
7
+ import { RouterModule, NavigationEnd } from '@angular/router';
8
8
  import * as i1$2 from '@ngrx/effects';
9
9
  import { createEffect, ofType } from '@ngrx/effects';
10
10
  import { map, catchError, tap, filter as filter$1, switchMap, flatMap, first, take, mergeMap, takeUntil, distinctUntilChanged, startWith } from 'rxjs/operators';
@@ -57,6 +57,9 @@ import { FileUploader, FileUploadModule } from 'ng2-file-upload';
57
57
  import * as i5$2 from '@angular/material/progress-bar';
58
58
  import { MatProgressBarModule } from '@angular/material/progress-bar';
59
59
  import { ENTER, COMMA } from '@angular/cdk/keycodes';
60
+ import { __awaiter } from 'tslib';
61
+ import { driver } from 'driver.js';
62
+ import * as i4$1 from 'ngx-cookie-service';
60
63
  import { MatLegacyChipsModule } from '@angular/material/legacy-chips';
61
64
  import * as i1$6 from '@angular/cdk/platform';
62
65
  import * as i2$4 from '@angular/material/menu';
@@ -6460,7 +6463,10 @@ const getStaticDataForListContentTypes = (contentTypes) => createSelector(getSta
6460
6463
  });
6461
6464
  const getStaticDataItem = (contentType, subSection, itemIdOrSlug) => createSelector(getStaticDataState, (state) => {
6462
6465
  var _a, _b;
6463
- return ((_b = (_a = state.list[contentType]) === null || _a === void 0 ? void 0 : _a[subSection]) === null || _b === void 0 ? void 0 : _b.find(item => item.id === itemIdOrSlug || (item === null || item === void 0 ? void 0 : item.slug) === itemIdOrSlug || (item === null || item === void 0 ? void 0 : item.slug) + '.html' === itemIdOrSlug)) || {};
6466
+ const foundItem = (_b = (_a = state.list[contentType]) === null || _a === void 0 ? void 0 : _a[subSection]) === null || _b === void 0 ? void 0 : _b.find(item => {
6467
+ return Number(item.id) === Number(itemIdOrSlug) || (item === null || item === void 0 ? void 0 : item.slug) === itemIdOrSlug || (item === null || item === void 0 ? void 0 : item.slug) + '.html' === itemIdOrSlug;
6468
+ }); //
6469
+ return foundItem || {};
6464
6470
  });
6465
6471
  const staticDataQuery = {
6466
6472
  getStatus,
@@ -6965,7 +6971,6 @@ class FormFieldSelectComponent {
6965
6971
  this.unSubscribeSubject$ = new Subject();
6966
6972
  }
6967
6973
  ngOnInit() {
6968
- console.log('ngOnInit');
6969
6974
  if (this.fieldData.options.subscribeToFormChanges) {
6970
6975
  this.subscribeToFormChanges();
6971
6976
  this.placeholder = this.fieldData.options.subscribeToFormChanges.emptyTitle;
@@ -6984,13 +6989,11 @@ class FormFieldSelectComponent {
6984
6989
  this.unSubscribeSubject$.complete();
6985
6990
  }
6986
6991
  ngOnChanges(changes) {
6987
- console.log('changes', changes);
6988
6992
  if (changes.fieldData && changes.fieldData.currentValue) {
6989
6993
  const { loadOptionFromStore, selectOptions } = changes.fieldData.currentValue.options;
6990
6994
  if (selectOptions && selectOptions.length) {
6991
6995
  this.options = selectOptions;
6992
6996
  }
6993
- console.log('loadOptionFromStore', loadOptionFromStore);
6994
6997
  if (loadOptionFromStore) {
6995
6998
  this.loadOptionsFromStore(loadOptionFromStore);
6996
6999
  }
@@ -7036,9 +7039,7 @@ class FormFieldSelectComponent {
7036
7039
  const listKeys = loadOptionFromStore.split('.');
7037
7040
  this.store.select(state => {
7038
7041
  let selectedStore = state;
7039
- console.log('state', state);
7040
7042
  listKeys.forEach(key => {
7041
- console.log('key', key);
7042
7043
  selectedStore = selectedStore[key];
7043
7044
  });
7044
7045
  return selectedStore;
@@ -9639,6 +9640,471 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
9639
9640
  }]
9640
9641
  }] });
9641
9642
 
9643
+ const mainTourConfigs = {
9644
+ '0': {
9645
+ option: {
9646
+ callNextAfter: 1000,
9647
+ }
9648
+ },
9649
+ '1': {
9650
+ text: 'Давайте знакомиться!!<br/>Я Ваш помошник по сайту',
9651
+ image: 'assets/site-helper/base.png',
9652
+ option: {
9653
+ callNextAfter: 5000
9654
+ }
9655
+ },
9656
+ '2': {
9657
+ text: 'Давайте начнем с тура по сайту',
9658
+ image: 'assets/site-helper/site-tour.png',
9659
+ tourSteps: [
9660
+ { element: '#menu-item-my-firms', popover: { title: 'Мои фирмы', description: 'Описание моих фирм' } },
9661
+ { element: '#menu-item-support', popover: { title: 'Служба поддержки', description: 'Описание Служба поддержки' } },
9662
+ ]
9663
+ },
9664
+ '3': {
9665
+ image: 'assets/site-helper/all-ok.png',
9666
+ option: {
9667
+ callNextAfter: 1000,
9668
+ }
9669
+ },
9670
+ '4': {}
9671
+ };
9672
+
9673
+ const firmTourConfigs = {
9674
+ '0': {
9675
+ option: {
9676
+ callNextAfter: 1000,
9677
+ }
9678
+ },
9679
+ '1': {
9680
+ text: 'Вы зашли в раздел Мои фирмы',
9681
+ image: 'assets/site-helper/base.png',
9682
+ option: {
9683
+ callNextAfter: 5000
9684
+ }
9685
+ },
9686
+ '2': {
9687
+ text: 'Давайте я Вам все покажу',
9688
+ image: 'assets/site-helper/site-tour.png',
9689
+ tourSteps: [
9690
+ { element: '#go-to-create-form-button', popover: { title: 'Для создания фирмы нужно нажать тут' } },
9691
+ ]
9692
+ },
9693
+ '3': {
9694
+ image: 'assets/site-helper/all-ok.png',
9695
+ option: {
9696
+ callNextAfter: 1000,
9697
+ }
9698
+ },
9699
+ '4': {}
9700
+ };
9701
+ const firmFormTourConfigs = {
9702
+ '0': {
9703
+ option: {
9704
+ callNextAfter: 1000,
9705
+ }
9706
+ },
9707
+ '1': {
9708
+ text: 'Вы зашли в раздел создания и редактирования фирмы',
9709
+ image: 'assets/site-helper/base.png',
9710
+ option: {
9711
+ callNextAfter: 3000
9712
+ }
9713
+ },
9714
+ '2': {
9715
+ text: 'Давайте я Вам все покажу',
9716
+ image: 'assets/site-helper/site-tour.png',
9717
+ tourSteps: [
9718
+ { element: '.mat-mdc-tab-labels .mdc-tab:nth-child(1)', popover: { title: 'Форма', description: 'Тут необходимо заполнить все данны фирмы' } },
9719
+ { element: '.mat-mdc-tab-labels .mdc-tab:nth-child(2)', popover: { title: 'Туры фирмы', description: 'После сохранения фирмы тут Вы можете добавить туры для Вашей фирмы' } },
9720
+ { element: '.center-block-inner form .form-group:nth-child(1)', popover: { title: 'Общая информаци о компании' } },
9721
+ { element: '.center-block-inner form .form-group:nth-child(2)', popover: { title: 'Контактная информаци компании', description: 'Кликните на название группы чтобы открыть ее' } },
9722
+ { element: '.center-block-inner form .form-group:nth-child(3)', popover: { title: 'Текстовое описание о компании' } },
9723
+ { element: '.center-block-inner form .form-group:nth-child(4)', popover: { title: 'Галлерея', description: 'Тут вы модете разместить фото офиса, сотрудников и т.д.' } },
9724
+ { element: '#back-to-list-button', popover: { title: 'Кнопка перехода назад к списку' } },
9725
+ { element: '#form-create-button', popover: { title: 'Кнопка сохрания/обнавления', description: 'После заполнения всех полей нужно нажать на нее для сохранения данных фирмы.' } },
9726
+ { element: '#publish-button', popover: { title: 'Кнопка публикации', description: 'После заполнения всех полей нужно нажать на нее чтобы фирма стала видна для пользователям.' } },
9727
+ { element: '#delete-button', popover: { title: 'Кнопка удаления', description: 'Мы можете использовать ее чтобы удалить Вашу фирму с сайта' } },
9728
+ ]
9729
+ },
9730
+ '3': {
9731
+ image: 'assets/site-helper/all-ok.png',
9732
+ option: {
9733
+ callNextAfter: 1000,
9734
+ }
9735
+ },
9736
+ '4': {}
9737
+ };
9738
+
9739
+ const allTours = {
9740
+ '/': mainTourConfigs,
9741
+ '/static-data/firms': firmTourConfigs,
9742
+ '/static-data/firms/new': firmFormTourConfigs,
9743
+ };
9744
+
9745
+ const publicationErrorTourConfigs = {
9746
+ '0': {
9747
+ option: {
9748
+ callNextAfter: 1000,
9749
+ }
9750
+ },
9751
+ '1': {
9752
+ text: 'У вас имеются замечания, которые требуется исправить перед публикацией вашей записи.',
9753
+ image: 'assets/site-helper/base.png',
9754
+ option: {
9755
+ callNextAfter: 3000
9756
+ }
9757
+ },
9758
+ '2': {
9759
+ text: 'Давайте посмотрим на них',
9760
+ image: 'assets/site-helper/site-tour.png',
9761
+ tourSteps: [
9762
+ {
9763
+ element: '.publish-messages.error-messages', popover: { title: 'Блок ошибок публикации', description: 'В данном разделе вы можете ознакомиться с теми изменениями, которые необходимо внести для публикации вашей записи.' }
9764
+ },
9765
+ {
9766
+ actionBeforeStep: () => {
9767
+ return new Promise((resolve, reject) => {
9768
+ const buttonElement = document.querySelector('.publish-messages button');
9769
+ if (buttonElement) {
9770
+ buttonElement.click();
9771
+ }
9772
+ resolve(null);
9773
+ });
9774
+ },
9775
+ element: '.publish-messages-list div:nth-child(1) shared-panel', popover: { title: 'Первое замечание' }
9776
+ },
9777
+ {
9778
+ element: '.publish-messages-list div:nth-child(1) a', popover: { title: 'По клику на эту ссылку вы сможете найти поле в форме' }
9779
+ },
9780
+ {
9781
+ actionBeforeStep: () => {
9782
+ return new Promise((resolve, reject) => {
9783
+ const buttonElement = document.querySelector('.publish-messages div:nth-child(1) .fuse-card button');
9784
+ if (buttonElement) {
9785
+ buttonElement.click();
9786
+ }
9787
+ resolve(null);
9788
+ });
9789
+ },
9790
+ element: '.publish-messages-list div:nth-child(1) .fuse-card .card-expand-area', popover: { title: 'Тут можно просмотреть описание ошибки' }
9791
+ },
9792
+ {
9793
+ element: '#publish-button', popover: { title: 'После испправления всех замечаний нажмите на кнопку опубликовать' }
9794
+ },
9795
+ ]
9796
+ },
9797
+ '3': {
9798
+ image: 'assets/site-helper/all-ok.png',
9799
+ option: {
9800
+ callNextAfter: 1000,
9801
+ }
9802
+ },
9803
+ '4': {}
9804
+ };
9805
+
9806
+ const unPublishTourConfigs = {
9807
+ '0': {
9808
+ option: {
9809
+ callNextAfter: 1000,
9810
+ }
9811
+ },
9812
+ '1': {
9813
+ text: 'Для того чтобы пользователи могли увидеть запись, необходимо её опубликовать.',
9814
+ image: 'assets/site-helper/base.png',
9815
+ option: {
9816
+ callNextByClickButton: 'Я понял'
9817
+ }
9818
+ },
9819
+ '2': {
9820
+ image: 'assets/site-helper/all-ok.png',
9821
+ option: {
9822
+ callNextAfter: 1000,
9823
+ }
9824
+ },
9825
+ '3': {}
9826
+ };
9827
+
9828
+ class SiteHelperComponent {
9829
+ constructor(cd, renderer, formsFacade, publicationMessagesFacade, staticDataFacade, cookieService, router) {
9830
+ this.cd = cd;
9831
+ this.renderer = renderer;
9832
+ this.formsFacade = formsFacade;
9833
+ this.publicationMessagesFacade = publicationMessagesFacade;
9834
+ this.staticDataFacade = staticDataFacade;
9835
+ this.cookieService = cookieService;
9836
+ this.router = router;
9837
+ this.activeConfigStep = -1;
9838
+ this.staticDataUrlKey = 'static-data';
9839
+ this.cookiesKeyPrefix = 'wt-site-tour';
9840
+ this.siteHelperRunning = false;
9841
+ this.siteHelperKeys = {
9842
+ errorPublication: 'error-publication'
9843
+ };
9844
+ }
9845
+ ngOnInit() {
9846
+ return __awaiter(this, void 0, void 0, function* () {
9847
+ this.pageUrl = this.router.url || '/';
9848
+ this.subscribeToRouteChanges();
9849
+ const isStartedTour = yield this.checkStaticItemData(this.router.url);
9850
+ if (!isStartedTour) {
9851
+ this.siteHelperRunning = true;
9852
+ this.runSiteHelper();
9853
+ }
9854
+ this.subscribeToFormsStatus();
9855
+ });
9856
+ }
9857
+ subscribeToFormsStatus() {
9858
+ this.formsFacade.getAllForms()
9859
+ .pipe(untilComponentDestroyed(this))
9860
+ .subscribe((allForms) => {
9861
+ const inValidForms = allForms.filter(item => item.hasError);
9862
+ });
9863
+ }
9864
+ subscribeToRouteChanges() {
9865
+ this.router.events
9866
+ .pipe(filter$1(event => event instanceof NavigationEnd), untilComponentDestroyed(this))
9867
+ .subscribe((event) => __awaiter(this, void 0, void 0, function* () {
9868
+ this.stopSiteTour();
9869
+ if (event.url !== '/auth') {
9870
+ this.currentSiteHelperKey = '';
9871
+ this.pageUrl = event.url;
9872
+ const isStartedTour = yield this.checkStaticItemData(event.url);
9873
+ if (!isStartedTour) {
9874
+ this.siteHelperRunning = true;
9875
+ this.runSiteHelper();
9876
+ }
9877
+ }
9878
+ else {
9879
+ this.hideSiteTour();
9880
+ this.siteHelperRunning = false;
9881
+ }
9882
+ }));
9883
+ }
9884
+ checkStaticItemData(url) {
9885
+ return __awaiter(this, void 0, void 0, function* () {
9886
+ const urlParams = url.split('/');
9887
+ if ((urlParams === null || urlParams === void 0 ? void 0 : urlParams.length) > 2 && urlParams[1] === this.staticDataUrlKey && urlParams[2] && Number(urlParams[3])) {
9888
+ const contentType = urlParams[2];
9889
+ const itemId = Number(urlParams[3]);
9890
+ const staticItemData = yield this.getStaticDataItemData(contentType, itemId);
9891
+ if (staticItemData === null || staticItemData === void 0 ? void 0 : staticItemData.id) {
9892
+ const publicationMessages = yield this.getStaticDataFormErrors(contentType, itemId);
9893
+ const errorPublicationMessages = publicationMessages.filter(item => item.isError);
9894
+ if (errorPublicationMessages === null || errorPublicationMessages === void 0 ? void 0 : errorPublicationMessages.length) {
9895
+ const cookieKey = this.getCookieKey(this.siteHelperKeys.errorPublication);
9896
+ if (!this.cookieService.get(cookieKey)) {
9897
+ this.currentSiteHelperKey = this.siteHelperKeys.errorPublication;
9898
+ this.siteHelperRunning = true;
9899
+ this.runSiteHelper(publicationErrorTourConfigs);
9900
+ return true;
9901
+ }
9902
+ }
9903
+ // if user open an item, which has not published yet
9904
+ if (!staticItemData.publishedAt) {
9905
+ this.siteHelperRunning = true;
9906
+ this.runSiteHelper(unPublishTourConfigs);
9907
+ return true;
9908
+ }
9909
+ // if user just have saved, need to say that he needs to publish
9910
+ }
9911
+ }
9912
+ return false;
9913
+ });
9914
+ }
9915
+ saveCompletedStatusInCookies() {
9916
+ if (this.currentSiteHelperKey) {
9917
+ const cookieKey = this.getCookieKey(this.currentSiteHelperKey);
9918
+ const cookiesExpiresDate = new Date();
9919
+ cookiesExpiresDate.setDate(cookiesExpiresDate.getDate() + 10e5);
9920
+ this.cookieService.set(cookieKey, 'true', cookiesExpiresDate);
9921
+ }
9922
+ }
9923
+ getCookieKey(key) {
9924
+ return key ? `${this.cookiesKeyPrefix}-${key}` : null;
9925
+ }
9926
+ getStaticDataFormErrors(contentType, itemId) {
9927
+ return new Promise((resolve, reject) => {
9928
+ this.publicationMessagesFacade.getPublicationMessage(contentType, itemId)
9929
+ .pipe(filter$1(item => !!(item === null || item === void 0 ? void 0 : item.length)), untilComponentDestroyed(this))
9930
+ .subscribe((publicationMessage) => {
9931
+ resolve(publicationMessage);
9932
+ });
9933
+ });
9934
+ }
9935
+ getStaticDataItemData(contentType, itemId) {
9936
+ return new Promise((resolve, reject) => {
9937
+ this.staticDataFacade.getStaticDataItem$(contentType, 'list', itemId)
9938
+ .pipe(filter$1(item => !!item.id), untilComponentDestroyed(this))
9939
+ .subscribe((data) => {
9940
+ resolve(data);
9941
+ });
9942
+ });
9943
+ }
9944
+ stopSiteTour() {
9945
+ if (this.activeConfigStep !== -1) {
9946
+ this.activeConfigStep = -1;
9947
+ this.hideSiteTour();
9948
+ }
9949
+ }
9950
+ hideSiteTour() {
9951
+ var _a;
9952
+ const createdElement = (_a = document.getElementsByClassName('site-helper')) === null || _a === void 0 ? void 0 : _a[0];
9953
+ if (createdElement) {
9954
+ createdElement.remove();
9955
+ }
9956
+ }
9957
+ runSiteHelper(configuration) {
9958
+ this.stopSiteTour();
9959
+ if (this.siteHelperRunning) {
9960
+ this.activeConfigStep = -1;
9961
+ if (configuration) {
9962
+ this.currentSiteHelperConfiguration = configuration;
9963
+ }
9964
+ else if (allTours[this.pageUrl]) {
9965
+ const helperKey = `url-${this.pageUrl}`;
9966
+ const cookieKey = this.getCookieKey(helperKey);
9967
+ if (!this.cookieService.get(cookieKey)) {
9968
+ this.currentSiteHelperKey = `url-${this.pageUrl}`;
9969
+ this.currentSiteHelperConfiguration = allTours[this.pageUrl];
9970
+ }
9971
+ }
9972
+ if (this.currentSiteHelperConfiguration) {
9973
+ this.runSiteHelperNextStep();
9974
+ }
9975
+ }
9976
+ }
9977
+ runSiteHelperNextStep() {
9978
+ var _a, _b, _c;
9979
+ return __awaiter(this, void 0, void 0, function* () {
9980
+ if (!this.siteHelperRunning) {
9981
+ return;
9982
+ }
9983
+ this.activeConfigStep++;
9984
+ const configItem = (_a = this.currentSiteHelperConfiguration) === null || _a === void 0 ? void 0 : _a[this.activeConfigStep];
9985
+ if (configItem) {
9986
+ let textDiv;
9987
+ let imageDiv;
9988
+ this.hideSiteTour();
9989
+ if (configItem.tourSteps) {
9990
+ yield this.initSiteTour(configItem.tourSteps);
9991
+ }
9992
+ if (configItem.text) {
9993
+ textDiv = this.renderer.createElement('div');
9994
+ textDiv.classList.add('site-helper-text');
9995
+ textDiv.innerHTML = configItem.text;
9996
+ if ((_b = configItem.option) === null || _b === void 0 ? void 0 : _b.callNextByClickButton) {
9997
+ const buttonDiv = this.renderer.createElement('div');
9998
+ buttonDiv.classList.add('site-helper-text-button');
9999
+ const button = this.renderer.createElement('button');
10000
+ button.textContent = configItem.option.callNextByClickButton;
10001
+ button.onclick = () => {
10002
+ this.runSiteHelperNextStep();
10003
+ };
10004
+ this.renderer.appendChild(buttonDiv, button);
10005
+ this.renderer.appendChild(textDiv, buttonDiv);
10006
+ }
10007
+ }
10008
+ if (configItem.image) {
10009
+ imageDiv = this.renderer.createElement('div');
10010
+ imageDiv.classList.add('site-helper-image');
10011
+ const image = this.renderer.createElement('img');
10012
+ image.src = configItem.image;
10013
+ this.renderer.appendChild(imageDiv, image);
10014
+ }
10015
+ if (textDiv || imageDiv) {
10016
+ const commonDiv = this.renderer.createElement('div');
10017
+ commonDiv.classList.add('site-helper');
10018
+ if (textDiv) {
10019
+ this.renderer.appendChild(commonDiv, textDiv);
10020
+ }
10021
+ if (imageDiv) {
10022
+ this.renderer.appendChild(commonDiv, imageDiv);
10023
+ }
10024
+ this.renderer.appendChild(document.body, commonDiv);
10025
+ }
10026
+ if ((_c = configItem === null || configItem === void 0 ? void 0 : configItem.option) === null || _c === void 0 ? void 0 : _c.callNextAfter) {
10027
+ setTimeout(() => {
10028
+ this.runSiteHelperNextStep();
10029
+ }, configItem.option.callNextAfter);
10030
+ }
10031
+ this.cd.markForCheck();
10032
+ }
10033
+ // Complete the site tour
10034
+ if (this.activeConfigStep === (Object.keys(this.currentSiteHelperConfiguration).length + 1)) {
10035
+ this.siteHelperRunning = false;
10036
+ }
10037
+ });
10038
+ }
10039
+ initSiteTour(steps) {
10040
+ return new Promise((resolve, reject) => {
10041
+ const driverObj = driver({
10042
+ showProgress: true,
10043
+ steps: [
10044
+ ...steps
10045
+ ],
10046
+ progressText: '{{current}} из {{total}}',
10047
+ nextBtnText: 'Следующий',
10048
+ prevBtnText: 'Предыдыщий',
10049
+ doneBtnText: 'Готово',
10050
+ onNextClick: (element, step, options) => __awaiter(this, void 0, void 0, function* () {
10051
+ if (driverObj.isLastStep()) {
10052
+ this.saveCompletedStatusInCookies();
10053
+ this.runSiteHelperNextStep();
10054
+ driverObj.destroy();
10055
+ resolve(null);
10056
+ }
10057
+ else {
10058
+ // if next step has actionBeforeStep, need to run it firstly
10059
+ const nextStep = steps[options.state.activeIndex + 1];
10060
+ if (nextStep === null || nextStep === void 0 ? void 0 : nextStep.actionBeforeStep) {
10061
+ yield nextStep.actionBeforeStep();
10062
+ }
10063
+ setTimeout(() => {
10064
+ driverObj.moveNext();
10065
+ }, 0);
10066
+ }
10067
+ }),
10068
+ onCloseClick: () => {
10069
+ driverObj.destroy();
10070
+ this.runSiteHelperNextStep();
10071
+ this.saveCompletedStatusInCookies();
10072
+ },
10073
+ popoverClass: 'site-helper-popover',
10074
+ onHighlighted: () => {
10075
+ resolve(null);
10076
+ }
10077
+ });
10078
+ driverObj.drive();
10079
+ });
10080
+ }
10081
+ ngOnDestroy() {
10082
+ }
10083
+ }
10084
+ SiteHelperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SiteHelperComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.Renderer2 }, { token: FormsFacade }, { token: PublicationMessagesFacade }, { token: StaticDataFacade }, { token: i4$1.CookieService }, { token: i3.Router }], target: i0.ɵɵFactoryTarget.Component });
10085
+ SiteHelperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: SiteHelperComponent, selector: "shared-site-helper", viewQueries: [{ propertyName: "textDiv", first: true, predicate: ["siteHelperText"], descendants: true }], ngImport: i0, template: "", styles: [".site-helper{position:fixed;right:20px;bottom:0;z-index:100000;display:flex;flex-direction:column}.site-helper .site-helper-text-button button{background:#4caf50;border:0;color:#fff;height:30px;margin-top:10px}\n"], animations: [appearOpacity2], changeDetection: i0.ChangeDetectionStrategy.OnPush });
10086
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SiteHelperComponent, decorators: [{
10087
+ type: Component,
10088
+ args: [{ selector: 'shared-site-helper', changeDetection: ChangeDetectionStrategy.OnPush, animations: [appearOpacity2], template: "", styles: [".site-helper{position:fixed;right:20px;bottom:0;z-index:100000;display:flex;flex-direction:column}.site-helper .site-helper-text-button button{background:#4caf50;border:0;color:#fff;height:30px;margin-top:10px}\n"] }]
10089
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }, { type: FormsFacade }, { type: PublicationMessagesFacade }, { type: StaticDataFacade }, { type: i4$1.CookieService }, { type: i3.Router }]; }, propDecorators: { textDiv: [{
10090
+ type: ViewChild,
10091
+ args: ['siteHelperText']
10092
+ }] } });
10093
+
10094
+ class SiteHelperModule {
10095
+ }
10096
+ SiteHelperModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SiteHelperModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
10097
+ SiteHelperModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: SiteHelperModule, declarations: [SiteHelperComponent], imports: [CommonModule], exports: [SiteHelperComponent] });
10098
+ SiteHelperModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SiteHelperModule, imports: [CommonModule] });
10099
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SiteHelperModule, decorators: [{
10100
+ type: NgModule,
10101
+ args: [{
10102
+ declarations: [SiteHelperComponent],
10103
+ imports: [CommonModule],
10104
+ exports: [SiteHelperComponent]
10105
+ }]
10106
+ }] });
10107
+
9642
10108
  class ChipsInputComponent {
9643
10109
  constructor() {
9644
10110
  this.items = [];
@@ -10966,5 +11432,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
10966
11432
  * Generated bundle index. Do not edit.
10967
11433
  */
10968
11434
 
10969
- export { AccessDeniedComponent, AccessDeniedModule, ActionsEndpointTypes, ActionsFacade, ActionsMetaStatus, ActionsModel, ActionsSendRequest, ActionsService, AsyncValidators, AsyncValidatorsMessages, AsyncValidatorsType, AuthEndpointTypes, AuthenticationService, AutoFormMainComponent, AutoFormModule, AutoFormService, AutoFormShowComponent, Back, BaseAPI, BaseAPIService, BaseAutoFormService, BaseErrors, BaseModelAdapter, BaseResponseFactory, BreadCrumbsComponent, BreadCrumbsModule, ButtonComponent, ButtonModule, CORE_CONFIG, CacheDataEndpointTypes, CacheDataFacade, CacheDataModel, CacheDataService, ChipsInputComponent, ChipsInputModule, ClearStaticData, CommonDialogComponent, CookiesService, CoreFacade, CoreLoadError, CoreLoaded, CountFormatPipe, CreateRequestListener, DateFormatPipe, DeleteComponent, DeleteRequest, DeleteRequestWaiter, DialogService, DialogsModule, EntitiesReportsRequest, Entity, EntityQueryFieldNames, EntitySortType, EntityType, FieldType, FileFieldNames, FileModel, FileUpdateModel, FilesDeleteRequest, FilesDeleteResponseFactory, FilesEndpointTypes, FilesFacade, FilesLoadRequest, FilesLoadResponseFactory, FilesService, FilesSortRequest, FilesSortResponseFactory, FilesUpdateRequest, FilesUpdateResponseFactory, FilesUploadComponent, FilesUploadModule, FormDeleteFileBaseEndpointTypes, FormDeleteFileFacade, FormDeleteFileRequest, FormDeleteFileService, FormErrorModel, FormErrorsFacade, FormFieldErrorComponent, FormFieldErrorModule, FormFieldPublishErrorComponent, FormFieldPublishErrorModule, FormValidationCheckRequest, FormValidationEndpointTypes, FormValidationFacade, FormValidationService, FormsFacade, Forward, GetCacheDataRequest, GetRequest, GlobalErrorMessages, GlobalEvent, Go, GoFail, HeaderComponent, HeaderModule, HeadersInterceptor, IFormFieldFormat, IconComponent, ImageComponent, ImageModule, InputTagsComponent, InputTagsModule, JwtInterceptor, LoadCore, LoadUsers, LoadUsersFail, LoadUsersSuccess, LoginSend, LoginSendCreateRequest, LoginSendCreateResponseFactory, LoginSendFail, LoginSendSuccess, MainConst, MainFacade, MapperRegistry, MapperUtil, MetaModel, NOTIFICATION_LONG_TIMEOUT, NOTIFICATION_TIMEOUT, NotificationAdd, NotificationAddFail, NotificationModel, NotificationShowingType, NotificationsEffects, NotificationsFacade, PaginationComponent, PaginationModule, PagingModel, PanelComponent, PanelHeaderComponent, PanelHeaderModule, PanelModule, PasswordRules, PhonePipe, PipesModule, PostRequest, PublicationMessageFieldNames, PublicationMessagesFacade, PublishDataModel, PublishEndpointTypes, PublishErrors, PublishPostRequest, PublishResultModel, PublishService, PutRequest, QueryFieldsAdapter, ReducerService, RefreshToken, RefreshTokenFail, RefreshTokenSuccess, ReportsEndpointTypes, ReportsFacade, ReportsModel, ReportsService, Request, RequestMethods, RequestStatus, RequestsEffects, RequestsFacade, ResponseStatus, RouterEffects, RouterFacade, RouterService, STICKY_SIDEBAR_OPTIONS, SafePipe, SequelizeUniqueConstraintError, SetLoaded, SetRouterQueryParams, SharedFormErrors, SharedIconModule, SharedReducer, SharedSpinnerModule, SmartProgressBarComponent, SmartProgressBarModule, SocialAuthService, SpinnerComponent, StarRatingComponent, StarRatingModule, StaticDataCreate, StaticDataCreateFail, StaticDataCreateRequest, StaticDataCreateSuccess, StaticDataDelete, StaticDataDeleteFail, StaticDataDeleteRequest, StaticDataDeleteSuccess, StaticDataEffects, StaticDataEndpointTypes, StaticDataFacade, StaticDataGet, StaticDataGetFail, StaticDataGetList, StaticDataGetListCategories, StaticDataGetListCategoriesFail, StaticDataGetListCategoriesRequest, StaticDataGetListCategoriesSuccess, StaticDataGetListFail, StaticDataGetListRequest, StaticDataGetListSuccess, StaticDataGetRequest, StaticDataGetSubRouting, StaticDataGetSubRoutingFail, StaticDataGetSubRoutingSuccess, StaticDataGetSuccess, StaticDataMetaStatus, StaticDataModel, StaticDataPartUpdate, StaticDataService, StaticDataSubRoutingGetRequest, StaticDataUpdate, StaticDataUpdateFail, StaticDataUpdateRequest, StaticDataUpdateSuccess, StickySidebarDirective, StickySidebarInnerDirective, StickySidebarModule, StorageProvider, StorageService, TableMenuComponent, TableMenuModule, TagCloudComponent, TagCloudModule, TagEntitiesRequest, TagEntityModel, TagModel, TagsEndpointTypes, TagsFacade, TagsLoadRequest, TagsLoadResponseFactory, TagsService, TextWithLinkMoreComponent, TextWithLinkMoreModule, USERS_FEATURE_KEY, UiUnitIds, UiUnitsEffects, UiUnitsFacade, UnPublishPostRequest, UpdateRequestData, UserFieldNames, UserModel, UserRole, UserSectionRightModel, UsersEffects, UsersFacade, UsersService, ValidatorsType, VersionsModel, WebsocketMessageSubTypes, WebsocketMessageTypes, WebsocketService, WtFrontSharedModule, appearFromLeft, appearFromLeftHideToRight, appearFromLeftWithDelay, appearFromRight, appearFromRightWithDelay, appearOpacity, appearOpacity2, componentDestroyed, coreQuery, defaultStickySidebarOptions, entityScheme, expandCollapse, fileMapper, fileScheme, getAll, getAllUiUnits, getRequestInfo, getRouterLastRoute, getRouterLastRouteParams, getRouterQueryParams, getRouterRoot, getRouterUrl, getUIUnit, getUiUnitDataById, getUserAuthData, guid, hideToTopOpacity, initialState$b as initialState, mappet, notificationQuery, publicationMessageMapper, publicationMessageScheme, requestsQuery, sharedEffects, sharedFacades, staticDataQuery, trackById, uiUnitsQuery, untilComponentDestroyed, userMapper, userReducer, userScheme, usersQuery };
11435
+ export { AccessDeniedComponent, AccessDeniedModule, ActionsEndpointTypes, ActionsFacade, ActionsMetaStatus, ActionsModel, ActionsSendRequest, ActionsService, AsyncValidators, AsyncValidatorsMessages, AsyncValidatorsType, AuthEndpointTypes, AuthenticationService, AutoFormMainComponent, AutoFormModule, AutoFormService, AutoFormShowComponent, Back, BaseAPI, BaseAPIService, BaseAutoFormService, BaseErrors, BaseModelAdapter, BaseResponseFactory, BreadCrumbsComponent, BreadCrumbsModule, ButtonComponent, ButtonModule, CORE_CONFIG, CacheDataEndpointTypes, CacheDataFacade, CacheDataModel, CacheDataService, ChipsInputComponent, ChipsInputModule, ClearStaticData, CommonDialogComponent, CookiesService, CoreFacade, CoreLoadError, CoreLoaded, CountFormatPipe, CreateRequestListener, DateFormatPipe, DeleteComponent, DeleteRequest, DeleteRequestWaiter, DialogService, DialogsModule, EntitiesReportsRequest, Entity, EntityQueryFieldNames, EntitySortType, EntityType, FieldType, FileFieldNames, FileModel, FileUpdateModel, FilesDeleteRequest, FilesDeleteResponseFactory, FilesEndpointTypes, FilesFacade, FilesLoadRequest, FilesLoadResponseFactory, FilesService, FilesSortRequest, FilesSortResponseFactory, FilesUpdateRequest, FilesUpdateResponseFactory, FilesUploadComponent, FilesUploadModule, FormDeleteFileBaseEndpointTypes, FormDeleteFileFacade, FormDeleteFileRequest, FormDeleteFileService, FormErrorModel, FormErrorsFacade, FormFieldErrorComponent, FormFieldErrorModule, FormFieldPublishErrorComponent, FormFieldPublishErrorModule, FormValidationCheckRequest, FormValidationEndpointTypes, FormValidationFacade, FormValidationService, FormsFacade, Forward, GetCacheDataRequest, GetRequest, GlobalErrorMessages, GlobalEvent, Go, GoFail, HeaderComponent, HeaderModule, HeadersInterceptor, IFormFieldFormat, IconComponent, ImageComponent, ImageModule, InputTagsComponent, InputTagsModule, JwtInterceptor, LoadCore, LoadUsers, LoadUsersFail, LoadUsersSuccess, LoginSend, LoginSendCreateRequest, LoginSendCreateResponseFactory, LoginSendFail, LoginSendSuccess, MainConst, MainFacade, MapperRegistry, MapperUtil, MetaModel, NOTIFICATION_LONG_TIMEOUT, NOTIFICATION_TIMEOUT, NotificationAdd, NotificationAddFail, NotificationModel, NotificationShowingType, NotificationsEffects, NotificationsFacade, PaginationComponent, PaginationModule, PagingModel, PanelComponent, PanelHeaderComponent, PanelHeaderModule, PanelModule, PasswordRules, PhonePipe, PipesModule, PostRequest, PublicationMessageFieldNames, PublicationMessagesFacade, PublishDataModel, PublishEndpointTypes, PublishErrors, PublishPostRequest, PublishResultModel, PublishService, PutRequest, QueryFieldsAdapter, ReducerService, RefreshToken, RefreshTokenFail, RefreshTokenSuccess, ReportsEndpointTypes, ReportsFacade, ReportsModel, ReportsService, Request, RequestMethods, RequestStatus, RequestsEffects, RequestsFacade, ResponseStatus, RouterEffects, RouterFacade, RouterService, STICKY_SIDEBAR_OPTIONS, SafePipe, SequelizeUniqueConstraintError, SetLoaded, SetRouterQueryParams, SharedFormErrors, SharedIconModule, SharedReducer, SharedSpinnerModule, SiteHelperComponent, SiteHelperModule, SmartProgressBarComponent, SmartProgressBarModule, SocialAuthService, SpinnerComponent, StarRatingComponent, StarRatingModule, StaticDataCreate, StaticDataCreateFail, StaticDataCreateRequest, StaticDataCreateSuccess, StaticDataDelete, StaticDataDeleteFail, StaticDataDeleteRequest, StaticDataDeleteSuccess, StaticDataEffects, StaticDataEndpointTypes, StaticDataFacade, StaticDataGet, StaticDataGetFail, StaticDataGetList, StaticDataGetListCategories, StaticDataGetListCategoriesFail, StaticDataGetListCategoriesRequest, StaticDataGetListCategoriesSuccess, StaticDataGetListFail, StaticDataGetListRequest, StaticDataGetListSuccess, StaticDataGetRequest, StaticDataGetSubRouting, StaticDataGetSubRoutingFail, StaticDataGetSubRoutingSuccess, StaticDataGetSuccess, StaticDataMetaStatus, StaticDataModel, StaticDataPartUpdate, StaticDataService, StaticDataSubRoutingGetRequest, StaticDataUpdate, StaticDataUpdateFail, StaticDataUpdateRequest, StaticDataUpdateSuccess, StickySidebarDirective, StickySidebarInnerDirective, StickySidebarModule, StorageProvider, StorageService, TableMenuComponent, TableMenuModule, TagCloudComponent, TagCloudModule, TagEntitiesRequest, TagEntityModel, TagModel, TagsEndpointTypes, TagsFacade, TagsLoadRequest, TagsLoadResponseFactory, TagsService, TextWithLinkMoreComponent, TextWithLinkMoreModule, USERS_FEATURE_KEY, UiUnitIds, UiUnitsEffects, UiUnitsFacade, UnPublishPostRequest, UpdateRequestData, UserFieldNames, UserModel, UserRole, UserSectionRightModel, UsersEffects, UsersFacade, UsersService, ValidatorsType, VersionsModel, WebsocketMessageSubTypes, WebsocketMessageTypes, WebsocketService, WtFrontSharedModule, appearFromLeft, appearFromLeftHideToRight, appearFromLeftWithDelay, appearFromRight, appearFromRightWithDelay, appearOpacity, appearOpacity2, componentDestroyed, coreQuery, defaultStickySidebarOptions, entityScheme, expandCollapse, fileMapper, fileScheme, getAll, getAllUiUnits, getRequestInfo, getRouterLastRoute, getRouterLastRouteParams, getRouterQueryParams, getRouterRoot, getRouterUrl, getUIUnit, getUiUnitDataById, getUserAuthData, guid, hideToTopOpacity, initialState$b as initialState, mappet, notificationQuery, publicationMessageMapper, publicationMessageScheme, requestsQuery, sharedEffects, sharedFacades, staticDataQuery, trackById, uiUnitsQuery, untilComponentDestroyed, userMapper, userReducer, userScheme, usersQuery };
10970
11436
  //# sourceMappingURL=wt-front-shared.mjs.map