@churchillliving/se-ui-toolkit 6.53.396 → 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.
- package/bundles/churchillliving-se-ui-toolkit.umd.js +118 -60
- package/bundles/churchillliving-se-ui-toolkit.umd.js.map +1 -1
- package/churchillliving-se-ui-toolkit.metadata.json +1 -1
- package/esm2015/lib/components/base/sidebar/sidebar.component.js +24 -5
- package/esm2015/lib/models/sidebar.model.js +6 -1
- package/esm2015/lib/services/sidebar.service.js +41 -5
- package/fesm2015/churchillliving-se-ui-toolkit.js +115 -56
- package/fesm2015/churchillliving-se-ui-toolkit.js.map +1 -1
- package/lib/components/base/sidebar/sidebar.component.d.ts +4 -1
- package/lib/models/sidebar.model.d.ts +5 -0
- package/lib/services/sidebar.service.d.ts +9 -1
- package/package.json +1 -1
|
@@ -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
|
|
|
@@ -8294,6 +8294,11 @@
|
|
|
8294
8294
|
LEFT: 'left-sidebar',
|
|
8295
8295
|
RIGHT: 'right-sidebar',
|
|
8296
8296
|
};
|
|
8297
|
+
exports.ESidebarTarget = void 0;
|
|
8298
|
+
(function (ESidebarTarget) {
|
|
8299
|
+
ESidebarTarget["BLANK"] = "_blank";
|
|
8300
|
+
ESidebarTarget["SELF"] = "_self";
|
|
8301
|
+
})(exports.ESidebarTarget || (exports.ESidebarTarget = {}));
|
|
8297
8302
|
exports.ESidebarAction = void 0;
|
|
8298
8303
|
(function (ESidebarAction) {
|
|
8299
8304
|
ESidebarAction["NAVIGATION"] = "navigation";
|
|
@@ -8301,14 +8306,102 @@
|
|
|
8301
8306
|
ESidebarAction["IFRAME"] = "_iframe";
|
|
8302
8307
|
})(exports.ESidebarAction || (exports.ESidebarAction = {}));
|
|
8303
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
|
+
|
|
8304
8396
|
var SidebarComponent = /** @class */ (function () {
|
|
8305
|
-
function SidebarComponent(instance, authService, dialogService, router, pageLoggerService, hyperlinkService) {
|
|
8397
|
+
function SidebarComponent(instance, authService, dialogService, router, pageLoggerService, hyperlinkService, sidebarService) {
|
|
8306
8398
|
this.instance = instance;
|
|
8307
8399
|
this.authService = authService;
|
|
8308
8400
|
this.dialogService = dialogService;
|
|
8309
8401
|
this.router = router;
|
|
8310
8402
|
this.pageLoggerService = pageLoggerService;
|
|
8311
8403
|
this.hyperlinkService = hyperlinkService;
|
|
8404
|
+
this.sidebarService = sidebarService;
|
|
8312
8405
|
this.toggleMenu = false;
|
|
8313
8406
|
this.openDialogs = [];
|
|
8314
8407
|
this.navHidden = false;
|
|
@@ -8349,7 +8442,12 @@
|
|
|
8349
8442
|
_this.navigateToSection(x, item);
|
|
8350
8443
|
}
|
|
8351
8444
|
else if (x.action && x.action === exports.ESidebarAction.OPENDIALOG) {
|
|
8352
|
-
|
|
8445
|
+
if (x.target && x.target === exports.ESidebarTarget.BLANK) {
|
|
8446
|
+
_this.navigateComponentToNewTab(x);
|
|
8447
|
+
}
|
|
8448
|
+
else {
|
|
8449
|
+
_this.openDialog(x, item);
|
|
8450
|
+
}
|
|
8353
8451
|
}
|
|
8354
8452
|
else if (x.action && x.action === exports.ESidebarAction.IFRAME) {
|
|
8355
8453
|
_this.loadIFrame(x, item);
|
|
@@ -8367,6 +8465,18 @@
|
|
|
8367
8465
|
disabled: x.disabled,
|
|
8368
8466
|
}); });
|
|
8369
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
|
+
};
|
|
8370
8480
|
SidebarComponent.prototype.setMenuTitle = function (x) {
|
|
8371
8481
|
return x.tooltip ? x.tooltip : !x.label ? x.section : '';
|
|
8372
8482
|
};
|
|
@@ -8576,7 +8686,8 @@
|
|
|
8576
8686
|
{ type: dynamicdialog.DialogService },
|
|
8577
8687
|
{ type: router.Router },
|
|
8578
8688
|
{ type: PageLoggerService },
|
|
8579
|
-
{ type: HyperlinkService }
|
|
8689
|
+
{ type: HyperlinkService },
|
|
8690
|
+
{ type: SideBarService }
|
|
8580
8691
|
]; };
|
|
8581
8692
|
SidebarComponent.propDecorators = {
|
|
8582
8693
|
navHidden: [{ type: i0.Input }],
|
|
@@ -10171,59 +10282,6 @@
|
|
|
10171
10282
|
EHeaderFormatType["DECIMAL"] = "decimal";
|
|
10172
10283
|
})(exports.EHeaderFormatType || (exports.EHeaderFormatType = {}));
|
|
10173
10284
|
|
|
10174
|
-
var SideBarService = /** @class */ (function () {
|
|
10175
|
-
function SideBarService() {
|
|
10176
|
-
}
|
|
10177
|
-
/**
|
|
10178
|
-
* Checks parent menu and expands it if current route exists in its child menus.
|
|
10179
|
-
* @param menuLabel
|
|
10180
|
-
* @returns {boolean}
|
|
10181
|
-
*/
|
|
10182
|
-
SideBarService.prototype.isMenuExpanded = function (currentRoute, items, menuLabel) {
|
|
10183
|
-
var _a, _b;
|
|
10184
|
-
if (items && items.length) {
|
|
10185
|
-
// check currentRoute contains loadDataForEdit or not
|
|
10186
|
-
currentRoute = currentRoute.includes('?') ? currentRoute.split('?')[0] : currentRoute;
|
|
10187
|
-
var detailPage_1 = '';
|
|
10188
|
-
if ((_a = currentRoute === null || currentRoute === void 0 ? void 0 : currentRoute.toString()) === null || _a === void 0 ? void 0 : _a.includes("list")) {
|
|
10189
|
-
detailPage_1 = currentRoute.replace('list', 'detail');
|
|
10190
|
-
}
|
|
10191
|
-
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()); });
|
|
10192
|
-
var matchedItems = [];
|
|
10193
|
-
if (currentIndex > -1) {
|
|
10194
|
-
matchedItems = (_b = items[currentIndex]) === null || _b === void 0 ? void 0 : _b.items;
|
|
10195
|
-
}
|
|
10196
|
-
return matchedItems.length > 0 ? matchedItems.some(function (item) { return item.routerLink && (currentRoute === item.routerLink[0] || currentRoute === detailPage_1); }) : false;
|
|
10197
|
-
}
|
|
10198
|
-
return false;
|
|
10199
|
-
};
|
|
10200
|
-
SideBarService.prototype.setSidebarPropValues = function (sidebar, section, props) {
|
|
10201
|
-
sidebar.map(function (sidebarItem) {
|
|
10202
|
-
var _a;
|
|
10203
|
-
if (((_a = sidebarItem.section) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === section.toLowerCase()) {
|
|
10204
|
-
props.map(function (prop) {
|
|
10205
|
-
var _a, _b;
|
|
10206
|
-
if (((_a = prop.name) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'data' && ((_b = sidebarItem.data) === null || _b === void 0 ? void 0 : _b.data)) {
|
|
10207
|
-
sidebarItem.data.data = prop.value;
|
|
10208
|
-
}
|
|
10209
|
-
else {
|
|
10210
|
-
return setPropValue(sidebarItem, prop);
|
|
10211
|
-
}
|
|
10212
|
-
});
|
|
10213
|
-
}
|
|
10214
|
-
});
|
|
10215
|
-
};
|
|
10216
|
-
return SideBarService;
|
|
10217
|
-
}());
|
|
10218
|
-
/** @nocollapse */ SideBarService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function SideBarService_Factory() { return new SideBarService(); }, token: SideBarService, providedIn: "root" });
|
|
10219
|
-
SideBarService.decorators = [
|
|
10220
|
-
{ type: i0.Injectable, args: [{
|
|
10221
|
-
providedIn: 'root',
|
|
10222
|
-
},] }
|
|
10223
|
-
];
|
|
10224
|
-
/** @nocollapse */
|
|
10225
|
-
SideBarService.ctorParameters = function () { return []; };
|
|
10226
|
-
|
|
10227
10285
|
var HeaderService = /** @class */ (function () {
|
|
10228
10286
|
function HeaderService() {
|
|
10229
10287
|
}
|