@wavemaker/app-runtime-wm-build 11.4.2-rc.5383 → 11.4.2-rc.5385
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.
- app-runtime-wm-build/package.json +1 -1
- app-runtime-wm-build/wmapp/scripts/wm-libs.js +4 -0
- app-runtime-wm-build/wmapp/scripts/wm-libs.min.js +1 -1
- app-runtime-wm-build/wmapp/scripts/wm-loader.js +9 -9
- app-runtime-wm-build/wmapp/scripts/wm-loader.min.js +3 -3
- app-runtime-wm-build/wmmobile/scripts/wm-libs.js +4 -0
- app-runtime-wm-build/wmmobile/scripts/wm-libs.min.js +1 -1
- app-runtime-wm-build/wmmobile/scripts/wm-mobileloader.js +9 -9
- app-runtime-wm-build/wmmobile/scripts/wm-mobileloader.min.js +3 -3
|
@@ -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,a=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return r}function d(e,t,n){if(n||2===arguments.length)for(var i,o=0,a=t.length;o<a;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var u=function(){a.register("wm-button",new Map([["animation",a.PROP_STRING],["badgevalue",a.PROP_STRING],["caption",a.PROP_STRING],["class",a.PROP_STRING],["conditionalclass",a.PROP_ANY],["conditionalstyle",a.PROP_ANY],["disabled",a.PROP_BOOLEAN],["hint",a.PROP_STRING],["iconclass",a.PROP_STRING],["iconheight",a.PROP_STRING],["iconmargin",a.PROP_STRING],["iconposition",a.PROP_STRING],["iconurl",a.PROP_STRING],["iconwidth",a.PROP_STRING],["name",a.PROP_STRING],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["type",a.PROP_STRING]]))},h={widgetType:"wm-button",hostClass:"btn app-button",displayType:a.DISPLAY_TYPE.INLINE_BLOCK},m=function(e){function t(t){var n=e.call(this,t,h)||this;return a.styler(n.nativeElement,n),n}return c(t,e),t}(a.StylableComponent);m.initializeProps=u(),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:[a.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(){a.register("wm-buttongroup",new Map([["class",a.PROP_STRING],["name",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["vertical",a.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 a.styler(n.nativeElement,n,a.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}(a.StylableComponent);v.initializeProps=f(),v.decorators=[{type:t.Directive,args:[{selector:"[wmButtonGroup]",providers:[a.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(r.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}(a.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,d([],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",a.PROP_STRING],["class",a.PROP_STRING],["conditionalclass",a.PROP_ANY],["conditionalstyle",a.PROP_ANY],["checkedvalue",Object.assign({value:!0},a.PROP_STRING)],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["hint",a.PROP_STRING],["name",a.PROP_STRING],["readonly",a.PROP_BOOLEAN],["required",a.PROP_BOOLEAN],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["uncheckedvalue",Object.assign({value:!1},a.PROP_STRING)]]),O=function(){a.register("wm-checkbox",P),a.registerFormWidget(r.FormWidgetType.CHECKBOX,P),a.registerFormWidget(r.FormWidgetType.TOGGLE,P)},E={widgetType:"wm-checkbox",hostClass:"app-checkbox checkbox"},R=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},A=R,T=function(e){function t(t,n,i,o){var a=e.call(this,t,E)||this;return a.type=o,a._caption=" ",a._checkedvalue=R(n,!0),a._uncheckedvalue=R(i,!1),r.toggleClass(a.nativeElement,"app-toggle","toggle"===o),a}return c(t,e),Object.defineProperty(t.prototype,"datavalue",{get:function(){return r.isDefined(this.proxyModel)?this.proxyModel?this._checkedvalue:this._uncheckedvalue:void 0},set:function(e){this.proxyModel=r.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?r.isDefined(n)&&""!==n?this._caption=n:this._caption=" ":"checkedvalue"===t?this._checkedvalue=R(n,!0):"uncheckedvalue"===t?this._uncheckedvalue=R(n,!1):"datavalue"===t?(this.datavalue=R(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 a="tap"===n?this.nativeElement.querySelector("label"):this.checkboxEl.nativeElement;e.prototype.handleEvent.call(this,a,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),a.styler(this.nativeElement.querySelector("label"),this)},t}(w);T.initializeProps=O(),T.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:[a.provideAs(T,i.NG_VALUE_ACCESSOR,!0),a.provideAs(T,i.NG_VALIDATORS,!0),a.provideAsWidgetRef(T)]}]}],T.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"]}]}]},T.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 S=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){!r.isDefined(o._modelByKey)||_.isArray(o._modelByKey)&&!o._modelByKey.length?(o.toBeProcessedDatavalue=e,o._modelByValue=""):r.isDefined(o.toBeProcessedDatavalue)&&(r.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(a.ToDatePipe),o.appDefaults=o.inj.get(r.AppDefaults),o.binddisplayexpression=o.nativeElement.getAttribute("displayexpression.bind"),o.binddisplayimagesrc=o.nativeElement.getAttribute("displayimagesrc.bind"),o.binddisplaylabel=o.nativeElement.getAttribute("displaylabel.bind"),o._debouncedInitDatasetItems=r.debounce((function(){o.initDatasetItems(),r.$appDigest()}),150),o.handleHeaderClick=r.noop,o.cancelLocaleChangeSubscription=o.getAppInstance().subscribe("locale-changed",(function(){o._debouncedInitDatasetItems()})),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=a.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=d(d([],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(),!(!r.isDefined(e)||""===e||_.isNull(e)||e instanceof Array&&!e.length)||(this._modelByKey=void 0,this.allowempty&&r.isDefined(e)))if(this.acceptsArray&&!_.isArray(e)&&(e=this.allowempty?[e]:a.extractDataAsArray(e)),this.datasetItems.length||!r.isDefined(e)){var n=this.datafield===a.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?r.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?r.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=a.getOrderedDataset(a.convertDataToObject(this.dataset),this.orderby);if(this.usekeys)this.datasetItems=a.transformDataWithKeys(e);else{var t=a.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=d([],p(a.getUniqObjsByDataField(t,this.datafield,this.displayfield||this.displaylabel,r.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?a.groupData(this,a.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=a.handleHeaderClick,this.toggleAllHeaders=a.toggleAllHeaders.bind(void 0,this))},t.prototype.ngOnDestroy=function(){this.cancelLocaleChangeSubscription&&this.cancelLocaleChangeSubscription()},t}(w);S.decorators=[{type:t.Injectable}],S.ctorParameters=function(){return[{type:t.Injector},null,{type:String,decorators:[{type:t.Attribute,args:["groupby"]}]}]};var C=new Map([["class",a.PROP_STRING],["collapsible",a.PROP_BOOLEAN],["compareby",a.PROP_STRING],["datafield",a.PROP_STRING],["dataset",Object.assign({value:"Option 1, Option 2, Option 3"},a.PROP_ANY)],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_STRING],["dateformat",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["displayexpression",a.PROP_STRING],["displayfield",a.PROP_STRING],["displayValue",a.PROP_STRING],["groupby",a.PROP_STRING],["itemclass",Object.assign({value:""},a.PROP_STRING)],["itemsperrow",Object.assign({value:"xs-1 sm-1 md-1 lg-1"},a.PROP_STRING)],["listclass",Object.assign({value:""},a.PROP_STRING)],["match",a.PROP_STRING],["name",a.PROP_STRING],["orderby",a.PROP_STRING],["readonly",a.PROP_BOOLEAN],["required",a.PROP_BOOLEAN],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["showcount",a.PROP_BOOLEAN],["showindevice",Object.assign({displayType:"inline-block",value:"all"},a.PROP_STRING)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["usekeys",a.PROP_BOOLEAN]]),I=function(){a.register("wm-checkboxset",C),a.registerFormWidget(r.FormWidgetType.CHECKBOXSET,new Map(C))},D={widgetType:"wm-checkboxset",hostClass:"app-checkboxset list-group inline"},x=function(e){function t(t){var n=e.call(this,t,D)||this;return n.layout="",a.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?r.setListClass(this):e.prototype.onPropertyChange.call(this,t,n,i):this._onChange(this.datavalue))},t}(S);x.initializeProps=I(),x.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:[a.provideAs(x,i.NG_VALUE_ACCESSOR,!0),a.provideAs(x,i.NG_VALIDATORS,!0),a.provideAsWidgetRef(x)]}]}],x.ctorParameters=function(){return[{type:t.Injector}]},x.propDecorators={onKeyDown:[{type:t.HostListener,args:["keydown.enter",["$event",'"ENTER"']]}]};var N=function(){a.register("wm-form-group",new Map([["captionposition",a.PROP_STRING],["name",a.PROP_STRING],["required",a.PROP_BOOLEAN],["show",Object.assign({value:!0},a.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 a.styler(n.nativeElement,n,a.APPLY_STYLES_TYPE.CONTAINER),n}return c(t,e),t.prototype.onPropertyChange=function(t,n,i){"captionposition"===t?r.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),r.addForIdAttributes(this.nativeElement),this.assignRequiredToSubComponents()},t}(a.StylableComponent);L.initializeProps=N(),L.decorators=[{type:t.Directive,args:[{selector:"div[wmComposite]",providers:[a.provideAsWidgetRef(L)]}]}],L.ctorParameters=function(){return[{type:t.Injector}]},L.propDecorators={componentRefs:[{type:t.ContentChildren,args:[a.WidgetRef,{descendants:!0}]}]};var F=new Map([["autofocus",a.PROP_BOOLEAN],["class",a.PROP_STRING],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["hint",a.PROP_STRING],["localefilter",a.PROP_STRING],["minvalue",a.PROP_NUMBER],["maxvalue",a.PROP_NUMBER],["name",a.PROP_STRING],["numberfilter",a.PROP_STRING],["placeholder",Object.assign({value:"Enter number"},a.PROP_STRING)],["readonly",a.PROP_BOOLEAN],["regexp",a.PROP_STRING],["required",a.PROP_BOOLEAN],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["step",Object.assign({value:1},a.PROP_NUMBER)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["trailingzero",Object.assign({value:!1},a.PROP_BOOLEAN)],["updateon",a.PROP_STRING],["inputmode",Object.assign({value:"natural"},a.PROP_STRING)]]),j=function(){a.register("wm-number",F),a.registerFormWidget(r.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&&r.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),r.$appDigest()},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),this.class&&r.addClass(this.inputEl.nativeElement,this.class),a.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,a){var r=e.call(this,t,i)||this;return r.i18nService=o,r.trailingZeroDecimalPipe=a,r.isDefaultQuery=!0,r.decimalValue="",r.selectedLocale=o.getSelectedLocale(),r.DECIMAL=n.getLocaleNumberSymbol(r.localefilter||r.selectedLocale,n.NumberSymbol.Decimal),r.GROUP=n.getLocaleNumberSymbol(r.localefilter||r.selectedLocale,n.NumberSymbol.Group),r.numberfilter="1.0-16",r.resetValidations(),r}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 a,r=e.toString();a=/\d/.test(r)?this.parseNumber(r):NaN,_.isNaN(a)&&r[r.length-1]===this.DECIMAL&&"change"===this.ngModelOptions.updateOn&&this.$element.find("input:focus").length&&(this.lastValIsDecimal=!0),!this.lastValIsDecimal&&this.isValid(a)?(this.proxyModel=a,this.updateDisplayText(),this.isDefaultQuery||this.handleChange(a)):(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===a.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===a.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===a.INPUTMODE.NATURAL&&"wm-currency"===this.widgetType&&!!this.trailingzero},t.prototype.onInputChange=function(e){var t=this.stepLength();if(r.isDefined(e)&&(""!==e||this.datavalue)&&(this.handleChange(e),t&&this.inputmode===a.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===a.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 a=this.parseNumber(this.inputEl.nativeElement.value);_.isNaN(a)||(i=this.getValueInRange(a),n=a,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 r=Math.max(this.countDecimals(n),this.countDecimals(this.step));this.proxyModel=_.round(i,r),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===a.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===a.INPUTMODE.NATURAL||this.inputmode===a.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"},W=function(e){function t(t,n,i){return e.call(this,t,V,n,i)||this}return c(t,e),t}(G);W.initializeProps=j(),W.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:[a.provideAs(W,i.NG_VALUE_ACCESSOR,!0),a.provideAs(W,i.NG_VALIDATORS,!0),a.provideAsWidgetRef(W)]}]}],W.ctorParameters=function(){return[{type:t.Injector},{type:r.AbstractI18nService},{type:a.TrailingZeroDecimalPipe}]},W.propDecorators={inputEl:[{type:t.ViewChild,args:["input",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel,{static:!0}]}]};var U=new Map([["class",a.PROP_STRING],["collapsible",a.PROP_BOOLEAN],["compareby",a.PROP_STRING],["datafield",a.PROP_STRING],["dataset",Object.assign({value:"Option 1, Option 2, Option 3"},a.PROP_ANY)],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_ANY],["dateformat",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["displayexpression",a.PROP_STRING],["displayfield",a.PROP_STRING],["displayValue",a.PROP_STRING],["groupby",a.PROP_STRING],["itemclass",Object.assign({value:""},a.PROP_STRING)],["itemsperrow",Object.assign({value:"xs-1 sm-1 md-1 lg-1"},a.PROP_STRING)],["listclass",Object.assign({value:""},a.PROP_STRING)],["match",a.PROP_STRING],["name",a.PROP_STRING],["orderby",a.PROP_STRING],["readonly",a.PROP_BOOLEAN],["required",a.PROP_BOOLEAN],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["showcount",a.PROP_BOOLEAN],["showindevice",Object.assign({displayType:"inline-block",value:"all"},a.PROP_STRING)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["usekeys",a.PROP_BOOLEAN]]),q=function(){a.register("wm-radioset",U),a.registerFormWidget(r.FormWidgetType.RADIOSET,new Map(U))},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="",a.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?r.setListClass(this):e.prototype.onPropertyChange.call(this,t,n,i))},t}(S);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:[a.provideAs(H,i.NG_VALUE_ACCESSOR,!0),a.provideAs(H,i.NG_VALIDATORS,!0),a.provideAsWidgetRef(H)]}]}],H.ctorParameters=function(){return[{type:t.Injector}]};var Y=new Map([["autofocus",a.PROP_BOOLEAN],["class",Object.assign({value:""},a.PROP_STRING)],["compareby",a.PROP_STRING],["datafield",a.PROP_STRING],["dataset",a.PROP_ANY],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_STRING],["dateformat",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["displayexpression",a.PROP_STRING],["displayfield",a.PROP_STRING],["displayValue",a.PROP_STRING],["groupby",a.PROP_STRING],["hint",a.PROP_STRING],["match",a.PROP_STRING],["multiple",Object.assign({value:!1},a.PROP_BOOLEAN)],["name",a.PROP_STRING],["orderby",a.PROP_STRING],["placeholder",a.PROP_STRING],["readonly",a.PROP_BOOLEAN],["required",a.PROP_BOOLEAN],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["usekeys",a.PROP_BOOLEAN]]),K=function(){a.register("wm-select",Y),a.registerFormWidget(r.FormWidgetType.SELECT,new Map(Y)),a.registerFormWidget(r.FormWidgetType.TYPEAHEAD,new Map(Y))},Q={widgetType:"wm-select",hostClass:"app-select-wrapper"},Z=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(r.DataSource.Operation.IS_BOUND_TO_LOCALE)&&(this.datavalue=e.execute(r.DataSource.Operation.GET_DEFAULT_LOCALE))},enumerable:!1,configurable:!0}),t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),a.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?r.setAttr(this.selectEl.nativeElement,"readonly","readonly"):r.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}(S);Z.initializeProps=K(),Z.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:[a.provideAs(Z,i.NG_VALUE_ACCESSOR,!0),a.provideAs(Z,i.NG_VALIDATORS,!0),a.provideAsWidgetRef(Z)]}]}],Z.ctorParameters=function(){return[{type:t.Injector}]},Z.propDecorators={selectEl:[{type:t.ViewChild,args:["select",{static:!0,read:t.ElementRef}]}]};var J=new Map([["class",a.PROP_STRING],["compareby",a.PROP_STRING],["datafield",a.PROP_STRING],["dataset",Object.assign({value:"yes, no, maybe"},a.PROP_ANY)],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["displayexpression",a.PROP_STRING],["displayfield",a.PROP_STRING],["hint",a.PROP_STRING],["iconclass",a.PROP_STRING],["name",a.PROP_STRING],["orderby",a.PROP_STRING],["required",a.PROP_BOOLEAN],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)]]),X=function(){a.register("wm-switch",J),a.registerFormWidget(r.FormWidgetType.SWITCH,new Map(J)),a.registerFormWidget(r.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=r.debounce((function(e){n.setSelectedValue(),n.updateHighlighter(e),e&&r.$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),a.styler(this.nativeElement,this)},t.prototype.onStyleChange=function(t,n,i){"height"===t?r.setCSS(this.nativeElement,"overflow",n?"auto":""):e.prototype.onStyleChange.call(this,t,n,i)},t.prototype.setSelectedValue=function(){r.isDefined(this.datavalue)||r.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,r.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),r.$appDigest()}},t.prototype.onPropertyChange=function(t,n,i){"disabled"!==t||r.toBoolean(n)?e.prototype.onPropertyChange.call(this,t,n,i):this.nativeElement.removeAttribute(t)},t}(S);te.initializeProps=X(),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:[a.provideAs(te,i.NG_VALUE_ACCESSOR,!0),a.provideAsWidgetRef(te)],exportAs:"wmSwitch"}]}],te.ctorParameters=function(){return[{type:t.Injector}]};var ne=new Map([["autocomplete",Object.assign({value:!0},a.PROP_BOOLEAN)],["autotrim",Object.assign({value:!0},a.PROP_BOOLEAN)],["autofocus",a.PROP_BOOLEAN],["class",a.PROP_STRING],["datasource",a.PROP_ANY],["datavalue",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["hint",a.PROP_STRING],["maxvalue",a.PROP_NUMBER],["minvalue",a.PROP_NUMBER],["name",a.PROP_STRING],["placeholder",Object.assign({value:"Enter text"},a.PROP_STRING)],["readonly",a.PROP_BOOLEAN],["required",a.PROP_BOOLEAN],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["step",a.PROP_NUMBER],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["type",a.PROP_STRING],["updateon",a.PROP_STRING]]),ie=function(){a.register("wm-input-calendar",ne)},oe={widgetType:"wm-input-calendar",hostClass:"app-input-wrapper"},ae=function(e){function t(t){return e.call(this,t,oe)||this}return c(t,e),t}(B);ae.initializeProps=ie(),ae.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:[a.provideAs(ae,i.NG_VALUE_ACCESSOR,!0),a.provideAs(ae,i.NG_VALIDATORS,!0),a.provideAsWidgetRef(ae)]}]}],ae.ctorParameters=function(){return[{type:t.Injector}]},ae.propDecorators={inputEl:[{type:t.ViewChild,args:["input",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel]}]};var re=new Map([["autocomplete",Object.assign({value:!0},a.PROP_BOOLEAN)],["autofocus",a.PROP_BOOLEAN],["autotrim",Object.assign({value:!0},a.PROP_BOOLEAN)],["class",a.PROP_STRING],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["hint",a.PROP_STRING],["name",a.PROP_STRING],["placeholder",Object.assign({value:"Enter text"},a.PROP_STRING)],["readonly",a.PROP_BOOLEAN],["required",a.PROP_BOOLEAN],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["type",Object.assign({value:"color"},a.PROP_STRING)],["updateon",a.PROP_STRING]]),se=function(){a.register("wm-input-color",re)},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:[a.provideAs(ce,i.NG_VALUE_ACCESSOR,!0),a.provideAs(ce,i.NG_VALIDATORS,!0),a.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},a.PROP_BOOLEAN)],["autofocus",a.PROP_BOOLEAN],["autotrim",Object.assign({value:!0},a.PROP_BOOLEAN)],["class",a.PROP_STRING],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["hint",a.PROP_STRING],["maxchars",a.PROP_NUMBER],["name",a.PROP_STRING],["placeholder",Object.assign({value:"Enter text"},a.PROP_STRING)],["readonly",a.PROP_BOOLEAN],["regexp",a.PROP_STRING],["required",a.PROP_BOOLEAN],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["type",Object.assign({value:"email"},a.PROP_STRING)],["updateon",a.PROP_STRING]]),de=function(){a.register("wm-input-email",pe)},ue={widgetType:"wm-input-email",hostClass:"app-input-wrapper"},he=function(e){function t(t){return e.call(this,t,ue)||this}return c(t,e),t}(B);he.initializeProps=de(),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:[a.provideAs(he,i.NG_VALUE_ACCESSOR,!0),a.provideAs(he,i.NG_VALIDATORS,!0),a.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},a.PROP_BOOLEAN)],["autofocus",a.PROP_BOOLEAN],["autotrim",Object.assign({value:!0},a.PROP_BOOLEAN)],["class",a.PROP_STRING],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["hint",a.PROP_STRING],["maxchars",a.PROP_NUMBER],["maxvalue",a.PROP_NUMBER],["minvalue",a.PROP_NUMBER],["name",a.PROP_STRING],["placeholder",Object.assign({value:"Enter text"},a.PROP_STRING)],["readonly",a.PROP_BOOLEAN],["regexp",a.PROP_STRING],["required",a.PROP_BOOLEAN],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["step",a.PROP_NUMBER],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["type",Object.assign({value:"number"},a.PROP_STRING)],["updateon",a.PROP_STRING]]),fe=function(){a.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:[a.provideAs(ve,i.NG_VALUE_ACCESSOR,!0),a.provideAs(ve,i.NG_VALIDATORS,!0),a.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},a.PROP_BOOLEAN)],["autofocus",a.PROP_BOOLEAN],["autotrim",Object.assign({value:!0},a.PROP_BOOLEAN)],["class",a.PROP_STRING],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["displayformat",a.PROP_STRING],["hint",a.PROP_STRING],["maxchars",a.PROP_NUMBER],["name",a.PROP_STRING],["placeholder",Object.assign({value:"Enter text"},a.PROP_STRING)],["readonly",a.PROP_BOOLEAN],["regexp",a.PROP_STRING],["required",a.PROP_BOOLEAN],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["showdisplayformaton",Object.assign({value:"always"},a.PROP_ANY)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["type",Object.assign({value:"text"},a.PROP_STRING)],["updateon",a.PROP_STRING]]),be=function(){a.register("wm-input-text",ye),a.registerFormWidget(r.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(re),t(pe),t(me),a.registerFormWidget(r.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:[a.provideAs(Pe,i.NG_VALUE_ACCESSOR,!0),a.provideAs(Pe,i.NG_VALIDATORS,!0),a.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",a.PROP_BOOLEAN],["autotrim",Object.assign({value:!0},a.PROP_BOOLEAN)],["class",a.PROP_STRING],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["hint",a.PROP_STRING],["maxchars",a.PROP_NUMBER],["name",a.PROP_STRING],["placeholder",Object.assign({value:"Place your text"},a.PROP_STRING)],["readonly",a.PROP_BOOLEAN],["required",a.PROP_BOOLEAN],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["updateon",a.PROP_STRING],["limitdisplaytext",a.PROP_STRING],["charlength",a.PROP_NUMBER]]),Oe=function(){a.register("wm-textarea",_e),a.registerFormWidget(r.FormWidgetType.TEXTAREA,new Map(_e))},Ee={widgetType:"wm-textarea",hostClass:"app-input-wrapper"},Re=function(e){function t(t){var n=e.call(this,t,Ee)||this;return n.charlength=0,n}return c(t,e),t.prototype.onInputChange=function(){this.charlength=this.inputEl.nativeElement.value.length},t}(B);Re.initializeProps=Oe(),Re.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:[a.provideAs(Re,i.NG_VALUE_ACCESSOR,!0),a.provideAs(Re,i.NG_VALIDATORS,!0),a.provideAsWidgetRef(Re)]}]}],Re.ctorParameters=function(){return[{type:t.Injector}]},Re.propDecorators={inputEl:[{type:t.ViewChild,args:["textarea",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel]}]};var Ae=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}();Ae.decorators=[{type:t.Directive,args:[{selector:"[captionPosition]"}]}],Ae.ctorParameters=function(){return[{type:t.Injector},{type:r.App}]};var Te=[m,v,Ae,T,x,L,W,H,Z,te,ae,ce,he,ve,Pe,Re],Se=function(){};Se.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule,a.WmComponentsModule,o.IMaskModule],declarations:d([],p(Te)),exports:d([],p(Te)),entryComponents:[]}]}],e.BaseFormComponent=y,e.BaseFormCustomComponent=w,e.ButtonComponent=m,e.ButtonGroupDirective=v,e.CaptionPositionDirective=Ae,e.CheckboxComponent=T,e.CheckboxsetComponent=x,e.CompositeDirective=L,e.DatasetAwareFormComponent=S,e.InputCalendarComponent=ae,e.InputColorComponent=ce,e.InputEmailComponent=he,e.InputModule=Se,e.InputNumberComponent=ve,e.InputTextComponent=Pe,e.NumberComponent=W,e.NumberLocale=G,e.RadiosetComponent=H,e.SelectComponent=Z,e.SwitchComponent=te,e.TextareaComponent=Re,e["\u02750"]=A,e["\u0275a"]=u,e["\u0275b"]=f,e["\u0275c"]=O,e["\u0275d"]=I,e["\u0275e"]=N,e["\u0275f"]=B,e["\u0275g"]=j,e["\u0275h"]=q,e["\u0275i"]=K,e["\u0275j"]=X,e["\u0275k"]=ie,e["\u0275l"]=se,e["\u0275m"]=de,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,a=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return r}function d(e,t,n){if(n||2===arguments.length)for(var i,o=0,a=t.length;o<a;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var u=function(){a.register("wm-button",new Map([["animation",a.PROP_STRING],["badgevalue",a.PROP_STRING],["caption",a.PROP_STRING],["class",a.PROP_STRING],["conditionalclass",a.PROP_ANY],["conditionalstyle",a.PROP_ANY],["disabled",a.PROP_BOOLEAN],["hint",a.PROP_STRING],["iconclass",a.PROP_STRING],["iconheight",a.PROP_STRING],["iconmargin",a.PROP_STRING],["iconposition",a.PROP_STRING],["iconurl",a.PROP_STRING],["iconwidth",a.PROP_STRING],["name",a.PROP_STRING],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["type",a.PROP_STRING]]))},h={widgetType:"wm-button",hostClass:"btn app-button",displayType:a.DISPLAY_TYPE.INLINE_BLOCK},m=function(e){function t(t){var n=e.call(this,t,h)||this;return a.styler(n.nativeElement,n),n}return c(t,e),t}(a.StylableComponent);m.initializeProps=u(),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:[a.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(){a.register("wm-buttongroup",new Map([["class",a.PROP_STRING],["name",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["vertical",a.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 a.styler(n.nativeElement,n,a.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}(a.StylableComponent);v.initializeProps=f(),v.decorators=[{type:t.Directive,args:[{selector:"[wmButtonGroup]",providers:[a.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(r.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}(a.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,d([],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),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",a.PROP_STRING],["class",a.PROP_STRING],["conditionalclass",a.PROP_ANY],["conditionalstyle",a.PROP_ANY],["checkedvalue",Object.assign({value:!0},a.PROP_STRING)],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["hint",a.PROP_STRING],["name",a.PROP_STRING],["readonly",a.PROP_BOOLEAN],["required",a.PROP_BOOLEAN],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["uncheckedvalue",Object.assign({value:!1},a.PROP_STRING)]]),O=function(){a.register("wm-checkbox",P),a.registerFormWidget(r.FormWidgetType.CHECKBOX,P),a.registerFormWidget(r.FormWidgetType.TOGGLE,P)},E={widgetType:"wm-checkbox",hostClass:"app-checkbox checkbox"},R=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},A=R,T=function(e){function t(t,n,i,o){var a=e.call(this,t,E)||this;return a.type=o,a._caption=" ",a._checkedvalue=R(n,!0),a._uncheckedvalue=R(i,!1),r.toggleClass(a.nativeElement,"app-toggle","toggle"===o),a}return c(t,e),Object.defineProperty(t.prototype,"datavalue",{get:function(){return r.isDefined(this.proxyModel)?this.proxyModel?this._checkedvalue:this._uncheckedvalue:void 0},set:function(e){this.proxyModel=r.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?r.isDefined(n)&&""!==n?this._caption=n:this._caption=" ":"checkedvalue"===t?this._checkedvalue=R(n,!0):"uncheckedvalue"===t?this._uncheckedvalue=R(n,!1):"datavalue"===t?(this.datavalue=R(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 a="tap"===n?this.nativeElement.querySelector("label"):this.checkboxEl.nativeElement;e.prototype.handleEvent.call(this,a,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),a.styler(this.nativeElement.querySelector("label"),this)},t}(w);T.initializeProps=O(),T.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:[a.provideAs(T,i.NG_VALUE_ACCESSOR,!0),a.provideAs(T,i.NG_VALIDATORS,!0),a.provideAsWidgetRef(T)]}]}],T.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"]}]}]},T.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 S=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){!r.isDefined(o._modelByKey)||_.isArray(o._modelByKey)&&!o._modelByKey.length?(o.toBeProcessedDatavalue=e,o._modelByValue=""):r.isDefined(o.toBeProcessedDatavalue)&&(r.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(a.ToDatePipe),o.appDefaults=o.inj.get(r.AppDefaults),o.binddisplayexpression=o.nativeElement.getAttribute("displayexpression.bind"),o.binddisplayimagesrc=o.nativeElement.getAttribute("displayimagesrc.bind"),o.binddisplaylabel=o.nativeElement.getAttribute("displaylabel.bind"),o._debouncedInitDatasetItems=r.debounce((function(){o.initDatasetItems(),r.$appDigest()}),150),o.handleHeaderClick=r.noop,o.cancelLocaleChangeSubscription=o.getAppInstance().subscribe("locale-changed",(function(){o._debouncedInitDatasetItems()})),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=a.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=d(d([],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(),!(!r.isDefined(e)||""===e||_.isNull(e)||e instanceof Array&&!e.length)||(this._modelByKey=void 0,this.allowempty&&r.isDefined(e)))if(this.acceptsArray&&!_.isArray(e)&&(e=this.allowempty?[e]:a.extractDataAsArray(e)),this.datasetItems.length||!r.isDefined(e)){var n=this.datafield===a.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?r.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?r.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=a.getOrderedDataset(a.convertDataToObject(this.dataset),this.orderby);if(this.usekeys)this.datasetItems=a.transformDataWithKeys(e);else{var t=a.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=d([],p(a.getUniqObjsByDataField(t,this.datafield,this.displayfield||this.displaylabel,r.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?a.groupData(this,a.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=a.handleHeaderClick,this.toggleAllHeaders=a.toggleAllHeaders.bind(void 0,this))},t.prototype.ngOnDestroy=function(){this.cancelLocaleChangeSubscription&&this.cancelLocaleChangeSubscription()},t}(w);S.decorators=[{type:t.Injectable}],S.ctorParameters=function(){return[{type:t.Injector},null,{type:String,decorators:[{type:t.Attribute,args:["groupby"]}]}]};var C=new Map([["class",a.PROP_STRING],["collapsible",a.PROP_BOOLEAN],["compareby",a.PROP_STRING],["datafield",a.PROP_STRING],["dataset",Object.assign({value:"Option 1, Option 2, Option 3"},a.PROP_ANY)],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_STRING],["dateformat",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["displayexpression",a.PROP_STRING],["displayfield",a.PROP_STRING],["displayValue",a.PROP_STRING],["groupby",a.PROP_STRING],["itemclass",Object.assign({value:""},a.PROP_STRING)],["itemsperrow",Object.assign({value:"xs-1 sm-1 md-1 lg-1"},a.PROP_STRING)],["listclass",Object.assign({value:""},a.PROP_STRING)],["match",a.PROP_STRING],["name",a.PROP_STRING],["orderby",a.PROP_STRING],["readonly",a.PROP_BOOLEAN],["required",a.PROP_BOOLEAN],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["showcount",a.PROP_BOOLEAN],["showindevice",Object.assign({displayType:"inline-block",value:"all"},a.PROP_STRING)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["usekeys",a.PROP_BOOLEAN]]),I=function(){a.register("wm-checkboxset",C),a.registerFormWidget(r.FormWidgetType.CHECKBOXSET,new Map(C))},D={widgetType:"wm-checkboxset",hostClass:"app-checkboxset list-group inline"},x=function(e){function t(t){var n=e.call(this,t,D)||this;return n.layout="",a.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?r.setListClass(this):e.prototype.onPropertyChange.call(this,t,n,i):this._onChange(this.datavalue))},t}(S);x.initializeProps=I(),x.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:[a.provideAs(x,i.NG_VALUE_ACCESSOR,!0),a.provideAs(x,i.NG_VALIDATORS,!0),a.provideAsWidgetRef(x)]}]}],x.ctorParameters=function(){return[{type:t.Injector}]},x.propDecorators={onKeyDown:[{type:t.HostListener,args:["keydown.enter",["$event",'"ENTER"']]}]};var N=function(){a.register("wm-form-group",new Map([["captionposition",a.PROP_STRING],["name",a.PROP_STRING],["required",a.PROP_BOOLEAN],["show",Object.assign({value:!0},a.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 a.styler(n.nativeElement,n,a.APPLY_STYLES_TYPE.CONTAINER),n}return c(t,e),t.prototype.onPropertyChange=function(t,n,i){"captionposition"===t?r.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),r.addForIdAttributes(this.nativeElement),this.assignRequiredToSubComponents()},t}(a.StylableComponent);L.initializeProps=N(),L.decorators=[{type:t.Directive,args:[{selector:"div[wmComposite]",providers:[a.provideAsWidgetRef(L)]}]}],L.ctorParameters=function(){return[{type:t.Injector}]},L.propDecorators={componentRefs:[{type:t.ContentChildren,args:[a.WidgetRef,{descendants:!0}]}]};var F=new Map([["autofocus",a.PROP_BOOLEAN],["class",a.PROP_STRING],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["hint",a.PROP_STRING],["localefilter",a.PROP_STRING],["minvalue",a.PROP_NUMBER],["maxvalue",a.PROP_NUMBER],["name",a.PROP_STRING],["numberfilter",a.PROP_STRING],["placeholder",Object.assign({value:"Enter number"},a.PROP_STRING)],["readonly",a.PROP_BOOLEAN],["regexp",a.PROP_STRING],["required",a.PROP_BOOLEAN],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["step",Object.assign({value:1},a.PROP_NUMBER)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["trailingzero",Object.assign({value:!1},a.PROP_BOOLEAN)],["updateon",a.PROP_STRING],["inputmode",Object.assign({value:"natural"},a.PROP_STRING)]]),j=function(){a.register("wm-number",F),a.registerFormWidget(r.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&&r.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),r.$appDigest()},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),this.class&&r.addClass(this.inputEl.nativeElement,this.class),a.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,a){var r=e.call(this,t,i)||this;return r.i18nService=o,r.trailingZeroDecimalPipe=a,r.isDefaultQuery=!0,r.decimalValue="",r.selectedLocale=o.getSelectedLocale(),r.DECIMAL=n.getLocaleNumberSymbol(r.localefilter||r.selectedLocale,n.NumberSymbol.Decimal),r.GROUP=n.getLocaleNumberSymbol(r.localefilter||r.selectedLocale,n.NumberSymbol.Group),r.numberfilter="1.0-16",r.resetValidations(),r}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 a,r=e.toString();a=/\d/.test(r)?this.parseNumber(r):NaN,_.isNaN(a)&&r[r.length-1]===this.DECIMAL&&"change"===this.ngModelOptions.updateOn&&this.$element.find("input:focus").length&&(this.lastValIsDecimal=!0),!this.lastValIsDecimal&&this.isValid(a)?(this.proxyModel=a,this.updateDisplayText(),this.isDefaultQuery||this.handleChange(a)):(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===a.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===a.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===a.INPUTMODE.NATURAL&&"wm-currency"===this.widgetType&&!!this.trailingzero},t.prototype.onInputChange=function(e){var t=this.stepLength();if(r.isDefined(e)&&(""!==e||this.datavalue)&&(this.handleChange(e),t&&this.inputmode===a.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===a.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 a=this.parseNumber(this.inputEl.nativeElement.value);_.isNaN(a)||(i=this.getValueInRange(a),n=a,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 r=Math.max(this.countDecimals(n),this.countDecimals(this.step));this.proxyModel=_.round(i,r),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===a.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===a.INPUTMODE.NATURAL||this.inputmode===a.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"},W=function(e){function t(t,n,i){return e.call(this,t,V,n,i)||this}return c(t,e),t}(G);W.initializeProps=j(),W.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:[a.provideAs(W,i.NG_VALUE_ACCESSOR,!0),a.provideAs(W,i.NG_VALIDATORS,!0),a.provideAsWidgetRef(W)]}]}],W.ctorParameters=function(){return[{type:t.Injector},{type:r.AbstractI18nService},{type:a.TrailingZeroDecimalPipe}]},W.propDecorators={inputEl:[{type:t.ViewChild,args:["input",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel,{static:!0}]}]};var U=new Map([["class",a.PROP_STRING],["collapsible",a.PROP_BOOLEAN],["compareby",a.PROP_STRING],["datafield",a.PROP_STRING],["dataset",Object.assign({value:"Option 1, Option 2, Option 3"},a.PROP_ANY)],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_ANY],["dateformat",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["displayexpression",a.PROP_STRING],["displayfield",a.PROP_STRING],["displayValue",a.PROP_STRING],["groupby",a.PROP_STRING],["itemclass",Object.assign({value:""},a.PROP_STRING)],["itemsperrow",Object.assign({value:"xs-1 sm-1 md-1 lg-1"},a.PROP_STRING)],["listclass",Object.assign({value:""},a.PROP_STRING)],["match",a.PROP_STRING],["name",a.PROP_STRING],["orderby",a.PROP_STRING],["readonly",a.PROP_BOOLEAN],["required",a.PROP_BOOLEAN],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["showcount",a.PROP_BOOLEAN],["showindevice",Object.assign({displayType:"inline-block",value:"all"},a.PROP_STRING)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["usekeys",a.PROP_BOOLEAN]]),q=function(){a.register("wm-radioset",U),a.registerFormWidget(r.FormWidgetType.RADIOSET,new Map(U))},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="",a.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?r.setListClass(this):e.prototype.onPropertyChange.call(this,t,n,i))},t}(S);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:[a.provideAs(H,i.NG_VALUE_ACCESSOR,!0),a.provideAs(H,i.NG_VALIDATORS,!0),a.provideAsWidgetRef(H)]}]}],H.ctorParameters=function(){return[{type:t.Injector}]};var Y=new Map([["autofocus",a.PROP_BOOLEAN],["class",Object.assign({value:""},a.PROP_STRING)],["compareby",a.PROP_STRING],["datafield",a.PROP_STRING],["dataset",a.PROP_ANY],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_STRING],["dateformat",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["displayexpression",a.PROP_STRING],["displayfield",a.PROP_STRING],["displayValue",a.PROP_STRING],["groupby",a.PROP_STRING],["hint",a.PROP_STRING],["match",a.PROP_STRING],["multiple",Object.assign({value:!1},a.PROP_BOOLEAN)],["name",a.PROP_STRING],["orderby",a.PROP_STRING],["placeholder",a.PROP_STRING],["readonly",a.PROP_BOOLEAN],["required",a.PROP_BOOLEAN],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["usekeys",a.PROP_BOOLEAN]]),K=function(){a.register("wm-select",Y),a.registerFormWidget(r.FormWidgetType.SELECT,new Map(Y)),a.registerFormWidget(r.FormWidgetType.TYPEAHEAD,new Map(Y))},Q={widgetType:"wm-select",hostClass:"app-select-wrapper"},Z=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(r.DataSource.Operation.IS_BOUND_TO_LOCALE)&&(this.datavalue=e.execute(r.DataSource.Operation.GET_DEFAULT_LOCALE))},enumerable:!1,configurable:!0}),t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),a.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?r.setAttr(this.selectEl.nativeElement,"readonly","readonly"):r.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}(S);Z.initializeProps=K(),Z.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:[a.provideAs(Z,i.NG_VALUE_ACCESSOR,!0),a.provideAs(Z,i.NG_VALIDATORS,!0),a.provideAsWidgetRef(Z)]}]}],Z.ctorParameters=function(){return[{type:t.Injector}]},Z.propDecorators={selectEl:[{type:t.ViewChild,args:["select",{static:!0,read:t.ElementRef}]}]};var J=new Map([["class",a.PROP_STRING],["compareby",a.PROP_STRING],["datafield",a.PROP_STRING],["dataset",Object.assign({value:"yes, no, maybe"},a.PROP_ANY)],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["displayexpression",a.PROP_STRING],["displayfield",a.PROP_STRING],["hint",a.PROP_STRING],["iconclass",a.PROP_STRING],["name",a.PROP_STRING],["orderby",a.PROP_STRING],["required",a.PROP_BOOLEAN],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)]]),X=function(){a.register("wm-switch",J),a.registerFormWidget(r.FormWidgetType.SWITCH,new Map(J)),a.registerFormWidget(r.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=r.debounce((function(e){n.setSelectedValue(),n.updateHighlighter(e),e&&r.$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),a.styler(this.nativeElement,this)},t.prototype.onStyleChange=function(t,n,i){"height"===t?r.setCSS(this.nativeElement,"overflow",n?"auto":""):e.prototype.onStyleChange.call(this,t,n,i)},t.prototype.setSelectedValue=function(){r.isDefined(this.datavalue)||r.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,r.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),r.$appDigest()}},t.prototype.onPropertyChange=function(t,n,i){"disabled"!==t||r.toBoolean(n)?e.prototype.onPropertyChange.call(this,t,n,i):this.nativeElement.removeAttribute(t)},t}(S);te.initializeProps=X(),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:[a.provideAs(te,i.NG_VALUE_ACCESSOR,!0),a.provideAsWidgetRef(te)],exportAs:"wmSwitch"}]}],te.ctorParameters=function(){return[{type:t.Injector}]};var ne=new Map([["autocomplete",Object.assign({value:!0},a.PROP_BOOLEAN)],["autotrim",Object.assign({value:!0},a.PROP_BOOLEAN)],["autofocus",a.PROP_BOOLEAN],["class",a.PROP_STRING],["datasource",a.PROP_ANY],["datavalue",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["hint",a.PROP_STRING],["maxvalue",a.PROP_NUMBER],["minvalue",a.PROP_NUMBER],["name",a.PROP_STRING],["placeholder",Object.assign({value:"Enter text"},a.PROP_STRING)],["readonly",a.PROP_BOOLEAN],["required",a.PROP_BOOLEAN],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["step",a.PROP_NUMBER],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["type",a.PROP_STRING],["updateon",a.PROP_STRING]]),ie=function(){a.register("wm-input-calendar",ne)},oe={widgetType:"wm-input-calendar",hostClass:"app-input-wrapper"},ae=function(e){function t(t){return e.call(this,t,oe)||this}return c(t,e),t}(B);ae.initializeProps=ie(),ae.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:[a.provideAs(ae,i.NG_VALUE_ACCESSOR,!0),a.provideAs(ae,i.NG_VALIDATORS,!0),a.provideAsWidgetRef(ae)]}]}],ae.ctorParameters=function(){return[{type:t.Injector}]},ae.propDecorators={inputEl:[{type:t.ViewChild,args:["input",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel]}]};var re=new Map([["autocomplete",Object.assign({value:!0},a.PROP_BOOLEAN)],["autofocus",a.PROP_BOOLEAN],["autotrim",Object.assign({value:!0},a.PROP_BOOLEAN)],["class",a.PROP_STRING],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["hint",a.PROP_STRING],["name",a.PROP_STRING],["placeholder",Object.assign({value:"Enter text"},a.PROP_STRING)],["readonly",a.PROP_BOOLEAN],["required",a.PROP_BOOLEAN],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["type",Object.assign({value:"color"},a.PROP_STRING)],["updateon",a.PROP_STRING]]),se=function(){a.register("wm-input-color",re)},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:[a.provideAs(ce,i.NG_VALUE_ACCESSOR,!0),a.provideAs(ce,i.NG_VALIDATORS,!0),a.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},a.PROP_BOOLEAN)],["autofocus",a.PROP_BOOLEAN],["autotrim",Object.assign({value:!0},a.PROP_BOOLEAN)],["class",a.PROP_STRING],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["hint",a.PROP_STRING],["maxchars",a.PROP_NUMBER],["name",a.PROP_STRING],["placeholder",Object.assign({value:"Enter text"},a.PROP_STRING)],["readonly",a.PROP_BOOLEAN],["regexp",a.PROP_STRING],["required",a.PROP_BOOLEAN],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["type",Object.assign({value:"email"},a.PROP_STRING)],["updateon",a.PROP_STRING]]),de=function(){a.register("wm-input-email",pe)},ue={widgetType:"wm-input-email",hostClass:"app-input-wrapper"},he=function(e){function t(t){return e.call(this,t,ue)||this}return c(t,e),t}(B);he.initializeProps=de(),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:[a.provideAs(he,i.NG_VALUE_ACCESSOR,!0),a.provideAs(he,i.NG_VALIDATORS,!0),a.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},a.PROP_BOOLEAN)],["autofocus",a.PROP_BOOLEAN],["autotrim",Object.assign({value:!0},a.PROP_BOOLEAN)],["class",a.PROP_STRING],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["hint",a.PROP_STRING],["maxchars",a.PROP_NUMBER],["maxvalue",a.PROP_NUMBER],["minvalue",a.PROP_NUMBER],["name",a.PROP_STRING],["placeholder",Object.assign({value:"Enter text"},a.PROP_STRING)],["readonly",a.PROP_BOOLEAN],["regexp",a.PROP_STRING],["required",a.PROP_BOOLEAN],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["step",a.PROP_NUMBER],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["type",Object.assign({value:"number"},a.PROP_STRING)],["updateon",a.PROP_STRING]]),fe=function(){a.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:[a.provideAs(ve,i.NG_VALUE_ACCESSOR,!0),a.provideAs(ve,i.NG_VALIDATORS,!0),a.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},a.PROP_BOOLEAN)],["autofocus",a.PROP_BOOLEAN],["autotrim",Object.assign({value:!0},a.PROP_BOOLEAN)],["class",a.PROP_STRING],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["displayformat",a.PROP_STRING],["hint",a.PROP_STRING],["maxchars",a.PROP_NUMBER],["name",a.PROP_STRING],["placeholder",Object.assign({value:"Enter text"},a.PROP_STRING)],["readonly",a.PROP_BOOLEAN],["regexp",a.PROP_STRING],["required",a.PROP_BOOLEAN],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["showdisplayformaton",Object.assign({value:"always"},a.PROP_ANY)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["type",Object.assign({value:"text"},a.PROP_STRING)],["updateon",a.PROP_STRING]]),be=function(){a.register("wm-input-text",ye),a.registerFormWidget(r.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(re),t(pe),t(me),a.registerFormWidget(r.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:[a.provideAs(Pe,i.NG_VALUE_ACCESSOR,!0),a.provideAs(Pe,i.NG_VALIDATORS,!0),a.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",a.PROP_BOOLEAN],["autotrim",Object.assign({value:!0},a.PROP_BOOLEAN)],["class",a.PROP_STRING],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["hint",a.PROP_STRING],["maxchars",a.PROP_NUMBER],["name",a.PROP_STRING],["placeholder",Object.assign({value:"Place your text"},a.PROP_STRING)],["readonly",a.PROP_BOOLEAN],["required",a.PROP_BOOLEAN],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["updateon",a.PROP_STRING],["limitdisplaytext",a.PROP_STRING],["charlength",a.PROP_NUMBER]]),Oe=function(){a.register("wm-textarea",_e),a.registerFormWidget(r.FormWidgetType.TEXTAREA,new Map(_e))},Ee={widgetType:"wm-textarea",hostClass:"app-input-wrapper"},Re=function(e){function t(t){var n=e.call(this,t,Ee)||this;return n.charlength=0,n}return c(t,e),t.prototype.onInputChange=function(){this.charlength=this.inputEl.nativeElement.value.length},t}(B);Re.initializeProps=Oe(),Re.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:[a.provideAs(Re,i.NG_VALUE_ACCESSOR,!0),a.provideAs(Re,i.NG_VALIDATORS,!0),a.provideAsWidgetRef(Re)]}]}],Re.ctorParameters=function(){return[{type:t.Injector}]},Re.propDecorators={inputEl:[{type:t.ViewChild,args:["textarea",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel]}]};var Ae=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}();Ae.decorators=[{type:t.Directive,args:[{selector:"[captionPosition]"}]}],Ae.ctorParameters=function(){return[{type:t.Injector},{type:r.App}]};var Te=[m,v,Ae,T,x,L,W,H,Z,te,ae,ce,he,ve,Pe,Re],Se=function(){};Se.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule,a.WmComponentsModule,o.IMaskModule],declarations:d([],p(Te)),exports:d([],p(Te)),entryComponents:[]}]}],e.BaseFormComponent=y,e.BaseFormCustomComponent=w,e.ButtonComponent=m,e.ButtonGroupDirective=v,e.CaptionPositionDirective=Ae,e.CheckboxComponent=T,e.CheckboxsetComponent=x,e.CompositeDirective=L,e.DatasetAwareFormComponent=S,e.InputCalendarComponent=ae,e.InputColorComponent=ce,e.InputEmailComponent=he,e.InputModule=Se,e.InputNumberComponent=ve,e.InputTextComponent=Pe,e.NumberComponent=W,e.NumberLocale=G,e.RadiosetComponent=H,e.SelectComponent=Z,e.SwitchComponent=te,e.TextareaComponent=Re,e["\u02750"]=A,e["\u0275a"]=u,e["\u0275b"]=f,e["\u0275c"]=O,e["\u0275d"]=I,e["\u0275e"]=N,e["\u0275f"]=B,e["\u0275g"]=j,e["\u0275h"]=q,e["\u0275i"]=K,e["\u0275j"]=X,e["\u0275k"]=ie,e["\u0275l"]=se,e["\u0275m"]=de,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
|
|
|
@@ -363,7 +363,7 @@ var c=function(e,t){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Arr
|
|
|
363
363
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
364
364
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
365
365
|
PERFORMANCE OF THIS SOFTWARE.
|
|
366
|
-
***************************************************************************** */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,a=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return r}function c(e,t,n){if(n||2===arguments.length)for(var i,o=0,a=t.length;o<a;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var p=function(){i.register("wm-dialog",new Map([["animation",i.PROP_STRING],["class",i.PROP_STRING],["closable",{value:!0,
|
|
366
|
+
***************************************************************************** */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,a=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return r}function c(e,t,n){if(n||2===arguments.length)for(var i,o=0,a=t.length;o<a;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var p=function(){i.register("wm-dialog",new Map([["animation",i.PROP_STRING],["class",i.PROP_STRING],["closable",Object.assign({value:!0},i.PROP_BOOLEAN)],["iconclass",{value:"wi wi-file-text",PROP_STRING:i.PROP_STRING}],["iconheight",i.PROP_STRING],["iconmargin",i.PROP_STRING],["iconurl",i.PROP_STRING],["iconwidth",i.PROP_STRING],["modal",Object.assign({value:!0},i.PROP_BOOLEAN)],["name",i.PROP_STRING],["showheader",Object.assign({value:!0},i.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},i.PROP_NUMBER)],["title",Object.assign({value:"Information"},i.PROP_STRING)],["eventsource",i.PROP_ANY]]))},d={widgetType:"wm-dialog"},u={},h=function(e){function t(t,n,i,o,a){var s=this;null==i&&(i=!0),null==o&&(o=!0),a[0].closeDialog=function(){return s.close()};var l=!r.toBoolean(i)||"static";return s=e.call(this,t,d,{class:"app-dialog modal-dialog "+(n||""),backdrop:l,keyboard:!!r.toBoolean(o)||!r.toBoolean(i)})||this}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)}(t,e),t.prototype.getTemplateRef=function(){return this.dialogTemplate},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.register(this.viewParent)},t}(o.BaseDialog);h.initializeProps=p(),h.decorators=[{type:t.Component,args:[{selector:"div[wmDialog]",template:'<ng-template #dialogTemplate>\n <div wmDialogHeader [closable]="closable"\n [iconclass]="iconclass"\n [iconurl]="iconurl"\n [iconwidth]="iconwidth"\n [iconheight]="iconheight"\n [iconmargin]="iconmargin"\n [heading]="title"\n *ngIf="showheader"\n [titleid]="titleId"\n ></div>\n <div wmDialogBody>\n <ng-container *ngTemplateOutlet="dialogBody"></ng-container>\n </div>\n <ng-container *ngTemplateOutlet="dialogFooter"></ng-container>\n</ng-template>\n',providers:[i.provideAsWidgetRef(h),i.provideAsDialogRef(h),{provide:i.Context,useValue:u,multi:!0}]}]}],h.ctorParameters=function(){return[{type:t.Injector},{type:String,decorators:[{type:t.Attribute,args:["class"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["modal"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["closable"]}]},{type:Array,decorators:[{type:t.Self},{type:t.Inject,args:[i.Context]}]}]},h.propDecorators={dialogTemplate:[{type:t.ViewChild,args:["dialogTemplate",{static:!0,read:t.TemplateRef}]}],dialogBody:[{type:t.ContentChild,args:["dialogBody",{read:t.TemplateRef}]}],dialogFooter:[{type:t.ContentChild,args:["dialogFooter",{read:t.TemplateRef}]}]};var m=[h],f=function(){};f.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,o.DialogModule,a.InputModule,i.WmComponentsModule],declarations:c([],l(m)),exports:c([],l(m)),entryComponents:[]}]}],e.DesignDialogModule=f,e.DialogComponent=h,e["\u02750"]=u,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("@wm/components/base"),require("@angular/platform-browser"),require("@wm/core")):"function"==typeof define&&define.amd?define("@wm/components/page",["exports","@angular/core","@angular/common","@wm/components/base","@angular/platform-browser","@wm/core"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.page={}),e.ng.core,e.ng.common,e.wm.components.base,e.ng.platformBrowser,e.wm.core)}(this,(function(e,t,n,i,o,a){"use strict";
|
|
367
367
|
/*! *****************************************************************************
|
|
368
368
|
Copyright (c) Microsoft Corporation.
|
|
369
369
|
|
|
@@ -517,7 +517,7 @@ var c=function(e,t){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Arr
|
|
|
517
517
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
518
518
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
519
519
|
PERFORMANCE OF THIS SOFTWARE.
|
|
520
|
-
***************************************************************************** */var f=function(e,t){return(f=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 g(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}f(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function v(e,t,n,i){return new(n||(n=Promise))((function(o,a){function r(e){try{l(i.next(e))}catch(e){a(e)}}function s(e){try{l(i.throw(e))}catch(e){a(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(r,s)}l((i=i.apply(e,t||[])).next())}))}function y(e,t){var n,i,o,a,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],i=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}Object.create;function b(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,a=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return r}function w(e,t,n){if(n||2===arguments.length)for(var i,o=0,a=t.length;o<a;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var P=function(){r.register("wm-table",new Map([["boundarylinks",Object.assign({value:!1},r.PROP_BOOLEAN)],["class",r.PROP_STRING],["confirmdelete",Object.assign({value:"Are you sure you want to delete this?"},r.PROP_STRING)],["datasource",r.PROP_STRING],["dataset",r.PROP_ANY],["deletecanceltext",r.PROP_STRING],["deleteoktext",r.PROP_STRING],["deletemessage",Object.assign({value:"Record deleted successfully"},r.PROP_STRING)],["directionlinks",Object.assign({value:!0},r.PROP_BOOLEAN)],["editmode",r.PROP_STRING],["errorstyle",Object.assign({value:"hover"},r.PROP_STRING)],["enablecolumnselection",Object.assign({value:!1},r.PROP_BOOLEAN)],["enablesort",Object.assign({value:!0},r.PROP_BOOLEAN)],["errormessage",r.PROP_STRING],["exportformat",r.PROP_STRING],["exportdatasize",Object.assign({value:100},r.PROP_NUMBER)],["filtermode",r.PROP_STRING],["filternullrecords",Object.assign({value:!0},r.PROP_BOOLEAN)],["forceellipses",Object.assign({value:!0},r.PROP_BOOLEAN)],["formposition",r.PROP_STRING],["gridclass",Object.assign({value:"table-hover"},r.PROP_STRING)],["gridfirstrowselect",r.PROP_BOOLEAN],["iconclass",r.PROP_STRING],["insertmessage",Object.assign({value:"Record added successfully"},r.PROP_STRING)],["isdynamictable",r.PROP_BOOLEAN],["isrowexpansionenabled",r.PROP_BOOLEAN],["loadingdatamsg",Object.assign({value:"Loading..."},r.PROP_STRING)],["loadingicon",Object.assign({value:"fa fa-circle-o-notch fa-spin"},r.PROP_STRING)],["maxsize",Object.assign({value:5},r.PROP_NUMBER)],["multiselect",r.PROP_BOOLEAN],["name",r.PROP_STRING],["navigation",Object.assign({value:"Basic"},r.PROP_STRING)],["navigationalign",Object.assign({value:"left"},r.PROP_STRING)],["nodatamessage",Object.assign({value:"No data found."},r.PROP_STRING)],["ondemandmessage",Object.assign({value:"Load More"},r.PROP_STRING)],["showviewlessbutton",Object.assign({value:!1},r.PROP_BOOLEAN)],["viewlessmessage",Object.assign({value:"View Less"},r.PROP_STRING)],["pagesize",r.PROP_NUMBER],["radioselect",r.PROP_BOOLEAN],["rowclass",r.PROP_STRING],["rowngclass",r.PROP_STRING],["searchlabel",Object.assign({value:"Search"},r.PROP_STRING)],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["showheader",Object.assign({value:!0},r.PROP_BOOLEAN)],["shownewrow",Object.assign({value:!0},r.PROP_BOOLEAN)],["showrecordcount",r.PROP_BOOLEAN],["showrowindex",r.PROP_BOOLEAN],["spacing",Object.assign({value:"normal"},r.PROP_STRING)],["statehandler",Object.assign({value:"none"},r.PROP_STRING)],["subheading",r.PROP_STRING],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["title",r.PROP_STRING],["updatemessage",Object.assign({value:"Record updated successfully"},r.PROP_STRING)]]))},O={widgetType:"wm-table",hostClass:"app-grid app-panel panel"},E={EXCEL:"fa fa-file-excel-o",CSV:"fa fa-file-text-o"},R="rowOperations",A=function(){},T=function(e){var t=!1;[".dropdown-menu",".uib-typeahead-match",".modal-dialog",".toast"].forEach((function(n){if(e.closest(n).length)return t=!0,!1}));return t||["bsdatepickerdaydecorator"].forEach((function(n){if(e[0].hasAttribute(n))return t=!0,!1})),t},S=function(e){function t(t,n,i,o,a,s,l,c,p,d,f,g,v){var y=e.call(this,t,O)||this;return y.inj=t,y.fb=n,y.app=i,y.dynamicComponentProvider=o,y.statePersistence=a,y.paginationService=s,y.viewport=l,y.parentList=c,y.binddataset=p,y.binddatasource=d,y.readonlygrid=f,y.ngZone=g,y.trustAsPipe=v,y.rowActionsCompiledTl={},y.rowFilterCompliedTl={},y.inlineCompliedTl={},y.inlineNewCompliedTl={},y.customExprCompiledTl={},y.customExprCompiledSummaryTl={},y.rowDefInstances={},y.rowDefMap={},y.rowExpansionActionTl={},y.columns={},y.formfields={},y.enablesort=!0,y.showviewlessbutton=!1,y.primaryKey=[],y.selectedItems=[],y.selectedItemChange=new h.Subject,y.selectedItemChange$=y.selectedItemChange.asObservable(),y.actions=[],y._actions={header:[],footer:[]},y.exportOptions=[],y.headerConfig=[],y.items=[],y.rowActions=[],y.shownavigation=!1,y.documentClickBind=A,y.prevFilterExpression=[],y.fieldDefs=[],y.rowDef={},y.rowInstance={},y.fullFieldDefs=[],y.variableInflight=!0,y.applyProps=new Map,y.redraw=_.debounce(y._redraw,150),y.debouncedHandleLoading=_.debounce(y.handleLoading,350),y.rowFilter={},y._searchSortHandler=A,y.searchSortHandler=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];y._searchSortHandler.apply(y,e)},y.onRowFilterChange=A,y.onFilterConditionSelect=A,y.showClearIcon=A,y.clearRowFilter=A,y.adjustContainer=A,y._pageLoad=!0,y.gridOptions={data:[],colDefs:[],startRowIndex:1,mode:"",sortInfo:{field:"",direction:""},filtermode:"",searchLabel:"",rowActions:[],headerConfig:[],rowClass:"",editmode:"",formPosition:"",isMobile:!1,rowExpansionEnabled:!1,rowDef:{position:"0"},name:"",messages:{selectField:"Select Field"},securityUtils:{pipeTransform:{}},navigation:"",isdynamictable:"",deletedRowIndex:-1,lastActionPerformed:"scroll",isSearchTrigerred:!1,isDatasetUpdated:!1,isDataUpdatedByUser:!1,showviewlessbutton:!1,ondemandmessage:"",viewlessmessage:"",loadingdatamsg:"",isNextPageData:void 0,ACTIONS:{DELETE:"delete",EDIT:"edit",SEARCH_OR_SORT:"search_or_sort",DEFAULT:"scroll",FILTER_CRITERIA:"filter",DATASET_UPDATE:"dataset_update"},actionRowIndex:void 0,actionRowPage:void 0,isLastPage:!1,getCurrentPage:function(){return _.get(y.dataNavigator,"dn.currentPage")||1},setCurrentPage:function(e){_.set(y.dataNavigator,"dn.currentPage",e||1)},getDataSource:function(){return y.datasource},getPageSize:function(){return y.pagesize},getPageCount:function(){return y.dataNavigator.pageCount},enableNavigation:function(){y.dataNavigator.widget.isDisableNext=!1,y.dataNavigator.widget.isDisableLast=!1,y.gridOptions.mode="viewless"},setDeletedRowIndex:function(e){y.setDataGridOption("deletedRowIndex",e)},setLastActionPerformed:function(e){y.setDataGridOption("lastActionPerformed",e||y.gridOptions.lastActionPerformed)},isNavTypeScrollOrOndemand:function(){return"Scroll"===y.gridOptions.navigation||"On-Demand"===y.gridOptions.navigation},setIsSearchTrigerred:function(e){y.setDataGridOption("isSearchTrigerred",e)},setIsDatasetUpdated:function(e){y.setDataGridOption("isDatasetUpdated",e)},setIsNextPageData:function(e){y.setDataGridOption("isNextPageData",e)},setIsDataUpdatedByUser:function(e){y.setDataGridOption("isDataUpdatedByUser",e)},onDataRender:function(){y.ngZone.run((function(){y.gridData.length&&y.invokeEventCallback("datarender",{$data:y.gridData,data:y.gridData}),y.multiselect||(y.items.length=0),y.callDataGridMethod("selectRows",y.items),y.selectedItems=y.callDataGridMethod("getSelectedRows"),y.selectedItems.length&&y.selectedItemChange.next(y.selectedItems),y._isPageSearch&&y.filterInfo&&y.searchSortHandler(y.filterInfo,void 0,"search")}))},onRowSelect:function(e,t){y.ngZone.run((function(){y.selectedItems=y.callDataGridMethod("getSelectedRows"),y.selectedItems.length&&y.selectedItemChange.next(y.selectedItems);var n=y.addRowIndex(e);if(y.selectedItems.length&&n.$index&&"none"!==y.getConfiguredState()&&y.dataNavigator&&r.unsupportedStatePersistenceTypes.indexOf(y.navigation)<0){var i={page:y.dataNavigator.dn.currentPage,index:n.$index-1},o=y.statePersistence.getWidgetState(y);_.get(o,"selectedItem")&&y.multiselect?(_.some(o.selectedItem,i)||o.selectedItem.push(i),y.statePersistence.setWidgetState(y,{selectedItem:o.selectedItem})):y.statePersistence.setWidgetState(y,{selectedItem:[i]})}else console.warn("Retain State handling on Widget "+y.name+" is not supported for current pagination type.");y.invokeEventCallback("rowselect",{$data:n,$event:t,row:n})}))},assignSelectedItems:function(e,t){y.ngZone.run((function(){y.multiselect?-1===_.findIndex(y.items,e)&&y.items.push(e):(y.items.length=0,y.items.push(e))}))},onRowDblClick:function(e,t){var n=y.addRowIndex(e);y.invokeEventCallback("rowdblclick",{$data:n,$event:t,row:n})},onRowDeselect:function(e,t){y.multiselect&&y.ngZone.run((function(){y.items=_.pullAllWith(y.items,[e],_.isEqual),y.selectedItems=y.callDataGridMethod("getSelectedRows"),y.invokeEventCallback("rowdeselect",{$data:e,$event:t,row:e});var n=y.addRowIndex(e);if("none"!==y.getConfiguredState()&&r.unsupportedStatePersistenceTypes.indexOf(y.navigation)<0){var i={page:y.dataNavigator.dn.currentPage,index:n.$index-1},o=y.statePersistence.getWidgetState(y);_.get(o,"selectedItem")&&(_.remove(o.selectedItem,(function(e){return _.isEqual(e,i)})),y.statePersistence.removeWidgetState(y,"selectedItem"),o.selectedItem.length>0&&y.statePersistence.setWidgetState(y,{selectedItem:o.selectedItem}))}else console.warn("Retain State handling on Widget "+y.name+" is not supported for current pagination type.")}))},callOnRowDeselectEvent:function(e,t){y.items=y.selectedItems=y.callDataGridMethod("getSelectedRows"),y.invokeEventCallback("rowdeselect",{$data:e,$event:t,row:e})},callOnRowClickEvent:function(e,t){y.ngZone.run((function(){if(t&&t.hasOwnProperty("originalEvent")){var n=y.addRowIndex(e);y.invokeEventCallback("rowclick",{$data:n,$event:t,row:n})}}))},closePopover:u.closePopover,onColumnSelect:function(e,t){y.selectedColumns=y.callDataGridMethod("getSelectedColumns"),y.invokeEventCallback("columnselect",{$data:e,$event:t})},onColumnDeselect:function(e,t){y.selectedColumns=y.callDataGridMethod("getSelectedColumns"),y.invokeEventCallback("columndeselect",{$data:e,$event:t})},onHeaderClick:function(e,t){y.invokeEventCallback("headerclick",{$event:t,$data:e,column:e})},onRowDelete:function(e,t,n,i,o){y.ngZone.run((function(){y.deleteRecord(_.extend({},o,{row:e,cancelRowDeleteCallback:t,evt:n,callBack:i}))}))},onRowInsert:function(e,t,n,i){y.insertRecord(_.extend({},i,{row:e,event:t,callBack:n}))},beforeRowUpdate:function(e,t){y._liveTableParent&&y._liveTableParent.updateRow(e,t),y.prevData=u.getClonedObject(e)},afterRowUpdate:function(e,t,n,i){y.updateRecord(_.extend({},i,{row:e,prevData:y.prevData,event:t,callBack:n}))},onBeforeRowUpdate:function(e,t,n){return y.invokeEventCallback("beforerowupdate",{$event:t,$data:e,row:e,options:n})},onBeforeRowInsert:function(e,t,n){return y.invokeEventCallback("beforerowinsert",{$event:t,$data:e,row:e,options:n})},onBeforeRowDelete:function(e,t,n){var i=y.addRowIndex(e);return y.invokeEventCallback("beforerowdelete",{$event:t,row:i,options:n})},onFormRender:function(e,t,n,i){var o=i?"inlineInstanceNew":"inlineInstance";setTimeout((function(){y.formWidgets={},y.fieldDefs.forEach((function(e){e[o]&&(y.formWidgets[e.field]=e[o],e[o].context&&(e[o].context.formWidgets=y.formWidgets),y.setDisabledOnField(n,e,o))})),y.invokeEventCallback("formrender",{$event:t,formWidgets:y.formWidgets,$operation:n})}),250)},onBeforeFormRender:function(e,t,n){return y.invokeEventCallback("beforeformrender",{$event:t,row:e,$operation:n})},registerRowNgClassWatcher:function(e,t){if(y.rowngclass){var n=y.getClonedRowObject(e),i=y.widgetId+"_rowNgClass_"+t;u.$unwatch(i),y.registerDestroyListener(u.$watch(y.rowngclass,y.viewParent,{row:n},(function(e,n){y.callDataGridMethod("applyRowNgClass",r.getConditionalClasses(e,n),t)}),i))}},registerColNgClassWatcher:function(e,t,n,i){if(t["col-ng-class"]){var o=y.getClonedRowObject(e),a=y.widgetId+"_colNgClass_"+n+"_"+i;u.$unwatch(a),y.registerDestroyListener(u.$watch(t["col-ng-class"],y.viewParent,{row:o},(function(e,t){y.callDataGridMethod("applyColNgClass",r.getConditionalClasses(e,t),n,i)}),a))}},clearCustomExpression:function(){y.customExprViewRef.clear(),y.customExprCompiledTl={},y.customExprCompiledSummaryTl={}},clearRowDetailExpression:function(){y.rowDetailViewRef.clear(),y.rowDefMap={},y.rowDefInstances={}},generateCustomExpressions:function(e,t,n){var i=y.getClonedRowObject(e),o=function(e){if(e){var o={},a={row:i,colDef:o};y.addEventsToContext(a);var r=y.customExprViewRef.createEmbeddedView(e,a).rootNodes[0],s=r.getAttribute("data-col-identifier");_.extend(o,y.columns[s]),n?y.customExprCompiledSummaryTl[s+t]=r:y.customExprCompiledTl[s+t]=r}};y.isdynamictable?y.fieldDefs.forEach((function(e){o(e.customExprTmpl)})):y.customExprTmpl.forEach(o.bind(y))},generateRowExpansionCell:function(e,t){var n=y.getClonedRowObject(e);y.rowExpansionActionTmpl.forEach((function(e){y.rowExpansionActionTl[t]=y.rowExpansionActionViewRef.createEmbeddedView(e,{row:n}).rootNodes}))},getRowExpansionAction:function(e){return y.rowExpansionActionTl[e]},generateRowDetailView:function(e,t,n,i,o,a){var r=y.getClonedRowObject(t),s=u.getClonedObject(y.rowDef);if(!1!==y.rowInstance.invokeEventCallback("beforerowexpand",{$event:e,$data:s,row:r})&&s.content)if(a(),y.rowDefMap[n]&&y.rowDefMap[n].content===s.content)y.rowInstance.invokeEventCallback("rowexpand",{$event:e,row:r,$data:y.rowDefInstances[n]});else{y.rowDefMap[n]=s,i.empty(),i.hide(),o.show();var l={row:r,rowDef:s,containerLoad:function(t){setTimeout((function(){o.hide(),i.show(),y.rowDefInstances[n]=t,y.rowInstance.invokeEventCallback("rowexpand",{$event:e,row:r,$data:t})}),500)}},c=y.rowDetailViewRef.createEmbeddedView(y.rowExpansionTmpl,l).rootNodes[0];i[0].appendChild(c),u.$appDigest()}},onBeforeRowCollapse:function(e,t,n){return y.rowInstance.invokeEventCallback("beforerowcollapse",{$event:e,row:t,$data:y.rowDefInstances[n]})},onRowCollapse:function(e,t){y.rowInstance.invokeEventCallback("rowcollapse",{$event:e,row:t})},getCustomExpression:function(e,t,n){return(n?y.customExprCompiledSummaryTl[e+t]:y.customExprCompiledTl[e+t])||""},clearRowActions:function(){y.rowActionsViewRef.clear(),y.rowActionsCompiledTl={},y.rowExpansionActionViewRef.clear(),y.rowExpansionActionTl={}},generateRowActions:function(e,t){var n=y.getClonedRowObject(e);y.rowActionsCompiledTl[t]=[],y.rowActionTmpl.forEach((function(e){var i;(i=y.rowActionsCompiledTl[t]).push.apply(i,w([],b(y.rowActionsViewRef.createEmbeddedView(e,{row:n}).rootNodes)))}))},getRowAction:function(e){return y.rowActionsCompiledTl[e]},generateInlineEditRow:function(e,t){var n=y.getClonedRowObject(e);if(t)return y.inlineEditNewViewRef.clear(),y.inlineNewCompliedTl={},y.inlineWidgetNewTmpl.forEach((function(e){var t,i={row:n,getControl:function(){return y.ngform.controls[t+"_new"]||{}},getValidationMessage:function(){return y.columns[t]&&y.columns[t].validationmessage},getPendingSpinnerStatusNew:function(){return y.columns[t]&&y.columns[t].showPendingSpinnerNew}},o=y.inlineEditNewViewRef.createEmbeddedView(e,i).rootNodes[0];t=o.getAttribute("data-col-identifier"),y.inlineNewCompliedTl[t]=o})),void y.clearForm(!0);y.inlineEditViewRef.clear(),y.inlineCompliedTl={},y.clearForm(),y.inlineWidgetTmpl.forEach((function(e){var t,i={row:n,getControl:function(){return y.ngform.controls[t]||{}},getValidationMessage:function(){return y.columns[t]&&y.columns[t].validationmessage},getPendingSpinnerStatus:function(){return y.columns[t]&&y.columns[t].showPendingSpinner}},o=y.inlineEditViewRef.createEmbeddedView(e,i).rootNodes[0];t=o.getAttribute("data-col-identifier"),y.inlineCompliedTl[t]=o}))},getInlineEditWidget:function(e,t,n){return n?(y.gridOptions.setFieldValue(e+"_new",t),y.inlineNewCompliedTl[e]):(y.gridOptions.setFieldValue(e,t),y.inlineCompliedTl[e])},setFieldValue:function(e,t){var n=y.ngform.controls&&y.ngform.controls[e];n&&n.setValue(t)},getFieldValue:function(e){var t=y.ngform.controls&&y.ngform.controls[e];return t&&t.value},addLoadMoreBtn:function(){y.callDataGridMethod("addLoadMoreBtn",y.ondemandmessage,y.loadingdatamsg,(function(e){y.gridOptions.setIsNextPageData(!0),y.gridOptions.setIsDataUpdatedByUser(!1),"viewless"===y.gridOptions.mode?(y.dataNavigator.navigatePage("first",e,!0),y.gridOptions.mode=""):(y.dataNavigator.navigatePage("next",e),y.isDataLoading=!0)}),y.infScroll)},bindScrollEvt:function(){y._gridData&&y._gridData.length&&y.infScroll&&setTimeout((function(){y.paginationService.bindScrollEvt(y,"tbody",r.DEBOUNCE_TIMES.PAGINATION_DEBOUNCE_TIME)}),0)},generateFilterRow:function(){y.filterViewRef.clear(),y.rowFilterCompliedTl={},y.filterTmpl.forEach((function(e){var t=y.filterViewRef.createEmbeddedView(e,{changeFn:y.onRowFilterChange.bind(y),isDisabled:function(e){return y.emptyMatchModes.indexOf(y.rowFilter[e]&&y.rowFilter[e].matchMode)>-1}}).rootNodes[0];y.rowFilterCompliedTl[t.getAttribute("data-col-identifier")]=t}))},getFilterWidget:function(e){return y.rowFilterCompliedTl[e]},setGridEditMode:function(e){y.ngZone.run((function(){y.isGridEditMode=e,u.$appDigest()}))},setGridState:function(e){y.isLoading="loading"===e},setActionRowIndex:function(e){y.gridOptions.isNavTypeScrollOrOndemand()&&(y.actionRowIndex=parseInt(e),y.setDataGridOption("actionRowIndex",y.actionRowIndex),_.isNaN(y.actionRowIndex)||(y.actionRowPage=Math.floor(y.actionRowIndex/y.pagesize)+1,y.setDataGridOption("actionRowPage",y.actionRowPage||y.gridOptions.actionRowPage)))},clearActionRowIndex:function(){y.isRowDeleted||!y.infScroll&&!y.onDemandLoad||y.clearActionRowVars()},noChangesDetected:function(){y.toggleMessage(!0,"info","No Changes Detected","")},redrawWidgets:function(){y.fieldDefs.forEach((function(e){u.triggerFn(e.inlineInstance&&e.inlineInstance.redraw),u.triggerFn(e.inlineInstanceNew&&e.inlineInstanceNew.redraw),u.triggerFn(e.filterInstance&&e.filterInstance.redraw)}))},searchHandler:y.searchSortHandler.bind(y),sortHandler:y.searchSortHandler.bind(y),timeoutCall:function(e,t){setTimeout(e,t)},runInNgZone:function(e){y.ngZone.run(e)},safeApply:function(){u.$appDigest()},setTouched:function(e){var t=y.ngform.controls[e];t&&t.markAsTouched()},clearForm:y.clearForm.bind(y),callLoadInlineWidgetData:function(){y.fullFieldDefs.forEach((function(e){_.isUndefined(e.isDataSetBound)&&u.triggerFn(e.loadInlineWidgetData&&e.loadInlineWidgetData.bind(e))}))},applyValidations:function(e,t){t?u.triggerFn(e.applyNewRowValidations&&e.applyNewRowValidations.bind(e)):u.triggerFn(e.applyValidations&&e.applyValidations.bind(e))},removeValidations:function(e){y.fullFieldDefs.forEach((function(t){t.readonly||"rowOperations"===t.binding||(e?u.triggerFn(t.removeNewRowValidations&&t.removeNewRowValidations.bind(t)):u.triggerFn(t.removeValidations&&t.removeValidations.bind(t)))}))}},y._selectedItemsExist=!1,y._onChange=function(){},y._onTouched=function(){},r.styler(y.nativeElement,y),y.ngform=n.group({}),y.addEventsToContext(y.context),[y.app.subscribe("check-state-persistence-options",(function(e){var t=_.get(y.datasource,"name");if(t||(t=r.extractDataSourceName(y.binddatasource)),_.get(e,"variable.name")===t&&y._pageLoad&&"none"!==y.getConfiguredState()){y._pageLoad=!1;var n=y.statePersistence.getWidgetState(y);n?e=y.handleStateParams(n,e):y.setDataGridOption("selectFirstRow",y.gridfirstrowselect)}})),y.app.subscribe("toggle-variable-state",(function(e){if(y.datasource&&y.datasource.execute(u.DataSource.Operation.IS_API_AWARE)&&u.isDataSourceEqual(e.variable,y.datasource)){if(y._pageLoad&&"none"!==y.getConfiguredState()){y._pageLoad=!1;var t=y.statePersistence.getWidgetState(y);t?e=y.handleStateParams(t,e):y.setDataGridOption("selectFirstRow",y.gridfirstrowselect)}u.isDefined(y.variableInflight)?y.debouncedHandleLoading(e):y.handleLoading(e)}})),y.app.subscribe("setup-cud-listener",(function(e){y.name===e&&(y._isDependent=!0,y.selectedItemChange$.pipe(m.debounceTime(250)).subscribe(y.triggerWMEvent.bind(y)))}))].forEach((function(e){return y.registerDestroyListener(e)})),y.deleteoktext=y.appLocale.LABEL_OK,y.deletecanceltext=y.appLocale.LABEL_CANCEL,y}return g(t,e),Object.defineProperty(t.prototype,"gridData",{get:function(){return this._gridData||[]},set:function(e){var t;if(this.isDataLoading=!1,!this.variableInflight||!_.isEmpty(e)){if(this.variableInflight=!1,e&&0===e.length?this.callDataGridMethod("setStatus","nodata",this.nodatamessage):this.callDataGridMethod("setStatus","ready"),this.gridOptions.isNavTypeScrollOrOndemand()){if(t=b(this.paginationService.updateFieldsOnPagination(this,e),2),this._gridData=t[0],this.currentPage=t[1],this.gridOptions.lastActionPerformed===this.gridOptions.ACTIONS.EDIT){var n=_.floor(this.actionRowIndex%this.pagesize);this._gridData.splice(this.actionRowIndex,1,e[n])}this.setDataGridOption("isLastPage",!!this.dataNavigator.isDisableNext),this.$element.find(".on-demand-datagrid").length||this.dataNavigator.isDisableNext||!this.onDemandLoad?this._gridData&&this._gridData.length&&(this.dataNavigator.isDisableNext||!this.isDataLoading)&&this.callDataGridMethod("hideLoadingIndicator",this.dataNavigator.isDisableNext,this.infScroll):this.gridOptions.addLoadMoreBtn()}else this._gridData=e;var i,o=0;if(this._onChange(this._gridData),this._onTouched(),u.isDefined(e)){if(this.gridOptions.bindScrollEvt(),this.isNavigationEnabled()&&this.dataNavigator.dn.currentPage&&(o=(this.dataNavigator.dn.currentPage-1)*(this.dataNavigator.maxResults||1)+1,this.setDataGridOption("startRowIndex",o)),!(i=this.callDataGridMethod("getOptions")))return;!i.colDefs.length&&this.fieldDefs.length&&this.setDataGridOption("colDefs",u.getClonedObject(this.fieldDefs)),this.isdynamictable||_.isEmpty(e)||!i.colDefs.length||this.invokeEventCallback("beforedatarender",{$data:this._gridData,$columns:this.columns,data:this._gridData,columns:this.columns}),this.setDataGridOption("data",u.getClonedObject(this._gridData))}}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selecteditem",{get:function(){return this.multiselect?u.getClonedObject(this.items):_.isEmpty(this.items)?{}:u.getClonedObject(this.items[0])},set:function(e){this.items.length=0,this.callDataGridMethod("selectRows",e)},enumerable:!1,configurable:!0}),t.prototype.onKeyPress=function(e){13===e.which&&this.invokeEventCallback("enterkeypress",{$event:e,$data:this.gridData})},t.prototype.ngAfterContentInit=function(){var t=this;e.prototype.ngAfterContentInit.call(this),this.headerConfig=this.headerConfig.filter(this.filterEmptyValues.bind(this)),_.remove(this.fieldDefs,(function(e){return void 0===e}));this._liveTableParent&&(this.isPartOfLiveGrid=!0),!this.readonlygrid&&this.editmode||("true"===this.readonlygrid?this.editmode="":this.isPartOfLiveGrid?this.editmode="inline"===this.isPartOfLiveGrid.formlayout?r.EDIT_MODE.FORM:r.EDIT_MODE.DIALOG:this.editmode=this.readonlygrid?r.EDIT_MODE.INLINE:""),this.gridOptions.colDefs=this.fullFieldDefs,this.gridOptions.rowActions=this.rowActions,this.gridOptions.headerConfig=this.headerConfig,this.gridOptions.rowClass=this.rowclass,this.gridOptions.editmode=this.editmode,this.gridOptions.formPosition=this.formposition,this.gridOptions.filtermode=this.filtermode,this.gridOptions.searchLabel=this.searchlabel,this.gridOptions.isMobile=u.isMobile(),this.gridOptions.name=this.name,this.gridOptions.securityUtils.pipeTransform=this.trustAsPipe,this.gridOptions.navigation=this.navigation,this.gridOptions.isdynamictable=this.isdynamictable,this.gridOptions.showviewlessbutton=this.showviewlessbutton,this.gridOptions.ondemandmessage=this.ondemandmessage,this.gridOptions.viewlessmessage=this.viewlessmessage,this.gridOptions.loadingdatamsg=this.loadingdatamsg,_.isEmpty(this.gridData)||(this.gridOptions.data=u.getClonedObject(this.gridData)),this.gridOptions.messages={selectField:this.appLocale.MESSAGE_SELECT_FIELD},this.datagridElement=$(this._tableElement.nativeElement),this.gridElement=this.$element,this.$element.css({position:"relative"}),_.forEach({showrowindex:"showRowIndex",multiselect:"multiselect",radioselect:"showRadioColumn",filternullrecords:"filterNullRecords",enablesort:"enableSort",showheader:"showHeader",enablecolumnselection:"enableColumnSelection",shownewrow:"showNewRow",gridfirstrowselect:"selectFirstRow"},(function(e,n){u.isDefined(t[n])&&(t.gridOptions[e]="true"===t[n]||!0===t[n])})),"none"!==this.statehandler&&(this.gridOptions.selectFirstRow=!1),this.renderOperationColumns(),this.gridOptions.colDefs=this.fieldDefs,this.datagridElement.datatable(this.gridOptions),this.callDataGridMethod("setStatus","loading",this.loadingdatamsg),this.applyProps.forEach((function(e){return t.callDataGridMethod.apply(t,w([],b(e)))})),this.editmode===r.EDIT_MODE.QUICK_EDIT&&(this.documentClickBind=this._documentClickBind.bind(this),document.addEventListener("click",this.documentClickBind))},t.prototype.getConfiguredState=function(){var e=this.statePersistence.computeMode(this.statehandler);return e&&e.toLowerCase()},t.prototype.handleStateParams=function(e,t){var n=this;return _.get(e,"selectedItem")&&(this._selectedItemsExist=!0),t.options=t.options||{},_.get(e,"pagination")?(t.options.page=e.pagination,_.get(e,"sort")&&(this.sortStateHandler(e),t.options.orderBy=_.get(e,"sort.field")+" "+_.get(e,"sort.direction")),_.get(e,"search")&&(setTimeout((function(){n.searchStateHandler(e)}),500),t.options.filterFields=this.getFilterFields(e.search))):(t.options.page=1,_.get(e,"search")&&(setTimeout((function(){n.searchStateHandler(e)}),500),t.options.filterFields=this.getFilterFields(e.search)),_.get(e,"sort")&&(this.sortStateHandler(e),t.options.orderBy=_.get(e,"sort.field")+" "+_.get(e,"sort.direction"))),t},t.prototype.triggerWMEvent=function(e){"dialog"!==this.editmode&&(u.$invokeWatchers(!0),this.app.notify("wm-event",{eventName:"selectedItemChange",widgetName:this.name,row:e,table:this}))},t.prototype.sortStateHandler=function(e){var t=this.datagridElement.find('th[data-col-field="'+_.get(e,"sort.field")+'"] .sort-icon');"asc"===_.get(e,"sort.direction")&&t.length?t.addClass("asc wi wi-long-arrow-up"):"desc"===_.get(e,"sort.direction")&&t.length&&t.addClass("desc wi wi-long-arrow-down")},t.prototype.searchStateHandler=function(e){var t=this;if(_.isArray(e.search))_.forEach(e.search,(function(e){if(t.rowFilter[e.field]&&(t.rowFilter[e.field].value=e.value,t.rowFilter[e.field].matchMode=e.matchMode,t.rowFilter[e.field].type=e.type,$(t.rowFilterCompliedTl[e.field]).length)){"integer"===e.type?parseInt(e.value):e.value;$(t.rowFilterCompliedTl[e.field]).find("input").val(e.value)}}));else{var n=this.datagridElement;n.find('[data-element="dgSearchText"]').val(e.search.value),n.find('[data-element="dgFilterValue"]').val(e.search.field)}},t.prototype.filterEmptyValues=function(e){return e.columns&&(e.columns=e.columns.filter(this.filterEmptyValues.bind(this))),void 0!==e},t.prototype.compareFilterExpressions=function(e,t){return!(e.length!==t.length||!_.isEqual(e,t))},t.prototype.setLastActionToFilterCriteria=function(){this.prevFilterExpression=_.get(this.datasource,"filterExpressions.rules")?u.getClonedObject(this.datasource.filterExpressions.rules):u.getClonedObject([].concat(this.datasource.dataBinding)),this.gridOptions.setLastActionPerformed(this.gridOptions.ACTIONS.FILTER_CRITERIA),this.gridOptions.setIsSearchTrigerred(!0)},t.prototype.setLastActionToDatasetUpdate=function(){this.gridOptions.setLastActionPerformed(this.gridOptions.ACTIONS.DATASET_UPDATE),this.gridOptions.setCurrentPage(1),this.gridOptions.setIsDatasetUpdated(!0)},t.prototype.checkIfVarFiltersApplied=function(){if(!_.isEmpty(_.get(this.datasource,"filterExpressions.rules"))||!_.isEmpty(_.get(this.datasource,"dataBinding"))){var e=_.get(this.datasource,"filterExpressions.rules")?this.datasource.filterExpressions.rules:[].concat(this.datasource.dataBinding);this.compareFilterExpressions(this.prevFilterExpression,e)||this.setLastActionToFilterCriteria()}},t.prototype.watchVariableDataSet=function(e){var t;if(this.gridOptions.isNavTypeScrollOrOndemand()&&this.checkIfVarFiltersApplied(),"wm.Variable"===_.get(this.datasource,"category")&&this._pageLoad&&"none"!==this.getConfiguredState()){var n=this.statePersistence.getWidgetState(this);this._pageLoad=!1,_.get(n,"selectedItem")?this._selectedItemsExist=!0:this.setDataGridOption("selectFirstRow",this.gridfirstrowselect),_.get(n,"search")&&(this.searchStateHandler(n),this.searchSortHandler(n.search,void 0,"search",!0)),_.get(n,"sort")&&(this.searchSortHandler(n.sort,void 0,"sort",!0),this.sortStateHandler(n)),_.get(n,"pagination")&&this.dataNavigator.pageChanged({page:n.pagination},!0)}if(!(this.dataNavigatorWatched&&_.isUndefined(e)&&this.__fullData)){this.variableInflight&&!this.infScroll&&this.callDataGridMethod("setStatus","loading",this.loadingdatamsg),(t=u.getValidJSON(e))&&(e=t);var i=this.getSortExpr(),o=i.split(" ");if(i&&o.length&&(this.sortInfo={direction:o[1],field:o[0]}),this.isDataValid()){if(e){if(this.shownavigation&&!this.dataNavigatorWatched)return void this.enablePageNavigation()}else this.resetPageNavigation(),this.variableInflight||this.callDataGridMethod("setStatus","nodata",this.nodatamessage),this.setDataGridOption("selectFirstRow",this.gridfirstrowselect);!this.isNavigationEnabled()&&e&&this.checkFiltersApplied(this.getSortExpr()),!_.isObject(e)||""===e||e&&""===e.dataValue?this.variableInflight||this.setGridData([]):e&&this.populateGridData(e)}}},t.prototype.ngOnDestroy=function(){document.removeEventListener("click",this.documentClickBind),this.navigatorResultWatch&&this.navigatorResultWatch.unsubscribe(),this.navigatorMaxResultWatch&&this.navigatorMaxResultWatch.unsubscribe(),e.prototype.ngOnDestroy.call(this)},t.prototype.addRowIndex=function(e){var t=u.getClonedObject(e),n=_.indexOf(this.gridOptions.data,e);return n<0?e:(t.$index=n+1,t.$isFirst=1===t.$index,t.$isLast=this.gridData.length===t.$index,t)},t.prototype.addEventsToContext=function(e){var t=this;e.addNewRow=function(){return t.addNewRow()},e.deleteRow=function(){return t.deleteRow()},e.editRow=function(){return t.editRow()}},t.prototype.execute=function(e,t){return![u.DataSource.Operation.IS_API_AWARE,u.DataSource.Operation.IS_PAGEABLE,u.DataSource.Operation.SUPPORTS_SERVER_FILTER].includes(e)&&(this.datasource?this.datasource.execute(e,t):{})},t.prototype.isNavigationEnabled=function(){return this.shownavigation&&this.dataNavigator&&this.dataNavigatorWatched},t.prototype.getClonedRowObject=function(e){var t=u.getClonedObject(e);return t.getProperty=function(e){return _.get(t,e)},t.$isFirst=1===t.$index,t.$isLast=this.gridData.length===t.$index,delete t.$$index,delete t.$$pk,t},t.prototype.handleLoading=function(e){this.variableInflight=e.active,e.active?this.callDataGridMethod("setStatus","loading",this.loadingdatamsg):!this.isGridEditMode&&_.isEmpty(this.dataset)?this.callDataGridMethod("setStatus","nodata",this.nodatamessage):this.callDataGridMethod("setStatus","ready")},t.prototype.setDisabledOnField=function(e,t,n){"new"===e||!t["primary-key"]||"assigned"!==t.generator||t["related-entity-name"]||t.period||(t[n].disabled=!0)},t.prototype.resetFormControl=function(e){e.markAsUntouched(),e.markAsPristine()},t.prototype.clearForm=function(e){var t=this,n=this.ngform.controls;_.keys(this.ngform.controls).forEach((function(i){!i.endsWith("_filter")&&(i.endsWith("_new")&&e||!i.endsWith("_new")&&!e)&&(n[i].setValue(""),t.resetFormControl(n[i]))}))},t.prototype.showFieldBasedOnScreenType=function(e){return u.isMobile()&&this.viewport.isMobileType?e.mobileDisplay:this.viewport.isTabletType?e.tabletDisplay:e.pcDisplay},t.prototype.isEmptyRecord=function(e){var t,n=this;return Object.keys(e).every((function(i,o){return t=e[i],!(n.fieldDefs.length&&u.isDefined(n.fieldDefs[o])&&n.showFieldBasedOnScreenType(n.fieldDefs[o])||!0)||(null==t||""===t)}))},t.prototype.removeEmptyRecords=function(e){var t=this,n=e,i=[];return n&&n.length&&(i=n.filter((function(e){return e&&!t.isEmptyRecord(e)}))),i},t.prototype.setGridData=function(e){var t=this.filternullrecords?this.removeEmptyRecords(e):e;"wm.Variable"===_.get(this.datasource,"category")&&(this.variableInflight=!1),this.variableInflight||(t&&0===t.length?this.callDataGridMethod("setStatus","nodata",this.nodatamessage):this.callDataGridMethod("setStatus","ready")),this.gridData=t},t.prototype.setDataGridOption=function(e,t,n){if(void 0===n&&(n=!1),this.datagridElement&&this.datagridElement.datatable&&this.datagridElement.datatable("instance")){var i={};!u.isDefined||_.isEqual(t,this.gridOptions[e])&&!n||(i[e]=t,this.datagridElement.datatable("option",i),this.gridOptions[e]=t)}},t.prototype.callDataGridMethod=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(this.datagridElement&&this.datagridElement.datatable("instance"))return this.datagridElement.datatable.apply(this.datagridElement,e);this.applyProps.set(e[1],e)},t.prototype.renderOperationColumns=function(){var e,t,n=r.getRowOperationsColumn(),i={name:n.field,field:n.field,isPredefined:!0};this.fieldDefs.length&&(e=_.find(this.fullFieldDefs,{field:R,type:"custom"}),_.remove(this.fieldDefs,{type:"custom",field:R}),_.remove(this.headerConfig,{field:n.field}),this.rowActions.length&&(e?(t=e.rowactionsposition?_.toNumber(e.rowactionsposition):this.fieldDefs.length,this.fieldDefs.splice(t,0,e),0===t?this.headerConfig.unshift(i):this.headerConfig.push(i)):(this.fieldDefs.push(n),this.headerConfig.push(i))),this.setDataGridOption("headerConfig",this.headerConfig))},t.prototype.enablePageNavigation=function(){var e=this;this.dataset&&this.binddataset&&this.dataNavigator&&(this.dataNavigatorWatched=!0,this.navigatorResultWatch&&this.navigatorResultWatch.unsubscribe(),this.navigatorResultWatch=this.dataNavigator.resultEmitter.subscribe((function(t){u.isDefined(t)?_.isEqual(e.dataset,t)?e.watchVariableDataSet(t):_.isArray(t)?e.widget.dataset=[].concat(t):_.isObject(t)?e.widget.dataset=_.extend({},t):e.widget.dataset=t:e.widget.dataset=void 0}),!0),this.navigatorMaxResultWatch&&this.navigatorMaxResultWatch.unsubscribe(),this.navigatorMaxResultWatch=this.dataNavigator.maxResultsEmitter.subscribe((function(t){e.pagesize=t})),this.__fullData=this.dataset,this.dataNavigator.widget.maxResults=this.pagesize||5,this.dataNavigator.options={maxResults:this.pagesize||5},this.removePropertyBinding("dataset"),this.dataNavigator.setBindDataSet(this.binddataset,this.viewParent,this.datasource,this.dataset,this.binddatasource,void 0,this.statehandler))},t.prototype.resetPageNavigation=function(){this.dataNavigator&&this.dataNavigator.resetPageNavigation()},t.prototype.isDataValid=function(){var e,t=this.dataset||{};return t.error&&(e=t.error),t.data&&t.data.error&&t.data.errorMessage&&(e=t.data.errorMessage),!e||(this.setGridData([]),this.callDataGridMethod("setStatus","error",e),!1)},t.prototype.populateGridData=function(e){var t,n=this;if(e=r.transformData(e,this.name),!this.isNavigationEnabled()&&this._isClientSearch?(t=u.getClonedObject(e),t=this.getSearchResult(t,this.filterInfo),t=this.getSortResult(t,this.sortInfo),this.serverData=t):this.serverData=e,this.isdynamictable?this.createGridColumns(this.serverData):this.setGridData(this.serverData),"none"!==this.getConfiguredState()&&this._selectedItemsExist&&e.length){var i=this.statePersistence.getWidgetState(this),o=void 0;_.get(i,"selectedItem")&&(o=i.selectedItem.filter((function(e){return e.page===n.dataNavigator.dn.currentPage})),this._selectedItemsExist=!1,o.length&&this.selecteditem.length!==i.selectedItem.length&&(_.isArray(this.selecteditem)?o.forEach((function(e){n.selectItem(e.index,void 0)})):this.selecteditem=o.map((function(e){return e.index}))))}},t.prototype.generateDynamicColumns=function(e){return v(this,void 0,void 0,(function(){var t,n,i,o=this;return y(this,(function(a){switch(a.label){case 0:return this.fieldDefs=[],this.filterTmpl._results=[],_.isEmpty(e)?[2]:(t="",e.forEach((function(e){var n="",i="";_.forEach(e,(function(e,t){_.isUndefined(e)||""===e||("customExpression"===t?i=e:n+=" "+t+'="'+e+'"')})),t+="<wm-table-column "+n+' tableName="'+o.name+o.$attrs.get("table_reference")+'">'+i+"</wm-table-column>"})),this.dynamicTableRef.clear(),this._dynamicContext||(this._dynamicContext=Object.create(this.viewParent),this._dynamicContext[this.getAttr("wmTable")]=this),this.noOfColumns=e.length,[4,this.dynamicComponentProvider.getComponentFactoryRef("app-table-dynamic-"+this.widgetId,t,{noCache:!0,transpile:!0})]);case 1:return n=a.sent(),i=this.dynamicTableRef.createComponent(n,0,this.inj),u.extendProto(i.instance,this._dynamicContext),this.$element.find(".dynamic-table-container")[0].appendChild(i.location.nativeElement),[2]}}))}))},t.prototype.prepareColDefs=function(e){var t,n,i=this,o=0,a=0;this.fieldDefs=[],this.headerConfig=[],this.columns={},n=e,t=r.prepareFieldDefs(n),_.forEach(t,(function(e){e.binding=e.field,e.caption=e.displayName,e.pcDisplay=!0,e.mobileDisplay=!0,e.tabletDisplay=!0,e.searchable=!0,e.showinfilter=!0,e.type="string",e.index=o,e.headerIndex=a,o++,a++})),t.forEach((function(e){i.columns[e.field]=e})),this.invokeEventCallback("beforedatarender",{$data:e,$columns:this.columns,data:e,columns:this.columns}),t=[],_.forEach(this.columns,(function(e){t.push(e)})),this.generateDynamicColumns(t)},t.prototype.createGridColumns=function(e){var t=e&&!e.error;t&&!_.isArray(e)&&(e=[e]),_.isEmpty(e)?this.setGridData(e):t&&(this.prepareColDefs(e),this.serverData=e,this.setGridData(this.serverData))},t.prototype.getSortExpr=function(){var e,t;return this.datasource&&this.datasource.execute(u.DataSource.Operation.IS_PAGEABLE)&&(t=this.datasource.execute(u.DataSource.Operation.GET_PAGING_OPTIONS),e=_.isEmpty(t)?"":r.getOrderByExpr(t.sort)),e||""},t.prototype.onPropertyChange=function(t,n,i){var o,a=this;switch(t){case"datasource":!1===n.startUpdate&&(this.variableInflight=!1,this.callDataGridMethod("setStatus","nodata",this.nodatamessage)),this.watchVariableDataSet(this.dataset),this.onDataSourceChange();break;case"dataset":if(this.gridOptions.isNavTypeScrollOrOndemand()&&1===this.gridOptions.getCurrentPage()&&this.gridOptions.setIsNextPageData(!1),this.binddatasource&&!this.datasource)return;this.parentList&&!this.datasource&&_.startsWith(this.binddataset,"item")&&(this.datasource=u.getDatasourceFromExpr(this.widget.$attrs.get("datasetboundexpr"),this)),this.gridOptions.isNavTypeScrollOrOndemand()&&(this.gridOptions.isNextPageData?this.gridOptions.setIsDataUpdatedByUser(!1):(this.gridOptions.setIsDataUpdatedByUser(!0),this.setLastActionToDatasetUpdate(),this.gridOptions.setIsNextPageData(!1))),"wm.Variable"===_.get(this.datasource,"category")&&this._pageLoad&&"none"!==this.getConfiguredState()||this.watchVariableDataSet(n);break;case"filtermode":this.setDataGridOption("filtermode",n);break;case"searchlabel":this.setDataGridOption("searchLabel",n);break;case"navigation":if("Advanced"===n)return void(this.navigation="Classic");"None"!==n&&(this.shownavigation=!0),this.setDataGridOption("navigation",this.navigation),this.onDemandLoad=n===r.NAVIGATION_TYPE.ONDEMAND,this.infScroll=n===r.NAVIGATION_TYPE.SCROLL,this.navControls=n;break;case"gridfirstrowselect":this.setDataGridOption("selectFirstRow",n);break;case"gridclass":this.callDataGridMethod("option","cssClassNames.grid",n);break;case"nodatamessage":this.callDataGridMethod("option","dataStates.nodata",n);break;case"loadingdatamsg":this.callDataGridMethod("option","dataStates.loading",n);break;case"loadingicon":this.callDataGridMethod("option","loadingicon",n);break;case"spacing":this.callDataGridMethod("option","spacing",n),this.navigationSize="condensed"===n?"small":"";break;case"exportformat":this.exportOptions=[],n&&_.forEach(_.split(n,","),(function(e){a.exportOptions.push({label:e,icon:E[e]})}));break;case"shownewrow":o=n||_.some(this.actions,(function(e){return _.includes(e.action,"addNewRow()")})),this.callDataGridMethod("option","actionsEnabled.new",o);break;case"pagesize":this.dataNavigator.options={maxResults:n},this.dataNavigator.widget.maxResults=n,this.dataNavigator.maxResults=n;break;case"ondemandmessage":n&&this.$element.find(".on-demand-datagrid > a").text(n),this.gridOptions.ondemandmessage=n;break;case"viewlessmessage":this.gridOptions.viewlessmessage=n;break;case"show":n?this.invokeEventCallback("show"):this.invokeEventCallback("hide");default:e.prototype.onPropertyChange.call(this,t,n,i)}},t.prototype.onDataSourceChange=function(){this.fieldDefs.forEach((function(e){u.triggerFn(e.onDataSourceChange&&e.onDataSourceChange.bind(e))}))},t.prototype.clearActionRowVars=function(){this.actionRowIndex=void 0,this.actionRowPage=void 0,this.setDataGridOption("actionRowIndex",void 0),this.setDataGridOption("actionRowPage",void 0)},t.prototype.onStyleChange=function(t,n,i){switch(t){case"width":this.callDataGridMethod("setGridDimensions","width",n);break;case"height":this.callDataGridMethod("setGridDimensions","height",n)}e.prototype.onStyleChange.call(this,t,n,i)},t.prototype.populateActions=function(){var e=this;this._actions.header=[],this._actions.footer=[],_.forEach(this.actions,(function(t){_.includes(t.position,"header")&&e._actions.header.push(t),_.includes(t.position,"footer")&&e._actions.footer.push(t)}))},t.prototype.renderDynamicFilterColumn=function(e){this.isdynamictable&&this.filterTmpl._results.push(e)},t.prototype.registerColumns=function(e,t){var n=this;if(u.isMobile()&&this.viewport.isMobileType){if(!e.mobileDisplay)return}else if(this.viewport.isTabletType){if(!e.tabletDisplay)return}else if(!e.pcDisplay)return;e["primary-key"]&&this.primaryKey.push(e.field),this.fieldDefs[t]=e;var i=this.fieldDefs.length;this.fullFieldDefs.push(e),this.rowFilter[e.field]={value:void 0},this.fieldDefs.forEach((function(e){n.columns[e.field]=e})),this.isdynamictable&&i===this.noOfColumns&&(this.renderOperationColumns(),this.setDataGridOption("colDefs",this.fieldDefs))},t.prototype.registerFormField=function(e,t){this.formfields[e]=t},t.prototype.registerActions=function(e){this.actions.push(e),this.populateActions()},t.prototype.registerRow=function(e,t){this.rowDef=e,this.rowInstance=t,this.callDataGridMethod("option","cssClassNames.rowExpandIcon",this.rowDef.expandicon),this.callDataGridMethod("option","cssClassNames.rowCollapseIcon",this.rowDef.collapseicon),this.gridOptions.rowExpansionEnabled=!0,this.gridOptions.rowDef=this.rowDef},t.prototype.registerRowActions=function(e){this.rowActions.push(e)},t.prototype.selectItem=function(e,t){t&&(this.serverData=t),_.isObject(e)&&(e=_.omitBy(e,(function(e){return _.isArray(e)&&_.isEmpty(e)}))),this.callDataGridMethod("selectRow",e,!0)},t.prototype.deselectItem=function(e){this.callDataGridMethod("deselectRow",e)},t.prototype.onDataNavigatorDataSetChange=function(e){var t;return this.__fullData=e,this.checkFiltersApplied(this.getSortExpr()),this._isClientSearch?(t=u.getClonedObject(this.__fullData),_.isObject(t)&&!_.isArray(t)&&(t=[t]),t=this.getSearchResult(t,this.filterInfo),t=this.getSortResult(t,this.sortInfo)):e},t.prototype.toggleMessage=function(e,t,n,i){e&&n&&this.app.notifyApp(n,t,i)},t.prototype.export=function(e){var t,n=_.isEmpty(this.sortInfo)?"":this.sortInfo.field+" "+this.sortInfo.direction,i={};this.fieldDefs.forEach((function(e){if(e.field!==R&&e.show){var t={header:e.displayName};e.exportexpression?t.expression=e.exportexpression:t.field=e.field,i[e.field]=t}})),t={matchMode:"anywhereignorecase",filterFields:this.getFilterFields(this.filterInfo),orderBy:n,exportType:e.label,logicalOp:"AND",exportSize:this.exportdatasize,columns:i},!1!==this.invokeEventCallback("beforeexport",{$data:t})&&(t.fields=_.values(t.columns),this.datasource.execute(u.DataSource.Operation.DOWNLOAD,{data:t}))},t.prototype.expandRow=function(e){this.callDataGridMethod("expandRow",e)},t.prototype.collapseRow=function(e){this.callDataGridMethod("collapseRow",e)},t.prototype._documentClickBind=function(e){var t=e.target;this.$element[0].contains(t)||e.target.doctype||T($(t))||this.callDataGridMethod("saveRow")},t.prototype._redraw=function(e){var t=this;e?this.datagridElement.datatable(this.gridOptions):setTimeout((function(){t.callDataGridMethod("setColGroupWidths"),t.callDataGridMethod("addOrRemoveScroll")}))},t.prototype.invokeActionEvent=function(e,t){u.$parseEvent(t)(this.viewParent,Object.assign(this.context,{$event:e}))},t.prototype.handleEvent=function(t,n,i,o){"select"!==n&&e.prototype.handleEvent.call(this,this.nativeElement,n,i,o)},t.prototype.triggerUploadEvent=function(e,t,n,i){var o={$event:e,row:i};this.columns[n]&&("change"===t&&(o.newVal=e.target.files,o.oldVal=this.columns[n]._oldUploadVal,this.columns[n]._oldUploadVal=o.newVal),this.columns[n].invokeEventCallback(t,o))},t.prototype.registerFormWidget=function(){},t.prototype.writeValue=function(){},t.prototype.registerOnChange=function(e){this._onChange=e},t.prototype.registerOnTouched=function(e){this._onTouched=e},t.prototype.ngOnDetach=function(){e.prototype.ngOnDetach.call(this),"wm.Variable"===_.get(this.datasource,"category")&&"none"!==this.getConfiguredState()?this._pageLoad=!1:this._pageLoad=!0},t}(r.StylableComponent);S.initializeProps=P(),S.decorators=[{type:t.Component,args:[{selector:"[wmTable]",template:'<div class="panel-heading" *ngIf="title || subheading || iconclass || exportOptions.length || _actions.header.length">\n <h3 class="panel-title">\n <div class="pull-left">\n <i class="app-icon panel-icon {{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="panel-actions app-datagrid-actions" *ngIf="exportOptions.length || _actions.header.length">\n <ng-container *ngFor="let btn of _actions.header"\n [ngTemplateOutlet]="btn.widgetType === \'button\' ? buttonRef : anchorRef" [ngTemplateOutletContext]="{btn:btn}">\n </ng-container>\n <div wmMenu dropdown caption.bind="appLocale.LABEL_EXPORT" *ngIf="exportOptions.length" autoclose="always" attr.name="{{name}}-export"\n dataset.bind="exportOptions" select.event="export($item)" menuposition="down,left"></div>\n </div>\n </h3>\n</div>\n<div class="app-datagrid" #datagridElement></div>\n\n<div class="panel-footer clearfix" [hidden]="!_actions.footer.length && (!shownavigation || (onDemandLoad && dataNavigator.isDisableNext) || dataNavigator?.dataSize <= pagesize)">\n <div class="app-datagrid-paginator" [hidden]="(!dataNavigator?.dataSize && !dataNavigator.datasource?.pagination?.next) || !shownavigation || (onDemandLoad && dataNavigator.isDisableNext) || dataNavigator?.dataSize <= pagesize">\n <nav wmPagination show.bind="shownavigation" navigationalign.bind="navigationalign"\n navigationsize.bind="navigationSize"\n navigation.bind="navControls" showrecordcount.bind="showrecordcount" maxsize.bind="maxsize"\n boundarylinks.bind="boundarylinks"\n forceellipses.bind="forceellipses" directionlinks.bind="directionlinks"></nav>\n </div>\n <div class="app-datagrid-actions" *ngIf="_actions.footer.length">\n <ng-container *ngFor="let btn of _actions.footer"\n [ngTemplateOutlet]="btn.widgetType === \'button\' ? buttonRef : anchorRef" [ngTemplateOutletContext]="{btn:btn}">\n </ng-container>\n </div>\n</div>\n\n<ng-template #buttonRef let-btn="btn">\n <button wmButton caption.bind="btn.displayName" show.bind="btn.show" class.bind="btn.class" iconclass.bind="btn.iconclass" (click)="invokeActionEvent($event, btn.action)"\n [ngClass]="{\'btn-sm\': spacing === \'condensed\', \'disabled-new\': btn.key === \'addNewRow\' && (isGridEditMode || isLoading)}"\n type="button" shortcutkey.bind="btn.shortcutkey" tabindex.bind="btn.tabindex" hint.bind="btn.title" [attr.aria-label]="btn.displayName" disabled.bind="btn.disabled" conditionalclass.bind="btn.conditionalclass" conditionalstyle.bind="btn.conditionalstyle"></button>\n</ng-template>\n\n<ng-template #anchorRef let-btn="btn">\n <a wmAnchor caption.bind="btn.displayName" show.bind="btn.show" class.bind="btn.class" iconclass.bind="btn.iconclass" (click)="invokeActionEvent($event, btn.action)"\n [ngClass]="{\'btn-sm\': spacing === \'condensed\', \'disabled-new\': btn.key === \'addNewRow\' && (isGridEditMode || isLoading)}"\n shortcutkey.bind="btn.shortcutkey" tabindex.bind="btn.tabindex" hint.bind="btn.title"\n hyperlink.bind="btn.hyperlink" target.bind="btn.target" conditionalclass.bind="btn.conditionalclass" conditionalstyle.bind="btn.conditionalstyle"></a>\n</ng-template>\n\n<div hidden>\n <ng-container #multiColumnFilterView></ng-container>\n\n <ng-container #inlineEditView></ng-container>\n\n <ng-container #inlineEditNewView></ng-container>\n\n <ng-container #rowActionsView></ng-container>\n\n <ng-container #rowExpansionActionView></ng-container>\n\n <ng-container #customExprView></ng-container>\n\n <ng-container #dynamicTable></ng-container>\n\n <ng-container #rowDetailView></ng-container>\n\n <div class="dynamic-table-container"></div>\n</div>\n',providers:[r.provideAs(S,i.NG_VALUE_ACCESSOR,!0),r.provideAsWidgetRef(S)]}]}],S.ctorParameters=function(){return[{type:t.Injector},{type:i.FormBuilder},{type:u.App},{type:u.DynamicComponentRefProvider},{type:u.StatePersistence},{type:u.PaginationService},{type:u.Viewport},{type:p.ListComponent,decorators:[{type:t.Optional}]},{type:void 0,decorators:[{type:t.Attribute,args:["dataset.bind"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["datasource.bind"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["readonlygrid"]}]},{type:t.NgZone},{type:r.TrustAsPipe}]},S.propDecorators={dataNavigator:[{type:t.ViewChild,args:[d.PaginationComponent,{static:!0}]}],_tableElement:[{type:t.ViewChild,args:["datagridElement",{static:!0}]}],rowActionTmpl:[{type:t.ContentChildren,args:["rowActionTmpl"]}],rowActionsViewRef:[{type:t.ViewChild,args:["rowActionsView",{static:!0,read:t.ViewContainerRef}]}],filterTmpl:[{type:t.ContentChildren,args:["filterTmpl",{descendants:!0}]}],filterViewRef:[{type:t.ViewChild,args:["multiColumnFilterView",{static:!0,read:t.ViewContainerRef}]}],inlineWidgetTmpl:[{type:t.ContentChildren,args:["inlineWidgetTmpl",{descendants:!0}]}],inlineEditViewRef:[{type:t.ViewChild,args:["inlineEditView",{static:!0,read:t.ViewContainerRef}]}],inlineWidgetNewTmpl:[{type:t.ContentChildren,args:["inlineWidgetTmplNew",{descendants:!0}]}],inlineEditNewViewRef:[{type:t.ViewChild,args:["inlineEditNewView",{static:!0,read:t.ViewContainerRef}]}],customExprTmpl:[{type:t.ContentChildren,args:["customExprTmpl",{descendants:!0}]}],customExprViewRef:[{type:t.ViewChild,args:["customExprView",{static:!0,read:t.ViewContainerRef}]}],rowExpansionActionTmpl:[{type:t.ContentChildren,args:["rowExpansionActionTmpl"]}],rowExpansionTmpl:[{type:t.ContentChild,args:["rowExpansionTmpl"]}],rowDetailViewRef:[{type:t.ViewChild,args:["rowDetailView",{static:!0,read:t.ViewContainerRef}]}],rowExpansionActionViewRef:[{type:t.ViewChild,args:["rowExpansionActionView",{static:!0,read:t.ViewContainerRef}]}],dynamicTableRef:[{type:t.ViewChild,args:["dynamicTable",{static:!0,read:t.ViewContainerRef}]}],onKeyPress:[{type:t.HostListener,args:["keypress",["$event"]]}]};var C="new",I="edit",D="delete",x=function(){function e(e,t,n){this.table=e,this.dialogService=t,this.app=n,e.initiateSelectItem=this.initiateSelectItem.bind(this),e.updateVariable=this.updateVariable.bind(this),e.updateRecord=this.updateRecord.bind(this),e.deleteRecord=this.deleteRecord.bind(this),e.insertRecord=this.insertRecord.bind(this),e.editRow=this.editRow.bind(this),e.addNewRow=this.addNewRow.bind(this),e.addRow=this.addNewRow.bind(this),e.deleteRow=this.deleteRow.bind(this),e.onRecordDelete=this.onRecordDelete.bind(this),e.hideEditRow=this.hideEditRow.bind(this),e.saveRow=this.saveRow.bind(this),e.cancelRow=this.cancelRow.bind(this)}return e.prototype.selectItemOnSuccess=function(e,t,n){var i=this;setTimeout((function(){t||i.table.selectItem(e,i.table.dataset),u.triggerFn(n)}),250)},e.prototype.initiateSelectItem=function(e,t,n,i,o){var a=this;this.table.gridOptions.isNavTypeScrollOrOndemand()&&!this.table.dataNavigator.isDisableNext&&this.table.isNewRowInserted?this.table.isNewRowInserted=!1:("last"===e&&(i||(this.table.dataNavigator.dataSize+=1),this.table.isNavigationEnabled()||(e="current")),this.table.dataNavigator.calculatePagingValues(),this.table.dataNavigator.__fullData=this.table.__fullData,this.table.dataNavigator.navigatePage(e,null,!0,(function(){(a.table.isNavigationEnabled()||i)&&a.selectItemOnSuccess(t,n,o),"quickedit"!==a.table.editmode||n||a.table.callDataGridMethod("setActiveRow",t)})))},e.prototype.updateVariable=function(e,t){var n=this,i=this.table.datasource;if(i&&(i.execute(u.DataSource.Operation.FETCH_DISTINCT_VALUES),!this.table.isNavigationEnabled())){var o=this.table.sortInfo,a=o&&o.direction?o.field+" "+o.direction:"";r.refreshDataSource(i,{page:1,filterFields:this.table.getFilterFields(this.table.filterInfo),orderBy:a,matchMode:"anywhereignorecase"}).then((function(){u.$appDigest(),n.selectItemOnSuccess(e,!0,t)}))}},e.prototype.insertSuccessHandler=function(e,t){if(e.error)this.table.invokeEventCallback("error",{$event:t.event,$operation:C,$data:e.error}),this.table.onError||this.table.toggleMessage(!0,"error",this.table.errormessage||e.error),u.triggerFn(t.error,e);else{if(this.table.gridOptions.isNavTypeScrollOrOndemand()&&(this.table.isNewRowInserted=!0),t.event){var n=$(t.event.target).closest("tr");this.table.callDataGridMethod("hideRowEditMode",n)}this.table.onRowinsert||this.table.toggleMessage(!0,"success",this.table.insertmessage),this.table.datasource.execute(u.DataSource.Operation.SUPPORTS_CRUD)?(this.table.initiateSelectItem(this.table.getNavigationTargetBySortInfo(),e,void 0,!1,t.callBack),this.updateVariable(e,t.callBack)):this.table.datasource.execute(u.DataSource.Operation.IS_API_AWARE)||this.table.initiateSelectItem(this.table.getNavigationTargetBySortInfo(),e,void 0,!1,t.callBack),u.triggerFn(t.success,e),this.table.invokeEventCallback("rowinsert",{$event:t.event,$data:e,row:e})}},e.prototype.generatePath=function(e){var t,n,i=this.table.widget.$attrs.get("datasetboundexpr");if(_.startsWith(e,"item")&&i){_.startsWith(i,"Widgets.")&&(i=u.extractCurrentItemExpr(i,this.table));for(var o=this.table.$element.parents(".app-list-item"),a=_.map(o,(function(e){return _.parseInt($(e).attr("listitemindex"))})),r=a.length-1;r>=0;r--)i=i.replace("$i",a[r]);n=_.last(a),t=i.replace(/^Variables\..*\.dataSet([^.])*(\.|$)/g,"")}else{/^Variables\..*\.dataSet([\[][0-9]])/g.test(e)&&(n=_.parseInt(e.replace(/^Variables\..*\.dataSet([\[])/g,""))),t=e.replace(/^Variables\..*\.dataSet([^.])*(\.|$)/g,"")}return{path:t,index:n}},e.prototype.insertRecord=function(e){var t=this,n=this.table.datasource;if(n){var i=n.pagination&&n.pagination.number+1,o={row:e.row,skipNotification:!0,period:e.period};if(n.execute(u.DataSource.Operation.SUPPORTS_CRUD)||!n.execute(u.DataSource.Operation.IS_API_AWARE)||"wm.CrudVariable"===n.category){if(!n.execute(u.DataSource.Operation.IS_API_AWARE)){var a=this.generatePath(this.table.binddataset);return n.execute(u.DataSource.Operation.ADD_ITEM,{item:e.row,path:a.path,parentIndex:a.index}),void this.insertSuccessHandler(e.row,e)}n.execute(u.DataSource.Operation.INSERT_RECORD,o).then((function(o){t.insertSuccessHandler(o,e),"wm.CrudVariable"===n.category&&n.execute(u.DataSource.Operation.LIST_RECORDS,{skipToggleState:!0,operation:"list",page:i})}),(function(n){t.table.invokeEventCallback("error",{$event:e.event,$operation:C,$data:n}),t.table.onError||t.table.toggleMessage(!0,"error",t.table.errormessage||n),u.triggerFn(e.error,n),u.triggerFn(e.callBack,void 0,!0)}))}else this.table.invokeEventCallback("rowinsert",{$event:e.event,row:e.row})}},e.prototype.updateSuccessHandler=function(e,t){if(e.error)this.table.invokeEventCallback("error",{$event:t.event,$operation:I,$data:e.error}),this.table.onError||this.table.toggleMessage(!0,"error",this.table.errormessage||e.error),u.triggerFn(t.error,e);else{if(t.event){var n=$(t.event.target).closest("tr");this.table.callDataGridMethod("hideRowEditMode",n)}this.table.onRowupdate||this.table.toggleMessage(!0,"success",this.table.updatemessage),this.table.datasource.execute(u.DataSource.Operation.SUPPORTS_CRUD)?(this.table.initiateSelectItem("current",e,void 0,!1,t.callBack),this.updateVariable(e,t.callBack)):this.table.datasource.execute(u.DataSource.Operation.IS_API_AWARE)||this.table.initiateSelectItem("current",e,void 0,!1,t.callBack),u.triggerFn(t.success,e),this.table.invokeEventCallback("rowupdate",{$event:t.event,$data:e,row:e})}},e.prototype.updateRecord=function(e){var t=this,n=this.table.datasource;if(n){var i=n.pagination&&n.pagination.number+1,o={row:e.row,prevData:e.prevData,skipNotification:!0,period:e.period};if(n.execute(u.DataSource.Operation.SUPPORTS_CRUD)||!n.execute(u.DataSource.Operation.IS_API_AWARE)||"wm.CrudVariable"===n.category){if(!n.execute(u.DataSource.Operation.IS_API_AWARE)){var a=this.generatePath(this.table.binddataset);return n.execute(u.DataSource.Operation.SET_ITEM,{prevItem:e.prevData,item:e.row,path:a.path,parentIndex:a.index}),void this.updateSuccessHandler(e.row,e)}n.execute(u.DataSource.Operation.UPDATE_RECORD,o).then((function(o){t.updateSuccessHandler(o,e),"wm.CrudVariable"===n.category&&n.execute(u.DataSource.Operation.LIST_RECORDS,{skipToggleState:!0,operation:"list",page:i})}),(function(n){t.table.invokeEventCallback("error",{$event:e.event,$operation:I,$data:n}),t.table.onError||t.table.toggleMessage(!0,"error",t.table.errormessage||n),u.triggerFn(e.error,n),u.triggerFn(e.callBack,void 0,!0)}))}else this.table.invokeEventCallback("rowupdate",{$event:e.event,row:e.row})}},e.prototype.onRecordDelete=function(e){var t;this.table.dataNavigator&&(this.table.dataNavigator.dataSize-=1,this.table.dataNavigator.calculatePagingValues(),t=this.table.dataNavigator.pageCount<this.table.dataNavigator.dn.currentPage?"prev":void 0,this.table.dataNavigator.__fullData=this.table.__fullData,this.table.dataNavigator.navigatePage(t,null,!0,(function(){setTimeout((function(){u.triggerFn(e)}),void 0,!1)})))},e.prototype.deleteSuccessHandler=function(e,t,n,i){t&&t.error?this.table.onError||this.table.toggleMessage(!0,"error",this.table.errormessage||t.error):(this.onRecordDelete(i),this.table.datasource.execute(u.DataSource.Operation.SUPPORTS_CRUD)&&this.updateVariable(e,i),this.table.onRowdelete||this.table.toggleMessage(!0,"success",this.table.deletemessage),this.table.invokeEventCallback("rowdelete",{$event:n,$data:e,row:e}),this.table.invokeEventCallback("rowdeleted",{$event:n,$data:e,row:e}))},e.prototype.deleteFn=function(e){var t,n,i=this,o=this.table.datasource;if(o){if((this.table.onDemandLoad||this.table.infScroll)&&(this.table.isRowDeleted=!0),"wm.CrudVariable"===o.category&&(this.triggerWMEvent("resetEditMode"),o.pagination&&(t=o.pagination.last&&1===o.pagination.numberOfElements,n=t?o.pagination.number:o.pagination.number+1)),o.execute(u.DataSource.Operation.SUPPORTS_CRUD)||!o.execute(u.DataSource.Operation.IS_API_AWARE)||this.table._isDependent||"wm.CrudVariable"===o.category){if(!o.execute(u.DataSource.Operation.IS_API_AWARE)){var a=this.generatePath(this.table.binddataset);return o.execute(u.DataSource.Operation.REMOVE_ITEM,{item:e.row,path:a.path,parentIndex:a.index}),void this.deleteSuccessHandler(e.row,void 0,e.evt,e.callBack)}o.execute(u.DataSource.Operation.DELETE_RECORD,{row:e.row,skipNotification:!0,period:e.period}).then((function(t){i.deleteSuccessHandler(t,e.row,e.evt,e.callBack),"wm.CrudVariable"===o.category&&o.execute(u.DataSource.Operation.LIST_RECORDS,{skipToggleState:!0,operation:"list",page:n})}),(function(t){i.table.isRowDeleted&&(i.table.isRowDeleted=!1),u.triggerFn(e.callBack,void 0,!0),i.table.invokeEventCallback("error",{$event:e.evt,$operation:D,$data:t}),i.table.onError||i.table.toggleMessage(!0,"error",i.table.errormessage||t)}))}else this.table.invokeEventCallback("rowdelete",{$event:e.evt,row:e.row});u.triggerFn(e.cancelRowDeleteCallback)}},e.prototype.deleteRecord=function(e){var t=this;if(!this.table.confirmdelete)return this.deleteFn(e),void u.triggerFn(e.cancelRowDeleteCallback);this.dialogService.showAppConfirmDialog({title:this.app.appLocale.MESSAGE_DELETE_RECORD||"Delete Record",iconclass:"wi wi-delete fa-lg",message:this.table.confirmdelete,oktext:this.table.deleteoktext,canceltext:this.table.deletecanceltext,onOk:function(){t.deleteFn(e),t.dialogService.closeAppConfirmDialog()},onCancel:function(){u.triggerFn(e.cancelRowDeleteCallback),t.dialogService.closeAppConfirmDialog()},onOpen:function(){$(".cancel-action").focus()},onEscape:function(){u.triggerFn(e.cancelRowDeleteCallback)}})},e.prototype.editRow=function(e){var t,n=this;this.table._isDependent?this.triggerWMEvent("update"):(e&&e.target?this.table.callDataGridMethod("toggleEditRow",e,{selectRow:!0,action:"edit"}):"form"===this.table.editmode||"dialog"===this.table.editmode?(t=e||this.table.selectedItems[0],this.table.gridOptions.beforeRowUpdate(t)):setTimeout((function(){(t=n.table.datagridElement.find("tr.active")).length&&n.table.callDataGridMethod("toggleEditRow",void 0,{$row:t,action:"edit"})})),this.table._triggeredByUser=!0,this.table.gridOptions.setIsDataUpdatedByUser(!1))},e.prototype.addNewRow=function(){this.table.isGridEditMode||(this.table._triggeredByUser=!0,this.table.gridOptions.setIsDataUpdatedByUser(!1),this.table.callDataGridMethod("addNewRow"),this.table._liveTableParent?this.table._liveTableParent.addNewRow():this.table._isDependent&&this.triggerWMEvent("insert"))},e.prototype.triggerWMEvent=function(e,t){u.$invokeWatchers(!0),this.app.notify("wm-event",{eventName:e,widgetName:this.table.name,row:this.table.selecteditem,dataSource:t})},e.prototype.deleteRow=function(e){var t,n=this;e&&e.target?this.table.callDataGridMethod("deleteRowAndUpdateSelectAll",e):setTimeout((function(){t=e||n.table.selectedItems[0],n.deleteRecord({row:t})})),this.table._triggeredByUser=!0,this.table.gridOptions.setIsDataUpdatedByUser(!1)},e.prototype.hideEditRow=function(){var e=this.table.datagridElement.find("tr.row-editing");e.length&&this.table.callDataGridMethod("hideRowEditMode",e)},e.prototype.saveRow=function(){this.table.callDataGridMethod("saveRow")},e.prototype.cancelRow=function(){var e=this.table.datagridElement.find("tr.row-editing");e.length&&this.table.callDataGridMethod("cancelEdit",e)},e}();x.decorators=[{type:t.Directive,args:[{selector:"[wmTableCUD]"}]}],x.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Self},{type:t.Inject,args:[S]}]},{type:u.AbstractDialogService},{type:u.App}]};var N=["null","empty","nullorempty","isnotnull","isnotempty"],k=function(e,t){if(u.isDefined(e)&&""!==e)return u.isNumberType(t)?_.toNumber(e):t===u.DataType.DATETIME?moment(e).valueOf():_.toString(e).toLowerCase()},M=function(e,t,n){void 0===n&&(n=[]);var i,o=k(t.value,t.type);return!u.isDefined(o)&&!_.includes(N,t.matchMode)||u.isNumberType(t.type)&&_.isNull(t.value)?e:e=e.filter((function(e){var a;switch(t.field?i=k(_.get(e,t.field),t.type):(i=[],_.forEach(e,(function(t,o){if(_.includes(n,o))i.push(t);else{var a=_.filter(_.range(n.length),(function(e){return n[e].includes(o)}));_.forEach(a,(function(t){var o=_.get(e,n[t]);i.indexOf(o)<0&&i.push(o)}))}})),i=i.join(" ").toLowerCase()),t.matchMode){case"start":a=_.startsWith(i,o);break;case"end":a=_.endsWith(i,o);break;case"exact":a=_.isEqual(i,o);break;case"notequals":a=!_.isEqual(i,o);break;case"null":a=_.isNull(i);break;case"isnotnull":a=!_.isNull(i);break;case"empty":a=_.isEmpty(i);break;case"isnotempty":a=!_.isEmpty(i);break;case"nullorempty":a=_.isNull(i)||_.isEmpty(i);break;case"lessthan":a=i<o;break;case"lessthanequal":a=i<=o;break;case"greaterthan":a=i>o;break;case"greaterthanequal":a=i>=o;break;default:a=u.isNumberType(t.type)?_.isEqual(i,o):_.includes(i,o)}return a}))},L=function(e,t,n){n.forEach((function(n){e[n]={value:t.value,type:t.value.type,logicalOp:"OR"},t.matchMode&&(e[n].matchMode=t.matchMode)}))},F=function(e,t,n){void 0===n&&(n=[]);var i=t&&t.field;i?(e[i]={value:t.value,logicalOp:"AND"},t.matchMode&&(e[i].matchMode=t.matchMode)):L(e,t,n)},j=function(e,t){t.field&&(e[t.field]={value:t.value,matchMode:t.matchMode,type:t.type})},B=function(e,t){e.push({field:t.key?t.key:"",matchMode:t.matchMode,type:t.type,value:t.value})},G=function(){function e(e){this.table=e,e._searchSortHandler=this.searchSortHandler.bind(this),e.getSearchResult=this.getSearchResult.bind(this),e.getSortResult=this.getSortResult.bind(this),e.checkFiltersApplied=this.checkFiltersApplied.bind(this),e.getFilterFields=this.getFilterFields.bind(this),e.onRowFilterChange=this.onRowFilterChange.bind(this),e.onFilterConditionSelect=this.onFilterConditionSelect.bind(this),e.showClearIcon=this.showClearIcon.bind(this),e.clearRowFilter=this.clearRowFilter.bind(this),e.matchModeTypesMap=r.getMatchModeTypesMap(),e.matchModeMsgs=r.getMatchModeMsgs(e.appLocale),e.emptyMatchModes=N,e.getNavigationTargetBySortInfo=this.getNavigationTargetBySortInfo.bind(this),e.refreshData=this.refreshData.bind(this),e.clearFilter=this.clearFilter.bind(this),e.adjustContainer=this.adjustContainer.bind(this)}return e.prototype.adjustContainer=function(e){var t=this;setTimeout((function(){u.adjustContainerRightEdges($("bs-dropdown-container"),t.table.rowFilterCompliedTl[e],t.table,$("bs-dropdown-container .dropdown-menu"))}))},e.prototype.getNavigationTargetBySortInfo=function(){return this.table.sortInfo&&"desc"===this.table.sortInfo.direction&&_.includes(this.table.primaryKey,this.table.sortInfo.field)?"first":"last"},e.prototype.getTableVisibleCols=function(){var e=[];return _.forEach(this.table.columns,(function(t,n){"true"===_.toLower(_.toString(t.showinfilter))&&"rowOperations"!==n&&t.searchable&&e.push(n)})),e},e.prototype.invokeSetFilterfieldBasedOnFieldval=function(e,t){if(e.field)F(t,e);else if(!_.isEmpty(e)){var n=this.getTableVisibleCols();F(t,e,n)}},e.prototype.getFilterFields=function(e){var t=this;e=e||{};var n={};return _.isArray(e)?_.forEach(e,(function(e){t.invokeSetFilterfieldBasedOnFieldval(e,n)})):this.invokeSetFilterfieldBasedOnFieldval(e,n),n},e.prototype.getLogicalOperator=function(e){var t="";for(var n in e){t=e[n].logicalOp||"";break}return t},e.prototype.resetSortStatus=function(e){var t;!_.isEmpty(this.table.sortInfo)&&this.table.datasource&&(t=this.table.sortInfo.field+" "+this.table.sortInfo.direction,(e=this.table.datasource.execute(u.DataSource.Operation.GET_OPTIONS).orderBy||e)&&(e=_.head(_.split(e,","))),t!==e&&(this.table.callDataGridMethod("resetSortIcons"),this.table.sortInfo={},this.table.setDataGridOption("sortInfo",{})))},e.prototype.clearFilter=function(e){var t;this.table.filterInfo={},"multicolumn"===this.table.filtermode?(this.table.fieldDefs.forEach((function(e){e.resetFilter&&e.resetFilter()})),e||this.table.onRowFilterChange()):"search"===this.table.filtermode&&((t=this.table.datagridElement).find('[data-element="dgSearchText"]').val(""),t.find('[data-element="dgFilterValue"]').val(""),e||t.find(".app-search-button").trigger("click"))},e.prototype.checkFiltersApplied=function(e){if(this.table.datasource)return this.table.datasource.execute(u.DataSource.Operation.SUPPORTS_SERVER_FILTER)?(_.isEmpty(this.table.datasource.execute(u.DataSource.Operation.GET_OPTIONS).filterFields)&&this.clearFilter(!0),void this.resetSortStatus(e)):void(this.table.datasource.execute(u.DataSource.Operation.IS_PAGEABLE)&&this.resetSortStatus(e))},e.prototype.getSearchResult=function(e,t){var n=this.getTableVisibleCols();return t?(_.isArray(t)?t.forEach((function(t){e=M(e,t,n)})):e=M(e,t,n),e):e},e.prototype.getSortResult=function(e,t){return t&&t.direction&&(e=_.orderBy(e,t.field,t.direction)),e},e.prototype.handleClientSideSortSearch=function(e,t,n){var i;this.table._isClientSearch=!0,i=this.table.isNavigationEnabled()?u.getClonedObject(this.table.__fullData):u.getClonedObject(this.table.dataset),"search"===n?this.table.filterInfo=e:this.table.sortInfo=e,_.isObject(i)&&!_.isArray(i)&&(i=[i]),i=this.getSearchResult(i,this.table.filterInfo),i=this.getSortResult(i,this.table.sortInfo),this.table.serverData=i,"sort"===n&&this.table.invokeEventCallback("sort",{$event:t,$data:{data:this.table.serverData,sortDirection:this.table.sortInfo.direction,colDef:this.table.columns[this.table.sortInfo.field]}}),this.table.isNavigationEnabled()?(this.table.dataNavigator.dn.currentPage=1,this.table.dataNavigator.setPagingValues(i)):this.table.setGridData(this.table.serverData)},e.prototype.handleSinglePageSearch=function(e){this.table._isPageSearch=!0;var t=u.getClonedObject(this.table.gridData),n=this.table.datagridElement.find("tbody tr.app-datagrid-row");this.table.filterInfo=e,t=this.getSearchResult(t,e),_.forEach(this.table.gridData,(function(e,i){var o=$(n[i]);_.find(t,(function(t){return _.isEqual(t,e)}))?o.show():o.hide()})),t&&t.length?(this.table.callDataGridMethod("setStatus","ready"),this.table.gridfirstrowselect&&!this.table.multiselect&&this.table.callDataGridMethod("selectFirstRow",!0,!0)):(this.table.callDataGridMethod("setStatus","nodata",this.table.nodatamessage),this.table.selecteditem=void 0),this.table.callDataGridMethod("updateSelectAllCheckboxState")},e.prototype.handleServerSideSearch=function(e){var t=this;if(this.table.filterInfo=e,this.table.datasource){var n=this.table.sortInfo,i=n&&n.direction?n.field+" "+n.direction:"",o=this.getFilterFields(e),a=this.getLogicalOperator(o);r.refreshDataSource(this.table.datasource,{page:1,filterFields:o,orderBy:i,condition:a}).then((function(){u.$appDigest()}),(function(){t.table.toggleMessage(!0,"error",t.table.nodatamessage)}))}},e.prototype.handleSeverSideSort=function(e,t,n){var i=this;this.table.gridOptions.sortInfo.field=e.field,this.table.gridOptions.sortInfo.direction=e.direction,this.table.sortInfo=u.getClonedObject(e);var o=e&&e.direction?e.field+" "+e.direction:"",a=this.getFilterFields(this.table.filterInfo),s=this.getLogicalOperator(a);n||"none"===this.table.getConfiguredState()||this.table.statePersistence.removeWidgetState(this.table,"pagination"),r.refreshDataSource(this.table.datasource,{page:1,filterFields:a,orderBy:o,condition:s}).then((function(n){u.$appDigest();var o=n&&n.data?n.data:n;i.table.invokeEventCallback("sort",{$event:t,$data:{data:o,sortDirection:e.direction,colDef:i.table.columns[e.field]}})}))},e.prototype.searchHandler=function(e,t,n,i){var o;o=_.isArray(e)?e.filter((function(e){return void 0!==e.matchMode&&void 0!==e.value||void 0!==e.value&&""===e.field})):{field:e.field,value:e.value,type:e.type},"none"!==this.table.getConfiguredState()&&r.unsupportedStatePersistenceTypes.indexOf(this.table.navigation)<0?(_.isArray(e)&&o.length||e.value?(this.table.statePersistence.removeWidgetState(this.table,"search"),this.table.statePersistence.setWidgetState(this.table,{search:o})):this.table.statePersistence.removeWidgetState(this.table,"search"),i||(this.table.statePersistence.removeWidgetState(this.table,"pagination"),this.table.statePersistence.removeWidgetState(this.table,"selectedItem"))):console.warn("Retain State handling on Widget "+this.table.name+" is not supported for current pagination type.");var a=u.getClonedObject(e),s=this.table.datasource;if(s||this.table.dataset){var l={};_.isArray(a)?a.forEach((function(e){j(l,e)})):j(l,a),!1!==this.table.invokeEventCallback("beforefilter",{$event:t,$data:l,columns:l})&&(a=[],_.isEmpty(l)&&!_.isEmpty(o)?_.isArray(o)?_.forEach(o,(function(e){B(a,e)})):B(a,o):_.forEach(l,(function(e,t){a.push({field:t,matchMode:e.matchMode,type:e.type,value:e.value})})),s&&s.execute(u.DataSource.Operation.SUPPORTS_SERVER_FILTER)?this.handleServerSideSearch(a):s&&s.execute(u.DataSource.Operation.IS_API_AWARE)&&s.execute(u.DataSource.Operation.IS_PAGEABLE)?this.handleSinglePageSearch(a):this.handleClientSideSortSearch(a,t,n))}},e.prototype.sortHandler=function(e,t,n,i){var o=this.table.datasource;if(o||this.table.dataset){if(!i&&"none"!==this.table.getConfiguredState()&&r.unsupportedStatePersistenceTypes.indexOf(this.table.navigation)<0){var a={direction:e.direction,field:e.field};e.direction?this.table.statePersistence.setWidgetState(this.table,{sort:a}):this.table.statePersistence.removeWidgetState(this.table,"sort"),this.table.statePersistence.removeWidgetState(this.table,"selectedItem")}else console.warn("Retain State handling on Widget "+this.table.name+" is not supported for current pagination type.");o&&o.execute(u.DataSource.Operation.IS_SORTABLE)?this.handleSeverSideSort(e,t,i):this.handleClientSideSortSearch(e,t,n)}},e.prototype.setLastActionPerformedToSearchSort=function(){this.table.gridOptions.setLastActionPerformed(this.table.gridOptions.ACTIONS.SEARCH_OR_SORT),this.table.gridOptions.setIsSearchTrigerred(!0)},e.prototype.searchSortHandler=function(e,t,n,i){"change"===(t?t.type:"")&&"multicolumn"!==this.table.filtermode?t.stopPropagation():(this.setLastActionPerformedToSearchSort(),"search"===n?this.searchHandler(e,t,n,i):this.sortHandler(e,t,n,i))},e.prototype.showClearIcon=function(e){var t=this.table.rowFilter[e]&&this.table.rowFilter[e].value;return u.isDefined(t)&&""!==t&&null!==t},e.prototype.clearRowFilter=function(e){this.table.rowFilter&&this.table.rowFilter[e]&&(this.table.columns[e].resetFilter(),this.onRowFilterChange(e))},e.prototype.onFilterConditionSelect=function(e,t){var n=this;this.table.rowFilter[e]=this.table.rowFilter[e]||{},this.table.rowFilter[e].matchMode=t,_.includes(this.table.emptyMatchModes,t)?(this.table.columns[e].resetFilter(),this.table.onRowFilterChange()):u.isDefined(this.table.rowFilter[e].value)&&""!==this.table.rowFilter[e].value?this.table.onRowFilterChange():setTimeout((function(){n.table.columns[e].filterInstance.focus()}))},e.prototype.getFilterOnFieldValues=function(e){var t=this;if(this.table.datasource&&this.table.datasource.execute(u.DataSource.Operation.SUPPORTS_DISTINCT_API)){var n=e.field,i=this.table.fullFieldDefs,o=_.filter(i,{filteronfilter:n}),a=_.get(this.table.rowFilter,[n,"value"]);_.forEach(o,(function(e){var n=e.filteronfilter,i=e.field,o={},s=e.filterwidget;r.isDataSetWidget(s)&&n!==i&&!e.isFilterDataSetBound&&(o[n]=u.isDefined(a)&&""!==a&&null!==a?{value:a}:{},s===u.FormWidgetType.AUTOCOMPLETE&&e.filterInstance.dataoptions?e.filterInstance.dataoptions.filterFields=o:t.table.datasource.execute(u.DataSource.Operation.GET_DISTINCT_DATA_BY_FIELDS,{fields:i,filterFields:o}).then((function(t){e.filterdataset=t.data})))}))}},e.prototype.onRowFilterChange=function(e){var t=this,n=[],i=_.find(this.table.fullFieldDefs,{field:e});_.forEach(this.table.rowFilter,(function(e,o){(u.isDefined(e.value)&&""!==e.value||_.includes(t.table.emptyMatchModes,e.matchMode))&&(i&&o===i.field&&(e.type=e.type||i.type,e.matchMode=e.matchMode||_.get(t.table.matchModeTypesMap[e.type],0)),n.push({field:o,value:e.value,matchMode:e.matchMode,type:e.type}))})),this.table.gridOptions.searchHandler(n,void 0,"search"),i&&this.getFilterOnFieldValues(i)},e.prototype.refreshData=function(e){if(this.table.datasource){var t=e?this.table.dataNavigator.dn.currentPage:1,n=this.table.sortInfo,i=n&&n.direction?n.field+" "+n.direction:"",o=this.getFilterFields(this.table.filterInfo),a=this.getLogicalOperator(o);r.refreshDataSource(this.table.datasource,{page:t,filterFields:o,orderBy:i,condition:a})}},e}();G.decorators=[{type:t.Directive,args:[{selector:"[wmTableFilterSort]"}]}],G.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Self},{type:t.Inject,args:[S]}]}]};var V=function(){r.register("wm-table-action",new Map([["accessroles",r.PROP_STRING],["action",r.PROP_STRING],["caption",r.PROP_STRING],["class",r.PROP_STRING],["conditionalclass",r.PROP_ANY],["conditionalstyle",r.PROP_ANY],["disabled",Object.assign({value:!1},r.PROP_BOOLEAN)],["display-name",r.PROP_STRING],["hyperlink",r.PROP_STRING],["icon",r.PROP_STRING],["iconclass",r.PROP_STRING],["key",r.PROP_STRING],["position",Object.assign({value:"footer"},r.PROP_STRING)],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["title",r.PROP_STRING],["target",r.PROP_STRING],["widget-type",Object.assign({value:"button"},r.PROP_STRING)]]))},W={widgetType:"wm-table-action",hostClass:""},U=function(e){function t(t,n){var i=e.call(this,t,W)||this;return i.table=n,i}return g(t,e),t.prototype.populateAction=function(){this.buttonDef={key:this.key,displayName:this["display-name"]||this.caption||"",show:this.show,class:this.class||"",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,icon:this.icon,position:this.position,widgetType:this["widget-type"],hyperlink:this.hyperlink,target:this.target||"",conditionalclass:this.conditionalclass||"",conditionalstyle:this.conditionalstyle||{}},this._propsInitialized=!0},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.populateAction(),this.table.registerActions(this.buttonDef)},t.prototype.onPropertyChange=function(e,t){this._propsInitialized&&("display-name"===e?this.buttonDef.displayName=t:this.buttonDef[e]=t)},t}(r.BaseComponent);U.initializeProps=V(),U.decorators=[{type:t.Directive,args:[{selector:"[wmTableAction]",providers:[r.provideAsWidgetRef(U)]}]}],U.ctorParameters=function(){return[{type:t.Injector},{type:S,decorators:[{type:t.Optional}]}]};var q=function(){r.register("wm-table-column",new Map([["accessroles",r.PROP_STRING],["autoclose",Object.assign({value:"outsideClick"},r.PROP_STRING)],["backgroundcolor",r.PROP_STRING],["binding",r.PROP_STRING],["caption",r.PROP_STRING],["checkedvalue",r.PROP_STRING],["col-class",r.PROP_STRING],["collapsible",r.PROP_BOOLEAN],["col-ng-class",r.PROP_STRING],["currencypattern",r.PROP_STRING],["customExpression",r.PROP_BOOLEAN],["dataentrymode",Object.assign({value:"default"},r.PROP_STRING)],["datafield",r.PROP_STRING],["dataoptions",r.PROP_ANY],["dataset",r.PROP_ANY],["datasource",r.PROP_STRING],["dateformat",r.PROP_STRING],["datepattern",r.PROP_STRING],["debouncetime",Object.assign({value:250},r.PROP_NUMBER)],["defaultvalue",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["displayfield",r.PROP_STRING],["displaylabel",r.PROP_STRING],["editdatepattern",r.PROP_STRING],["outputformat",r.PROP_STRING],["edit-widget-type",r.PROP_STRING],["editinputtype",r.PROP_STRING],["exportexpression",r.PROP_STRING],["filterdataset",r.PROP_STRING],["filterdatafield",r.PROP_STRING],["filterdisplayfield",r.PROP_STRING],["filterdisplaylabel",r.PROP_STRING],["filterexpressions",Object.assign({value:"{}"},r.PROP_STRING)],["filtersearchkey",r.PROP_STRING],["filter-on",r.PROP_STRING],["filteronfilter",r.PROP_STRING],["filterplaceholder",r.PROP_STRING],["filterwidget",r.PROP_STRING],["filterinputtype",r.PROP_STRING],["formatpattern",r.PROP_STRING],["custompipeformat",r.PROP_STRING],["fractionsize",r.PROP_STRING],["generator",r.PROP_STRING],["groupby",r.PROP_STRING],["limit",r.PROP_NUMBER],["match",r.PROP_STRING],["matchmode",r.PROP_STRING],["maxchars",r.PROP_NUMBER],["maxvalue",r.PROP_NUMBER],["step",r.PROP_NUMBER],["mobiledisplay",Object.assign({value:!0},r.PROP_BOOLEAN)],["minvalue",r.PROP_NUMBER],["maxdate",r.PROP_STRING],["mindate",r.PROP_STRING],["excludedays",r.PROP_STRING],["excludedates",r.PROP_STRING],["maxtime",r.PROP_STRING],["mintime",r.PROP_STRING],["pcdisplay",Object.assign({value:!0},r.PROP_BOOLEAN)],["period",r.PROP_BOOLEAN],["placeholder",r.PROP_STRING],["prefix",r.PROP_STRING],["primary-key",r.PROP_BOOLEAN],["readonly",r.PROP_BOOLEAN],["regexp",r.PROP_ANY],["related-entity-name",r.PROP_STRING],["required",r.PROP_BOOLEAN],["rowactionsposition",r.PROP_STRING],["searchkey",r.PROP_STRING],["searchable",Object.assign({value:!0},r.PROP_BOOLEAN)],["showinfilter",Object.assign({value:!1},r.PROP_BOOLEAN)],["suffix",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["showcount",r.PROP_BOOLEAN],["showdropdownon",Object.assign({value:"default"},r.PROP_STRING)],["sortable",Object.assign({value:!0},r.PROP_BOOLEAN)],["tabletdisplay",Object.assign({value:!0},r.PROP_BOOLEAN)],["textalignment",Object.assign({value:"left"},r.PROP_STRING)],["textcolor",r.PROP_STRING],["type",Object.assign({value:"string"},r.PROP_STRING)],["uncheckedvalue",r.PROP_STRING],["validationmessage",r.PROP_STRING],["widget-type",r.PROP_STRING],["width",r.PROP_STRING]]))},z=function(){r.register("wm-table-column-group",new Map([["backgroundcolor",r.PROP_STRING],["caption",r.PROP_STRING],["col-class",r.PROP_STRING],["name",r.PROP_STRING],["textalignment",Object.assign({value:"center"},r.PROP_STRING)]]))},H={widgetType:"wm-table-column-group",hostClass:""},Y=function(e){function t(t,n,i){var o=e.call(this,t,H)||this;return o.group=n,o.table=i,o.config={},o}return g(t,e),t.prototype.populateConfig=function(){this.config={field:this.name,displayName:this.caption||"",columns:[],isGroup:!0,accessroles:this.accessroles,textAlignment:this.textalignment||"center",backgroundColor:this.backgroundcolor,class:this["col-class"]}},t.prototype.onPropertyChange=function(t,n,i){"caption"===t?(this.config.displayName=n||"",this.table.callDataGridMethod("setColumnProp",this.config.field,"displayName",n,!0)):e.prototype.onPropertyChange.call(this,t,n,i)},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.populateConfig();var t=parseInt(this.getAttr("headerIndex"),10),n=parseInt(this.getAttr("index"),10),i=this.group&&this.group.name;r.setHeaderConfigForTable(this.table.headerConfig,this.config,i,i?n:t)},t}(r.BaseComponent);Y.initializeProps=z(),Y.decorators=[{type:t.Directive,args:[{selector:"[wmTableColumnGroup]",providers:[r.provideAsWidgetRef(Y)]}]}],Y.ctorParameters=function(){return[{type:t.Injector},{type:Y,decorators:[{type:t.SkipSelf},{type:t.Optional}]},{type:S,decorators:[{type:t.Optional}]}]};var K={widgetType:"wm-table-column",hostClass:""},Q=["datafield","displayfield","placeholder","searchkey","matchmode","displaylabel","groupby","match","dateformat","showcount","collapsible","checkedvalue","uncheckedvalue","showdropdownon","dataentrymode","autoclose","dataset","outputformat"];Q=w(w([],b(Q)),b(["maxchars","regexp","minvalue","maxvalue","step","required","mindate","maxdate","excludedates","excludedays","mintime","maxtime"]));var Z=function(){function e(e){this.widget=e}return e.prototype.focus=function(){this.widget.focus()},e.prototype.setProperty=function(e,t){e="value"===e?"datavalue":e,this.widget[e]=t},e.prototype.getProperty=function(e){return e="value"===e?"datavalue":e,this.widget[e]},e}(),J=function(e){function t(t,n,i,o,a,r){var s=e.call(this,t,K)||this;return s.appDefaults=n,s.table=i,s.group=o,s.bindfilterdataset=a,s.binddataset=r,s.syncValidators=[],s.asyncValidators=[],s.observeOnFields=[],s.aggregate={sum:function(){return _.sum(s._getColumnData())},average:function(e){return void 0===e&&(e=2),_.round(_.mean(s._getColumnData()),e)},count:function(){return s._getColumnData().length},minimum:function(){return _.min(s._getColumnData())},maximum:function(){return _.max(s._getColumnData())},percent:function(e,t){return void 0===t&&(t=2),_.round(_.sum(s._getColumnData())/e*100,t)}},s.notifyForFields=[],s}return g(t,e),Object.defineProperty(t.prototype,"dataoptions",{get:function(){return this._dataoptions},set:function(e){this._dataoptions=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"datasource",{get:function(){return this._datasource},set:function(e){this._datasource=e},enumerable:!1,configurable:!0}),t.prototype.ngOnInit=function(){var t=this;e.prototype.ngOnInit.call(this),this.populateFieldDef();var n=parseInt(this.getAttr("index"),10),i=parseInt(this.getAttr("headerIndex"),10),o=this.group&&this.group.name;if(r.setHeaderConfigForTable(this.table.headerConfig,{field:this.field,displayName:this.displayName},o,o?n:i),this.table.registerColumns(this.widget,n),this._isRowFilter="multicolumn"===this.table.filtermode&&this.searchable,this._isInlineEditable=!this.readonly&&this.table.editmode!==r.EDIT_MODE.DIALOG&&this.table.editmode!==r.EDIT_MODE.FORM,this._isNewEditableRow=this._isInlineEditable&&this.table.editmode===r.EDIT_MODE.QUICK_EDIT&&this.table.shownewrow,this.setUpControls(),this._propsInitialized=!0,this.getFormControl()){var a=this.getFormControl().statusChanges.pipe(m.debounceTime(100)).subscribe((function(e){return t.onStatusChange(e,"inlineInstance")}));this.registerDestroyListener((function(){return a.unsubscribe()})),this.fieldValidations=new r.BaseFieldValidations(this,this.inlineInstance,this.editWidgetType,this.getFormControl(),this.table,"inlineInstance")}if(this._checkNewEditableRowControl()){var s=this.getFormControl("_new").statusChanges.pipe(m.debounceTime(100)).subscribe((function(e){return t.onStatusChange(e,"inlineInstanceNew")}));this.registerDestroyListener((function(){return s.unsubscribe()})),this.fieldValidations_new=new r.BaseFieldValidations(this,this.inlineInstanceNew,this.editWidgetType,this.getFormControl("_new"),this.table,"inlineInstanceNew")}},t.prototype.ngAfterContentInit=function(){var t=this;if(this._isRowFilter){var n=this._filterInstances.changes.subscribe((function(e){t.filterInstance=e.first&&e.first.widget,t.setUpFilterWidget()}));this.registerDestroyListener((function(){return n.unsubscribe()}))}if(this._isInlineEditable){var i=this._inlineInstances.changes.subscribe((function(e){t.inlineInstance=e.first&&e.first.widget,t.fieldValidations.formwidget=e.first,t.table.registerFormField(t.binding,new Z(t.inlineInstance)),t.setUpInlineWidget("inlineInstance")}));if(this.registerDestroyListener((function(){return i.unsubscribe()})),this._isNewEditableRow){var o=this._inlineInstancesNew.changes.subscribe((function(e){t.inlineInstanceNew=e.first&&e.first.widget,t.fieldValidations_new.formwidget=e.first,t.setUpInlineWidget("inlineInstanceNew")}));this.registerDestroyListener((function(){return o.unsubscribe()}))}}this.registerReadyStateListener((function(){t.key=t.field||t.binding})),e.prototype.ngAfterContentInit.call(this),this.table.isdynamictable&&this.table.inlineWidgetTmpl._results.push(this.inlineWidthTempRef)},t.prototype.ngAfterViewInit=function(){this.filterTemplateRef&&this.table.renderDynamicFilterColumn(this.filterTemplateRef)},t.prototype.applyValidations=function(){this.getFormControl()&&(this.syncValidators.length>0&&this.fieldValidations.setValidators(this.syncValidators),this.fieldValidations.setUpValidators(),this.asyncValidators.length>0&&this.fieldValidations.setAsyncValidators(this.asyncValidators),this.observeOnFields.length>0&&this.fieldValidations.observeOn(this.observeOnFields,"columns"))},t.prototype.removeValidations=function(){this.table.ngform.markAsUntouched();var e=this.getFormControl();e&&(e.clearValidators(),e.clearAsyncValidators(),e.updateValueAndValidity())},t.prototype.applyNewRowValidations=function(){this._checkNewEditableRowControl()&&(this.syncValidators.length>0&&this.fieldValidations_new.setValidators(this.syncValidators),this.fieldValidations_new.setUpValidators(),this.asyncValidators.length>0&&this.fieldValidations_new.setAsyncValidators(this.asyncValidators),this.observeOnFields.length>0&&this.fieldValidations_new.observeOn(this.observeOnFields,"columns"))},t.prototype.removeNewRowValidations=function(){if(this.table.ngform.markAsUntouched(),this._checkNewEditableRowControl()){var e=this.getFormControl("_new");e.clearValidators(),e.clearAsyncValidators(),e.updateValueAndValidity()}},t.prototype.addFormControl=function(e){var t=e?this.binding+e:this.binding;this.table.ngform.addControl(t,this.table.fb.control(""))},t.prototype.getFormControl=function(e){var t=e?this.binding+e:this.binding;return this.table.ngform.controls[t]},t.prototype._checkNewEditableRowControl=function(){return this._isNewEditableRow&&this.getFormControl("_new")},t.prototype.setUpControls=function(){var e=this;if(this._isInlineEditable){if(this.editWidgetType===u.FormWidgetType.UPLOAD)return;this.addFormControl();var t=this.getFormControl();if(t){var n=t.valueChanges.pipe(m.debounceTime(200)).subscribe((function(t){return e.onValueChange(t,"inlineInstance")}));this.registerDestroyListener((function(){return n.unsubscribe()}))}if(this._isNewEditableRow){this.addFormControl("_new");var i=this.getFormControl("_new");if(i){var o=i.valueChanges.pipe(m.debounceTime(200)).subscribe((function(t){return e.onValueChange(t,"inlineInstanceNew")}));this.registerDestroyListener((function(){return o.unsubscribe()}))}}}if(this._isRowFilter&&(this.addFormControl("_filter"),this.filterControl=this.getFormControl("_filter"),this.filterControl)){var a=this.filterControl.valueChanges.subscribe(this.onFilterValueChange.bind(this));this.registerDestroyListener((function(){return a.unsubscribe()}))}},t.prototype.resetFilter=function(){this.filterControl&&this.filterControl.setValue(""),this.filterwidget===u.FormWidgetType.AUTOCOMPLETE&&(this.filterInstance.query="",this.filterInstance.queryModel="")},t.prototype.onFilterValueChange=function(e){this.table.rowFilter[this.field].value=e},Object.defineProperty(t.prototype,"datavalue",{get:function(){return this[this.activeControlType]&&this[this.activeControlType].datavalue},set:function(e){var t=this.getFormControl("inlineInstanceNew"===this.activeControlType?"_new":void 0);t&&t&&this.editWidgetType!==u.FormWidgetType.UPLOAD&&t.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}),t.prototype.onValueChange=function(e,t){null!==e&&r.applyFilterOnField(this.table.datasource,this.widget,this.table.fieldDefs,e,{widget:"edit-widget-type"}),this.table.ngform.touched&&(this.activeControlType=t,"inlineInstance"===t?(this.notifyChanges(),this.fieldValidations.setCustomValidationMessage()):this._isNewEditableRow&&(this.notifyChanges("_new"),this.fieldValidations_new.setCustomValidationMessage()))},t.prototype.loadFilterData=function(){var e=this;this._isRowFilter&&r.isDataSetWidget(this.filterwidget)&&!this.bindfilterdataset&&(this.table.datasource.execute(u.DataSource.Operation.SUPPORTS_DISTINCT_API)?(this.relatedEntityName&&(this.widget["is-related"]=!0,this.widget["lookup-type"]=this.relatedEntityName,this.widget["lookup-field"]=_.last(_.split(this.field,"."))),this.filterwidget===u.FormWidgetType.AUTOCOMPLETE?(this.filterInstance.dataoptions=r.getDistinctFieldProperties(this.table.datasource,this),this.filterInstance.datasource=this.table.datasource):r.getDistinctValues(this.table.datasource,this.widget,"filterwidget").then((function(t){e._filterDataSet=t.data,e.setFilterWidgetDataSet()}))):this.registerDestroyListener(u.$watch(this.table.binddataset,this.viewParent,{},(function(t){return e.widget.filterdataset=t}),r.getWatchIdentifier(this.widgetId,"filterdataset"))))},t.prototype.loadInlineWidgetData=function(){if(r.isDataSetWidget(this["edit-widget-type"])&&!this.binddataset&&!this.readonly){var e=this.table.datasource;if(this["related-entity-name"]&&this["primary-key"]){this.isDataSetBound=!0;var t=_.split(this.binding,".");this.showPendingSpinner=!0,r.fetchRelatedFieldData(e,this.widget,{relatedField:_.head(t),datafield:_.last(t),widget:"edit-widget-type"})}else e.execute(u.DataSource.Operation.SUPPORTS_DISTINCT_API)&&r.getDistinctValuesForField(e,this.widget,{widget:"edit-widget-type"})}},t.prototype.onDataSourceChange=function(){this.loadFilterData(),this.table.editmode===r.EDIT_MODE.QUICK_EDIT&&this.loadInlineWidgetData()},t.prototype.setFilterWidgetDataSet=function(){this.filterInstance&&(this.filterInstance.dataset=this._filterDataSet)},t.prototype.setUpFilterWidget=function(){var e=this;this.filterInstance.registerReadyStateListener((function(){if(r.isDataSetWidget(e.filterwidget)){var t=_.last(e.binding.split("."));e.filterInstance.dataset=e._filterDataSet,e.filterInstance.datafield=e.filterdatafield||t,e.filterInstance.displayfield=e.filterdisplayfield||t,e.filterwidget===u.FormWidgetType.AUTOCOMPLETE&&(e.filterInstance.displaylabel=e.filterdisplaylabel||t,e.filterInstance.searchkey=e.filtersearchkey||t)}e.filterwidget===u.FormWidgetType.TIME&&(e.filterInstance.timepattern=e.appDefaults.timeFormat||"hh:mm:ss a"),e.filterInstance.placeholder=e.filterplaceholder||""}))},t.prototype.notifyChanges=function(e){var t=this;_.forEach(this.notifyForFields,(function(n){e&&t._isNewEditableRow?n.fieldValidations_new.validate():n.fieldValidations.validate()}))},t.prototype.observeOn=function(e){this.observeOnFields=_.cloneDeep(e)},t.prototype.setUpValidators=function(){this.fieldValidations.setUpValidators(),this._checkNewEditableRowControl()&&this.fieldValidations_new.setUpValidators()},t.prototype.setAsyncValidators=function(e){this.asyncValidators=_.cloneDeep(e)},t.prototype.setValidators=function(e){this.syncValidators=_.cloneDeep(e)},t.prototype.boundFn=function(e){return e()},t.prototype.onStatusChange=function(e,t){this["showPendingSpinner"+("inlineInstance"===t?"":"New")]="PENDING"===e},t.prototype.setSummaryRowData=function(e){var t=e instanceof Array?e:[e];this._invokeSummaryRowData(t)},t.prototype._invokeSummaryRowData=function(e){var t=this;_.forEach(e,(function(e,n){var i=e;if(i instanceof Promise)i.then((function(e){t.table.callDataGridMethod("setSummaryRowDef",t.key,e,n,!0)}));else if(i.value&&i.value instanceof Promise){var o=i;i.value.then((function(e){o.value=e,t.table.callDataGridMethod("setSummaryRowDef",t.key,o,n,!0)}))}t.table.callDataGridMethod("setSummaryRowDef",t.key,i,n)}))},t.prototype._getColumnData=function(){return _.map(this.table.dataset,this.binding)},t.prototype.setInlineWidgetProp=function(e,t,n){"datepattern"===t&&this.editWidgetType===u.FormWidgetType.TIME&&(t="timepattern"),this[e]&&u.isDefined(n)&&(this[e][t]=n)},t.prototype.setUpInlineWidget=function(e){var t=this;this[e].registerReadyStateListener((function(){r.isDataSetWidget(t["edit-widget-type"])&&(t[e].dataset=t.dataset),Q.forEach((function(n){t.setInlineWidgetProp(e,n,t[n])})),t[e].datasource=t._datasource,t[e].dataoptions=t._dataoptions,t.setInlineWidgetProp(e,"datepattern",t.editdatepattern)}))},t.prototype.getStyleDef=function(){return"width: "+(this.width||"")+"; background-color: "+(this.backgroundcolor||"")+"; color: "+(this.textcolor||"")+";"},t.prototype.populateFieldDef=function(){if(this.width="px"===this.width?"":this.width||"",this.field=this.binding,this.displayName=this.caption||"",this.pcDisplay=this.pcdisplay,this.mobileDisplay=this.mobiledisplay,this.tabletDisplay=this.tabletdisplay,this.textAlignment=this.textalignment,this.backgroundColor=this.backgroundcolor,this.textColor=this.textcolor,this.primaryKey=this["primary-key"],this.relatedEntityName=this["related-entity-name"],this.style=this.getStyleDef(),this.class=this["col-class"],this.ngclass=this["col-ng-class"],this.formatpattern="toNumber"===this.formatpattern?"numberToString":this.formatpattern,this.searchable="blob"!==this.type&&"clob"!==this.type&&this.searchable,this.showinfilter=!this.nativeElement.hasAttribute("showinfilter")||this.table&&this.table.isdynamictable?this.show:this.nativeElement.getAttribute("showinfilter"),this.limit=this.limit?+this.limit:void 0,this.editWidgetType=this["edit-widget-type"]=this["edit-widget-type"]||r.getEditModeWidget(this),this.filterOn=this["filter-on"],this.readonly=u.isDefined(this.getAttr("readonly"))?"true"===this.getAttr("readonly"):this["related-entity-name"]?!this["primary-key"]:_.includes(["identity","uniqueid","sequence"],this.generator),this.filterwidget=this.filterwidget||r.getDataTableFilterWidget(this.type||"string"),this.isFilterDataSetBound=!!this.bindfilterdataset,this.defaultvalue=r.getDefaultValue(this.defaultvalue,this.type,this.editWidgetType),u.isDateTimeType(this.type)&&"toDate"===this.formatpattern&&!this.datepattern){var e=u.getDisplayDateTimeFormat(this.type);this.type===u.DataType.DATE?this.datepattern=this.appDefaults.dateFormat||e:this.type===u.DataType.TIME?this.datepattern=this.appDefaults.timeFormat||e:this.type!==u.DataType.TIMESTAMP&&this.type!==u.DataType.DATETIME||(this.datepattern=this.appDefaults.dateTimeFormat||e)}},t.prototype.onPropertyChange=function(t,n,i){if(this._propsInitialized){switch(t){case"caption":this.displayName=n||"",this.setProperty("displayName",this.displayName);break;case"defaultvalue":this.defaultvalue=r.getDefaultValue(this.defaultvalue,this.type,this.editWidgetType);break;case"show":this.table.redraw(!0),this.showinfilter=this.nativeElement.hasAttribute("showinfilter")?this.nativeElement.getAttribute("showinfilter"):n;break;case"filterdataset":this._filterDataSet=n,this.setFilterWidgetDataSet();break;case"editdatepattern":this.setInlineWidgetProp("inlineInstance","datepattern",n),this.setInlineWidgetProp("inlineInstanceNew","datepattern",n);break;case"showinfilter":this.showinfilter=n;break;default:Q.includes(t)&&(this.setInlineWidgetProp("inlineInstance",t,n),this.setInlineWidgetProp("inlineInstanceNew",t,n))}e.prototype.onPropertyChange.call(this,t,n,i)}},t.prototype.setProperty=function(e,t){switch(this[e]=t,e){case"displayName":this.table.callDataGridMethod("setColumnProp",this.field,e,t);break;default:this.table.redraw(!0)}},t}(r.BaseComponent);J.initializeProps=q(),J.decorators=[{type:t.Directive,args:[{selector:"[wmTableColumn]",providers:[r.provideAsWidgetRef(J)]}]}],J.ctorParameters=function(){return[{type:t.Injector},{type:u.AppDefaults},{type:S,decorators:[{type:t.Optional}]},{type:Y,decorators:[{type:t.Optional}]},{type:void 0,decorators:[{type:t.Attribute,args:["filterdataset.bind"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["dataset.bind"]}]}]},J.propDecorators={_filterInstances:[{type:t.ContentChildren,args:["filterWidget"]}],_inlineInstances:[{type:t.ContentChildren,args:["inlineWidget"]}],_inlineInstancesNew:[{type:t.ContentChildren,args:["inlineWidgetNew"]}],customExprTmpl:[{type:t.ContentChild,args:["customExprTmpl"]}],inlineWidthTempRef:[{type:t.ContentChild,args:["inlineWidgetTmpl"]}],filterTemplateRef:[{type:t.ContentChild,args:["filterTmpl"]}]};var X=function(){r.register("wm-table-row",new Map([["class",r.PROP_STRING],["closeothers",Object.assign({value:!0},r.PROP_BOOLEAN)],["content",r.PROP_STRING],["columnwidth",Object.assign({value:"30px"},r.PROP_STRING)],["collapseicon",r.PROP_STRING],["expandicon",r.PROP_STRING],["height",r.PROP_STRING],["position",Object.assign({value:"0"},r.PROP_STRING)]]))},ee={widgetType:"wm-table-row",hostClass:""},te=function(e){function t(t,n){var i=e.call(this,t,ee)||this;return i.table=n,i}return g(t,e),t.prototype.populateConfig=function(){this.config={closeothers:this.closeothers,content:this.content,columnwidth:this.columnwidth,expandicon:this.expandicon,collapseicon:this.collapseicon,height:this.height,position:this.position}},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.populateConfig(),this.table.registerRow(this.config,this)},t.prototype.onPropertyChange=function(e,t){"content"===e&&this.config&&(this.config.content=this.content)},t}(r.BaseComponent);te.initializeProps=X(),te.decorators=[{type:t.Directive,args:[{selector:"[wmTableRow]",providers:[r.provideAsWidgetRef(te)]}]}],te.ctorParameters=function(){return[{type:t.Injector},{type:S,decorators:[{type:t.Optional},{type:t.SkipSelf}]}]};var ne=function(){r.register("wm-table-row-action",new Map([["accessroles",r.PROP_STRING],["action",r.PROP_STRING],["caption",r.PROP_STRING],["class ",Object.assign({value:"btn-secondary"},r.PROP_STRING)],["disabled",Object.assign({value:!1},r.PROP_BOOLEAN)],["display-name",r.PROP_STRING],["hyperlink",r.PROP_STRING],["iconclass",r.PROP_STRING],["key",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["target",r.PROP_STRING],["title",r.PROP_STRING],["widget-type",Object.assign({value:"button"},r.PROP_STRING)]]))},ie={widgetType:"wm-table-row-action",hostClass:""},oe=function(e){function t(t,n,i){var o=e.call(this,t,ie)||this;return o.table=n,i[0].editRow=function(e){return o.table.editRow(e)},i[0].deleteRow=function(e){return o.table.deleteRow(e)},i[0].addNewRow=function(e){return o.table.addNewRow(e)},o}return g(t,e),t.prototype.getTitle=function(){return _.isUndefined(this.title)?this["display-name"]||"":this.title},t.prototype.populateAction=function(){this.buttonDef={key:this.key,displayName:this["display-name"]||this.caption||"",show:this.show,class:this.class||"",iconclass:this.iconclass||"",title:this.getTitle(),action:this.action,accessroles:this.accessroles,disabled:this.disabled,tabindex:this.tabindex?+this.tabindex:void 0,widgetType:this["widget-type"]||"button",hyperlink:this.hyperlink,target:this.target||"",conditionalclass:this.conditionalclass||"",conditionalstyle:this.conditionalstyle||{}}},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.populateAction(),this.table.registerRowActions(this.buttonDef)},t}(r.BaseComponent);oe.initializeProps=ne(),oe.decorators=[{type:t.Directive,args:[{selector:"[wmTableRowAction]",providers:[r.provideAsWidgetRef(oe),{provide:r.Context,useValue:{},multi:!0}]}]}],oe.ctorParameters=function(){return[{type:t.Injector},{type:S,decorators:[{type:t.Optional}]},{type:Array,decorators:[{type:t.Self},{type:t.Inject,args:[r.Context]}]}]};var ae=[S,x,G,U,J,Y,te,oe],re=function(){};re.decorators=[{type:t.NgModule,args:[{imports:[s.BasicModule,a.BsDropdownModule,n.CommonModule,i.FormsModule,i.ReactiveFormsModule,l.InputModule,p.ListModule,c.MenuModule,d.PaginationModule,o.TooltipModule,r.WmComponentsModule],declarations:w([],b(ae)),exports:w([],b(ae)),entryComponents:[]}]}],e.TableActionDirective=U,e.TableCUDDirective=x,e.TableColumnDirective=J,e.TableColumnGroupDirective=Y,e.TableComponent=S,e.TableFilterSortDirective=G,e.TableModule=re,e.TableRowActionDirective=oe,e.TableRowDirective=te,e["\u0275a"]=P,e["\u0275b"]=V,e["\u0275c"]=z,e["\u0275d"]=q,e["\u0275e"]=X,e["\u0275f"]=ne,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("rxjs/operators"),require("@wm/core"),require("@wm/components/data/table")):"function"==typeof define&&define.amd?define("@wm/components/data/live-table",["exports","@angular/core","@angular/common","@wm/components/base","rxjs/operators","@wm/core","@wm/components/data/table"],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.livetable={}),e.ng.core,e.ng.common,e.wm.components.base,e.rxjs.operators,e.wm.core,e.wm.components.data.table)}(this,(function(e,t,n,i,o,a,r){"use strict";
|
|
520
|
+
***************************************************************************** */var f=function(e,t){return(f=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 g(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}f(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function v(e,t,n,i){return new(n||(n=Promise))((function(o,a){function r(e){try{l(i.next(e))}catch(e){a(e)}}function s(e){try{l(i.throw(e))}catch(e){a(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(r,s)}l((i=i.apply(e,t||[])).next())}))}function y(e,t){var n,i,o,a,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],i=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}Object.create;function b(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,a=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return r}function w(e,t,n){if(n||2===arguments.length)for(var i,o=0,a=t.length;o<a;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var P=function(){r.register("wm-table",new Map([["boundarylinks",Object.assign({value:!1},r.PROP_BOOLEAN)],["class",r.PROP_STRING],["confirmdelete",Object.assign({value:"Are you sure you want to delete this?"},r.PROP_STRING)],["datasource",r.PROP_STRING],["dataset",r.PROP_ANY],["deletecanceltext",r.PROP_STRING],["deleteoktext",r.PROP_STRING],["deletemessage",Object.assign({value:"Record deleted successfully"},r.PROP_STRING)],["directionlinks",Object.assign({value:!0},r.PROP_BOOLEAN)],["editmode",r.PROP_STRING],["errorstyle",Object.assign({value:"hover"},r.PROP_STRING)],["enablecolumnselection",Object.assign({value:!1},r.PROP_BOOLEAN)],["enablesort",Object.assign({value:!0},r.PROP_BOOLEAN)],["errormessage",r.PROP_STRING],["exportformat",r.PROP_STRING],["exportdatasize",Object.assign({value:100},r.PROP_NUMBER)],["filtermode",r.PROP_STRING],["filternullrecords",Object.assign({value:!0},r.PROP_BOOLEAN)],["forceellipses",Object.assign({value:!0},r.PROP_BOOLEAN)],["formposition",r.PROP_STRING],["gridclass",Object.assign({value:"table-hover"},r.PROP_STRING)],["gridfirstrowselect",r.PROP_BOOLEAN],["iconclass",r.PROP_STRING],["insertmessage",Object.assign({value:"Record added successfully"},r.PROP_STRING)],["isdynamictable",r.PROP_BOOLEAN],["isrowexpansionenabled",r.PROP_BOOLEAN],["loadingdatamsg",Object.assign({value:"Loading..."},r.PROP_STRING)],["loadingicon",Object.assign({value:"fa fa-circle-o-notch fa-spin"},r.PROP_STRING)],["maxsize",Object.assign({value:5},r.PROP_NUMBER)],["multiselect",r.PROP_BOOLEAN],["name",r.PROP_STRING],["navigation",Object.assign({value:"Basic"},r.PROP_STRING)],["navigationalign",Object.assign({value:"left"},r.PROP_STRING)],["nodatamessage",Object.assign({value:"No data found."},r.PROP_STRING)],["ondemandmessage",Object.assign({value:"Load More"},r.PROP_STRING)],["showviewlessbutton",Object.assign({value:!1},r.PROP_BOOLEAN)],["viewlessmessage",Object.assign({value:"View Less"},r.PROP_STRING)],["pagesize",r.PROP_NUMBER],["radioselect",r.PROP_BOOLEAN],["rowclass",r.PROP_STRING],["rowngclass",r.PROP_STRING],["searchlabel",Object.assign({value:"Search"},r.PROP_STRING)],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["showheader",Object.assign({value:!0},r.PROP_BOOLEAN)],["shownewrow",Object.assign({value:!0},r.PROP_BOOLEAN)],["showrecordcount",r.PROP_BOOLEAN],["showrowindex",r.PROP_BOOLEAN],["spacing",Object.assign({value:"normal"},r.PROP_STRING)],["statehandler",Object.assign({value:"none"},r.PROP_STRING)],["subheading",r.PROP_STRING],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["title",r.PROP_STRING],["updatemessage",Object.assign({value:"Record updated successfully"},r.PROP_STRING)]]))},O={widgetType:"wm-table",hostClass:"app-grid app-panel panel"},E={EXCEL:"fa fa-file-excel-o",CSV:"fa fa-file-text-o"},R="rowOperations",A=function(){},T=function(e){var t=!1;[".dropdown-menu",".uib-typeahead-match",".modal-dialog",".toast"].forEach((function(n){if(e.closest(n).length)return t=!0,!1}));return t||["bsdatepickerdaydecorator"].forEach((function(n){if(e[0].hasAttribute(n))return t=!0,!1})),t},S=function(e){function t(t,n,i,o,a,s,l,c,p,d,f,g,v){var y=e.call(this,t,O)||this;return y.inj=t,y.fb=n,y.app=i,y.dynamicComponentProvider=o,y.statePersistence=a,y.paginationService=s,y.viewport=l,y.parentList=c,y.binddataset=p,y.binddatasource=d,y.readonlygrid=f,y.ngZone=g,y.trustAsPipe=v,y.rowActionsCompiledTl={},y.rowFilterCompliedTl={},y.inlineCompliedTl={},y.inlineNewCompliedTl={},y.customExprCompiledTl={},y.customExprCompiledSummaryTl={},y.rowDefInstances={},y.rowDefMap={},y.rowExpansionActionTl={},y.columns={},y.formfields={},y.enablesort=!0,y.showviewlessbutton=!1,y.primaryKey=[],y.selectedItems=[],y.selectedItemChange=new h.Subject,y.selectedItemChange$=y.selectedItemChange.asObservable(),y.actions=[],y._actions={header:[],footer:[]},y.exportOptions=[],y.headerConfig=[],y.items=[],y.rowActions=[],y.shownavigation=!1,y.documentClickBind=A,y.prevFilterExpression=[],y.fieldDefs=[],y.rowDef={},y.rowInstance={},y.fullFieldDefs=[],y.variableInflight=!0,y.applyProps=new Map,y.redraw=_.debounce(y._redraw,150),y.debouncedHandleLoading=_.debounce(y.handleLoading,350),y.rowFilter={},y._searchSortHandler=A,y.searchSortHandler=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];y._searchSortHandler.apply(y,e)},y.onRowFilterChange=A,y.onFilterConditionSelect=A,y.showClearIcon=A,y.clearRowFilter=A,y.adjustContainer=A,y._pageLoad=!0,y.gridOptions={data:[],colDefs:[],startRowIndex:1,mode:"",sortInfo:{field:"",direction:""},filtermode:"",searchLabel:"",rowActions:[],headerConfig:[],rowClass:"",editmode:"",formPosition:"",isMobile:!1,rowExpansionEnabled:!1,rowDef:{position:"0"},name:"",messages:{selectField:"Select Field"},securityUtils:{pipeTransform:{}},navigation:"",isdynamictable:"",deletedRowIndex:-1,lastActionPerformed:"scroll",isSearchTrigerred:!1,isDatasetUpdated:!1,isDataUpdatedByUser:!1,showviewlessbutton:!1,ondemandmessage:"",viewlessmessage:"",loadingdatamsg:"",isNextPageData:void 0,ACTIONS:{DELETE:"delete",EDIT:"edit",SEARCH_OR_SORT:"search_or_sort",DEFAULT:"scroll",FILTER_CRITERIA:"filter",DATASET_UPDATE:"dataset_update"},actionRowIndex:void 0,actionRowPage:void 0,isLastPage:!1,getCurrentPage:function(){return _.get(y.dataNavigator,"dn.currentPage")||1},setCurrentPage:function(e){_.set(y.dataNavigator,"dn.currentPage",e||1)},getDataSource:function(){return y.datasource},getPageSize:function(){return y.pagesize},getPageCount:function(){return y.dataNavigator.pageCount},enableNavigation:function(){y.dataNavigator.widget.isDisableNext=!1,y.dataNavigator.widget.isDisableLast=!1,y.gridOptions.mode="viewless"},setDeletedRowIndex:function(e){y.setDataGridOption("deletedRowIndex",e)},setLastActionPerformed:function(e){y.setDataGridOption("lastActionPerformed",e||y.gridOptions.lastActionPerformed)},isNavTypeScrollOrOndemand:function(){return"Scroll"===y.gridOptions.navigation||"On-Demand"===y.gridOptions.navigation},setIsSearchTrigerred:function(e){y.setDataGridOption("isSearchTrigerred",e)},setIsDatasetUpdated:function(e){y.setDataGridOption("isDatasetUpdated",e)},setIsNextPageData:function(e){y.setDataGridOption("isNextPageData",e)},setIsDataUpdatedByUser:function(e){y.setDataGridOption("isDataUpdatedByUser",e)},onDataRender:function(){y.ngZone.run((function(){y.gridData.length&&y.invokeEventCallback("datarender",{$data:y.gridData,data:y.gridData}),y.multiselect||(y.items.length=0),y.callDataGridMethod("selectRows",y.items),y.selectedItems=y.callDataGridMethod("getSelectedRows"),y.selectedItems.length&&y.selectedItemChange.next(y.selectedItems),y._isPageSearch&&y.filterInfo&&y.searchSortHandler(y.filterInfo,void 0,"search")}))},onRowSelect:function(e,t){y.ngZone.run((function(){y.selectedItems=y.callDataGridMethod("getSelectedRows"),y.selectedItems.length&&y.selectedItemChange.next(y.selectedItems);var n=y.addRowIndex(e);if(y.selectedItems.length&&n.$index&&"none"!==y.getConfiguredState()&&y.dataNavigator&&r.unsupportedStatePersistenceTypes.indexOf(y.navigation)<0){var i={page:y.dataNavigator.dn.currentPage,index:n.$index-1},o=y.statePersistence.getWidgetState(y);_.get(o,"selectedItem")&&y.multiselect?(_.some(o.selectedItem,i)||o.selectedItem.push(i),y.statePersistence.setWidgetState(y,{selectedItem:o.selectedItem})):y.statePersistence.setWidgetState(y,{selectedItem:[i]})}else console.warn("Retain State handling on Widget "+y.name+" is not supported for current pagination type.");y.invokeEventCallback("rowselect",{$data:n,$event:t,row:n})}))},assignSelectedItems:function(e,t){y.ngZone.run((function(){y.multiselect?-1===_.findIndex(y.items,e)&&y.items.push(e):(y.items.length=0,y.items.push(e))}))},onRowDblClick:function(e,t){var n=y.addRowIndex(e);y.invokeEventCallback("rowdblclick",{$data:n,$event:t,row:n})},onRowDeselect:function(e,t){y.multiselect&&y.ngZone.run((function(){y.items=_.pullAllWith(y.items,[e],_.isEqual),y.selectedItems=y.callDataGridMethod("getSelectedRows"),y.invokeEventCallback("rowdeselect",{$data:e,$event:t,row:e});var n=y.addRowIndex(e);if("none"!==y.getConfiguredState()&&r.unsupportedStatePersistenceTypes.indexOf(y.navigation)<0){var i={page:y.dataNavigator.dn.currentPage,index:n.$index-1},o=y.statePersistence.getWidgetState(y);_.get(o,"selectedItem")&&(_.remove(o.selectedItem,(function(e){return _.isEqual(e,i)})),y.statePersistence.removeWidgetState(y,"selectedItem"),o.selectedItem.length>0&&y.statePersistence.setWidgetState(y,{selectedItem:o.selectedItem}))}else console.warn("Retain State handling on Widget "+y.name+" is not supported for current pagination type.")}))},callOnRowDeselectEvent:function(e,t){y.items=y.selectedItems=y.callDataGridMethod("getSelectedRows"),y.invokeEventCallback("rowdeselect",{$data:e,$event:t,row:e})},callOnRowClickEvent:function(e,t){y.ngZone.run((function(){if(t&&t.hasOwnProperty("originalEvent")){var n=y.addRowIndex(e);y.invokeEventCallback("rowclick",{$data:n,$event:t,row:n})}}))},closePopover:u.closePopover,onColumnSelect:function(e,t){y.selectedColumns=y.callDataGridMethod("getSelectedColumns"),y.invokeEventCallback("columnselect",{$data:e,$event:t})},onColumnDeselect:function(e,t){y.selectedColumns=y.callDataGridMethod("getSelectedColumns"),y.invokeEventCallback("columndeselect",{$data:e,$event:t})},onHeaderClick:function(e,t){y.invokeEventCallback("headerclick",{$event:t,$data:e,column:e})},onRowDelete:function(e,t,n,i,o){y.ngZone.run((function(){y.deleteRecord(_.extend({},o,{row:e,cancelRowDeleteCallback:t,evt:n,callBack:i}))}))},onRowInsert:function(e,t,n,i){y.insertRecord(_.extend({},i,{row:e,event:t,callBack:n}))},beforeRowUpdate:function(e,t){y._liveTableParent&&y._liveTableParent.updateRow(e,t),y.prevData=u.getClonedObject(e)},afterRowUpdate:function(e,t,n,i){y.updateRecord(_.extend({},i,{row:e,prevData:y.prevData,event:t,callBack:n}))},onBeforeRowUpdate:function(e,t,n){return y.invokeEventCallback("beforerowupdate",{$event:t,$data:e,row:e,options:n})},onBeforeRowInsert:function(e,t,n){return y.invokeEventCallback("beforerowinsert",{$event:t,$data:e,row:e,options:n})},onBeforeRowDelete:function(e,t,n){var i=y.addRowIndex(e);return y.invokeEventCallback("beforerowdelete",{$event:t,row:i,options:n})},onFormRender:function(e,t,n,i){var o=i?"inlineInstanceNew":"inlineInstance";setTimeout((function(){y.formWidgets={},y.fieldDefs.forEach((function(e){e[o]&&(y.formWidgets[e.field]=e[o],e[o].context&&(e[o].context.formWidgets=y.formWidgets),y.setDisabledOnField(n,e,o))})),y.invokeEventCallback("formrender",{$event:t,formWidgets:y.formWidgets,$operation:n})}),250)},onBeforeFormRender:function(e,t,n){return y.invokeEventCallback("beforeformrender",{$event:t,row:e,$operation:n})},registerRowNgClassWatcher:function(e,t){if(y.rowngclass){var n=y.getClonedRowObject(e),i=y.widgetId+"_rowNgClass_"+t;u.$unwatch(i),y.registerDestroyListener(u.$watch(y.rowngclass,y.viewParent,{row:n},(function(e,n){y.callDataGridMethod("applyRowNgClass",r.getConditionalClasses(e,n),t)}),i))}},registerColNgClassWatcher:function(e,t,n,i){if(t["col-ng-class"]){var o=y.getClonedRowObject(e),a=y.widgetId+"_colNgClass_"+n+"_"+i;u.$unwatch(a),y.registerDestroyListener(u.$watch(t["col-ng-class"],y.viewParent,{row:o},(function(e,t){y.callDataGridMethod("applyColNgClass",r.getConditionalClasses(e,t),n,i)}),a))}},clearCustomExpression:function(){y.customExprViewRef.clear(),y.customExprCompiledTl={},y.customExprCompiledSummaryTl={}},clearRowDetailExpression:function(){y.rowDetailViewRef.clear(),y.rowDefMap={},y.rowDefInstances={}},generateCustomExpressions:function(e,t,n){var i=y.getClonedRowObject(e),o=function(e){if(e){var o={},a={row:i,colDef:o};y.addEventsToContext(a);var r=y.customExprViewRef.createEmbeddedView(e,a).rootNodes[0],s=r.getAttribute("data-col-identifier");_.extend(o,y.columns[s]),n?y.customExprCompiledSummaryTl[s+t]=r:y.customExprCompiledTl[s+t]=r}};y.isdynamictable?y.fieldDefs.forEach((function(e){o(e.customExprTmpl)})):y.customExprTmpl.forEach(o.bind(y))},generateRowExpansionCell:function(e,t){var n=y.getClonedRowObject(e);y.rowExpansionActionTmpl.forEach((function(e){y.rowExpansionActionTl[t]=y.rowExpansionActionViewRef.createEmbeddedView(e,{row:n}).rootNodes}))},getRowExpansionAction:function(e){return y.rowExpansionActionTl[e]},generateRowDetailView:function(e,t,n,i,o,a){var r=y.getClonedRowObject(t),s=u.getClonedObject(y.rowDef);if(!1!==y.rowInstance.invokeEventCallback("beforerowexpand",{$event:e,$data:s,row:r})&&s.content)if(a(),y.rowDefMap[n]&&y.rowDefMap[n].content===s.content)y.rowInstance.invokeEventCallback("rowexpand",{$event:e,row:r,$data:y.rowDefInstances[n]});else{y.rowDefMap[n]=s,i.empty(),i.hide(),o.show();var l={row:r,rowDef:s,containerLoad:function(t){setTimeout((function(){o.hide(),i.show(),y.rowDefInstances[n]=t,y.rowInstance.invokeEventCallback("rowexpand",{$event:e,row:r,$data:t})}),500)}},c=y.rowDetailViewRef.createEmbeddedView(y.rowExpansionTmpl,l).rootNodes[0];i[0].appendChild(c),u.$appDigest()}},onBeforeRowCollapse:function(e,t,n){return y.rowInstance.invokeEventCallback("beforerowcollapse",{$event:e,row:t,$data:y.rowDefInstances[n]})},onRowCollapse:function(e,t){y.rowInstance.invokeEventCallback("rowcollapse",{$event:e,row:t})},getCustomExpression:function(e,t,n){return(n?y.customExprCompiledSummaryTl[e+t]:y.customExprCompiledTl[e+t])||""},clearRowActions:function(){y.rowActionsViewRef.clear(),y.rowActionsCompiledTl={},y.rowExpansionActionViewRef.clear(),y.rowExpansionActionTl={}},generateRowActions:function(e,t){var n=y.getClonedRowObject(e);y.rowActionsCompiledTl[t]=[],y.rowActionTmpl.forEach((function(e){var i;(i=y.rowActionsCompiledTl[t]).push.apply(i,w([],b(y.rowActionsViewRef.createEmbeddedView(e,{row:n}).rootNodes)))}))},getRowAction:function(e){return y.rowActionsCompiledTl[e]},generateInlineEditRow:function(e,t){var n=y.getClonedRowObject(e);if(t)return y.inlineEditNewViewRef.clear(),y.inlineNewCompliedTl={},y.inlineWidgetNewTmpl.forEach((function(e){var t,i={row:n,getControl:function(){return y.ngform.controls[t+"_new"]||{}},getValidationMessage:function(){return y.columns[t]&&y.columns[t].validationmessage},getPendingSpinnerStatusNew:function(){return y.columns[t]&&y.columns[t].showPendingSpinnerNew}},o=y.inlineEditNewViewRef.createEmbeddedView(e,i).rootNodes[0];t=o.getAttribute("data-col-identifier"),y.inlineNewCompliedTl[t]=o})),void y.clearForm(!0);y.inlineEditViewRef.clear(),y.inlineCompliedTl={},y.clearForm(),y.inlineWidgetTmpl.forEach((function(e){var t,i={row:n,getControl:function(){return y.ngform.controls[t]||{}},getValidationMessage:function(){return y.columns[t]&&y.columns[t].validationmessage},getPendingSpinnerStatus:function(){return y.columns[t]&&y.columns[t].showPendingSpinner}},o=y.inlineEditViewRef.createEmbeddedView(e,i).rootNodes[0];t=o.getAttribute("data-col-identifier"),y.inlineCompliedTl[t]=o}))},getInlineEditWidget:function(e,t,n){return n?(y.gridOptions.setFieldValue(e+"_new",t),y.inlineNewCompliedTl[e]):(y.gridOptions.setFieldValue(e,t),y.inlineCompliedTl[e])},setFieldValue:function(e,t){var n=y.ngform.controls&&y.ngform.controls[e];n&&n.setValue(t)},getFieldValue:function(e){var t=y.ngform.controls&&y.ngform.controls[e];return t&&t.value},addLoadMoreBtn:function(){y.callDataGridMethod("addLoadMoreBtn",y.ondemandmessage,y.loadingdatamsg,(function(e){y.gridOptions.setIsNextPageData(!0),y.gridOptions.setIsDataUpdatedByUser(!1),"viewless"===y.gridOptions.mode?(y.dataNavigator.navigatePage("first",e,!0),y.gridOptions.mode=""):(y.dataNavigator.navigatePage("next",e),y.isDataLoading=!0)}),y.infScroll)},bindScrollEvt:function(){y._gridData&&y._gridData.length&&y.infScroll&&setTimeout((function(){y.paginationService.bindScrollEvt(y,"tbody",r.DEBOUNCE_TIMES.PAGINATION_DEBOUNCE_TIME)}),0)},generateFilterRow:function(){y.filterViewRef.clear(),y.rowFilterCompliedTl={},y.filterTmpl.forEach((function(e){var t=y.filterViewRef.createEmbeddedView(e,{changeFn:y.onRowFilterChange.bind(y),isDisabled:function(e){return y.emptyMatchModes.indexOf(y.rowFilter[e]&&y.rowFilter[e].matchMode)>-1}}).rootNodes[0];y.rowFilterCompliedTl[t.getAttribute("data-col-identifier")]=t}))},getFilterWidget:function(e){return y.rowFilterCompliedTl[e]},setGridEditMode:function(e){y.ngZone.run((function(){y.isGridEditMode=e,u.$appDigest()}))},setGridState:function(e){y.isLoading="loading"===e},setActionRowIndex:function(e){y.gridOptions.isNavTypeScrollOrOndemand()&&(y.actionRowIndex=parseInt(e),y.setDataGridOption("actionRowIndex",y.actionRowIndex),_.isNaN(y.actionRowIndex)||(y.actionRowPage=Math.floor(y.actionRowIndex/y.pagesize)+1,y.setDataGridOption("actionRowPage",y.actionRowPage||y.gridOptions.actionRowPage)))},clearActionRowIndex:function(){y.isRowDeleted||!y.infScroll&&!y.onDemandLoad||y.clearActionRowVars()},noChangesDetected:function(){y.toggleMessage(!0,"info","No Changes Detected","")},redrawWidgets:function(){y.fieldDefs.forEach((function(e){u.triggerFn(e.inlineInstance&&e.inlineInstance.redraw),u.triggerFn(e.inlineInstanceNew&&e.inlineInstanceNew.redraw),u.triggerFn(e.filterInstance&&e.filterInstance.redraw)}))},searchHandler:y.searchSortHandler.bind(y),sortHandler:y.searchSortHandler.bind(y),timeoutCall:function(e,t){setTimeout(e,t)},runInNgZone:function(e){y.ngZone.run(e)},safeApply:function(){u.$appDigest()},setTouched:function(e){var t=y.ngform.controls[e];t&&t.markAsTouched()},clearForm:y.clearForm.bind(y),callLoadInlineWidgetData:function(){y.fullFieldDefs.forEach((function(e){_.isUndefined(e.isDataSetBound)&&u.triggerFn(e.loadInlineWidgetData&&e.loadInlineWidgetData.bind(e))}))},applyValidations:function(e,t){t?u.triggerFn(e.applyNewRowValidations&&e.applyNewRowValidations.bind(e)):u.triggerFn(e.applyValidations&&e.applyValidations.bind(e))},removeValidations:function(e){y.fullFieldDefs.forEach((function(t){t.readonly||"rowOperations"===t.binding||(e?u.triggerFn(t.removeNewRowValidations&&t.removeNewRowValidations.bind(t)):u.triggerFn(t.removeValidations&&t.removeValidations.bind(t)))}))}},y._selectedItemsExist=!1,y._onChange=function(){},y._onTouched=function(){},r.styler(y.nativeElement,y),y.ngform=n.group({}),y.addEventsToContext(y.context),[y.app.subscribe("check-state-persistence-options",(function(e){var t=_.get(y.datasource,"name");if(t||(t=r.extractDataSourceName(y.binddatasource)),_.get(e,"variable.name")===t&&y._pageLoad&&"none"!==y.getConfiguredState()){y._pageLoad=!1;var n=y.statePersistence.getWidgetState(y);n?e=y.handleStateParams(n,e):y.setDataGridOption("selectFirstRow",y.gridfirstrowselect)}})),y.app.subscribe("toggle-variable-state",(function(e){if(y.datasource&&y.datasource.execute(u.DataSource.Operation.IS_API_AWARE)&&u.isDataSourceEqual(e.variable,y.datasource)){if(y._pageLoad&&"none"!==y.getConfiguredState()){y._pageLoad=!1;var t=y.statePersistence.getWidgetState(y);t?e=y.handleStateParams(t,e):y.setDataGridOption("selectFirstRow",y.gridfirstrowselect)}u.isDefined(y.variableInflight)?y.debouncedHandleLoading(e):y.handleLoading(e)}})),y.app.subscribe("setup-cud-listener",(function(e){y.name===e&&(y._isDependent=!0,y.selectedItemChange$.pipe(m.debounceTime(250)).subscribe(y.triggerWMEvent.bind(y)))}))].forEach((function(e){return y.registerDestroyListener(e)})),y.deleteoktext=y.appLocale.LABEL_OK,y.deletecanceltext=y.appLocale.LABEL_CANCEL,y}return g(t,e),Object.defineProperty(t.prototype,"gridData",{get:function(){return this._gridData||[]},set:function(e){var t;if(this.isDataLoading=!1,!this.variableInflight||!_.isEmpty(e)){if(this.variableInflight=!1,e&&0===e.length?this.callDataGridMethod("setStatus","nodata",this.nodatamessage):this.callDataGridMethod("setStatus","ready"),this.gridOptions.isNavTypeScrollOrOndemand()){if(t=b(this.paginationService.updateFieldsOnPagination(this,e),2),this._gridData=t[0],this.currentPage=t[1],this.gridOptions.lastActionPerformed===this.gridOptions.ACTIONS.EDIT){var n=_.floor(this.actionRowIndex%this.pagesize);this._gridData.splice(this.actionRowIndex,1,e[n])}this.setDataGridOption("isLastPage",!!this.dataNavigator.isDisableNext),this.$element.find(".on-demand-datagrid").length||this.dataNavigator.isDisableNext||!this.onDemandLoad?this._gridData&&this._gridData.length&&(this.dataNavigator.isDisableNext||!this.isDataLoading)&&this.callDataGridMethod("hideLoadingIndicator",this.dataNavigator.isDisableNext,this.infScroll):this.gridOptions.addLoadMoreBtn()}else this._gridData=e;var i,o=0;if(this._onChange(this._gridData),this._onTouched(),u.isDefined(e)){if(this.gridOptions.bindScrollEvt(),this.isNavigationEnabled()&&this.dataNavigator.dn.currentPage&&(o=(this.dataNavigator.dn.currentPage-1)*(this.dataNavigator.maxResults||1)+1,this.setDataGridOption("startRowIndex",o)),!(i=this.callDataGridMethod("getOptions")))return;!i.colDefs.length&&this.fieldDefs.length&&this.setDataGridOption("colDefs",u.getClonedObject(this.fieldDefs)),this.isdynamictable||_.isEmpty(e)||!i.colDefs.length||this.invokeEventCallback("beforedatarender",{$data:this._gridData,$columns:this.columns,data:this._gridData,columns:this.columns}),this.setDataGridOption("data",u.getClonedObject(this._gridData))}}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selecteditem",{get:function(){return this.multiselect?u.getClonedObject(this.items):_.isEmpty(this.items)?{}:u.getClonedObject(this.items[0])},set:function(e){this.items.length=0,this.callDataGridMethod("selectRows",e)},enumerable:!1,configurable:!0}),t.prototype.onKeyPress=function(e){13===e.which&&this.invokeEventCallback("enterkeypress",{$event:e,$data:this.gridData})},t.prototype.ngAfterContentInit=function(){var t=this;e.prototype.ngAfterContentInit.call(this),this.headerConfig=this.headerConfig.filter(this.filterEmptyValues.bind(this)),_.remove(this.fieldDefs,(function(e){return void 0===e}));this._liveTableParent&&(this.isPartOfLiveGrid=!0),!this.readonlygrid&&this.editmode||("true"===this.readonlygrid?this.editmode="":this.isPartOfLiveGrid?this.editmode="inline"===this.isPartOfLiveGrid.formlayout?r.EDIT_MODE.FORM:r.EDIT_MODE.DIALOG:this.editmode=this.readonlygrid?r.EDIT_MODE.INLINE:""),this.gridOptions.colDefs=this.fullFieldDefs,this.gridOptions.rowActions=this.rowActions,this.gridOptions.headerConfig=this.headerConfig,this.gridOptions.rowClass=this.rowclass,this.gridOptions.editmode=this.editmode,this.gridOptions.formPosition=this.formposition,this.gridOptions.filtermode=this.filtermode,this.gridOptions.searchLabel=this.searchlabel,this.gridOptions.isMobile=u.isMobile(),this.gridOptions.name=this.name,this.gridOptions.securityUtils.pipeTransform=this.trustAsPipe,this.gridOptions.navigation=this.navigation,this.gridOptions.isdynamictable=this.isdynamictable,this.gridOptions.showviewlessbutton=this.showviewlessbutton,this.gridOptions.ondemandmessage=this.ondemandmessage,this.gridOptions.viewlessmessage=this.viewlessmessage,this.gridOptions.loadingdatamsg=this.loadingdatamsg,_.isEmpty(this.gridData)||(this.gridOptions.data=u.getClonedObject(this.gridData)),this.gridOptions.messages={selectField:this.appLocale.MESSAGE_SELECT_FIELD},this.datagridElement=$(this._tableElement.nativeElement),this.gridElement=this.$element,this.$element.css({position:"relative"}),_.forEach({showrowindex:"showRowIndex",multiselect:"multiselect",radioselect:"showRadioColumn",filternullrecords:"filterNullRecords",enablesort:"enableSort",showheader:"showHeader",enablecolumnselection:"enableColumnSelection",shownewrow:"showNewRow",gridfirstrowselect:"selectFirstRow"},(function(e,n){u.isDefined(t[n])&&(t.gridOptions[e]="true"===t[n]||!0===t[n])})),"none"!==this.statehandler&&(this.gridOptions.selectFirstRow=!1),this.renderOperationColumns(),this.gridOptions.colDefs=this.fieldDefs,this.datagridElement.datatable(this.gridOptions),this.callDataGridMethod("setStatus","loading",this.loadingdatamsg),this.applyProps.forEach((function(e){return t.callDataGridMethod.apply(t,w([],b(e)))})),this.editmode===r.EDIT_MODE.QUICK_EDIT&&(this.documentClickBind=this._documentClickBind.bind(this),document.addEventListener("click",this.documentClickBind))},t.prototype.getConfiguredState=function(){var e=this.statePersistence.computeMode(this.statehandler);return e&&e.toLowerCase()},t.prototype.handleStateParams=function(e,t){var n=this;return _.get(e,"selectedItem")&&(this._selectedItemsExist=!0),t.options=t.options||{},_.get(e,"pagination")?(t.options.page=e.pagination,_.get(e,"sort")&&(this.sortStateHandler(e),t.options.orderBy=_.get(e,"sort.field")+" "+_.get(e,"sort.direction")),_.get(e,"search")&&(setTimeout((function(){n.searchStateHandler(e)}),500),t.options.filterFields=this.getFilterFields(e.search))):(t.options.page=1,_.get(e,"search")&&(setTimeout((function(){n.searchStateHandler(e)}),500),t.options.filterFields=this.getFilterFields(e.search)),_.get(e,"sort")&&(this.sortStateHandler(e),t.options.orderBy=_.get(e,"sort.field")+" "+_.get(e,"sort.direction"))),t},t.prototype.triggerWMEvent=function(e){"dialog"!==this.editmode&&(u.$invokeWatchers(!0),this.app.notify("wm-event",{eventName:"selectedItemChange",widgetName:this.name,row:e,table:this}))},t.prototype.sortStateHandler=function(e){var t=this.datagridElement.find('th[data-col-field="'+_.get(e,"sort.field")+'"] .sort-icon');"asc"===_.get(e,"sort.direction")&&t.length?t.addClass("asc wi wi-long-arrow-up"):"desc"===_.get(e,"sort.direction")&&t.length&&t.addClass("desc wi wi-long-arrow-down")},t.prototype.searchStateHandler=function(e){var t=this;if(_.isArray(e.search))_.forEach(e.search,(function(e){if(t.rowFilter[e.field]&&(t.rowFilter[e.field].value=e.value,t.rowFilter[e.field].matchMode=e.matchMode,t.rowFilter[e.field].type=e.type,$(t.rowFilterCompliedTl[e.field]).length)){"integer"===e.type?parseInt(e.value):e.value;$(t.rowFilterCompliedTl[e.field]).find("input").val(e.value)}}));else{var n=this.datagridElement;n.find('[data-element="dgSearchText"]').val(e.search.value),n.find('[data-element="dgFilterValue"]').val(e.search.field)}},t.prototype.filterEmptyValues=function(e){return e.columns&&(e.columns=e.columns.filter(this.filterEmptyValues.bind(this))),void 0!==e},t.prototype.compareFilterExpressions=function(e,t){return!(e.length!==t.length||!_.isEqual(e,t))},t.prototype.setLastActionToFilterCriteria=function(){this.prevFilterExpression=_.get(this.datasource,"filterExpressions.rules")?u.getClonedObject(this.datasource.filterExpressions.rules):u.getClonedObject([].concat(this.datasource.dataBinding)),this.gridOptions.setLastActionPerformed(this.gridOptions.ACTIONS.FILTER_CRITERIA),this.gridOptions.setIsSearchTrigerred(!0)},t.prototype.setLastActionToDatasetUpdate=function(){this.gridOptions.setLastActionPerformed(this.gridOptions.ACTIONS.DATASET_UPDATE),this.gridOptions.setCurrentPage(1),this.gridOptions.setIsDatasetUpdated(!0)},t.prototype.checkIfVarFiltersApplied=function(){if(!_.isEmpty(_.get(this.datasource,"filterExpressions.rules"))||!_.isEmpty(_.get(this.datasource,"dataBinding"))){var e=_.get(this.datasource,"filterExpressions.rules")?this.datasource.filterExpressions.rules:[].concat(this.datasource.dataBinding);this.compareFilterExpressions(this.prevFilterExpression,e)||this.setLastActionToFilterCriteria()}},t.prototype.watchVariableDataSet=function(e){var t;if(this.gridOptions.isNavTypeScrollOrOndemand()&&this.checkIfVarFiltersApplied(),"wm.Variable"===_.get(this.datasource,"category")&&this._pageLoad&&"none"!==this.getConfiguredState()){var n=this.statePersistence.getWidgetState(this);this._pageLoad=!1,_.get(n,"selectedItem")?this._selectedItemsExist=!0:this.setDataGridOption("selectFirstRow",this.gridfirstrowselect),_.get(n,"search")&&(this.searchStateHandler(n),this.searchSortHandler(n.search,void 0,"search",!0)),_.get(n,"sort")&&(this.searchSortHandler(n.sort,void 0,"sort",!0),this.sortStateHandler(n)),_.get(n,"pagination")&&this.dataNavigator.pageChanged({page:n.pagination},!0)}if(!(this.dataNavigatorWatched&&_.isUndefined(e)&&this.__fullData)){this.variableInflight&&!this.infScroll&&this.callDataGridMethod("setStatus","loading",this.loadingdatamsg),(t=u.getValidJSON(e))&&(e=t);var i=this.getSortExpr(),o=i.split(" ");if(i&&o.length&&(this.sortInfo={direction:o[1],field:o[0]}),this.isDataValid()){if(e){if(this.shownavigation&&!this.dataNavigatorWatched)return void this.enablePageNavigation()}else this.resetPageNavigation(),""!==e&&void 0!==e&&"wm.Variable"!==_.get(this.datasource,"category")||(this.variableInflight=!1),this.variableInflight||this.callDataGridMethod("setStatus","nodata",this.nodatamessage),this.setDataGridOption("selectFirstRow",this.gridfirstrowselect);!this.isNavigationEnabled()&&e&&this.checkFiltersApplied(this.getSortExpr()),!_.isObject(e)||""===e||e&&""===e.dataValue?this.variableInflight||this.setGridData([]):e&&this.populateGridData(e)}}},t.prototype.ngOnDestroy=function(){document.removeEventListener("click",this.documentClickBind),this.navigatorResultWatch&&this.navigatorResultWatch.unsubscribe(),this.navigatorMaxResultWatch&&this.navigatorMaxResultWatch.unsubscribe(),e.prototype.ngOnDestroy.call(this)},t.prototype.addRowIndex=function(e){var t=u.getClonedObject(e),n=_.indexOf(this.gridOptions.data,e);return n<0?e:(t.$index=n+1,t.$isFirst=1===t.$index,t.$isLast=this.gridData.length===t.$index,t)},t.prototype.addEventsToContext=function(e){var t=this;e.addNewRow=function(){return t.addNewRow()},e.deleteRow=function(){return t.deleteRow()},e.editRow=function(){return t.editRow()}},t.prototype.execute=function(e,t){return![u.DataSource.Operation.IS_API_AWARE,u.DataSource.Operation.IS_PAGEABLE,u.DataSource.Operation.SUPPORTS_SERVER_FILTER].includes(e)&&(this.datasource?this.datasource.execute(e,t):{})},t.prototype.isNavigationEnabled=function(){return this.shownavigation&&this.dataNavigator&&this.dataNavigatorWatched},t.prototype.getClonedRowObject=function(e){var t=u.getClonedObject(e);return t.getProperty=function(e){return _.get(t,e)},t.$isFirst=1===t.$index,t.$isLast=this.gridData.length===t.$index,delete t.$$index,delete t.$$pk,t},t.prototype.handleLoading=function(e){this.variableInflight=e.active,e.active?this.callDataGridMethod("setStatus","loading",this.loadingdatamsg):!this.isGridEditMode&&_.isEmpty(this.dataset)?this.callDataGridMethod("setStatus","nodata",this.nodatamessage):this.callDataGridMethod("setStatus","ready")},t.prototype.setDisabledOnField=function(e,t,n){"new"===e||!t["primary-key"]||"assigned"!==t.generator||t["related-entity-name"]||t.period||(t[n].disabled=!0)},t.prototype.resetFormControl=function(e){e.markAsUntouched(),e.markAsPristine()},t.prototype.clearForm=function(e){var t=this,n=this.ngform.controls;_.keys(this.ngform.controls).forEach((function(i){!i.endsWith("_filter")&&(i.endsWith("_new")&&e||!i.endsWith("_new")&&!e)&&(n[i].setValue(""),t.resetFormControl(n[i]))}))},t.prototype.showFieldBasedOnScreenType=function(e){return u.isMobile()&&this.viewport.isMobileType?e.mobileDisplay:this.viewport.isTabletType?e.tabletDisplay:e.pcDisplay},t.prototype.isEmptyRecord=function(e){var t,n=this;return Object.keys(e).every((function(i,o){return t=e[i],!(n.fieldDefs.length&&u.isDefined(n.fieldDefs[o])&&n.showFieldBasedOnScreenType(n.fieldDefs[o])||!0)||(null==t||""===t)}))},t.prototype.removeEmptyRecords=function(e){var t=this,n=e,i=[];return n&&n.length&&(i=n.filter((function(e){return e&&!t.isEmptyRecord(e)}))),i},t.prototype.setGridData=function(e){var t=this.filternullrecords?this.removeEmptyRecords(e):e;"wm.Variable"!==_.get(this.datasource,"category")&&void 0!==_.get(this.datasource,"category")||(this.variableInflight=!1),this.variableInflight||(t&&0===t.length?this.callDataGridMethod("setStatus","nodata",this.nodatamessage):this.callDataGridMethod("setStatus","ready")),this.gridData=t},t.prototype.setDataGridOption=function(e,t,n){if(void 0===n&&(n=!1),this.datagridElement&&this.datagridElement.datatable&&this.datagridElement.datatable("instance")){var i={};!u.isDefined||_.isEqual(t,this.gridOptions[e])&&!n||(i[e]=t,this.datagridElement.datatable("option",i),this.gridOptions[e]=t)}},t.prototype.callDataGridMethod=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(this.datagridElement&&this.datagridElement.datatable("instance"))return this.datagridElement.datatable.apply(this.datagridElement,e);this.applyProps.set(e[1],e)},t.prototype.renderOperationColumns=function(){var e,t,n=r.getRowOperationsColumn(),i={name:n.field,field:n.field,isPredefined:!0};this.fieldDefs.length&&(e=_.find(this.fullFieldDefs,{field:R,type:"custom"}),_.remove(this.fieldDefs,{type:"custom",field:R}),_.remove(this.headerConfig,{field:n.field}),this.rowActions.length&&(e?(t=e.rowactionsposition?_.toNumber(e.rowactionsposition):this.fieldDefs.length,this.fieldDefs.splice(t,0,e),0===t?this.headerConfig.unshift(i):this.headerConfig.push(i)):(this.fieldDefs.push(n),this.headerConfig.push(i))),this.setDataGridOption("headerConfig",this.headerConfig))},t.prototype.enablePageNavigation=function(){var e=this;this.dataset&&this.binddataset&&this.dataNavigator&&(this.dataNavigatorWatched=!0,this.navigatorResultWatch&&this.navigatorResultWatch.unsubscribe(),this.navigatorResultWatch=this.dataNavigator.resultEmitter.subscribe((function(t){u.isDefined(t)?_.isEqual(e.dataset,t)?e.watchVariableDataSet(t):_.isArray(t)?e.widget.dataset=[].concat(t):_.isObject(t)?e.widget.dataset=_.extend({},t):e.widget.dataset=t:e.widget.dataset=void 0}),!0),this.navigatorMaxResultWatch&&this.navigatorMaxResultWatch.unsubscribe(),this.navigatorMaxResultWatch=this.dataNavigator.maxResultsEmitter.subscribe((function(t){e.pagesize=t})),this.__fullData=this.dataset,this.dataNavigator.widget.maxResults=this.pagesize||5,this.dataNavigator.options={maxResults:this.pagesize||5},this.removePropertyBinding("dataset"),this.dataNavigator.setBindDataSet(this.binddataset,this.viewParent,this.datasource,this.dataset,this.binddatasource,void 0,this.statehandler))},t.prototype.resetPageNavigation=function(){this.dataNavigator&&this.dataNavigator.resetPageNavigation()},t.prototype.isDataValid=function(){var e,t=this.dataset||{};return t.error&&(e=t.error),t.data&&t.data.error&&t.data.errorMessage&&(e=t.data.errorMessage),!e||(this.setGridData([]),this.callDataGridMethod("setStatus","error",e),!1)},t.prototype.populateGridData=function(e){var t,n=this;if(e=r.transformData(e,this.name),!this.isNavigationEnabled()&&this._isClientSearch?(t=u.getClonedObject(e),t=this.getSearchResult(t,this.filterInfo),t=this.getSortResult(t,this.sortInfo),this.serverData=t):this.serverData=e,this.isdynamictable?this.createGridColumns(this.serverData):this.setGridData(this.serverData),"none"!==this.getConfiguredState()&&this._selectedItemsExist&&e.length){var i=this.statePersistence.getWidgetState(this),o=void 0;_.get(i,"selectedItem")&&(o=i.selectedItem.filter((function(e){return e.page===n.dataNavigator.dn.currentPage})),this._selectedItemsExist=!1,o.length&&this.selecteditem.length!==i.selectedItem.length&&(_.isArray(this.selecteditem)?o.forEach((function(e){n.selectItem(e.index,void 0)})):this.selecteditem=o.map((function(e){return e.index}))))}},t.prototype.generateDynamicColumns=function(e){return v(this,void 0,void 0,(function(){var t,n,i,o=this;return y(this,(function(a){switch(a.label){case 0:return this.fieldDefs=[],this.filterTmpl._results=[],_.isEmpty(e)?[2]:(t="",e.forEach((function(e){var n="",i="";_.forEach(e,(function(e,t){_.isUndefined(e)||""===e||("customExpression"===t?i=e:n+=" "+t+'="'+e+'"')})),t+="<wm-table-column "+n+' tableName="'+o.name+o.$attrs.get("table_reference")+'">'+i+"</wm-table-column>"})),this.dynamicTableRef.clear(),this._dynamicContext||(this._dynamicContext=Object.create(this.viewParent),this._dynamicContext[this.getAttr("wmTable")]=this),this.noOfColumns=e.length,[4,this.dynamicComponentProvider.getComponentFactoryRef("app-table-dynamic-"+this.widgetId,t,{noCache:!0,transpile:!0})]);case 1:return n=a.sent(),i=this.dynamicTableRef.createComponent(n,0,this.inj),u.extendProto(i.instance,this._dynamicContext),this.$element.find(".dynamic-table-container")[0].appendChild(i.location.nativeElement),[2]}}))}))},t.prototype.prepareColDefs=function(e){var t,n,i=this,o=0,a=0;this.fieldDefs=[],this.headerConfig=[],this.columns={},n=e,t=r.prepareFieldDefs(n),_.forEach(t,(function(e){e.binding=e.field,e.caption=e.displayName,e.pcDisplay=!0,e.mobileDisplay=!0,e.tabletDisplay=!0,e.searchable=!0,e.showinfilter=!0,e.type="string",e.index=o,e.headerIndex=a,o++,a++})),t.forEach((function(e){i.columns[e.field]=e})),this.invokeEventCallback("beforedatarender",{$data:e,$columns:this.columns,data:e,columns:this.columns}),t=[],_.forEach(this.columns,(function(e){t.push(e)})),this.generateDynamicColumns(t)},t.prototype.createGridColumns=function(e){var t=e&&!e.error;t&&!_.isArray(e)&&(e=[e]),_.isEmpty(e)?this.setGridData(e):t&&(this.prepareColDefs(e),this.serverData=e,this.setGridData(this.serverData))},t.prototype.getSortExpr=function(){var e,t;return this.datasource&&this.datasource.execute(u.DataSource.Operation.IS_PAGEABLE)&&(t=this.datasource.execute(u.DataSource.Operation.GET_PAGING_OPTIONS),e=_.isEmpty(t)?"":r.getOrderByExpr(t.sort)),e||""},t.prototype.onPropertyChange=function(t,n,i){var o,a=this;switch(t){case"datasource":!1===n.startUpdate&&(this.variableInflight=!1,this.callDataGridMethod("setStatus","nodata",this.nodatamessage)),this.watchVariableDataSet(this.dataset),this.onDataSourceChange();break;case"dataset":if(this.gridOptions.isNavTypeScrollOrOndemand()&&1===this.gridOptions.getCurrentPage()&&this.gridOptions.setIsNextPageData(!1),this.binddatasource&&!this.datasource)return;this.parentList&&!this.datasource&&_.startsWith(this.binddataset,"item")&&(this.datasource=u.getDatasourceFromExpr(this.widget.$attrs.get("datasetboundexpr"),this)),this.gridOptions.isNavTypeScrollOrOndemand()&&(this.gridOptions.isNextPageData?this.gridOptions.setIsDataUpdatedByUser(!1):(this.gridOptions.setIsDataUpdatedByUser(!0),this.setLastActionToDatasetUpdate(),this.gridOptions.setIsNextPageData(!1))),"wm.Variable"===_.get(this.datasource,"category")&&this._pageLoad&&"none"!==this.getConfiguredState()||this.watchVariableDataSet(n);break;case"filtermode":this.setDataGridOption("filtermode",n);break;case"searchlabel":this.setDataGridOption("searchLabel",n);break;case"navigation":if("Advanced"===n)return void(this.navigation="Classic");"None"!==n&&(this.shownavigation=!0),this.setDataGridOption("navigation",this.navigation),this.onDemandLoad=n===r.NAVIGATION_TYPE.ONDEMAND,this.infScroll=n===r.NAVIGATION_TYPE.SCROLL,this.navControls=n;break;case"gridfirstrowselect":this.setDataGridOption("selectFirstRow",n);break;case"gridclass":this.callDataGridMethod("option","cssClassNames.grid",n);break;case"nodatamessage":this.callDataGridMethod("option","dataStates.nodata",n);break;case"loadingdatamsg":this.callDataGridMethod("option","dataStates.loading",n);break;case"loadingicon":this.callDataGridMethod("option","loadingicon",n);break;case"spacing":this.callDataGridMethod("option","spacing",n),this.navigationSize="condensed"===n?"small":"";break;case"exportformat":this.exportOptions=[],n&&_.forEach(_.split(n,","),(function(e){a.exportOptions.push({label:e,icon:E[e]})}));break;case"shownewrow":o=n||_.some(this.actions,(function(e){return _.includes(e.action,"addNewRow()")})),this.callDataGridMethod("option","actionsEnabled.new",o);break;case"pagesize":this.dataNavigator.options={maxResults:n},this.dataNavigator.widget.maxResults=n,this.dataNavigator.maxResults=n;break;case"ondemandmessage":n&&this.$element.find(".on-demand-datagrid > a").text(n),this.gridOptions.ondemandmessage=n;break;case"viewlessmessage":this.gridOptions.viewlessmessage=n;break;case"show":n?this.invokeEventCallback("show"):this.invokeEventCallback("hide");default:e.prototype.onPropertyChange.call(this,t,n,i)}},t.prototype.onDataSourceChange=function(){this.fieldDefs.forEach((function(e){u.triggerFn(e.onDataSourceChange&&e.onDataSourceChange.bind(e))}))},t.prototype.clearActionRowVars=function(){this.actionRowIndex=void 0,this.actionRowPage=void 0,this.setDataGridOption("actionRowIndex",void 0),this.setDataGridOption("actionRowPage",void 0)},t.prototype.onStyleChange=function(t,n,i){switch(t){case"width":this.callDataGridMethod("setGridDimensions","width",n);break;case"height":this.callDataGridMethod("setGridDimensions","height",n)}e.prototype.onStyleChange.call(this,t,n,i)},t.prototype.populateActions=function(){var e=this;this._actions.header=[],this._actions.footer=[],_.forEach(this.actions,(function(t){_.includes(t.position,"header")&&e._actions.header.push(t),_.includes(t.position,"footer")&&e._actions.footer.push(t)}))},t.prototype.renderDynamicFilterColumn=function(e){this.isdynamictable&&this.filterTmpl._results.push(e)},t.prototype.registerColumns=function(e,t){var n=this;if(u.isMobile()&&this.viewport.isMobileType){if(!e.mobileDisplay)return}else if(this.viewport.isTabletType){if(!e.tabletDisplay)return}else if(!e.pcDisplay)return;e["primary-key"]&&this.primaryKey.push(e.field),this.fieldDefs[t]=e;var i=this.fieldDefs.length;this.fullFieldDefs.push(e),this.rowFilter[e.field]={value:void 0},this.fieldDefs.forEach((function(e){n.columns[e.field]=e})),this.isdynamictable&&i===this.noOfColumns&&(this.renderOperationColumns(),this.setDataGridOption("colDefs",this.fieldDefs))},t.prototype.registerFormField=function(e,t){this.formfields[e]=t},t.prototype.registerActions=function(e){this.actions.push(e),this.populateActions()},t.prototype.registerRow=function(e,t){this.rowDef=e,this.rowInstance=t,this.callDataGridMethod("option","cssClassNames.rowExpandIcon",this.rowDef.expandicon),this.callDataGridMethod("option","cssClassNames.rowCollapseIcon",this.rowDef.collapseicon),this.gridOptions.rowExpansionEnabled=!0,this.gridOptions.rowDef=this.rowDef},t.prototype.registerRowActions=function(e){this.rowActions.push(e)},t.prototype.selectItem=function(e,t){t&&(this.serverData=t),_.isObject(e)&&(e=_.omitBy(e,(function(e){return _.isArray(e)&&_.isEmpty(e)}))),this.callDataGridMethod("selectRow",e,!0)},t.prototype.deselectItem=function(e){this.callDataGridMethod("deselectRow",e)},t.prototype.onDataNavigatorDataSetChange=function(e){var t;return this.__fullData=e,this.checkFiltersApplied(this.getSortExpr()),this._isClientSearch?(t=u.getClonedObject(this.__fullData),_.isObject(t)&&!_.isArray(t)&&(t=[t]),t=this.getSearchResult(t,this.filterInfo),t=this.getSortResult(t,this.sortInfo)):e},t.prototype.toggleMessage=function(e,t,n,i){e&&n&&this.app.notifyApp(n,t,i)},t.prototype.export=function(e){var t,n=_.isEmpty(this.sortInfo)?"":this.sortInfo.field+" "+this.sortInfo.direction,i={};this.fieldDefs.forEach((function(e){if(e.field!==R&&e.show){var t={header:e.displayName};e.exportexpression?t.expression=e.exportexpression:t.field=e.field,i[e.field]=t}})),t={matchMode:"anywhereignorecase",filterFields:this.getFilterFields(this.filterInfo),orderBy:n,exportType:e.label,logicalOp:"AND",exportSize:this.exportdatasize,columns:i},!1!==this.invokeEventCallback("beforeexport",{$data:t})&&(t.fields=_.values(t.columns),this.datasource.execute(u.DataSource.Operation.DOWNLOAD,{data:t}))},t.prototype.expandRow=function(e){this.callDataGridMethod("expandRow",e)},t.prototype.collapseRow=function(e){this.callDataGridMethod("collapseRow",e)},t.prototype._documentClickBind=function(e){var t=e.target;this.$element[0].contains(t)||e.target.doctype||T($(t))||this.callDataGridMethod("saveRow")},t.prototype._redraw=function(e){var t=this;e?this.datagridElement.datatable(this.gridOptions):setTimeout((function(){t.callDataGridMethod("setColGroupWidths"),t.callDataGridMethod("addOrRemoveScroll")}))},t.prototype.invokeActionEvent=function(e,t){u.$parseEvent(t)(this.viewParent,Object.assign(this.context,{$event:e}))},t.prototype.handleEvent=function(t,n,i,o){"select"!==n&&e.prototype.handleEvent.call(this,this.nativeElement,n,i,o)},t.prototype.triggerUploadEvent=function(e,t,n,i){var o={$event:e,row:i};this.columns[n]&&("change"===t&&(o.newVal=e.target.files,o.oldVal=this.columns[n]._oldUploadVal,this.columns[n]._oldUploadVal=o.newVal),this.columns[n].invokeEventCallback(t,o))},t.prototype.registerFormWidget=function(){},t.prototype.writeValue=function(){},t.prototype.registerOnChange=function(e){this._onChange=e},t.prototype.registerOnTouched=function(e){this._onTouched=e},t.prototype.ngOnDetach=function(){e.prototype.ngOnDetach.call(this),"wm.Variable"===_.get(this.datasource,"category")&&"none"!==this.getConfiguredState()?this._pageLoad=!1:this._pageLoad=!0},t}(r.StylableComponent);S.initializeProps=P(),S.decorators=[{type:t.Component,args:[{selector:"[wmTable]",template:'<div class="panel-heading" *ngIf="title || subheading || iconclass || exportOptions.length || _actions.header.length">\n <h3 class="panel-title">\n <div class="pull-left">\n <i class="app-icon panel-icon {{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="panel-actions app-datagrid-actions" *ngIf="exportOptions.length || _actions.header.length">\n <ng-container *ngFor="let btn of _actions.header"\n [ngTemplateOutlet]="btn.widgetType === \'button\' ? buttonRef : anchorRef" [ngTemplateOutletContext]="{btn:btn}">\n </ng-container>\n <div wmMenu dropdown caption.bind="appLocale.LABEL_EXPORT" *ngIf="exportOptions.length" autoclose="always" attr.name="{{name}}-export"\n dataset.bind="exportOptions" select.event="export($item)" menuposition="down,left"></div>\n </div>\n </h3>\n</div>\n<div class="app-datagrid" #datagridElement></div>\n\n<div class="panel-footer clearfix" [hidden]="!_actions.footer.length && (!shownavigation || (onDemandLoad && dataNavigator.isDisableNext) || dataNavigator?.dataSize <= pagesize)">\n <div class="app-datagrid-paginator" [hidden]="(!dataNavigator?.dataSize && !dataNavigator.datasource?.pagination?.next) || !shownavigation || (onDemandLoad && dataNavigator.isDisableNext) || dataNavigator?.dataSize <= pagesize">\n <nav wmPagination show.bind="shownavigation" navigationalign.bind="navigationalign"\n navigationsize.bind="navigationSize"\n navigation.bind="navControls" showrecordcount.bind="showrecordcount" maxsize.bind="maxsize"\n boundarylinks.bind="boundarylinks"\n forceellipses.bind="forceellipses" directionlinks.bind="directionlinks"></nav>\n </div>\n <div class="app-datagrid-actions" *ngIf="_actions.footer.length">\n <ng-container *ngFor="let btn of _actions.footer"\n [ngTemplateOutlet]="btn.widgetType === \'button\' ? buttonRef : anchorRef" [ngTemplateOutletContext]="{btn:btn}">\n </ng-container>\n </div>\n</div>\n\n<ng-template #buttonRef let-btn="btn">\n <button wmButton caption.bind="btn.displayName" show.bind="btn.show" class.bind="btn.class" iconclass.bind="btn.iconclass" (click)="invokeActionEvent($event, btn.action)"\n [ngClass]="{\'btn-sm\': spacing === \'condensed\', \'disabled-new\': btn.key === \'addNewRow\' && (isGridEditMode || isLoading)}"\n type="button" shortcutkey.bind="btn.shortcutkey" tabindex.bind="btn.tabindex" hint.bind="btn.title" [attr.aria-label]="btn.displayName" disabled.bind="btn.disabled" conditionalclass.bind="btn.conditionalclass" conditionalstyle.bind="btn.conditionalstyle"></button>\n</ng-template>\n\n<ng-template #anchorRef let-btn="btn">\n <a wmAnchor caption.bind="btn.displayName" show.bind="btn.show" class.bind="btn.class" iconclass.bind="btn.iconclass" (click)="invokeActionEvent($event, btn.action)"\n [ngClass]="{\'btn-sm\': spacing === \'condensed\', \'disabled-new\': btn.key === \'addNewRow\' && (isGridEditMode || isLoading)}"\n shortcutkey.bind="btn.shortcutkey" tabindex.bind="btn.tabindex" hint.bind="btn.title"\n hyperlink.bind="btn.hyperlink" target.bind="btn.target" conditionalclass.bind="btn.conditionalclass" conditionalstyle.bind="btn.conditionalstyle"></a>\n</ng-template>\n\n<div hidden>\n <ng-container #multiColumnFilterView></ng-container>\n\n <ng-container #inlineEditView></ng-container>\n\n <ng-container #inlineEditNewView></ng-container>\n\n <ng-container #rowActionsView></ng-container>\n\n <ng-container #rowExpansionActionView></ng-container>\n\n <ng-container #customExprView></ng-container>\n\n <ng-container #dynamicTable></ng-container>\n\n <ng-container #rowDetailView></ng-container>\n\n <div class="dynamic-table-container"></div>\n</div>\n',providers:[r.provideAs(S,i.NG_VALUE_ACCESSOR,!0),r.provideAsWidgetRef(S)]}]}],S.ctorParameters=function(){return[{type:t.Injector},{type:i.FormBuilder},{type:u.App},{type:u.DynamicComponentRefProvider},{type:u.StatePersistence},{type:u.PaginationService},{type:u.Viewport},{type:p.ListComponent,decorators:[{type:t.Optional}]},{type:void 0,decorators:[{type:t.Attribute,args:["dataset.bind"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["datasource.bind"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["readonlygrid"]}]},{type:t.NgZone},{type:r.TrustAsPipe}]},S.propDecorators={dataNavigator:[{type:t.ViewChild,args:[d.PaginationComponent,{static:!0}]}],_tableElement:[{type:t.ViewChild,args:["datagridElement",{static:!0}]}],rowActionTmpl:[{type:t.ContentChildren,args:["rowActionTmpl"]}],rowActionsViewRef:[{type:t.ViewChild,args:["rowActionsView",{static:!0,read:t.ViewContainerRef}]}],filterTmpl:[{type:t.ContentChildren,args:["filterTmpl",{descendants:!0}]}],filterViewRef:[{type:t.ViewChild,args:["multiColumnFilterView",{static:!0,read:t.ViewContainerRef}]}],inlineWidgetTmpl:[{type:t.ContentChildren,args:["inlineWidgetTmpl",{descendants:!0}]}],inlineEditViewRef:[{type:t.ViewChild,args:["inlineEditView",{static:!0,read:t.ViewContainerRef}]}],inlineWidgetNewTmpl:[{type:t.ContentChildren,args:["inlineWidgetTmplNew",{descendants:!0}]}],inlineEditNewViewRef:[{type:t.ViewChild,args:["inlineEditNewView",{static:!0,read:t.ViewContainerRef}]}],customExprTmpl:[{type:t.ContentChildren,args:["customExprTmpl",{descendants:!0}]}],customExprViewRef:[{type:t.ViewChild,args:["customExprView",{static:!0,read:t.ViewContainerRef}]}],rowExpansionActionTmpl:[{type:t.ContentChildren,args:["rowExpansionActionTmpl"]}],rowExpansionTmpl:[{type:t.ContentChild,args:["rowExpansionTmpl"]}],rowDetailViewRef:[{type:t.ViewChild,args:["rowDetailView",{static:!0,read:t.ViewContainerRef}]}],rowExpansionActionViewRef:[{type:t.ViewChild,args:["rowExpansionActionView",{static:!0,read:t.ViewContainerRef}]}],dynamicTableRef:[{type:t.ViewChild,args:["dynamicTable",{static:!0,read:t.ViewContainerRef}]}],onKeyPress:[{type:t.HostListener,args:["keypress",["$event"]]}]};var C="new",I="edit",D="delete",x=function(){function e(e,t,n){this.table=e,this.dialogService=t,this.app=n,e.initiateSelectItem=this.initiateSelectItem.bind(this),e.updateVariable=this.updateVariable.bind(this),e.updateRecord=this.updateRecord.bind(this),e.deleteRecord=this.deleteRecord.bind(this),e.insertRecord=this.insertRecord.bind(this),e.editRow=this.editRow.bind(this),e.addNewRow=this.addNewRow.bind(this),e.addRow=this.addNewRow.bind(this),e.deleteRow=this.deleteRow.bind(this),e.onRecordDelete=this.onRecordDelete.bind(this),e.hideEditRow=this.hideEditRow.bind(this),e.saveRow=this.saveRow.bind(this),e.cancelRow=this.cancelRow.bind(this)}return e.prototype.selectItemOnSuccess=function(e,t,n){var i=this;setTimeout((function(){t||i.table.selectItem(e,i.table.dataset),u.triggerFn(n)}),250)},e.prototype.initiateSelectItem=function(e,t,n,i,o){var a=this;this.table.gridOptions.isNavTypeScrollOrOndemand()&&!this.table.dataNavigator.isDisableNext&&this.table.isNewRowInserted?this.table.isNewRowInserted=!1:("last"===e&&(i||(this.table.dataNavigator.dataSize+=1),this.table.isNavigationEnabled()||(e="current")),this.table.dataNavigator.calculatePagingValues(),this.table.dataNavigator.__fullData=this.table.__fullData,this.table.dataNavigator.navigatePage(e,null,!0,(function(){(a.table.isNavigationEnabled()||i)&&a.selectItemOnSuccess(t,n,o),"quickedit"!==a.table.editmode||n||a.table.callDataGridMethod("setActiveRow",t)})))},e.prototype.updateVariable=function(e,t){var n=this,i=this.table.datasource;if(i&&(i.execute(u.DataSource.Operation.FETCH_DISTINCT_VALUES),!this.table.isNavigationEnabled())){var o=this.table.sortInfo,a=o&&o.direction?o.field+" "+o.direction:"";r.refreshDataSource(i,{page:1,filterFields:this.table.getFilterFields(this.table.filterInfo),orderBy:a,matchMode:"anywhereignorecase"}).then((function(){u.$appDigest(),n.selectItemOnSuccess(e,!0,t)}))}},e.prototype.insertSuccessHandler=function(e,t){if(e.error)this.table.invokeEventCallback("error",{$event:t.event,$operation:C,$data:e.error}),this.table.onError||this.table.toggleMessage(!0,"error",this.table.errormessage||e.error),u.triggerFn(t.error,e);else{if(this.table.gridOptions.isNavTypeScrollOrOndemand()&&(this.table.isNewRowInserted=!0),t.event){var n=$(t.event.target).closest("tr");this.table.callDataGridMethod("hideRowEditMode",n)}this.table.onRowinsert||this.table.toggleMessage(!0,"success",this.table.insertmessage),this.table.datasource.execute(u.DataSource.Operation.SUPPORTS_CRUD)?(this.table.initiateSelectItem(this.table.getNavigationTargetBySortInfo(),e,void 0,!1,t.callBack),this.updateVariable(e,t.callBack)):this.table.datasource.execute(u.DataSource.Operation.IS_API_AWARE)||this.table.initiateSelectItem(this.table.getNavigationTargetBySortInfo(),e,void 0,!1,t.callBack),u.triggerFn(t.success,e),this.table.invokeEventCallback("rowinsert",{$event:t.event,$data:e,row:e})}},e.prototype.generatePath=function(e){var t,n,i=this.table.widget.$attrs.get("datasetboundexpr");if(_.startsWith(e,"item")&&i){_.startsWith(i,"Widgets.")&&(i=u.extractCurrentItemExpr(i,this.table));for(var o=this.table.$element.parents(".app-list-item"),a=_.map(o,(function(e){return _.parseInt($(e).attr("listitemindex"))})),r=a.length-1;r>=0;r--)i=i.replace("$i",a[r]);n=_.last(a),t=i.replace(/^Variables\..*\.dataSet([^.])*(\.|$)/g,"")}else{/^Variables\..*\.dataSet([\[][0-9]])/g.test(e)&&(n=_.parseInt(e.replace(/^Variables\..*\.dataSet([\[])/g,""))),t=e.replace(/^Variables\..*\.dataSet([^.])*(\.|$)/g,"")}return{path:t,index:n}},e.prototype.insertRecord=function(e){var t=this,n=this.table.datasource;if(n){var i=n.pagination&&n.pagination.number+1,o={row:e.row,skipNotification:!0,period:e.period};if(n.execute(u.DataSource.Operation.SUPPORTS_CRUD)||!n.execute(u.DataSource.Operation.IS_API_AWARE)||"wm.CrudVariable"===n.category){if(!n.execute(u.DataSource.Operation.IS_API_AWARE)){var a=this.generatePath(this.table.binddataset);return n.execute(u.DataSource.Operation.ADD_ITEM,{item:e.row,path:a.path,parentIndex:a.index}),void this.insertSuccessHandler(e.row,e)}n.execute(u.DataSource.Operation.INSERT_RECORD,o).then((function(o){t.insertSuccessHandler(o,e),"wm.CrudVariable"===n.category&&n.execute(u.DataSource.Operation.LIST_RECORDS,{skipToggleState:!0,operation:"list",page:i})}),(function(n){t.table.invokeEventCallback("error",{$event:e.event,$operation:C,$data:n}),t.table.onError||t.table.toggleMessage(!0,"error",t.table.errormessage||n),u.triggerFn(e.error,n),u.triggerFn(e.callBack,void 0,!0)}))}else this.table.invokeEventCallback("rowinsert",{$event:e.event,row:e.row})}},e.prototype.updateSuccessHandler=function(e,t){if(e.error)this.table.invokeEventCallback("error",{$event:t.event,$operation:I,$data:e.error}),this.table.onError||this.table.toggleMessage(!0,"error",this.table.errormessage||e.error),u.triggerFn(t.error,e);else{if(t.event){var n=$(t.event.target).closest("tr");this.table.callDataGridMethod("hideRowEditMode",n)}this.table.onRowupdate||this.table.toggleMessage(!0,"success",this.table.updatemessage),this.table.datasource.execute(u.DataSource.Operation.SUPPORTS_CRUD)?(this.table.initiateSelectItem("current",e,void 0,!1,t.callBack),this.updateVariable(e,t.callBack)):this.table.datasource.execute(u.DataSource.Operation.IS_API_AWARE)||this.table.initiateSelectItem("current",e,void 0,!1,t.callBack),u.triggerFn(t.success,e),this.table.invokeEventCallback("rowupdate",{$event:t.event,$data:e,row:e})}},e.prototype.updateRecord=function(e){var t=this,n=this.table.datasource;if(n){var i=n.pagination&&n.pagination.number+1,o={row:e.row,prevData:e.prevData,skipNotification:!0,period:e.period};if(n.execute(u.DataSource.Operation.SUPPORTS_CRUD)||!n.execute(u.DataSource.Operation.IS_API_AWARE)||"wm.CrudVariable"===n.category){if(!n.execute(u.DataSource.Operation.IS_API_AWARE)){var a=this.generatePath(this.table.binddataset);return n.execute(u.DataSource.Operation.SET_ITEM,{prevItem:e.prevData,item:e.row,path:a.path,parentIndex:a.index}),void this.updateSuccessHandler(e.row,e)}n.execute(u.DataSource.Operation.UPDATE_RECORD,o).then((function(o){t.updateSuccessHandler(o,e),"wm.CrudVariable"===n.category&&n.execute(u.DataSource.Operation.LIST_RECORDS,{skipToggleState:!0,operation:"list",page:i})}),(function(n){t.table.invokeEventCallback("error",{$event:e.event,$operation:I,$data:n}),t.table.onError||t.table.toggleMessage(!0,"error",t.table.errormessage||n),u.triggerFn(e.error,n),u.triggerFn(e.callBack,void 0,!0)}))}else this.table.invokeEventCallback("rowupdate",{$event:e.event,row:e.row})}},e.prototype.onRecordDelete=function(e){var t;this.table.dataNavigator&&(this.table.dataNavigator.dataSize-=1,this.table.dataNavigator.calculatePagingValues(),t=this.table.dataNavigator.pageCount<this.table.dataNavigator.dn.currentPage?"prev":void 0,this.table.dataNavigator.__fullData=this.table.__fullData,this.table.dataNavigator.navigatePage(t,null,!0,(function(){setTimeout((function(){u.triggerFn(e)}),void 0,!1)})))},e.prototype.deleteSuccessHandler=function(e,t,n,i){t&&t.error?this.table.onError||this.table.toggleMessage(!0,"error",this.table.errormessage||t.error):(this.onRecordDelete(i),this.table.datasource.execute(u.DataSource.Operation.SUPPORTS_CRUD)&&this.updateVariable(e,i),this.table.onRowdelete||this.table.toggleMessage(!0,"success",this.table.deletemessage),this.table.invokeEventCallback("rowdelete",{$event:n,$data:e,row:e}),this.table.invokeEventCallback("rowdeleted",{$event:n,$data:e,row:e}))},e.prototype.deleteFn=function(e){var t,n,i=this,o=this.table.datasource;if(o){if((this.table.onDemandLoad||this.table.infScroll)&&(this.table.isRowDeleted=!0),"wm.CrudVariable"===o.category&&(this.triggerWMEvent("resetEditMode"),o.pagination&&(t=o.pagination.last&&1===o.pagination.numberOfElements,n=t?o.pagination.number:o.pagination.number+1)),o.execute(u.DataSource.Operation.SUPPORTS_CRUD)||!o.execute(u.DataSource.Operation.IS_API_AWARE)||this.table._isDependent||"wm.CrudVariable"===o.category){if(!o.execute(u.DataSource.Operation.IS_API_AWARE)){var a=this.generatePath(this.table.binddataset);return o.execute(u.DataSource.Operation.REMOVE_ITEM,{item:e.row,path:a.path,parentIndex:a.index}),void this.deleteSuccessHandler(e.row,void 0,e.evt,e.callBack)}o.execute(u.DataSource.Operation.DELETE_RECORD,{row:e.row,skipNotification:!0,period:e.period}).then((function(t){i.deleteSuccessHandler(t,e.row,e.evt,e.callBack),"wm.CrudVariable"===o.category&&o.execute(u.DataSource.Operation.LIST_RECORDS,{skipToggleState:!0,operation:"list",page:n})}),(function(t){i.table.isRowDeleted&&(i.table.isRowDeleted=!1),u.triggerFn(e.callBack,void 0,!0),i.table.invokeEventCallback("error",{$event:e.evt,$operation:D,$data:t}),i.table.onError||i.table.toggleMessage(!0,"error",i.table.errormessage||t)}))}else this.table.invokeEventCallback("rowdelete",{$event:e.evt,row:e.row});u.triggerFn(e.cancelRowDeleteCallback)}},e.prototype.deleteRecord=function(e){var t=this;if(!this.table.confirmdelete)return this.deleteFn(e),void u.triggerFn(e.cancelRowDeleteCallback);this.dialogService.showAppConfirmDialog({title:this.app.appLocale.MESSAGE_DELETE_RECORD||"Delete Record",iconclass:"wi wi-delete fa-lg",message:this.table.confirmdelete,oktext:this.table.deleteoktext,canceltext:this.table.deletecanceltext,onOk:function(){t.deleteFn(e),t.dialogService.closeAppConfirmDialog()},onCancel:function(){u.triggerFn(e.cancelRowDeleteCallback),t.dialogService.closeAppConfirmDialog()},onOpen:function(){$(".cancel-action").focus()},onEscape:function(){u.triggerFn(e.cancelRowDeleteCallback)}})},e.prototype.editRow=function(e){var t,n=this;this.table._isDependent?this.triggerWMEvent("update"):(e&&e.target?this.table.callDataGridMethod("toggleEditRow",e,{selectRow:!0,action:"edit"}):"form"===this.table.editmode||"dialog"===this.table.editmode?(t=e||this.table.selectedItems[0],this.table.gridOptions.beforeRowUpdate(t)):setTimeout((function(){(t=n.table.datagridElement.find("tr.active")).length&&n.table.callDataGridMethod("toggleEditRow",void 0,{$row:t,action:"edit"})})),this.table._triggeredByUser=!0,this.table.gridOptions.setIsDataUpdatedByUser(!1))},e.prototype.addNewRow=function(){this.table.isGridEditMode||(this.table._triggeredByUser=!0,this.table.gridOptions.setIsDataUpdatedByUser(!1),this.table.callDataGridMethod("addNewRow"),this.table._liveTableParent?this.table._liveTableParent.addNewRow():this.table._isDependent&&this.triggerWMEvent("insert"))},e.prototype.triggerWMEvent=function(e,t){u.$invokeWatchers(!0),this.app.notify("wm-event",{eventName:e,widgetName:this.table.name,row:this.table.selecteditem,dataSource:t})},e.prototype.deleteRow=function(e){var t,n=this;e&&e.target?this.table.callDataGridMethod("deleteRowAndUpdateSelectAll",e):setTimeout((function(){t=e||n.table.selectedItems[0],n.deleteRecord({row:t})})),this.table._triggeredByUser=!0,this.table.gridOptions.setIsDataUpdatedByUser(!1)},e.prototype.hideEditRow=function(){var e=this.table.datagridElement.find("tr.row-editing");e.length&&this.table.callDataGridMethod("hideRowEditMode",e)},e.prototype.saveRow=function(){this.table.callDataGridMethod("saveRow")},e.prototype.cancelRow=function(){var e=this.table.datagridElement.find("tr.row-editing");e.length&&this.table.callDataGridMethod("cancelEdit",e)},e}();x.decorators=[{type:t.Directive,args:[{selector:"[wmTableCUD]"}]}],x.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Self},{type:t.Inject,args:[S]}]},{type:u.AbstractDialogService},{type:u.App}]};var N=["null","empty","nullorempty","isnotnull","isnotempty"],k=function(e,t){if(u.isDefined(e)&&""!==e)return u.isNumberType(t)?_.toNumber(e):t===u.DataType.DATETIME?moment(e).valueOf():_.toString(e).toLowerCase()},M=function(e,t,n){void 0===n&&(n=[]);var i,o=k(t.value,t.type);return!u.isDefined(o)&&!_.includes(N,t.matchMode)||u.isNumberType(t.type)&&_.isNull(t.value)?e:e=e.filter((function(e){var a;switch(t.field?i=k(_.get(e,t.field),t.type):(i=[],_.forEach(e,(function(t,o){if(_.includes(n,o))i.push(t);else{var a=_.filter(_.range(n.length),(function(e){return n[e].includes(o)}));_.forEach(a,(function(t){var o=_.get(e,n[t]);i.indexOf(o)<0&&i.push(o)}))}})),i=i.join(" ").toLowerCase()),t.matchMode){case"start":a=_.startsWith(i,o);break;case"end":a=_.endsWith(i,o);break;case"exact":a=_.isEqual(i,o);break;case"notequals":a=!_.isEqual(i,o);break;case"null":a=_.isNull(i);break;case"isnotnull":a=!_.isNull(i);break;case"empty":a=_.isEmpty(i);break;case"isnotempty":a=!_.isEmpty(i);break;case"nullorempty":a=_.isNull(i)||_.isEmpty(i);break;case"lessthan":a=i<o;break;case"lessthanequal":a=i<=o;break;case"greaterthan":a=i>o;break;case"greaterthanequal":a=i>=o;break;default:a=u.isNumberType(t.type)?_.isEqual(i,o):_.includes(i,o)}return a}))},L=function(e,t,n){n.forEach((function(n){e[n]={value:t.value,type:t.value.type,logicalOp:"OR"},t.matchMode&&(e[n].matchMode=t.matchMode)}))},F=function(e,t,n){void 0===n&&(n=[]);var i=t&&t.field;i?(e[i]={value:t.value,logicalOp:"AND"},t.matchMode&&(e[i].matchMode=t.matchMode)):L(e,t,n)},j=function(e,t){t.field&&(e[t.field]={value:t.value,matchMode:t.matchMode,type:t.type})},B=function(e,t){e.push({field:t.key?t.key:"",matchMode:t.matchMode,type:t.type,value:t.value})},G=function(){function e(e){this.table=e,e._searchSortHandler=this.searchSortHandler.bind(this),e.getSearchResult=this.getSearchResult.bind(this),e.getSortResult=this.getSortResult.bind(this),e.checkFiltersApplied=this.checkFiltersApplied.bind(this),e.getFilterFields=this.getFilterFields.bind(this),e.onRowFilterChange=this.onRowFilterChange.bind(this),e.onFilterConditionSelect=this.onFilterConditionSelect.bind(this),e.showClearIcon=this.showClearIcon.bind(this),e.clearRowFilter=this.clearRowFilter.bind(this),e.matchModeTypesMap=r.getMatchModeTypesMap(),e.matchModeMsgs=r.getMatchModeMsgs(e.appLocale),e.emptyMatchModes=N,e.getNavigationTargetBySortInfo=this.getNavigationTargetBySortInfo.bind(this),e.refreshData=this.refreshData.bind(this),e.clearFilter=this.clearFilter.bind(this),e.adjustContainer=this.adjustContainer.bind(this)}return e.prototype.adjustContainer=function(e){var t=this;setTimeout((function(){u.adjustContainerRightEdges($("bs-dropdown-container"),t.table.rowFilterCompliedTl[e],t.table,$("bs-dropdown-container .dropdown-menu"))}))},e.prototype.getNavigationTargetBySortInfo=function(){return this.table.sortInfo&&"desc"===this.table.sortInfo.direction&&_.includes(this.table.primaryKey,this.table.sortInfo.field)?"first":"last"},e.prototype.getTableVisibleCols=function(){var e=[];return _.forEach(this.table.columns,(function(t,n){"true"===_.toLower(_.toString(t.showinfilter))&&"rowOperations"!==n&&t.searchable&&e.push(n)})),e},e.prototype.invokeSetFilterfieldBasedOnFieldval=function(e,t){if(e.field)F(t,e);else if(!_.isEmpty(e)){var n=this.getTableVisibleCols();F(t,e,n)}},e.prototype.getFilterFields=function(e){var t=this;e=e||{};var n={};return _.isArray(e)?_.forEach(e,(function(e){t.invokeSetFilterfieldBasedOnFieldval(e,n)})):this.invokeSetFilterfieldBasedOnFieldval(e,n),n},e.prototype.getLogicalOperator=function(e){var t="";for(var n in e){t=e[n].logicalOp||"";break}return t},e.prototype.resetSortStatus=function(e){var t;!_.isEmpty(this.table.sortInfo)&&this.table.datasource&&(t=this.table.sortInfo.field+" "+this.table.sortInfo.direction,(e=this.table.datasource.execute(u.DataSource.Operation.GET_OPTIONS).orderBy||e)&&(e=_.head(_.split(e,","))),t!==e&&(this.table.callDataGridMethod("resetSortIcons"),this.table.sortInfo={},this.table.setDataGridOption("sortInfo",{})))},e.prototype.clearFilter=function(e){var t;this.table.filterInfo={},"multicolumn"===this.table.filtermode?(this.table.fieldDefs.forEach((function(e){e.resetFilter&&e.resetFilter()})),e||this.table.onRowFilterChange()):"search"===this.table.filtermode&&((t=this.table.datagridElement).find('[data-element="dgSearchText"]').val(""),t.find('[data-element="dgFilterValue"]').val(""),e||t.find(".app-search-button").trigger("click"))},e.prototype.checkFiltersApplied=function(e){if(this.table.datasource)return this.table.datasource.execute(u.DataSource.Operation.SUPPORTS_SERVER_FILTER)?(_.isEmpty(this.table.datasource.execute(u.DataSource.Operation.GET_OPTIONS).filterFields)&&this.clearFilter(!0),void this.resetSortStatus(e)):void(this.table.datasource.execute(u.DataSource.Operation.IS_PAGEABLE)&&this.resetSortStatus(e))},e.prototype.getSearchResult=function(e,t){var n=this.getTableVisibleCols();return t?(_.isArray(t)?t.forEach((function(t){e=M(e,t,n)})):e=M(e,t,n),e):e},e.prototype.getSortResult=function(e,t){return t&&t.direction&&(e=_.orderBy(e,t.field,t.direction)),e},e.prototype.handleClientSideSortSearch=function(e,t,n){var i;this.table._isClientSearch=!0,i=this.table.isNavigationEnabled()?u.getClonedObject(this.table.__fullData):u.getClonedObject(this.table.dataset),"search"===n?this.table.filterInfo=e:this.table.sortInfo=e,_.isObject(i)&&!_.isArray(i)&&(i=[i]),i=this.getSearchResult(i,this.table.filterInfo),i=this.getSortResult(i,this.table.sortInfo),this.table.serverData=i,"sort"===n&&this.table.invokeEventCallback("sort",{$event:t,$data:{data:this.table.serverData,sortDirection:this.table.sortInfo.direction,colDef:this.table.columns[this.table.sortInfo.field]}}),this.table.isNavigationEnabled()?(this.table.dataNavigator.dn.currentPage=1,this.table.dataNavigator.setPagingValues(i)):this.table.setGridData(this.table.serverData)},e.prototype.handleSinglePageSearch=function(e){this.table._isPageSearch=!0;var t=u.getClonedObject(this.table.gridData),n=this.table.datagridElement.find("tbody tr.app-datagrid-row");this.table.filterInfo=e,t=this.getSearchResult(t,e),_.forEach(this.table.gridData,(function(e,i){var o=$(n[i]);_.find(t,(function(t){return _.isEqual(t,e)}))?o.show():o.hide()})),t&&t.length?(this.table.callDataGridMethod("setStatus","ready"),this.table.gridfirstrowselect&&!this.table.multiselect&&this.table.callDataGridMethod("selectFirstRow",!0,!0)):(this.table.callDataGridMethod("setStatus","nodata",this.table.nodatamessage),this.table.selecteditem=void 0),this.table.callDataGridMethod("updateSelectAllCheckboxState")},e.prototype.handleServerSideSearch=function(e){var t=this;if(this.table.filterInfo=e,this.table.datasource){var n=this.table.sortInfo,i=n&&n.direction?n.field+" "+n.direction:"",o=this.getFilterFields(e),a=this.getLogicalOperator(o);r.refreshDataSource(this.table.datasource,{page:1,filterFields:o,orderBy:i,condition:a}).then((function(){u.$appDigest()}),(function(){t.table.toggleMessage(!0,"error",t.table.nodatamessage)}))}},e.prototype.handleSeverSideSort=function(e,t,n){var i=this;this.table.gridOptions.sortInfo.field=e.field,this.table.gridOptions.sortInfo.direction=e.direction,this.table.sortInfo=u.getClonedObject(e);var o=e&&e.direction?e.field+" "+e.direction:"",a=this.getFilterFields(this.table.filterInfo),s=this.getLogicalOperator(a);n||"none"===this.table.getConfiguredState()||this.table.statePersistence.removeWidgetState(this.table,"pagination"),r.refreshDataSource(this.table.datasource,{page:1,filterFields:a,orderBy:o,condition:s}).then((function(n){u.$appDigest();var o=n&&n.data?n.data:n;i.table.invokeEventCallback("sort",{$event:t,$data:{data:o,sortDirection:e.direction,colDef:i.table.columns[e.field]}})}))},e.prototype.searchHandler=function(e,t,n,i){var o;o=_.isArray(e)?e.filter((function(e){return void 0!==e.matchMode&&void 0!==e.value||void 0!==e.value&&""===e.field})):{field:e.field,value:e.value,type:e.type},"none"!==this.table.getConfiguredState()&&r.unsupportedStatePersistenceTypes.indexOf(this.table.navigation)<0?(_.isArray(e)&&o.length||e.value?(this.table.statePersistence.removeWidgetState(this.table,"search"),this.table.statePersistence.setWidgetState(this.table,{search:o})):this.table.statePersistence.removeWidgetState(this.table,"search"),i||(this.table.statePersistence.removeWidgetState(this.table,"pagination"),this.table.statePersistence.removeWidgetState(this.table,"selectedItem"))):console.warn("Retain State handling on Widget "+this.table.name+" is not supported for current pagination type.");var a=u.getClonedObject(e),s=this.table.datasource;if(s||this.table.dataset){var l={};_.isArray(a)?a.forEach((function(e){j(l,e)})):j(l,a),!1!==this.table.invokeEventCallback("beforefilter",{$event:t,$data:l,columns:l})&&(a=[],_.isEmpty(l)&&!_.isEmpty(o)?_.isArray(o)?_.forEach(o,(function(e){B(a,e)})):B(a,o):_.forEach(l,(function(e,t){a.push({field:t,matchMode:e.matchMode,type:e.type,value:e.value})})),s&&s.execute(u.DataSource.Operation.SUPPORTS_SERVER_FILTER)?this.handleServerSideSearch(a):s&&s.execute(u.DataSource.Operation.IS_API_AWARE)&&s.execute(u.DataSource.Operation.IS_PAGEABLE)?this.handleSinglePageSearch(a):this.handleClientSideSortSearch(a,t,n))}},e.prototype.sortHandler=function(e,t,n,i){var o=this.table.datasource;if(o||this.table.dataset){if(!i&&"none"!==this.table.getConfiguredState()&&r.unsupportedStatePersistenceTypes.indexOf(this.table.navigation)<0){var a={direction:e.direction,field:e.field};e.direction?this.table.statePersistence.setWidgetState(this.table,{sort:a}):this.table.statePersistence.removeWidgetState(this.table,"sort"),this.table.statePersistence.removeWidgetState(this.table,"selectedItem")}else console.warn("Retain State handling on Widget "+this.table.name+" is not supported for current pagination type.");o&&o.execute(u.DataSource.Operation.IS_SORTABLE)?this.handleSeverSideSort(e,t,i):this.handleClientSideSortSearch(e,t,n)}},e.prototype.setLastActionPerformedToSearchSort=function(){this.table.gridOptions.setLastActionPerformed(this.table.gridOptions.ACTIONS.SEARCH_OR_SORT),this.table.gridOptions.setIsSearchTrigerred(!0)},e.prototype.searchSortHandler=function(e,t,n,i){"change"===(t?t.type:"")&&"multicolumn"!==this.table.filtermode?t.stopPropagation():(this.setLastActionPerformedToSearchSort(),"search"===n?this.searchHandler(e,t,n,i):this.sortHandler(e,t,n,i))},e.prototype.showClearIcon=function(e){var t=this.table.rowFilter[e]&&this.table.rowFilter[e].value;return u.isDefined(t)&&""!==t&&null!==t},e.prototype.clearRowFilter=function(e){this.table.rowFilter&&this.table.rowFilter[e]&&(this.table.columns[e].resetFilter(),this.onRowFilterChange(e))},e.prototype.onFilterConditionSelect=function(e,t){var n=this;this.table.rowFilter[e]=this.table.rowFilter[e]||{},this.table.rowFilter[e].matchMode=t,_.includes(this.table.emptyMatchModes,t)?(this.table.columns[e].resetFilter(),this.table.onRowFilterChange()):u.isDefined(this.table.rowFilter[e].value)&&""!==this.table.rowFilter[e].value?this.table.onRowFilterChange():setTimeout((function(){n.table.columns[e].filterInstance.focus()}))},e.prototype.getFilterOnFieldValues=function(e){var t=this;if(this.table.datasource&&this.table.datasource.execute(u.DataSource.Operation.SUPPORTS_DISTINCT_API)){var n=e.field,i=this.table.fullFieldDefs,o=_.filter(i,{filteronfilter:n}),a=_.get(this.table.rowFilter,[n,"value"]);_.forEach(o,(function(e){var n=e.filteronfilter,i=e.field,o={},s=e.filterwidget;r.isDataSetWidget(s)&&n!==i&&!e.isFilterDataSetBound&&(o[n]=u.isDefined(a)&&""!==a&&null!==a?{value:a}:{},s===u.FormWidgetType.AUTOCOMPLETE&&e.filterInstance.dataoptions?e.filterInstance.dataoptions.filterFields=o:t.table.datasource.execute(u.DataSource.Operation.GET_DISTINCT_DATA_BY_FIELDS,{fields:i,filterFields:o}).then((function(t){e.filterdataset=t.data})))}))}},e.prototype.onRowFilterChange=function(e){var t=this,n=[],i=_.find(this.table.fullFieldDefs,{field:e});_.forEach(this.table.rowFilter,(function(e,o){(u.isDefined(e.value)&&""!==e.value||_.includes(t.table.emptyMatchModes,e.matchMode))&&(i&&o===i.field&&(e.type=e.type||i.type,e.matchMode=e.matchMode||_.get(t.table.matchModeTypesMap[e.type],0)),n.push({field:o,value:e.value,matchMode:e.matchMode,type:e.type}))})),this.table.gridOptions.searchHandler(n,void 0,"search"),i&&this.getFilterOnFieldValues(i)},e.prototype.refreshData=function(e){if(this.table.datasource){var t=e?this.table.dataNavigator.dn.currentPage:1,n=this.table.sortInfo,i=n&&n.direction?n.field+" "+n.direction:"",o=this.getFilterFields(this.table.filterInfo),a=this.getLogicalOperator(o);r.refreshDataSource(this.table.datasource,{page:t,filterFields:o,orderBy:i,condition:a})}},e}();G.decorators=[{type:t.Directive,args:[{selector:"[wmTableFilterSort]"}]}],G.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Self},{type:t.Inject,args:[S]}]}]};var V=function(){r.register("wm-table-action",new Map([["accessroles",r.PROP_STRING],["action",r.PROP_STRING],["caption",r.PROP_STRING],["class",r.PROP_STRING],["conditionalclass",r.PROP_ANY],["conditionalstyle",r.PROP_ANY],["disabled",Object.assign({value:!1},r.PROP_BOOLEAN)],["display-name",r.PROP_STRING],["hyperlink",r.PROP_STRING],["icon",r.PROP_STRING],["iconclass",r.PROP_STRING],["key",r.PROP_STRING],["position",Object.assign({value:"footer"},r.PROP_STRING)],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["title",r.PROP_STRING],["target",r.PROP_STRING],["widget-type",Object.assign({value:"button"},r.PROP_STRING)]]))},W={widgetType:"wm-table-action",hostClass:""},U=function(e){function t(t,n){var i=e.call(this,t,W)||this;return i.table=n,i}return g(t,e),t.prototype.populateAction=function(){this.buttonDef={key:this.key,displayName:this["display-name"]||this.caption||"",show:this.show,class:this.class||"",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,icon:this.icon,position:this.position,widgetType:this["widget-type"],hyperlink:this.hyperlink,target:this.target||"",conditionalclass:this.conditionalclass||"",conditionalstyle:this.conditionalstyle||{}},this._propsInitialized=!0},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.populateAction(),this.table.registerActions(this.buttonDef)},t.prototype.onPropertyChange=function(e,t){this._propsInitialized&&("display-name"===e?this.buttonDef.displayName=t:this.buttonDef[e]=t)},t}(r.BaseComponent);U.initializeProps=V(),U.decorators=[{type:t.Directive,args:[{selector:"[wmTableAction]",providers:[r.provideAsWidgetRef(U)]}]}],U.ctorParameters=function(){return[{type:t.Injector},{type:S,decorators:[{type:t.Optional}]}]};var q=function(){r.register("wm-table-column",new Map([["accessroles",r.PROP_STRING],["autoclose",Object.assign({value:"outsideClick"},r.PROP_STRING)],["backgroundcolor",r.PROP_STRING],["binding",r.PROP_STRING],["caption",r.PROP_STRING],["checkedvalue",r.PROP_STRING],["col-class",r.PROP_STRING],["collapsible",r.PROP_BOOLEAN],["col-ng-class",r.PROP_STRING],["currencypattern",r.PROP_STRING],["customExpression",r.PROP_BOOLEAN],["dataentrymode",Object.assign({value:"default"},r.PROP_STRING)],["datafield",r.PROP_STRING],["dataoptions",r.PROP_ANY],["dataset",r.PROP_ANY],["datasource",r.PROP_STRING],["dateformat",r.PROP_STRING],["datepattern",r.PROP_STRING],["debouncetime",Object.assign({value:250},r.PROP_NUMBER)],["defaultvalue",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["displayfield",r.PROP_STRING],["displaylabel",r.PROP_STRING],["editdatepattern",r.PROP_STRING],["outputformat",r.PROP_STRING],["edit-widget-type",r.PROP_STRING],["editinputtype",r.PROP_STRING],["exportexpression",r.PROP_STRING],["filterdataset",r.PROP_STRING],["filterdatafield",r.PROP_STRING],["filterdisplayfield",r.PROP_STRING],["filterdisplaylabel",r.PROP_STRING],["filterexpressions",Object.assign({value:"{}"},r.PROP_STRING)],["filtersearchkey",r.PROP_STRING],["filter-on",r.PROP_STRING],["filteronfilter",r.PROP_STRING],["filterplaceholder",r.PROP_STRING],["filterwidget",r.PROP_STRING],["filterinputtype",r.PROP_STRING],["formatpattern",r.PROP_STRING],["custompipeformat",r.PROP_STRING],["fractionsize",r.PROP_STRING],["generator",r.PROP_STRING],["groupby",r.PROP_STRING],["limit",r.PROP_NUMBER],["match",r.PROP_STRING],["matchmode",r.PROP_STRING],["maxchars",r.PROP_NUMBER],["maxvalue",r.PROP_NUMBER],["step",r.PROP_NUMBER],["mobiledisplay",Object.assign({value:!0},r.PROP_BOOLEAN)],["minvalue",r.PROP_NUMBER],["maxdate",r.PROP_STRING],["mindate",r.PROP_STRING],["excludedays",r.PROP_STRING],["excludedates",r.PROP_STRING],["maxtime",r.PROP_STRING],["mintime",r.PROP_STRING],["pcdisplay",Object.assign({value:!0},r.PROP_BOOLEAN)],["period",r.PROP_BOOLEAN],["placeholder",r.PROP_STRING],["prefix",r.PROP_STRING],["primary-key",r.PROP_BOOLEAN],["readonly",r.PROP_BOOLEAN],["regexp",r.PROP_ANY],["related-entity-name",r.PROP_STRING],["required",r.PROP_BOOLEAN],["rowactionsposition",r.PROP_STRING],["searchkey",r.PROP_STRING],["searchable",Object.assign({value:!0},r.PROP_BOOLEAN)],["showinfilter",Object.assign({value:!1},r.PROP_BOOLEAN)],["suffix",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["showcount",r.PROP_BOOLEAN],["showdropdownon",Object.assign({value:"default"},r.PROP_STRING)],["sortable",Object.assign({value:!0},r.PROP_BOOLEAN)],["tabletdisplay",Object.assign({value:!0},r.PROP_BOOLEAN)],["textalignment",Object.assign({value:"left"},r.PROP_STRING)],["textcolor",r.PROP_STRING],["type",Object.assign({value:"string"},r.PROP_STRING)],["uncheckedvalue",r.PROP_STRING],["validationmessage",r.PROP_STRING],["widget-type",r.PROP_STRING],["width",r.PROP_STRING]]))},z=function(){r.register("wm-table-column-group",new Map([["backgroundcolor",r.PROP_STRING],["caption",r.PROP_STRING],["col-class",r.PROP_STRING],["name",r.PROP_STRING],["textalignment",Object.assign({value:"center"},r.PROP_STRING)]]))},H={widgetType:"wm-table-column-group",hostClass:""},Y=function(e){function t(t,n,i){var o=e.call(this,t,H)||this;return o.group=n,o.table=i,o.config={},o}return g(t,e),t.prototype.populateConfig=function(){this.config={field:this.name,displayName:this.caption||"",columns:[],isGroup:!0,accessroles:this.accessroles,textAlignment:this.textalignment||"center",backgroundColor:this.backgroundcolor,class:this["col-class"]}},t.prototype.onPropertyChange=function(t,n,i){"caption"===t?(this.config.displayName=n||"",this.table.callDataGridMethod("setColumnProp",this.config.field,"displayName",n,!0)):e.prototype.onPropertyChange.call(this,t,n,i)},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.populateConfig();var t=parseInt(this.getAttr("headerIndex"),10),n=parseInt(this.getAttr("index"),10),i=this.group&&this.group.name;r.setHeaderConfigForTable(this.table.headerConfig,this.config,i,i?n:t)},t}(r.BaseComponent);Y.initializeProps=z(),Y.decorators=[{type:t.Directive,args:[{selector:"[wmTableColumnGroup]",providers:[r.provideAsWidgetRef(Y)]}]}],Y.ctorParameters=function(){return[{type:t.Injector},{type:Y,decorators:[{type:t.SkipSelf},{type:t.Optional}]},{type:S,decorators:[{type:t.Optional}]}]};var K={widgetType:"wm-table-column",hostClass:""},Q=["datafield","displayfield","placeholder","searchkey","matchmode","displaylabel","groupby","match","dateformat","showcount","collapsible","checkedvalue","uncheckedvalue","showdropdownon","dataentrymode","autoclose","dataset","outputformat"];Q=w(w([],b(Q)),b(["maxchars","regexp","minvalue","maxvalue","step","required","mindate","maxdate","excludedates","excludedays","mintime","maxtime"]));var Z=function(){function e(e){this.widget=e}return e.prototype.focus=function(){this.widget.focus()},e.prototype.setProperty=function(e,t){e="value"===e?"datavalue":e,this.widget[e]=t},e.prototype.getProperty=function(e){return e="value"===e?"datavalue":e,this.widget[e]},e}(),J=function(e){function t(t,n,i,o,a,r){var s=e.call(this,t,K)||this;return s.appDefaults=n,s.table=i,s.group=o,s.bindfilterdataset=a,s.binddataset=r,s.syncValidators=[],s.asyncValidators=[],s.observeOnFields=[],s.aggregate={sum:function(){return _.sum(s._getColumnData())},average:function(e){return void 0===e&&(e=2),_.round(_.mean(s._getColumnData()),e)},count:function(){return s._getColumnData().length},minimum:function(){return _.min(s._getColumnData())},maximum:function(){return _.max(s._getColumnData())},percent:function(e,t){return void 0===t&&(t=2),_.round(_.sum(s._getColumnData())/e*100,t)}},s.notifyForFields=[],s}return g(t,e),Object.defineProperty(t.prototype,"dataoptions",{get:function(){return this._dataoptions},set:function(e){this._dataoptions=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"datasource",{get:function(){return this._datasource},set:function(e){this._datasource=e},enumerable:!1,configurable:!0}),t.prototype.ngOnInit=function(){var t=this;e.prototype.ngOnInit.call(this),this.populateFieldDef();var n=parseInt(this.getAttr("index"),10),i=parseInt(this.getAttr("headerIndex"),10),o=this.group&&this.group.name;if(r.setHeaderConfigForTable(this.table.headerConfig,{field:this.field,displayName:this.displayName},o,o?n:i),this.table.registerColumns(this.widget,n),this._isRowFilter="multicolumn"===this.table.filtermode&&this.searchable,this._isInlineEditable=!this.readonly&&this.table.editmode!==r.EDIT_MODE.DIALOG&&this.table.editmode!==r.EDIT_MODE.FORM,this._isNewEditableRow=this._isInlineEditable&&this.table.editmode===r.EDIT_MODE.QUICK_EDIT&&this.table.shownewrow,this.setUpControls(),this._propsInitialized=!0,this.getFormControl()){var a=this.getFormControl().statusChanges.pipe(m.debounceTime(100)).subscribe((function(e){return t.onStatusChange(e,"inlineInstance")}));this.registerDestroyListener((function(){return a.unsubscribe()})),this.fieldValidations=new r.BaseFieldValidations(this,this.inlineInstance,this.editWidgetType,this.getFormControl(),this.table,"inlineInstance")}if(this._checkNewEditableRowControl()){var s=this.getFormControl("_new").statusChanges.pipe(m.debounceTime(100)).subscribe((function(e){return t.onStatusChange(e,"inlineInstanceNew")}));this.registerDestroyListener((function(){return s.unsubscribe()})),this.fieldValidations_new=new r.BaseFieldValidations(this,this.inlineInstanceNew,this.editWidgetType,this.getFormControl("_new"),this.table,"inlineInstanceNew")}},t.prototype.ngAfterContentInit=function(){var t=this;if(this._isRowFilter){var n=this._filterInstances.changes.subscribe((function(e){t.filterInstance=e.first&&e.first.widget,t.setUpFilterWidget()}));this.registerDestroyListener((function(){return n.unsubscribe()}))}if(this._isInlineEditable){var i=this._inlineInstances.changes.subscribe((function(e){t.inlineInstance=e.first&&e.first.widget,t.fieldValidations.formwidget=e.first,t.table.registerFormField(t.binding,new Z(t.inlineInstance)),t.setUpInlineWidget("inlineInstance")}));if(this.registerDestroyListener((function(){return i.unsubscribe()})),this._isNewEditableRow){var o=this._inlineInstancesNew.changes.subscribe((function(e){t.inlineInstanceNew=e.first&&e.first.widget,t.fieldValidations_new.formwidget=e.first,t.setUpInlineWidget("inlineInstanceNew")}));this.registerDestroyListener((function(){return o.unsubscribe()}))}}this.registerReadyStateListener((function(){t.key=t.field||t.binding})),e.prototype.ngAfterContentInit.call(this),this.table.isdynamictable&&this.table.inlineWidgetTmpl._results.push(this.inlineWidthTempRef)},t.prototype.ngAfterViewInit=function(){this.filterTemplateRef&&this.table.renderDynamicFilterColumn(this.filterTemplateRef)},t.prototype.applyValidations=function(){this.getFormControl()&&(this.syncValidators.length>0&&this.fieldValidations.setValidators(this.syncValidators),this.fieldValidations.setUpValidators(),this.asyncValidators.length>0&&this.fieldValidations.setAsyncValidators(this.asyncValidators),this.observeOnFields.length>0&&this.fieldValidations.observeOn(this.observeOnFields,"columns"))},t.prototype.removeValidations=function(){this.table.ngform.markAsUntouched();var e=this.getFormControl();e&&(e.clearValidators(),e.clearAsyncValidators(),e.updateValueAndValidity())},t.prototype.applyNewRowValidations=function(){this._checkNewEditableRowControl()&&(this.syncValidators.length>0&&this.fieldValidations_new.setValidators(this.syncValidators),this.fieldValidations_new.setUpValidators(),this.asyncValidators.length>0&&this.fieldValidations_new.setAsyncValidators(this.asyncValidators),this.observeOnFields.length>0&&this.fieldValidations_new.observeOn(this.observeOnFields,"columns"))},t.prototype.removeNewRowValidations=function(){if(this.table.ngform.markAsUntouched(),this._checkNewEditableRowControl()){var e=this.getFormControl("_new");e.clearValidators(),e.clearAsyncValidators(),e.updateValueAndValidity()}},t.prototype.addFormControl=function(e){var t=e?this.binding+e:this.binding;this.table.ngform.addControl(t,this.table.fb.control(""))},t.prototype.getFormControl=function(e){var t=e?this.binding+e:this.binding;return this.table.ngform.controls[t]},t.prototype._checkNewEditableRowControl=function(){return this._isNewEditableRow&&this.getFormControl("_new")},t.prototype.setUpControls=function(){var e=this;if(this._isInlineEditable){if(this.editWidgetType===u.FormWidgetType.UPLOAD)return;this.addFormControl();var t=this.getFormControl();if(t){var n=t.valueChanges.pipe(m.debounceTime(200)).subscribe((function(t){return e.onValueChange(t,"inlineInstance")}));this.registerDestroyListener((function(){return n.unsubscribe()}))}if(this._isNewEditableRow){this.addFormControl("_new");var i=this.getFormControl("_new");if(i){var o=i.valueChanges.pipe(m.debounceTime(200)).subscribe((function(t){return e.onValueChange(t,"inlineInstanceNew")}));this.registerDestroyListener((function(){return o.unsubscribe()}))}}}if(this._isRowFilter&&(this.addFormControl("_filter"),this.filterControl=this.getFormControl("_filter"),this.filterControl)){var a=this.filterControl.valueChanges.subscribe(this.onFilterValueChange.bind(this));this.registerDestroyListener((function(){return a.unsubscribe()}))}},t.prototype.resetFilter=function(){this.filterControl&&this.filterControl.setValue(""),this.filterwidget===u.FormWidgetType.AUTOCOMPLETE&&(this.filterInstance.query="",this.filterInstance.queryModel="")},t.prototype.onFilterValueChange=function(e){this.table.rowFilter[this.field].value=e},Object.defineProperty(t.prototype,"datavalue",{get:function(){return this[this.activeControlType]&&this[this.activeControlType].datavalue},set:function(e){var t=this.getFormControl("inlineInstanceNew"===this.activeControlType?"_new":void 0);t&&t&&this.editWidgetType!==u.FormWidgetType.UPLOAD&&t.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}),t.prototype.onValueChange=function(e,t){null!==e&&r.applyFilterOnField(this.table.datasource,this.widget,this.table.fieldDefs,e,{widget:"edit-widget-type"}),this.table.ngform.touched&&(this.activeControlType=t,"inlineInstance"===t?(this.notifyChanges(),this.fieldValidations.setCustomValidationMessage()):this._isNewEditableRow&&(this.notifyChanges("_new"),this.fieldValidations_new.setCustomValidationMessage()))},t.prototype.loadFilterData=function(){var e=this;this._isRowFilter&&r.isDataSetWidget(this.filterwidget)&&!this.bindfilterdataset&&(this.table.datasource.execute(u.DataSource.Operation.SUPPORTS_DISTINCT_API)?(this.relatedEntityName&&(this.widget["is-related"]=!0,this.widget["lookup-type"]=this.relatedEntityName,this.widget["lookup-field"]=_.last(_.split(this.field,"."))),this.filterwidget===u.FormWidgetType.AUTOCOMPLETE?(this.filterInstance.dataoptions=r.getDistinctFieldProperties(this.table.datasource,this),this.filterInstance.datasource=this.table.datasource):r.getDistinctValues(this.table.datasource,this.widget,"filterwidget").then((function(t){e._filterDataSet=t.data,e.setFilterWidgetDataSet()}))):this.registerDestroyListener(u.$watch(this.table.binddataset,this.viewParent,{},(function(t){return e.widget.filterdataset=t}),r.getWatchIdentifier(this.widgetId,"filterdataset"))))},t.prototype.loadInlineWidgetData=function(){if(r.isDataSetWidget(this["edit-widget-type"])&&!this.binddataset&&!this.readonly){var e=this.table.datasource;if(this["related-entity-name"]&&this["primary-key"]){this.isDataSetBound=!0;var t=_.split(this.binding,".");this.showPendingSpinner=!0,r.fetchRelatedFieldData(e,this.widget,{relatedField:_.head(t),datafield:_.last(t),widget:"edit-widget-type"})}else e.execute(u.DataSource.Operation.SUPPORTS_DISTINCT_API)&&r.getDistinctValuesForField(e,this.widget,{widget:"edit-widget-type"})}},t.prototype.onDataSourceChange=function(){this.loadFilterData(),this.table.editmode===r.EDIT_MODE.QUICK_EDIT&&this.loadInlineWidgetData()},t.prototype.setFilterWidgetDataSet=function(){this.filterInstance&&(this.filterInstance.dataset=this._filterDataSet)},t.prototype.setUpFilterWidget=function(){var e=this;this.filterInstance.registerReadyStateListener((function(){if(r.isDataSetWidget(e.filterwidget)){var t=_.last(e.binding.split("."));e.filterInstance.dataset=e._filterDataSet,e.filterInstance.datafield=e.filterdatafield||t,e.filterInstance.displayfield=e.filterdisplayfield||t,e.filterwidget===u.FormWidgetType.AUTOCOMPLETE&&(e.filterInstance.displaylabel=e.filterdisplaylabel||t,e.filterInstance.searchkey=e.filtersearchkey||t)}e.filterwidget===u.FormWidgetType.TIME&&(e.filterInstance.timepattern=e.appDefaults.timeFormat||"hh:mm:ss a"),e.filterInstance.placeholder=e.filterplaceholder||""}))},t.prototype.notifyChanges=function(e){var t=this;_.forEach(this.notifyForFields,(function(n){e&&t._isNewEditableRow?n.fieldValidations_new.validate():n.fieldValidations.validate()}))},t.prototype.observeOn=function(e){this.observeOnFields=_.cloneDeep(e)},t.prototype.setUpValidators=function(){this.fieldValidations.setUpValidators(),this._checkNewEditableRowControl()&&this.fieldValidations_new.setUpValidators()},t.prototype.setAsyncValidators=function(e){this.asyncValidators=_.cloneDeep(e)},t.prototype.setValidators=function(e){this.syncValidators=_.cloneDeep(e)},t.prototype.boundFn=function(e){return e()},t.prototype.onStatusChange=function(e,t){this["showPendingSpinner"+("inlineInstance"===t?"":"New")]="PENDING"===e},t.prototype.setSummaryRowData=function(e){var t=e instanceof Array?e:[e];this._invokeSummaryRowData(t)},t.prototype._invokeSummaryRowData=function(e){var t=this;_.forEach(e,(function(e,n){var i=e;if(i instanceof Promise)i.then((function(e){t.table.callDataGridMethod("setSummaryRowDef",t.key,e,n,!0)}));else if(i.value&&i.value instanceof Promise){var o=i;i.value.then((function(e){o.value=e,t.table.callDataGridMethod("setSummaryRowDef",t.key,o,n,!0)}))}t.table.callDataGridMethod("setSummaryRowDef",t.key,i,n)}))},t.prototype._getColumnData=function(){return _.map(this.table.dataset,this.binding)},t.prototype.setInlineWidgetProp=function(e,t,n){"datepattern"===t&&this.editWidgetType===u.FormWidgetType.TIME&&(t="timepattern"),this[e]&&u.isDefined(n)&&(this[e][t]=n)},t.prototype.setUpInlineWidget=function(e){var t=this;this[e].registerReadyStateListener((function(){r.isDataSetWidget(t["edit-widget-type"])&&(t[e].dataset=t.dataset),Q.forEach((function(n){t.setInlineWidgetProp(e,n,t[n])})),t[e].datasource=t._datasource,t[e].dataoptions=t._dataoptions,t.setInlineWidgetProp(e,"datepattern",t.editdatepattern)}))},t.prototype.getStyleDef=function(){return"width: "+(this.width||"")+"; background-color: "+(this.backgroundcolor||"")+"; color: "+(this.textcolor||"")+";"},t.prototype.populateFieldDef=function(){if(this.width="px"===this.width?"":this.width||"",this.field=this.binding,this.displayName=this.caption||"",this.pcDisplay=this.pcdisplay,this.mobileDisplay=this.mobiledisplay,this.tabletDisplay=this.tabletdisplay,this.textAlignment=this.textalignment,this.backgroundColor=this.backgroundcolor,this.textColor=this.textcolor,this.primaryKey=this["primary-key"],this.relatedEntityName=this["related-entity-name"],this.style=this.getStyleDef(),this.class=this["col-class"],this.ngclass=this["col-ng-class"],this.formatpattern="toNumber"===this.formatpattern?"numberToString":this.formatpattern,this.searchable="blob"!==this.type&&"clob"!==this.type&&this.searchable,this.showinfilter=!this.nativeElement.hasAttribute("showinfilter")||this.table&&this.table.isdynamictable?this.show:this.nativeElement.getAttribute("showinfilter"),this.limit=this.limit?+this.limit:void 0,this.editWidgetType=this["edit-widget-type"]=this["edit-widget-type"]||r.getEditModeWidget(this),this.filterOn=this["filter-on"],this.readonly=u.isDefined(this.getAttr("readonly"))?"true"===this.getAttr("readonly"):this["related-entity-name"]?!this["primary-key"]:_.includes(["identity","uniqueid","sequence"],this.generator),this.filterwidget=this.filterwidget||r.getDataTableFilterWidget(this.type||"string"),this.isFilterDataSetBound=!!this.bindfilterdataset,this.defaultvalue=r.getDefaultValue(this.defaultvalue,this.type,this.editWidgetType),u.isDateTimeType(this.type)&&"toDate"===this.formatpattern&&!this.datepattern){var e=u.getDisplayDateTimeFormat(this.type);this.type===u.DataType.DATE?this.datepattern=this.appDefaults.dateFormat||e:this.type===u.DataType.TIME?this.datepattern=this.appDefaults.timeFormat||e:this.type!==u.DataType.TIMESTAMP&&this.type!==u.DataType.DATETIME||(this.datepattern=this.appDefaults.dateTimeFormat||e)}},t.prototype.onPropertyChange=function(t,n,i){if(this._propsInitialized){switch(t){case"caption":this.displayName=n||"",this.setProperty("displayName",this.displayName);break;case"defaultvalue":this.defaultvalue=r.getDefaultValue(this.defaultvalue,this.type,this.editWidgetType);break;case"show":this.table.redraw(!0),this.showinfilter=this.nativeElement.hasAttribute("showinfilter")?this.nativeElement.getAttribute("showinfilter"):n;break;case"filterdataset":this._filterDataSet=n,this.setFilterWidgetDataSet();break;case"editdatepattern":this.setInlineWidgetProp("inlineInstance","datepattern",n),this.setInlineWidgetProp("inlineInstanceNew","datepattern",n);break;case"showinfilter":this.showinfilter=n;break;default:Q.includes(t)&&(this.setInlineWidgetProp("inlineInstance",t,n),this.setInlineWidgetProp("inlineInstanceNew",t,n))}e.prototype.onPropertyChange.call(this,t,n,i)}},t.prototype.setProperty=function(e,t){switch(this[e]=t,e){case"displayName":this.table.callDataGridMethod("setColumnProp",this.field,e,t);break;default:this.table.redraw(!0)}},t}(r.BaseComponent);J.initializeProps=q(),J.decorators=[{type:t.Directive,args:[{selector:"[wmTableColumn]",providers:[r.provideAsWidgetRef(J)]}]}],J.ctorParameters=function(){return[{type:t.Injector},{type:u.AppDefaults},{type:S,decorators:[{type:t.Optional}]},{type:Y,decorators:[{type:t.Optional}]},{type:void 0,decorators:[{type:t.Attribute,args:["filterdataset.bind"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["dataset.bind"]}]}]},J.propDecorators={_filterInstances:[{type:t.ContentChildren,args:["filterWidget"]}],_inlineInstances:[{type:t.ContentChildren,args:["inlineWidget"]}],_inlineInstancesNew:[{type:t.ContentChildren,args:["inlineWidgetNew"]}],customExprTmpl:[{type:t.ContentChild,args:["customExprTmpl"]}],inlineWidthTempRef:[{type:t.ContentChild,args:["inlineWidgetTmpl"]}],filterTemplateRef:[{type:t.ContentChild,args:["filterTmpl"]}]};var X=function(){r.register("wm-table-row",new Map([["class",r.PROP_STRING],["closeothers",Object.assign({value:!0},r.PROP_BOOLEAN)],["content",r.PROP_STRING],["columnwidth",Object.assign({value:"30px"},r.PROP_STRING)],["collapseicon",r.PROP_STRING],["expandicon",r.PROP_STRING],["height",r.PROP_STRING],["position",Object.assign({value:"0"},r.PROP_STRING)]]))},ee={widgetType:"wm-table-row",hostClass:""},te=function(e){function t(t,n){var i=e.call(this,t,ee)||this;return i.table=n,i}return g(t,e),t.prototype.populateConfig=function(){this.config={closeothers:this.closeothers,content:this.content,columnwidth:this.columnwidth,expandicon:this.expandicon,collapseicon:this.collapseicon,height:this.height,position:this.position}},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.populateConfig(),this.table.registerRow(this.config,this)},t.prototype.onPropertyChange=function(e,t){"content"===e&&this.config&&(this.config.content=this.content)},t}(r.BaseComponent);te.initializeProps=X(),te.decorators=[{type:t.Directive,args:[{selector:"[wmTableRow]",providers:[r.provideAsWidgetRef(te)]}]}],te.ctorParameters=function(){return[{type:t.Injector},{type:S,decorators:[{type:t.Optional},{type:t.SkipSelf}]}]};var ne=function(){r.register("wm-table-row-action",new Map([["accessroles",r.PROP_STRING],["action",r.PROP_STRING],["caption",r.PROP_STRING],["class ",Object.assign({value:"btn-secondary"},r.PROP_STRING)],["disabled",Object.assign({value:!1},r.PROP_BOOLEAN)],["display-name",r.PROP_STRING],["hyperlink",r.PROP_STRING],["iconclass",r.PROP_STRING],["key",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["target",r.PROP_STRING],["title",r.PROP_STRING],["widget-type",Object.assign({value:"button"},r.PROP_STRING)]]))},ie={widgetType:"wm-table-row-action",hostClass:""},oe=function(e){function t(t,n,i){var o=e.call(this,t,ie)||this;return o.table=n,i[0].editRow=function(e){return o.table.editRow(e)},i[0].deleteRow=function(e){return o.table.deleteRow(e)},i[0].addNewRow=function(e){return o.table.addNewRow(e)},o}return g(t,e),t.prototype.getTitle=function(){return _.isUndefined(this.title)?this["display-name"]||"":this.title},t.prototype.populateAction=function(){this.buttonDef={key:this.key,displayName:this["display-name"]||this.caption||"",show:this.show,class:this.class||"",iconclass:this.iconclass||"",title:this.getTitle(),action:this.action,accessroles:this.accessroles,disabled:this.disabled,tabindex:this.tabindex?+this.tabindex:void 0,widgetType:this["widget-type"]||"button",hyperlink:this.hyperlink,target:this.target||"",conditionalclass:this.conditionalclass||"",conditionalstyle:this.conditionalstyle||{}}},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.populateAction(),this.table.registerRowActions(this.buttonDef)},t}(r.BaseComponent);oe.initializeProps=ne(),oe.decorators=[{type:t.Directive,args:[{selector:"[wmTableRowAction]",providers:[r.provideAsWidgetRef(oe),{provide:r.Context,useValue:{},multi:!0}]}]}],oe.ctorParameters=function(){return[{type:t.Injector},{type:S,decorators:[{type:t.Optional}]},{type:Array,decorators:[{type:t.Self},{type:t.Inject,args:[r.Context]}]}]};var ae=[S,x,G,U,J,Y,te,oe],re=function(){};re.decorators=[{type:t.NgModule,args:[{imports:[s.BasicModule,a.BsDropdownModule,n.CommonModule,i.FormsModule,i.ReactiveFormsModule,l.InputModule,p.ListModule,c.MenuModule,d.PaginationModule,o.TooltipModule,r.WmComponentsModule],declarations:w([],b(ae)),exports:w([],b(ae)),entryComponents:[]}]}],e.TableActionDirective=U,e.TableCUDDirective=x,e.TableColumnDirective=J,e.TableColumnGroupDirective=Y,e.TableComponent=S,e.TableFilterSortDirective=G,e.TableModule=re,e.TableRowActionDirective=oe,e.TableRowDirective=te,e["\u0275a"]=P,e["\u0275b"]=V,e["\u0275c"]=z,e["\u0275d"]=q,e["\u0275e"]=X,e["\u0275f"]=ne,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("rxjs/operators"),require("@wm/core"),require("@wm/components/data/table")):"function"==typeof define&&define.amd?define("@wm/components/data/live-table",["exports","@angular/core","@angular/common","@wm/components/base","rxjs/operators","@wm/core","@wm/components/data/table"],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.livetable={}),e.ng.core,e.ng.common,e.wm.components.base,e.rxjs.operators,e.wm.core,e.wm.components.data.table)}(this,(function(e,t,n,i,o,a,r){"use strict";
|
|
521
521
|
/*! *****************************************************************************
|
|
522
522
|
Copyright (c) Microsoft Corporation.
|
|
523
523
|
|