@churchillliving/se-ui-toolkit 6.53.409 → 6.53.410

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.
@@ -8414,6 +8414,7 @@
8414
8414
  this.hyperlinkService = hyperlinkService;
8415
8415
  this.sidebarService = sidebarService;
8416
8416
  this.toggleMenu = false;
8417
+ this.loadComponentName = '';
8417
8418
  this.openDialogs = [];
8418
8419
  this.navHidden = false;
8419
8420
  this.collapseSidebar = false;
@@ -8432,7 +8433,27 @@
8432
8433
  enumerable: false,
8433
8434
  configurable: true
8434
8435
  });
8435
- SidebarComponent.prototype.ngOnInit = function () { };
8436
+ SidebarComponent.prototype.ngOnInit = function () {
8437
+ var _a, _b;
8438
+ if ((_a = this.router.url.toString()) === null || _a === void 0 ? void 0 : _a.includes('temp_comp=')) {
8439
+ var componentName = (_b = this.router.url) === null || _b === void 0 ? void 0 : _b.split('temp_comp=')[1];
8440
+ if (componentName) {
8441
+ this.loadComponentName = componentName;
8442
+ }
8443
+ }
8444
+ if (this.loadComponentName) {
8445
+ this.openDynamicComponetonLoad();
8446
+ }
8447
+ };
8448
+ SidebarComponent.prototype.openDynamicComponetonLoad = function () {
8449
+ var _this = this;
8450
+ var _a;
8451
+ (_a = this.sidebarItemsList) === null || _a === void 0 ? void 0 : _a.forEach(function (item) {
8452
+ if (item.action === exports.ESidebarAction.OPENDIALOG && exports.ESidebarTarget.BLANK && item.component.name === _this.loadComponentName) {
8453
+ _this.navigateComponentToNewTab(item, false);
8454
+ }
8455
+ });
8456
+ };
8436
8457
  SidebarComponent.prototype.initializeSideBar = function () {
8437
8458
  var _this = this;
8438
8459
  this.roles = this.authService.getUserRoles();
@@ -8478,16 +8499,27 @@
8478
8499
  console.log('menu items', this.menuItems);
8479
8500
  };
8480
8501
  //ref link: https://medium.com/@saranya.thangaraj/open-angular-component-in-a-new-tab-without-bootstrapping-the-whole-app-again-e329af460e92
8481
- SidebarComponent.prototype.navigateComponentToNewTab = function (menu) {
8502
+ SidebarComponent.prototype.navigateComponentToNewTab = function (menu, onNewTab) {
8482
8503
  var _this = this;
8483
- var winRef = window.open();
8484
- if (winRef.location.href === 'about:blank') {
8485
- winRef.location.href = this.router.url;
8504
+ if (onNewTab === void 0) { onNewTab = true; }
8505
+ var _a, _b;
8506
+ var windowRef = window;
8507
+ var winRef;
8508
+ if (onNewTab) {
8509
+ winRef = window.open();
8510
+ if (winRef.location.href === 'about:blank') {
8511
+ if (this.router.url && ((_b = (_a = this.router.url) === null || _a === void 0 ? void 0 : _a.toString()) === null || _b === void 0 ? void 0 : _b.includes('?'))) {
8512
+ winRef.location.href = this.router.url + '&&temp_comp=' + menu.component.name;
8513
+ }
8514
+ else {
8515
+ winRef.location.href = this.router.url + "?temp_comp=" + menu.component.name;
8516
+ }
8517
+ }
8486
8518
  }
8487
8519
  // Wait for window instance to be created
8488
8520
  setTimeout(function () {
8489
- _this.sidebarService.createWindowInstance(menu, winRef);
8490
- }, 750);
8521
+ _this.sidebarService.createWindowInstance(menu, onNewTab ? winRef : windowRef);
8522
+ }, 900);
8491
8523
  };
8492
8524
  SidebarComponent.prototype.setMenuTitle = function (x) {
8493
8525
  return x.tooltip ? x.tooltip : !x.label ? x.section : '';