barsa-novin-ray-core 2.3.36 → 2.3.38

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.
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, inject, ElementRef, Input, ChangeDetectionStrategy, Component, Pipe, ComponentFactoryResolver, Injector, ApplicationRef, Compiler, signal, DOCUMENT, NgModuleFactory, InjectionToken, NgZone, EventEmitter, ChangeDetectorRef, Renderer2, HostBinding, Output, HostListener, ViewContainerRef, ViewChild, Directive, TemplateRef, input, NgModule, NO_ERRORS_SCHEMA, CUSTOM_ELEMENTS_SCHEMA, provideAppInitializer, ErrorHandler } from '@angular/core';
3
- import { Subject, from, BehaviorSubject, of, exhaustMap, map as map$1, combineLatest, fromEvent, forkJoin, throwError, merge, interval, filter as filter$1, tap as tap$1, concatMap as concatMap$1, catchError as catchError$1, finalize as finalize$1, Observable, takeUntil as takeUntil$1, timer, debounceTime as debounceTime$1, mergeWith, Subscription } from 'rxjs';
2
+ import { Injectable, inject, ElementRef, Input, ChangeDetectionStrategy, Component, Pipe, ComponentFactoryResolver, Injector, ApplicationRef, Compiler, DOCUMENT, NgModuleFactory, InjectionToken, NgZone, EventEmitter, ChangeDetectorRef, Renderer2, HostBinding, Output, HostListener, ViewContainerRef, ViewChild, signal, Directive, TemplateRef, input, NgModule, NO_ERRORS_SCHEMA, CUSTOM_ELEMENTS_SCHEMA, provideAppInitializer, ErrorHandler } from '@angular/core';
3
+ import { Subject, from, BehaviorSubject, of, exhaustMap, map as map$1, combineLatest, withLatestFrom as withLatestFrom$1, fromEvent, forkJoin, throwError, merge, interval, filter as filter$1, tap as tap$1, concatMap as concatMap$1, catchError as catchError$1, finalize as finalize$1, Observable, takeUntil as takeUntil$1, timer, debounceTime as debounceTime$1, mergeWith, Subscription } from 'rxjs';
4
4
  import * as i1 from '@angular/router';
5
5
  import { Router, NavigationEnd, ActivatedRoute, NavigationStart, RouterEvent, RouterModule } from '@angular/router';
6
6
  import { DomSanitizer, Title } from '@angular/platform-browser';
@@ -5022,46 +5022,189 @@ function formRoutes(authGuard = false) {
5022
5022
 
5023
5023
  class ApplicationCtrlrService {
5024
5024
  constructor() {
5025
- this.sidebarToggle = signal(false);
5025
+ this._selectedNavGroupItemId$ = new BehaviorSubject({});
5026
+ this._selectedReportId$ = new BehaviorSubject({});
5027
+ this._selectedNavGroupId$ = new BehaviorSubject({});
5028
+ this._sidebarToggle$ = new BehaviorSubject(false);
5029
+ this._selectedAppTileGroup$ = new BehaviorSubject('');
5026
5030
  this._appMenuItems$ = new BehaviorSubject([]);
5027
5031
  this._systemsUi$ = new BehaviorSubject([]);
5028
- this._selectedSystem$ = new BehaviorSubject(null);
5032
+ this._selectedSystemId$ = new BehaviorSubject('');
5033
+ this._selectedSystemNavUi$ = new BehaviorSubject(null);
5034
+ this._selectedCommandId$ = new BehaviorSubject({});
5035
+ this._isCommandGroupsSelected$ = new BehaviorSubject({});
5029
5036
  this._log = inject(LogService);
5030
5037
  this._document = inject(DOCUMENT);
5038
+ this._router = inject(Router);
5031
5039
  }
5032
5040
  get appMenuItems$() {
5033
5041
  return this._appMenuItems$.asObservable();
5034
5042
  }
5035
- get selectedSystem$() {
5036
- return this._selectedSystem$.asObservable();
5043
+ get systemCommandGroups$() {
5044
+ return this._selectedSystemNavUi$
5045
+ .asObservable()
5046
+ .pipe(map$1((c) => (!c ? [] : this._mergeToSystemGroup(c.SystemData.CommandGroups) || [])));
5047
+ }
5048
+ get selectedCommand$() {
5049
+ return combineLatest([this._selectedCommandId$, this._selectedSystemId$]).pipe(map$1(([selectedCommand, systemId]) => selectedCommand[systemId]));
5050
+ }
5051
+ get systemWorkflowList$() {
5052
+ return this._selectedSystemNavUi$.asObservable().pipe(map$1((c) => (!c ? [] : c.SystemData.WorkflowList || [])));
5053
+ }
5054
+ get selectedSystemNavUi$() {
5055
+ return this._selectedSystemNavUi$.asObservable();
5056
+ }
5057
+ get isCommandGroupsSelected$() {
5058
+ return combineLatest([this._isCommandGroupsSelected$, this._selectedSystemId$]).pipe(map$1(([isSelectedGroups, systemId]) => isSelectedGroups[systemId]));
5059
+ }
5060
+ get selectedSystemId$() {
5061
+ return this._selectedSystemId$
5062
+ .asObservable()
5063
+ .pipe(map$1((c) => c || BarsaApi.Ul.ApplicationCtrlr.DefaultSystemId));
5064
+ }
5065
+ get selectedAppTileGroup$() {
5066
+ return this._selectedAppTileGroup$.asObservable();
5067
+ }
5068
+ get sidebarToggle$() {
5069
+ return this._sidebarToggle$.asObservable();
5070
+ }
5071
+ get sidebarToggle() {
5072
+ return this._sidebarToggle$.getValue();
5073
+ }
5074
+ get selectedNavGroupId$() {
5075
+ return combineLatest([this._selectedNavGroupId$, this._selectedSystemId$]).pipe(map$1(([selectedNavGroupsId, systemId]) => selectedNavGroupsId[systemId]));
5076
+ }
5077
+ get selectedNavGroupItemId$() {
5078
+ return this._selectedNavGroupItemId$.pipe(withLatestFrom$1(this._selectedSystemId$), map$1(([selectedNavGroupId, systemId]) => selectedNavGroupId[systemId]));
5079
+ }
5080
+ get selectedReportId$() {
5081
+ return this._selectedReportId$.pipe(withLatestFrom$1(this._selectedSystemId$), map$1(([selectedNavGroupId, systemId]) => selectedNavGroupId[systemId]));
5082
+ }
5083
+ get selectedSystemId() {
5084
+ return this._selectedSystemId$.getValue();
5085
+ }
5086
+ getSelectedNavGroupItemId(systemId) {
5087
+ return this._selectedNavGroupItemId$.getValue()[systemId];
5088
+ }
5089
+ getSelectedReportId(systemId) {
5090
+ return this._selectedReportId$.getValue()[systemId];
5037
5091
  }
5038
5092
  initialize(callback) {
5093
+ BarsaApi.Ul.ApplicationCtrlr.on({
5094
+ 'MetaEventTopics.System_BeforeApplicationStart': () => {
5095
+ BarsaApi.Ul.ApplicationCtrlr.DefaultSystemId = this.selectedSystemId || 0;
5096
+ }
5097
+ });
5039
5098
  BarsaApi.Ul.ApplicationCtrlr.Initialize(() => {
5040
5099
  this._handleEvents();
5041
- callback && callback();
5100
+ callback && callback(true);
5042
5101
  });
5043
5102
  this._document.documentElement.setAttribute('data-layout', 'vertical');
5044
5103
  }
5045
- systemChange(appMenuItem) {
5046
- this._customApplicationMenuBodyUi.fireEvent('SelectedSystemChanged', this._customApplicationMenuBodyUi, appMenuItem.SystemData);
5104
+ systemChange(systemId) {
5105
+ const systemData = BarsaApi.Ul.ApplicationCtrlr.SystemDict[systemId]?.SystemData;
5106
+ this.selectedSystem(systemId);
5107
+ if (!systemData) {
5108
+ // console.error(`system data for systemid ${systemId} not found.`);
5109
+ return;
5110
+ }
5111
+ this._customApplicationMenuBodyUi.fireEvent('SelectedSystemChanged', this._customApplicationMenuBodyUi, systemData);
5112
+ }
5113
+ selectAppTileGroup(id) {
5114
+ this._selectedAppTileGroup$.next(id);
5115
+ }
5116
+ setCommandGroupsSelected(isSelected) {
5117
+ const groupsSelected = this._isCommandGroupsSelected$.getValue();
5118
+ const selectedSystemId = this._selectedSystemId$.getValue();
5119
+ const systemId = selectedSystemId;
5120
+ groupsSelected[systemId] = isSelected;
5121
+ this._isCommandGroupsSelected$.next(groupsSelected);
5122
+ }
5123
+ selectedSystem(systemId) {
5124
+ this._selectedSystemId$.next(systemId);
5125
+ this.selectNavGroup(this._selectedNavGroupId$.getValue()[systemId], false);
5126
+ this.selectNavGroupItem(this._selectedNavGroupItemId$.getValue()[systemId]);
5127
+ }
5128
+ selectSystemCommand(command) {
5129
+ this.selectSystemCommandId(command.Key);
5130
+ new Promise((resolve, _reject) => {
5131
+ this._router.navigate(['application', this._selectedSystemId$.getValue()]);
5132
+ if (command.DynamicCommand) {
5133
+ BarsaApi.Common.CustomCodeManager.RunDynamicCommand(command.Key, {}, resolve);
5134
+ }
5135
+ else {
5136
+ const key = `${this._selectedSystemId$.getValue()}:${command.Caption}`;
5137
+ BarsaApi.Common.CustomCodeManager.ExecFunctions(key, 'click', [
5138
+ { Id: command.CommandId, Caption: command.Caption },
5139
+ { System: BarsaApi.Bw._wrap(BarsaApi.Ul.ApplicationCtrlr.GetSelectedSystem()), E: command }
5140
+ ], resolve);
5141
+ }
5142
+ });
5047
5143
  }
5048
- sidebarToggled(sidebarToggle) {
5049
- this.sidebarToggle.set(sidebarToggle);
5050
- if (sidebarToggle) {
5051
- // [data-layout=vertical] [data-sidebartype=mini-sidebar]
5052
- this._document.body.removeAttribute('data-sidebartype');
5144
+ selectSystemCommandId(id) {
5145
+ const selectedCommandId = this._selectedCommandId$.getValue();
5146
+ const selectedSystemId = this._selectedSystemId$.getValue();
5147
+ const systemId = selectedSystemId;
5148
+ selectedCommandId[systemId] = id;
5149
+ this._selectedCommandId$.next(selectedCommandId);
5150
+ }
5151
+ selectNavGroupItem(navGroupItemId) {
5152
+ const selectedNavGroupItem = this._selectedNavGroupItemId$.getValue();
5153
+ const selectedSystemId = this._selectedSystemId$.getValue();
5154
+ const systemId = selectedSystemId;
5155
+ selectedNavGroupItem[systemId] = navGroupItemId;
5156
+ this._selectedNavGroupItemId$.next(selectedNavGroupItem);
5157
+ }
5158
+ selectNavGroup(navGroupId, toggle = true) {
5159
+ const selectedNavGroup = this._selectedNavGroupId$.getValue();
5160
+ const selectedSystemId = this._selectedSystemId$.getValue();
5161
+ const systemId = selectedSystemId;
5162
+ if (selectedNavGroup[systemId] === navGroupId) {
5163
+ toggle && (selectedNavGroup[systemId] = '');
5053
5164
  }
5054
5165
  else {
5055
- this._document.body.setAttribute('data-sidebartype', 'mini-sidebar');
5166
+ selectedNavGroup[systemId] = navGroupId;
5056
5167
  }
5168
+ this._selectedNavGroupId$.next(selectedNavGroup);
5169
+ }
5170
+ sidebarToggled(value) {
5171
+ this._sidebarToggle$.next(value);
5057
5172
  }
5058
- _loadSystem(id, resolve, reject) {
5173
+ loadSystem(id, resolve, reject) {
5059
5174
  BarsaApi.Ul.ApplicationCtrlr._loadSystem(id, true, (data) => {
5060
5175
  resolve(data);
5061
5176
  }, (err) => {
5062
5177
  reject(err);
5063
5178
  });
5064
5179
  }
5180
+ flattenLeafCommands(commands) {
5181
+ const result = [];
5182
+ for (const cmd of commands) {
5183
+ if (cmd.Menu && cmd.Menu.length > 0) {
5184
+ // خودش حذف میشه، فقط بچه‌هاش بررسی می‌شن
5185
+ result.push(...this.flattenLeafCommands(cmd.Menu));
5186
+ }
5187
+ else {
5188
+ result.push(cmd);
5189
+ }
5190
+ }
5191
+ return result;
5192
+ }
5193
+ // ساخت یک CommandGroup به نام System
5194
+ _mergeToSystemGroup(commandGroups) {
5195
+ const allCommands = [];
5196
+ for (const group of commandGroups) {
5197
+ allCommands.push(...this.flattenLeafCommands(group.Commands));
5198
+ }
5199
+ const systemGroup = {
5200
+ Caption: 'All',
5201
+ Name: 'All',
5202
+ Key: 'All',
5203
+ Order: 0,
5204
+ Commands: allCommands
5205
+ };
5206
+ return systemGroup.Commands.length > 0 ? [systemGroup] : [];
5207
+ }
5065
5208
  _handleEvents() {
5066
5209
  const context = BarsaApi.Ul.ApplicationCtrlr.Adapter.Control;
5067
5210
  context.on({
@@ -5086,25 +5229,32 @@ class ApplicationCtrlrService {
5086
5229
  _appMenuBodyUi_itemsChanged(items) {
5087
5230
  this._appMenuItems$.next([...items]);
5088
5231
  }
5089
- _addSystemUi(systemUi) {
5090
- // this._selectedSystem$.next(systemUi);
5091
- console.log('_addSystemUi', systemUi);
5232
+ _addSystemUi(_systemUi) {
5233
+ // this._selectedSystemId$.next(systemUi.SystemData.Id);
5234
+ // console.log('_addSystemUi', systemUi);
5092
5235
  }
5093
- _addToMainTabPanel(customSystemUi) {
5094
- console.log('AddToMainTabPanel', customSystemUi);
5236
+ _addToMainTabPanel(_customSystemUi) {
5237
+ // console.log('AddToMainTabPanel', customSystemUi);
5095
5238
  }
5096
- _selectedSystemChanged(systemId, forceRelayout = false) {
5239
+ _selectedSystemChanged(systemId, _forceRelayout = false) {
5097
5240
  const x = this._customApplicationUi._systemsUi.find((c) => c.SystemData.Id === systemId);
5098
- if (x) {
5099
- this._selectedSystem$.next(x);
5241
+ this._selectSystem(x);
5242
+ // console.log('SelectedSystemChanged', systemId, forceRelayout);
5243
+ // console.log('selected navgroup ', this._selectedNavGroupId$.getValue());
5244
+ // console.log('selected navgroup Item ', this._selectedNavGroupItemId$.getValue());
5245
+ }
5246
+ _selectSystem(system) {
5247
+ if (!system) {
5248
+ return;
5100
5249
  }
5101
- this._log.error('SelectedSystemChanged', systemId, forceRelayout);
5250
+ this.selectedSystem(system.SystemData.Id);
5251
+ this._selectedSystemNavUi$.next(system.SystemNavUi);
5102
5252
  }
5103
- _setStatusBarValues(statusbarValues) {
5104
- console.log('SetStatusBarValues', statusbarValues);
5253
+ _setStatusBarValues(_statusbarValues) {
5254
+ // console.log('SetStatusBarValues', statusbarValues);
5105
5255
  }
5106
- _showReleaseNoteWindow(releaseNoteData) {
5107
- console.log('ShowReleaseNoteWindow', releaseNoteData);
5256
+ _showReleaseNoteWindow(_releaseNoteData) {
5257
+ // console.log('ShowReleaseNoteWindow', releaseNoteData);
5108
5258
  }
5109
5259
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: ApplicationCtrlrService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
5110
5260
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: ApplicationCtrlrService, providedIn: 'root' }); }
@@ -5116,6 +5266,50 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
5116
5266
  }]
5117
5267
  }] });
5118
5268
 
5269
+ class RedirectHomeGuard {
5270
+ constructor() {
5271
+ this._portalService = inject(PortalService);
5272
+ this.router = inject(Router);
5273
+ }
5274
+ canActivate(route) {
5275
+ this._handle(route.queryParams);
5276
+ return of(!BarsaApi.LoginFormData.IsAnonymous && BarsaApi.LoginFormData.IsUserLoggedIn).pipe(withLatestFrom(this._portalService.portalData$), tap(([hasAuthorized, portalData]) => {
5277
+ if (hasAuthorized) {
5278
+ const homePage = this._portalService.DefaultPage ||
5279
+ portalData?.ChildPageList.MoDataList.find((c) => c.IsDefaultRoute === 'True');
5280
+ const homeRoute = homePage?.Route || '/';
5281
+ this.router.navigate([homeRoute]);
5282
+ }
5283
+ }), map(([hasAuthorized]) => !hasAuthorized));
5284
+ }
5285
+ _handle(params) {
5286
+ const { notificationTag, action, moid, tpid } = params;
5287
+ if (typeof notificationTag !== 'undefined' && action) {
5288
+ const pushAction = {
5289
+ notificationTag,
5290
+ action,
5291
+ moid,
5292
+ tpid
5293
+ };
5294
+ // if (notificationTag === '' && action === 'show') {
5295
+ // setTimeout(() => {
5296
+ // BarsaApi.Bw.Form.Show({
5297
+ // MoId: params.moid,
5298
+ // TypeDefId: params.tpid
5299
+ // });
5300
+ // }, 1000);
5301
+ // return;
5302
+ // }
5303
+ this._portalService.pushActionNext(pushAction);
5304
+ }
5305
+ }
5306
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: RedirectHomeGuard, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
5307
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: RedirectHomeGuard }); }
5308
+ }
5309
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: RedirectHomeGuard, decorators: [{
5310
+ type: Injectable
5311
+ }] });
5312
+
5119
5313
  class PortalService {
5120
5314
  constructor() {
5121
5315
  this.offsetTop = 0;
@@ -5360,7 +5554,7 @@ class PortalService {
5360
5554
  else if (window.innerWidth > 600 && window.innerWidth <= 992) {
5361
5555
  _windoWSize = 'm';
5362
5556
  }
5363
- else if (window.innerWidth > 992 && window.innerWidth <= 1200) {
5557
+ else if (window.innerWidth > 992 && window.innerWidth <= 1300) {
5364
5558
  _windoWSize = 'l';
5365
5559
  }
5366
5560
  else {
@@ -5669,10 +5863,10 @@ class PortalService {
5669
5863
  path: (cpage.IsDefaultRoute === 'True' && path === '') || (path !== '' && typeof path !== 'undefined')
5670
5864
  ? path
5671
5865
  : cpage.Route.replace('/', ''),
5672
- canActivate: cpage.HasAuthorize !== 'True' ? [] : [AuthGuard],
5866
+ canActivate: cpage.HasAuthorize === 'True' ? [AuthGuard] : cpage.IsLoginRoute ? [RedirectHomeGuard] : [],
5673
5867
  resolve: { pageData: PortalPageResolver },
5674
5868
  component: pageComponent,
5675
- outlet: cpage.Outlet,
5869
+ outlet: cpage.Outlet ? cpage.Outlet : undefined,
5676
5870
  data: {
5677
5871
  pageData: {
5678
5872
  Module: cpage.Module,
@@ -5719,6 +5913,7 @@ class PortalService {
5719
5913
  const defaultPath = newConfigRoutes.find((c) => c.path === '');
5720
5914
  defaultPath && (defaultPath.redirectTo = defaultPageRoute);
5721
5915
  newConfigRoutes.push({ path: '**', redirectTo: defaultPageRoute });
5916
+ newConfigRoutes.push({ path: '', redirectTo: defaultPageRoute, pathMatch: 'full' });
5722
5917
  }
5723
5918
  else {
5724
5919
  const defaultPath = configRoute.find((c) => c.path === '');
@@ -5967,7 +6162,7 @@ class PortalService {
5967
6162
  BarsaApi.Ul.ApplicationCtrlr.DefaultSystemId = null;
5968
6163
  }
5969
6164
  return new Promise((resolve, reject) => {
5970
- this._applicationCtrlrService._loadSystem(id, (data) => {
6165
+ this._applicationCtrlrService.loadSystem(id, (data) => {
5971
6166
  resolve(data);
5972
6167
  }, (err) => {
5973
6168
  reject(err);
@@ -9103,8 +9298,8 @@ class ContainerComponent extends BaseComponent {
9103
9298
  return this.containerRef;
9104
9299
  }
9105
9300
  ngOnInit() {
9106
- this.parentContainer = BarsaApi.Ul.ApplicationCtrlr.CurrentSystemAdapter;
9107
- BarsaApi.Ul.ApplicationCtrlr.CurrentSystemAdapter = this;
9301
+ this.parentContainer = BarsaApi.Bw.FormHandler;
9302
+ BarsaApi.Bw.FormHandler = this;
9108
9303
  this.oldNavigation = BarsaApi.Bw.Navigate;
9109
9304
  BarsaApi.Bw.Navigate = (navigation, isRelative, queryParams) => {
9110
9305
  this._router.navigate(navigation, {
@@ -9119,7 +9314,7 @@ class ContainerComponent extends BaseComponent {
9119
9314
  }
9120
9315
  }
9121
9316
  ngOnDestroy() {
9122
- BarsaApi.Ul.ApplicationCtrlr.CurrentSystemAdapter = this.parentContainer;
9317
+ BarsaApi.Bw.FormHandler = this.parentContainer;
9123
9318
  super.ngOnDestroy();
9124
9319
  this._barsaDialogService.containerComponent = this.oldContainerContainer;
9125
9320
  BarsaApi.Bw.Navigate = this.oldNavigation;
@@ -9492,8 +9687,11 @@ class SingleRelationControlInfoModel extends GeneralControlInfoModel {
9492
9687
  }
9493
9688
  class MetaobjectDataModel {
9494
9689
  }
9495
- class MoForReportModel {
9690
+ class MoForReportModelBase {
9691
+ }
9692
+ class MoForReportModel extends MoForReportModelBase {
9496
9693
  constructor() {
9694
+ super();
9497
9695
  this.DeletedList = this.AddedList = this.MoDataList = [];
9498
9696
  }
9499
9697
  }
@@ -12410,8 +12608,15 @@ class DynamicTileGroupComponent extends BaseDynamicComponent {
12410
12608
  this.resetGroup = new EventEmitter();
12411
12609
  this.deleteGroup = new EventEmitter();
12412
12610
  }
12611
+ ngOnChanges(changes) {
12612
+ super.ngOnChanges(changes);
12613
+ const { appTileGroup } = changes;
12614
+ if (appTileGroup && !appTileGroup.firstChange) {
12615
+ this._renderComponentInstance();
12616
+ }
12617
+ }
12413
12618
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: DynamicTileGroupComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
12414
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.6", type: DynamicTileGroupComponent, isStandalone: false, selector: "bnrc-dynamic-tile-group,[dynamictilegroup]", inputs: { appTileGroup: "appTileGroup", tabRef: "tabRef", stackContent: "stackContent", cssStyles: "cssStyles", edit: "edit", rtl: "rtl", isAppTileSubGroup: "isAppTileSubGroup", deviceSize: "deviceSize", isLast: "isLast" }, outputs: { tilesDropped: "tilesDropped", hideAppTileClick: "hideAppTileClick", renameAppTileClick: "renameAppTileClick", toggleGroup: "toggleGroup", resetGroup: "resetGroup", deleteGroup: "deleteGroup" }, usesInheritance: true, ngImport: i0, template: `<ng-container #componentContainer></ng-container>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
12619
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.6", type: DynamicTileGroupComponent, isStandalone: false, selector: "bnrc-dynamic-tile-group,[dynamictilegroup]", inputs: { appTileGroup: "appTileGroup", tabRef: "tabRef", stackContent: "stackContent", cssStyles: "cssStyles", edit: "edit", rtl: "rtl", isAppTileSubGroup: "isAppTileSubGroup", deviceSize: "deviceSize", isLast: "isLast" }, outputs: { tilesDropped: "tilesDropped", hideAppTileClick: "hideAppTileClick", renameAppTileClick: "renameAppTileClick", toggleGroup: "toggleGroup", resetGroup: "resetGroup", deleteGroup: "deleteGroup" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: `<ng-container #componentContainer></ng-container>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
12415
12620
  }
12416
12621
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: DynamicTileGroupComponent, decorators: [{
12417
12622
  type: Component,
@@ -14004,7 +14209,7 @@ class RouteFormChangeDirective extends BaseDirective {
14004
14209
  ngOnInit() {
14005
14210
  super.ngOnInit();
14006
14211
  this._router.events
14007
- .pipe(takeUntil$1(this._onDestroy$), filter$1((event) => event instanceof NavigationStart && event instanceof RouterEvent), mergeWith(this._portalService.openForm$), mergeWith(this.handleBodyClick ? fromEvent(document.body, 'click') : of(null)))
14212
+ .pipe(takeUntil$1(this._onDestroy$), filter$1((event) => event instanceof NavigationStart && event instanceof RouterEvent), mergeWith(this._portalService.openForm$))
14008
14213
  .subscribe((_event) => {
14009
14214
  this.stateChanged.emit();
14010
14215
  });
@@ -15630,50 +15835,6 @@ class CustomRouteReuseStategy {
15630
15835
  }
15631
15836
  }
15632
15837
 
15633
- class RedirectHomeGuard {
15634
- constructor() {
15635
- this._portalService = inject(PortalService);
15636
- this.router = inject(Router);
15637
- }
15638
- canActivate(route) {
15639
- this._handle(route.queryParams);
15640
- return of(!BarsaApi.LoginFormData.IsAnonymous && BarsaApi.LoginFormData.IsUserLoggedIn).pipe(withLatestFrom(this._portalService.portalData$), tap(([hasAuthorized, portalData]) => {
15641
- if (hasAuthorized) {
15642
- const homePage = this._portalService.DefaultPage ||
15643
- portalData?.ChildPageList.MoDataList.find((c) => c.IsDefaultRoute === 'True');
15644
- const homeRoute = homePage?.Route || 'home';
15645
- this.router.navigate([homeRoute]);
15646
- }
15647
- }), map(([hasAuthorized]) => !hasAuthorized));
15648
- }
15649
- _handle(params) {
15650
- const { notificationTag, action, moid, tpid } = params;
15651
- if (typeof notificationTag !== 'undefined' && action) {
15652
- const pushAction = {
15653
- notificationTag,
15654
- action,
15655
- moid,
15656
- tpid
15657
- };
15658
- // if (notificationTag === '' && action === 'show') {
15659
- // setTimeout(() => {
15660
- // BarsaApi.Bw.Form.Show({
15661
- // MoId: params.moid,
15662
- // TypeDefId: params.tpid
15663
- // });
15664
- // }, 1000);
15665
- // return;
15666
- // }
15667
- this._portalService.pushActionNext(pushAction);
15668
- }
15669
- }
15670
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: RedirectHomeGuard, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
15671
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: RedirectHomeGuard }); }
15672
- }
15673
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: RedirectHomeGuard, decorators: [{
15674
- type: Injectable
15675
- }] });
15676
-
15677
15838
  class RootPageComponent extends BaseComponent {
15678
15839
  constructor() {
15679
15840
  super(...arguments);
@@ -16306,7 +16467,11 @@ const functionL2 = function (portalService, applicationCtrlrService, titleServic
16306
16467
  }
16307
16468
  else {
16308
16469
  return new Promise((resolve, _reject) => {
16470
+ const m = window.location.hash.match(/application\/([^/?#]+)/i);
16471
+ const systemId = m?.[1] || ''; // "344344343"
16472
+ applicationCtrlrService.systemChange(systemId);
16309
16473
  applicationCtrlrService.initialize(resolve);
16474
+ resolve(true);
16310
16475
  }); // load all systems if user is logged in
16311
16476
  }
16312
16477
  };
@@ -16658,5 +16823,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
16658
16823
  * Generated bundle index. Do not edit.
16659
16824
  */
16660
16825
 
16661
- export { APP_VERSION, AbsoluteDivBodyDirective, AffixRespondEvents, AllFilesMimeType, AnchorScrollDirective, ApiService, ApplicationBaseComponent, ApplicationCtrlrService, AttrRtlDirective, AudioMimeType, AudioRecordingService, AuthGuard, BarsaApi, BarsaDialogService, BarsaIconDictPipe, BarsaNovinRayCoreModule, BarsaReadonlyDirective, BarsaSapUiFormPageModule, BarsaStorageService, BaseColumnPropsComponent, BaseComponent, BaseController, BaseDirective, BaseDynamicComponent, BaseFormToolbaritemPropsComponent, BaseItemContentPropsComponent, BaseModule, BaseReportModel, BaseUlvSettingComponent, BaseViewContentPropsComponent, BaseViewItemPropsComponent, BaseViewPropsComponent, BbbTranslatePipe, BodyClickDirective, BoolControlInfoModel, BreadcrumbService, ButtonLoadingComponent, CalculateControlInfoModel, CanUploadFilePipe, CardMediaSizePipe, ChangeLayoutInfoCustomUi, ChunkArrayPipe, CodeEditorControlInfoModel, ColSetting, ColumnCustomComponentPipe, ColumnCustomUiPipe, ColumnIconPipe, ColumnResizerDirective, ColumnService, ColumnValueDirective, ColumnValueOfParametersPipe, ColumnValuePipe, ComboRowImagePipe, CommandControlInfoModel, ContainerComponent, ContainerService, ContextMenuPipe, ControlUiPipe, ConvertToStylePipe, CopyDirective, CountDownDirective, CustomCommand, CustomInjector, CustomRouteReuseStategy, DIALOG_SERVICE, DateHijriService, DateMiladiService, DateRanges, DateService, DateShamsiService, DateTimeControlInfoModel, DeviceWidth, DialogParams, DynamicCommandDirective, DynamicComponentService, DynamicDarkColorPipe, DynamicFormComponent, DynamicFormToolbaritemComponent, DynamicItemComponent, DynamicLayoutComponent, DynamicRootVariableDirective, DynamicStyleDirective, DynamicTileGroupComponent, EllapsisTextDirective, EllipsifyDirective, EmptyPageComponent, EmptyPageWithRouterAndRouterOutletComponent, EnumControlInfoModel, ExecuteDynamicCommand, ExecuteWorkflowChoiceDef, FORM_DIALOG_COMPONENT, FieldBaseComponent, FieldDirective, FieldInfoTypeEnum, FieldUiComponent, FileControlInfoModel, FileInfoCountPipe, FilePictureInfoModel, FilesValidationHelper, FillAllLayoutControls, FillEmptySpaceDirective, FilterColumnsByDetailsPipe, FilterInlineActionListPipe, FilterPipe, FilterStringPipe, FilterTabPipe, FilterToolbarControlPipe, FilterWorkflowInMobilePipe, FindColumnByDbNamePipe, FindGroup, FindLayoutSettingFromLayout94, FindPreviewColumnPipe, FindToolbarItem, FioriIconPipe, FormBaseComponent, FormCloseDirective, FormComponent, FormFieldReportPageComponent, FormNewComponent, FormPageBaseComponent, FormPageComponent, FormPanelService, FormPropsBaseComponent, FormService, FormToolbarBaseComponent, GaugeControlInfoModel, GeneralControlInfoModel, GetAllColumnsSorted, GetAllHorizontalFromLayout94, GetDefaultMoObjectInfo, GetImgTags, GetVisibleValue, GridSetting, GroupBy, GroupByPipe, GroupByService, HeaderFacetValuePipe, HideAcceptCancelButtonsPipe, HideColumnsInmobilePipe, HistoryControlInfoModel, HorizontalLayoutService, HorizontalResponsiveDirective, IconControlInfoModel, ImageLazyDirective, ImageMimeType, ImagetoPrint, InMemoryStorageService, IndexedDbService, InputNumber, IntersectionObserverDirective, IntersectionStatus, IsDarkMode, IsExpandedNodePipe, IsImagePipe, ItemsRendererDirective, LabelStarTrimPipe, LabelmandatoryDirective, LayoutItemBaseComponent, LayoutMainContentService, LayoutPanelBaseComponent, LayoutService, LeafletLongPressDirective, LinearListControlInfoModel, LinearListHelper, ListCountPipe, ListRelationModel, LoadExternalFilesDirective, LocalStorageService, LogService, LoginSettingsResolver, MeasureFormTitleWidthDirective, MergeFieldsToColumnsPipe, MetaobjectDataModel, MetaobjectRelationModel, MoForReportModel, MoInfoUlvMoListPipe, MoInfoUlvPagingPipe, MoReportValueConcatPipe, MoReportValuePipe, MoValuePipe, MobileDirective, ModalRootComponent, MultipleGroupByPipe, NOTIFICATAION_POPUP_SERVER, NOTIFICATION_WEBWORKER_FACTORY, NetworkStatusService, NotFoundComponent, NotificationService, NowraptextDirective, NumberBaseComponent, NumberControlInfoModel, NumbersOnlyInputDirective, NumeralPipe, OverflowTextDirective, PageBaseComponent, PageWithFormHandlerBaseComponent, PdfMimeType, PictureFieldSourcePipe, PictureFileControlInfoModel, PlaceHolderDirective, PortalDynamicPageResolver, PortalFormPageResolver, PortalPageComponent, PortalPageResolver, PortalPageSidebarComponent, PortalReportPageResolver, PortalService, PreventDefaulEvent, PreventDefaultDirective, PrintFilesDirective, PrintImage, PromptUpdateService, RabetehAkseTakiListiControlInfoModel, RedirectHomeGuard, RedirectReportNavigatorCommandComponent, RelatedReportControlInfoModel, RelationListControlInfoModel, RemoveNewlinePipe, RenderUlvDirective, RenderUlvPaginDirective, RenderUlvViewerDirective, ReplacePipe, ReportBaseComponent, ReportBaseInfo, ReportCalendarModel, ReportContainerComponent, ReportExtraInfo, ReportField, ReportFormModel, ReportItemBaseComponent, ReportListModel, ReportModel, ReportTreeModel, ReportViewBaseComponent, ReportViewColumn, ResizableComponent, ResizableDirective, ResizableModule, ResizeObserverDirective, ReversePipe, RichStringControlInfoModel, RootPageComponent, RootPortalComponent, RouteFormChangeDirective, RoutingService, RowDataOption, RowNumberPipe, SanitizeTextPipe, SaveImageDirective, SaveImageToFile, SaveScrollPositionService, ScrollPersistDirective, ScrollToSelectedDirective, SelectionMode, SeperatorFixPipe, ServiceWorkerCommuncationService, ServiceWorkerNotificationService, ShellbarHeightService, ShortcutHandlerDirective, ShortcutRegisterDirective, SimplebarDirective, SingleRelationControlInfoModel, SortDirection, SortPipe, SortSetting, SplideSliderDirective, SplitPipe, StopPropagationDirective, StringControlInfoModel, StringToNumberPipe, SubformControlInfoModel, SystemBaseComponent, TOAST_SERVICE, TableHeaderWidthMode, TableResizerDirective, TabpageService, ThImageOrIconePipe, TileGroupBreadcrumResolver, TilePropsComponent, TlbButtonsPipe, ToolbarSettingsPipe, TooltipDirective, TotalSummaryPipe, UiService, UlvCommandDirective, UlvMainService, UnlimitSessionComponent, UntilInViewDirective, UploadService, VideoMimeType, VideoRecordingService, ViewBase, VisibleValuePipe, WebOtpDirective, WordMimeType, WorfkflowwChoiceCommandDirective, addCssVariableToRoot, availablePrefixes, calcContextMenuWidth, calculateColumnContent, calculateColumnWidth, calculateColumnWidthFitToContainer, calculateFreeColumnSize, calculateMoDataListContentWidthByColumnName, cancelRequestAnimationFrame, createFormPanelMetaConditions, createGridEditorFormPanel, easeInOutCubic, elementInViewport2, enumValueToStringSize, executeUlvCommandHandler, flattenTree, forbiddenValidator, formRoutes, formatBytes, fromEntries, fromIntersectionObserver, genrateInlineMoId, getAllItemsPerChildren, getColumnValueOfMoDataList, getComponentDefined, getControlList, getControlSizeMode, getDateService, getDeviceIsDesktop, getDeviceIsMobile, getDeviceIsPhone, getDeviceIsTablet, getFieldValue, getFocusableTagNames, getFormSettings, getGridSettings, getHeaderValue, getIcon, getImagePath, getLabelWidth, getLayout94ObjectInfo, getLayoutControl, getNewMoGridEditor, getParentHeight, getRequestAnimationFrame, getResetGridSettings, getTargetRect, getUniqueId, getValidExtension, isFF, isFirefox, isFunction, isImage, isInLocalMode, isSafari, isTargetWindow, measureText, measureText2, measureTextBy, mobile_regex, nullOrUndefinedString, number_only, requestAnimationFramePolyfill, setColumnWidthByMaxMoContentWidth, setOneDepthLevel, setTableThWidth, shallowEqual, stopPropagation, throwIfAlreadyLoaded, toNumber, validateAllFormFields };
16826
+ export { APP_VERSION, AbsoluteDivBodyDirective, AffixRespondEvents, AllFilesMimeType, AnchorScrollDirective, ApiService, ApplicationBaseComponent, ApplicationCtrlrService, AttrRtlDirective, AudioMimeType, AudioRecordingService, AuthGuard, BarsaApi, BarsaDialogService, BarsaIconDictPipe, BarsaNovinRayCoreModule, BarsaReadonlyDirective, BarsaSapUiFormPageModule, BarsaStorageService, BaseColumnPropsComponent, BaseComponent, BaseController, BaseDirective, BaseDynamicComponent, BaseFormToolbaritemPropsComponent, BaseItemContentPropsComponent, BaseModule, BaseReportModel, BaseUlvSettingComponent, BaseViewContentPropsComponent, BaseViewItemPropsComponent, BaseViewPropsComponent, BbbTranslatePipe, BodyClickDirective, BoolControlInfoModel, BreadcrumbService, ButtonLoadingComponent, CalculateControlInfoModel, CanUploadFilePipe, CardMediaSizePipe, ChangeLayoutInfoCustomUi, ChunkArrayPipe, CodeEditorControlInfoModel, ColSetting, ColumnCustomComponentPipe, ColumnCustomUiPipe, ColumnIconPipe, ColumnResizerDirective, ColumnService, ColumnValueDirective, ColumnValueOfParametersPipe, ColumnValuePipe, ComboRowImagePipe, CommandControlInfoModel, ContainerComponent, ContainerService, ContextMenuPipe, ControlUiPipe, ConvertToStylePipe, CopyDirective, CountDownDirective, CustomCommand, CustomInjector, CustomRouteReuseStategy, DIALOG_SERVICE, DateHijriService, DateMiladiService, DateRanges, DateService, DateShamsiService, DateTimeControlInfoModel, DeviceWidth, DialogParams, DynamicCommandDirective, DynamicComponentService, DynamicDarkColorPipe, DynamicFormComponent, DynamicFormToolbaritemComponent, DynamicItemComponent, DynamicLayoutComponent, DynamicRootVariableDirective, DynamicStyleDirective, DynamicTileGroupComponent, EllapsisTextDirective, EllipsifyDirective, EmptyPageComponent, EmptyPageWithRouterAndRouterOutletComponent, EnumControlInfoModel, ExecuteDynamicCommand, ExecuteWorkflowChoiceDef, FORM_DIALOG_COMPONENT, FieldBaseComponent, FieldDirective, FieldInfoTypeEnum, FieldUiComponent, FileControlInfoModel, FileInfoCountPipe, FilePictureInfoModel, FilesValidationHelper, FillAllLayoutControls, FillEmptySpaceDirective, FilterColumnsByDetailsPipe, FilterInlineActionListPipe, FilterPipe, FilterStringPipe, FilterTabPipe, FilterToolbarControlPipe, FilterWorkflowInMobilePipe, FindColumnByDbNamePipe, FindGroup, FindLayoutSettingFromLayout94, FindPreviewColumnPipe, FindToolbarItem, FioriIconPipe, FormBaseComponent, FormCloseDirective, FormComponent, FormFieldReportPageComponent, FormNewComponent, FormPageBaseComponent, FormPageComponent, FormPanelService, FormPropsBaseComponent, FormService, FormToolbarBaseComponent, GaugeControlInfoModel, GeneralControlInfoModel, GetAllColumnsSorted, GetAllHorizontalFromLayout94, GetDefaultMoObjectInfo, GetImgTags, GetVisibleValue, GridSetting, GroupBy, GroupByPipe, GroupByService, HeaderFacetValuePipe, HideAcceptCancelButtonsPipe, HideColumnsInmobilePipe, HistoryControlInfoModel, HorizontalLayoutService, HorizontalResponsiveDirective, IconControlInfoModel, ImageLazyDirective, ImageMimeType, ImagetoPrint, InMemoryStorageService, IndexedDbService, InputNumber, IntersectionObserverDirective, IntersectionStatus, IsDarkMode, IsExpandedNodePipe, IsImagePipe, ItemsRendererDirective, LabelStarTrimPipe, LabelmandatoryDirective, LayoutItemBaseComponent, LayoutMainContentService, LayoutPanelBaseComponent, LayoutService, LeafletLongPressDirective, LinearListControlInfoModel, LinearListHelper, ListCountPipe, ListRelationModel, LoadExternalFilesDirective, LocalStorageService, LogService, LoginSettingsResolver, MeasureFormTitleWidthDirective, MergeFieldsToColumnsPipe, MetaobjectDataModel, MetaobjectRelationModel, MoForReportModel, MoForReportModelBase, MoInfoUlvMoListPipe, MoInfoUlvPagingPipe, MoReportValueConcatPipe, MoReportValuePipe, MoValuePipe, MobileDirective, ModalRootComponent, MultipleGroupByPipe, NOTIFICATAION_POPUP_SERVER, NOTIFICATION_WEBWORKER_FACTORY, NetworkStatusService, NotFoundComponent, NotificationService, NowraptextDirective, NumberBaseComponent, NumberControlInfoModel, NumbersOnlyInputDirective, NumeralPipe, OverflowTextDirective, PageBaseComponent, PageWithFormHandlerBaseComponent, PdfMimeType, PictureFieldSourcePipe, PictureFileControlInfoModel, PlaceHolderDirective, PortalDynamicPageResolver, PortalFormPageResolver, PortalPageComponent, PortalPageResolver, PortalPageSidebarComponent, PortalReportPageResolver, PortalService, PreventDefaulEvent, PreventDefaultDirective, PrintFilesDirective, PrintImage, PromptUpdateService, RabetehAkseTakiListiControlInfoModel, RedirectHomeGuard, RedirectReportNavigatorCommandComponent, RelatedReportControlInfoModel, RelationListControlInfoModel, RemoveNewlinePipe, RenderUlvDirective, RenderUlvPaginDirective, RenderUlvViewerDirective, ReplacePipe, ReportBaseComponent, ReportBaseInfo, ReportCalendarModel, ReportContainerComponent, ReportExtraInfo, ReportField, ReportFormModel, ReportItemBaseComponent, ReportListModel, ReportModel, ReportTreeModel, ReportViewBaseComponent, ReportViewColumn, ResizableComponent, ResizableDirective, ResizableModule, ResizeObserverDirective, ReversePipe, RichStringControlInfoModel, RootPageComponent, RootPortalComponent, RouteFormChangeDirective, RoutingService, RowDataOption, RowNumberPipe, SanitizeTextPipe, SaveImageDirective, SaveImageToFile, SaveScrollPositionService, ScrollPersistDirective, ScrollToSelectedDirective, SelectionMode, SeperatorFixPipe, ServiceWorkerCommuncationService, ServiceWorkerNotificationService, ShellbarHeightService, ShortcutHandlerDirective, ShortcutRegisterDirective, SimplebarDirective, SingleRelationControlInfoModel, SortDirection, SortPipe, SortSetting, SplideSliderDirective, SplitPipe, StopPropagationDirective, StringControlInfoModel, StringToNumberPipe, SubformControlInfoModel, SystemBaseComponent, TOAST_SERVICE, TableHeaderWidthMode, TableResizerDirective, TabpageService, ThImageOrIconePipe, TileGroupBreadcrumResolver, TilePropsComponent, TlbButtonsPipe, ToolbarSettingsPipe, TooltipDirective, TotalSummaryPipe, UiService, UlvCommandDirective, UlvMainService, UnlimitSessionComponent, UntilInViewDirective, UploadService, VideoMimeType, VideoRecordingService, ViewBase, VisibleValuePipe, WebOtpDirective, WordMimeType, WorfkflowwChoiceCommandDirective, addCssVariableToRoot, availablePrefixes, calcContextMenuWidth, calculateColumnContent, calculateColumnWidth, calculateColumnWidthFitToContainer, calculateFreeColumnSize, calculateMoDataListContentWidthByColumnName, cancelRequestAnimationFrame, createFormPanelMetaConditions, createGridEditorFormPanel, easeInOutCubic, elementInViewport2, enumValueToStringSize, executeUlvCommandHandler, flattenTree, forbiddenValidator, formRoutes, formatBytes, fromEntries, fromIntersectionObserver, genrateInlineMoId, getAllItemsPerChildren, getColumnValueOfMoDataList, getComponentDefined, getControlList, getControlSizeMode, getDateService, getDeviceIsDesktop, getDeviceIsMobile, getDeviceIsPhone, getDeviceIsTablet, getFieldValue, getFocusableTagNames, getFormSettings, getGridSettings, getHeaderValue, getIcon, getImagePath, getLabelWidth, getLayout94ObjectInfo, getLayoutControl, getNewMoGridEditor, getParentHeight, getRequestAnimationFrame, getResetGridSettings, getTargetRect, getUniqueId, getValidExtension, isFF, isFirefox, isFunction, isImage, isInLocalMode, isSafari, isTargetWindow, measureText, measureText2, measureTextBy, mobile_regex, nullOrUndefinedString, number_only, requestAnimationFramePolyfill, setColumnWidthByMaxMoContentWidth, setOneDepthLevel, setTableThWidth, shallowEqual, stopPropagation, throwIfAlreadyLoaded, toNumber, validateAllFormFields };
16662
16827
  //# sourceMappingURL=barsa-novin-ray-core.mjs.map