wt-front-shared 1.0.64 → 1.0.65

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 (37) 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 +10 -2
  4. package/esm2020/lib/core/+state/static-data/static-data.facade.mjs +42 -18
  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 +21 -3
  7. package/esm2020/lib/core/components/static-data/components/static-data-list-items/static-data-list-items.component.mjs +3 -3
  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-load-revisions/index.mjs +2 -0
  16. package/esm2020/lib/models/endpoints/static-data/static-data-load-revisions/request/index.mjs +2 -0
  17. package/esm2020/lib/models/endpoints/static-data/static-data-load-revisions/request/static-data-load-revisions-request-config.mjs +2 -0
  18. package/esm2020/lib/models/endpoints/static-data/static-data-load-revisions/request/static-data-load-revisions-request.mjs +21 -0
  19. package/fesm2015/wt-front-shared.mjs +516 -395
  20. package/fesm2015/wt-front-shared.mjs.map +1 -1
  21. package/fesm2020/wt-front-shared.mjs +512 -395
  22. package/fesm2020/wt-front-shared.mjs.map +1 -1
  23. package/lib/core/+state/index.d.ts +1 -1
  24. package/lib/core/+state/static-data/static-data.actions.d.ts +17 -0
  25. package/lib/core/+state/static-data/static-data.effects.d.ts +1 -0
  26. package/lib/core/+state/static-data/static-data.facade.d.ts +9 -3
  27. package/lib/core/+state/static-data/static-data.reducer.d.ts +3 -0
  28. package/lib/core/+state/static-data/static-data.selectors.d.ts +2 -0
  29. package/lib/core/services/static-data/static-data.service.d.ts +2 -0
  30. package/lib/core/services/websocket.service.d.ts +4 -2
  31. package/lib/models/endpoints/static-data/static-data-endpoint-types.d.ts +1 -0
  32. package/lib/models/endpoints/static-data/static-data-get-list/request/static-data-get-list-request-config.d.ts +1 -0
  33. package/lib/models/endpoints/static-data/static-data-load-revisions/index.d.ts +1 -0
  34. package/lib/models/endpoints/static-data/static-data-load-revisions/request/index.d.ts +2 -0
  35. package/lib/models/endpoints/static-data/static-data-load-revisions/request/static-data-load-revisions-request-config.d.ts +4 -0
  36. package/lib/models/endpoints/static-data/static-data-load-revisions/request/static-data-load-revisions-request.d.ts +11 -0
  37. 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() {
@@ -4707,6 +4711,8 @@ const ClearStaticData = createAction('[StaticData] Clear StaticData', props());
4707
4711
  const StaticDataGetSubRouting = createAction('[StaticData] StaticData Get Sub routing', props());
4708
4712
  const StaticDataGetSubRoutingSuccess = createAction('[StaticData] StaticData Get Sub routing Success', props());
4709
4713
  const StaticDataGetSubRoutingFail = createAction('[StaticData] StaticData Get Sub routing Fail', props());
4714
+ const StaticDataNewRevisions = createAction('[StaticData] StaticDataNewRevisions', props());
4715
+ const StaticDataLoadRevisions = createAction('[StaticData] StaticDataLoadRevisions', props());
4710
4716
 
4711
4717
  class StaticDataGetListBehavior extends Behavior {
4712
4718
  constructor(action, result) {
@@ -4726,7 +4732,7 @@ class StaticDataGetListBehavior extends Behavior {
4726
4732
  if (data) {
4727
4733
  returnedActions = [
4728
4734
  StaticDataGetListSuccess({
4729
- payload: { data, meta, keepState: actionPayload.keepState }
4735
+ payload: { data, meta, keepState: actionPayload === null || actionPayload === void 0 ? void 0 : actionPayload.keepState }
4730
4736
  })
4731
4737
  ];
4732
4738
  }
@@ -5462,6 +5468,26 @@ class StaticDataPatchUpdateRequest extends PatchRequest {
5462
5468
  }
5463
5469
  }
5464
5470
 
5471
+ class StaticDataLoadRevisionsRequest extends GetRequest {
5472
+ constructor(domain, config) {
5473
+ super(domain);
5474
+ this.domain = domain;
5475
+ this.config = config;
5476
+ }
5477
+ get url() {
5478
+ return `${this.domain}/api/static-data/revisions`;
5479
+ }
5480
+ get headers() {
5481
+ return this.addAuthHeaders(this.config.headers);
5482
+ }
5483
+ get params() {
5484
+ return null;
5485
+ }
5486
+ get body() {
5487
+ return null;
5488
+ }
5489
+ }
5490
+
5465
5491
  class StaticDataApi extends BaseAPI {
5466
5492
  constructor(domain) {
5467
5493
  super(domain);
@@ -5470,6 +5496,9 @@ class StaticDataApi extends BaseAPI {
5470
5496
  createRequest(paramsConfig, endPointType) {
5471
5497
  let request;
5472
5498
  switch (endPointType) {
5499
+ case StaticDataEndpointTypes.LOAD_REVISION:
5500
+ request = new StaticDataLoadRevisionsRequest(this.domain, paramsConfig);
5501
+ break;
5473
5502
  case StaticDataEndpointTypes.GET_LIST:
5474
5503
  request = new StaticDataGetListRequest(this.domain, paramsConfig);
5475
5504
  break;
@@ -5513,6 +5542,9 @@ class StaticDataService extends BaseAPIService {
5513
5542
  this.formsFacade = formsFacade;
5514
5543
  this.api = new StaticDataApi(this.config.apiUrl);
5515
5544
  }
5545
+ loadRevision(config) {
5546
+ return this.doRequest(config, StaticDataEndpointTypes.LOAD_REVISION);
5547
+ }
5516
5548
  getList(config) {
5517
5549
  return this.doRequest(config, StaticDataEndpointTypes.GET_LIST);
5518
5550
  }
@@ -5662,204 +5694,6 @@ const StorageProvider = {
5662
5694
  useFactory: cookiesProviderFactory,
5663
5695
  };
5664
5696
 
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
5697
  const STATIC_DATA_FEATURE_KEY$1 = 'staticData';
5864
5698
  var StaticDataMetaStatus$1;
5865
5699
  (function (StaticDataMetaStatus) {
@@ -5868,7 +5702,8 @@ var StaticDataMetaStatus$1;
5868
5702
  })(StaticDataMetaStatus$1 || (StaticDataMetaStatus$1 = {}));
5869
5703
  const initialState$3 = {
5870
5704
  list: {},
5871
- meta: {}
5705
+ meta: {},
5706
+ revisions: null
5872
5707
  };
5873
5708
  const _staticDataReducer$2 = createReducer(initialState$3, on(StaticDataGetList, (state, action) => {
5874
5709
  var _a, _b, _c;
@@ -6024,6 +5859,37 @@ const _staticDataReducer$2 = createReducer(initialState$3, on(StaticDataGetList,
6024
5859
  newState.meta[contentType] = Object.assign(Object.assign({}, newState.meta[contentType]), { list: Object.assign(Object.assign({}, newState.meta[contentType]['list']), { status: StaticDataMetaStatus$1.LOADED }) });
6025
5860
  });
6026
5861
  return newState;
5862
+ }), on(StaticDataNewRevisions, (state, action) => {
5863
+ var _a, _b;
5864
+ const { data } = action.payload;
5865
+ const newState = {
5866
+ list: Object.assign({}, state.list),
5867
+ meta: Object.assign({}, state.meta)
5868
+ };
5869
+ const newDataKeys = data.map(item => item.staticDataKey);
5870
+ if (data === null || data === void 0 ? void 0 : data.length) {
5871
+ if (!((_a = newState.list) === null || _a === void 0 ? void 0 : _a.revisions)) {
5872
+ newState.list['revisions'] = { list: [] };
5873
+ }
5874
+ else {
5875
+ if ((_b = newState.list['revisions']) === null || _b === void 0 ? void 0 : _b.list) {
5876
+ const newList = newState.list['revisions'].list
5877
+ .filter(item => !newDataKeys.includes(item.staticDataKey));
5878
+ if (newList) {
5879
+ newState.list['revisions'] = { list: [...newList] };
5880
+ }
5881
+ }
5882
+ }
5883
+ data.forEach(item => {
5884
+ const contentType = item.staticDataKey;
5885
+ newState.list['revisions'].list.push({
5886
+ slug: contentType,
5887
+ staticDataKey: contentType,
5888
+ revision: item.revision
5889
+ });
5890
+ });
5891
+ }
5892
+ return newState;
6027
5893
  }));
6028
5894
  function staticDataReducer(state, action) {
6029
5895
  return _staticDataReducer$2(state, action);
@@ -6032,34 +5898,446 @@ function getFormKey$1(contentType, itemId) {
6032
5898
  return `${contentType}-${itemId || '*'}`;
6033
5899
  }
6034
5900
 
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;
5901
+ const getStaticDataState = createFeatureSelector(STATIC_DATA_FEATURE_KEY$1);
5902
+ 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; });
5903
+ 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; });
5904
+ 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; });
5905
+ const getStaticDataMeta = (contentType, subSection) => createSelector(getStaticDataState, (state) => {
5906
+ var _a, _b;
5907
+ return (_b = (_a = state.meta) === null || _a === void 0 ? void 0 : _a[contentType]) === null || _b === void 0 ? void 0 : _b[subSection];
5908
+ });
5909
+ const getStaticDataRevisions = () => createSelector(getStaticDataState, (state) => {
5910
+ var _a, _b;
5911
+ let result = [];
5912
+ if ((_a = state.list['revisions']) === null || _a === void 0 ? void 0 : _a['list']) {
5913
+ result = (_b = state.list['revisions']) === null || _b === void 0 ? void 0 : _b['list'];
6044
5914
  }
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,
5915
+ return result;
5916
+ });
5917
+ const getStaticDataRevision = (contentType) => createSelector(getStaticDataState, (state) => {
5918
+ var _a, _b, _c, _d;
5919
+ let result = null;
5920
+ if ((_b = (_a = state.list) === null || _a === void 0 ? void 0 : _a.revisions) === null || _b === void 0 ? void 0 : _b.list) {
5921
+ 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);
5922
+ }
5923
+ return result;
5924
+ });
5925
+ const getStaticData = (contentType, subSection, where) => createSelector(getStaticDataState, getLoaded$1(contentType, subSection), (state, isLoaded) => {
5926
+ var _a;
5927
+ let list = isLoaded ? (_a = state.list[contentType]) === null || _a === void 0 ? void 0 : _a[subSection] : null;
5928
+ if (where && (list === null || list === void 0 ? void 0 : list.length)) {
5929
+ list = list.filter(item => {
5930
+ let result = true;
5931
+ Object.keys(where)
5932
+ .forEach(whereItem => {
5933
+ if (item[whereItem] !== where[whereItem]) {
5934
+ result = false;
5935
+ }
5936
+ });
5937
+ return result;
5938
+ });
5939
+ }
5940
+ return list;
5941
+ });
5942
+ const getStaticDataForListContentTypes = (contentTypes) => createSelector(getStaticDataState, (state) => {
5943
+ let result = {};
5944
+ contentTypes.forEach(contentType => {
5945
+ var _a;
5946
+ result[contentType] = ((_a = state.list[contentType]) === null || _a === void 0 ? void 0 : _a.list) || [];
5947
+ });
5948
+ return result;
5949
+ });
5950
+ const getStaticDataItem = (contentType, subSection, itemIdOrSlug) => createSelector(getStaticDataState, (state) => {
5951
+ var _a, _b;
5952
+ const foundItem = (_b = (_a = state.list[contentType]) === null || _a === void 0 ? void 0 : _a[subSection]) === null || _b === void 0 ? void 0 : _b.find(item => {
5953
+ 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;
5954
+ }); //
5955
+ return foundItem || {};
5956
+ });
5957
+ const staticDataQuery = {
5958
+ getStatus: getStatus$1,
5959
+ getLoaded: getLoaded$1,
5960
+ getError: getError$1,
5961
+ getStaticData,
5962
+ getStaticDataItem,
5963
+ getStaticDataMeta,
5964
+ getStaticDataForListContentTypes,
5965
+ getStaticDataRevision,
5966
+ getStaticDataRevisions
5967
+ };
5968
+
5969
+ class StaticDataFacade {
5970
+ constructor(store) {
5971
+ this.store = store;
5972
+ }
5973
+ getStatus$(contentType, subSection = 'list') {
5974
+ return this.store.pipe(select(staticDataQuery.getStatus(contentType, subSection)));
5975
+ }
5976
+ getStaticDataMeta$(contentType, subSection = 'list') {
5977
+ return this.store.pipe(select(staticDataQuery.getStaticDataMeta(contentType, subSection)));
5978
+ }
5979
+ getStaticData$(contentType, subSection = 'list', options, where) {
5980
+ return this.store.pipe(select(staticDataQuery.getStaticData(contentType, subSection, where)));
5981
+ }
5982
+ getStaticDataForListContentTypes$(contentTypes) {
5983
+ return this.store.pipe(select(staticDataQuery.getStaticDataForListContentTypes(contentTypes)));
5984
+ }
5985
+ getStaticDataItem$(contentType, subSection = 'list', itemIdOrSlug) {
5986
+ return this.store.pipe(select(staticDataQuery.getStaticDataItem(contentType, subSection, itemIdOrSlug)));
5987
+ }
5988
+ getStaticDataRevision(contentType) {
5989
+ return new Promise((resolve, reject) => {
5990
+ this.store.pipe(select(staticDataQuery.getStaticDataRevision(contentType)))
5991
+ .pipe(take(1))
5992
+ .subscribe(revisionData => {
5993
+ resolve((revisionData === null || revisionData === void 0 ? void 0 : revisionData.revision) || null);
5994
+ });
5995
+ });
5996
+ }
5997
+ loadStaticData(contentType, params, subSection = 'list') {
5998
+ const { where, fields, paging, sort, forPanel, search, keepState } = params;
5999
+ this.getStaticDataRevision(contentType)
6000
+ .then(revision => {
6001
+ this.store.dispatch(StaticDataGetList({
6002
+ payload: {
6003
+ contentType,
6004
+ subSection,
6005
+ where,
6006
+ fields,
6007
+ paging,
6008
+ sort,
6009
+ forPanel,
6010
+ search,
6011
+ keepState,
6012
+ revision
6013
+ }
6014
+ }));
6015
+ });
6016
+ }
6017
+ loadStaticDataSubRouting(contentType, routing) {
6018
+ this.store.dispatch(StaticDataGetSubRouting({
6019
+ payload: {
6020
+ contentType,
6021
+ routing
6022
+ }
6023
+ }));
6024
+ }
6025
+ loadStaticDataRevisions() {
6026
+ this.store.dispatch(StaticDataLoadRevisions({
6027
+ payload: null
6028
+ }));
6029
+ }
6030
+ clearStaticData(contentType) {
6031
+ return this.store.dispatch(ClearStaticData({ payload: { contentType } }));
6032
+ }
6033
+ delete(contentType, itemId) {
6034
+ this.store.dispatch(StaticDataDelete({
6035
+ payload: {
6036
+ contentType,
6037
+ itemId
6038
+ }
6039
+ }));
6040
+ }
6041
+ newRevisions(newRevisions) {
6042
+ this.store.dispatch(StaticDataNewRevisions({
6043
+ payload: { data: newRevisions }
6044
+ }));
6045
+ }
6046
+ create(formId, contentType, data, publicApi = false) {
6047
+ this.store.dispatch(StaticDataCreate({
6048
+ payload: {
6049
+ formId,
6050
+ contentType,
6051
+ data,
6052
+ publicApi
6053
+ }
6054
+ }));
6055
+ }
6056
+ update(formId, contentType, itemId, data, publicApi = false) {
6057
+ this.store.dispatch(StaticDataUpdate({
6058
+ payload: {
6059
+ formId,
6060
+ contentType,
6061
+ itemId,
6062
+ data,
6063
+ publicApi
6064
+ }
6065
+ }));
6066
+ }
6067
+ updateSuccess(contentType, itemId, data) {
6068
+ this.store.dispatch(StaticDataUpdateSuccess({
6069
+ payload: {
6070
+ contentType,
6071
+ itemId,
6072
+ data
6073
+ }
6074
+ }));
6075
+ }
6076
+ patchUpdate(formId, contentType, itemId, data, publicApi = false) {
6077
+ this.store.dispatch(StaticDataPatchUpdate({
6078
+ payload: {
6079
+ formId,
6080
+ contentType,
6081
+ itemId,
6082
+ data,
6083
+ publicApi
6084
+ }
6085
+ }));
6086
+ }
6087
+ staticDataLoadCategories(contentTypes) {
6088
+ this.store.dispatch(StaticDataGetListCategories({
6089
+ payload: {
6090
+ contentTypes
6091
+ }
6092
+ }));
6093
+ }
6094
+ }
6095
+ StaticDataFacade.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: StaticDataFacade, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable });
6096
+ StaticDataFacade.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: StaticDataFacade, providedIn: 'root' });
6097
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: StaticDataFacade, decorators: [{
6098
+ type: Injectable,
6099
+ args: [{ providedIn: 'root' }]
6100
+ }], ctorParameters: function () { return [{ type: i1.Store }]; } });
6101
+
6102
+ var WebsocketMessageTypes;
6103
+ (function (WebsocketMessageTypes) {
6104
+ WebsocketMessageTypes["USER_ACTIVITY"] = "user-activity";
6105
+ })(WebsocketMessageTypes || (WebsocketMessageTypes = {}));
6106
+ var WebsocketMessageSubTypes;
6107
+ (function (WebsocketMessageSubTypes) {
6108
+ WebsocketMessageSubTypes["CHANGE_PAGE"] = "change-page";
6109
+ WebsocketMessageSubTypes["OPEN_BOOKING_FORM"] = "open-booking-form";
6110
+ WebsocketMessageSubTypes["OPEN_FIRM_CONTACT"] = "open-firm-contact";
6111
+ })(WebsocketMessageSubTypes || (WebsocketMessageSubTypes = {}));
6112
+ class WebsocketService {
6113
+ constructor(config, staticDataFacade) {
6114
+ this.config = config;
6115
+ this.staticDataFacade = staticDataFacade;
6116
+ this.wsIsLoaded = false;
6117
+ this.maxNumbersOfReloads = 10;
6118
+ this.numbersOfReloads = 0;
6119
+ this.connectToWebSocket();
6120
+ }
6121
+ connectToWebSocket() {
6122
+ if ('WebSocket' in window) {
6123
+ this.ws = new WebSocket(this.config.websocketUrl);
6124
+ this.ws.onopen = () => {
6125
+ this.numbersOfReloads = 0;
6126
+ console.info('[ WS ][ Connection opened ]', this.sessionKey || '', this.config.websocketUrl);
6127
+ this.wsIsLoaded = true;
6128
+ };
6129
+ this.ws.onmessage = (event) => {
6130
+ let message;
6131
+ try {
6132
+ message = JSON.parse(event.data);
6133
+ }
6134
+ catch (e) {
6135
+ console.error('[ WS ][ Incorrect message ]', { message: event.data, error: e });
6136
+ }
6137
+ if (message === null || message === void 0 ? void 0 : message.revisions) {
6138
+ console.info('[ WS ][ New revisions ]', message.revisions);
6139
+ this.staticDataFacade.newRevisions(message.revisions);
6140
+ }
6141
+ if (message && !this.sessionKey) {
6142
+ if (message === null || message === void 0 ? void 0 : message.sessionKey) {
6143
+ this.sessionKey = message.sessionKey;
6144
+ }
6145
+ console.info('[ WS ][ Message received ]', this.sessionKey, message);
6146
+ }
6147
+ };
6148
+ this.ws.onclose = () => {
6149
+ console.info('[ WS ][ Connection closed ]');
6150
+ this.wsIsLoaded = false;
6151
+ setTimeout(() => {
6152
+ if (this.numbersOfReloads < this.maxNumbersOfReloads) {
6153
+ this.numbersOfReloads++;
6154
+ this.connectToWebSocket();
6155
+ }
6156
+ }, 10000);
6157
+ };
6158
+ }
6159
+ }
6160
+ wsSentMessage(type, subType, message) {
6161
+ if (this.wsIsLoaded) {
6162
+ this.ws.send(JSON.stringify({ type, subType, message, sessionKey: this.sessionKey }));
6163
+ }
6164
+ }
6165
+ }
6166
+ 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 });
6167
+ WebsocketService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: WebsocketService, providedIn: 'root' });
6168
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: WebsocketService, decorators: [{
6169
+ type: Injectable,
6170
+ args: [{
6171
+ providedIn: 'root'
6172
+ }]
6173
+ }], ctorParameters: function () {
6174
+ return [{ type: undefined, decorators: [{
6175
+ type: Inject,
6176
+ args: [CORE_CONFIG]
6177
+ }] }, { type: StaticDataFacade }];
6178
+ } });
6179
+
6180
+ class RouterFacade {
6181
+ constructor(store) {
6182
+ this.store = store;
6183
+ }
6184
+ goTo(path, extras = null) {
6185
+ console.info('[ router.facade.navigation ]', path, extras);
6186
+ return this.store.dispatch(Go({ payload: { path, extras } }));
6187
+ }
6188
+ }
6189
+ RouterFacade.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RouterFacade, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable });
6190
+ RouterFacade.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RouterFacade, providedIn: "root" });
6191
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RouterFacade, decorators: [{
6192
+ type: Injectable,
6193
+ args: [{ providedIn: "root" }]
6194
+ }], ctorParameters: function () { return [{ type: i1.Store }]; } });
6195
+
6196
+ /*const MESSAGES = {
6197
+ delete: {
6198
+ title: 'Внимание',
6199
+ text: 'Запись успешно удаленна'
6200
+ },
6201
+ update: {
6202
+ title: 'Внимание',
6203
+ text: 'Запись успешно обновлена'
6204
+ },
6205
+ create: {
6206
+ title: 'Внимание',
6207
+ text: 'Запись успешно создана'
6208
+ }
6209
+ };*/
6210
+ class StaticDataEffects extends BaseEffects {
6211
+ constructor(actions$, store, authenticationService, staticDataService, routerService, notificationsFacade) {
6212
+ super(actions$, store);
6213
+ this.actions$ = actions$;
6214
+ this.store = store;
6215
+ this.authenticationService = authenticationService;
6216
+ this.staticDataService = staticDataService;
6217
+ this.routerService = routerService;
6218
+ this.notificationsFacade = notificationsFacade;
6219
+ this.staticDataLoadRevision$ = createEffect(() => this.actions$.pipe(ofType(StaticDataLoadRevisions), mergeMap((action) => {
6220
+ const headers = this.authenticationService.loadAuthDataFromLocalStore();
6221
+ const config = {
6222
+ headers: { token: headers.token, uid: headers.id },
6223
+ };
6224
+ return this.staticDataService.loadRevision(config)
6225
+ .pipe(flatMap((r) => new StaticDataGetListBehavior(action, r).resolve()));
6226
+ })));
6227
+ this.staticDataGetList$ = createEffect(() => this.actions$.pipe(ofType(StaticDataGetList), mergeMap((action) => {
6228
+ const headers = this.authenticationService.loadAuthDataFromLocalStore();
6229
+ const config = Object.assign(Object.assign({}, action.payload), { headers: { token: headers.token, uid: headers.id }, contentType: action.payload.contentType });
6230
+ return this.staticDataService.getList(config)
6231
+ .pipe(flatMap((r) => new StaticDataGetListBehavior(action, r).resolve()));
6232
+ })));
6233
+ this.staticDataGetSubRouting$ = createEffect(() => this.actions$.pipe(ofType(StaticDataGetSubRouting), mergeMap((action) => {
6234
+ const headers = this.authenticationService.loadAuthDataFromLocalStore();
6235
+ const config = Object.assign(Object.assign({}, action.payload), { headers: { token: headers.token, uid: headers.id }, contentType: action.payload.contentType, routing: action.payload.routing });
6236
+ return this.staticDataService.getSubRouting(config)
6237
+ .pipe(flatMap((r) => new StaticDataGetListBehavior(action, r).resolve()));
6238
+ })));
6239
+ this.staticDataDelete$ = createEffect(() => this.actions$.pipe(ofType(StaticDataDelete), switchMap$1((action) => {
6240
+ const headers = this.authenticationService.loadAuthDataFromLocalStore();
6241
+ const config = Object.assign(Object.assign({}, action.payload), { headers: { token: headers.token, uid: headers.id }, contentType: action.payload.contentType, itemId: action.payload.itemId });
6242
+ return this.staticDataService.delete(config)
6243
+ .pipe(flatMap((r) => new StaticDataDeleteBehavior(action, r).resolve()));
6244
+ })));
6245
+ /* @Effect({dispatch: false})
6246
+ StaticDataDeleteSuccess$ = this.actions$.pipe(
6247
+ ofType(StaticDataDeleteSuccess),
6248
+ tap((action) => {
6249
+ const {contentType, itemId} = action.payload;
6250
+ this.routerService.goTo(['/static-data', contentType]);
6251
+ this.notificationsFacade.addNotifications({
6252
+ id: `form-message-delete-${contentType}-${itemId}`,
6253
+ type: 'success',
6254
+ text: MESSAGES.delete.text,
6255
+ title: MESSAGES.delete.title,
6256
+ timeout: NOTIFICATION_TIMEOUT
6257
+ });
6258
+ })
6259
+ );*/
6260
+ this.staticDataCreate$ = createEffect(() => this.actions$.pipe(ofType(StaticDataCreate), switchMap$1((action) => {
6261
+ const headers = this.authenticationService.loadAuthDataFromLocalStore();
6262
+ 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 });
6263
+ return this.staticDataService.create(config)
6264
+ .pipe(flatMap((r) => new StaticDataCreateBehavior(action, r).resolve()));
6265
+ })));
6266
+ /* @Effect({dispatch: false})
6267
+ staticDataCreateSuccess$ = this.actions$.pipe(
6268
+ ofType(StaticDataCreateSuccess),
6269
+ tap((action) => {
6270
+ const {contentType, itemId} = action.payload;
6271
+ this.routerService.goTo(['/static-data', contentType, itemId]);
6272
+ this.notificationsFacade.addNotifications({
6273
+ id: `form-message-create-${contentType}-${itemId}`,
6274
+ type: 'success',
6275
+ text: MESSAGES.create.text,
6276
+ title: MESSAGES.create.title,
6277
+ timeout: NOTIFICATION_TIMEOUT
6278
+ });
6279
+ })
6280
+ );*/
6281
+ this.staticDataUpdate$ = createEffect(() => this.actions$.pipe(ofType(StaticDataUpdate), switchMap$1((action) => {
6282
+ const headers = this.authenticationService.loadAuthDataFromLocalStore();
6283
+ 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 });
6284
+ return this.staticDataService.update(config)
6285
+ .pipe(flatMap((r) => new StaticDataUpdateBehavior(action, r).resolve()));
6286
+ })));
6287
+ this.staticDataPatchUpdate$ = createEffect(() => this.actions$.pipe(ofType(StaticDataPatchUpdate), switchMap$1((action) => {
6288
+ const headers = this.authenticationService.loadAuthDataFromLocalStore();
6289
+ 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 });
6290
+ return this.staticDataService.patchUpdate(config)
6291
+ .pipe(flatMap((r) => new StaticDataPatchUpdateBehavior(action, r).resolve()));
6292
+ })));
6293
+ this.staticDataGetListCategories$ = createEffect(() => this.actions$.pipe(ofType(StaticDataGetListCategories), switchMap$1((action) => {
6294
+ const { contentTypes } = action.payload;
6295
+ const config = {
6296
+ contentTypes
6297
+ };
6298
+ return this.staticDataService.getListCategories(config)
6299
+ .pipe(flatMap((r) => new StaticDataGetListCategoriesBehavior(action, r).resolve()), catchError(error => of(StaticDataGetListCategoriesFail({
6300
+ payload: {
6301
+ contentTypes: action.payload.contentTypes,
6302
+ }
6303
+ }))));
6304
+ })));
6305
+ }
6306
+ }
6307
+ 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 });
6308
+ StaticDataEffects.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: StaticDataEffects });
6309
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: StaticDataEffects, decorators: [{
6310
+ type: Injectable
6311
+ }], ctorParameters: function () { return [{ type: i1$2.Actions }, { type: i1.Store }, { type: AuthenticationService }, { type: StaticDataService }, { type: RouterFacade }, { type: NotificationsFacade }]; } });
6312
+
6313
+ const ActionsSend = createAction('[Actions] Actions Create', props());
6314
+ const ActionsSendSuccess = createAction('[Actions] Actions Create Success', props());
6315
+ const ActionsSendFail = createAction('[Actions] Actions Create Error', props());
6316
+
6317
+ class ActionsSendBehavior extends Behavior {
6318
+ constructor(action, result) {
6319
+ super(action);
6320
+ this.action = action;
6321
+ this.result = result;
6322
+ }
6323
+ resolve() {
6324
+ const status = this.result.data.status;
6325
+ let returnedActions;
6326
+ const response = this.result.data;
6327
+ const { data } = response.body;
6328
+ switch (status) {
6329
+ case ResponseStatus.STATUS_200: {
6330
+ returnedActions = [
6331
+ ActionsSendSuccess({ payload: Object.assign({}, data) })
6332
+ ];
6333
+ break;
6334
+ }
6335
+ default: {
6336
+ returnedActions = [
6337
+ ActionsSendFail({
6338
+ payload: {
6339
+ error: 'Unhandled error',
6340
+ action: data.action,
6063
6341
  actionId: data.actionId,
6064
6342
  }
6065
6343
  })
@@ -6364,17 +6642,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
6364
6642
  }], ctorParameters: function () { return [{ type: i1$2.Actions }, { type: i1.Store }, { type: AuthenticationService }, { type: ReportsService }]; } });
6365
6643
 
6366
6644
  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; });
6645
+ 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; });
6646
+ 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; });
6647
+ 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
6648
  const getActionMeta = (action, actionId) => createSelector(getActionsState, (state) => { var _a; return (_a = state.meta) === null || _a === void 0 ? void 0 : _a[`${action}-${actionId}`]; });
6371
6649
  const getActionItem = (action, actionId) => createSelector(getActionsState, (state) => {
6372
6650
  return state.list[`${action}-${actionId}`] || {};
6373
6651
  });
6374
6652
  const actionsQuery = {
6375
- getStatus: getStatus$1,
6376
- getLoaded: getLoaded$1,
6377
- getError: getError$1,
6653
+ getStatus,
6654
+ getLoaded,
6655
+ getError,
6378
6656
  getActionItem,
6379
6657
  getActionMeta
6380
6658
  };
@@ -6534,163 +6812,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
6534
6812
  args: [{ providedIn: "root" }]
6535
6813
  }], ctorParameters: function () { return [{ type: i1.Store }]; } });
6536
6814
 
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
6815
  class FormDeleteFileFacade {
6695
6816
  constructor(store) {
6696
6817
  this.store = store;
@@ -10531,10 +10652,10 @@ class StaticDataListItemsComponent {
10531
10652
  }
10532
10653
  }
10533
10654
  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 });
10655
+ 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
10656
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: StaticDataListItemsComponent, decorators: [{
10536
10657
  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"] }]
10658
+ 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
10659
  }], ctorParameters: function () { return [{ type: i1$4.MatDialog }, { type: RightService }, { type: StaticDataFacade }, { type: i0.ChangeDetectorRef }, { type: RouterFacade }]; }, propDecorators: { staticDataConfiguration: [{
10539
10660
  type: Input
10540
10661
  }], contentType: [{
@@ -12451,5 +12572,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
12451
12572
  * Generated bundle index. Do not edit.
12452
12573
  */
12453
12574
 
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 };
12575
+ 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
12576
  //# sourceMappingURL=wt-front-shared.mjs.map