@wavemaker/app-runtime-wm-build 11.4.0-rc.5351 → 11.4.1-next.140982

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.
@@ -54,7 +54,7 @@
54
54
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
55
55
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
56
56
  PERFORMANCE OF THIS SOFTWARE.
57
- ***************************************************************************** */var l=function(e,t){return(l=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 c(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}l(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}Object.create;function p(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 u(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 d=function(){r.register("wm-button",new Map([["animation",r.PROP_STRING],["badgevalue",r.PROP_STRING],["caption",r.PROP_STRING],["class",r.PROP_STRING],["conditionalclass",r.PROP_ANY],["conditionalstyle",r.PROP_ANY],["disabled",r.PROP_BOOLEAN],["hint",r.PROP_STRING],["iconclass",r.PROP_STRING],["iconheight",r.PROP_STRING],["iconmargin",r.PROP_STRING],["iconposition",r.PROP_STRING],["iconurl",r.PROP_STRING],["iconwidth",r.PROP_STRING],["name",r.PROP_STRING],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["type",r.PROP_STRING]]))},h={widgetType:"wm-button",hostClass:"btn app-button",displayType:r.DISPLAY_TYPE.INLINE_BLOCK},m=function(e){function t(t){var n=e.call(this,t,h)||this;return r.styler(n.nativeElement,n),n}return c(t,e),t}(r.StylableComponent);m.initializeProps=d(),m.decorators=[{type:t.Component,args:[{selector:"button[wmButton]",template:'<img data-identifier="img" alt="button image" class="button-image-icon" [src]="iconurl | image" *ngIf="iconurl" [ngStyle]="{width:iconwidth, height:iconheight, margin:iconmargin}"/>\n<i class="app-icon {{iconclass}}" aria-hidden="true" [ngStyle]="{width:iconwidth, height:iconheight, margin:iconmargin, fontSize:iconwidth}" *ngIf="iconclass"></i>\n<span class="sr-only" *ngIf="iconclass">{{caption}} {{appLocale.LABEL_ICON}}</span>\n<span class="btn-caption" [innerHTML]="caption"></span>\n<ng-content select=".caret"></ng-content>\n<span *ngIf="badgevalue" class="badge pull-right" [textContent]="badgevalue"></span>\n',providers:[r.provideAsWidgetRef(m)],exportAs:"wmButton"}]}],m.ctorParameters=function(){return[{type:t.Injector}]},m.propDecorators={type:[{type:t.HostBinding,args:["type"]}],tabindex:[{type:t.HostBinding,args:["tabIndex"]}],disabled:[{type:t.HostBinding,args:["disabled"]}],shortcutkey:[{type:t.HostBinding,args:["attr.accesskey"]}],iconposition:[{type:t.HostBinding,args:["attr.icon-position"]}]};var f=function(){r.register("wm-buttongroup",new Map([["class",r.PROP_STRING],["name",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["vertical",r.PROP_BOOLEAN]]))},g={widgetType:"wm-buttongroup",hostClass:"btn-group app-button-group"},v=function(e){function t(t){var n=e.call(this,t,g)||this;return r.styler(n.nativeElement,n,r.APPLY_STYLES_TYPE.CONTAINER),n}return c(t,e),t.prototype.handleClick=function(e){var t=$(e.target).closest(".app-button");this.$element.find(".app-button").removeClass("selected"),t.addClass("selected")},t}(r.StylableComponent);v.initializeProps=f(),v.decorators=[{type:t.Directive,args:[{selector:"[wmButtonGroup]",providers:[r.provideAsWidgetRef(v)]}]}],v.ctorParameters=function(){return[{type:t.Injector}]},v.propDecorators={vertical:[{type:t.HostBinding,args:["class.btn-group-vertical"]}],handleClick:[{type:t.HostListener,args:["click",["$event"]]}]};var y=function(e){function t(t,n,i){var o=e.call(this,t,n,i)||this;return o.inj=t,o.binddatavalue=o.$element.attr("datavalue.bind"),o}return c(t,e),Object.defineProperty(t.prototype,"datavalue",{get:function(){return this.dataval},set:function(e){this.dataval=e},enumerable:!1,configurable:!0}),t.prototype.updateBoundVariable=function(e){var t=this.binddatavalue;this.datavaluesource&&this.datavaluesource.execute(a.DataSource.Operation.IS_API_AWARE)||this.datavaluesource&&!this.datavaluesource.twoWayBinding||!t||t.startsWith("Widgets.")||t.startsWith("itemRef.currentItemWidgets")||(t=t.replace(/\[\$i\]/g,"[0]"),_.has(this.context,t.split(".")[0])?_.set(this.context,t,e):_.set(this.viewParent,t,e))},t.prototype.invokeOnChange=function(e,t){t&&this.datavalue!==this.prevDatavalue&&(this.updateBoundVariable(e),this.invokeEventCallback("change",{$event:t,newVal:e,oldVal:this.prevDatavalue})),this.prevDatavalue=e},t.prototype.updatePrevDatavalue=function(e){this.prevDatavalue=e},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),$(this.nativeElement).parents().closest("[wmList]").length&&this.$element.keydown((function(e){37!==e.keyCode&&38!==e.keyCode&&39!==e.keyCode&&40!==e.keyCode||e.stopPropagation()}))},t}(r.StylableComponent);function b(e){return function(t){return e?function(e){switch(typeof e){case"object":return!(!e||!e.length&&!Object.keys(e).length);case"number":return!!e||0===e;default:return!(null==e||""===e)}}(t.value)?null:{required:!0}:null}}y.decorators=[{type:t.Injectable}],y.ctorParameters=function(){return[{type:t.Injector},{type:void 0},{type:Promise}]};var w=function(e){function t(){var t=e.apply(this,u([],p(arguments)))||this;return t._onChange=function(){},t._onTouched=function(){},t}return c(t,e),t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this._formControl=this.inj.get(i.FormControlName,null)},t.prototype.registerOnChange=function(e){this._onChange=e},t.prototype.registerOnTouched=function(e){this._onTouched=e},t.prototype.writeValue=function(e){this.isDestroyed||(this._formControl&&(this.datavalue=e,this.onPropertyChange("datavalue",e),this.updatePrevDatavalue(e)),e!==this.datavalue&&this._onChange(this.datavalue))},t.prototype.invokeOnChange=function(t,n,i){this._onChange(t),i&&e.prototype.invokeOnChange.call(this,t,n)},t.prototype.invokeOnTouched=function(e){this._onTouched(),e&&this.invokeEventCallback("blur",{$event:e})},t.prototype.invokeOnFocus=function(e){this.invokeEventCallback("focus",{$event:e})},t.prototype.validate=function(e){return this.show?b(this.required)(e):null},t}(y);w.decorators=[{type:t.Injectable}];var P=new Map([["caption",r.PROP_STRING],["class",r.PROP_STRING],["conditionalclass",r.PROP_ANY],["conditionalstyle",r.PROP_ANY],["checkedvalue",Object.assign({value:!0},r.PROP_STRING)],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["hint",r.PROP_STRING],["name",r.PROP_STRING],["readonly",r.PROP_BOOLEAN],["required",r.PROP_BOOLEAN],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["uncheckedvalue",Object.assign({value:!1},r.PROP_STRING)]]),O=function(){r.register("wm-checkbox",P),r.registerFormWidget(a.FormWidgetType.CHECKBOX,P),r.registerFormWidget(a.FormWidgetType.TOGGLE,P)},S={widgetType:"wm-checkbox",hostClass:"app-checkbox checkbox"},E=function(e,t){if(null===e)return t;if(!0===e||"true"===e)return!0;if(!1===e||"false"===e)return!1;var n=parseInt(e,10);return isNaN(n)?e:n},T=E,R=function(e){function t(t,n,i,o){var r=e.call(this,t,S)||this;return r.type=o,r._caption="&nbsp",r._checkedvalue=E(n,!0),r._uncheckedvalue=E(i,!1),a.toggleClass(r.nativeElement,"app-toggle","toggle"===o),r}return c(t,e),Object.defineProperty(t.prototype,"datavalue",{get:function(){return a.isDefined(this.proxyModel)?this.proxyModel?this._checkedvalue:this._uncheckedvalue:void 0},set:function(e){this.proxyModel=a.isDefined(e)&&""!==e?e===this._checkedvalue:void 0,this.updatePrevDatavalue(this.datavalue)},enumerable:!1,configurable:!0}),t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("required"!==t?"caption"===t?a.isDefined(n)&&""!==n?this._caption=n:this._caption="&nbsp;":"checkedvalue"===t?this._checkedvalue=E(n,!0):"uncheckedvalue"===t?this._uncheckedvalue=E(n,!1):"datavalue"===t?(this.datavalue=E(n),this._onChange(this.datavalue)):e.prototype.onPropertyChange.call(this,t,n,i):this._onChange(this.datavalue))},t.prototype.handleEvent=function(t,n,i,o){if("change"!==n&&"blur"!==n){var r="tap"===n?this.nativeElement.querySelector("label"):this.checkboxEl.nativeElement;e.prototype.handleEvent.call(this,r,n,i,o)}},t.prototype.handleChange=function(e){this.invokeOnChange(this.datavalue,{type:"change"},this.ngModel.valid)},t.prototype.onKeyDown=function(e){e.preventDefault(),this.checkboxEl.nativeElement.click()},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),r.styler(this.nativeElement.querySelector("label"),this)},t}(w);R.initializeProps=O(),R.decorators=[{type:t.Component,args:[{selector:"[wmCheckbox]",template:'<label [ngClass]="{\'unchecked\': !proxyModel, \'disabled\': (disabled || readonly), \'required\': (required && _caption)}">\n <input type="checkbox"\n role="checkbox"\n #checkbox\n [attr.name]="name"\n [attr.aria-label]="hint"\n [attr.aria-checked]="!!proxyModel"\n focus-target\n [(ngModel)]="proxyModel"\n [readonly]="readonly"\n [required]="required"\n [disabled]="disabled || readonly"\n [attr.accesskey]="shortcutkey"\n [tabindex]="tabindex"\n (blur)="invokeOnTouched($event)"\n (ngModelChange)="handleChange($event)">\n <span class="caption" [innerHtml]="_caption"></span>\n <img alt="Checkbox Image" aria-hidden="true" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" class="switch"/>\n</label>\n<input type="hidden" class="ng-hide model-holder" aria-hidden="true" tabindex="-1" [disabled]="disabled" [value]="proxyModel">\n',providers:[r.provideAs(R,i.NG_VALUE_ACCESSOR,!0),r.provideAs(R,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(R)]}]}],R.ctorParameters=function(){return[{type:t.Injector},{type:void 0,decorators:[{type:t.Attribute,args:["checkedvalue"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["uncheckedvalue"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["type"]}]}]},R.propDecorators={ngModel:[{type:t.ViewChild,args:[i.NgModel]}],checkboxEl:[{type:t.ViewChild,args:["checkbox",{static:!0,read:t.ElementRef}]}],onKeyDown:[{type:t.HostListener,args:["keydown.enter",["$event",'"ENTER"']]}]};var A=function(e){function t(t,n,i){var o=e.call(this,t,n)||this;return o.groupby=i,o.datasetItems=[],o.acceptsArray=!1,o.dataset$=new s.Subject,o.datavalue$=new s.Subject,o.allowempty=!0,o._debounceDatavalueUpdation=_.debounce((function(e){!a.isDefined(o._modelByKey)||_.isArray(o._modelByKey)&&!o._modelByKey.length?(o.toBeProcessedDatavalue=e,o._modelByValue=""):a.isDefined(o.toBeProcessedDatavalue)&&(a.isDefined(o._modelByValue)||(o._modelByValue=!o.multiple&&_.isArray(o.toBeProcessedDatavalue)?o.toBeProcessedDatavalue[0]:o.toBeProcessedDatavalue),o.toBeProcessedDatavalue=void 0),o.initDisplayValues()}),150),o.datePipe=o.inj.get(r.ToDatePipe),o.appDefaults=o.inj.get(a.AppDefaults),o.binddisplayexpression=o.nativeElement.getAttribute("displayexpression.bind"),o.binddisplayimagesrc=o.nativeElement.getAttribute("displayimagesrc.bind"),o.binddisplaylabel=o.nativeElement.getAttribute("displaylabel.bind"),o._debouncedInitDatasetItems=a.debounce((function(){o.initDatasetItems(),a.$appDigest()}),150),o.handleHeaderClick=a.noop,o}return c(t,e),Object.defineProperty(t.prototype,"modelByKey",{get:function(){return this._modelByKey},set:function(e){this.selectByKey(e),this.invokeOnChange(this._modelByValue)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"datavalue",{get:function(){return this._modelByValue},set:function(e){this.multiple&&(e=r.extractDataAsArray(e)),this._modelByValue=e,this.selectByValue(e),this.datavalue$.next(e),this.invokeOnChange(e,void 0,!0)},enumerable:!1,configurable:!0}),t.prototype.selectByKey=function(e){var t=this;if(this.resetDatasetItems(),this.datasetItems.length){if(this.multiple&&!_.isArray(e)&&(e=[e]),this._modelByKey=e,this.multiple)this._modelByValue=[],e.forEach((function(e){var n=_.find(t.datasetItems,(function(t){return _.toString(t.key)===_.toString(e)}));n&&(n.selected=!0,t._modelByValue=u(u([],p(t._modelByValue)),[n.value]))}));else{this._modelByValue="";var n=_.find(this.datasetItems,(function(t){return _.toString(t.key)===_.toString(e)}));n&&(n.selected=!0,this._modelByValue=n.value)}this.initDisplayValues()}},t.prototype.selectByValue=function(e){var t=this;if(this.resetDatasetItems(),!(!a.isDefined(e)||""===e||_.isNull(e)||e instanceof Array&&!e.length)||(this._modelByKey=void 0,this.allowempty&&a.isDefined(e)))if(this.acceptsArray&&!_.isArray(e)&&(e=this.allowempty?[e]:r.extractDataAsArray(e)),this.datasetItems.length||!a.isDefined(e)){var n=this.datafield===r.ALLFIELDS?"dataObject":"key";if(_.isArray(e))this._modelByKey=[],e.forEach((function(e){var i=_.find(t.datasetItems,(function(i){return"dataObject"===n&&t.compareby&&t.compareby.length?a.isEqualWithFields(i[n],e,t.compareby):_.isObject(i.value)?_.isEqual(i.value,e):_.toString(i.value).toLowerCase()===_.toString(e).toLowerCase()}));i&&(i.selected=!0,t._modelByKey.push(i.key))}));else{this._modelByKey=void 0;var i=_.find(this.datasetItems,(function(i){return"dataObject"===n&&t.compareby&&t.compareby.length?a.isEqualWithFields(i[n],e,t.compareby):_.isObject(i.value)?_.isEqual(i.value,e):_.toString(i.value).toLowerCase()===_.toString(e).toLowerCase()}));i&&(i.selected=!0,this._modelByKey=i.key)}this._debounceDatavalueUpdation(e)}else this.toBeProcessedDatavalue=e},t.prototype.initDisplayValues=function(){var e=[];this.datasetItems.forEach((function(t){t.selected&&e.push(t.label)})),this.displayValue=this.multiple?e:e[0]||""},t.prototype.initDatasetItems=function(){if(!this.dataset||_.isEmpty(this.dataset))return this.datasetItems=[],void this.dataset$.next(this.datasetItems);var e=r.getOrderedDataset(r.convertDataToObject(this.dataset),this.orderby);if(this.usekeys)this.datasetItems=r.transformDataWithKeys(e);else{var t=r.transformFormData(this.viewParent,e,this.datafield,{displayField:this.displayfield||this.displaylabel,displayExpr:this.displayexpression,bindDisplayExpr:this.binddisplayexpression||this.binddisplaylabel,bindDisplayImgSrc:this.binddisplayimagesrc,displayImgSrc:this.displayimagesrc});this.datasetItems=u([],p(r.getUniqObjsByDataField(t,this.datafield,this.displayfield||this.displaylabel,a.toBoolean(this.allowempty))))}this.postDatasetItemsInit()},t.prototype.postDatasetItemsInit=function(){if(this.datasetItems.length&&!this._defaultQueryInvoked){var e=_.isEmpty(this.toBeProcessedDatavalue)?this.datavalue:this.toBeProcessedDatavalue;this.selectByValue(e)}this.dataset$.next(this.datasetItems)},t.prototype.resetDatasetItems=function(){this.datasetItems.forEach((function(e){return e.selected=!1}))},t.prototype.setTemplate=function(e){this.content=e,this.viewParent&&this.viewParent.prefabName&&(this.prefabName=this.viewParent.prefabName)},t.prototype.getGroupedData=function(){return this.datasetItems.length?r.groupData(this,r.convertDataToObject(this.datasetItems),this.groupby,this.match,this.orderby,this.dateformat,this.datePipe,"dataObject",this.appDefaults):[]},t.prototype.datasetSubscription=function(){var e=this,t=this.dataset$.subscribe((function(){e.groupedData=e.getGroupedData()}));this.registerDestroyListener((function(){return t.unsubscribe()}))},t.prototype.setGroupData=function(){this.datasetSubscription(),this.groupedData=this.getGroupedData()},t.prototype.onPropertyChange=function(t,n,i){switch(e.prototype.onPropertyChange.call(this,t,n,i),t){case"dataset":case"datafield":case"displayfield":case"displaylabel":case"displayexpression":case"orderby":case"usekeys":this._debouncedInitDatasetItems();break;case"required":case"datavalue":this._onChange(this.datavalue);break;case"groupby":case"match":"wm-search"!==this.widgetType&&"wm-chips"!==this.widgetType&&this.setGroupData()}},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.groupby&&"wm-search"!==this.widgetType&&"wm-chips"!==this.widgetType&&this.setGroupData(),this.groupby&&this.collapsible&&(this.handleHeaderClick=r.handleHeaderClick,this.toggleAllHeaders=r.toggleAllHeaders.bind(void 0,this))},t}(w);A.decorators=[{type:t.Injectable}],A.ctorParameters=function(){return[{type:t.Injector},null,{type:String,decorators:[{type:t.Attribute,args:["groupby"]}]}]};var C=new Map([["class",r.PROP_STRING],["collapsible",r.PROP_BOOLEAN],["compareby",r.PROP_STRING],["datafield",r.PROP_STRING],["dataset",Object.assign({value:"Option 1, Option 2, Option 3"},r.PROP_ANY)],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_STRING],["dateformat",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["displayexpression",r.PROP_STRING],["displayfield",r.PROP_STRING],["displayValue",r.PROP_STRING],["groupby",r.PROP_STRING],["itemclass",Object.assign({value:""},r.PROP_STRING)],["itemsperrow",Object.assign({value:"xs-1 sm-1 md-1 lg-1"},r.PROP_STRING)],["listclass",Object.assign({value:""},r.PROP_STRING)],["match",r.PROP_STRING],["name",r.PROP_STRING],["orderby",r.PROP_STRING],["readonly",r.PROP_BOOLEAN],["required",r.PROP_BOOLEAN],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["showcount",r.PROP_BOOLEAN],["showindevice",Object.assign({displayType:"inline-block",value:"all"},r.PROP_STRING)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["usekeys",r.PROP_BOOLEAN]]),I=function(){r.register("wm-checkboxset",C),r.registerFormWidget(a.FormWidgetType.CHECKBOXSET,new Map(C))},D={widgetType:"wm-checkboxset",hostClass:"app-checkboxset list-group inline"},N=function(e){function t(t){var n=e.call(this,t,D)||this;return n.layout="",r.styler(n.nativeElement,n),n.multiple=!0,n}return c(t,e),t.prototype.onCheckboxLabelClick=function(e,t){if($(e.target).is("input")){var n=this.nativeElement.querySelectorAll("input:checked"),i=[];_.forEach(n,(function(e){i.push(e.value)})),this.modelByKey=i,this.invokeOnTouched(),this.invokeOnChange(this.datavalue,e||{},!0)}},t.prototype.handleEvent=function(t,n,i,o){"click"===n?this.eventManager.addEventListener(t,n,(function(e){if($(e.target).is("input"))return o.$event=e,i()})):_.includes(["change"],n)||e.prototype.handleEvent.call(this,t,n,i,o)},t.prototype.onKeyDown=function(e){e.preventDefault(),e.target.click()},t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("required"!==t?"itemsperrow"===t?a.setListClass(this):e.prototype.onPropertyChange.call(this,t,n,i):this._onChange(this.datavalue))},t}(A);N.initializeProps=I(),N.decorators=[{type:t.Component,args:[{selector:"[wmCheckboxset]",exportAs:"wmCheckboxset",template:'<ng-template [ngIf]="!groupby" [ngIfElse]="groupedListTemplate">\n <li [ngClass]="[\'checkbox\', \'app-checkbox\', itemclass, itemsPerRowClass]"\n [class.active]="item.selected"\n *ngFor="let item of datasetItems; let i = index"\n [wmItemTemplate]="content" [userComponentParams]="item" partialContainer\n (click)="onCheckboxLabelClick($event, item.key)" role="presentation">\n \x3c!-- Default item template --\x3e\n <label *ngIf="!content" class="app-checkboxset-label" [ngClass]="{\'disabled\':disabled || readonly}" [title]="item.label">\n <input [name]="\'checkboxset_\' + widgetId" type="checkbox" [attr.aria-label]="item.key"\n [tabindex]="tabindex" [attr.aria-checked]="item.selected"\n [disabled]="disabled || readonly" [attr.data-attr-index]="i"\n [value]="item.key" [tabindex]="tabindex" [checked]="item.selected"/>\n <span class="caption" [textContent]="item.label"></span>\n </label>\n \x3c!-- Custom partial template --\x3e\n <label *ngIf="content" class="app-checkboxset-label" [ngClass]="{\'disabled\':disabled || readonly}" >\n <input [name]="\'checkboxset_\' + widgetId" type="checkbox" [attr.aria-label]="item.key"\n [tabindex]="tabindex" [attr.aria-checked]="item.selected"\n [disabled]="disabled || readonly" [attr.data-attr-index]="i"\n [value]="item.key" [tabindex]="tabindex" [checked]="item.selected"/>\n <span class="caption customTemplate" partial-container-target></span>\n </label>\n </li>\n</ng-template>\n<input [disabled]="disabled || readonly" hidden class="model-holder">\n<div *ngIf="readonly || disabled" class="readonly-wrapper"></div>\n\n\x3c!-- This template will be displayed when groupby is specified. --\x3e\n<ng-template #groupedListTemplate>\n <li *ngFor="let groupObj of groupedData" class="app-list-item-group" role="presentation">\n <ul class="item-group">\n <li class="list-group-header" (click)="handleHeaderClick($event)" [title]="groupObj.key" [ngClass]="{\'collapsible-content\': collapsible}">\n <h4 class="group-title">{{groupObj.key}}\n <div class="header-action">\n <i class="app-icon wi action wi-chevron-up" *ngIf="collapsible" title="{{appLocale.LABEL_COLLAPSE}}/{{appLocale.LABEL_EXPAND}}"></i>\n <span *ngIf="showcount" class="label label-default" [textContent]="groupObj.data.length"></span>\n </div>\n </h4>\n </li>\n <li *ngFor="let item of groupObj.data; let i = index;"\n [ngClass]="[\'checkbox\', \'app-checkbox\', \'group-list-item\', itemclass, itemsPerRowClass]"\n [class.active]="item.selected"\n [wmItemTemplate]="content" [userComponentParams]="item" partialContainer\n (click)="onCheckboxLabelClick($event, item)">\n \x3c!-- Default item template --\x3e\n <label *ngIf="!content" class="app-checkboxset-label" [ngClass]="{\'disabled\':disabled || readonly}" [title]="item.label">\n <input [name]="\'checkboxset_\' + widgetId" type="checkbox" aria-label="checkbox group"\n [tabindex]="tabindex"\n [disabled]="disabled || readonly" [attr.data-attr-index]="i"\n [value]="item.key" [tabindex]="tabindex" [checked]="item.selected"/>\n <span class="caption" [textContent]="item.label"></span>\n </label>\n \x3c!-- Custom partial template --\x3e\n <label *ngIf="content" class="app-checkboxset-label" [ngClass]="{\'disabled\':disabled || readonly}" >\n <input [name]="\'checkboxset_\' + widgetId" type="checkbox" aria-label="checkbox group"\n [tabindex]="tabindex"\n [disabled]="disabled || readonly" [attr.data-attr-index]="i"\n [value]="item.key" [tabindex]="tabindex" [checked]="item.selected"/>\n <span class="caption" partial-container-target></span>\n </label>\n </li>\n </ul>\n </li>\n</ng-template>\n',providers:[r.provideAs(N,i.NG_VALUE_ACCESSOR,!0),r.provideAs(N,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(N)]}]}],N.ctorParameters=function(){return[{type:t.Injector}]},N.propDecorators={onKeyDown:[{type:t.HostListener,args:["keydown.enter",["$event",'"ENTER"']]}]};var x=function(){r.register("wm-form-group",new Map([["captionposition",r.PROP_STRING],["name",r.PROP_STRING],["required",r.PROP_BOOLEAN],["show",Object.assign({value:!0},r.PROP_BOOLEAN)]]))},k={widgetType:"wm-form-group",hostClass:"form-group app-composite-widget clearfix"},M={left:"caption-left",right:"caption-right",top:"caption-top",floating:"caption-floating"},L=function(e){function t(t){var n=e.call(this,t,k)||this;return r.styler(n.nativeElement,n,r.APPLY_STYLES_TYPE.CONTAINER),n}return c(t,e),t.prototype.onPropertyChange=function(t,n,i){"captionposition"===t?a.switchClass(this.nativeElement,M[n],M[i]):"required"===t?(this.required=n,this.assignRequiredToSubComponents()):e.prototype.onPropertyChange.call(this,t,n,i)},t.prototype.assignRequiredToSubComponents=function(){var e=this;this.required&&this.componentRefs&&setTimeout((function(){e.componentRefs.forEach((function(e){return e.widget.required=!0}))}),50)},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),a.addForIdAttributes(this.nativeElement),this.assignRequiredToSubComponents()},t}(r.StylableComponent);L.initializeProps=x(),L.decorators=[{type:t.Directive,args:[{selector:"div[wmComposite]",providers:[r.provideAsWidgetRef(L)]}]}],L.ctorParameters=function(){return[{type:t.Injector}]},L.propDecorators={componentRefs:[{type:t.ContentChildren,args:[r.WidgetRef,{descendants:!0}]}]};var F=new Map([["autofocus",r.PROP_BOOLEAN],["class",r.PROP_STRING],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["hint",r.PROP_STRING],["localefilter",r.PROP_STRING],["minvalue",r.PROP_NUMBER],["maxvalue",r.PROP_NUMBER],["name",r.PROP_STRING],["numberfilter",r.PROP_STRING],["placeholder",Object.assign({value:"Enter number"},r.PROP_STRING)],["readonly",r.PROP_BOOLEAN],["regexp",r.PROP_STRING],["required",r.PROP_BOOLEAN],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["step",Object.assign({value:1},r.PROP_NUMBER)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["trailingzero",Object.assign({value:!1},r.PROP_BOOLEAN)],["updateon",r.PROP_STRING],["inputmode",Object.assign({value:"natural"},r.PROP_STRING)]]),j=function(){r.register("wm-number",F),r.registerFormWidget(a.FormWidgetType.NUMBER,new Map(F))},B=function(e){function t(t,n){var i=e.call(this,t,n)||this;i.ngModelOptions={updateOn:""};var o=i.nativeElement.getAttribute("updateon")||"blur";return o="default"===o?"change":o,i.ngModelOptions.updateOn=o,i}return c(t,e),t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("required"===t&&this._onChange(this.datavalue),"class"===t?this.inputEl.nativeElement&&a.switchClass(this.inputEl.nativeElement,n,i):"datavalue"===t?(this.updatePrevDatavalue(n),this._onChange(this.datavalue)):e.prototype.onPropertyChange.call(this,t,n,i))},t.prototype.handleChange=function(e){this.autotrim&&this.datavalue&&_.isString(this.datavalue)&&(this.datavalue=this.datavalue.trim()),this.invokeOnChange(this.datavalue,{type:"change"},this.ngModel.valid)},t.prototype.handleEvent=function(t,n,i,o){"change"!==n&&"blur"!==n&&e.prototype.handleEvent.call(this,this.inputEl.nativeElement,n,i,o)},t.prototype.handleBlur=function(e){this.invokeOnTouched(e)},t.prototype.flushViewChanges=function(e){var t=_.get(this.imask,"maskRef.unmaskedValue");e=t||e,this.ngModel.update.next(e),a.$appDigest()},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),this.class&&a.addClass(this.inputEl.nativeElement,this.class),r.styler(this.inputEl.nativeElement,this)},t}(w);B.decorators=[{type:t.Injectable}],B.ctorParameters=function(){return[{type:t.Injector},{type:void 0}]};var G=function(e){function t(t,i,o,r){var a=e.call(this,t,i)||this;return a.i18nService=o,a.trailingZeroDecimalPipe=r,a.isDefaultQuery=!0,a.decimalValue="",a.selectedLocale=o.getSelectedLocale(),a.DECIMAL=n.getLocaleNumberSymbol(a.localefilter||a.selectedLocale,n.NumberSymbol.Decimal),a.GROUP=n.getLocaleNumberSymbol(a.localefilter||a.selectedLocale,n.NumberSymbol.Group),a.numberfilter="1.0-16",a.resetValidations(),a}return c(t,e),Object.defineProperty(t.prototype,"datavalue",{get:function(){return this.proxyModel},set:function(e){if(this.lastValIsDecimal=!1,_.includes([null,void 0,""],e)){var t=this.inputEl.nativeElement,n=this.prevDatavalue;return this.displayValue=t.value=this.proxyModel=null,this.resetValidations(),void(n&&!this.isDefaultQuery&&(this.handleChange(e),this._onChange()))}if(this.isDefaultQuery){var i=_.isString(e)&&_.includes(e,this.DECIMAL),o=i?e.split(this.DECIMAL):_.isString(e)&&e.split(".");this.decimalValue=o[1]||"",e=i?e:this.transformNumber(e)}var r,a=e.toString();r=/\d/.test(a)?this.parseNumber(a):NaN,_.isNaN(r)&&a[a.length-1]===this.DECIMAL&&"change"===this.ngModelOptions.updateOn&&this.$element.find("input:focus").length&&(this.lastValIsDecimal=!0),!this.lastValIsDecimal&&this.isValid(r)?(this.proxyModel=r,this.updateDisplayText(),this.isDefaultQuery||this.handleChange(r)):(this.displayValue=e.toString(),this.proxyModel=null,this.handleChange(null))},enumerable:!1,configurable:!0}),t.prototype.resetValidations=function(){this.isInvalidNumber=!1,this.numberNotInRange=!1},t.prototype.isValid=function(e){return _.isNaN(e)||!_.isFinite(e)||!Number.isInteger(this.step)&&this.countDecimals(e)>this.countDecimals(this.step)?(this.isInvalidNumber=!0,!1):e!==this.getValueInRange(e)?(this.numberNotInRange=!0,!0):(this.resetValidations(),!0)},t.prototype.getValueInRange=function(e){return!_.isNaN(this.minvalue)&&e<this.minvalue?(this.validateType="minvalue",this.minvalue):!_.isNaN(this.maxvalue)&&e>this.maxvalue?(this.validateType="maxvalue",this.maxvalue):e},t.prototype.transformNumber=function(e,t){var n,i=t||this.numberfilter;return this.trailingZeroDecimalPipe.transform(e,this.selectedLocale,i,this.localefilter,this.trailingzero,this.decimalValue,!!t,null===(n=this.i18nService)||void 0===n?void 0:n.getwidgetLocale())},t.prototype.resetCursorPosition=function(e){var t=this.inputEl.nativeElement,n=t.value.length-e;n=n<0?0:n,t.setSelectionRange(n,n)},t.prototype.parseNumber=function(e){var t=e.split(this.inputmode===r.INPUTMODE.FINANCIAL?e.indexOf(this.DECIMAL)>-1?this.DECIMAL:".":this.DECIMAL);if(!t.length)return null;if(t.length>2)return NaN;if(""===t[1])return NaN;var n=Number(t[0].split(this.GROUP).join("")),i=Number("0."+(t[1]||0));if(Number.isNaN(n)||Number.isNaN(i))return NaN;var o=t.length>1?parseFloat((n+i).toFixed(t[1].length)):n+i;return 0===n?Object.is(0,n)?o:n-i:n>0?o:n-i},t.prototype.updateDisplayText=function(){var e=this.inputEl.nativeElement,t=e.selectionStart,n=e.value;if(!this.isDefaultQuery){var i=n.split(this.DECIMAL);this.decimalValue=i[1]||""}var o=this.stepLength();this.inputmode===r.INPUTMODE.FINANCIAL&&o?(this.displayValue=e.value=this.transformNumber(this.proxyModel,"1."+o+"-"+o),this.decimalValue=this.decimalValue.replace(/\D/g,"")):this.displayValue=e.value=this.transformNumber(this.proxyModel),"default"!==this.updateon||this.isDefaultQuery||this.resetCursorPosition(n.length-t)},t.prototype.stepLength=function(){var e=this.step.toString().split(".");return 1===e.length?void 0:e[1].length},t.prototype.isNaturalCurrency=function(){return this.inputmode===r.INPUTMODE.NATURAL&&"wm-currency"===this.widgetType&&!!this.trailingzero},t.prototype.onInputChange=function(e){var t=this.stepLength();if(a.isDefined(e)&&(""!==e||this.datavalue)&&(this.handleChange(e),t&&this.inputmode===r.INPUTMODE.FINANCIAL)){var n;if(this.isDefaultQuery)n=parseFloat(e);else n=parseInt(e.toString().replace(/\D/g,""))*this.step;_.isNaN(n)?"blur"!==this.ngModelOptions.updateOn&&(this.datavalue=void 0,this.handleChange(null)):"change"===this.ngModelOptions.updateOn?(this.datavalue=parseFloat(n.toFixed(t)),this.handleChange(this.datavalue)):this.displayValue=n.toFixed(t)}},t.prototype.checkForTrailingZeros=function(e){var t=this.stepLength(),n=!this.trailingzero&&this.inputmode===r.INPUTMODE.FINANCIAL;if(this.lastValIsDecimal&&this.onModelChange(this.displayValue),(n||this.isNaturalCurrency())&&t&&this.datavalue){var i=void 0;(n&&"focus"===e.type||this.isNaturalCurrency()&&"blur"===e.type)&&(i="1."+t+"-"+t),this.displayValue=this.transformNumber(this.datavalue,i)}},t.prototype.countDecimals=function(e){if(e%1!=0){var t=e.toString().split(".")[1];return t&&t.length}return 0},t.prototype.onArrowPress=function(e,t){if(e.preventDefault(),!this.readonly&&0!==this.step){var n,i,o=e.target.value.replace(/,/g,"");if(n=o&&!_.isNaN(parseFloat(o))?parseFloat(o):this.proxyModel,this.numberNotInRange){var r=this.parseNumber(this.inputEl.nativeElement.value);_.isNaN(r)||(i=this.getValueInRange(r),n=r,this.resetValidations())}else _.isUndefined(n)||_.isNull(n)?(n=i=this.getValueInRange(this.minvalue||0),this.resetValidations()):i=this.getValueInRange(n+("UP"===t?this.step:-this.step));if("UP"===t&&n<=i||"DOWN"===t&&n>=i){var a=Math.max(this.countDecimals(n),this.countDecimals(this.step));this.proxyModel=_.round(i,a),this.updateDisplayText(),this.handleChange(this.proxyModel)}}},t.prototype.validate=function(e){return this.isInvalidNumber?(this.validateType="",{invalidNumber:{valid:!1}}):this.numberNotInRange?{numberNotInRange:{valid:!1}}:(this.validateType="",this.show&&this.required?e.value||0===e.value?null:{required:!0}:null)},t.prototype.validateInputEntry=function(e){if(this.isDefaultQuery=!1,!e.ctrlKey&&!_.includes(["Backspace","ArrowRight","ArrowLeft","Tab","Enter","Delete"],e.key)){var t=new RegExp("^[\\d\\s-,.e+"+this.GROUP+this.DECIMAL+"]$","i"),n=e.target.value,i=this.inputmode===r.INPUTMODE.FINANCIAL;if(n)if(parseInt(n.toString().replace(/\D/g,"")).toString().length>15){var o=window.getSelection();return!(!o||!o.toString()||o.focusNode!==this.nativeElement)}return!(!i&&n&&this.countDecimals(this.step)&&this.countDecimals(n)>=this.countDecimals(this.step)&&e.target.selectionStart>=n.length-1)&&(!!t.test(e.key)&&((!_.includes(n,",")||","!==n[n.length-1]||","!==e.key)&&((!_.includes(n,this.DECIMAL)||e.key!==this.DECIMAL)&&((!_.intersection(_.toArray(n),["e","E"]).length||!_.includes("eE",e.key))&&((!_.includes(n,"+")&&!_.includes(n,"-")||"+"!==e.key&&"-"!==e.key)&&(!(!n&&"Space"===e.code)&&void 0))))))}},t.prototype.onBackspace=function(e){this.isDefaultQuery=!1},t.prototype.onEnter=function(e){this.datavalue=e.target.value},t.prototype.onModelChange=function(e){(this.inputmode===r.INPUTMODE.NATURAL||this.inputmode===r.INPUTMODE.FINANCIAL&&"blur"===this.ngModelOptions.updateOn)&&(this.datavalue=e)},t.prototype.onPropertyChange=function(t,n,i){"minvalue"===t||"maxvalue"===t?this.isValid(n):"datavalue"!==t||i?e.prototype.onPropertyChange.call(this,t,n,i):this.isNaturalCurrency()?this.checkForTrailingZeros({type:"blur"}):this.onInputChange(n)},t}(B),V={widgetType:"wm-number",hostClass:"app-input-wrapper"},U=function(e){function t(t,n,i){return e.call(this,t,V,n,i)||this}return c(t,e),t}(G);U.initializeProps=j(),U.decorators=[{type:t.Component,args:[{selector:"[wmNumber]",template:'<input class="form-control app-textbox app-number-input"\n inputmode="decimal"\n focus-target\n [attr.name]="name"\n role="textbox"\n type="text"\n [ngModel]="displayValue"\n [readonly]="readonly"\n [disabled]="disabled"\n [pattern]="regexp"\n [attr.tabindex]="tabindex"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-label]="hint"\n [autofocus]="autofocus"\n (ngModelChange)="onModelChange($event)"\n (blur)="handleBlur($event); checkForTrailingZeros($event);"\n (focus)="checkForTrailingZeros($event)"\n (input)="onInputChange($event.target.value)"\n [ngModelOptions]="ngModelOptions"\n [required]="required"\n (keypress)="validateInputEntry($event)"\n (keydown.backspace)="onBackspace($event)"\n (keydown.enter)="onEnter($event)"\n (keydown.ArrowUp)="onArrowPress($event, \'UP\')"\n (keydown.ArrowDown)="onArrowPress($event, \'DOWN\')"\n #input>\n',providers:[r.provideAs(U,i.NG_VALUE_ACCESSOR,!0),r.provideAs(U,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(U)]}]}],U.ctorParameters=function(){return[{type:t.Injector},{type:a.AbstractI18nService},{type:r.TrailingZeroDecimalPipe}]},U.propDecorators={inputEl:[{type:t.ViewChild,args:["input",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel,{static:!0}]}]};var W=new Map([["class",r.PROP_STRING],["collapsible",r.PROP_BOOLEAN],["compareby",r.PROP_STRING],["datafield",r.PROP_STRING],["dataset",Object.assign({value:"Option 1, Option 2, Option 3"},r.PROP_ANY)],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_ANY],["dateformat",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["displayexpression",r.PROP_STRING],["displayfield",r.PROP_STRING],["displayValue",r.PROP_STRING],["groupby",r.PROP_STRING],["itemclass",Object.assign({value:""},r.PROP_STRING)],["itemsperrow",Object.assign({value:"xs-1 sm-1 md-1 lg-1"},r.PROP_STRING)],["listclass",Object.assign({value:""},r.PROP_STRING)],["match",r.PROP_STRING],["name",r.PROP_STRING],["orderby",r.PROP_STRING],["readonly",r.PROP_BOOLEAN],["required",r.PROP_BOOLEAN],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["showcount",r.PROP_BOOLEAN],["showindevice",Object.assign({displayType:"inline-block",value:"all"},r.PROP_STRING)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["usekeys",r.PROP_BOOLEAN]]),q=function(){r.register("wm-radioset",W),r.registerFormWidget(a.FormWidgetType.RADIOSET,new Map(W))},z={widgetType:"wm-radioset",hostClass:"app-radioset list-group inline"},H=function(e){function t(t){var n=e.call(this,t,z)||this;return n.layout="",r.styler(n.nativeElement,n),n.multiple=!1,n}return c(t,e),t.prototype.onRadioLabelClick=function(e,t){$(e.target).is("input")&&(this.modelByKey=t,this.invokeOnTouched(),this.invokeOnChange(this.datavalue,e||{},!0))},t.prototype.handleEvent=function(t,n,i,o){"click"===n?this.eventManager.addEventListener(t,n,(function(e){if($(e.target).is("input"))return o.$event=e,i()})):_.includes(["change"],n)||e.prototype.handleEvent.call(this,t,n,i,o)},t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("itemsperrow"===t?a.setListClass(this):e.prototype.onPropertyChange.call(this,t,n,i))},t}(A);H.initializeProps=q(),H.decorators=[{type:t.Component,args:[{selector:"[wmRadioset]",exportAs:"wmRadioset",template:'<ng-template [ngIf]="!groupby" [ngIfElse]="groupedListTemplate">\n <li [ngClass]="[\'radio\', \'app-radio\', itemclass, itemsPerRowClass]"\n [class.active]="item.selected"\n *ngFor="let item of datasetItems;let i = index"\n [wmItemTemplate]="content" [userComponentParams]="item" partialContainer\n (click)="onRadioLabelClick($event, item.key)" role="presentation">\n \x3c!-- Default item template --\x3e\n <label *ngIf="!content" class="app-radioset-label"\n [ngClass]="{\'disabled\':disabled || readonly}">\n <input [name]="\'radioset_\' + widgetId" type="radio" [attr.aria-checked]="item.selected" [attr.data-attr-index]="i"\n [value]="item.key" [disabled]="disabled || readonly" [tabindex]="tabindex" [checked]="item.selected"\n [attr.aria-label]="item.key"/>\n <span class="caption" [textContent]="item.label"></span>\n </label>\n \x3c!-- Custom partial template --\x3e\n <label *ngIf="content" class="app-radioset-label"\n [ngClass]="{\'disabled\':disabled || readonly}">\n <input [name]="\'radioset_\' + widgetId" type="radio" [attr.aria-checked]="item.selected" [attr.data-attr-index]="i"\n [value]="item.key" [disabled]="disabled || readonly" [tabindex]="tabindex" [checked]="item.selected"\n [attr.aria-label]="item.key"/>\n <span class="caption customTemplate" partial-container-target></span>\n </label>\n </li>\n</ng-template>\n\n<input [disabled]="disabled || readonly" hidden class="model-holder">\n<div *ngIf="readonly || disabled" aria-readonly="true" class="readonly-wrapper"></div>\n\n\x3c!-- This template will be displayed when groupby is specified. --\x3e\n<ng-template #groupedListTemplate>\n <li *ngFor="let groupObj of groupedData" class="app-list-item-group">\n <ul class="item-group">\n <li class="list-group-header" (click)="handleHeaderClick($event)" [title]="groupObj.key" [ngClass]="{\'collapsible-content\': collapsible}">\n <h4 class="group-title">{{groupObj.key}}\n <div class="header-action">\n <i class="app-icon wi action wi-chevron-up" *ngIf="collapsible" title="{{appLocale.LABEL_COLLAPSE}}/{{appLocale.LABEL_EXPAND}}"></i>\n <span *ngIf="showcount" class="label label-default" [textContent]="groupObj.data.length"></span>\n </div>\n </h4>\n </li>\n <li *ngFor="let item of groupObj.data; let i = index;"\n [ngClass]="[\'radio\', \'app-radio\', \'group-list-item\', itemclass, itemsPerRowClass]"\n [class.active]="item.selected"\n [wmItemTemplate]="content" [userComponentParams]="item" partialContainer\n (click)="onRadioLabelClick($event, item)">\n \x3c!-- Default item template --\x3e\n <label *ngIf="!content" class="app-radioset-label"\n [ngClass]="{\'disabled\':disabled || readonly}">\n <input [name]="\'radioset_\' + widgetId" type="radio" [attr.aria-checked]="item.selected" [attr.data-attr-index]="i"\n [value]="item.key" [disabled]="disabled || readonly" [tabindex]="tabindex" [checked]="item.selected"/>\n <span class="caption" [textContent]="item.label"></span>\n </label>\n \x3c!-- Custom partial template --\x3e\n <label *ngIf="content" class="app-radioset-label"\n [ngClass]="{\'disabled\':disabled || readonly}">\n <input [name]="\'radioset_\' + widgetId" type="radio" [attr.aria-checked]="item.selected" [attr.data-attr-index]="i"\n [value]="item.key" [disabled]="disabled || readonly" [tabindex]="tabindex" [checked]="item.selected"/>\n <span class="caption customTemplate" partial-container-target></span>\n </label>\n </li>\n </ul>\n </li>\n</ng-template>\n',providers:[r.provideAs(H,i.NG_VALUE_ACCESSOR,!0),r.provideAs(H,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(H)]}]}],H.ctorParameters=function(){return[{type:t.Injector}]};var Y=new Map([["autofocus",r.PROP_BOOLEAN],["class",Object.assign({value:""},r.PROP_STRING)],["compareby",r.PROP_STRING],["datafield",r.PROP_STRING],["dataset",r.PROP_ANY],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_STRING],["dateformat",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["displayexpression",r.PROP_STRING],["displayfield",r.PROP_STRING],["displayValue",r.PROP_STRING],["groupby",r.PROP_STRING],["hint",r.PROP_STRING],["match",r.PROP_STRING],["multiple",Object.assign({value:!1},r.PROP_BOOLEAN)],["name",r.PROP_STRING],["orderby",r.PROP_STRING],["placeholder",r.PROP_STRING],["readonly",r.PROP_BOOLEAN],["required",r.PROP_BOOLEAN],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["usekeys",r.PROP_BOOLEAN]]),K=function(){r.register("wm-select",Y),r.registerFormWidget(a.FormWidgetType.SELECT,new Map(Y)),r.registerFormWidget(a.FormWidgetType.TYPEAHEAD,new Map(Y))},Q={widgetType:"wm-select",hostClass:"app-select-wrapper"},X=function(e){function t(t){var n=e.call(this,t,Q)||this;return n.acceptsArray=!0,n}return c(t,e),Object.defineProperty(t.prototype,"datasource",{set:function(e){e&&e.execute&&e.execute(a.DataSource.Operation.IS_BOUND_TO_LOCALE)&&(this.datavalue=e.execute(a.DataSource.Operation.GET_DEFAULT_LOCALE))},enumerable:!1,configurable:!0}),t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),r.styler(this.selectEl.nativeElement,this)},t.prototype.handleEvent=function(t,n,i,o){_.includes(["blur","change"],n)||e.prototype.handleEvent.call(this,this.selectEl.nativeElement,n,i,o)},t.prototype.onSelectValueChange=function(e){if(this.readonly)return this.placeholder?this.selectEl.nativeElement.value=this.placeholder:this.selectEl.nativeElement.value="",void(this.datavalue=this.prevDatavalue);this.invokeOnTouched(),this.invokeOnChange(this.datavalue,e||{},!0)},t.prototype.onPropertyChange=function(t,n,i){"required"!==t?"class"!==t&&"tabindex"!==t&&("readonly"===t&&(!0===n?a.setAttr(this.selectEl.nativeElement,"readonly","readonly"):a.removeAttr(this.selectEl.nativeElement,"readonly")),e.prototype.onPropertyChange.call(this,t,n,i)):this._onChange(this.datavalue)},t.prototype.checkForFloatingLabel=function(e){var t=$(this.selectEl.nativeElement).closest(".app-composite-widget.caption-floating");t.length>0&&("focus"===e.type&&(!this.datavalue||this.datavalue&&""===$(this.selectEl).find("select option:selected").text()&&this.placeholder)?$(this.selectEl.nativeElement).find("option:first").text(this.placeholder):this.datavalue||($(this.selectEl.nativeElement).find("option:selected").text(""),t.removeClass("float-active")))},t}(A);X.initializeProps=K(),X.decorators=[{type:t.Component,args:[{selector:"wm-select",template:'<select role="listbox" aria-haspopup="true" aria-expanded="false" #select\n focus-target\n [ngClass]="[\'app-select form-control\', class]"\n [disabled]="disabled"\n [required]="required"\n [tabindex]="tabindex"\n [(ngModel)]="modelByKey"\n [multiple]="multiple"\n (change)="onSelectValueChange($event)"\n (focus)="checkForFloatingLabel($event)"\n (blur)="invokeOnTouched($event); checkForFloatingLabel($event)"\n [attr.name]="name"\n [attr.aria-label]="hint"\n [attr.aria-multiselectable]="multiple"\n [autofocus]="autofocus"\n>\n <option selected\n value="undefined"\n [textContent]="placeholder"\n [hidden]="!placeholder"></option>\n\n <ng-container *ngIf="groupby">\n <optgroup *ngFor="let groupObj of groupedData"\n [label]="groupObj.key">\n <option *ngFor="let item of groupObj.data;"\n [value]="item.key"\n [selected]="item.selected"\n [textContent]="item.label"\n role="option"></option>\n </optgroup>\n </ng-container>\n\n <ng-container *ngIf="!groupby">\n <option *ngFor="let item of datasetItems"\n [value]="item.key"\n [selected]="item.selected"\n [textContent]="item.label"\n role="option"></option>\n </ng-container>\n</select>\n',providers:[r.provideAs(X,i.NG_VALUE_ACCESSOR,!0),r.provideAs(X,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(X)]}]}],X.ctorParameters=function(){return[{type:t.Injector}]},X.propDecorators={selectEl:[{type:t.ViewChild,args:["select",{static:!0,read:t.ElementRef}]}]};var J=new Map([["class",r.PROP_STRING],["compareby",r.PROP_STRING],["datafield",r.PROP_STRING],["dataset",Object.assign({value:"yes, no, maybe"},r.PROP_ANY)],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["displayexpression",r.PROP_STRING],["displayfield",r.PROP_STRING],["hint",r.PROP_STRING],["iconclass",r.PROP_STRING],["name",r.PROP_STRING],["orderby",r.PROP_STRING],["required",r.PROP_BOOLEAN],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)]]),Z=function(){r.register("wm-switch",J),r.registerFormWidget(a.FormWidgetType.SWITCH,new Map(J)),r.registerFormWidget(a.FormWidgetType.TOGGLE,new Map(J))},ee={widgetType:"wm-switch",hostClass:"app-switch"},te=function(e){function t(t){var n=e.call(this,t,ee)||this;n.options=[],n._debounceSetSelectedValue=a.debounce((function(e){n.setSelectedValue(),n.updateHighlighter(e),e&&a.$appDigest()}),200);var i=n.dataset$.subscribe((function(){return n.updateSwitchOptions()}));n.registerDestroyListener((function(){return i.unsubscribe()}));var o=n.datavalue$.subscribe((function(){n._debounceSetSelectedValue(!0)}));return n.registerDestroyListener((function(){return o.unsubscribe()})),n}return c(t,e),t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),r.styler(this.nativeElement,this)},t.prototype.onStyleChange=function(t,n,i){"height"===t?a.setCSS(this.nativeElement,"overflow",n?"auto":""):e.prototype.onStyleChange.call(this,t,n,i)},t.prototype.setSelectedValue=function(){a.isDefined(this.datavalue)||a.isDefined(this.toBeProcessedDatavalue)?this.selectedItem=_.find(this.datasetItems,{selected:!0}):this.selectOptAtIndex(0)},t.prototype.updateSwitchOptions=function(){this.datasetItems.length&&(this.btnwidth=100/this.datasetItems.length,a.setCSS(this.nativeElement.querySelector(".app-switch-overlay"),"width",this.btnwidth+"%")),this._debounceSetSelectedValue(!0)},t.prototype.updateHighlighter=function(e){var t=$(this.nativeElement).find("span.app-switch-overlay");this.setSelectedValue();var n,i=this.selectedItem?_.findIndex(this.datasetItems,{key:this.selectedItem.key}):-1;null==i&&(i=-1),n=i*this.btnwidth,e?t.css("left",n+"%"):t.animate({left:n+"%"},300)},t.prototype.selectOptAtIndex=function(e){if(this.datasetItems.length){var t=this.datasetItems[e];this._modelByValue=t.value}},t.prototype.selectOpt=function(e,t,n){if(e.preventDefault(),!this.disabled){if(this.modelByKey=n.key,this.invokeOnTouched(),this.selectedItem&&t===_.findIndex(this.datasetItems,{key:this.selectedItem.key})){if(2!==this.datasetItems.length)return;t=1===t?0:1}this.selectedItem=this.datasetItems[t],this.updateHighlighter(),this.invokeOnChange(this.datavalue,e||{},!0),a.$appDigest()}},t.prototype.onPropertyChange=function(t,n,i){"disabled"!==t||a.toBoolean(n)?e.prototype.onPropertyChange.call(this,t,n,i):this.nativeElement.removeAttribute(t)},t}(A);te.initializeProps=Z(),te.decorators=[{type:t.Component,args:[{selector:"[wmSwitch]",template:'<div role="group" class="btn-group btn-group-justified">\n <a *ngFor="let opt of datasetItems; let $index = index;"\n focus-target\n href="javascript:void(0);"\n class="btn btn-default"\n [name]="\'wm-switch-\' + opt.key"\n [ngClass]="{\'selected\': opt.selected, \'disabled\': disabled}"\n (click)="selectOpt($event, $index, opt)"\n >\n <i *ngIf="opt.dataObject && opt.dataObject[iconclass]" aria-hidden="true" [ngClass]="[\'app-icon\', opt.dataObject[iconclass] || opt[\'icon\']]"></i>\n <span class="caption" [textContent]="opt[displayfield] || opt.label"></span>\n </a>\n</div>\n<span [title]="selectedItem ? selectedItem.label : modelByKey"\n class="btn btn-primary app-switch-overlay switch-handle">\n <i *ngIf="iconclass"\n class="app-icon {{(selectedItem && selectedItem.dataObject) && selectedItem.dataObject[iconclass]}}"></i>\n {{selectedItem ? selectedItem.label : modelByKey}}\n</span>\n<input [name]="name" class="model-holder ng-hide" [disabled]="disabled" [value]="modelByKey" [required]="required" aria-hidden="true">\n',providers:[r.provideAs(te,i.NG_VALUE_ACCESSOR,!0),r.provideAsWidgetRef(te)],exportAs:"wmSwitch"}]}],te.ctorParameters=function(){return[{type:t.Injector}]};var ne=new Map([["autocomplete",Object.assign({value:!0},r.PROP_BOOLEAN)],["autotrim",Object.assign({value:!0},r.PROP_BOOLEAN)],["autofocus",r.PROP_BOOLEAN],["class",r.PROP_STRING],["datasource",r.PROP_ANY],["datavalue",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["hint",r.PROP_STRING],["maxvalue",r.PROP_NUMBER],["minvalue",r.PROP_NUMBER],["name",r.PROP_STRING],["placeholder",Object.assign({value:"Enter text"},r.PROP_STRING)],["readonly",r.PROP_BOOLEAN],["required",r.PROP_BOOLEAN],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["step",r.PROP_NUMBER],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["type",r.PROP_STRING],["updateon",r.PROP_STRING]]),ie=function(){r.register("wm-input-calendar",ne)},oe={widgetType:"wm-input-calendar",hostClass:"app-input-wrapper"},re=function(e){function t(t){return e.call(this,t,oe)||this}return c(t,e),t}(B);re.initializeProps=ie(),re.decorators=[{type:t.Component,args:[{selector:'wm-input[type="date"], wm-input[type="datetime-local"], wm-input[type="month"], wm-input[type="time"], wm-input[type="week"]',template:'<input class="form-control app-textbox"\n focus-target\n role="textbox"\n [type]="type"\n [attr.name]="name"\n [(ngModel)]="datavalue"\n [readonly]="readonly"\n [required]="required"\n [disabled]="disabled"\n [min]="minvalue"\n [max]="maxvalue"\n [step]="step"\n [attr.tabindex]="tabindex"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-label]="hint || type + \' field\'"\n [autofocus]="autofocus"\n (blur)="handleBlur($event)"\n (ngModelChange)="handleChange($event)"\n [autocomplete]="autocomplete ? \'on\' : \'off\'"\n #input>\n',providers:[r.provideAs(re,i.NG_VALUE_ACCESSOR,!0),r.provideAs(re,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(re)]}]}],re.ctorParameters=function(){return[{type:t.Injector}]},re.propDecorators={inputEl:[{type:t.ViewChild,args:["input",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel]}]};var ae=new Map([["autocomplete",Object.assign({value:!0},r.PROP_BOOLEAN)],["autofocus",r.PROP_BOOLEAN],["autotrim",Object.assign({value:!0},r.PROP_BOOLEAN)],["class",r.PROP_STRING],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["hint",r.PROP_STRING],["name",r.PROP_STRING],["placeholder",Object.assign({value:"Enter text"},r.PROP_STRING)],["readonly",r.PROP_BOOLEAN],["required",r.PROP_BOOLEAN],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["type",Object.assign({value:"color"},r.PROP_STRING)],["updateon",r.PROP_STRING]]),se=function(){r.register("wm-input-color",ae)},le={widgetType:"wm-input-color",hostClass:"app-input-wrapper"},ce=function(e){function t(t){return e.call(this,t,le)||this}return c(t,e),t}(B);ce.initializeProps=se(),ce.decorators=[{type:t.Component,args:[{selector:'wm-input[type="color"]',template:'<input class="form-control app-textbox"\n focus-target\n [type]="type"\n role="textbox"\n [attr.name]="name"\n [(ngModel)]="datavalue"\n [readonly]="readonly"\n [required]="required"\n [disabled]="disabled"\n [maxlength]="maxchars"\n [attr.tabindex]="tabindex"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-label]="hint"\n [autofocus]="autofocus"\n (blur)="handleBlur($event)"\n (ngModelChange)="handleChange($event)"\n #input>\n',providers:[r.provideAs(ce,i.NG_VALUE_ACCESSOR,!0),r.provideAs(ce,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(ce)]}]}],ce.ctorParameters=function(){return[{type:t.Injector}]},ce.propDecorators={inputEl:[{type:t.ViewChild,args:["input",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel]}]};var pe=new Map([["autocomplete",Object.assign({value:!0},r.PROP_BOOLEAN)],["autofocus",r.PROP_BOOLEAN],["autotrim",Object.assign({value:!0},r.PROP_BOOLEAN)],["class",r.PROP_STRING],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["hint",r.PROP_STRING],["maxchars",r.PROP_NUMBER],["name",r.PROP_STRING],["placeholder",Object.assign({value:"Enter text"},r.PROP_STRING)],["readonly",r.PROP_BOOLEAN],["regexp",r.PROP_STRING],["required",r.PROP_BOOLEAN],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["type",Object.assign({value:"email"},r.PROP_STRING)],["updateon",r.PROP_STRING]]),ue=function(){r.register("wm-input-email",pe)},de={widgetType:"wm-input-email",hostClass:"app-input-wrapper"},he=function(e){function t(t){return e.call(this,t,de)||this}return c(t,e),t}(B);he.initializeProps=ue(),he.decorators=[{type:t.Component,args:[{selector:'wm-input[type="email"]',template:'<input class="form-control app-textbox"\n focus-target\n role="textbox"\n [type]="type"\n [attr.name]="name"\n [(ngModel)]="datavalue"\n [ngModelOptions]="ngModelOptions"\n [readonly]="readonly"\n [required]="required"\n [disabled]="disabled"\n [maxlength]="maxchars"\n [pattern]="regexp"\n [attr.tabindex]="tabindex"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-label]="hint"\n [autofocus]="autofocus"\n (blur)="handleBlur($event)"\n (ngModelChange)="handleChange($event)"\n [autocomplete]="autocomplete ? \'on\' : \'off\'"\n (keyup.enter)="flushViewChanges(input.value)"\n email\n #input>\n',providers:[r.provideAs(he,i.NG_VALUE_ACCESSOR,!0),r.provideAs(he,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(he)]}]}],he.ctorParameters=function(){return[{type:t.Injector}]},he.propDecorators={inputEl:[{type:t.ViewChild,args:["input",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel]}]};var me=new Map([["autocomplete",Object.assign({value:!0},r.PROP_BOOLEAN)],["autofocus",r.PROP_BOOLEAN],["autotrim",Object.assign({value:!0},r.PROP_BOOLEAN)],["class",r.PROP_STRING],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["hint",r.PROP_STRING],["maxchars",r.PROP_NUMBER],["maxvalue",r.PROP_NUMBER],["minvalue",r.PROP_NUMBER],["name",r.PROP_STRING],["placeholder",Object.assign({value:"Enter text"},r.PROP_STRING)],["readonly",r.PROP_BOOLEAN],["regexp",r.PROP_STRING],["required",r.PROP_BOOLEAN],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["step",r.PROP_NUMBER],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["type",Object.assign({value:"number"},r.PROP_STRING)],["updateon",r.PROP_STRING]]),fe=function(){r.register("wm-input-number",me)},ge={widgetType:"wm-input-number",hostClass:"app-input-wrapper"},ve=function(e){function t(t){return e.call(this,t,ge)||this}return c(t,e),t.prototype.onArrowPress=function(e){0===this.step&&e.preventDefault()},t.prototype.validateInputEntry=function(e){if("e"===e.key&&-1!==e.target.value.indexOf(e.key))return!1},t}(B);ve.initializeProps=fe(),ve.decorators=[{type:t.Component,args:[{selector:'wm-input[type="number"]',template:'<input class="form-control app-textbox"\n [ngClass]="{\'step-hidden\': step === 0}"\n focus-target\n role="textbox"\n [type]="type"\n [attr.name]="name"\n [(ngModel)]="datavalue"\n [ngModelOptions]="ngModelOptions"\n [readonly]="readonly"\n [required]="required"\n [disabled]="disabled"\n [maxlength]="maxchars"\n [min]="minvalue"\n [max]="maxvalue"\n [step]="step"\n [attr.tabindex]="tabindex"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-label]="hint"\n [autofocus]="autofocus"\n (blur)="handleBlur($event)"\n (ngModelChange)="handleChange($event)"\n [autocomplete]="autocomplete ? \'on\' : \'off\'"\n (keyup.enter)="flushViewChanges(input.value)"\n (keydown.ArrowUp)="onArrowPress($event)"\n (keydown.ArrowDown)="onArrowPress($event)"\n (keypress)="validateInputEntry($event)"\n #input>\n',providers:[r.provideAs(ve,i.NG_VALUE_ACCESSOR,!0),r.provideAs(ve,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(ve)]}]}],ve.ctorParameters=function(){return[{type:t.Injector}]},ve.propDecorators={inputEl:[{type:t.ViewChild,args:["input",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel]}]};var ye=new Map([["autocomplete",Object.assign({value:!0},r.PROP_BOOLEAN)],["autofocus",r.PROP_BOOLEAN],["autotrim",Object.assign({value:!0},r.PROP_BOOLEAN)],["class",r.PROP_STRING],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["displayformat",r.PROP_STRING],["hint",r.PROP_STRING],["maxchars",r.PROP_NUMBER],["name",r.PROP_STRING],["placeholder",Object.assign({value:"Enter text"},r.PROP_STRING)],["readonly",r.PROP_BOOLEAN],["regexp",r.PROP_STRING],["required",r.PROP_BOOLEAN],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["showdisplayformaton",Object.assign({value:"always"},r.PROP_ANY)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["type",Object.assign({value:"text"},r.PROP_STRING)],["updateon",r.PROP_STRING]]),be=function(){r.register("wm-input-text",ye),r.registerFormWidget(a.FormWidgetType.PASSWORD,new Map(ye));var e=new Map(ye),t=function(t){t.forEach((function(t,n){return e.set(n,t)}))};t(ne),t(ae),t(pe),t(me),r.registerFormWidget(a.FormWidgetType.TEXT,new Map(e))},we={widgetType:"wm-input-text",hostClass:"app-input-wrapper"},Pe=function(e){function t(t){var n=e.call(this,t,we)||this;return n.lazy=!1,n}return c(t,e),t.prototype.onPropertyChange=function(t,n,i){switch(t){case"displayformat":this.maskVal=this.displayformat,this.checkForDisplayFormat();break;case"showdisplayformaton":this.lazy="keypress"===n;break;default:e.prototype.onPropertyChange.call(this,t,n,i)}},Object.defineProperty(t.prototype,"mask",{get:function(){return!(!this.displayformat||!(!this.placeholder||this.placeholder&&this.isFocused))&&{mask:this.maskVal,lazy:this.lazy,definitions:{9:/\d/,A:/[a-zA-Z]/,a:/[a-z]/,"*":/\w/}}},enumerable:!1,configurable:!0}),t.prototype.checkForDisplayFormat=function(e){var t=this;this.displayformat?(this.isFocused=!!(e&&"focus"===e.type||this.datavalue),!this.isFocused&&this.imask&&this.imask.maskRef?(this.imask.maskRef.updateOptions({lazy:!0}),!this.datavalue&&this.imask.maskRef.value&&(this.imask.maskRef.value=this.datavalue)):setTimeout((function(){if(t.imask&&t.imask.maskRef&&t.imask.maskRef.value){var e=t.imask.maskRef.value.indexOf("_"),n=e>=0?t.imask.maskRef.value.slice(0,e).length:t.imask.maskRef.value.length;n!==t.imask.maskRef.cursorPos&&t.imask.maskRef.updateCursor(n)}}),50)):this.imask&&this.imask.maskRef&&(this.imask.maskRef.updateOptions({lazy:!0}),this.inputEl.nativeElement.value=this.datavalue)},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.isFocused=!!this.datavalue},t}(B);Pe.initializeProps=be(),Pe.decorators=[{type:t.Component,args:[{selector:'wm-input[type="text"], wm-input:not([type]), wm-input[type="password"], wm-input[type="search"], wm-input[type="tel"], wm-input[type="url"]',template:'<input class="form-control app-textbox"\n focus-target\n role="textbox"\n [type]="type"\n [attr.name]="name"\n [attr.aria-label]="hint"\n [(ngModel)]="datavalue"\n [imask]="mask"\n [unmask]="true"\n [ngModelOptions]="ngModelOptions"\n [readonly]="readonly"\n [required]="required"\n [disabled]="disabled"\n [maxlength]="maxchars"\n [pattern]="regexp"\n [attr.tabindex]="tabindex"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [autofocus]="autofocus"\n (ngModelChange)="handleChange($event)"\n (blur)="handleBlur($event); checkForDisplayFormat($event)"\n (focus)="checkForDisplayFormat($event)"\n [autocomplete]="autocomplete ? \'on\' : \'off\'"\n (keyup.enter)="flushViewChanges(input.value)"\n #input>\n',providers:[r.provideAs(Pe,i.NG_VALUE_ACCESSOR,!0),r.provideAs(Pe,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(Pe)]}]}],Pe.ctorParameters=function(){return[{type:t.Injector}]},Pe.propDecorators={inputEl:[{type:t.ViewChild,args:["input",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel]}],imask:[{type:t.ViewChild,args:["input",{read:o.IMaskDirective}]}]};var _e=new Map([["autofocus",r.PROP_BOOLEAN],["autotrim",Object.assign({value:!0},r.PROP_BOOLEAN)],["class",r.PROP_STRING],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["hint",r.PROP_STRING],["maxchars",r.PROP_NUMBER],["name",r.PROP_STRING],["placeholder",Object.assign({value:"Place your text"},r.PROP_STRING)],["readonly",r.PROP_BOOLEAN],["required",r.PROP_BOOLEAN],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["updateon",r.PROP_STRING],["limitdisplaytext",r.PROP_STRING],["charlength",r.PROP_NUMBER]]),Oe=function(){r.register("wm-textarea",_e),r.registerFormWidget(a.FormWidgetType.TEXTAREA,new Map(_e))},Se={widgetType:"wm-textarea",hostClass:"app-input-wrapper"},Ee=function(e){function t(t){var n=e.call(this,t,Se)||this;return n.charlength=0,n}return c(t,e),t.prototype.onInputChange=function(){this.charlength=this.inputEl.nativeElement.value.length},t}(B);Ee.initializeProps=Oe(),Ee.decorators=[{type:t.Component,args:[{selector:"wm-textarea",template:'<textarea class="form-control app-textarea"\n focus-target\n role="textbox"\n [attr.name]="name"\n [(ngModel)]="datavalue"\n [ngModelOptions]="ngModelOptions"\n [readonly]="readonly"\n [required]="required"\n [disabled]="disabled"\n [maxlength]="maxchars"\n [attr.tabindex]="tabindex"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-label]="hint"\n aria-multiline="true"\n [autofocus]="autofocus"\n (blur)="handleBlur($event)"\n (input)="onInputChange()"\n (ngModelChange)="handleChange($event); onInputChange();"\n #textarea\n></textarea>\n\n<div *ngIf="maxchars" class="textarea-count" >{{limitdisplaytext}}</div>\n',providers:[r.provideAs(Ee,i.NG_VALUE_ACCESSOR,!0),r.provideAs(Ee,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(Ee)]}]}],Ee.ctorParameters=function(){return[{type:t.Injector}]},Ee.propDecorators={inputEl:[{type:t.ViewChild,args:["textarea",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel]}]};var Te=function(){function e(e,n){this.skipFloatPositionWidgets=["radioset","checkboxset","richtext","switch","chips","checkbox","slider","rating","toggle","upload"],this.elementRef=e.get(t.ElementRef),this.nativeEl=this.elementRef.nativeElement,this.app=n}return e.prototype.onBlurCb=function(){var e;this.inputEl.length>1&&this.inputEl.hasClass("mobile-input")&&_.forEach(this.inputEl,(function(t){$(t).hasClass("mobile-input")&&t.value&&(e=t.value)})),this.inputEl.val()||e||(this.compositeEle.classList.remove("float-active"),this.inputEl.removeAttr("placeholder"))},e.prototype.onFocusCb=function(){this.compositeEle.classList.add("float-active"),this.inputEl.attr("placeholder",this.placeholder)},e.prototype.checkForSelectPlaceholder=function(){!$(this.nativeEl).find("select option:selected").text()||$(this.nativeEl).find("select").is(":focus")||$(this.inputEl.closest("[widget-id]")).attr("datavalue")||$(this.nativeEl).find("select option:selected").text("")},e.prototype.setDefaultValueAnimation=function(){!this._isPlaceholderBound&&this.inputEl.attr("placeholder")&&(this.placeholder=this.inputEl.attr("placeholder"),this.inputEl.removeAttr("placeholder")),this.checkForSelectPlaceholder(),(this.inputEl.val()&&!this.inputEl.is("select")||$(this.inputEl.closest("[widget-id]")).attr("datavalue")||$(this.inputEl.parent("[widget-id]")).attr("datavalue.bind")||this.nativeEl.getAttribute("defaultvalue")||this.nativeEl.getAttribute("displayformat")||$(this.nativeEl).find("select option:selected").text()||$(this.nativeEl).find("select").attr("multiple"))&&this.compositeEle.classList.add("float-active")},e.prototype.observeForPlaceholderAttrChange=function(){var e=this;this._attrObserver=new MutationObserver((function(t){t.forEach((function(t){"placeholder"===t.attributeName&&e.inputEl.attr("placeholder")&&!e.compositeEle.classList.contains("float-active")&&(e.placeholder=e.inputEl.attr("placeholder"),e.inputEl.removeAttr("placeholder"))}))}));this._attrObserver.observe(this.inputEl[0],{attributes:!0,childList:!1,characterData:!1})},e.prototype.checkForRightAlignedForm=function(){var e=$(this.compositeEle);if(e.closest(".align-right").length&&e.find(".input-group-btn").length){var t=e.find("label");e.find("[wmdatetime]").length?t.addClass("input-grp-dt-icon"):t.addClass("input-grp-icon")}},e.prototype.ngAfterViewInit=function(){this.compositeEle=this.nativeEl;var e=this.nativeEl.widget,t=e.$attrs.get("captionposition");if(e.form&&(t=e.form.$attrs.get("captionposition"),this.compositeEle=this.nativeEl.querySelector(".app-composite-widget"),this._isPlaceholderBound=this.nativeEl.getAttribute("placeholder.bind")),"floating"===t){if(e.form){var n=this.nativeEl.getAttribute("widgettype");this.skipFloatPositionWidgets.indexOf(n)>-1&&(this.compositeEle.classList.remove("caption-floating"),this.compositeEle.classList.add("caption-top")),this.checkForRightAlignedForm()}this.inputEl=$(this.nativeEl).find("input, select, textarea"),this._isPlaceholderBound||(this._isPlaceholderBound=this.inputEl.closest("[widget-id]").attr("placeholder.bind")),setTimeout(this.setDefaultValueAnimation.bind(this),0),this.inputEl.focus(this.onFocusCb.bind(this)),this.inputEl.blur(this.onBlurCb.bind(this)),this._isPlaceholderBound&&this.observeForPlaceholderAttrChange()}},e.prototype.ngOnInit=function(){var e=this;this.labelAnimationSubscription=this.app.subscribe("captionPositionAnimate",(function(t){var n=e.inputEl&&e.inputEl.is(":focus");if(t.displayVal||t.isFocused||t.isSelectMultiple||n)t.nativeEl.addClass("float-active"),!t.displayVal&&n&&e.inputEl.attr("placeholder",e.placeholder);else if(t.nativeEl.removeClass("float-active"),e.inputEl){var i=e.inputEl.find("option:first");(e.inputEl.attr("placeholder")||i.text())&&(i.length?i.text(""):(e.placeholder=e.inputEl.attr("placeholder"),e.inputEl.removeAttr("placeholder")))}}))},e.prototype.ngOnDestroy=function(){this.labelAnimationSubscription&&this.labelAnimationSubscription(),this._attrObserver&&this._attrObserver.disconnect()},e}();Te.decorators=[{type:t.Directive,args:[{selector:"[captionPosition]"}]}],Te.ctorParameters=function(){return[{type:t.Injector},{type:a.App}]};var Re=[m,v,Te,R,N,L,U,H,X,te,re,ce,he,ve,Pe,Ee],Ae=function(){};Ae.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule,r.WmComponentsModule,o.IMaskModule],declarations:u([],p(Re)),exports:u([],p(Re)),entryComponents:[]}]}],e.BaseFormComponent=y,e.BaseFormCustomComponent=w,e.ButtonComponent=m,e.ButtonGroupDirective=v,e.CaptionPositionDirective=Te,e.CheckboxComponent=R,e.CheckboxsetComponent=N,e.CompositeDirective=L,e.DatasetAwareFormComponent=A,e.InputCalendarComponent=re,e.InputColorComponent=ce,e.InputEmailComponent=he,e.InputModule=Ae,e.InputNumberComponent=ve,e.InputTextComponent=Pe,e.NumberComponent=U,e.NumberLocale=G,e.RadiosetComponent=H,e.SelectComponent=X,e.SwitchComponent=te,e.TextareaComponent=Ee,e["\u02750"]=T,e["\u0275a"]=d,e["\u0275b"]=f,e["\u0275c"]=O,e["\u0275d"]=I,e["\u0275e"]=x,e["\u0275f"]=B,e["\u0275g"]=j,e["\u0275h"]=q,e["\u0275i"]=K,e["\u0275j"]=Z,e["\u0275k"]=ie,e["\u0275l"]=se,e["\u0275m"]=ue,e["\u0275n"]=fe,e["\u0275o"]=be,e["\u0275p"]=Oe,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@wm/core"),require("@wm/components/base"),require("@angular/common")):"function"==typeof define&&define.amd?define("@wm/components/basic",["exports","@angular/core","@wm/core","@wm/components/base","@angular/common"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.basic={}),e.ng.core,e.wm.core,e.wm.components.base,e.ng.common)}(this,(function(e,t,n,i,o){"use strict";
57
+ ***************************************************************************** */var l=function(e,t){return(l=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 c(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}l(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}Object.create;function p(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 u(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 d=function(){r.register("wm-button",new Map([["animation",r.PROP_STRING],["badgevalue",r.PROP_STRING],["caption",r.PROP_STRING],["class",r.PROP_STRING],["conditionalclass",r.PROP_ANY],["conditionalstyle",r.PROP_ANY],["disabled",r.PROP_BOOLEAN],["hint",r.PROP_STRING],["iconclass",r.PROP_STRING],["iconheight",r.PROP_STRING],["iconmargin",r.PROP_STRING],["iconposition",r.PROP_STRING],["iconurl",r.PROP_STRING],["iconwidth",r.PROP_STRING],["name",r.PROP_STRING],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["type",r.PROP_STRING]]))},h={widgetType:"wm-button",hostClass:"btn app-button",displayType:r.DISPLAY_TYPE.INLINE_BLOCK},m=function(e){function t(t){var n=e.call(this,t,h)||this;return r.styler(n.nativeElement,n),n}return c(t,e),t}(r.StylableComponent);m.initializeProps=d(),m.decorators=[{type:t.Component,args:[{selector:"button[wmButton]",template:'<img data-identifier="img" alt="button image" class="button-image-icon" [src]="iconurl | image" *ngIf="iconurl" [ngStyle]="{width:iconwidth, height:iconheight, margin:iconmargin}"/>\n<i class="app-icon {{iconclass}}" aria-hidden="true" [ngStyle]="{width:iconwidth, height:iconheight, margin:iconmargin, fontSize:iconwidth}" *ngIf="iconclass"></i>\n<span class="sr-only" *ngIf="iconclass">{{caption}} {{appLocale.LABEL_ICON}}</span>\n<span class="btn-caption" [innerHTML]="caption"></span>\n<ng-content select=".caret"></ng-content>\n<span *ngIf="badgevalue" class="badge pull-right" [textContent]="badgevalue"></span>\n',providers:[r.provideAsWidgetRef(m)],exportAs:"wmButton"}]}],m.ctorParameters=function(){return[{type:t.Injector}]},m.propDecorators={type:[{type:t.HostBinding,args:["type"]}],tabindex:[{type:t.HostBinding,args:["tabIndex"]}],disabled:[{type:t.HostBinding,args:["disabled"]}],shortcutkey:[{type:t.HostBinding,args:["attr.accesskey"]}],iconposition:[{type:t.HostBinding,args:["attr.icon-position"]}]};var f=function(){r.register("wm-buttongroup",new Map([["class",r.PROP_STRING],["name",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["vertical",r.PROP_BOOLEAN]]))},g={widgetType:"wm-buttongroup",hostClass:"btn-group app-button-group"},v=function(e){function t(t){var n=e.call(this,t,g)||this;return r.styler(n.nativeElement,n,r.APPLY_STYLES_TYPE.CONTAINER),n}return c(t,e),t.prototype.handleClick=function(e){var t=$(e.target).closest(".app-button");this.$element.find(".app-button").removeClass("selected"),t.addClass("selected")},t}(r.StylableComponent);v.initializeProps=f(),v.decorators=[{type:t.Directive,args:[{selector:"[wmButtonGroup]",providers:[r.provideAsWidgetRef(v)]}]}],v.ctorParameters=function(){return[{type:t.Injector}]},v.propDecorators={vertical:[{type:t.HostBinding,args:["class.btn-group-vertical"]}],handleClick:[{type:t.HostListener,args:["click",["$event"]]}]};var y=function(e){function t(t,n,i){var o=e.call(this,t,n,i)||this;return o.inj=t,o.binddatavalue=o.$element.attr("datavalue.bind"),o}return c(t,e),Object.defineProperty(t.prototype,"datavalue",{get:function(){return this.dataval},set:function(e){this.dataval=e},enumerable:!1,configurable:!0}),t.prototype.updateBoundVariable=function(e){var t=this.binddatavalue;this.datavaluesource&&this.datavaluesource.execute(a.DataSource.Operation.IS_API_AWARE)||this.datavaluesource&&!this.datavaluesource.twoWayBinding||!t||t.startsWith("Widgets.")||t.startsWith("itemRef.currentItemWidgets")||(t=t.replace(/\[\$i\]/g,"[0]"),_.has(this.context,t.split(".")[0])?_.set(this.context,t,e):_.set(this.viewParent,t,e))},t.prototype.invokeOnChange=function(e,t){t&&this.datavalue!==this.prevDatavalue&&(this.updateBoundVariable(e),this.invokeEventCallback("change",{$event:t,newVal:e,oldVal:this.prevDatavalue})),this.prevDatavalue=e},t.prototype.updatePrevDatavalue=function(e){this.prevDatavalue=e},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),$(this.nativeElement).parents().closest("[wmList]").length&&this.$element.keydown((function(e){37!==e.keyCode&&38!==e.keyCode&&39!==e.keyCode&&40!==e.keyCode||e.stopPropagation()}))},t}(r.StylableComponent);function b(e){return function(t){return e?function(e){switch(typeof e){case"object":return!(!e||!e.length&&!Object.keys(e).length);case"number":return!!e||0===e;default:return!(null==e||""===e)}}(t.value)?null:{required:!0}:null}}y.decorators=[{type:t.Injectable}],y.ctorParameters=function(){return[{type:t.Injector},{type:void 0},{type:Promise}]};var w=function(e){function t(){var t=e.apply(this,u([],p(arguments)))||this;return t._onChange=function(){},t._onTouched=function(){},t}return c(t,e),t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this._formControl=this.inj.get(i.FormControlName,null)},t.prototype.registerOnChange=function(e){this._onChange=e},t.prototype.registerOnTouched=function(e){this._onTouched=e},t.prototype.writeValue=function(e){this.isDestroyed||(this._formControl&&(this.datavalue=e,this.onPropertyChange("datavalue",e),this.updatePrevDatavalue(e)),e!==this.datavalue&&this._onChange(this.datavalue))},t.prototype.invokeOnChange=function(t,n,i){this._onChange(t),i&&e.prototype.invokeOnChange.call(this,t,n)},t.prototype.invokeOnTouched=function(e){this._onTouched(),e&&this.invokeEventCallback("blur",{$event:e})},t.prototype.invokeOnFocus=function(e){this.invokeEventCallback("focus",{$event:e})},t.prototype.validate=function(e){return this.show?b(this.required)(e):null},t}(y);w.decorators=[{type:t.Injectable}];var P=new Map([["caption",r.PROP_STRING],["class",r.PROP_STRING],["conditionalclass",r.PROP_ANY],["conditionalstyle",r.PROP_ANY],["checkedvalue",Object.assign({value:!0},r.PROP_STRING)],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["hint",r.PROP_STRING],["name",r.PROP_STRING],["readonly",r.PROP_BOOLEAN],["required",r.PROP_BOOLEAN],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["uncheckedvalue",Object.assign({value:!1},r.PROP_STRING)],["togglewithicon",r.PROP_BOOLEAN],["checkedicon",Object.assign({value:"wi wi-done"},r.PROP_STRING)],["uncheckedicon",Object.assign({value:"wi wi-close"},r.PROP_STRING)]]),O=function(){r.register("wm-checkbox",P),r.registerFormWidget(a.FormWidgetType.CHECKBOX,P),r.registerFormWidget(a.FormWidgetType.TOGGLE,P)},S={widgetType:"wm-checkbox",hostClass:"app-checkbox checkbox"},E=function(e,t){if(null===e)return t;if(!0===e||"true"===e)return!0;if(!1===e||"false"===e)return!1;var n=parseInt(e,10);return isNaN(n)?e:n},T=E,R=function(e){function t(t,n,i,o){var r=e.call(this,t,S)||this;return r.type=o,r._caption="&nbsp",r._checkedvalue=E(n,!0),r._uncheckedvalue=E(i,!1),a.toggleClass(r.nativeElement,"app-toggle","toggle"===o),r}return c(t,e),Object.defineProperty(t.prototype,"datavalue",{get:function(){return a.isDefined(this.proxyModel)?this.proxyModel?this._checkedvalue:this._uncheckedvalue:void 0},set:function(e){this.proxyModel=a.isDefined(e)&&""!==e?e===this._checkedvalue:void 0,this.updatePrevDatavalue(this.datavalue)},enumerable:!1,configurable:!0}),t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("required"!==t?"caption"===t?a.isDefined(n)&&""!==n?this._caption=n:this._caption="&nbsp;":"checkedvalue"===t?this._checkedvalue=E(n,!0):"uncheckedvalue"===t?this._uncheckedvalue=E(n,!1):"datavalue"===t?(this.datavalue=E(n),this._onChange(this.datavalue)):e.prototype.onPropertyChange.call(this,t,n,i):this._onChange(this.datavalue))},t.prototype.handleEvent=function(t,n,i,o){if("change"!==n&&"blur"!==n){var r="tap"===n?this.nativeElement.querySelector("label"):this.checkboxEl.nativeElement;e.prototype.handleEvent.call(this,r,n,i,o)}},t.prototype.handleChange=function(e){this.invokeOnChange(this.datavalue,{type:"change"},this.ngModel.valid)},t.prototype.getColor=function(){var e=$("div[widget-id='"+this.widgetId+"'] label");return $(e).css("background-color")},t.prototype.onMouseOver=function(){var e=$("div.app-toggle[widget-id='"+this.widgetId+"'] label"),t=$(e).css("background-color");document.documentElement.style.setProperty("--boxAfterBackColor",t)},t.prototype.onKeyDown=function(e){e.preventDefault(),this.checkboxEl.nativeElement.click()},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),r.styler(this.nativeElement.querySelector("label"),this)},t}(w);R.initializeProps=O(),R.decorators=[{type:t.Component,args:[{selector:"[wmCheckbox]",template:'<label [ngClass]="{\'unchecked\': !proxyModel, \'disabled\': (disabled || readonly), \'required\': (required && _caption)}" (mouseenter)="onMouseOver()">\n <input type="checkbox"\n role="checkbox"\n #checkbox\n [attr.name]="name"\n [attr.aria-label]="hint"\n [attr.aria-checked]="!!proxyModel"\n focus-target\n [(ngModel)]="proxyModel"\n [readonly]="readonly"\n [required]="required"\n [disabled]="disabled || readonly"\n [attr.accesskey]="shortcutkey"\n [tabindex]="tabindex"\n (blur)="invokeOnTouched($event)"\n (ngModelChange)="handleChange($event)">\n <span class="toggle_slider">\n <i class="app-icon {{checkedicon}} toggle-checked" aria-hidden="true" [ngStyle]="{width:iconwidth, height:iconheight, margin:iconmargin, color:getColor(), fontSize:iconwidth}" *ngIf="proxyModel && togglewithicon"></i>\n <i class="app-icon {{uncheckedicon}} toggle-unchecked" aria-hidden="true" [ngStyle]="{width:iconwidth, height:iconheight, margin:iconmargin, fontSize:iconwidth}" *ngIf="!proxyModel && togglewithicon"></i>\n </span>\n <span class="caption" [innerHtml]="_caption"></span>\n <img alt="Checkbox Image" aria-hidden="true" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" class="switch"/>\n</label>\n<input type="hidden" class="ng-hide model-holder" aria-hidden="true" tabindex="-1" [disabled]="disabled" [value]="proxyModel">\n',providers:[r.provideAs(R,i.NG_VALUE_ACCESSOR,!0),r.provideAs(R,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(R)]}]}],R.ctorParameters=function(){return[{type:t.Injector},{type:void 0,decorators:[{type:t.Attribute,args:["checkedvalue"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["uncheckedvalue"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["type"]}]}]},R.propDecorators={ngModel:[{type:t.ViewChild,args:[i.NgModel]}],checkboxEl:[{type:t.ViewChild,args:["checkbox",{static:!0,read:t.ElementRef}]}],onKeyDown:[{type:t.HostListener,args:["keydown.enter",["$event",'"ENTER"']]}]};var A=function(e){function t(t,n,i){var o=e.call(this,t,n)||this;return o.groupby=i,o.datasetItems=[],o.acceptsArray=!1,o.dataset$=new s.Subject,o.datavalue$=new s.Subject,o.allowempty=!0,o._debounceDatavalueUpdation=_.debounce((function(e){!a.isDefined(o._modelByKey)||_.isArray(o._modelByKey)&&!o._modelByKey.length?(o.toBeProcessedDatavalue=e,o._modelByValue=""):a.isDefined(o.toBeProcessedDatavalue)&&(a.isDefined(o._modelByValue)||(o._modelByValue=!o.multiple&&_.isArray(o.toBeProcessedDatavalue)?o.toBeProcessedDatavalue[0]:o.toBeProcessedDatavalue),o.toBeProcessedDatavalue=void 0),o.initDisplayValues()}),150),o.datePipe=o.inj.get(r.ToDatePipe),o.appDefaults=o.inj.get(a.AppDefaults),o.binddisplayexpression=o.nativeElement.getAttribute("displayexpression.bind"),o.binddisplayimagesrc=o.nativeElement.getAttribute("displayimagesrc.bind"),o.binddisplaylabel=o.nativeElement.getAttribute("displaylabel.bind"),o._debouncedInitDatasetItems=a.debounce((function(){o.initDatasetItems(),a.$appDigest()}),150),o.handleHeaderClick=a.noop,o}return c(t,e),Object.defineProperty(t.prototype,"modelByKey",{get:function(){return this._modelByKey},set:function(e){this.selectByKey(e),this.invokeOnChange(this._modelByValue)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"datavalue",{get:function(){return this._modelByValue},set:function(e){this.multiple&&(e=r.extractDataAsArray(e)),this._modelByValue=e,this.selectByValue(e),this.datavalue$.next(e),this.invokeOnChange(e,void 0,!0)},enumerable:!1,configurable:!0}),t.prototype.selectByKey=function(e){var t=this;if(this.resetDatasetItems(),this.datasetItems.length){if(this.multiple&&!_.isArray(e)&&(e=[e]),this._modelByKey=e,this.multiple)this._modelByValue=[],e.forEach((function(e){var n=_.find(t.datasetItems,(function(t){return _.toString(t.key)===_.toString(e)}));n&&(n.selected=!0,t._modelByValue=u(u([],p(t._modelByValue)),[n.value]))}));else{this._modelByValue="";var n=_.find(this.datasetItems,(function(t){return _.toString(t.key)===_.toString(e)}));n&&(n.selected=!0,this._modelByValue=n.value)}this.initDisplayValues()}},t.prototype.selectByValue=function(e){var t=this;if(this.resetDatasetItems(),!(!a.isDefined(e)||""===e||_.isNull(e)||e instanceof Array&&!e.length)||(this._modelByKey=void 0,this.allowempty&&a.isDefined(e)))if(this.acceptsArray&&!_.isArray(e)&&(e=this.allowempty?[e]:r.extractDataAsArray(e)),this.datasetItems.length||!a.isDefined(e)){var n=this.datafield===r.ALLFIELDS?"dataObject":"key";if(_.isArray(e))this._modelByKey=[],e.forEach((function(e){var i=_.find(t.datasetItems,(function(i){return"dataObject"===n&&t.compareby&&t.compareby.length?a.isEqualWithFields(i[n],e,t.compareby):_.isObject(i.value)?_.isEqual(i.value,e):_.toString(i.value).toLowerCase()===_.toString(e).toLowerCase()}));i&&(i.selected=!0,t._modelByKey.push(i.key))}));else{this._modelByKey=void 0;var i=_.find(this.datasetItems,(function(i){return"dataObject"===n&&t.compareby&&t.compareby.length?a.isEqualWithFields(i[n],e,t.compareby):_.isObject(i.value)?_.isEqual(i.value,e):_.toString(i.value).toLowerCase()===_.toString(e).toLowerCase()}));i&&(i.selected=!0,this._modelByKey=i.key)}this._debounceDatavalueUpdation(e)}else this.toBeProcessedDatavalue=e},t.prototype.initDisplayValues=function(){var e=[];this.datasetItems.forEach((function(t){t.selected&&e.push(t.label)})),this.displayValue=this.multiple?e:e[0]||""},t.prototype.initDatasetItems=function(){if(!this.dataset||_.isEmpty(this.dataset))return this.datasetItems=[],void this.dataset$.next(this.datasetItems);var e=r.getOrderedDataset(r.convertDataToObject(this.dataset),this.orderby);if(this.usekeys)this.datasetItems=r.transformDataWithKeys(e);else{var t=r.transformFormData(this.viewParent,e,this.datafield,{displayField:this.displayfield||this.displaylabel,displayExpr:this.displayexpression,bindDisplayExpr:this.binddisplayexpression||this.binddisplaylabel,bindDisplayImgSrc:this.binddisplayimagesrc,displayImgSrc:this.displayimagesrc});this.datasetItems=u([],p(r.getUniqObjsByDataField(t,this.datafield,this.displayfield||this.displaylabel,a.toBoolean(this.allowempty))))}this.postDatasetItemsInit()},t.prototype.postDatasetItemsInit=function(){if(this.datasetItems.length&&!this._defaultQueryInvoked){var e=_.isEmpty(this.toBeProcessedDatavalue)?this.datavalue:this.toBeProcessedDatavalue;this.selectByValue(e)}this.dataset$.next(this.datasetItems)},t.prototype.resetDatasetItems=function(){this.datasetItems.forEach((function(e){return e.selected=!1}))},t.prototype.setTemplate=function(e){this.content=e,this.viewParent&&this.viewParent.prefabName&&(this.prefabName=this.viewParent.prefabName)},t.prototype.getGroupedData=function(){return this.datasetItems.length?r.groupData(this,r.convertDataToObject(this.datasetItems),this.groupby,this.match,this.orderby,this.dateformat,this.datePipe,"dataObject",this.appDefaults):[]},t.prototype.datasetSubscription=function(){var e=this,t=this.dataset$.subscribe((function(){e.groupedData=e.getGroupedData()}));this.registerDestroyListener((function(){return t.unsubscribe()}))},t.prototype.setGroupData=function(){this.datasetSubscription(),this.groupedData=this.getGroupedData()},t.prototype.onPropertyChange=function(t,n,i){switch(e.prototype.onPropertyChange.call(this,t,n,i),t){case"dataset":case"datafield":case"displayfield":case"displaylabel":case"displayexpression":case"orderby":case"usekeys":this._debouncedInitDatasetItems();break;case"required":case"datavalue":this._onChange(this.datavalue);break;case"groupby":case"match":"wm-search"!==this.widgetType&&"wm-chips"!==this.widgetType&&this.setGroupData()}},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.groupby&&"wm-search"!==this.widgetType&&"wm-chips"!==this.widgetType&&this.setGroupData(),this.groupby&&this.collapsible&&(this.handleHeaderClick=r.handleHeaderClick,this.toggleAllHeaders=r.toggleAllHeaders.bind(void 0,this))},t}(w);A.decorators=[{type:t.Injectable}],A.ctorParameters=function(){return[{type:t.Injector},null,{type:String,decorators:[{type:t.Attribute,args:["groupby"]}]}]};var C=new Map([["class",r.PROP_STRING],["collapsible",r.PROP_BOOLEAN],["compareby",r.PROP_STRING],["datafield",r.PROP_STRING],["dataset",Object.assign({value:"Option 1, Option 2, Option 3"},r.PROP_ANY)],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_STRING],["dateformat",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["displayexpression",r.PROP_STRING],["displayfield",r.PROP_STRING],["displayValue",r.PROP_STRING],["groupby",r.PROP_STRING],["itemclass",Object.assign({value:""},r.PROP_STRING)],["itemsperrow",Object.assign({value:"xs-1 sm-1 md-1 lg-1"},r.PROP_STRING)],["listclass",Object.assign({value:""},r.PROP_STRING)],["match",r.PROP_STRING],["name",r.PROP_STRING],["orderby",r.PROP_STRING],["readonly",r.PROP_BOOLEAN],["required",r.PROP_BOOLEAN],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["showcount",r.PROP_BOOLEAN],["showindevice",Object.assign({displayType:"inline-block",value:"all"},r.PROP_STRING)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["usekeys",r.PROP_BOOLEAN]]),I=function(){r.register("wm-checkboxset",C),r.registerFormWidget(a.FormWidgetType.CHECKBOXSET,new Map(C))},D={widgetType:"wm-checkboxset",hostClass:"app-checkboxset list-group inline"},N=function(e){function t(t){var n=e.call(this,t,D)||this;return n.layout="",r.styler(n.nativeElement,n),n.multiple=!0,n}return c(t,e),t.prototype.onCheckboxLabelClick=function(e,t){if($(e.target).is("input")){var n=this.nativeElement.querySelectorAll("input:checked"),i=[];_.forEach(n,(function(e){i.push(e.value)})),this.modelByKey=i,this.invokeOnTouched(),this.invokeOnChange(this.datavalue,e||{},!0)}},t.prototype.handleEvent=function(t,n,i,o){"click"===n?this.eventManager.addEventListener(t,n,(function(e){if($(e.target).is("input"))return o.$event=e,i()})):_.includes(["change"],n)||e.prototype.handleEvent.call(this,t,n,i,o)},t.prototype.onKeyDown=function(e){e.preventDefault(),e.target.click()},t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("required"!==t?"itemsperrow"===t?a.setListClass(this):e.prototype.onPropertyChange.call(this,t,n,i):this._onChange(this.datavalue))},t}(A);N.initializeProps=I(),N.decorators=[{type:t.Component,args:[{selector:"[wmCheckboxset]",exportAs:"wmCheckboxset",template:'<ng-template [ngIf]="!groupby" [ngIfElse]="groupedListTemplate">\n <li [ngClass]="[\'checkbox\', \'app-checkbox\', itemclass, itemsPerRowClass]"\n [class.active]="item.selected"\n *ngFor="let item of datasetItems; let i = index"\n [wmItemTemplate]="content" [userComponentParams]="item" partialContainer\n (click)="onCheckboxLabelClick($event, item.key)" role="presentation">\n \x3c!-- Default item template --\x3e\n <label *ngIf="!content" class="app-checkboxset-label" [ngClass]="{\'disabled\':disabled || readonly}" [title]="item.label">\n <input [name]="\'checkboxset_\' + widgetId" type="checkbox" [attr.aria-label]="item.key"\n [tabindex]="tabindex" [attr.aria-checked]="item.selected"\n [disabled]="disabled || readonly" [attr.data-attr-index]="i"\n [value]="item.key" [tabindex]="tabindex" [checked]="item.selected"/>\n <span class="caption" [textContent]="item.label"></span>\n </label>\n \x3c!-- Custom partial template --\x3e\n <label *ngIf="content" class="app-checkboxset-label" [ngClass]="{\'disabled\':disabled || readonly}" >\n <input [name]="\'checkboxset_\' + widgetId" type="checkbox" [attr.aria-label]="item.key"\n [tabindex]="tabindex" [attr.aria-checked]="item.selected"\n [disabled]="disabled || readonly" [attr.data-attr-index]="i"\n [value]="item.key" [tabindex]="tabindex" [checked]="item.selected"/>\n <span class="caption customTemplate" partial-container-target></span>\n </label>\n </li>\n</ng-template>\n<input [disabled]="disabled || readonly" hidden class="model-holder">\n<div *ngIf="readonly || disabled" class="readonly-wrapper"></div>\n\n\x3c!-- This template will be displayed when groupby is specified. --\x3e\n<ng-template #groupedListTemplate>\n <li *ngFor="let groupObj of groupedData" class="app-list-item-group" role="presentation">\n <ul class="item-group">\n <li class="list-group-header" (click)="handleHeaderClick($event)" [title]="groupObj.key" [ngClass]="{\'collapsible-content\': collapsible}">\n <h4 class="group-title">{{groupObj.key}}\n <div class="header-action">\n <i class="app-icon wi action wi-chevron-up" *ngIf="collapsible" title="{{appLocale.LABEL_COLLAPSE}}/{{appLocale.LABEL_EXPAND}}"></i>\n <span *ngIf="showcount" class="label label-default" [textContent]="groupObj.data.length"></span>\n </div>\n </h4>\n </li>\n <li *ngFor="let item of groupObj.data; let i = index;"\n [ngClass]="[\'checkbox\', \'app-checkbox\', \'group-list-item\', itemclass, itemsPerRowClass]"\n [class.active]="item.selected"\n [wmItemTemplate]="content" [userComponentParams]="item" partialContainer\n (click)="onCheckboxLabelClick($event, item)">\n \x3c!-- Default item template --\x3e\n <label *ngIf="!content" class="app-checkboxset-label" [ngClass]="{\'disabled\':disabled || readonly}" [title]="item.label">\n <input [name]="\'checkboxset_\' + widgetId" type="checkbox" aria-label="checkbox group"\n [tabindex]="tabindex"\n [disabled]="disabled || readonly" [attr.data-attr-index]="i"\n [value]="item.key" [tabindex]="tabindex" [checked]="item.selected"/>\n <span class="caption" [textContent]="item.label"></span>\n </label>\n \x3c!-- Custom partial template --\x3e\n <label *ngIf="content" class="app-checkboxset-label" [ngClass]="{\'disabled\':disabled || readonly}" >\n <input [name]="\'checkboxset_\' + widgetId" type="checkbox" aria-label="checkbox group"\n [tabindex]="tabindex"\n [disabled]="disabled || readonly" [attr.data-attr-index]="i"\n [value]="item.key" [tabindex]="tabindex" [checked]="item.selected"/>\n <span class="caption" partial-container-target></span>\n </label>\n </li>\n </ul>\n </li>\n</ng-template>\n',providers:[r.provideAs(N,i.NG_VALUE_ACCESSOR,!0),r.provideAs(N,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(N)]}]}],N.ctorParameters=function(){return[{type:t.Injector}]},N.propDecorators={onKeyDown:[{type:t.HostListener,args:["keydown.enter",["$event",'"ENTER"']]}]};var x=function(){r.register("wm-form-group",new Map([["captionposition",r.PROP_STRING],["name",r.PROP_STRING],["required",r.PROP_BOOLEAN],["show",Object.assign({value:!0},r.PROP_BOOLEAN)]]))},k={widgetType:"wm-form-group",hostClass:"form-group app-composite-widget clearfix"},M={left:"caption-left",right:"caption-right",top:"caption-top",floating:"caption-floating"},L=function(e){function t(t){var n=e.call(this,t,k)||this;return r.styler(n.nativeElement,n,r.APPLY_STYLES_TYPE.CONTAINER),n}return c(t,e),t.prototype.onPropertyChange=function(t,n,i){"captionposition"===t?a.switchClass(this.nativeElement,M[n],M[i]):"required"===t?(this.required=n,this.assignRequiredToSubComponents()):e.prototype.onPropertyChange.call(this,t,n,i)},t.prototype.assignRequiredToSubComponents=function(){var e=this;this.required&&this.componentRefs&&setTimeout((function(){e.componentRefs.forEach((function(e){return e.widget.required=!0}))}),50)},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),a.addForIdAttributes(this.nativeElement),this.assignRequiredToSubComponents()},t}(r.StylableComponent);L.initializeProps=x(),L.decorators=[{type:t.Directive,args:[{selector:"div[wmComposite]",providers:[r.provideAsWidgetRef(L)]}]}],L.ctorParameters=function(){return[{type:t.Injector}]},L.propDecorators={componentRefs:[{type:t.ContentChildren,args:[r.WidgetRef,{descendants:!0}]}]};var F=new Map([["autofocus",r.PROP_BOOLEAN],["class",r.PROP_STRING],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["hint",r.PROP_STRING],["localefilter",r.PROP_STRING],["minvalue",r.PROP_NUMBER],["maxvalue",r.PROP_NUMBER],["name",r.PROP_STRING],["numberfilter",r.PROP_STRING],["placeholder",Object.assign({value:"Enter number"},r.PROP_STRING)],["readonly",r.PROP_BOOLEAN],["regexp",r.PROP_STRING],["required",r.PROP_BOOLEAN],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["step",Object.assign({value:1},r.PROP_NUMBER)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["trailingzero",Object.assign({value:!1},r.PROP_BOOLEAN)],["updateon",r.PROP_STRING],["inputmode",Object.assign({value:"natural"},r.PROP_STRING)]]),j=function(){r.register("wm-number",F),r.registerFormWidget(a.FormWidgetType.NUMBER,new Map(F))},B=function(e){function t(t,n){var i=e.call(this,t,n)||this;i.ngModelOptions={updateOn:""};var o=i.nativeElement.getAttribute("updateon")||"blur";return o="default"===o?"change":o,i.ngModelOptions.updateOn=o,i}return c(t,e),t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("required"===t&&this._onChange(this.datavalue),"class"===t?this.inputEl.nativeElement&&a.switchClass(this.inputEl.nativeElement,n,i):"datavalue"===t?(this.updatePrevDatavalue(n),this._onChange(this.datavalue)):e.prototype.onPropertyChange.call(this,t,n,i))},t.prototype.handleChange=function(e){this.autotrim&&this.datavalue&&_.isString(this.datavalue)&&(this.datavalue=this.datavalue.trim()),this.invokeOnChange(this.datavalue,{type:"change"},this.ngModel.valid)},t.prototype.handleEvent=function(t,n,i,o){"change"!==n&&"blur"!==n&&e.prototype.handleEvent.call(this,this.inputEl.nativeElement,n,i,o)},t.prototype.handleBlur=function(e){this.invokeOnTouched(e)},t.prototype.flushViewChanges=function(e){var t=_.get(this.imask,"maskRef.unmaskedValue");e=t||e,this.ngModel.update.next(e),a.$appDigest()},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),this.class&&a.addClass(this.inputEl.nativeElement,this.class),r.styler(this.inputEl.nativeElement,this)},t}(w);B.decorators=[{type:t.Injectable}],B.ctorParameters=function(){return[{type:t.Injector},{type:void 0}]};var G=function(e){function t(t,i,o,r){var a=e.call(this,t,i)||this;return a.i18nService=o,a.trailingZeroDecimalPipe=r,a.isDefaultQuery=!0,a.decimalValue="",a.selectedLocale=o.getSelectedLocale(),a.DECIMAL=n.getLocaleNumberSymbol(a.localefilter||a.selectedLocale,n.NumberSymbol.Decimal),a.GROUP=n.getLocaleNumberSymbol(a.localefilter||a.selectedLocale,n.NumberSymbol.Group),a.numberfilter="1.0-16",a.resetValidations(),a}return c(t,e),Object.defineProperty(t.prototype,"datavalue",{get:function(){return this.proxyModel},set:function(e){if(this.lastValIsDecimal=!1,_.includes([null,void 0,""],e)){var t=this.inputEl.nativeElement,n=this.prevDatavalue;return this.displayValue=t.value=this.proxyModel=null,this.resetValidations(),void(n&&!this.isDefaultQuery&&(this.handleChange(e),this._onChange()))}if(this.isDefaultQuery){var i=_.isString(e)&&_.includes(e,this.DECIMAL),o=i?e.split(this.DECIMAL):_.isString(e)&&e.split(".");this.decimalValue=o[1]||"",e=i?e:this.transformNumber(e)}var r,a=e.toString();r=/\d/.test(a)?this.parseNumber(a):NaN,_.isNaN(r)&&a[a.length-1]===this.DECIMAL&&"change"===this.ngModelOptions.updateOn&&this.$element.find("input:focus").length&&(this.lastValIsDecimal=!0),!this.lastValIsDecimal&&this.isValid(r)?(this.proxyModel=r,this.updateDisplayText(),this.isDefaultQuery||this.handleChange(r)):(this.displayValue=e.toString(),this.proxyModel=null,this.handleChange(null))},enumerable:!1,configurable:!0}),t.prototype.resetValidations=function(){this.isInvalidNumber=!1,this.numberNotInRange=!1},t.prototype.isValid=function(e){return _.isNaN(e)||!_.isFinite(e)||!Number.isInteger(this.step)&&this.countDecimals(e)>this.countDecimals(this.step)?(this.isInvalidNumber=!0,!1):e!==this.getValueInRange(e)?(this.numberNotInRange=!0,!0):(this.resetValidations(),!0)},t.prototype.getValueInRange=function(e){return!_.isNaN(this.minvalue)&&e<this.minvalue?(this.validateType="minvalue",this.minvalue):!_.isNaN(this.maxvalue)&&e>this.maxvalue?(this.validateType="maxvalue",this.maxvalue):e},t.prototype.transformNumber=function(e,t){var n,i=t||this.numberfilter;return this.trailingZeroDecimalPipe.transform(e,this.selectedLocale,i,this.localefilter,this.trailingzero,this.decimalValue,!!t,null===(n=this.i18nService)||void 0===n?void 0:n.getwidgetLocale())},t.prototype.resetCursorPosition=function(e){var t=this.inputEl.nativeElement,n=t.value.length-e;n=n<0?0:n,t.setSelectionRange(n,n)},t.prototype.parseNumber=function(e){var t=e.split(this.inputmode===r.INPUTMODE.FINANCIAL?e.indexOf(this.DECIMAL)>-1?this.DECIMAL:".":this.DECIMAL);if(!t.length)return null;if(t.length>2)return NaN;if(""===t[1])return NaN;var n=Number(t[0].split(this.GROUP).join("")),i=Number("0."+(t[1]||0));if(Number.isNaN(n)||Number.isNaN(i))return NaN;var o=t.length>1?parseFloat((n+i).toFixed(t[1].length)):n+i;return 0===n?Object.is(0,n)?o:n-i:n>0?o:n-i},t.prototype.updateDisplayText=function(){var e=this.inputEl.nativeElement,t=e.selectionStart,n=e.value;if(!this.isDefaultQuery){var i=n.split(this.DECIMAL);this.decimalValue=i[1]||""}var o=this.stepLength();this.inputmode===r.INPUTMODE.FINANCIAL&&o?(this.displayValue=e.value=this.transformNumber(this.proxyModel,"1."+o+"-"+o),this.decimalValue=this.decimalValue.replace(/\D/g,"")):this.displayValue=e.value=this.transformNumber(this.proxyModel),"default"!==this.updateon||this.isDefaultQuery||this.resetCursorPosition(n.length-t)},t.prototype.stepLength=function(){var e=this.step.toString().split(".");return 1===e.length?void 0:e[1].length},t.prototype.isNaturalCurrency=function(){return this.inputmode===r.INPUTMODE.NATURAL&&"wm-currency"===this.widgetType&&!!this.trailingzero},t.prototype.onInputChange=function(e){var t=this.stepLength();if(a.isDefined(e)&&(""!==e||this.datavalue)&&(this.handleChange(e),t&&this.inputmode===r.INPUTMODE.FINANCIAL)){var n;if(this.isDefaultQuery)n=parseFloat(e);else n=parseInt(e.toString().replace(/\D/g,""))*this.step;_.isNaN(n)?"blur"!==this.ngModelOptions.updateOn&&(this.datavalue=void 0,this.handleChange(null)):"change"===this.ngModelOptions.updateOn?(this.datavalue=parseFloat(n.toFixed(t)),this.handleChange(this.datavalue)):this.displayValue=n.toFixed(t)}},t.prototype.checkForTrailingZeros=function(e){var t=this.stepLength(),n=!this.trailingzero&&this.inputmode===r.INPUTMODE.FINANCIAL;if(this.lastValIsDecimal&&this.onModelChange(this.displayValue),(n||this.isNaturalCurrency())&&t&&this.datavalue){var i=void 0;(n&&"focus"===e.type||this.isNaturalCurrency()&&"blur"===e.type)&&(i="1."+t+"-"+t),this.displayValue=this.transformNumber(this.datavalue,i)}},t.prototype.countDecimals=function(e){if(e%1!=0){var t=e.toString().split(".")[1];return t&&t.length}return 0},t.prototype.onArrowPress=function(e,t){if(e.preventDefault(),!this.readonly&&0!==this.step){var n,i,o=e.target.value.replace(/,/g,"");if(n=o&&!_.isNaN(parseFloat(o))?parseFloat(o):this.proxyModel,this.numberNotInRange){var r=this.parseNumber(this.inputEl.nativeElement.value);_.isNaN(r)||(i=this.getValueInRange(r),n=r,this.resetValidations())}else _.isUndefined(n)||_.isNull(n)?(n=i=this.getValueInRange(this.minvalue||0),this.resetValidations()):i=this.getValueInRange(n+("UP"===t?this.step:-this.step));if("UP"===t&&n<=i||"DOWN"===t&&n>=i){var a=Math.max(this.countDecimals(n),this.countDecimals(this.step));this.proxyModel=_.round(i,a),this.updateDisplayText(),this.handleChange(this.proxyModel)}}},t.prototype.validate=function(e){return this.isInvalidNumber?(this.validateType="",{invalidNumber:{valid:!1}}):this.numberNotInRange?{numberNotInRange:{valid:!1}}:(this.validateType="",this.show&&this.required?e.value||0===e.value?null:{required:!0}:null)},t.prototype.validateInputEntry=function(e){if(this.isDefaultQuery=!1,!e.ctrlKey&&!_.includes(["Backspace","ArrowRight","ArrowLeft","Tab","Enter","Delete"],e.key)){var t=new RegExp("^[\\d\\s-,.e+"+this.GROUP+this.DECIMAL+"]$","i"),n=e.target.value,i=this.inputmode===r.INPUTMODE.FINANCIAL;if(n)if(parseInt(n.toString().replace(/\D/g,"")).toString().length>15){var o=window.getSelection();return!(!o||!o.toString()||o.focusNode!==this.nativeElement)}return!(!i&&n&&this.countDecimals(this.step)&&this.countDecimals(n)>=this.countDecimals(this.step)&&e.target.selectionStart>=n.length-1)&&(!!t.test(e.key)&&((!_.includes(n,",")||","!==n[n.length-1]||","!==e.key)&&((!_.includes(n,this.DECIMAL)||e.key!==this.DECIMAL)&&((!_.intersection(_.toArray(n),["e","E"]).length||!_.includes("eE",e.key))&&((!_.includes(n,"+")&&!_.includes(n,"-")||"+"!==e.key&&"-"!==e.key)&&(!(!n&&"Space"===e.code)&&void 0))))))}},t.prototype.onBackspace=function(e){this.isDefaultQuery=!1},t.prototype.onEnter=function(e){this.datavalue=e.target.value},t.prototype.onModelChange=function(e){(this.inputmode===r.INPUTMODE.NATURAL||this.inputmode===r.INPUTMODE.FINANCIAL&&"blur"===this.ngModelOptions.updateOn)&&(this.datavalue=e)},t.prototype.onPropertyChange=function(t,n,i){"minvalue"===t||"maxvalue"===t?this.isValid(n):"datavalue"!==t||i?e.prototype.onPropertyChange.call(this,t,n,i):this.isNaturalCurrency()?this.checkForTrailingZeros({type:"blur"}):this.onInputChange(n)},t}(B),V={widgetType:"wm-number",hostClass:"app-input-wrapper"},U=function(e){function t(t,n,i){return e.call(this,t,V,n,i)||this}return c(t,e),t}(G);U.initializeProps=j(),U.decorators=[{type:t.Component,args:[{selector:"[wmNumber]",template:'<input class="form-control app-textbox app-number-input"\n inputmode="decimal"\n focus-target\n [attr.name]="name"\n role="textbox"\n type="text"\n [ngModel]="displayValue"\n [readonly]="readonly"\n [disabled]="disabled"\n [pattern]="regexp"\n [attr.tabindex]="tabindex"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-label]="hint"\n [autofocus]="autofocus"\n (ngModelChange)="onModelChange($event)"\n (blur)="handleBlur($event); checkForTrailingZeros($event);"\n (focus)="checkForTrailingZeros($event)"\n (input)="onInputChange($event.target.value)"\n [ngModelOptions]="ngModelOptions"\n [required]="required"\n (keypress)="validateInputEntry($event)"\n (keydown.backspace)="onBackspace($event)"\n (keydown.enter)="onEnter($event)"\n (keydown.ArrowUp)="onArrowPress($event, \'UP\')"\n (keydown.ArrowDown)="onArrowPress($event, \'DOWN\')"\n #input>\n',providers:[r.provideAs(U,i.NG_VALUE_ACCESSOR,!0),r.provideAs(U,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(U)]}]}],U.ctorParameters=function(){return[{type:t.Injector},{type:a.AbstractI18nService},{type:r.TrailingZeroDecimalPipe}]},U.propDecorators={inputEl:[{type:t.ViewChild,args:["input",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel,{static:!0}]}]};var W=new Map([["class",r.PROP_STRING],["collapsible",r.PROP_BOOLEAN],["compareby",r.PROP_STRING],["datafield",r.PROP_STRING],["dataset",Object.assign({value:"Option 1, Option 2, Option 3"},r.PROP_ANY)],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_ANY],["dateformat",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["displayexpression",r.PROP_STRING],["displayfield",r.PROP_STRING],["displayValue",r.PROP_STRING],["groupby",r.PROP_STRING],["itemclass",Object.assign({value:""},r.PROP_STRING)],["itemsperrow",Object.assign({value:"xs-1 sm-1 md-1 lg-1"},r.PROP_STRING)],["listclass",Object.assign({value:""},r.PROP_STRING)],["match",r.PROP_STRING],["name",r.PROP_STRING],["orderby",r.PROP_STRING],["readonly",r.PROP_BOOLEAN],["required",r.PROP_BOOLEAN],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["showcount",r.PROP_BOOLEAN],["showindevice",Object.assign({displayType:"inline-block",value:"all"},r.PROP_STRING)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["usekeys",r.PROP_BOOLEAN]]),q=function(){r.register("wm-radioset",W),r.registerFormWidget(a.FormWidgetType.RADIOSET,new Map(W))},z={widgetType:"wm-radioset",hostClass:"app-radioset list-group inline"},H=function(e){function t(t){var n=e.call(this,t,z)||this;return n.layout="",r.styler(n.nativeElement,n),n.multiple=!1,n}return c(t,e),t.prototype.onRadioLabelClick=function(e,t){$(e.target).is("input")&&(this.modelByKey=t,this.invokeOnTouched(),this.invokeOnChange(this.datavalue,e||{},!0))},t.prototype.handleEvent=function(t,n,i,o){"click"===n?this.eventManager.addEventListener(t,n,(function(e){if($(e.target).is("input"))return o.$event=e,i()})):_.includes(["change"],n)||e.prototype.handleEvent.call(this,t,n,i,o)},t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("itemsperrow"===t?a.setListClass(this):e.prototype.onPropertyChange.call(this,t,n,i))},t}(A);H.initializeProps=q(),H.decorators=[{type:t.Component,args:[{selector:"[wmRadioset]",exportAs:"wmRadioset",template:'<ng-template [ngIf]="!groupby" [ngIfElse]="groupedListTemplate">\n <li [ngClass]="[\'radio\', \'app-radio\', itemclass, itemsPerRowClass]"\n [class.active]="item.selected"\n *ngFor="let item of datasetItems;let i = index"\n [wmItemTemplate]="content" [userComponentParams]="item" partialContainer\n (click)="onRadioLabelClick($event, item.key)" role="presentation">\n \x3c!-- Default item template --\x3e\n <label *ngIf="!content" class="app-radioset-label"\n [ngClass]="{\'disabled\':disabled || readonly}">\n <input [name]="\'radioset_\' + widgetId" type="radio" [attr.aria-checked]="item.selected" [attr.data-attr-index]="i"\n [value]="item.key" [disabled]="disabled || readonly" [tabindex]="tabindex" [checked]="item.selected"\n [attr.aria-label]="item.key"/>\n <span class="caption" [textContent]="item.label"></span>\n </label>\n \x3c!-- Custom partial template --\x3e\n <label *ngIf="content" class="app-radioset-label"\n [ngClass]="{\'disabled\':disabled || readonly}">\n <input [name]="\'radioset_\' + widgetId" type="radio" [attr.aria-checked]="item.selected" [attr.data-attr-index]="i"\n [value]="item.key" [disabled]="disabled || readonly" [tabindex]="tabindex" [checked]="item.selected"\n [attr.aria-label]="item.key"/>\n <span class="caption customTemplate" partial-container-target></span>\n </label>\n </li>\n</ng-template>\n\n<input [disabled]="disabled || readonly" hidden class="model-holder">\n<div *ngIf="readonly || disabled" aria-readonly="true" class="readonly-wrapper"></div>\n\n\x3c!-- This template will be displayed when groupby is specified. --\x3e\n<ng-template #groupedListTemplate>\n <li *ngFor="let groupObj of groupedData" class="app-list-item-group">\n <ul class="item-group">\n <li class="list-group-header" (click)="handleHeaderClick($event)" [title]="groupObj.key" [ngClass]="{\'collapsible-content\': collapsible}">\n <h4 class="group-title">{{groupObj.key}}\n <div class="header-action">\n <i class="app-icon wi action wi-chevron-up" *ngIf="collapsible" title="{{appLocale.LABEL_COLLAPSE}}/{{appLocale.LABEL_EXPAND}}"></i>\n <span *ngIf="showcount" class="label label-default" [textContent]="groupObj.data.length"></span>\n </div>\n </h4>\n </li>\n <li *ngFor="let item of groupObj.data; let i = index;"\n [ngClass]="[\'radio\', \'app-radio\', \'group-list-item\', itemclass, itemsPerRowClass]"\n [class.active]="item.selected"\n [wmItemTemplate]="content" [userComponentParams]="item" partialContainer\n (click)="onRadioLabelClick($event, item)">\n \x3c!-- Default item template --\x3e\n <label *ngIf="!content" class="app-radioset-label"\n [ngClass]="{\'disabled\':disabled || readonly}">\n <input [name]="\'radioset_\' + widgetId" type="radio" [attr.aria-checked]="item.selected" [attr.data-attr-index]="i"\n [value]="item.key" [disabled]="disabled || readonly" [tabindex]="tabindex" [checked]="item.selected"/>\n <span class="caption" [textContent]="item.label"></span>\n </label>\n \x3c!-- Custom partial template --\x3e\n <label *ngIf="content" class="app-radioset-label"\n [ngClass]="{\'disabled\':disabled || readonly}">\n <input [name]="\'radioset_\' + widgetId" type="radio" [attr.aria-checked]="item.selected" [attr.data-attr-index]="i"\n [value]="item.key" [disabled]="disabled || readonly" [tabindex]="tabindex" [checked]="item.selected"/>\n <span class="caption customTemplate" partial-container-target></span>\n </label>\n </li>\n </ul>\n </li>\n</ng-template>\n',providers:[r.provideAs(H,i.NG_VALUE_ACCESSOR,!0),r.provideAs(H,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(H)]}]}],H.ctorParameters=function(){return[{type:t.Injector}]};var Y=new Map([["autofocus",r.PROP_BOOLEAN],["class",Object.assign({value:""},r.PROP_STRING)],["compareby",r.PROP_STRING],["datafield",r.PROP_STRING],["dataset",r.PROP_ANY],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_STRING],["dateformat",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["displayexpression",r.PROP_STRING],["displayfield",r.PROP_STRING],["displayValue",r.PROP_STRING],["groupby",r.PROP_STRING],["hint",r.PROP_STRING],["match",r.PROP_STRING],["multiple",Object.assign({value:!1},r.PROP_BOOLEAN)],["name",r.PROP_STRING],["orderby",r.PROP_STRING],["placeholder",r.PROP_STRING],["readonly",r.PROP_BOOLEAN],["required",r.PROP_BOOLEAN],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["usekeys",r.PROP_BOOLEAN]]),K=function(){r.register("wm-select",Y),r.registerFormWidget(a.FormWidgetType.SELECT,new Map(Y)),r.registerFormWidget(a.FormWidgetType.TYPEAHEAD,new Map(Y))},Q={widgetType:"wm-select",hostClass:"app-select-wrapper"},X=function(e){function t(t){var n=e.call(this,t,Q)||this;return n.acceptsArray=!0,n}return c(t,e),Object.defineProperty(t.prototype,"datasource",{set:function(e){e&&e.execute&&e.execute(a.DataSource.Operation.IS_BOUND_TO_LOCALE)&&(this.datavalue=e.execute(a.DataSource.Operation.GET_DEFAULT_LOCALE))},enumerable:!1,configurable:!0}),t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),r.styler(this.selectEl.nativeElement,this)},t.prototype.handleEvent=function(t,n,i,o){_.includes(["blur","change"],n)||e.prototype.handleEvent.call(this,this.selectEl.nativeElement,n,i,o)},t.prototype.onSelectValueChange=function(e){if(this.readonly)return this.placeholder?this.selectEl.nativeElement.value=this.placeholder:this.selectEl.nativeElement.value="",void(this.datavalue=this.prevDatavalue);this.invokeOnTouched(),this.invokeOnChange(this.datavalue,e||{},!0)},t.prototype.onPropertyChange=function(t,n,i){"required"!==t?"class"!==t&&"tabindex"!==t&&("readonly"===t&&(!0===n?a.setAttr(this.selectEl.nativeElement,"readonly","readonly"):a.removeAttr(this.selectEl.nativeElement,"readonly")),e.prototype.onPropertyChange.call(this,t,n,i)):this._onChange(this.datavalue)},t.prototype.checkForFloatingLabel=function(e){var t=$(this.selectEl.nativeElement).closest(".app-composite-widget.caption-floating");t.length>0&&("focus"===e.type&&(!this.datavalue||this.datavalue&&""===$(this.selectEl).find("select option:selected").text()&&this.placeholder)?$(this.selectEl.nativeElement).find("option:first").text(this.placeholder):this.datavalue||($(this.selectEl.nativeElement).find("option:selected").text(""),t.removeClass("float-active")))},t}(A);X.initializeProps=K(),X.decorators=[{type:t.Component,args:[{selector:"wm-select",template:'<select role="listbox" aria-haspopup="true" aria-expanded="false" #select\n focus-target\n [ngClass]="[\'app-select form-control\', class]"\n [disabled]="disabled"\n [required]="required"\n [tabindex]="tabindex"\n [(ngModel)]="modelByKey"\n [multiple]="multiple"\n (change)="onSelectValueChange($event)"\n (focus)="checkForFloatingLabel($event)"\n (blur)="invokeOnTouched($event); checkForFloatingLabel($event)"\n [attr.name]="name"\n [attr.aria-label]="hint"\n [attr.aria-multiselectable]="multiple"\n [autofocus]="autofocus"\n>\n <option selected\n value="undefined"\n [textContent]="placeholder"\n [hidden]="!placeholder"></option>\n\n <ng-container *ngIf="groupby">\n <optgroup *ngFor="let groupObj of groupedData"\n [label]="groupObj.key">\n <option *ngFor="let item of groupObj.data;"\n [value]="item.key"\n [selected]="item.selected"\n [textContent]="item.label"\n role="option"></option>\n </optgroup>\n </ng-container>\n\n <ng-container *ngIf="!groupby">\n <option *ngFor="let item of datasetItems"\n [value]="item.key"\n [selected]="item.selected"\n [textContent]="item.label"\n role="option"></option>\n </ng-container>\n</select>\n',providers:[r.provideAs(X,i.NG_VALUE_ACCESSOR,!0),r.provideAs(X,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(X)]}]}],X.ctorParameters=function(){return[{type:t.Injector}]},X.propDecorators={selectEl:[{type:t.ViewChild,args:["select",{static:!0,read:t.ElementRef}]}]};var J=new Map([["class",r.PROP_STRING],["compareby",r.PROP_STRING],["datafield",r.PROP_STRING],["dataset",Object.assign({value:"yes, no, maybe"},r.PROP_ANY)],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["displayexpression",r.PROP_STRING],["displayfield",r.PROP_STRING],["hint",r.PROP_STRING],["iconclass",r.PROP_STRING],["name",r.PROP_STRING],["orderby",r.PROP_STRING],["required",r.PROP_BOOLEAN],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)]]),Z=function(){r.register("wm-switch",J),r.registerFormWidget(a.FormWidgetType.SWITCH,new Map(J)),r.registerFormWidget(a.FormWidgetType.TOGGLE,new Map(J))},ee={widgetType:"wm-switch",hostClass:"app-switch"},te=function(e){function t(t){var n=e.call(this,t,ee)||this;n.options=[],n._debounceSetSelectedValue=a.debounce((function(e){n.setSelectedValue(),n.updateHighlighter(e),e&&a.$appDigest()}),200);var i=n.dataset$.subscribe((function(){return n.updateSwitchOptions()}));n.registerDestroyListener((function(){return i.unsubscribe()}));var o=n.datavalue$.subscribe((function(){n._debounceSetSelectedValue(!0)}));return n.registerDestroyListener((function(){return o.unsubscribe()})),n}return c(t,e),t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),r.styler(this.nativeElement,this)},t.prototype.onStyleChange=function(t,n,i){"height"===t?a.setCSS(this.nativeElement,"overflow",n?"auto":""):e.prototype.onStyleChange.call(this,t,n,i)},t.prototype.setSelectedValue=function(){a.isDefined(this.datavalue)||a.isDefined(this.toBeProcessedDatavalue)?this.selectedItem=_.find(this.datasetItems,{selected:!0}):this.selectOptAtIndex(0)},t.prototype.updateSwitchOptions=function(){this.datasetItems.length&&(this.btnwidth=100/this.datasetItems.length,a.setCSS(this.nativeElement.querySelector(".app-switch-overlay"),"width",this.btnwidth+"%")),this._debounceSetSelectedValue(!0)},t.prototype.updateHighlighter=function(e){var t=$(this.nativeElement).find("span.app-switch-overlay");this.setSelectedValue();var n,i=this.selectedItem?_.findIndex(this.datasetItems,{key:this.selectedItem.key}):-1;null==i&&(i=-1),n=i*this.btnwidth,e?t.css("left",n+"%"):t.animate({left:n+"%"},300)},t.prototype.selectOptAtIndex=function(e){if(this.datasetItems.length){var t=this.datasetItems[e];this._modelByValue=t.value}},t.prototype.selectOpt=function(e,t,n){if(e.preventDefault(),!this.disabled){if(this.modelByKey=n.key,this.invokeOnTouched(),this.selectedItem&&t===_.findIndex(this.datasetItems,{key:this.selectedItem.key})){if(2!==this.datasetItems.length)return;t=1===t?0:1}this.selectedItem=this.datasetItems[t],this.updateHighlighter(),this.invokeOnChange(this.datavalue,e||{},!0),a.$appDigest()}},t.prototype.onPropertyChange=function(t,n,i){"disabled"!==t||a.toBoolean(n)?e.prototype.onPropertyChange.call(this,t,n,i):this.nativeElement.removeAttribute(t)},t}(A);te.initializeProps=Z(),te.decorators=[{type:t.Component,args:[{selector:"[wmSwitch]",template:'<div role="group" class="btn-group btn-group-justified">\n <a *ngFor="let opt of datasetItems; let $index = index;"\n focus-target\n href="javascript:void(0);"\n class="btn btn-default"\n [name]="\'wm-switch-\' + opt.key"\n [ngClass]="{\'selected\': opt.selected, \'disabled\': disabled}"\n (click)="selectOpt($event, $index, opt)"\n >\n <i *ngIf="opt.dataObject && opt.dataObject[iconclass]" aria-hidden="true" [ngClass]="[\'app-icon\', opt.dataObject[iconclass] || opt[\'icon\']]"></i>\n <span class="caption" [textContent]="opt[displayfield] || opt.label"></span>\n </a>\n</div>\n<span [title]="selectedItem ? selectedItem.label : modelByKey"\n class="btn btn-primary app-switch-overlay switch-handle">\n <i *ngIf="iconclass"\n class="app-icon {{(selectedItem && selectedItem.dataObject) && selectedItem.dataObject[iconclass]}}"></i>\n {{selectedItem ? selectedItem.label : modelByKey}}\n</span>\n<input [name]="name" class="model-holder ng-hide" [disabled]="disabled" [value]="modelByKey" [required]="required" aria-hidden="true">\n',providers:[r.provideAs(te,i.NG_VALUE_ACCESSOR,!0),r.provideAsWidgetRef(te)],exportAs:"wmSwitch"}]}],te.ctorParameters=function(){return[{type:t.Injector}]};var ne=new Map([["autocomplete",Object.assign({value:!0},r.PROP_BOOLEAN)],["autotrim",Object.assign({value:!0},r.PROP_BOOLEAN)],["autofocus",r.PROP_BOOLEAN],["class",r.PROP_STRING],["datasource",r.PROP_ANY],["datavalue",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["hint",r.PROP_STRING],["maxvalue",r.PROP_NUMBER],["minvalue",r.PROP_NUMBER],["name",r.PROP_STRING],["placeholder",Object.assign({value:"Enter text"},r.PROP_STRING)],["readonly",r.PROP_BOOLEAN],["required",r.PROP_BOOLEAN],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["step",r.PROP_NUMBER],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["type",r.PROP_STRING],["updateon",r.PROP_STRING]]),ie=function(){r.register("wm-input-calendar",ne)},oe={widgetType:"wm-input-calendar",hostClass:"app-input-wrapper"},re=function(e){function t(t){return e.call(this,t,oe)||this}return c(t,e),t}(B);re.initializeProps=ie(),re.decorators=[{type:t.Component,args:[{selector:'wm-input[type="date"], wm-input[type="datetime-local"], wm-input[type="month"], wm-input[type="time"], wm-input[type="week"]',template:'<input class="form-control app-textbox"\n focus-target\n role="textbox"\n [type]="type"\n [attr.name]="name"\n [(ngModel)]="datavalue"\n [readonly]="readonly"\n [required]="required"\n [disabled]="disabled"\n [min]="minvalue"\n [max]="maxvalue"\n [step]="step"\n [attr.tabindex]="tabindex"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-label]="hint || type + \' field\'"\n [autofocus]="autofocus"\n (blur)="handleBlur($event)"\n (ngModelChange)="handleChange($event)"\n [autocomplete]="autocomplete ? \'on\' : \'off\'"\n #input>\n',providers:[r.provideAs(re,i.NG_VALUE_ACCESSOR,!0),r.provideAs(re,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(re)]}]}],re.ctorParameters=function(){return[{type:t.Injector}]},re.propDecorators={inputEl:[{type:t.ViewChild,args:["input",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel]}]};var ae=new Map([["autocomplete",Object.assign({value:!0},r.PROP_BOOLEAN)],["autofocus",r.PROP_BOOLEAN],["autotrim",Object.assign({value:!0},r.PROP_BOOLEAN)],["class",r.PROP_STRING],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["hint",r.PROP_STRING],["name",r.PROP_STRING],["placeholder",Object.assign({value:"Enter text"},r.PROP_STRING)],["readonly",r.PROP_BOOLEAN],["required",r.PROP_BOOLEAN],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["type",Object.assign({value:"color"},r.PROP_STRING)],["updateon",r.PROP_STRING]]),se=function(){r.register("wm-input-color",ae)},le={widgetType:"wm-input-color",hostClass:"app-input-wrapper"},ce=function(e){function t(t){return e.call(this,t,le)||this}return c(t,e),t}(B);ce.initializeProps=se(),ce.decorators=[{type:t.Component,args:[{selector:'wm-input[type="color"]',template:'<input class="form-control app-textbox"\n focus-target\n [type]="type"\n role="textbox"\n [attr.name]="name"\n [(ngModel)]="datavalue"\n [readonly]="readonly"\n [required]="required"\n [disabled]="disabled"\n [maxlength]="maxchars"\n [attr.tabindex]="tabindex"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-label]="hint"\n [autofocus]="autofocus"\n (blur)="handleBlur($event)"\n (ngModelChange)="handleChange($event)"\n #input>\n',providers:[r.provideAs(ce,i.NG_VALUE_ACCESSOR,!0),r.provideAs(ce,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(ce)]}]}],ce.ctorParameters=function(){return[{type:t.Injector}]},ce.propDecorators={inputEl:[{type:t.ViewChild,args:["input",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel]}]};var pe=new Map([["autocomplete",Object.assign({value:!0},r.PROP_BOOLEAN)],["autofocus",r.PROP_BOOLEAN],["autotrim",Object.assign({value:!0},r.PROP_BOOLEAN)],["class",r.PROP_STRING],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["hint",r.PROP_STRING],["maxchars",r.PROP_NUMBER],["name",r.PROP_STRING],["placeholder",Object.assign({value:"Enter text"},r.PROP_STRING)],["readonly",r.PROP_BOOLEAN],["regexp",r.PROP_STRING],["required",r.PROP_BOOLEAN],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["type",Object.assign({value:"email"},r.PROP_STRING)],["updateon",r.PROP_STRING]]),ue=function(){r.register("wm-input-email",pe)},de={widgetType:"wm-input-email",hostClass:"app-input-wrapper"},he=function(e){function t(t){return e.call(this,t,de)||this}return c(t,e),t}(B);he.initializeProps=ue(),he.decorators=[{type:t.Component,args:[{selector:'wm-input[type="email"]',template:'<input class="form-control app-textbox"\n focus-target\n role="textbox"\n [type]="type"\n [attr.name]="name"\n [(ngModel)]="datavalue"\n [ngModelOptions]="ngModelOptions"\n [readonly]="readonly"\n [required]="required"\n [disabled]="disabled"\n [maxlength]="maxchars"\n [pattern]="regexp"\n [attr.tabindex]="tabindex"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-label]="hint"\n [autofocus]="autofocus"\n (blur)="handleBlur($event)"\n (ngModelChange)="handleChange($event)"\n [autocomplete]="autocomplete ? \'on\' : \'off\'"\n (keyup.enter)="flushViewChanges(input.value)"\n email\n #input>\n',providers:[r.provideAs(he,i.NG_VALUE_ACCESSOR,!0),r.provideAs(he,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(he)]}]}],he.ctorParameters=function(){return[{type:t.Injector}]},he.propDecorators={inputEl:[{type:t.ViewChild,args:["input",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel]}]};var me=new Map([["autocomplete",Object.assign({value:!0},r.PROP_BOOLEAN)],["autofocus",r.PROP_BOOLEAN],["autotrim",Object.assign({value:!0},r.PROP_BOOLEAN)],["class",r.PROP_STRING],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["hint",r.PROP_STRING],["maxchars",r.PROP_NUMBER],["maxvalue",r.PROP_NUMBER],["minvalue",r.PROP_NUMBER],["name",r.PROP_STRING],["placeholder",Object.assign({value:"Enter text"},r.PROP_STRING)],["readonly",r.PROP_BOOLEAN],["regexp",r.PROP_STRING],["required",r.PROP_BOOLEAN],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["step",r.PROP_NUMBER],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["type",Object.assign({value:"number"},r.PROP_STRING)],["updateon",r.PROP_STRING]]),fe=function(){r.register("wm-input-number",me)},ge={widgetType:"wm-input-number",hostClass:"app-input-wrapper"},ve=function(e){function t(t){return e.call(this,t,ge)||this}return c(t,e),t.prototype.onArrowPress=function(e){0===this.step&&e.preventDefault()},t.prototype.validateInputEntry=function(e){if("e"===e.key&&-1!==e.target.value.indexOf(e.key))return!1},t}(B);ve.initializeProps=fe(),ve.decorators=[{type:t.Component,args:[{selector:'wm-input[type="number"]',template:'<input class="form-control app-textbox"\n [ngClass]="{\'step-hidden\': step === 0}"\n focus-target\n role="textbox"\n [type]="type"\n [attr.name]="name"\n [(ngModel)]="datavalue"\n [ngModelOptions]="ngModelOptions"\n [readonly]="readonly"\n [required]="required"\n [disabled]="disabled"\n [maxlength]="maxchars"\n [min]="minvalue"\n [max]="maxvalue"\n [step]="step"\n [attr.tabindex]="tabindex"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-label]="hint"\n [autofocus]="autofocus"\n (blur)="handleBlur($event)"\n (ngModelChange)="handleChange($event)"\n [autocomplete]="autocomplete ? \'on\' : \'off\'"\n (keyup.enter)="flushViewChanges(input.value)"\n (keydown.ArrowUp)="onArrowPress($event)"\n (keydown.ArrowDown)="onArrowPress($event)"\n (keypress)="validateInputEntry($event)"\n #input>\n',providers:[r.provideAs(ve,i.NG_VALUE_ACCESSOR,!0),r.provideAs(ve,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(ve)]}]}],ve.ctorParameters=function(){return[{type:t.Injector}]},ve.propDecorators={inputEl:[{type:t.ViewChild,args:["input",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel]}]};var ye=new Map([["autocomplete",Object.assign({value:!0},r.PROP_BOOLEAN)],["autofocus",r.PROP_BOOLEAN],["autotrim",Object.assign({value:!0},r.PROP_BOOLEAN)],["class",r.PROP_STRING],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["displayformat",r.PROP_STRING],["hint",r.PROP_STRING],["maxchars",r.PROP_NUMBER],["name",r.PROP_STRING],["placeholder",Object.assign({value:"Enter text"},r.PROP_STRING)],["readonly",r.PROP_BOOLEAN],["regexp",r.PROP_STRING],["required",r.PROP_BOOLEAN],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["showdisplayformaton",Object.assign({value:"always"},r.PROP_ANY)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["type",Object.assign({value:"text"},r.PROP_STRING)],["updateon",r.PROP_STRING]]),be=function(){r.register("wm-input-text",ye),r.registerFormWidget(a.FormWidgetType.PASSWORD,new Map(ye));var e=new Map(ye),t=function(t){t.forEach((function(t,n){return e.set(n,t)}))};t(ne),t(ae),t(pe),t(me),r.registerFormWidget(a.FormWidgetType.TEXT,new Map(e))},we={widgetType:"wm-input-text",hostClass:"app-input-wrapper"},Pe=function(e){function t(t){var n=e.call(this,t,we)||this;return n.lazy=!1,n}return c(t,e),t.prototype.onPropertyChange=function(t,n,i){switch(t){case"displayformat":this.maskVal=this.displayformat,this.checkForDisplayFormat();break;case"showdisplayformaton":this.lazy="keypress"===n;break;default:e.prototype.onPropertyChange.call(this,t,n,i)}},Object.defineProperty(t.prototype,"mask",{get:function(){return!(!this.displayformat||!(!this.placeholder||this.placeholder&&this.isFocused))&&{mask:this.maskVal,lazy:this.lazy,definitions:{9:/\d/,A:/[a-zA-Z]/,a:/[a-z]/,"*":/\w/}}},enumerable:!1,configurable:!0}),t.prototype.checkForDisplayFormat=function(e){var t=this;this.displayformat?(this.isFocused=!!(e&&"focus"===e.type||this.datavalue),!this.isFocused&&this.imask&&this.imask.maskRef?(this.imask.maskRef.updateOptions({lazy:!0}),!this.datavalue&&this.imask.maskRef.value&&(this.imask.maskRef.value=this.datavalue)):setTimeout((function(){if(t.imask&&t.imask.maskRef&&t.imask.maskRef.value){var e=t.imask.maskRef.value.indexOf("_"),n=e>=0?t.imask.maskRef.value.slice(0,e).length:t.imask.maskRef.value.length;n!==t.imask.maskRef.cursorPos&&t.imask.maskRef.updateCursor(n)}}),50)):this.imask&&this.imask.maskRef&&(this.imask.maskRef.updateOptions({lazy:!0}),this.inputEl.nativeElement.value=this.datavalue)},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.isFocused=!!this.datavalue},t}(B);Pe.initializeProps=be(),Pe.decorators=[{type:t.Component,args:[{selector:'wm-input[type="text"], wm-input:not([type]), wm-input[type="password"], wm-input[type="search"], wm-input[type="tel"], wm-input[type="url"]',template:'<input class="form-control app-textbox"\n focus-target\n role="textbox"\n [type]="type"\n [attr.name]="name"\n [attr.aria-label]="hint"\n [(ngModel)]="datavalue"\n [imask]="mask"\n [unmask]="true"\n [ngModelOptions]="ngModelOptions"\n [readonly]="readonly"\n [required]="required"\n [disabled]="disabled"\n [maxlength]="maxchars"\n [pattern]="regexp"\n [attr.tabindex]="tabindex"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [autofocus]="autofocus"\n (ngModelChange)="handleChange($event)"\n (blur)="handleBlur($event); checkForDisplayFormat($event)"\n (focus)="checkForDisplayFormat($event)"\n [autocomplete]="autocomplete ? \'on\' : \'off\'"\n (keyup.enter)="flushViewChanges(input.value)"\n #input>\n',providers:[r.provideAs(Pe,i.NG_VALUE_ACCESSOR,!0),r.provideAs(Pe,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(Pe)]}]}],Pe.ctorParameters=function(){return[{type:t.Injector}]},Pe.propDecorators={inputEl:[{type:t.ViewChild,args:["input",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel]}],imask:[{type:t.ViewChild,args:["input",{read:o.IMaskDirective}]}]};var _e=new Map([["autofocus",r.PROP_BOOLEAN],["autotrim",Object.assign({value:!0},r.PROP_BOOLEAN)],["class",r.PROP_STRING],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["hint",r.PROP_STRING],["maxchars",r.PROP_NUMBER],["name",r.PROP_STRING],["placeholder",Object.assign({value:"Place your text"},r.PROP_STRING)],["readonly",r.PROP_BOOLEAN],["required",r.PROP_BOOLEAN],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["updateon",r.PROP_STRING],["limitdisplaytext",r.PROP_STRING],["charlength",r.PROP_NUMBER]]),Oe=function(){r.register("wm-textarea",_e),r.registerFormWidget(a.FormWidgetType.TEXTAREA,new Map(_e))},Se={widgetType:"wm-textarea",hostClass:"app-input-wrapper"},Ee=function(e){function t(t){var n=e.call(this,t,Se)||this;return n.charlength=0,n}return c(t,e),t.prototype.onInputChange=function(){this.charlength=this.inputEl.nativeElement.value.length},t}(B);Ee.initializeProps=Oe(),Ee.decorators=[{type:t.Component,args:[{selector:"wm-textarea",template:'<textarea class="form-control app-textarea"\n focus-target\n role="textbox"\n [attr.name]="name"\n [(ngModel)]="datavalue"\n [ngModelOptions]="ngModelOptions"\n [readonly]="readonly"\n [required]="required"\n [disabled]="disabled"\n [maxlength]="maxchars"\n [attr.tabindex]="tabindex"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-label]="hint"\n aria-multiline="true"\n [autofocus]="autofocus"\n (blur)="handleBlur($event)"\n (input)="onInputChange()"\n (ngModelChange)="handleChange($event); onInputChange();"\n #textarea\n></textarea>\n\n<div *ngIf="maxchars" class="textarea-count" >{{limitdisplaytext}}</div>\n',providers:[r.provideAs(Ee,i.NG_VALUE_ACCESSOR,!0),r.provideAs(Ee,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(Ee)]}]}],Ee.ctorParameters=function(){return[{type:t.Injector}]},Ee.propDecorators={inputEl:[{type:t.ViewChild,args:["textarea",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel]}]};var Te=function(){function e(e,n){this.skipFloatPositionWidgets=["radioset","checkboxset","richtext","switch","chips","checkbox","slider","rating","toggle","upload"],this.elementRef=e.get(t.ElementRef),this.nativeEl=this.elementRef.nativeElement,this.app=n}return e.prototype.onBlurCb=function(){var e;this.inputEl.length>1&&this.inputEl.hasClass("mobile-input")&&_.forEach(this.inputEl,(function(t){$(t).hasClass("mobile-input")&&t.value&&(e=t.value)})),this.inputEl.val()||e||(this.compositeEle.classList.remove("float-active"),this.inputEl.removeAttr("placeholder"))},e.prototype.onFocusCb=function(){this.compositeEle.classList.add("float-active"),this.inputEl.attr("placeholder",this.placeholder)},e.prototype.checkForSelectPlaceholder=function(){!$(this.nativeEl).find("select option:selected").text()||$(this.nativeEl).find("select").is(":focus")||$(this.inputEl.closest("[widget-id]")).attr("datavalue")||$(this.nativeEl).find("select option:selected").text("")},e.prototype.setDefaultValueAnimation=function(){!this._isPlaceholderBound&&this.inputEl.attr("placeholder")&&(this.placeholder=this.inputEl.attr("placeholder"),this.inputEl.removeAttr("placeholder")),this.checkForSelectPlaceholder(),(this.inputEl.val()&&!this.inputEl.is("select")||$(this.inputEl.closest("[widget-id]")).attr("datavalue")||$(this.inputEl.parent("[widget-id]")).attr("datavalue.bind")||this.nativeEl.getAttribute("defaultvalue")||this.nativeEl.getAttribute("displayformat")||$(this.nativeEl).find("select option:selected").text()||$(this.nativeEl).find("select").attr("multiple"))&&this.compositeEle.classList.add("float-active")},e.prototype.observeForPlaceholderAttrChange=function(){var e=this;this._attrObserver=new MutationObserver((function(t){t.forEach((function(t){"placeholder"===t.attributeName&&e.inputEl.attr("placeholder")&&!e.compositeEle.classList.contains("float-active")&&(e.placeholder=e.inputEl.attr("placeholder"),e.inputEl.removeAttr("placeholder"))}))}));this._attrObserver.observe(this.inputEl[0],{attributes:!0,childList:!1,characterData:!1})},e.prototype.checkForRightAlignedForm=function(){var e=$(this.compositeEle);if(e.closest(".align-right").length&&e.find(".input-group-btn").length){var t=e.find("label");e.find("[wmdatetime]").length?t.addClass("input-grp-dt-icon"):t.addClass("input-grp-icon")}},e.prototype.ngAfterViewInit=function(){this.compositeEle=this.nativeEl;var e=this.nativeEl.widget,t=e.$attrs.get("captionposition");if(e.form&&(t=e.form.$attrs.get("captionposition"),this.compositeEle=this.nativeEl.querySelector(".app-composite-widget"),this._isPlaceholderBound=this.nativeEl.getAttribute("placeholder.bind")),"floating"===t){if(e.form){var n=this.nativeEl.getAttribute("widgettype");this.skipFloatPositionWidgets.indexOf(n)>-1&&(this.compositeEle.classList.remove("caption-floating"),this.compositeEle.classList.add("caption-top")),this.checkForRightAlignedForm()}this.inputEl=$(this.nativeEl).find("input, select, textarea"),this._isPlaceholderBound||(this._isPlaceholderBound=this.inputEl.closest("[widget-id]").attr("placeholder.bind")),setTimeout(this.setDefaultValueAnimation.bind(this),0),this.inputEl.focus(this.onFocusCb.bind(this)),this.inputEl.blur(this.onBlurCb.bind(this)),this._isPlaceholderBound&&this.observeForPlaceholderAttrChange()}},e.prototype.ngOnInit=function(){var e=this;this.labelAnimationSubscription=this.app.subscribe("captionPositionAnimate",(function(t){var n=e.inputEl&&e.inputEl.is(":focus");if(t.displayVal||t.isFocused||t.isSelectMultiple||n)t.nativeEl.addClass("float-active"),!t.displayVal&&n&&e.inputEl.attr("placeholder",e.placeholder);else if(t.nativeEl.removeClass("float-active"),e.inputEl){var i=e.inputEl.find("option:first");(e.inputEl.attr("placeholder")||i.text())&&(i.length?i.text(""):(e.placeholder=e.inputEl.attr("placeholder"),e.inputEl.removeAttr("placeholder")))}}))},e.prototype.ngOnDestroy=function(){this.labelAnimationSubscription&&this.labelAnimationSubscription(),this._attrObserver&&this._attrObserver.disconnect()},e}();Te.decorators=[{type:t.Directive,args:[{selector:"[captionPosition]"}]}],Te.ctorParameters=function(){return[{type:t.Injector},{type:a.App}]};var Re=[m,v,Te,R,N,L,U,H,X,te,re,ce,he,ve,Pe,Ee],Ae=function(){};Ae.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule,r.WmComponentsModule,o.IMaskModule],declarations:u([],p(Re)),exports:u([],p(Re)),entryComponents:[]}]}],e.BaseFormComponent=y,e.BaseFormCustomComponent=w,e.ButtonComponent=m,e.ButtonGroupDirective=v,e.CaptionPositionDirective=Te,e.CheckboxComponent=R,e.CheckboxsetComponent=N,e.CompositeDirective=L,e.DatasetAwareFormComponent=A,e.InputCalendarComponent=re,e.InputColorComponent=ce,e.InputEmailComponent=he,e.InputModule=Ae,e.InputNumberComponent=ve,e.InputTextComponent=Pe,e.NumberComponent=U,e.NumberLocale=G,e.RadiosetComponent=H,e.SelectComponent=X,e.SwitchComponent=te,e.TextareaComponent=Ee,e["\u02750"]=T,e["\u0275a"]=d,e["\u0275b"]=f,e["\u0275c"]=O,e["\u0275d"]=I,e["\u0275e"]=x,e["\u0275f"]=B,e["\u0275g"]=j,e["\u0275h"]=q,e["\u0275i"]=K,e["\u0275j"]=Z,e["\u0275k"]=ie,e["\u0275l"]=se,e["\u0275m"]=ue,e["\u0275n"]=fe,e["\u0275o"]=be,e["\u0275p"]=Oe,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@wm/core"),require("@wm/components/base"),require("@angular/common")):"function"==typeof define&&define.amd?define("@wm/components/basic",["exports","@angular/core","@wm/core","@wm/components/base","@angular/common"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.basic={}),e.ng.core,e.wm.core,e.wm.components.base,e.ng.common)}(this,(function(e,t,n,i,o){"use strict";
58
58
  /*! *****************************************************************************
59
59
  Copyright (c) Microsoft Corporation.
60
60
 
@@ -124,7 +124,7 @@
124
124
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
125
125
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
126
126
  PERFORMANCE OF THIS SOFTWARE.
127
- ***************************************************************************** */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)};Object.create;function a(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function s(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 l(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 c=function(){i.register("wm-tree",new Map([["class",i.PROP_STRING],["dataset",Object.assign({value:"node1, node2, node3"},i.PROP_ANY)],["datavalue",i.PROP_STRING],["levels",Object.assign({value:0},i.PROP_NUMBER)],["name",i.PROP_STRING],["nodeaction",i.PROP_STRING],["nodechildren",i.PROP_STRING],["nodeclick",Object.assign({value:"none"},i.PROP_STRING)],["nodeicon",i.PROP_STRING],["nodeid",i.PROP_STRING],["nodelabel",i.PROP_STRING],["orderby",i.PROP_STRING],["show",Object.assign({value:!0},i.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},i.PROP_NUMBER)],["treeicons",i.PROP_STRING]]))},p={widgetType:"wm-tree",hostClass:"app-tree"},u="plus-minus",d=function(e){function t(t){var n=e.call(this,t,p)||this;return n.setting={data:{simpleData:{enable:!1},key:{children:"children",name:"label"}},view:{dblClickExpand:!1,fontCss:{"font-awesome":!0},switchIcon:{}},check:{},callback:{}},i.styler(n.nativeElement,n,i.APPLY_STYLES_TYPE.CONTAINER),n}return function(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)}(t,e),t.prototype.onPropertyChange=function(t,n,i){switch(t){case"dataset":this.nodes=this.getNodes(n),this.level>0&&this.expandTree(this.level,this.nodes,0),this.renderTree();break;case"levels":n>0&&(this.level=n),this.renderTree();break;case"treeicons":this.treeicon=n,this.renderTree();break;case"nodelabel":this.setting.data.key.name=this.labelKey,this.renderTree();break;case"nodechildren":this.setting.data.key.children=this.childrenKey,this.renderTree();break;case"nodeicon":this.nodeicon=this.iconKey,this.renderTree();break;case"orderby":this.renderTree();break;case"class":this.treeClass=n,this.renderTree();break;default:e.prototype.onPropertyChange.call(this,t,n,i)}},t.prototype.expandTree=function(e,t,n){var i=this;t.map((function(t){var o=i.getChildren(t);o&&!("open"in t)&&n<e?(t.open=!0,i.expandTree(e,o,n+1)):n=0}))},t.prototype.setTreeTemplate=function(e){"Classic"===e?this.setting.check.enable=!1:"Checkbox"===e?(this.setting.check.enable=!0,this.setting.check.chkStyle="checkbox"):"Radio"===e&&(this.setting.check.enable=!0,this.setting.check.chkStyle="radio",this.setting.check.radioType="all")},t.prototype.getNodesFromString=function(e){return e.split(",").map((function(e){return{label:e&&e.trim()}}))},t.prototype.getNodes=function(e){var t;return _.isArray(e)?t=i.getOrderedDataset(e,this.orderby):_.isObject(e)?t=[e]:_.isString(e)&&!_.isEmpty(e)&&(e=e.trim())&&(t=this.getNodesFromString(e)),t},t.prototype.setNodeclasses=function(e,t){return t.icon?{add:[""+t.icon]}:""},t.prototype.setNodeData=function(e,t,n,i,o){var r=this;0===t?e.map((function(e){var a=r.getChildren(e);if(a&&r.setNodeData(a,t,n,i,o),e.icon&&"icon"==r.nodelabel)e[o]=e.icon;else{if(!e.name||"name"!=r.nodelabel)return;e[o]=e.name}})):e.map((function(e){var a=r.getChildren(e);return a&&n>1&&(t===n&&(i=e),r.setNodeData(a,t,n-1,i,o)),1===n&&("name"===o?r.nodelabel.includes("label")||r.nodelabel.includes("name"):r.nodeicon.includes("label")||r.nodeicon.includes("name"))?void(i[o]=e.name||e.label):1===n&&void 0!==e.icon&&("name"===o?r.nodelabel.includes("icon"):r.nodeicon.includes("icon"))?void(i[o]=e.icon):void 0}))},t.prototype.changeTreeIcons=function(e){var t=$('ul[name="'+this.name+'"] li span.button.switch');$(t).map((function(t,n){$(n).addClass(e),$(n).on("click",(function(t){setTimeout((function(){$(n).addClass(e)}),0)}))}))},t.prototype.getPath=function(e,t){return t=null===e.getParentNode()?"/"+e[this.labelKey]+t:this.getPath(e.getParentNode(),t)+"/"+e[this.labelKey]},t.prototype.onClick=function(e,t,n,i){if("expand"===this.nodeclick){var o=this.treeObj.getSelectedNodes();o.length>0&&this.expandNode(o[0],!o[0].open,!0)}var r={$event:e,$item:n,$path:this.getPath(n,"")};this.setSelectedItem(n),this.invokeEventCallback("select",r)},t.prototype.onExpand=function(e,t,n){var i=this,o={$event:e,$item:n,$path:this.getPath(n,"")};this.invokeEventCallback("expand",o);var r=this.getChildren(n);null==r||r.map((function(e){if(e.isParent){var t=$("#"+e.tId+"_switch");$(t).addClass(i.treeicon||u),$(t).on("click",(function(e){setTimeout((function(){$(t).addClass(i.treeicon||u)}),0)}))}}))},t.prototype.onCollapse=function(e,t,n){var i={$event:e,$item:n,$path:this.getPath(n,"")};this.invokeEventCallback("collapse",i)},t.prototype.getChildren=function(e){return e[this.childrenKey]},Object.defineProperty(t.prototype,"childrenKey",{get:function(){return this.nodechildren?this.countDepth(this.nodechildren)?this.nodechildren.split(".").pop():this.nodechildren:"children"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"labelKey",{get:function(){return this.nodelabel?this.countDepth(this.nodelabel)?this.nodelabel.split(".").pop():this.nodelabel:"label"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"iconKey",{get:function(){return this.nodeicon?this.countDepth(this.nodeicon)?this.nodeicon.split(".").pop():this.nodeicon:"icon"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"treeObj",{get:function(){return $.fn.zTree.getZTreeObj(""+this.name)},enumerable:!1,configurable:!0}),t.prototype.modifyObjects=function(e){var t=this;e.forEach((function(e){e.icon=e[t.nodeicon];var n=t.getChildren(e);(null==n?void 0:n.length)&&t.modifyObjects(n)}))},t.prototype.setNodeChildren=function(e,t,n,i){var o=this;if(t<=0)return e;for(var r=0;r<e.length;r++){var a=e[r];t===n&&(i=e[r]);var s=this.getChildren(a);if(null==s?void 0:s.length){if(1===n)return void(i[this.childrenKey]=s.map((function(e){var t;return(t={})[o.labelKey]=e[o.labelKey],t[o.childrenKey]=o.getChildren(e),t.icon=e[o.iconKey],t})));this.setNodeChildren(s,t,n-1,i)}}return e},t.prototype.countDepth=function(e){var t,n,i=e.match(/\[.*?\]/g),o=1;if(null===i)return o;try{for(var r=a(i),s=r.next();!s.done;s=r.next()){s.value;o++}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return o},t.prototype.renderTree=function(){if(this.nodes){if(this.nativeElement.setAttribute("id",this.name),this.nodeicon&&"icon"!==this.nodeicon&&this.modifyObjects(this.nodes),this.setTreeTemplate(this.treeClass),this.nodelabel){var e=0;this.nodelabel.includes("children")&&(e=this.countDepth(this.nodelabel)),this.setNodeData(this.nodes,e,e,null,"name")}if(this.nodeicon){e=0;this.nodeicon.includes("children")&&(e=this.countDepth(this.nodeicon)),this.setNodeData(this.nodes,e,e,null,"icon")}if(this.nodechildren)(e=this.countDepth(this.nodechildren))>1&&(this.nodes=this.setNodeChildren(this.nodes,e,e,null))}this.setting.view.nodeClasses=this.setNodeclasses,this.setting.callback.onClick=this.onClick.bind(this),this.setting.callback.onExpand=this.onExpand.bind(this),this.setting.callback.onCollapse=this.onCollapse.bind(this);var t=$.fn.zTree.init($('ul[name="'+this.name+'"]'),this.setting,this.nodes);$.fn.zTreeKeyboardNavigation(t,$('ul[name="'+this.name+'"]'),null,this.treeicon||u)},t.prototype.setSelectedItem=function(e){this.selecteditem=o.getClonedObject(e)||{},this.selecteditem.path=this.getPath(e,""),$("li[treenode].selected").removeClass("selected"),$("#"+e.tId+":has(.curSelectedNode)").addClass("selected")},t.prototype.expandNode=function(e,t,n){this.treeObj.expandNode(e,t,!1,!1,n);var i=$("#"+e.tId+"_switch");$(i).addClass(this.treeicon||u)},t.prototype.ngAfterViewInit=function(){var e=this;setTimeout((function(){if(e.changeTreeIcons(e.treeicon||u),e.datavalue){var t=e.treeObj.getNodes(),n=void 0;"FirstNode"===e.datavalue&&t.length&&(n=t[0]),"LastNode"===e.datavalue&&t.length&&(n=t[t.length-1]),e.treeObj.selectNode(n,!1),e.setSelectedItem(n),e.expandNode(n,!0,!1)}}),200)},t}(i.StylableComponent);d.initializeProps=c(),d.decorators=[{type:t.Component,args:[{selector:"ul[wmTree]",template:'<ul #wmTree class="ztree" id="ztree"></ul> ',providers:[i.provideAsWidgetRef(d)],encapsulation:t.ViewEncapsulation.None}]}],d.ctorParameters=function(){return[{type:t.Injector}]};var h=[d],m=function(){};m.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.WmComponentsModule],declarations:l([],s(h)),exports:l([],s(h)),entryComponents:[]}]}],e.TreeComponent=d,e.TreeModule=m,e["\u0275a"]=c,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@angular/forms"),require("ngx-bootstrap/datepicker"),require("@wm/core"),require("@wm/components/base")):"function"==typeof define&&define.amd?define("@wm/components/input/calendar",["exports","@angular/core","@angular/common","@angular/forms","ngx-bootstrap/datepicker","@wm/core","@wm/components/base"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.input=e.wm.components.input||{},e.wm.components.input.calendar={}),e.ng.core,e.ng.common,e.ng.forms,e["ngx-bootstrap"].datepicker,e.wm.core,e.wm.components.base)}(this,(function(e,t,n,i,o,r,a){"use strict";
127
+ ***************************************************************************** */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)};Object.create;function a(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 s(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 l=function(){i.register("wm-tree",new Map([["class",i.PROP_STRING],["dataset",Object.assign({value:"node1, node2, node3"},i.PROP_ANY)],["datavalue",i.PROP_STRING],["levels",Object.assign({value:0},i.PROP_NUMBER)],["name",i.PROP_STRING],["nodeaction",i.PROP_STRING],["nodechildren",i.PROP_STRING],["nodeclick",Object.assign({value:"none"},i.PROP_STRING)],["nodeicon",i.PROP_STRING],["nodeid",i.PROP_STRING],["nodelabel",i.PROP_STRING],["orderby",i.PROP_STRING],["show",Object.assign({value:!0},i.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},i.PROP_NUMBER)],["treeicons",i.PROP_STRING]]))},c={widgetType:"wm-tree",hostClass:"app-tree"},p="plus-minus",u=function(e){function t(t,n,o,r,a,s){var l=e.call(this,t,c)||this;return l.binddatavalue=n,l.bindnodelabel=o,l.bindnodeicon=r,l.bindnodechildren=a,l.bindnodeid=s,l.setting={data:{simpleData:{enable:!1}},view:{dblClickExpand:!1,fontCss:{"font-awesome":!0},switchIcon:{}},check:{},callback:{}},i.styler(l.nativeElement,l,i.APPLY_STYLES_TYPE.CONTAINER),l.setting.view.nodeClasses=l.setNodeClasses,l.setting.callback.onClick=l.onClick.bind(l),l.setting.callback.onExpand=l.onExpand.bind(l),l.setting.callback.onCollapse=l.onCollapse.bind(l),l}return function(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)}(t,e),t.prototype.onPropertyChange=function(t,n,i){switch(t){case"dataset":this.nodes=this.getNodes(n),this.renderTree();break;case"levels":this.level=n,this.renderTree();break;case"nodeicon":this.nodeicon=n,this.renderTree();break;case"nodelabel":this.nodelabel=n,this.renderTree();break;case"nodechildren":this.nodechildren=n,this.renderTree();break;case"orderby":this.orderby=n,this.renderTree();break;case"treeicons":this.treeicons=n,this.renderTree();break;case"class":this.treeClass=n,this.setTreeTemplate(this.treeClass),this.renderTree();default:e.prototype.onPropertyChange.call(this,t,n,i)}},t.prototype.expandTree=function(e,t,n){var i=this;t.map((function(t){var o=t.children;o&&n<e?(t.open=!0,i.expandTree(e,o,n+1)):n=0}))},t.prototype.setTreeTemplate=function(e){var t=e.split(" ");t.includes("Classic")?this.setting.check.enable=!1:t.includes("Checkbox")?(this.setting.check.enable=!0,this.setting.check.chkStyle="checkbox"):t.includes("Radio")&&(this.setting.check.enable=!0,this.setting.check.chkStyle="radio",this.setting.check.radioType="all")},t.prototype.getNodesFromString=function(e){return e.split(",").map((function(e){return{label:e&&e.trim()}}))},t.prototype.getNodes=function(e){var t;return _.isArray(e)?t=i.getOrderedDataset(e,this.orderby):_.isObject(e)?t=[e]:_.isString(e)&&!_.isEmpty(e)&&(e=e.trim())&&(t=this.getNodesFromString(e)),t},t.prototype.setNodeClasses=function(e,t){return t.icon?{add:[""+t.icon]}:""},t.prototype.changeTreeIcons=function(e){var t=$('ul[name="'+this.name+'"] li span.button.switch');$(t).map((function(t,n){$(n).addClass(e),$(n).on("click",(function(t){setTimeout((function(){$(n).addClass(e)}),0)}))}))},t.prototype.getPath=function(e,t){return t=null===e.getParentNode()?"/"+e.name+t:this.getPath(e.getParentNode(),t)+"/"+e.name},t.prototype.onClick=function(e,t,n,i){if("expand"===this.nodeclick){var o=this.zTree.getSelectedNodes();o.length>0&&this.expandNode(o[0],!o[0].open,!0)}this.selectNode(e,n)},t.prototype.onExpand=function(e,t,n){var i=this,r=this.getPath(n,""),a={$event:e,$item:o.getClonedObject(n.data),$path:r};this.invokeEventCallback("expand",a);var s=n.children;null==s||s.map((function(e){if(e.isParent){var t=$("#"+e.tId+"_switch");$(t).addClass(i.treeicons||p),$(t).on("click",(function(e){setTimeout((function(){$(t).addClass(i.treeicons||p)}),0)}))}}))},t.prototype.onCollapse=function(e,t,n){var i=this.getPath(n,""),r={$event:e,$item:o.getClonedObject(n.data),$path:i};this.invokeEventCallback("collapse",r)},t.prototype.constructZTreeData=function(e,t){var n=this;e.forEach((function(e){var r={},a=i.getEvaluatedData(e,{field:n.nodelabel,bindExpression:n.bindnodelabel},n.viewParent)||e.label,s=i.getEvaluatedData(e,{field:n.nodeicon,bindExpression:n.bindnodeicon},n.viewParent)||e.icon,l=i.getEvaluatedData(e,{field:n.nodeid,bindExpression:n.bindnodeid},n.viewParent),c=i.getEvaluatedData(e,{field:n.nodechildren,bindExpression:n.bindnodechildren},n.viewParent)||e.children;r.name=a,r.icon=s,r.nodeId=l,r.data=o.getClonedObject(e),_.isArray(c)&&c.length&&(r.children=[],n.constructZTreeData(c,r.children)),t.push(r)}))},t.prototype.renderTree=function(){var e;this.zTreeNodes=[],(null===(e=this.nodes)||void 0===e?void 0:e.length)&&(this.nativeElement.setAttribute("id",this.name),this.constructZTreeData(this.nodes,this.zTreeNodes),this.level>0&&this.expandTree(this.level,this.zTreeNodes,0)),this.zTree=$.fn.zTree.init($('ul[name="'+this.name+'"]'),this.setting,this.zTreeNodes),$.fn.zTreeKeyboardNavigation(this.zTree,$('ul[name="'+this.name+'"]'),null,this.treeicons||p),this.postRenderTree()},t.prototype.setChecked=function(e,t){var n=this;t.checked=e.checked;var o=i.getEvaluatedData(t,{field:this.nodechildren,bindExpression:this.bindnodechildren},this.viewParent)||t.children;(null==o?void 0:o.length)&&o.forEach((function(t,i){n.setChecked(e.children[i],t)}))},t.prototype.selectNode=function(e,t){if($(".app-tree[name="+this.name+"] li[treenode].selected").removeClass("selected"),t){$("#"+t.tId+":has(.curSelectedNode)").addClass("selected");var n=(this.treeClass||"").split(" ");(n.includes("Checkbox")||n.includes("Radio"))&&this.setChecked(t,t.data);var i=this.getPath(t,"");this.selecteditem=o.getClonedObject(t.data)||{},this.selecteditem.path=i;var r={$event:e,$item:o.getClonedObject(t.data),$path:i},a=t.data[this.nodeaction||"action"];a&&o.$parseEvent(a)(this),this.invokeEventCallback("select",r)}},t.prototype.expandNode=function(e,t,n){this.zTree.expandNode(e,t,!1,!1,n);var i=$("#"+e.tId+"_switch");$(i).addClass(this.treeicons||p)},t.prototype.postRenderTree=function(){var e=this;setTimeout((function(){if(e.changeTreeIcons(e.treeicons||p),e.datavalue&&!e.selecteditem){var t=e.zTree.getNodes(),n=void 0;t.length&&("FirstNode"===e.datavalue&&(n=t[0]),"LastNode"===e.datavalue&&(n=t[t.length-1])),n&&(e.zTree.selectNode(n,!1),e.selectNode(void 0,n),e.expandNode(n,!0,!1))}}),200)},t.prototype.selectById=function(e){var t,n=null===(t=this.zTree)||void 0===t?void 0:t.transformToArray(this.zTree.getNodes()),i=null==n?void 0:n.find((function(t){return e===t.nodeId}));i&&(this.zTree.selectNode(i,!1),this.selectNode(void 0,i))},t.prototype.deselectById=function(e){this.selecteditem={},this.selectById()},t}(i.StylableComponent);u.initializeProps=l(),u.decorators=[{type:t.Component,args:[{selector:"ul[wmTree]",template:'<ul #wmTree class="ztree" id="ztree"></ul> ',providers:[i.provideAsWidgetRef(u)],encapsulation:t.ViewEncapsulation.None}]}],u.ctorParameters=function(){return[{type:t.Injector},{type:void 0,decorators:[{type:t.Attribute,args:["datavalue.bind"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["nodelabel.bind"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["nodeicon.bind"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["nodechildren.bind"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["nodeid.bind"]}]}]};var d=[u],h=function(){};h.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.WmComponentsModule],declarations:s([],a(d)),exports:s([],a(d)),entryComponents:[]}]}],e.TreeComponent=u,e.TreeModule=h,e["\u0275a"]=l,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@angular/forms"),require("ngx-bootstrap/datepicker"),require("@wm/core"),require("@wm/components/base")):"function"==typeof define&&define.amd?define("@wm/components/input/calendar",["exports","@angular/core","@angular/common","@angular/forms","ngx-bootstrap/datepicker","@wm/core","@wm/components/base"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.input=e.wm.components.input||{},e.wm.components.input.calendar={}),e.ng.core,e.ng.common,e.ng.forms,e["ngx-bootstrap"].datepicker,e.wm.core,e.wm.components.base)}(this,(function(e,t,n,i,o,r,a){"use strict";
128
128
  /*! *****************************************************************************
129
129
  Copyright (c) Microsoft Corporation.
130
130
 
@@ -250,7 +250,7 @@
250
250
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
251
251
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
252
252
  PERFORMANCE OF THIS SOFTWARE.
253
- ***************************************************************************** */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)};Object.create;function s(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 l(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 c=function(){i.register("wm-chart",new Map([["aggregation",Object.assign({value:"none"},i.PROP_STRING)],["aggregationcolumn",i.PROP_STRING],["areaviewtype",Object.assign({value:"stack"},i.PROP_STRING)],["barspacing",Object.assign({value:"medium"},i.PROP_STRING)],["bubblesize",i.PROP_STRING],["centerlabel",i.PROP_STRING],["class",i.PROP_STRING],["customcolors",i.PROP_ANY],["dataset",i.PROP_ANY],["datasource",i.PROP_STRING],["donutratio",Object.assign({value:"medium"},i.PROP_STRING)],["formattype",{value:"",PROP_STRING:i.PROP_STRING}],["groupby",i.PROP_STRING],["height",{value:"210px",PROP_STRING:i.PROP_STRING}],["highlightpoints",i.PROP_BOOLEAN],["iconclass",i.PROP_STRING],["interpolation",Object.assign({value:"linear"},i.PROP_STRING)],["labelthreshold",Object.assign({value:.01},i.PROP_NUMBER)],["labeltype",Object.assign({value:"percent"},i.PROP_STRING)],["legendtype",Object.assign({value:"furious"},i.PROP_STRING)],["linethickness",i.PROP_STRING],["loadingdatamsg",Object.assign({value:"Loading..."},i.PROP_STRING)],["name",i.PROP_STRING],["nodatamessage",Object.assign({value:"No Data Available."},i.PROP_STRING)],["offset",i.PROP_STRING],["offsetbottom",Object.assign({value:55},i.PROP_NUMBER)],["offsetleft",Object.assign({value:75},i.PROP_NUMBER)],["offsetright",Object.assign({value:25},i.PROP_NUMBER)],["offsettop",Object.assign({value:25},i.PROP_NUMBER)],["orderby",i.PROP_STRING],["reducexticks",Object.assign({value:!0},i.PROP_BOOLEAN)],["shape",Object.assign({value:"circle"},i.PROP_STRING)],["show",Object.assign({value:!0},i.PROP_BOOLEAN)],["showlabels",Object.assign({value:"outside"},i.PROP_STRING)],["showlabelsoutside",Object.assign({value:!0},i.PROP_BOOLEAN)],["showlegend",Object.assign({value:"top"},i.PROP_STRING)],["showvalues",Object.assign({value:!1},i.PROP_BOOLEAN)],["showxaxis",Object.assign({value:!0},i.PROP_BOOLEAN)],["showxdistance",Object.assign({value:!1},i.PROP_BOOLEAN)],["showyaxis",Object.assign({value:!0},i.PROP_BOOLEAN)],["showydistance",Object.assign({value:!1},i.PROP_BOOLEAN)],["staggerlabels",Object.assign({value:!1},i.PROP_BOOLEAN)],["subheading",i.PROP_STRING],["theme",i.PROP_STRING],["title",i.PROP_STRING],["tooltips",Object.assign({value:!0},i.PROP_BOOLEAN)],["type",i.PROP_STRING],["viewtype",Object.assign({value:"Grouped"},i.PROP_STRING)],["xaxisdatakey",i.PROP_STRING],["xaxislabel",i.PROP_STRING],["xaxislabeldistance",Object.assign({value:12},i.PROP_NUMBER)],["xdateformat",i.PROP_STRING],["xdomain",Object.assign({value:"Default"},i.PROP_STRING)],["xnumberformat",i.PROP_STRING],["xunits",i.PROP_STRING],["yaxisdatakey",i.PROP_STRING],["yaxislabel",i.PROP_STRING],["yaxislabeldistance",Object.assign({value:12},i.PROP_NUMBER)],["ydomain",Object.assign({value:"Default"},i.PROP_STRING)],["ynumberformat",i.PROP_STRING],["yunits",i.PROP_STRING]]))},p=["Column","Line","Area","Cumulative Line","Bar","Pie","Donut","Bubble"],u=["circle","square","diamond","cross","triangle-up","triangle-down"],d=["01/01/2001","01/01/2002","01/01/2003"],h={Terrestrial:{colors:["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],tooltip:{backgroundColor:"#de7d28",textColor:"#FFFFFF"}},Annabelle:{colors:["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],tooltip:{backgroundColor:"#2e306f",textColor:"#FFFFFF"}},Azure:{colors:["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b","#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696","#bdbdbd","#d9d9d9"],tooltip:{backgroundColor:"#3182bd",textColor:"#FFFFFF"}},Retro:{colors:["#0ca7a1","#ffa615","#334957","#acc5c2","#988f90","#8accc9","#515151","#f27861","#36c9fd","#794668","#0f709d","#0d2738","#44be78","#4a1839","#6a393f","#557d8b","#6c331c","#1c1c1c","#861500","#09562a"],tooltip:{backgroundColor:"#80513a",textColor:"#FFFFFF"}},Mellow:{colors:["#f0dcbf","#88c877","#aeb918","#2e2c23","#ddddd2","#dfe956","#4c963b","#5d3801","#e1eec3","#cd8472","#fcfab3","#9a4635","#9295ad","#2e3f12","#565677","#557d8b","#4f4d02","#0c0c1b","#833324","#24120e"],tooltip:{backgroundColor:"#7c9e73",textColor:"#FFFFFF"}},Orient:{colors:["#a80000","#cc6c3c","#f0e400","#000084","#fccc6c","#009c6c","#cc309c","#78cc00","#fc84e4","#48e4fc","#4878d8","#186c0c","#606060","#a8a8a8","#000000","#d7d7d7","#75a06e","#190d0b","#888888","#694b84"],tooltip:{backgroundColor:"#c14242",textColor:"#FFFFFF"}},GrayScale:{colors:["#141414","#353535","#5b5b5b","#848484","#a8a8a8","#c3c3c3","#e0e0e0","#c8c8c8","#a5a5a5","#878787","#656565","#4e4e4e","#303030","#1c1c1c","#4f4f4f","#3b3b3b","#757575","#606060","#868686","#c1c1c1"],tooltip:{backgroundColor:"#575757",textColor:"#FFFFFF"}},Flyer:{colors:["#3f454c","#5a646e","#848778","#cededf","#74c4dd","#0946ed","#380bb1","#000ff0","#f54a23","#1db262","#bca3aa","#ffa500","#a86b32","#63a18c","#56795e","#934343","#b75f5f","#752d2d","#4e1111","#920606"],tooltip:{backgroundColor:"#47637c",textColor:"#FFFFFF"}},Luminosity:{colors:["#FFFFFF","#e4e4e4","#00bcd4","#f0dd2f","#00aabf","#018376","#e91e63","#39e5d4","#ff6d6d","#00ff76","#ff9800","#969696","#ff4200","#e00000","#95cbe5","#5331ff","#fff4a7","#e7a800","#0061e4","#d5e7ff"],tooltip:{backgroundColor:"#47637c",textColor:"#FFFFFF"}}},m=["xaxislabel","yaxislabel","xunits","yunits","xnumberformat","xdateformat","ynumberformat","showvalues","showlabels","viewtype","areaviewtype","staggerlabels","reducexticks","offsettop","offsetbottom","offsetright","offsetleft","barspacing","xaxislabeldistance","yaxislabeldistance","theme","labeltype","donutratio","showlabelsoutside","showxdistance","showydistance","shape","nodatamessage","captions","showxaxis","showyaxis","centerlabel","customcolors","showlegend","legendtype","xdomain","ydomain","tooltips","linethickness","highlightpoints","interpolation","labelthreshold"],f={small:.3,medium:.5,large:.8},g={small:.3,medium:.6,large:.7},v=_.invert(f),y=_.invert(g),b={Thousand:{prefix:"K",divider:1e3},Million:{prefix:"M",divider:1e6},Billion:{prefix:"B",divider:1e9}},w="#preview-chart",P=["Column","Line","Pie","Bar","Donut","Bubble"],O=["Line","Area","Cumulative Line"],S=["Cumulative Line","Area"],E="Europe",T="Asia",R="America",A="Australia",C=function(e){return"Bar"===e},I=function(e){return"Donut"===e},D=function(e){return"Bubble"===e},N=function(e){return"Area"===e},x=function(e){return function(e){return"Pie"===e}(e)||I(e)},k=function(e){return _.includes(P,e)||!_.includes(p,e)},M=function(e){return _.includes(O,e)},L=function(e,t){return"value"===t?f[e]:"key"===t?v[e]:void 0},F=function(e,t){return"value"===t?g[e]:"key"===t?y[e]:void 0},j=function(e){return function(e,t,n){var i=[],o=[],r=[],a=[],s=[],l=[],c=[],p=[],d=[],h=[];switch(e){case"jsonFormat":i=[{x:"01/01/2001",y:4e6},{x:"01/01/2002",y:1e6},{x:"01/01/2003",y:5e6}],o=[{x:"01/01/2001",y:3e6},{x:"01/01/2002",y:4e6},{x:"01/01/2003",y:7e6}],r=[{x:"01/01/2001",y:2e6},{x:"01/01/2002",y:8e6},{x:"01/01/2003",y:6e6}],h[0]={values:i,key:E},t>=2&&(h[1]={values:o,key:T}),t>=3&&(h[2]={values:r,key:R});break;case"lineChartFormat":i=[{x:1,y:4e6},{x:2,y:1e6},{x:3,y:5e6}],o=[{x:1,y:3e6},{x:2,y:4e6},{x:3,y:7e6}],r=[{x:1,y:2e6},{x:2,y:8e6},{x:3,y:6e6}],h[0]={values:i,key:E},t>=2&&(h[1]={values:o,key:T}),t>=3&&(h[2]={values:r,key:R});break;case"arrayFormat":a=[[1,4e6],[2,1e6],[3,5e6]],s=[[1,3e6],[2,4e6],[3,7e6]],l=[[1,2e6],[2,8e6],[3,6e6]],h[0]={values:a,key:E},t>=2&&(h[1]={values:s,key:T}),t>=3&&(h[2]={values:l,key:R});break;case"bubbleFormat":c=[{x:80.66,y:33739900,size:78,shape:n="random"===n?u[Math.floor(Math.random()*u.length)]:n},{x:79.84,y:81902300,size:90,shape:n},{x:78.6,y:5523100,size:45,shape:n}],p=[{x:72.73,y:79716200,size:98,shape:n},{x:80.05,y:61801600,size:20,shape:n},{x:72.49,y:73137200,size:34,shape:n}],d=[{x:68.09,y:33739900,size:45,shape:n},{x:81.55,y:7485600,size:78,shape:n},{x:68.6,y:14185e4,size:56,shape:n}],h[0]={values:c,key:E},t>=2&&(h[1]={values:p,key:T}),t>=3&&(h[2]={values:d,key:R});break;case"pieChartFormat":h=[{x:E,y:1e6},{x:T,y:2e6},{x:R,y:3e6},{x:A,y:4e6}]}return h}(function(e){var t=e.type;return function(e){return"Line"===e}(t)?"lineChartFormat":x(t)?"pieChartFormat":D(t)?"bubbleFormat":k(t)?"jsonFormat":"arrayFormat"}(e),_.split(e.yaxisdatakey,",").length,e.shape)},B=function(e,t){return!("Min"!==e[t+"domain"]||(n=e.type,!function(e){return"Column"===e}(n)&&!N(n)));var n},G=function(e){return!(!_.isFinite(e.min)||!_.isFinite(e.max))},V=function(e){var t=Math.floor(e);return Math.abs(e)-t>0?e-.1:t-1},U=function(e,t){return isNaN(parseInt(e,10))?t(e,"value"):e},W=function(e,t){return e=e||"%x",d3.time.format(e)(new Date(moment(moment(t).format()).valueOf()))},q=function(e,t){var n,i,o;return n=d3.format(e)(t),e?(i=b[e]&&b[e].divider||0,(o=b[e]&&b[e].prefix)&&0!==i&&(n=d3.format(".2f")(t/i)+o)):n=t>=1e3?d3.format(".1s")(t):t,n},z=function(e){return"false"!==e&&!1!==e&&("true"===e||!0===e||"hide"!==e)},H=function(e,t,n,i){e.tooltip.contentGenerator((function(e){var o,r=e.data.x;return o=q(t.ynumberformat,e.data.y),x(n.type)&&(i=e.data.x,r=""),'<table><tbody><tr class="value"><b>'+r+'</b></tr><tr><td class="legend-color-guide"><div style="background-color:'+e.color+';"></div></td><td class="key">'+i+'</td><td class="value">'+o+"</td></tr></tbody></table>"}))},Y=function(e,t,n,i,o){i=function(e,t){return t&&!r.isEmptyObject(t)||(t={}),_.forEach(m,(function(n){_.isUndefined(t[n])&&(t[n]=e[n])})),t}(e,i);var a,s,l,c,u,v,y,b,w,P=[],O={},S={};switch(e.type){case"Column":v=U(i.barspacing,L)||f.medium,a=nv.models.multiBarChart().x((function(e){return e.x})).y((function(e){return e.y})).reduceXTicks(i.reducexticks).rotateLabels(0).showControls(!1).stacked("Stacked"===i.viewtype).groupSpacing(v);break;case"Cumulative Line":a=nv.models.cumulativeLineChart().x((function(e){return e[0]})).y((function(e){return e[1]})).showControls(!1).useInteractiveGuideline(i.tooltips).interpolate(i.interpolation);break;case"Line":a=nv.models.lineChart().useInteractiveGuideline(i.tooltips).interpolate(i.interpolation);break;case"Area":a=nv.models.stackedAreaChart().x((function(e){return e[0]})).y((function(e){return e[1]})).clipEdge(!0).showControls(!1).style(i.areaviewtype).useInteractiveGuideline(i.tooltips).interpolate(i.interpolation);break;case"Bar":v=U(i.barspacing,L)||f.medium,a=nv.models.multiBarHorizontalChart().x((function(e){return e.x})).y((function(e){return e.y})).showControls(!1).stacked("Stacked"===i.viewtype).showValues(i.showvalues).groupSpacing(v);break;case"Pie":case"Donut":c=function(e,t,n){var i={};switch(e){case"hide":i.showlabels=!1;break;case"inside":i.showlabels=!0,i.showlabelsoutside=!1;break;case"outside":i.showlabels=!0,i.showlabelsoutside=!0}return i}(i.showlabels,i.showlabelsoutside),u=U(i.donutratio,F)||g.medium,a=nv.models.pieChart().x((function(e){return e.x})).y((function(e){return e.y})).showLabels(c.showlabels).labelType(i.labeltype).valueFormat(d3.format("%")).title(i.centerlabel).labelThreshold(i.labelthreshold||.01).labelsOutside(c.showlabelsoutside),I(e.type)&&a.donut(!0).donutRatio(u),"key-value"===i.labeltype&&a.labelType((function(e){return e.data.x+" "+e.data.y}));break;case"Bubble":a=nv.models.scatterChart().x((function(e){return e.x})).y((function(e){return e.y})).showDistX(i.showxdistance).showDistY(i.showydistance)}return t&&(O.min=t.min.x||t.min[0],O.max=t.max.x||t.max[0],G(O)&&(O.min=V(O.min),a.xDomain([O.min,O.max]))),n&&(S.min=n.min.y||n.min[1],S.max=n.max.y||n.max[1],G(S)&&(S.min=V(S.min),a.yDomain([S.min,S.max]))),a.legend.vers(i.legendtype&&i.legendtype.toLowerCase()||"furious"),_.includes(p,e.type)||(a=nv.models.multiBarChart().x((function(e){return e.x})).y((function(e){return e.y}))),x(e.type)?("percent"===i.labeltype?a.valueFormat(d3.format("%")):a.valueFormat((function(e){return q(i.ynumberformat,e)})),H(a,i,e)):(a.showXAxis(i.showxaxis).showYAxis(i.showyaxis),s=i.xaxislabel||r.prettifyLabels(e.xaxisdatakey)||"x caption",l=i.yaxislabel||r.prettifyLabels(e.yaxisdatakey)||"y caption",e.yaxisdatakey&&e.yaxisdatakey.split(",").length>1&&(w=!0),w||D(e.type)||H(a,i,e,l),s+=i.xunits?"("+i.xunits+")":"",l+=i.yunits?"("+i.yunits+")":"",a.xAxis.axisLabel(s).axisLabelDistance(i.xaxislabeldistance).staggerLabels(i.staggerlabels),i.xdateformat||o&&!D(e.type)?M(e.type)?a.xAxis.tickFormat((function(t){return b=o?d[t-1]:e.xDataKeyArr[t],W(i.xdateformat,b)})):a.xAxis.tickFormat((function(e){return W(i.xdateformat,e)})):i.xnumberformat?a.xAxis.tickFormat((function(e){return q(i.xnumberformat,e)})):M(e.type)&&a.xAxis.tickFormat((function(t){return e.xDataKeyArr[t]})),a.yAxis.axisLabel(l).axisLabelDistance(i.yaxislabeldistance).staggerLabels(i.staggerlabels).tickFormat((function(e){return q(i.ynumberformat,e)})),C(e.type)&&a.valueFormat((function(e){return q(i.ynumberformat,e)}))),_.isString(i.customcolors)&&i.customcolors&&(P=_.split(i.customcolors,",")),_.isArray(i.customcolors)&&(P=i.customcolors),y=z(i.showlegend),a.showLegend(y).margin({top:i.offsettop,right:i.offsetright,bottom:i.offsetbottom,left:i.offsetleft}).color(P.length?P:h[i.theme].colors),a.tooltip.enabled(i.tooltips),e.message=i.nodatamessage||"No data found",a.noData(e.message),M(e.type)&&e.highlightpoints&&a.dispatch.on("stateChange",(function(){setTimeout((function(){return K(e)}),100)})),!e.showlegend||"Donut"!==e.type&&"Pie"!==e.type||"right"===e.showlegend&&a.legendPosition("right"),a},K=function(e,t){var n=t?null:e.$id;M(e.type)&&(function(e,t){t=t||1.5,(e?d3.select("#wmChart"+e+" svg"):d3.select(w+" svg")).selectAll(".nv-line").style({"stroke-width":t})}(n,e.linethickness),function(e,t){var n=e?d3.select("#wmChart"+e+" svg"):d3.select(w+" svg");t?n.selectAll(".nv-point").style({"stroke-width":"6px","fill-opacity":".95","stroke-opacity":".95"}):n.selectAll(".nv-point").style({"stroke-width":"0px","fill-opacity":"0"})}(n,e.highlightpoints)),e.showlegend&&function(e,t,n){var i,o=z(e.showlegend),r=n?"#wmChart"+n:w,a=d3.select(r+" .nv-legendWrap");if(o&&a[0][0]&&"bottom"===t){var s=a[0][0].getBoundingClientRect().height,l=d3.select(r+" .nv-wrap"),c=l&&l.attr("transform")?l.attr("transform").replace(/, /g,","):"",p=/translate\(\s*([^\s,)]+)[ ,]([^\s,)]+)/.exec(c);a.attr("transform","translate(0 , "+(0===(i=$(r+" svg>.nvd3.nv-wrap")[0].getBoundingClientRect().height)&&(i=$(r+" svg")[0].getBoundingClientRect().height-(s+15)),i-s-5+")")),p&&l.attr("transform","translate("+p[1]+",5)")}}(e,e.showlegend,n)},Q={widgetType:"wm-chart",hostClass:"app-chart"},X="none",J=["aggregation","aggregationcolumn","groupby","orderby"],Z={Column:"rect.nv-bar",Bar:"g.nv-bar",Area:".nv-stackedarea .nv-point","Cumulative Line":".nv-cumulativeLine .nv-scatterWrap path.nv-point",Line:".nv-lineChart .nv-scatterWrap path.nv-point",Pie:".nv-pieChart .nv-slice path",Donut:".nv-pieChart .nv-slice path",Bubble:".nv-scatterChart .nv-point-paths path"},ee={fontunit:"font-size",fontsize:"font-size",color:"fill",fontfamily:"font-family",fontweight:"font-weight",fontstyle:"font-style",textdecoration:"text-decoration"},te={average:"AVG",count:"COUNT",maximum:"MAX",minimum:"MIN",sum:"SUM"},ne=function(e){return!0===e||"true"===e||!1!==e&&"false"!==e&&e},ie=ne,oe=function(e){var t,n=[],i=[];return _.forEach(_.split(e,","),(function(e){t=_.split(e,":"),n.push(t[0]),i.push(t[1])})),{columns:n,orders:i}},re=oe,ae=function(e){return e?e.replace(/\./g,"$"):null},se=ae,le=function(e,t){d3.select("#wmChart"+t+" svg").selectAll("text").style(e)},ce=le,pe=function(e){var t=90*(e.startAngle+e.endAngle)/Math.PI-90;return t>90?t-180:t},ue=pe,de=function(e){function t(t,n){var o=e.call(this,t,Q)||this;return o.app=n,o.iconclass="",o.nonPrimaryColumns=[],o.xDataKeyArr=[],o.chartData=[],o._processedData=[],o._subsciptions=[],o._plotChartProxy=_.debounce(o.plotChartProxy.bind(o),100),o.redraw=o._plotChartProxy.bind(o),i.styler(o.nativeElement,o,i.APPLY_STYLES_TYPE.CONTAINER,["fontsize","fontunit","color","fontfamily","fontweight","fontstyle","textdecoration"]),o.$id=o.widgetId||Math.random(),r.removeAttr(o.nativeElement,"title"),o.chartReady=!1,o.binddataset=o.nativeElement.getAttribute("dataset.bind"),o._subsciptions.push(o.app.subscribe("toggle-variable-state",o.handleLoading.bind(o))),o._subsciptions.push(o.app.subscribe("iscroll-start",(function(){o.hideTooltip()}))),o}return function(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)}(t,e),t.prototype.isGroupByEnabled=function(){return!(!this.groupby||this.groupby===X)},t.prototype.isValidAxis=function(){return!this.binddataset||this.xaxisdatakey&&this.yaxisdatakey},t.prototype.isAggregationEnabled=function(){return!(!this.isGroupByEnabled()||this.aggregation===X||!this.aggregationcolumn)},t.prototype.isDataFilteringEnabled=function(){return this.isAggregationEnabled()||!this.isVisuallyGrouped&&this.orderby},t.prototype.getxAxisVal=function(e,t,n){var i=_.get(e,t);return M(this.type)&&!r.isNumberType(this.xAxisDataType)?(this.xDataKeyArr.push(i),i):i},t.prototype.getXMinMaxValues=function(e){if(e){var t={};return t.min=_.minBy(e.values,(function(e){return e.x||e[0]})),t.max=_.maxBy(e.values,(function(e){return e.x||e[0]})),t}},t.prototype.getYMinMaxValues=function(e){var t={},n=[],i=[];if(e)return _.forEach(e,(function(e){n.push(_.minBy(e.values,(function(e){return e.y||e[1]}))),i.push(_.maxBy(e.values,(function(e){return e.y||e[1]})))})),t.min=_.minBy(n,(function(e){return e.y||e[1]})),t.max=_.maxBy(i,(function(e){return e.y||e[1]})),t},t.prototype.getValidData=function(e){return 1===e.length&&void 0===e[0]?[]:e},t.prototype.valueFinder=function(e,t,n,i,o){var r,a=this.getxAxisVal(e,t,i),s=_.get(e,n),l=parseFloat(s)||s,c=parseFloat(e[this.bubblesize])||2,p={};return k(this.type)?(p.x=a,p.y=l,D(this.type)&&(p.size=c,p.shape=o||"circle")):(r=this.type,_.includes(S,r)&&(p=[a,l])),p._dataObj=e,p},t.prototype.setErrMsg=function(e){this.showNoDataMsg&&(this.showContentLoadError=!0,this.invalidConfig=!0,this.errMsg="")},t.prototype.processChartData=function(){var e=this;if(this.sampleData=j(this),this.xDataKeyArr=[],!this.binddataset)return this.xDataKeyArr=d,this.sampleData;if(!this.chartData||!this.chartData.length)return[];var t,n=[],i=[],o=[],a=this.xaxisdatakey,s=this.yaxisdatakey?this.yaxisdatakey.split(","):[],l=this.chartData;return _.isArray(l)&&(x(this.type)?(t=s[0],n=_.map(l,(function(n,i){if(!r.isEmptyObject(l[i]))return e.valueFinder(l[i],a,t)})),n=this.getValidData(n)):(D(this.type)&&(i="random"===this.shape?u:this.shape),s.forEach((function(t,s){o=_.map(l,(function(n,o){if(!r.isEmptyObject(l[o]))return e.valueFinder(l[o],a,t,o,_.isArray(i)&&i[s]||e.shape)})),o=e.getValidData(o),n.push({values:o,key:r.prettifyLabels(t)})})))),n},t.prototype.setChartData=function(e){e&&(this._processedData=e)},t.prototype.getChartData=function(){return this._processedData},t.prototype.getVisuallyGroupedData=function(e,t){var n,i,o=this,r={},a=[],s=[],l=N(this.type),c=_.first(_.split(this.yaxisdatakey,","));return this.xDataKeyArr=[],e=_.orderBy(e,_.split(this.groupby,",")),this.orderby&&(n=oe(this.orderby),e=_.orderBy(e,n.columns,n.orders)),e=_.groupBy(e,t),l&&(i=_.max(_.map(e,(function(e){return e.length})))),_.forEach(e,(function(e,t){a=N?_.fill(new Array(i),[0,0]):[],_.forEachRight(e,(function(e,t){a[t]=o.valueFinder(e,o.xaxisdatakey,c,t)})),r={key:t,values:a},s.push(r)})),s},t.prototype.getGroupingDetails=function(){var e=this;if(this.isGroupByEnabled()&&!this.isAggregationEnabled()){var t,n,i,o=!1,r=[],a=this.groupby&&this.groupby!==X?this.groupby.split(","):[],s=this.yaxisdatakey?this.yaxisdatakey.split(","):[];return a.length>1&&(a.every((function(n,r){return e.xaxisdatakey===n||-1!==$.inArray(n,s)||(o=!0,t=n,i=r,a.splice(i,1),!1)})),t&&r.push(t),a.length&&(r=_.concat(r,a))),this.xaxisdatakey!==this.aggregationcolumn&&r.push(this.xaxisdatakey),_.forEach(s,(function(t){t!==e.aggregationcolumn&&r.push(t)})),n=r.join(","),this.isVisuallyGrouped=o,{expression:n,isVisuallyGrouped:o,visualGroupingColumn:t}}return{expression:"",isVisuallyGrouped:!1,visualGroupingColumn:""}},t.prototype.getAggregatedData=function(e){var t,n,i,o=this,a=this.datasource,s=this.yaxisdatakey?this.yaxisdatakey.split(","):[],l={},c=[],p=[];a&&(this.isGroupByEnabled()&&(p=_.split(this.groupby,",")),this.orderby&&(t=_.replace(this.orderby,/:/g," "),c=_.uniq(_.concat(c,p,[this.aggregationcolumn])),i=oe(this.orderby).columns,_.forEach(_.intersection(c,i),(function(e){n=ae(e),t=_.replace(t,e,n)}))),this.isAggregationEnabled()&&(l.groupByFields=p,l.aggregations=[{field:this.aggregationcolumn,type:te[this.aggregation],alias:ae(this.aggregationcolumn)}]),a.execute("getAggregatedData",{aggregations:l,sort:t}).then((function(t){var n=[],i=ae(o.aggregationcolumn),a=ae(o.xaxisdatakey),l=[];s.forEach((function(e){return l.push(ae(e))})),_.forEach(t.body.content,(function(e){var t={};o.isAggregationEnabled()&&(t[o.aggregationcolumn]=e[i],t[o.aggregationcolumn]=_.get(e,i)||_.get(e,o.aggregationcolumn)),t[o.xaxisdatakey]=_.get(e,a)||_.get(e,o.xaxisdatakey),s.forEach((function(n,i){t[n]=e[l[i]],t[n]=_.get(e,l[i])||_.get(e,n)})),n.push(t)})),o.chartData=n,r.triggerFn(e)}),(function(){o.chartData=[],o.setErrMsg("MESSAGE_ERROR_FETCH_DATA"),r.triggerFn(e)})))},t.prototype.setLabelsMaxWidth=function(){var e,t,n,i,o,r,a,s,l,c,p,u,d=parseInt(this.fontsize,10)||12,h=C(this.type);(e=$("#wmChart"+this.$id+" svg").find("g.nv-x").find("g.tick").find("text")).each((function(){var e,n,r=$(this);if(r.text()&&"1"===r.css("opacity"))return e=r.parent().attr("transform").split(","),i=parseFloat(e[0].substr(10)),o=parseFloat(e[1]||"0"),!h&&i>0?n=i:o>0&&(n=o),t?(t=n-t,!1):(t=n,!0)})),h?(c=$("#wmChart"+this.$id+" svg>g.nv-wrap>g>g.nv-barsWrap")[0],p=$("#wmChart"+this.$id+" svg>g.nv-wrap>g>g.nv-y")[0],u=$("#wmChart"+this.$id+" svg")[0],r=c?c.getBoundingClientRect().height:0,l=p?u.getBoundingClientRect().width-p.getBoundingClientRect().width:u.getBoundingClientRect().width,n=Math.round(l/d),t<d&&(a=r/d,s=Math.ceil(this.chartData.length/a),d3.select("#wmChart"+this.$id+" svg").select("g.nv-x").selectAll("g.tick").select("text").each((function(e,t){t%s!=0&&d3.select(this).attr("opacity",0)})))):n=Math.round(t/d),n=Math.abs(n),e.each((function(){this.textContent.length>n&&(this.textContent=this.textContent.substr(0,n)+"...")}))},t.prototype.getDefaultColumns=function(){var e,t,n,i,o=[],a=this.datasource.execute(r.DataSource.Operation.GET_PROPERTIES_MAP)||[];for(n=0;n<a.length&&o.length<=2;n+=1)e=a[n].type,!a[n].isRelated&&r.isNumberType(e)?o.push(a[n].fieldName):"string"!==e||t||(t=a[n].fieldName);return t&&o.length>0&&!D(this.type)&&(i=o[0],o[0]=t,o[1]=i),o},t.prototype.attachClickEvent=function(){var e,t=this;d3.select("#wmChart"+this.$id+" svg").selectAll(Z[this.type]).style("pointer-events","all").on("click",(function(n,i){switch(t.type){case"Column":case"Bar":e=n._dataObj;break;case"Pie":case"Donut":e=n.data._dataObj;break;case"Area":case"Cumulative Line":case"Line":e=n[0]._dataObj;break;case"Bubble":e=n.data.point[4]._dataObj}t.selecteditem=e,t.invokeEventCallback("select",{$event:d3.event,selectedChartItem:n,selectedItem:t.selecteditem})}))},t.prototype.postPlotProcess=function(e){var t,n,i,o,a=this,s={},l=this.$element;K(this),x(this.type)?this.showlabelsoutside||(n=(t=d3.select("#wmChart"+this.$id+" svg")).select(".nv-pieLabels").selectAll(".nv-label"),i=t.select(".nv-pie").selectAll(".nv-slice"),o=[],i&&i.length&&(i.each((function(){d3.select(this).attr("transform",(function(e){o.push(pe(e))}))})),n.each((function(e,t){var n=d3.select(this);$(n[0][0]).find("text").attr("transform","rotate("+o[t]+")")})))):this.setLabelsMaxWidth(),_.forEach(ee,(function(e,t){s[e]="fontsize"===t||"fontunit"===t?a.fontsize+a.fontunit:a[t]})),le(s,this.$id),r.triggerFn(this._resizeFn&&this._resizeFn.clear),this._resizeFn=nv.utils.windowResize((function(){l[0].getBoundingClientRect().height&&(e.update(),K(a),x(a.type)||a.setLabelsMaxWidth())}))},t.prototype.configureChart=function(){var e,t,n,i;if(this._processedData.length>0&&(B(this,"x")&&(e=this.binddataset?this.getXMinMaxValues(this._processedData[0]):{min:{x:1},max:{x:5}}),B(this,"y")&&(t=this.binddataset?this.getYMinMaxValues(this._processedData):{min:{y:1},max:{y:5}})),!x(this.type)||this.binddataset&&this.scopedataset||(this._processedData=r.getClonedObject(this.scopedataset||this._processedData)),n=Y(this,e,t,null,!this.binddataset),_.isArray(this._processedData)){var o=$("#wmChart"+this.$id+" svg").find("g.nv-x").find("g.tick");return o&&o.length&&o.remove(),(i=this.invokeEventCallback("beforerender",{chartInstance:n}))&&(n=i),this.chart=n,d3.select("#wmChart"+this.$id+" svg").datum(this._processedData).call(this.chart),this.postPlotProcess(n),n}},t.prototype.plotChart=function(){var e=this,t=this.$element;this.chartData=this.invokeEventCallback("transform")||this.chartData,this.isVisuallyGrouped&&!x(this.type)?this._processedData=this.chartData:this._processedData=this.processChartData(),t[0].getBoundingClientRect().height&&(this.clearCanvas&&(t.find("svg").replaceWith("<svg></svg>"),this.clearCanvas=!1),this.isValidAxis()||(this._processedData=[]),nv.addGraph((function(){return e.configureChart()}),(function(){setTimeout((function(){e.attachClickEvent()}),600)})),this.isLoadInProgress=!1)},Object.defineProperty(t.prototype,"isLiveVariable",{get:function(){var e=this.datasource;return e&&"wm.LiveVariable"===e.category},enumerable:!1,configurable:!0}),t.prototype.plotChartProxy=function(){var e=this;this.showContentLoadError=!1,this.invalidConfig=!1,this.isLoadInProgress=!0;var t=this.getGroupingDetails();this.binddataset&&this.isLiveVariable&&(this.filterFields||this.isDataFilteringEnabled())?this.getAggregatedData((function(){return e.plotChart()})):(this.dataset&&this.isLiveVariable&&(this.chartData=this.dataset,this.isGroupByEnabled()&&t.isVisuallyGrouped&&(this.chartData=this.getVisuallyGroupedData(this.chartData,t.visualGroupingColumn))),this.plotChart())},t.prototype.setDefaultAxisOptions=function(){var e=this.getDefaultColumns();this.xaxisdatakey=e[0]||null,this.yaxisdatakey=e[1]||null},t.prototype.getCutomizedOptions=function(e,t){var n,i=_.split(this.groupby,","),o=_.split(this.aggregationcolumn,",");if(!this.binddataset)return t;switch(this.axisoptions||(this.axisoptions=t),e){case"xaxisdatakey":this.isGroupByEnabled()&&(n=i);break;case"yaxisdatakey":this.isAggregationEnabled()?n=o:this.isLiveVariable&&(n=this.numericColumns);break;case"groupby":this.isLiveVariable&&this.nonPrimaryColumns&&this.nonPrimaryColumns.length&&(n=this.nonPrimaryColumns);break;case"aggregationcolumn":this.isLiveVariable&&this.isAggregationEnabled()&&"count"!==this.aggregation&&(n=this.numericColumns);break;case"orderby":this.isLiveVariable&&this.isAggregationEnabled()&&(n=_.uniq(_.concat(i,o)));break;case"bubblesize":this.numericColumns&&this.numericColumns.length&&(n=this.numericColumns)}return n||t||this.axisoptions},t.prototype.setNumericandNonPrimaryColumns=function(){var e,t,n=this,i=this.datasource.execute(r.DataSource.Operation.GET_PROPERTIES_MAP);this.numericColumns=[],this.nonPrimaryColumns=[],this.dataset&&!_.isEmpty(i)&&(e=[]),e&&(_.forEach(Object.keys(e),(function(i){t=e[i].type,r.isNumberType(t)&&n.numericColumns.push(i),"true"!==e[i].isRelatedPk&&e[i].isPrimaryKey||n.nonPrimaryColumns.push(i)})),this.numericColumns=this.numericColumns.sort(),this.nonPrimaryColumns=this.nonPrimaryColumns.sort())},t.prototype.handleDataSet=function(e){this.errMsg="",e||this.binddataset||(this.isVisuallyGrouped=!1,this.axisoptions=null),this.chartData=this.isLiveVariable?e||"":e&&""===e.dataValue&&1===_.keys(e).length?"":e,!_.isArray(this.chartData)&&_.isObject(this.chartData)&&(this.chartData=[this.chartData]),e&&e.filterFields&&(this.filterFields=e.filterFields),this.chartData&&this._plotChartProxy()},t.prototype.setDonutCenterLabel=function(e){var t;(t=d3.select("#wmChart"+this.$id+" svg").select(".nv-wrap.nv-pie").select(".nv-pie")).text(""),t.append("text").attr("dy",".35em").attr("text-anchor","middle").attr("class","nv-pie-title").text(e).each((function(e){var t=d3.select(this),n=d3.select(this.parentElement),i=Number(n.node().getBoundingClientRect().width)-30,o=this.getComputedTextLength();t.attr("data-scale",i/o)})).style("font-size",(function(){var e=16*d3.select(this).attr("data-scale");return e>24?24:e+"px"}))},t.prototype.onPropertyChange=function(t,n,i){switch(e.prototype.onPropertyChange.call(this,t,n,i),t){case"dataset":this.handleDataSet(n);break;case"centerlabel":this.chart&&(this.chart.title(n),this.setDonutCenterLabel(n));break;case"type":x(this.type)?(this.offsettop=20,this.offsetright=0,this.offsetbottom=0,this.offsetleft=0):"Pie"!==i&&"Donut"!==i||(this.offsettop=25,this.offsetright=25,this.offsetbottom=55,this.offsetleft=75),i!==n&&(this.clearCanvas=!0),this._plotChartProxy();break;default:this._plotChartProxy()}_.includes(J,t)&&this._plotChartProxy()},t.prototype.handleLoading=function(e){var t=this.datasource;t&&t.execute(r.DataSource.Operation.IS_API_AWARE)&&r.isDataSourceEqual(e.variable,t)&&(this.variableInflight=e.active,this.isLoadInProgress=e.active)},t.prototype.hideTooltip=function(){d3.selectAll(".nvtooltip").style("opacity",0)},t.prototype.onStyleChange=function(t,n,i){var o={};switch(e.prototype.onStyleChange.call(this,t,n,i),t){case"fontsize":case"fontunit":case"color":case"fontfamily":case"fontweight":case"fontstyle":case"textdecoration":o[ee[t]]="fontsize"===t||"fontunit"===t?this.fontsize+this.fontunit:n,le(o,this.$id)}},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),_.includes(["outside","inside","hide"],this.showlabels)||(this.showlabels=ne(this.showlabels),this.showlabelsoutside=ne(this.showlabelsoutside),this.showlabels=this.showlabels?this.showlabelsoutside?"outside":"inside":"hide"),this.theme||(this.theme=x(this.type)?"Azure":"Terrestrial"),this.nativeElement.setAttribute("id","wmChart"+this.$id),this.binddataset||this.nativeElement.getAttribute("scopedataset")||this._plotChartProxy()},t.prototype.ngOnDestroy=function(){this.hideTooltip(),this._subsciptions.forEach((function(e){e()})),e.prototype.ngOnDestroy.call(this)},t}(i.StylableComponent);de.initializeProps=c(),de.decorators=[{type:t.Component,args:[{selector:"div[wmChart]",template:'<div class="panel-heading" *ngIf="title">\n <h3 class="panel-title">\n <div class="pull-left"><i class="app-icon panel-icon {{iconclass}}" [class.ng-hide]="!iconclass"></i></div>\n <div class="heading" [innerHTML]="title"></div>\n <div class="description" *ngIf="subheading" [innerHTML]="subheading"></div>\n </h3>\n</div>\n<div class="app-chart-inner" [ngClass]="{\'loading\':isLoadInProgress, \'panel-body\': title}">\n <svg></svg>\n <div class="wm-content-info readonly-wrapper" *ngIf="showContentLoadError && showNoDataMsg">\n <p class="wm-message" [title]="hintMsg" [ngClass]="{\'error\': invalidConfig}" [innerText]="errMsg"></p>\n </div>\n <div wmSpinner show.bind="isLoadInProgress" caption.bind="loadingdatamsg"></div>\n</div>\n',providers:[i.provideAsWidgetRef(de)],encapsulation:t.ViewEncapsulation.None,styles:[".nvd3 .nv-axis line,.nvd3 .nv-axis path{fill:none;shape-rendering:crispEdges}.nv-brush .extent,.nvd3 .background path,.nvd3 .nv-axis line,.nvd3 .nv-axis path{shape-rendering:crispEdges}.nv-distx,.nv-disty,.nv-noninteractive,.nvd3 .nv-axis,.nvd3.nv-pie .nv-label,.nvd3.nv-sparklineplus g.nv-hoverValue{pointer-events:none}.nvd3 .nv-axis{opacity:1}.nvd3 .nv-axis.nv-disabled,.nvd3 .nv-controlsWrap .nv-legend .nv-check-box .nv-check{opacity:0}.nvd3 .nv-axis path{stroke:#000;stroke-opacity:.75}.nvd3 .nv-axis path.domain{stroke-opacity:.75}.nvd3 .nv-axis.nv-x path.domain{stroke-opacity:0}.nvd3 .nv-axis line{stroke:#e5e5e5}.nvd3 .nv-axis .zero line,.nvd3 .nv-axis line.zero{stroke-opacity:.75}.nvd3 .nv-axis .nv-axisMaxMin text{font-weight:700}.nvd3 .x .nv-axis .nv-axisMaxMin text,.nvd3 .x2 .nv-axis .nv-axisMaxMin text,.nvd3 .x3 .nv-axis .nv-axisMaxMin text{text-anchor:middle}.nvd3 .nv-bars rect{fill-opacity:.75;transition:fill-opacity .25s linear}.nvd3 .nv-bars rect.hover{fill-opacity:1}.nvd3 .nv-bars .hover rect{fill:#add8e6}.nvd3 .nv-bars text{fill:transparent}.nvd3 .nv-bars .hover text{fill:#000}.nvd3 .nv-discretebar .nv-groups rect,.nvd3 .nv-multibar .nv-groups rect,.nvd3 .nv-multibarHorizontal .nv-groups rect{stroke-opacity:0;transition:fill-opacity .25s linear}.with-transitions .nv-candlestickBar .nv-ticks .nv-tick,.with-transitions .nvd3 .nv-groups .nv-point{transition:stroke-width .25s linear,stroke-opacity .25s linear}.nvd3 .nv-candlestickBar .nv-ticks rect:hover,.nvd3 .nv-discretebar .nv-groups rect:hover,.nvd3 .nv-multibar .nv-groups rect:hover,.nvd3 .nv-multibarHorizontal .nv-groups rect:hover{fill-opacity:1}.nvd3 .nv-discretebar .nv-groups text,.nvd3 .nv-multibarHorizontal .nv-groups text{font-weight:700;fill:#000;stroke:transparent}.nvd3 .nv-boxplot circle{fill-opacity:.5}.nvd3 .nv-boxplot circle:hover,.nvd3 .nv-boxplot rect:hover{fill-opacity:1}.nvd3 line.nv-boxplot-median{stroke:#000}.nv-boxplot-tick:hover{stroke-width:2.5px}.nvd3.nv-bullet{font:10px sans-serif}.nvd3.nv-bullet .nv-measure{fill-opacity:.8}.nvd3.nv-bullet .nv-measure:hover{fill-opacity:1}.nvd3.nv-bullet .nv-marker{stroke:#000;stroke-width:2px}.nvd3.nv-bullet .nv-markerTriangle{stroke:#000;fill:#fff;stroke-width:1.5px}.nvd3.nv-bullet .nv-markerLine{stroke:#000;stroke-width:1.5px}.nvd3.nv-bullet .nv-tick line{stroke:#666;stroke-width:.5px}.nvd3.nv-bullet .nv-range.nv-s0{fill:#eee}.nvd3.nv-bullet .nv-range.nv-s1{fill:#ddd}.nvd3.nv-bullet .nv-range.nv-s2{fill:#ccc}.nvd3.nv-bullet .nv-title{font-size:14px;font-weight:700}.nvd3.nv-bullet .nv-subtitle{fill:#999}.nvd3.nv-bullet .nv-range{fill:#bababa;fill-opacity:.4}.nvd3.nv-bullet .nv-range:hover{fill-opacity:.7}.nvd3.nv-candlestickBar .nv-ticks .nv-tick{stroke-width:1px}.nvd3.nv-candlestickBar .nv-ticks .nv-tick.hover{stroke-width:2px}.nvd3.nv-candlestickBar .nv-ticks .nv-tick.positive rect{stroke:#2ca02c;fill:#2ca02c}.nvd3.nv-candlestickBar .nv-ticks .nv-tick.negative rect{stroke:#d62728;fill:#d62728}.nvd3.nv-candlestickBar .nv-ticks line{stroke:#333}.nv-force-node{stroke:#fff;stroke-width:1.5px}.nv-force-link{stroke:#999;stroke-opacity:.6}.nv-force-node text{stroke-width:0}.nvd3 .nv-check-box .nv-box{fill-opacity:0;stroke-width:2}.nvd3 .nv-check-box .nv-check{fill-opacity:0;stroke-width:4}.nvd3 .nv-series.nv-disabled .nv-check-box .nv-check{fill-opacity:0;stroke-opacity:0}.nvd3.nv-linePlusBar .nv-bar rect{fill-opacity:.75}.nvd3.nv-linePlusBar .nv-bar rect:hover{fill-opacity:1}.nvd3 .nv-groups path.nv-line{fill:none}.nvd3 .nv-groups path.nv-area{stroke:none}.nvd3.nv-line .nvd3.nv-scatter .nv-groups .nv-point{fill-opacity:0;stroke-opacity:0}.nvd3.nv-scatter.nv-single-point .nv-groups .nv-point{fill-opacity:.5!important;stroke-opacity:.5!important}.nvd3 .nv-groups .nv-point.hover,.nvd3.nv-scatter .nv-groups .nv-point.hover{stroke-width:7px;fill-opacity:.95!important;stroke-opacity:.95!important}.nvd3 .nv-point-paths path{stroke:#aaa;stroke-opacity:0;fill:#eee;fill-opacity:0}.nvd3 .nv-indexLine{cursor:ew-resize}svg.nvd3-svg{-webkit-user-select:none;-moz-user-select:none;user-select:none;display:block;width:100%;height:100%}.nvtooltip.with-3d-shadow,.with-3d-shadow .nvtooltip{box-shadow:0 5px 10px #0003;border-radius:5px}.nvd3 text{font:400 12px Arial,sans-serif}.nvd3 .title{font:700 14px Arial,sans-serif}.nvd3 .nv-background{fill:#fff;fill-opacity:0}.nvd3.nv-noData{font-size:18px;font-weight:700}.nv-brush .extent{fill-opacity:.125}.nv-brush .resize path{fill:#eee;stroke:#666}.nvd3 .nv-legend .nv-series{cursor:pointer}.nvd3 .nv-legend .nv-disabled circle{fill-opacity:0}.nvd3 .nv-brush .extent{fill-opacity:0!important}.nvd3 .nv-brushBackground rect{stroke:#000;stroke-width:.4;fill:#fff;fill-opacity:.7}@media print{.nvd3 text{stroke-width:0;fill-opacity:1}}.nvd3.nv-ohlcBar .nv-ticks .nv-tick{stroke-width:1px}.nvd3.nv-ohlcBar .nv-ticks .nv-tick.hover{stroke-width:2px}.nvd3.nv-ohlcBar .nv-ticks .nv-tick.positive{stroke:#2ca02c}.nvd3.nv-ohlcBar .nv-ticks .nv-tick.negative{stroke:#d62728}.nvd3 .background path{fill:none;stroke:#eee;stroke-opacity:.4}.nvd3 .foreground path{fill:none;stroke-opacity:.7}.nvd3 .nv-parallelCoordinates-brush .extent{fill:#fff;fill-opacity:.6;stroke:gray;shape-rendering:crispEdges}.nvd3 .nv-parallelCoordinates .hover{fill-opacity:1;stroke-width:3px}.nvd3 .missingValuesline line{fill:none;stroke:#000;stroke-width:1;stroke-opacity:1;stroke-dasharray:5,5}.nvd3.nv-pie .nv-pie-title{font-size:24px;fill:#13c4f996}.nvd3.nv-pie .nv-slice text{stroke:#000;stroke-width:0}.nvd3.nv-pie path{transition:fill-opacity .25s linear,stroke-width .25s linear,stroke-opacity .25s linear;stroke:#fff;stroke-width:1px;stroke-opacity:1;fill-opacity:.7}.nvd3.nv-pie .hover path{fill-opacity:1}.nvd3.nv-pie .nv-label rect{fill-opacity:0;stroke-opacity:0}.nvd3 .nv-groups .nv-point.hover{stroke-width:20px;stroke-opacity:.5}.nvd3 .nv-scatter .nv-point.hover{fill-opacity:1}.nvd3.nv-sparkline path{fill:none}.nvd3.nv-sparklineplus .nv-hoverValue line{stroke:#333;stroke-width:1.5px}.nvd3.nv-sparklineplus,.nvd3.nv-sparklineplus g{pointer-events:all}.nvd3 .nv-interactiveGuideLine,.nvtooltip{pointer-events:none}.nvd3 .nv-hoverArea{fill-opacity:0;stroke-opacity:0}.nvd3.nv-sparklineplus .nv-xValue,.nvd3.nv-sparklineplus .nv-yValue{stroke-width:0;font-size:.9em;font-weight:400}.nvd3.nv-sparklineplus .nv-yValue{stroke:#f66}.nvd3.nv-sparklineplus .nv-maxValue{stroke:#2ca02c;fill:#2ca02c}.nvd3.nv-sparklineplus .nv-minValue{stroke:#d62728;fill:#d62728}.nvd3.nv-sparklineplus .nv-currentValue{font-weight:700;font-size:1.1em}.nvtooltip h3,.nvtooltip table td.key{font-weight:400}.nvd3.nv-stackedarea path.nv-area{fill-opacity:.7;stroke-opacity:0;transition:fill-opacity .25s linear,stroke-opacity .25s linear}.nvd3.nv-stackedarea path.nv-area.hover{fill-opacity:.9}.nvd3.nv-stackedarea .nv-groups .nv-point{stroke-opacity:0;fill-opacity:0}.nvtooltip{position:absolute;color:#000;padding:1px;z-index:10000;display:block;font-family:Arial,sans-serif;font-size:13px;text-align:left;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;user-select:none;background:rgba(255,255,255,.8);border:1px solid rgba(0,0,0,.5);border-radius:4px}.nvtooltip h3,.nvtooltip p{margin:0;text-align:center}.nvtooltip.with-transitions,.with-transitions .nvtooltip{transition:opacity 50ms linear;transition-delay:.2s}.nvtooltip.x-nvtooltip,.nvtooltip.y-nvtooltip{padding:8px}.nvtooltip h3{padding:4px 14px;line-height:18px;background-color:#f7f7f7bf;color:#000;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.nvtooltip p{padding:5px 14px}.nvtooltip span{display:inline-block;margin:2px 0}.nvtooltip table{margin:6px;border-spacing:0}.nvtooltip table td{padding:2px 9px 2px 0;vertical-align:middle}.nvtooltip table td.key.total{font-weight:700}.nvtooltip table td.value{text-align:right;font-weight:700}.nvtooltip table td.percent{color:#a9a9a9}.nvtooltip table tr.highlight td{padding:1px 9px 1px 0;border-bottom-style:solid;border-bottom-width:1px;border-top-style:solid;border-top-width:1px}.nvtooltip table td.legend-color-guide div{vertical-align:middle;width:12px;height:12px;border:1px solid #999}.nvtooltip .footer{padding:3px;text-align:center}.nvtooltip-pending-removal{pointer-events:none;display:none}.nvd3 line.nv-guideline{stroke:#ccc}\n"]}]}],de.ctorParameters=function(){return[{type:t.Injector},{type:r.App}]},de.propDecorators={title:[{type:t.HostBinding,args:["class.panel"]}]};var he=[de],me=function(){};me.decorators=[{type:t.NgModule,args:[{imports:[o.BasicModule,n.CommonModule,i.WmComponentsModule],declarations:l([],s(he)),exports:l([],s(he)),entryComponents:[]}]}],e.ChartComponent=de,e.ChartModule=me,e["\u02750"]=ie,e["\u02751"]=re,e["\u02752"]=se,e["\u02753"]=ce,e["\u02754"]=ue,e["\u0275a"]=c,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("ngx-bootstrap/dropdown"),require("@wm/components/base"),require("@wm/components/basic"),require("@wm/components/input"),require("@angular/router"),require("@wm/core")):"function"==typeof define&&define.amd?define("@wm/components/navigation/menu",["exports","@angular/core","@angular/common","ngx-bootstrap/dropdown","@wm/components/base","@wm/components/basic","@wm/components/input","@angular/router","@wm/core"],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.menu={}),e.ng.core,e.ng.common,e["ngx-bootstrap"].dropdown,e.wm.components.base,e.wm.components.basic,e.wm.components.input,e.ng.router,e.wm.core)}(this,(function(e,t,n,i,o,r,a,s,l){"use strict";
253
+ ***************************************************************************** */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)};Object.create;function s(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 l(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 c=function(){i.register("wm-chart",new Map([["aggregation",Object.assign({value:"none"},i.PROP_STRING)],["aggregationcolumn",i.PROP_STRING],["areaviewtype",Object.assign({value:"stack"},i.PROP_STRING)],["barspacing",Object.assign({value:"medium"},i.PROP_STRING)],["bubblesize",i.PROP_STRING],["centerlabel",i.PROP_STRING],["class",i.PROP_STRING],["customcolors",i.PROP_ANY],["dataset",i.PROP_ANY],["datasource",i.PROP_STRING],["donutratio",Object.assign({value:"medium"},i.PROP_STRING)],["formattype",{value:"",PROP_STRING:i.PROP_STRING}],["groupby",i.PROP_STRING],["height",{value:"210px",PROP_STRING:i.PROP_STRING}],["highlightpoints",i.PROP_BOOLEAN],["iconclass",i.PROP_STRING],["interpolation",Object.assign({value:"linear"},i.PROP_STRING)],["labelthreshold",Object.assign({value:.01},i.PROP_NUMBER)],["labeltype",Object.assign({value:"percent"},i.PROP_STRING)],["legendtype",Object.assign({value:"furious"},i.PROP_STRING)],["linethickness",i.PROP_STRING],["loadingdatamsg",Object.assign({value:"Loading..."},i.PROP_STRING)],["name",i.PROP_STRING],["nodatamessage",Object.assign({value:"No Data Available."},i.PROP_STRING)],["offset",i.PROP_STRING],["offsetbottom",Object.assign({value:55},i.PROP_NUMBER)],["offsetleft",Object.assign({value:75},i.PROP_NUMBER)],["offsetright",Object.assign({value:25},i.PROP_NUMBER)],["offsettop",Object.assign({value:25},i.PROP_NUMBER)],["orderby",i.PROP_STRING],["reducexticks",Object.assign({value:!0},i.PROP_BOOLEAN)],["shape",Object.assign({value:"circle"},i.PROP_STRING)],["show",Object.assign({value:!0},i.PROP_BOOLEAN)],["showlabels",Object.assign({value:"outside"},i.PROP_STRING)],["showlabelsoutside",Object.assign({value:!0},i.PROP_BOOLEAN)],["showlegend",Object.assign({value:"top"},i.PROP_STRING)],["showvalues",Object.assign({value:!1},i.PROP_BOOLEAN)],["showxaxis",Object.assign({value:!0},i.PROP_BOOLEAN)],["showxdistance",Object.assign({value:!1},i.PROP_BOOLEAN)],["showyaxis",Object.assign({value:!0},i.PROP_BOOLEAN)],["showydistance",Object.assign({value:!1},i.PROP_BOOLEAN)],["staggerlabels",Object.assign({value:!1},i.PROP_BOOLEAN)],["subheading",i.PROP_STRING],["theme",i.PROP_STRING],["title",i.PROP_STRING],["tooltips",Object.assign({value:!0},i.PROP_BOOLEAN)],["type",i.PROP_STRING],["viewtype",Object.assign({value:"Grouped"},i.PROP_STRING)],["xaxisdatakey",i.PROP_STRING],["xaxislabel",i.PROP_STRING],["xaxislabeldistance",Object.assign({value:12},i.PROP_NUMBER)],["xdateformat",i.PROP_STRING],["xdomain",Object.assign({value:"Default"},i.PROP_STRING)],["xnumberformat",i.PROP_STRING],["xunits",i.PROP_STRING],["yaxisdatakey",i.PROP_STRING],["yaxislabel",i.PROP_STRING],["yaxislabeldistance",Object.assign({value:12},i.PROP_NUMBER)],["ydomain",Object.assign({value:"Default"},i.PROP_STRING)],["ynumberformat",i.PROP_STRING],["yunits",i.PROP_STRING]]))},p=["Column","Line","Area","Cumulative Line","Bar","Pie","Donut","Bubble"],u=["circle","square","diamond","cross","triangle-up","triangle-down"],d=["01/01/2001","01/01/2002","01/01/2003"],h={Terrestrial:{colors:["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],tooltip:{backgroundColor:"#de7d28",textColor:"#FFFFFF"}},Annabelle:{colors:["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],tooltip:{backgroundColor:"#2e306f",textColor:"#FFFFFF"}},Azure:{colors:["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b","#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696","#bdbdbd","#d9d9d9"],tooltip:{backgroundColor:"#3182bd",textColor:"#FFFFFF"}},Retro:{colors:["#0ca7a1","#ffa615","#334957","#acc5c2","#988f90","#8accc9","#515151","#f27861","#36c9fd","#794668","#0f709d","#0d2738","#44be78","#4a1839","#6a393f","#557d8b","#6c331c","#1c1c1c","#861500","#09562a"],tooltip:{backgroundColor:"#80513a",textColor:"#FFFFFF"}},Mellow:{colors:["#f0dcbf","#88c877","#aeb918","#2e2c23","#ddddd2","#dfe956","#4c963b","#5d3801","#e1eec3","#cd8472","#fcfab3","#9a4635","#9295ad","#2e3f12","#565677","#557d8b","#4f4d02","#0c0c1b","#833324","#24120e"],tooltip:{backgroundColor:"#7c9e73",textColor:"#FFFFFF"}},Orient:{colors:["#a80000","#cc6c3c","#f0e400","#000084","#fccc6c","#009c6c","#cc309c","#78cc00","#fc84e4","#48e4fc","#4878d8","#186c0c","#606060","#a8a8a8","#000000","#d7d7d7","#75a06e","#190d0b","#888888","#694b84"],tooltip:{backgroundColor:"#c14242",textColor:"#FFFFFF"}},GrayScale:{colors:["#141414","#353535","#5b5b5b","#848484","#a8a8a8","#c3c3c3","#e0e0e0","#c8c8c8","#a5a5a5","#878787","#656565","#4e4e4e","#303030","#1c1c1c","#4f4f4f","#3b3b3b","#757575","#606060","#868686","#c1c1c1"],tooltip:{backgroundColor:"#575757",textColor:"#FFFFFF"}},Flyer:{colors:["#3f454c","#5a646e","#848778","#cededf","#74c4dd","#0946ed","#380bb1","#000ff0","#f54a23","#1db262","#bca3aa","#ffa500","#a86b32","#63a18c","#56795e","#934343","#b75f5f","#752d2d","#4e1111","#920606"],tooltip:{backgroundColor:"#47637c",textColor:"#FFFFFF"}},Luminosity:{colors:["#FFFFFF","#e4e4e4","#00bcd4","#f0dd2f","#00aabf","#018376","#e91e63","#39e5d4","#ff6d6d","#00ff76","#ff9800","#969696","#ff4200","#e00000","#95cbe5","#5331ff","#fff4a7","#e7a800","#0061e4","#d5e7ff"],tooltip:{backgroundColor:"#47637c",textColor:"#FFFFFF"}}},m=["xaxislabel","yaxislabel","xunits","yunits","xnumberformat","xdateformat","ynumberformat","showvalues","showlabels","viewtype","areaviewtype","staggerlabels","reducexticks","offsettop","offsetbottom","offsetright","offsetleft","barspacing","xaxislabeldistance","yaxislabeldistance","theme","labeltype","donutratio","showlabelsoutside","showxdistance","showydistance","shape","nodatamessage","captions","showxaxis","showyaxis","centerlabel","customcolors","showlegend","legendtype","xdomain","ydomain","tooltips","linethickness","highlightpoints","interpolation","labelthreshold"],f={small:.3,medium:.5,large:.8},g={small:.3,medium:.6,large:.7},v=_.invert(f),y=_.invert(g),b={Thousand:{prefix:"K",divider:1e3},Million:{prefix:"M",divider:1e6},Billion:{prefix:"B",divider:1e9}},w="#preview-chart",P=["Column","Line","Pie","Bar","Donut","Bubble"],O=["Line","Area","Cumulative Line"],S=["Cumulative Line","Area"],E="Europe",T="Asia",R="America",A="Australia",C=function(e){return"Bar"===e},I=function(e){return"Donut"===e},D=function(e){return"Bubble"===e},N=function(e){return"Area"===e},x=function(e){return function(e){return"Pie"===e}(e)||I(e)},k=function(e){return _.includes(P,e)||!_.includes(p,e)},M=function(e){return _.includes(O,e)},L=function(e,t){return"value"===t?f[e]:"key"===t?v[e]:void 0},F=function(e,t){return"value"===t?g[e]:"key"===t?y[e]:void 0},j=function(e){return function(e,t,n){var i=[],o=[],r=[],a=[],s=[],l=[],c=[],p=[],d=[],h=[];switch(e){case"jsonFormat":i=[{x:"01/01/2001",y:4e6},{x:"01/01/2002",y:1e6},{x:"01/01/2003",y:5e6}],o=[{x:"01/01/2001",y:3e6},{x:"01/01/2002",y:4e6},{x:"01/01/2003",y:7e6}],r=[{x:"01/01/2001",y:2e6},{x:"01/01/2002",y:8e6},{x:"01/01/2003",y:6e6}],h[0]={values:i,key:E},t>=2&&(h[1]={values:o,key:T}),t>=3&&(h[2]={values:r,key:R});break;case"lineChartFormat":i=[{x:1,y:4e6},{x:2,y:1e6},{x:3,y:5e6}],o=[{x:1,y:3e6},{x:2,y:4e6},{x:3,y:7e6}],r=[{x:1,y:2e6},{x:2,y:8e6},{x:3,y:6e6}],h[0]={values:i,key:E},t>=2&&(h[1]={values:o,key:T}),t>=3&&(h[2]={values:r,key:R});break;case"arrayFormat":a=[[1,4e6],[2,1e6],[3,5e6]],s=[[1,3e6],[2,4e6],[3,7e6]],l=[[1,2e6],[2,8e6],[3,6e6]],h[0]={values:a,key:E},t>=2&&(h[1]={values:s,key:T}),t>=3&&(h[2]={values:l,key:R});break;case"bubbleFormat":c=[{x:80.66,y:33739900,size:78,shape:n="random"===n?u[Math.floor(Math.random()*u.length)]:n},{x:79.84,y:81902300,size:90,shape:n},{x:78.6,y:5523100,size:45,shape:n}],p=[{x:72.73,y:79716200,size:98,shape:n},{x:80.05,y:61801600,size:20,shape:n},{x:72.49,y:73137200,size:34,shape:n}],d=[{x:68.09,y:33739900,size:45,shape:n},{x:81.55,y:7485600,size:78,shape:n},{x:68.6,y:14185e4,size:56,shape:n}],h[0]={values:c,key:E},t>=2&&(h[1]={values:p,key:T}),t>=3&&(h[2]={values:d,key:R});break;case"pieChartFormat":h=[{x:E,y:1e6},{x:T,y:2e6},{x:R,y:3e6},{x:A,y:4e6}]}return h}(function(e){var t=e.type;return function(e){return"Line"===e}(t)?"lineChartFormat":x(t)?"pieChartFormat":D(t)?"bubbleFormat":k(t)?"jsonFormat":"arrayFormat"}(e),_.split(e.yaxisdatakey,",").length,e.shape)},B=function(e,t){return!("Min"!==e[t+"domain"]||(n=e.type,!function(e){return"Column"===e}(n)&&!N(n)));var n},G=function(e){return!(!_.isFinite(e.min)||!_.isFinite(e.max))},V=function(e){var t=Math.floor(e);return Math.abs(e)-t>0?e-.1:t-1},U=function(e,t){return isNaN(parseInt(e,10))?t(e,"value"):e},W=function(e,t){return e=e||"%x",d3.time.format(e)(new Date(moment(moment(t).format()).valueOf()))},q=function(e,t){var n,i,o;return n=d3.format(e)(t),e?(i=b[e]&&b[e].divider||0,(o=b[e]&&b[e].prefix)&&0!==i&&(n=d3.format(".2f")(t/i)+o)):n=t>=1e3?d3.format(".1s")(t):t,n},z=function(e){return"false"!==e&&!1!==e&&("true"===e||!0===e||"hide"!==e)},H=function(e,t,n,i){e.tooltip.contentGenerator((function(e){var o,r=e.data.x;return o=q(t.ynumberformat,e.data.y),x(n.type)&&(i=e.data.x,r=""),'<table><tbody><tr class="value"><b>'+r+'</b></tr><tr><td class="legend-color-guide"><div style="background-color:'+e.color+';"></div></td><td class="key">'+i+'</td><td class="value">'+o+"</td></tr></tbody></table>"}))},Y=function(e,t,n,i,o){i=function(e,t){return t&&!r.isEmptyObject(t)||(t={}),_.forEach(m,(function(n){_.isUndefined(t[n])&&(t[n]=e[n])})),t}(e,i);var a,s,l,c,u,v,y,b,w,P=[],O={},S={};switch(e.type){case"Column":v=U(i.barspacing,L)||f.medium,a=nv.models.multiBarChart().x((function(e){return e.x})).y((function(e){return e.y})).reduceXTicks(i.reducexticks).rotateLabels(0).showControls(!1).stacked("Stacked"===i.viewtype).groupSpacing(v);break;case"Cumulative Line":a=nv.models.cumulativeLineChart().x((function(e){return e[0]})).y((function(e){return e[1]})).showControls(!1).useInteractiveGuideline(i.tooltips).interpolate(i.interpolation);break;case"Line":a=nv.models.lineChart().useInteractiveGuideline(i.tooltips).interpolate(i.interpolation);break;case"Area":a=nv.models.stackedAreaChart().x((function(e){return e[0]})).y((function(e){return e[1]})).clipEdge(!0).showControls(!1).style(i.areaviewtype).useInteractiveGuideline(i.tooltips).interpolate(i.interpolation);break;case"Bar":v=U(i.barspacing,L)||f.medium,a=nv.models.multiBarHorizontalChart().x((function(e){return e.x})).y((function(e){return e.y})).showControls(!1).stacked("Stacked"===i.viewtype).showValues(i.showvalues).groupSpacing(v);break;case"Pie":case"Donut":c=function(e,t,n){var i={};switch(e){case"hide":i.showlabels=!1;break;case"inside":i.showlabels=!0,i.showlabelsoutside=!1;break;case"outside":i.showlabels=!0,i.showlabelsoutside=!0}return i}(i.showlabels,i.showlabelsoutside),u=U(i.donutratio,F)||g.medium,a=nv.models.pieChart().x((function(e){return e.x})).y((function(e){return e.y})).showLabels(c.showlabels).labelType(i.labeltype).valueFormat(d3.format("%")).title(i.centerlabel).labelThreshold(i.labelthreshold||.01).labelsOutside(c.showlabelsoutside),I(e.type)&&a.donut(!0).donutRatio(u),"key-value"===i.labeltype&&a.labelType((function(e){return e.data.x+" "+e.data.y}));break;case"Bubble":a=nv.models.scatterChart().x((function(e){return e.x})).y((function(e){return e.y})).showDistX(i.showxdistance).showDistY(i.showydistance)}return t&&(O.min=t.min.x||t.min[0],O.max=t.max.x||t.max[0],G(O)&&(O.min=V(O.min),a.xDomain([O.min,O.max]))),n&&(S.min=n.min.y||n.min[1],S.max=n.max.y||n.max[1],G(S)&&(S.min=V(S.min),a.yDomain([S.min,S.max]))),a.legend.vers(i.legendtype&&i.legendtype.toLowerCase()||"furious"),_.includes(p,e.type)||(a=nv.models.multiBarChart().x((function(e){return e.x})).y((function(e){return e.y}))),x(e.type)?("percent"===i.labeltype?a.valueFormat(d3.format("%")):a.valueFormat((function(e){return q(i.ynumberformat,e)})),H(a,i,e)):(a.showXAxis(i.showxaxis).showYAxis(i.showyaxis),s=i.xaxislabel||r.prettifyLabels(e.xaxisdatakey)||"x caption",l=i.yaxislabel||r.prettifyLabels(e.yaxisdatakey)||"y caption",e.yaxisdatakey&&e.yaxisdatakey.split(",").length>1&&(w=!0),w||D(e.type)||H(a,i,e,l),s+=i.xunits?"("+i.xunits+")":"",l+=i.yunits?"("+i.yunits+")":"",a.xAxis.axisLabel(s).axisLabelDistance(i.xaxislabeldistance).staggerLabels(i.staggerlabels),i.xdateformat||o&&!D(e.type)?M(e.type)?a.xAxis.tickFormat((function(t){return b=o?d[t-1]:e.xDataKeyArr[t],W(i.xdateformat,b)})):a.xAxis.tickFormat((function(e){return W(i.xdateformat,e)})):i.xnumberformat?a.xAxis.tickFormat((function(e){return q(i.xnumberformat,e)})):M(e.type)&&a.xAxis.tickFormat((function(t){return e.xDataKeyArr[t]})),a.yAxis.axisLabel(l).axisLabelDistance(i.yaxislabeldistance).staggerLabels(i.staggerlabels).tickFormat((function(e){return q(i.ynumberformat,e)})),C(e.type)&&a.valueFormat((function(e){return q(i.ynumberformat,e)}))),_.isString(i.customcolors)&&i.customcolors&&(P=_.split(i.customcolors,",")),_.isArray(i.customcolors)&&(P=i.customcolors),y=z(i.showlegend),a.showLegend(y).margin({top:i.offsettop,right:i.offsetright,bottom:i.offsetbottom,left:i.offsetleft}).color(P.length?P:h[i.theme].colors),a.tooltip.enabled(i.tooltips),e.message=i.nodatamessage||"No data found",a.noData(e.message),M(e.type)&&e.highlightpoints&&a.dispatch.on("stateChange",(function(){setTimeout((function(){return K(e)}),100)})),!e.showlegend||"Donut"!==e.type&&"Pie"!==e.type||"right"===e.showlegend&&a.legendPosition("right"),a},K=function(e,t){var n=t?null:e.$id;M(e.type)&&(function(e,t){t=t||1.5,(e?d3.select("#wmChart"+e+" svg"):d3.select(w+" svg")).selectAll(".nv-line").style({"stroke-width":t})}(n,e.linethickness),function(e,t){var n=e?d3.select("#wmChart"+e+" svg"):d3.select(w+" svg");t?n.selectAll(".nv-point").style({"stroke-width":"6px","fill-opacity":".95","stroke-opacity":".95"}):n.selectAll(".nv-point").style({"stroke-width":"0px","fill-opacity":"0"})}(n,e.highlightpoints)),e.showlegend&&function(e,t,n){var i,o=z(e.showlegend),r=n?"#wmChart"+n:w,a=d3.select(r+" .nv-legendWrap");if(o&&a[0][0]&&"bottom"===t){var s=a[0][0].getBoundingClientRect().height,l=d3.select(r+" .nv-wrap"),c=l&&l.attr("transform")?l.attr("transform").replace(/, /g,","):"",p=/translate\(\s*([^\s,)]+)[ ,]([^\s,)]+)/.exec(c);a.attr("transform","translate(0 , "+(0===(i=$(r+" svg>.nvd3.nv-wrap")[0].getBoundingClientRect().height)&&(i=$(r+" svg")[0].getBoundingClientRect().height-(s+15)),i-s-5+")")),p&&l.attr("transform","translate("+p[1]+",5)")}}(e,e.showlegend,n)},Q={widgetType:"wm-chart",hostClass:"app-chart"},X="none",J=["aggregation","aggregationcolumn","groupby","orderby"],Z={Column:"rect.nv-bar",Bar:"g.nv-bar",Area:".nv-stackedarea .nv-point","Cumulative Line":".nv-cumulativeLine .nv-scatterWrap path.nv-point",Line:".nv-lineChart .nv-scatterWrap path.nv-point",Pie:".nv-pieChart .nv-slice path",Donut:".nv-pieChart .nv-slice path",Bubble:".nv-scatterChart .nv-point-paths path"},ee={fontunit:"font-size",fontsize:"font-size",color:"fill",fontfamily:"font-family",fontweight:"font-weight",fontstyle:"font-style",textdecoration:"text-decoration"},te={average:"AVG",count:"COUNT",maximum:"MAX",minimum:"MIN",sum:"SUM"},ne=function(e){return!0===e||"true"===e||!1!==e&&"false"!==e&&e},ie=ne,oe=function(e){var t,n=[],i=[];return _.forEach(_.split(e,","),(function(e){t=_.split(e,":"),n.push(t[0]),i.push(t[1])})),{columns:n,orders:i}},re=oe,ae=function(e){return e?e.replace(/\./g,"$"):null},se=ae,le=function(e,t){d3.select("#wmChart"+t+" svg").selectAll("text").style(e)},ce=le,pe=function(e){var t=90*(e.startAngle+e.endAngle)/Math.PI-90;return t>90?t-180:t},ue=pe,de=function(e){function t(t,n){var o=e.call(this,t,Q)||this;return o.app=n,o.iconclass="",o.nonPrimaryColumns=[],o.xDataKeyArr=[],o.chartData=[],o._processedData=[],o._subsciptions=[],o._plotChartProxy=_.debounce(o.plotChartProxy.bind(o),100),o.redraw=o._plotChartProxy.bind(o),i.styler(o.nativeElement,o,i.APPLY_STYLES_TYPE.CONTAINER,["fontsize","fontunit","color","fontfamily","fontweight","fontstyle","textdecoration"]),o.$id=o.widgetId||Math.random(),r.removeAttr(o.nativeElement,"title"),o.chartReady=!1,o.binddataset=o.nativeElement.getAttribute("dataset.bind"),o._subsciptions.push(o.app.subscribe("toggle-variable-state",o.handleLoading.bind(o))),o._subsciptions.push(o.app.subscribe("iscroll-start",(function(){o.hideTooltip()}))),o}return function(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)}(t,e),t.prototype.isGroupByEnabled=function(){return!(!this.groupby||this.groupby===X)},t.prototype.isValidAxis=function(){return!this.binddataset||this.xaxisdatakey&&this.yaxisdatakey},t.prototype.isAggregationEnabled=function(){return!(!this.isGroupByEnabled()||this.aggregation===X||!this.aggregationcolumn)},t.prototype.isDataFilteringEnabled=function(){return this.isAggregationEnabled()||!this.isVisuallyGrouped&&this.orderby},t.prototype.getxAxisVal=function(e,t,n){var i=_.get(e,t);return M(this.type)&&!r.isNumberType(this.xAxisDataType)?(this.xDataKeyArr.push(i),i instanceof Date?i:n):i},t.prototype.getXMinMaxValues=function(e){if(e){var t={};return t.min=_.minBy(e.values,(function(e){return e.x||e[0]})),t.max=_.maxBy(e.values,(function(e){return e.x||e[0]})),t}},t.prototype.getYMinMaxValues=function(e){var t={},n=[],i=[];if(e)return _.forEach(e,(function(e){n.push(_.minBy(e.values,(function(e){return e.y||e[1]}))),i.push(_.maxBy(e.values,(function(e){return e.y||e[1]})))})),t.min=_.minBy(n,(function(e){return e.y||e[1]})),t.max=_.maxBy(i,(function(e){return e.y||e[1]})),t},t.prototype.getValidData=function(e){return 1===e.length&&void 0===e[0]?[]:e},t.prototype.valueFinder=function(e,t,n,i,o){var r,a=this.getxAxisVal(e,t,i),s=_.get(e,n),l=parseFloat(s)||s,c=parseFloat(e[this.bubblesize])||2,p={};return k(this.type)?(p.x=a,p.y=l,D(this.type)&&(p.size=c,p.shape=o||"circle")):(r=this.type,_.includes(S,r)&&(p=[a,l])),p._dataObj=e,p},t.prototype.setErrMsg=function(e){this.showNoDataMsg&&(this.showContentLoadError=!0,this.invalidConfig=!0,this.errMsg="")},t.prototype.processChartData=function(){var e=this;if(this.sampleData=j(this),this.xDataKeyArr=[],!this.binddataset)return this.xDataKeyArr=d,this.sampleData;if(!this.chartData||!this.chartData.length)return[];var t,n=[],i=[],o=[],a=this.xaxisdatakey,s=this.yaxisdatakey?this.yaxisdatakey.split(","):[],l=this.chartData;return _.isArray(l)&&(x(this.type)?(t=s[0],n=_.map(l,(function(n,i){if(!r.isEmptyObject(l[i]))return e.valueFinder(l[i],a,t)})),n=this.getValidData(n)):(D(this.type)&&(i="random"===this.shape?u:this.shape),s.forEach((function(t,s){o=_.map(l,(function(n,o){if(!r.isEmptyObject(l[o]))return e.valueFinder(l[o],a,t,o,_.isArray(i)&&i[s]||e.shape)})),o=e.getValidData(o),n.push({values:o,key:r.prettifyLabels(t)})})))),n},t.prototype.setChartData=function(e){e&&(this._processedData=e)},t.prototype.getChartData=function(){return this._processedData},t.prototype.getVisuallyGroupedData=function(e,t){var n,i,o=this,r={},a=[],s=[],l=N(this.type),c=_.first(_.split(this.yaxisdatakey,","));return this.xDataKeyArr=[],e=_.orderBy(e,_.split(this.groupby,",")),this.orderby&&(n=oe(this.orderby),e=_.orderBy(e,n.columns,n.orders)),e=_.groupBy(e,t),l&&(i=_.max(_.map(e,(function(e){return e.length})))),_.forEach(e,(function(e,t){a=N?_.fill(new Array(i),[0,0]):[],_.forEachRight(e,(function(e,t){a[t]=o.valueFinder(e,o.xaxisdatakey,c,t)})),r={key:t,values:a},s.push(r)})),s},t.prototype.getGroupingDetails=function(){var e=this;if(this.isGroupByEnabled()&&!this.isAggregationEnabled()){var t,n,i,o=!1,r=[],a=this.groupby&&this.groupby!==X?this.groupby.split(","):[],s=this.yaxisdatakey?this.yaxisdatakey.split(","):[];return a.length>1&&(a.every((function(n,r){return e.xaxisdatakey===n||-1!==$.inArray(n,s)||(o=!0,t=n,i=r,a.splice(i,1),!1)})),t&&r.push(t),a.length&&(r=_.concat(r,a))),this.xaxisdatakey!==this.aggregationcolumn&&r.push(this.xaxisdatakey),_.forEach(s,(function(t){t!==e.aggregationcolumn&&r.push(t)})),n=r.join(","),this.isVisuallyGrouped=o,{expression:n,isVisuallyGrouped:o,visualGroupingColumn:t}}return{expression:"",isVisuallyGrouped:!1,visualGroupingColumn:""}},t.prototype.getAggregatedData=function(e){var t,n,i,o=this,a=this.datasource,s=this.yaxisdatakey?this.yaxisdatakey.split(","):[],l={},c=[],p=[];a&&(this.isGroupByEnabled()&&(p=_.split(this.groupby,",")),this.orderby&&(t=_.replace(this.orderby,/:/g," "),c=_.uniq(_.concat(c,p,[this.aggregationcolumn])),i=oe(this.orderby).columns,_.forEach(_.intersection(c,i),(function(e){n=ae(e),t=_.replace(t,e,n)}))),this.isAggregationEnabled()&&(l.groupByFields=p,l.aggregations=[{field:this.aggregationcolumn,type:te[this.aggregation],alias:ae(this.aggregationcolumn)}]),a.execute("getAggregatedData",{aggregations:l,sort:t}).then((function(t){var n=[],i=ae(o.aggregationcolumn),a=ae(o.xaxisdatakey),l=[];s.forEach((function(e){return l.push(ae(e))})),_.forEach(t.body.content,(function(e){var t={};o.isAggregationEnabled()&&(t[o.aggregationcolumn]=e[i],t[o.aggregationcolumn]=_.get(e,i)||_.get(e,o.aggregationcolumn)),t[o.xaxisdatakey]=_.get(e,a)||_.get(e,o.xaxisdatakey),s.forEach((function(n,i){t[n]=e[l[i]],t[n]=_.get(e,l[i])||_.get(e,n)})),n.push(t)})),o.chartData=n,r.triggerFn(e)}),(function(){o.chartData=[],o.setErrMsg("MESSAGE_ERROR_FETCH_DATA"),r.triggerFn(e)})))},t.prototype.setLabelsMaxWidth=function(){var e,t,n,i,o,r,a,s,l,c,p,u,d=parseInt(this.fontsize,10)||12,h=C(this.type);(e=$("#wmChart"+this.$id+" svg").find("g.nv-x").find("g.tick").find("text")).each((function(){var e,n,r=$(this);if(r.text()&&"1"===r.css("opacity"))return e=r.parent().attr("transform").split(","),i=parseFloat(e[0].substr(10)),o=parseFloat(e[1]||"0"),!h&&i>0?n=i:o>0&&(n=o),t?(t=n-t,!1):(t=n,!0)})),h?(c=$("#wmChart"+this.$id+" svg>g.nv-wrap>g>g.nv-barsWrap")[0],p=$("#wmChart"+this.$id+" svg>g.nv-wrap>g>g.nv-y")[0],u=$("#wmChart"+this.$id+" svg")[0],r=c?c.getBoundingClientRect().height:0,l=p?u.getBoundingClientRect().width-p.getBoundingClientRect().width:u.getBoundingClientRect().width,n=Math.round(l/d),t<d&&(a=r/d,s=Math.ceil(this.chartData.length/a),d3.select("#wmChart"+this.$id+" svg").select("g.nv-x").selectAll("g.tick").select("text").each((function(e,t){t%s!=0&&d3.select(this).attr("opacity",0)})))):n=Math.round(t/d),n=Math.abs(n),e.each((function(){this.textContent.length>n&&(this.textContent=this.textContent.substr(0,n)+"...")}))},t.prototype.getDefaultColumns=function(){var e,t,n,i,o=[],a=this.datasource.execute(r.DataSource.Operation.GET_PROPERTIES_MAP)||[];for(n=0;n<a.length&&o.length<=2;n+=1)e=a[n].type,!a[n].isRelated&&r.isNumberType(e)?o.push(a[n].fieldName):"string"!==e||t||(t=a[n].fieldName);return t&&o.length>0&&!D(this.type)&&(i=o[0],o[0]=t,o[1]=i),o},t.prototype.attachClickEvent=function(){var e,t=this;d3.select("#wmChart"+this.$id+" svg").selectAll(Z[this.type]).style("pointer-events","all").on("click",(function(n,i){switch(t.type){case"Column":case"Bar":e=n._dataObj;break;case"Pie":case"Donut":e=n.data._dataObj;break;case"Area":case"Cumulative Line":case"Line":e=n[0]._dataObj;break;case"Bubble":e=n.data.point[4]._dataObj}t.selecteditem=e,t.invokeEventCallback("select",{$event:d3.event,selectedChartItem:n,selectedItem:t.selecteditem})}))},t.prototype.postPlotProcess=function(e){var t,n,i,o,a=this,s={},l=this.$element;K(this),x(this.type)?this.showlabelsoutside||(n=(t=d3.select("#wmChart"+this.$id+" svg")).select(".nv-pieLabels").selectAll(".nv-label"),i=t.select(".nv-pie").selectAll(".nv-slice"),o=[],i&&i.length&&(i.each((function(){d3.select(this).attr("transform",(function(e){o.push(pe(e))}))})),n.each((function(e,t){var n=d3.select(this);$(n[0][0]).find("text").attr("transform","rotate("+o[t]+")")})))):this.setLabelsMaxWidth(),_.forEach(ee,(function(e,t){s[e]="fontsize"===t||"fontunit"===t?a.fontsize+a.fontunit:a[t]})),le(s,this.$id),r.triggerFn(this._resizeFn&&this._resizeFn.clear),this._resizeFn=nv.utils.windowResize((function(){l[0].getBoundingClientRect().height&&(e.update(),K(a),x(a.type)||a.setLabelsMaxWidth())}))},t.prototype.configureChart=function(){var e,t,n,i;if(this._processedData.length>0&&(B(this,"x")&&(e=this.binddataset?this.getXMinMaxValues(this._processedData[0]):{min:{x:1},max:{x:5}}),B(this,"y")&&(t=this.binddataset?this.getYMinMaxValues(this._processedData):{min:{y:1},max:{y:5}})),!x(this.type)||this.binddataset&&this.scopedataset||(this._processedData=r.getClonedObject(this.scopedataset||this._processedData)),n=Y(this,e,t,null,!this.binddataset),_.isArray(this._processedData)){var o=$("#wmChart"+this.$id+" svg").find("g.nv-x").find("g.tick");return o&&o.length&&o.remove(),(i=this.invokeEventCallback("beforerender",{chartInstance:n}))&&(n=i),this.chart=n,d3.select("#wmChart"+this.$id+" svg").datum(this._processedData).call(this.chart),this.postPlotProcess(n),n}},t.prototype.plotChart=function(){var e=this,t=this.$element;this.chartData=this.invokeEventCallback("transform")||this.chartData,this.isVisuallyGrouped&&!x(this.type)?this._processedData=this.chartData:this._processedData=this.processChartData(),t[0].getBoundingClientRect().height&&(this.clearCanvas&&(t.find("svg").replaceWith("<svg></svg>"),this.clearCanvas=!1),this.isValidAxis()||(this._processedData=[]),nv.addGraph((function(){return e.configureChart()}),(function(){setTimeout((function(){e.attachClickEvent()}),600)})),this.isLoadInProgress=!1)},Object.defineProperty(t.prototype,"isLiveVariable",{get:function(){var e=this.datasource;return e&&"wm.LiveVariable"===e.category},enumerable:!1,configurable:!0}),t.prototype.plotChartProxy=function(){var e=this;this.showContentLoadError=!1,this.invalidConfig=!1,this.isLoadInProgress=!0;var t=this.getGroupingDetails();this.binddataset&&this.isLiveVariable&&(this.filterFields||this.isDataFilteringEnabled())?this.getAggregatedData((function(){return e.plotChart()})):(this.dataset&&this.isLiveVariable&&(this.chartData=this.dataset,this.isGroupByEnabled()&&t.isVisuallyGrouped&&(this.chartData=this.getVisuallyGroupedData(this.chartData,t.visualGroupingColumn))),this.plotChart())},t.prototype.setDefaultAxisOptions=function(){var e=this.getDefaultColumns();this.xaxisdatakey=e[0]||null,this.yaxisdatakey=e[1]||null},t.prototype.getCutomizedOptions=function(e,t){var n,i=_.split(this.groupby,","),o=_.split(this.aggregationcolumn,",");if(!this.binddataset)return t;switch(this.axisoptions||(this.axisoptions=t),e){case"xaxisdatakey":this.isGroupByEnabled()&&(n=i);break;case"yaxisdatakey":this.isAggregationEnabled()?n=o:this.isLiveVariable&&(n=this.numericColumns);break;case"groupby":this.isLiveVariable&&this.nonPrimaryColumns&&this.nonPrimaryColumns.length&&(n=this.nonPrimaryColumns);break;case"aggregationcolumn":this.isLiveVariable&&this.isAggregationEnabled()&&"count"!==this.aggregation&&(n=this.numericColumns);break;case"orderby":this.isLiveVariable&&this.isAggregationEnabled()&&(n=_.uniq(_.concat(i,o)));break;case"bubblesize":this.numericColumns&&this.numericColumns.length&&(n=this.numericColumns)}return n||t||this.axisoptions},t.prototype.setNumericandNonPrimaryColumns=function(){var e,t,n=this,i=this.datasource.execute(r.DataSource.Operation.GET_PROPERTIES_MAP);this.numericColumns=[],this.nonPrimaryColumns=[],this.dataset&&!_.isEmpty(i)&&(e=[]),e&&(_.forEach(Object.keys(e),(function(i){t=e[i].type,r.isNumberType(t)&&n.numericColumns.push(i),"true"!==e[i].isRelatedPk&&e[i].isPrimaryKey||n.nonPrimaryColumns.push(i)})),this.numericColumns=this.numericColumns.sort(),this.nonPrimaryColumns=this.nonPrimaryColumns.sort())},t.prototype.handleDataSet=function(e){this.errMsg="",e||this.binddataset||(this.isVisuallyGrouped=!1,this.axisoptions=null),this.chartData=this.isLiveVariable?e||"":e&&""===e.dataValue&&1===_.keys(e).length?"":e,!_.isArray(this.chartData)&&_.isObject(this.chartData)&&(this.chartData=[this.chartData]),e&&e.filterFields&&(this.filterFields=e.filterFields),this.chartData&&this._plotChartProxy()},t.prototype.setDonutCenterLabel=function(e){var t;(t=d3.select("#wmChart"+this.$id+" svg").select(".nv-wrap.nv-pie").select(".nv-pie")).text(""),t.append("text").attr("dy",".35em").attr("text-anchor","middle").attr("class","nv-pie-title").text(e).each((function(e){var t=d3.select(this),n=d3.select(this.parentElement),i=Number(n.node().getBoundingClientRect().width)-30,o=this.getComputedTextLength();t.attr("data-scale",i/o)})).style("font-size",(function(){var e=16*d3.select(this).attr("data-scale");return e>24?24:e+"px"}))},t.prototype.onPropertyChange=function(t,n,i){switch(e.prototype.onPropertyChange.call(this,t,n,i),t){case"dataset":this.handleDataSet(n);break;case"centerlabel":this.chart&&(this.chart.title(n),this.setDonutCenterLabel(n));break;case"type":x(this.type)?(this.offsettop=20,this.offsetright=0,this.offsetbottom=0,this.offsetleft=0):"Pie"!==i&&"Donut"!==i||(this.offsettop=25,this.offsetright=25,this.offsetbottom=55,this.offsetleft=75),i!==n&&(this.clearCanvas=!0),this._plotChartProxy();break;default:this._plotChartProxy()}_.includes(J,t)&&this._plotChartProxy()},t.prototype.handleLoading=function(e){var t=this.datasource;t&&t.execute(r.DataSource.Operation.IS_API_AWARE)&&r.isDataSourceEqual(e.variable,t)&&(this.variableInflight=e.active,this.isLoadInProgress=e.active)},t.prototype.hideTooltip=function(){d3.selectAll(".nvtooltip").style("opacity",0)},t.prototype.onStyleChange=function(t,n,i){var o={};switch(e.prototype.onStyleChange.call(this,t,n,i),t){case"fontsize":case"fontunit":case"color":case"fontfamily":case"fontweight":case"fontstyle":case"textdecoration":o[ee[t]]="fontsize"===t||"fontunit"===t?this.fontsize+this.fontunit:n,le(o,this.$id)}},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),_.includes(["outside","inside","hide"],this.showlabels)||(this.showlabels=ne(this.showlabels),this.showlabelsoutside=ne(this.showlabelsoutside),this.showlabels=this.showlabels?this.showlabelsoutside?"outside":"inside":"hide"),this.theme||(this.theme=x(this.type)?"Azure":"Terrestrial"),this.nativeElement.setAttribute("id","wmChart"+this.$id),this.binddataset||this.nativeElement.getAttribute("scopedataset")||this._plotChartProxy()},t.prototype.ngOnDestroy=function(){this.hideTooltip(),this._subsciptions.forEach((function(e){e()})),e.prototype.ngOnDestroy.call(this)},t}(i.StylableComponent);de.initializeProps=c(),de.decorators=[{type:t.Component,args:[{selector:"div[wmChart]",template:'<div class="panel-heading" *ngIf="title">\n <h3 class="panel-title">\n <div class="pull-left"><i class="app-icon panel-icon {{iconclass}}" [class.ng-hide]="!iconclass"></i></div>\n <div class="heading" [innerHTML]="title"></div>\n <div class="description" *ngIf="subheading" [innerHTML]="subheading"></div>\n </h3>\n</div>\n<div class="app-chart-inner" [ngClass]="{\'loading\':isLoadInProgress, \'panel-body\': title}">\n <svg></svg>\n <div class="wm-content-info readonly-wrapper" *ngIf="showContentLoadError && showNoDataMsg">\n <p class="wm-message" [title]="hintMsg" [ngClass]="{\'error\': invalidConfig}" [innerText]="errMsg"></p>\n </div>\n <div wmSpinner show.bind="isLoadInProgress" caption.bind="loadingdatamsg"></div>\n</div>\n',providers:[i.provideAsWidgetRef(de)],encapsulation:t.ViewEncapsulation.None,styles:[".nvd3 .nv-axis line,.nvd3 .nv-axis path{fill:none;shape-rendering:crispEdges}.nv-brush .extent,.nvd3 .background path,.nvd3 .nv-axis line,.nvd3 .nv-axis path{shape-rendering:crispEdges}.nv-distx,.nv-disty,.nv-noninteractive,.nvd3 .nv-axis,.nvd3.nv-pie .nv-label,.nvd3.nv-sparklineplus g.nv-hoverValue{pointer-events:none}.nvd3 .nv-axis{opacity:1}.nvd3 .nv-axis.nv-disabled,.nvd3 .nv-controlsWrap .nv-legend .nv-check-box .nv-check{opacity:0}.nvd3 .nv-axis path{stroke:#000;stroke-opacity:.75}.nvd3 .nv-axis path.domain{stroke-opacity:.75}.nvd3 .nv-axis.nv-x path.domain{stroke-opacity:0}.nvd3 .nv-axis line{stroke:#e5e5e5}.nvd3 .nv-axis .zero line,.nvd3 .nv-axis line.zero{stroke-opacity:.75}.nvd3 .nv-axis .nv-axisMaxMin text{font-weight:700}.nvd3 .x .nv-axis .nv-axisMaxMin text,.nvd3 .x2 .nv-axis .nv-axisMaxMin text,.nvd3 .x3 .nv-axis .nv-axisMaxMin text{text-anchor:middle}.nvd3 .nv-bars rect{fill-opacity:.75;transition:fill-opacity .25s linear}.nvd3 .nv-bars rect.hover{fill-opacity:1}.nvd3 .nv-bars .hover rect{fill:#add8e6}.nvd3 .nv-bars text{fill:transparent}.nvd3 .nv-bars .hover text{fill:#000}.nvd3 .nv-discretebar .nv-groups rect,.nvd3 .nv-multibar .nv-groups rect,.nvd3 .nv-multibarHorizontal .nv-groups rect{stroke-opacity:0;transition:fill-opacity .25s linear}.with-transitions .nv-candlestickBar .nv-ticks .nv-tick,.with-transitions .nvd3 .nv-groups .nv-point{transition:stroke-width .25s linear,stroke-opacity .25s linear}.nvd3 .nv-candlestickBar .nv-ticks rect:hover,.nvd3 .nv-discretebar .nv-groups rect:hover,.nvd3 .nv-multibar .nv-groups rect:hover,.nvd3 .nv-multibarHorizontal .nv-groups rect:hover{fill-opacity:1}.nvd3 .nv-discretebar .nv-groups text,.nvd3 .nv-multibarHorizontal .nv-groups text{font-weight:700;fill:#000;stroke:transparent}.nvd3 .nv-boxplot circle{fill-opacity:.5}.nvd3 .nv-boxplot circle:hover,.nvd3 .nv-boxplot rect:hover{fill-opacity:1}.nvd3 line.nv-boxplot-median{stroke:#000}.nv-boxplot-tick:hover{stroke-width:2.5px}.nvd3.nv-bullet{font:10px sans-serif}.nvd3.nv-bullet .nv-measure{fill-opacity:.8}.nvd3.nv-bullet .nv-measure:hover{fill-opacity:1}.nvd3.nv-bullet .nv-marker{stroke:#000;stroke-width:2px}.nvd3.nv-bullet .nv-markerTriangle{stroke:#000;fill:#fff;stroke-width:1.5px}.nvd3.nv-bullet .nv-markerLine{stroke:#000;stroke-width:1.5px}.nvd3.nv-bullet .nv-tick line{stroke:#666;stroke-width:.5px}.nvd3.nv-bullet .nv-range.nv-s0{fill:#eee}.nvd3.nv-bullet .nv-range.nv-s1{fill:#ddd}.nvd3.nv-bullet .nv-range.nv-s2{fill:#ccc}.nvd3.nv-bullet .nv-title{font-size:14px;font-weight:700}.nvd3.nv-bullet .nv-subtitle{fill:#999}.nvd3.nv-bullet .nv-range{fill:#bababa;fill-opacity:.4}.nvd3.nv-bullet .nv-range:hover{fill-opacity:.7}.nvd3.nv-candlestickBar .nv-ticks .nv-tick{stroke-width:1px}.nvd3.nv-candlestickBar .nv-ticks .nv-tick.hover{stroke-width:2px}.nvd3.nv-candlestickBar .nv-ticks .nv-tick.positive rect{stroke:#2ca02c;fill:#2ca02c}.nvd3.nv-candlestickBar .nv-ticks .nv-tick.negative rect{stroke:#d62728;fill:#d62728}.nvd3.nv-candlestickBar .nv-ticks line{stroke:#333}.nv-force-node{stroke:#fff;stroke-width:1.5px}.nv-force-link{stroke:#999;stroke-opacity:.6}.nv-force-node text{stroke-width:0}.nvd3 .nv-check-box .nv-box{fill-opacity:0;stroke-width:2}.nvd3 .nv-check-box .nv-check{fill-opacity:0;stroke-width:4}.nvd3 .nv-series.nv-disabled .nv-check-box .nv-check{fill-opacity:0;stroke-opacity:0}.nvd3.nv-linePlusBar .nv-bar rect{fill-opacity:.75}.nvd3.nv-linePlusBar .nv-bar rect:hover{fill-opacity:1}.nvd3 .nv-groups path.nv-line{fill:none}.nvd3 .nv-groups path.nv-area{stroke:none}.nvd3.nv-line .nvd3.nv-scatter .nv-groups .nv-point{fill-opacity:0;stroke-opacity:0}.nvd3.nv-scatter.nv-single-point .nv-groups .nv-point{fill-opacity:.5!important;stroke-opacity:.5!important}.nvd3 .nv-groups .nv-point.hover,.nvd3.nv-scatter .nv-groups .nv-point.hover{stroke-width:7px;fill-opacity:.95!important;stroke-opacity:.95!important}.nvd3 .nv-point-paths path{stroke:#aaa;stroke-opacity:0;fill:#eee;fill-opacity:0}.nvd3 .nv-indexLine{cursor:ew-resize}svg.nvd3-svg{-webkit-user-select:none;-moz-user-select:none;user-select:none;display:block;width:100%;height:100%}.nvtooltip.with-3d-shadow,.with-3d-shadow .nvtooltip{box-shadow:0 5px 10px #0003;border-radius:5px}.nvd3 text{font:400 12px Arial,sans-serif}.nvd3 .title{font:700 14px Arial,sans-serif}.nvd3 .nv-background{fill:#fff;fill-opacity:0}.nvd3.nv-noData{font-size:18px;font-weight:700}.nv-brush .extent{fill-opacity:.125}.nv-brush .resize path{fill:#eee;stroke:#666}.nvd3 .nv-legend .nv-series{cursor:pointer}.nvd3 .nv-legend .nv-disabled circle{fill-opacity:0}.nvd3 .nv-brush .extent{fill-opacity:0!important}.nvd3 .nv-brushBackground rect{stroke:#000;stroke-width:.4;fill:#fff;fill-opacity:.7}@media print{.nvd3 text{stroke-width:0;fill-opacity:1}}.nvd3.nv-ohlcBar .nv-ticks .nv-tick{stroke-width:1px}.nvd3.nv-ohlcBar .nv-ticks .nv-tick.hover{stroke-width:2px}.nvd3.nv-ohlcBar .nv-ticks .nv-tick.positive{stroke:#2ca02c}.nvd3.nv-ohlcBar .nv-ticks .nv-tick.negative{stroke:#d62728}.nvd3 .background path{fill:none;stroke:#eee;stroke-opacity:.4}.nvd3 .foreground path{fill:none;stroke-opacity:.7}.nvd3 .nv-parallelCoordinates-brush .extent{fill:#fff;fill-opacity:.6;stroke:gray;shape-rendering:crispEdges}.nvd3 .nv-parallelCoordinates .hover{fill-opacity:1;stroke-width:3px}.nvd3 .missingValuesline line{fill:none;stroke:#000;stroke-width:1;stroke-opacity:1;stroke-dasharray:5,5}.nvd3.nv-pie .nv-pie-title{font-size:24px;fill:#13c4f996}.nvd3.nv-pie .nv-slice text{stroke:#000;stroke-width:0}.nvd3.nv-pie path{transition:fill-opacity .25s linear,stroke-width .25s linear,stroke-opacity .25s linear;stroke:#fff;stroke-width:1px;stroke-opacity:1;fill-opacity:.7}.nvd3.nv-pie .hover path{fill-opacity:1}.nvd3.nv-pie .nv-label rect{fill-opacity:0;stroke-opacity:0}.nvd3 .nv-groups .nv-point.hover{stroke-width:20px;stroke-opacity:.5}.nvd3 .nv-scatter .nv-point.hover{fill-opacity:1}.nvd3.nv-sparkline path{fill:none}.nvd3.nv-sparklineplus .nv-hoverValue line{stroke:#333;stroke-width:1.5px}.nvd3.nv-sparklineplus,.nvd3.nv-sparklineplus g{pointer-events:all}.nvd3 .nv-interactiveGuideLine,.nvtooltip{pointer-events:none}.nvd3 .nv-hoverArea{fill-opacity:0;stroke-opacity:0}.nvd3.nv-sparklineplus .nv-xValue,.nvd3.nv-sparklineplus .nv-yValue{stroke-width:0;font-size:.9em;font-weight:400}.nvd3.nv-sparklineplus .nv-yValue{stroke:#f66}.nvd3.nv-sparklineplus .nv-maxValue{stroke:#2ca02c;fill:#2ca02c}.nvd3.nv-sparklineplus .nv-minValue{stroke:#d62728;fill:#d62728}.nvd3.nv-sparklineplus .nv-currentValue{font-weight:700;font-size:1.1em}.nvtooltip h3,.nvtooltip table td.key{font-weight:400}.nvd3.nv-stackedarea path.nv-area{fill-opacity:.7;stroke-opacity:0;transition:fill-opacity .25s linear,stroke-opacity .25s linear}.nvd3.nv-stackedarea path.nv-area.hover{fill-opacity:.9}.nvd3.nv-stackedarea .nv-groups .nv-point{stroke-opacity:0;fill-opacity:0}.nvtooltip{position:absolute;color:#000;padding:1px;z-index:10000;display:block;font-family:Arial,sans-serif;font-size:13px;text-align:left;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;user-select:none;background:rgba(255,255,255,.8);border:1px solid rgba(0,0,0,.5);border-radius:4px}.nvtooltip h3,.nvtooltip p{margin:0;text-align:center}.nvtooltip.with-transitions,.with-transitions .nvtooltip{transition:opacity 50ms linear;transition-delay:.2s}.nvtooltip.x-nvtooltip,.nvtooltip.y-nvtooltip{padding:8px}.nvtooltip h3{padding:4px 14px;line-height:18px;background-color:#f7f7f7bf;color:#000;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.nvtooltip p{padding:5px 14px}.nvtooltip span{display:inline-block;margin:2px 0}.nvtooltip table{margin:6px;border-spacing:0}.nvtooltip table td{padding:2px 9px 2px 0;vertical-align:middle}.nvtooltip table td.key.total{font-weight:700}.nvtooltip table td.value{text-align:right;font-weight:700}.nvtooltip table td.percent{color:#a9a9a9}.nvtooltip table tr.highlight td{padding:1px 9px 1px 0;border-bottom-style:solid;border-bottom-width:1px;border-top-style:solid;border-top-width:1px}.nvtooltip table td.legend-color-guide div{vertical-align:middle;width:12px;height:12px;border:1px solid #999}.nvtooltip .footer{padding:3px;text-align:center}.nvtooltip-pending-removal{pointer-events:none;display:none}.nvd3 line.nv-guideline{stroke:#ccc}\n"]}]}],de.ctorParameters=function(){return[{type:t.Injector},{type:r.App}]},de.propDecorators={title:[{type:t.HostBinding,args:["class.panel"]}]};var he=[de],me=function(){};me.decorators=[{type:t.NgModule,args:[{imports:[o.BasicModule,n.CommonModule,i.WmComponentsModule],declarations:l([],s(he)),exports:l([],s(he)),entryComponents:[]}]}],e.ChartComponent=de,e.ChartModule=me,e["\u02750"]=ie,e["\u02751"]=re,e["\u02752"]=se,e["\u02753"]=ce,e["\u02754"]=ue,e["\u0275a"]=c,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("ngx-bootstrap/dropdown"),require("@wm/components/base"),require("@wm/components/basic"),require("@wm/components/input"),require("@angular/router"),require("@wm/core")):"function"==typeof define&&define.amd?define("@wm/components/navigation/menu",["exports","@angular/core","@angular/common","ngx-bootstrap/dropdown","@wm/components/base","@wm/components/basic","@wm/components/input","@angular/router","@wm/core"],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.menu={}),e.ng.core,e.ng.common,e["ngx-bootstrap"].dropdown,e.wm.components.base,e.wm.components.basic,e.wm.components.input,e.ng.router,e.wm.core)}(this,(function(e,t,n,i,o,r,a,s,l){"use strict";
254
254
  /*! *****************************************************************************
255
255
  Copyright (c) Microsoft Corporation.
256
256
 
@@ -475,7 +475,7 @@ var c=function(e,t){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Arr
475
475
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
476
476
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
477
477
  PERFORMANCE OF THIS SOFTWARE.
478
- ***************************************************************************** */var s=function(e,t){return(s=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)};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(){r.register("wm-pagination",new Map([["boundarylinks",Object.assign({value:!1},r.PROP_BOOLEAN)],["class",r.PROP_STRING],["dataset",r.PROP_ANY],["directionlinks",Object.assign({value:!0},r.PROP_BOOLEAN)],["forceellipses",Object.assign({value:!0},r.PROP_BOOLEAN)],["maxResults",r.PROP_NUMBER],["maxsize",Object.assign({value:5},r.PROP_NUMBER)],["name",r.PROP_STRING],["navigation",Object.assign({value:"Basic"},r.PROP_STRING)],["navigationalign",Object.assign({value:"left"},r.PROP_STRING)],["navigationsize",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["showrecordcount",r.PROP_BOOLEAN],["tabindex",Object.assign({value:0},r.PROP_NUMBER)]]))},u={widgetType:"wm-pagination",hostClass:"app-datanavigator clearfix"},d={Pager:{small:"pager-sm",large:"pager-lg"},Basic:{small:"pagination-sm",large:"pagination-lg"},Classic:{small:"pagination-sm",large:"pagination-lg"}},h=function(e){function n(n,i){var o=e.call(this,n,u)||this;return o.parent=i,o.resultEmitter=new t.EventEmitter,o.maxResultsEmitter=new t.EventEmitter,o.dn={currentPage:1},o.pageCount=0,o.isDisableNext=!0,o.isDisablePrevious=!0,o.isDisableFirst=!0,o.isDisableLast=!0,o._debouncedApplyDataset=a.debounce((function(){return o.widget.dataset=o.dataset}),r.DEBOUNCE_TIMES.PAGINATION_DEBOUNCE_TIME),o._debouncedPageChanged=a.debounce((function(e){var t=e&&e.page;if(t!==o.dn.currentPage){var n=o.parent||o;o.dn.currentPage=t,n.invokeEventCallback("paginationchange",{$event:void 0,$index:o.dn.currentPage}),o.goToPage(),"Basic"===o.navigation&&o._setAriaForBasicNavigation()}}),r.DEBOUNCE_TIMES.PAGINATION_DEBOUNCE_TIME),r.styler(o.nativeElement,o),o}return function(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}s(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(n,e),n.prototype._setAriaForBasicNavigation=function(){_.forEach(this.nativeElement.getElementsByTagName("a"),(function(e){e.setAttribute("href","javascript:void(0);");var t=e.querySelector("span");"true"===(null==t?void 0:t.dataset.isacitvepage)&&(e.setAttribute("aria-current","true"),setTimeout((function(){return e.focus()}))),"true"===(null==t?void 0:t.dataset.isdisabled)?e.setAttribute("aria-disabled","true"):e.removeAttribute("aria-disabled")}))},n.prototype.setResult=function(e){this.result=e,this.resultEmitter.emit(this.result)},n.prototype.updateNavSize=function(){var e=d[this.navcontrols];e&&this.navigationsize?this.navigationClass=e[this.navigationsize]:this.navigationClass=""},n.prototype.resetPageNavigation=function(){this.pageCount=0,this.dn.currentPage=1,this.dataSize=0},n.prototype.calculatePagingValues=function(){this.pageCount=this.dataSize>this.maxResults?Math.ceil(this.dataSize/this.maxResults):this.dataSize<0?0:1,this.dn.currentPage=this.dn.currentPage||1},n.prototype.setDefaultPagingValues=function(e,t,n){e||t?(this.maxResults=t||this.maxResults,this.dataSize=a.isDefined(e)?e:this.dataSize,this.dn.currentPage=n||this.dn.currentPage,this.calculatePagingValues()):(this.pageCount=1,this.dn.currentPage=1,this.maxResults=e,this.dataSize=e),this.maxResultsEmitter.emit(this.maxResults)},n.prototype.checkDataSize=function(e,t,n){-1===e||e===a.AppConstants.INT_MAX_VALUE?(this.prevshowrecordcount=this.showrecordcount,this.isDisableLast=!0,this.isDisableCount=!0,this.showrecordcount=!1,t<n&&(this.isDisableNext=!0)):(this.isDisableCount=!1,this.showrecordcount=this.prevshowrecordcount||this.showrecordcount)},n.prototype.disableNavigation=function(){var e,t=1===this.dn.currentPage,n=this.dn.currentPage===this.pageCount;(null===(e=this.pagination)||void 0===e?void 0:e.next)?(this.isDisableFirst=this.isDisablePrevious=!this.pagination.prev,this.isDisableNext=this.isDisableLast=!this.pagination.next):(this.isDisableFirst=this.isDisablePrevious=t,this.isDisableNext=this.isDisableLast=n),this.isDisableCurrent=t&&n,this.dataset&&this.dataset.length&&this.isDisableNext&&this.parent.onDemandLoad&&"wm-table"===this.parent.widgetType&&this.parent.callDataGridMethod("hideLoadingIndicator",this.isDisableNext,this.parent.infScroll)},n.prototype.isDataSourceHasPaging=function(){return this.datasource&&this.datasource.execute(a.DataSource.Operation.IS_PAGEABLE)},n.prototype.setNonPageableData=function(e){var t,n,i,o;t=_.isArray(e)?e.length:_.isEmpty(e)?0:1,n=this.options&&this.options.maxResults||t,i=this.datasource&&(this.datasource.execute(a.DataSource.Operation.IS_API_AWARE)||"wm-table"===this.parent.widgetType&&this.parent.gridOptions.isNavTypeScrollOrOndemand()&&(_.get(this.parent,"gridOptions.lastActionPerformed")===this.parent.gridOptions.ACTIONS.DATASET_UPDATE||!_.get(this.parent,"gridOptions.isNextPageData")))?1:this.dn.currentPage||1,this.setDefaultPagingValues(t,n,i),this.disableNavigation(),o=(this.dn.currentPage-1)*this.maxResults,this.setResult(_.isArray(e)?e.slice(o,o+this.maxResults):e)},n.prototype.setPagingValues=function(e){var t,n,i,o={};this.__fullData=e,this.binddataset?(o=(this.datasource||{})._options||{},e?this.isDataSourceHasPaging()?(this.pagination=this.datasource.execute(a.DataSource.Operation.GET_PAGING_OPTIONS)||{},this.filterFields=o.filterFields||{},this.logicalOp=o.logicalOp||"",this.sortOptions=o.orderBy||(_.isArray(this.pagination.sort)?r.getOrderByExpr(this.pagination.sort):""),t=this.pagination.totalElements,n=this.pagination.size,this.pagination.numberOfElements>0?(a.isDefined(this.pagination.number)&&(this.dn.currentPage=this.pagination.number+1),i=this.dn.currentPage||1):i=1,this.setDefaultPagingValues(t,n,i),this.disableNavigation(),this.checkDataSize(t,this.pagination.numberOfElements,this.pagination.size),this.setResult(e)):_.isString(e)||this.setNonPageableData(e):(this.setResult(e),this.resetPageNavigation()),"Basic"===this.navigation&&this._setAriaForBasicNavigation()):e&&!_.isString(e)&&this.setNonPageableData(e)},n.prototype.isFirstPage=function(){return 1===this.dn.currentPage||!this.dn.currentPage},n.prototype.isLastPage=function(){return this.dn.currentPage===this.pageCount},n.prototype.goToLastPage=function(e,t,n){this.isLastPage()?e&&this.goToPage(t,n):(this.dn.currentPage=this.pageCount,this.goToPage(t,n))},n.prototype.goToFirstPage=function(e,t,n){this.isFirstPage()?e&&this.goToPage(t,n):(this.dn.currentPage=1,this.goToPage(t,n))},n.prototype.goToPage=function(e,t){this.firstRow=(this.dn.currentPage-1)*this.maxResults;var n=this.parent.statePersistence.computeMode(this.statehandler);!n||"none"===n.toLowerCase()||"wm-table"!==this.parent.widgetType&&"wm-list"!==this.parent.widgetType||(this.parent._selectedItemsExist=!0,this.isFirstPage()?this.parent.statePersistence.removeWidgetState(this.parent,"pagination"):r.unsupportedStatePersistenceTypes.indexOf(this.parent.navigation)<0?this.parent.statePersistence.setWidgetState(this.parent,{pagination:this.dn.currentPage}):"wm-list"!==this.parent.widgetType&&"wm-table"!==this.parent.widgetType||console.warn("Retain State handling on Widget "+this.parent.name+" is not supported for current pagination type.")),this.getPageData(e,t)},n.prototype.onPageDataReady=function(e,t,n){this.disableNavigation(),this.invokeSetRecord(e,t),a.triggerFn(n)},n.prototype.getPageData=function(e,t){var n,i,o=this;if(this.isDataSourceHasPaging()){var r=this.dn.currentPage;this.isEditNotInCurrentPage()&&"delete"!==this.parent.gridOptions.lastActionPerformed&&(r=this.parent.actionRowPage),this.datasource.execute(a.DataSource.Operation.LIST_RECORDS,{page:r,filterFields:this.filterFields,orderBy:this.sortOptions,logicalOp:this.logicalOp,matchMode:"anywhereignorecase"}).then((function(n){o.onPageDataReady(e,n&&n.data,t),a.$appDigest()}),(function(e){}))}else i=this.isEditNotInCurrentPage()?(this.parent.actionRowPage-1)*this.maxResults:(this.dn.currentPage-1)*this.maxResults,n=_.isArray(this.__fullData)?this.__fullData.slice(i,i+this.maxResults):this.__fullData,this.setResult(n),this.onPageDataReady(e,n,t)},n.prototype.isEditNotInCurrentPage=function(){var e=this.dn.currentPage;return"wm-table"===this.parent.widgetType&&e===this.parent.currentPage&&this.parent.actionRowPage&&this.parent.actionRowPage<e},n.prototype.invokeSetRecord=function(e,t){var n={currentPage:this.dn.currentPage,size:this.maxResults,totalElements:this.dataSize,totalPages:this.pageCount};this.parent?this.parent.invokeEventCallback("setrecord",{$event:e,$data:t,$index:this.dn.currentPage,pageInfo:n,data:t}):this.invokeEventCallback("setrecord",{$event:e,$data:t,$index:this.dn.currentPage,pageInfo:n,data:t})},n.prototype.validateCurrentPage=function(e,t){return!e||!(isNaN(this.dn.currentPage)||this.dn.currentPage<=0||this.pageCount&&(this.dn.currentPage>this.pageCount||_.isNull(this.dn.currentPage)))||(this.dn.currentPage<=0?this.dn.currentPage=1:this.dn.currentPage>this.pageCount&&(this.dn.currentPage=this.pageCount),!1)},n.prototype.onModelChange=function(e){this.validateCurrentPage(e)&&this.goToPage(e)},n.prototype.onKeyDown=function(e){var t=$(e.target).closest("a");return"KeyE"===e.code?(t.addClass("ng-invalid"),!1):(t.removeClass("ng-invalid"),!0)},n.prototype.pageChanged=function(e){this._debouncedPageChanged(e)},n.prototype.navigatePage=function(e,t,n,i){var o,r,s,l;switch(a.isDefined(this.parent.isDataLoading)&&!this.isDisableNext&&(this.parent.isDataLoading=!0,this.parent.infScroll&&(this.parent.variableInflight=!0,this.parent.callDataGridMethod("showLoadingIndicator",this.parent.loadingdatamsg,!0))),"wm-table"===this.parent.widgetType&&this.parent.gridOptions.isNavTypeScrollOrOndemand()&&(this.parent.gridOptions.setLastActionPerformed(this.parent.gridOptions.ACTIONS.DEFAULT),this.parent.gridOptions.setIsDatasetUpdated(!1)),this.invokeEventCallback("paginationchange",{$event:void 0,$index:this.dn.currentPage}),this.dn.currentPage=+this.dn.currentPage,e){case"first":return void this.goToFirstPage(n,t,i);case"prev":if(!((null===(o=this.pagination)||void 0===o?void 0:o.next)||!this.isFirstPage()&&this.validateCurrentPage(t,i)))return;(null===(r=this.pagination)||void 0===r?void 0:r.next)&&(this.datasource.pagination.isNext=!1,this.datasource.pagination.isPrev=!0),this.dn.currentPage-=1;break;case"next":if(!((null===(s=this.pagination)||void 0===s?void 0:s.next)||!this.isLastPage()&&this.validateCurrentPage(t,i)))return;(null===(l=this.pagination)||void 0===l?void 0:l.next)&&(this.datasource.pagination.isNext=!0,this.datasource.pagination.isPrev=!1),this.dn.currentPage+=1;break;case"last":return void this.goToLastPage(n,t,i)}this.goToPage(t,i)},n.prototype.setBindDataSet=function(e,t,n,i,o,r,s){var l,c=this,p=e.split(".");if(this.statehandler=s,"Variables"!==p[0]&&"Widgets"!==p[0]||(l=p[0]+"."+p[1]+".pagination"),!o&&i&&!r)return this.dataset=i,void this._debouncedApplyDataset();this.binddataset=e,setTimeout((function(){c.registerDestroyListener(a.$watch(e,t,r?n:{},(function(e){e?(c.dataset=e,c._debouncedApplyDataset()):c.widget.dataset=e}))),l&&c.registerDestroyListener(a.$watch(l,t,{},(function(){return c._debouncedApplyDataset()})))})),r||(this.datasource=n)},n.prototype.setDataSource=function(e){this.datasource=e},n.prototype.onPropertyChange=function(t,n,i){if("dataset"===t){var o=void 0;o=this.parent&&this.parent.onDataNavigatorDataSetChange?this.parent.onDataNavigatorDataSetChange(n):n,"wm-table"===this.parent.widgetType&&(this.parent._triggeredByUser=!1),this.isEditNotInCurrentPage()?this.setResult(o):this.setPagingValues(o)}else"navigation"===t?("Advanced"===n&&(this.navigation="Classic"),this.updateNavSize(),this.navcontrols=n):"navigationsize"===t?this.updateNavSize():"navigationalign"===t?a.switchClass(this.nativeElement,"text-"+n,"text-"+i):"maxResults"===t?this.setPagingValues(this.dataset):e.prototype.onPropertyChange.call(this,t,n,i)},n.prototype.ngAfterViewInit=function(){this.nativeElement.onclick=function(e){e.stopPropagation()}},n}(r.StylableComponent);h.initializeProps=p(),h.decorators=[{type:t.Component,args:[{selector:"[wmPagination]",template:'\n<ul class="pagination advanced {{navigationClass}}" *ngIf="navcontrols === \'Classic\'">\n <li [ngClass]="{\'disabled\':isDisableFirst}">\n <a [title]="appLocale.LABEL_FIRST" name="first" href="javascript:void(0);"\n [attr.aria-disabled]="isDisableFirst"\n (click)="navigatePage(\'first\', $event)">\n <span aria-hidden="true"><i class="wi wi-first-page"></i></span>\n <span class="sr-only">Go to first page {{ isDisableFirst ? \' , Disabled\' : \'\'}}</span>\n </a>\n </li>\n <li [ngClass]="{\'disabled\':isDisablePrevious}">\n <a [title]="appLocale.LABEL_PREVIOUS" name="prev" href="javascript:void(0);"\n [attr.aria-disabled]="isDisablePrevious"\n (click)="navigatePage(\'prev\', $event)">\n <span aria-hidden="true"><i class="wi wi-chevron-left"></i></span>\n <span class="sr-only">Go to previous page {{ isDisablePrevious ? \', Disabled\' : \'\'}}</span>\n </a>\n </li>\n <li class="pagecount disabled">\n <a href="javascript:void(0);">\n <input type="number" [disabled]="isDisableCurrent" [(ngModel)]="dn.currentPage" [attr.aria-label]="\'Showing Page \' + dn.currentPage + \' of \' + pageCount"\n (keydown)="onKeyDown($event)" (change)="onModelChange($event)" class="form-control"/>\n </a>\n </li>\n <li class="disabled">\n <a [hidden]="isDisableCount"> / {{pageCount}}</a>\n </li>\n <li [ngClass]="{\'disabled\':isDisableNext}">\n <a [title]="appLocale.LABEL_NEXT" name="next" href="javascript:void(0);"\n [attr.aria-disabled]="isDisableNext"\n (click)="navigatePage(\'next\', $event)">\n <span aria-hidden="true"><i class="wi wi-chevron-right"></i></span>\n <span class="sr-only">Go to next page {{ isDisableNext ? \' , Disabled\' : \'\'}}</span>\n </a>\n </li>\n <li [ngClass]="{\'disabled\':isDisableLast}">\n <a [title]="appLocale.LABEL_LAST" name="last" href="javascript:void(0);"\n [attr.aria-disabled]="isDisableLast"\n (click)="navigatePage(\'last\', $event)">\n <span aria-hidden="true"><i class="wi wi-last-page"></i></span>\n <span class="sr-only">Go to last page {{ isDisableLast ? \' , Disabled\' : \'\'}}</span>\n </a>\n </li>\n <li *ngIf="showrecordcount" class="totalcount disabled">\n <a href="javascript:void(0);" tabindex="-1" aria-disabled="true">{{appLocale.LABEL_TOTAL_RECORDS}}: {{dataSize}}</a>\n </li>\n</ul>\n<ul class="pager {{navigationClass}}" *ngIf="navcontrols === \'Pager\'">\n <li class="previous" [ngClass]="{\'disabled\':isDisablePrevious}">\n <a href="javascript:void(0);" (click)="navigatePage(\'prev\', $event)"\n [attr.aria-disabled]="isDisablePrevious">\n <span aria-hidden="true"><i class="wi wi-chevron-left"></i></span>\n {{appLocale.LABEL_PREVIOUS}}\n <span class="sr-only">{{ isDisablePrevious ? \' , Disabled\' : \'\'}}</span>\n </a>\n </li>\n <li class="next" [ngClass]="{\'disabled\':isDisableNext}">\n <a href="javascript:void(0);" (click)="navigatePage(\'next\', $event)"\n [attr.aria-disabled]="isDisableNext">\n <span aria-hidden="true"><i class="wi wi-chevron-right"></i></span>\n {{appLocale.LABEL_NEXT}}\n <span class="sr-only">{{ isDisableNext ? \' , Disabled\' : \'\'}}</span>\n </a>\n </li>\n</ul>\n\n<pagination class="pagination basic" [ngClass]="navigationClass" *ngIf="navcontrols === \'Basic\'" role="navigation"\n [itemsPerPage]="maxResults" [totalItems]="dataSize"\n [ngModel]="dn.currentPage" (pageChanged)="pageChanged($event)"\n [attr.aria-label]="\'Showing Page \' + dn.currentPage + \' of \' + pageCount + \' pages\'"\n [boundaryLinks]="boundarylinks" [maxSize]="maxsize"\n [directionLinks]="directionlinks"\n firstText="Firtst" lastText="Last"\n [customPreviousTemplate]="prevTemplate"\n [customNextTemplate]="nextTemplate"\n [customPageTemplate]="pageTemplate"></pagination>\n\n<ul *ngIf="navcontrols === \'Basic\' && showrecordcount" class="pagination">\n <li class="totalcount disabled basiccount">\n <a href="javascript:void(0);" tabindex="-1" aria-disabled="true">{{appLocale.LABEL_TOTAL_RECORDS}}: {{dataSize}}</a>\n </li>\n</ul>\n\n<ng-template #pageTemplate let-page>\n <span class="sr-only" [attr.data-isacitvepage]="page.active">{{\'Page \'}}</span>\n {{page.number}}\n <span class="sr-only" *ngIf="page.active"> {{\', Showing page \' + page.number + \' of \' + pageCount}}</span>\n</ng-template>\n<ng-template #prevTemplate let-disabled="disabled">\n <span class="sr-only" [attr.data-isdisabled]="disabled">Go to Previous page {{disabled ? \', Disabled\' : \'\'}}</span>\n</ng-template>\n<ng-template #nextTemplate let-disabled="disabled">\n <span class="sr-only" [attr.data-isdisabled]="disabled">Go to Next page {{disabled ? \', Disabled\' : \'\'}}</span>\n</ng-template>\n',providers:[r.provideAsWidgetRef(h)]}]}],h.ctorParameters=function(){return[{type:t.Injector},{type:void 0,decorators:[{type:t.SkipSelf},{type:t.Inject,args:[r.WidgetRef]}]}]},h.propDecorators={resultEmitter:[{type:t.Output}],maxResultsEmitter:[{type:t.Output}]};var m=[h],f=function(){};f.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule,o.PaginationModule,r.WmComponentsModule],declarations:c([],l(m)),exports:c([],l(m)),entryComponents:[]}]}],e.PaginationComponent=h,e.PaginationModule=f,e["\u0275a"]=p,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("ngx-bootstrap/dropdown"),require("@wm/components/base"),require("@wm/components/basic"),require("@wm/components/navigation/menu"),require("@wm/core")):"function"==typeof define&&define.amd?define("@wm/components/data/card",["exports","@angular/core","@angular/common","ngx-bootstrap/dropdown","@wm/components/base","@wm/components/basic","@wm/components/navigation/menu","@wm/core"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.data=e.wm.components.data||{},e.wm.components.data.card={}),e.ng.core,e.ng.common,e["ngx-bootstrap"].dropdown,e.wm.components.base,e.wm.components.basic,e.wm.components.navigation.menu,e.wm.core)}(this,(function(e,t,n,i,o,r,a,s){"use strict";
478
+ ***************************************************************************** */var s=function(e,t){return(s=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)};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(){r.register("wm-pagination",new Map([["boundarylinks",Object.assign({value:!1},r.PROP_BOOLEAN)],["class",r.PROP_STRING],["dataset",r.PROP_ANY],["directionlinks",Object.assign({value:!0},r.PROP_BOOLEAN)],["forceellipses",Object.assign({value:!0},r.PROP_BOOLEAN)],["maxResults",r.PROP_NUMBER],["maxsize",Object.assign({value:5},r.PROP_NUMBER)],["name",r.PROP_STRING],["navigation",Object.assign({value:"Basic"},r.PROP_STRING)],["navigationalign",Object.assign({value:"left"},r.PROP_STRING)],["navigationsize",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["showrecordcount",r.PROP_BOOLEAN],["tabindex",Object.assign({value:0},r.PROP_NUMBER)]]))},u={widgetType:"wm-pagination",hostClass:"app-datanavigator clearfix"},d={Pager:{small:"pager-sm",large:"pager-lg"},Basic:{small:"pagination-sm",large:"pagination-lg"},Classic:{small:"pagination-sm",large:"pagination-lg"}},h=function(e){function n(n,i){var o=e.call(this,n,u)||this;return o.parent=i,o.resultEmitter=new t.EventEmitter,o.maxResultsEmitter=new t.EventEmitter,o.dn={currentPage:1},o.pageCount=0,o.isDisableNext=!0,o.isDisablePrevious=!0,o.isDisableFirst=!0,o.isDisableLast=!0,o._debouncedApplyDataset=a.debounce((function(){return o.widget.dataset=o.dataset}),r.DEBOUNCE_TIMES.PAGINATION_DEBOUNCE_TIME),o._debouncedPageChanged=a.debounce((function(e){var t=e&&e.page;if(t!==o.dn.currentPage){var n=o.parent||o;o.dn.currentPage=t,n.invokeEventCallback("paginationchange",{$event:void 0,$index:o.dn.currentPage}),o.goToPage(),"Basic"===o.navigation&&o._setAriaForBasicNavigation()}}),r.DEBOUNCE_TIMES.PAGINATION_DEBOUNCE_TIME),r.styler(o.nativeElement,o),o}return function(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}s(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(n,e),n.prototype._setAriaForBasicNavigation=function(){_.forEach(this.nativeElement.getElementsByTagName("a"),(function(e){e.setAttribute("href","javascript:void(0);");var t=e.querySelector("span");"true"===(null==t?void 0:t.dataset.isacitvepage)&&e.setAttribute("aria-current","true"),"true"===(null==t?void 0:t.dataset.isdisabled)?e.setAttribute("aria-disabled","true"):e.removeAttribute("aria-disabled")}))},n.prototype.setResult=function(e){this.result=e,this.resultEmitter.emit(this.result)},n.prototype.updateNavSize=function(){var e=d[this.navcontrols];e&&this.navigationsize?this.navigationClass=e[this.navigationsize]:this.navigationClass=""},n.prototype.resetPageNavigation=function(){this.pageCount=0,this.dn.currentPage=1,this.dataSize=0},n.prototype.calculatePagingValues=function(){this.pageCount=this.dataSize>this.maxResults?Math.ceil(this.dataSize/this.maxResults):this.dataSize<0?0:1,this.dn.currentPage=this.dn.currentPage||1},n.prototype.setDefaultPagingValues=function(e,t,n){e||t?(this.maxResults=t||this.maxResults,this.dataSize=a.isDefined(e)?e:this.dataSize,this.dn.currentPage=n||this.dn.currentPage,this.calculatePagingValues()):(this.pageCount=1,this.dn.currentPage=1,this.maxResults=e,this.dataSize=e),this.maxResultsEmitter.emit(this.maxResults)},n.prototype.checkDataSize=function(e,t,n){-1===e||e===a.AppConstants.INT_MAX_VALUE?(this.prevshowrecordcount=this.showrecordcount,this.isDisableLast=!0,this.isDisableCount=!0,this.showrecordcount=!1,t<n&&(this.isDisableNext=!0)):(this.isDisableCount=!1,this.showrecordcount=this.prevshowrecordcount||this.showrecordcount)},n.prototype.disableNavigation=function(){var e,t=1===this.dn.currentPage,n=this.dn.currentPage===this.pageCount;(null===(e=this.pagination)||void 0===e?void 0:e.next)?(this.isDisableFirst=this.isDisablePrevious=!this.pagination.prev,this.isDisableNext=this.isDisableLast=!this.pagination.next):(this.isDisableFirst=this.isDisablePrevious=t,this.isDisableNext=this.isDisableLast=n),this.isDisableCurrent=t&&n,this.dataset&&this.dataset.length&&this.isDisableNext&&this.parent.onDemandLoad&&"wm-table"===this.parent.widgetType&&this.parent.callDataGridMethod("hideLoadingIndicator",this.isDisableNext,this.parent.infScroll)},n.prototype.isDataSourceHasPaging=function(){return this.datasource&&this.datasource.execute(a.DataSource.Operation.IS_PAGEABLE)},n.prototype.setNonPageableData=function(e){var t,n,i,o;t=_.isArray(e)?e.length:_.isEmpty(e)?0:1,n=this.options&&this.options.maxResults||t,i=this.datasource&&(this.datasource.execute(a.DataSource.Operation.IS_API_AWARE)||"wm-table"===this.parent.widgetType&&this.parent.gridOptions.isNavTypeScrollOrOndemand()&&(_.get(this.parent,"gridOptions.lastActionPerformed")===this.parent.gridOptions.ACTIONS.DATASET_UPDATE||!_.get(this.parent,"gridOptions.isNextPageData")))?1:this.dn.currentPage||1,this.setDefaultPagingValues(t,n,i),this.disableNavigation(),o=(this.dn.currentPage-1)*this.maxResults,this.setResult(_.isArray(e)?e.slice(o,o+this.maxResults):e)},n.prototype.setPagingValues=function(e){var t,n,i,o={};this.__fullData=e,this.binddataset?(o=(this.datasource||{})._options||{},e?this.isDataSourceHasPaging()?(this.pagination=this.datasource.execute(a.DataSource.Operation.GET_PAGING_OPTIONS)||{},this.filterFields=o.filterFields||{},this.logicalOp=o.logicalOp||"",this.sortOptions=o.orderBy||(_.isArray(this.pagination.sort)?r.getOrderByExpr(this.pagination.sort):""),t=this.pagination.totalElements,n=this.pagination.size,this.pagination.numberOfElements>0?(a.isDefined(this.pagination.number)&&(this.dn.currentPage=this.pagination.number+1),i=this.dn.currentPage||1):i=1,this.setDefaultPagingValues(t,n,i),this.disableNavigation(),this.checkDataSize(t,this.pagination.numberOfElements,this.pagination.size),this.setResult(e)):_.isString(e)||this.setNonPageableData(e):(this.setResult(e),this.resetPageNavigation()),"Basic"===this.navigation&&this._setAriaForBasicNavigation()):e&&!_.isString(e)&&this.setNonPageableData(e)},n.prototype.isFirstPage=function(){return 1===this.dn.currentPage||!this.dn.currentPage},n.prototype.isLastPage=function(){return this.dn.currentPage===this.pageCount},n.prototype.goToLastPage=function(e,t,n){this.isLastPage()?e&&this.goToPage(t,n):(this.dn.currentPage=this.pageCount,this.goToPage(t,n))},n.prototype.goToFirstPage=function(e,t,n){this.isFirstPage()?e&&this.goToPage(t,n):(this.dn.currentPage=1,this.goToPage(t,n))},n.prototype.goToPage=function(e,t){this.firstRow=(this.dn.currentPage-1)*this.maxResults;var n=this.parent.statePersistence.computeMode(this.statehandler);!n||"none"===n.toLowerCase()||"wm-table"!==this.parent.widgetType&&"wm-list"!==this.parent.widgetType||(this.parent._selectedItemsExist=!0,this.isFirstPage()?this.parent.statePersistence.removeWidgetState(this.parent,"pagination"):r.unsupportedStatePersistenceTypes.indexOf(this.parent.navigation)<0?this.parent.statePersistence.setWidgetState(this.parent,{pagination:this.dn.currentPage}):"wm-list"!==this.parent.widgetType&&"wm-table"!==this.parent.widgetType||console.warn("Retain State handling on Widget "+this.parent.name+" is not supported for current pagination type.")),this.getPageData(e,t)},n.prototype.onPageDataReady=function(e,t,n){this.disableNavigation(),this.invokeSetRecord(e,t),a.triggerFn(n)},n.prototype.getPageData=function(e,t){var n,i,o=this;if(this.isDataSourceHasPaging()){var r=this.dn.currentPage;this.isEditNotInCurrentPage()&&"delete"!==this.parent.gridOptions.lastActionPerformed&&(r=this.parent.actionRowPage),this.datasource.execute(a.DataSource.Operation.LIST_RECORDS,{page:r,filterFields:this.filterFields,orderBy:this.sortOptions,logicalOp:this.logicalOp,matchMode:"anywhereignorecase"}).then((function(n){o.onPageDataReady(e,n&&n.data,t),a.$appDigest()}),(function(e){}))}else i=this.isEditNotInCurrentPage()?(this.parent.actionRowPage-1)*this.maxResults:(this.dn.currentPage-1)*this.maxResults,n=_.isArray(this.__fullData)?this.__fullData.slice(i,i+this.maxResults):this.__fullData,this.setResult(n),this.onPageDataReady(e,n,t)},n.prototype.isEditNotInCurrentPage=function(){var e=this.dn.currentPage;return"wm-table"===this.parent.widgetType&&e===this.parent.currentPage&&this.parent.actionRowPage&&this.parent.actionRowPage<e},n.prototype.invokeSetRecord=function(e,t){var n={currentPage:this.dn.currentPage,size:this.maxResults,totalElements:this.dataSize,totalPages:this.pageCount};this.parent?this.parent.invokeEventCallback("setrecord",{$event:e,$data:t,$index:this.dn.currentPage,pageInfo:n,data:t}):this.invokeEventCallback("setrecord",{$event:e,$data:t,$index:this.dn.currentPage,pageInfo:n,data:t})},n.prototype.validateCurrentPage=function(e,t){return!e||!(isNaN(this.dn.currentPage)||this.dn.currentPage<=0||this.pageCount&&(this.dn.currentPage>this.pageCount||_.isNull(this.dn.currentPage)))||(this.dn.currentPage<=0?this.dn.currentPage=1:this.dn.currentPage>this.pageCount&&(this.dn.currentPage=this.pageCount),!1)},n.prototype.onModelChange=function(e){this.validateCurrentPage(e)&&this.goToPage(e)},n.prototype.onKeyDown=function(e){var t=$(e.target).closest("a");return"KeyE"===e.code?(t.addClass("ng-invalid"),!1):(t.removeClass("ng-invalid"),!0)},n.prototype.pageChanged=function(e){this._debouncedPageChanged(e)},n.prototype.navigatePage=function(e,t,n,i){var o,r,s,l;switch(a.isDefined(this.parent.isDataLoading)&&!this.isDisableNext&&(this.parent.isDataLoading=!0,this.parent.infScroll&&(this.parent.variableInflight=!0,this.parent.callDataGridMethod("showLoadingIndicator",this.parent.loadingdatamsg,!0))),"wm-table"===this.parent.widgetType&&this.parent.gridOptions.isNavTypeScrollOrOndemand()&&(this.parent.gridOptions.setLastActionPerformed(this.parent.gridOptions.ACTIONS.DEFAULT),this.parent.gridOptions.setIsDatasetUpdated(!1)),this.invokeEventCallback("paginationchange",{$event:void 0,$index:this.dn.currentPage}),this.dn.currentPage=+this.dn.currentPage,e){case"first":return void this.goToFirstPage(n,t,i);case"prev":if(!((null===(o=this.pagination)||void 0===o?void 0:o.next)||!this.isFirstPage()&&this.validateCurrentPage(t,i)))return;(null===(r=this.pagination)||void 0===r?void 0:r.next)&&(this.datasource.pagination.isNext=!1,this.datasource.pagination.isPrev=!0),this.dn.currentPage-=1;break;case"next":if(!((null===(s=this.pagination)||void 0===s?void 0:s.next)||!this.isLastPage()&&this.validateCurrentPage(t,i)))return;(null===(l=this.pagination)||void 0===l?void 0:l.next)&&(this.datasource.pagination.isNext=!0,this.datasource.pagination.isPrev=!1),this.dn.currentPage+=1;break;case"last":return void this.goToLastPage(n,t,i)}this.goToPage(t,i)},n.prototype.setBindDataSet=function(e,t,n,i,o,r,s){var l,c=this,p=e.split(".");if(this.statehandler=s,"Variables"!==p[0]&&"Widgets"!==p[0]||(l=p[0]+"."+p[1]+".pagination"),!o&&i&&!r)return this.dataset=i,void this._debouncedApplyDataset();this.binddataset=e,setTimeout((function(){c.registerDestroyListener(a.$watch(e,t,r?n:{},(function(e){e?(c.dataset=e,c._debouncedApplyDataset()):c.widget.dataset=e}))),l&&c.registerDestroyListener(a.$watch(l,t,{},(function(){return c._debouncedApplyDataset()})))})),r||(this.datasource=n)},n.prototype.setDataSource=function(e){this.datasource=e},n.prototype.onPropertyChange=function(t,n,i){if("dataset"===t){var o=void 0;o=this.parent&&this.parent.onDataNavigatorDataSetChange?this.parent.onDataNavigatorDataSetChange(n):n,"wm-table"===this.parent.widgetType&&(this.parent._triggeredByUser=!1),this.isEditNotInCurrentPage()?this.setResult(o):this.setPagingValues(o)}else"navigation"===t?("Advanced"===n&&(this.navigation="Classic"),this.updateNavSize(),this.navcontrols=n):"navigationsize"===t?this.updateNavSize():"navigationalign"===t?a.switchClass(this.nativeElement,"text-"+n,"text-"+i):"maxResults"===t?this.setPagingValues(this.dataset):e.prototype.onPropertyChange.call(this,t,n,i)},n.prototype.ngAfterViewInit=function(){this.nativeElement.onclick=function(e){e.stopPropagation()}},n}(r.StylableComponent);h.initializeProps=p(),h.decorators=[{type:t.Component,args:[{selector:"[wmPagination]",template:'\n<ul class="pagination advanced {{navigationClass}}" *ngIf="navcontrols === \'Classic\'">\n <li [ngClass]="{\'disabled\':isDisableFirst}">\n <a [title]="appLocale.LABEL_FIRST" name="first" href="javascript:void(0);"\n [attr.aria-disabled]="isDisableFirst"\n (click)="navigatePage(\'first\', $event)">\n <span aria-hidden="true"><i class="wi wi-first-page"></i></span>\n <span class="sr-only">Go to first page {{ isDisableFirst ? \' , Disabled\' : \'\'}}</span>\n </a>\n </li>\n <li [ngClass]="{\'disabled\':isDisablePrevious}">\n <a [title]="appLocale.LABEL_PREVIOUS" name="prev" href="javascript:void(0);"\n [attr.aria-disabled]="isDisablePrevious"\n (click)="navigatePage(\'prev\', $event)">\n <span aria-hidden="true"><i class="wi wi-chevron-left"></i></span>\n <span class="sr-only">Go to previous page {{ isDisablePrevious ? \', Disabled\' : \'\'}}</span>\n </a>\n </li>\n <li class="pagecount disabled">\n <a href="javascript:void(0);">\n <input type="number" [disabled]="isDisableCurrent" [(ngModel)]="dn.currentPage" [attr.aria-label]="\'Showing Page \' + dn.currentPage + \' of \' + pageCount"\n (keydown)="onKeyDown($event)" (change)="onModelChange($event)" class="form-control"/>\n </a>\n </li>\n <li class="disabled">\n <a [hidden]="isDisableCount"> / {{pageCount}}</a>\n </li>\n <li [ngClass]="{\'disabled\':isDisableNext}">\n <a [title]="appLocale.LABEL_NEXT" name="next" href="javascript:void(0);"\n [attr.aria-disabled]="isDisableNext"\n (click)="navigatePage(\'next\', $event)">\n <span aria-hidden="true"><i class="wi wi-chevron-right"></i></span>\n <span class="sr-only">Go to next page {{ isDisableNext ? \' , Disabled\' : \'\'}}</span>\n </a>\n </li>\n <li [ngClass]="{\'disabled\':isDisableLast}">\n <a [title]="appLocale.LABEL_LAST" name="last" href="javascript:void(0);"\n [attr.aria-disabled]="isDisableLast"\n (click)="navigatePage(\'last\', $event)">\n <span aria-hidden="true"><i class="wi wi-last-page"></i></span>\n <span class="sr-only">Go to last page {{ isDisableLast ? \' , Disabled\' : \'\'}}</span>\n </a>\n </li>\n <li *ngIf="showrecordcount" class="totalcount disabled">\n <a href="javascript:void(0);" tabindex="-1" aria-disabled="true">{{appLocale.LABEL_TOTAL_RECORDS}}: {{dataSize}}</a>\n </li>\n</ul>\n<ul class="pager {{navigationClass}}" *ngIf="navcontrols === \'Pager\'">\n <li class="previous" [ngClass]="{\'disabled\':isDisablePrevious}">\n <a href="javascript:void(0);" (click)="navigatePage(\'prev\', $event)"\n [attr.aria-disabled]="isDisablePrevious">\n <span aria-hidden="true"><i class="wi wi-chevron-left"></i></span>\n {{appLocale.LABEL_PREVIOUS}}\n <span class="sr-only">{{ isDisablePrevious ? \' , Disabled\' : \'\'}}</span>\n </a>\n </li>\n <li class="next" [ngClass]="{\'disabled\':isDisableNext}">\n <a href="javascript:void(0);" (click)="navigatePage(\'next\', $event)"\n [attr.aria-disabled]="isDisableNext">\n <span aria-hidden="true"><i class="wi wi-chevron-right"></i></span>\n {{appLocale.LABEL_NEXT}}\n <span class="sr-only">{{ isDisableNext ? \' , Disabled\' : \'\'}}</span>\n </a>\n </li>\n</ul>\n\n<pagination class="pagination basic" [ngClass]="navigationClass" *ngIf="navcontrols === \'Basic\'" role="navigation"\n [itemsPerPage]="maxResults" [totalItems]="dataSize"\n [ngModel]="dn.currentPage" (pageChanged)="pageChanged($event)"\n [attr.aria-label]="\'Showing Page \' + dn.currentPage + \' of \' + pageCount + \' pages\'"\n [boundaryLinks]="boundarylinks" [maxSize]="maxsize"\n [directionLinks]="directionlinks"\n firstText="Firtst" lastText="Last"\n [customPreviousTemplate]="prevTemplate"\n [customNextTemplate]="nextTemplate"\n [customPageTemplate]="pageTemplate"></pagination>\n\n<ul *ngIf="navcontrols === \'Basic\' && showrecordcount" class="pagination">\n <li class="totalcount disabled basiccount">\n <a href="javascript:void(0);" tabindex="-1" aria-disabled="true">{{appLocale.LABEL_TOTAL_RECORDS}}: {{dataSize}}</a>\n </li>\n</ul>\n\n<ng-template #pageTemplate let-page>\n <span class="sr-only" [attr.data-isacitvepage]="page.active">{{\'Page \'}}</span>\n {{page.number}}\n <span class="sr-only" *ngIf="page.active"> {{\', Showing page \' + page.number + \' of \' + pageCount}}</span>\n</ng-template>\n<ng-template #prevTemplate let-disabled="disabled">\n <span class="sr-only" [attr.data-isdisabled]="disabled">Go to Previous page {{disabled ? \', Disabled\' : \'\'}}</span>\n</ng-template>\n<ng-template #nextTemplate let-disabled="disabled">\n <span class="sr-only" [attr.data-isdisabled]="disabled">Go to Next page {{disabled ? \', Disabled\' : \'\'}}</span>\n</ng-template>\n',providers:[r.provideAsWidgetRef(h)]}]}],h.ctorParameters=function(){return[{type:t.Injector},{type:void 0,decorators:[{type:t.SkipSelf},{type:t.Inject,args:[r.WidgetRef]}]}]},h.propDecorators={resultEmitter:[{type:t.Output}],maxResultsEmitter:[{type:t.Output}]};var m=[h],f=function(){};f.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule,o.PaginationModule,r.WmComponentsModule],declarations:c([],l(m)),exports:c([],l(m)),entryComponents:[]}]}],e.PaginationComponent=h,e.PaginationModule=f,e["\u0275a"]=p,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("ngx-bootstrap/dropdown"),require("@wm/components/base"),require("@wm/components/basic"),require("@wm/components/navigation/menu"),require("@wm/core")):"function"==typeof define&&define.amd?define("@wm/components/data/card",["exports","@angular/core","@angular/common","ngx-bootstrap/dropdown","@wm/components/base","@wm/components/basic","@wm/components/navigation/menu","@wm/core"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.data=e.wm.components.data||{},e.wm.components.data.card={}),e.ng.core,e.ng.common,e["ngx-bootstrap"].dropdown,e.wm.components.base,e.wm.components.basic,e.wm.components.navigation.menu,e.wm.core)}(this,(function(e,t,n,i,o,r,a,s){"use strict";
479
479
  /*! *****************************************************************************
480
480
  Copyright (c) Microsoft Corporation.
481
481
 
@@ -545,7 +545,7 @@ var c=function(e,t){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Arr
545
545
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
546
546
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
547
547
  PERFORMANCE OF THIS SOFTWARE.
548
- ***************************************************************************** */var m=function(e,t){return(m=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 f(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}m(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function g(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{l(i.next(e))}catch(e){r(e)}}function s(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))}function v(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}}Object.create;function y(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 b(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 w=new Map([["autocomplete",Object.assign({value:!1},i.PROP_BOOLEAN)],["captionalign",Object.assign({value:"left"},i.PROP_STRING)],["captionposition",Object.assign({value:"left"},i.PROP_STRING)],["captionsize",i.PROP_STRING],["captionwidth",Object.assign({value:"xs-12 sm-3 md-3 lg-3"},i.PROP_STRING)],["class",i.PROP_STRING],["collapsible",i.PROP_BOOLEAN],["dataset",i.PROP_ANY],["datasource",i.PROP_STRING],["expanded",Object.assign({value:!0},i.PROP_BOOLEAN)],["formdatasource",i.PROP_STRING],["name",i.PROP_STRING],["numberOfFields",i.PROP_NUMBER],["show",Object.assign({value:!0},i.PROP_BOOLEAN)],["showindevice",Object.assign({displayType:"inline-block",value:"all"},i.PROP_STRING)],["subheading",i.PROP_STRING],["tabindex",Object.assign({value:0},i.PROP_NUMBER)],["title",i.PROP_STRING]]),P=function(){l.isMobileApp()&&w.set("captionwidth",Object.assign({value:"xs-4 sm-4 md-4 lg-4"},i.PROP_STRING));var e=new Map(w);e.set("action",i.PROP_STRING),e.set("defaultmode",Object.assign({value:"Edit"},i.PROP_STRING)),e.set("metadata",i.PROP_STRING),e.set("method",i.PROP_STRING),e.set("postmessage",Object.assign({value:"Data posted successfully"},i.PROP_STRING)),e.set("target",i.PROP_STRING),e.set("enctype",i.PROP_STRING),e.set("errormessage",Object.assign({value:"An error occured. Please try again!"},i.PROP_STRING)),e.set("messagelayout",Object.assign({value:"Inline"},i.PROP_STRING)),e.set("formdata",i.PROP_STRING),e.set("novalidate",i.PROP_BOOLEAN),e.set("validationtype",Object.assign({value:"default"},i.PROP_STRING)),e.set("iconclass",i.PROP_STRING),i.register("wm-form",e)},O=function(){l.isMobileApp()&&w.set("captionwidth",Object.assign({value:"xs-4 sm-4 md-4 lg-4"},i.PROP_STRING));var e=new Map(w);e.set("defaultmode",Object.assign({value:"View"},i.PROP_STRING)),e.set("formlayout",Object.assign({value:"inline"},i.PROP_STRING)),e.set("insertmessage",Object.assign({value:"Record added successfully"},i.PROP_STRING)),e.set("updatemessage",Object.assign({value:"Record updated successfully"},i.PROP_STRING)),e.set("deletemessage",Object.assign({value:"Record deleted successfully"},i.PROP_STRING)),e.set("errormessage",Object.assign({value:"An error occured. Please try again!"},i.PROP_STRING)),e.set("messagelayout",Object.assign({value:"Toaster"},i.PROP_STRING)),e.set("formdata",i.PROP_STRING),e.set("novalidate",i.PROP_BOOLEAN),e.set("validationtype",Object.assign({value:"default"},i.PROP_STRING)),e.set("iconclass",i.PROP_STRING),i.register("wm-liveform",e)},S=function(){l.isMobileApp()&&w.set("captionwidth",Object.assign({value:"xs-4 sm-4 md-4 lg-4"},i.PROP_STRING));var e=new Map(w);e.set("autoupdate",i.PROP_BOOLEAN),e.set("enableemptyfilter",Object.assign({value:" "},i.PROP_STRING)),e.set("pagesize",Object.assign({value:20},i.PROP_NUMBER)),e.set("iconclass",Object.assign({value:"wi wi-filter-list"},i.PROP_STRING)),i.register("wm-livefilter",e)},E={widgetType:"wm-form",hostClass:"panel app-panel app-form"},T={widgetType:"wm-form",hostClass:"app-form app-login-form"},R={widgetType:"wm-liveform",hostClass:"panel app-panel app-liveform liveform-inline"},A={widgetType:"wm-livefilter",hostClass:"panel app-panel app-livefilter clearfix liveform-inline"},C=function(e,t,n){var i=E;return null!==e?i=R:null!==t?i=A:"app-login"===n&&(i=T),i},I=function(e,t){var n="";return _.forEach(e,(function(e,t){n=n+" "+t+'="'+e+'"'})),'<wm-gridcolumn columnwidth="'+t+'">\n <wm-form-field '+n+"></wm-form-field>\n </wm-gridcolumn>"},D=function(e,t){var n=e.find("form.ng-invalid:visible, [formControlName].ng-invalid:visible").first(),i=t;return n.is("form")&&(i=t&&t.controls[n.attr("formControlName")||n.attr("name")])?D(n,i):{ngForm:i,$ele:n}},N=function(e,t,n){var i,o;if(!t.valid)if(t.controls)_.forEach(t.controls,(function(t,n){N(e,t,n)}));else{var r=e.$element.find('[wmformfield][key="'+n+'"]');r[0].setAttribute("__errormsg",r[0].getAttribute("__validationId")),null===(i=r[0].querySelector("input"))||void 0===i||i.setAttribute("aria-invalid",t.invalid),null===(o=r[0].querySelector("input"))||void 0===o||o.setAttribute("aria-describedby",r[0].getAttribute("__validationId")),t.markAsTouched()}},x=function(e){function t(t,n,o,r,a,s,c,p,u,d,h,m,f,g,v,y,b,w,P,O){var S=e.call(this,t,C(y,b,w))||this;S.fb=n,S.app=o,S.dialogService=r,S.dynamicComponentProvider=a,S.ngZone=s,S.parentList=c,S.parentForm=p,S.parentPrefab=u,S.parentPartial=d,S.onBeforeSubmitEvt=h,S.onSubmitEvt=m,S.onBeforeRenderEvt=f,S.binddataset=g,S.bindformdata=v,S._widgetClass="",S._captionClass="",S.formFields=[],S.formfields={},S.formWidgets={},S.filterWidgets={},S.buttonArray=[],S.dataoutput={},S.formdata={},S.statusMessage={caption:"",type:""},S.primaryKey=[],S._debouncedUpdateFieldSource=_.debounce(S.updateFieldSource,350),S.validationMessages=[],S._debouncedSubmitForm=l.debounce((function(e){S.ngZone.run((function(){S.submitForm(e)}))}),250),i.styler(S.nativeElement,S),l.removeAttr(S.nativeElement,"title"),S.isUpdateMode=!0,S.dialogId=S.nativeElement.getAttribute("dialogId"),S.ngform=n.group({}),S.bindingValue=P||O;var E=S.ngform.valueChanges.subscribe(S.updateDataOutput.bind(S));return S.registerDestroyListener((function(){return E.unsubscribe()})),S.elScope=S,S.addEventsToContext(S.context),S}return f(t,e),Object.defineProperty(t.prototype,"isLayoutDialog",{get:function(){return this._isLayoutDialog},set:function(e){e&&l.removeClass(this.nativeElement,"panel app-panel liveform-inline"),this._isLayoutDialog=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isUpdateMode",{get:function(){return this._isUpdateMode},set:function(e){this._isUpdateMode=e,this.formFields.forEach((function(t){t.setReadOnlyState(e)}))},enumerable:!1,configurable:!0}),t.prototype.submit=function(e){this._debouncedSubmitForm(e)},t.prototype.onReset=function(){this.reset()},t.prototype.onKeydownHandler=function(e){this._triggeredByUser=!0},Object.defineProperty(t.prototype,"parentFormArray",{get:function(){return this.parentForm&&this.isParentList&&this.parentForm.ngform.get(this.parentList.name)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isParentList",{get:function(){if(this.parentList&&this.parentForm&&!l.isDefined(this._formIsInList)){var e=this.$element.closest('.app-livelist[name="'+this.parentList.name+'"]');e.length&&(this._formIsInList=!e.find('form[widget-id="'+this.parentForm.widgetId+'"]').length)}return l.isDefined(this._formIsInList)?this._formIsInList:this.parentList},enumerable:!1,configurable:!0}),t.prototype.ngAfterContentInit=function(){var e=this;setTimeout((function(){e.componentRefs.forEach((function(t){t.name&&(e.formWidgets[t.name]=t)}))}),250)},t.prototype.ngAfterViewInit=function(){this.parentForm&&this.parentForm.ngform&&this.isParentList&&(_.get(this.parentForm.ngform.controls,this.parentList.name)||this.parentForm.ngform.setControl(this.parentList.name,new s.FormArray([])),this.parentFormArray.push(this.ngform),this.formArrayIndex=this.parentFormArray.length-1),this.addInnerNgFormToForm(this.bindingValue)},t.prototype.findOperationType=function(){},t.prototype.addInnerNgFormToForm=function(e){if(this.parentForm&&this.parentForm.ngform){if(this.isParentList)return;var t=this.parentPrefab||this.parentPartial;if(t){var n=(this.parentPrefab?t.$element.find("[wmprefabcontainer]"):t.$element).find("form").first();_.get(n[0],"widget.widgetId")===this.widgetId&&(n.isParentList||n.siblings("form").length||(e=_.get(t,"name")))}for(var i=1,o=e;this.parentForm.ngform.controls.hasOwnProperty(o);)o=e+"_"+i,i++;this.formGroupName=o,this.parentForm.ngform.addControl(o,this.ngform)}},t.prototype.addEventsToContext=function(e){var t=this;e.cancel=function(){return t.cancel()},e.reset=function(){return t.reset()},e.save=function(e){return t.save(e)},e.saveAndNew=function(){return t.saveAndNew()},e.saveAndView=function(){return t.saveAndView()},e.delete=function(){return t.delete()},e.new=function(){return t.new()},e.edit=function(){return t.edit()},e.highlightInvalidFields=function(){return t.highlightInvalidFields()},e.filter=function(){return t.filter()},e.clearFilter=function(){return t.clearFilter()},e.submit=function(e){return t.submit(e)}},t.prototype.setValidationOnInnerForms=function(e){var t=this,n=this.getNativeElement().querySelectorAll(".app-form");_.forEach(n,(function(n){var i=n.widget,o=_.get(i,"formGroupName")||i.name;l.isDefined(i.formArrayIndex)&&(o=o+"["+i.formArrayIndex+"]");for(var r=i;_.get(r,"parentForm");){var a=r.parentForm.formGroupName||r.parentForm.name;r.parentForm.parentFormArray&&(a=a+"["+r.parentForm.formArrayIndex+"]"),o=a+"."+o,r=r.parentForm}t.setValidationOnFields(i,o,e)}))},t.prototype.setValidationOnFields=function(e,t,n){var i=this,o=e.ngform.controls,r=e.formFields;r&&_.forEach(o,(function(o,a){var s,l=r.find((function(e){return e.key===a}));!l||n&&!o.touched||(null===(s=l.nativeElement.querySelector("input"))||void 0===s||s.setAttribute("aria-invalid",o.invalid),i.prepareValidationObj(o,a,l,t),i.prepareValidationObj.call(e,o,a,l,t))}))},t.prototype.prepareValidationObj=function(e,t,n,i){var o=this.validationMessages.findIndex((function(e){return e.field===t&&e.fullyQualifiedFormName===i}));e.invalid?-1===o?this.validationMessages.push({field:t,value:n.value,errorType:_.keys(e.errors),message:n.validationmessage||"",getElement:function(){return n.$element.find("[focus-target]")},formName:_.last(i.split(".")),fullyQualifiedFormName:i}):(this.validationMessages[o].value=n.value,this.validationMessages[o].errorType=_.keys(e.errors)):e.valid&&o>-1&&this.validationMessages.splice(o,1)},t.prototype.setValidationMsgs=function(e){!this.formFields.length&&_.isEmpty(this.ngform.controls)||(this.setValidationOnFields(this,this.name,e),this.setValidationOnInnerForms(e))},t.prototype.handleEvent=function(t,n,i,o){"submit"!==n&&e.prototype.handleEvent.call(this,this.nativeElement,n,i,o)},t.prototype.updateFieldSource=function(){var e=this;this.formdatasource&&this.formdatasource.execute(l.DataSource.Operation.IS_API_AWARE)||this.formdatasource&&!this.formdatasource.twoWayBinding||this.formFields.forEach((function(t){t.setFormWidget("datavaluesource",e.formdatasource),t.setFormWidget("binddatavalue",e.bindformdata+"."+t.key)}))},t.prototype.highlightInvalidFields=function(){N(this,this.ngform,"")},t.prototype.validateFieldsOnSubmit=function(){if(this.setValidationMsgs(),"delete"!==this.operationType&&("html"===this.validationtype||"default"===this.validationtype)&&this.ngform&&this.ngform.invalid){if(this.ngform.invalid){"default"===this.validationtype&&this.highlightInvalidFields();var e=D(this.$element,this.ngform),t=e.ngForm,n=e.$ele;if((n=n.parent().find("[focus-target]")).length){n.hasClass("app-search-input")||n.focus();var i=t&&t.controls[n.attr("formControlName")||n.attr("name")];return i&&i.markAsTouched&&i.markAsTouched(),l.$appDigest(),!0}return!0}return!1}return!1},t.prototype.onPropertyChange=function(t,n,i){switch(t){case"captionalign":this.captionAlignClass="align-"+n;break;case"captionposition":case"captionwidth":this.setLayoutConfig();break;case"captionsize":this.captionsize=n;break;case"novalidate":this.widget.validationtype=!0===n||"true"===n?"none":"default";break;case"formdata":if(_.isEqual(n,i))break;_.isArray(n)?this.setFormData(_.last(n)):this.setFormData(n),!this.isDataSourceUpdated&&this.datasource&&this.onDataSourceChange();break;case"defaultmode":this.isLayoutDialog||(this.updateMode=!(!n||"Edit"!==n),this.isUpdateMode=this.updateMode);break;case"datasource":this.onDataSourceChange();break;case"formdatasource":this.onFormDataSourceChange();break;case"metadata":this.generateFormFields();break;case"dataset":this.getFormFields().forEach((function(e){!e.isDataSetBound&&_.get(e.formWidget,"dataset$")&&e.formWidget.dataset$.next()}));break;default:e.prototype.onPropertyChange.call(this,t,n,i)}},t.prototype.onResultCb=function(e,t,n){var i={$event:n,$data:e,$operation:this.operationType};this.invokeEventCallback("result",i),t?this.invokeEventCallback("success",i):this.invokeEventCallback("error",i)},t.prototype.toggleMessage=function(e,t,n,i){var o;e&&t?(o="error"===n&&this.errormessage?this.errormessage:t,"Inline"===this.messagelayout?(o=this.checkAppServiceErrorMsg(n)||o,this.statusMessage={caption:o||"",type:n},this.messageRef&&this.messageRef.showMessage(this.statusMessage.caption,this.statusMessage.type),l.isElementInViewport(this.$element[0])||l.scrollToElement(this.$element[0])):this.app.notifyApp(o,n,i)):this.statusMessage.caption=""},t.prototype.checkAppServiceErrorMsg=function(e){var t=_.get(this.app,"Actions.appNotification");if(t&&"error"===e)return t.getMessage()},t.prototype.clearMessage=function(){this.toggleMessage(!1)},t.prototype.setLayoutConfig=function(){var e;e=i.getFieldLayoutConfig(this.captionwidth,this.captionposition,_.get(this.app.selectedViewPort,"os")),this._widgetClass=e.widgetCls,this._captionClass=e.captionCls,l.$appDigest()},t.prototype.registerFormWidget=function(e){var t=e.name||e.key;this.formWidgets[t]=e},t.prototype.registerFormFields=function(e){var t=this.formFields.push(e);this.formfields[e.key]=e,this.registerFormWidget(e),this._debouncedUpdateFieldSource(),this.parentForm&&(this.parentForm.formFields.push(e),this.parentForm.formfields[e.key]=e,this.parentForm.setFormData(this.parentForm.formdata,this.formFields,this.formdata||{})),t!==this.numberOfFields||_.isEmpty(this.formdata)||(this.onDataSourceChange(),_.isArray(this.formdata)?this.setFormData(_.last(this.formdata)):this.setFormData(this.formdata))},t.prototype.registerActions=function(e){this.buttonArray.push(e)},t.prototype.updateFormDataOutput=function(e){var t=this;_.forEach(this.ngform.value,(function(n,i){_.find(t.formFields,{key:i})||(e[i]=n)})),this.dataoutput=e},t.prototype.constructDataObject=function(){var e=this,t={};return this.getFormFields().forEach((function(n){var i,o;if(o=null===(o=n.datavalue||n._control.value)||""===o?void 0:o,"file"===n.type&&(o=l.getFiles(e.name,n.key+"_formWidget",n.multiple)),i=n.key||n.target||n.name,n.form.widgetId!==e.widgetId&&n.form.formGroupName)(r=_.get(t,n.form.formGroupName,{}))[i]=o,_.set(t,n.form.formGroupName,r);else if(n.form.isParentList){var r;(r=_.get(t,n.form.parentList.name,[]))[n.form.formArrayIndex]=r[n.form.formArrayIndex]||{},r[n.form.formArrayIndex][i]=o,_.set(t,n.form.parentList.name,r)}else _.set(t,i,o)})),this.updateFormDataOutput(t),this.dataoutput},t.prototype.updateDataOutput=function(){this.constructDataObject(),this.ngform.touched&&this.setValidationMsgs(!0)},t.prototype.getFormFields=function(){var e=this;return _.filter(this.formFields,(function(t){return t.form.name===e.name}))},t.prototype.setFieldValue=function(e,t,n){var i=e.key||e.name,o=n||t;o&&((o.hasOwnProperty(i)||_.includes(i,".")&&o.hasOwnProperty(_.split(i,".")[0]))&&(e.value=_.get(o,i)),this.dirty&&!this._triggeredByUser&&this.markAsPristine());var r=e.form.formGroupName;r&&_.get(t,r)&&this.setFormData.call(e.form,t[r]),_.get(e.form,"parentFormArray")&&this.setFormDataFromParentFormData.call(e.form,t)},t.prototype.setFormData=function(e,t,n){var i=this;(t||this.formFields).forEach((function(t){i.setFieldValue(t,e,n),t.fieldValidations&&t.fieldValidations.setCustomValidationMessage()})),this.constructDataObject()},t.prototype.resetFormState=function(){this.validationMessages.length&&(this.validationMessages=[]),this.ngform&&(this.ngform.markAsUntouched(),this.ngform.markAsPristine())},t.prototype.reset=function(){var e=this;this.resetFormState(),this.formFields.forEach((function(t){var n;t.value="","upload"!==t.widgettype&&t.type!==l.DataType.BLOB||e.resetFileUploadWidget(t,!0),null===(n=t.nativeElement.querySelector("input"))||void 0===n||n.removeAttribute("aria-invalid")})),this.constructDataObject(),this.clearMessage()},t.prototype.savePrevformFields=function(){this.prevformFields=l.getClonedObject(this.formFields.map((function(e){return{key:e.key,type:e.type,widgettype:e.widgettype,outputformat:e.outputformat,value:e.value}})))},t.prototype.savePrevDataValues=function(){this.prevDataValues=this.formFields.map((function(e){return{key:e.key,value:e.value}}))},t.prototype.setReadonlyFields=function(){this.formFields.forEach((function(e){e.setReadOnlyState()}))},t.prototype.resetFileUploadWidget=function(e,t){this.$element.find('[name="'+e.key+'_formWidget"]').val(""),e._control.reset(),t||(e.href="",e.value=null)},t.prototype.emptyDataModel=function(){var e=this;this.formFields.forEach((function(t){l.isDefined(t)&&(t.type===l.DataType.BLOB?e.resetFileUploadWidget(t):t.datavalue="")}))},t.prototype.setDefaultValues=function(){var e=this;this.formFields.forEach((function(t){e.onFieldDefaultValueChange(t,t.defaultvalue)}))},t.prototype.setOperationType=function(e){this.operationType=e||"insert"},t.prototype.new=function(){var e=this;this.resetFormState(),this.operationType=i.Live_Operations.INSERT,this.clearMessage(),this.isSelected&&this.savePrevformFields(),this.emptyDataModel(),setTimeout((function(){e.setDefaultValues(),e.savePrevDataValues(),e.constructDataObject()})),this.isUpdateMode=!0},t.prototype.edit=function(){this.resetFormState(),this.clearMessage(),this.operationType=i.Live_Operations.UPDATE,this.isSelected&&(this.savePrevformFields(),this.savePrevDataValues()),this.prevDataObject=l.getClonedObject(this.formdata||{}),this.setReadonlyFields(),this.isUpdateMode=!0,l.$appDigest()},t.prototype.triggerWMEvent=function(e){var t=this.nativeElement.getAttribute("dependson");t&&(l.$invokeWatchers(!0),this.app.notify("wm-event",{eventName:e,widgetName:t}))},t.prototype.submitForm=function(e){var t,n,o,r=this,a=this.datasource;if(!this.validateFieldsOnSubmit()){n=l.getClonedObject(this.constructDataObject());var s=function(){return{$event:e,$formData:n,$data:n}};if(this.onBeforeSubmitEvt){if(!1===this.invokeEventCallback("beforesubmit",s()))return;this.resetFormState()}else this.resetFormState();if(this.onSubmitEvt||a)if(a){var c=a.pagination&&a.pagination.number+1,p=this.operationType?this.operationType:"insert";i.performDataOperation(a,n,{operationType:p}).then((function(e){return"wm.CrudVariable"===a.category&&(r.triggerWMEvent("resetEditMode"),r.datasource.execute(l.DataSource.Operation.LIST_RECORDS,{skipToggleState:!0,operation:"list",page:c,preventMissingOpMsg:!0}),r.dialogId&&r.closeDialog()),l.isDefined(e.body)?(o=l.getValidJSON(e.body),o=l.isDefined(o)?o:e.body):o=e,{result:o,status:!0,message:r.postmessage,type:"success"}}),(function(e){return t=r.errormessage||e.error||e,l.$appDigest(),{result:_.get(e,"error")||e,status:!1,message:t,type:"error"}})).then((function(t){("error"===t.type&&!r.onError||"success"===t.type&&!r.onSuccess)&&r.toggleMessage(!0,t.message,t.type),r.invokeEventCallback("submit",s()),r.onResultCb(t.result,t.status,e)}))}else this.invokeEventCallback("submit",s()),this.onResultCb({},!0,e);else this.onResultCb({},!0,e)}},t.prototype.closeDialog=function(){this.dialogService.close(this.dialogId)},t.prototype.showButtons=function(e){var t=this;return _.some(this.buttonArray,(function(n){return _.includes(n.position,e)&&n.updateMode===t.isUpdateMode}))},t.prototype.expandCollapsePanel=function(){this.collapsible&&(this.expanded=!this.expanded)},t.prototype.onDataSourceUpdate=function(e,t,n){t?this.new():(this.setFormData(e),this.closeDialog()),this.isUpdateMode=!l.isDefined(n)||n},t.prototype.getNearestParentFormData=function(e){return e.parentForm?e.bindformdata||!_.get(e.parentForm,"formdata")||_.isEmpty(e.parentForm.formdata)?this.getNearestParentFormData(e.parentForm):e.parentForm.formdata:{}},t.prototype.setFormDataFromParentFormData=function(e){if(_.isEmpty(this.formdata)&&this.parentForm&&e)if(this.parentFormArray){var t=_.get(e,this.parentList.name);if(t)_.isArray(t)||(t=[t]),this.parentFormArray.patchValue(t),this.bindformdata||(this.formdata=t[this.formArrayIndex]),this.setFormData(this.formdata);else if(this.isParentList&&this.parentForm.formGroupName){var n=_.get(e,this.parentForm.formGroupName);this.setFormDataFromParentFormData(n)}}else this.setFormData(e)},t.prototype.onDataSourceChange=function(){if(_.get(this.formFields,"length")&&!this.bindformdata){this.isDataSourceUpdated=!0;var e=this.getNearestParentFormData(this);this.setFormDataFromParentFormData(e)}},t.prototype.onFormDataSourceChange=function(){this.updateFieldSource()},t.prototype.onFieldDefaultValueChange=function(e,t){e.value=i.parseValueByType(t,void 0,e.widgettype,e.trailingzero),this.dirty&&!this._triggeredByUser&&this.markAsPristine()},t.prototype.onFieldValueChange=function(){},t.prototype.generateFormFields=function(){return g(this,void 0,void 0,(function(){var e,t,n,i,o,r,a,s,c,p,u;return v(this,(function(d){switch(d.label){case 0:if(_.isUndefined(this._isGridLayoutPresent)&&(this._isGridLayoutPresent=this.$element.find(".panel-body [wmlayoutgrid]").length>0),this._isGridLayoutPresent?(t=this.$element.find(".form-elements [wmlayoutgrid]").first(),e=Number(t.attr("columns"))||1):((t=this.$element.find(".form-elements .dynamic-form-container")).length||(this.$element.find(".form-elements").prepend('<div class="dynamic-form-container"></div>'),t=this.$element.find(".form-elements .dynamic-form-container")),e=1),n=12/e,i="",o=0,s=this.metadata?this.metadata.data||this.metadata:[],this.formFields=[],_.isEmpty(s))return[2];if(this.onBeforeRenderEvt&&(a=this.invokeEventCallback("beforerender",{$metadata:s}))&&(s=a),!_.isArray(s))return[2];for(;s[o];){for(c="",r=0;r<e;r++)s[o]&&(c+=I(s[o],n)),o++;i+="<wm-gridrow>"+c+"</wm-gridrow>"}return this._isGridLayoutPresent||(i="<wm-layoutgrid>"+i+"</wm-layoutgrid>"),this.dynamicFormRef.clear(),this._dynamicContext||(this._dynamicContext=Object.create(this.viewParent),this._dynamicContext.form=this),[4,this.dynamicComponentProvider.getComponentFactoryRef("app-form-dynamic-"+this.widgetId,i,{noCache:!0,transpile:!0})];case 1:return p=d.sent(),u=this.dynamicFormRef.createComponent(p,0,this.inj),l.extendProto(u.instance,this._dynamicContext),t[0].appendChild(u.location.nativeElement),this.setFormData(this.formdata),[2]}}))}))},Object.defineProperty(t.prototype,"mode",{get:function(){return this.operationType||this.findOperationType()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dirty",{get:function(){return this.ngform&&this.ngform.dirty},enumerable:!1,configurable:!0}),t.prototype.markAsPristine=function(e){void 0===e&&(e=!1),this.ngform.markAsPristine({onlySelf:e})},t.prototype.markAsDirty=function(e){void 0===e&&(e=!1),this.ngform.markAsDirty({onlySelf:e})},Object.defineProperty(t.prototype,"invalid",{get:function(){return this.ngform&&this.ngform.invalid},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"touched",{get:function(){return this.ngform&&this.ngform.touched},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"valid",{get:function(){return this.ngform&&this.ngform.valid},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pristine",{get:function(){return this.ngform&&this.ngform.pristine},enumerable:!1,configurable:!0}),t.prototype.markAsTouched=function(e){void 0===e&&(e=!1),this.ngform.markAsTouched({onlySelf:e})},t.prototype.markAsUntouched=function(e){void 0===e&&(e=!1),this.ngform.markAsUntouched({onlySelf:e})},t.prototype.invokeActionEvent=function(e,t){l.$parseEvent(t)(this.viewParent,Object.assign(this.context,{$event:e}))},t.prototype.ngOnDestroy=function(){var t=this.parentForm&&_.get(this.parentForm,"ngform.controls");t&&(_.get(this.parentList,"name")&&t.hasOwnProperty(this.parentList.name)&&this.parentForm.ngform.removeControl(this.parentList.name),this.formGroupName&&t.hasOwnProperty(this.formGroupName)?this.parentForm.ngform.removeControl(this.formGroupName):this.parentForm.ngform.removeControl(this.name)),e.prototype.ngOnDestroy.call(this)},t}(i.StylableComponent);x.initializeProps=P(),x.decorators=[{type:t.Component,args:[{selector:"form[wmForm]",template:'<ng-template #content><ng-content></ng-content></ng-template>\n\n<ng-container *ngIf="formlayout === \'page\'; then pageLayoutTemplate else defaultTemplate">\n</ng-container>\n\n<ng-template #defaultTemplate>\n <div class="panel-heading" *ngIf="!isLayoutDialog && (title || subheading || iconclass || showButtons(\'header\'))">\n <h3 class="panel-title">\n <div class="pull-left">\n <i class="app-icon panel-icon" aria-hidden="true" [ngClass]="iconclass" *ngIf="iconclass"></i>\n </div>\n <div class="pull-left">\n <div class="heading" [innerHTML]="title"></div>\n <div class="description" [innerHTML]="subheading"></div>\n </div>\n <div class="form-action panel-actions basic-btn-grp">\n <ng-container *ngFor="let btn of buttonArray | filter : \'position\' : \'header\'"\n [ngTemplateOutlet]="btn.widgetType === \'button\' ? buttonRef : anchorRef" [ngTemplateOutletContext]="{btn:btn}">\n </ng-container>\n <button type="button" class="app-icon wi panel-action" *ngIf="collapsible" title="Collapse/Expand"\n [ngClass]="expanded ? \'wi-minus\': \'wi-plus\'" (click)="expandCollapsePanel();"></button>\n </div>\n </h3>\n </div>\n <div class="panel-body" [ngClass]="{\'form-elements\': isLayoutDialog, \'form-body\': !isLayoutDialog}" [class.hidden]="!expanded">\n <p wmMessage [hidden]="!statusMessage.caption.toString()" [attr.aria-hidden]="!statusMessage.caption" [attr.aria-label]="statusMessage.caption" caption.bind="statusMessage.caption" type.bind="statusMessage.type"></p>\n <div [ngClass]="{\'form-elements\': !isLayoutDialog, \'form-content\': isLayoutDialog}">\n <ng-container *ngTemplateOutlet="content"></ng-container>\n </div>\n <div class="basic-btn-grp form-action panel-footer clearfix" [ngClass]="{\'modal-footer\': isLayoutDialog}" [class.hidden]="!expanded || !showButtons(\'footer\')">\n <ng-container *ngFor="let btn of buttonArray | filter : \'position\' : \'footer\'"\n [ngTemplateOutlet]="btn.widgetType === \'button\' ? buttonRef : anchorRef" [ngTemplateOutletContext]="{btn:btn}">\n </ng-container>\n </div>\n </div>\n</ng-template>\n\n<ng-template #pageLayoutTemplate>\n <ng-container *ngTemplateOutlet="content"></ng-container>\n</ng-template>\n\n<ng-template #buttonRef let-btn="btn">\n <button wmButton name="{{btn.key}}" caption.bind="btn.displayName" class.bind="btn.class" iconclass.bind="btn.iconclass" show.bind="btn.show"\n (click)="invokeActionEvent($event, btn.action)" type.bind="btn.type" hint.bind="btn.title" shortcutkey.bind="btn.shortcutkey" disabled.bind="ngform.status === \'PENDING\' || btn.disabled"\n tabindex.bind="btn.tabindex" [attr.aria-label]="btn.displayName" [class.hidden]="btn.updateMode ? !isUpdateMode : isUpdateMode"></button>\n</ng-template>\n\n<ng-template #anchorRef let-btn="btn">\n <a wmAnchor name="{{btn.key}}" caption.bind="btn.displayName" class.bind="btn.class" iconclass.bind="btn.iconclass" show.bind="btn.show"\n (click)="invokeActionEvent($event, btn.action)" hint.bind="btn.title" shortcutkey.bind="btn.shortcutkey"\n hyperlink.bind="btn.hyperlink" target.bind="btn.target"\n tabindex.bind="btn.tabindex" [class.hidden]="btn.updateMode ? !isUpdateMode : isUpdateMode"></a>\n</ng-template>\n\n<ng-container #dynamicForm></ng-container>\n',providers:[i.provideAsWidgetRef(x)]}]}],x.ctorParameters=function(){return[{type:t.Injector},{type:s.FormBuilder},{type:l.App},{type:l.AbstractDialogService},{type:l.DynamicComponentRefProvider},{type:t.NgZone},{type:p.ListComponent,decorators:[{type:t.Optional}]},{type:x,decorators:[{type:t.SkipSelf},{type:t.Optional}]},{type:c.PrefabDirective,decorators:[{type:t.SkipSelf},{type:t.Optional}]},{type:i.PartialDirective,decorators:[{type:t.SkipSelf},{type:t.Optional}]},{type:void 0,decorators:[{type:t.Attribute,args:["beforesubmit.event"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["submit.event"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["beforerender.event"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["dataset.bind"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["formdata.bind"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["wmLiveForm"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["wmLiveFilter"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["data-role"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["key"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["name"]}]}]},x.propDecorators={dynamicFormRef:[{type:t.ViewChild,args:["dynamicForm",{static:!0,read:t.ViewContainerRef}]}],messageRef:[{type:t.ViewChild,args:[i.MessageComponent]}],componentRefs:[{type:t.ContentChildren,args:[i.WidgetRef,{descendants:!0}]}],action:[{type:t.HostBinding,args:["action"]}],submit:[{type:t.HostListener,args:["submit",["$event"]]}],onReset:[{type:t.HostListener,args:["reset"]}],onKeydownHandler:[{type:t.HostListener,args:["keydown",["$event"]]}]};var k=function(){function e(e,t,n,i,o,r){var a=this;this.componentInstance=n,this.name=o,this.key=r,this.fb=i,this.parent=e||t,this.ngform=this.parent.ngform,this.componentInstance.registerPropertyChangeListener((function(e,t){"datavalue"===e&&a._control?a._control.setValue(t):"name"!==e||a._control||a.addControl(a.key||t)}))}return Object.defineProperty(e.prototype,"_control",{get:function(){var e=this.key||this.name;if(e)return this.ngform&&this.ngform.controls[e]},enumerable:!1,configurable:!0}),e.prototype.addControl=function(e){this.ngform.addControl(e,this.createControl())},e.prototype.createControl=function(){return this.fb.control(this.componentInstance.datavalue)},e.prototype.ngOnInit=function(){var e=this.key||this.name;e&&!this._control&&(this.addControl(e),this.parent.registerFormWidget(this.componentInstance))},e}();k.decorators=[{type:t.Directive,args:[{selector:"[wmFormWidget]"}]}],k.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[x]}]},{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[u.TableComponent]}]},{type:void 0,decorators:[{type:t.Self},{type:t.Inject,args:[i.WidgetRef]}]},{type:s.FormBuilder},{type:void 0,decorators:[{type:t.Attribute,args:["name"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["key"]}]}]};var M=function(){i.register("wm-form-action",new Map([["accessroles",i.PROP_STRING],["action",i.PROP_STRING],["class",i.PROP_STRING],["binding",i.PROP_STRING],["disabled",i.PROP_BOOLEAN],["display-name",i.PROP_STRING],["hyperlink",i.PROP_STRING],["iconclass",i.PROP_STRING],["iconname",i.PROP_STRING],["key",i.PROP_STRING],["position",Object.assign({value:"footer"},i.PROP_STRING)],["shortcutkey",i.PROP_STRING],["show",Object.assign({value:!0},i.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},i.PROP_NUMBER)],["target",i.PROP_STRING],["title",i.PROP_STRING],["type",Object.assign({value:"button"},i.PROP_STRING)],["update-mode",Object.assign({value:!0},i.PROP_BOOLEAN)],["widget-type",Object.assign({value:"button"},i.PROP_STRING)]]))},L={widgetType:"wm-form-action",hostClass:""},F=function(e){function t(t,n){var i=e.call(this,t,L)||this;return i.form=n,i}return f(t,e),t.prototype.populateAction=function(){this.buttonDef={key:this.key||this.binding,displayName:this["display-name"],show:this.show,class:this.class?this.class:"button"===this["widget-type"]?"btn-secondary":"",iconclass:this.iconclass||"",title:_.isUndefined(this.title)?this["display-name"]||"":this.title,action:this.action,accessroles:this.accessroles,shortcutkey:this.shortcutkey,disabled:this.disabled,tabindex:this.tabindex,iconname:this.iconname,type:this.type,updateMode:this["update-mode"],position:this.position,widgetType:this["widget-type"],hyperlink:this.hyperlink,target:this.target},this._propsInitialized=!0},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.populateAction(),this.form.registerActions(this.buttonDef)},t.prototype.onPropertyChange=function(e,t,n){if(this._propsInitialized)switch(e){case"display-name":this.buttonDef.displayName=t;default:this.buttonDef[e]=t}},t}(i.BaseComponent);F.initializeProps=M(),F.decorators=[{type:t.Directive,args:[{selector:"[wmFormAction]",providers:[i.provideAsWidgetRef(F)]}]}],F.ctorParameters=function(){return[{type:t.Injector},{type:x,decorators:[{type:t.Optional}]}]};var j=function(){var e=new Map([["dataentrymode",Object.assign({value:"default"},i.PROP_STRING)],["debouncetime",Object.assign({value:250},i.PROP_NUMBER)],["defaultvalue",i.PROP_STRING],["displayname",i.PROP_STRING],["display-name",i.PROP_STRING],["field",i.PROP_STRING],["filterexpressions",i.PROP_STRING],["filter-on",i.PROP_STRING],["generator",i.PROP_STRING],["hint",i.PROP_STRING],["inputtype",i.PROP_STRING],["is-primary-key",i.PROP_BOOLEAN],["is-range",i.PROP_BOOLEAN],["is-related",i.PROP_BOOLEAN],["isformfield",{value:!0}],["key",i.PROP_STRING],["limit",i.PROP_NUMBER],["lookup-type",i.PROP_STRING],["lookup-field",i.PROP_STRING],["name",i.PROP_STRING],["matchmode",i.PROP_STRING],["maxdefaultvalue",i.PROP_STRING],["maxplaceholder",i.PROP_STRING],["mobile-display",Object.assign({value:!0},i.PROP_BOOLEAN)],["period",i.PROP_BOOLEAN],["pc-display",Object.assign({value:!0},i.PROP_BOOLEAN)],["placeholder",i.PROP_STRING],["primary-key",i.PROP_BOOLEAN],["related-entity-name",i.PROP_STRING],["required",i.PROP_BOOLEAN],["show",Object.assign({value:!0},i.PROP_BOOLEAN)],["tablet-display",Object.assign({value:!0},i.PROP_BOOLEAN)],["type",i.PROP_STRING],["validationmessage",i.PROP_STRING],["viewmodewidget",i.PROP_STRING],["widgettype",i.PROP_STRING]]),t=function(t){var n="wm-form-field-"+l.FormWidgetType[t],o=i.getWidgetPropsByType(n);e.forEach((function(e,t){null==o.get(t)&&o.set(t,e)}))};for(var n in l.FormWidgetType)t(n)},B=function(){return{custom:!0}},G={image:"image/*",video:"video/*",audio:"audio/*"},V=function(e){function t(t,n,i,o,r,a,s,c,p,u,d,h,m,f,g,v,y,b,w){var P=this,_={widgetType:"wm-form-field",hostClass:"",widgetSubType:"wm-form-field-"+(d||l.FormWidgetType.TEXT).trim()},O=l.noop;return(P=e.call(this,t,_,new Promise((function(e){return O=e})))||this)._initPropsRes=O,P.app=r,P.fieldDefConfig={},P.class="",P.binddataset=c,P.binddisplayimagesrc=m,P.binddisplayexpression=p,P.bindChipclass=s,P.binddisplaylabel=u,P.form=n,P.fb=i,P.viewport=o,P._fieldName=f||h,P.isRange=g,P.excludeProps=new Set(["type","name"]),P.widgettype=d,P.parentList=a,P.notifyForFields=[],(P.binddataset||P.$element.attr("dataset"))&&(P.isDataSetBound=!0),w[0]._onFocusField=P._onFocusField.bind(P),w[0]._onBlurField=P._onBlurField.bind(P),P._debounceSetUpValidators=l.debounce((function(){return P.setUpValidators()}),500),P}return f(t,e),t.prototype.onKeydownHandler=function(e){this._triggeredByUser=!0},t.prototype.handleClick=function(e){this._clicktriggeredByUser=!0},t.prototype._onFocusField=function(e){this._activeField=!0,$(e.target).closest(".live-field").addClass("active")},t.prototype._onBlurField=function(e){var t,n,i,o;$(e.target).closest(".live-field").removeClass("active");this.nativeElement.querySelector("p.text-danger");this.ngform.controls[this._fieldName].invalid&&this.ngform.controls[this._fieldName].touched&&this.form.isUpdateMode?(this.nativeElement.setAttribute("__errormsg",""+this.nativeElement.getAttribute("__validationId")),null===(t=this.nativeElement.querySelector("input"))||void 0===t||t.setAttribute("aria-invalid",""+this.ngform.controls[this._fieldName].invalid),null===(n=this.nativeElement.querySelector("input"))||void 0===n||n.setAttribute("aria-describedby",""+this.nativeElement.getAttribute("__validationId"))):(this.nativeElement.removeAttribute("__errormsg"),null===(i=this.nativeElement.querySelector("input"))||void 0===i||i.removeAttribute("aria-invalid"),null===(o=this.nativeElement.querySelector("input"))||void 0===o||o.removeAttribute("aria-describedby")),this._activeField=!1,this._triggeredByUser=!1,this._clicktriggeredByUser=!1},t.prototype.evaluateExpr=function(e,t,n){if(n&&t||(t=Object.keys(e)[0]))return i.getEvaluatedData(e,{field:t,expression:n},this.viewParent)},t.prototype.getDisplayExpr=function(){var e=this,t=[],n=this.value,i=this.displayfield||this.displaylabel,o=this.displayexpression;return _.isObject(n)?(_.isArray(n)?_.forEach(n,(function(n){_.isObject(n)&&t.push(e.evaluateExpr(n,i,o))})):t.push(this.evaluateExpr(n,i,o)),_.join(t,",")):null==n?"":this.value},t.prototype.getCaption=function(){return void 0===this.value||null===this.value?_.get(this.form.dataoutput,this._fieldName)||"":this.value},t.prototype.notifyChanges=function(){_.forEach(this.notifyForFields,(function(e){e.fieldValidations.validate()}))},t.prototype.observeOn=function(e){this.fieldValidations.observeOn(e,"formfields")},t.prototype.setUpValidators=function(e){this.fieldValidations.setUpValidators(e)},t.prototype.setAsyncValidators=function(e){this.fieldValidations.setAsyncValidators(e)},t.prototype.setValidators=function(e){this.fieldValidations.setValidators(e)},t.prototype.setFormWidget=function(e,t){this.formWidget&&this.formWidget.widget&&(this.formWidget.widget[e]=t)},t.prototype.boundFn=function(e){return e()},t.prototype.setMaxFormWidget=function(e,t){this.formWidgetMax&&(this.formWidgetMax.widget[e]=t)},t.prototype.onPropertyChange=function(t,n,i){var o=this.form.dirty;if("tabindex"!==t&&e.prototype.onPropertyChange.call(this,t,n,i),!this.excludeProps.has(t)){if(this.widgettype===l.FormWidgetType.UPLOAD)return"required"===t&&this._debounceSetUpValidators(),void e.prototype.onPropertyChange.call(this,t,n,i);switch(this.setFormWidget(t,n),"placeholder"!==t&&this.setMaxFormWidget(t,n),t){case"defaultvalue":this.form.onFieldDefaultValueChange(this,n);break;case"maxdefaultvalue":this.maxValue=n,this.setMaxFormWidget("datavalue",n),this.form.onMaxDefaultValueChange();break;case"maxplaceholder":this.setMaxFormWidget("placeholder",n);break;case"required":o!==this.form.dirty&&this.form.markAsPristine();case"maxchars":case"minvalue":case"maxvalue":case"regexp":case"show":this._debounceSetUpValidators();break;case"primary-key":n&&this.form.setPrimaryKey(this._fieldName);break;case"display-name":this.displayname=n;break;case"readonly":this.setReadOnlyState()}}},t.prototype.onStyleChange=function(t,n,i){this.setFormWidget(t,n),this.setMaxFormWidget(t,n),e.prototype.onStyleChange.call(this,t,n,i)},Object.defineProperty(t.prototype,"datavalue",{get:function(){return this.formWidget&&this.formWidget.datavalue},set:function(e){this._control&&this.widgettype!==l.FormWidgetType.UPLOAD&&this._control.setValue(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.datavalue},set:function(e){this.datavalue=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxValue",{get:function(){return this.formWidgetMax&&this.formWidgetMax.datavalue},set:function(e){this._maxControl&&this._maxControl.setValue(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minValue",{get:function(){return this.value},set:function(e){this.value=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_control",{get:function(){return this.ngform&&this.ngform.controls[this._fieldName]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_maxControl",{get:function(){return this.ngform&&this.ngform.controls[this._fieldName+"_max"]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"displayValue",{get:function(){return this.formWidget&&this.formWidget.displayValue},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"timestamp",{get:function(){return this.formWidget&&this.formWidget.timestamp},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"charlength",{get:function(){return this.formWidget&&this.formWidget.charlength},enumerable:!1,configurable:!0}),t.prototype.createControl=function(){return this.fb.control(void 0,{validators:this._validators})},t.prototype.onValueChange=function(e){var t,n,i,o;if(!this.isDestroyed){var r=$(this.nativeElement).find(".caption-floating");if(r.length>0){var a=l.isDefined(e)&&""!==e&&null!==e||r.find("input").val()||r.find("input:-webkit-autofill").length;this.app.notify("captionPositionAnimate",{displayVal:a,nativeEl:r,isSelectMultiple:this.formWidget&&this.formWidget.multiple,isFocused:this._activeField})}this.ngform.controls[this._fieldName].invalid&&this.ngform.controls[this._fieldName].touched&&this.form.isUpdateMode?(this.nativeElement.setAttribute("__errormsg",""+this.nativeElement.getAttribute("__validationId")),null===(t=this.nativeElement.querySelector("input"))||void 0===t||t.setAttribute("aria-invalid",this._triggeredByUser&&this.ngform.controls[this._fieldName].invalid?"true":"false"),null===(n=this.nativeElement.querySelector("input"))||void 0===n||n.setAttribute("aria-describedby",""+this.nativeElement.getAttribute("__validationId"))):(this.nativeElement.removeAttribute("__errormsg"),null===(i=this.nativeElement.querySelector("input"))||void 0===i||i.removeAttribute("aria-invalid"),null===(o=this.nativeElement.querySelector("input"))||void 0===o||o.removeAttribute("aria-describedby")),this.form.onFieldValueChange(this,e),this.notifyChanges(),(this.$element.find(".active").length>0||this.form.touched)&&((this._triggeredByUser||l.isMobile()&&this._clicktriggeredByUser&&l.isDateTimeType(this.widgettype))&&this.ngform.controls[this._fieldName].markAsTouched(),this.fieldValidations.setCustomValidationMessage())}},t.prototype.onStatusChange=function(e){this.isDestroyed||(this.showPendingSpinner="PENDING"===e,"PENDING"===e?this.formWidget.disabled=!0:this.formWidget.disabled!==this.disabled&&(this.formWidget.disabled=this.disabled))},t.prototype.setValidationMessage=function(e){var t=this;setTimeout((function(){t.validationmessage=e,t.setUpValidators(B)}))},t.prototype.setReadOnlyState=function(){var e;e=!this.form.isUpdateMode||(!this["primary-key"]||this["is-related"]||this.period?this.readonly:!("assigned"===this.generator&&"update"!==this.form.operationType)),this.setFormWidget("readonly",e)},t.prototype.resetDisplayInput=function(){l.isDefined(this.value)&&""!==this.value||this.formWidget&&this.formWidget.resetDisplayInput&&this.formWidget.resetDisplayInput()},t.prototype.triggerUploadEvent=function(e,t){var n={$event:e};"change"===t&&(n.newVal=e.target.files,n.oldVal=this._oldUploadVal,this._oldUploadVal=n.newVal),this.invokeEventCallback(t,n)},t.prototype.registerFormField=function(){var e=this._fieldName;if(this.parentList&&this.form.parentList!==this.parentList){for(var t=1,n=e;this.ngform.controls.hasOwnProperty(n);)n=e+"_"+t,t++;this.ngform.addControl(n,this.createControl()),this._fieldName=n}else this.ngform.addControl(e,this.createControl());var i=this._control.valueChanges.pipe(d.debounceTime(200)).subscribe(this.onValueChange.bind(this));this.registerDestroyListener((function(){return i.unsubscribe()}));var o=this._control.statusChanges.pipe(d.debounceTime(100)).subscribe(this.onStatusChange.bind(this));if(this.registerDestroyListener((function(){return o.unsubscribe()})),"true"===this.isRange){this.ngform.addControl(e+"_max",this.createControl());var r=this._maxControl.valueChanges.pipe(d.debounceTime(200)).subscribe(this.onValueChange.bind(this));this.registerDestroyListener((function(){return r.unsubscribe()}))}this.value=_.get(this.form.formdata,this._fieldName)},t.prototype.ngOnInit=function(){this.ngform=this.form.ngform,this.registerFormField(),this.fieldValidations=new i.BaseFieldValidations(this,this.formWidget,this.widgettype,this._control,this.form),e.prototype.ngOnInit.call(this)},t.prototype.ngAfterContentInit=function(){var t=this;e.prototype.ngAfterContentInit.call(this),this.formWidget&&(this._initPropsRes(),this.setFormWidget("binddisplaylabel",this.binddisplaylabel),this.setFormWidget("binddisplayexpression",this.binddisplayexpression),this.setFormWidget("binddisplayimagesrc",this.binddisplayimagesrc),this.setFormWidget("bindChipclass",this.bindChipclass),this.setFormWidget("binddataset",this.binddataset)),this.registerReadyStateListener((function(){if(t.key=t._fieldName||t.target||t.binding,t.viewmodewidget=t.viewmodewidget||i.getDefaultViewModeWidget(t.widgettype),t.widgettype===l.FormWidgetType.UPLOAD){var e;e=t.filetype?G[t.filetype]:"",t.permitted=e+(t.extensions?(e?",":"")+t.extensions:"")}l.isMobile()&&t.viewport.isMobileType?t["mobile-display"]||(t.widget.show=!1):t.viewport.isTabletType?t["tablet-display"]||(t.widget.show=!1):t["pc-display"]||(t.widget.show=!1),t.fieldDefConfig.displaname=t.displayname,t.fieldDefConfig.show=t.show,t.fieldDefConfig.isRelated=t["is-related"],t.fieldDefConfig.inputtype=t.inputtype,t.fieldDefConfig.generator=t.generator,t.fieldDefConfig.placeholder=t.placeholder,t.fieldDefConfig.primaryKey=t["primary-key"],t.fieldDefConfig.required=t.required,t.fieldDefConfig._readonly=t.readonly,t.fieldDefConfig.regexp=t.regexp,t.fieldDefConfig.type=t.type,t.fieldDefConfig.key=t.key,t.fieldDefConfig.mobileDisplay=t["mobile-display"],t.fieldDefConfig.name=t.name,t.fieldDefConfig.pcDisplay=t["pc-display"],t.fieldDefConfig.tabletDisplay=t["tablet-display"],t.fieldDefConfig.validationmessage=t.validationmessage,t.fieldDefConfig.viewmodewidget=t.viewmodewidget,t.fieldDefConfig.widget=t.widgettype,t.form.registerFormFields(t.widget),l.addForIdAttributes(t.nativeElement),t.setReadOnlyState()}))},t}(i.StylableComponent);V.initializeProps=j(),V.decorators=[{type:t.Directive,args:[{selector:"[wmFormField]",exportAs:"wmFormField",providers:[i.provideAsWidgetRef(V),i.provideAs(V,s.NG_VALUE_ACCESSOR,!0),{provide:i.Context,useValue:{},multi:!0}]}]}],V.ctorParameters=function(){return[{type:t.Injector},{type:x},{type:s.FormBuilder},{type:l.Viewport},{type:l.App},{type:p.ListComponent,decorators:[{type:t.Optional}]},{type:String,decorators:[{type:t.Attribute,args:["chipclass.bind"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["dataset.bind"]}]},{type:String,decorators:[{type:t.Attribute,args:["displayexpression.bind"]}]},{type:String,decorators:[{type:t.Attribute,args:["displaylabel.bind"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["widgettype"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["name"]}]},{type:String,decorators:[{type:t.Attribute,args:["displayimagesrc.bind"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["key"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["is-range"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["pc-display"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["mobile-display"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["tablet-display"]}]},{type:Array,decorators:[{type:t.Self},{type:t.Inject,args:[i.Context]}]}]},V.propDecorators={formWidget:[{type:t.ContentChild,args:["formWidget",{static:!0}]}],formWidgetMax:[{type:t.ContentChild,args:["formWidgetMax"]}],onKeydownHandler:[{type:t.HostListener,args:["keydown",["$event"]]}],handleClick:[{type:t.HostListener,args:["click",["$event"]]}]};var U=function(){function e(e,t,n){this.subscribedWidget=e,this.app=t,this.dialogService=n,e.addRow=this.addRow.bind(this),e.updateRow=this.updateRow.bind(this),e.deleteRow=this.deleteRow.bind(this),e.call=this.call.bind(this)}return e.prototype.addRow=function(){this.app.notify("wm-event",{eventName:i.Live_Operations.INSERT,widgetName:this.subscribedWidget.name,row:this.subscribedWidget.selecteditem})},e.prototype.updateRow=function(){this.app.notify("wm-event",{eventName:i.Live_Operations.UPDATE,widgetName:this.subscribedWidget.name,row:this.subscribedWidget.selecteditem})},e.prototype.deleteRow=function(){this.app.notify("wm-event",{eventName:i.Live_Operations.DELETE,widgetName:this.subscribedWidget.name,row:this.subscribedWidget.selecteditem})},e.prototype.successHandler=function(e,t){l.triggerFn(e.success,t)},e.prototype.errorHandler=function(e,t){this.app.notifyApp(t,"error","ERROR"),l.triggerFn(e.error,t)},e.prototype.getRecords=function(e,t){var n,o,r=this;"None"!==this.subscribedWidget.navigation&&this.subscribedWidget.dataNavigator?(o=this.subscribedWidget.dataNavigator,t===i.Live_Operations.DELETE?(o.dataSize-=1,o.calculatePagingValues(),n=o.pageCount<o.dn.currentPage?"prev":void 0):("last"===(n=t===i.Live_Operations.INSERT?"last":"current")&&(o.dataSize+=1),o.calculatePagingValues()),o.navigatePage(n,null,!0,(function(t){r.successHandler(e,t)}))):this.subscribedWidget.datasource.execute(l.DataSource.Operation.LIST_RECORDS,{skipToggleState:!0}).then((function(t){r.successHandler(e,t)}),(function(t){r.errorHandler(e,t)}))},e.prototype.performCUDOperation=function(e,t,n){var o=this;i.performDataOperation(this.subscribedWidget.datasource,e,{operationType:t}).then((function(e){e.error?o.errorHandler(n,e.error):("wm.CrudVariable"===o.subscribedWidget.datasource.category&&"delete"===t?o.subscribedWidget.datasource.execute(l.DataSource.Operation.LIST_RECORDS,{skipToggleState:!0}).then((function(e){o.successHandler(n,e)}),(function(e){o.errorHandler(n,e)})):o.getRecords(n,t),"delete"===t&&o.app.notifyApp(o.app.appLocale.MESSAGE_DELETE_RECORD_SUCCESS,"success"))}),(function(e){o.errorHandler(n,e)}))},e.prototype.insertRecord=function(e,t,n){this.performCUDOperation(e,t,n)},e.prototype.updateRecord=function(e,t,n){this.performCUDOperation(e,t,n)},e.prototype.deleteRecord=function(e,t,n){var i=this;this.dialogService.showAppConfirmDialog({title:this.app.appLocale.MESSAGE_DELETE_RECORD||"Delete Record",iconclass:"wi wi-delete fa-lg",message:this.subscribedWidget.confirmdelete||"Are you sure you want to delete this?",oktext:this.subscribedWidget.deleteoktext||"Ok",canceltext:this.subscribedWidget.deletecanceltext||"Cancel",onOk:function(){i.performCUDOperation(e,t,n),i.dialogService.closeAppConfirmDialog()},onCancel:function(){l.triggerFn(n.cancelDeleteCallback),i.dialogService.closeAppConfirmDialog()}})},e.prototype.performOperation=function(e,t){var n={row:t.row,prevData:{},rowData:{},transform:!0,skipNotification:!0};switch(e===i.Live_Operations.UPDATE&&(n.rowData=t.rowData,n.prevData=t.prevData),e){case i.Live_Operations.INSERT:this.insertRecord(n,e,t);break;case i.Live_Operations.UPDATE:this.updateRecord(n,e,t);break;case i.Live_Operations.DELETE:this.deleteRecord(n,e,t);break;case i.Live_Operations.READ:this.getRecords(t,e)}},e.prototype.call=function(e,t,n,i){t.success=n,t.error=i,this.performOperation(e,t)},e}();U.decorators=[{type:t.Directive,args:[{selector:"[wmLiveActions]"}]}],U.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Self},{type:t.Inject,args:[p.ListComponent]}]},{type:l.App},{type:l.AbstractDialogService}]};var W=function(){function e(e,t,n,i){this.dialogService=n,this.app=i,e&&(this.isLayoutDialog=!0,this.dialogId=e),this.dependson=t,this.eventSubscription=this.app.subscribe("wm-event",this.handleEvent.bind(this))}return e.prototype.openFormDialog=function(){this.dialogService.open(this.dialogId)},e.prototype.onUpdate=function(e,t,n){this.editMode=n||this.editMode,this.form.operationType=i.Live_Operations.UPDATE,this.form.isSelected=!0;var o=this.currentFormData;e&&t&&(o=t.multiselect?e[0]:e[e.length-1]),this.form.setFormData(o),this.form.edit(),this.editMode||(this.form.isUpdateMode=!1)},e.prototype.onInsert=function(){this.form.operationType=i.Live_Operations.INSERT,this.form.isSelected=!0,this.form.setFormData({}),this.form.new()},e.prototype.handleEvent=function(e){if(this.dependson===e.widgetName)switch(this.currentOp=e.eventName,e.eventName){case i.Live_Operations.UPDATE:this.currentFormData=e.row,this.isLayoutDialog?this.openFormDialog():this.onUpdate(void 0,void 0,!0);break;case i.Live_Operations.INSERT:this.isLayoutDialog?this.openFormDialog():this.onInsert();break;case i.Live_Operations.DELETE:this.app.Widgets[this.dependson].call("delete",{row:e.row});break;case i.Live_Operations.READ:this.isLayoutDialog||(this.form.isUpdateMode=!1);break;case"rerender":e.dataSource&&e.dataSource.execute(l.DataSource.Operation.LIST_RECORDS,{skipToggleState:!0,operation:"list"});break;case"selectedItemChange":e.table&&this.onUpdate(e.row,e.table);break;case"resetEditMode":this.editMode=!1}},e.prototype.onFormRender=function(){var e=this;this.form&&this.isLayoutDialog&&(this.form.isLayoutDialog=!0,setTimeout((function(){e.currentOp===i.Live_Operations.UPDATE?e.onUpdate(void 0,void 0,!0):e.currentOp===i.Live_Operations.INSERT&&e.onInsert()}),250))},e.prototype.ngAfterContentInit=function(){var e=this;this.formChildren.first?this.form=this.formChildren.first:this.formSubscription=this.formChildren.changes.subscribe((function(t){e.form=t.first,e.onFormRender()})),this.app.notify("setup-cud-listener",this.dependson)},e.prototype.ngOnDestroy=function(){this.formSubscription&&this.formSubscription.unsubscribe(),this.eventSubscription&&this.eventSubscription()},e}();W.decorators=[{type:t.Directive,args:[{selector:"[dependson]"}]}],W.ctorParameters=function(){return[{type:String,decorators:[{type:t.Attribute,args:["dialogid"]}]},{type:String,decorators:[{type:t.Attribute,args:["dependson"]}]},{type:l.AbstractDialogService},{type:l.App}]},W.propDecorators={formChildren:[{type:t.ContentChildren,args:[x,{descendants:!0}]}]};var q="EMPTY_NULL_FILTER",z=function(){function e(e){var t=this;this.form=e,this._filter=l.debounce((function(e){t.filter(e)}),250),e.clearFilter=this.clearFilter.bind(this),e.applyFilter=this.applyFilter.bind(this),e.filter=this.filter.bind(this),e.filterOnDefault=this.filterOnDefault.bind(this),e.execute=this.execute.bind(this),e.onFieldDefaultValueChange=this.onFieldDefaultValueChange.bind(this),e.onMaxDefaultValueChange=this.onMaxDefaultValueChange.bind(this),e.onDataSourceChange=this.onDataSourceChange.bind(this),e.onFieldValueChange=this.onFieldValueChange.bind(this),e.submitForm=this.submitForm.bind(this),e.registerFormWidget=this.registerFormWidget.bind(this)}return e.prototype.execute=function(e,t){return e===l.DataSource.Operation.LIST_RECORDS||e===l.DataSource.Operation.DOWNLOAD?this.applyFilter(t):e===l.DataSource.Operation.GET_OPTIONS?this._options||{}:e===l.DataSource.Operation.GET_PAGING_OPTIONS?this.form.pagination:this.form.datasource?e===l.DataSource.Operation.FETCH_DISTINCT_VALUES?i.fetchDistinctValues(this.form.datasource,this.form.formFields,{widget:"widgettype",enableemptyfilter:this.form.enableemptyfilter,EMPTY_VALUE:this.form.appLocale.LABEL_NO_VALUE}):this.form.datasource.execute(e,t):{}},e.prototype.onFieldDefaultValueChange=function(e,t){e.minValue=t,e.value=t,this.filterOnDefault()},e.prototype.onFieldValueChange=function(e,t){i.applyFilterOnField(this.form.datasource,e.widget,this.form.formFields,t,{EMPTY_VALUE:this.form.appLocale.LABEL_NO_VALUE}),this.form.autoupdate&&l.isDefined(t)&&this._filter()},e.prototype.onMaxDefaultValueChange=function(){var e=this;setTimeout((function(){e.filterOnDefault()}))},e.prototype.onDataSourceChange=function(){var e=this,t=this.form.datasource;t&&(this.form.formFields.forEach((function(n){i.isDataSetWidget(n.widgettype)&&(i.getDistinctValuesForField(t,n.widget,{widget:"widgettype",enableemptyfilter:e.form.enableemptyfilter,EMPTY_VALUE:e.form.appLocale.LABEL_NO_VALUE}),i.applyFilterOnField(t,n.widget,e.form.formFields,n.value,{isFirst:!0,EMPTY_VALUE:e.form.appLocale.LABEL_NO_VALUE}))})),this._filter(this._options))},e.prototype.clearFilter=function(){var e=this;this.form.resetFormState(),this.form.formFields.forEach((function(t){!t.readonly&&t.show&&(t.widgettype!==l.FormWidgetType.AUTOCOMPLETE&&t.widgettype!==l.FormWidgetType.TYPEAHEAD||e.form.$element.find("div[name="+t.name+"] input").val(""),t["is-range"]?(t.minValue="",t.maxValue=""):(t.value="",t.resetDisplayInput()))})),setTimeout((function(){e._filter()}))},e.prototype.submitForm=function(){this.filter()},e.prototype.applyFilter=function(e){return(e=e?e.data||e:{}).page=e.page||1,e.orderBy=l.isDefined(e.orderBy)?e.orderBy:this.orderBy,this.filter(e)},e.prototype.filter=function(e){var t=this;if(this.form.datasource){var n,o,r={},a={},s=1;s=(e=e||{}).page||s,n=l.isDefined(e.orderBy)?e.orderBy:this.orderBy||"",this.orderBy=n,this.form.formFields.forEach((function(e){var n,i="div[name="+e.name+"] input",o=t.form.$element;if((e.widgettype===l.FormWidgetType.AUTOCOMPLETE||e.widgettype===l.FormWidgetType.TYPEAHEAD)&&o)return n=o.find(i),void(e["is-range"]?a[e.field]={minValue:l.isDefined(e.minValue)?e.minValue:n.first().val(),maxValue:l.isDefined(e.maxValue)?e.maxValue:n.last().val()}:a[e.field]={value:l.isDefined(e.value)?e.value:n.val()});e["is-range"]?a[e.field]={minValue:e.minValue,maxValue:e.maxValue}:a[e.field]={value:e.value}}));try{if(!1===(o=this.form.invokeEventCallback("beforeservicecall",{$data:a})))return;if(o&&o.error)return void this.form.toggleMessage(!0,o.error,"error","ERROR");this.form.formFields.forEach((function(e){e["is-range"]?(e._minValue=a[e.field].minValue,e._maxValue=a[e.field].maxValue):e._value=a[e.field].value}))}catch(e){if("Abort"===e.message)return}return this.form.formFields.forEach((function(e){var n,o,a=e.field,s=e._minValue,c=e._maxValue;if(e["is-related"]&&(a+="."+e["lookup-field"]),e["is-range"])n=i.getRangeFieldValue(s,c),o=i.getRangeMatchMode(s,c),l.isDefined(n)&&(r[a]={value:n,matchMode:o,logicalOp:"AND"});else{switch(e.widgettype){case l.FormWidgetType.SELECT:case l.FormWidgetType.RADIOSET:i.getEnableEmptyFilter(t.form.enableemptyfilter)&&e._value===q?(o=i.getEmptyMatchMode(t.form.enableemptyfilter),n=e._value):e.type===l.DataType.BOOLEAN?l.isDefined(e._value)&&""!==e._value&&(n=JSON.parse(e._value)):n=e._value;break;case l.FormWidgetType.CHECKBOXSET:case l.FormWidgetType.CHIPS:e._value&&e._value.length&&(n=e._value);break;case l.FormWidgetType.CHECKBOX:case l.FormWidgetType.TOGGLE:l.isDefined(e._value)&&""!==e._value&&(n=e.type===l.DataType.BOOLEAN?JSON.parse(e._value):e._value);break;default:n=e._value}l.isDefined(n)&&""!==n&&null!==n&&(r[a]={},o?(r[a].matchMode=o,n=void 0):(e.type===l.DataType.STRING||e.isRelated)&&(r[a].matchMode=o||e.matchmode||t.form.datasource.execute(l.DataSource.Operation.GET_MATCH_MODE)),r[a].value=n,r[a].logicalOp="AND",r[a].type=e.type)}})),e.exportType?this.form.datasource.execute(l.DataSource.Operation.DOWNLOAD,{data:{matchMode:"anywhereignorecase",filterFields:r,orderBy:n,exportType:e.exportType,logicalOp:"AND",exportSize:e.exportSize,fields:e.fields,fileName:e.fileName}}):this.form.datasource.execute(l.DataSource.Operation.LIST_RECORDS,{filterFields:r,orderBy:n,page:s,pagesize:this.form.pagesize||20,skipDataSetUpdate:!0,inFlightBehavior:"executeAll"}).then((function(e){var i=e.data;return t.form.pagination=e.pagination,i.error?(t.form.toggleMessage(!0,i.error,"error","ERROR"),t.form.onResultCb(i,!1)):(t._options={page:s,orderBy:n},t.form.result=l.getClonedObject(i),t.form.onResultCb(i,!0)),l.$appDigest(),t.form.result}),(function(e){return t.form.toggleMessage(!0,e,"error","ERROR"),t.form.onResultCb(e,!1),e}))}},e.prototype.filterOnDefault=function(){_.find(this.form.formFields,(function(e){return l.isDefined(e.value)||l.isDefined(e.minValue)||l.isDefined(e.maxValue)}))&&this._filter(this._options)},e.prototype.registerFormWidget=function(e){var t=e.key||e.name;this.form.filterWidgets[t]=e},e}();z.initializeProps=S(),z.decorators=[{type:t.Directive,args:[{selector:"[wmLiveFilter]"}]}],z.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Self},{type:t.Inject,args:[x]}]}]};var H=function(e){return e.widgettype===l.DataType.TIME||e.type===l.DataType.TIME&&!e.widgettype},Y=H,K=function(e){if(e){var t=(new Date).toDateString();return new Date(t+" "+e).getTime()}},Q=K,X=function(){function e(e,t,n,i,o){var r=this;this.form=e,this.datePipe=n,this.dialogService=i,this._debouncedSavePrevDataValues=l.debounce((function(){r.savePrevDataValues()}),250),t&&!this.form.parentForm?(this.form._liveTableParent=t,this.form.isLayoutDialog=t.isLayoutDialog,t.onFormReady(this.form)):this.form.isLayoutDialog="dialog"===o,e.cancel=this.cancel.bind(this),e.reset=this.reset.bind(this),e.delete=this.delete.bind(this),e.save=this.save.bind(this),e.saveAndNew=this.saveAndNew.bind(this),e.saveAndView=this.saveAndView.bind(this),e.setPrimaryKey=this.setPrimaryKey.bind(this),e.constructDataObject=this.constructDataObject.bind(this),e.changeDataObject=this.setFormData.bind(this),e.setFormData=this.setFormData.bind(this),e.findOperationType=this.findOperationType.bind(this),e.clearData=this.clearData.bind(this),e.onFieldDefaultValueChange=this.onFieldDefaultValueChange.bind(this),e.onDataSourceChange=this.onDataSourceChange.bind(this),e.onFieldValueChange=this.onFieldValueChange.bind(this),e.submitForm=this.submitForm.bind(this),e.form_registerFormFields=e.registerFormFields,e.registerFormFields=this.registerFormFields.bind(this)}return e.prototype.onKeydownHandler=function(e){this._triggeredByUser=!0},e.prototype.registerFormFields=function(e){var t=this.form.getFormFields();this.form.form_registerFormFields(e),this.form.isDataSourceUpdated&&this._updateFieldOnDataSourceChange(e,t)},e.prototype._updateFieldOnDataSourceChange=function(e,t){!e.isDataSetBound&&i.isDataSetWidget(e.widgettype)&&(e["is-related"]?(e.isDataSetBound=!0,i.fetchRelatedFieldData(this.form.datasource,e.widget,{relatedField:e.key,datafield:i.ALLFIELDS,widget:"widgettype"})):(i.getDistinctValuesForField(this.form.datasource,e.widget,{widget:"widgettype",enableemptyfilter:this.form.enableemptyfilter}),i.applyFilterOnField(this.form.datasource,e.widget,t,e.value,{isFirst:!0})))},e.prototype.onDataSourceChange=function(){var e=this;_.get(this.form.formFields,"length")&&(this.form.isDataSourceUpdated=!0);var t=this.form.getFormFields();t.forEach((function(n){e._updateFieldOnDataSourceChange(n,t)}))},e.prototype.onFieldDefaultValueChange=function(e,t){"update"!==this.form.operationType&&(l.isDefined(t)&&null!==t&&""!==t&&"null"!==t?e.value=i.parseValueByType(t,e.type,e.widgettype,e.trailingzero):e.value=void 0,this.form.dirty&&!this._triggeredByUser&&this.form.markAsPristine(),this._debouncedSavePrevDataValues())},e.prototype.onFieldValueChange=function(e,t){i.applyFilterOnField(this.form.datasource,e.widget,this.form.formFields,t)},e.prototype.getBlobURL=function(e,t,n){var i,o="";return null!=n&&this.form.datasource?(i=e[(this.form.datasource.execute(l.DataSource.Operation.GET_PRIMARY_KEY)||[])[0]],o+=this.form.datasource.execute(l.DataSource.Operation.GET_BLOB_URL,{primaryValue:i,columnName:t}),o+="?"+Math.random()):o},e.prototype.setFormData=function(e,t){var n=this;e&&((t=t||this.form.formFields).forEach((function(t){var i=_.get(e,t.key||t.name);H(t)?t.value=K(i):t.type===l.DataType.BLOB?(n.form.resetFileUploadWidget(t,!0),t.href=n.getBlobURL(e,t.key,i),t.value=_.isString(i)?"":i):n.form.setFieldValue(t,e)})),this.savePrevDataValues(),this.form.constructDataObject())},e.prototype.onDataSourceUpdate=function(e,t,n){t?this.form.new():(this.form.setFormData(e),this.closeDialog()),this.form.isUpdateMode=!l.isDefined(n)||n},e.prototype.savePrevformFields=function(){this.form.prevformFields=l.getClonedObject(this.form.formFields.map((function(e){return{key:e.key,type:e.type,widgettype:e.widgettype,outputformat:e.outputformat,value:e.value}})))},e.prototype.getPrevformFields=function(){var e=this;this.form.formFields.map((function(t){var n=e.form.prevformFields.find((function(e){return e.key===t.key}));t.value=n.value}))},e.prototype.getDataObject=function(){return this.form.operationType===i.Live_Operations.INSERT?{}:l.isDefined(this.form.prevDataObject)&&!l.isEmptyObject(this.form.prevDataObject)?l.getClonedObject(this.form.prevDataObject):l.getClonedObject(this.form.formdata||{})},e.prototype.constructDataObject=function(e){var t=this,n=this.getDataObject(),i=this.form.name;return(e?this.form.prevformFields:this.form.getFormFields()).forEach((function(e){var o,r,a=_.split(e.key,"."),s=a[0]||e.key;e.widgettype&&l.isDateTimeType(e.widgettype)||l.isDateTimeType(e.type)?e.value?(o=l.getValidDateObject(e.value),r=e.outputformat===l.DataType.TIMESTAMP||e.type===l.DataType.TIMESTAMP?e.value?o:null:e.outputformat?t.datePipe.transform(o,e.outputformat):e.value):r=void 0:r=e.type===l.DataType.BLOB?l.getFiles(i,s+"_formWidget",e.multiple):e.type===l.DataType.LIST?e.value||void 0:null===e.value||""===e.value?void 0:e.value,1===a.length?n[s]=r:(n[s]=n[s]||{},n[s][a[1]]=r)})),e?n:(this.form.updateFormDataOutput(n),this.form.dataoutput)},e.prototype.setPrimaryKey=function(e){this.form.primaryKey=this.form.primaryKey||[],-1===this.form.primaryKey.indexOf(e)&&this.form.primaryKey.push(e)},e.prototype.findOperationType=function(){var e,t=this,n=!1,o=this.form.datasource&&this.form.datasource.execute(l.DataSource.Operation.GET_OPERATION_TYPE);return o&&"read"!==o?o:(this.form.primaryKey&&!_.isEmpty(this.form.formdata)&&(1===this.form.primaryKey.length?this.form.formdata[this.form.primaryKey[0]]&&(e=i.Live_Operations.UPDATE):0===this.form.primaryKey.length?(_.forEach(this.form.formdata,(function(e){e&&(n=!0)})),n&&(e=i.Live_Operations.UPDATE)):(n=_.some(this.form.primaryKey,(function(e){if(t.form.formdata[e])return!0})))&&(e=i.Live_Operations.UPDATE)),e||i.Live_Operations.INSERT)},e.prototype.getPrevDataValues=function(){var e=_.fromPairs(_.map(this.form.prevDataValues,(function(e){return[e.key,e.value]})));return this.form.formFields.forEach((function(t){t.value=e[t.key]||"",t.resetDisplayInput()})),e},e.prototype.savePrevDataValues=function(){this.form.prevDataValues=this.form.formFields.map((function(e){return{key:e.key,value:e.value}}))},e.prototype.clearData=function(){this.form.toggleMessage(!1),this.form.emptyDataModel()},e.prototype.setReadonlyFields=function(){this.form.formFields.forEach((function(e){e.setReadOnlyState()}))},e.prototype.reset=function(){var e,t=this;this.form.resetFormState(),e=this.getPrevDataValues(),this.form.formFields.forEach((function(n){var i;n.type!==l.DataType.BLOB&&"upload"!==n.widgettype||(t.form.resetFileUploadWidget(n,!0),n.href=t.getBlobURL(e,n.key,n.value)),null===(i=n.nativeElement.querySelector("input"))||void 0===i||i.removeAttribute("aria-invalid")})),this.form.constructDataObject()},e.prototype.closeDialog=function(){this.form.isLayoutDialog&&this.dialogService.close(this.form.dialogId)},e.prototype.cancel=function(){this.form.clearMessage(),this.form.isUpdateMode=!1,this.form.reset(),this.form.isSelected&&this.getPrevformFields(),this.form.isUpdateMode=!1,this.form._liveTableParent?this.form._liveTableParent.onCancel():this.closeDialog(),l.$appDigest()},e.prototype.delete=function(e){this.form.resetFormState(),this.form.operationType=i.Live_Operations.DELETE,this.form.prevDataObject=l.getClonedObject(this.form.formdata||{}),this.form.save(void 0,void 0,void 0,e)},e.prototype.saveAndNew=function(){this.save(void 0,!0,!0)},e.prototype.saveAndView=function(){this.save(void 0,!1)},e.prototype.submitForm=function(e){this.save(e)},e.prototype.save=function(e,t,n){var o=this;if(this.form.datasource){var r,a,s,c,p={};if(s=this.form.operationType=this.form.operationType||this.findOperationType(),!this.form.validateFieldsOnSubmit()){r=l.getClonedObject(this.form.constructDataObject()),a=this.form.prevformFields?this.form.constructDataObject(!0):r;try{if(!1===(c=this.form.invokeEventCallback("beforeservicecall",{$event:e,$operation:this.form.operationType,$data:r,options:p})))return;if(c&&c.error)return void this.form.toggleMessage(!0,c.error,"error")}catch(e){if("Abort"===e.message)return}if(this.form.operationType===i.Live_Operations.UPDATE&&this.form.ngform&&this.form.ngform.pristine&&this.form.isSelected&&_.isEqual(r,a))return this.form.toggleMessage(!0,this.form.appLocale.MESSAGE_NO_CHANGES,"info",""),void l.$appDigest();p.row=r,p.transform=!0,p.skipNotification=!0,s===i.Live_Operations.UPDATE&&(p.rowData=this.form.formdata,p.prevData=a),i.performDataOperation(this.form.datasource,p,{operationType:s}).then((function(e){var r,a=s===i.Live_Operations.INSERT?o.form.insertmessage:s===i.Live_Operations.UPDATE?o.form.updatemessage:o.form.deletemessage;return s===i.Live_Operations.DELETE?(r=p.row,o.form.emptyDataModel(),o.form.prevDataValues=[],o.form.isSelected=!1):r=e,o.form.onSuccess||o.form.toggleMessage(!0,a,"success"),o.form._liveTableParent?o.form._liveTableParent.onResult(s,e,n,t):(o.form.datasource.execute(l.DataSource.Operation.LIST_RECORDS,{skipToggleState:!0}),o.onDataSourceUpdate(e,n,t)),{result:r,status:!0}}),(function(e){return o.form.onError||o.form.toggleMessage(!0,e,"error"),l.$appDigest(),{result:e,status:!1}})).then((function(t){o.form.resetFormState(),o.form.onResultCb(t.result,t.status,e)}))}}},e}();X.initializeProps=O(),X.decorators=[{type:t.Directive,args:[{selector:"[wmLiveForm]"}]}],X.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Self},{type:t.Inject,args:[x]}]},{type:h.LiveTableComponent,decorators:[{type:t.Optional}]},{type:i.ToDatePipe},{type:l.AbstractDialogService},{type:String,decorators:[{type:t.Attribute,args:["formlayout"]}]}]},X.propDecorators={onKeydownHandler:[{type:t.HostListener,args:["keydown",["$event"]]}]};var J=[x,k,F,V,U,W,z,X],Z=function(){};Z.decorators=[{type:t.NgModule,args:[{imports:[o.BasicModule,n.CommonModule,a.DesignDialogModule,r.InputModule,i.WmComponentsModule],declarations:b([],y(J)),exports:b([],y(J)),entryComponents:[]}]}],e.DependsonDirective=W,e.FormActionDirective=F,e.FormComponent=x,e.FormFieldDirective=V,e.FormModule=Z,e.FormWidgetDirective=k,e.LiveActionsDirective=U,e.LiveFilterDirective=z,e.LiveFormDirective=X,e["\u02750"]=Y,e["\u02751"]=Q,e["\u0275a"]=P,e["\u0275b"]=O,e["\u0275c"]=S,e["\u0275d"]=M,e["\u0275e"]=j,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"),require("@wm/components/basic"),require("@wm/components/dialogs"),require("@wm/components/input"),require("@wm/core")):"function"==typeof define&&define.amd?define("@wm/components/dialogs/iframe-dialog",["exports","@angular/core","@angular/common","@wm/components/base","@wm/components/basic","@wm/components/dialogs","@wm/components/input","@wm/core"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.dialogs=e.wm.components.dialogs||{},e.wm.components.dialogs.iframedialog={}),e.ng.core,e.ng.common,e.wm.components.base,e.wm.components.basic,e.wm.components.dialogs,e.wm.components.input,e.wm.core)}(this,(function(e,t,n,i,o,r,a,s){"use strict";
548
+ ***************************************************************************** */var m=function(e,t){return(m=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 f(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}m(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function g(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{l(i.next(e))}catch(e){r(e)}}function s(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))}function v(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}}Object.create;function y(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 b(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 w=new Map([["autocomplete",Object.assign({value:!1},i.PROP_BOOLEAN)],["captionalign",Object.assign({value:"left"},i.PROP_STRING)],["captionposition",Object.assign({value:"left"},i.PROP_STRING)],["captionsize",i.PROP_STRING],["captionwidth",Object.assign({value:"xs-12 sm-3 md-3 lg-3"},i.PROP_STRING)],["class",i.PROP_STRING],["collapsible",i.PROP_BOOLEAN],["dataset",i.PROP_ANY],["datasource",i.PROP_STRING],["expanded",Object.assign({value:!0},i.PROP_BOOLEAN)],["formdatasource",i.PROP_STRING],["name",i.PROP_STRING],["numberOfFields",i.PROP_NUMBER],["show",Object.assign({value:!0},i.PROP_BOOLEAN)],["showindevice",Object.assign({displayType:"inline-block",value:"all"},i.PROP_STRING)],["subheading",i.PROP_STRING],["tabindex",Object.assign({value:0},i.PROP_NUMBER)],["title",i.PROP_STRING]]),P=function(){l.isMobileApp()&&w.set("captionwidth",Object.assign({value:"xs-4 sm-4 md-4 lg-4"},i.PROP_STRING));var e=new Map(w);e.set("action",i.PROP_STRING),e.set("defaultmode",Object.assign({value:"Edit"},i.PROP_STRING)),e.set("metadata",i.PROP_STRING),e.set("method",i.PROP_STRING),e.set("postmessage",Object.assign({value:"Data posted successfully"},i.PROP_STRING)),e.set("target",i.PROP_STRING),e.set("enctype",i.PROP_STRING),e.set("errormessage",Object.assign({value:"An error occured. Please try again!"},i.PROP_STRING)),e.set("messagelayout",Object.assign({value:"Inline"},i.PROP_STRING)),e.set("formdata",i.PROP_STRING),e.set("novalidate",i.PROP_BOOLEAN),e.set("validationtype",Object.assign({value:"default"},i.PROP_STRING)),e.set("iconclass",i.PROP_STRING),i.register("wm-form",e)},O=function(){l.isMobileApp()&&w.set("captionwidth",Object.assign({value:"xs-4 sm-4 md-4 lg-4"},i.PROP_STRING));var e=new Map(w);e.set("defaultmode",Object.assign({value:"View"},i.PROP_STRING)),e.set("formlayout",Object.assign({value:"inline"},i.PROP_STRING)),e.set("insertmessage",Object.assign({value:"Record added successfully"},i.PROP_STRING)),e.set("updatemessage",Object.assign({value:"Record updated successfully"},i.PROP_STRING)),e.set("deletemessage",Object.assign({value:"Record deleted successfully"},i.PROP_STRING)),e.set("errormessage",Object.assign({value:"An error occured. Please try again!"},i.PROP_STRING)),e.set("messagelayout",Object.assign({value:"Toaster"},i.PROP_STRING)),e.set("formdata",i.PROP_STRING),e.set("novalidate",i.PROP_BOOLEAN),e.set("validationtype",Object.assign({value:"default"},i.PROP_STRING)),e.set("iconclass",i.PROP_STRING),i.register("wm-liveform",e)},S=function(){l.isMobileApp()&&w.set("captionwidth",Object.assign({value:"xs-4 sm-4 md-4 lg-4"},i.PROP_STRING));var e=new Map(w);e.set("autoupdate",i.PROP_BOOLEAN),e.set("enableemptyfilter",Object.assign({value:" "},i.PROP_STRING)),e.set("pagesize",Object.assign({value:20},i.PROP_NUMBER)),e.set("iconclass",Object.assign({value:"wi wi-filter-list"},i.PROP_STRING)),i.register("wm-livefilter",e)},E={widgetType:"wm-form",hostClass:"panel app-panel app-form"},T={widgetType:"wm-form",hostClass:"app-form app-login-form"},R={widgetType:"wm-liveform",hostClass:"panel app-panel app-liveform liveform-inline"},A={widgetType:"wm-livefilter",hostClass:"panel app-panel app-livefilter clearfix liveform-inline"},C=function(e,t,n){var i=E;return null!==e?i=R:null!==t?i=A:"app-login"===n&&(i=T),i},I=function(e,t){var n="";return _.forEach(e,(function(e,t){n=n+" "+t+'="'+e+'"'})),'<wm-gridcolumn columnwidth="'+t+'">\n <wm-form-field '+n+"></wm-form-field>\n </wm-gridcolumn>"},D=function(e,t){var n=e.find("form.ng-invalid:visible, [formControlName].ng-invalid:visible").first(),i=t;return n.is("form")&&(i=t&&t.controls[n.attr("formControlName")||n.attr("name")])?D(n,i):{ngForm:i,$ele:n}},N=function(e,t,n){var i,o;if(!t.valid)if(t.controls)_.forEach(t.controls,(function(t,n){N(e,t,n)}));else{var r=e.$element.find('[wmformfield][key="'+n+'"]');r.length||(r=e.$element.find('[wmformfield][name="'+n+'"]')),r.length&&(r[0].setAttribute("__errormsg",r[0].getAttribute("__validationId")),null===(i=r[0].querySelector("input"))||void 0===i||i.setAttribute("aria-invalid",t.invalid),null===(o=r[0].querySelector("input"))||void 0===o||o.setAttribute("aria-describedby",r[0].getAttribute("__validationId"))),t.markAsTouched()}},x=function(e){function t(t,n,o,r,a,s,c,p,u,d,h,m,f,g,v,y,b,w,P,O){var S=e.call(this,t,C(y,b,w))||this;S.fb=n,S.app=o,S.dialogService=r,S.dynamicComponentProvider=a,S.ngZone=s,S.parentList=c,S.parentForm=p,S.parentPrefab=u,S.parentPartial=d,S.onBeforeSubmitEvt=h,S.onSubmitEvt=m,S.onBeforeRenderEvt=f,S.binddataset=g,S.bindformdata=v,S._widgetClass="",S._captionClass="",S.formFields=[],S.formfields={},S.formWidgets={},S.filterWidgets={},S.buttonArray=[],S.dataoutput={},S.formdata={},S.statusMessage={caption:"",type:""},S.primaryKey=[],S._debouncedUpdateFieldSource=_.debounce(S.updateFieldSource,350),S.validationMessages=[],S._debouncedSubmitForm=l.debounce((function(e){S.ngZone.run((function(){S.submitForm(e)}))}),250),i.styler(S.nativeElement,S),l.removeAttr(S.nativeElement,"title"),S.isUpdateMode=!0,S.dialogId=S.nativeElement.getAttribute("dialogId"),S.ngform=n.group({}),S.bindingValue=P||O;var E=S.ngform.valueChanges.subscribe(S.updateDataOutput.bind(S));return S.registerDestroyListener((function(){return E.unsubscribe()})),S.elScope=S,S.addEventsToContext(S.context),S}return f(t,e),Object.defineProperty(t.prototype,"isLayoutDialog",{get:function(){return this._isLayoutDialog},set:function(e){e&&l.removeClass(this.nativeElement,"panel app-panel liveform-inline"),this._isLayoutDialog=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isUpdateMode",{get:function(){return this._isUpdateMode},set:function(e){this._isUpdateMode=e,this.formFields.forEach((function(t){t.setReadOnlyState(e)}))},enumerable:!1,configurable:!0}),t.prototype.submit=function(e){this._debouncedSubmitForm(e)},t.prototype.onReset=function(){this.reset()},t.prototype.onKeydownHandler=function(e){this._triggeredByUser=!0},Object.defineProperty(t.prototype,"parentFormArray",{get:function(){return this.parentForm&&this.isParentList&&this.parentForm.ngform.get(this.parentList.name)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isParentList",{get:function(){if(this.parentList&&this.parentForm&&!l.isDefined(this._formIsInList)){var e=this.$element.closest('.app-livelist[name="'+this.parentList.name+'"]');e.length&&(this._formIsInList=!e.find('form[widget-id="'+this.parentForm.widgetId+'"]').length)}return l.isDefined(this._formIsInList)?this._formIsInList:this.parentList},enumerable:!1,configurable:!0}),t.prototype.ngAfterContentInit=function(){var e=this;setTimeout((function(){e.componentRefs.forEach((function(t){t.name&&(e.formWidgets[t.name]=t)}))}),250)},t.prototype.ngAfterViewInit=function(){this.parentForm&&this.parentForm.ngform&&this.isParentList&&(_.get(this.parentForm.ngform.controls,this.parentList.name)||this.parentForm.ngform.setControl(this.parentList.name,new s.FormArray([])),this.parentFormArray.push(this.ngform),this.formArrayIndex=this.parentFormArray.length-1),this.addInnerNgFormToForm(this.bindingValue)},t.prototype.findOperationType=function(){},t.prototype.addInnerNgFormToForm=function(e){if(this.parentForm&&this.parentForm.ngform){if(this.isParentList)return;var t=this.parentPrefab||this.parentPartial;if(t){var n=(this.parentPrefab?t.$element.find("[wmprefabcontainer]"):t.$element).find("form").first();_.get(n[0],"widget.widgetId")===this.widgetId&&(n.isParentList||n.siblings("form").length||(e=_.get(t,"name")))}for(var i=1,o=e;this.parentForm.ngform.controls.hasOwnProperty(o);)o=e+"_"+i,i++;this.formGroupName=o,this.parentForm.ngform.addControl(o,this.ngform)}},t.prototype.addEventsToContext=function(e){var t=this;e.cancel=function(){return t.cancel()},e.reset=function(){return t.reset()},e.save=function(e){return t.save(e)},e.saveAndNew=function(){return t.saveAndNew()},e.saveAndView=function(){return t.saveAndView()},e.delete=function(){return t.delete()},e.new=function(){return t.new()},e.edit=function(){return t.edit()},e.highlightInvalidFields=function(){return t.highlightInvalidFields()},e.filter=function(){return t.filter()},e.clearFilter=function(){return t.clearFilter()},e.submit=function(e){return t.submit(e)}},t.prototype.setValidationOnInnerForms=function(e){var t=this,n=this.getNativeElement().querySelectorAll(".app-form");_.forEach(n,(function(n){var i=n.widget,o=_.get(i,"formGroupName")||i.name;l.isDefined(i.formArrayIndex)&&(o=o+"["+i.formArrayIndex+"]");for(var r=i;_.get(r,"parentForm");){var a=r.parentForm.formGroupName||r.parentForm.name;r.parentForm.parentFormArray&&(a=a+"["+r.parentForm.formArrayIndex+"]"),o=a+"."+o,r=r.parentForm}t.setValidationOnFields(i,o,e)}))},t.prototype.setValidationOnFields=function(e,t,n){var i=this,o=e.ngform.controls,r=e.formFields;r&&_.forEach(o,(function(o,a){var s,l=r.find((function(e){return e.key===a}));!l||n&&!o.touched||(null===(s=l.nativeElement.querySelector("input"))||void 0===s||s.setAttribute("aria-invalid",o.invalid),i.prepareValidationObj(o,a,l,t),i.prepareValidationObj.call(e,o,a,l,t))}))},t.prototype.prepareValidationObj=function(e,t,n,i){var o=this.validationMessages.findIndex((function(e){return e.field===t&&e.fullyQualifiedFormName===i}));e.invalid?-1===o?this.validationMessages.push({field:t,value:n.value,errorType:_.keys(e.errors),message:n.validationmessage||"",getElement:function(){return n.$element.find("[focus-target]")},formName:_.last(i.split(".")),fullyQualifiedFormName:i}):(this.validationMessages[o].value=n.value,this.validationMessages[o].errorType=_.keys(e.errors)):e.valid&&o>-1&&this.validationMessages.splice(o,1)},t.prototype.setValidationMsgs=function(e){!this.formFields.length&&_.isEmpty(this.ngform.controls)||(this.setValidationOnFields(this,this.name,e),this.setValidationOnInnerForms(e))},t.prototype.handleEvent=function(t,n,i,o){"submit"!==n&&e.prototype.handleEvent.call(this,this.nativeElement,n,i,o)},t.prototype.updateFieldSource=function(){var e=this;this.formdatasource&&this.formdatasource.execute(l.DataSource.Operation.IS_API_AWARE)||this.formdatasource&&!this.formdatasource.twoWayBinding||this.formFields.forEach((function(t){t.setFormWidget("datavaluesource",e.formdatasource),t.setFormWidget("binddatavalue",e.bindformdata+"."+t.key)}))},t.prototype.highlightInvalidFields=function(){N(this,this.ngform,"")},t.prototype.validateFieldsOnSubmit=function(){if(this.setValidationMsgs(),"delete"!==this.operationType&&("html"===this.validationtype||"default"===this.validationtype)&&this.ngform&&this.ngform.invalid){if(this.ngform.invalid){"default"===this.validationtype&&this.highlightInvalidFields();var e=D(this.$element,this.ngform),t=e.ngForm,n=e.$ele;if((n=n.parent().find("[focus-target]")).length){n.hasClass("app-search-input")||n.focus();var i=t&&t.controls[n.attr("formControlName")||n.attr("name")];return i&&i.markAsTouched&&i.markAsTouched(),l.$appDigest(),!0}return!0}return!1}return!1},t.prototype.onPropertyChange=function(t,n,i){switch(t){case"captionalign":this.captionAlignClass="align-"+n;break;case"captionposition":case"captionwidth":this.setLayoutConfig();break;case"captionsize":this.captionsize=n;break;case"novalidate":this.widget.validationtype=!0===n||"true"===n?"none":"default";break;case"formdata":if(_.isEqual(n,i))break;_.isArray(n)?this.setFormData(_.last(n)):this.setFormData(n),!this.isDataSourceUpdated&&this.datasource&&this.onDataSourceChange();break;case"defaultmode":this.isLayoutDialog||(this.updateMode=!(!n||"Edit"!==n),this.isUpdateMode=this.updateMode);break;case"datasource":this.onDataSourceChange();break;case"formdatasource":this.onFormDataSourceChange();break;case"metadata":this.generateFormFields();break;case"dataset":this.getFormFields().forEach((function(e){!e.isDataSetBound&&_.get(e.formWidget,"dataset$")&&e.formWidget.dataset$.next()}));break;default:e.prototype.onPropertyChange.call(this,t,n,i)}},t.prototype.onResultCb=function(e,t,n){var i={$event:n,$data:e,$operation:this.operationType};this.invokeEventCallback("result",i),t?this.invokeEventCallback("success",i):this.invokeEventCallback("error",i)},t.prototype.toggleMessage=function(e,t,n,i){var o;e&&t?(o="error"===n&&this.errormessage?this.errormessage:t,"Inline"===this.messagelayout?(o=this.checkAppServiceErrorMsg(n)||o,this.statusMessage={caption:o||"",type:n},this.messageRef&&this.messageRef.showMessage(this.statusMessage.caption,this.statusMessage.type),l.isElementInViewport(this.$element[0])||l.scrollToElement(this.$element[0])):this.app.notifyApp(o,n,i)):this.statusMessage.caption=""},t.prototype.checkAppServiceErrorMsg=function(e){var t=_.get(this.app,"Actions.appNotification");if(t&&"error"===e)return t.getMessage()},t.prototype.clearMessage=function(){this.toggleMessage(!1)},t.prototype.setLayoutConfig=function(){var e;e=i.getFieldLayoutConfig(this.captionwidth,this.captionposition,_.get(this.app.selectedViewPort,"os")),this._widgetClass=e.widgetCls,this._captionClass=e.captionCls,l.$appDigest()},t.prototype.registerFormWidget=function(e){var t=e.name||e.key;this.formWidgets[t]=e},t.prototype.registerFormFields=function(e){var t=this.formFields.push(e);this.formfields[e.key]=e,this.registerFormWidget(e),this._debouncedUpdateFieldSource(),this.parentForm&&(this.parentForm.formFields.push(e),this.parentForm.formfields[e.key]=e,this.parentForm.setFormData(this.parentForm.formdata,this.formFields,this.formdata||{})),t!==this.numberOfFields||_.isEmpty(this.formdata)||(this.onDataSourceChange(),_.isArray(this.formdata)?this.setFormData(_.last(this.formdata)):this.setFormData(this.formdata))},t.prototype.registerActions=function(e){this.buttonArray.push(e)},t.prototype.updateFormDataOutput=function(e){var t=this;_.forEach(this.ngform.value,(function(n,i){_.find(t.formFields,{key:i})||(e[i]=n)})),this.dataoutput=e},t.prototype.constructDataObject=function(){var e=this,t={};return this.getFormFields().forEach((function(n){var i,o;if(o=null===(o=n.datavalue||n._control.value)||""===o?void 0:o,"file"===n.type&&(o=l.getFiles(e.name,n.key+"_formWidget",n.multiple)),i=n.key||n.target||n.name,n.form.widgetId!==e.widgetId&&n.form.formGroupName)(r=_.get(t,n.form.formGroupName,{}))[i]=o,_.set(t,n.form.formGroupName,r);else if(n.form.isParentList){var r;(r=_.get(t,n.form.parentList.name,[]))[n.form.formArrayIndex]=r[n.form.formArrayIndex]||{},r[n.form.formArrayIndex][i]=o,_.set(t,n.form.parentList.name,r)}else _.set(t,i,o)})),this.updateFormDataOutput(t),this.dataoutput},t.prototype.updateDataOutput=function(){this.constructDataObject(),this.ngform.touched&&this.setValidationMsgs(!0)},t.prototype.getFormFields=function(){var e=this;return _.filter(this.formFields,(function(t){return t.form.name===e.name}))},t.prototype.setFieldValue=function(e,t,n){var i=e.key||e.name,o=n||t;o&&((o.hasOwnProperty(i)||_.includes(i,".")&&o.hasOwnProperty(_.split(i,".")[0]))&&(e.value=_.get(o,i)),this.dirty&&!this._triggeredByUser&&this.markAsPristine());var r=e.form.formGroupName;r&&_.get(t,r)&&this.setFormData.call(e.form,t[r]),_.get(e.form,"parentFormArray")&&this.setFormDataFromParentFormData.call(e.form,t)},t.prototype.setFormData=function(e,t,n){var i=this;(t||this.formFields).forEach((function(t){i.setFieldValue(t,e,n),t.fieldValidations&&t.fieldValidations.setCustomValidationMessage()})),this.constructDataObject()},t.prototype.resetFormState=function(){this.validationMessages.length&&(this.validationMessages=[]),this.ngform&&(this.ngform.markAsUntouched(),this.ngform.markAsPristine())},t.prototype.reset=function(){var e=this;this.resetFormState(),this.formFields.forEach((function(t){var n;t.value="","upload"!==t.widgettype&&t.type!==l.DataType.BLOB||e.resetFileUploadWidget(t,!0),null===(n=t.nativeElement.querySelector("input"))||void 0===n||n.removeAttribute("aria-invalid")})),this.constructDataObject(),this.clearMessage()},t.prototype.savePrevformFields=function(){this.prevformFields=l.getClonedObject(this.formFields.map((function(e){return{key:e.key,type:e.type,widgettype:e.widgettype,outputformat:e.outputformat,value:e.value}})))},t.prototype.savePrevDataValues=function(){this.prevDataValues=this.formFields.map((function(e){return{key:e.key,value:e.value}}))},t.prototype.setReadonlyFields=function(){this.formFields.forEach((function(e){e.setReadOnlyState()}))},t.prototype.resetFileUploadWidget=function(e,t){this.$element.find('[name="'+e.key+'_formWidget"]').val(""),e._control.reset(),t||(e.href="",e.value=null)},t.prototype.emptyDataModel=function(){var e=this;this.formFields.forEach((function(t){l.isDefined(t)&&(t.type===l.DataType.BLOB?e.resetFileUploadWidget(t):t.datavalue="")}))},t.prototype.setDefaultValues=function(){var e=this;this.formFields.forEach((function(t){e.onFieldDefaultValueChange(t,t.defaultvalue)}))},t.prototype.setOperationType=function(e){this.operationType=e||"insert"},t.prototype.new=function(){var e=this;this.resetFormState(),this.operationType=i.Live_Operations.INSERT,this.clearMessage(),this.isSelected&&this.savePrevformFields(),this.emptyDataModel(),setTimeout((function(){e.setDefaultValues(),e.savePrevDataValues(),e.constructDataObject()})),this.isUpdateMode=!0},t.prototype.edit=function(){this.resetFormState(),this.clearMessage(),this.operationType=i.Live_Operations.UPDATE,this.isSelected&&(this.savePrevformFields(),this.savePrevDataValues()),this.prevDataObject=l.getClonedObject(this.formdata||{}),this.setReadonlyFields(),this.isUpdateMode=!0,l.$appDigest()},t.prototype.triggerWMEvent=function(e){var t=this.nativeElement.getAttribute("dependson");t&&(l.$invokeWatchers(!0),this.app.notify("wm-event",{eventName:e,widgetName:t}))},t.prototype.submitForm=function(e){var t,n,o,r=this,a=this.datasource;if(!this.validateFieldsOnSubmit()){n=l.getClonedObject(this.constructDataObject());var s=function(){return{$event:e,$formData:n,$data:n}};if(this.onBeforeSubmitEvt){if(!1===this.invokeEventCallback("beforesubmit",s()))return;this.resetFormState()}else this.resetFormState();if(this.onSubmitEvt||a)if(a){var c=a.pagination&&a.pagination.number+1,p=this.operationType?this.operationType:"insert";i.performDataOperation(a,n,{operationType:p}).then((function(e){return"wm.CrudVariable"===a.category&&(r.triggerWMEvent("resetEditMode"),r.datasource.execute(l.DataSource.Operation.LIST_RECORDS,{skipToggleState:!0,operation:"list",page:c,preventMissingOpMsg:!0}),r.dialogId&&r.closeDialog()),l.isDefined(e.body)?(o=l.getValidJSON(e.body),o=l.isDefined(o)?o:e.body):o=e,{result:o,status:!0,message:r.postmessage,type:"success"}}),(function(e){return t=r.errormessage||e.error||e,l.$appDigest(),{result:_.get(e,"error")||e,status:!1,message:t,type:"error"}})).then((function(t){("error"===t.type&&!r.onError||"success"===t.type&&!r.onSuccess)&&r.toggleMessage(!0,t.message,t.type),r.invokeEventCallback("submit",s()),r.onResultCb(t.result,t.status,e)}))}else this.invokeEventCallback("submit",s()),this.onResultCb({},!0,e);else this.onResultCb({},!0,e)}},t.prototype.closeDialog=function(){this.dialogService.close(this.dialogId)},t.prototype.showButtons=function(e){var t=this;return _.some(this.buttonArray,(function(n){return _.includes(n.position,e)&&n.updateMode===t.isUpdateMode}))},t.prototype.expandCollapsePanel=function(){this.collapsible&&(this.expanded=!this.expanded)},t.prototype.onDataSourceUpdate=function(e,t,n){t?this.new():(this.setFormData(e),this.closeDialog()),this.isUpdateMode=!l.isDefined(n)||n},t.prototype.getNearestParentFormData=function(e){return e.parentForm?e.bindformdata||!_.get(e.parentForm,"formdata")||_.isEmpty(e.parentForm.formdata)?this.getNearestParentFormData(e.parentForm):e.parentForm.formdata:{}},t.prototype.setFormDataFromParentFormData=function(e){if(_.isEmpty(this.formdata)&&this.parentForm&&e)if(this.parentFormArray){var t=_.get(e,this.parentList.name);if(t)_.isArray(t)||(t=[t]),this.parentFormArray.patchValue(t),this.bindformdata||(this.formdata=t[this.formArrayIndex]),this.setFormData(this.formdata);else if(this.isParentList&&this.parentForm.formGroupName){var n=_.get(e,this.parentForm.formGroupName);this.setFormDataFromParentFormData(n)}}else this.setFormData(e)},t.prototype.onDataSourceChange=function(){if(_.get(this.formFields,"length")&&!this.bindformdata){this.isDataSourceUpdated=!0;var e=this.getNearestParentFormData(this);this.setFormDataFromParentFormData(e)}},t.prototype.onFormDataSourceChange=function(){this.updateFieldSource()},t.prototype.onFieldDefaultValueChange=function(e,t){e.value=i.parseValueByType(t,void 0,e.widgettype,e.trailingzero),this.dirty&&!this._triggeredByUser&&this.markAsPristine()},t.prototype.onFieldValueChange=function(){},t.prototype.generateFormFields=function(){return g(this,void 0,void 0,(function(){var e,t,n,i,o,r,a,s,c,p,u;return v(this,(function(d){switch(d.label){case 0:if(_.isUndefined(this._isGridLayoutPresent)&&(this._isGridLayoutPresent=this.$element.find(".panel-body [wmlayoutgrid]").length>0),this._isGridLayoutPresent?(t=this.$element.find(".form-elements [wmlayoutgrid]").first(),e=Number(t.attr("columns"))||1):((t=this.$element.find(".form-elements .dynamic-form-container")).length||(this.$element.find(".form-elements").prepend('<div class="dynamic-form-container"></div>'),t=this.$element.find(".form-elements .dynamic-form-container")),e=1),n=12/e,i="",o=0,s=this.metadata?this.metadata.data||this.metadata:[],this.formFields=[],_.isEmpty(s))return[2];if(this.onBeforeRenderEvt&&(a=this.invokeEventCallback("beforerender",{$metadata:s}))&&(s=a),!_.isArray(s))return[2];for(;s[o];){for(c="",r=0;r<e;r++)s[o]&&(c+=I(s[o],n)),o++;i+="<wm-gridrow>"+c+"</wm-gridrow>"}return this._isGridLayoutPresent||(i="<wm-layoutgrid>"+i+"</wm-layoutgrid>"),this.dynamicFormRef.clear(),this._dynamicContext||(this._dynamicContext=Object.create(this.viewParent),this._dynamicContext.form=this),[4,this.dynamicComponentProvider.getComponentFactoryRef("app-form-dynamic-"+this.widgetId,i,{noCache:!0,transpile:!0})];case 1:return p=d.sent(),u=this.dynamicFormRef.createComponent(p,0,this.inj),l.extendProto(u.instance,this._dynamicContext),t[0].appendChild(u.location.nativeElement),this.setFormData(this.formdata),[2]}}))}))},Object.defineProperty(t.prototype,"mode",{get:function(){return this.operationType||this.findOperationType()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dirty",{get:function(){return this.ngform&&this.ngform.dirty},enumerable:!1,configurable:!0}),t.prototype.markAsPristine=function(e){void 0===e&&(e=!1),this.ngform.markAsPristine({onlySelf:e})},t.prototype.markAsDirty=function(e){void 0===e&&(e=!1),this.ngform.markAsDirty({onlySelf:e})},Object.defineProperty(t.prototype,"invalid",{get:function(){return this.ngform&&this.ngform.invalid},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"touched",{get:function(){return this.ngform&&this.ngform.touched},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"valid",{get:function(){return this.ngform&&this.ngform.valid},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pristine",{get:function(){return this.ngform&&this.ngform.pristine},enumerable:!1,configurable:!0}),t.prototype.markAsTouched=function(e){void 0===e&&(e=!1),this.ngform.markAsTouched({onlySelf:e})},t.prototype.markAsUntouched=function(e){void 0===e&&(e=!1),this.ngform.markAsUntouched({onlySelf:e})},t.prototype.invokeActionEvent=function(e,t){l.$parseEvent(t)(this.viewParent,Object.assign(this.context,{$event:e}))},t.prototype.ngOnDestroy=function(){var t=this.parentForm&&_.get(this.parentForm,"ngform.controls");t&&(_.get(this.parentList,"name")&&t.hasOwnProperty(this.parentList.name)&&this.parentForm.ngform.removeControl(this.parentList.name),this.formGroupName&&t.hasOwnProperty(this.formGroupName)?this.parentForm.ngform.removeControl(this.formGroupName):this.parentForm.ngform.removeControl(this.name)),e.prototype.ngOnDestroy.call(this)},t}(i.StylableComponent);x.initializeProps=P(),x.decorators=[{type:t.Component,args:[{selector:"form[wmForm]",template:'<ng-template #content><ng-content></ng-content></ng-template>\n\n<ng-container *ngIf="formlayout === \'page\'; then pageLayoutTemplate else defaultTemplate">\n</ng-container>\n\n<ng-template #defaultTemplate>\n <div class="panel-heading" *ngIf="!isLayoutDialog && (title || subheading || iconclass || showButtons(\'header\'))">\n <h3 class="panel-title">\n <div class="pull-left">\n <i class="app-icon panel-icon" aria-hidden="true" [ngClass]="iconclass" *ngIf="iconclass"></i>\n </div>\n <div class="pull-left">\n <div class="heading" [innerHTML]="title"></div>\n <div class="description" [innerHTML]="subheading"></div>\n </div>\n <div class="form-action panel-actions basic-btn-grp">\n <ng-container *ngFor="let btn of buttonArray | filter : \'position\' : \'header\'"\n [ngTemplateOutlet]="btn.widgetType === \'button\' ? buttonRef : anchorRef" [ngTemplateOutletContext]="{btn:btn}">\n </ng-container>\n <button type="button" class="app-icon wi panel-action" *ngIf="collapsible" title="Collapse/Expand"\n [ngClass]="expanded ? \'wi-minus\': \'wi-plus\'" (click)="expandCollapsePanel();"></button>\n </div>\n </h3>\n </div>\n <div class="panel-body" [ngClass]="{\'form-elements\': isLayoutDialog, \'form-body\': !isLayoutDialog}" [class.hidden]="!expanded">\n <p wmMessage [hidden]="!statusMessage.caption.toString()" [attr.aria-hidden]="!statusMessage.caption" [attr.aria-label]="statusMessage.caption" caption.bind="statusMessage.caption" type.bind="statusMessage.type"></p>\n <div [ngClass]="{\'form-elements\': !isLayoutDialog, \'form-content\': isLayoutDialog}">\n <ng-container *ngTemplateOutlet="content"></ng-container>\n </div>\n <div class="basic-btn-grp form-action panel-footer clearfix" [ngClass]="{\'modal-footer\': isLayoutDialog}" [class.hidden]="!expanded || !showButtons(\'footer\')">\n <ng-container *ngFor="let btn of buttonArray | filter : \'position\' : \'footer\'"\n [ngTemplateOutlet]="btn.widgetType === \'button\' ? buttonRef : anchorRef" [ngTemplateOutletContext]="{btn:btn}">\n </ng-container>\n </div>\n </div>\n</ng-template>\n\n<ng-template #pageLayoutTemplate>\n <ng-container *ngTemplateOutlet="content"></ng-container>\n</ng-template>\n\n<ng-template #buttonRef let-btn="btn">\n <button wmButton name="{{btn.key}}" caption.bind="btn.displayName" class.bind="btn.class" iconclass.bind="btn.iconclass" show.bind="btn.show"\n (click)="invokeActionEvent($event, btn.action)" type.bind="btn.type" hint.bind="btn.title" shortcutkey.bind="btn.shortcutkey" disabled.bind="ngform.status === \'PENDING\' || btn.disabled"\n tabindex.bind="btn.tabindex" [attr.aria-label]="btn.displayName" [class.hidden]="btn.updateMode ? !isUpdateMode : isUpdateMode"></button>\n</ng-template>\n\n<ng-template #anchorRef let-btn="btn">\n <a wmAnchor name="{{btn.key}}" caption.bind="btn.displayName" class.bind="btn.class" iconclass.bind="btn.iconclass" show.bind="btn.show"\n (click)="invokeActionEvent($event, btn.action)" hint.bind="btn.title" shortcutkey.bind="btn.shortcutkey"\n hyperlink.bind="btn.hyperlink" target.bind="btn.target"\n tabindex.bind="btn.tabindex" [class.hidden]="btn.updateMode ? !isUpdateMode : isUpdateMode"></a>\n</ng-template>\n\n<ng-container #dynamicForm></ng-container>\n',providers:[i.provideAsWidgetRef(x)]}]}],x.ctorParameters=function(){return[{type:t.Injector},{type:s.FormBuilder},{type:l.App},{type:l.AbstractDialogService},{type:l.DynamicComponentRefProvider},{type:t.NgZone},{type:p.ListComponent,decorators:[{type:t.Optional}]},{type:x,decorators:[{type:t.SkipSelf},{type:t.Optional}]},{type:c.PrefabDirective,decorators:[{type:t.SkipSelf},{type:t.Optional}]},{type:i.PartialDirective,decorators:[{type:t.SkipSelf},{type:t.Optional}]},{type:void 0,decorators:[{type:t.Attribute,args:["beforesubmit.event"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["submit.event"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["beforerender.event"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["dataset.bind"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["formdata.bind"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["wmLiveForm"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["wmLiveFilter"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["data-role"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["key"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["name"]}]}]},x.propDecorators={dynamicFormRef:[{type:t.ViewChild,args:["dynamicForm",{static:!0,read:t.ViewContainerRef}]}],messageRef:[{type:t.ViewChild,args:[i.MessageComponent]}],componentRefs:[{type:t.ContentChildren,args:[i.WidgetRef,{descendants:!0}]}],action:[{type:t.HostBinding,args:["action"]}],submit:[{type:t.HostListener,args:["submit",["$event"]]}],onReset:[{type:t.HostListener,args:["reset"]}],onKeydownHandler:[{type:t.HostListener,args:["keydown",["$event"]]}]};var k=function(){function e(e,t,n,i,o,r){var a=this;this.componentInstance=n,this.name=o,this.key=r,this.fb=i,this.parent=e||t,this.ngform=this.parent.ngform,this.componentInstance.registerPropertyChangeListener((function(e,t){"datavalue"===e&&a._control?a._control.setValue(t):"name"!==e||a._control||a.addControl(a.key||t)}))}return Object.defineProperty(e.prototype,"_control",{get:function(){var e=this.key||this.name;if(e)return this.ngform&&this.ngform.controls[e]},enumerable:!1,configurable:!0}),e.prototype.addControl=function(e){this.ngform.addControl(e,this.createControl())},e.prototype.createControl=function(){return this.fb.control(this.componentInstance.datavalue)},e.prototype.ngOnInit=function(){var e=this.key||this.name;e&&!this._control&&(this.addControl(e),this.parent.registerFormWidget(this.componentInstance))},e}();k.decorators=[{type:t.Directive,args:[{selector:"[wmFormWidget]"}]}],k.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[x]}]},{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[u.TableComponent]}]},{type:void 0,decorators:[{type:t.Self},{type:t.Inject,args:[i.WidgetRef]}]},{type:s.FormBuilder},{type:void 0,decorators:[{type:t.Attribute,args:["name"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["key"]}]}]};var M=function(){i.register("wm-form-action",new Map([["accessroles",i.PROP_STRING],["action",i.PROP_STRING],["class",i.PROP_STRING],["binding",i.PROP_STRING],["disabled",i.PROP_BOOLEAN],["display-name",i.PROP_STRING],["hyperlink",i.PROP_STRING],["iconclass",i.PROP_STRING],["iconname",i.PROP_STRING],["key",i.PROP_STRING],["position",Object.assign({value:"footer"},i.PROP_STRING)],["shortcutkey",i.PROP_STRING],["show",Object.assign({value:!0},i.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},i.PROP_NUMBER)],["target",i.PROP_STRING],["title",i.PROP_STRING],["type",Object.assign({value:"button"},i.PROP_STRING)],["update-mode",Object.assign({value:!0},i.PROP_BOOLEAN)],["widget-type",Object.assign({value:"button"},i.PROP_STRING)]]))},L={widgetType:"wm-form-action",hostClass:""},F=function(e){function t(t,n){var i=e.call(this,t,L)||this;return i.form=n,i}return f(t,e),t.prototype.populateAction=function(){this.buttonDef={key:this.key||this.binding,displayName:this["display-name"],show:this.show,class:this.class?this.class:"button"===this["widget-type"]?"btn-secondary":"",iconclass:this.iconclass||"",title:_.isUndefined(this.title)?this["display-name"]||"":this.title,action:this.action,accessroles:this.accessroles,shortcutkey:this.shortcutkey,disabled:this.disabled,tabindex:this.tabindex,iconname:this.iconname,type:this.type,updateMode:this["update-mode"],position:this.position,widgetType:this["widget-type"],hyperlink:this.hyperlink,target:this.target},this._propsInitialized=!0},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.populateAction(),this.form.registerActions(this.buttonDef)},t.prototype.onPropertyChange=function(e,t,n){if(this._propsInitialized)switch(e){case"display-name":this.buttonDef.displayName=t;default:this.buttonDef[e]=t}},t}(i.BaseComponent);F.initializeProps=M(),F.decorators=[{type:t.Directive,args:[{selector:"[wmFormAction]",providers:[i.provideAsWidgetRef(F)]}]}],F.ctorParameters=function(){return[{type:t.Injector},{type:x,decorators:[{type:t.Optional}]}]};var j=function(){var e=new Map([["dataentrymode",Object.assign({value:"default"},i.PROP_STRING)],["debouncetime",Object.assign({value:250},i.PROP_NUMBER)],["defaultvalue",i.PROP_STRING],["displayname",i.PROP_STRING],["display-name",i.PROP_STRING],["field",i.PROP_STRING],["filterexpressions",i.PROP_STRING],["filter-on",i.PROP_STRING],["generator",i.PROP_STRING],["hint",i.PROP_STRING],["inputtype",i.PROP_STRING],["is-primary-key",i.PROP_BOOLEAN],["is-range",i.PROP_BOOLEAN],["is-related",i.PROP_BOOLEAN],["isformfield",{value:!0}],["key",i.PROP_STRING],["limit",i.PROP_NUMBER],["lookup-type",i.PROP_STRING],["lookup-field",i.PROP_STRING],["name",i.PROP_STRING],["matchmode",i.PROP_STRING],["maxdefaultvalue",i.PROP_STRING],["maxplaceholder",i.PROP_STRING],["mobile-display",Object.assign({value:!0},i.PROP_BOOLEAN)],["period",i.PROP_BOOLEAN],["pc-display",Object.assign({value:!0},i.PROP_BOOLEAN)],["placeholder",i.PROP_STRING],["primary-key",i.PROP_BOOLEAN],["related-entity-name",i.PROP_STRING],["required",i.PROP_BOOLEAN],["show",Object.assign({value:!0},i.PROP_BOOLEAN)],["tablet-display",Object.assign({value:!0},i.PROP_BOOLEAN)],["type",i.PROP_STRING],["validationmessage",i.PROP_STRING],["viewmodewidget",i.PROP_STRING],["widgettype",i.PROP_STRING]]),t=function(t){var n="wm-form-field-"+l.FormWidgetType[t],o=i.getWidgetPropsByType(n);e.forEach((function(e,t){null==o.get(t)&&o.set(t,e)}))};for(var n in l.FormWidgetType)t(n)},B=function(){return{custom:!0}},G={image:"image/*",video:"video/*",audio:"audio/*"},V=function(e){function t(t,n,i,o,r,a,s,c,p,u,d,h,m,f,g,v,y,b,w){var P=this,_={widgetType:"wm-form-field",hostClass:"",widgetSubType:"wm-form-field-"+(d||l.FormWidgetType.TEXT).trim()},O=l.noop;return(P=e.call(this,t,_,new Promise((function(e){return O=e})))||this)._initPropsRes=O,P.app=r,P.fieldDefConfig={},P.class="",P.binddataset=c,P.binddisplayimagesrc=m,P.binddisplayexpression=p,P.bindChipclass=s,P.binddisplaylabel=u,P.form=n,P.fb=i,P.viewport=o,P._fieldName=f||h,P.isRange=g,P.excludeProps=new Set(["type","name"]),P.widgettype=d,P.parentList=a,P.notifyForFields=[],(P.binddataset||P.$element.attr("dataset"))&&(P.isDataSetBound=!0),w[0]._onFocusField=P._onFocusField.bind(P),w[0]._onBlurField=P._onBlurField.bind(P),P._debounceSetUpValidators=l.debounce((function(){return P.setUpValidators()}),500),P}return f(t,e),t.prototype.onKeydownHandler=function(e){this._triggeredByUser=!0},t.prototype.handleClick=function(e){this._clicktriggeredByUser=!0},t.prototype._onFocusField=function(e){this._activeField=!0,$(e.target).closest(".live-field").addClass("active")},t.prototype._onBlurField=function(e){var t,n,i,o;$(e.target).closest(".live-field").removeClass("active");this.nativeElement.querySelector("p.text-danger");this.ngform.controls[this._fieldName].invalid&&this.ngform.controls[this._fieldName].touched&&this.form.isUpdateMode?(this.nativeElement.setAttribute("__errormsg",""+this.nativeElement.getAttribute("__validationId")),null===(t=this.nativeElement.querySelector("input"))||void 0===t||t.setAttribute("aria-invalid",""+this.ngform.controls[this._fieldName].invalid),null===(n=this.nativeElement.querySelector("input"))||void 0===n||n.setAttribute("aria-describedby",""+this.nativeElement.getAttribute("__validationId"))):(this.nativeElement.removeAttribute("__errormsg"),null===(i=this.nativeElement.querySelector("input"))||void 0===i||i.removeAttribute("aria-invalid"),null===(o=this.nativeElement.querySelector("input"))||void 0===o||o.removeAttribute("aria-describedby")),this._activeField=!1,this._triggeredByUser=!1,this._clicktriggeredByUser=!1},t.prototype.evaluateExpr=function(e,t,n){if(n&&t||(t=Object.keys(e)[0]))return i.getEvaluatedData(e,{field:t,expression:n},this.viewParent)},t.prototype.getDisplayExpr=function(){var e=this,t=[],n=this.value,i=this.displayfield||this.displaylabel,o=this.displayexpression;return _.isObject(n)?(_.isArray(n)?_.forEach(n,(function(n){_.isObject(n)&&t.push(e.evaluateExpr(n,i,o))})):t.push(this.evaluateExpr(n,i,o)),_.join(t,",")):null==n?"":this.value},t.prototype.getCaption=function(){return void 0===this.value||null===this.value?_.get(this.form.dataoutput,this._fieldName)||"":this.value},t.prototype.notifyChanges=function(){_.forEach(this.notifyForFields,(function(e){e.fieldValidations.validate()}))},t.prototype.observeOn=function(e){this.fieldValidations.observeOn(e,"formfields")},t.prototype.setUpValidators=function(e){this.fieldValidations.setUpValidators(e)},t.prototype.setAsyncValidators=function(e){this.fieldValidations.setAsyncValidators(e)},t.prototype.setValidators=function(e){this.fieldValidations.setValidators(e)},t.prototype.setFormWidget=function(e,t){this.formWidget&&this.formWidget.widget&&(this.formWidget.widget[e]=t)},t.prototype.boundFn=function(e){return e()},t.prototype.setMaxFormWidget=function(e,t){this.formWidgetMax&&(this.formWidgetMax.widget[e]=t)},t.prototype.onPropertyChange=function(t,n,i){var o=this.form.dirty;if("tabindex"!==t&&e.prototype.onPropertyChange.call(this,t,n,i),!this.excludeProps.has(t)){if(this.widgettype===l.FormWidgetType.UPLOAD)return"required"===t&&this._debounceSetUpValidators(),void e.prototype.onPropertyChange.call(this,t,n,i);switch(this.setFormWidget(t,n),"placeholder"!==t&&this.setMaxFormWidget(t,n),t){case"defaultvalue":this.form.onFieldDefaultValueChange(this,n);break;case"maxdefaultvalue":this.maxValue=n,this.setMaxFormWidget("datavalue",n),this.form.onMaxDefaultValueChange();break;case"maxplaceholder":this.setMaxFormWidget("placeholder",n);break;case"required":o!==this.form.dirty&&this.form.markAsPristine();case"maxchars":case"minvalue":case"maxvalue":case"regexp":case"show":this._debounceSetUpValidators();break;case"primary-key":n&&this.form.setPrimaryKey(this._fieldName);break;case"display-name":this.displayname=n;break;case"readonly":this.setReadOnlyState()}}},t.prototype.onStyleChange=function(t,n,i){this.setFormWidget(t,n),this.setMaxFormWidget(t,n),e.prototype.onStyleChange.call(this,t,n,i)},Object.defineProperty(t.prototype,"datavalue",{get:function(){return this.formWidget&&this.formWidget.datavalue},set:function(e){this._control&&this.widgettype!==l.FormWidgetType.UPLOAD&&this._control.setValue(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.datavalue},set:function(e){this.datavalue=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxValue",{get:function(){return this.formWidgetMax&&this.formWidgetMax.datavalue},set:function(e){this._maxControl&&this._maxControl.setValue(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minValue",{get:function(){return this.value},set:function(e){this.value=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_control",{get:function(){return this.ngform&&this.ngform.controls[this._fieldName]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_maxControl",{get:function(){return this.ngform&&this.ngform.controls[this._fieldName+"_max"]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"displayValue",{get:function(){return this.formWidget&&this.formWidget.displayValue},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"timestamp",{get:function(){return this.formWidget&&this.formWidget.timestamp},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"charlength",{get:function(){return this.formWidget&&this.formWidget.charlength},enumerable:!1,configurable:!0}),t.prototype.createControl=function(){return this.fb.control(void 0,{validators:this._validators})},t.prototype.onValueChange=function(e){var t,n,i,o;if(!this.isDestroyed){var r=$(this.nativeElement).find(".caption-floating");if(r.length>0){var a=l.isDefined(e)&&""!==e&&null!==e||r.find("input").val()||r.find("input:-webkit-autofill").length;this.app.notify("captionPositionAnimate",{displayVal:a,nativeEl:r,isSelectMultiple:this.formWidget&&this.formWidget.multiple,isFocused:this._activeField})}this.ngform.controls[this._fieldName].invalid&&this.ngform.controls[this._fieldName].touched&&this.form.isUpdateMode?(this.nativeElement.setAttribute("__errormsg",""+this.nativeElement.getAttribute("__validationId")),null===(t=this.nativeElement.querySelector("input"))||void 0===t||t.setAttribute("aria-invalid",this._triggeredByUser&&this.ngform.controls[this._fieldName].invalid?"true":"false"),null===(n=this.nativeElement.querySelector("input"))||void 0===n||n.setAttribute("aria-describedby",""+this.nativeElement.getAttribute("__validationId"))):(this.nativeElement.removeAttribute("__errormsg"),null===(i=this.nativeElement.querySelector("input"))||void 0===i||i.removeAttribute("aria-invalid"),null===(o=this.nativeElement.querySelector("input"))||void 0===o||o.removeAttribute("aria-describedby")),this.form.onFieldValueChange(this,e),this.notifyChanges(),(this.$element.find(".active").length>0||this.form.touched)&&((this._triggeredByUser||l.isMobile()&&this._clicktriggeredByUser&&l.isDateTimeType(this.widgettype))&&this.ngform.controls[this._fieldName].markAsTouched(),this.fieldValidations.setCustomValidationMessage())}},t.prototype.onStatusChange=function(e){this.isDestroyed||(this.showPendingSpinner="PENDING"===e,"PENDING"===e?this.formWidget.disabled=!0:this.formWidget.disabled!==this.disabled&&(this.formWidget.disabled=this.disabled))},t.prototype.setValidationMessage=function(e){var t=this;setTimeout((function(){t.validationmessage=e,t.setUpValidators(B)}))},t.prototype.setReadOnlyState=function(){var e;e=!this.form.isUpdateMode||(!this["primary-key"]||this["is-related"]||this.period?this.readonly:!("assigned"===this.generator&&"update"!==this.form.operationType)),this.setFormWidget("readonly",e)},t.prototype.resetDisplayInput=function(){l.isDefined(this.value)&&""!==this.value||this.formWidget&&this.formWidget.resetDisplayInput&&this.formWidget.resetDisplayInput()},t.prototype.triggerUploadEvent=function(e,t){var n={$event:e};"change"===t&&(n.newVal=e.target.files,n.oldVal=this._oldUploadVal,this._oldUploadVal=n.newVal),this.invokeEventCallback(t,n)},t.prototype.registerFormField=function(){var e=this._fieldName;if(this.parentList&&this.form.parentList!==this.parentList){for(var t=1,n=e;this.ngform.controls.hasOwnProperty(n);)n=e+"_"+t,t++;this.ngform.addControl(n,this.createControl()),this._fieldName=n}else this.ngform.addControl(e,this.createControl());var i=this._control.valueChanges.pipe(d.debounceTime(200)).subscribe(this.onValueChange.bind(this));this.registerDestroyListener((function(){return i.unsubscribe()}));var o=this._control.statusChanges.pipe(d.debounceTime(100)).subscribe(this.onStatusChange.bind(this));if(this.registerDestroyListener((function(){return o.unsubscribe()})),"true"===this.isRange){this.ngform.addControl(e+"_max",this.createControl());var r=this._maxControl.valueChanges.pipe(d.debounceTime(200)).subscribe(this.onValueChange.bind(this));this.registerDestroyListener((function(){return r.unsubscribe()}))}this.value=_.get(this.form.formdata,this._fieldName)},t.prototype.ngOnInit=function(){this.ngform=this.form.ngform,this.registerFormField(),this.fieldValidations=new i.BaseFieldValidations(this,this.formWidget,this.widgettype,this._control,this.form),e.prototype.ngOnInit.call(this)},t.prototype.ngAfterContentInit=function(){var t=this;e.prototype.ngAfterContentInit.call(this),this.formWidget&&(this._initPropsRes(),this.setFormWidget("binddisplaylabel",this.binddisplaylabel),this.setFormWidget("binddisplayexpression",this.binddisplayexpression),this.setFormWidget("binddisplayimagesrc",this.binddisplayimagesrc),this.setFormWidget("bindChipclass",this.bindChipclass),this.setFormWidget("binddataset",this.binddataset)),this.registerReadyStateListener((function(){if(t.key=t._fieldName||t.target||t.binding,t.viewmodewidget=t.viewmodewidget||i.getDefaultViewModeWidget(t.widgettype),t.widgettype===l.FormWidgetType.UPLOAD){var e;e=t.filetype?G[t.filetype]:"",t.permitted=e+(t.extensions?(e?",":"")+t.extensions:"")}l.isMobile()&&t.viewport.isMobileType?t["mobile-display"]||(t.widget.show=!1):t.viewport.isTabletType?t["tablet-display"]||(t.widget.show=!1):t["pc-display"]||(t.widget.show=!1),t.fieldDefConfig.displaname=t.displayname,t.fieldDefConfig.show=t.show,t.fieldDefConfig.isRelated=t["is-related"],t.fieldDefConfig.inputtype=t.inputtype,t.fieldDefConfig.generator=t.generator,t.fieldDefConfig.placeholder=t.placeholder,t.fieldDefConfig.primaryKey=t["primary-key"],t.fieldDefConfig.required=t.required,t.fieldDefConfig._readonly=t.readonly,t.fieldDefConfig.regexp=t.regexp,t.fieldDefConfig.type=t.type,t.fieldDefConfig.key=t.key,t.fieldDefConfig.mobileDisplay=t["mobile-display"],t.fieldDefConfig.name=t.name,t.fieldDefConfig.pcDisplay=t["pc-display"],t.fieldDefConfig.tabletDisplay=t["tablet-display"],t.fieldDefConfig.validationmessage=t.validationmessage,t.fieldDefConfig.viewmodewidget=t.viewmodewidget,t.fieldDefConfig.widget=t.widgettype,t.form.registerFormFields(t.widget),l.addForIdAttributes(t.nativeElement),t.setReadOnlyState()}))},t}(i.StylableComponent);V.initializeProps=j(),V.decorators=[{type:t.Directive,args:[{selector:"[wmFormField]",exportAs:"wmFormField",providers:[i.provideAsWidgetRef(V),i.provideAs(V,s.NG_VALUE_ACCESSOR,!0),{provide:i.Context,useValue:{},multi:!0}]}]}],V.ctorParameters=function(){return[{type:t.Injector},{type:x},{type:s.FormBuilder},{type:l.Viewport},{type:l.App},{type:p.ListComponent,decorators:[{type:t.Optional}]},{type:String,decorators:[{type:t.Attribute,args:["chipclass.bind"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["dataset.bind"]}]},{type:String,decorators:[{type:t.Attribute,args:["displayexpression.bind"]}]},{type:String,decorators:[{type:t.Attribute,args:["displaylabel.bind"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["widgettype"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["name"]}]},{type:String,decorators:[{type:t.Attribute,args:["displayimagesrc.bind"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["key"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["is-range"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["pc-display"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["mobile-display"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["tablet-display"]}]},{type:Array,decorators:[{type:t.Self},{type:t.Inject,args:[i.Context]}]}]},V.propDecorators={formWidget:[{type:t.ContentChild,args:["formWidget",{static:!0}]}],formWidgetMax:[{type:t.ContentChild,args:["formWidgetMax"]}],onKeydownHandler:[{type:t.HostListener,args:["keydown",["$event"]]}],handleClick:[{type:t.HostListener,args:["click",["$event"]]}]};var U=function(){function e(e,t,n){this.subscribedWidget=e,this.app=t,this.dialogService=n,e.addRow=this.addRow.bind(this),e.updateRow=this.updateRow.bind(this),e.deleteRow=this.deleteRow.bind(this),e.call=this.call.bind(this)}return e.prototype.addRow=function(){this.app.notify("wm-event",{eventName:i.Live_Operations.INSERT,widgetName:this.subscribedWidget.name,row:this.subscribedWidget.selecteditem})},e.prototype.updateRow=function(){this.app.notify("wm-event",{eventName:i.Live_Operations.UPDATE,widgetName:this.subscribedWidget.name,row:this.subscribedWidget.selecteditem})},e.prototype.deleteRow=function(){this.app.notify("wm-event",{eventName:i.Live_Operations.DELETE,widgetName:this.subscribedWidget.name,row:this.subscribedWidget.selecteditem})},e.prototype.successHandler=function(e,t){l.triggerFn(e.success,t)},e.prototype.errorHandler=function(e,t){this.app.notifyApp(t,"error","ERROR"),l.triggerFn(e.error,t)},e.prototype.getRecords=function(e,t){var n,o,r=this;"None"!==this.subscribedWidget.navigation&&this.subscribedWidget.dataNavigator?(o=this.subscribedWidget.dataNavigator,t===i.Live_Operations.DELETE?(o.dataSize-=1,o.calculatePagingValues(),n=o.pageCount<o.dn.currentPage?"prev":void 0):("last"===(n=t===i.Live_Operations.INSERT?"last":"current")&&(o.dataSize+=1),o.calculatePagingValues()),o.navigatePage(n,null,!0,(function(t){r.successHandler(e,t)}))):this.subscribedWidget.datasource.execute(l.DataSource.Operation.LIST_RECORDS,{skipToggleState:!0}).then((function(t){r.successHandler(e,t)}),(function(t){r.errorHandler(e,t)}))},e.prototype.performCUDOperation=function(e,t,n){var o=this;i.performDataOperation(this.subscribedWidget.datasource,e,{operationType:t}).then((function(e){e.error?o.errorHandler(n,e.error):("wm.CrudVariable"===o.subscribedWidget.datasource.category&&"delete"===t?o.subscribedWidget.datasource.execute(l.DataSource.Operation.LIST_RECORDS,{skipToggleState:!0}).then((function(e){o.successHandler(n,e)}),(function(e){o.errorHandler(n,e)})):o.getRecords(n,t),"delete"===t&&o.app.notifyApp(o.app.appLocale.MESSAGE_DELETE_RECORD_SUCCESS,"success"))}),(function(e){o.errorHandler(n,e)}))},e.prototype.insertRecord=function(e,t,n){this.performCUDOperation(e,t,n)},e.prototype.updateRecord=function(e,t,n){this.performCUDOperation(e,t,n)},e.prototype.deleteRecord=function(e,t,n){var i=this;this.dialogService.showAppConfirmDialog({title:this.app.appLocale.MESSAGE_DELETE_RECORD||"Delete Record",iconclass:"wi wi-delete fa-lg",message:this.subscribedWidget.confirmdelete||"Are you sure you want to delete this?",oktext:this.subscribedWidget.deleteoktext||"Ok",canceltext:this.subscribedWidget.deletecanceltext||"Cancel",onOk:function(){i.performCUDOperation(e,t,n),i.dialogService.closeAppConfirmDialog()},onCancel:function(){l.triggerFn(n.cancelDeleteCallback),i.dialogService.closeAppConfirmDialog()}})},e.prototype.performOperation=function(e,t){var n={row:t.row,prevData:{},rowData:{},transform:!0,skipNotification:!0};switch(e===i.Live_Operations.UPDATE&&(n.rowData=t.rowData,n.prevData=t.prevData),e){case i.Live_Operations.INSERT:this.insertRecord(n,e,t);break;case i.Live_Operations.UPDATE:this.updateRecord(n,e,t);break;case i.Live_Operations.DELETE:this.deleteRecord(n,e,t);break;case i.Live_Operations.READ:this.getRecords(t,e)}},e.prototype.call=function(e,t,n,i){t.success=n,t.error=i,this.performOperation(e,t)},e}();U.decorators=[{type:t.Directive,args:[{selector:"[wmLiveActions]"}]}],U.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Self},{type:t.Inject,args:[p.ListComponent]}]},{type:l.App},{type:l.AbstractDialogService}]};var W=function(){function e(e,t,n,i){this.dialogService=n,this.app=i,e&&(this.isLayoutDialog=!0,this.dialogId=e),this.dependson=t,this.eventSubscription=this.app.subscribe("wm-event",this.handleEvent.bind(this))}return e.prototype.openFormDialog=function(){this.dialogService.open(this.dialogId)},e.prototype.onUpdate=function(e,t,n){this.editMode=n||this.editMode,this.form.operationType=i.Live_Operations.UPDATE,this.form.isSelected=!0;var o=this.currentFormData;e&&t&&(o=t.multiselect?e[0]:e[e.length-1]),this.form.setFormData(o),this.form.edit(),this.editMode||(this.form.isUpdateMode=!1)},e.prototype.onInsert=function(){this.form.operationType=i.Live_Operations.INSERT,this.form.isSelected=!0,this.form.setFormData({}),this.form.new()},e.prototype.handleEvent=function(e){if(this.dependson===e.widgetName)switch(this.currentOp=e.eventName,e.eventName){case i.Live_Operations.UPDATE:this.currentFormData=e.row,this.isLayoutDialog?this.openFormDialog():this.onUpdate(void 0,void 0,!0);break;case i.Live_Operations.INSERT:this.isLayoutDialog?this.openFormDialog():this.onInsert();break;case i.Live_Operations.DELETE:this.app.Widgets[this.dependson].call("delete",{row:e.row});break;case i.Live_Operations.READ:this.isLayoutDialog||(this.form.isUpdateMode=!1);break;case"rerender":e.dataSource&&e.dataSource.execute(l.DataSource.Operation.LIST_RECORDS,{skipToggleState:!0,operation:"list"});break;case"selectedItemChange":e.table&&this.onUpdate(e.row,e.table);break;case"resetEditMode":this.editMode=!1}},e.prototype.onFormRender=function(){var e=this;this.form&&this.isLayoutDialog&&(this.form.isLayoutDialog=!0,setTimeout((function(){e.currentOp===i.Live_Operations.UPDATE?e.onUpdate(void 0,void 0,!0):e.currentOp===i.Live_Operations.INSERT&&e.onInsert()}),250))},e.prototype.ngAfterContentInit=function(){var e=this;this.formChildren.first?this.form=this.formChildren.first:this.formSubscription=this.formChildren.changes.subscribe((function(t){e.form=t.first,e.onFormRender()})),this.app.notify("setup-cud-listener",this.dependson)},e.prototype.ngOnDestroy=function(){this.formSubscription&&this.formSubscription.unsubscribe(),this.eventSubscription&&this.eventSubscription()},e}();W.decorators=[{type:t.Directive,args:[{selector:"[dependson]"}]}],W.ctorParameters=function(){return[{type:String,decorators:[{type:t.Attribute,args:["dialogid"]}]},{type:String,decorators:[{type:t.Attribute,args:["dependson"]}]},{type:l.AbstractDialogService},{type:l.App}]},W.propDecorators={formChildren:[{type:t.ContentChildren,args:[x,{descendants:!0}]}]};var q="EMPTY_NULL_FILTER",z=function(){function e(e){var t=this;this.form=e,this._filter=l.debounce((function(e){t.filter(e)}),250),e.clearFilter=this.clearFilter.bind(this),e.applyFilter=this.applyFilter.bind(this),e.filter=this.filter.bind(this),e.filterOnDefault=this.filterOnDefault.bind(this),e.execute=this.execute.bind(this),e.onFieldDefaultValueChange=this.onFieldDefaultValueChange.bind(this),e.onMaxDefaultValueChange=this.onMaxDefaultValueChange.bind(this),e.onDataSourceChange=this.onDataSourceChange.bind(this),e.onFieldValueChange=this.onFieldValueChange.bind(this),e.submitForm=this.submitForm.bind(this),e.registerFormWidget=this.registerFormWidget.bind(this)}return e.prototype.execute=function(e,t){return e===l.DataSource.Operation.LIST_RECORDS||e===l.DataSource.Operation.DOWNLOAD?this.applyFilter(t):e===l.DataSource.Operation.GET_OPTIONS?this._options||{}:e===l.DataSource.Operation.GET_PAGING_OPTIONS?this.form.pagination:this.form.datasource?e===l.DataSource.Operation.FETCH_DISTINCT_VALUES?i.fetchDistinctValues(this.form.datasource,this.form.formFields,{widget:"widgettype",enableemptyfilter:this.form.enableemptyfilter,EMPTY_VALUE:this.form.appLocale.LABEL_NO_VALUE}):this.form.datasource.execute(e,t):{}},e.prototype.onFieldDefaultValueChange=function(e,t){e.minValue=t,e.value=t,this.filterOnDefault()},e.prototype.onFieldValueChange=function(e,t){i.applyFilterOnField(this.form.datasource,e.widget,this.form.formFields,t,{EMPTY_VALUE:this.form.appLocale.LABEL_NO_VALUE}),this.form.autoupdate&&l.isDefined(t)&&this._filter()},e.prototype.onMaxDefaultValueChange=function(){var e=this;setTimeout((function(){e.filterOnDefault()}))},e.prototype.onDataSourceChange=function(){var e=this,t=this.form.datasource;t&&(this.form.formFields.forEach((function(n){i.isDataSetWidget(n.widgettype)&&(i.getDistinctValuesForField(t,n.widget,{widget:"widgettype",enableemptyfilter:e.form.enableemptyfilter,EMPTY_VALUE:e.form.appLocale.LABEL_NO_VALUE}),i.applyFilterOnField(t,n.widget,e.form.formFields,n.value,{isFirst:!0,EMPTY_VALUE:e.form.appLocale.LABEL_NO_VALUE}))})),this._filter(this._options))},e.prototype.clearFilter=function(){var e=this;this.form.resetFormState(),this.form.formFields.forEach((function(t){!t.readonly&&t.show&&(t.widgettype!==l.FormWidgetType.AUTOCOMPLETE&&t.widgettype!==l.FormWidgetType.TYPEAHEAD||e.form.$element.find("div[name="+t.name+"] input").val(""),t["is-range"]?(t.minValue="",t.maxValue=""):(t.value="",t.resetDisplayInput()))})),setTimeout((function(){e._filter()}))},e.prototype.submitForm=function(){this.filter()},e.prototype.applyFilter=function(e){return(e=e?e.data||e:{}).page=e.page||1,e.orderBy=l.isDefined(e.orderBy)?e.orderBy:this.orderBy,this.filter(e)},e.prototype.filter=function(e){var t=this;if(this.form.datasource){var n,o,r={},a={},s=1;s=(e=e||{}).page||s,n=l.isDefined(e.orderBy)?e.orderBy:this.orderBy||"",this.orderBy=n,this.form.formFields.forEach((function(e){var n,i="div[name="+e.name+"] input",o=t.form.$element;if((e.widgettype===l.FormWidgetType.AUTOCOMPLETE||e.widgettype===l.FormWidgetType.TYPEAHEAD)&&o)return n=o.find(i),void(e["is-range"]?a[e.field]={minValue:l.isDefined(e.minValue)?e.minValue:n.first().val(),maxValue:l.isDefined(e.maxValue)?e.maxValue:n.last().val()}:a[e.field]={value:l.isDefined(e.value)?e.value:n.val()});e["is-range"]?a[e.field]={minValue:e.minValue,maxValue:e.maxValue}:a[e.field]={value:e.value}}));try{if(!1===(o=this.form.invokeEventCallback("beforeservicecall",{$data:a})))return;if(o&&o.error)return void this.form.toggleMessage(!0,o.error,"error","ERROR");this.form.formFields.forEach((function(e){e["is-range"]?(e._minValue=a[e.field].minValue,e._maxValue=a[e.field].maxValue):e._value=a[e.field].value}))}catch(e){if("Abort"===e.message)return}return this.form.formFields.forEach((function(e){var n,o,a=e.field,s=e._minValue,c=e._maxValue;if(e["is-related"]&&(a+="."+e["lookup-field"]),e["is-range"])n=i.getRangeFieldValue(s,c),o=i.getRangeMatchMode(s,c),l.isDefined(n)&&(r[a]={value:n,matchMode:o,logicalOp:"AND"});else{switch(e.widgettype){case l.FormWidgetType.SELECT:case l.FormWidgetType.RADIOSET:i.getEnableEmptyFilter(t.form.enableemptyfilter)&&e._value===q?(o=i.getEmptyMatchMode(t.form.enableemptyfilter),n=e._value):e.type===l.DataType.BOOLEAN?l.isDefined(e._value)&&""!==e._value&&(n=JSON.parse(e._value)):n=e._value;break;case l.FormWidgetType.CHECKBOXSET:case l.FormWidgetType.CHIPS:e._value&&e._value.length&&(n=e._value);break;case l.FormWidgetType.CHECKBOX:case l.FormWidgetType.TOGGLE:l.isDefined(e._value)&&""!==e._value&&(n=e.type===l.DataType.BOOLEAN?JSON.parse(e._value):e._value);break;default:n=e._value}l.isDefined(n)&&""!==n&&null!==n&&(r[a]={},o?(r[a].matchMode=o,n=void 0):(e.type===l.DataType.STRING||e.isRelated)&&(r[a].matchMode=o||e.matchmode||t.form.datasource.execute(l.DataSource.Operation.GET_MATCH_MODE)),r[a].value=n,r[a].logicalOp="AND",r[a].type=e.type)}})),e.exportType?this.form.datasource.execute(l.DataSource.Operation.DOWNLOAD,{data:{matchMode:"anywhereignorecase",filterFields:r,orderBy:n,exportType:e.exportType,logicalOp:"AND",exportSize:e.exportSize,fields:e.fields,fileName:e.fileName}}):this.form.datasource.execute(l.DataSource.Operation.LIST_RECORDS,{filterFields:r,orderBy:n,page:s,pagesize:this.form.pagesize||20,skipDataSetUpdate:!0,inFlightBehavior:"executeAll"}).then((function(e){var i=e.data;return t.form.pagination=e.pagination,i.error?(t.form.toggleMessage(!0,i.error,"error","ERROR"),t.form.onResultCb(i,!1)):(t._options={page:s,orderBy:n},t.form.result=l.getClonedObject(i),t.form.onResultCb(i,!0)),l.$appDigest(),t.form.result}),(function(e){return t.form.toggleMessage(!0,e,"error","ERROR"),t.form.onResultCb(e,!1),e}))}},e.prototype.filterOnDefault=function(){_.find(this.form.formFields,(function(e){return l.isDefined(e.value)||l.isDefined(e.minValue)||l.isDefined(e.maxValue)}))&&this._filter(this._options)},e.prototype.registerFormWidget=function(e){var t=e.key||e.name;this.form.filterWidgets[t]=e},e}();z.initializeProps=S(),z.decorators=[{type:t.Directive,args:[{selector:"[wmLiveFilter]"}]}],z.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Self},{type:t.Inject,args:[x]}]}]};var H=function(e){return e.widgettype===l.DataType.TIME||e.type===l.DataType.TIME&&!e.widgettype},Y=H,K=function(e){if(e){var t=(new Date).toDateString();return new Date(t+" "+e).getTime()}},Q=K,X=function(){function e(e,t,n,i,o){var r=this;this.form=e,this.datePipe=n,this.dialogService=i,this._debouncedSavePrevDataValues=l.debounce((function(){r.savePrevDataValues()}),250),t&&!this.form.parentForm?(this.form._liveTableParent=t,this.form.isLayoutDialog=t.isLayoutDialog,t.onFormReady(this.form)):this.form.isLayoutDialog="dialog"===o,e.cancel=this.cancel.bind(this),e.reset=this.reset.bind(this),e.delete=this.delete.bind(this),e.save=this.save.bind(this),e.saveAndNew=this.saveAndNew.bind(this),e.saveAndView=this.saveAndView.bind(this),e.setPrimaryKey=this.setPrimaryKey.bind(this),e.constructDataObject=this.constructDataObject.bind(this),e.changeDataObject=this.setFormData.bind(this),e.setFormData=this.setFormData.bind(this),e.findOperationType=this.findOperationType.bind(this),e.clearData=this.clearData.bind(this),e.onFieldDefaultValueChange=this.onFieldDefaultValueChange.bind(this),e.onDataSourceChange=this.onDataSourceChange.bind(this),e.onFieldValueChange=this.onFieldValueChange.bind(this),e.submitForm=this.submitForm.bind(this),e.form_registerFormFields=e.registerFormFields,e.registerFormFields=this.registerFormFields.bind(this)}return e.prototype.onKeydownHandler=function(e){this._triggeredByUser=!0},e.prototype.registerFormFields=function(e){var t=this.form.getFormFields();this.form.form_registerFormFields(e),this.form.isDataSourceUpdated&&this._updateFieldOnDataSourceChange(e,t)},e.prototype._updateFieldOnDataSourceChange=function(e,t){!e.isDataSetBound&&i.isDataSetWidget(e.widgettype)&&(e["is-related"]?(e.isDataSetBound=!0,i.fetchRelatedFieldData(this.form.datasource,e.widget,{relatedField:e.key,datafield:i.ALLFIELDS,widget:"widgettype"})):(i.getDistinctValuesForField(this.form.datasource,e.widget,{widget:"widgettype",enableemptyfilter:this.form.enableemptyfilter}),i.applyFilterOnField(this.form.datasource,e.widget,t,e.value,{isFirst:!0})))},e.prototype.onDataSourceChange=function(){var e=this;_.get(this.form.formFields,"length")&&(this.form.isDataSourceUpdated=!0);var t=this.form.getFormFields();t.forEach((function(n){e._updateFieldOnDataSourceChange(n,t)}))},e.prototype.onFieldDefaultValueChange=function(e,t){"update"!==this.form.operationType&&(l.isDefined(t)&&null!==t&&""!==t&&"null"!==t?e.value=i.parseValueByType(t,e.type,e.widgettype,e.trailingzero):e.value=void 0,this.form.dirty&&!this._triggeredByUser&&this.form.markAsPristine(),this._debouncedSavePrevDataValues())},e.prototype.onFieldValueChange=function(e,t){i.applyFilterOnField(this.form.datasource,e.widget,this.form.formFields,t)},e.prototype.getBlobURL=function(e,t,n){var i,o="";return null!=n&&this.form.datasource?(i=e[(this.form.datasource.execute(l.DataSource.Operation.GET_PRIMARY_KEY)||[])[0]],o+=this.form.datasource.execute(l.DataSource.Operation.GET_BLOB_URL,{primaryValue:i,columnName:t}),o+="?"+Math.random()):o},e.prototype.setFormData=function(e,t){var n=this;e&&((t=t||this.form.formFields).forEach((function(t){var i=_.get(e,t.key||t.name);H(t)?t.value=K(i):t.type===l.DataType.BLOB?(n.form.resetFileUploadWidget(t,!0),t.href=n.getBlobURL(e,t.key,i),t.value=_.isString(i)?"":i):n.form.setFieldValue(t,e)})),this.savePrevDataValues(),this.form.constructDataObject())},e.prototype.onDataSourceUpdate=function(e,t,n){t?this.form.new():(this.form.setFormData(e),this.closeDialog()),this.form.isUpdateMode=!l.isDefined(n)||n},e.prototype.savePrevformFields=function(){this.form.prevformFields=l.getClonedObject(this.form.formFields.map((function(e){return{key:e.key,type:e.type,widgettype:e.widgettype,outputformat:e.outputformat,value:e.value}})))},e.prototype.getPrevformFields=function(){var e=this;this.form.formFields.map((function(t){var n=e.form.prevformFields.find((function(e){return e.key===t.key}));t.value=n.value}))},e.prototype.getDataObject=function(){return this.form.operationType===i.Live_Operations.INSERT?{}:l.isDefined(this.form.prevDataObject)&&!l.isEmptyObject(this.form.prevDataObject)?l.getClonedObject(this.form.prevDataObject):l.getClonedObject(this.form.formdata||{})},e.prototype.constructDataObject=function(e){var t=this,n=this.getDataObject(),i=this.form.name;return(e?this.form.prevformFields:this.form.getFormFields()).forEach((function(e){var o,r,a=_.split(e.key,"."),s=a[0]||e.key;e.widgettype&&l.isDateTimeType(e.widgettype)||l.isDateTimeType(e.type)?e.value?(o=l.getValidDateObject(e.value),r=e.outputformat===l.DataType.TIMESTAMP||e.type===l.DataType.TIMESTAMP?e.value?o:null:e.outputformat?t.datePipe.transform(o,e.outputformat):e.value):r=void 0:r=e.type===l.DataType.BLOB?l.getFiles(i,s+"_formWidget",e.multiple):e.type===l.DataType.LIST?e.value||void 0:null===e.value||""===e.value?void 0:e.value,1===a.length?n[s]=r:(n[s]=n[s]||{},n[s][a[1]]=r)})),e?n:(this.form.updateFormDataOutput(n),this.form.dataoutput)},e.prototype.setPrimaryKey=function(e){this.form.primaryKey=this.form.primaryKey||[],-1===this.form.primaryKey.indexOf(e)&&this.form.primaryKey.push(e)},e.prototype.findOperationType=function(){var e,t=this,n=!1,o=this.form.datasource&&this.form.datasource.execute(l.DataSource.Operation.GET_OPERATION_TYPE);return o&&"read"!==o?o:(this.form.primaryKey&&!_.isEmpty(this.form.formdata)&&(1===this.form.primaryKey.length?this.form.formdata[this.form.primaryKey[0]]&&(e=i.Live_Operations.UPDATE):0===this.form.primaryKey.length?(_.forEach(this.form.formdata,(function(e){e&&(n=!0)})),n&&(e=i.Live_Operations.UPDATE)):(n=_.some(this.form.primaryKey,(function(e){if(t.form.formdata[e])return!0})))&&(e=i.Live_Operations.UPDATE)),e||i.Live_Operations.INSERT)},e.prototype.getPrevDataValues=function(){var e=_.fromPairs(_.map(this.form.prevDataValues,(function(e){return[e.key,e.value]})));return this.form.formFields.forEach((function(t){t.value=e[t.key]||"",t.resetDisplayInput()})),e},e.prototype.savePrevDataValues=function(){this.form.prevDataValues=this.form.formFields.map((function(e){return{key:e.key,value:e.value}}))},e.prototype.clearData=function(){this.form.toggleMessage(!1),this.form.emptyDataModel()},e.prototype.setReadonlyFields=function(){this.form.formFields.forEach((function(e){e.setReadOnlyState()}))},e.prototype.reset=function(){var e,t=this;this.form.resetFormState(),e=this.getPrevDataValues(),this.form.formFields.forEach((function(n){var i;n.type!==l.DataType.BLOB&&"upload"!==n.widgettype||(t.form.resetFileUploadWidget(n,!0),n.href=t.getBlobURL(e,n.key,n.value)),null===(i=n.nativeElement.querySelector("input"))||void 0===i||i.removeAttribute("aria-invalid")})),this.form.constructDataObject()},e.prototype.closeDialog=function(){this.form.isLayoutDialog&&this.dialogService.close(this.form.dialogId)},e.prototype.cancel=function(){this.form.clearMessage(),this.form.isUpdateMode=!1,this.form.reset(),this.form.isSelected&&this.getPrevformFields(),this.form.isUpdateMode=!1,this.form._liveTableParent?this.form._liveTableParent.onCancel():this.closeDialog(),l.$appDigest()},e.prototype.delete=function(e){this.form.resetFormState(),this.form.operationType=i.Live_Operations.DELETE,this.form.prevDataObject=l.getClonedObject(this.form.formdata||{}),this.form.save(void 0,void 0,void 0,e)},e.prototype.saveAndNew=function(){this.save(void 0,!0,!0)},e.prototype.saveAndView=function(){this.save(void 0,!1)},e.prototype.submitForm=function(e){this.save(e)},e.prototype.save=function(e,t,n){var o=this;if(this.form.datasource){var r,a,s,c,p={};if(s=this.form.operationType=this.form.operationType||this.findOperationType(),!this.form.validateFieldsOnSubmit()){r=l.getClonedObject(this.form.constructDataObject()),a=this.form.prevformFields?this.form.constructDataObject(!0):r;try{if(!1===(c=this.form.invokeEventCallback("beforeservicecall",{$event:e,$operation:this.form.operationType,$data:r,options:p})))return;if(c&&c.error)return void this.form.toggleMessage(!0,c.error,"error")}catch(e){if("Abort"===e.message)return}if(this.form.operationType===i.Live_Operations.UPDATE&&this.form.ngform&&this.form.ngform.pristine&&this.form.isSelected&&_.isEqual(r,a))return this.form.toggleMessage(!0,this.form.appLocale.MESSAGE_NO_CHANGES,"info",""),void l.$appDigest();p.row=r,p.transform=!0,p.skipNotification=!0,s===i.Live_Operations.UPDATE&&(p.rowData=this.form.formdata,p.prevData=a),i.performDataOperation(this.form.datasource,p,{operationType:s}).then((function(e){var r,a=s===i.Live_Operations.INSERT?o.form.insertmessage:s===i.Live_Operations.UPDATE?o.form.updatemessage:o.form.deletemessage;return s===i.Live_Operations.DELETE?(r=p.row,o.form.emptyDataModel(),o.form.prevDataValues=[],o.form.isSelected=!1):r=e,o.form.onSuccess||o.form.toggleMessage(!0,a,"success"),o.form._liveTableParent?o.form._liveTableParent.onResult(s,e,n,t):(o.form.datasource.execute(l.DataSource.Operation.LIST_RECORDS,{skipToggleState:!0}),o.onDataSourceUpdate(e,n,t)),{result:r,status:!0}}),(function(e){return o.form.onError||o.form.toggleMessage(!0,e,"error"),l.$appDigest(),{result:e,status:!1}})).then((function(t){o.form.resetFormState(),o.form.onResultCb(t.result,t.status,e)}))}}},e}();X.initializeProps=O(),X.decorators=[{type:t.Directive,args:[{selector:"[wmLiveForm]"}]}],X.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Self},{type:t.Inject,args:[x]}]},{type:h.LiveTableComponent,decorators:[{type:t.Optional}]},{type:i.ToDatePipe},{type:l.AbstractDialogService},{type:String,decorators:[{type:t.Attribute,args:["formlayout"]}]}]},X.propDecorators={onKeydownHandler:[{type:t.HostListener,args:["keydown",["$event"]]}]};var J=[x,k,F,V,U,W,z,X],Z=function(){};Z.decorators=[{type:t.NgModule,args:[{imports:[o.BasicModule,n.CommonModule,a.DesignDialogModule,r.InputModule,i.WmComponentsModule],declarations:b([],y(J)),exports:b([],y(J)),entryComponents:[]}]}],e.DependsonDirective=W,e.FormActionDirective=F,e.FormComponent=x,e.FormFieldDirective=V,e.FormModule=Z,e.FormWidgetDirective=k,e.LiveActionsDirective=U,e.LiveFilterDirective=z,e.LiveFormDirective=X,e["\u02750"]=Y,e["\u02751"]=Q,e["\u0275a"]=P,e["\u0275b"]=O,e["\u0275c"]=S,e["\u0275d"]=M,e["\u0275e"]=j,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"),require("@wm/components/basic"),require("@wm/components/dialogs"),require("@wm/components/input"),require("@wm/core")):"function"==typeof define&&define.amd?define("@wm/components/dialogs/iframe-dialog",["exports","@angular/core","@angular/common","@wm/components/base","@wm/components/basic","@wm/components/dialogs","@wm/components/input","@wm/core"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.dialogs=e.wm.components.dialogs||{},e.wm.components.dialogs.iframedialog={}),e.ng.core,e.ng.common,e.wm.components.base,e.wm.components.basic,e.wm.components.dialogs,e.wm.components.input,e.wm.core)}(this,(function(e,t,n,i,o,r,a,s){"use strict";
549
549
  /*! *****************************************************************************
550
550
  Copyright (c) Microsoft Corporation.
551
551
 
@@ -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