@wavemaker/app-runtime-wm-build 11.4.2-rc.5559 → 11.4.2-rc.5575

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
  {
2
2
  "name": "@wavemaker/app-runtime-wm-build",
3
- "version": "11.4.2-rc.5559",
3
+ "version": "11.4.2-rc.5575",
4
4
  "description": "All modules required for a wavemaker application.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -33771,7 +33771,6 @@
33771
33771
  core.$appDigest();
33772
33772
  };
33773
33773
  MenuComponent.prototype.onHide = function() {
33774
- this.$element.find(">.dropdown-toggle").focus();
33775
33774
  this.$element.find("li").removeClass("open");
33776
33775
  this._selectFirstItem = false;
33777
33776
  core.$appDigest();
@@ -264,7 +264,7 @@
264
264
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
265
265
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
266
266
  PERFORMANCE OF THIS SOFTWARE.
267
- ***************************************************************************** */var c=function(e,t){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}c(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}Object.create;function d(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,a=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return r}function u(e,t,n){if(n||2===arguments.length)for(var i,o=0,a=t.length;o<a;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var h=function(){o.register("wm-nav",new Map([["autoclose",Object.assign({value:"always"},o.PROP_STRING)],["autoopen",Object.assign({value:"never"},o.PROP_STRING)],["class",o.PROP_STRING],["dataset",o.PROP_ANY],["iconposition",Object.assign({value:"left"},o.PROP_STRING)],["isactive",o.PROP_STRING],["itemlabel",o.PROP_STRING],["itemlink",o.PROP_STRING],["itemicon",o.PROP_STRING],["itemclass",o.PROP_STRING],["itemchildren",o.PROP_STRING],["itemaction",o.PROP_STRING],["itembadge",o.PROP_STRING],["itemtarget",o.PROP_STRING],["layout",o.PROP_STRING],["name",o.PROP_STRING],["orderby",o.PROP_STRING],["show",Object.assign({value:!0},o.PROP_BOOLEAN)],["type",o.PROP_STRING],["userrole",o.PROP_STRING]]))},m={widgetType:"wm-nav",hostClass:"nav app-nav"},f={pills:"nav-pills",tabs:"nav-tabs",navbar:"navbar-nav"},g=function(e){function t(t,n,i,a,r,s){var c=e.call(this,t,m)||this;c.cdRef=n,c.route=i,c.userDefinedExecutionContext=a,c.app=r,o.styler(c.nativeElement,c,o.APPLY_STYLES_TYPE.CONTAINER),c.disableMenuContext=!!s,c.pageScope=c.viewParent;var p=c.nodes$.subscribe((function(){if(!_.isEmpty(c.nodes)){var e=!1,t=function(n,i){_.forEach(n,(function(n){if(!e)return n.isactive?(e=!0,c.selecteditem=i?_.omit(n,["children","value"]):n.value,c.invokeEventCallback("select",{$event:{},$item:n.value}),l.triggerItemAction(c,n),i||(n._selected=!0),!1):void(_.isEmpty(n.children)||t(n.children,"menu"))}))};t(c.nodes)}}));return c.registerDestroyListener((function(){return p.unsubscribe()})),c}return p(t,e),Object.defineProperty(t.prototype,"activePageName",{get:function(){return this.app.activePageName},enumerable:!1,configurable:!0}),t.prototype.setNavType=function(e){l.addClass(this.nativeElement,f[e])},t.prototype.setNavLayout=function(e){l.addClass(this.nativeElement,"nav-"+e)},t.prototype.onNavSelect=function(e,t,n){e.preventDefault();var i=_.find(this.nodes,"_selected");i&&delete i._selected,this.activeNavLINode&&l.removeClass(this.activeNavLINode,"active"),this.activeNavLINode=n,l.addClass(n,"active"),this.selecteditem=t.value,this.invokeEventCallback("select",{$event:e,$item:t.value}),l.triggerItemAction(this,t)},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.setNavType(this.type),this.setNavLayout(this.layout)},t.prototype.onMenuItemSelect=function(e,t,n){this.selecteditem=_.omit(n,["children","value"]),this.invokeEventCallback("select",{$event:e,$item:this.selecteditem})},t}(o.DatasetAwareNavComponent);g.initializeProps=h(),g.decorators=[{type:t.Component,args:[{selector:"[wmNav]",template:'<ng-template #menuRef let-item="item" let-index="index">\n <div wmMenu dropdown\n type="anchor"\n autoclose.bind="autoclose"\n iconclass.bind="item.icon"\n autoopen.bind="autoopen"\n caption.bind="item.label"\n dataset.bind="item.children"\n badgevalue.bind="item.badge"\n iconposition.bind="iconposition"\n select.event="onMenuItemSelect($event, widget, $item)"></div>\n</ng-template>\n\n<ng-template #anchorRef let-item="item" let-index="index" let-liRef="liRef">\n <a wmAnchor\n [disableMenuContext]="disableMenuContext || !!item.action"\n [wmNavigationControl]="item.link"\n [attr.aria-current]="item._selected || (!isactive && item.link === \'#/\' + activePageName) ? \'page\' : \'\'"\n caption.bind="item.label"\n iconclass.bind="item.icon"\n badgevalue.bind="item.badge"\n iconposition.bind="iconposition"\n click.event="onNavSelect($event, item, liRef)"></a>\n</ng-template>\n\n<li class="app-nav-item {{item.class}}" *ngFor="let item of nodes; let index = index;" #liRef [ngClass]="{active: item._selected || (!isactive && item.link === \'#/\' + activePageName)}">\n <ng-container [ngTemplateOutlet]="anchorRef" [ngTemplateOutletContext]="{item: item, index:index, liRef: liRef}" *ngIf="!item.children.length"></ng-container>\n <ng-container [ngTemplateOutlet]="menuRef" [ngTemplateOutletContext]="{item: item, index:index}" *ngIf="item.children.length"></ng-container>\n</li>\n\n<ng-content *ngIf="!nodes.length" select="[wmNavItem]"></ng-content>\n',providers:[o.provideAsWidgetRef(g)]}]}],g.ctorParameters=function(){return[{type:t.Injector},{type:t.ChangeDetectorRef},{type:s.Router},{type:l.UserDefinedExecutionContext},{type:l.App},{type:void 0,decorators:[{type:t.Attribute,args:["select.event"]}]}]};var v=function(){o.register("wm-menu",new Map([["accessroles",Object.assign({value:"Everyone"},o.PROP_STRING)],["animateitems",o.PROP_STRING],["autoclose",Object.assign({value:"always"},o.PROP_STRING)],["autoopen",Object.assign({value:"never"},o.PROP_STRING)],["caption",o.PROP_STRING],["class",o.PROP_STRING],["dataset",Object.assign({value:"Menu Item 1, Menu Item 2, Menu Item 3"},o.PROP_ANY)],["hint",Object.assign({value:""},o.PROP_STRING)],["isactive",o.PROP_STRING],["iconclass",o.PROP_STRING],["iconposition",Object.assign({value:"left"},o.PROP_STRING)],["itemaction",o.PROP_STRING],["itemchildren",o.PROP_STRING],["itemclass",o.PROP_STRING],["itemicon",o.PROP_STRING],["itemlabel",o.PROP_STRING],["itemlink",o.PROP_STRING],["itemtarget",o.PROP_STRING],["linktarget",Object.assign({value:"_self"},o.PROP_STRING)],["menuclass",o.PROP_STRING],["menulayout",o.PROP_STRING],["menuposition",o.PROP_STRING],["name",o.PROP_STRING],["orderby",o.PROP_STRING],["shortcutkey",o.PROP_STRING],["show",Object.assign({value:!0},o.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},o.PROP_NUMBER)],["type",Object.assign({value:"menu"},o.PROP_STRING)],["userrole",o.PROP_STRING]]))},y={MOVE_UP:"UP-ARROW",MOVE_LEFT:"LEFT-ARROW",MOVE_RIGHT:"RIGHT-ARROW",MOVE_DOWN:"DOWN-ARROW",ON_ENTER:"ENTER",ON_TAB:"TAB",ON_SHIFT_TAB:"SHIFT-TAB",ON_ESCAPE:"ESC"},b={UP_LEFT:"up,left",UP_RIGHT:"up,right",DOWN_LEFT:"down,left",DOWN_RIGHT:"down,right",INLINE:"inline"},w="down,right",P="down,left",O="up,right",E="up,left",R="inline",A="fa-caret-up",T="fa-caret-down",S="pull-left",C="pull-right",I="activepage",D="always",x={widgetType:"wm-menu",hostClass:"dropdown app-menu"},N=function(e){function t(t,n,i,a,r,s,c){var p=e.call(this,t,x)||this;p.route=n,p.app=i,p.userDefinedExecutionContext=a,p.bsDropdown=r,p.parentNav=s,p.selectEventCB=c,p.menuCaret="fa-caret-down",p._selectFirstItem=!1,p.disableMenuContext=s?!!s.disableMenuContext:!!c;var d=p.nodes$.subscribe((function(){if(!_.isEmpty(p.nodes)){if(o.hasLinkToCurrentPage(p.nodes,p.route.url)&&l.addClass(p.nativeElement.querySelector(".dropdown-toggle"),"active"),p.parentNav)return;var e=!1,t=function(n){_.forEach(n,(function(n){if(!e)return n.isactive?(e=!0,p.onMenuItemSelect({$event:{},$item:n}),l.triggerItemAction(p,n),!1):void(_.isEmpty(n.children)||t(n.children))}))};t(p.nodes)}}));return p.registerDestroyListener((function(){return d.unsubscribe()})),p}return p(t,e),t.prototype.onShow=function(){var e=this;this._selectFirstItem&&setTimeout((function(){e.$element.find("> ul[wmmenudropdown] li.app-menu-item").first().find("> a").focus()})),l.$appDigest()},t.prototype.onHide=function(){this.$element.find(">.dropdown-toggle").focus(),this.$element.find("li").removeClass("open"),this._selectFirstItem=!1,l.$appDigest()},t.prototype.onKeyDown=function(e,t){var n=_.clone(y);this.menuposition===b.UP_RIGHT?(n.MOVE_UP="DOWN-ARROW",n.MOVE_DOWN="UP-ARROW"):this.menuposition===b.UP_LEFT?(n.MOVE_UP="DOWN-ARROW",n.MOVE_DOWN="UP-ARROW",n.MOVE_LEFT="RIGHT-ARROW",n.MOVE_RIGHT="LEFT-ARROW"):this.menuposition===b.DOWN_LEFT&&(n.MOVE_LEFT="RIGHT-ARROW",n.MOVE_RIGHT="LEFT-ARROW"),_.includes([n.MOVE_DOWN,n.MOVE_RIGHT],t)?this.bsDropdown.isOpen?this.$element.find("> ul[wmmenudropdown] li.app-menu-item").first().find("> a").focus():(this._selectFirstItem=!0,this.bsDropdown.show()):t===n.ON_ENTER?this.bsDropdown.toggle(!0):_.includes([n.MOVE_UP,n.MOVE_LEFT],t)&&this.bsDropdown.hide(),e.preventDefault()},t.prototype.resetNodes=function(){e.prototype.resetNodes.call(this),(this.autoopen===I&&o.hasLinkToCurrentPage(this.nodes,this.route.url)||this.autoopen===D)&&this.bsDropdown.show()},t.prototype.ngOnInit=function(){var t=this;e.prototype.ngOnInit.call(this),this.setMenuPosition();var n=this.app.subscribe("highlightActiveLink",(function(e){l.toggleClass(t.nativeElement.querySelector(".dropdown-toggle"),"active",o.hasLinkToCurrentPage(t.nodes,t.route.url))}));this.registerDestroyListener((function(){return n()}))},t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("autoclose"===t?this.bsDropdown.autoClose=n!==o.AUTOCLOSE_TYPE.DISABLED:e.prototype.onPropertyChange.call(this,t,n,i))},t.prototype.setMenuPosition=function(){switch(this.menuposition){case w:l.removeClass(this.nativeElement,"dropup"),this.menualign=S,this.menuCaret=T;break;case P:l.removeClass(this.nativeElement,"dropup"),this.menualign=C,this.menuCaret=T;break;case E:l.addClass(this.nativeElement,"dropup"),this.menualign=C,this.menuCaret=A;break;case O:l.addClass(this.nativeElement,"dropup"),this.menualign=S,this.menuCaret=A;break;case R:this.menualign="dropinline-menu"}},t.prototype.onMenuItemSelect=function(e){var t=e.$event,n=e.$item.value;this.invokeEventCallback("select",{$event:t,$item:n})},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),o.styler(this.nativeElement.querySelector(".dropdown-toggle"),this)},t}(o.DatasetAwareNavComponent);N.initializeProps=v(),N.decorators=[{type:t.Component,args:[{selector:"[wmMenu]",template:'<ng-template #menuTemplate>\n <button wmButton\n dropdownToggle\n aria-haspopup="true"\n aria-expanded="false"\n [attr.aria-label]="hint || \'Menu\'"\n class="btn app-button dropdown-toggle {{menuclass}}"\n hint.bind="hint"\n shortcutkey.bind="shortcutkey"\n tabindex.bind="tabindex"\n caption.bind="caption"\n iconclass.bind="iconclass"\n iconposition.bind="iconposition">\n <span class="pull-right caret fa {{menuCaret}}"></span>\n </button>\n</ng-template>\n\n<ng-template #innerTemplate>\n <i class="app-icon {{iconclass}}"></i>\n <span class="caption" [textContent]="caption"></span>\n <span class="pull-right caret fa {{menuCaret}}"></span>\n</ng-template>\n\n<ng-container *ngIf="type === \'anchor\'; else menuTemplate">\n <a wmAnchor\n dropdownToggle\n\n href="javascript:void(0);"\n role="button"\n aria-haspopup="true"\n aria-expanded="false"\n\n hint.bind="hint"\n class="dropdown-toggle {{menuclass}}"\n shortcutkey.bind="shortcutkey"\n tabindex.bind="tabindex"\n caption.bind="caption"\n iconclass.bind="iconclass"\n iconposition.bind="iconposition"\n badgevalue.bind="badgevalue"\n >\n <span class="pull-right caret fa {{menuCaret}}"></span>\n </a>\n</ng-container>\n\n<ul wmMenuDropdown [items]="nodes" [ngClass]="menulayout" class="icon-position-{{iconposition}}" *dropdownMenu aria-labelledby="dropdownmenu" role="menubar"></ul>\n',providers:[o.provideAsWidgetRef(N)]}]}],N.ctorParameters=function(){return[{type:t.Injector},{type:s.Router},{type:l.App},{type:l.UserDefinedExecutionContext},{type:i.BsDropdownDirective,decorators:[{type:t.Self},{type:t.Optional}]},{type:g,decorators:[{type:t.Optional}]},{type:String,decorators:[{type:t.Attribute,args:["select.event"]}]}]},N.propDecorators={onShow:[{type:t.HostListener,args:["onShown"]}],onHide:[{type:t.HostListener,args:["onHidden"]}],onKeyDown:[{type:t.HostListener,args:["keydown.arrowup",["$event",'"UP-ARROW"']]},{type:t.HostListener,args:["keydown.arrowdown",["$event",'"DOWN-ARROW"']]},{type:t.HostListener,args:["keydown.arrowright",["$event",'"RIGHT-ARROW"']]},{type:t.HostListener,args:["keydown.arrowleft",["$event",'"LEFT-ARROW"']]},{type:t.HostListener,args:["keydown.enter",["$event",'"ENTER"']]}]};var k={scale:{name:"wmScaleInLeft","down,right":"wmScaleInLeft","down,left":"wmScaleInRight","up,right":"wmScaleInTopLeft","up,left":"wmScaleInTopRight"},fade:{name:"fadeIn","down,right":"fadeIn","down,left":"fadeIn","up,right":"fadeIn","up,left":"fadeIn"},slide:{name:"wmSlideInDown","down,right":"wmSlideInDown","down,left":"wmSlideInDown","up,right":"wmSlideInUp","up,left":"wmSlideInUp"}},M=function(){function e(e,t){this.menuRef=t,this.nativeElement=e.nativeElement,l.addClass(this.nativeElement,"dropdown-menu")}return e.prototype.ngAfterViewInit=function(){var e=this.menuRef.animateitems,t="";e&&(t="animated "+(k[e][this.menuRef.menuposition]||k[e].name)),l.addClass(this.nativeElement,"dropdown-menu "+this.menuRef.menualign+" "+t,!0)},e}();M.decorators=[{type:t.Component,args:[{selector:"ul[wmMenuDropdown]",template:'<li wmMenuDropdownItem *ngFor="let item of items"\n [item]="item"\n [ngClass]="{disabled: item.disabled, \'dropdown-submenu\': item.children.length > 0}"\n class="{{item.class}}"\n role="menuitem">\n</li>\n'}]}],M.ctorParameters=function(){return[{type:t.ElementRef},{type:N}]},M.propDecorators={items:[{type:t.Input}]};var L={"pull-right":"fa-caret-left","dropinline-menu":"fa-caret-down","pull-left":"fa-caret-right"},F="horizontal",j=function(){function e(e,t,n,i,o){var a=this;this.app=e,this.menuRef=t,this.userDefinedExecutionContext=n,this.parentNav=i,this.onSelect=function(e,t){if(a.nativeElement===$(e.target).closest(".app-menu-item").get(0)){"outsideClick"===a.menuRef.autoclose&&e.stopPropagation(),e.preventDefault();var n={$event:e,$item:t};a.menuRef.onMenuItemSelect(n);var i=_.clone(t);i.target=i.target||a.menuRef.linktarget,l.triggerItemAction(a,i)}},this.nativeElement=o.nativeElement,l.addClass(this.nativeElement,"app-menu-item"),this.menualign=L[this.menuRef.menualign]||L["pull-left"]}return e.prototype.ngOnInit=function(){var e=this;this.parentNav&&(o.hasLinkToCurrentPage([this.item],this.menuRef.route.url)&&l.addClass(this.nativeElement,"active"),this.highlightActiveLinkSubscription=this.app.subscribe("highlightActiveLink",(function(t){l.toggleClass(e.nativeElement,"active",o.hasLinkToCurrentPage([e.item],e.menuRef.route.url))})))},e.prototype.getInitialKeyMovements=function(){var e=_.clone(y);return this.menuRef.menulayout===F?(e.MOVE_UP="LEFT-ARROW",e.MOVE_LEFT="UP-ARROW",e.MOVE_RIGHT="DOWN-ARROW",e.MOVE_DOWN="RIGHT-ARROW"):this.menuRef.menuposition===b.DOWN_LEFT||this.menuRef.menuposition===b.UP_LEFT?(e.MOVE_LEFT="RIGHT-ARROW",e.MOVE_RIGHT="LEFT-ARROW"):"inline"===this.menuRef.menuposition&&(e.MOVE_UP="LEFT-ARROW",e.MOVE_LEFT="UP-ARROW",e.MOVE_RIGHT="DOWN-ARROW",e.MOVE_DOWN="RIGHT-ARROW"),e},e.prototype.onKeyDown=function(e,t){var n=$(this.nativeElement),i=$(this.nativeElement).closest("ul.dropdown-menu"),o=this.menuRef.$element.find("> ul.dropdown-menu"),a=this.getInitialKeyMovements();if(_.includes(["LEFT-ARROW","RIGHT-ARROW","UP-ARROW","DOWN-ARROW"],t)&&e.preventDefault(),t===a.ON_TAB&&o.children().last()[0]===this.nativeElement||t===a.ON_SHIFT_TAB&&o.children().first()[0]===this.nativeElement||t===a.ON_ESCAPE)e.preventDefault(),this.menuRef.bsDropdown.hide();else if(t===a.ON_ENTER&&!this.item.link||t===a.MOVE_RIGHT)e.stopPropagation(),this.item.children.length?(n.toggleClass("open"),n.find("li").first().find("> a").focus()):n.find("> a").focus();else if(t===a.MOVE_LEFT||t===a.ON_TAB&&i.children().last()[0]===this.nativeElement||t===a.ON_SHIFT_TAB&&i.children().first()[0]===this.nativeElement){if(o[0]!==i[0]){var r=i.parent();r.toggleClass("open").find("li.open").removeClass("open"),r.find("> a").focus(),e.preventDefault(),e.stopPropagation()}}else t===a.MOVE_UP?o[0]===i[0]&&o.find("> li").first()[0]===this.nativeElement||(e.stopPropagation(),n.prev().find("> a").focus()):t===a.MOVE_DOWN?(e.stopPropagation(),o.find("> li").last()[0]===this.nativeElement&&(this.menuRef.menulayout!==F&&this.menuRef.menuposition===b.UP_RIGHT||this.menuRef.menuposition===b.UP_LEFT)?this.menuRef.bsDropdown.hide():n.next().find("> a").focus()):t===a.ON_ENTER?this.onSelect(e,this.item):e.stopPropagation()},e.prototype.ngOnDestroy=function(){this.highlightActiveLinkSubscription&&this.highlightActiveLinkSubscription()},e}();j.decorators=[{type:t.Component,args:[{selector:"li[wmMenuDropdownItem]",template:'<a href="javascript:void(0);" [title]="item.label" [wmNavigationControl]="item.link" [disableMenuContext]="menuRef.disableMenuContext || !!item.action">\n <span *ngIf="item.children.length" class="pull-right fa caret {{menualign}}"></span>\n <i class="app-icon {{item.icon}}"></i>\n <span class="anchor-caption">{{item.label}}</span>\n <span *ngIf="item.badge" class="badge pull-right" [textContent]="item.badge"></span>\n</a>\n<ng-container [ngTemplateOutlet]="nestedMenuDropdown" *ngIf="item.children.length" [ngTemplateOutletContext]="{item: item}"></ng-container>\n\n<ng-template #nestedMenuDropdown let-item="item">\n <ul wmMenuDropdown [items]="item.children"></ul>\n</ng-template>\n'}]}],j.ctorParameters=function(){return[{type:l.App},{type:N},{type:l.UserDefinedExecutionContext},{type:g,decorators:[{type:t.Optional}]},{type:t.ElementRef}]},j.propDecorators={item:[{type:t.Input}],onKeyDown:[{type:t.HostListener,args:["keydown.tab",["$event",'"TAB"']]},{type:t.HostListener,args:["keydown.shift.tab",["$event",'"SHIFT-TAB"']]},{type:t.HostListener,args:["keydown.escape",["$event",'"ESC"']]},{type:t.HostListener,args:["keydown.enter",["$event",'"ENTER"']]},{type:t.HostListener,args:["keydown.arrowup",["$event",'"UP-ARROW"']]},{type:t.HostListener,args:["keydown.arrowdown",["$event",'"DOWN-ARROW"']]},{type:t.HostListener,args:["keydown.arrowright",["$event",'"RIGHT-ARROW"']]},{type:t.HostListener,args:["keydown.arrowleft",["$event",'"LEFT-ARROW"']]}],onSelect:[{type:t.HostListener,args:["click",["$event","item"]]}]};var B=function(){o.register("wm-nav-item",new Map([["class",o.PROP_STRING],["name",o.PROP_STRING],["show",Object.assign({value:!0},o.PROP_BOOLEAN)]]))},G={widgetType:"wm-nav-item",hostClass:"app-nav-item"},V=function(e){function t(t){var n=e.call(this,t,G)||this;return o.styler(n.nativeElement,n,o.APPLY_STYLES_TYPE.CONTAINER),n}return p(t,e),t.prototype.makeActive=function(){var e=this.nativeElement.parentNode;$(e).find("> li.active").removeClass("active"),this.isAttached&&l.addClass(this.nativeElement,"active")},t.prototype.ngAfterViewInit=function(){var e=this;this.innerLink&&this.innerLink.onActive((function(){return e.makeActive()}))},t.prototype.ngOnDetach=function(){l.removeClass(this.nativeElement,"active",!0),e.prototype.ngOnDetach.call(this)},t}(o.StylableComponent);V.initializeProps=B(),V.decorators=[{type:t.Directive,args:[{selector:"[wmNavItem]",providers:[o.provideAsWidgetRef(V)]}]}],V.ctorParameters=function(){return[{type:t.Injector}]},V.propDecorators={innerLink:[{type:t.ContentChild,args:[a.AnchorComponent]}],makeActive:[{type:t.HostListener,args:["click"]},{type:t.HostListener,args:["keydown.enter"]}]};var W=function(e){e.preventDefault()},U=function(){function e(e){this.nativeElement=e.nativeElement}return Object.defineProperty(e.prototype,"wmNavigationControl",{set:function(e){this._link=e,e&&!this.disableMenuContext?(l.setAttr(this.nativeElement,"href",e),this.nativeElement.removeEventListener("contextmenu",W)):(l.setAttr(this.nativeElement,"href","javascript:void(0)"),this.nativeElement.addEventListener("contextmenu",W))},enumerable:!1,configurable:!0}),e}();U.decorators=[{type:t.Directive,args:[{selector:"[wmNavigationControl]"}]}],U.ctorParameters=function(){return[{type:t.ElementRef}]},U.propDecorators={disableMenuContext:[{type:t.Input}],wmNavigationControl:[{type:t.Input}]};var q=[N,M,j,U,g,V],z=function(){};z.decorators=[{type:t.NgModule,args:[{imports:[a.BasicModule,i.BsDropdownModule,n.CommonModule,r.InputModule,o.WmComponentsModule],declarations:u([],d(q)),exports:u([],d(q)),entryComponents:[N,M]}]}];var H=["itemlabel","itemicon","itemlink","itemaction","itemchildren","userrole"],Y=function(e){function t(t,n){var i=e.call(this,t,n)||this;return i.pageScope=i.viewParent,i.binditemlabel=i.nativeElement.getAttribute("itemlabel.bind"),i.binditemicon=i.nativeElement.getAttribute("itemicon.bind"),i.binditemaction=i.nativeElement.getAttribute("itemaction.bind"),i.binditemlink=i.nativeElement.getAttribute("itemlink.bind"),i.binduserrole=i.nativeElement.getAttribute("userrole.bind"),i.binditemchildren=i.nativeElement.getAttribute("itemchildren.bind"),i}return p(t,e),t.prototype.onPropertyChange=function(t,n,i){_.includes(H,t)&&this.menuRef?this.menuRef.itemlabel=n:e.prototype.onPropertyChange.call(this,t,n,i)},t.prototype.ngAfterViewInit=function(){var t=this;e.prototype.ngAfterViewInit.call(this);var n=this.menuRefQL.changes.subscribe((function(e){e.first&&(t.menuRef=e.first,H.forEach((function(e){var n="bind"+e;t[n]&&(t.menuRef[n]=t[n]),t.menuRef[e]=t[e]})),n.unsubscribe())}))},t}(o.BaseContainerComponent);Y.decorators=[{type:t.Directive}],Y.ctorParameters=function(){return[null,null]},Y.propDecorators={menuRefQL:[{type:t.ViewChildren,args:[N]}]},e.KEYBOARD_MOVEMENTS=y,e.MENU_POSITION=b,e.MenuAdapterComponent=Y,e.MenuComponent=N,e.MenuDropdownComponent=M,e.MenuDropdownItemComponent=j,e.MenuModule=z,e.NavComponent=g,e.NavItemDirective=V,e.NavigationControlDirective=U,e.disableContextMenu=W,e["\u0275a"]=h,e["\u0275b"]=v,e["\u0275c"]=B,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@wm/components/base")):"function"==typeof define&&define.amd?define("@wm/components/navigation/navbar",["exports","@angular/core","@angular/common","@wm/components/base"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.navigation=e.wm.components.navigation||{},e.wm.components.navigation.navbar={}),e.ng.core,e.ng.common,e.wm.components.base)}(this,(function(e,t,n,i){"use strict";
267
+ ***************************************************************************** */var c=function(e,t){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}c(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}Object.create;function d(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,a=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return r}function u(e,t,n){if(n||2===arguments.length)for(var i,o=0,a=t.length;o<a;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var h=function(){o.register("wm-nav",new Map([["autoclose",Object.assign({value:"always"},o.PROP_STRING)],["autoopen",Object.assign({value:"never"},o.PROP_STRING)],["class",o.PROP_STRING],["dataset",o.PROP_ANY],["iconposition",Object.assign({value:"left"},o.PROP_STRING)],["isactive",o.PROP_STRING],["itemlabel",o.PROP_STRING],["itemlink",o.PROP_STRING],["itemicon",o.PROP_STRING],["itemclass",o.PROP_STRING],["itemchildren",o.PROP_STRING],["itemaction",o.PROP_STRING],["itembadge",o.PROP_STRING],["itemtarget",o.PROP_STRING],["layout",o.PROP_STRING],["name",o.PROP_STRING],["orderby",o.PROP_STRING],["show",Object.assign({value:!0},o.PROP_BOOLEAN)],["type",o.PROP_STRING],["userrole",o.PROP_STRING]]))},m={widgetType:"wm-nav",hostClass:"nav app-nav"},f={pills:"nav-pills",tabs:"nav-tabs",navbar:"navbar-nav"},g=function(e){function t(t,n,i,a,r,s){var c=e.call(this,t,m)||this;c.cdRef=n,c.route=i,c.userDefinedExecutionContext=a,c.app=r,o.styler(c.nativeElement,c,o.APPLY_STYLES_TYPE.CONTAINER),c.disableMenuContext=!!s,c.pageScope=c.viewParent;var p=c.nodes$.subscribe((function(){if(!_.isEmpty(c.nodes)){var e=!1,t=function(n,i){_.forEach(n,(function(n){if(!e)return n.isactive?(e=!0,c.selecteditem=i?_.omit(n,["children","value"]):n.value,c.invokeEventCallback("select",{$event:{},$item:n.value}),l.triggerItemAction(c,n),i||(n._selected=!0),!1):void(_.isEmpty(n.children)||t(n.children,"menu"))}))};t(c.nodes)}}));return c.registerDestroyListener((function(){return p.unsubscribe()})),c}return p(t,e),Object.defineProperty(t.prototype,"activePageName",{get:function(){return this.app.activePageName},enumerable:!1,configurable:!0}),t.prototype.setNavType=function(e){l.addClass(this.nativeElement,f[e])},t.prototype.setNavLayout=function(e){l.addClass(this.nativeElement,"nav-"+e)},t.prototype.onNavSelect=function(e,t,n){e.preventDefault();var i=_.find(this.nodes,"_selected");i&&delete i._selected,this.activeNavLINode&&l.removeClass(this.activeNavLINode,"active"),this.activeNavLINode=n,l.addClass(n,"active"),this.selecteditem=t.value,this.invokeEventCallback("select",{$event:e,$item:t.value}),l.triggerItemAction(this,t)},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.setNavType(this.type),this.setNavLayout(this.layout)},t.prototype.onMenuItemSelect=function(e,t,n){this.selecteditem=_.omit(n,["children","value"]),this.invokeEventCallback("select",{$event:e,$item:this.selecteditem})},t}(o.DatasetAwareNavComponent);g.initializeProps=h(),g.decorators=[{type:t.Component,args:[{selector:"[wmNav]",template:'<ng-template #menuRef let-item="item" let-index="index">\n <div wmMenu dropdown\n type="anchor"\n autoclose.bind="autoclose"\n iconclass.bind="item.icon"\n autoopen.bind="autoopen"\n caption.bind="item.label"\n dataset.bind="item.children"\n badgevalue.bind="item.badge"\n iconposition.bind="iconposition"\n select.event="onMenuItemSelect($event, widget, $item)"></div>\n</ng-template>\n\n<ng-template #anchorRef let-item="item" let-index="index" let-liRef="liRef">\n <a wmAnchor\n [disableMenuContext]="disableMenuContext || !!item.action"\n [wmNavigationControl]="item.link"\n [attr.aria-current]="item._selected || (!isactive && item.link === \'#/\' + activePageName) ? \'page\' : \'\'"\n caption.bind="item.label"\n iconclass.bind="item.icon"\n badgevalue.bind="item.badge"\n iconposition.bind="iconposition"\n click.event="onNavSelect($event, item, liRef)"></a>\n</ng-template>\n\n<li class="app-nav-item {{item.class}}" *ngFor="let item of nodes; let index = index;" #liRef [ngClass]="{active: item._selected || (!isactive && item.link === \'#/\' + activePageName)}">\n <ng-container [ngTemplateOutlet]="anchorRef" [ngTemplateOutletContext]="{item: item, index:index, liRef: liRef}" *ngIf="!item.children.length"></ng-container>\n <ng-container [ngTemplateOutlet]="menuRef" [ngTemplateOutletContext]="{item: item, index:index}" *ngIf="item.children.length"></ng-container>\n</li>\n\n<ng-content *ngIf="!nodes.length" select="[wmNavItem]"></ng-content>\n',providers:[o.provideAsWidgetRef(g)]}]}],g.ctorParameters=function(){return[{type:t.Injector},{type:t.ChangeDetectorRef},{type:s.Router},{type:l.UserDefinedExecutionContext},{type:l.App},{type:void 0,decorators:[{type:t.Attribute,args:["select.event"]}]}]};var v=function(){o.register("wm-menu",new Map([["accessroles",Object.assign({value:"Everyone"},o.PROP_STRING)],["animateitems",o.PROP_STRING],["autoclose",Object.assign({value:"always"},o.PROP_STRING)],["autoopen",Object.assign({value:"never"},o.PROP_STRING)],["caption",o.PROP_STRING],["class",o.PROP_STRING],["dataset",Object.assign({value:"Menu Item 1, Menu Item 2, Menu Item 3"},o.PROP_ANY)],["hint",Object.assign({value:""},o.PROP_STRING)],["isactive",o.PROP_STRING],["iconclass",o.PROP_STRING],["iconposition",Object.assign({value:"left"},o.PROP_STRING)],["itemaction",o.PROP_STRING],["itemchildren",o.PROP_STRING],["itemclass",o.PROP_STRING],["itemicon",o.PROP_STRING],["itemlabel",o.PROP_STRING],["itemlink",o.PROP_STRING],["itemtarget",o.PROP_STRING],["linktarget",Object.assign({value:"_self"},o.PROP_STRING)],["menuclass",o.PROP_STRING],["menulayout",o.PROP_STRING],["menuposition",o.PROP_STRING],["name",o.PROP_STRING],["orderby",o.PROP_STRING],["shortcutkey",o.PROP_STRING],["show",Object.assign({value:!0},o.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},o.PROP_NUMBER)],["type",Object.assign({value:"menu"},o.PROP_STRING)],["userrole",o.PROP_STRING]]))},y={MOVE_UP:"UP-ARROW",MOVE_LEFT:"LEFT-ARROW",MOVE_RIGHT:"RIGHT-ARROW",MOVE_DOWN:"DOWN-ARROW",ON_ENTER:"ENTER",ON_TAB:"TAB",ON_SHIFT_TAB:"SHIFT-TAB",ON_ESCAPE:"ESC"},b={UP_LEFT:"up,left",UP_RIGHT:"up,right",DOWN_LEFT:"down,left",DOWN_RIGHT:"down,right",INLINE:"inline"},w="down,right",P="down,left",O="up,right",E="up,left",R="inline",A="fa-caret-up",T="fa-caret-down",S="pull-left",C="pull-right",I="activepage",D="always",x={widgetType:"wm-menu",hostClass:"dropdown app-menu"},N=function(e){function t(t,n,i,a,r,s,c){var p=e.call(this,t,x)||this;p.route=n,p.app=i,p.userDefinedExecutionContext=a,p.bsDropdown=r,p.parentNav=s,p.selectEventCB=c,p.menuCaret="fa-caret-down",p._selectFirstItem=!1,p.disableMenuContext=s?!!s.disableMenuContext:!!c;var d=p.nodes$.subscribe((function(){if(!_.isEmpty(p.nodes)){if(o.hasLinkToCurrentPage(p.nodes,p.route.url)&&l.addClass(p.nativeElement.querySelector(".dropdown-toggle"),"active"),p.parentNav)return;var e=!1,t=function(n){_.forEach(n,(function(n){if(!e)return n.isactive?(e=!0,p.onMenuItemSelect({$event:{},$item:n}),l.triggerItemAction(p,n),!1):void(_.isEmpty(n.children)||t(n.children))}))};t(p.nodes)}}));return p.registerDestroyListener((function(){return d.unsubscribe()})),p}return p(t,e),t.prototype.onShow=function(){var e=this;this._selectFirstItem&&setTimeout((function(){e.$element.find("> ul[wmmenudropdown] li.app-menu-item").first().find("> a").focus()})),l.$appDigest()},t.prototype.onHide=function(){this.$element.find("li").removeClass("open"),this._selectFirstItem=!1,l.$appDigest()},t.prototype.onKeyDown=function(e,t){var n=_.clone(y);this.menuposition===b.UP_RIGHT?(n.MOVE_UP="DOWN-ARROW",n.MOVE_DOWN="UP-ARROW"):this.menuposition===b.UP_LEFT?(n.MOVE_UP="DOWN-ARROW",n.MOVE_DOWN="UP-ARROW",n.MOVE_LEFT="RIGHT-ARROW",n.MOVE_RIGHT="LEFT-ARROW"):this.menuposition===b.DOWN_LEFT&&(n.MOVE_LEFT="RIGHT-ARROW",n.MOVE_RIGHT="LEFT-ARROW"),_.includes([n.MOVE_DOWN,n.MOVE_RIGHT],t)?this.bsDropdown.isOpen?this.$element.find("> ul[wmmenudropdown] li.app-menu-item").first().find("> a").focus():(this._selectFirstItem=!0,this.bsDropdown.show()):t===n.ON_ENTER?this.bsDropdown.toggle(!0):_.includes([n.MOVE_UP,n.MOVE_LEFT],t)&&this.bsDropdown.hide(),e.preventDefault()},t.prototype.resetNodes=function(){e.prototype.resetNodes.call(this),(this.autoopen===I&&o.hasLinkToCurrentPage(this.nodes,this.route.url)||this.autoopen===D)&&this.bsDropdown.show()},t.prototype.ngOnInit=function(){var t=this;e.prototype.ngOnInit.call(this),this.setMenuPosition();var n=this.app.subscribe("highlightActiveLink",(function(e){l.toggleClass(t.nativeElement.querySelector(".dropdown-toggle"),"active",o.hasLinkToCurrentPage(t.nodes,t.route.url))}));this.registerDestroyListener((function(){return n()}))},t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("autoclose"===t?this.bsDropdown.autoClose=n!==o.AUTOCLOSE_TYPE.DISABLED:e.prototype.onPropertyChange.call(this,t,n,i))},t.prototype.setMenuPosition=function(){switch(this.menuposition){case w:l.removeClass(this.nativeElement,"dropup"),this.menualign=S,this.menuCaret=T;break;case P:l.removeClass(this.nativeElement,"dropup"),this.menualign=C,this.menuCaret=T;break;case E:l.addClass(this.nativeElement,"dropup"),this.menualign=C,this.menuCaret=A;break;case O:l.addClass(this.nativeElement,"dropup"),this.menualign=S,this.menuCaret=A;break;case R:this.menualign="dropinline-menu"}},t.prototype.onMenuItemSelect=function(e){var t=e.$event,n=e.$item.value;this.invokeEventCallback("select",{$event:t,$item:n})},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),o.styler(this.nativeElement.querySelector(".dropdown-toggle"),this)},t}(o.DatasetAwareNavComponent);N.initializeProps=v(),N.decorators=[{type:t.Component,args:[{selector:"[wmMenu]",template:'<ng-template #menuTemplate>\n <button wmButton\n dropdownToggle\n aria-haspopup="true"\n aria-expanded="false"\n [attr.aria-label]="hint || \'Menu\'"\n class="btn app-button dropdown-toggle {{menuclass}}"\n hint.bind="hint"\n shortcutkey.bind="shortcutkey"\n tabindex.bind="tabindex"\n caption.bind="caption"\n iconclass.bind="iconclass"\n iconposition.bind="iconposition">\n <span class="pull-right caret fa {{menuCaret}}"></span>\n </button>\n</ng-template>\n\n<ng-template #innerTemplate>\n <i class="app-icon {{iconclass}}"></i>\n <span class="caption" [textContent]="caption"></span>\n <span class="pull-right caret fa {{menuCaret}}"></span>\n</ng-template>\n\n<ng-container *ngIf="type === \'anchor\'; else menuTemplate">\n <a wmAnchor\n dropdownToggle\n\n href="javascript:void(0);"\n role="button"\n aria-haspopup="true"\n aria-expanded="false"\n\n hint.bind="hint"\n class="dropdown-toggle {{menuclass}}"\n shortcutkey.bind="shortcutkey"\n tabindex.bind="tabindex"\n caption.bind="caption"\n iconclass.bind="iconclass"\n iconposition.bind="iconposition"\n badgevalue.bind="badgevalue"\n >\n <span class="pull-right caret fa {{menuCaret}}"></span>\n </a>\n</ng-container>\n\n<ul wmMenuDropdown [items]="nodes" [ngClass]="menulayout" class="icon-position-{{iconposition}}" *dropdownMenu aria-labelledby="dropdownmenu" role="menubar"></ul>\n',providers:[o.provideAsWidgetRef(N)]}]}],N.ctorParameters=function(){return[{type:t.Injector},{type:s.Router},{type:l.App},{type:l.UserDefinedExecutionContext},{type:i.BsDropdownDirective,decorators:[{type:t.Self},{type:t.Optional}]},{type:g,decorators:[{type:t.Optional}]},{type:String,decorators:[{type:t.Attribute,args:["select.event"]}]}]},N.propDecorators={onShow:[{type:t.HostListener,args:["onShown"]}],onHide:[{type:t.HostListener,args:["onHidden"]}],onKeyDown:[{type:t.HostListener,args:["keydown.arrowup",["$event",'"UP-ARROW"']]},{type:t.HostListener,args:["keydown.arrowdown",["$event",'"DOWN-ARROW"']]},{type:t.HostListener,args:["keydown.arrowright",["$event",'"RIGHT-ARROW"']]},{type:t.HostListener,args:["keydown.arrowleft",["$event",'"LEFT-ARROW"']]},{type:t.HostListener,args:["keydown.enter",["$event",'"ENTER"']]}]};var k={scale:{name:"wmScaleInLeft","down,right":"wmScaleInLeft","down,left":"wmScaleInRight","up,right":"wmScaleInTopLeft","up,left":"wmScaleInTopRight"},fade:{name:"fadeIn","down,right":"fadeIn","down,left":"fadeIn","up,right":"fadeIn","up,left":"fadeIn"},slide:{name:"wmSlideInDown","down,right":"wmSlideInDown","down,left":"wmSlideInDown","up,right":"wmSlideInUp","up,left":"wmSlideInUp"}},M=function(){function e(e,t){this.menuRef=t,this.nativeElement=e.nativeElement,l.addClass(this.nativeElement,"dropdown-menu")}return e.prototype.ngAfterViewInit=function(){var e=this.menuRef.animateitems,t="";e&&(t="animated "+(k[e][this.menuRef.menuposition]||k[e].name)),l.addClass(this.nativeElement,"dropdown-menu "+this.menuRef.menualign+" "+t,!0)},e}();M.decorators=[{type:t.Component,args:[{selector:"ul[wmMenuDropdown]",template:'<li wmMenuDropdownItem *ngFor="let item of items"\n [item]="item"\n [ngClass]="{disabled: item.disabled, \'dropdown-submenu\': item.children.length > 0}"\n class="{{item.class}}"\n role="menuitem">\n</li>\n'}]}],M.ctorParameters=function(){return[{type:t.ElementRef},{type:N}]},M.propDecorators={items:[{type:t.Input}]};var L={"pull-right":"fa-caret-left","dropinline-menu":"fa-caret-down","pull-left":"fa-caret-right"},F="horizontal",j=function(){function e(e,t,n,i,o){var a=this;this.app=e,this.menuRef=t,this.userDefinedExecutionContext=n,this.parentNav=i,this.onSelect=function(e,t){if(a.nativeElement===$(e.target).closest(".app-menu-item").get(0)){"outsideClick"===a.menuRef.autoclose&&e.stopPropagation(),e.preventDefault();var n={$event:e,$item:t};a.menuRef.onMenuItemSelect(n);var i=_.clone(t);i.target=i.target||a.menuRef.linktarget,l.triggerItemAction(a,i)}},this.nativeElement=o.nativeElement,l.addClass(this.nativeElement,"app-menu-item"),this.menualign=L[this.menuRef.menualign]||L["pull-left"]}return e.prototype.ngOnInit=function(){var e=this;this.parentNav&&(o.hasLinkToCurrentPage([this.item],this.menuRef.route.url)&&l.addClass(this.nativeElement,"active"),this.highlightActiveLinkSubscription=this.app.subscribe("highlightActiveLink",(function(t){l.toggleClass(e.nativeElement,"active",o.hasLinkToCurrentPage([e.item],e.menuRef.route.url))})))},e.prototype.getInitialKeyMovements=function(){var e=_.clone(y);return this.menuRef.menulayout===F?(e.MOVE_UP="LEFT-ARROW",e.MOVE_LEFT="UP-ARROW",e.MOVE_RIGHT="DOWN-ARROW",e.MOVE_DOWN="RIGHT-ARROW"):this.menuRef.menuposition===b.DOWN_LEFT||this.menuRef.menuposition===b.UP_LEFT?(e.MOVE_LEFT="RIGHT-ARROW",e.MOVE_RIGHT="LEFT-ARROW"):"inline"===this.menuRef.menuposition&&(e.MOVE_UP="LEFT-ARROW",e.MOVE_LEFT="UP-ARROW",e.MOVE_RIGHT="DOWN-ARROW",e.MOVE_DOWN="RIGHT-ARROW"),e},e.prototype.onKeyDown=function(e,t){var n=$(this.nativeElement),i=$(this.nativeElement).closest("ul.dropdown-menu"),o=this.menuRef.$element.find("> ul.dropdown-menu"),a=this.getInitialKeyMovements();if(_.includes(["LEFT-ARROW","RIGHT-ARROW","UP-ARROW","DOWN-ARROW"],t)&&e.preventDefault(),t===a.ON_TAB&&o.children().last()[0]===this.nativeElement||t===a.ON_SHIFT_TAB&&o.children().first()[0]===this.nativeElement||t===a.ON_ESCAPE)e.preventDefault(),this.menuRef.bsDropdown.hide();else if(t===a.ON_ENTER&&!this.item.link||t===a.MOVE_RIGHT)e.stopPropagation(),this.item.children.length?(n.toggleClass("open"),n.find("li").first().find("> a").focus()):n.find("> a").focus();else if(t===a.MOVE_LEFT||t===a.ON_TAB&&i.children().last()[0]===this.nativeElement||t===a.ON_SHIFT_TAB&&i.children().first()[0]===this.nativeElement){if(o[0]!==i[0]){var r=i.parent();r.toggleClass("open").find("li.open").removeClass("open"),r.find("> a").focus(),e.preventDefault(),e.stopPropagation()}}else t===a.MOVE_UP?o[0]===i[0]&&o.find("> li").first()[0]===this.nativeElement||(e.stopPropagation(),n.prev().find("> a").focus()):t===a.MOVE_DOWN?(e.stopPropagation(),o.find("> li").last()[0]===this.nativeElement&&(this.menuRef.menulayout!==F&&this.menuRef.menuposition===b.UP_RIGHT||this.menuRef.menuposition===b.UP_LEFT)?this.menuRef.bsDropdown.hide():n.next().find("> a").focus()):t===a.ON_ENTER?this.onSelect(e,this.item):e.stopPropagation()},e.prototype.ngOnDestroy=function(){this.highlightActiveLinkSubscription&&this.highlightActiveLinkSubscription()},e}();j.decorators=[{type:t.Component,args:[{selector:"li[wmMenuDropdownItem]",template:'<a href="javascript:void(0);" [title]="item.label" [wmNavigationControl]="item.link" [disableMenuContext]="menuRef.disableMenuContext || !!item.action">\n <span *ngIf="item.children.length" class="pull-right fa caret {{menualign}}"></span>\n <i class="app-icon {{item.icon}}"></i>\n <span class="anchor-caption">{{item.label}}</span>\n <span *ngIf="item.badge" class="badge pull-right" [textContent]="item.badge"></span>\n</a>\n<ng-container [ngTemplateOutlet]="nestedMenuDropdown" *ngIf="item.children.length" [ngTemplateOutletContext]="{item: item}"></ng-container>\n\n<ng-template #nestedMenuDropdown let-item="item">\n <ul wmMenuDropdown [items]="item.children"></ul>\n</ng-template>\n'}]}],j.ctorParameters=function(){return[{type:l.App},{type:N},{type:l.UserDefinedExecutionContext},{type:g,decorators:[{type:t.Optional}]},{type:t.ElementRef}]},j.propDecorators={item:[{type:t.Input}],onKeyDown:[{type:t.HostListener,args:["keydown.tab",["$event",'"TAB"']]},{type:t.HostListener,args:["keydown.shift.tab",["$event",'"SHIFT-TAB"']]},{type:t.HostListener,args:["keydown.escape",["$event",'"ESC"']]},{type:t.HostListener,args:["keydown.enter",["$event",'"ENTER"']]},{type:t.HostListener,args:["keydown.arrowup",["$event",'"UP-ARROW"']]},{type:t.HostListener,args:["keydown.arrowdown",["$event",'"DOWN-ARROW"']]},{type:t.HostListener,args:["keydown.arrowright",["$event",'"RIGHT-ARROW"']]},{type:t.HostListener,args:["keydown.arrowleft",["$event",'"LEFT-ARROW"']]}],onSelect:[{type:t.HostListener,args:["click",["$event","item"]]}]};var B=function(){o.register("wm-nav-item",new Map([["class",o.PROP_STRING],["name",o.PROP_STRING],["show",Object.assign({value:!0},o.PROP_BOOLEAN)]]))},G={widgetType:"wm-nav-item",hostClass:"app-nav-item"},V=function(e){function t(t){var n=e.call(this,t,G)||this;return o.styler(n.nativeElement,n,o.APPLY_STYLES_TYPE.CONTAINER),n}return p(t,e),t.prototype.makeActive=function(){var e=this.nativeElement.parentNode;$(e).find("> li.active").removeClass("active"),this.isAttached&&l.addClass(this.nativeElement,"active")},t.prototype.ngAfterViewInit=function(){var e=this;this.innerLink&&this.innerLink.onActive((function(){return e.makeActive()}))},t.prototype.ngOnDetach=function(){l.removeClass(this.nativeElement,"active",!0),e.prototype.ngOnDetach.call(this)},t}(o.StylableComponent);V.initializeProps=B(),V.decorators=[{type:t.Directive,args:[{selector:"[wmNavItem]",providers:[o.provideAsWidgetRef(V)]}]}],V.ctorParameters=function(){return[{type:t.Injector}]},V.propDecorators={innerLink:[{type:t.ContentChild,args:[a.AnchorComponent]}],makeActive:[{type:t.HostListener,args:["click"]},{type:t.HostListener,args:["keydown.enter"]}]};var W=function(e){e.preventDefault()},U=function(){function e(e){this.nativeElement=e.nativeElement}return Object.defineProperty(e.prototype,"wmNavigationControl",{set:function(e){this._link=e,e&&!this.disableMenuContext?(l.setAttr(this.nativeElement,"href",e),this.nativeElement.removeEventListener("contextmenu",W)):(l.setAttr(this.nativeElement,"href","javascript:void(0)"),this.nativeElement.addEventListener("contextmenu",W))},enumerable:!1,configurable:!0}),e}();U.decorators=[{type:t.Directive,args:[{selector:"[wmNavigationControl]"}]}],U.ctorParameters=function(){return[{type:t.ElementRef}]},U.propDecorators={disableMenuContext:[{type:t.Input}],wmNavigationControl:[{type:t.Input}]};var q=[N,M,j,U,g,V],z=function(){};z.decorators=[{type:t.NgModule,args:[{imports:[a.BasicModule,i.BsDropdownModule,n.CommonModule,r.InputModule,o.WmComponentsModule],declarations:u([],d(q)),exports:u([],d(q)),entryComponents:[N,M]}]}];var H=["itemlabel","itemicon","itemlink","itemaction","itemchildren","userrole"],Y=function(e){function t(t,n){var i=e.call(this,t,n)||this;return i.pageScope=i.viewParent,i.binditemlabel=i.nativeElement.getAttribute("itemlabel.bind"),i.binditemicon=i.nativeElement.getAttribute("itemicon.bind"),i.binditemaction=i.nativeElement.getAttribute("itemaction.bind"),i.binditemlink=i.nativeElement.getAttribute("itemlink.bind"),i.binduserrole=i.nativeElement.getAttribute("userrole.bind"),i.binditemchildren=i.nativeElement.getAttribute("itemchildren.bind"),i}return p(t,e),t.prototype.onPropertyChange=function(t,n,i){_.includes(H,t)&&this.menuRef?this.menuRef.itemlabel=n:e.prototype.onPropertyChange.call(this,t,n,i)},t.prototype.ngAfterViewInit=function(){var t=this;e.prototype.ngAfterViewInit.call(this);var n=this.menuRefQL.changes.subscribe((function(e){e.first&&(t.menuRef=e.first,H.forEach((function(e){var n="bind"+e;t[n]&&(t.menuRef[n]=t[n]),t.menuRef[e]=t[e]})),n.unsubscribe())}))},t}(o.BaseContainerComponent);Y.decorators=[{type:t.Directive}],Y.ctorParameters=function(){return[null,null]},Y.propDecorators={menuRefQL:[{type:t.ViewChildren,args:[N]}]},e.KEYBOARD_MOVEMENTS=y,e.MENU_POSITION=b,e.MenuAdapterComponent=Y,e.MenuComponent=N,e.MenuDropdownComponent=M,e.MenuDropdownItemComponent=j,e.MenuModule=z,e.NavComponent=g,e.NavItemDirective=V,e.NavigationControlDirective=U,e.disableContextMenu=W,e["\u0275a"]=h,e["\u0275b"]=v,e["\u0275c"]=B,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@wm/components/base")):"function"==typeof define&&define.amd?define("@wm/components/navigation/navbar",["exports","@angular/core","@angular/common","@wm/components/base"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.navigation=e.wm.components.navigation||{},e.wm.components.navigation.navbar={}),e.ng.core,e.ng.common,e.wm.components.base)}(this,(function(e,t,n,i){"use strict";
268
268
  /*! *****************************************************************************
269
269
  Copyright (c) Microsoft Corporation.
270
270
 
@@ -33771,7 +33771,6 @@
33771
33771
  core.$appDigest();
33772
33772
  };
33773
33773
  MenuComponent.prototype.onHide = function() {
33774
- this.$element.find(">.dropdown-toggle").focus();
33775
33774
  this.$element.find("li").removeClass("open");
33776
33775
  this._selectFirstItem = false;
33777
33776
  core.$appDigest();
@@ -264,7 +264,7 @@
264
264
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
265
265
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
266
266
  PERFORMANCE OF THIS SOFTWARE.
267
- ***************************************************************************** */var c=function(e,t){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}c(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}Object.create;function u(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function d(e,t,n){if(n||2===arguments.length)for(var i,o=0,r=t.length;o<r;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var h=function(){o.register("wm-nav",new Map([["autoclose",Object.assign({value:"always"},o.PROP_STRING)],["autoopen",Object.assign({value:"never"},o.PROP_STRING)],["class",o.PROP_STRING],["dataset",o.PROP_ANY],["iconposition",Object.assign({value:"left"},o.PROP_STRING)],["isactive",o.PROP_STRING],["itemlabel",o.PROP_STRING],["itemlink",o.PROP_STRING],["itemicon",o.PROP_STRING],["itemclass",o.PROP_STRING],["itemchildren",o.PROP_STRING],["itemaction",o.PROP_STRING],["itembadge",o.PROP_STRING],["itemtarget",o.PROP_STRING],["layout",o.PROP_STRING],["name",o.PROP_STRING],["orderby",o.PROP_STRING],["show",Object.assign({value:!0},o.PROP_BOOLEAN)],["type",o.PROP_STRING],["userrole",o.PROP_STRING]]))},m={widgetType:"wm-nav",hostClass:"nav app-nav"},f={pills:"nav-pills",tabs:"nav-tabs",navbar:"navbar-nav"},g=function(e){function t(t,n,i,r,a,s){var c=e.call(this,t,m)||this;c.cdRef=n,c.route=i,c.userDefinedExecutionContext=r,c.app=a,o.styler(c.nativeElement,c,o.APPLY_STYLES_TYPE.CONTAINER),c.disableMenuContext=!!s,c.pageScope=c.viewParent;var p=c.nodes$.subscribe((function(){if(!_.isEmpty(c.nodes)){var e=!1,t=function(n,i){_.forEach(n,(function(n){if(!e)return n.isactive?(e=!0,c.selecteditem=i?_.omit(n,["children","value"]):n.value,c.invokeEventCallback("select",{$event:{},$item:n.value}),l.triggerItemAction(c,n),i||(n._selected=!0),!1):void(_.isEmpty(n.children)||t(n.children,"menu"))}))};t(c.nodes)}}));return c.registerDestroyListener((function(){return p.unsubscribe()})),c}return p(t,e),Object.defineProperty(t.prototype,"activePageName",{get:function(){return this.app.activePageName},enumerable:!1,configurable:!0}),t.prototype.setNavType=function(e){l.addClass(this.nativeElement,f[e])},t.prototype.setNavLayout=function(e){l.addClass(this.nativeElement,"nav-"+e)},t.prototype.onNavSelect=function(e,t,n){e.preventDefault();var i=_.find(this.nodes,"_selected");i&&delete i._selected,this.activeNavLINode&&l.removeClass(this.activeNavLINode,"active"),this.activeNavLINode=n,l.addClass(n,"active"),this.selecteditem=t.value,this.invokeEventCallback("select",{$event:e,$item:t.value}),l.triggerItemAction(this,t)},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.setNavType(this.type),this.setNavLayout(this.layout)},t.prototype.onMenuItemSelect=function(e,t,n){this.selecteditem=_.omit(n,["children","value"]),this.invokeEventCallback("select",{$event:e,$item:this.selecteditem})},t}(o.DatasetAwareNavComponent);g.initializeProps=h(),g.decorators=[{type:t.Component,args:[{selector:"[wmNav]",template:'<ng-template #menuRef let-item="item" let-index="index">\n <div wmMenu dropdown\n type="anchor"\n autoclose.bind="autoclose"\n iconclass.bind="item.icon"\n autoopen.bind="autoopen"\n caption.bind="item.label"\n dataset.bind="item.children"\n badgevalue.bind="item.badge"\n iconposition.bind="iconposition"\n select.event="onMenuItemSelect($event, widget, $item)"></div>\n</ng-template>\n\n<ng-template #anchorRef let-item="item" let-index="index" let-liRef="liRef">\n <a wmAnchor\n [disableMenuContext]="disableMenuContext || !!item.action"\n [wmNavigationControl]="item.link"\n [attr.aria-current]="item._selected || (!isactive && item.link === \'#/\' + activePageName) ? \'page\' : \'\'"\n caption.bind="item.label"\n iconclass.bind="item.icon"\n badgevalue.bind="item.badge"\n iconposition.bind="iconposition"\n click.event="onNavSelect($event, item, liRef)"></a>\n</ng-template>\n\n<li class="app-nav-item {{item.class}}" *ngFor="let item of nodes; let index = index;" #liRef [ngClass]="{active: item._selected || (!isactive && item.link === \'#/\' + activePageName)}">\n <ng-container [ngTemplateOutlet]="anchorRef" [ngTemplateOutletContext]="{item: item, index:index, liRef: liRef}" *ngIf="!item.children.length"></ng-container>\n <ng-container [ngTemplateOutlet]="menuRef" [ngTemplateOutletContext]="{item: item, index:index}" *ngIf="item.children.length"></ng-container>\n</li>\n\n<ng-content *ngIf="!nodes.length" select="[wmNavItem]"></ng-content>\n',providers:[o.provideAsWidgetRef(g)]}]}],g.ctorParameters=function(){return[{type:t.Injector},{type:t.ChangeDetectorRef},{type:s.Router},{type:l.UserDefinedExecutionContext},{type:l.App},{type:void 0,decorators:[{type:t.Attribute,args:["select.event"]}]}]};var v=function(){o.register("wm-menu",new Map([["accessroles",Object.assign({value:"Everyone"},o.PROP_STRING)],["animateitems",o.PROP_STRING],["autoclose",Object.assign({value:"always"},o.PROP_STRING)],["autoopen",Object.assign({value:"never"},o.PROP_STRING)],["caption",o.PROP_STRING],["class",o.PROP_STRING],["dataset",Object.assign({value:"Menu Item 1, Menu Item 2, Menu Item 3"},o.PROP_ANY)],["hint",Object.assign({value:""},o.PROP_STRING)],["isactive",o.PROP_STRING],["iconclass",o.PROP_STRING],["iconposition",Object.assign({value:"left"},o.PROP_STRING)],["itemaction",o.PROP_STRING],["itemchildren",o.PROP_STRING],["itemclass",o.PROP_STRING],["itemicon",o.PROP_STRING],["itemlabel",o.PROP_STRING],["itemlink",o.PROP_STRING],["itemtarget",o.PROP_STRING],["linktarget",Object.assign({value:"_self"},o.PROP_STRING)],["menuclass",o.PROP_STRING],["menulayout",o.PROP_STRING],["menuposition",o.PROP_STRING],["name",o.PROP_STRING],["orderby",o.PROP_STRING],["shortcutkey",o.PROP_STRING],["show",Object.assign({value:!0},o.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},o.PROP_NUMBER)],["type",Object.assign({value:"menu"},o.PROP_STRING)],["userrole",o.PROP_STRING]]))},y={MOVE_UP:"UP-ARROW",MOVE_LEFT:"LEFT-ARROW",MOVE_RIGHT:"RIGHT-ARROW",MOVE_DOWN:"DOWN-ARROW",ON_ENTER:"ENTER",ON_TAB:"TAB",ON_SHIFT_TAB:"SHIFT-TAB",ON_ESCAPE:"ESC"},b={UP_LEFT:"up,left",UP_RIGHT:"up,right",DOWN_LEFT:"down,left",DOWN_RIGHT:"down,right",INLINE:"inline"},w="down,right",P="down,left",O="up,right",S="up,left",E="inline",T="fa-caret-up",C="fa-caret-down",A="pull-left",R="pull-right",I="activepage",D="always",N={widgetType:"wm-menu",hostClass:"dropdown app-menu"},x=function(e){function t(t,n,i,r,a,s,c){var p=e.call(this,t,N)||this;p.route=n,p.app=i,p.userDefinedExecutionContext=r,p.bsDropdown=a,p.parentNav=s,p.selectEventCB=c,p.menuCaret="fa-caret-down",p._selectFirstItem=!1,p.disableMenuContext=s?!!s.disableMenuContext:!!c;var u=p.nodes$.subscribe((function(){if(!_.isEmpty(p.nodes)){if(o.hasLinkToCurrentPage(p.nodes,p.route.url)&&l.addClass(p.nativeElement.querySelector(".dropdown-toggle"),"active"),p.parentNav)return;var e=!1,t=function(n){_.forEach(n,(function(n){if(!e)return n.isactive?(e=!0,p.onMenuItemSelect({$event:{},$item:n}),l.triggerItemAction(p,n),!1):void(_.isEmpty(n.children)||t(n.children))}))};t(p.nodes)}}));return p.registerDestroyListener((function(){return u.unsubscribe()})),p}return p(t,e),t.prototype.onShow=function(){var e=this;this._selectFirstItem&&setTimeout((function(){e.$element.find("> ul[wmmenudropdown] li.app-menu-item").first().find("> a").focus()})),l.$appDigest()},t.prototype.onHide=function(){this.$element.find(">.dropdown-toggle").focus(),this.$element.find("li").removeClass("open"),this._selectFirstItem=!1,l.$appDigest()},t.prototype.onKeyDown=function(e,t){var n=_.clone(y);this.menuposition===b.UP_RIGHT?(n.MOVE_UP="DOWN-ARROW",n.MOVE_DOWN="UP-ARROW"):this.menuposition===b.UP_LEFT?(n.MOVE_UP="DOWN-ARROW",n.MOVE_DOWN="UP-ARROW",n.MOVE_LEFT="RIGHT-ARROW",n.MOVE_RIGHT="LEFT-ARROW"):this.menuposition===b.DOWN_LEFT&&(n.MOVE_LEFT="RIGHT-ARROW",n.MOVE_RIGHT="LEFT-ARROW"),_.includes([n.MOVE_DOWN,n.MOVE_RIGHT],t)?this.bsDropdown.isOpen?this.$element.find("> ul[wmmenudropdown] li.app-menu-item").first().find("> a").focus():(this._selectFirstItem=!0,this.bsDropdown.show()):t===n.ON_ENTER?this.bsDropdown.toggle(!0):_.includes([n.MOVE_UP,n.MOVE_LEFT],t)&&this.bsDropdown.hide(),e.preventDefault()},t.prototype.resetNodes=function(){e.prototype.resetNodes.call(this),(this.autoopen===I&&o.hasLinkToCurrentPage(this.nodes,this.route.url)||this.autoopen===D)&&this.bsDropdown.show()},t.prototype.ngOnInit=function(){var t=this;e.prototype.ngOnInit.call(this),this.setMenuPosition();var n=this.app.subscribe("highlightActiveLink",(function(e){l.toggleClass(t.nativeElement.querySelector(".dropdown-toggle"),"active",o.hasLinkToCurrentPage(t.nodes,t.route.url))}));this.registerDestroyListener((function(){return n()}))},t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("autoclose"===t?this.bsDropdown.autoClose=n!==o.AUTOCLOSE_TYPE.DISABLED:e.prototype.onPropertyChange.call(this,t,n,i))},t.prototype.setMenuPosition=function(){switch(this.menuposition){case w:l.removeClass(this.nativeElement,"dropup"),this.menualign=A,this.menuCaret=C;break;case P:l.removeClass(this.nativeElement,"dropup"),this.menualign=R,this.menuCaret=C;break;case S:l.addClass(this.nativeElement,"dropup"),this.menualign=R,this.menuCaret=T;break;case O:l.addClass(this.nativeElement,"dropup"),this.menualign=A,this.menuCaret=T;break;case E:this.menualign="dropinline-menu"}},t.prototype.onMenuItemSelect=function(e){var t=e.$event,n=e.$item.value;this.invokeEventCallback("select",{$event:t,$item:n})},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),o.styler(this.nativeElement.querySelector(".dropdown-toggle"),this)},t}(o.DatasetAwareNavComponent);x.initializeProps=v(),x.decorators=[{type:t.Component,args:[{selector:"[wmMenu]",template:'<ng-template #menuTemplate>\n <button wmButton\n dropdownToggle\n aria-haspopup="true"\n aria-expanded="false"\n [attr.aria-label]="hint || \'Menu\'"\n class="btn app-button dropdown-toggle {{menuclass}}"\n hint.bind="hint"\n shortcutkey.bind="shortcutkey"\n tabindex.bind="tabindex"\n caption.bind="caption"\n iconclass.bind="iconclass"\n iconposition.bind="iconposition">\n <span class="pull-right caret fa {{menuCaret}}"></span>\n </button>\n</ng-template>\n\n<ng-template #innerTemplate>\n <i class="app-icon {{iconclass}}"></i>\n <span class="caption" [textContent]="caption"></span>\n <span class="pull-right caret fa {{menuCaret}}"></span>\n</ng-template>\n\n<ng-container *ngIf="type === \'anchor\'; else menuTemplate">\n <a wmAnchor\n dropdownToggle\n\n href="javascript:void(0);"\n role="button"\n aria-haspopup="true"\n aria-expanded="false"\n\n hint.bind="hint"\n class="dropdown-toggle {{menuclass}}"\n shortcutkey.bind="shortcutkey"\n tabindex.bind="tabindex"\n caption.bind="caption"\n iconclass.bind="iconclass"\n iconposition.bind="iconposition"\n badgevalue.bind="badgevalue"\n >\n <span class="pull-right caret fa {{menuCaret}}"></span>\n </a>\n</ng-container>\n\n<ul wmMenuDropdown [items]="nodes" [ngClass]="menulayout" class="icon-position-{{iconposition}}" *dropdownMenu aria-labelledby="dropdownmenu" role="menubar"></ul>\n',providers:[o.provideAsWidgetRef(x)]}]}],x.ctorParameters=function(){return[{type:t.Injector},{type:s.Router},{type:l.App},{type:l.UserDefinedExecutionContext},{type:i.BsDropdownDirective,decorators:[{type:t.Self},{type:t.Optional}]},{type:g,decorators:[{type:t.Optional}]},{type:String,decorators:[{type:t.Attribute,args:["select.event"]}]}]},x.propDecorators={onShow:[{type:t.HostListener,args:["onShown"]}],onHide:[{type:t.HostListener,args:["onHidden"]}],onKeyDown:[{type:t.HostListener,args:["keydown.arrowup",["$event",'"UP-ARROW"']]},{type:t.HostListener,args:["keydown.arrowdown",["$event",'"DOWN-ARROW"']]},{type:t.HostListener,args:["keydown.arrowright",["$event",'"RIGHT-ARROW"']]},{type:t.HostListener,args:["keydown.arrowleft",["$event",'"LEFT-ARROW"']]},{type:t.HostListener,args:["keydown.enter",["$event",'"ENTER"']]}]};var k={scale:{name:"wmScaleInLeft","down,right":"wmScaleInLeft","down,left":"wmScaleInRight","up,right":"wmScaleInTopLeft","up,left":"wmScaleInTopRight"},fade:{name:"fadeIn","down,right":"fadeIn","down,left":"fadeIn","up,right":"fadeIn","up,left":"fadeIn"},slide:{name:"wmSlideInDown","down,right":"wmSlideInDown","down,left":"wmSlideInDown","up,right":"wmSlideInUp","up,left":"wmSlideInUp"}},M=function(){function e(e,t){this.menuRef=t,this.nativeElement=e.nativeElement,l.addClass(this.nativeElement,"dropdown-menu")}return e.prototype.ngAfterViewInit=function(){var e=this.menuRef.animateitems,t="";e&&(t="animated "+(k[e][this.menuRef.menuposition]||k[e].name)),l.addClass(this.nativeElement,"dropdown-menu "+this.menuRef.menualign+" "+t,!0)},e}();M.decorators=[{type:t.Component,args:[{selector:"ul[wmMenuDropdown]",template:'<li wmMenuDropdownItem *ngFor="let item of items"\n [item]="item"\n [ngClass]="{disabled: item.disabled, \'dropdown-submenu\': item.children.length > 0}"\n class="{{item.class}}"\n role="menuitem">\n</li>\n'}]}],M.ctorParameters=function(){return[{type:t.ElementRef},{type:x}]},M.propDecorators={items:[{type:t.Input}]};var L={"pull-right":"fa-caret-left","dropinline-menu":"fa-caret-down","pull-left":"fa-caret-right"},F="horizontal",j=function(){function e(e,t,n,i,o){var r=this;this.app=e,this.menuRef=t,this.userDefinedExecutionContext=n,this.parentNav=i,this.onSelect=function(e,t){if(r.nativeElement===$(e.target).closest(".app-menu-item").get(0)){"outsideClick"===r.menuRef.autoclose&&e.stopPropagation(),e.preventDefault();var n={$event:e,$item:t};r.menuRef.onMenuItemSelect(n);var i=_.clone(t);i.target=i.target||r.menuRef.linktarget,l.triggerItemAction(r,i)}},this.nativeElement=o.nativeElement,l.addClass(this.nativeElement,"app-menu-item"),this.menualign=L[this.menuRef.menualign]||L["pull-left"]}return e.prototype.ngOnInit=function(){var e=this;this.parentNav&&(o.hasLinkToCurrentPage([this.item],this.menuRef.route.url)&&l.addClass(this.nativeElement,"active"),this.highlightActiveLinkSubscription=this.app.subscribe("highlightActiveLink",(function(t){l.toggleClass(e.nativeElement,"active",o.hasLinkToCurrentPage([e.item],e.menuRef.route.url))})))},e.prototype.getInitialKeyMovements=function(){var e=_.clone(y);return this.menuRef.menulayout===F?(e.MOVE_UP="LEFT-ARROW",e.MOVE_LEFT="UP-ARROW",e.MOVE_RIGHT="DOWN-ARROW",e.MOVE_DOWN="RIGHT-ARROW"):this.menuRef.menuposition===b.DOWN_LEFT||this.menuRef.menuposition===b.UP_LEFT?(e.MOVE_LEFT="RIGHT-ARROW",e.MOVE_RIGHT="LEFT-ARROW"):"inline"===this.menuRef.menuposition&&(e.MOVE_UP="LEFT-ARROW",e.MOVE_LEFT="UP-ARROW",e.MOVE_RIGHT="DOWN-ARROW",e.MOVE_DOWN="RIGHT-ARROW"),e},e.prototype.onKeyDown=function(e,t){var n=$(this.nativeElement),i=$(this.nativeElement).closest("ul.dropdown-menu"),o=this.menuRef.$element.find("> ul.dropdown-menu"),r=this.getInitialKeyMovements();if(_.includes(["LEFT-ARROW","RIGHT-ARROW","UP-ARROW","DOWN-ARROW"],t)&&e.preventDefault(),t===r.ON_TAB&&o.children().last()[0]===this.nativeElement||t===r.ON_SHIFT_TAB&&o.children().first()[0]===this.nativeElement||t===r.ON_ESCAPE)e.preventDefault(),this.menuRef.bsDropdown.hide();else if(t===r.ON_ENTER&&!this.item.link||t===r.MOVE_RIGHT)e.stopPropagation(),this.item.children.length?(n.toggleClass("open"),n.find("li").first().find("> a").focus()):n.find("> a").focus();else if(t===r.MOVE_LEFT||t===r.ON_TAB&&i.children().last()[0]===this.nativeElement||t===r.ON_SHIFT_TAB&&i.children().first()[0]===this.nativeElement){if(o[0]!==i[0]){var a=i.parent();a.toggleClass("open").find("li.open").removeClass("open"),a.find("> a").focus(),e.preventDefault(),e.stopPropagation()}}else t===r.MOVE_UP?o[0]===i[0]&&o.find("> li").first()[0]===this.nativeElement||(e.stopPropagation(),n.prev().find("> a").focus()):t===r.MOVE_DOWN?(e.stopPropagation(),o.find("> li").last()[0]===this.nativeElement&&(this.menuRef.menulayout!==F&&this.menuRef.menuposition===b.UP_RIGHT||this.menuRef.menuposition===b.UP_LEFT)?this.menuRef.bsDropdown.hide():n.next().find("> a").focus()):t===r.ON_ENTER?this.onSelect(e,this.item):e.stopPropagation()},e.prototype.ngOnDestroy=function(){this.highlightActiveLinkSubscription&&this.highlightActiveLinkSubscription()},e}();j.decorators=[{type:t.Component,args:[{selector:"li[wmMenuDropdownItem]",template:'<a href="javascript:void(0);" [title]="item.label" [wmNavigationControl]="item.link" [disableMenuContext]="menuRef.disableMenuContext || !!item.action">\n <span *ngIf="item.children.length" class="pull-right fa caret {{menualign}}"></span>\n <i class="app-icon {{item.icon}}"></i>\n <span class="anchor-caption">{{item.label}}</span>\n <span *ngIf="item.badge" class="badge pull-right" [textContent]="item.badge"></span>\n</a>\n<ng-container [ngTemplateOutlet]="nestedMenuDropdown" *ngIf="item.children.length" [ngTemplateOutletContext]="{item: item}"></ng-container>\n\n<ng-template #nestedMenuDropdown let-item="item">\n <ul wmMenuDropdown [items]="item.children"></ul>\n</ng-template>\n'}]}],j.ctorParameters=function(){return[{type:l.App},{type:x},{type:l.UserDefinedExecutionContext},{type:g,decorators:[{type:t.Optional}]},{type:t.ElementRef}]},j.propDecorators={item:[{type:t.Input}],onKeyDown:[{type:t.HostListener,args:["keydown.tab",["$event",'"TAB"']]},{type:t.HostListener,args:["keydown.shift.tab",["$event",'"SHIFT-TAB"']]},{type:t.HostListener,args:["keydown.escape",["$event",'"ESC"']]},{type:t.HostListener,args:["keydown.enter",["$event",'"ENTER"']]},{type:t.HostListener,args:["keydown.arrowup",["$event",'"UP-ARROW"']]},{type:t.HostListener,args:["keydown.arrowdown",["$event",'"DOWN-ARROW"']]},{type:t.HostListener,args:["keydown.arrowright",["$event",'"RIGHT-ARROW"']]},{type:t.HostListener,args:["keydown.arrowleft",["$event",'"LEFT-ARROW"']]}],onSelect:[{type:t.HostListener,args:["click",["$event","item"]]}]};var B=function(){o.register("wm-nav-item",new Map([["class",o.PROP_STRING],["name",o.PROP_STRING],["show",Object.assign({value:!0},o.PROP_BOOLEAN)]]))},G={widgetType:"wm-nav-item",hostClass:"app-nav-item"},V=function(e){function t(t){var n=e.call(this,t,G)||this;return o.styler(n.nativeElement,n,o.APPLY_STYLES_TYPE.CONTAINER),n}return p(t,e),t.prototype.makeActive=function(){var e=this.nativeElement.parentNode;$(e).find("> li.active").removeClass("active"),this.isAttached&&l.addClass(this.nativeElement,"active")},t.prototype.ngAfterViewInit=function(){var e=this;this.innerLink&&this.innerLink.onActive((function(){return e.makeActive()}))},t.prototype.ngOnDetach=function(){l.removeClass(this.nativeElement,"active",!0),e.prototype.ngOnDetach.call(this)},t}(o.StylableComponent);V.initializeProps=B(),V.decorators=[{type:t.Directive,args:[{selector:"[wmNavItem]",providers:[o.provideAsWidgetRef(V)]}]}],V.ctorParameters=function(){return[{type:t.Injector}]},V.propDecorators={innerLink:[{type:t.ContentChild,args:[r.AnchorComponent]}],makeActive:[{type:t.HostListener,args:["click"]},{type:t.HostListener,args:["keydown.enter"]}]};var U=function(e){e.preventDefault()},W=function(){function e(e){this.nativeElement=e.nativeElement}return Object.defineProperty(e.prototype,"wmNavigationControl",{set:function(e){this._link=e,e&&!this.disableMenuContext?(l.setAttr(this.nativeElement,"href",e),this.nativeElement.removeEventListener("contextmenu",U)):(l.setAttr(this.nativeElement,"href","javascript:void(0)"),this.nativeElement.addEventListener("contextmenu",U))},enumerable:!1,configurable:!0}),e}();W.decorators=[{type:t.Directive,args:[{selector:"[wmNavigationControl]"}]}],W.ctorParameters=function(){return[{type:t.ElementRef}]},W.propDecorators={disableMenuContext:[{type:t.Input}],wmNavigationControl:[{type:t.Input}]};var q=[x,M,j,W,g,V],z=function(){};z.decorators=[{type:t.NgModule,args:[{imports:[r.BasicModule,i.BsDropdownModule,n.CommonModule,a.InputModule,o.WmComponentsModule],declarations:d([],u(q)),exports:d([],u(q)),entryComponents:[x,M]}]}];var H=["itemlabel","itemicon","itemlink","itemaction","itemchildren","userrole"],Y=function(e){function t(t,n){var i=e.call(this,t,n)||this;return i.pageScope=i.viewParent,i.binditemlabel=i.nativeElement.getAttribute("itemlabel.bind"),i.binditemicon=i.nativeElement.getAttribute("itemicon.bind"),i.binditemaction=i.nativeElement.getAttribute("itemaction.bind"),i.binditemlink=i.nativeElement.getAttribute("itemlink.bind"),i.binduserrole=i.nativeElement.getAttribute("userrole.bind"),i.binditemchildren=i.nativeElement.getAttribute("itemchildren.bind"),i}return p(t,e),t.prototype.onPropertyChange=function(t,n,i){_.includes(H,t)&&this.menuRef?this.menuRef.itemlabel=n:e.prototype.onPropertyChange.call(this,t,n,i)},t.prototype.ngAfterViewInit=function(){var t=this;e.prototype.ngAfterViewInit.call(this);var n=this.menuRefQL.changes.subscribe((function(e){e.first&&(t.menuRef=e.first,H.forEach((function(e){var n="bind"+e;t[n]&&(t.menuRef[n]=t[n]),t.menuRef[e]=t[e]})),n.unsubscribe())}))},t}(o.BaseContainerComponent);Y.decorators=[{type:t.Directive}],Y.ctorParameters=function(){return[null,null]},Y.propDecorators={menuRefQL:[{type:t.ViewChildren,args:[x]}]},e.KEYBOARD_MOVEMENTS=y,e.MENU_POSITION=b,e.MenuAdapterComponent=Y,e.MenuComponent=x,e.MenuDropdownComponent=M,e.MenuDropdownItemComponent=j,e.MenuModule=z,e.NavComponent=g,e.NavItemDirective=V,e.NavigationControlDirective=W,e.disableContextMenu=U,e["\u0275a"]=h,e["\u0275b"]=v,e["\u0275c"]=B,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@wm/components/base")):"function"==typeof define&&define.amd?define("@wm/components/navigation/navbar",["exports","@angular/core","@angular/common","@wm/components/base"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.navigation=e.wm.components.navigation||{},e.wm.components.navigation.navbar={}),e.ng.core,e.ng.common,e.wm.components.base)}(this,(function(e,t,n,i){"use strict";
267
+ ***************************************************************************** */var c=function(e,t){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}c(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}Object.create;function u(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function d(e,t,n){if(n||2===arguments.length)for(var i,o=0,r=t.length;o<r;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var h=function(){o.register("wm-nav",new Map([["autoclose",Object.assign({value:"always"},o.PROP_STRING)],["autoopen",Object.assign({value:"never"},o.PROP_STRING)],["class",o.PROP_STRING],["dataset",o.PROP_ANY],["iconposition",Object.assign({value:"left"},o.PROP_STRING)],["isactive",o.PROP_STRING],["itemlabel",o.PROP_STRING],["itemlink",o.PROP_STRING],["itemicon",o.PROP_STRING],["itemclass",o.PROP_STRING],["itemchildren",o.PROP_STRING],["itemaction",o.PROP_STRING],["itembadge",o.PROP_STRING],["itemtarget",o.PROP_STRING],["layout",o.PROP_STRING],["name",o.PROP_STRING],["orderby",o.PROP_STRING],["show",Object.assign({value:!0},o.PROP_BOOLEAN)],["type",o.PROP_STRING],["userrole",o.PROP_STRING]]))},m={widgetType:"wm-nav",hostClass:"nav app-nav"},f={pills:"nav-pills",tabs:"nav-tabs",navbar:"navbar-nav"},g=function(e){function t(t,n,i,r,a,s){var c=e.call(this,t,m)||this;c.cdRef=n,c.route=i,c.userDefinedExecutionContext=r,c.app=a,o.styler(c.nativeElement,c,o.APPLY_STYLES_TYPE.CONTAINER),c.disableMenuContext=!!s,c.pageScope=c.viewParent;var p=c.nodes$.subscribe((function(){if(!_.isEmpty(c.nodes)){var e=!1,t=function(n,i){_.forEach(n,(function(n){if(!e)return n.isactive?(e=!0,c.selecteditem=i?_.omit(n,["children","value"]):n.value,c.invokeEventCallback("select",{$event:{},$item:n.value}),l.triggerItemAction(c,n),i||(n._selected=!0),!1):void(_.isEmpty(n.children)||t(n.children,"menu"))}))};t(c.nodes)}}));return c.registerDestroyListener((function(){return p.unsubscribe()})),c}return p(t,e),Object.defineProperty(t.prototype,"activePageName",{get:function(){return this.app.activePageName},enumerable:!1,configurable:!0}),t.prototype.setNavType=function(e){l.addClass(this.nativeElement,f[e])},t.prototype.setNavLayout=function(e){l.addClass(this.nativeElement,"nav-"+e)},t.prototype.onNavSelect=function(e,t,n){e.preventDefault();var i=_.find(this.nodes,"_selected");i&&delete i._selected,this.activeNavLINode&&l.removeClass(this.activeNavLINode,"active"),this.activeNavLINode=n,l.addClass(n,"active"),this.selecteditem=t.value,this.invokeEventCallback("select",{$event:e,$item:t.value}),l.triggerItemAction(this,t)},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.setNavType(this.type),this.setNavLayout(this.layout)},t.prototype.onMenuItemSelect=function(e,t,n){this.selecteditem=_.omit(n,["children","value"]),this.invokeEventCallback("select",{$event:e,$item:this.selecteditem})},t}(o.DatasetAwareNavComponent);g.initializeProps=h(),g.decorators=[{type:t.Component,args:[{selector:"[wmNav]",template:'<ng-template #menuRef let-item="item" let-index="index">\n <div wmMenu dropdown\n type="anchor"\n autoclose.bind="autoclose"\n iconclass.bind="item.icon"\n autoopen.bind="autoopen"\n caption.bind="item.label"\n dataset.bind="item.children"\n badgevalue.bind="item.badge"\n iconposition.bind="iconposition"\n select.event="onMenuItemSelect($event, widget, $item)"></div>\n</ng-template>\n\n<ng-template #anchorRef let-item="item" let-index="index" let-liRef="liRef">\n <a wmAnchor\n [disableMenuContext]="disableMenuContext || !!item.action"\n [wmNavigationControl]="item.link"\n [attr.aria-current]="item._selected || (!isactive && item.link === \'#/\' + activePageName) ? \'page\' : \'\'"\n caption.bind="item.label"\n iconclass.bind="item.icon"\n badgevalue.bind="item.badge"\n iconposition.bind="iconposition"\n click.event="onNavSelect($event, item, liRef)"></a>\n</ng-template>\n\n<li class="app-nav-item {{item.class}}" *ngFor="let item of nodes; let index = index;" #liRef [ngClass]="{active: item._selected || (!isactive && item.link === \'#/\' + activePageName)}">\n <ng-container [ngTemplateOutlet]="anchorRef" [ngTemplateOutletContext]="{item: item, index:index, liRef: liRef}" *ngIf="!item.children.length"></ng-container>\n <ng-container [ngTemplateOutlet]="menuRef" [ngTemplateOutletContext]="{item: item, index:index}" *ngIf="item.children.length"></ng-container>\n</li>\n\n<ng-content *ngIf="!nodes.length" select="[wmNavItem]"></ng-content>\n',providers:[o.provideAsWidgetRef(g)]}]}],g.ctorParameters=function(){return[{type:t.Injector},{type:t.ChangeDetectorRef},{type:s.Router},{type:l.UserDefinedExecutionContext},{type:l.App},{type:void 0,decorators:[{type:t.Attribute,args:["select.event"]}]}]};var v=function(){o.register("wm-menu",new Map([["accessroles",Object.assign({value:"Everyone"},o.PROP_STRING)],["animateitems",o.PROP_STRING],["autoclose",Object.assign({value:"always"},o.PROP_STRING)],["autoopen",Object.assign({value:"never"},o.PROP_STRING)],["caption",o.PROP_STRING],["class",o.PROP_STRING],["dataset",Object.assign({value:"Menu Item 1, Menu Item 2, Menu Item 3"},o.PROP_ANY)],["hint",Object.assign({value:""},o.PROP_STRING)],["isactive",o.PROP_STRING],["iconclass",o.PROP_STRING],["iconposition",Object.assign({value:"left"},o.PROP_STRING)],["itemaction",o.PROP_STRING],["itemchildren",o.PROP_STRING],["itemclass",o.PROP_STRING],["itemicon",o.PROP_STRING],["itemlabel",o.PROP_STRING],["itemlink",o.PROP_STRING],["itemtarget",o.PROP_STRING],["linktarget",Object.assign({value:"_self"},o.PROP_STRING)],["menuclass",o.PROP_STRING],["menulayout",o.PROP_STRING],["menuposition",o.PROP_STRING],["name",o.PROP_STRING],["orderby",o.PROP_STRING],["shortcutkey",o.PROP_STRING],["show",Object.assign({value:!0},o.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},o.PROP_NUMBER)],["type",Object.assign({value:"menu"},o.PROP_STRING)],["userrole",o.PROP_STRING]]))},y={MOVE_UP:"UP-ARROW",MOVE_LEFT:"LEFT-ARROW",MOVE_RIGHT:"RIGHT-ARROW",MOVE_DOWN:"DOWN-ARROW",ON_ENTER:"ENTER",ON_TAB:"TAB",ON_SHIFT_TAB:"SHIFT-TAB",ON_ESCAPE:"ESC"},b={UP_LEFT:"up,left",UP_RIGHT:"up,right",DOWN_LEFT:"down,left",DOWN_RIGHT:"down,right",INLINE:"inline"},w="down,right",P="down,left",O="up,right",S="up,left",E="inline",T="fa-caret-up",C="fa-caret-down",A="pull-left",R="pull-right",I="activepage",D="always",N={widgetType:"wm-menu",hostClass:"dropdown app-menu"},x=function(e){function t(t,n,i,r,a,s,c){var p=e.call(this,t,N)||this;p.route=n,p.app=i,p.userDefinedExecutionContext=r,p.bsDropdown=a,p.parentNav=s,p.selectEventCB=c,p.menuCaret="fa-caret-down",p._selectFirstItem=!1,p.disableMenuContext=s?!!s.disableMenuContext:!!c;var u=p.nodes$.subscribe((function(){if(!_.isEmpty(p.nodes)){if(o.hasLinkToCurrentPage(p.nodes,p.route.url)&&l.addClass(p.nativeElement.querySelector(".dropdown-toggle"),"active"),p.parentNav)return;var e=!1,t=function(n){_.forEach(n,(function(n){if(!e)return n.isactive?(e=!0,p.onMenuItemSelect({$event:{},$item:n}),l.triggerItemAction(p,n),!1):void(_.isEmpty(n.children)||t(n.children))}))};t(p.nodes)}}));return p.registerDestroyListener((function(){return u.unsubscribe()})),p}return p(t,e),t.prototype.onShow=function(){var e=this;this._selectFirstItem&&setTimeout((function(){e.$element.find("> ul[wmmenudropdown] li.app-menu-item").first().find("> a").focus()})),l.$appDigest()},t.prototype.onHide=function(){this.$element.find("li").removeClass("open"),this._selectFirstItem=!1,l.$appDigest()},t.prototype.onKeyDown=function(e,t){var n=_.clone(y);this.menuposition===b.UP_RIGHT?(n.MOVE_UP="DOWN-ARROW",n.MOVE_DOWN="UP-ARROW"):this.menuposition===b.UP_LEFT?(n.MOVE_UP="DOWN-ARROW",n.MOVE_DOWN="UP-ARROW",n.MOVE_LEFT="RIGHT-ARROW",n.MOVE_RIGHT="LEFT-ARROW"):this.menuposition===b.DOWN_LEFT&&(n.MOVE_LEFT="RIGHT-ARROW",n.MOVE_RIGHT="LEFT-ARROW"),_.includes([n.MOVE_DOWN,n.MOVE_RIGHT],t)?this.bsDropdown.isOpen?this.$element.find("> ul[wmmenudropdown] li.app-menu-item").first().find("> a").focus():(this._selectFirstItem=!0,this.bsDropdown.show()):t===n.ON_ENTER?this.bsDropdown.toggle(!0):_.includes([n.MOVE_UP,n.MOVE_LEFT],t)&&this.bsDropdown.hide(),e.preventDefault()},t.prototype.resetNodes=function(){e.prototype.resetNodes.call(this),(this.autoopen===I&&o.hasLinkToCurrentPage(this.nodes,this.route.url)||this.autoopen===D)&&this.bsDropdown.show()},t.prototype.ngOnInit=function(){var t=this;e.prototype.ngOnInit.call(this),this.setMenuPosition();var n=this.app.subscribe("highlightActiveLink",(function(e){l.toggleClass(t.nativeElement.querySelector(".dropdown-toggle"),"active",o.hasLinkToCurrentPage(t.nodes,t.route.url))}));this.registerDestroyListener((function(){return n()}))},t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("autoclose"===t?this.bsDropdown.autoClose=n!==o.AUTOCLOSE_TYPE.DISABLED:e.prototype.onPropertyChange.call(this,t,n,i))},t.prototype.setMenuPosition=function(){switch(this.menuposition){case w:l.removeClass(this.nativeElement,"dropup"),this.menualign=A,this.menuCaret=C;break;case P:l.removeClass(this.nativeElement,"dropup"),this.menualign=R,this.menuCaret=C;break;case S:l.addClass(this.nativeElement,"dropup"),this.menualign=R,this.menuCaret=T;break;case O:l.addClass(this.nativeElement,"dropup"),this.menualign=A,this.menuCaret=T;break;case E:this.menualign="dropinline-menu"}},t.prototype.onMenuItemSelect=function(e){var t=e.$event,n=e.$item.value;this.invokeEventCallback("select",{$event:t,$item:n})},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),o.styler(this.nativeElement.querySelector(".dropdown-toggle"),this)},t}(o.DatasetAwareNavComponent);x.initializeProps=v(),x.decorators=[{type:t.Component,args:[{selector:"[wmMenu]",template:'<ng-template #menuTemplate>\n <button wmButton\n dropdownToggle\n aria-haspopup="true"\n aria-expanded="false"\n [attr.aria-label]="hint || \'Menu\'"\n class="btn app-button dropdown-toggle {{menuclass}}"\n hint.bind="hint"\n shortcutkey.bind="shortcutkey"\n tabindex.bind="tabindex"\n caption.bind="caption"\n iconclass.bind="iconclass"\n iconposition.bind="iconposition">\n <span class="pull-right caret fa {{menuCaret}}"></span>\n </button>\n</ng-template>\n\n<ng-template #innerTemplate>\n <i class="app-icon {{iconclass}}"></i>\n <span class="caption" [textContent]="caption"></span>\n <span class="pull-right caret fa {{menuCaret}}"></span>\n</ng-template>\n\n<ng-container *ngIf="type === \'anchor\'; else menuTemplate">\n <a wmAnchor\n dropdownToggle\n\n href="javascript:void(0);"\n role="button"\n aria-haspopup="true"\n aria-expanded="false"\n\n hint.bind="hint"\n class="dropdown-toggle {{menuclass}}"\n shortcutkey.bind="shortcutkey"\n tabindex.bind="tabindex"\n caption.bind="caption"\n iconclass.bind="iconclass"\n iconposition.bind="iconposition"\n badgevalue.bind="badgevalue"\n >\n <span class="pull-right caret fa {{menuCaret}}"></span>\n </a>\n</ng-container>\n\n<ul wmMenuDropdown [items]="nodes" [ngClass]="menulayout" class="icon-position-{{iconposition}}" *dropdownMenu aria-labelledby="dropdownmenu" role="menubar"></ul>\n',providers:[o.provideAsWidgetRef(x)]}]}],x.ctorParameters=function(){return[{type:t.Injector},{type:s.Router},{type:l.App},{type:l.UserDefinedExecutionContext},{type:i.BsDropdownDirective,decorators:[{type:t.Self},{type:t.Optional}]},{type:g,decorators:[{type:t.Optional}]},{type:String,decorators:[{type:t.Attribute,args:["select.event"]}]}]},x.propDecorators={onShow:[{type:t.HostListener,args:["onShown"]}],onHide:[{type:t.HostListener,args:["onHidden"]}],onKeyDown:[{type:t.HostListener,args:["keydown.arrowup",["$event",'"UP-ARROW"']]},{type:t.HostListener,args:["keydown.arrowdown",["$event",'"DOWN-ARROW"']]},{type:t.HostListener,args:["keydown.arrowright",["$event",'"RIGHT-ARROW"']]},{type:t.HostListener,args:["keydown.arrowleft",["$event",'"LEFT-ARROW"']]},{type:t.HostListener,args:["keydown.enter",["$event",'"ENTER"']]}]};var k={scale:{name:"wmScaleInLeft","down,right":"wmScaleInLeft","down,left":"wmScaleInRight","up,right":"wmScaleInTopLeft","up,left":"wmScaleInTopRight"},fade:{name:"fadeIn","down,right":"fadeIn","down,left":"fadeIn","up,right":"fadeIn","up,left":"fadeIn"},slide:{name:"wmSlideInDown","down,right":"wmSlideInDown","down,left":"wmSlideInDown","up,right":"wmSlideInUp","up,left":"wmSlideInUp"}},M=function(){function e(e,t){this.menuRef=t,this.nativeElement=e.nativeElement,l.addClass(this.nativeElement,"dropdown-menu")}return e.prototype.ngAfterViewInit=function(){var e=this.menuRef.animateitems,t="";e&&(t="animated "+(k[e][this.menuRef.menuposition]||k[e].name)),l.addClass(this.nativeElement,"dropdown-menu "+this.menuRef.menualign+" "+t,!0)},e}();M.decorators=[{type:t.Component,args:[{selector:"ul[wmMenuDropdown]",template:'<li wmMenuDropdownItem *ngFor="let item of items"\n [item]="item"\n [ngClass]="{disabled: item.disabled, \'dropdown-submenu\': item.children.length > 0}"\n class="{{item.class}}"\n role="menuitem">\n</li>\n'}]}],M.ctorParameters=function(){return[{type:t.ElementRef},{type:x}]},M.propDecorators={items:[{type:t.Input}]};var L={"pull-right":"fa-caret-left","dropinline-menu":"fa-caret-down","pull-left":"fa-caret-right"},F="horizontal",j=function(){function e(e,t,n,i,o){var r=this;this.app=e,this.menuRef=t,this.userDefinedExecutionContext=n,this.parentNav=i,this.onSelect=function(e,t){if(r.nativeElement===$(e.target).closest(".app-menu-item").get(0)){"outsideClick"===r.menuRef.autoclose&&e.stopPropagation(),e.preventDefault();var n={$event:e,$item:t};r.menuRef.onMenuItemSelect(n);var i=_.clone(t);i.target=i.target||r.menuRef.linktarget,l.triggerItemAction(r,i)}},this.nativeElement=o.nativeElement,l.addClass(this.nativeElement,"app-menu-item"),this.menualign=L[this.menuRef.menualign]||L["pull-left"]}return e.prototype.ngOnInit=function(){var e=this;this.parentNav&&(o.hasLinkToCurrentPage([this.item],this.menuRef.route.url)&&l.addClass(this.nativeElement,"active"),this.highlightActiveLinkSubscription=this.app.subscribe("highlightActiveLink",(function(t){l.toggleClass(e.nativeElement,"active",o.hasLinkToCurrentPage([e.item],e.menuRef.route.url))})))},e.prototype.getInitialKeyMovements=function(){var e=_.clone(y);return this.menuRef.menulayout===F?(e.MOVE_UP="LEFT-ARROW",e.MOVE_LEFT="UP-ARROW",e.MOVE_RIGHT="DOWN-ARROW",e.MOVE_DOWN="RIGHT-ARROW"):this.menuRef.menuposition===b.DOWN_LEFT||this.menuRef.menuposition===b.UP_LEFT?(e.MOVE_LEFT="RIGHT-ARROW",e.MOVE_RIGHT="LEFT-ARROW"):"inline"===this.menuRef.menuposition&&(e.MOVE_UP="LEFT-ARROW",e.MOVE_LEFT="UP-ARROW",e.MOVE_RIGHT="DOWN-ARROW",e.MOVE_DOWN="RIGHT-ARROW"),e},e.prototype.onKeyDown=function(e,t){var n=$(this.nativeElement),i=$(this.nativeElement).closest("ul.dropdown-menu"),o=this.menuRef.$element.find("> ul.dropdown-menu"),r=this.getInitialKeyMovements();if(_.includes(["LEFT-ARROW","RIGHT-ARROW","UP-ARROW","DOWN-ARROW"],t)&&e.preventDefault(),t===r.ON_TAB&&o.children().last()[0]===this.nativeElement||t===r.ON_SHIFT_TAB&&o.children().first()[0]===this.nativeElement||t===r.ON_ESCAPE)e.preventDefault(),this.menuRef.bsDropdown.hide();else if(t===r.ON_ENTER&&!this.item.link||t===r.MOVE_RIGHT)e.stopPropagation(),this.item.children.length?(n.toggleClass("open"),n.find("li").first().find("> a").focus()):n.find("> a").focus();else if(t===r.MOVE_LEFT||t===r.ON_TAB&&i.children().last()[0]===this.nativeElement||t===r.ON_SHIFT_TAB&&i.children().first()[0]===this.nativeElement){if(o[0]!==i[0]){var a=i.parent();a.toggleClass("open").find("li.open").removeClass("open"),a.find("> a").focus(),e.preventDefault(),e.stopPropagation()}}else t===r.MOVE_UP?o[0]===i[0]&&o.find("> li").first()[0]===this.nativeElement||(e.stopPropagation(),n.prev().find("> a").focus()):t===r.MOVE_DOWN?(e.stopPropagation(),o.find("> li").last()[0]===this.nativeElement&&(this.menuRef.menulayout!==F&&this.menuRef.menuposition===b.UP_RIGHT||this.menuRef.menuposition===b.UP_LEFT)?this.menuRef.bsDropdown.hide():n.next().find("> a").focus()):t===r.ON_ENTER?this.onSelect(e,this.item):e.stopPropagation()},e.prototype.ngOnDestroy=function(){this.highlightActiveLinkSubscription&&this.highlightActiveLinkSubscription()},e}();j.decorators=[{type:t.Component,args:[{selector:"li[wmMenuDropdownItem]",template:'<a href="javascript:void(0);" [title]="item.label" [wmNavigationControl]="item.link" [disableMenuContext]="menuRef.disableMenuContext || !!item.action">\n <span *ngIf="item.children.length" class="pull-right fa caret {{menualign}}"></span>\n <i class="app-icon {{item.icon}}"></i>\n <span class="anchor-caption">{{item.label}}</span>\n <span *ngIf="item.badge" class="badge pull-right" [textContent]="item.badge"></span>\n</a>\n<ng-container [ngTemplateOutlet]="nestedMenuDropdown" *ngIf="item.children.length" [ngTemplateOutletContext]="{item: item}"></ng-container>\n\n<ng-template #nestedMenuDropdown let-item="item">\n <ul wmMenuDropdown [items]="item.children"></ul>\n</ng-template>\n'}]}],j.ctorParameters=function(){return[{type:l.App},{type:x},{type:l.UserDefinedExecutionContext},{type:g,decorators:[{type:t.Optional}]},{type:t.ElementRef}]},j.propDecorators={item:[{type:t.Input}],onKeyDown:[{type:t.HostListener,args:["keydown.tab",["$event",'"TAB"']]},{type:t.HostListener,args:["keydown.shift.tab",["$event",'"SHIFT-TAB"']]},{type:t.HostListener,args:["keydown.escape",["$event",'"ESC"']]},{type:t.HostListener,args:["keydown.enter",["$event",'"ENTER"']]},{type:t.HostListener,args:["keydown.arrowup",["$event",'"UP-ARROW"']]},{type:t.HostListener,args:["keydown.arrowdown",["$event",'"DOWN-ARROW"']]},{type:t.HostListener,args:["keydown.arrowright",["$event",'"RIGHT-ARROW"']]},{type:t.HostListener,args:["keydown.arrowleft",["$event",'"LEFT-ARROW"']]}],onSelect:[{type:t.HostListener,args:["click",["$event","item"]]}]};var B=function(){o.register("wm-nav-item",new Map([["class",o.PROP_STRING],["name",o.PROP_STRING],["show",Object.assign({value:!0},o.PROP_BOOLEAN)]]))},G={widgetType:"wm-nav-item",hostClass:"app-nav-item"},V=function(e){function t(t){var n=e.call(this,t,G)||this;return o.styler(n.nativeElement,n,o.APPLY_STYLES_TYPE.CONTAINER),n}return p(t,e),t.prototype.makeActive=function(){var e=this.nativeElement.parentNode;$(e).find("> li.active").removeClass("active"),this.isAttached&&l.addClass(this.nativeElement,"active")},t.prototype.ngAfterViewInit=function(){var e=this;this.innerLink&&this.innerLink.onActive((function(){return e.makeActive()}))},t.prototype.ngOnDetach=function(){l.removeClass(this.nativeElement,"active",!0),e.prototype.ngOnDetach.call(this)},t}(o.StylableComponent);V.initializeProps=B(),V.decorators=[{type:t.Directive,args:[{selector:"[wmNavItem]",providers:[o.provideAsWidgetRef(V)]}]}],V.ctorParameters=function(){return[{type:t.Injector}]},V.propDecorators={innerLink:[{type:t.ContentChild,args:[r.AnchorComponent]}],makeActive:[{type:t.HostListener,args:["click"]},{type:t.HostListener,args:["keydown.enter"]}]};var U=function(e){e.preventDefault()},W=function(){function e(e){this.nativeElement=e.nativeElement}return Object.defineProperty(e.prototype,"wmNavigationControl",{set:function(e){this._link=e,e&&!this.disableMenuContext?(l.setAttr(this.nativeElement,"href",e),this.nativeElement.removeEventListener("contextmenu",U)):(l.setAttr(this.nativeElement,"href","javascript:void(0)"),this.nativeElement.addEventListener("contextmenu",U))},enumerable:!1,configurable:!0}),e}();W.decorators=[{type:t.Directive,args:[{selector:"[wmNavigationControl]"}]}],W.ctorParameters=function(){return[{type:t.ElementRef}]},W.propDecorators={disableMenuContext:[{type:t.Input}],wmNavigationControl:[{type:t.Input}]};var q=[x,M,j,W,g,V],z=function(){};z.decorators=[{type:t.NgModule,args:[{imports:[r.BasicModule,i.BsDropdownModule,n.CommonModule,a.InputModule,o.WmComponentsModule],declarations:d([],u(q)),exports:d([],u(q)),entryComponents:[x,M]}]}];var H=["itemlabel","itemicon","itemlink","itemaction","itemchildren","userrole"],Y=function(e){function t(t,n){var i=e.call(this,t,n)||this;return i.pageScope=i.viewParent,i.binditemlabel=i.nativeElement.getAttribute("itemlabel.bind"),i.binditemicon=i.nativeElement.getAttribute("itemicon.bind"),i.binditemaction=i.nativeElement.getAttribute("itemaction.bind"),i.binditemlink=i.nativeElement.getAttribute("itemlink.bind"),i.binduserrole=i.nativeElement.getAttribute("userrole.bind"),i.binditemchildren=i.nativeElement.getAttribute("itemchildren.bind"),i}return p(t,e),t.prototype.onPropertyChange=function(t,n,i){_.includes(H,t)&&this.menuRef?this.menuRef.itemlabel=n:e.prototype.onPropertyChange.call(this,t,n,i)},t.prototype.ngAfterViewInit=function(){var t=this;e.prototype.ngAfterViewInit.call(this);var n=this.menuRefQL.changes.subscribe((function(e){e.first&&(t.menuRef=e.first,H.forEach((function(e){var n="bind"+e;t[n]&&(t.menuRef[n]=t[n]),t.menuRef[e]=t[e]})),n.unsubscribe())}))},t}(o.BaseContainerComponent);Y.decorators=[{type:t.Directive}],Y.ctorParameters=function(){return[null,null]},Y.propDecorators={menuRefQL:[{type:t.ViewChildren,args:[x]}]},e.KEYBOARD_MOVEMENTS=y,e.MENU_POSITION=b,e.MenuAdapterComponent=Y,e.MenuComponent=x,e.MenuDropdownComponent=M,e.MenuDropdownItemComponent=j,e.MenuModule=z,e.NavComponent=g,e.NavItemDirective=V,e.NavigationControlDirective=W,e.disableContextMenu=U,e["\u0275a"]=h,e["\u0275b"]=v,e["\u0275c"]=B,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@wm/components/base")):"function"==typeof define&&define.amd?define("@wm/components/navigation/navbar",["exports","@angular/core","@angular/common","@wm/components/base"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.navigation=e.wm.components.navigation||{},e.wm.components.navigation.navbar={}),e.ng.core,e.ng.common,e.wm.components.base)}(this,(function(e,t,n,i){"use strict";
268
268
  /*! *****************************************************************************
269
269
  Copyright (c) Microsoft Corporation.
270
270