@energycap/components 0.27.2-ECAPID-377-Implement-Sidebar.20220120-1419 → 0.27.3-ECAPID-377-Nav-Item-Test.20220125-1635
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/energycap-components.umd.js +23 -6
- package/bundles/energycap-components.umd.js.map +1 -1
- package/bundles/energycap-components.umd.min.js +1 -1
- package/bundles/energycap-components.umd.min.js.map +1 -1
- package/energycap-components.metadata.json +1 -1
- package/esm2015/lib/controls/menu/menu.component.js +20 -4
- package/esm2015/lib/controls/navigation/nav-item-active.directive.js +3 -2
- package/esm2015/lib/shared/page/page-title/page-title.component.js +2 -2
- package/esm2015/lib/shared/page/page-view/page-view.component.js +2 -2
- package/fesm2015/energycap-components.js +23 -6
- package/fesm2015/energycap-components.js.map +1 -1
- package/lib/controls/menu/menu.component.d.ts +10 -0
- package/lib/controls/navigation/nav-item-active.directive.d.ts +6 -1
- package/package.json +1 -1
|
@@ -2653,6 +2653,12 @@
|
|
|
2653
2653
|
* Item currently highlighted by keyboard navigation
|
|
2654
2654
|
*/
|
|
2655
2655
|
this.highlightedItem = null;
|
|
2656
|
+
/**
|
|
2657
|
+
* Tells the menu to maintain the selected/lastSelected item. Turning this off is useful for
|
|
2658
|
+
* action type menus that are displayed on the screen at all times and you do not
|
|
2659
|
+
* want the item to be selected when clicked.
|
|
2660
|
+
*/
|
|
2661
|
+
this.maintainSelectedItem = true;
|
|
2656
2662
|
/**
|
|
2657
2663
|
* Emitted when `selected` is changed. Emits the referenced object.
|
|
2658
2664
|
*
|
|
@@ -2676,6 +2682,9 @@
|
|
|
2676
2682
|
*/
|
|
2677
2683
|
this.lastSelected = null;
|
|
2678
2684
|
}
|
|
2685
|
+
MenuComponent.prototype.onRouterLinkActivated = function (event) {
|
|
2686
|
+
this.selectItem(event.event, event.item);
|
|
2687
|
+
};
|
|
2679
2688
|
/**
|
|
2680
2689
|
* Sets & displays the interalized template based on
|
|
2681
2690
|
* the set template.
|
|
@@ -2755,8 +2764,14 @@
|
|
|
2755
2764
|
else {
|
|
2756
2765
|
this.onSelection(item);
|
|
2757
2766
|
}
|
|
2758
|
-
this.
|
|
2759
|
-
|
|
2767
|
+
if (this.maintainSelectedItem) {
|
|
2768
|
+
this.selected = item;
|
|
2769
|
+
this.lastSelected = item;
|
|
2770
|
+
}
|
|
2771
|
+
else {
|
|
2772
|
+
this.selected = null;
|
|
2773
|
+
this.lastSelected = null;
|
|
2774
|
+
}
|
|
2760
2775
|
}
|
|
2761
2776
|
};
|
|
2762
2777
|
/**
|
|
@@ -2977,7 +2992,7 @@
|
|
|
2977
2992
|
MenuComponent.decorators = [
|
|
2978
2993
|
{ type: i0.Component, args: [{
|
|
2979
2994
|
selector: 'ec-menu',
|
|
2980
|
-
template: "<nav>\r\n <div class=\"parent\"\r\n [class.no-data]=\"showNoItems && (!items || items.length === 0)\">\r\n <header id=\"{{id}}_header\"\r\n class=\"item-wrapper\"\r\n [class.is-selected]=\"highlightedItemIndex === -1\"\r\n *ngIf=\"parent\"\r\n (click)=\"back($event)\">\r\n <i class=\"ec-icon icon-angle-down rotate-90 flex-shrink\"></i>\r\n <span class=\"label text-truncate flex-grow\">{{parent?.label}}</span>\r\n </header>\r\n\r\n <ul id=\"{{id}}_list\">\r\n <li *ngFor=\"let item of items; index as i\"\r\n id=\"{{item.id || id + '_item' + i}}\"\r\n class=\"{{item.display || 'item'}} {{item.classList}}\"\r\n [attr.disabled]=\"item.disabled\"\r\n [hidden]=\"item.hidden\"\r\n ecNavItemActive=\"is-selected\"\r\n [ecNavItemActiveQueryParams]=\"item.queryParams\"\r\n [ecNavItemActiveUrl]=\"item.url\"\r\n [ecNavItemActiveExactMatch]='item.isActiveExactMatch'\r\n (routerLinkActivated)=\"
|
|
2995
|
+
template: "<nav>\r\n <div class=\"parent\"\r\n [class.no-data]=\"showNoItems && (!items || items.length === 0)\">\r\n <header id=\"{{id}}_header\"\r\n class=\"item-wrapper\"\r\n [class.is-selected]=\"highlightedItemIndex === -1\"\r\n *ngIf=\"parent\"\r\n (click)=\"back($event)\">\r\n <i class=\"ec-icon icon-angle-down rotate-90 flex-shrink\"></i>\r\n <span class=\"label text-truncate flex-grow\">{{parent?.label}}</span>\r\n </header>\r\n\r\n <ul id=\"{{id}}_list\">\r\n <li *ngFor=\"let item of items; index as i\"\r\n id=\"{{item.id || id + '_item' + i}}\"\r\n class=\"{{item.display || 'item'}} {{item.classList}}\"\r\n [attr.disabled]=\"item.disabled\"\r\n [hidden]=\"item.hidden\"\r\n ecNavItemActive=\"is-selected\"\r\n [ecNavItemCurrentItem]=\"item\"\r\n [ecNavItemActiveQueryParams]=\"item.queryParams\"\r\n [ecNavItemActiveUrl]=\"item.url\"\r\n [ecNavItemActiveExactMatch]='item.isActiveExactMatch'\r\n (routerLinkActivated)=\"onRouterLinkActivated($event)\"\r\n [ngClass]=\"{'is-highlighted':(selected === item && item?.display !== 'heading') || highlightedItem === item, 'is-link': item.url, 'is-disabled': item.disabled, 'is-readonly': item.readonly, 'is-checked': item.checked}\"\r\n (click)=\"selectItem($event, item)\">\r\n\r\n <a *ngIf=\"item.url && !item.externalLink\"\r\n id=\"{{item.id}}_link\"\r\n class=\"item-wrapper\"\r\n [routerLink]=\"item.url\"\r\n [queryParams]=\"item.queryParams || null\"\r\n target=\"{{item.target || '_self'}}\">\r\n\r\n <ng-container *ngTemplateOutlet=\"internalizedTemplate; context: {$implicit: item}\"></ng-container>\r\n </a>\r\n\r\n <a *ngIf=\"item.url && item.externalLink\"\r\n id=\"{{item.id}}_link\"\r\n class=\"item-wrapper\"\r\n href=\"{{item.url}}\"\r\n target=\"{{item.target || '_self'}}\">\r\n\r\n <ng-container *ngTemplateOutlet=\"internalizedTemplate; context: {$implicit: item}\"></ng-container>\r\n </a>\r\n\r\n <div *ngIf=\"!item.url\"\r\n class=\"item-wrapper\">\r\n <ng-container *ngTemplateOutlet=\"internalizedTemplate; context: {$implicit: item}\"></ng-container>\r\n </div>\r\n </li>\r\n </ul>\r\n\r\n <p class=\"no-data-message\">{{noDataText | translate}}</p>\r\n </div>\r\n\r\n <!-- Child menu (Rendered to the right) -->\r\n <ec-menu *ngIf=\"selected?.items\"\r\n id=\"{{id}}_child\"\r\n class=\"child\"\r\n [parent]=\"selected\"\r\n [items]=\"selected?.items\"\r\n [showNoItems]=\"true\"\r\n [templateType]=\"templateType\"\r\n [enableKeyNav]=\"true\"\r\n (selectedChanged)=\"onSelection($event)\"\r\n (menuClosed)=\"toggleChildMenu(false)\">\r\n </ec-menu>\r\n</nav>\r\n\r\n<!-- 'label' Item Template -->\r\n<ng-template #label\r\n let-item>\r\n <span id=\"{{item.id}}_label\"\r\n class=\"label\">{{item.label}}</span>\r\n\r\n <i class=\"ec-icon icon-angle-down rotate-270\" *ngIf=\"item?.items\"></i>\r\n</ng-template>\r\n\r\n<!-- 'checkAndLabel' Item Template -->\r\n<ng-template #checkAndLabel\r\n let-item>\r\n\r\n <i class=\"ec-icon icon-check ec-icon-sm\" *ngIf=\"item.display !== 'heading'\"></i>\r\n\r\n <i class=\"ec-icon {{item.icon}} ml-2\" *ngIf=\"item.icon\"></i>\r\n\r\n <span id=\"{{item.id}}_label\"\r\n class=\"label\">{{item.label}}</span>\r\n\r\n <i class=\"ec-icon icon-angle-down rotate-270\" *ngIf=\"item?.items\"></i>\r\n</ng-template>\r\n\r\n<!-- 'iconAndLabel' Item Template -->\r\n<ng-template #iconAndLabel\r\n let-item>\r\n\r\n <i class=\"ec-icon {{item.icon}}\"></i>\r\n\r\n <span id=\"{{item.id}}_label\"\r\n class=\"label\">{{item.label}}</span>\r\n\r\n <i class=\"ec-icon icon-angle-down rotate-270\" *ngIf=\"item?.items\"></i>\r\n</ng-template>",
|
|
2981
2996
|
styles: ["@-webkit-keyframes spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}:host{background-color:#fff;display:block;font-size:.875rem;font-weight:400}:host.open>nav>.child,:host.open>nav>.parent{height:100%;left:0;position:absolute;right:0;top:0;transition:transform .25s ease}:host.open>nav>.parent{transform:translateX(0)}:host.open>nav>.child{transform:translateX(100%)}:host.open-active>nav>.parent{transform:translateX(-100%)}:host.open-active>nav>.child{transform:translateX(0)}:host(.bg-transparent){background-color:transparent}:host-context(.is-always-open){height:100%}:host-context(.is-always-open) .item-wrapper{padding-left:1rem;padding-right:1rem}nav{height:100%;overflow:hidden}.parent,nav{display:flex;position:relative}.parent{flex:auto;flex-direction:column;max-width:100%}.parent>header{background-color:#dee2e4;color:rgba(26,26,35,.66);cursor:pointer}.parent>header.is-highlighted,.parent>header.is-selected{background-color:#d9edf2}.parent>header:hover{background-color:#bfe0e9}.parent.no-data ul{display:none}.parent.no-data .no-data-message{display:block}ul{flex:auto;height:100%;list-style:none;margin:0;overflow-y:auto;padding:0}ul li{cursor:pointer}ul li.is-highlighted,ul li.is-selected{background-color:#d9edf2}ul li:hover{background-color:#bfe0e9}ul li:focus{background-color:rgba(26,26,35,.38);outline:none}ul li:active{background-color:#0084a9;color:#fff}ul li.is-disabled,ul li:disabled{color:rgba(26,26,35,.66);cursor:default;opacity:.65}ul li a{border-bottom:0;color:inherit;text-decoration:none}ul li.heading{background-color:#dee2e4;color:rgba(26,26,35,.66)}ul li.heading .item-wrapper{cursor:default}ul li.divider{border-bottom:1px solid #d2d7d9}ul li.is-disabled,ul li.is-readonly{background-color:transparent;color:inherit;cursor:default}ul li.is-checked .icon-check{opacity:1}.item-wrapper{color:inherit;cursor:inherit;display:flex;line-height:1.25rem;min-height:1.75rem;padding:.25rem .5rem}.item-wrapper .label{margin-right:auto}.item-wrapper .label+.ec-icon{margin-left:.5rem}.item-wrapper .ec-icon{flex:none;margin-top:.125rem}.item-wrapper .ec-icon+.label{margin-left:.5rem}.item-wrapper .ec-icon-sm{margin-top:.25rem}.item-wrapper .icon-check{opacity:0}.no-data-message{color:rgba(26,26,35,.38);display:none;font-size:1rem;margin-bottom:0;padding:1rem;text-align:center}:host-context(ec-tree) ul{overflow-x:hidden}:host-context(ec-tree) li{white-space:nowrap}:host-context(ec-tree) li.is-highlighted,:host-context(ec-tree) li.is-selected{font-weight:700}:host-context(ec-tree) li.is-highlighted:not(:hover),:host-context(ec-tree) li.is-selected:not(:hover){background-color:transparent}"]
|
|
2982
2997
|
},] }
|
|
2983
2998
|
];
|
|
@@ -3000,6 +3015,7 @@
|
|
|
3000
3015
|
noDataText: [{ type: i0.Input }],
|
|
3001
3016
|
enableKeyNav: [{ type: i0.Input }],
|
|
3002
3017
|
highlightedItem: [{ type: i0.Input }],
|
|
3018
|
+
maintainSelectedItem: [{ type: i0.Input }],
|
|
3003
3019
|
selectedChanged: [{ type: i0.Output }],
|
|
3004
3020
|
menuClosed: [{ type: i0.Output }],
|
|
3005
3021
|
labelTemplate: [{ type: i0.ViewChild, args: ['label', { static: true },] }],
|
|
@@ -3806,7 +3822,7 @@
|
|
|
3806
3822
|
if (this._url && this.classValue) {
|
|
3807
3823
|
if (this.router.isActive(this._url, this._exact)) {
|
|
3808
3824
|
this.renderer.addClass(this.el.nativeElement, this.classValue);
|
|
3809
|
-
this.routerLinkActivated.emit(new Event('routerLinkActivated'));
|
|
3825
|
+
this.routerLinkActivated.emit({ event: new Event('routerLinkActivated'), item: this.currentItem });
|
|
3810
3826
|
}
|
|
3811
3827
|
else {
|
|
3812
3828
|
this.renderer.removeClass(this.el.nativeElement, this.classValue);
|
|
@@ -3830,6 +3846,7 @@
|
|
|
3830
3846
|
classValue: [{ type: i0.Input, args: ['ecNavItemActive',] }],
|
|
3831
3847
|
exact: [{ type: i0.Input, args: ['ecNavItemActiveExactMatch',] }],
|
|
3832
3848
|
queryParams: [{ type: i0.Input, args: ['ecNavItemActiveQueryParams',] }],
|
|
3849
|
+
currentItem: [{ type: i0.Input, args: ['ecNavItemCurrentItem',] }],
|
|
3833
3850
|
url: [{ type: i0.Input, args: ['ecNavItemActiveUrl',] }],
|
|
3834
3851
|
routerLinkActivated: [{ type: i0.Output }]
|
|
3835
3852
|
};
|
|
@@ -8266,7 +8283,7 @@
|
|
|
8266
8283
|
PageTitleComponent.decorators = [
|
|
8267
8284
|
{ type: i0.Component, args: [{
|
|
8268
8285
|
selector: 'app-page-title',
|
|
8269
|
-
template: "<i *ngIf=\"titleIcon\"\r\n class=\"flex-shrink mr-1 my-1 ec-icon ec-icon-md {{titleIcon}}\"></i>\r\n<div>\r\n <h1 *ngIf=\"title\"\r\n
|
|
8286
|
+
template: "<i *ngIf=\"titleIcon\"\r\n class=\"flex-shrink mr-1 my-1 ec-icon ec-icon-md {{titleIcon}}\"></i>\r\n<div class=\"text-truncate\">\r\n <h1 *ngIf=\"title\"\r\n class=\"text-title-1 mb-0 py-1 text-truncate\"\r\n title=\"{{title}}\">{{title}}</h1>\r\n <p *ngIf=\"subTitle\"\r\n class=\"text-caption-1 mb-0 mt-n1 text-truncate\">{{subTitle}}</p>\r\n</div>",
|
|
8270
8287
|
host: {
|
|
8271
8288
|
class: 'd-flex'
|
|
8272
8289
|
}
|
|
@@ -8332,7 +8349,7 @@
|
|
|
8332
8349
|
PageViewComponent.decorators = [
|
|
8333
8350
|
{ type: i0.Component, args: [{
|
|
8334
8351
|
selector: 'ec-page-view',
|
|
8335
|
-
template: "<div ecOverlay\r\n [status]=\"status?.status\"\r\n [message]=\"status?.message\"\r\n [displayAsMask]=\"true\"\r\n class=\"bg-body flex-grow d-flex\">\r\n <div id=\"PageViewScrollContainer\" \r\n class=\"d-flex flex-column flex-grow scroll-y\" \r\n [class.is-dialog]=\"isDialog\"\r\n [class.fit-content]=\"fitContent\"\r\n [class.sticky-footer]=\"stickyFooter && !!footerTemplate\"\r\n [class.overlay-visible]=\"status?.status !== 'hasData'\">\r\n <section>\r\n <ng-content></ng-content> \r\n </section>\r\n \r\n <footer>\r\n <ng-container *ngTemplateOutlet=\"footerTemplate\"></ng-container>\r\n </footer>\r\n\r\n <header *ngIf=\"showHeader\">\r\n \r\n <ol id=\"breadcrumbs\"\r\n *ngIf=\"breadcrumbs?.length && !isDialog\">\r\n <li *ngFor=\"let crumb of breadcrumbs; last as isLast\">\r\n <a *ngIf=\"crumb.url; else label\"\r\n [routerLink]=\"crumb.url\">\r\n <ng-container *ngTemplateOutlet=\"label\"></ng-container>\r\n </a>\r\n <ng-template #label>{{crumb.label}}</ng-template>\r\n </li>\r\n </ol>\r\n \r\n <div *ngIf=\"!customHeaderTemplate; else customHeaderOutlet\" class=\"titlebar\">\r\n <app-page-title *ngIf=\"!customTitleTemplate; else customTitle\" \r\n [title]=\"title\"\r\n [subTitle]=\"subTitle\"\r\n [titleIcon]=\"titleIcon\"\r\n class=\"title\">\r\n </app-page-title>\r\n \r\n <ng-template #customTitle>\r\n <div class=\"title\">\r\n <ng-container *ngTemplateOutlet=\"customTitleTemplate\"></ng-container>\r\n </div>\r\n </ng-template>\r\n \r\n <div class=\"actions\">\r\n <ec-button id=\"primaryAction\"\r\n class=\"ml-2\"\r\n *ngIf=\"!hidePrimaryAction && onPrimaryAction.observers?.length\"\r\n [disabled]=\"status?.status === 'pending'\"\r\n type=\"primary\"\r\n [label]=\"primaryActionLabel\"\r\n (clicked)=\"primaryAction($event)\">\r\n </ec-button>\r\n <ec-button id=\"secondaryAction\"\r\n class=\"ml-2\"\r\n *ngIf=\"!hideSecondaryAction && onSecondaryAction.observers?.length\"\r\n type=\"secondary\"\r\n [label]=\"secondaryActionLabel\"\r\n (clicked)=\"secondaryAction($event)\">\r\n </ec-button>\r\n <ec-dropdown id=\"moreActions\"\r\n *ngIf=\"moreActions?.length\"\r\n [disabled]=\"status?.status === 'pending'\"\r\n class=\"ml-2\"\r\n buttonType=\"secondary\"\r\n [label]=\"moreActionsLabel\"\r\n [items]=\"moreActions\">\r\n </ec-dropdown>\r\n <ng-container *ngTemplateOutlet=\"customActionsTemplate\"></ng-container>\r\n </div>\r\n </div>\r\n \r\n <ng-template #customHeaderOutlet> \r\n <div class=\"page-header\">\r\n <ng-container *ngTemplateOutlet=\"customHeaderTemplate\"></ng-container>\r\n </div>\r\n </ng-template>\r\n \r\n <ec-banner *ngIf=\"errors\"\r\n id=\"pageViewErrors\"\r\n [class.border-bottom-0]=\"!isDialog\">\r\n <div [innerHtml]=\"errors\"></div>\r\n </ec-banner>\r\n </header>\r\n </div>\r\n</div>\r\n\r\n",
|
|
8352
|
+
template: "<div ecOverlay\r\n [status]=\"status?.status\"\r\n [message]=\"status?.message\"\r\n [displayAsMask]=\"true\"\r\n class=\"bg-body flex-grow d-flex\">\r\n <div id=\"PageViewScrollContainer\" \r\n class=\"d-flex flex-column flex-grow scroll-y\" \r\n [class.is-dialog]=\"isDialog\"\r\n [class.fit-content]=\"fitContent\"\r\n [class.sticky-footer]=\"stickyFooter && !!footerTemplate\"\r\n [class.overlay-visible]=\"status?.status !== 'hasData'\">\r\n <section>\r\n <ng-content></ng-content> \r\n </section>\r\n \r\n <footer>\r\n <ng-container *ngTemplateOutlet=\"footerTemplate\"></ng-container>\r\n </footer>\r\n\r\n <header *ngIf=\"showHeader\">\r\n \r\n <ol id=\"breadcrumbs\"\r\n *ngIf=\"breadcrumbs?.length && !isDialog\">\r\n <li *ngFor=\"let crumb of breadcrumbs; last as isLast\">\r\n <a *ngIf=\"crumb.url; else label\"\r\n [routerLink]=\"crumb.url\">\r\n <ng-container *ngTemplateOutlet=\"label\"></ng-container>\r\n </a>\r\n <ng-template #label>{{crumb.label}}</ng-template>\r\n </li>\r\n </ol>\r\n \r\n <div *ngIf=\"!customHeaderTemplate; else customHeaderOutlet\" class=\"titlebar\">\r\n <app-page-title *ngIf=\"!customTitleTemplate; else customTitle\" \r\n [title]=\"title\"\r\n [subTitle]=\"subTitle\"\r\n [titleIcon]=\"titleIcon\"\r\n class=\"title text-truncate\">\r\n </app-page-title>\r\n \r\n <ng-template #customTitle>\r\n <div class=\"title\">\r\n <ng-container *ngTemplateOutlet=\"customTitleTemplate\"></ng-container>\r\n </div>\r\n </ng-template>\r\n \r\n <div class=\"actions\">\r\n <ec-button id=\"primaryAction\"\r\n class=\"ml-2\"\r\n *ngIf=\"!hidePrimaryAction && onPrimaryAction.observers?.length\"\r\n [disabled]=\"status?.status === 'pending'\"\r\n type=\"primary\"\r\n [label]=\"primaryActionLabel\"\r\n (clicked)=\"primaryAction($event)\">\r\n </ec-button>\r\n <ec-button id=\"secondaryAction\"\r\n class=\"ml-2\"\r\n *ngIf=\"!hideSecondaryAction && onSecondaryAction.observers?.length\"\r\n type=\"secondary\"\r\n [label]=\"secondaryActionLabel\"\r\n (clicked)=\"secondaryAction($event)\">\r\n </ec-button>\r\n <ec-dropdown id=\"moreActions\"\r\n *ngIf=\"moreActions?.length\"\r\n [disabled]=\"status?.status === 'pending'\"\r\n class=\"ml-2\"\r\n buttonType=\"secondary\"\r\n [label]=\"moreActionsLabel\"\r\n [items]=\"moreActions\">\r\n </ec-dropdown>\r\n <ng-container *ngTemplateOutlet=\"customActionsTemplate\"></ng-container>\r\n </div>\r\n </div>\r\n \r\n <ng-template #customHeaderOutlet> \r\n <div class=\"page-header\">\r\n <ng-container *ngTemplateOutlet=\"customHeaderTemplate\"></ng-container>\r\n </div>\r\n </ng-template>\r\n \r\n <ec-banner *ngIf=\"errors\"\r\n id=\"pageViewErrors\"\r\n [class.border-bottom-0]=\"!isDialog\">\r\n <div [innerHtml]=\"errors\"></div>\r\n </ec-banner>\r\n </header>\r\n </div>\r\n</div>\r\n\r\n",
|
|
8336
8353
|
host: {
|
|
8337
8354
|
class: "flex-grow"
|
|
8338
8355
|
},
|