wt-front-shared 1.0.64 → 1.0.66

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 (40) hide show
  1. package/esm2020/lib/core/+state/static-data/behavios/static-data-get-list-behavior.mjs +2 -2
  2. package/esm2020/lib/core/+state/static-data/static-data.actions.mjs +3 -1
  3. package/esm2020/lib/core/+state/static-data/static-data.effects.mjs +13 -4
  4. package/esm2020/lib/core/+state/static-data/static-data.facade.mjs +72 -23
  5. package/esm2020/lib/core/+state/static-data/static-data.reducer.mjs +34 -3
  6. package/esm2020/lib/core/+state/static-data/static-data.selectors.mjs +33 -3
  7. package/esm2020/lib/core/components/static-data/components/static-data-list-items/static-data-list-items.component.mjs +7 -9
  8. package/esm2020/lib/core/services/static-data/static-data-api.mjs +5 -1
  9. package/esm2020/lib/core/services/static-data/static-data.service.mjs +4 -1
  10. package/esm2020/lib/core/services/websocket.service.mjs +17 -11
  11. package/esm2020/lib/models/endpoints/http/request/request.mjs +3 -3
  12. package/esm2020/lib/models/endpoints/static-data/static-data-endpoint-types.mjs +2 -1
  13. package/esm2020/lib/models/endpoints/static-data/static-data-get-list/request/static-data-get-list-request-config.mjs +1 -1
  14. package/esm2020/lib/models/endpoints/static-data/static-data-get-list/request/static-data-get-list-request.mjs +4 -1
  15. package/esm2020/lib/models/endpoints/static-data/static-data-get-list-categories/request/static-data-get-list-categories-request-config.mjs +1 -1
  16. package/esm2020/lib/models/endpoints/static-data/static-data-get-list-categories/request/static-data-get-list-categories-request.mjs +3 -2
  17. package/esm2020/lib/models/endpoints/static-data/static-data-load-revisions/index.mjs +2 -0
  18. package/esm2020/lib/models/endpoints/static-data/static-data-load-revisions/request/index.mjs +2 -0
  19. package/esm2020/lib/models/endpoints/static-data/static-data-load-revisions/request/static-data-load-revisions-request-config.mjs +2 -0
  20. package/esm2020/lib/models/endpoints/static-data/static-data-load-revisions/request/static-data-load-revisions-request.mjs +21 -0
  21. package/fesm2015/wt-front-shared.mjs +563 -404
  22. package/fesm2015/wt-front-shared.mjs.map +1 -1
  23. package/fesm2020/wt-front-shared.mjs +558 -404
  24. package/fesm2020/wt-front-shared.mjs.map +1 -1
  25. package/lib/core/+state/index.d.ts +1 -1
  26. package/lib/core/+state/static-data/static-data.actions.d.ts +18 -0
  27. package/lib/core/+state/static-data/static-data.effects.d.ts +1 -0
  28. package/lib/core/+state/static-data/static-data.facade.d.ts +10 -3
  29. package/lib/core/+state/static-data/static-data.reducer.d.ts +3 -0
  30. package/lib/core/+state/static-data/static-data.selectors.d.ts +3 -0
  31. package/lib/core/services/static-data/static-data.service.d.ts +2 -0
  32. package/lib/core/services/websocket.service.d.ts +4 -2
  33. package/lib/models/endpoints/static-data/static-data-endpoint-types.d.ts +1 -0
  34. package/lib/models/endpoints/static-data/static-data-get-list/request/static-data-get-list-request-config.d.ts +1 -0
  35. package/lib/models/endpoints/static-data/static-data-get-list-categories/request/static-data-get-list-categories-request-config.d.ts +1 -0
  36. package/lib/models/endpoints/static-data/static-data-load-revisions/index.d.ts +1 -0
  37. package/lib/models/endpoints/static-data/static-data-load-revisions/request/index.d.ts +2 -0
  38. package/lib/models/endpoints/static-data/static-data-load-revisions/request/static-data-load-revisions-request-config.d.ts +4 -0
  39. package/lib/models/endpoints/static-data/static-data-load-revisions/request/static-data-load-revisions-request.d.ts +11 -0
  40. package/package.json +1 -1
@@ -466,10 +466,10 @@ class Request {
466
466
  convertPagingToString(paging) {
467
467
  let res = '';
468
468
  if (paging) {
469
- if (paging.page) {
469
+ if (paging === null || paging === void 0 ? void 0 : paging.page) {
470
470
  res = `page=${paging.page}`;
471
471
  }
472
- if (paging.perPage) {
472
+ if (paging === null || paging === void 0 ? void 0 : paging.perPage) {
473
473
  res += `${res ? '&' : ''}per_page=${paging.perPage}`;
474
474
  }
475
475
  }
@@ -1060,6 +1060,7 @@ var StaticDataEndpointTypes;
1060
1060
  (function (StaticDataEndpointTypes) {
1061
1061
  StaticDataEndpointTypes["CREATE"] = "create";
1062
1062
  StaticDataEndpointTypes["DELETE"] = "delete";
1063
+ StaticDataEndpointTypes["LOAD_REVISION"] = "loadRevision";
1063
1064
  StaticDataEndpointTypes["GET_LIST"] = "getList";
1064
1065
  StaticDataEndpointTypes["GET_SUB_ROUTING"] = "getSubRouting";
1065
1066
  StaticDataEndpointTypes["GET_LIST_CATEGORIES"] = "getListCategories";
@@ -1171,6 +1172,9 @@ class StaticDataGetListRequest extends GetRequest {
1171
1172
  if (this.config.search) {
1172
1173
  url += `${url ? '&' : ''}search=${this.config.search}`;
1173
1174
  }
1175
+ if (this.config.revision) {
1176
+ url += `${url ? '&' : ''}revision=${this.config.revision}`;
1177
+ }
1174
1178
  return `${this.domain}/api/static-data/${this.config.contentType}/${this.config.subSection || 'list'}/${url ? '?' : ''}${url}`;
1175
1179
  }
1176
1180
  get headers() {
@@ -1192,7 +1196,8 @@ class StaticDataGetListCategoriesRequest extends GetRequest {
1192
1196
  }
1193
1197
  get url() {
1194
1198
  const contentTypes = this.config.contentTypes;
1195
- return `${this.domain}/api/static-data/list/?types=${contentTypes.join(',')}`;
1199
+ const revisions = this.config.revisions;
1200
+ return `${this.domain}/api/static-data/list/?types=${contentTypes.join(',')}${revisions ? '&revisions=' + revisions.join(':') : ''}`;
1196
1201
  }
1197
1202
  get headers() {
1198
1203
  return null;
@@ -4707,6 +4712,8 @@ const ClearStaticData = createAction('[StaticData] Clear StaticData', props());
4707
4712
  const StaticDataGetSubRouting = createAction('[StaticData] StaticData Get Sub routing', props());
4708
4713
  const StaticDataGetSubRoutingSuccess = createAction('[StaticData] StaticData Get Sub routing Success', props());
4709
4714
  const StaticDataGetSubRoutingFail = createAction('[StaticData] StaticData Get Sub routing Fail', props());
4715
+ const StaticDataNewRevisions = createAction('[StaticData] StaticDataNewRevisions', props());
4716
+ const StaticDataLoadRevisions = createAction('[StaticData] StaticDataLoadRevisions', props());
4710
4717
 
4711
4718
  class StaticDataGetListBehavior extends Behavior {
4712
4719
  constructor(action, result) {
@@ -4726,7 +4733,7 @@ class StaticDataGetListBehavior extends Behavior {
4726
4733
  if (data) {
4727
4734
  returnedActions = [
4728
4735
  StaticDataGetListSuccess({
4729
- payload: { data, meta, keepState: actionPayload.keepState }
4736
+ payload: { data, meta, keepState: actionPayload === null || actionPayload === void 0 ? void 0 : actionPayload.keepState }
4730
4737
  })
4731
4738
  ];
4732
4739
  }
@@ -5462,6 +5469,26 @@ class StaticDataPatchUpdateRequest extends PatchRequest {
5462
5469
  }
5463
5470
  }
5464
5471
 
5472
+ class StaticDataLoadRevisionsRequest extends GetRequest {
5473
+ constructor(domain, config) {
5474
+ super(domain);
5475
+ this.domain = domain;
5476
+ this.config = config;
5477
+ }
5478
+ get url() {
5479
+ return `${this.domain}/api/static-data/revisions`;
5480
+ }
5481
+ get headers() {
5482
+ return this.addAuthHeaders(this.config.headers);
5483
+ }
5484
+ get params() {
5485
+ return null;
5486
+ }
5487
+ get body() {
5488
+ return null;
5489
+ }
5490
+ }
5491
+
5465
5492
  class StaticDataApi extends BaseAPI {
5466
5493
  constructor(domain) {
5467
5494
  super(domain);
@@ -5470,6 +5497,9 @@ class StaticDataApi extends BaseAPI {
5470
5497
  createRequest(paramsConfig, endPointType) {
5471
5498
  let request;
5472
5499
  switch (endPointType) {
5500
+ case StaticDataEndpointTypes.LOAD_REVISION:
5501
+ request = new StaticDataLoadRevisionsRequest(this.domain, paramsConfig);
5502
+ break;
5473
5503
  case StaticDataEndpointTypes.GET_LIST:
5474
5504
  request = new StaticDataGetListRequest(this.domain, paramsConfig);
5475
5505
  break;
@@ -5513,6 +5543,9 @@ class StaticDataService extends BaseAPIService {
5513
5543
  this.formsFacade = formsFacade;
5514
5544
  this.api = new StaticDataApi(this.config.apiUrl);
5515
5545
  }
5546
+ loadRevision(config) {
5547
+ return this.doRequest(config, StaticDataEndpointTypes.LOAD_REVISION);
5548
+ }
5516
5549
  getList(config) {
5517
5550
  return this.doRequest(config, StaticDataEndpointTypes.GET_LIST);
5518
5551
  }
@@ -5662,204 +5695,6 @@ const StorageProvider = {
5662
5695
  useFactory: cookiesProviderFactory,
5663
5696
  };
5664
5697
 
5665
- var WebsocketMessageTypes;
5666
- (function (WebsocketMessageTypes) {
5667
- WebsocketMessageTypes["USER_ACTIVITY"] = "user-activity";
5668
- })(WebsocketMessageTypes || (WebsocketMessageTypes = {}));
5669
- var WebsocketMessageSubTypes;
5670
- (function (WebsocketMessageSubTypes) {
5671
- WebsocketMessageSubTypes["CHANGE_PAGE"] = "change-page";
5672
- WebsocketMessageSubTypes["OPEN_BOOKING_FORM"] = "open-booking-form";
5673
- WebsocketMessageSubTypes["OPEN_FIRM_CONTACT"] = "open-firm-contact";
5674
- })(WebsocketMessageSubTypes || (WebsocketMessageSubTypes = {}));
5675
- class WebsocketService {
5676
- constructor(config) {
5677
- this.config = config;
5678
- this.wsIsLoaded = false;
5679
- this.maxNumbersOfReloads = 10;
5680
- this.numbersOfReloads = 0;
5681
- this.connectToWebSocket();
5682
- }
5683
- connectToWebSocket() {
5684
- if ("WebSocket" in window) {
5685
- this.ws = new WebSocket(this.config.websocketUrl);
5686
- this.ws.onopen = () => {
5687
- this.numbersOfReloads = 0;
5688
- console.info('[ document ][ WS ][ Connection opened ]', this.sessionKey || '', this.config.websocketUrl);
5689
- this.wsIsLoaded = true;
5690
- };
5691
- this.ws.onmessage = (event) => {
5692
- let message;
5693
- try {
5694
- message = JSON.parse(event.data);
5695
- }
5696
- catch (e) {
5697
- console.info('[ document ][ WS ][ Incorrect message ]', { message: event.data, error: e });
5698
- }
5699
- if (message && !this.sessionKey) {
5700
- if (message === null || message === void 0 ? void 0 : message.sessionKey) {
5701
- this.sessionKey = message.sessionKey;
5702
- }
5703
- console.info('[ document ][ WS ][ Message received ]', this.sessionKey, message);
5704
- }
5705
- };
5706
- this.ws.onclose = () => {
5707
- console.info('[ document ][ WS ][ Connection closed ]');
5708
- this.wsIsLoaded = false;
5709
- setTimeout(() => {
5710
- if (this.numbersOfReloads < this.maxNumbersOfReloads) {
5711
- this.numbersOfReloads++;
5712
- this.connectToWebSocket();
5713
- }
5714
- }, 10000);
5715
- };
5716
- }
5717
- }
5718
- wsSentMessage(type, subType, message) {
5719
- if (this.wsIsLoaded) {
5720
- this.ws.send(JSON.stringify({ type, subType, message, sessionKey: this.sessionKey }));
5721
- }
5722
- }
5723
- }
5724
- WebsocketService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: WebsocketService, deps: [{ token: CORE_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
5725
- WebsocketService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: WebsocketService, providedIn: 'root' });
5726
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: WebsocketService, decorators: [{
5727
- type: Injectable,
5728
- args: [{
5729
- providedIn: 'root'
5730
- }]
5731
- }], ctorParameters: function () {
5732
- return [{ type: undefined, decorators: [{
5733
- type: Inject,
5734
- args: [CORE_CONFIG]
5735
- }] }];
5736
- } });
5737
-
5738
- class RouterFacade {
5739
- constructor(store) {
5740
- this.store = store;
5741
- }
5742
- goTo(path, extras = null) {
5743
- console.info('[ router.facade.navigation ]', path, extras);
5744
- return this.store.dispatch(Go({ payload: { path, extras } }));
5745
- }
5746
- }
5747
- RouterFacade.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RouterFacade, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable });
5748
- RouterFacade.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RouterFacade, providedIn: "root" });
5749
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RouterFacade, decorators: [{
5750
- type: Injectable,
5751
- args: [{ providedIn: "root" }]
5752
- }], ctorParameters: function () { return [{ type: i1.Store }]; } });
5753
-
5754
- /*const MESSAGES = {
5755
- delete: {
5756
- title: 'Внимание',
5757
- text: 'Запись успешно удаленна'
5758
- },
5759
- update: {
5760
- title: 'Внимание',
5761
- text: 'Запись успешно обновлена'
5762
- },
5763
- create: {
5764
- title: 'Внимание',
5765
- text: 'Запись успешно создана'
5766
- }
5767
- };*/
5768
- class StaticDataEffects extends BaseEffects {
5769
- constructor(actions$, store, authenticationService, staticDataService, routerService, notificationsFacade) {
5770
- super(actions$, store);
5771
- this.actions$ = actions$;
5772
- this.store = store;
5773
- this.authenticationService = authenticationService;
5774
- this.staticDataService = staticDataService;
5775
- this.routerService = routerService;
5776
- this.notificationsFacade = notificationsFacade;
5777
- this.staticDataGetList$ = createEffect(() => this.actions$.pipe(ofType(StaticDataGetList), mergeMap((action) => {
5778
- const headers = this.authenticationService.loadAuthDataFromLocalStore();
5779
- const config = Object.assign(Object.assign({}, action.payload), { headers: { token: headers.token, uid: headers.id }, contentType: action.payload.contentType });
5780
- return this.staticDataService.getList(config)
5781
- .pipe(flatMap((r) => new StaticDataGetListBehavior(action, r).resolve()));
5782
- })));
5783
- this.staticDataGetSubRouting$ = createEffect(() => this.actions$.pipe(ofType(StaticDataGetSubRouting), mergeMap((action) => {
5784
- const headers = this.authenticationService.loadAuthDataFromLocalStore();
5785
- const config = Object.assign(Object.assign({}, action.payload), { headers: { token: headers.token, uid: headers.id }, contentType: action.payload.contentType, routing: action.payload.routing });
5786
- return this.staticDataService.getSubRouting(config)
5787
- .pipe(flatMap((r) => new StaticDataGetListBehavior(action, r).resolve()));
5788
- })));
5789
- this.staticDataDelete$ = createEffect(() => this.actions$.pipe(ofType(StaticDataDelete), switchMap$1((action) => {
5790
- const headers = this.authenticationService.loadAuthDataFromLocalStore();
5791
- const config = Object.assign(Object.assign({}, action.payload), { headers: { token: headers.token, uid: headers.id }, contentType: action.payload.contentType, itemId: action.payload.itemId });
5792
- return this.staticDataService.delete(config)
5793
- .pipe(flatMap((r) => new StaticDataDeleteBehavior(action, r).resolve()));
5794
- })));
5795
- /* @Effect({dispatch: false})
5796
- StaticDataDeleteSuccess$ = this.actions$.pipe(
5797
- ofType(StaticDataDeleteSuccess),
5798
- tap((action) => {
5799
- const {contentType, itemId} = action.payload;
5800
- this.routerService.goTo(['/static-data', contentType]);
5801
- this.notificationsFacade.addNotifications({
5802
- id: `form-message-delete-${contentType}-${itemId}`,
5803
- type: 'success',
5804
- text: MESSAGES.delete.text,
5805
- title: MESSAGES.delete.title,
5806
- timeout: NOTIFICATION_TIMEOUT
5807
- });
5808
- })
5809
- );*/
5810
- this.staticDataCreate$ = createEffect(() => this.actions$.pipe(ofType(StaticDataCreate), switchMap$1((action) => {
5811
- const headers = this.authenticationService.loadAuthDataFromLocalStore();
5812
- const config = Object.assign(Object.assign({}, action.payload), { headers: { token: headers.token, uid: headers.id }, formId: action.payload.formId, contentType: action.payload.contentType, publicApi: action.payload.publicApi });
5813
- return this.staticDataService.create(config)
5814
- .pipe(flatMap((r) => new StaticDataCreateBehavior(action, r).resolve()));
5815
- })));
5816
- /* @Effect({dispatch: false})
5817
- staticDataCreateSuccess$ = this.actions$.pipe(
5818
- ofType(StaticDataCreateSuccess),
5819
- tap((action) => {
5820
- const {contentType, itemId} = action.payload;
5821
- this.routerService.goTo(['/static-data', contentType, itemId]);
5822
- this.notificationsFacade.addNotifications({
5823
- id: `form-message-create-${contentType}-${itemId}`,
5824
- type: 'success',
5825
- text: MESSAGES.create.text,
5826
- title: MESSAGES.create.title,
5827
- timeout: NOTIFICATION_TIMEOUT
5828
- });
5829
- })
5830
- );*/
5831
- this.staticDataUpdate$ = createEffect(() => this.actions$.pipe(ofType(StaticDataUpdate), switchMap$1((action) => {
5832
- const headers = this.authenticationService.loadAuthDataFromLocalStore();
5833
- const config = Object.assign(Object.assign({}, action.payload), { headers: { token: headers.token, uid: headers.id }, formId: action.payload.formId, contentType: action.payload.contentType, itemId: action.payload.itemId });
5834
- return this.staticDataService.update(config)
5835
- .pipe(flatMap((r) => new StaticDataUpdateBehavior(action, r).resolve()));
5836
- })));
5837
- this.staticDataPatchUpdate$ = createEffect(() => this.actions$.pipe(ofType(StaticDataPatchUpdate), switchMap$1((action) => {
5838
- const headers = this.authenticationService.loadAuthDataFromLocalStore();
5839
- const config = Object.assign(Object.assign({}, action.payload), { headers: { token: headers.token, uid: headers.id }, formId: action.payload.formId, contentType: action.payload.contentType, itemId: action.payload.itemId });
5840
- return this.staticDataService.patchUpdate(config)
5841
- .pipe(flatMap((r) => new StaticDataPatchUpdateBehavior(action, r).resolve()));
5842
- })));
5843
- this.staticDataGetListCategories$ = createEffect(() => this.actions$.pipe(ofType(StaticDataGetListCategories), switchMap$1((action) => {
5844
- const { contentTypes } = action.payload;
5845
- const config = {
5846
- contentTypes
5847
- };
5848
- return this.staticDataService.getListCategories(config)
5849
- .pipe(flatMap((r) => new StaticDataGetListCategoriesBehavior(action, r).resolve()), catchError(error => of(StaticDataGetListCategoriesFail({
5850
- payload: {
5851
- contentTypes: action.payload.contentTypes,
5852
- }
5853
- }))));
5854
- })));
5855
- }
5856
- }
5857
- StaticDataEffects.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: StaticDataEffects, deps: [{ token: i1$2.Actions }, { token: i1.Store }, { token: AuthenticationService }, { token: StaticDataService }, { token: RouterFacade }, { token: NotificationsFacade }], target: i0.ɵɵFactoryTarget.Injectable });
5858
- StaticDataEffects.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: StaticDataEffects });
5859
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: StaticDataEffects, decorators: [{
5860
- type: Injectable
5861
- }], ctorParameters: function () { return [{ type: i1$2.Actions }, { type: i1.Store }, { type: AuthenticationService }, { type: StaticDataService }, { type: RouterFacade }, { type: NotificationsFacade }]; } });
5862
-
5863
5698
  const STATIC_DATA_FEATURE_KEY$1 = 'staticData';
5864
5699
  var StaticDataMetaStatus$1;
5865
5700
  (function (StaticDataMetaStatus) {
@@ -5868,7 +5703,8 @@ var StaticDataMetaStatus$1;
5868
5703
  })(StaticDataMetaStatus$1 || (StaticDataMetaStatus$1 = {}));
5869
5704
  const initialState$3 = {
5870
5705
  list: {},
5871
- meta: {}
5706
+ meta: {},
5707
+ revisions: null
5872
5708
  };
5873
5709
  const _staticDataReducer$2 = createReducer(initialState$3, on(StaticDataGetList, (state, action) => {
5874
5710
  var _a, _b, _c;
@@ -6024,6 +5860,37 @@ const _staticDataReducer$2 = createReducer(initialState$3, on(StaticDataGetList,
6024
5860
  newState.meta[contentType] = Object.assign(Object.assign({}, newState.meta[contentType]), { list: Object.assign(Object.assign({}, newState.meta[contentType]['list']), { status: StaticDataMetaStatus$1.LOADED }) });
6025
5861
  });
6026
5862
  return newState;
5863
+ }), on(StaticDataNewRevisions, (state, action) => {
5864
+ var _a, _b;
5865
+ const { data } = action.payload;
5866
+ const newState = {
5867
+ list: Object.assign({}, state.list),
5868
+ meta: Object.assign({}, state.meta)
5869
+ };
5870
+ const newDataKeys = data.map(item => item.staticDataKey);
5871
+ if (data === null || data === void 0 ? void 0 : data.length) {
5872
+ if (!((_a = newState.list) === null || _a === void 0 ? void 0 : _a.revisions)) {
5873
+ newState.list['revisions'] = { list: [] };
5874
+ }
5875
+ else {
5876
+ if ((_b = newState.list['revisions']) === null || _b === void 0 ? void 0 : _b.list) {
5877
+ const newList = newState.list['revisions'].list
5878
+ .filter(item => !newDataKeys.includes(item.staticDataKey));
5879
+ if (newList) {
5880
+ newState.list['revisions'] = { list: [...newList] };
5881
+ }
5882
+ }
5883
+ }
5884
+ data.forEach(item => {
5885
+ const contentType = item.staticDataKey;
5886
+ newState.list['revisions'].list.push({
5887
+ slug: contentType,
5888
+ staticDataKey: contentType,
5889
+ revision: item.revision
5890
+ });
5891
+ });
5892
+ }
5893
+ return newState;
6027
5894
  }));
6028
5895
  function staticDataReducer(state, action) {
6029
5896
  return _staticDataReducer$2(state, action);
@@ -6032,36 +5899,487 @@ function getFormKey$1(contentType, itemId) {
6032
5899
  return `${contentType}-${itemId || '*'}`;
6033
5900
  }
6034
5901
 
6035
- const ActionsSend = createAction('[Actions] Actions Create', props());
6036
- const ActionsSendSuccess = createAction('[Actions] Actions Create Success', props());
6037
- const ActionsSendFail = createAction('[Actions] Actions Create Error', props());
6038
-
6039
- class ActionsSendBehavior extends Behavior {
6040
- constructor(action, result) {
6041
- super(action);
6042
- this.action = action;
6043
- this.result = result;
5902
+ const getStaticDataState = createFeatureSelector(STATIC_DATA_FEATURE_KEY$1);
5903
+ const getStatus$1 = (contentType, subSection) => createSelector(getStaticDataState, (state) => { var _a, _b, _c; return (_c = (_b = (_a = state === null || state === void 0 ? void 0 : state.meta) === null || _a === void 0 ? void 0 : _a[contentType]) === null || _b === void 0 ? void 0 : _b[subSection]) === null || _c === void 0 ? void 0 : _c.status; });
5904
+ const getLoaded$1 = (contentType, subSection) => createSelector(getStaticDataState, (state) => { var _a, _b, _c; return ((_c = (_b = (_a = state === null || state === void 0 ? void 0 : state.meta) === null || _a === void 0 ? void 0 : _a[contentType]) === null || _b === void 0 ? void 0 : _b[subSection]) === null || _c === void 0 ? void 0 : _c.status) === StaticDataMetaStatus$1.LOADED; });
5905
+ const getError$1 = (contentType) => createSelector(getStaticDataState, (state) => { var _a, _b; return (_b = (_a = state === null || state === void 0 ? void 0 : state.meta) === null || _a === void 0 ? void 0 : _a[contentType]) === null || _b === void 0 ? void 0 : _b.error; });
5906
+ const getStaticDataMeta = (contentType, subSection) => createSelector(getStaticDataState, (state) => {
5907
+ var _a, _b;
5908
+ return (_b = (_a = state.meta) === null || _a === void 0 ? void 0 : _a[contentType]) === null || _b === void 0 ? void 0 : _b[subSection];
5909
+ });
5910
+ const getStaticDataRevisions = () => createSelector(getStaticDataState, (state) => {
5911
+ var _a, _b;
5912
+ let result = [];
5913
+ if ((_a = state.list['revisions']) === null || _a === void 0 ? void 0 : _a['list']) {
5914
+ result = (_b = state.list['revisions']) === null || _b === void 0 ? void 0 : _b['list'];
6044
5915
  }
6045
- resolve() {
6046
- const status = this.result.data.status;
6047
- let returnedActions;
6048
- const response = this.result.data;
6049
- const { data } = response.body;
6050
- switch (status) {
6051
- case ResponseStatus.STATUS_200: {
6052
- returnedActions = [
6053
- ActionsSendSuccess({ payload: Object.assign({}, data) })
6054
- ];
6055
- break;
6056
- }
6057
- default: {
6058
- returnedActions = [
6059
- ActionsSendFail({
6060
- payload: {
6061
- error: 'Unhandled error',
6062
- action: data.action,
6063
- actionId: data.actionId,
6064
- }
5916
+ return result;
5917
+ });
5918
+ const getStaticDataRevision = (contentType) => createSelector(getStaticDataState, (state) => {
5919
+ var _a, _b, _c, _d;
5920
+ let result = null;
5921
+ if ((_b = (_a = state.list) === null || _a === void 0 ? void 0 : _a.revisions) === null || _b === void 0 ? void 0 : _b.list) {
5922
+ result = (_d = (_c = state.list) === null || _c === void 0 ? void 0 : _c.revisions) === null || _d === void 0 ? void 0 : _d.list.find(item => item.slug === contentType);
5923
+ }
5924
+ return result;
5925
+ });
5926
+ const getStaticDataRevisionsList = (contentTypes) => createSelector(getStaticDataState, (state) => {
5927
+ var _a, _b, _c, _d;
5928
+ const preparedContentTypes = contentTypes.map(item => {
5929
+ const itemParameters = item.split('(');
5930
+ return itemParameters[0];
5931
+ });
5932
+ let result = null;
5933
+ if ((_b = (_a = state.list) === null || _a === void 0 ? void 0 : _a.revisions) === null || _b === void 0 ? void 0 : _b.list) {
5934
+ result = (_d = (_c = state.list) === null || _c === void 0 ? void 0 : _c.revisions) === null || _d === void 0 ? void 0 : _d.list.filter(item => preparedContentTypes.includes(item.slug));
5935
+ }
5936
+ return result;
5937
+ });
5938
+ const getStaticData = (contentType, subSection, where) => createSelector(getStaticDataState, getLoaded$1(contentType, subSection), (state, isLoaded) => {
5939
+ var _a;
5940
+ let list = isLoaded ? (_a = state.list[contentType]) === null || _a === void 0 ? void 0 : _a[subSection] : null;
5941
+ if (where && (list === null || list === void 0 ? void 0 : list.length)) {
5942
+ list = list.filter(item => {
5943
+ let result = true;
5944
+ Object.keys(where)
5945
+ .forEach(whereItem => {
5946
+ if (item[whereItem] !== where[whereItem]) {
5947
+ result = false;
5948
+ }
5949
+ });
5950
+ return result;
5951
+ });
5952
+ }
5953
+ return list;
5954
+ });
5955
+ const getStaticDataForListContentTypes = (contentTypes) => createSelector(getStaticDataState, (state) => {
5956
+ let result = {};
5957
+ contentTypes.forEach(contentType => {
5958
+ var _a;
5959
+ result[contentType] = ((_a = state.list[contentType]) === null || _a === void 0 ? void 0 : _a.list) || [];
5960
+ });
5961
+ return result;
5962
+ });
5963
+ const getStaticDataItem = (contentType, subSection, itemIdOrSlug) => createSelector(getStaticDataState, (state) => {
5964
+ var _a, _b;
5965
+ const foundItem = (_b = (_a = state.list[contentType]) === null || _a === void 0 ? void 0 : _a[subSection]) === null || _b === void 0 ? void 0 : _b.find(item => {
5966
+ 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;
5967
+ }); //
5968
+ return foundItem || {};
5969
+ });
5970
+ const staticDataQuery = {
5971
+ getStatus: getStatus$1,
5972
+ getLoaded: getLoaded$1,
5973
+ getError: getError$1,
5974
+ getStaticData,
5975
+ getStaticDataItem,
5976
+ getStaticDataMeta,
5977
+ getStaticDataForListContentTypes,
5978
+ getStaticDataRevision,
5979
+ getStaticDataRevisions,
5980
+ getStaticDataRevisionsList
5981
+ };
5982
+
5983
+ class StaticDataFacade {
5984
+ constructor(store) {
5985
+ this.store = store;
5986
+ }
5987
+ getStatus$(contentType, subSection = 'list') {
5988
+ return this.store.pipe(select(staticDataQuery.getStatus(contentType, subSection)));
5989
+ }
5990
+ getStaticDataMeta$(contentType, subSection = 'list') {
5991
+ return this.store.pipe(select(staticDataQuery.getStaticDataMeta(contentType, subSection)));
5992
+ }
5993
+ getStaticData$(contentType, subSection = 'list', options, where) {
5994
+ return this.store.pipe(select(staticDataQuery.getStaticData(contentType, subSection, where)));
5995
+ }
5996
+ getStaticDataForListContentTypes$(contentTypes) {
5997
+ return this.store.pipe(select(staticDataQuery.getStaticDataForListContentTypes(contentTypes)));
5998
+ }
5999
+ getStaticDataItem$(contentType, subSection = 'list', itemIdOrSlug) {
6000
+ return this.store.pipe(select(staticDataQuery.getStaticDataItem(contentType, subSection, itemIdOrSlug)));
6001
+ }
6002
+ getStaticDataRevision(contentType) {
6003
+ return new Promise((resolve, reject) => {
6004
+ if (!contentType) {
6005
+ return resolve(null);
6006
+ }
6007
+ this.store.pipe(select(staticDataQuery.getStaticDataRevision(contentType)))
6008
+ .pipe(take(1))
6009
+ .subscribe(revisionData => {
6010
+ resolve((revisionData === null || revisionData === void 0 ? void 0 : revisionData.revision) || null);
6011
+ });
6012
+ });
6013
+ }
6014
+ getStaticDataRevisions(contentTypes) {
6015
+ return new Promise((resolve, reject) => {
6016
+ if (!(contentTypes === null || contentTypes === void 0 ? void 0 : contentTypes.length)) {
6017
+ return resolve(null);
6018
+ }
6019
+ this.store.pipe(select(staticDataQuery.getStaticDataRevisionsList(contentTypes)))
6020
+ .pipe(take(1))
6021
+ .subscribe(revisions => {
6022
+ if (revisions === null || revisions === void 0 ? void 0 : revisions.length) {
6023
+ const revisionList = revisions.map(item => item.revision);
6024
+ resolve(revisionList || null);
6025
+ }
6026
+ else {
6027
+ resolve(null);
6028
+ }
6029
+ });
6030
+ });
6031
+ }
6032
+ loadStaticData(contentType, params, subSection = 'list') {
6033
+ const { where, fields, paging, sort, forPanel, search, keepState } = params;
6034
+ this.getStaticDataRevision(contentType)
6035
+ .then(revision => {
6036
+ this.store.dispatch(StaticDataGetList({
6037
+ payload: {
6038
+ contentType,
6039
+ subSection,
6040
+ where,
6041
+ fields,
6042
+ paging,
6043
+ sort,
6044
+ forPanel,
6045
+ search,
6046
+ keepState,
6047
+ revision
6048
+ }
6049
+ }));
6050
+ });
6051
+ }
6052
+ loadStaticDataSubRouting(contentType, routing) {
6053
+ this.store.dispatch(StaticDataGetSubRouting({
6054
+ payload: {
6055
+ contentType,
6056
+ routing
6057
+ }
6058
+ }));
6059
+ }
6060
+ loadStaticDataRevisions() {
6061
+ this.store.dispatch(StaticDataLoadRevisions({
6062
+ payload: null
6063
+ }));
6064
+ }
6065
+ clearStaticData(contentType) {
6066
+ return this.store.dispatch(ClearStaticData({ payload: { contentType } }));
6067
+ }
6068
+ delete(contentType, itemId) {
6069
+ this.store.dispatch(StaticDataDelete({
6070
+ payload: {
6071
+ contentType,
6072
+ itemId
6073
+ }
6074
+ }));
6075
+ }
6076
+ newRevisions(newRevisions) {
6077
+ this.store.dispatch(StaticDataNewRevisions({
6078
+ payload: { data: newRevisions }
6079
+ }));
6080
+ }
6081
+ create(formId, contentType, data, publicApi = false) {
6082
+ this.store.dispatch(StaticDataCreate({
6083
+ payload: {
6084
+ formId,
6085
+ contentType,
6086
+ data,
6087
+ publicApi
6088
+ }
6089
+ }));
6090
+ }
6091
+ update(formId, contentType, itemId, data, publicApi = false) {
6092
+ this.store.dispatch(StaticDataUpdate({
6093
+ payload: {
6094
+ formId,
6095
+ contentType,
6096
+ itemId,
6097
+ data,
6098
+ publicApi
6099
+ }
6100
+ }));
6101
+ }
6102
+ updateSuccess(contentType, itemId, data) {
6103
+ this.store.dispatch(StaticDataUpdateSuccess({
6104
+ payload: {
6105
+ contentType,
6106
+ itemId,
6107
+ data
6108
+ }
6109
+ }));
6110
+ }
6111
+ patchUpdate(formId, contentType, itemId, data, publicApi = false) {
6112
+ this.store.dispatch(StaticDataPatchUpdate({
6113
+ payload: {
6114
+ formId,
6115
+ contentType,
6116
+ itemId,
6117
+ data,
6118
+ publicApi
6119
+ }
6120
+ }));
6121
+ }
6122
+ staticDataLoadCategories(contentTypes) {
6123
+ this.getStaticDataRevisions(contentTypes)
6124
+ .then(revisions => {
6125
+ this.store.dispatch(StaticDataGetListCategories({
6126
+ payload: {
6127
+ contentTypes,
6128
+ revisions
6129
+ }
6130
+ }));
6131
+ });
6132
+ }
6133
+ }
6134
+ StaticDataFacade.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: StaticDataFacade, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable });
6135
+ StaticDataFacade.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: StaticDataFacade, providedIn: 'root' });
6136
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: StaticDataFacade, decorators: [{
6137
+ type: Injectable,
6138
+ args: [{ providedIn: 'root' }]
6139
+ }], ctorParameters: function () { return [{ type: i1.Store }]; } });
6140
+
6141
+ var WebsocketMessageTypes;
6142
+ (function (WebsocketMessageTypes) {
6143
+ WebsocketMessageTypes["USER_ACTIVITY"] = "user-activity";
6144
+ })(WebsocketMessageTypes || (WebsocketMessageTypes = {}));
6145
+ var WebsocketMessageSubTypes;
6146
+ (function (WebsocketMessageSubTypes) {
6147
+ WebsocketMessageSubTypes["CHANGE_PAGE"] = "change-page";
6148
+ WebsocketMessageSubTypes["OPEN_BOOKING_FORM"] = "open-booking-form";
6149
+ WebsocketMessageSubTypes["OPEN_FIRM_CONTACT"] = "open-firm-contact";
6150
+ })(WebsocketMessageSubTypes || (WebsocketMessageSubTypes = {}));
6151
+ class WebsocketService {
6152
+ constructor(config, staticDataFacade) {
6153
+ this.config = config;
6154
+ this.staticDataFacade = staticDataFacade;
6155
+ this.wsIsLoaded = false;
6156
+ this.maxNumbersOfReloads = 10;
6157
+ this.numbersOfReloads = 0;
6158
+ this.connectToWebSocket();
6159
+ }
6160
+ connectToWebSocket() {
6161
+ if ('WebSocket' in window) {
6162
+ this.ws = new WebSocket(this.config.websocketUrl);
6163
+ this.ws.onopen = () => {
6164
+ this.numbersOfReloads = 0;
6165
+ console.info('[ WS ][ Connection opened ]', this.sessionKey || '', this.config.websocketUrl);
6166
+ this.wsIsLoaded = true;
6167
+ };
6168
+ this.ws.onmessage = (event) => {
6169
+ let message;
6170
+ try {
6171
+ message = JSON.parse(event.data);
6172
+ }
6173
+ catch (e) {
6174
+ console.error('[ WS ][ Incorrect message ]', { message: event.data, error: e });
6175
+ }
6176
+ if (message === null || message === void 0 ? void 0 : message.revisions) {
6177
+ console.info('[ WS ][ New revisions ]', message.revisions);
6178
+ this.staticDataFacade.newRevisions(message.revisions);
6179
+ }
6180
+ if (message && !this.sessionKey) {
6181
+ if (message === null || message === void 0 ? void 0 : message.sessionKey) {
6182
+ this.sessionKey = message.sessionKey;
6183
+ }
6184
+ console.info('[ WS ][ Message received ]', this.sessionKey, message);
6185
+ }
6186
+ };
6187
+ this.ws.onclose = () => {
6188
+ console.info('[ WS ][ Connection closed ]');
6189
+ this.wsIsLoaded = false;
6190
+ setTimeout(() => {
6191
+ if (this.numbersOfReloads < this.maxNumbersOfReloads) {
6192
+ this.numbersOfReloads++;
6193
+ this.connectToWebSocket();
6194
+ }
6195
+ }, 10000);
6196
+ };
6197
+ }
6198
+ }
6199
+ wsSentMessage(type, subType, message) {
6200
+ if (this.wsIsLoaded) {
6201
+ this.ws.send(JSON.stringify({ type, subType, message, sessionKey: this.sessionKey }));
6202
+ }
6203
+ }
6204
+ }
6205
+ WebsocketService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: WebsocketService, deps: [{ token: CORE_CONFIG }, { token: StaticDataFacade }], target: i0.ɵɵFactoryTarget.Injectable });
6206
+ WebsocketService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: WebsocketService, providedIn: 'root' });
6207
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: WebsocketService, decorators: [{
6208
+ type: Injectable,
6209
+ args: [{
6210
+ providedIn: 'root'
6211
+ }]
6212
+ }], ctorParameters: function () {
6213
+ return [{ type: undefined, decorators: [{
6214
+ type: Inject,
6215
+ args: [CORE_CONFIG]
6216
+ }] }, { type: StaticDataFacade }];
6217
+ } });
6218
+
6219
+ class RouterFacade {
6220
+ constructor(store) {
6221
+ this.store = store;
6222
+ }
6223
+ goTo(path, extras = null) {
6224
+ console.info('[ router.facade.navigation ]', path, extras);
6225
+ return this.store.dispatch(Go({ payload: { path, extras } }));
6226
+ }
6227
+ }
6228
+ RouterFacade.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RouterFacade, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable });
6229
+ RouterFacade.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RouterFacade, providedIn: "root" });
6230
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RouterFacade, decorators: [{
6231
+ type: Injectable,
6232
+ args: [{ providedIn: "root" }]
6233
+ }], ctorParameters: function () { return [{ type: i1.Store }]; } });
6234
+
6235
+ /*const MESSAGES = {
6236
+ delete: {
6237
+ title: 'Внимание',
6238
+ text: 'Запись успешно удаленна'
6239
+ },
6240
+ update: {
6241
+ title: 'Внимание',
6242
+ text: 'Запись успешно обновлена'
6243
+ },
6244
+ create: {
6245
+ title: 'Внимание',
6246
+ text: 'Запись успешно создана'
6247
+ }
6248
+ };*/
6249
+ class StaticDataEffects extends BaseEffects {
6250
+ constructor(actions$, store, authenticationService, staticDataService, routerService, notificationsFacade) {
6251
+ super(actions$, store);
6252
+ this.actions$ = actions$;
6253
+ this.store = store;
6254
+ this.authenticationService = authenticationService;
6255
+ this.staticDataService = staticDataService;
6256
+ this.routerService = routerService;
6257
+ this.notificationsFacade = notificationsFacade;
6258
+ this.staticDataLoadRevision$ = createEffect(() => this.actions$.pipe(ofType(StaticDataLoadRevisions), mergeMap((action) => {
6259
+ const headers = this.authenticationService.loadAuthDataFromLocalStore();
6260
+ const config = {
6261
+ headers: { token: headers.token, uid: headers.id },
6262
+ };
6263
+ return this.staticDataService.loadRevision(config)
6264
+ .pipe(flatMap((r) => new StaticDataGetListBehavior(action, r).resolve()));
6265
+ })));
6266
+ this.staticDataGetList$ = createEffect(() => this.actions$.pipe(ofType(StaticDataGetList), mergeMap((action) => {
6267
+ const headers = this.authenticationService.loadAuthDataFromLocalStore();
6268
+ const config = Object.assign(Object.assign({}, action.payload), { headers: { token: headers.token, uid: headers.id }, contentType: action.payload.contentType });
6269
+ return this.staticDataService.getList(config)
6270
+ .pipe(flatMap((r) => new StaticDataGetListBehavior(action, r).resolve()));
6271
+ })));
6272
+ this.staticDataGetSubRouting$ = createEffect(() => this.actions$.pipe(ofType(StaticDataGetSubRouting), mergeMap((action) => {
6273
+ const headers = this.authenticationService.loadAuthDataFromLocalStore();
6274
+ const config = Object.assign(Object.assign({}, action.payload), { headers: { token: headers.token, uid: headers.id }, contentType: action.payload.contentType, routing: action.payload.routing });
6275
+ return this.staticDataService.getSubRouting(config)
6276
+ .pipe(flatMap((r) => new StaticDataGetListBehavior(action, r).resolve()));
6277
+ })));
6278
+ this.staticDataDelete$ = createEffect(() => this.actions$.pipe(ofType(StaticDataDelete), switchMap$1((action) => {
6279
+ const headers = this.authenticationService.loadAuthDataFromLocalStore();
6280
+ const config = Object.assign(Object.assign({}, action.payload), { headers: { token: headers.token, uid: headers.id }, contentType: action.payload.contentType, itemId: action.payload.itemId });
6281
+ return this.staticDataService.delete(config)
6282
+ .pipe(flatMap((r) => new StaticDataDeleteBehavior(action, r).resolve()));
6283
+ })));
6284
+ /* @Effect({dispatch: false})
6285
+ StaticDataDeleteSuccess$ = this.actions$.pipe(
6286
+ ofType(StaticDataDeleteSuccess),
6287
+ tap((action) => {
6288
+ const {contentType, itemId} = action.payload;
6289
+ this.routerService.goTo(['/static-data', contentType]);
6290
+ this.notificationsFacade.addNotifications({
6291
+ id: `form-message-delete-${contentType}-${itemId}`,
6292
+ type: 'success',
6293
+ text: MESSAGES.delete.text,
6294
+ title: MESSAGES.delete.title,
6295
+ timeout: NOTIFICATION_TIMEOUT
6296
+ });
6297
+ })
6298
+ );*/
6299
+ this.staticDataCreate$ = createEffect(() => this.actions$.pipe(ofType(StaticDataCreate), switchMap$1((action) => {
6300
+ const headers = this.authenticationService.loadAuthDataFromLocalStore();
6301
+ const config = Object.assign(Object.assign({}, action.payload), { headers: { token: headers.token, uid: headers.id }, formId: action.payload.formId, contentType: action.payload.contentType, publicApi: action.payload.publicApi });
6302
+ return this.staticDataService.create(config)
6303
+ .pipe(flatMap((r) => new StaticDataCreateBehavior(action, r).resolve()));
6304
+ })));
6305
+ /* @Effect({dispatch: false})
6306
+ staticDataCreateSuccess$ = this.actions$.pipe(
6307
+ ofType(StaticDataCreateSuccess),
6308
+ tap((action) => {
6309
+ const {contentType, itemId} = action.payload;
6310
+ this.routerService.goTo(['/static-data', contentType, itemId]);
6311
+ this.notificationsFacade.addNotifications({
6312
+ id: `form-message-create-${contentType}-${itemId}`,
6313
+ type: 'success',
6314
+ text: MESSAGES.create.text,
6315
+ title: MESSAGES.create.title,
6316
+ timeout: NOTIFICATION_TIMEOUT
6317
+ });
6318
+ })
6319
+ );*/
6320
+ this.staticDataUpdate$ = createEffect(() => this.actions$.pipe(ofType(StaticDataUpdate), switchMap$1((action) => {
6321
+ const headers = this.authenticationService.loadAuthDataFromLocalStore();
6322
+ const config = Object.assign(Object.assign({}, action.payload), { headers: { token: headers.token, uid: headers.id }, formId: action.payload.formId, contentType: action.payload.contentType, itemId: action.payload.itemId });
6323
+ return this.staticDataService.update(config)
6324
+ .pipe(flatMap((r) => new StaticDataUpdateBehavior(action, r).resolve()));
6325
+ })));
6326
+ this.staticDataPatchUpdate$ = createEffect(() => this.actions$.pipe(ofType(StaticDataPatchUpdate), switchMap$1((action) => {
6327
+ const headers = this.authenticationService.loadAuthDataFromLocalStore();
6328
+ const config = Object.assign(Object.assign({}, action.payload), { headers: { token: headers.token, uid: headers.id }, formId: action.payload.formId, contentType: action.payload.contentType, itemId: action.payload.itemId });
6329
+ return this.staticDataService.patchUpdate(config)
6330
+ .pipe(flatMap((r) => new StaticDataPatchUpdateBehavior(action, r).resolve()));
6331
+ })));
6332
+ this.staticDataGetListCategories$ = createEffect(() => this.actions$.pipe(ofType(StaticDataGetListCategories), switchMap$1((action) => {
6333
+ const { contentTypes, revisions } = action.payload;
6334
+ const config = {
6335
+ contentTypes,
6336
+ revisions
6337
+ };
6338
+ return this.staticDataService.getListCategories(config)
6339
+ .pipe(flatMap((r) => new StaticDataGetListCategoriesBehavior(action, r).resolve()), catchError(error => of(StaticDataGetListCategoriesFail({
6340
+ payload: {
6341
+ contentTypes: action.payload.contentTypes,
6342
+ }
6343
+ }))));
6344
+ })));
6345
+ }
6346
+ }
6347
+ StaticDataEffects.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: StaticDataEffects, deps: [{ token: i1$2.Actions }, { token: i1.Store }, { token: AuthenticationService }, { token: StaticDataService }, { token: RouterFacade }, { token: NotificationsFacade }], target: i0.ɵɵFactoryTarget.Injectable });
6348
+ StaticDataEffects.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: StaticDataEffects });
6349
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: StaticDataEffects, decorators: [{
6350
+ type: Injectable
6351
+ }], ctorParameters: function () { return [{ type: i1$2.Actions }, { type: i1.Store }, { type: AuthenticationService }, { type: StaticDataService }, { type: RouterFacade }, { type: NotificationsFacade }]; } });
6352
+
6353
+ const ActionsSend = createAction('[Actions] Actions Create', props());
6354
+ const ActionsSendSuccess = createAction('[Actions] Actions Create Success', props());
6355
+ const ActionsSendFail = createAction('[Actions] Actions Create Error', props());
6356
+
6357
+ class ActionsSendBehavior extends Behavior {
6358
+ constructor(action, result) {
6359
+ super(action);
6360
+ this.action = action;
6361
+ this.result = result;
6362
+ }
6363
+ resolve() {
6364
+ const status = this.result.data.status;
6365
+ let returnedActions;
6366
+ const response = this.result.data;
6367
+ const { data } = response.body;
6368
+ switch (status) {
6369
+ case ResponseStatus.STATUS_200: {
6370
+ returnedActions = [
6371
+ ActionsSendSuccess({ payload: Object.assign({}, data) })
6372
+ ];
6373
+ break;
6374
+ }
6375
+ default: {
6376
+ returnedActions = [
6377
+ ActionsSendFail({
6378
+ payload: {
6379
+ error: 'Unhandled error',
6380
+ action: data.action,
6381
+ actionId: data.actionId,
6382
+ }
6065
6383
  })
6066
6384
  ];
6067
6385
  }
@@ -6364,17 +6682,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
6364
6682
  }], ctorParameters: function () { return [{ type: i1$2.Actions }, { type: i1.Store }, { type: AuthenticationService }, { type: ReportsService }]; } });
6365
6683
 
6366
6684
  const getActionsState = createFeatureSelector(STATIC_DATA_FEATURE_KEY);
6367
- const getStatus$1 = (action, actionId) => createSelector(getActionsState, (state) => { var _a, _b; return (_b = (_a = state === null || state === void 0 ? void 0 : state.meta) === null || _a === void 0 ? void 0 : _a[`${action}-${actionId}`]) === null || _b === void 0 ? void 0 : _b.status; });
6368
- const getLoaded$1 = (action, actionId) => createSelector(getActionsState, (state) => { var _a, _b; return (_b = (_a = state === null || state === void 0 ? void 0 : state.meta) === null || _a === void 0 ? void 0 : _a[`${action}-${actionId}`]) === null || _b === void 0 ? void 0 : _b.status; });
6369
- const getError$1 = (action) => createSelector(getActionsState, (state) => { var _a, _b; return (_b = (_a = state === null || state === void 0 ? void 0 : state.meta) === null || _a === void 0 ? void 0 : _a[action]) === null || _b === void 0 ? void 0 : _b.error; });
6685
+ const getStatus = (action, actionId) => createSelector(getActionsState, (state) => { var _a, _b; return (_b = (_a = state === null || state === void 0 ? void 0 : state.meta) === null || _a === void 0 ? void 0 : _a[`${action}-${actionId}`]) === null || _b === void 0 ? void 0 : _b.status; });
6686
+ const getLoaded = (action, actionId) => createSelector(getActionsState, (state) => { var _a, _b; return (_b = (_a = state === null || state === void 0 ? void 0 : state.meta) === null || _a === void 0 ? void 0 : _a[`${action}-${actionId}`]) === null || _b === void 0 ? void 0 : _b.status; });
6687
+ const getError = (action) => createSelector(getActionsState, (state) => { var _a, _b; return (_b = (_a = state === null || state === void 0 ? void 0 : state.meta) === null || _a === void 0 ? void 0 : _a[action]) === null || _b === void 0 ? void 0 : _b.error; });
6370
6688
  const getActionMeta = (action, actionId) => createSelector(getActionsState, (state) => { var _a; return (_a = state.meta) === null || _a === void 0 ? void 0 : _a[`${action}-${actionId}`]; });
6371
6689
  const getActionItem = (action, actionId) => createSelector(getActionsState, (state) => {
6372
6690
  return state.list[`${action}-${actionId}`] || {};
6373
6691
  });
6374
6692
  const actionsQuery = {
6375
- getStatus: getStatus$1,
6376
- getLoaded: getLoaded$1,
6377
- getError: getError$1,
6693
+ getStatus,
6694
+ getLoaded,
6695
+ getError,
6378
6696
  getActionItem,
6379
6697
  getActionMeta
6380
6698
  };
@@ -6534,163 +6852,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
6534
6852
  args: [{ providedIn: "root" }]
6535
6853
  }], ctorParameters: function () { return [{ type: i1.Store }]; } });
6536
6854
 
6537
- const getStaticDataState = createFeatureSelector(STATIC_DATA_FEATURE_KEY$1);
6538
- const getStatus = (contentType, subSection) => createSelector(getStaticDataState, (state) => { var _a, _b, _c; return (_c = (_b = (_a = state === null || state === void 0 ? void 0 : state.meta) === null || _a === void 0 ? void 0 : _a[contentType]) === null || _b === void 0 ? void 0 : _b[subSection]) === null || _c === void 0 ? void 0 : _c.status; });
6539
- const getLoaded = (contentType, subSection) => createSelector(getStaticDataState, (state) => { var _a, _b, _c; return ((_c = (_b = (_a = state === null || state === void 0 ? void 0 : state.meta) === null || _a === void 0 ? void 0 : _a[contentType]) === null || _b === void 0 ? void 0 : _b[subSection]) === null || _c === void 0 ? void 0 : _c.status) === StaticDataMetaStatus$1.LOADED; });
6540
- const getError = (contentType) => createSelector(getStaticDataState, (state) => { var _a, _b; return (_b = (_a = state === null || state === void 0 ? void 0 : state.meta) === null || _a === void 0 ? void 0 : _a[contentType]) === null || _b === void 0 ? void 0 : _b.error; });
6541
- const getStaticDataMeta = (contentType, subSection) => createSelector(getStaticDataState, (state) => { var _a, _b; return (_b = (_a = state.meta) === null || _a === void 0 ? void 0 : _a[contentType]) === null || _b === void 0 ? void 0 : _b[subSection]; });
6542
- const getStaticData = (contentType, subSection, where) => createSelector(getStaticDataState, getLoaded(contentType, subSection), (state, isLoaded) => {
6543
- var _a;
6544
- let list = isLoaded ? (_a = state.list[contentType]) === null || _a === void 0 ? void 0 : _a[subSection] : null;
6545
- if (where && (list === null || list === void 0 ? void 0 : list.length)) {
6546
- list = list.filter(item => {
6547
- let result = true;
6548
- Object.keys(where)
6549
- .forEach(whereItem => {
6550
- if (item[whereItem] !== where[whereItem]) {
6551
- result = false;
6552
- }
6553
- });
6554
- return result;
6555
- });
6556
- }
6557
- return list;
6558
- });
6559
- const getStaticDataForListContentTypes = (contentTypes) => createSelector(getStaticDataState, (state) => {
6560
- let result = {};
6561
- contentTypes.forEach(contentType => {
6562
- var _a;
6563
- result[contentType] = ((_a = state.list[contentType]) === null || _a === void 0 ? void 0 : _a.list) || [];
6564
- });
6565
- return result;
6566
- });
6567
- const getStaticDataItem = (contentType, subSection, itemIdOrSlug) => createSelector(getStaticDataState, (state) => {
6568
- var _a, _b;
6569
- const foundItem = (_b = (_a = state.list[contentType]) === null || _a === void 0 ? void 0 : _a[subSection]) === null || _b === void 0 ? void 0 : _b.find(item => {
6570
- 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;
6571
- }); //
6572
- return foundItem || {};
6573
- });
6574
- const staticDataQuery = {
6575
- getStatus,
6576
- getLoaded,
6577
- getError,
6578
- getStaticData,
6579
- getStaticDataItem,
6580
- getStaticDataMeta,
6581
- getStaticDataForListContentTypes
6582
- };
6583
-
6584
- class StaticDataFacade {
6585
- constructor(store) {
6586
- this.store = store;
6587
- }
6588
- getStatus$(contentType, subSection = 'list') {
6589
- return this.store.pipe(select(staticDataQuery.getStatus(contentType, subSection)));
6590
- }
6591
- getStaticDataMeta$(contentType, subSection = 'list') {
6592
- return this.store.pipe(select(staticDataQuery.getStaticDataMeta(contentType, subSection)));
6593
- }
6594
- getStaticData$(contentType, subSection = 'list', options, where) {
6595
- return this.store.pipe(select(staticDataQuery.getStaticData(contentType, subSection, where)));
6596
- }
6597
- getStaticDataForListContentTypes$(contentTypes) {
6598
- return this.store.pipe(select(staticDataQuery.getStaticDataForListContentTypes(contentTypes)));
6599
- }
6600
- getStaticDataItem$(contentType, subSection = 'list', itemIdOrSlug) {
6601
- return this.store.pipe(select(staticDataQuery.getStaticDataItem(contentType, subSection, itemIdOrSlug)));
6602
- }
6603
- loadStaticData(contentType, params, subSection = 'list') {
6604
- const { where, fields, paging, sort, forPanel, search, keepState } = params;
6605
- this.store.dispatch(StaticDataGetList({
6606
- payload: {
6607
- contentType,
6608
- subSection,
6609
- where,
6610
- fields,
6611
- paging,
6612
- sort,
6613
- forPanel,
6614
- search,
6615
- keepState
6616
- }
6617
- }));
6618
- }
6619
- loadStaticDataSubRouting(contentType, routing) {
6620
- this.store.dispatch(StaticDataGetSubRouting({
6621
- payload: {
6622
- contentType,
6623
- routing
6624
- }
6625
- }));
6626
- }
6627
- clearStaticData(contentType) {
6628
- return this.store.dispatch(ClearStaticData({ payload: { contentType } }));
6629
- }
6630
- delete(contentType, itemId) {
6631
- this.store.dispatch(StaticDataDelete({
6632
- payload: {
6633
- contentType,
6634
- itemId
6635
- }
6636
- }));
6637
- }
6638
- create(formId, contentType, data, publicApi = false) {
6639
- this.store.dispatch(StaticDataCreate({
6640
- payload: {
6641
- formId,
6642
- contentType,
6643
- data,
6644
- publicApi
6645
- }
6646
- }));
6647
- }
6648
- update(formId, contentType, itemId, data, publicApi = false) {
6649
- this.store.dispatch(StaticDataUpdate({
6650
- payload: {
6651
- formId,
6652
- contentType,
6653
- itemId,
6654
- data,
6655
- publicApi
6656
- }
6657
- }));
6658
- }
6659
- updateSuccess(contentType, itemId, data) {
6660
- this.store.dispatch(StaticDataUpdateSuccess({
6661
- payload: {
6662
- contentType,
6663
- itemId,
6664
- data
6665
- }
6666
- }));
6667
- }
6668
- patchUpdate(formId, contentType, itemId, data, publicApi = false) {
6669
- this.store.dispatch(StaticDataPatchUpdate({
6670
- payload: {
6671
- formId,
6672
- contentType,
6673
- itemId,
6674
- data,
6675
- publicApi
6676
- }
6677
- }));
6678
- }
6679
- staticDataLoadCategories(contentTypes) {
6680
- this.store.dispatch(StaticDataGetListCategories({
6681
- payload: {
6682
- contentTypes
6683
- }
6684
- }));
6685
- }
6686
- }
6687
- StaticDataFacade.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: StaticDataFacade, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable });
6688
- StaticDataFacade.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: StaticDataFacade, providedIn: "root" });
6689
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: StaticDataFacade, decorators: [{
6690
- type: Injectable,
6691
- args: [{ providedIn: "root" }]
6692
- }], ctorParameters: function () { return [{ type: i1.Store }]; } });
6693
-
6694
6855
  class FormDeleteFileFacade {
6695
6856
  constructor(store) {
6696
6857
  this.store = store;
@@ -10415,12 +10576,10 @@ class StaticDataListItemsComponent {
10415
10576
  this.staticSection = this.staticDataConfiguration[this.contentType];
10416
10577
  if (this.staticSection) {
10417
10578
  this.userRights$ = this.rightService.getUserRoleRightsForSection('static-data', this.contentType);
10418
- if (this.staticSection) {
10419
- this.title = this.customTitle || ((_a = this.staticSection) === null || _a === void 0 ? void 0 : _a.title) || '';
10420
- this.loadStaticData();
10421
- this.loadStaticDataMeta();
10422
- this.changeDetectorRef.markForCheck();
10423
- }
10579
+ this.title = this.customTitle || ((_a = this.staticSection) === null || _a === void 0 ? void 0 : _a.title) || '';
10580
+ this.loadStaticData();
10581
+ this.loadStaticDataMeta();
10582
+ this.changeDetectorRef.markForCheck();
10424
10583
  }
10425
10584
  else {
10426
10585
  console.error('[ wt-front-shared ][ static-data-items ][ loadData ]', 'NOT_FOUND_STATIC_DATA_SECTION', { contentType: this.contentType });
@@ -10531,10 +10690,10 @@ class StaticDataListItemsComponent {
10531
10690
  }
10532
10691
  }
10533
10692
  StaticDataListItemsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: StaticDataListItemsComponent, deps: [{ token: i1$4.MatDialog }, { token: RightService }, { token: StaticDataFacade }, { token: i0.ChangeDetectorRef }, { token: RouterFacade }], target: i0.ɵɵFactoryTarget.Component });
10534
- StaticDataListItemsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: StaticDataListItemsComponent, selector: "app-static-data-list-items", inputs: { staticDataConfiguration: "staticDataConfiguration", contentType: "contentType", customTitle: "customTitle", addTitle: "addTitle", parentSection: "parentSection", parentItemId: "parentItemId", showPanelHeader: "showPanelHeader", parentData: "parentData", parentSectionHashtag: "parentSectionHashtag", autoCompleteFields: "autoCompleteFields", filteringQuery: "filteringQuery" }, viewQueries: [{ propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true, static: true }, { propertyName: "sort", first: true, predicate: MatSort, descendants: true, static: true }, { propertyName: "searchInput", first: true, predicate: ["search"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"(userRights$ | async) as userRights\">\n <ng-container *ngIf=\"(staticDataMeta$ | async) as staticDataObj\">\n <div class=\"page-layout simple fullwidth angular-material-elements\">\n <shared-panel-header *ngIf=\"showPanelHeader\" [title]=\"title\"></shared-panel-header>\n\n <h1>{{title}}</h1>\n <div class=\"content p-24\">\n <div *ngIf=\"staticSection.options?.search\" class=\"top-bar\">\n <div class=\"search-block\">\n \u041F\u043E\u0438\u0441\u043A:&nbsp; <input #search class=\"search-input\">\n <shared-button\n icon=\"search\"\n color=\"accent\"\n iconColor=\"black\"\n (click)=\"searchHandle(search.value)\"></shared-button>\n <div class=\"cancel-button\">\n <shared-button\n *ngIf=\"search.value\"\n icon=\"clear\"\n color=\"warn\"\n iconColor=\"black\"\n (click)=\"searchCancelHandle()\"></shared-button>\n </div>\n </div>\n </div>\n <ng-container *ngIf=\"staticData$ | async as staticData\">\n <div class=\"center-block p-10\">\n <app-static-data-items [items]=\"staticData\"\n [userRights]=\"userRights\"\n [staticSection]=\"staticSection\"\n [contentType]=\"contentType\"\n [queryParams]=\"queryParams\"\n (delete)=\"deleteEvent($event)\"></app-static-data-items>\n </div>\n <div *ngIf=\"staticDataObj.meta.perPage !== -1\">\n <mat-paginator\n *ngIf=\"totalCount\"\n [length]=\"staticDataObj.meta.totalCount\"\n [pageIndex]=\"pageIndex\"\n [pageSizeOptions]=\"[10, 25, 100]\"\n (page)=\"changePage($event)\"></mat-paginator>\n </div>\n </ng-container>\n <div *ngIf=\"isLoaded && !totalCount\">\u0421\u043F\u0438\u0441\u043E\u043A \u043F\u0443\u0441\u0442</div>\n <div *ngIf=\"userRights[0]\" class=\"text-center mt-30 mb-30\">\n <shared-button\n id=\"go-to-create-form-button\"\n class=\"mr-5\"\n iconSize=\"small\"\n icon=\"add\"\n iconColor=\"white\"\n styleTheme=\"raised\"\n color=\"accent\"\n (click)=\"addHandle()\">{{ addTitle || '\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C' }}\n </shared-button>\n </div>\n </div>\n <ng-container *ngIf=\"loaded$|async; let loaded;\">\n <shared-spinner *ngIf=\"!loaded\"></shared-spinner>\n </ng-container>\n </div>\n </ng-container>\n</ng-container>\n", styles: [".top-bar{background:#c7deef;display:flex;justify-content:flex-end}.top-bar .search-block{display:flex;align-content:center;align-items:center}.top-bar .search-block .search-input{background-color:#adcde8!important;padding:11px 10px!important}.top-bar .search-block .cancel-button{width:64px;height:40px}\n"], dependencies: [{ kind: "directive", type: i1$3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6$3.MatPaginator, selector: "mat-paginator", inputs: ["disabled"], exportAs: ["matPaginator"] }, { kind: "component", type: SpinnerComponent, selector: "shared-spinner", inputs: ["overlay", "diameter", "color", "position"] }, { kind: "component", type: ButtonComponent, selector: "shared-button", inputs: ["icon", "iconColor", "iconSize", "rightIcon", "disabled", "loading", "active", "stopPropagation", "type", "color", "size", "styleTheme", "tooltip", "tooltipPosition"], outputs: ["clickButton"] }, { kind: "component", type: PanelHeaderComponent, selector: "shared-panel-header", inputs: ["title", "parentTitle", "parentUrl"] }, { kind: "component", type: StaticDataItemsComponent, selector: "app-static-data-items", inputs: ["items", "contentType", "queryParams", "userRights", "staticSection"], outputs: ["delete"] }, { kind: "pipe", type: i1$3.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
10693
+ StaticDataListItemsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: StaticDataListItemsComponent, selector: "app-static-data-list-items", inputs: { staticDataConfiguration: "staticDataConfiguration", contentType: "contentType", customTitle: "customTitle", addTitle: "addTitle", parentSection: "parentSection", parentItemId: "parentItemId", showPanelHeader: "showPanelHeader", parentData: "parentData", parentSectionHashtag: "parentSectionHashtag", autoCompleteFields: "autoCompleteFields", filteringQuery: "filteringQuery" }, viewQueries: [{ propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true, static: true }, { propertyName: "sort", first: true, predicate: MatSort, descendants: true, static: true }, { propertyName: "searchInput", first: true, predicate: ["search"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"(userRights$ | async) as userRights\">\n <ng-container *ngIf=\"(staticDataMeta$ | async) as staticDataObj\">\n <div class=\"page-layout simple fullwidth angular-material-elements\">\n <shared-panel-header *ngIf=\"showPanelHeader\" [title]=\"title\"></shared-panel-header>\n\n <h1>{{title}}</h1>\n <div class=\"content p-24\">\n <div *ngIf=\"staticSection.options?.search\" class=\"top-bar\">\n <div class=\"search-block\">\n \u041F\u043E\u0438\u0441\u043A:&nbsp; <input #search class=\"search-input\">\n <shared-button\n icon=\"search\"\n color=\"accent\"\n iconColor=\"black\"\n (click)=\"searchHandle(search.value)\"></shared-button>\n <div class=\"cancel-button\">\n <shared-button\n *ngIf=\"search.value\"\n icon=\"clear\"\n color=\"warn\"\n iconColor=\"black\"\n (click)=\"searchCancelHandle()\"></shared-button>\n </div>\n </div>\n </div>\n <ng-container *ngIf=\"staticData$ | async as staticData\">\n <div class=\"center-block p-10\">\n <app-static-data-items [items]=\"staticData\"\n [userRights]=\"userRights\"\n [staticSection]=\"staticSection\"\n [contentType]=\"contentType\"\n [queryParams]=\"queryParams\"\n (delete)=\"deleteEvent($event)\"></app-static-data-items>\n </div>\n <div *ngIf=\"staticDataObj.meta?.perPage !== -1\">\n <mat-paginator\n *ngIf=\"totalCount\"\n [length]=\"staticDataObj.meta?.totalCount\"\n [pageIndex]=\"pageIndex\"\n [pageSizeOptions]=\"[10, 25, 100]\"\n (page)=\"changePage($event)\"></mat-paginator>\n </div>\n </ng-container>\n <div *ngIf=\"isLoaded && !totalCount\">\u0421\u043F\u0438\u0441\u043E\u043A \u043F\u0443\u0441\u0442</div>\n <div *ngIf=\"userRights[0]\" class=\"text-center mt-30 mb-30\">\n <shared-button\n id=\"go-to-create-form-button\"\n class=\"mr-5\"\n iconSize=\"small\"\n icon=\"add\"\n iconColor=\"white\"\n styleTheme=\"raised\"\n color=\"accent\"\n (click)=\"addHandle()\">{{ addTitle || '\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C' }}\n </shared-button>\n </div>\n </div>\n <ng-container *ngIf=\"loaded$|async; let loaded;\">\n <shared-spinner *ngIf=\"!loaded\"></shared-spinner>\n </ng-container>\n </div>\n </ng-container>\n</ng-container>\n", styles: [".top-bar{background:#c7deef;display:flex;justify-content:flex-end}.top-bar .search-block{display:flex;align-content:center;align-items:center}.top-bar .search-block .search-input{background-color:#adcde8!important;padding:11px 10px!important}.top-bar .search-block .cancel-button{width:64px;height:40px}\n"], dependencies: [{ kind: "directive", type: i1$3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6$3.MatPaginator, selector: "mat-paginator", inputs: ["disabled"], exportAs: ["matPaginator"] }, { kind: "component", type: SpinnerComponent, selector: "shared-spinner", inputs: ["overlay", "diameter", "color", "position"] }, { kind: "component", type: ButtonComponent, selector: "shared-button", inputs: ["icon", "iconColor", "iconSize", "rightIcon", "disabled", "loading", "active", "stopPropagation", "type", "color", "size", "styleTheme", "tooltip", "tooltipPosition"], outputs: ["clickButton"] }, { kind: "component", type: PanelHeaderComponent, selector: "shared-panel-header", inputs: ["title", "parentTitle", "parentUrl"] }, { kind: "component", type: StaticDataItemsComponent, selector: "app-static-data-items", inputs: ["items", "contentType", "queryParams", "userRights", "staticSection"], outputs: ["delete"] }, { kind: "pipe", type: i1$3.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
10535
10694
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: StaticDataListItemsComponent, decorators: [{
10536
10695
  type: Component,
10537
- args: [{ selector: 'app-static-data-list-items', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"(userRights$ | async) as userRights\">\n <ng-container *ngIf=\"(staticDataMeta$ | async) as staticDataObj\">\n <div class=\"page-layout simple fullwidth angular-material-elements\">\n <shared-panel-header *ngIf=\"showPanelHeader\" [title]=\"title\"></shared-panel-header>\n\n <h1>{{title}}</h1>\n <div class=\"content p-24\">\n <div *ngIf=\"staticSection.options?.search\" class=\"top-bar\">\n <div class=\"search-block\">\n \u041F\u043E\u0438\u0441\u043A:&nbsp; <input #search class=\"search-input\">\n <shared-button\n icon=\"search\"\n color=\"accent\"\n iconColor=\"black\"\n (click)=\"searchHandle(search.value)\"></shared-button>\n <div class=\"cancel-button\">\n <shared-button\n *ngIf=\"search.value\"\n icon=\"clear\"\n color=\"warn\"\n iconColor=\"black\"\n (click)=\"searchCancelHandle()\"></shared-button>\n </div>\n </div>\n </div>\n <ng-container *ngIf=\"staticData$ | async as staticData\">\n <div class=\"center-block p-10\">\n <app-static-data-items [items]=\"staticData\"\n [userRights]=\"userRights\"\n [staticSection]=\"staticSection\"\n [contentType]=\"contentType\"\n [queryParams]=\"queryParams\"\n (delete)=\"deleteEvent($event)\"></app-static-data-items>\n </div>\n <div *ngIf=\"staticDataObj.meta.perPage !== -1\">\n <mat-paginator\n *ngIf=\"totalCount\"\n [length]=\"staticDataObj.meta.totalCount\"\n [pageIndex]=\"pageIndex\"\n [pageSizeOptions]=\"[10, 25, 100]\"\n (page)=\"changePage($event)\"></mat-paginator>\n </div>\n </ng-container>\n <div *ngIf=\"isLoaded && !totalCount\">\u0421\u043F\u0438\u0441\u043E\u043A \u043F\u0443\u0441\u0442</div>\n <div *ngIf=\"userRights[0]\" class=\"text-center mt-30 mb-30\">\n <shared-button\n id=\"go-to-create-form-button\"\n class=\"mr-5\"\n iconSize=\"small\"\n icon=\"add\"\n iconColor=\"white\"\n styleTheme=\"raised\"\n color=\"accent\"\n (click)=\"addHandle()\">{{ addTitle || '\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C' }}\n </shared-button>\n </div>\n </div>\n <ng-container *ngIf=\"loaded$|async; let loaded;\">\n <shared-spinner *ngIf=\"!loaded\"></shared-spinner>\n </ng-container>\n </div>\n </ng-container>\n</ng-container>\n", styles: [".top-bar{background:#c7deef;display:flex;justify-content:flex-end}.top-bar .search-block{display:flex;align-content:center;align-items:center}.top-bar .search-block .search-input{background-color:#adcde8!important;padding:11px 10px!important}.top-bar .search-block .cancel-button{width:64px;height:40px}\n"] }]
10696
+ args: [{ selector: 'app-static-data-list-items', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"(userRights$ | async) as userRights\">\n <ng-container *ngIf=\"(staticDataMeta$ | async) as staticDataObj\">\n <div class=\"page-layout simple fullwidth angular-material-elements\">\n <shared-panel-header *ngIf=\"showPanelHeader\" [title]=\"title\"></shared-panel-header>\n\n <h1>{{title}}</h1>\n <div class=\"content p-24\">\n <div *ngIf=\"staticSection.options?.search\" class=\"top-bar\">\n <div class=\"search-block\">\n \u041F\u043E\u0438\u0441\u043A:&nbsp; <input #search class=\"search-input\">\n <shared-button\n icon=\"search\"\n color=\"accent\"\n iconColor=\"black\"\n (click)=\"searchHandle(search.value)\"></shared-button>\n <div class=\"cancel-button\">\n <shared-button\n *ngIf=\"search.value\"\n icon=\"clear\"\n color=\"warn\"\n iconColor=\"black\"\n (click)=\"searchCancelHandle()\"></shared-button>\n </div>\n </div>\n </div>\n <ng-container *ngIf=\"staticData$ | async as staticData\">\n <div class=\"center-block p-10\">\n <app-static-data-items [items]=\"staticData\"\n [userRights]=\"userRights\"\n [staticSection]=\"staticSection\"\n [contentType]=\"contentType\"\n [queryParams]=\"queryParams\"\n (delete)=\"deleteEvent($event)\"></app-static-data-items>\n </div>\n <div *ngIf=\"staticDataObj.meta?.perPage !== -1\">\n <mat-paginator\n *ngIf=\"totalCount\"\n [length]=\"staticDataObj.meta?.totalCount\"\n [pageIndex]=\"pageIndex\"\n [pageSizeOptions]=\"[10, 25, 100]\"\n (page)=\"changePage($event)\"></mat-paginator>\n </div>\n </ng-container>\n <div *ngIf=\"isLoaded && !totalCount\">\u0421\u043F\u0438\u0441\u043E\u043A \u043F\u0443\u0441\u0442</div>\n <div *ngIf=\"userRights[0]\" class=\"text-center mt-30 mb-30\">\n <shared-button\n id=\"go-to-create-form-button\"\n class=\"mr-5\"\n iconSize=\"small\"\n icon=\"add\"\n iconColor=\"white\"\n styleTheme=\"raised\"\n color=\"accent\"\n (click)=\"addHandle()\">{{ addTitle || '\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C' }}\n </shared-button>\n </div>\n </div>\n <ng-container *ngIf=\"loaded$|async; let loaded;\">\n <shared-spinner *ngIf=\"!loaded\"></shared-spinner>\n </ng-container>\n </div>\n </ng-container>\n</ng-container>\n", styles: [".top-bar{background:#c7deef;display:flex;justify-content:flex-end}.top-bar .search-block{display:flex;align-content:center;align-items:center}.top-bar .search-block .search-input{background-color:#adcde8!important;padding:11px 10px!important}.top-bar .search-block .cancel-button{width:64px;height:40px}\n"] }]
10538
10697
  }], ctorParameters: function () { return [{ type: i1$4.MatDialog }, { type: RightService }, { type: StaticDataFacade }, { type: i0.ChangeDetectorRef }, { type: RouterFacade }]; }, propDecorators: { staticDataConfiguration: [{
10539
10698
  type: Input
10540
10699
  }], contentType: [{
@@ -12451,5 +12610,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
12451
12610
  * Generated bundle index. Do not edit.
12452
12611
  */
12453
12612
 
12454
- 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, PatchRequest, 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, StaticDataComponentInputData, 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, StaticDataModule, StaticDataPartUpdate, StaticDataPatchUpdate, StaticDataPatchUpdateFail, StaticDataPatchUpdateSuccess, 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 };
12613
+ 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, PatchRequest, 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, StaticDataComponentInputData, 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, StaticDataLoadRevisions, StaticDataMetaStatus, StaticDataModel, StaticDataModule, StaticDataNewRevisions, StaticDataPartUpdate, StaticDataPatchUpdate, StaticDataPatchUpdateFail, StaticDataPatchUpdateSuccess, 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 };
12455
12614
  //# sourceMappingURL=wt-front-shared.mjs.map