@churchillliving/se-ui-toolkit 6.53.395 → 6.53.397

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,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('primeng/api'), require('@angular/core'), require('primeng/dynamicdialog'), require('file-saver'), require('jspdf'), require('@angular/common'), require('ngx-toastr'), require('@angular/common/http'), require('rxjs'), require('@angular/platform-browser'), require('@angular/router'), require('primeng/table'), require('primeng/multiselect'), require('@angular/forms'), require('@angular/platform-browser/animations'), require('primeng/tabview'), require('primeng/dropdown'), require('primeng/calendar'), require('primeng/button'), require('primeng/ripple'), require('primeng/checkbox'), require('primeng/inputtext'), require('primeng/tristatecheckbox'), require('primeng/inputtextarea'), require('primeng/tooltip'), require('primeng/panelmenu'), require('ngx-cookie-service'), require('primeng/menu'), require('primeng/galleria'), require('primeng/autocomplete'), require('primeng/accordion'), require('primeng/confirmdialog'), require('primeng/messages'), require('primeng/progressspinner'), require('primeng/inputnumber'), require('primeng/avatar'), require('primeng/card'), require('@angular/cdk/drag-drop'), require('primeng/inputswitch')) :
3
- typeof define === 'function' && define.amd ? define('@churchillliving/se-ui-toolkit', ['exports', 'primeng/api', '@angular/core', 'primeng/dynamicdialog', 'file-saver', 'jspdf', '@angular/common', 'ngx-toastr', '@angular/common/http', 'rxjs', '@angular/platform-browser', '@angular/router', 'primeng/table', 'primeng/multiselect', '@angular/forms', '@angular/platform-browser/animations', 'primeng/tabview', 'primeng/dropdown', 'primeng/calendar', 'primeng/button', 'primeng/ripple', 'primeng/checkbox', 'primeng/inputtext', 'primeng/tristatecheckbox', 'primeng/inputtextarea', 'primeng/tooltip', 'primeng/panelmenu', 'ngx-cookie-service', 'primeng/menu', 'primeng/galleria', 'primeng/autocomplete', 'primeng/accordion', 'primeng/confirmdialog', 'primeng/messages', 'primeng/progressspinner', 'primeng/inputnumber', 'primeng/avatar', 'primeng/card', '@angular/cdk/drag-drop', 'primeng/inputswitch'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.churchillliving = global.churchillliving || {}, global.churchillliving["se-ui-toolkit"] = {}), global.api, global.ng.core, global.dynamicdialog, global.fileSaver, global.jsPDF, global.ng.common, global.ngxToastr, global.ng.common.http, global.rxjs, global.ng.platformBrowser, global.ng.router, global.table, global.multiselect, global.ng.forms, global.ng.platformBrowser.animations, global.tabview, global.dropdown, global.calendar, global.button, global.ripple, global.checkbox, global.inputtext, global.tristatecheckbox, global.inputtextarea, global.tooltip, global.panelmenu, global.ngxCookieService, global.menu, global.galleria, global.autocomplete, global.accordion, global.confirmdialog, global.messages, global.progressspinner, global.inputnumber, global.avatar, global.card, global.ng.cdk.dragDrop, global.inputswitch));
5
- })(this, (function (exports, api, i0, dynamicdialog, fileSaver, jsPDF, i1$1, ngxToastr, i1, rxjs, platformBrowser, router, table, multiselect, forms, animations, tabview, dropdown, calendar, button, ripple, checkbox, inputtext, tristatecheckbox, inputtextarea, tooltip, panelmenu, ngxCookieService, menu, galleria, autocomplete, accordion, confirmdialog, messages, progressspinner, inputnumber, avatar, card, dragDrop, inputswitch) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('primeng/api'), require('@angular/core'), require('primeng/dynamicdialog'), require('file-saver'), require('jspdf'), require('@angular/common'), require('ngx-toastr'), require('@angular/common/http'), require('rxjs'), require('@angular/platform-browser'), require('@angular/router'), require('primeng/table'), require('primeng/multiselect'), require('@angular/forms'), require('@angular/platform-browser/animations'), require('primeng/tabview'), require('primeng/dropdown'), require('primeng/calendar'), require('primeng/button'), require('primeng/ripple'), require('primeng/checkbox'), require('primeng/inputtext'), require('primeng/tristatecheckbox'), require('primeng/inputtextarea'), require('primeng/tooltip'), require('primeng/panelmenu'), require('ngx-cookie-service'), require('@angular/cdk/portal'), require('primeng/menu'), require('primeng/galleria'), require('primeng/autocomplete'), require('primeng/accordion'), require('primeng/confirmdialog'), require('primeng/messages'), require('primeng/progressspinner'), require('primeng/inputnumber'), require('primeng/avatar'), require('primeng/card'), require('@angular/cdk/drag-drop'), require('primeng/inputswitch')) :
3
+ typeof define === 'function' && define.amd ? define('@churchillliving/se-ui-toolkit', ['exports', 'primeng/api', '@angular/core', 'primeng/dynamicdialog', 'file-saver', 'jspdf', '@angular/common', 'ngx-toastr', '@angular/common/http', 'rxjs', '@angular/platform-browser', '@angular/router', 'primeng/table', 'primeng/multiselect', '@angular/forms', '@angular/platform-browser/animations', 'primeng/tabview', 'primeng/dropdown', 'primeng/calendar', 'primeng/button', 'primeng/ripple', 'primeng/checkbox', 'primeng/inputtext', 'primeng/tristatecheckbox', 'primeng/inputtextarea', 'primeng/tooltip', 'primeng/panelmenu', 'ngx-cookie-service', '@angular/cdk/portal', 'primeng/menu', 'primeng/galleria', 'primeng/autocomplete', 'primeng/accordion', 'primeng/confirmdialog', 'primeng/messages', 'primeng/progressspinner', 'primeng/inputnumber', 'primeng/avatar', 'primeng/card', '@angular/cdk/drag-drop', 'primeng/inputswitch'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.churchillliving = global.churchillliving || {}, global.churchillliving["se-ui-toolkit"] = {}), global.api, global.ng.core, global.dynamicdialog, global.fileSaver, global.jsPDF, global.ng.common, global.ngxToastr, global.ng.common.http, global.rxjs, global.ng.platformBrowser, global.ng.router, global.table, global.multiselect, global.ng.forms, global.ng.platformBrowser.animations, global.tabview, global.dropdown, global.calendar, global.button, global.ripple, global.checkbox, global.inputtext, global.tristatecheckbox, global.inputtextarea, global.tooltip, global.panelmenu, global.ngxCookieService, global.ng.cdk.portal, global.menu, global.galleria, global.autocomplete, global.accordion, global.confirmdialog, global.messages, global.progressspinner, global.inputnumber, global.avatar, global.card, global.ng.cdk.dragDrop, global.inputswitch));
5
+ })(this, (function (exports, api, i0, dynamicdialog, fileSaver, jsPDF, i1$1, ngxToastr, i1, rxjs, platformBrowser, router, table, multiselect, forms, animations, tabview, dropdown, calendar, button, ripple, checkbox, inputtext, tristatecheckbox, inputtextarea, tooltip, panelmenu, ngxCookieService, portal, menu, galleria, autocomplete, accordion, confirmdialog, messages, progressspinner, inputnumber, avatar, card, dragDrop, inputswitch) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -7381,9 +7381,10 @@
7381
7381
  header: ((_d = formField.hyperlink.data) === null || _d === void 0 ? void 0 : _d.header)
7382
7382
  ? (_e = formField.hyperlink.data) === null || _e === void 0 ? void 0 : _e.header
7383
7383
  : '',
7384
- width: formField.hyperlink.width ? formField.hyperlink.width : '90%',
7384
+ width: formField.hyperlink.width ? formField.hyperlink.width : '',
7385
+ style: formField.hyperlink.width ? '' : { 'max-width': 'fit-content' },
7385
7386
  height: formField.hyperlink.height ? formField.hyperlink.height : '80%',
7386
- data: formField.hyperlink.params,
7387
+ data: formField.hyperlink.params
7387
7388
  });
7388
7389
  var componentName = (_g = (_f = formField.hyperlink) === null || _f === void 0 ? void 0 : _f.component) === null || _g === void 0 ? void 0 : _g.name;
7389
7390
  if (componentName) {
@@ -8293,6 +8294,11 @@
8293
8294
  LEFT: 'left-sidebar',
8294
8295
  RIGHT: 'right-sidebar',
8295
8296
  };
8297
+ exports.ESidebarTarget = void 0;
8298
+ (function (ESidebarTarget) {
8299
+ ESidebarTarget["BLANK"] = "_blank";
8300
+ ESidebarTarget["SELF"] = "_self";
8301
+ })(exports.ESidebarTarget || (exports.ESidebarTarget = {}));
8296
8302
  exports.ESidebarAction = void 0;
8297
8303
  (function (ESidebarAction) {
8298
8304
  ESidebarAction["NAVIGATION"] = "navigation";
@@ -8300,14 +8306,102 @@
8300
8306
  ESidebarAction["IFRAME"] = "_iframe";
8301
8307
  })(exports.ESidebarAction || (exports.ESidebarAction = {}));
8302
8308
 
8309
+ var SideBarService = /** @class */ (function () {
8310
+ function SideBarService(injector, componentFactoryResolver, applicationRef) {
8311
+ this.injector = injector;
8312
+ this.componentFactoryResolver = componentFactoryResolver;
8313
+ this.applicationRef = applicationRef;
8314
+ }
8315
+ /**
8316
+ * Checks parent menu and expands it if current route exists in its child menus.
8317
+ * @param menuLabel
8318
+ * @returns {boolean}
8319
+ */
8320
+ SideBarService.prototype.isMenuExpanded = function (currentRoute, items, menuLabel) {
8321
+ var _a, _b;
8322
+ if (items && items.length) {
8323
+ // check currentRoute contains loadDataForEdit or not
8324
+ currentRoute = currentRoute.includes('?') ? currentRoute.split('?')[0] : currentRoute;
8325
+ var detailPage_1 = '';
8326
+ if ((_a = currentRoute === null || currentRoute === void 0 ? void 0 : currentRoute.toString()) === null || _a === void 0 ? void 0 : _a.includes("list")) {
8327
+ detailPage_1 = currentRoute.replace('list', 'detail');
8328
+ }
8329
+ var currentIndex = items.findIndex(function (menu) { var _a; return ((_a = menu.label) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === (menuLabel === null || menuLabel === void 0 ? void 0 : menuLabel.toLowerCase()); });
8330
+ var matchedItems = [];
8331
+ if (currentIndex > -1) {
8332
+ matchedItems = (_b = items[currentIndex]) === null || _b === void 0 ? void 0 : _b.items;
8333
+ }
8334
+ return matchedItems.length > 0 ? matchedItems.some(function (item) { return item.routerLink && (currentRoute === item.routerLink[0] || currentRoute === detailPage_1); }) : false;
8335
+ }
8336
+ return false;
8337
+ };
8338
+ SideBarService.prototype.setSidebarPropValues = function (sidebar, section, props) {
8339
+ sidebar.map(function (sidebarItem) {
8340
+ var _a;
8341
+ if (((_a = sidebarItem.section) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === section.toLowerCase()) {
8342
+ props.map(function (prop) {
8343
+ var _a, _b;
8344
+ if (((_a = prop.name) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'data' && ((_b = sidebarItem.data) === null || _b === void 0 ? void 0 : _b.data)) {
8345
+ sidebarItem.data.data = prop.value;
8346
+ }
8347
+ else {
8348
+ return setPropValue(sidebarItem, prop);
8349
+ }
8350
+ });
8351
+ }
8352
+ });
8353
+ };
8354
+ SideBarService.prototype.createWindowInstance = function (menu, windowInstance) {
8355
+ if (windowInstance) {
8356
+ // Create a PortalOutlet with the body of the new window document
8357
+ var outlet = new portal.DomPortalOutlet(windowInstance.document.body, this.componentFactoryResolver, this.applicationRef, this.injector);
8358
+ // Copy stylesheet link from parent window
8359
+ this.styleSheetElement = this.getStyleSheetElement();
8360
+ windowInstance.document.head.appendChild(this.styleSheetElement);
8361
+ windowInstance.document.body.innerText = '';
8362
+ this.attachComponentContainer(outlet, menu);
8363
+ }
8364
+ };
8365
+ SideBarService.prototype.attachComponentContainer = function (outlet, menu) {
8366
+ var containerPortal = new portal.ComponentPortal(menu.component, null);
8367
+ var containerRef = outlet.attach(containerPortal);
8368
+ return containerRef.instance;
8369
+ };
8370
+ SideBarService.prototype.getStyleSheetElement = function () {
8371
+ var styleSheetElement = document.createElement('link');
8372
+ document.querySelectorAll('link').forEach(function (htmlElement) {
8373
+ if (htmlElement.rel === 'stylesheet') {
8374
+ var absoluteUrl = new URL(htmlElement.href).href;
8375
+ styleSheetElement.rel = 'stylesheet';
8376
+ styleSheetElement.href = absoluteUrl;
8377
+ }
8378
+ });
8379
+ return styleSheetElement;
8380
+ };
8381
+ return SideBarService;
8382
+ }());
8383
+ /** @nocollapse */ SideBarService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function SideBarService_Factory() { return new SideBarService(i0__namespace.ɵɵinject(i0__namespace.INJECTOR), i0__namespace.ɵɵinject(i0__namespace.ComponentFactoryResolver), i0__namespace.ɵɵinject(i0__namespace.ApplicationRef)); }, token: SideBarService, providedIn: "root" });
8384
+ SideBarService.decorators = [
8385
+ { type: i0.Injectable, args: [{
8386
+ providedIn: 'root',
8387
+ },] }
8388
+ ];
8389
+ /** @nocollapse */
8390
+ SideBarService.ctorParameters = function () { return [
8391
+ { type: i0.Injector },
8392
+ { type: i0.ComponentFactoryResolver },
8393
+ { type: i0.ApplicationRef }
8394
+ ]; };
8395
+
8303
8396
  var SidebarComponent = /** @class */ (function () {
8304
- function SidebarComponent(instance, authService, dialogService, router, pageLoggerService, hyperlinkService) {
8397
+ function SidebarComponent(instance, authService, dialogService, router, pageLoggerService, hyperlinkService, sidebarService) {
8305
8398
  this.instance = instance;
8306
8399
  this.authService = authService;
8307
8400
  this.dialogService = dialogService;
8308
8401
  this.router = router;
8309
8402
  this.pageLoggerService = pageLoggerService;
8310
8403
  this.hyperlinkService = hyperlinkService;
8404
+ this.sidebarService = sidebarService;
8311
8405
  this.toggleMenu = false;
8312
8406
  this.openDialogs = [];
8313
8407
  this.navHidden = false;
@@ -8348,7 +8442,12 @@
8348
8442
  _this.navigateToSection(x, item);
8349
8443
  }
8350
8444
  else if (x.action && x.action === exports.ESidebarAction.OPENDIALOG) {
8351
- _this.openDialog(x, item);
8445
+ if (x.target && x.target === exports.ESidebarTarget.BLANK) {
8446
+ _this.navigateComponentToNewTab(x);
8447
+ }
8448
+ else {
8449
+ _this.openDialog(x, item);
8450
+ }
8352
8451
  }
8353
8452
  else if (x.action && x.action === exports.ESidebarAction.IFRAME) {
8354
8453
  _this.loadIFrame(x, item);
@@ -8366,6 +8465,18 @@
8366
8465
  disabled: x.disabled,
8367
8466
  }); });
8368
8467
  };
8468
+ //ref link: https://medium.com/@saranya.thangaraj/open-angular-component-in-a-new-tab-without-bootstrapping-the-whole-app-again-e329af460e92
8469
+ SidebarComponent.prototype.navigateComponentToNewTab = function (menu) {
8470
+ var _this = this;
8471
+ var winRef = window.open();
8472
+ if (winRef.location.href === 'about:blank') {
8473
+ winRef.location.href = this.router.url;
8474
+ }
8475
+ // Wait for window instance to be created
8476
+ setTimeout(function () {
8477
+ _this.sidebarService.createWindowInstance(menu, winRef);
8478
+ }, 750);
8479
+ };
8369
8480
  SidebarComponent.prototype.setMenuTitle = function (x) {
8370
8481
  return x.tooltip ? x.tooltip : !x.label ? x.section : '';
8371
8482
  };
@@ -8575,7 +8686,8 @@
8575
8686
  { type: dynamicdialog.DialogService },
8576
8687
  { type: router.Router },
8577
8688
  { type: PageLoggerService },
8578
- { type: HyperlinkService }
8689
+ { type: HyperlinkService },
8690
+ { type: SideBarService }
8579
8691
  ]; };
8580
8692
  SidebarComponent.propDecorators = {
8581
8693
  navHidden: [{ type: i0.Input }],
@@ -10170,59 +10282,6 @@
10170
10282
  EHeaderFormatType["DECIMAL"] = "decimal";
10171
10283
  })(exports.EHeaderFormatType || (exports.EHeaderFormatType = {}));
10172
10284
 
10173
- var SideBarService = /** @class */ (function () {
10174
- function SideBarService() {
10175
- }
10176
- /**
10177
- * Checks parent menu and expands it if current route exists in its child menus.
10178
- * @param menuLabel
10179
- * @returns {boolean}
10180
- */
10181
- SideBarService.prototype.isMenuExpanded = function (currentRoute, items, menuLabel) {
10182
- var _a, _b;
10183
- if (items && items.length) {
10184
- // check currentRoute contains loadDataForEdit or not
10185
- currentRoute = currentRoute.includes('?') ? currentRoute.split('?')[0] : currentRoute;
10186
- var detailPage_1 = '';
10187
- if ((_a = currentRoute === null || currentRoute === void 0 ? void 0 : currentRoute.toString()) === null || _a === void 0 ? void 0 : _a.includes("list")) {
10188
- detailPage_1 = currentRoute.replace('list', 'detail');
10189
- }
10190
- var currentIndex = items.findIndex(function (menu) { var _a; return ((_a = menu.label) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === (menuLabel === null || menuLabel === void 0 ? void 0 : menuLabel.toLowerCase()); });
10191
- var matchedItems = [];
10192
- if (currentIndex > -1) {
10193
- matchedItems = (_b = items[currentIndex]) === null || _b === void 0 ? void 0 : _b.items;
10194
- }
10195
- return matchedItems.length > 0 ? matchedItems.some(function (item) { return item.routerLink && (currentRoute === item.routerLink[0] || currentRoute === detailPage_1); }) : false;
10196
- }
10197
- return false;
10198
- };
10199
- SideBarService.prototype.setSidebarPropValues = function (sidebar, section, props) {
10200
- sidebar.map(function (sidebarItem) {
10201
- var _a;
10202
- if (((_a = sidebarItem.section) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === section.toLowerCase()) {
10203
- props.map(function (prop) {
10204
- var _a, _b;
10205
- if (((_a = prop.name) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'data' && ((_b = sidebarItem.data) === null || _b === void 0 ? void 0 : _b.data)) {
10206
- sidebarItem.data.data = prop.value;
10207
- }
10208
- else {
10209
- return setPropValue(sidebarItem, prop);
10210
- }
10211
- });
10212
- }
10213
- });
10214
- };
10215
- return SideBarService;
10216
- }());
10217
- /** @nocollapse */ SideBarService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function SideBarService_Factory() { return new SideBarService(); }, token: SideBarService, providedIn: "root" });
10218
- SideBarService.decorators = [
10219
- { type: i0.Injectable, args: [{
10220
- providedIn: 'root',
10221
- },] }
10222
- ];
10223
- /** @nocollapse */
10224
- SideBarService.ctorParameters = function () { return []; };
10225
-
10226
10285
  var HeaderService = /** @class */ (function () {
10227
10286
  function HeaderService() {
10228
10287
  }