@wavemaker/app-runtime-wm-build 11.4.1-rc.122 → 11.4.2-next.25743

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.1-rc.122",
3
+ "version": "11.4.2-next.25743",
4
4
  "description": "All modules required for a wavemaker application.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -58725,6 +58725,7 @@
58725
58725
  _this.heading = heading;
58726
58726
  _this.title = title;
58727
58727
  _this._isFirstLoad = true;
58728
+ _this._isOnLoadTriggered = false;
58728
58729
  _this.$lazyLoad = core.noop;
58729
58730
  _this.isActive = false;
58730
58731
  _this.disabled = false;
@@ -58775,6 +58776,10 @@
58775
58776
  return c.redraw();
58776
58777
  }));
58777
58778
  }
58779
+ if (!_this._isOnLoadTriggered && !_this.content) {
58780
+ _this.invokeEventCallback("load");
58781
+ _this._isOnLoadTriggered = true;
58782
+ }
58778
58783
  }), 100);
58779
58784
  };
58780
58785
  TabPaneComponent.prototype.notifyParent = function(evt) {
@@ -657,7 +657,7 @@ var c=function(e,t){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Arr
657
657
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
658
658
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
659
659
  PERFORMANCE OF THIS SOFTWARE.
660
- ***************************************************************************** */var r=function(e,t){return(r=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 s(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}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}Object.create;function l(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 c(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 p=function(e){function t(t){var n=e.call(this)||this;return n.tabs=t,n._$el=$(n.tabs.getNativeElement()).find(">.tab-content"),n.init(n._$el),n}return s(t,e),t.prototype.calibrate=function(){var e=this.tabs.getActiveTabIndex(),t=this._$el.find(">.tab-pane"),n=0,i=0,o=[];return t.each((function(t,a){return $(a).prop("hidden")||(i++,t===e&&(n=i-1),o.push(a)),!0})),{activeTabIndex:n,noOfTabs:i,panes:o}},t.prototype.bounds=function(){var e=this.calibrate(),t=e.activeTabIndex,n=e.noOfTabs,i=e.panes,o=$(i[0]).width(),a=-1*t*o;return this.clearContentFocus(),{strict:!1,lower:t===n-1?0:-o,center:a,upper:0===t?a:o}},t.prototype.context=function(){return{w:this._$el.width()}},t.prototype.animation=function(){return{transform:"translate3d(${{ ($D + $d)/w * 100 + '%'}}, 0, 0)","-webkit-transform":"translate3d(${{ ($D + $d)/w * 100 + '%'}}, 0, 0)"}},t.prototype.clearContentFocus=function(){var e=this._$el.find(">.tab-pane.active");e.length&&e.find(document.activeElement).length&&document.activeElement.blur()},t.prototype.transitionTabIntoView=function(){var e=this.calibrate(),t=e.activeTabIndex,n=e.noOfTabs,i=e.panes,a=100*n+"%";o.setCSSFromObj(this._$el[0],{maxWidth:a,width:a}),o.addClass(this.tabs.getNativeElement(),"has-transition");var r=100/n+"%";i.forEach((function(e){o.setCSS(e,"width",r)})),o.setCSS(this._$el[0],"transform","translate3d("+-1*t/n*100+"%, 0, 0)")},t.prototype.onUpper=function(e){this.tabs.prev(e),o.$appDigest()},t.prototype.onLower=function(e){this.tabs.next(e),o.$appDigest()},t.prototype.threshold=function(){return 5},t}(a.SwipeAnimation),d=function(){var e=new Map([["class",i.PROP_STRING],["dataset",i.PROP_ANY],["defaultpaneindex",Object.assign({value:0},i.PROP_NUMBER)],["justified",i.PROP_BOOLEAN],["tabsposition",Object.assign({value:"top"},i.PROP_STRING)],["name",i.PROP_STRING],["nodatamessage",Object.assign({value:"No Data Found"},i.PROP_STRING)],["show",Object.assign({value:!0},i.PROP_BOOLEAN)],["statehandler",Object.assign({value:"none"},i.PROP_STRING)],["transition",i.PROP_STRING],["type",i.PROP_STRING]]);o.isMobileApp()&&e.set("transition",Object.assign({value:"slide"},i.PROP_STRING)),i.register("wm-tabs",e)},u=function(){i.register("wm-tabpane",new Map([["active",i.PROP_BOOLEAN],["badgevalue",i.PROP_STRING],["badgetype",Object.assign({value:"default"},i.PROP_STRING)],["class",i.PROP_STRING],["content",i.PROP_STRING],["disabled",i.PROP_BOOLEAN],["dynamicPaneIndex",i.PROP_NUMBER],["heading",i.PROP_STRING],["isdefaulttab",i.PROP_STRING],["isdynamic",i.PROP_BOOLEAN],["name",i.PROP_STRING],["paneicon",i.PROP_STRING],["show",Object.assign({value:!0},i.PROP_BOOLEAN)],["smoothscroll",Object.assign({value:!1},i.PROP_BOOLEAN)],["title",Object.assign({value:"Tab Title"},i.PROP_STRING)]]))},h={widgetType:"wm-tabpane",hostClass:"tab-pane"},m=function(e){function t(t,n,i,a){var r=e.call(this,t,h)||this;return r.tabsRef=n,r.heading=i,r.title=a,r._isFirstLoad=!0,r.$lazyLoad=o.noop,r.isActive=!1,r.disabled=!1,o.removeAttr(r.nativeElement,"title"),r}return s(t,e),t.prototype.invokeOnSelectCallback=function(e){this.invokeEventCallback("select",{$event:e})},t.prototype.select=function(e){this.isActive||this.disabled||(this.isActive=!0,this.$lazyLoad(),this.redrawChildren(),this.notifyParent(e))},t.prototype.tabpaneHeaderClick=function(e,t){this.invokeEventCallback("headerclick",{$event:e,paneIndex:t})},t.prototype.deselect=function(){this.isActive&&(this.isActive=!1,this.invokeEventCallback("deselect"))},t.prototype.remove=function(){this.isActive&&(this===this.tabsRef.panes.last?this.tabsRef.prev():this.tabsRef.next());var e=this.tabsRef.panes.toArray();e.splice(this.tabsRef.getPaneIndexByRef(this),1),this.tabsRef.panes.reset(c([],l(e))),this.nativeElement.remove(),this.tabsRef.$element.find(".tab-header[data-paneid='"+this.$element.attr("widget-id")+"'] a").remove()},t.prototype.redrawChildren=function(){var e=this;setTimeout((function(){e.reDrawableComponents&&e.reDrawableComponents.forEach((function(e){return e.redraw()}))}),100)},t.prototype.notifyParent=function(e){this.tabsRef.notifyChange(this,e)},t.prototype.handleSwipeLeft=function(){this.tabsRef.next()},t.prototype.handleSwipeRight=function(){this.tabsRef.prev()},t.prototype.handleEvent=function(t,n,i,o){"select"!==n&&e.prototype.handleEvent.call(this,this.nativeElement,n,i,o)},t.prototype.onPropertyChange=function(t,n,i){var o,a=this;"content"===t?this.isActive&&setTimeout((function(){return a.$lazyLoad()}),100):"show"===t?(this.nativeElement.hidden=!n,this._isFirstLoad?this.tabsRef.selectDefaultPaneByIndex(this.tabsRef.defaultpaneindex):!n&&this.isActive?this.tabsRef.next():!n&&this.isActive||null===(o=this.tabsRef.tabsAnimator)||void 0===o||o.transitionTabIntoView(),this._isFirstLoad=!1):e.prototype.onPropertyChange.call(this,t,n,i)},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.title=this.title||this.heading},t.prototype.ngAfterViewInit=function(){i.styler(this.nativeElement.querySelector(".tab-body"),this,i.APPLY_STYLES_TYPE.CONTAINER),e.prototype.ngAfterViewInit.call(this),this.isdynamic&&this.tabsRef.registerDynamicTab(this)},t}(i.StylableComponent);m.initializeProps=u(),m.decorators=[{type:t.Component,args:[{selector:"div[wmTabPane]",template:'<div class="tab-body" partial-container-target [wmSmoothscroll]="smoothscroll">\n <ng-content></ng-content>\n</div>',providers:[i.provideAsWidgetRef(m)]}]}],m.ctorParameters=function(){return[{type:t.Injector},{type:g},{type:void 0,decorators:[{type:t.Attribute,args:["heading"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["title"]}]}]},m.propDecorators={isActive:[{type:t.HostBinding,args:["class.active"]}],disabled:[{type:t.HostBinding,args:["class.disabled"]}],reDrawableComponents:[{type:t.ContentChildren,args:[i.RedrawableDirective,{descendants:!0}]}]};var f={widgetType:"wm-tabs",hostClass:"app-tabs clearfix"},g=function(e){function t(t,n,a,r,s){var l=this,c=o.noop;return(l=e.call(this,t,f,new Promise((function(e){return c=e})))||this).transition=a,l.tabsposition=r,l.statePersistence=s,l.dynamicComponentProvider=n,l.dynamicTabs=[],l.dynamicPaneIndex=0,l.promiseResolverFn=c,i.styler(l.nativeElement,l,i.APPLY_STYLES_TYPE.CONTAINER),l}return s(t,e),t.prototype.animateIn=function(e){var t=$(e);t.siblings(".active").removeClass("active"),t.addClass("active");var n=this.nativeElement.querySelector("ul.nav.nav-tabs"),i=t.prev();i.length?n.scrollLeft=i[0].offsetLeft:n.scrollLeft=0},t.prototype.registerDynamicTab=function(e){if(this.dynamicTabs.push(e),this.dynamicTabs.length===this.dynamicPaneIndex)for(var t=function(e){var t=_.find(n.dynamicTabs,(function(t){return t.dynamicPaneIndex===e}));_.find(n.panes.toArray(),t)||(n.panes.reset(c(c([],l(n.panes.toArray())),[t])),t.active&&setTimeout((function(){t.select()}),20))},n=this,i=0;i<this.dynamicTabs.length;i++)t(i)},t.prototype.addPane=function(e){var t=this;_.isArray(e)||(e=[e]);var n=[];return _.forEach(e,(function(e,i){var o=_.find(t.panes.toArray(),{name:e.name}),a=_.indexOf(n,e.name);if(o||a>0)console.warn("The tab pane with name "+e.name+" already exists");else{var r="",s="";t.dynamicPaneIndex++;var l=e.name?e.name:"tabpane"+(t.panes.toArray().length+(i+1));n.push(l);var c=_.get(e,"params");_.forEach(e,(function(e,t){"params"!==t&&(s=s+" "+t+'="'+e+'"')})),_.forEach(c,(function(e,t){r=r+' <wm-param name="'+t+'" value="'+e+'"></wm-param>'}));var p='<wm-tabpane dynamicPaneIndex="'+(t.dynamicPaneIndex-1)+'" isdynamic="true" name="'+l+'" '+s+">\n "+r+"\n </wm-tabpane>";t._dynamicContext||(t._dynamicContext=Object.create(t.viewParent),t._dynamicContext[t.getAttr("wmTab")]=t),t.dynamicComponentProvider.addComponent(t.getNativeElement().querySelector(".tab-content"),p,t._dynamicContext,{inj:t.inj})}})),n},t.prototype.removePane=function(e){var t=this.getPaneRefByName(e);t&&t.remove()},t.prototype.notifyChange=function(e,t){if(this.isSelectableTab(e)){var n;_.isEmpty(this.activeTab)||this.activeTab.deselect(),this.activeTab=e.getWidget();var i=this.getPaneIndexByRef(e),o=this.statePersistence.computeMode(this.statehandler);if(!this.isPageLoadCall&&o&&"none"!==o.toLowerCase()?this.statePersistence.setWidgetState(this,this.activeTab.name):(this.defaultpaneindex=this.getPaneIndexByRef(e),this.isPageLoadCall=!1),e.invokeOnSelectCallback(t),t&&this.invokeEventCallback("change",{$event:t,newPaneIndex:i,oldPaneIndex:this._oldPaneIndex||0}),this._oldPaneIndex=i,t&&(n=$(t.target).closest("li.tab-header")),!t||!n||!n.length)n=this.nativeElement.querySelector("li[data-paneid="+e.widgetId+"]"),!!$(n).closest(".app-tabs").parent().closest(".app-tabs").length||$(n).children().focus();this.animateIn(n),this.canSlide()&&(this.tabsAnimator||(this.tabsAnimator=new p(this),this.tabsAnimator.setGesturesEnabled(this.canSlide())),this.tabsAnimator.transitionTabIntoView())}},t.prototype.goToTab=function(e){this.isValidPaneIndex(e-1)&&this.getPaneRefByIndex(e-1).select()},t.prototype.getPaneIndexByRef=function(e){return this.panes.toArray().indexOf(e)},t.prototype.getActiveTabIndex=function(){return _.findIndex(this.panes.toArray(),{isActive:!0})},t.prototype.isValidPaneIndex=function(e){return e>=0&&e<this.panes.length},t.prototype.getPaneRefByIndex=function(e){return this.panes.toArray()[e]},t.prototype.getPaneRefByName=function(e){return _.find(this.panes.toArray(),{name:e})},t.prototype.isSelectableTab=function(e){return e.show&&!e.disabled},t.prototype.canSlide=function(){return"slide"===this.transition&&!this.vertical},t.prototype.getSelectableTabAfterIndex=function(e){for(var t=e+1;t<this.panes.length;t++){var n=this.getPaneRefByIndex(t);if(this.isSelectableTab(n))return n}if(e===this.panes.length-1){n=this.getPaneRefByIndex(0);if(this.isSelectableTab(n))return n}},t.prototype.getSelectableTabBeforeIndex=function(e){for(var t=e-1;t>=0;t--){var n=this.getPaneRefByIndex(t);if(this.isSelectableTab(n))return n}if(0===e){n=this.getPaneRefByIndex(this.panes.length-1);if(this.isSelectableTab(n))return n}},t.prototype.next=function(e){var t=this.getSelectableTabAfterIndex(this.getActiveTabIndex());t&&t.select(e)},t.prototype.prev=function(e){var t=this.getSelectableTabBeforeIndex(this.getActiveTabIndex());t&&t.select(e)},t.prototype.selectDefaultPaneByIndex=function(e){if(this.isValidPaneIndex(e)){var t=this.getPaneRefByIndex(e);this.isSelectableTab(t)||(t=this.getSelectableTabAfterIndex(0)),t&&t.select()}},t.prototype.setTabsPosition=function(){var e=this.nativeElement.children[0];this.vertical="left"===this.tabsposition||"right"===this.tabsposition,o.removeClass(this.nativeElement,"inverted"),"bottom"!==this.tabsposition&&"right"!==this.tabsposition||(o.appendNode(e,this.nativeElement),o.addClass(this.nativeElement,"inverted"))},t.prototype.onDataChange=function(e){var t=this;this.fieldDefs=i.createArrayFrom(e),setTimeout((function(){return t.selectDefaultPaneByIndex(t.defaultpaneindex||0)}))},t.prototype.onPropertyChange=function(t,n,i){var o=this;if("defaultpaneindex"===t)this.defaultpaneindex=n;else if("dataset"===t)this.onDataChange(n);else if("statehandler"===t){this.isPageLoadCall=!0;var a=this.statePersistence.getWidgetState(this);if("none"!==n&&a){var r=this.panes.filter((function(e){return a===e.name}));if(r.length){var s=this.getPaneIndexByRef(r[0]);setTimeout((function(){return o.selectDefaultPaneByIndex(s)}),20)}else console.warn("Tab pane name "+a+" in State is incorrect. Falling back to the default pane"),setTimeout((function(){return o.selectDefaultPaneByIndex(o.defaultpaneindex||0)}),20)}else setTimeout((function(){return o.selectDefaultPaneByIndex(o.defaultpaneindex||0)}),20)}else e.prototype.onPropertyChange.call(this,t,n,i)},t.prototype.registerTabsScroll=function(){var e=this;setTimeout((function(){var t,n=e.$element.find("> ul");(t=n.children().last().position())&&t.left>n.width()&&n.on("mousewheel",(function(e){var t=n[0].scrollLeft,i=-1*e.originalEvent.wheelDelta;e.stopPropagation(),e.preventDefault(),n.animate({scrollLeft:t+i},{duration:10})}))}))},t.prototype.onkeydown=function(e){switch(e.key){case"ArrowLeft":case"ArrowUp":this.prev(),e.preventDefault();break;case"ArrowRight":case"ArrowDown":this.next(),e.preventDefault()}},t.prototype.ngAfterContentInit=function(){var t=this;this.promiseResolverFn(),e.prototype.ngAfterContentInit.call(this),this.setTabsPosition(),this.panes.changes.subscribe((function(e){t.panes.length&&t.selectDefaultPaneByIndex(t.defaultpaneindex||0)}))},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),this.registerTabsScroll()},t}(i.StylableComponent);g.initializeProps=d(),g.decorators=[{type:t.Component,args:[{selector:"div[wmTabs]",template:'<ul class="nav nav-tabs" [ngClass]="{\'nav-stacked\': vertical, \'nav-justified\': justified}" role="tablist">\n <li class="tab-header" *ngFor="let pane of panes; let i=index;" [attr.data-paneid]="pane.widgetId" [ngClass]="{\'active\': pane.isActive, \'disabled\': pane.disabled}"\n [hidden]="!pane.show" role="presentation">\n <a class="tab-heading" href="javascript:void(0);" [attr.aria-label]="pane.title" [attr.title]="pane.title" [tabindex]="pane.isActive ? \'0\' : \'-1\'"\n [attr.aria-selected]="pane.isActive" role="tab" (click)="pane.select($event); pane.tabpaneHeaderClick($event, i);" (keydown)="onkeydown($event)">\n <i [ngClass]="[\'app-icon\', pane.paneicon]" *ngIf="pane.paneicon"></i>\n <span [textContent]="pane.title"></span>\n <span *ngIf="pane.badgevalue" class="label label-{{pane.badgetype}}" [textContent]="pane.badgevalue"></span>\n </a>\n </li>\n</ul>\n<div class="tab-content" *ngIf="type !== \'dynamic\'" [ngClass]="{\'tab-stacked\': vertical, \'tab-justified\': justified}">\n <ng-content ngProjectAs="div[wmTabPane]"></ng-content>\n</div>\n<div class="tab-content" *ngIf="type === \'dynamic\'" [ngClass]="{\'tab-stacked\': vertical, \'tab-justified\': justified}">\n <div *ngIf="fieldDefs && !fieldDefs.length">{{nodatamessage}}</div>\n <ng-content select="div[wmRepeatTemplate]"></ng-content>\n</div>\n',exportAs:"wmTabs",providers:[i.provideAsWidgetRef(g)]}]}],g.ctorParameters=function(){return[{type:t.Injector},{type:o.DynamicComponentRefProvider},{type:String,decorators:[{type:t.Attribute,args:["transition"]}]},{type:String,decorators:[{type:t.Attribute,args:["tabsposition"]}]},{type:o.StatePersistence}]},g.propDecorators={panes:[{type:t.ContentChildren,args:[m]}]};var v=[m,g],y=function(){};y.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.WmComponentsModule],declarations:c([],l(v)),exports:c([],l(v)),entryComponents:[]}]}],e.TabPaneComponent=m,e.TabsComponent=g,e.TabsModule=y,e["\u0275a"]=d,e["\u0275b"]=u,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/containers/tile",["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.containers=e.wm.components.containers||{},e.wm.components.containers.tile={}),e.ng.core,e.ng.common,e.wm.components.base)}(this,(function(e,t,n,i){"use strict";
660
+ ***************************************************************************** */var r=function(e,t){return(r=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 s(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}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}Object.create;function l(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 c(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 p=function(e){function t(t){var n=e.call(this)||this;return n.tabs=t,n._$el=$(n.tabs.getNativeElement()).find(">.tab-content"),n.init(n._$el),n}return s(t,e),t.prototype.calibrate=function(){var e=this.tabs.getActiveTabIndex(),t=this._$el.find(">.tab-pane"),n=0,i=0,o=[];return t.each((function(t,a){return $(a).prop("hidden")||(i++,t===e&&(n=i-1),o.push(a)),!0})),{activeTabIndex:n,noOfTabs:i,panes:o}},t.prototype.bounds=function(){var e=this.calibrate(),t=e.activeTabIndex,n=e.noOfTabs,i=e.panes,o=$(i[0]).width(),a=-1*t*o;return this.clearContentFocus(),{strict:!1,lower:t===n-1?0:-o,center:a,upper:0===t?a:o}},t.prototype.context=function(){return{w:this._$el.width()}},t.prototype.animation=function(){return{transform:"translate3d(${{ ($D + $d)/w * 100 + '%'}}, 0, 0)","-webkit-transform":"translate3d(${{ ($D + $d)/w * 100 + '%'}}, 0, 0)"}},t.prototype.clearContentFocus=function(){var e=this._$el.find(">.tab-pane.active");e.length&&e.find(document.activeElement).length&&document.activeElement.blur()},t.prototype.transitionTabIntoView=function(){var e=this.calibrate(),t=e.activeTabIndex,n=e.noOfTabs,i=e.panes,a=100*n+"%";o.setCSSFromObj(this._$el[0],{maxWidth:a,width:a}),o.addClass(this.tabs.getNativeElement(),"has-transition");var r=100/n+"%";i.forEach((function(e){o.setCSS(e,"width",r)})),o.setCSS(this._$el[0],"transform","translate3d("+-1*t/n*100+"%, 0, 0)")},t.prototype.onUpper=function(e){this.tabs.prev(e),o.$appDigest()},t.prototype.onLower=function(e){this.tabs.next(e),o.$appDigest()},t.prototype.threshold=function(){return 5},t}(a.SwipeAnimation),d=function(){var e=new Map([["class",i.PROP_STRING],["dataset",i.PROP_ANY],["defaultpaneindex",Object.assign({value:0},i.PROP_NUMBER)],["justified",i.PROP_BOOLEAN],["tabsposition",Object.assign({value:"top"},i.PROP_STRING)],["name",i.PROP_STRING],["nodatamessage",Object.assign({value:"No Data Found"},i.PROP_STRING)],["show",Object.assign({value:!0},i.PROP_BOOLEAN)],["statehandler",Object.assign({value:"none"},i.PROP_STRING)],["transition",i.PROP_STRING],["type",i.PROP_STRING]]);o.isMobileApp()&&e.set("transition",Object.assign({value:"slide"},i.PROP_STRING)),i.register("wm-tabs",e)},u=function(){i.register("wm-tabpane",new Map([["active",i.PROP_BOOLEAN],["badgevalue",i.PROP_STRING],["badgetype",Object.assign({value:"default"},i.PROP_STRING)],["class",i.PROP_STRING],["content",i.PROP_STRING],["disabled",i.PROP_BOOLEAN],["dynamicPaneIndex",i.PROP_NUMBER],["heading",i.PROP_STRING],["isdefaulttab",i.PROP_STRING],["isdynamic",i.PROP_BOOLEAN],["name",i.PROP_STRING],["paneicon",i.PROP_STRING],["show",Object.assign({value:!0},i.PROP_BOOLEAN)],["smoothscroll",Object.assign({value:!1},i.PROP_BOOLEAN)],["title",Object.assign({value:"Tab Title"},i.PROP_STRING)]]))},h={widgetType:"wm-tabpane",hostClass:"tab-pane"},m=function(e){function t(t,n,i,a){var r=e.call(this,t,h)||this;return r.tabsRef=n,r.heading=i,r.title=a,r._isFirstLoad=!0,r._isOnLoadTriggered=!1,r.$lazyLoad=o.noop,r.isActive=!1,r.disabled=!1,o.removeAttr(r.nativeElement,"title"),r}return s(t,e),t.prototype.invokeOnSelectCallback=function(e){this.invokeEventCallback("select",{$event:e})},t.prototype.select=function(e){this.isActive||this.disabled||(this.isActive=!0,this.$lazyLoad(),this.redrawChildren(),this.notifyParent(e))},t.prototype.tabpaneHeaderClick=function(e,t){this.invokeEventCallback("headerclick",{$event:e,paneIndex:t})},t.prototype.deselect=function(){this.isActive&&(this.isActive=!1,this.invokeEventCallback("deselect"))},t.prototype.remove=function(){this.isActive&&(this===this.tabsRef.panes.last?this.tabsRef.prev():this.tabsRef.next());var e=this.tabsRef.panes.toArray();e.splice(this.tabsRef.getPaneIndexByRef(this),1),this.tabsRef.panes.reset(c([],l(e))),this.nativeElement.remove(),this.tabsRef.$element.find(".tab-header[data-paneid='"+this.$element.attr("widget-id")+"'] a").remove()},t.prototype.redrawChildren=function(){var e=this;setTimeout((function(){e.reDrawableComponents&&e.reDrawableComponents.forEach((function(e){return e.redraw()})),e._isOnLoadTriggered||e.content||(e.invokeEventCallback("load"),e._isOnLoadTriggered=!0)}),100)},t.prototype.notifyParent=function(e){this.tabsRef.notifyChange(this,e)},t.prototype.handleSwipeLeft=function(){this.tabsRef.next()},t.prototype.handleSwipeRight=function(){this.tabsRef.prev()},t.prototype.handleEvent=function(t,n,i,o){"select"!==n&&e.prototype.handleEvent.call(this,this.nativeElement,n,i,o)},t.prototype.onPropertyChange=function(t,n,i){var o,a=this;"content"===t?this.isActive&&setTimeout((function(){return a.$lazyLoad()}),100):"show"===t?(this.nativeElement.hidden=!n,this._isFirstLoad?this.tabsRef.selectDefaultPaneByIndex(this.tabsRef.defaultpaneindex):!n&&this.isActive?this.tabsRef.next():!n&&this.isActive||null===(o=this.tabsRef.tabsAnimator)||void 0===o||o.transitionTabIntoView(),this._isFirstLoad=!1):e.prototype.onPropertyChange.call(this,t,n,i)},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.title=this.title||this.heading},t.prototype.ngAfterViewInit=function(){i.styler(this.nativeElement.querySelector(".tab-body"),this,i.APPLY_STYLES_TYPE.CONTAINER),e.prototype.ngAfterViewInit.call(this),this.isdynamic&&this.tabsRef.registerDynamicTab(this)},t}(i.StylableComponent);m.initializeProps=u(),m.decorators=[{type:t.Component,args:[{selector:"div[wmTabPane]",template:'<div class="tab-body" partial-container-target [wmSmoothscroll]="smoothscroll">\n <ng-content></ng-content>\n</div>',providers:[i.provideAsWidgetRef(m)]}]}],m.ctorParameters=function(){return[{type:t.Injector},{type:g},{type:void 0,decorators:[{type:t.Attribute,args:["heading"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["title"]}]}]},m.propDecorators={isActive:[{type:t.HostBinding,args:["class.active"]}],disabled:[{type:t.HostBinding,args:["class.disabled"]}],reDrawableComponents:[{type:t.ContentChildren,args:[i.RedrawableDirective,{descendants:!0}]}]};var f={widgetType:"wm-tabs",hostClass:"app-tabs clearfix"},g=function(e){function t(t,n,a,r,s){var l=this,c=o.noop;return(l=e.call(this,t,f,new Promise((function(e){return c=e})))||this).transition=a,l.tabsposition=r,l.statePersistence=s,l.dynamicComponentProvider=n,l.dynamicTabs=[],l.dynamicPaneIndex=0,l.promiseResolverFn=c,i.styler(l.nativeElement,l,i.APPLY_STYLES_TYPE.CONTAINER),l}return s(t,e),t.prototype.animateIn=function(e){var t=$(e);t.siblings(".active").removeClass("active"),t.addClass("active");var n=this.nativeElement.querySelector("ul.nav.nav-tabs"),i=t.prev();i.length?n.scrollLeft=i[0].offsetLeft:n.scrollLeft=0},t.prototype.registerDynamicTab=function(e){if(this.dynamicTabs.push(e),this.dynamicTabs.length===this.dynamicPaneIndex)for(var t=function(e){var t=_.find(n.dynamicTabs,(function(t){return t.dynamicPaneIndex===e}));_.find(n.panes.toArray(),t)||(n.panes.reset(c(c([],l(n.panes.toArray())),[t])),t.active&&setTimeout((function(){t.select()}),20))},n=this,i=0;i<this.dynamicTabs.length;i++)t(i)},t.prototype.addPane=function(e){var t=this;_.isArray(e)||(e=[e]);var n=[];return _.forEach(e,(function(e,i){var o=_.find(t.panes.toArray(),{name:e.name}),a=_.indexOf(n,e.name);if(o||a>0)console.warn("The tab pane with name "+e.name+" already exists");else{var r="",s="";t.dynamicPaneIndex++;var l=e.name?e.name:"tabpane"+(t.panes.toArray().length+(i+1));n.push(l);var c=_.get(e,"params");_.forEach(e,(function(e,t){"params"!==t&&(s=s+" "+t+'="'+e+'"')})),_.forEach(c,(function(e,t){r=r+' <wm-param name="'+t+'" value="'+e+'"></wm-param>'}));var p='<wm-tabpane dynamicPaneIndex="'+(t.dynamicPaneIndex-1)+'" isdynamic="true" name="'+l+'" '+s+">\n "+r+"\n </wm-tabpane>";t._dynamicContext||(t._dynamicContext=Object.create(t.viewParent),t._dynamicContext[t.getAttr("wmTab")]=t),t.dynamicComponentProvider.addComponent(t.getNativeElement().querySelector(".tab-content"),p,t._dynamicContext,{inj:t.inj})}})),n},t.prototype.removePane=function(e){var t=this.getPaneRefByName(e);t&&t.remove()},t.prototype.notifyChange=function(e,t){if(this.isSelectableTab(e)){var n;_.isEmpty(this.activeTab)||this.activeTab.deselect(),this.activeTab=e.getWidget();var i=this.getPaneIndexByRef(e),o=this.statePersistence.computeMode(this.statehandler);if(!this.isPageLoadCall&&o&&"none"!==o.toLowerCase()?this.statePersistence.setWidgetState(this,this.activeTab.name):(this.defaultpaneindex=this.getPaneIndexByRef(e),this.isPageLoadCall=!1),e.invokeOnSelectCallback(t),t&&this.invokeEventCallback("change",{$event:t,newPaneIndex:i,oldPaneIndex:this._oldPaneIndex||0}),this._oldPaneIndex=i,t&&(n=$(t.target).closest("li.tab-header")),!t||!n||!n.length)n=this.nativeElement.querySelector("li[data-paneid="+e.widgetId+"]"),!!$(n).closest(".app-tabs").parent().closest(".app-tabs").length||$(n).children().focus();this.animateIn(n),this.canSlide()&&(this.tabsAnimator||(this.tabsAnimator=new p(this),this.tabsAnimator.setGesturesEnabled(this.canSlide())),this.tabsAnimator.transitionTabIntoView())}},t.prototype.goToTab=function(e){this.isValidPaneIndex(e-1)&&this.getPaneRefByIndex(e-1).select()},t.prototype.getPaneIndexByRef=function(e){return this.panes.toArray().indexOf(e)},t.prototype.getActiveTabIndex=function(){return _.findIndex(this.panes.toArray(),{isActive:!0})},t.prototype.isValidPaneIndex=function(e){return e>=0&&e<this.panes.length},t.prototype.getPaneRefByIndex=function(e){return this.panes.toArray()[e]},t.prototype.getPaneRefByName=function(e){return _.find(this.panes.toArray(),{name:e})},t.prototype.isSelectableTab=function(e){return e.show&&!e.disabled},t.prototype.canSlide=function(){return"slide"===this.transition&&!this.vertical},t.prototype.getSelectableTabAfterIndex=function(e){for(var t=e+1;t<this.panes.length;t++){var n=this.getPaneRefByIndex(t);if(this.isSelectableTab(n))return n}if(e===this.panes.length-1){n=this.getPaneRefByIndex(0);if(this.isSelectableTab(n))return n}},t.prototype.getSelectableTabBeforeIndex=function(e){for(var t=e-1;t>=0;t--){var n=this.getPaneRefByIndex(t);if(this.isSelectableTab(n))return n}if(0===e){n=this.getPaneRefByIndex(this.panes.length-1);if(this.isSelectableTab(n))return n}},t.prototype.next=function(e){var t=this.getSelectableTabAfterIndex(this.getActiveTabIndex());t&&t.select(e)},t.prototype.prev=function(e){var t=this.getSelectableTabBeforeIndex(this.getActiveTabIndex());t&&t.select(e)},t.prototype.selectDefaultPaneByIndex=function(e){if(this.isValidPaneIndex(e)){var t=this.getPaneRefByIndex(e);this.isSelectableTab(t)||(t=this.getSelectableTabAfterIndex(0)),t&&t.select()}},t.prototype.setTabsPosition=function(){var e=this.nativeElement.children[0];this.vertical="left"===this.tabsposition||"right"===this.tabsposition,o.removeClass(this.nativeElement,"inverted"),"bottom"!==this.tabsposition&&"right"!==this.tabsposition||(o.appendNode(e,this.nativeElement),o.addClass(this.nativeElement,"inverted"))},t.prototype.onDataChange=function(e){var t=this;this.fieldDefs=i.createArrayFrom(e),setTimeout((function(){return t.selectDefaultPaneByIndex(t.defaultpaneindex||0)}))},t.prototype.onPropertyChange=function(t,n,i){var o=this;if("defaultpaneindex"===t)this.defaultpaneindex=n;else if("dataset"===t)this.onDataChange(n);else if("statehandler"===t){this.isPageLoadCall=!0;var a=this.statePersistence.getWidgetState(this);if("none"!==n&&a){var r=this.panes.filter((function(e){return a===e.name}));if(r.length){var s=this.getPaneIndexByRef(r[0]);setTimeout((function(){return o.selectDefaultPaneByIndex(s)}),20)}else console.warn("Tab pane name "+a+" in State is incorrect. Falling back to the default pane"),setTimeout((function(){return o.selectDefaultPaneByIndex(o.defaultpaneindex||0)}),20)}else setTimeout((function(){return o.selectDefaultPaneByIndex(o.defaultpaneindex||0)}),20)}else e.prototype.onPropertyChange.call(this,t,n,i)},t.prototype.registerTabsScroll=function(){var e=this;setTimeout((function(){var t,n=e.$element.find("> ul");(t=n.children().last().position())&&t.left>n.width()&&n.on("mousewheel",(function(e){var t=n[0].scrollLeft,i=-1*e.originalEvent.wheelDelta;e.stopPropagation(),e.preventDefault(),n.animate({scrollLeft:t+i},{duration:10})}))}))},t.prototype.onkeydown=function(e){switch(e.key){case"ArrowLeft":case"ArrowUp":this.prev(),e.preventDefault();break;case"ArrowRight":case"ArrowDown":this.next(),e.preventDefault()}},t.prototype.ngAfterContentInit=function(){var t=this;this.promiseResolverFn(),e.prototype.ngAfterContentInit.call(this),this.setTabsPosition(),this.panes.changes.subscribe((function(e){t.panes.length&&t.selectDefaultPaneByIndex(t.defaultpaneindex||0)}))},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),this.registerTabsScroll()},t}(i.StylableComponent);g.initializeProps=d(),g.decorators=[{type:t.Component,args:[{selector:"div[wmTabs]",template:'<ul class="nav nav-tabs" [ngClass]="{\'nav-stacked\': vertical, \'nav-justified\': justified}" role="tablist">\n <li class="tab-header" *ngFor="let pane of panes; let i=index;" [attr.data-paneid]="pane.widgetId" [ngClass]="{\'active\': pane.isActive, \'disabled\': pane.disabled}"\n [hidden]="!pane.show" role="presentation">\n <a class="tab-heading" href="javascript:void(0);" [attr.aria-label]="pane.title" [attr.title]="pane.title" [tabindex]="pane.isActive ? \'0\' : \'-1\'"\n [attr.aria-selected]="pane.isActive" role="tab" (click)="pane.select($event); pane.tabpaneHeaderClick($event, i);" (keydown)="onkeydown($event)">\n <i [ngClass]="[\'app-icon\', pane.paneicon]" *ngIf="pane.paneicon"></i>\n <span [textContent]="pane.title"></span>\n <span *ngIf="pane.badgevalue" class="label label-{{pane.badgetype}}" [textContent]="pane.badgevalue"></span>\n </a>\n </li>\n</ul>\n<div class="tab-content" *ngIf="type !== \'dynamic\'" [ngClass]="{\'tab-stacked\': vertical, \'tab-justified\': justified}">\n <ng-content ngProjectAs="div[wmTabPane]"></ng-content>\n</div>\n<div class="tab-content" *ngIf="type === \'dynamic\'" [ngClass]="{\'tab-stacked\': vertical, \'tab-justified\': justified}">\n <div *ngIf="fieldDefs && !fieldDefs.length">{{nodatamessage}}</div>\n <ng-content select="div[wmRepeatTemplate]"></ng-content>\n</div>\n',exportAs:"wmTabs",providers:[i.provideAsWidgetRef(g)]}]}],g.ctorParameters=function(){return[{type:t.Injector},{type:o.DynamicComponentRefProvider},{type:String,decorators:[{type:t.Attribute,args:["transition"]}]},{type:String,decorators:[{type:t.Attribute,args:["tabsposition"]}]},{type:o.StatePersistence}]},g.propDecorators={panes:[{type:t.ContentChildren,args:[m]}]};var v=[m,g],y=function(){};y.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.WmComponentsModule],declarations:c([],l(v)),exports:c([],l(v)),entryComponents:[]}]}],e.TabPaneComponent=m,e.TabsComponent=g,e.TabsModule=y,e["\u0275a"]=d,e["\u0275b"]=u,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/containers/tile",["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.containers=e.wm.components.containers||{},e.wm.components.containers.tile={}),e.ng.core,e.ng.common,e.wm.components.base)}(this,(function(e,t,n,i){"use strict";
661
661
  /*! *****************************************************************************
662
662
  Copyright (c) Microsoft Corporation.
663
663
 
@@ -58725,6 +58725,7 @@
58725
58725
  _this.heading = heading;
58726
58726
  _this.title = title;
58727
58727
  _this._isFirstLoad = true;
58728
+ _this._isOnLoadTriggered = false;
58728
58729
  _this.$lazyLoad = core.noop;
58729
58730
  _this.isActive = false;
58730
58731
  _this.disabled = false;
@@ -58775,6 +58776,10 @@
58775
58776
  return c.redraw();
58776
58777
  }));
58777
58778
  }
58779
+ if (!_this._isOnLoadTriggered && !_this.content) {
58780
+ _this.invokeEventCallback("load");
58781
+ _this._isOnLoadTriggered = true;
58782
+ }
58778
58783
  }), 100);
58779
58784
  };
58780
58785
  TabPaneComponent.prototype.notifyParent = function(evt) {
@@ -657,7 +657,7 @@ var c=function(e,t){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Arr
657
657
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
658
658
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
659
659
  PERFORMANCE OF THIS SOFTWARE.
660
- ***************************************************************************** */var a=function(e,t){return(a=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 s(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}a(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}Object.create;function l(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 c(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 p=function(e){function t(t){var n=e.call(this)||this;return n.tabs=t,n._$el=$(n.tabs.getNativeElement()).find(">.tab-content"),n.init(n._$el),n}return s(t,e),t.prototype.calibrate=function(){var e=this.tabs.getActiveTabIndex(),t=this._$el.find(">.tab-pane"),n=0,i=0,o=[];return t.each((function(t,r){return $(r).prop("hidden")||(i++,t===e&&(n=i-1),o.push(r)),!0})),{activeTabIndex:n,noOfTabs:i,panes:o}},t.prototype.bounds=function(){var e=this.calibrate(),t=e.activeTabIndex,n=e.noOfTabs,i=e.panes,o=$(i[0]).width(),r=-1*t*o;return this.clearContentFocus(),{strict:!1,lower:t===n-1?0:-o,center:r,upper:0===t?r:o}},t.prototype.context=function(){return{w:this._$el.width()}},t.prototype.animation=function(){return{transform:"translate3d(${{ ($D + $d)/w * 100 + '%'}}, 0, 0)","-webkit-transform":"translate3d(${{ ($D + $d)/w * 100 + '%'}}, 0, 0)"}},t.prototype.clearContentFocus=function(){var e=this._$el.find(">.tab-pane.active");e.length&&e.find(document.activeElement).length&&document.activeElement.blur()},t.prototype.transitionTabIntoView=function(){var e=this.calibrate(),t=e.activeTabIndex,n=e.noOfTabs,i=e.panes,r=100*n+"%";o.setCSSFromObj(this._$el[0],{maxWidth:r,width:r}),o.addClass(this.tabs.getNativeElement(),"has-transition");var a=100/n+"%";i.forEach((function(e){o.setCSS(e,"width",a)})),o.setCSS(this._$el[0],"transform","translate3d("+-1*t/n*100+"%, 0, 0)")},t.prototype.onUpper=function(e){this.tabs.prev(e),o.$appDigest()},t.prototype.onLower=function(e){this.tabs.next(e),o.$appDigest()},t.prototype.threshold=function(){return 5},t}(r.SwipeAnimation),u=function(){var e=new Map([["class",i.PROP_STRING],["dataset",i.PROP_ANY],["defaultpaneindex",Object.assign({value:0},i.PROP_NUMBER)],["justified",i.PROP_BOOLEAN],["tabsposition",Object.assign({value:"top"},i.PROP_STRING)],["name",i.PROP_STRING],["nodatamessage",Object.assign({value:"No Data Found"},i.PROP_STRING)],["show",Object.assign({value:!0},i.PROP_BOOLEAN)],["statehandler",Object.assign({value:"none"},i.PROP_STRING)],["transition",i.PROP_STRING],["type",i.PROP_STRING]]);o.isMobileApp()&&e.set("transition",Object.assign({value:"slide"},i.PROP_STRING)),i.register("wm-tabs",e)},d=function(){i.register("wm-tabpane",new Map([["active",i.PROP_BOOLEAN],["badgevalue",i.PROP_STRING],["badgetype",Object.assign({value:"default"},i.PROP_STRING)],["class",i.PROP_STRING],["content",i.PROP_STRING],["disabled",i.PROP_BOOLEAN],["dynamicPaneIndex",i.PROP_NUMBER],["heading",i.PROP_STRING],["isdefaulttab",i.PROP_STRING],["isdynamic",i.PROP_BOOLEAN],["name",i.PROP_STRING],["paneicon",i.PROP_STRING],["show",Object.assign({value:!0},i.PROP_BOOLEAN)],["smoothscroll",Object.assign({value:!1},i.PROP_BOOLEAN)],["title",Object.assign({value:"Tab Title"},i.PROP_STRING)]]))},h={widgetType:"wm-tabpane",hostClass:"tab-pane"},m=function(e){function t(t,n,i,r){var a=e.call(this,t,h)||this;return a.tabsRef=n,a.heading=i,a.title=r,a._isFirstLoad=!0,a.$lazyLoad=o.noop,a.isActive=!1,a.disabled=!1,o.removeAttr(a.nativeElement,"title"),a}return s(t,e),t.prototype.invokeOnSelectCallback=function(e){this.invokeEventCallback("select",{$event:e})},t.prototype.select=function(e){this.isActive||this.disabled||(this.isActive=!0,this.$lazyLoad(),this.redrawChildren(),this.notifyParent(e))},t.prototype.tabpaneHeaderClick=function(e,t){this.invokeEventCallback("headerclick",{$event:e,paneIndex:t})},t.prototype.deselect=function(){this.isActive&&(this.isActive=!1,this.invokeEventCallback("deselect"))},t.prototype.remove=function(){this.isActive&&(this===this.tabsRef.panes.last?this.tabsRef.prev():this.tabsRef.next());var e=this.tabsRef.panes.toArray();e.splice(this.tabsRef.getPaneIndexByRef(this),1),this.tabsRef.panes.reset(c([],l(e))),this.nativeElement.remove(),this.tabsRef.$element.find(".tab-header[data-paneid='"+this.$element.attr("widget-id")+"'] a").remove()},t.prototype.redrawChildren=function(){var e=this;setTimeout((function(){e.reDrawableComponents&&e.reDrawableComponents.forEach((function(e){return e.redraw()}))}),100)},t.prototype.notifyParent=function(e){this.tabsRef.notifyChange(this,e)},t.prototype.handleSwipeLeft=function(){this.tabsRef.next()},t.prototype.handleSwipeRight=function(){this.tabsRef.prev()},t.prototype.handleEvent=function(t,n,i,o){"select"!==n&&e.prototype.handleEvent.call(this,this.nativeElement,n,i,o)},t.prototype.onPropertyChange=function(t,n,i){var o,r=this;"content"===t?this.isActive&&setTimeout((function(){return r.$lazyLoad()}),100):"show"===t?(this.nativeElement.hidden=!n,this._isFirstLoad?this.tabsRef.selectDefaultPaneByIndex(this.tabsRef.defaultpaneindex):!n&&this.isActive?this.tabsRef.next():!n&&this.isActive||null===(o=this.tabsRef.tabsAnimator)||void 0===o||o.transitionTabIntoView(),this._isFirstLoad=!1):e.prototype.onPropertyChange.call(this,t,n,i)},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.title=this.title||this.heading},t.prototype.ngAfterViewInit=function(){i.styler(this.nativeElement.querySelector(".tab-body"),this,i.APPLY_STYLES_TYPE.CONTAINER),e.prototype.ngAfterViewInit.call(this),this.isdynamic&&this.tabsRef.registerDynamicTab(this)},t}(i.StylableComponent);m.initializeProps=d(),m.decorators=[{type:t.Component,args:[{selector:"div[wmTabPane]",template:'<div class="tab-body" partial-container-target [wmSmoothscroll]="smoothscroll">\n <ng-content></ng-content>\n</div>',providers:[i.provideAsWidgetRef(m)]}]}],m.ctorParameters=function(){return[{type:t.Injector},{type:g},{type:void 0,decorators:[{type:t.Attribute,args:["heading"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["title"]}]}]},m.propDecorators={isActive:[{type:t.HostBinding,args:["class.active"]}],disabled:[{type:t.HostBinding,args:["class.disabled"]}],reDrawableComponents:[{type:t.ContentChildren,args:[i.RedrawableDirective,{descendants:!0}]}]};var f={widgetType:"wm-tabs",hostClass:"app-tabs clearfix"},g=function(e){function t(t,n,r,a,s){var l=this,c=o.noop;return(l=e.call(this,t,f,new Promise((function(e){return c=e})))||this).transition=r,l.tabsposition=a,l.statePersistence=s,l.dynamicComponentProvider=n,l.dynamicTabs=[],l.dynamicPaneIndex=0,l.promiseResolverFn=c,i.styler(l.nativeElement,l,i.APPLY_STYLES_TYPE.CONTAINER),l}return s(t,e),t.prototype.animateIn=function(e){var t=$(e);t.siblings(".active").removeClass("active"),t.addClass("active");var n=this.nativeElement.querySelector("ul.nav.nav-tabs"),i=t.prev();i.length?n.scrollLeft=i[0].offsetLeft:n.scrollLeft=0},t.prototype.registerDynamicTab=function(e){if(this.dynamicTabs.push(e),this.dynamicTabs.length===this.dynamicPaneIndex)for(var t=function(e){var t=_.find(n.dynamicTabs,(function(t){return t.dynamicPaneIndex===e}));_.find(n.panes.toArray(),t)||(n.panes.reset(c(c([],l(n.panes.toArray())),[t])),t.active&&setTimeout((function(){t.select()}),20))},n=this,i=0;i<this.dynamicTabs.length;i++)t(i)},t.prototype.addPane=function(e){var t=this;_.isArray(e)||(e=[e]);var n=[];return _.forEach(e,(function(e,i){var o=_.find(t.panes.toArray(),{name:e.name}),r=_.indexOf(n,e.name);if(o||r>0)console.warn("The tab pane with name "+e.name+" already exists");else{var a="",s="";t.dynamicPaneIndex++;var l=e.name?e.name:"tabpane"+(t.panes.toArray().length+(i+1));n.push(l);var c=_.get(e,"params");_.forEach(e,(function(e,t){"params"!==t&&(s=s+" "+t+'="'+e+'"')})),_.forEach(c,(function(e,t){a=a+' <wm-param name="'+t+'" value="'+e+'"></wm-param>'}));var p='<wm-tabpane dynamicPaneIndex="'+(t.dynamicPaneIndex-1)+'" isdynamic="true" name="'+l+'" '+s+">\n "+a+"\n </wm-tabpane>";t._dynamicContext||(t._dynamicContext=Object.create(t.viewParent),t._dynamicContext[t.getAttr("wmTab")]=t),t.dynamicComponentProvider.addComponent(t.getNativeElement().querySelector(".tab-content"),p,t._dynamicContext,{inj:t.inj})}})),n},t.prototype.removePane=function(e){var t=this.getPaneRefByName(e);t&&t.remove()},t.prototype.notifyChange=function(e,t){if(this.isSelectableTab(e)){var n;_.isEmpty(this.activeTab)||this.activeTab.deselect(),this.activeTab=e.getWidget();var i=this.getPaneIndexByRef(e),o=this.statePersistence.computeMode(this.statehandler);if(!this.isPageLoadCall&&o&&"none"!==o.toLowerCase()?this.statePersistence.setWidgetState(this,this.activeTab.name):(this.defaultpaneindex=this.getPaneIndexByRef(e),this.isPageLoadCall=!1),e.invokeOnSelectCallback(t),t&&this.invokeEventCallback("change",{$event:t,newPaneIndex:i,oldPaneIndex:this._oldPaneIndex||0}),this._oldPaneIndex=i,t&&(n=$(t.target).closest("li.tab-header")),!t||!n||!n.length)n=this.nativeElement.querySelector("li[data-paneid="+e.widgetId+"]"),!!$(n).closest(".app-tabs").parent().closest(".app-tabs").length||$(n).children().focus();this.animateIn(n),this.canSlide()&&(this.tabsAnimator||(this.tabsAnimator=new p(this),this.tabsAnimator.setGesturesEnabled(this.canSlide())),this.tabsAnimator.transitionTabIntoView())}},t.prototype.goToTab=function(e){this.isValidPaneIndex(e-1)&&this.getPaneRefByIndex(e-1).select()},t.prototype.getPaneIndexByRef=function(e){return this.panes.toArray().indexOf(e)},t.prototype.getActiveTabIndex=function(){return _.findIndex(this.panes.toArray(),{isActive:!0})},t.prototype.isValidPaneIndex=function(e){return e>=0&&e<this.panes.length},t.prototype.getPaneRefByIndex=function(e){return this.panes.toArray()[e]},t.prototype.getPaneRefByName=function(e){return _.find(this.panes.toArray(),{name:e})},t.prototype.isSelectableTab=function(e){return e.show&&!e.disabled},t.prototype.canSlide=function(){return"slide"===this.transition&&!this.vertical},t.prototype.getSelectableTabAfterIndex=function(e){for(var t=e+1;t<this.panes.length;t++){var n=this.getPaneRefByIndex(t);if(this.isSelectableTab(n))return n}if(e===this.panes.length-1){n=this.getPaneRefByIndex(0);if(this.isSelectableTab(n))return n}},t.prototype.getSelectableTabBeforeIndex=function(e){for(var t=e-1;t>=0;t--){var n=this.getPaneRefByIndex(t);if(this.isSelectableTab(n))return n}if(0===e){n=this.getPaneRefByIndex(this.panes.length-1);if(this.isSelectableTab(n))return n}},t.prototype.next=function(e){var t=this.getSelectableTabAfterIndex(this.getActiveTabIndex());t&&t.select(e)},t.prototype.prev=function(e){var t=this.getSelectableTabBeforeIndex(this.getActiveTabIndex());t&&t.select(e)},t.prototype.selectDefaultPaneByIndex=function(e){if(this.isValidPaneIndex(e)){var t=this.getPaneRefByIndex(e);this.isSelectableTab(t)||(t=this.getSelectableTabAfterIndex(0)),t&&t.select()}},t.prototype.setTabsPosition=function(){var e=this.nativeElement.children[0];this.vertical="left"===this.tabsposition||"right"===this.tabsposition,o.removeClass(this.nativeElement,"inverted"),"bottom"!==this.tabsposition&&"right"!==this.tabsposition||(o.appendNode(e,this.nativeElement),o.addClass(this.nativeElement,"inverted"))},t.prototype.onDataChange=function(e){var t=this;this.fieldDefs=i.createArrayFrom(e),setTimeout((function(){return t.selectDefaultPaneByIndex(t.defaultpaneindex||0)}))},t.prototype.onPropertyChange=function(t,n,i){var o=this;if("defaultpaneindex"===t)this.defaultpaneindex=n;else if("dataset"===t)this.onDataChange(n);else if("statehandler"===t){this.isPageLoadCall=!0;var r=this.statePersistence.getWidgetState(this);if("none"!==n&&r){var a=this.panes.filter((function(e){return r===e.name}));if(a.length){var s=this.getPaneIndexByRef(a[0]);setTimeout((function(){return o.selectDefaultPaneByIndex(s)}),20)}else console.warn("Tab pane name "+r+" in State is incorrect. Falling back to the default pane"),setTimeout((function(){return o.selectDefaultPaneByIndex(o.defaultpaneindex||0)}),20)}else setTimeout((function(){return o.selectDefaultPaneByIndex(o.defaultpaneindex||0)}),20)}else e.prototype.onPropertyChange.call(this,t,n,i)},t.prototype.registerTabsScroll=function(){var e=this;setTimeout((function(){var t,n=e.$element.find("> ul");(t=n.children().last().position())&&t.left>n.width()&&n.on("mousewheel",(function(e){var t=n[0].scrollLeft,i=-1*e.originalEvent.wheelDelta;e.stopPropagation(),e.preventDefault(),n.animate({scrollLeft:t+i},{duration:10})}))}))},t.prototype.onkeydown=function(e){switch(e.key){case"ArrowLeft":case"ArrowUp":this.prev(),e.preventDefault();break;case"ArrowRight":case"ArrowDown":this.next(),e.preventDefault()}},t.prototype.ngAfterContentInit=function(){var t=this;this.promiseResolverFn(),e.prototype.ngAfterContentInit.call(this),this.setTabsPosition(),this.panes.changes.subscribe((function(e){t.panes.length&&t.selectDefaultPaneByIndex(t.defaultpaneindex||0)}))},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),this.registerTabsScroll()},t}(i.StylableComponent);g.initializeProps=u(),g.decorators=[{type:t.Component,args:[{selector:"div[wmTabs]",template:'<ul class="nav nav-tabs" [ngClass]="{\'nav-stacked\': vertical, \'nav-justified\': justified}" role="tablist">\n <li class="tab-header" *ngFor="let pane of panes; let i=index;" [attr.data-paneid]="pane.widgetId" [ngClass]="{\'active\': pane.isActive, \'disabled\': pane.disabled}"\n [hidden]="!pane.show" role="presentation">\n <a class="tab-heading" href="javascript:void(0);" [attr.aria-label]="pane.title" [attr.title]="pane.title" [tabindex]="pane.isActive ? \'0\' : \'-1\'"\n [attr.aria-selected]="pane.isActive" role="tab" (click)="pane.select($event); pane.tabpaneHeaderClick($event, i);" (keydown)="onkeydown($event)">\n <i [ngClass]="[\'app-icon\', pane.paneicon]" *ngIf="pane.paneicon"></i>\n <span [textContent]="pane.title"></span>\n <span *ngIf="pane.badgevalue" class="label label-{{pane.badgetype}}" [textContent]="pane.badgevalue"></span>\n </a>\n </li>\n</ul>\n<div class="tab-content" *ngIf="type !== \'dynamic\'" [ngClass]="{\'tab-stacked\': vertical, \'tab-justified\': justified}">\n <ng-content ngProjectAs="div[wmTabPane]"></ng-content>\n</div>\n<div class="tab-content" *ngIf="type === \'dynamic\'" [ngClass]="{\'tab-stacked\': vertical, \'tab-justified\': justified}">\n <div *ngIf="fieldDefs && !fieldDefs.length">{{nodatamessage}}</div>\n <ng-content select="div[wmRepeatTemplate]"></ng-content>\n</div>\n',exportAs:"wmTabs",providers:[i.provideAsWidgetRef(g)]}]}],g.ctorParameters=function(){return[{type:t.Injector},{type:o.DynamicComponentRefProvider},{type:String,decorators:[{type:t.Attribute,args:["transition"]}]},{type:String,decorators:[{type:t.Attribute,args:["tabsposition"]}]},{type:o.StatePersistence}]},g.propDecorators={panes:[{type:t.ContentChildren,args:[m]}]};var v=[m,g],y=function(){};y.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.WmComponentsModule],declarations:c([],l(v)),exports:c([],l(v)),entryComponents:[]}]}],e.TabPaneComponent=m,e.TabsComponent=g,e.TabsModule=y,e["\u0275a"]=u,e["\u0275b"]=d,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/containers/tile",["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.containers=e.wm.components.containers||{},e.wm.components.containers.tile={}),e.ng.core,e.ng.common,e.wm.components.base)}(this,(function(e,t,n,i){"use strict";
660
+ ***************************************************************************** */var a=function(e,t){return(a=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 s(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}a(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}Object.create;function l(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 c(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 p=function(e){function t(t){var n=e.call(this)||this;return n.tabs=t,n._$el=$(n.tabs.getNativeElement()).find(">.tab-content"),n.init(n._$el),n}return s(t,e),t.prototype.calibrate=function(){var e=this.tabs.getActiveTabIndex(),t=this._$el.find(">.tab-pane"),n=0,i=0,o=[];return t.each((function(t,r){return $(r).prop("hidden")||(i++,t===e&&(n=i-1),o.push(r)),!0})),{activeTabIndex:n,noOfTabs:i,panes:o}},t.prototype.bounds=function(){var e=this.calibrate(),t=e.activeTabIndex,n=e.noOfTabs,i=e.panes,o=$(i[0]).width(),r=-1*t*o;return this.clearContentFocus(),{strict:!1,lower:t===n-1?0:-o,center:r,upper:0===t?r:o}},t.prototype.context=function(){return{w:this._$el.width()}},t.prototype.animation=function(){return{transform:"translate3d(${{ ($D + $d)/w * 100 + '%'}}, 0, 0)","-webkit-transform":"translate3d(${{ ($D + $d)/w * 100 + '%'}}, 0, 0)"}},t.prototype.clearContentFocus=function(){var e=this._$el.find(">.tab-pane.active");e.length&&e.find(document.activeElement).length&&document.activeElement.blur()},t.prototype.transitionTabIntoView=function(){var e=this.calibrate(),t=e.activeTabIndex,n=e.noOfTabs,i=e.panes,r=100*n+"%";o.setCSSFromObj(this._$el[0],{maxWidth:r,width:r}),o.addClass(this.tabs.getNativeElement(),"has-transition");var a=100/n+"%";i.forEach((function(e){o.setCSS(e,"width",a)})),o.setCSS(this._$el[0],"transform","translate3d("+-1*t/n*100+"%, 0, 0)")},t.prototype.onUpper=function(e){this.tabs.prev(e),o.$appDigest()},t.prototype.onLower=function(e){this.tabs.next(e),o.$appDigest()},t.prototype.threshold=function(){return 5},t}(r.SwipeAnimation),u=function(){var e=new Map([["class",i.PROP_STRING],["dataset",i.PROP_ANY],["defaultpaneindex",Object.assign({value:0},i.PROP_NUMBER)],["justified",i.PROP_BOOLEAN],["tabsposition",Object.assign({value:"top"},i.PROP_STRING)],["name",i.PROP_STRING],["nodatamessage",Object.assign({value:"No Data Found"},i.PROP_STRING)],["show",Object.assign({value:!0},i.PROP_BOOLEAN)],["statehandler",Object.assign({value:"none"},i.PROP_STRING)],["transition",i.PROP_STRING],["type",i.PROP_STRING]]);o.isMobileApp()&&e.set("transition",Object.assign({value:"slide"},i.PROP_STRING)),i.register("wm-tabs",e)},d=function(){i.register("wm-tabpane",new Map([["active",i.PROP_BOOLEAN],["badgevalue",i.PROP_STRING],["badgetype",Object.assign({value:"default"},i.PROP_STRING)],["class",i.PROP_STRING],["content",i.PROP_STRING],["disabled",i.PROP_BOOLEAN],["dynamicPaneIndex",i.PROP_NUMBER],["heading",i.PROP_STRING],["isdefaulttab",i.PROP_STRING],["isdynamic",i.PROP_BOOLEAN],["name",i.PROP_STRING],["paneicon",i.PROP_STRING],["show",Object.assign({value:!0},i.PROP_BOOLEAN)],["smoothscroll",Object.assign({value:!1},i.PROP_BOOLEAN)],["title",Object.assign({value:"Tab Title"},i.PROP_STRING)]]))},h={widgetType:"wm-tabpane",hostClass:"tab-pane"},m=function(e){function t(t,n,i,r){var a=e.call(this,t,h)||this;return a.tabsRef=n,a.heading=i,a.title=r,a._isFirstLoad=!0,a._isOnLoadTriggered=!1,a.$lazyLoad=o.noop,a.isActive=!1,a.disabled=!1,o.removeAttr(a.nativeElement,"title"),a}return s(t,e),t.prototype.invokeOnSelectCallback=function(e){this.invokeEventCallback("select",{$event:e})},t.prototype.select=function(e){this.isActive||this.disabled||(this.isActive=!0,this.$lazyLoad(),this.redrawChildren(),this.notifyParent(e))},t.prototype.tabpaneHeaderClick=function(e,t){this.invokeEventCallback("headerclick",{$event:e,paneIndex:t})},t.prototype.deselect=function(){this.isActive&&(this.isActive=!1,this.invokeEventCallback("deselect"))},t.prototype.remove=function(){this.isActive&&(this===this.tabsRef.panes.last?this.tabsRef.prev():this.tabsRef.next());var e=this.tabsRef.panes.toArray();e.splice(this.tabsRef.getPaneIndexByRef(this),1),this.tabsRef.panes.reset(c([],l(e))),this.nativeElement.remove(),this.tabsRef.$element.find(".tab-header[data-paneid='"+this.$element.attr("widget-id")+"'] a").remove()},t.prototype.redrawChildren=function(){var e=this;setTimeout((function(){e.reDrawableComponents&&e.reDrawableComponents.forEach((function(e){return e.redraw()})),e._isOnLoadTriggered||e.content||(e.invokeEventCallback("load"),e._isOnLoadTriggered=!0)}),100)},t.prototype.notifyParent=function(e){this.tabsRef.notifyChange(this,e)},t.prototype.handleSwipeLeft=function(){this.tabsRef.next()},t.prototype.handleSwipeRight=function(){this.tabsRef.prev()},t.prototype.handleEvent=function(t,n,i,o){"select"!==n&&e.prototype.handleEvent.call(this,this.nativeElement,n,i,o)},t.prototype.onPropertyChange=function(t,n,i){var o,r=this;"content"===t?this.isActive&&setTimeout((function(){return r.$lazyLoad()}),100):"show"===t?(this.nativeElement.hidden=!n,this._isFirstLoad?this.tabsRef.selectDefaultPaneByIndex(this.tabsRef.defaultpaneindex):!n&&this.isActive?this.tabsRef.next():!n&&this.isActive||null===(o=this.tabsRef.tabsAnimator)||void 0===o||o.transitionTabIntoView(),this._isFirstLoad=!1):e.prototype.onPropertyChange.call(this,t,n,i)},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.title=this.title||this.heading},t.prototype.ngAfterViewInit=function(){i.styler(this.nativeElement.querySelector(".tab-body"),this,i.APPLY_STYLES_TYPE.CONTAINER),e.prototype.ngAfterViewInit.call(this),this.isdynamic&&this.tabsRef.registerDynamicTab(this)},t}(i.StylableComponent);m.initializeProps=d(),m.decorators=[{type:t.Component,args:[{selector:"div[wmTabPane]",template:'<div class="tab-body" partial-container-target [wmSmoothscroll]="smoothscroll">\n <ng-content></ng-content>\n</div>',providers:[i.provideAsWidgetRef(m)]}]}],m.ctorParameters=function(){return[{type:t.Injector},{type:g},{type:void 0,decorators:[{type:t.Attribute,args:["heading"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["title"]}]}]},m.propDecorators={isActive:[{type:t.HostBinding,args:["class.active"]}],disabled:[{type:t.HostBinding,args:["class.disabled"]}],reDrawableComponents:[{type:t.ContentChildren,args:[i.RedrawableDirective,{descendants:!0}]}]};var f={widgetType:"wm-tabs",hostClass:"app-tabs clearfix"},g=function(e){function t(t,n,r,a,s){var l=this,c=o.noop;return(l=e.call(this,t,f,new Promise((function(e){return c=e})))||this).transition=r,l.tabsposition=a,l.statePersistence=s,l.dynamicComponentProvider=n,l.dynamicTabs=[],l.dynamicPaneIndex=0,l.promiseResolverFn=c,i.styler(l.nativeElement,l,i.APPLY_STYLES_TYPE.CONTAINER),l}return s(t,e),t.prototype.animateIn=function(e){var t=$(e);t.siblings(".active").removeClass("active"),t.addClass("active");var n=this.nativeElement.querySelector("ul.nav.nav-tabs"),i=t.prev();i.length?n.scrollLeft=i[0].offsetLeft:n.scrollLeft=0},t.prototype.registerDynamicTab=function(e){if(this.dynamicTabs.push(e),this.dynamicTabs.length===this.dynamicPaneIndex)for(var t=function(e){var t=_.find(n.dynamicTabs,(function(t){return t.dynamicPaneIndex===e}));_.find(n.panes.toArray(),t)||(n.panes.reset(c(c([],l(n.panes.toArray())),[t])),t.active&&setTimeout((function(){t.select()}),20))},n=this,i=0;i<this.dynamicTabs.length;i++)t(i)},t.prototype.addPane=function(e){var t=this;_.isArray(e)||(e=[e]);var n=[];return _.forEach(e,(function(e,i){var o=_.find(t.panes.toArray(),{name:e.name}),r=_.indexOf(n,e.name);if(o||r>0)console.warn("The tab pane with name "+e.name+" already exists");else{var a="",s="";t.dynamicPaneIndex++;var l=e.name?e.name:"tabpane"+(t.panes.toArray().length+(i+1));n.push(l);var c=_.get(e,"params");_.forEach(e,(function(e,t){"params"!==t&&(s=s+" "+t+'="'+e+'"')})),_.forEach(c,(function(e,t){a=a+' <wm-param name="'+t+'" value="'+e+'"></wm-param>'}));var p='<wm-tabpane dynamicPaneIndex="'+(t.dynamicPaneIndex-1)+'" isdynamic="true" name="'+l+'" '+s+">\n "+a+"\n </wm-tabpane>";t._dynamicContext||(t._dynamicContext=Object.create(t.viewParent),t._dynamicContext[t.getAttr("wmTab")]=t),t.dynamicComponentProvider.addComponent(t.getNativeElement().querySelector(".tab-content"),p,t._dynamicContext,{inj:t.inj})}})),n},t.prototype.removePane=function(e){var t=this.getPaneRefByName(e);t&&t.remove()},t.prototype.notifyChange=function(e,t){if(this.isSelectableTab(e)){var n;_.isEmpty(this.activeTab)||this.activeTab.deselect(),this.activeTab=e.getWidget();var i=this.getPaneIndexByRef(e),o=this.statePersistence.computeMode(this.statehandler);if(!this.isPageLoadCall&&o&&"none"!==o.toLowerCase()?this.statePersistence.setWidgetState(this,this.activeTab.name):(this.defaultpaneindex=this.getPaneIndexByRef(e),this.isPageLoadCall=!1),e.invokeOnSelectCallback(t),t&&this.invokeEventCallback("change",{$event:t,newPaneIndex:i,oldPaneIndex:this._oldPaneIndex||0}),this._oldPaneIndex=i,t&&(n=$(t.target).closest("li.tab-header")),!t||!n||!n.length)n=this.nativeElement.querySelector("li[data-paneid="+e.widgetId+"]"),!!$(n).closest(".app-tabs").parent().closest(".app-tabs").length||$(n).children().focus();this.animateIn(n),this.canSlide()&&(this.tabsAnimator||(this.tabsAnimator=new p(this),this.tabsAnimator.setGesturesEnabled(this.canSlide())),this.tabsAnimator.transitionTabIntoView())}},t.prototype.goToTab=function(e){this.isValidPaneIndex(e-1)&&this.getPaneRefByIndex(e-1).select()},t.prototype.getPaneIndexByRef=function(e){return this.panes.toArray().indexOf(e)},t.prototype.getActiveTabIndex=function(){return _.findIndex(this.panes.toArray(),{isActive:!0})},t.prototype.isValidPaneIndex=function(e){return e>=0&&e<this.panes.length},t.prototype.getPaneRefByIndex=function(e){return this.panes.toArray()[e]},t.prototype.getPaneRefByName=function(e){return _.find(this.panes.toArray(),{name:e})},t.prototype.isSelectableTab=function(e){return e.show&&!e.disabled},t.prototype.canSlide=function(){return"slide"===this.transition&&!this.vertical},t.prototype.getSelectableTabAfterIndex=function(e){for(var t=e+1;t<this.panes.length;t++){var n=this.getPaneRefByIndex(t);if(this.isSelectableTab(n))return n}if(e===this.panes.length-1){n=this.getPaneRefByIndex(0);if(this.isSelectableTab(n))return n}},t.prototype.getSelectableTabBeforeIndex=function(e){for(var t=e-1;t>=0;t--){var n=this.getPaneRefByIndex(t);if(this.isSelectableTab(n))return n}if(0===e){n=this.getPaneRefByIndex(this.panes.length-1);if(this.isSelectableTab(n))return n}},t.prototype.next=function(e){var t=this.getSelectableTabAfterIndex(this.getActiveTabIndex());t&&t.select(e)},t.prototype.prev=function(e){var t=this.getSelectableTabBeforeIndex(this.getActiveTabIndex());t&&t.select(e)},t.prototype.selectDefaultPaneByIndex=function(e){if(this.isValidPaneIndex(e)){var t=this.getPaneRefByIndex(e);this.isSelectableTab(t)||(t=this.getSelectableTabAfterIndex(0)),t&&t.select()}},t.prototype.setTabsPosition=function(){var e=this.nativeElement.children[0];this.vertical="left"===this.tabsposition||"right"===this.tabsposition,o.removeClass(this.nativeElement,"inverted"),"bottom"!==this.tabsposition&&"right"!==this.tabsposition||(o.appendNode(e,this.nativeElement),o.addClass(this.nativeElement,"inverted"))},t.prototype.onDataChange=function(e){var t=this;this.fieldDefs=i.createArrayFrom(e),setTimeout((function(){return t.selectDefaultPaneByIndex(t.defaultpaneindex||0)}))},t.prototype.onPropertyChange=function(t,n,i){var o=this;if("defaultpaneindex"===t)this.defaultpaneindex=n;else if("dataset"===t)this.onDataChange(n);else if("statehandler"===t){this.isPageLoadCall=!0;var r=this.statePersistence.getWidgetState(this);if("none"!==n&&r){var a=this.panes.filter((function(e){return r===e.name}));if(a.length){var s=this.getPaneIndexByRef(a[0]);setTimeout((function(){return o.selectDefaultPaneByIndex(s)}),20)}else console.warn("Tab pane name "+r+" in State is incorrect. Falling back to the default pane"),setTimeout((function(){return o.selectDefaultPaneByIndex(o.defaultpaneindex||0)}),20)}else setTimeout((function(){return o.selectDefaultPaneByIndex(o.defaultpaneindex||0)}),20)}else e.prototype.onPropertyChange.call(this,t,n,i)},t.prototype.registerTabsScroll=function(){var e=this;setTimeout((function(){var t,n=e.$element.find("> ul");(t=n.children().last().position())&&t.left>n.width()&&n.on("mousewheel",(function(e){var t=n[0].scrollLeft,i=-1*e.originalEvent.wheelDelta;e.stopPropagation(),e.preventDefault(),n.animate({scrollLeft:t+i},{duration:10})}))}))},t.prototype.onkeydown=function(e){switch(e.key){case"ArrowLeft":case"ArrowUp":this.prev(),e.preventDefault();break;case"ArrowRight":case"ArrowDown":this.next(),e.preventDefault()}},t.prototype.ngAfterContentInit=function(){var t=this;this.promiseResolverFn(),e.prototype.ngAfterContentInit.call(this),this.setTabsPosition(),this.panes.changes.subscribe((function(e){t.panes.length&&t.selectDefaultPaneByIndex(t.defaultpaneindex||0)}))},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),this.registerTabsScroll()},t}(i.StylableComponent);g.initializeProps=u(),g.decorators=[{type:t.Component,args:[{selector:"div[wmTabs]",template:'<ul class="nav nav-tabs" [ngClass]="{\'nav-stacked\': vertical, \'nav-justified\': justified}" role="tablist">\n <li class="tab-header" *ngFor="let pane of panes; let i=index;" [attr.data-paneid]="pane.widgetId" [ngClass]="{\'active\': pane.isActive, \'disabled\': pane.disabled}"\n [hidden]="!pane.show" role="presentation">\n <a class="tab-heading" href="javascript:void(0);" [attr.aria-label]="pane.title" [attr.title]="pane.title" [tabindex]="pane.isActive ? \'0\' : \'-1\'"\n [attr.aria-selected]="pane.isActive" role="tab" (click)="pane.select($event); pane.tabpaneHeaderClick($event, i);" (keydown)="onkeydown($event)">\n <i [ngClass]="[\'app-icon\', pane.paneicon]" *ngIf="pane.paneicon"></i>\n <span [textContent]="pane.title"></span>\n <span *ngIf="pane.badgevalue" class="label label-{{pane.badgetype}}" [textContent]="pane.badgevalue"></span>\n </a>\n </li>\n</ul>\n<div class="tab-content" *ngIf="type !== \'dynamic\'" [ngClass]="{\'tab-stacked\': vertical, \'tab-justified\': justified}">\n <ng-content ngProjectAs="div[wmTabPane]"></ng-content>\n</div>\n<div class="tab-content" *ngIf="type === \'dynamic\'" [ngClass]="{\'tab-stacked\': vertical, \'tab-justified\': justified}">\n <div *ngIf="fieldDefs && !fieldDefs.length">{{nodatamessage}}</div>\n <ng-content select="div[wmRepeatTemplate]"></ng-content>\n</div>\n',exportAs:"wmTabs",providers:[i.provideAsWidgetRef(g)]}]}],g.ctorParameters=function(){return[{type:t.Injector},{type:o.DynamicComponentRefProvider},{type:String,decorators:[{type:t.Attribute,args:["transition"]}]},{type:String,decorators:[{type:t.Attribute,args:["tabsposition"]}]},{type:o.StatePersistence}]},g.propDecorators={panes:[{type:t.ContentChildren,args:[m]}]};var v=[m,g],y=function(){};y.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.WmComponentsModule],declarations:c([],l(v)),exports:c([],l(v)),entryComponents:[]}]}],e.TabPaneComponent=m,e.TabsComponent=g,e.TabsModule=y,e["\u0275a"]=u,e["\u0275b"]=d,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/containers/tile",["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.containers=e.wm.components.containers||{},e.wm.components.containers.tile={}),e.ng.core,e.ng.common,e.wm.components.base)}(this,(function(e,t,n,i){"use strict";
661
661
  /*! *****************************************************************************
662
662
  Copyright (c) Microsoft Corporation.
663
663