@wavemaker/app-runtime-wm-build 11.4.2-rc.5405 → 11.4.2-rc.5559
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 +488 -204
- app-runtime-wm-build/wmapp/scripts/wm-libs.min.js +186 -174
- app-runtime-wm-build/wmapp/scripts/wm-loader.js +24 -24
- app-runtime-wm-build/wmapp/scripts/wm-loader.min.js +6 -6
- app-runtime-wm-build/wmapp/styles/css/wm-style.css +1 -1
- app-runtime-wm-build/wmmobile/scripts/wm-libs.js +488 -204
- app-runtime-wm-build/wmmobile/scripts/wm-libs.min.js +209 -197
- app-runtime-wm-build/wmmobile/scripts/wm-mobileloader.js +24 -24
- app-runtime-wm-build/wmmobile/scripts/wm-mobileloader.min.js +6 -6
- app-runtime-wm-build/wmmobile/styles/css/wm-style.css +1 -1
|
@@ -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),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),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";
|
|
58
58
|
/*! *****************************************************************************
|
|
59
59
|
Copyright (c) Microsoft Corporation.
|
|
60
60
|
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
111
111
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
112
112
|
PERFORMANCE OF THIS SOFTWARE.
|
|
113
|
-
***************************************************************************** */var p=function(e,t){return(p=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 d(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,a=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return r}function u(e,t,n){if(n||2===arguments.length)for(var i,o=0,a=t.length;o<a;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var h=new Map([["casesensitive",Object.assign({value:!1},a.PROP_BOOLEAN)],["class",a.PROP_STRING],["datacompletemsg",Object.assign({value:"No more data to load"},a.PROP_STRING)],["datafield",Object.assign({value:"All Fields"},a.PROP_STRING)],["dataoptions",a.PROP_ANY],["dataset",a.PROP_ANY],["datasource",a.PROP_ANY],["datavalue",a.PROP_STRING],["datavaluesource",a.PROP_ANY],["dateformat",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["displayimagesrc",a.PROP_STRING],["displaylabel",a.PROP_STRING],["displayexpression",a.PROP_STRING],["dropup",a.PROP_BOOLEAN],["groupby",a.PROP_STRING],["hint",a.PROP_STRING],["imagewidth",Object.assign({value:"16px"},a.PROP_STRING)],["limit",a.PROP_NUMBER],["loadingdatamsg",Object.assign({value:"Loading items..."},a.PROP_STRING)],["match",a.PROP_STRING],["matchmode",a.PROP_STRING],["minchars",a.PROP_NUMBER],["name",a.PROP_STRING],["navsearchbar",Object.assign({value:!1},a.PROP_BOOLEAN)],["orderby",a.PROP_STRING],["placeholder",Object.assign({value:"Search"},a.PROP_STRING)],["position",a.PROP_STRING],["query",a.PROP_STRING],["readonly",a.PROP_BOOLEAN],["required",a.PROP_BOOLEAN],["searchkey",a.PROP_STRING],["searchon",Object.assign({value:"typing"},a.PROP_STRING)],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["showclear",Object.assign({value:!1},a.PROP_BOOLEAN)],["showsearchicon",a.PROP_BOOLEAN],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["type",Object.assign({value:"search"},a.PROP_STRING)],["debouncetime",Object.assign({value:250},a.PROP_NUMBER)],["width",a.PROP_STRING]]),m=function(){a.register("wm-search",h),a.registerFormWidget(l.FormWidgetType.AUTOCOMPLETE,new Map(h)),a.registerFormWidget(l.FormWidgetType.TYPEAHEAD,new Map(h))},f=function(){function e(){}return e.prototype.applyFilter=function(e,t,n){return e=_.isNumber(e)?e.toString():e,_.includes(n,"start")?_.startsWith(e,t):_.includes(n,"end")?_.endsWith(e,t):_.includes(n,"exact")?_.isEqual(e,t):_.includes(e,t)},e.prototype.filter=function(e){var t=this,n=e.dataset,i=e.casesensitive,o=e.matchMode;o&&!_.includes(o,"ignorecase")&&(i=!0);var a,r=e.query;return new Promise((function(s,l){if(e.searchKey){var c=_.split(e.searchKey,",");a=_.filter(e.dataset,(function(e){return c.some((function(n){var a=_.get(e,n),s=r;return i||(a=_.toLower(_.toString(a)),s=_.toLower(_.toString(s))),t.applyFilter(a,s,o)}))}))}else a=_.isArray(n)&&_.isObject(n[0])?_.filter(n,(function(e){var n=_.values(e).join(" ");return i||(n=_.toLower(n),r=_.toLower(r)),t.applyFilter(n,r)})):_.filter(n,(function(e){return i||(e=_.toLower(e),r=_.toLower(r)),t.applyFilter(e,r,o)}));s({data:a,hasMoreData:!1,isLastPage:!0})}))},e}(),g=function(){function e(){}return e.prototype.filter=function(e){var t=this;return this.filterData(e).then((function(n){return t.onFilterSuccess(e,n)}),(function(){return t.onFilterFailure()}))},e.prototype.filterData=function(e){if(e.dataoptions){var t=e.dataoptions,n=e.datasource.execute(l.DataSource.Operation.GET_REQUEST_PARAMS,e);if(t.relatedField)return new Promise((function(i,o){a.interpolateBindExpressions(e.viewParent,t.filterExpr,(function(a){n.filterExpr=t.filterExpr=a,t.filterExpr=a,e.datasource.execute(l.DataSource.Operation.GET_RELATED_TABLE_DATA,_.assign({relatedField:t.relatedField},n)).then(i,o)}))}));if(t.distinctField)return e.datasource.execute(l.DataSource.Operation.GET_DISTINCT_DATA_BY_FIELDS,{pagesize:e.limit||e.pagesize,page:e.page,fields:t.distinctField,entityName:t.tableName,filterFields:_.assign(t.filterFields,n.filterFields),filterExpr:l.getClonedObject(t.filterExpr||{})})}return e.datasource.execute(l.DataSource.Operation.SEARCH_RECORDS,e)},e.prototype.isLast=function(e,t,n,i){return t===l.AppConstants.INT_MAX_VALUE?0!==i&&i<n:e===(t>n?Math.ceil(t/n):t<0?0:1)},e.prototype.getTransformedData=function(e,t){var n=e.operation+"Result",i=t[n];if(i){var o={};_.set(o,n,i),t=[o]}else t=[t];return t},e.prototype.onFilterFailure=function(){return[]},e.prototype.isLastPageForDistinctApi=function(e,t,n,i){return t>1&&!i&&_.isEmpty(e)&&n===l.AppConstants.INT_MAX_VALUE},e.prototype.onFilterSuccess=function(e,t){var n,i,o,a,r=this,s=t.data,c=_.split(e.binddataset,"."),p=_.slice(c,_.indexOf(c,"dataSet")+1).join(".");return new Promise((function(c,d){var u=t.pagination;if(e.datasource.execute(l.DataSource.Operation.IS_PAGEABLE)&&(o=u.number+1,i=r.isLast(o,e.limit>0&&e.limit||u.totalElements,u.size,u.numberOfElements),a=!0,r.isLastPageForDistinctApi(s,o,u.totalElements,i)))c({data:[],isLastPage:i=!0,hasMoreData:o>1,isPaginatedData:a,page:o});else{if(p){if(_.isArray(s)){var h=p.lastIndexOf("[$i]");if(h>-1){var m=p.substr(h+5);n=s.map((function(e){return l.findValueOf(e,m)}))}}else _.isObject(s)&&(n=_.get(s,p));s=n||s}_.isArray(s)||(s=r.getTransformedData(e.datasource,s)),s.length?c({data:s,isLastPage:i,hasMoreData:o>1,isPaginatedData:a,page:o}):c({data:[],isLastPage:i,hasMoreData:o>1,isPaginatedData:a,page:o})}}))},e}(),v=function(){function e(){}return e.prototype.filter=function(t){var n=this,i=t.datasource&&t.datasource.execute(l.DataSource.Operation.IS_UPDATE_REQUIRED,t.hasData);return(!t.isLocalFilter&&(t.dataoptions||t.datasource&&t.datasource.execute(l.DataSource.Operation.IS_API_AWARE)&&t.searchKey&&i)?e.remoteDataProvider.filter(t):e.localDataProvider.filter(t)).then((function(e){return n.updateDataset=t.datasource&&!t.datasource.execute(l.DataSource.Operation.SUPPORTS_CRUD)&&i,n.hasMoreData=e.hasMoreData,n.isLastPage=e.isLastPage,n.page=e.page,n.isPaginatedData=e.isPaginatedData,e}))},e}();v.remoteDataProvider=new g,v.localDataProvider=new f;var y={widgetType:"wm-search",hostClass:"input-group"},b=function(e){function t(t,n,i,o){var a=e.call(this,t,y)||this;a.binddatavalue=i,a.binddataset=o,a.query="",a.page=1,a.allowempty=!1,a.app=n,l.addClass(a.nativeElement,"app-search",!0),a.typeaheadDataSource=r.Observable.create((function(e){a.listenQuery&&(a._defaultQueryInvoked=!1,a._loadingItems=!0,e.next(a.query)),a.lastSelectedIndex&&(a.typeahead._container=void 0)})).pipe(s.filter((function(){return a._loadingItems=!1,0===a.minchars||a.query&&a.query.length>=a.minchars})),s.mergeMap((function(e){return a.getDataSourceAsObservable(e)}))),a.dataProvider=new v;var c=a.datavalue$.subscribe((function(e){var t=_.isArray(e)?e[0]:e;if(null===t||""===t)return a._modelByValue="",a.query=a.queryModel="",void(a._lastResult=void 0);a._unsubscribeDv||(a._defaultQueryInvoked=!1,_.isObject(e)||a.prevDatavalue===e||(a._modelByKey=void 0,a.query=a.queryModel=""),a.updateByDatavalue(e)),a.showClosebtn=""!==a.query}));a.registerDestroyListener((function(){return c.unsubscribe()}));var p=a.dataset$.subscribe((function(){a.startIndex=a.datasetItems.length,a._lastResult=void 0;var e=a.datavalue||a.toBeProcessedDatavalue;l.isDefined(e)&&a.updateByDataset(e)}));return a.registerDestroyListener((function(){return p.unsubscribe()})),a}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}p(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),Object.defineProperty(t.prototype,"datasource",{get:function(){return this._datasource},set:function(e){this._datasource=e;var t=this.datavalue||this.toBeProcessedDatavalue;this.updateByDatavalue(t)},enumerable:!1,configurable:!0}),t.prototype.clearSearch=function(e,t){this.query="",this.onInputChange(e),this.dataProvider.isLastPage=!1,this.listenQuery=!1,t&&(this.listenQuery=!0,this._unsubscribeDv=!1,this.loadMoreData()),this.invokeEventCallback("clearsearch"),this._loadingItems=!1,e&&this.$element.find(".app-search-input").focus()},t.prototype.clearText=function(){this.query="",this.showClosebtn=!1},t.prototype.closeSearch=function(){this._loadingItems=!1,this.page=1,this.insertAtIndex(this.elIndex),this.elIndex=void 0,this.parentEl=void 0,this.$element.removeClass("full-screen"),this._domUpdated&&(this._domUpdated=!1),this.listenQuery=!1,this._unsubscribeDv=!0,this.typeahead.hide()},t.prototype.renderMobileAutoComplete=function(){l.isDefined(this.elIndex)||(this.parentEl=this.$element.parent(),this.elIndex=this.parentEl.children().index(this.$element)),this.$element.hasClass("full-screen")||(this._domUpdated=!0,this.$element.addClass("full-screen"),"inline"===this.position&&this.$element.addClass(this.position)),this.$element.hasClass("full-screen")&&this.$element.find(".app-search-input").focus()},t.prototype.getDataSourceAsObservable=function(e){if(this._lastQuery===e&&!_.get(this.dataoptions,"filterFields")&&l.isDefined(this._lastResult))return this._loadingItems=!1,r.of(this._lastResult);if("autocomplete"===this.type&&this.searchkey&&this.query&&this.datavalue){var t=[],n=_.split(this.searchkey,","),i=void 0;if(this.binddisplaylabel&&1===(t=_.split(this.binddisplaylabel,"+")).length)if(_.includes(t[0],"|"))i=!0;else{i=/\[(.*?)\]/.exec(t[0])[1]}if(t.length>1||i&&!_.includes(n,i)||this.displayexpression&&!_.includes(n,this.displayexpression))return this._loadingItems=!1,r.of([])}return this._lastQuery=this.query,r.from(this.getDataSource(e))},t.prototype.handleEvent=function(t,n,i,o){_.includes(["blur","focus","select","submit","change"],n)||e.prototype.handleEvent.call(this,t,n,i,o)},t.prototype.highlight=function(e,t){if(this.typeaheadContainer)return e.value=e.item.label.toString(),this.typeaheadContainer.highlight(e,t)},t.prototype.insertAtIndex=function(e){0===e?this.parentEl.prepend(this.$element):this.parentEl.children().eq(e).length?this.$element.insertBefore(this.parentEl.children().eq(e)):this.$element.insertAfter(this.parentEl.children().eq(e-1))},t.prototype.isMobileAutoComplete=function(){return"autocomplete"===this.type&&l.isMobile()},t.prototype.isQueryEntered=function(){return this.showclear&&this.showClosebtn},t.prototype.loadMoreData=function(e){this.dataProvider.isLastPage||(this.page=e?this.page+1:this.page,this.isScrolled=!0,this._loadingItems=!0,e&&(this._lastQuery=void 0),this.typeahead.onInput({target:{value:_.trim(this.query)||"0"}}))},t.prototype.onFocusOut=function(){this._unsubscribeDv=!1,this._loadingItems=!1,this.page=1,!this._domUpdated&&this._isOpen&&(this.listenQuery=!1),this._isOpen=!1,this._domUpdated&&this.typeahead&&this.typeahead._container&&(this.typeahead._container.isFocused=!0)},t.prototype.onInputChange=function(e){this.result=[],this.page=1,this.listenQuery=this.isUpdateOnKeyPress(),this._modelByValue=void 0,""===this.query?(this.queryModel="",this._modelByValue="",this.updatePrevDatavalue(this._lastQuery),this.invokeOnChange(this._modelByValue,{},!0),this.invokeEventCallback("clear",{$event:e}),e&&9!==e.which&&this.invokeEventCallback("submit",{$event:e})):this.invokeEventCallback("change",{$event:e,newVal:this._modelByValue||this.query,oldVal:this.prevDatavalue}),this.showClosebtn=""!==this.query},t.prototype.handleEnterEvent=function(e){_.get(this.typeahead,"matches.length")||this.onSearchSelect(e)},t.prototype.onSearchSelect=function(e){var t,n,i,o=(null===(n=null===(t=this.typeaheadContainer)||void 0===t?void 0:t.active)||void 0===n?void 0:n.value)===this.query;if(this.typeaheadContainer&&this.typeaheadContainer.active&&o&&(i=this.typeaheadContainer.active.item),e=this.eventData(e,i||{}),!this.isUpdateOnKeyPress())return this.listenQuery=!0,void this.typeahead.onInput({target:{value:this.query}});this.typeaheadContainer&&this.liElements.length&&o?this.typeaheadContainer.selectActiveMatch():(this.queryModel=this.query,this.invokeEventCallback("submit",{$event:e}))},t.prototype.invokeOnBeforeServiceCall=function(e){this.invokeEventCallback("beforeservicecall",{inputData:e})},t.prototype.onDropdownOpen=function(){var e=this;if(this.clearData&&this.typeahead.hide(),_.debounce((function(){e._isOpen=!0,e.typeaheadContainer=e.typeahead._container||e.typeahead._typeahead.instance,e.typeaheadContainer.liElements=e.liElements,e.typeaheadContainer.ulElement=e.ulElement,l.adjustContainerPosition($("typeahead-container"),e.nativeElement,e.typeahead._typeahead,$("typeahead-container .dropdown-menu"))}))(),this.isMobileAutoComplete()){this.$element.hasClass("full-screen")||this.renderMobileAutoComplete();var t=this.dropdownEl.closest("typeahead-container");t.insertAfter(this.$element.find("input").first());var n=this.$element.closest(".app-content").height();t.css({position:"relative",top:0,height:n+"px"}),this.showClosebtn=this.query&&""!==this.query,_.isUndefined(this.dataProvider.isLastPage)||this.dataProvider.isLastPage||this.triggerSearch()}},t.prototype.selectNext=function(){var e=this.typeaheadContainer.matches;if(e){var t=e.indexOf(this.typeaheadContainer.active);!this._loadingItems&&!this.dataProvider.isLastPage&&t+1>e.length-1&&(this.lastSelectedIndex=t,this.loadMoreData(!0))}},t.prototype.setLastActiveMatchAsSelected=function(){this.lastSelectedIndex&&(this.typeaheadContainer._active=this.typeaheadContainer.matches[this.lastSelectedIndex],this.typeaheadContainer.nextActiveMatch(),this.lastSelectedIndex=void 0)},t.prototype.triggerSearch=function(){if(!this.dataProvider.isLastPage&&this.$element.hasClass("full-screen")){var e=this.dropdownEl,t=e.find("li").last();t.length&&e.length&&e.height()+e.position().top>t.height()+t.position().top&&this.loadMoreData(!0)}},t.prototype.isUpdateOnKeyPress=function(){return"typing"===this.searchon},t.prototype.debounceDefaultQuery=function(e){var t=this;this._defaultQueryInvoked=!0,this.getDataSource(e,!0).then((function(e){e.length?(t.queryModel=e,t._lastQuery=t.query=t.queryModel[0].label||"",t._modelByValue=t.queryModel[0].value,t._modelByKey=t.queryModel[0].key,t.showClosebtn=""!==t.query):(t._modelByValue=void 0,t.queryModel=void 0,t.query=""),t.clearData&&_.get(t.typeahead,"_typeahead.isShown")&&t.typeahead.hide()}))},t.prototype.updateByDatavalue=function(e){this.updateByDataset(e),this.updateByDataSource(e)},t.prototype.updateByDataSource=function(e){if(l.isDefined(e)&&!_.isObject(e)&&this.datasource&&!l.isDefined(this._modelByKey)&&this.datafield!==a.ALLFIELDS){if(l.isDefined(this.queryModel)&&!_.isEmpty(this.queryModel))return void this.updateDatavalueFromQueryModel();!this._defaultQueryInvoked&&this.datasource.execute(l.DataSource.Operation.SUPPORTS_CRUD)&&this.debounceDefaultQuery(e)}},t.prototype.updateDatavalueFromQueryModel=function(){l.isDefined(this.queryModel)&&(this._modelByValue=_.isArray(this.queryModel)?this.queryModel[0].value:this.queryModel,this._modelByKey=_.isArray(this.queryModel)?this.queryModel[0].key:this.queryModel,this.toBeProcessedDatavalue=void 0)},t.prototype.updateByDataset=function(e){if(!this._defaultQueryInvoked||!this.searchkey){var t=_.find(this.datasetItems,(function(t){return _.isObject(t.value)?_.isEqual(t.value,e):_.toString(t.value).toLowerCase()===_.toString(e).toLowerCase()}));if(t)this.queryModel=[t];else if(this.datafield===a.ALLFIELDS&&_.isObject(e))this.queryModel=this.getTransformedData(a.extractDataAsArray(e));else if(this.prevDatavalue!==e)return this.queryModel=void 0,void(this.query="");this.updateDatavalueFromQueryModel(),this._lastQuery=this.query=l.isDefined(this.queryModel)&&this.queryModel.length?_.get(this.queryModel[0],"label"):"",this.showClosebtn=""!==this.query}},t.prototype.handleFocus=function(e){"search"===this.type&&this.query===this._lastQuery&&this._lastResult&&this.typeahead.keyUpEventEmitter.emit(this.query)},t.prototype.notifySubscriber=function(){var e=$(this.nativeElement).closest(".app-composite-widget.caption-floating");e.length>0&&this.app.notify("captionPositionAnimate",{displayVal:!0,nativeEl:e})},t.prototype.getDataSource=function(e,t,n){var i=this;if(t&&this.datafield===a.ALLFIELDS)return this._loadingItems=!1,Promise.resolve([]);var o={dataset:this.dataset?a.convertDataToObject(this.dataset):void 0,binddataset:this.binddataset,datasource:this.datasource,datafield:this.datafield,hasData:this.dataset&&this.dataset.length,query:e,isLocalFilter:!this.searchkey,searchKey:t?this.datafield:this.searchkey,matchMode:t?"startignorecase":this.matchmode,casesensitive:this.casesensitive,isformfield:this.isformfield,orderby:this.orderby,limit:this.limit,pagesize:this.pagesize,page:this.page,onBeforeservicecall:this.invokeOnBeforeServiceCall.bind(this)};return this.dataoptions&&(o.dataoptions=this.dataoptions,o.viewParent=this.viewParent),this._loadingItems=!0,this.dataProvider.filter(o).then((function(e){e=e.data||e,l.isDefined(i.dataset)&&i.dataset.length||!i.dataProvider.updateDataset||(i.dataset=e),i.dataProvider.hasMoreData?i.formattedDataset=i.formattedDataset.concat(e):i.formattedDataset=e,i.formattedDataset.length>20&&!l.isDefined(i.limit)&&(i.typeahead.typeaheadOptionsLimit=i.formattedDataset.length),i._isOpen&&i.isMobileAutoComplete()&&!_.isUndefined(i.dataProvider.isLastPage)&&!i.dataProvider.isLastPage&&i.triggerSearch();var t=i.getTransformedData(i.formattedDataset,n);return i.result=_.map(t,"value"),t}),(function(e){return i._loadingItems=!1,[]})).then((function(t){return i.isScrolled&&(_.debounce((function(){i.setLastActiveMatchAsSelected()}),30)(),i.isScrolled=!1),t.length||(i._modelByValue=void 0,i.queryModel=e),i._unsubscribeDv&&(t=[]),i._loadingItems=!1,i._lastResult=t,t}))},t.prototype.getContext=function(e){return e&&_.get(e,"widget")?this.getContext(e.viewParent):e},t.prototype.getTransformedData=function(e,t,n){l.isDefined(t)&&t++;var i=a.transformFormData(this.getContext(this.viewParent),e,this.datafield,{displayField:this.displaylabel||this.displayfield,displayExpr:n?"":this.displayexpression,bindDisplayExpr:n?"":this.binddisplaylabel,bindDisplayImgSrc:this.binddisplayimagesrc,displayImgSrc:this.displayimagesrc},t,this);return a.getUniqObjsByDataField(i,this.datafield,this.displayfield||this.displaylabel,l.toBoolean(this.allowempty))},t.prototype.onScroll=function(e,t){var n=e.scrollHeight,i=e.clientHeight;!this._loadingItems&&!this.dataProvider.isLastPage&&e.scrollTop+i>=n&&this.loadMoreData(!0)},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),l.isDefined(this.minchars)||("autocomplete"===this.type?this.minchars=0:this.minchars=1),this.listenQuery=this.isUpdateOnKeyPress(),this.showsearchicon=l.isDefined(this.showsearchicon)?this.showsearchicon:"search"===this.type},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),a.styler(this.nativeElement,this),this.containerTarget=a.getContainerTargetClass(this.nativeElement)},t.prototype.eventData=function(e,t){return e&&(e.data={item:t.dataObject,model:t.value,label:t.label,query:this.query}),e},t.prototype.typeaheadOnSelect=function(e,t){var n=e.item;this.queryModel=n,n.selected=!0,this.query=n.label,this.showClosebtn=""!==this.query,t=t||this.$typeaheadEvent,this._modelByKey=n.key,this._modelByValue=n.value,t=this.eventData(t,n),this.invokeOnTouched(),this.invokeOnChange(this.datavalue,t||{}),this.datavalue!==this.prevDatavalue&&this.updateBoundVariable(this.datavalue),this.$element.hasClass("full-screen")&&this.closeSearch(),this.invokeEventCallback("select",{$event:t,selectedValue:this.datavalue}),this.invokeEventCallback("submit",{$event:t}),this.updatePrevDatavalue(this.datavalue)},t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("autocomplete"===this.type&&"displaylabel"===t&&this.displaylabel&&(!this.displayexpression||this.displayexpression&&!this.datasource)&&(this.displayexpression=this.displaylabel,this.displaylabel=void 0),"displaylabel"===t&&this.dataoptions&&null===this.binddisplaylabel&&(this.query=_.get(this._modelByValue,n)||this._modelByValue),"disabled"===t&&(!1===n?this.clearData=!1:(this.clearData=!0,_.get(this.typeahead,"_typeahead.isShown")&&this.typeahead.hide())),e.prototype.onPropertyChange.call(this,t,n,i))},t}(c.DatasetAwareFormComponent);b.initializeProps=m(),b.decorators=[{type:t.Component,args:[{selector:"[wmSearch]",template:'<ng-template #customItemTemplate let-model="item" let-index="index" let-query="query" let-match="match">\n \x3c!-- Default item template --\x3e\n <a *ngIf="!content">\n <img *ngIf="model.imgSrc" [src]="model.imgSrc" alt="Search" [style.width]="imagewidth">\n <span [title]="model.label" [innerHtml]="highlight(match, query) || model.label"></span>\n </a>\n \x3c!-- Custom partial template --\x3e\n <a *ngIf="content" [ngClass]="{customTemplate: content}" partialContainer [wmItemTemplate]="content" [userComponentParams]="match.item">\n <div partial-container-target></div>\n </a>\n</ng-template>\n\n<ng-template #customListTemplate let-matches="matches" let-itemTemplate="itemTemplate" let-query="query">\n <ul #ulElement class="app-search dropdown-menu" scrollable>\n <li #liElements *ngFor="let match of matches" [ngClass]="{active: typeaheadContainer && typeaheadContainer.isActive(match), \'list-group-header\': match && match.isHeader()}"\n (mouseenter)="typeaheadContainer.selectActive(match);"\n (click)="match && !match.isHeader() && typeaheadContainer.selectMatch(match, $event); $typeaheadEvent = $event; notifySubscriber();">\n \x3c!-- itemTemplate comes from the <input> --\x3e\n <h4 *ngIf="match.isHeader()" class="group-title">{{match.value}}</h4>\n <ng-container *ngIf="!match.isHeader()" [ngTemplateOutlet]="itemTemplate"\n [ngTemplateOutletContext]="{item: match.item, index: i, match: match, query: query}">\n </ng-container>\n </li>\n <div class="status" [hidden]="_loadingItems || !(datacompletemsg && dataProvider.isLastPage)">\n <span [textContent]="datacompletemsg"></span>\n </div>\n <div class="status" [hidden]="!_loadingItems">\n <i class="fa fa-circle-o-notch fa-spin"></i>\n <span [textContent]="loadingdatamsg"></span>\n </div>\n </ul>\n</ng-template>\n\n\x3c!--This template is for search inside mobile navbar.--\x3e\n<ng-container *ngIf="navsearchbar; else searchTemplate">\n <input [title]="query || \'\'" type="text" class="app-textbox form-control list-of-objs app-search-input" [placeholder]="placeholder || \'\'"\n focus-target\n container="body"\n [disabled]="disabled"\n autocomplete="off"\n [(ngModel)]="query"\n [readonly]="readonly"\n [disabled]="disabled"\n [typeahead]="typeaheadDataSource"\n [typeaheadWaitMs]="debouncetime"\n [typeaheadItemTemplate]="customItemTemplate"\n [optionsListTemplate]="customListTemplate"\n (input)="onInputChange($event)"\n (keydown)="listenQuery = true"\n (keydown.enter)="$typeaheadEvent = $event;handleEnterEvent($event)"\n (keydown.arrowdown)="selectNext($event)"\n (blur)="invokeOnTouched($event)"\n (click)="handleFocus($event);"\n (focus)="_unsubscribeDv = false; listenQuery = true; handleFocus($event); invokeOnFocus($event);"\n (focusout)="onFocusOut()"\n [typeaheadMinLength]="minchars"\n [typeaheadOptionsLimit]="limit"\n (typeaheadLoading)="_loadingItems"\n (typeaheadOnSelect)="typeaheadOnSelect($event)"\n typeaheadOptionField="label"\n [typeaheadGroupField]="groupby ? \'groupby\' : null"\n [typeaheadAsync]="true"\n [typeaheadScrollable]="true"\n [adaptivePosition]="true"\n [typeaheadOptionsInScrollableView]="optionslimitinscrollableview"\n [dropup]="dropup"\n [tabindex]="tabindex"\n [attr.name]="name"\n [attr.aria-label]="hint || \'Search field\'"/>\n <i class="btn-close wi wi-cancel" [hidden]="!showClosebtn" (click)="clearSearch($event);"></i>\n</ng-container>\n\x3c!--This template is for both web and fullscreen mode in mobile.--\x3e\n<ng-template #searchTemplate>\n <span class="wi wi-arrow-left form-control-feedback back-btn" aria-hidden="true" (click)="closeSearch()"></span>\n <span class="sr-only">Back button</span>\n <input [title]="query || \'\'" type="text" class="app-textbox form-control list-of-objs app-search-input" [placeholder]="placeholder || \'\'"\n focus-target\n [container]="containerTarget || \'body\'"\n [disabled]="disabled"\n autocomplete="off"\n [(ngModel)]="query"\n [readonly]="readonly"\n [typeahead]="typeaheadDataSource"\n [typeaheadWaitMs]="debouncetime"\n [typeaheadItemTemplate]="customItemTemplate"\n [optionsListTemplate]="customListTemplate"\n (input)="onInputChange($event)"\n (keydown)="listenQuery = true"\n (keydown.enter)="$typeaheadEvent = $event;handleEnterEvent($event)"\n (keydown.arrowdown)="selectNext($event)"\n (blur)="invokeOnTouched($event); onFocusOut()"\n (click)="handleFocus($event);"\n (focus)="_unsubscribeDv = false; listenQuery = true; handleFocus($event); invokeOnFocus($event)"\n [typeaheadMinLength]="minchars"\n [typeaheadOptionsLimit]="limit"\n (typeaheadLoading)="_loadingItems"\n (typeaheadOnSelect)="typeaheadOnSelect($event)"\n typeaheadOptionField="label"\n [typeaheadGroupField]="groupby ? \'groupby\' : null"\n [typeaheadAsync]="true"\n [typeaheadScrollable]="true"\n [adaptivePosition]="true"\n [typeaheadOptionsInScrollableView]="optionslimitinscrollableview"\n [tabindex]="tabindex"\n [dropup]="dropup"\n [attr.name]="name"\n [attr.aria-label]="hint || \'Search field\'">\n <input class="model-holder" ng-model="proxyModel" ng-required="required" tabindex="-1" aria-hidden="true">\n <span *ngIf="_loadingItems" aria-hidden="true" class="fa fa-circle-o-notch fa-spin form-control-feedback"></span>\n <span class="wi wi-close form-control-feedback clear-btn" [ngClass]="{\'show-btn\': isQueryEntered()}" (click)="clearSearch($event, true)"></span>\n <span class="sr-only">Clear button</span>\n <span *ngIf="showsearchicon" class="input-group-addon" aria-label="search icon" [ngClass]="{\'disabled\': disabled}">\n <form>\n <button title="Search" [disabled]="disabled" class="app-search-button wm-sl-l sl-search" type="submit"\n (click)="onSearchSelect($event)"></button>\n </form>\n </span>\n</ng-template>\n',providers:[a.provideAs(b,i.NG_VALUE_ACCESSOR,!0),a.provideAs(b,i.NG_VALIDATORS,!0),a.provideAsWidgetRef(b)]}]}],b.ctorParameters=function(){return[{type:t.Injector},{type:l.App},{type:void 0,decorators:[{type:t.Attribute,args:["datavalue.bind"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["dataset.bind"]}]}]},b.propDecorators={typeahead:[{type:t.ViewChild,args:[o.TypeaheadDirective]}],ulElement:[{type:t.ViewChild,args:["ulElement"]}],liElements:[{type:t.ViewChildren,args:["liElements"]}]};var w=function(){function e(e,n){this.searchRef=n,this.elementRef=e.get(t.ElementRef)}return e.prototype.ngAfterContentInit=function(){this.elementRef.nativeElement.addEventListener("scroll",this.notifyParent.bind(this)),this.searchRef.dropdownEl=$(this.elementRef.nativeElement),this.searchRef.onDropdownOpen()},e.prototype.ngAfterViewInit=function(){if(!this.searchRef.isMobileAutoComplete()){var e=this.searchRef.$element.find("input").first();this.searchRef.dropdownEl.width(e.outerWidth())}},e.prototype.notifyParent=function(e){this.searchRef.onScroll(this.elementRef.nativeElement,e)},e}();w.decorators=[{type:t.Directive,args:[{selector:"[scrollable]"}]}],w.ctorParameters=function(){return[{type:t.Injector},{type:b}]};var P=[b,w],O=function(){};O.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule,o.TypeaheadModule,a.WmComponentsModule],declarations:u([],d(P)),exports:u([],d(P)),entryComponents:[]}]}],e.ScrollableDirective=w,e.SearchComponent=b,e.SearchModule=O,e["\u0275a"]=m,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@wm/components/base"),require("@wm/core")):"function"==typeof define&&define.amd?define("@wm/components/basic/tree",["exports","@angular/core","@angular/common","@wm/components/base","@wm/core"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.basic=e.wm.components.basic||{},e.wm.components.basic.tree={}),e.ng.core,e.ng.common,e.wm.components.base,e.wm.core)}(this,(function(e,t,n,i,o){"use strict";
|
|
113
|
+
***************************************************************************** */var p=function(e,t){return(p=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 d(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,a=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return r}function u(e,t,n){if(n||2===arguments.length)for(var i,o=0,a=t.length;o<a;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var h=new Map([["casesensitive",Object.assign({value:!1},a.PROP_BOOLEAN)],["class",a.PROP_STRING],["datacompletemsg",Object.assign({value:"No more data to load"},a.PROP_STRING)],["datafield",Object.assign({value:"All Fields"},a.PROP_STRING)],["dataoptions",a.PROP_ANY],["dataset",a.PROP_ANY],["datasource",a.PROP_ANY],["datavalue",a.PROP_STRING],["datavaluesource",a.PROP_ANY],["dateformat",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["displayimagesrc",a.PROP_STRING],["displaylabel",a.PROP_STRING],["displayexpression",a.PROP_STRING],["dropup",a.PROP_BOOLEAN],["groupby",a.PROP_STRING],["hint",a.PROP_STRING],["imagewidth",Object.assign({value:"16px"},a.PROP_STRING)],["limit",a.PROP_NUMBER],["loadingdatamsg",Object.assign({value:"Loading items..."},a.PROP_STRING)],["match",a.PROP_STRING],["matchmode",a.PROP_STRING],["minchars",a.PROP_NUMBER],["name",a.PROP_STRING],["navsearchbar",Object.assign({value:!1},a.PROP_BOOLEAN)],["orderby",a.PROP_STRING],["placeholder",Object.assign({value:"Search"},a.PROP_STRING)],["position",a.PROP_STRING],["query",a.PROP_STRING],["readonly",a.PROP_BOOLEAN],["required",a.PROP_BOOLEAN],["searchkey",a.PROP_STRING],["searchon",Object.assign({value:"typing"},a.PROP_STRING)],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["showclear",Object.assign({value:!1},a.PROP_BOOLEAN)],["showsearchicon",a.PROP_BOOLEAN],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["type",Object.assign({value:"search"},a.PROP_STRING)],["debouncetime",Object.assign({value:250},a.PROP_NUMBER)],["width",a.PROP_STRING]]),m=function(){a.register("wm-search",h),a.registerFormWidget(l.FormWidgetType.AUTOCOMPLETE,new Map(h)),a.registerFormWidget(l.FormWidgetType.TYPEAHEAD,new Map(h))},f=function(){function e(){}return e.prototype.applyFilter=function(e,t,n){return e=_.isNumber(e)?e.toString():e,_.includes(n,"start")?_.startsWith(e,t):_.includes(n,"end")?_.endsWith(e,t):_.includes(n,"exact")?_.isEqual(e,t):_.includes(e,t)},e.prototype.filter=function(e){var t=this,n=e.dataset,i=e.casesensitive,o=e.matchMode;o&&!_.includes(o,"ignorecase")&&(i=!0);var a,r=e.query;return new Promise((function(s,l){if(e.searchKey){var c=_.split(e.searchKey,",");a=_.filter(e.dataset,(function(e){return c.some((function(n){var a=_.get(e,n),s=r;return i||(a=_.toLower(_.toString(a)),s=_.toLower(_.toString(s))),t.applyFilter(a,s,o)}))}))}else a=_.isArray(n)&&_.isObject(n[0])?_.filter(n,(function(e){var n=_.values(e).join(" ");return i||(n=_.toLower(n),r=_.toLower(r)),t.applyFilter(n,r)})):_.filter(n,(function(e){return i||(e=_.toLower(e),r=_.toLower(r)),t.applyFilter(e,r,o)}));s({data:a,hasMoreData:!1,isLastPage:!0})}))},e}(),g=function(){function e(){}return e.prototype.filter=function(e){var t=this;return this.filterData(e).then((function(n){return t.onFilterSuccess(e,n)}),(function(){return t.onFilterFailure()}))},e.prototype.filterData=function(e){if(e.dataoptions){var t=e.dataoptions,n=e.datasource.execute(l.DataSource.Operation.GET_REQUEST_PARAMS,e);if(t.relatedField)return new Promise((function(i,o){a.interpolateBindExpressions(e.viewParent,t.filterExpr,(function(a){n.filterExpr=t.filterExpr=a,t.filterExpr=a,e.datasource.execute(l.DataSource.Operation.GET_RELATED_TABLE_DATA,_.assign({relatedField:t.relatedField},n)).then(i,o)}))}));if(t.distinctField)return e.datasource.execute(l.DataSource.Operation.GET_DISTINCT_DATA_BY_FIELDS,{pagesize:e.limit||e.pagesize,page:e.page,fields:t.distinctField,entityName:t.tableName,filterFields:_.assign(t.filterFields,n.filterFields),filterExpr:l.getClonedObject(t.filterExpr||{})})}return e.datasource.execute(l.DataSource.Operation.SEARCH_RECORDS,e)},e.prototype.isLast=function(e,t,n,i){return t===l.AppConstants.INT_MAX_VALUE?0!==i&&i<n:e===(t>n?Math.ceil(t/n):t<0?0:1)},e.prototype.getTransformedData=function(e,t){var n=e.operation+"Result",i=t[n];if(i){var o={};_.set(o,n,i),t=[o]}else t=[t];return t},e.prototype.onFilterFailure=function(){return[]},e.prototype.isLastPageForDistinctApi=function(e,t,n,i){return t>1&&!i&&_.isEmpty(e)&&n===l.AppConstants.INT_MAX_VALUE},e.prototype.onFilterSuccess=function(e,t){var n,i,o,a,r=this,s=t.data,c=_.split(e.binddataset,"."),p=_.slice(c,_.indexOf(c,"dataSet")+1).join(".");return new Promise((function(c,d){var u=t.pagination;if(e.datasource.execute(l.DataSource.Operation.IS_PAGEABLE)&&(o=u.number+1,i=r.isLast(o,e.limit>0&&e.limit||u.totalElements,u.size,u.numberOfElements),a=!0,r.isLastPageForDistinctApi(s,o,u.totalElements,i)))c({data:[],isLastPage:i=!0,hasMoreData:o>1,isPaginatedData:a,page:o});else{if(p){if(_.isArray(s)){var h=p.lastIndexOf("[$i]");if(h>-1){var m=p.substr(h+5);n=s.map((function(e){return l.findValueOf(e,m)}))}}else _.isObject(s)&&(n=_.get(s,p));s=n||s}_.isArray(s)||(s=r.getTransformedData(e.datasource,s)),s.length?c({data:s,isLastPage:i,hasMoreData:o>1,isPaginatedData:a,page:o}):c({data:[],isLastPage:i,hasMoreData:o>1,isPaginatedData:a,page:o})}}))},e}(),v=function(){function e(){}return e.prototype.filter=function(t){var n=this,i=t.datasource&&t.datasource.execute(l.DataSource.Operation.IS_UPDATE_REQUIRED,t.hasData);return(!t.isLocalFilter&&(t.dataoptions||t.datasource&&t.datasource.execute(l.DataSource.Operation.IS_API_AWARE)&&t.searchKey&&i)?e.remoteDataProvider.filter(t):e.localDataProvider.filter(t)).then((function(e){return n.updateDataset=t.datasource&&!t.datasource.execute(l.DataSource.Operation.SUPPORTS_CRUD)&&i,n.hasMoreData=e.hasMoreData,n.isLastPage=e.isLastPage,n.page=e.page,n.isPaginatedData=e.isPaginatedData,e}))},e}();v.remoteDataProvider=new g,v.localDataProvider=new f;var y={widgetType:"wm-search",hostClass:"input-group"},b=function(e){function t(t,n,i,o){var a=e.call(this,t,y)||this;a.binddatavalue=i,a.binddataset=o,a.query="",a.page=1,a.allowempty=!1,a.app=n,l.addClass(a.nativeElement,"app-search",!0),a.typeaheadDataSource=r.Observable.create((function(e){a.listenQuery&&(a._defaultQueryInvoked=!1,a._loadingItems=!0,e.next(a.query)),a.lastSelectedIndex&&(a.typeahead._container=void 0)})).pipe(s.filter((function(){return a._loadingItems=!1,0===a.minchars||a.query&&a.query.length>=a.minchars})),s.mergeMap((function(e){return a.getDataSourceAsObservable(e)}))),a.dataProvider=new v;var c=a.datavalue$.subscribe((function(e){var t=_.isArray(e)?e[0]:e;if(null===t||""===t)return a._modelByValue="",a.query=a.queryModel="",void(a._lastResult=void 0);a._unsubscribeDv||(a._defaultQueryInvoked=!1,_.isObject(e)||a.prevDatavalue===e||(a._modelByKey=void 0,a.query=a.queryModel=""),a.updateByDatavalue(e)),a.showClosebtn=""!==a.query}));a.registerDestroyListener((function(){return c.unsubscribe()}));var p=a.dataset$.subscribe((function(){a.startIndex=a.datasetItems.length,a._lastResult=void 0;var e=a.datavalue||a.toBeProcessedDatavalue;l.isDefined(e)&&a.updateByDataset(e)}));return a.registerDestroyListener((function(){return p.unsubscribe()})),a}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}p(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),Object.defineProperty(t.prototype,"datasource",{get:function(){return this._datasource},set:function(e){this._datasource=e;var t=this.datavalue||this.toBeProcessedDatavalue;this.updateByDatavalue(t)},enumerable:!1,configurable:!0}),t.prototype.clearSearch=function(e,t){this.query="",this.onInputChange(e),this.dataProvider.isLastPage=!1,this.listenQuery=!1,t&&(this.listenQuery=!0,this._unsubscribeDv=!1,this.loadMoreData()),this.invokeEventCallback("clearsearch"),this._loadingItems=!1,e&&this.$element.find(".app-search-input").focus()},t.prototype.clearText=function(){this.query="",this.showClosebtn=!1},t.prototype.closeSearch=function(){this._loadingItems=!1,this.page=1,this.insertAtIndex(this.elIndex),this.elIndex=void 0,this.parentEl=void 0,this.$element.removeClass("full-screen"),this._domUpdated&&(this._domUpdated=!1),this.listenQuery=!1,this._unsubscribeDv=!0,this.typeahead.hide()},t.prototype.renderMobileAutoComplete=function(){l.isDefined(this.elIndex)||(this.parentEl=this.$element.parent(),this.elIndex=this.parentEl.children().index(this.$element)),this.$element.hasClass("full-screen")||(this._domUpdated=!0,this.$element.addClass("full-screen"),"inline"===this.position&&this.$element.addClass(this.position)),this.$element.hasClass("full-screen")&&this.$element.find(".app-search-input").focus()},t.prototype.getDataSourceAsObservable=function(e){if(this._lastQuery===e&&!_.get(this.dataoptions,"filterFields")&&l.isDefined(this._lastResult))return this._loadingItems=!1,r.of(this._lastResult);if("autocomplete"===this.type&&this.searchkey&&this.query&&this.datavalue){var t=[],n=_.split(this.searchkey,","),i=void 0;if(this.binddisplaylabel&&1===(t=_.split(this.binddisplaylabel,"+")).length)if(_.includes(t[0],"|"))i=!0;else{i=/\[(.*?)\]/.exec(t[0])[1]}if(t.length>1||i&&!_.includes(n,i)||this.displayexpression&&!_.includes(n,this.displayexpression))return this._loadingItems=!1,r.of([])}return this._lastQuery=this.query,r.from(this.getDataSource(e))},t.prototype.handleEvent=function(t,n,i,o){_.includes(["blur","focus","select","submit","change"],n)||e.prototype.handleEvent.call(this,t,n,i,o)},t.prototype.highlight=function(e,t){if(this.typeaheadContainer)return e.value=e.item.label.toString(),this.typeaheadContainer.highlight(e,t)},t.prototype.insertAtIndex=function(e){0===e?this.parentEl.prepend(this.$element):this.parentEl.children().eq(e).length?this.$element.insertBefore(this.parentEl.children().eq(e)):this.$element.insertAfter(this.parentEl.children().eq(e-1))},t.prototype.isMobileAutoComplete=function(){return"autocomplete"===this.type&&l.isMobile()},t.prototype.isQueryEntered=function(){return this.showclear&&this.showClosebtn},t.prototype.loadMoreData=function(e){this.dataProvider.isLastPage||(this.page=e?this.page+1:this.page,this.isScrolled=!0,this._loadingItems=!0,e&&(this._lastQuery=void 0),this.typeahead.onInput({target:{value:_.trim(this.query)||"0"}}))},t.prototype.onFocusOut=function(){this._unsubscribeDv=!1,this._loadingItems=!1,this.page=1,!this._domUpdated&&this._isOpen&&(this.listenQuery=!1),this._isOpen=!1,this._domUpdated&&this.typeahead&&this.typeahead._container&&(this.typeahead._container.isFocused=!0)},t.prototype.onInputChange=function(e){this.result=[],this.page=1,this.listenQuery=this.isUpdateOnKeyPress(),this._modelByValue=void 0,""===this.query?(this.queryModel="",this._modelByValue="",this.updatePrevDatavalue(this._lastQuery),this.invokeOnChange(this._modelByValue,{},!0),this.invokeEventCallback("clear",{$event:e}),e&&9!==e.which&&this.invokeEventCallback("submit",{$event:e})):this.invokeEventCallback("change",{$event:e,newVal:this._modelByValue||this.query,oldVal:this.prevDatavalue}),this.showClosebtn=""!==this.query},t.prototype.handleEnterEvent=function(e){_.get(this.typeahead,"matches.length")||this.onSearchSelect(e)},t.prototype.onSearchSelect=function(e){var t,n,i,o=(null===(n=null===(t=this.typeaheadContainer)||void 0===t?void 0:t.active)||void 0===n?void 0:n.value)===this.query;if(this.typeaheadContainer&&this.typeaheadContainer.active&&o&&(i=this.typeaheadContainer.active.item),e=this.eventData(e,i||{}),!this.isUpdateOnKeyPress())return this.listenQuery=!0,void this.typeahead.onInput({target:{value:this.query}});this.typeaheadContainer&&this.liElements.length&&o?this.typeaheadContainer.selectActiveMatch():(this.queryModel=this.query,this.invokeEventCallback("submit",{$event:e}))},t.prototype.invokeOnBeforeServiceCall=function(e){this.invokeEventCallback("beforeservicecall",{inputData:e})},t.prototype.onDropdownOpen=function(){var e=this;if(this.clearData&&this.typeahead.hide(),_.debounce((function(){e._isOpen=!0,e.typeaheadContainer=e.typeahead._container||e.typeahead._typeahead.instance,e.typeaheadContainer.liElements=e.liElements,e.typeaheadContainer.ulElement=e.ulElement,l.adjustContainerPosition($("typeahead-container"),e.nativeElement,e.typeahead._typeahead,$("typeahead-container .dropdown-menu"))}))(),this.isMobileAutoComplete()){this.$element.hasClass("full-screen")||this.renderMobileAutoComplete();var t=this.dropdownEl.closest("typeahead-container");t.insertAfter(this.$element.find("input").first());var n=this.$element.closest(".app-content").height();t.css({position:"relative",top:0,height:n+"px"}),this.showClosebtn=this.query&&""!==this.query,_.isUndefined(this.dataProvider.isLastPage)||this.dataProvider.isLastPage||this.triggerSearch()}},t.prototype.selectNext=function(){var e=this.typeaheadContainer.matches;if(e){var t=e.indexOf(this.typeaheadContainer.active);!this._loadingItems&&!this.dataProvider.isLastPage&&t+1>e.length-1&&(this.lastSelectedIndex=t,this.loadMoreData(!0))}},t.prototype.setLastActiveMatchAsSelected=function(){this.lastSelectedIndex&&(this.typeaheadContainer._active=this.typeaheadContainer.matches[this.lastSelectedIndex],this.typeaheadContainer.nextActiveMatch(),this.lastSelectedIndex=void 0)},t.prototype.triggerSearch=function(){if(!this.dataProvider.isLastPage&&this.$element.hasClass("full-screen")){var e=this.dropdownEl,t=e.find("li").last();t.length&&e.length&&e.height()+e.position().top>t.height()+t.position().top&&this.loadMoreData(!0)}},t.prototype.isUpdateOnKeyPress=function(){return"typing"===this.searchon},t.prototype.debounceDefaultQuery=function(e){var t=this;this._defaultQueryInvoked=!0,this.getDataSource(e,!0).then((function(e){e.length?(t.queryModel=e,t._lastQuery=t.query=t.queryModel[0].label||"",t._modelByValue=t.queryModel[0].value,t._modelByKey=t.queryModel[0].key,t.showClosebtn=""!==t.query):(t._modelByValue=void 0,t.queryModel=void 0,t.query=""),t.clearData&&_.get(t.typeahead,"_typeahead.isShown")&&t.typeahead.hide()}))},t.prototype.updateByDatavalue=function(e){this.updateByDataset(e),this.updateByDataSource(e)},t.prototype.updateByDataSource=function(e){if(l.isDefined(e)&&!_.isObject(e)&&this.datasource&&!l.isDefined(this._modelByKey)&&this.datafield!==a.ALLFIELDS){if(l.isDefined(this.queryModel)&&!_.isEmpty(this.queryModel))return void this.updateDatavalueFromQueryModel();!this._defaultQueryInvoked&&this.datasource.execute(l.DataSource.Operation.SUPPORTS_CRUD)&&this.debounceDefaultQuery(e)}},t.prototype.updateDatavalueFromQueryModel=function(){l.isDefined(this.queryModel)&&(this._modelByValue=_.isArray(this.queryModel)?this.queryModel[0].value:this.queryModel,this._modelByKey=_.isArray(this.queryModel)?this.queryModel[0].key:this.queryModel,this.toBeProcessedDatavalue=void 0)},t.prototype.updateByDataset=function(e){if(!this._defaultQueryInvoked||!this.searchkey){var t=_.find(this.datasetItems,(function(t){return _.isObject(t.value)?_.isEqual(t.value,e):_.toString(t.value).toLowerCase()===_.toString(e).toLowerCase()}));if(t)this.queryModel=[t];else if(this.datafield===a.ALLFIELDS&&_.isObject(e))this.queryModel=this.getTransformedData(a.extractDataAsArray(e));else if(this.prevDatavalue!==e)return this.queryModel=void 0,void(this.query="");this.updateDatavalueFromQueryModel(),this._lastQuery=this.query=l.isDefined(this.queryModel)&&this.queryModel.length?_.get(this.queryModel[0],"label"):"",this.showClosebtn=""!==this.query}},t.prototype.handleFocus=function(e){"search"===this.type&&this.query===this._lastQuery&&this._lastResult&&this.typeahead.keyUpEventEmitter.emit(this.query)},t.prototype.notifySubscriber=function(){var e=$(this.nativeElement).closest(".app-composite-widget.caption-floating");e.length>0&&this.app.notify("captionPositionAnimate",{displayVal:!0,nativeEl:e})},t.prototype.getDataSource=function(e,t,n){var i=this;if(t&&this.datafield===a.ALLFIELDS)return this._loadingItems=!1,Promise.resolve([]);var o={dataset:this.dataset?a.convertDataToObject(this.dataset):void 0,binddataset:this.binddataset,datasource:this.datasource,datafield:this.datafield,hasData:this.dataset&&this.dataset.length,query:e,isLocalFilter:!this.searchkey,searchKey:t?this.datafield:this.searchkey,matchMode:t?"startignorecase":this.matchmode,casesensitive:this.casesensitive,isformfield:this.isformfield,orderby:this.orderby,limit:this.limit,pagesize:this.pagesize,page:this.page,onBeforeservicecall:this.invokeOnBeforeServiceCall.bind(this)};return this.dataoptions&&(o.dataoptions=this.dataoptions,o.viewParent=this.viewParent),this._loadingItems=!0,this.dataProvider.filter(o).then((function(e){e=e.data||e,l.isDefined(i.dataset)&&i.dataset.length||!i.dataProvider.updateDataset||(i.dataset=e),i.dataProvider.hasMoreData?i.formattedDataset=i.formattedDataset.concat(e):i.formattedDataset=e,i.formattedDataset.length>20&&!l.isDefined(i.limit)&&(i.typeahead.typeaheadOptionsLimit=i.formattedDataset.length),i._isOpen&&i.isMobileAutoComplete()&&!_.isUndefined(i.dataProvider.isLastPage)&&!i.dataProvider.isLastPage&&i.triggerSearch();var t=i.getTransformedData(i.formattedDataset,n);return i.result=_.map(t,"value"),t}),(function(e){return i._loadingItems=!1,[]})).then((function(t){return i.isScrolled&&(_.debounce((function(){i.setLastActiveMatchAsSelected()}),30)(),i.isScrolled=!1),t.length||(i._modelByValue=void 0,i.queryModel=e),i._unsubscribeDv&&(t=[]),i._loadingItems=!1,i._lastResult=t,t}))},t.prototype.getContext=function(e){return e&&_.get(e,"widget")?this.getContext(e.viewParent):e},t.prototype.getTransformedData=function(e,t,n){l.isDefined(t)&&t++;var i=a.transformFormData(this.getContext(this.viewParent),e,this.datafield,{displayField:this.displaylabel||this.displayfield,displayExpr:n?"":this.displayexpression,bindDisplayExpr:n?"":this.binddisplaylabel,bindDisplayImgSrc:this.binddisplayimagesrc,displayImgSrc:this.displayimagesrc},t,this);return a.getUniqObjsByDataField(i,this.datafield,this.displayfield||this.displaylabel,l.toBoolean(this.allowempty))},t.prototype.onScroll=function(e,t){var n=e.scrollHeight,i=e.clientHeight;!this._loadingItems&&!this.dataProvider.isLastPage&&e.scrollTop+i>=n&&this.loadMoreData(!0)},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),l.isDefined(this.minchars)||("autocomplete"===this.type?this.minchars=0:this.minchars=1),this.listenQuery=this.isUpdateOnKeyPress(),this.showsearchicon=l.isDefined(this.showsearchicon)?this.showsearchicon:"search"===this.type},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),a.styler(this.nativeElement,this),this.containerTarget=a.getContainerTargetClass(this.nativeElement)},t.prototype.eventData=function(e,t){return e&&(e.data={item:t.dataObject,model:t.value,label:t.label,query:this.query}),e},t.prototype.typeaheadOnSelect=function(e,t){var n=e.item;this.queryModel=n,n.selected=!0,this.query=n.label,this.showClosebtn=""!==this.query,t=t||this.$typeaheadEvent,this._modelByKey=n.key,this._modelByValue=n.value,t=this.eventData(t,n),this.invokeOnTouched(),this.invokeOnChange(this.datavalue,t||{}),this.datavalue!==this.prevDatavalue&&this.updateBoundVariable(this.datavalue),this.$element.hasClass("full-screen")&&this.closeSearch(),this.invokeEventCallback("select",{$event:t,selectedValue:this.datavalue}),this.invokeEventCallback("submit",{$event:t}),this.updatePrevDatavalue(this.datavalue)},t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("autocomplete"===this.type&&"displaylabel"===t&&this.displaylabel&&(!this.displayexpression||this.displayexpression&&!this.datasource)&&(this.displayexpression=this.displaylabel,this.displaylabel=void 0),"displaylabel"===t&&this.dataoptions&&null===this.binddisplaylabel&&(this.query=_.get(this._modelByValue,n)||this._modelByValue),"disabled"===t&&(!1===n?this.clearData=!1:(this.clearData=!0,_.get(this.typeahead,"_typeahead.isShown")&&this.typeahead.hide())),e.prototype.onPropertyChange.call(this,t,n,i))},t}(c.DatasetAwareFormComponent);b.initializeProps=m(),b.decorators=[{type:t.Component,args:[{selector:"[wmSearch]",template:'<ng-template #customItemTemplate let-model="item" let-index="index" let-query="query" let-match="match">\n \x3c!-- Default item template --\x3e\n <a *ngIf="!content">\n <img *ngIf="model.imgSrc" [src]="model.imgSrc" alt="Search" [style.width]="imagewidth">\n <span [title]="model.label" [innerHtml]="highlight(match, query) || model.label"></span>\n </a>\n \x3c!-- Custom partial template --\x3e\n <a *ngIf="content" [ngClass]="{customTemplate: content}" partialContainer [wmItemTemplate]="content" [userComponentParams]="match.item">\n <div partial-container-target></div>\n </a>\n</ng-template>\n\n<ng-template #customListTemplate let-matches="matches" let-itemTemplate="itemTemplate" let-query="query">\n <ul #ulElement class="app-search dropdown-menu" scrollable>\n <li #liElements *ngFor="let match of matches" [ngClass]="{active: typeaheadContainer && typeaheadContainer.isActive(match), \'list-group-header\': match && match.isHeader()}"\n (mouseenter)="typeaheadContainer.selectActive(match);"\n (click)="match && !match.isHeader() && typeaheadContainer.selectMatch(match, $event); $typeaheadEvent = $event; notifySubscriber();">\n \x3c!-- itemTemplate comes from the <input> --\x3e\n <h4 *ngIf="match.isHeader()" class="group-title">{{match.value}}</h4>\n <ng-container *ngIf="!match.isHeader()" [ngTemplateOutlet]="itemTemplate"\n [ngTemplateOutletContext]="{item: match.item, index: i, match: match, query: query}">\n </ng-container>\n </li>\n <div class="status" [hidden]="_loadingItems || !(datacompletemsg && dataProvider.isLastPage)">\n <span [textContent]="datacompletemsg"></span>\n </div>\n <div class="status" [hidden]="!_loadingItems">\n <i class="fa fa-circle-o-notch fa-spin"></i>\n <span [textContent]="loadingdatamsg"></span>\n </div>\n </ul>\n</ng-template>\n\n\x3c!--This template is for search inside mobile navbar.--\x3e\n<ng-container *ngIf="navsearchbar; else searchTemplate">\n <input [title]="query || \'\'" type="text" class="app-textbox form-control list-of-objs app-search-input" [placeholder]="placeholder || \'\'"\n focus-target\n container="body"\n [disabled]="disabled"\n autocomplete="off"\n [(ngModel)]="query"\n [readonly]="readonly"\n [disabled]="disabled"\n [typeahead]="typeaheadDataSource"\n [typeaheadWaitMs]="debouncetime"\n [typeaheadItemTemplate]="customItemTemplate"\n [optionsListTemplate]="customListTemplate"\n (input)="onInputChange($event)"\n (keydown)="listenQuery = true"\n (keydown.enter)="$typeaheadEvent = $event;handleEnterEvent($event)"\n (keydown.arrowdown)="selectNext($event)"\n (blur)="invokeOnTouched($event)"\n (click)="handleFocus($event);"\n (focus)="_unsubscribeDv = false; listenQuery = true; handleFocus($event); invokeOnFocus($event);"\n (focusout)="onFocusOut()"\n [typeaheadMinLength]="minchars"\n [typeaheadOptionsLimit]="limit"\n (typeaheadLoading)="_loadingItems"\n (typeaheadOnSelect)="typeaheadOnSelect($event)"\n typeaheadOptionField="label"\n [typeaheadGroupField]="groupby ? \'groupby\' : null"\n [typeaheadAsync]="true"\n [typeaheadScrollable]="true"\n [typeaheadOptionsInScrollableView]="optionslimitinscrollableview"\n [dropup]="dropup"\n [tabindex]="tabindex"\n [attr.name]="name"\n [attr.aria-label]="hint || \'Search field\'"/>\n <i class="btn-close wi wi-cancel" [hidden]="!showClosebtn" (click)="clearSearch($event);"></i>\n</ng-container>\n\x3c!--This template is for both web and fullscreen mode in mobile.--\x3e\n<ng-template #searchTemplate>\n <span class="wi wi-arrow-left form-control-feedback back-btn" aria-hidden="true" (click)="closeSearch()"></span>\n <span class="sr-only">Back button</span>\n <input [title]="query || \'\'" type="text" class="app-textbox form-control list-of-objs app-search-input" [placeholder]="placeholder || \'\'"\n focus-target\n [container]="containerTarget || \'body\'"\n [disabled]="disabled"\n autocomplete="off"\n [(ngModel)]="query"\n [readonly]="readonly"\n [typeahead]="typeaheadDataSource"\n [typeaheadWaitMs]="debouncetime"\n [typeaheadItemTemplate]="customItemTemplate"\n [optionsListTemplate]="customListTemplate"\n (input)="onInputChange($event)"\n (keydown)="listenQuery = true"\n (keydown.enter)="$typeaheadEvent = $event;handleEnterEvent($event)"\n (keydown.arrowdown)="selectNext($event)"\n (blur)="invokeOnTouched($event); onFocusOut()"\n (click)="handleFocus($event);"\n (focus)="_unsubscribeDv = false; listenQuery = true; handleFocus($event); invokeOnFocus($event)"\n [typeaheadMinLength]="minchars"\n [typeaheadOptionsLimit]="limit"\n (typeaheadLoading)="_loadingItems"\n (typeaheadOnSelect)="typeaheadOnSelect($event)"\n typeaheadOptionField="label"\n [typeaheadGroupField]="groupby ? \'groupby\' : null"\n [typeaheadAsync]="true"\n [typeaheadScrollable]="true"\n [typeaheadOptionsInScrollableView]="optionslimitinscrollableview"\n [tabindex]="tabindex"\n [dropup]="dropup"\n [attr.name]="name"\n [attr.aria-label]="hint || \'Search field\'">\n <input class="model-holder" ng-model="proxyModel" ng-required="required" tabindex="-1" aria-hidden="true">\n <span *ngIf="_loadingItems" aria-hidden="true" class="fa fa-circle-o-notch fa-spin form-control-feedback"></span>\n <span class="wi wi-close form-control-feedback clear-btn" [ngClass]="{\'show-btn\': isQueryEntered()}" (click)="clearSearch($event, true)"></span>\n <span class="sr-only">Clear button</span>\n <span *ngIf="showsearchicon" class="input-group-addon" aria-label="search icon" [ngClass]="{\'disabled\': disabled}">\n <form>\n <button title="Search" [disabled]="disabled" class="app-search-button wm-sl-l sl-search" type="submit"\n (click)="onSearchSelect($event)"></button>\n </form>\n </span>\n</ng-template>\n',providers:[a.provideAs(b,i.NG_VALUE_ACCESSOR,!0),a.provideAs(b,i.NG_VALIDATORS,!0),a.provideAsWidgetRef(b)]}]}],b.ctorParameters=function(){return[{type:t.Injector},{type:l.App},{type:void 0,decorators:[{type:t.Attribute,args:["datavalue.bind"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["dataset.bind"]}]}]},b.propDecorators={typeahead:[{type:t.ViewChild,args:[o.TypeaheadDirective]}],ulElement:[{type:t.ViewChild,args:["ulElement"]}],liElements:[{type:t.ViewChildren,args:["liElements"]}]};var w=function(){function e(e,n){this.searchRef=n,this.elementRef=e.get(t.ElementRef)}return e.prototype.ngAfterContentInit=function(){this.elementRef.nativeElement.addEventListener("scroll",this.notifyParent.bind(this)),this.searchRef.dropdownEl=$(this.elementRef.nativeElement),this.searchRef.onDropdownOpen()},e.prototype.ngAfterViewInit=function(){if(!this.searchRef.isMobileAutoComplete()){var e=this.searchRef.$element.find("input").first();this.searchRef.dropdownEl.width(e.outerWidth())}},e.prototype.notifyParent=function(e){this.searchRef.onScroll(this.elementRef.nativeElement,e)},e}();w.decorators=[{type:t.Directive,args:[{selector:"[scrollable]"}]}],w.ctorParameters=function(){return[{type:t.Injector},{type:b}]};var P=[b,w],O=function(){};O.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule,o.TypeaheadModule,a.WmComponentsModule],declarations:u([],d(P)),exports:u([],d(P)),entryComponents:[]}]}],e.ScrollableDirective=w,e.SearchComponent=b,e.SearchModule=O,e["\u0275a"]=m,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@wm/components/base"),require("@wm/core")):"function"==typeof define&&define.amd?define("@wm/components/basic/tree",["exports","@angular/core","@angular/common","@wm/components/base","@wm/core"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.basic=e.wm.components.basic||{},e.wm.components.basic.tree={}),e.ng.core,e.ng.common,e.wm.components.base,e.wm.core)}(this,(function(e,t,n,i,o){"use strict";
|
|
114
114
|
/*! *****************************************************************************
|
|
115
115
|
Copyright (c) Microsoft Corporation.
|
|
116
116
|
|
|
@@ -194,7 +194,7 @@
|
|
|
194
194
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
195
195
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
196
196
|
PERFORMANCE OF THIS SOFTWARE.
|
|
197
|
-
***************************************************************************** */var u=function(e,t){return(u=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 h(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}u(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}Object.create;function m(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 f(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 g=function(){function e(e,n){this.inj=e,this.bsModalService=n,this.isDateOpen=!0,this.isTimeOpen=!1,this.mode="DATE_TIME",this.placement="MODAL",this.change=new t.EventEmitter,this._value=new Date,this.changedValue=null,this.appLocale=e.get(c.App).appLocale||{}}return Object.defineProperty(e.prototype,"value",{set:function(e){e=e||new Date,this._value=e,this.changedValue=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bsDatepickerConfig",{get:function(){return this._bsDatepickerConfig},set:function(e){this._bsDatepickerConfig=e,this._bsDatepickerConfig.showClearButton=!1,this._bsDatepickerConfig.showTodayButton=!1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"excludedDaysToDisable",{set:function(e){this._bsDatepickerConfig.daysDisabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"displayFormat",{get:function(){if(this._displayFormat)return this._displayFormat},set:function(e){e&&(this._displayFormat=e.replace(/y/g,"Y").replace(/d/g,"D").replace("a","A"))},enumerable:!1,configurable:!0}),e.prototype.validateSelectedDate=function(){var e,t,n,i,o;if(!this.changedValue)return!0;var a=moment(this.changedValue),r=null===(e=this._bsDatepickerConfig)||void 0===e?void 0:e.minDate,s=null===(t=this._bsDatepickerConfig)||void 0===t?void 0:t.maxDate;if(r&&("DATE"===this.mode&&moment(r).startOf("day").toDate()>this.changedValue||"DATE"!==this.mode&&r>this.changedValue))return!1;if(s&&("DATE"===this.mode&&moment(s).endOf("day").toDate()<this.changedValue||"DATE"!==this.mode&&s<this.changedValue))return!1;if((null===(i=null===(n=this._bsDatepickerConfig)||void 0===n?void 0:n.daysDisabled)||void 0===i?void 0:i.indexOf(a.day()))>=0)return!1;var l=a.startOf("day").toDate().getTime();return!(null===(o=this.excludedDatesToDisable)||void 0===o?void 0:o.find((function(e){return e.getTime()===l})))},e.prototype.hightlightToday=function(){var e=(new Date).getDate().toString();_.filter($("body>modal-container .date-picker-modal span:contains("+e+")").not(".is-other-month,.current-date"),(function(t){$(t).text()===e&&$(t).addClass("current-date text-info")}))},e.prototype.hideOnClick=function(){var e=this;$("body>modal-container .date-picker-modal .app-datetime-picker").click((function(e){return e.stopPropagation()})),$("body>modal-container .date-picker-modal").click((function(){return e.onCancelClick()}))},e.prototype.getDateLabel=function(){return moment(this.changedValue).format(this.displayFormat)},e.prototype.openDatePicker=function(){this.isTimeOpen=!1,this.isDateOpen=!0},e.prototype.openTimePicker=function(){this.isTimeOpen=!0,this.isDateOpen=!1},e.prototype.onDateUpdate=function(e){var t=this.changedValue;"DATE"===this.mode?(e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0)):t&&e&&(e.setHours(t.getHours()),e.setMinutes(t.getMinutes()),e.setSeconds(t.getSeconds()),e.setMilliseconds(t.getMilliseconds())),this.changedValue=e,"DATE"===this.mode&&t!==e&&this.validateSelectedDate()&&this.onOkClick()},e.prototype.onTimeUpdate=function(e){this.changedValue=e},e.prototype.show=function(){var e=this;this.reset(),this.modalRef=this.bsModalService.show(this.datetimepickerTemplate,{animated:!0,backdrop:"static",class:"date-picker-modal modal-dialog-centered"}),setTimeout((function(){e.hideOnClick()}),500)},e.prototype.clear=function(){this.changedValue=null,this.triggerChange(),this.hideModal()},e.prototype.setToday=function(){var e=moment().startOf("day").toDate();this.onDateUpdate(e)},e.prototype.reset=function(){this.changedValue=this._value},e.prototype.hideModal=function(){var e;(null===(e=this.modalRef)||void 0===e?void 0:e.id)&&this.bsModalService.hide(this.modalRef.id)},e.prototype.onCancelClick=function(){this.changedValue=this._value,this.hideModal()},e.prototype.onOkClick=function(){this.validateSelectedDate()&&this.triggerChange(),this.hideModal()},e.prototype.triggerChange=function(){this.value!==this.changedValue&&this.change.emit(this.changedValue)},e.prototype.ngAfterViewInit=function(){},e.prototype.ngOnDestroy=function(){this.hideModal()},e}();g.decorators=[{type:t.Component,args:[{selector:"wm-datetimepicker",template:'\n <ng-template #datetimepickerTemplate>\n <div class="app-datetime-picker">\n <div class="modal-body">\n <div class="mobile-datetime-picker-options">\n\n </div>\n <bs-datepicker-inline\n [bsConfig]="bsDatepickerConfig"\n [datesDisabled]="excludedDatesToDisable"\n bsDatepicker\n [bsValue]="changedValue"\n (bsValueChange)="onDateUpdate($event)"\n *ngIf="mode === \'DATE_TIME\' || mode === \'DATE\'">\n </bs-datepicker-inline>\n <wm-timepicker\n [value]="changedValue"\n [min]="minTime"\n [max]="maxTime"\n (change)="onTimeUpdate($event)"\n *ngIf="mode === \'DATE_TIME\' || mode === \'TIME\'"></wm-timepicker>\n <span class="text-primary date-picker-value">\n {{getDateLabel()}}\n </span>\n </div>\n <div class="modal-footer">\n <button\n *ngIf="mode === \'DATE_TIME\' || mode === \'DATE\'"\n class="btn btn-secondary today-btn"\n (click)="setToday()">{{appLocale.LABEL_TODAY_DATE || "Today" }}</button>\n <button\n class="btn btn-primary pull-right ok-btn"\n *ngIf="mode === \'DATE_TIME\' || mode === \'TIME\'"\n (click)="onOkClick()">{{appLocale.LABEL_OK || "Ok" }}</button>\n <button\n class="btn btn-secondary pull-right clear-btn"\n (click)="clear()">{{appLocale.LABEL_CLEAR_DATE || "Clear" }}</button>\n </div>\n </div>\n </ng-template>\n '}]}],g.ctorParameters=function(){return[{type:t.Injector},{type:d.BsModalService}]},g.propDecorators={datetimepickerTemplate:[{type:t.ViewChild,args:["datetimepickerTemplate",{static:!0}]}],mode:[{type:t.Input}],placement:[{type:t.Input}],_bsDatepickerConfig:[{type:t.Input,args:["config"]}],minTime:[{type:t.Input}],maxTime:[{type:t.Input}],_displayFormat:[{type:t.Input}],change:[{type:t.Output}],excludedDatesToDisable:[{type:t.Input}],value:[{type:t.Input}],bsDatepickerConfig:[{type:t.Input,args:["config"]}],excludedDaysToDisable:[{type:t.Input}],displayFormat:[{type:t.Input}]};var v=function(){function e(e){this.inj=e,this.options={hour:[],minute:[],second:[],meridian:["AM","PM"]},this.value=new Date,this.min=null,this.max=null,this.change=new t.EventEmitter,this.options.hour=this.populateNumbers(0,23),this.options.minute=this.populateNumbers(0,59),this.options.second=this.populateNumbers(0,59)}return e.prototype.populateNumbers=function(e,t){for(var n=[],i=e;i<=t;i++)n.push({label:(i<10?"0":"")+i,value:i});return n},e.prototype.set=function(e,t){e.index;var n=e.value;"HOUR"===t?this.value=moment(this.value).hour(parseInt(n)).toDate():"MINUTE"===t?this.value=moment(this.value).minute(parseInt(n)).toDate():"SECOND"===t?this.value=moment(this.value).second(parseInt(n)).toDate():"MERIDIAN"===t&&(this.value=moment(this.value).minute(n).toDate()),this.min&&this.value<this.min&&(this.value=this.min),this.max&&this.value>this.max&&(this.value=this.max),this.change.emit(this.value)},Object.defineProperty(e.prototype,"hour",{get:function(){return moment(this.value).hour()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minute",{get:function(){return moment(this.value).minute()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"second",{get:function(){return moment(this.value).second()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"meridian",{get:function(){return"AM"},enumerable:!1,configurable:!0}),e.prototype.onDateUpdate=function(e){},e.prototype.ngAfterViewInit=function(){},e}();v.decorators=[{type:t.Component,args:[{selector:"wm-timepicker",template:'\n <wm-pickergroup>\n <wm-picker\n [options]="options.hour"\n [selectedValue]="hour"\n (change)="set($event, \'HOUR\')"></wm-picker>\n <span class="app-time-separator">:</span>\n <wm-picker\n [options]="options.minute"\n [selectedValue]="minute"\n (change)="set($event, \'MINUTE\')"></wm-picker>\n <span class="app-time-separator">:</span>\n <wm-picker\n [options]="options.minute"\n [selectedValue]="second"\n (change)="set($event, \'SECOND\')"></wm-picker>\n </wm-pickergroup>\n '}]}],v.ctorParameters=function(){return[{type:t.Injector}]},v.propDecorators={value:[{type:t.Input}],min:[{type:t.Input}],max:[{type:t.Input}],change:[{type:t.Output}]};var y="CURRENT_DATE",b=["January","February","March","April","May","June","July","August","September","October","November","December"],w="default",P="default";function O(e){return Object.assign(new r.TimepickerConfig,{meridians:n.getLocaleDayPeriods(e.getSelectedLocale(),n.FormStyle.Format,n.TranslationWidth.Abbreviated)})}var E=function(e){function t(t,i){var a=e.call(this,t,i)||this;return a.isReadOnly=!1,a.clicked=!1,a.formatsByLocale={timezone:""},a._dateOptions=new o.BsDatepickerConfig,a.i18nService=a.inj.get(c.AbstractI18nService),a.invokeEventCallback("beforeload"),a.datePipe=a.inj.get(s.ToDatePipe),a.selectedLocale=a.i18nService.getSelectedLocale(),a._dateOptions.todayPosition="left",a._dateOptions.clearPosition="right",a.meridians=n.getLocaleDayPeriods(a.selectedLocale,n.FormStyle.Format,n.TranslationWidth.Abbreviated),a.loadNativeDateInput=c.isMobile()&&!a.showcustompicker,a.cancelLocaleChangeSubscription=a.getAppInstance().subscribe("locale-changed",(function(e){a.datePipe.datePipe.locale=e.angular,a._dateOptions.todayButtonLabel=a.i18nService.getLocalizedMessage("LABEL_TODAY_DATE"),a._dateOptions.clearButtonLabel=a.i18nService.getLocalizedMessage("LABEL_CLEAR_DATE")})),a}return h(t,e),Object.defineProperty(t.prototype,"timeZone",{get:function(){return this.inj.get(c.AbstractI18nService).getTimezone(this)},enumerable:!1,configurable:!0}),t.prototype.isDropDownDisplayEnabledOnInput=function(e){return e===w},t.prototype.isDataEntryModeEnabledOnInput=function(e){return e===P},t.prototype.showValidation=function(e,t,n,i){if(n)return console.warn("min max date validation failed ",i),$(e.target).val(t)},t.prototype.resetDisplayInput=function(){$(this.nativeElement).find(".display-input").val("")},t.prototype.validate=function(e){return this.invalidDateTimeFormat?{invalidDateTimeFormat:{valid:!1}}:!_.isUndefined(this.dateNotInRange)&&this.dateNotInRange?{dateNotInRange:{valid:!1}}:!_.isUndefined(this.timeNotInRange)&&this.timeNotInRange?{timeNotInRange:{valid:!1}}:this.show&&this.required?e.value?null:{required:!0}:(this.validateType="",null)},t.prototype.formatValidation=function(e,t,n){var i=this.datepattern||this.timepattern,o=this.timeZone,a=c.getFormattedDate(this.datePipe,e,i,o,null,null,this);if(t=t.trim())if("timestamp"===i){if(!_.isNaN(t)&&_.parseInt(t)!==a)return this.invalidDateTimeFormat=!0,this.validateType="incorrectformat",this.invokeOnChange(this.datavalue,void 0,!1),!1}else if(n&&(t=c.getFormattedDate(this.datePipe,t,i,o)),t!==a)return this.invalidDateTimeFormat=!0,this.validateType="incorrectformat",this.invokeOnChange(this.datavalue,void 0,!1),!1;return!0},t.prototype.minDateMaxDateValidationOnInput=function(e,t,n,i){var o=this;if(e){var a=e;e=moment(e).startOf("day").toDate();var r=moment(c.getDateObj(this.mindate)).startOf("day").toDate(),s=moment(c.getDateObj(this.maxdate)).startOf("day").toDate();if(this.mindate&&e<r){var l=this.appLocale.LABEL_MINDATE_VALIDATION_MESSAGE+" "+this.mindate+".";return this.invokeOnChange(this.datavalue,void 0,!1),i&&c.getFormattedDate(this.datePipe,r,this.datepattern,this.timeZone,null,null,this)===n?$(t.target).val(n):(this.dateNotInRange=!0,this.validateType="mindate",this.showValidation(t,n,i,l))}if(this.maxdate&&e>s){l=this.appLocale.LABEL_MAXDATE_VALIDATION_MESSAGE+" "+this.maxdate+".";return this.invokeOnChange(this.datavalue,void 0,!1),i&&c.getFormattedDate(this.datePipe,s,this.datepattern,this.timeZone,null,null,this)===n?$(t.target).val(n):(this.dateNotInRange=!0,this.validateType="maxdate",this.showValidation(t,n,i,l))}if(this.excludedates){if((c.isString(this.excludedates)?_.split(this.excludedates,","):this.excludedates).map((function(e){return c.getFormattedDate(o.datePipe,e,o.datepattern,o.timeZone,null,null,o)})).indexOf(c.getFormattedDate(this.datePipe,a,this.datepattern,this.timeZone,null,null,this))>-1)return this.dateNotInRange=!0,this.validateType="excludedates",void this.invokeOnChange(this.datavalue,void 0,!1)}if(this.excludedays){var p=_.split(this.excludedays,","),d=_.get(a,"getDay")?a.getDay():a;if(p.indexOf(d.toString())>-1)return this.dateNotInRange=!0,this.validateType="excludedays",void this.invokeOnChange(this.datavalue,void 0,!1)}}i||(this.dateNotInRange=!1,this.invokeOnChange(this.datavalue,void 0,!1))},t.prototype.hightlightToday=function(){var e=(new Date).getDate().toString();_.filter($("span:contains("+e+")").not(".is-other-month"),(function(t){$(t).text()===e&&$(t).addClass("current-date text-info")}))},t.prototype.isOtheryear=function(e){return 0===e.getMonth()&&11===this.activeDate.getMonth()||11===e.getMonth()&&0===this.activeDate.getMonth()},t.prototype.setActiveDateFocus=function(e,t){var n=this;this.setNextData(e);var i=this.activeDate.getMonth();t||(e.getMonth()<i?this.isOtheryear(e)?this.goToOtherMonthOryear("next","days"):this.goToOtherMonthOryear("previous","days"):e.getMonth()>i&&(this.isOtheryear(e)?this.goToOtherMonthOryear("previous","days"):this.goToOtherMonthOryear("next","days"))),setTimeout((function(){var t=e.getDate().toString();_.filter($("span:contains("+t+")").not(".is-other-month"),(function(i){$(i).text()===t&&($(i).hasClass("selected")&&$(i).parent().attr("aria-selected","true"),$(i).attr("aria-label",moment(e).format("dddd, MMMM Do YYYY")),$("[bsdatepickerdaydecorator]").not(".is-other-month").attr("tabindex","-1"),$(i).attr("tabindex","0"),$(i).focus(),n.activeDate=e)})),e.getMonth()===(new Date).getMonth()&&e.getFullYear()===(new Date).getFullYear()&&n.hightlightToday()}))},t.prototype.goToOtherMonthOryear=function(e,t){var n=$(".bs-datepicker-head ."+e);n.attr("disabled")||(n.trigger("click"),"days"===t?this.loadDays():"month"===t?this.loadMonths():"year"===t&&this.loadYears())},t.prototype.getMonth=function(e,t){var n=new Date(e),i=n.getMonth(),o=n.getFullYear(),a=new Date(o,i+=t),r=a.toLocaleString("en-US",{month:"long"});return{date:a,fullMonth:r}},t.prototype.addDatepickerMouseEvents=function(){var e=this,t=$(".bs-datepicker-head");t.find(".previous").click((function(t){e.next=e.getMonth(e.activeDate,0),e.prev=e.getMonth(e.activeDate,-2),e.clicked=!0,t.originalEvent&&e.setFocusForDate(-1);var n=e.getMonth(e.activeDate,-1);$(".bs-datepicker-head .previous").prepend('<p aria-hidden="false" class="sr-only">Changed to Previous Month, '+n.fullMonth+" and year "+n.date.getFullYear()+"</p>"),setTimeout((function(){$(".bs-datepicker-head .previous").focus()}))})),t.find(".next").click((function(t){e.next=e.getMonth(e.activeDate,2),e.prev=e.getMonth(e.activeDate,0),e.clicked=!0,t.originalEvent&&e.setFocusForDate(1);var n=e.getMonth(e.activeDate,1);$(".bs-datepicker-head .next").prepend('<p aria-hidden="false" class="sr-only">Changed to Next Month, '+n.fullMonth+" and year "+n.date.getFullYear()+"</p>"),setTimeout((function(){$(".bs-datepicker-head .next").focus()}))})),t.find(".current").click((function(t){t.originalEvent&&e.setFocusForCurrentMonthOryear()})),$(".bs-datepicker-body, .bs-datepicker-action-buttons").click((function(t){t.stopPropagation(),t.originalEvent&&e.setFocusForMonthOrDay()})),this.clicked||(t.find(".next").attr("aria-label","Next Month, "+this.next.fullMonth+" "+this.next.date.getFullYear()),t.find(".previous").attr("aria-label","Previous Month, "+this.prev.fullMonth+" "+this.prev.date.getFullYear()))},t.prototype.setFocusForMonthOrDay=function(){var e=$(".bs-datepicker-head .current").first().text(),t=$(".bs-datepicker-body");if(t.find("table.months").length>0){_.parseInt(e)!==this.activeDate.getFullYear()&&this.loadMonths();var n=new Date(_.parseInt(e),this.activeDate.getMonth(),this.activeDate.getDate());this.setActiveMonthFocus(n,!0)}else if(t.find("table.days").length>0){var i=b.indexOf(e);i!==this.activeDate.getMonth()&&this.loadDays();n=new Date(this.activeDate.getFullYear(),i,1);this.setActiveDateFocus(n,!0)}},t.prototype.setFocusForCurrentMonthOryear=function(){var e=$(".bs-datepicker-body");e.find("table.months").length>0?(this.loadMonths(),this.setActiveMonthFocus(this.activeDate,!0)):e.find("table.years").length>0&&(this.loadYears(),this.setActiveYearFocus(this.activeDate,!0))},t.prototype.setFocusForDate=function(e){var t=$(".bs-datepicker-body");if(t.find("table.months").length>0){this.loadMonths();var n=new Date(this.activeDate.getFullYear()+e,0,this.activeDate.getDate());this.setActiveMonthFocus(n,!0)}else if(t.find("table.years").length>0){this.loadYears();var i=t.find("table.years span").first().text();n=new Date(_.parseInt(i),this.activeDate.getMonth(),this.activeDate.getDate());this.setActiveYearFocus(n,!0)}else if(t.find("table.days").length>0){this.loadDays();n=new Date(this.activeDate.getFullYear(),this.activeDate.getMonth()+e,1);this.setActiveDateFocus(n,!0)}},t.prototype.addDatepickerKeyboardEvents=function(e,t){var n=this;this.keyEventPluginInstance=e.keyEventPlugin.constructor,this.elementScope=e;var i=document.querySelector("."+e.dateContainerCls);c.setAttr(i,"tabindex","0"),i.onkeydown=function(e){if("escape"===n.keyEventPluginInstance.getEventFullKey(e)){n.elementScope.hideDatepickerDropdown();var t=n.elementScope.nativeElement.querySelector(".display-input");setTimeout((function(){return t.focus()}))}},this.loadDays(),this.setActiveDateFocus(this.activeDate)},t.prototype.setNextData=function(e){this.next=this.getMonth(e,1),this.prev=this.getMonth(e,-1)},t.prototype.loadDays=function(){var e=this;setTimeout((function(){$("[bsdatepickerdaydecorator]").not(".is-other-month").attr("tabindex","0"),e.addKeyBoardEventsForDays(),e.addDatepickerMouseEvents()}))},t.prototype.addKeyBoardEventsForDays=function(){var e=this;$(".bs-datepicker-body").keydown((function(t){var n,i=e.keyEventPluginInstance.getEventFullKey(t);if("arrowdown"===i)t.preventDefault(),n=moment(e.activeDate).add(7,"days").toDate(),e.setActiveDateFocus(n);else if("arrowup"===i)t.preventDefault(),n=moment(e.activeDate).add(-7,"days").toDate(),e.setActiveDateFocus(n);else if("arrowleft"===i)n=moment(e.activeDate).add(-1,"days").toDate(),e.setActiveDateFocus(n);else if("arrowright"===i)n=moment(e.activeDate).add(1,"days").toDate(),e.setActiveDateFocus(n);else if("pageup"===i)t.preventDefault(),n=moment(e.activeDate).add(-1,"month").toDate(),e.setActiveDateFocus(n);else if("pagedown"===i)t.preventDefault(),n=moment(e.activeDate).add(1,"month").toDate(),e.setActiveDateFocus(n);else if("control.arrowup"===i)$(".bs-datepicker-head .current").first().click(),e.loadMonths(),e.setActiveMonthFocus(e.activeDate);else if("enter"===i){if($(document.activeElement).hasClass("disabled"))return;$(document.activeElement).click(),e.elementScope.hideDatepickerDropdown();var o=e.elementScope.nativeElement.querySelector(".display-input");setTimeout((function(){return o.focus()}))}})),this.focusBlurDatePickerHeadButtons()},t.prototype.focusBlurDatePickerHeadButtons=function(){var e=$(".bs-datepicker-head button");e.on("focus",(function(){$(this).css("background-color","#9AA0A3")})),e.on("blur",(function(){$(this).css("background-color","")}))},t.prototype.loadMonths=function(){var e=this;setTimeout((function(){e.addKeyBoardEventsForMonths(),e.addDatepickerMouseEvents()}))},t.prototype.addKeyBoardEventsForMonths=function(){var e=this;$(".bs-datepicker-body").keydown((function(t){var n,i=e.keyEventPluginInstance.getEventFullKey(t);if("arrowdown"===i)t.preventDefault(),n=moment(e.activeDate).add(3,"month").toDate(),e.setActiveMonthFocus(n);else if("arrowup"===i)t.preventDefault(),n=moment(e.activeDate).add(-3,"month").toDate(),e.setActiveMonthFocus(n);else if("arrowleft"===i)n=moment(e.activeDate).add(-1,"month").toDate(),e.setActiveMonthFocus(n);else if("arrowright"===i)n=moment(e.activeDate).add(1,"month").toDate(),e.setActiveMonthFocus(n);else if("control.arrowup"===i)$(".bs-datepicker-head .current").first().click(),e.loadYears(),e.setActiveYearFocus(e.activeDate);else if("control.arrowdown"===i||"enter"===i){if($(document.activeElement).parent().hasClass("disabled"))return;$(document.activeElement).click(),e.loadDays();var o=new Date(e.activeDate.getFullYear(),e.activeDate.getMonth(),1);e.setActiveDateFocus(o)}})),this.focusBlurDatePickerHeadButtons()},t.prototype.loadYears=function(){var e=this;setTimeout((function(){e.addKeyBoardEventsForYears(),e.addDatepickerMouseEvents()}))},t.prototype.setActiveMonthFocus=function(e,t){var n=this;this.setNextData(e);var i=b[e.getMonth()];t||(e.getFullYear()<this.activeDate.getFullYear()?this.goToOtherMonthOryear("previous","month"):e.getFullYear()>this.activeDate.getFullYear()&&this.goToOtherMonthOryear("next","month")),setTimeout((function(){$(".bs-datepicker-body table.months span").attr("tabindex","-1"),$(".bs-datepicker-body table.months span:contains("+i+")").attr("tabindex","0"),$(".bs-datepicker-body table.months span:contains("+i+")").focus(),n.activeDate=e}))},t.prototype.addKeyBoardEventsForYears=function(){var e=this;$(".bs-datepicker-body").keydown((function(t){var n,i=e.keyEventPluginInstance.getEventFullKey(t);if("arrowdown"===i)t.preventDefault(),n=moment(e.activeDate).add(4,"year").toDate(),e.setActiveYearFocus(n);else if("arrowup"===i)t.preventDefault(),n=moment(e.activeDate).add(-4,"year").toDate(),e.setActiveYearFocus(n);else if("arrowleft"===i)n=moment(e.activeDate).add(-1,"year").toDate(),e.setActiveYearFocus(n);else if("arrowright"===i)n=moment(e.activeDate).add(1,"year").toDate(),e.setActiveYearFocus(n);else if("control.arrowdown"===i||"enter"===i){if($(document.activeElement).parent().hasClass("disabled"))return;$(document.activeElement).click(),e.loadMonths(),e.setActiveMonthFocus(e.activeDate)}})),this.focusBlurDatePickerHeadButtons()},t.prototype.setActiveYearFocus=function(e,t){var n=this,i=e.getFullYear(),o=$(".bs-datepicker-body table.years span"),a=o.first().text(),r=o.last().text();t||(e.getFullYear()<_.parseInt(a)?this.goToOtherMonthOryear("previous","year"):e.getFullYear()>_.parseInt(r)&&this.goToOtherMonthOryear("next","year")),setTimeout((function(){$(".bs-datepicker-body table.years span").attr("tabindex","-1"),$(".bs-datepicker-body table.years span:contains("+i+")").attr("tabindex","0"),$(".bs-datepicker-body table.years span:contains("+i+")").focus(),n.activeDate=e}))},t.prototype.focusTimePickerPopover=function(e){this.keyEventPluginInstance=e.keyEventPlugin.constructor,this.elementScope=e,this.elementScope.ngZone.runOutsideAngular((function(){setTimeout((function(){$("timepicker .form-group").first().find("> input.form-control").focus()}))}))},t.prototype.bindTimePickerKeyboardEvents=function(){var e=this;setTimeout((function(){var t=$("body").find("> bs-dropdown-container timepicker");t.attr("tabindex",0),e.addEventsOnTimePicker(t)}))},t.prototype.focusOnInputEl=function(){var e=this;$(this.nativeElement).closest(".caption-floating").length>0&&setTimeout((function(){$(e.nativeElement).find(".app-textbox").focus()}),100)},t.prototype.isValidDate=function(e){return e&&e instanceof Date&&!isNaN(e.getTime())},t.prototype.timeFormatValidation=function(){var e=$(this.nativeElement).find("input").val(),t=c.getNativeDateObject(e,{meridians:this.meridians,pattern:this.datepattern});this.formatValidation(t,e)&&(this.invalidDateTimeFormat=!1,this.invokeOnChange(this.datavalue,void 0,!1))},t.prototype.updateTimeValue=function(e,t){var n=this;e.length<2?setTimeout((function(){"minutes"===t?n.bsTimePicker.updateMinutes("00"):n.bsTimePicker.updateSeconds("00")}),500):"minutes"===t?this.bsTimePicker.updateMinutes("00"):this.bsTimePicker.updateSeconds("00")},t.prototype.addEventsOnTimePicker=function(e){var t=this,n=e.find(".bs-timepicker-field");n.first().on("keyup",(function(e){var i=e.target.value;_.forEach(n,(function(n,o){if(e.target!==n&&""===n.value&&i.length){var a=1===o?"minutes":"seconds";t.updateTimeValue(i,a)}}))})),this.removeKeyupListener=function(){n.first().off("keyup")},e.on("keydown",(function(e){var n,i,o=$(e.target),a=o.parent(),r=t.elementScope,s=t.keyEventPluginInstance.getEventFullKey(e);if("escape"===s&&r.hideTimepickerDropdown(),o.hasClass("bs-timepicker-field")){if(a.is(":first-child")?"shift.tab"!==s&&"enter"!==s&&"escape"!==s||(r.setIsTimeOpen(!1),t.focus(),n=!0,i=!0):a.is(":last-child")||a.next().next().find("button.disabled").length?"tab"!==s&&"escape"!==s&&"enter"!==s||(r.setIsTimeOpen(!1),t.focus(),n=!0,i=!0):"enter"!==s&&"escape"!==s||(r.setIsTimeOpen(!1),t.focus(),n=!0,i=!0),n&&e.stopPropagation(),i&&e.preventDefault(),r.mintime&&r.maxtime&&!t.isValidDate(r.bsTimeValue)&&("arrowdown"===s?r.bsTimeValue=r.maxTime:"arrowup"===s&&(r.bsTimeValue=r.minTime)),"tab"===s){t.invalidDateTimeFormat=!1,t.invokeOnChange(t.datavalue,void 0,!1);var l=t.datepattern||t.timepattern;c.getFormattedDate(r.datePipe,r.bsTimeValue,l,t.timeZone,null,null,t)===r.displayValue&&$(t.nativeElement).find(".display-input").val(r.displayValue)}"arrowdown"!==s&&"arrowup"!==s||t.timeFormatValidation()}else o.hasClass("btn-default")&&("tab"!==s&&"escape"!==s||(r.setIsTimeOpen(!1),t.focus()))})),e.find("a").on("click",(function(e){var n=t.elementScope,i=$(e.target);n.mintime&&n.maxtime&&!t.isValidDate(n.bsTimeValue)&&(i.find("span").hasClass("bs-chevron-down")?n.bsTimeValue=n.maxTime:i.find("span").hasClass("bs-chevron-up")&&(n.bsTimeValue=n.minTime)),t.timeFormatValidation()}))},t.prototype.updateFormat=function(e){"datepattern"===e?(this._dateOptions.dateInputFormat=this.datepattern,this.showseconds=_.includes(this.datepattern,"s"),this.ismeridian=_.includes(this.datepattern,"h")):"timepattern"===e&&(this.showseconds=_.includes(this.timepattern,"s"),this.ismeridian=_.includes(this.timepattern,"h"))},t.prototype.getMobileInput=function(){return this.nativeElement.querySelector(".mobile-input")},t.prototype.onDateTimeInputBlur=function(){var e=this.getMobileInput();if(e&&!c.hasCordova()){for(var t=this.nativeElement.children,n=0;n<t.length;n++)t[n].classList.remove("add-opacity");e.classList.remove("remove-opacity")}},t.prototype.onDateTimeInputFocus=function(e){if(void 0===e&&(e=!1),this.loadNativeDateInput){var t=this.getMobileInput();if(!e||c.hasCordova())t&&this._triggeredByUser&&(t.focus(),t.click());else{for(var n=this.nativeElement.children,i=0;i<n.length;i++)n[i].classList.add("add-opacity");t.classList.add("remove-opacity")}}},t.prototype.getCordovaPluginDatePickerApi=function(){if(c.isIos())return _.get(window,"cordova.wavemaker.datePicker.selectDate")},t.prototype.showDatePickerModal=function(){this.datetimepickerComponent.show()},t.prototype.blurDateInput=function(e){var t=this.nativeElement.querySelector(".display-input");e&&setTimeout((function(){return t.blur()}))},t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("required"!==t?"datepattern"===t?this.updateFormat(t):"showweeks"===t?this._dateOptions.showWeekNumbers=n:"mindate"===t?(this._dateOptions.minDate=n===y?this.mindate=new Date:c.getDateObj(n),this.minDateMaxDateValidationOnInput(this.datavalue)):"maxdate"===t?(this._dateOptions.maxDate=n===y?this.maxdate=new Date:c.getDateObj(n),this.minDateMaxDateValidationOnInput(this.datavalue)):"excludedates"===t||"excludedays"===t?(this.excludedays&&(this.excludedDaysToDisable=_.split(this.excludedays,",").map((function(e){return+e}))),this.excludedates&&(this.excludedDatesToDisable=this.excludedates,c.isString(this.excludedates)&&(this.excludedDatesToDisable=_.split(this.excludedates,",")),this.excludedDatesToDisable=this.excludedDatesToDisable.map((function(e){return c.getDateObj(e)}))),this.minDateMaxDateValidationOnInput(this.datavalue)):"selectfromothermonth"===t?this._dateOptions.selectFromOtherMonth=n:"todaybutton"===t?this._dateOptions.showTodayButton=n:"clearbutton"===t?this._dateOptions.showClearButton=n:"todaybuttonlabel"===t?this._dateOptions.todayButtonLabel=this.i18nService.getLocalizedMessage(n)||n:"clearbuttonlabel"===t?this._dateOptions.clearButtonLabel=this.i18nService.getLocalizedMessage(n)||n:"showcustompicker"===t?this.loadNativeDateInput=c.isMobile()&&!this.showcustompicker:"adaptiveposition"===t?this._dateOptions.adaptivePosition=n:e.prototype.onPropertyChange.call(this,t,n,i):this._onChange(this.datavalue))},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),this.containerTarget=s.getContainerTargetClass(this.nativeElement),this.isReadOnly="undefined"!=this.dataentrymode&&!this.isDataEntryModeEnabledOnInput(this.dataentrymode);var t=this.getMobileInput();t&&setTimeout((function(){t.style.width="100%",t.style.height="100%"}))},t.prototype.ngOnDestroy=function(){this.dateOnShowSubscription&&this.dateOnShowSubscription.unsubscribe(),this.cancelLocaleChangeSubscription&&this.cancelLocaleChangeSubscription(),e.prototype.ngOnDestroy.call(this)},t.prototype.ngOnDetach=function(){var e;null===(e=this.datetimepickerComponent)||void 0===e||e.hideModal()},t.prototype.setTimezone=function(e){this.i18nService.setTimezone(e,this)},t}(p.BaseFormCustomComponent);E.decorators=[{type:t.Directive}],E.ctorParameters=function(){return[{type:t.Injector},null]},E.propDecorators={bsDropdown:[{type:t.ViewChild,args:[a.BsDropdownDirective]}],bsTimePicker:[{type:t.ViewChild,args:[r.TimepickerComponent]}],datetimepickerComponent:[{type:t.ViewChild,args:[g]}]};var R=new Map([["autofocus",s.PROP_BOOLEAN],["class",s.PROP_STRING],["dataentrymode",Object.assign({value:"default"},s.PROP_STRING)],["datavaluesource",s.PROP_ANY],["datavalue",s.PROP_STRING],["datepattern",s.PROP_STRING],["disabled",s.PROP_BOOLEAN],["excludedays",s.PROP_STRING],["excludedates",s.PROP_STRING],["hint",s.PROP_STRING],["maxdate",s.PROP_STRING],["mindate",s.PROP_STRING],["name",s.PROP_STRING],["outputformat",Object.assign({value:"yyyy-MM-dd"},s.PROP_STRING)],["placeholder",Object.assign({value:"Select Date"},s.PROP_STRING)],["readonly",s.PROP_BOOLEAN],["required",s.PROP_BOOLEAN],["shortcutkey",s.PROP_STRING],["show",Object.assign({value:!0},s.PROP_BOOLEAN)],["showdropdownon",Object.assign({value:"default"},s.PROP_STRING)],["showbuttonbar",Object.assign({value:!0},s.PROP_BOOLEAN)],["showcustompicker",Object.assign({value:!1},s.PROP_BOOLEAN)],["showindevice",Object.assign({displayType:"inline-block",value:"all"},s.PROP_STRING)],["showweeks",Object.assign({value:!1},s.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},s.PROP_NUMBER)],["selectfromothermonth",Object.assign({value:!0},s.PROP_BOOLEAN)],["todaybutton",Object.assign({value:!0},s.PROP_BOOLEAN)],["clearbutton",Object.assign({value:!0},s.PROP_BOOLEAN)],["adaptiveposition",Object.assign({value:!0},s.PROP_BOOLEAN)],["todaybuttonlabel",Object.assign({value:"LABEL_TODAY_DATE"},s.PROP_STRING)],["clearbuttonlabel",Object.assign({value:"LABEL_CLEAR_DATE"},s.PROP_STRING)]]),A=function(){s.register("wm-date",R),s.registerFormWidget(c.FormWidgetType.DATE,new Map(R))},T={widgetType:"wm-date",hostClass:"app-date input-group"},S=function(e){function t(t,n,i,o){var a=e.call(this,t,T)||this;return a.cdRef=n,a.appDefaults=i,a.isOpen=!1,a.isEnterPressedOnDateInput=!1,s.styler(a.nativeElement,a),a.keyEventPlugin=o[1],a.dateContainerCls="app-date-"+a.widgetId,a._dateOptions.containerClass="app-date "+a.dateContainerCls,a._dateOptions.showWeekNumbers=!1,a._bsDefaultLoadCheck=!0,a.datepattern=a.appDefaults.dateFormat||c.getDisplayDateTimeFormat(c.FormWidgetType.DATE),a.updateFormat("datepattern"),a}return h(t,e),Object.defineProperty(t.prototype,"timestamp",{get:function(){return this.bsDataValue?this.bsDataValue.valueOf():void 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dateInputFormat",{get:function(){return this._dateOptions.dateInputFormat||"yyyy-MM-dd"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"displayValue",{get:function(){return c.getFormattedDate(this.datePipe,this.bsDataValue,this.dateInputFormat,this.timeZone,null,this.isCurrentDate,this)||""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nativeDisplayValue",{get:function(){return c.getFormattedDate(this.datePipe,this.bsDataValue,"yyyy-MM-dd",this.timeZone,null,this.isCurrentDate,this)||""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"datavalue",{get:function(){return c.getFormattedDate(this.datePipe,this.bsDataValue,this.outputformat,this.timeZone,null,this.isCurrentDate,this)||""},set:function(e){var t=this;"CURRENT_DATE"===e?(setTimeout((function(){t.bsDataValue=t.timeZone?c.getMomentLocaleObject(t.timeZone):new Date}),50),this.isCurrentDate=!0):(this.bsDataValue=e?c.getDateObj(e,{isNativePicker:this.loadNativeDateInput},this.timeZone):void 0,this.isCurrentDate=!1),this.invokeOnChange(this.datavalue,void 0,!0),this.cdRef.detectChanges()},enumerable:!1,configurable:!0}),t.prototype.onDisplayDateChange=function(e,t){if(void 0===t&&(t=!1),this.isEnterPressedOnDateInput)this.isEnterPressedOnDateInput=!1;else{var n=c.getDateObj(e.target.value,{pattern:this.datepattern,isNativePicker:t});this.formatValidation(n,e.target.value,t)&&(t&&this.minDateMaxDateValidationOnInput(n,e,this.displayValue,t)||this.setDataValue(n))}},t.prototype.setDataValue=function(e){this.invalidDateTimeFormat=!1,this.minDateMaxDateValidationOnInput(e),c.getFormattedDate(this.datePipe,e,this.dateInputFormat,this.timeZone,null,this.isCurrentDate,this)===this.displayValue&&$(this.nativeElement).find(".display-input").val(this.displayValue),this.bsDataValue=e||void 0,this.invokeOnChange(this.datavalue,{},!0)},t.prototype.onDatePickerOpen=function(){this.isOpen=!0,this.bsDataValue?this.activeDate=this.bsDataValue:this.activeDate=new Date,this.bsDataValue||this.hightlightToday(),this.$element.find(".model-holder").width("1px"),$("bs-datepicker-container").attr("aria-label","Use Arrow keys to navigate dates, Choose Date from datepicker"),$(".bs-calendar-container").removeAttr("role");var e=$(".bs-datepicker-container")[0];this.focusTrap=s.setFocusTrap(e,!0),this.focusTrap.activate(),this.addDatepickerKeyboardEvents(this,!1),c.adjustContainerPosition($("bs-datepicker-container"),this.nativeElement,this.bsDatePickerDirective._datepicker),c.adjustContainerRightEdges($("bs-datepicker-container"),this.nativeElement,this.bsDatePickerDirective._datepicker)},t.prototype.onInputBlur=function(e){$(e.relatedTarget).hasClass("current-date")||(this.invokeOnTouched(),this.invokeEventCallback("blur",{$event:e}))},t.prototype.hideDatepickerDropdown=function(){var e;this.invokeOnTouched(),this.isOpen=!1,null===(e=this.focusTrap)||void 0===e||e.deactivate(),this.isEnterPressedOnDateInput=!1,this.deregisterEventListener&&this.deregisterEventListener(),this.blurDateInput(this.isOpen)},t.prototype.handleEvent=function(t,n,i,o){_.includes(["blur","focus","change","click"],n)||e.prototype.handleEvent.call(this,t,n,i,o)},t.prototype.toggleDpDropdown=function(e,t){void 0===t&&(t=!1),this.loadNativeDateInput&&(t||this.onDateTimeInputFocus()),"click"===e.type&&this.invokeEventCallback("click",{$event:e}),e.target&&$(e.target).is("input")&&!this.isDropDownDisplayEnabledOnInput(this.showdropdownon)?e.stopPropagation():(this.bsDatePickerDirective.toggle(),this.addBodyClickListener(this.bsDatePickerDirective.isOpen))},t.prototype.addBodyClickListener=function(e){var t=this;if(e){var n=document.querySelector("body");setTimeout((function(){var e=n.querySelector("."+t.dateContainerCls);t.deregisterEventListener=c.addEventListenerOnElement(n,e,t.nativeElement,"click",t.isDropDownDisplayEnabledOnInput(t.showdropdownon),(function(){t.isOpen=!1}),0,!0)}),350)}},t.prototype.onDisplayKeydown=function(e){if(this.isDropDownDisplayEnabledOnInput(this.showdropdownon))if(e.stopPropagation(),"enter"===this.keyEventPlugin.constructor.getEventFullKey(e)){var t=c.getDateObj(e.target.value,{pattern:this.datepattern});e.preventDefault();var n=c.getFormattedDate(this.datePipe,t,this.dateInputFormat,this.timeZone,null,this.isCurrentDate,this),i=e.target.value.trim();i&&"timestamp"===this.datepattern?_.isNaN(i)||_.parseInt(i)===n||(this.invalidDateTimeFormat=!0,this.invokeOnChange(this.datavalue,e,!1)):i&&i!==n?(this.invalidDateTimeFormat=!0,this.invokeOnChange(this.datavalue,e,!1)):(this.invalidDateTimeFormat=!1,this.isEnterPressedOnDateInput=!0,this.bsDatePickerDirective.bsValue=e.target.value?t:""),this.toggleDpDropdown(e)}else this.hideDatepickerDropdown();else this.hideDatepickerDropdown()},t.prototype.onDateChange=function(e){this._bsDefaultLoadCheck?this._bsDefaultLoadCheck=!1:this.setDataValue(e)},t}(E);S.initializeProps=A(),S.decorators=[{type:t.Component,args:[{selector:"[wmDate]",template:' <input class="form-control app-textbox app-dateinput display-input"\n focus-target\n type="text"\n [name]="name"\n [tabindex]="loadNativeDateInput ? \'-1\' : tabindex"\n [attr.aria-hidden]="!!loadNativeDateInput"\n [value]="displayValue"\n (click)="toggleDpDropdown($event, true)"\n (focus)="onDateTimeInputFocus(); invokeOnFocus($event);"\n (blur)="onInputBlur($event)"\n [disabled]="disabled || readonly"\n [autofocus]="autofocus"\n [required]="required"\n [readOnly]="isReadOnly"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-label]="hint"\n (change)="onDisplayDateChange($event)"\n (keydown)="this._triggeredByUser = true; onDisplayKeydown($event);">\n\n <span class="input-group-btn">\n <button type="button"\n class="btn btn-default btn-time"\n [tabindex]="loadNativeDateInput ? \'-1\' : tabindex"\n [attr.aria-hidden]="!!loadNativeDateInput"\n [disabled]="disabled || readonly"\n [attr.aria-label]="displayValue ? \'Change Date \' + displayValue : \'Choose date by pressing enter\'"\n aria-haspopup="true"\n aria-expanded="false"\n (click)="toggleDpDropdown($event, false)">\n <i aria-hidden="true"\n class="app-icon wm-sl-l sl-calendar"></i>\n </button>\n </span>\n <div style="width: 0;display: inline-block;">\n <input class="model-holder"\n aria-label="datepicker dropdownmenu"\n aria-controls="date"\n [tabindex]="-1"\n [attr.aria-hidden]="!!loadNativeDateInput"\n [container]="containerTarget || \'body\'"\n [bsConfig]="_dateOptions"\n [isOpen]="isOpen"\n #datepicker="bsDatepicker"\n bsDatepicker\n [daysDisabled]="excludedDaysToDisable"\n [datesDisabled]="excludedDatesToDisable"\n placement="bottom right"\n [isDisabled]="disabled || readonly"\n [bsValue]="bsDataValue"\n (onShown)="onDatePickerOpen()"\n (onHidden)="hideDatepickerDropdown()"\n (bsValueChange)="onDateChange($event)">\n</div>\n\n<ng-template [ngIf]="loadNativeDateInput">\n <wm-datetimepicker\n dateTimePicker\n mode="DATE"\n [config]="_dateOptions"\n [placement]="modal"\n [excludedDaysToDisable]="excludedDaysToDisable"\n [excludedDatesToDisable]="excludedDatesToDisable"\n [displayFormat]="dateInputFormat"\n [value]="bsDataValue"\n (change)="onDateChange($event)">\n </wm-datetimepicker>\n <div class="mobile-input mobile-datepicker-container"\n [tabindex]="tabindex || 0"\n (focus)="onDateTimeInputFocus(true); invokeOnFocus($event);"\n (blur)="onDateTimeInputBlur(); invokeOnTouched($event)"\n [attr.aria-label]="displayValue ? \'Change Date\' + displayValue : \'Choose Date\'"\n (click)="!(disabled || readonly || isCurrentDate) && showDatePickerModal()">\n </div>\n</ng-template>\n',providers:[s.provideAs(S,i.NG_VALUE_ACCESSOR,!0),s.provideAs(S,i.NG_VALIDATORS,!0),s.provideAsWidgetRef(S)]}]}],S.ctorParameters=function(){return[{type:t.Injector},{type:t.ChangeDetectorRef},{type:c.AppDefaults},{type:void 0,decorators:[{type:t.Inject,args:[l.EVENT_MANAGER_PLUGINS]}]}]},S.propDecorators={bsDatePickerDirective:[{type:t.ViewChild,args:[o.BsDatepickerDirective]}]};var C=new Map([["autofocus",s.PROP_BOOLEAN],["class",s.PROP_STRING],["dataentrymode",Object.assign({value:"default"},s.PROP_STRING)],["datavaluesource",s.PROP_ANY],["datavalue",s.PROP_STRING],["datepattern",s.PROP_STRING],["disabled",s.PROP_BOOLEAN],["excludedays",s.PROP_STRING],["excludedates",s.PROP_STRING],["hint",s.PROP_STRING],["hourstep",Object.assign({value:1},s.PROP_NUMBER)],["maxdate",s.PROP_STRING],["mindate",s.PROP_STRING],["minutestep",Object.assign({value:15},s.PROP_NUMBER)],["name",s.PROP_STRING],["outputformat",Object.assign({value:"timestamp"},s.PROP_STRING)],["placeholder",Object.assign({value:"Select date time"},s.PROP_STRING)],["readonly",s.PROP_BOOLEAN],["required",s.PROP_BOOLEAN],["secondsstep",Object.assign({value:1},s.PROP_NUMBER)],["shortcutkey",s.PROP_STRING],["show",Object.assign({value:!0},s.PROP_BOOLEAN)],["showdropdownon",Object.assign({value:"default"},s.PROP_STRING)],["showbuttonbar",s.PROP_BOOLEAN],["showcustompicker",Object.assign({value:!1},s.PROP_BOOLEAN)],["showindevice",Object.assign({displayType:"inline-block",value:"all"},s.PROP_STRING)],["showweeks",s.PROP_BOOLEAN],["tabindex",Object.assign({value:0},s.PROP_NUMBER)],["timestamp",s.PROP_STRING],["selectfromothermonth",Object.assign({value:!0},s.PROP_BOOLEAN)],["todaybutton",Object.assign({value:!0},s.PROP_BOOLEAN)],["clearbutton",Object.assign({value:!0},s.PROP_BOOLEAN)],["adaptiveposition",Object.assign({value:!0},s.PROP_BOOLEAN)],["todaybuttonlabel",Object.assign({value:"LABEL_TODAY_DATE"},s.PROP_STRING)],["clearbuttonlabel",Object.assign({value:"LABEL_CLEAR_DATE"},s.PROP_STRING)]]),I=function(){s.register("wm-datetime",C),s.registerFormWidget(c.FormWidgetType.DATETIME,new Map(C)),s.registerFormWidget(c.FormWidgetType.TIMESTAMP,new Map(C))},D={widgetType:"wm-datetime",hostClass:"app-datetime input-group"},x="CURRENT_DATE",N=O,k=function(e){function t(t,n,i,o,a,r){var l=e.call(this,t,D)||this;return l.ngZone=n,l.cdRef=i,l.appDefaults=o,l.isEnterPressedOnDateInput=!1,l.isTimeOpen=!1,l.isDateOpen=!1,l.isCurrentDate=!1,l._debouncedOnChange=_.debounce(l.invokeOnChange,10),l.registerDestroyListener((function(){return l.clearTimeInterval()})),s.styler(l.nativeElement,l),l.app=a,l.keyEventPlugin=r[1],l.dateContainerCls="app-date-"+l.widgetId,l._dateOptions.containerClass="app-date "+l.dateContainerCls,l._dateOptions.showWeekNumbers=!1,l.datepattern=l.appDefaults.dateTimeFormat||c.getDisplayDateTimeFormat(c.FormWidgetType.DATETIME),l.updateFormat("datepattern"),l}return h(t,e),Object.defineProperty(t.prototype,"timestamp",{get:function(){return this.proxyModel?this.proxyModel.valueOf():void 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dateInputFormat",{get:function(){return this._dateOptions.dateInputFormat||"yyyy-MM-ddTHH:mm:ss"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"displayValue",{get:function(){return c.getFormattedDate(this.datePipe,this.proxyModel,this.dateInputFormat,this.timeZone,this.key,this.isCurrentDate,this)||""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nativeDisplayValue",{get:function(){return c.getFormattedDate(this.datePipe,this.proxyModel,"yyyy-MM-ddTHH:mm:ss",this.timeZone,this.key,this.isCurrentDate,this)||""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"datavalue",{get:function(){return this.isCurrentDate&&!this.proxyModel?x:c.getFormattedDate(this.datePipe,this.proxyModel,this.outputformat,this.timeZone,null,null,this)},set:function(e){e===x?(this.isCurrentDate=!0,this.setTimeInterval()):(this.proxyModel=e?c.getDateObj(e,{isNativePicker:this.loadNativeDateInput},this.timeZone):void 0,this.clearTimeInterval(),this.isCurrentDate=!1),this.bsTimeValue=this.bsDateValue=this.proxyModel,this.cdRef.detectChanges()},enumerable:!1,configurable:!0}),t.prototype.setTimeInterval=function(){var e=this;this.timeinterval||(this.timeinterval=setInterval((function(){var t=e.timeZone?c.getMomentLocaleObject(e.timeZone):new Date;e.onModelUpdate(t)}),1e3))},t.prototype.clearTimeInterval=function(){this.timeinterval&&(clearInterval(this.timeinterval),this.timeinterval=null)},t.prototype.toggleTimePicker=function(e,t){this.loadNativeDateInput?this.onDateTimeInputFocus():(this.isTimeOpen=e,t&&"click"===t.type&&this.invokeEventCallback("click",{$event:t}),this.addTimepickerClickListener(this.isTimeOpen))},t.prototype.addTimepickerClickListener=function(e){var t=this;if(e){var n=document.querySelector("body");setTimeout((function(){var e=$(n).find(">bs-dropdown-container .dropdown-menu").get(0);t.deregisterTimepickeEventListener=c.addEventListenerOnElement(n,e,t.nativeElement,"click",t.isDropDownDisplayEnabledOnInput(t.showdropdownon),(function(){t.toggleTimePicker(!1)}),0,!0)}),350)}},t.prototype.setIsTimeOpen=function(e){this.isTimeOpen=e},t.prototype.hideTimepickerDropdown=function(){this.invokeOnTouched(),this.toggleTimePicker(!1),this.deregisterTimepickeEventListener&&this.deregisterTimepickeEventListener();var e=$(this.nativeElement).closest(".app-composite-widget.caption-floating");e.length>0&&this.app.notify("captionPositionAnimate",{displayVal:this.displayValue,nativeEl:e})},t.prototype.onTimepickerOpen=function(){var e=document.querySelectorAll("timepicker");_.forEach(e,(function(e){c.addClass(e.parentElement,"app-datetime",!0)})),this.bsDatePickerDirective.hide(),this.focusTimePickerPopover(this),this.bindTimePickerKeyboardEvents(),c.adjustContainerPosition($("bs-dropdown-container"),this.nativeElement,this.bsDropdown._dropdown,$("bs-dropdown-container .dropdown-menu")),c.adjustContainerRightEdges($("bs-dropdown-container"),this.nativeElement,this.bsDropdown._dropdown,$("bs-dropdown-container .dropdown-menu"))},t.prototype.onDatePickerOpen=function(){this.isDateOpen=!this.isDateOpen,this.toggleTimePicker(!1),this.$element.find(".model-holder").width("1px"),$("bs-datepicker-container").attr("aria-label","Use Arrow keys to navigate dates, Choose Date from datepicker"),$(".bs-calendar-container").removeAttr("role");var e=$(".bs-datepicker-container")[0];this.focusTrap=s.setFocusTrap(e,!0),this.focusTrap.activate(),this.bsDateValue?this.activeDate=this.bsDateValue:this.activeDate=new Date,this.bsDateValue||this.hightlightToday(),this.addDatepickerKeyboardEvents(this,!0),c.adjustContainerPosition($("bs-datepicker-container"),this.nativeElement,this.bsDatePickerDirective._datepicker)},t.prototype.onModelUpdate=function(e,t){if("date"===t&&(this.invalidDateTimeFormat=!1,c.getFormattedDate(this.datePipe,e,this.dateInputFormat,this.timeZone,this.key,this.isCurrentDate,this)===this.displayValue&&$(this.nativeElement).find(".display-input").val(this.displayValue)),this.minDateMaxDateValidationOnInput(e),!e)return this.bsDateValue&&this.bsTimePicker&&(""===this.bsTimePicker.hours||""===this.bsTimePicker.minutes||""===this.bsTimePicker.seconds)?this.bsDateValue=this.bsTimeValue=this.proxyModel=moment(this.bsDateValue).startOf("day").toDate():this.bsDateValue=this.bsTimeValue=this.proxyModel=void 0,void((e!==this.datavalue||!this.datavalue&&this.prevDatavalue)&&this._debouncedOnChange(this.datavalue,{},!0));"date"===t&&this.isDateOpen&&this.toggleTimePicker(!0),this.proxyModel=e,this.proxyModel&&(this.bsDateValue=this.bsTimeValue=e),this._debouncedOnChange(this.datavalue,{},!0),this.cdRef.detectChanges();var n=$(".bs-timepicker-field");if(this.timeZone&&"datetimestamp"===this.key&&n.length){var i=c.getFormattedDate(this.datePipe,e,this.getTimePattern(),this.timeZone,this.key,null,this);this.updateTimepickerFields(i,n)}},t.prototype.getTimePattern=function(){var e,t=this.datepattern.toLowerCase().indexOf("h"),n=this.datepattern.toLowerCase().indexOf(":ss");(n>-1||(n=this.datepattern.toLowerCase().indexOf(":mm"))>-1)&&(n+=3);var i=this.datepattern.toLowerCase().indexOf("a");return e=this.datepattern.substr(t,n),i>-1&&(e+=" a"),e},t.prototype.updateTimepickerFields=function(e,t){for(var n,i=$("timepicker button.text-center"),o=e.split(" "),a=o[0].split(":"),r=0;r<t.length;r++)t[r].value=a[r];(null===(n=null==i?void 0:i.html())||void 0===n?void 0:n.trim())!==o[1]&&i.text(o[1])},t.prototype.preventTpClose=function(e){e.stopImmediatePropagation()},t.prototype.toggleDpDropdown=function(e,t){void 0===t&&(t=!1),this.loadNativeDateInput?t||this.onDateTimeInputFocus():("click"===e.type&&this.invokeEventCallback("click",{$event:e}),e.target&&$(e.target).is("input")&&!this.isDropDownDisplayEnabledOnInput(this.showdropdownon)?e.stopPropagation():(this.bsDatePickerDirective.toggle(),this.addBodyClickListener(this.bsDatePickerDirective.isOpen)))},t.prototype.addBodyClickListener=function(e){var t=this;if(e){var n=document.querySelector("body");setTimeout((function(){var e=n.querySelector("."+t.dateContainerCls);t.deregisterDatepickerEventListener=c.addEventListenerOnElement(n,e,t.nativeElement,"click",t.isDropDownDisplayEnabledOnInput(t.showdropdownon),(function(){t.bsDatePickerDirective.hide()}),0,!0)}),350)}},t.prototype.hideDatepickerDropdown=function(){var e;this.isDateOpen=!1,null===(e=this.focusTrap)||void 0===e||e.deactivate(),this.invokeOnTouched(),this.bsDatePickerDirective.hide(),this.bsDateValue&&this.toggleTimePicker(!0),this.isEnterPressedOnDateInput=!1,this.deregisterDatepickerEventListener&&this.deregisterDatepickerEventListener();var t=$(this.nativeElement).closest(".app-composite-widget.caption-floating");t.length>0&&this.app.notify("captionPositionAnimate",{displayVal:this.displayValue,nativeEl:t}),this.blurDateInput(this.isDateOpen)},t.prototype.onDateChange=function(e,t){if(this.isEnterPressedOnDateInput)this.isEnterPressedOnDateInput=!1;else{var n=e.target.value.trim();n=n?c.getNativeDateObject(n,{pattern:this.loadNativeDateInput?this.outputformat:this.datepattern,meridians:this.meridians,isNativePicker:this.loadNativeDateInput}):void 0,this.formatValidation(n,e.target.value,t)&&(t&&this.minDateMaxDateValidationOnInput(n,e,this.displayValue,t)||(this.invalidDateTimeFormat=!1,this.onModelUpdate(n)))}},t.prototype.onDisplayKeydown=function(e){if(this.isDropDownDisplayEnabledOnInput(this.showdropdownon)){e.stopPropagation();var t=e.target.value.trim(),n=this.keyEventPlugin.constructor.getEventFullKey(e);if("enter"===n||"arrowdown"===n){t=t?c.getNativeDateObject(t,{pattern:this.loadNativeDateInput?this.outputformat:this.datepattern,meridians:this.meridians}):void 0,e.preventDefault();var i=c.getFormattedDate(this.datePipe,t,this.dateInputFormat,this.timeZone,this.key,this.isCurrentDate,this),o=e.target.value.trim();o&&"timestamp"===this.datepattern?_.isNaN(o)||_.parseInt(o)===i||(this.invalidDateTimeFormat=!0,this.invokeOnChange(this.datavalue,e,!1)):o&&o!==i?(this.invalidDateTimeFormat=!0,this.invokeOnChange(this.datavalue,e,!1)):(this.invalidDateTimeFormat=!1,this.isEnterPressedOnDateInput=!0,this.bsDatePickerDirective.bsValue=t),this.toggleDpDropdown(e)}else this.hideDatepickerDropdown(),this.hideTimepickerDropdown()}else this.hideDatepickerDropdown(),this.hideTimepickerDropdown()},t.prototype.isValid=function(e){if(!e){var t=$(this.nativeElement).find("input").val(),n=c.getNativeDateObject(t,{pattern:this.loadNativeDateInput?this.outputformat:this.datepattern,meridians:this.meridians,isNativePicker:this.loadNativeDateInput});if(!this.formatValidation(n,t))return}},t.prototype.handleEvent=function(t,n,i,o){_.includes(["blur","focus","change","click"],n)||e.prototype.handleEvent.call(this,t,n,i,o)},t.prototype.onInputBlur=function(e){$(e.relatedTarget).hasClass("current-date")||(this.invokeOnTouched(),this.invokeEventCallback("blur",{$event:e}))},t}(E);k.initializeProps=I(),k.decorators=[{type:t.Component,args:[{selector:"[wmDateTime]",template:' <div dropdown\n [isOpen]="isTimeOpen"\n autoClose="false"\n [container]="\'body\'"\n (onShown)="onTimepickerOpen()"\n style="display: inherit;">\n <input class="form-control app-textbox display-input"\n [attr.aria-label]="hint"\n focus-target\n [name]="name"\n [tabindex]="loadNativeDateInput ? \'-1\' : tabindex"\n [attr.aria-hidden]="!!loadNativeDateInput"\n type="text"\n [value]="displayValue"\n (click)="toggleDpDropdown($event, true)"\n (focus)="onDateTimeInputFocus(); invokeOnFocus($event);"\n (blur)="onInputBlur($event)"\n (change)="onDateChange($event)"\n [autofocus]="autofocus"\n [disabled]="disabled || readonly || isCurrentDate"\n [required]="required"\n [readOnly]="isReadOnly"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n (keydown)="this._triggeredByUser = true; onDisplayKeydown($event)">\n\n <span class="input-group-btn">\n <button type="button"\n class="btn btn-default btn-date"\n [tabindex]="loadNativeDateInput ? \'-1\' : tabindex"\n [attr.aria-hidden]="!!loadNativeDateInput"\n [disabled]="disabled || readonly || isCurrentDate"\n [attr.aria-label]="displayValue ? \'Change Date \' + displayValue : \'Choose date by pressing enter\'"\n aria-haspopup="true"\n aria-expanded="false"\n (click)="toggleDpDropdown($event, false)">\n <i aria-hidden="true"\n class="app-icon wm-sl-l sl-calendar"></i>\n </button>\n <button type="button"\n class="btn btn-default btn-time"\n [tabindex]="loadNativeDateInput ? \'-1\' : tabindex"\n [attr.aria-hidden]="!!loadNativeDateInput"\n [disabled]="disabled || readonly || isCurrentDate"\n aria-label="Select time"\n aria-haspopup="true"\n aria-expanded="false"\n (click)="toggleTimePicker(!isTimeOpen, $event)">\n <i aria-hidden="true"\n class="app-icon wm-sl-l sl-time"></i>\n </button>\n </span>\n <div style="width: 0;display: inline-block;">\n <input class="model-holder"\n aria-label="datepicker dropdownmenu"\n aria-controls="date"\n focus-target\n [tabindex]="-1"\n [attr.aria-hidden]="!!loadNativeDateInput"\n [container]="containerTarget || \'body\'"\n [bsConfig]="_dateOptions"\n [isOpen]="isDateOpen"\n placement="bottom right"\n (onShown)="onDatePickerOpen()"\n (onHidden)="hideDatepickerDropdown()"\n [daysDisabled]="excludedDaysToDisable"\n [datesDisabled]="excludedDatesToDisable"\n #datepicker=bsDatepicker\n bsDatepicker\n [isDisabled]="disabled || readonly || isCurrentDate"\n [bsValue]="bsDateValue"\n (bsValueChange)="onModelUpdate($event, \'date\')">\n </div>\n <div *dropdownMenu\n class="dropdown-menu"\n aria-label="timepicker dropdown"\n aria-controls="time"\n (click)="preventTpClose($event)">\n <timepicker class="model-holder"\n [showMeridian]="ismeridian"\n [readonlyInput]="disabled || readonly || isCurrentDate"\n [(ngModel)]="bsTimeValue"\n [min]="minTime"\n [max]="maxTime"\n [hourStep]="hourstep"\n [minuteStep]="minutestep"\n [secondsStep]="secondsstep"\n [mousewheel]="true"\n [arrowkeys]="true"\n (isValid)="isValid($event)"\n [showSeconds]="showseconds"\n (ngModelChange)="onModelUpdate($event, \'time\')"></timepicker>\n </div>\n </div>\n<ng-template [ngIf]="loadNativeDateInput">\n <wm-datetimepicker\n dateTimePicker\n [config]="_dateOptions"\n [placement]="modal"\n [excludedDaysToDisable]="excludedDaysToDisable"\n [excludedDatesToDisable]="excludedDatesToDisable"\n [displayFormat]="dateInputFormat"\n [value]="bsDateValue"\n (change)="onModelUpdate($event, \'date\')">\n </wm-datetimepicker>\n <div class="mobile-input mobile-datepicker-container"\n [tabindex]="tabindex || 0"\n (focus)="onDateTimeInputFocus(true); invokeOnFocus($event)"\n (blur)="onDateTimeInputBlur(); invokeOnTouched($event)"\n (click)="!(disabled || readonly || isCurrentDate) && showDatePickerModal()">\n </div>\n</ng-template>\n',providers:[s.provideAs(k,i.NG_VALUE_ACCESSOR,!0),s.provideAs(k,i.NG_VALIDATORS,!0),s.provideAsWidgetRef(k),{provide:r.TimepickerConfig,deps:[c.AbstractI18nService],useFactory:N}]}]}],k.ctorParameters=function(){return[{type:t.Injector},{type:t.NgZone},{type:t.ChangeDetectorRef},{type:c.AppDefaults},{type:c.App},{type:void 0,decorators:[{type:t.Inject,args:[l.EVENT_MANAGER_PLUGINS]}]}]},k.propDecorators={bsDatePickerDirective:[{type:t.ViewChild,args:[o.BsDatepickerDirective]}]};var M=new Map([["autofocus",s.PROP_BOOLEAN],["class",s.PROP_STRING],["dataentrymode",Object.assign({value:"default"},s.PROP_STRING)],["datavaluesource",s.PROP_ANY],["datavalue",s.PROP_STRING],["disabled",s.PROP_BOOLEAN],["hint",s.PROP_STRING],["hourstep",Object.assign({value:1},s.PROP_NUMBER)],["maxtime",s.PROP_STRING],["mintime",s.PROP_STRING],["minutestep",Object.assign({value:15},s.PROP_NUMBER)],["name",s.PROP_STRING],["outputformat",Object.assign({value:"HH:mm:ss"},s.PROP_STRING)],["placeholder",Object.assign({value:"Select time"},s.PROP_STRING)],["readonly",s.PROP_BOOLEAN],["required",s.PROP_BOOLEAN],["shortcutkey",s.PROP_STRING],["show",Object.assign({value:!0},s.PROP_BOOLEAN)],["showdropdownon",Object.assign({value:"default"},s.PROP_STRING)],["showcustompicker",Object.assign({value:!1},s.PROP_BOOLEAN)],["secondsstep",Object.assign({value:1},s.PROP_NUMBER)],["tabindex",Object.assign({value:0},s.PROP_NUMBER)],["timepattern",s.PROP_STRING],["timestamp",s.PROP_STRING]]),L=function(){s.register("wm-time",M),s.registerFormWidget(c.FormWidgetType.TIME,new Map(M))},F="CURRENT_TIME",j={widgetType:"wm-time",hostClass:"input-group app-timeinput"},B=O,G=function(e){function t(t,n,i,o,a){var r=e.call(this,t,j)||this;return r.ngZone=n,r.appDefaults=i,r.status={isopen:!1},r.keyEventPlugin=a[1],s.styler(r.nativeElement,r),r.registerDestroyListener((function(){return r.clearTimeInterval()})),r.timepattern=r.appDefaults.timeFormat||c.getDisplayDateTimeFormat(c.FormWidgetType.TIME),r.updateFormat("timepattern"),r.app=o,r}return h(t,e),Object.defineProperty(t.prototype,"timestamp",{get:function(){return this.bsTimeValue?this.bsTimeValue.valueOf():void 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"datavalue",{get:function(){return this.isCurrentTime&&!this.bsTimeValue?F:c.getFormattedDate(this.datePipe,this.bsTimeValue,this.outputformat,this.timeZone,null,null,this)||""},set:function(e){e?e===F?(this.isCurrentTime=!0,this.setTimeInterval()):(this.clearTimeInterval(),this.bsTimeValue=c.getNativeDateObject(e,{pattern:this.loadNativeDateInput?this.outputformat:void 0,isNativePicker:this.loadNativeDateInput}),this.isCurrentTime=!1,this.mintimeMaxtimeValidation()):(this.bsTimeValue=void 0,this.clearTimeInterval(),this.isCurrentTime=!1),this.invokeOnChange(this.datavalue),c.$appDigest()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"displayValue",{get:function(){return c.getFormattedDate(this.datePipe,this.bsTimeValue,this.timepattern,this.timeZone,null,null,this)||""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nativeDisplayValue",{get:function(){return c.getFormattedDate(this.datePipe,this.bsTimeValue,"HH:mm:ss",this.timeZone,null,null,this)||""},enumerable:!1,configurable:!0}),t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("timepattern"===t&&this.updateFormat("timepattern"),"mintime"===t?(this.minTime=c.getNativeDateObject(n,{pattern:this.loadNativeDateInput?this.outputformat:void 0,isNativePicker:this.loadNativeDateInput}),this.mintimeMaxtimeValidation()):"maxtime"===t?(this.maxTime=c.getNativeDateObject(n,{pattern:this.loadNativeDateInput?this.outputformat:void 0,isNativePicker:this.loadNativeDateInput}),this.mintimeMaxtimeValidation()):e.prototype.onPropertyChange.call(this,t,n,i))},t.prototype.setValidateType=function(e,t,n){this.timeNotInRange&&(n<e?this.validateType="mintime":n>t&&(this.validateType="maxtime"))},t.prototype.mintimeMaxtimeValidation=function(){this.timeNotInRange=this.minTime&&this.maxTime&&(this.bsTimeValue<this.minTime||this.bsTimeValue>this.maxTime),this.setValidateType(this.minTime,this.maxTime,this.bsTimeValue),this.invokeOnChange(this.datavalue,void 0,!1)},t.prototype.toggleDropdown=function(e,t){var n=this;void 0===t&&(t=!1),this.loadNativeDateInput?t||this.onDateTimeInputFocus():("click"===e.type&&this.invokeEventCallback("click",{$event:e}),e.target&&$(e.target).is("input")&&!this.isDropDownDisplayEnabledOnInput(this.showdropdownon)||(this.ngZone.run((function(){n.status.isopen=!n.status.isopen})),this.addBodyClickListener(this.status.isopen)))},t.prototype.preventTpClose=function(e){e.stopImmediatePropagation();var t=$(this.nativeElement).closest(".app-composite-widget.caption-floating");t.length>0&&this.app.notify("captionPositionAnimate",{displayVal:this.displayValue,nativeEl:t})},t.prototype.addBodyClickListener=function(e){var t=this;if(e){var n=document.querySelector("body");setTimeout((function(){var e=$(n).find(">bs-dropdown-container .dropdown-menu").get(0);t.deregisterEventListener=c.addEventListenerOnElement(n,e,t.nativeElement,"click",t.isDropDownDisplayEnabledOnInput(t.showdropdownon),(function(){t.status.isopen=!1}),0,!0)}),350)}},t.prototype.onDisplayKeydown=function(e){if(this.isDropDownDisplayEnabledOnInput(this.showdropdownon)){e.stopPropagation();var t=this.keyEventPlugin.constructor.getEventFullKey(e);"enter"===t||"arrowdown"===t?(e.preventDefault(),this.toggleDropdown(e)):this.hideTimepickerDropdown()}else this.hideTimepickerDropdown()},t.prototype.onDisplayTimeChange=function(e){var t=c.getNativeDateObject(e.target.value,{meridians:this.meridians,pattern:this.loadNativeDateInput?this.outputformat:void 0,isNativePicker:this.loadNativeDateInput});this.formatValidation(t,e.target.value)&&(this.invalidDateTimeFormat=!1,this.onTimeChange(t))},t.prototype.onInputBlur=function(e){$(e.relatedTarget).hasClass("bs-timepicker-field")||(this.invokeOnTouched(),this.invokeEventCallback("blur",{$event:e}))},t.prototype.onTimeChange=function(e,t){var n,i,o;t&&(e=c.getNativeDateObject(e.target.value,{pattern:this.loadNativeDateInput?this.outputformat:void 0,isNativePicker:this.loadNativeDateInput})),e?(this.bsTimeValue=e,this.timeNotInRange=this.minTime&&this.maxTime&&(e<this.minTime||e>this.maxTime),this.setValidateType(this.minTime,this.maxTime,e)):(this.bsTimePicker&&this.bsTimePicker.min&&this.bsTimePicker.max&&(o=moment(new Date(this.bsTimePicker.min)).format("A"),moment(new Date(this.bsTimePicker.max)).format("A"),n=this.bsTimePicker.hours+":"+(this.bsTimePicker.minutes||0)+":"+(this.bsTimePicker.seconds||0)+(this.bsTimePicker.showMeridian?" "+o:""),i=c.getNativeDateObject(n,{pattern:this.loadNativeDateInput?this.outputformat:void 0,isNativePicker:this.loadNativeDateInput}),this.bsTimePicker.meridian=o,this.timeNotInRange=this.bsTimePicker.min>i||this.bsTimePicker.max<i,this.setValidateType(this.bsTimePicker.min,this.bsTimePicker.max,i)),this.bsTimeValue=i),this.invokeOnTouched(),this.invokeOnChange(this.datavalue,{},!0)},t.prototype.setTimeInterval=function(){var e=this;this.timeinterval||(this.timeinterval=setInterval((function(){var t=e.timeZone?c.getMomentLocaleObject(e.timeZone):new Date;t.setSeconds(t.getSeconds()+1),e.datavalue=F,e.onTimeChange(t)}),1e3))},t.prototype.clearTimeInterval=function(){this.timeinterval&&(clearInterval(this.timeinterval),this.timeinterval=null)},t.prototype.setIsTimeOpen=function(e){this.status.isopen=e},t.prototype.handleEvent=function(t,n,i,o){_.includes(["blur","focus","change","click"],n)||e.prototype.handleEvent.call(this,t,n,i,o)},t.prototype.hideTimepickerDropdown=function(){this.invokeOnTouched(),this.status.isopen=!1,this.deregisterEventListener&&this.deregisterEventListener(),this.removeKeyupListener();var e=$(this.nativeElement).closest(".app-composite-widget.caption-floating");e.length>0&&this.app.notify("captionPositionAnimate",{displayVal:this.displayValue,nativeEl:e}),this.blurDateInput(!0)},t.prototype.isValid=function(e){if(!e){var t=$(this.nativeElement).find("input").val(),n=c.getNativeDateObject(t,{meridians:this.meridians,pattern:this.loadNativeDateInput?this.outputformat:void 0,isNativePicker:this.loadNativeDateInput});if(!this.formatValidation(n,t))return}},t.prototype.onShown=function(){var e=document.querySelectorAll("timepicker");_.forEach(e,(function(e){c.addClass(e.parentElement,"app-datetime",!0)})),this.focusTimePickerPopover(this),this.bindTimePickerKeyboardEvents(),c.adjustContainerPosition($("bs-dropdown-container"),this.nativeElement,this.bsDropdown._dropdown,$("bs-dropdown-container .dropdown-menu"))},t.prototype.assignModel=function(){this.displayInputElem||(this.displayInputElem=this.getMobileInput()),this.displayInputElem.value=_.get(this,"nativeDisplayValue")},t}(E);G.initializeProps=L(),G.decorators=[{type:t.Component,args:[{selector:"[wmTime]",template:' <div dropdown [isOpen]="status.isopen" (onShown)="onShown()" (onHidden)="hideTimepickerDropdown()" [container]="\'body\'" style="display: inherit">\n <input class="form-control app-textbox display-input" [attr.aria-label]="hint"\n focus-target\n [tabindex]="tabindex"\n [name]="name"\n type="text"\n role="timer"\n [value]="displayValue"\n [disabled]="disabled || readonly || isCurrentTime"\n [autofocus]="autofocus"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-atomic]="isCurrentTime ? \'true\' : \'false\'"\n [required]="required"\n [readOnly]="isReadOnly"\n (click)="toggleDropdown($event, true)"\n (focus)="onDateTimeInputFocus(); invokeOnFocus($event);"\n (blur)="onInputBlur($event)"\n (change)="onDisplayTimeChange($event)"\n (keydown)="this._triggeredByUser = true; onDisplayKeydown($event)">\n <span class="input-group-btn dropdown-toggle">\n <button type="button" class="btn btn-default btn-date" [tabindex]="tabindex" [disabled]="disabled || readonly || isCurrentTime" aria-label="Select time" aria-haspopup="true" aria-expanded="false" (click)="toggleDropdown($event, false)"><i aria-hidden="true" class="app-icon wm-sl-l sl-time"></i></button>\n </span>\n <div *dropdownMenu class="dropdown-menu" (click)="preventTpClose($event)">\n <timepicker class="model-holder"\n [showMeridian]="ismeridian"\n [readonlyInput]="isDisabled"\n [(ngModel)]="bsTimeValue"\n [disabled]="disabled || readonly || isCurrentTime"\n [min]="minTime"\n [max]="maxTime"\n [hourStep]="hourstep"\n [minuteStep]="minutestep"\n [secondsStep]="secondsstep"\n [mousewheel]="true"\n [arrowkeys]="true"\n (isValid)="isValid($event)"\n [showSeconds]="showseconds" (ngModelChange)="onTimeChange($event)"></timepicker>\n </div>\n </div>\n<ng-template [ngIf]="loadNativeDateInput">\n <wm-datetimepicker\n dateTimePicker\n mode="TIME"\n [minTime]="minTime"\n [maxTime]="maxTime"\n [placement]="modal"\n [displayFormat]="timepattern"\n [value]="bsTimeValue"\n (change)="onTimeChange($event)">\n </wm-datetimepicker>\n <div class="mobile-input mobile-datepicker-container"\n tabindex="1000000"\n (focus)="onDateTimeInputFocus(true); invokeOnFocus($event); assignModel()"\n (blur)="onDateTimeInputBlur(); invokeOnTouched($event)"\n (click)="!(disabled || readonly || isCurrentTime) && showDatePickerModal()">\n </div>\n</ng-template>\n',providers:[s.provideAs(G,i.NG_VALUE_ACCESSOR,!0),s.provideAs(G,i.NG_VALIDATORS,!0),s.provideAsWidgetRef(G),{provide:r.TimepickerConfig,deps:[c.AbstractI18nService],useFactory:B}]}]}],G.ctorParameters=function(){return[{type:t.Injector},{type:t.NgZone},{type:c.AppDefaults},{type:c.App},{type:void 0,decorators:[{type:t.Inject,args:[l.EVENT_MANAGER_PLUGINS]}]}]};var V=function(){};V.decorators=[{type:t.Component,args:[{selector:"wm-pickergroup",template:'\n <div class="app-picker-group">\n <ng-content></ng-content>\n </div>\n '}]}];var W=function(){function e(e){this.inj=e,this.change=new t.EventEmitter,this._selectedIndex=0,this._options=[],this.noOfEmptyElements=2,this.$el=$(e.get(t.ElementRef).nativeElement)}return Object.defineProperty(e.prototype,"selectedValue",{get:function(){return this._selectedValue},set:function(e){this._selectedValue=e,this.reRender()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return this._options},set:function(e){this._options=e.map((function(e){return{label:e.label,value:void 0!==e.value?e.value:e.label}})),this.reRender()},enumerable:!1,configurable:!0}),e.prototype.reRender=function(){var e,t=this;this._selectedIndex=this.options.findIndex((function(e){return e.value===t.selectedValue})),null===(e=this.pickerAnimator)||void 0===e||e.select(this._selectedIndex+this.noOfEmptyElements)},Object.defineProperty(e.prototype,"selectedIndex",{get:function(){return this._selectedIndex},set:function(e){this._selectedIndex=e,this._selectedValue=this.options[e].value,this.change.emit(this.options[e])},enumerable:!1,configurable:!0}),e.prototype.ngAfterViewInit=function(){this.pickerAnimator=new U(this)},e}();W.decorators=[{type:t.Component,args:[{selector:"wm-picker",template:'\n <div class="app-picker">\n <div class="app-picker-option-container">\n <div class="app-picker-option app-picker-empty-option">E</div>\n <div class="app-picker-option app-picker-empty-option">E</div>\n <div *ngFor="let option of options; index as i;" class="app-picker-option">\n {{option.label}}\n </div>\n <div class="app-picker-option app-picker-empty-option">E</div>\n <div class="app-picker-option app-picker-empty-option">E</div>\n </div>\n <div class="app-picker-ruler"></div>\n </div>\n '}]}],W.ctorParameters=function(){return[{type:t.Injector}]},W.propDecorators={change:[{type:t.Output}],selectedValue:[{type:t.Input}],options:[{type:t.Input}]};var U=function(){function e(e){var t=this;this.picker=e;var n=e.selectedIndex+e.noOfEmptyElements,i=function(e){return n+Math.floor(e/16)};this.select(n),this.getElement().swipey({direction:$.fn.swipey.DIRECTIONS.VERTICAL,threshold:10,target:e.$el,onSwipe:function(e,n){t.select(i(-1*n.length))},onSwipeEnd:function(o,a){var r=i(-1*a.length);t.select(r),n=e.selectedIndex+e.noOfEmptyElements}})}return e.prototype.getElement=function(){return this.picker.$el.find(".app-picker-option-container:first")},e.prototype.getOptionElements=function(){return this.getElement().find(".app-picker-option")},e.prototype.select=function(e){var t=this.getOptionElements();if(!(e<this.picker.noOfEmptyElements||e>=t.length-this.picker.noOfEmptyElements)){this.getElement().find(".app-picker-option.app-picker-option-selected").removeClass("app-picker-option-selected"),t.eq(e).addClass("app-picker-option-selected"),this.picker.selectedIndex=e-this.picker.noOfEmptyElements;var n=e-this.picker.noOfEmptyElements,i=e+this.picker.noOfEmptyElements;t.each((function(t,o){if(t>=n&&t<=i){var a=30*(t-e),r=1-.3*Math.abs(t-e);$(o).css({transform:"perspective(500px) rotateX("+a+"deg)",opacity:r}).show()}else $(o).hide()}))}},e}(),q=[S,k,G,g,v,W,V],z=function(){};z.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,o.BsDatepickerModule,a.BsDropdownModule,i.FormsModule,r.TimepickerModule,s.WmComponentsModule],declarations:f([],m(q)),exports:f([],m(q)),entryComponents:[]}]}],e.DateComponent=S,e.DatetimeComponent=k,e.EpochModule=z,e.TimeComponent=G,e["\u02750"]=N,e["\u0275a"]=O,e["\u0275b"]=E,e["\u0275c"]=g,e["\u0275d"]=v,e["\u0275e"]=A,e["\u0275f"]=I,e["\u0275g"]=L,e["\u0275h"]=V,e["\u0275i"]=W,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"),require("@wm/core")):"function"==typeof define&&define.amd?define("@wm/components/input/file-upload",["exports","@angular/core","@angular/common","@wm/components/base","rxjs","@wm/core"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.input=e.wm.components.input||{},e.wm.components.input.fileupload={}),e.ng.core,e.ng.common,e.wm.components.base,e.rxjs,e.wm.core)}(this,(function(e,t,n,i,o,a){"use strict";
|
|
197
|
+
***************************************************************************** */var u=function(e,t){return(u=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 h(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}u(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}Object.create;function m(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 f(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 g=function(){function e(e,n){this.inj=e,this.bsModalService=n,this.isDateOpen=!0,this.isTimeOpen=!1,this.mode="DATE_TIME",this.placement="MODAL",this.change=new t.EventEmitter,this._value=new Date,this.changedValue=null,this.appLocale=e.get(c.App).appLocale||{}}return Object.defineProperty(e.prototype,"value",{set:function(e){e=e||new Date,this._value=e,this.changedValue=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bsDatepickerConfig",{get:function(){return this._bsDatepickerConfig},set:function(e){this._bsDatepickerConfig=e,this._bsDatepickerConfig.showClearButton=!1,this._bsDatepickerConfig.showTodayButton=!1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"excludedDaysToDisable",{set:function(e){this._bsDatepickerConfig.daysDisabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"displayFormat",{get:function(){if(this._displayFormat)return this._displayFormat},set:function(e){e&&(this._displayFormat=e.replace(/y/g,"Y").replace(/d/g,"D").replace("a","A"))},enumerable:!1,configurable:!0}),e.prototype.validateSelectedDate=function(){var e,t,n,i,o;if(!this.changedValue)return!0;var a=moment(this.changedValue),r=null===(e=this._bsDatepickerConfig)||void 0===e?void 0:e.minDate,s=null===(t=this._bsDatepickerConfig)||void 0===t?void 0:t.maxDate;if(r&&("DATE"===this.mode&&moment(r).startOf("day").toDate()>this.changedValue||"DATE"!==this.mode&&r>this.changedValue))return!1;if(s&&("DATE"===this.mode&&moment(s).endOf("day").toDate()<this.changedValue||"DATE"!==this.mode&&s<this.changedValue))return!1;if((null===(i=null===(n=this._bsDatepickerConfig)||void 0===n?void 0:n.daysDisabled)||void 0===i?void 0:i.indexOf(a.day()))>=0)return!1;var l=a.startOf("day").toDate().getTime();return!(null===(o=this.excludedDatesToDisable)||void 0===o?void 0:o.find((function(e){return e.getTime()===l})))},e.prototype.hightlightToday=function(){var e=(new Date).getDate().toString();_.filter($("body>modal-container .date-picker-modal span:contains("+e+")").not(".is-other-month,.current-date"),(function(t){$(t).text()===e&&$(t).addClass("current-date text-info")}))},e.prototype.hideOnClick=function(){var e=this;$("body>modal-container .date-picker-modal .app-datetime-picker").click((function(e){return e.stopPropagation()})),$("body>modal-container .date-picker-modal").click((function(){return e.onCancelClick()}))},e.prototype.getDateLabel=function(){return moment(this.changedValue).format(this.displayFormat)},e.prototype.openDatePicker=function(){this.isTimeOpen=!1,this.isDateOpen=!0},e.prototype.openTimePicker=function(){this.isTimeOpen=!0,this.isDateOpen=!1},e.prototype.onDateUpdate=function(e){var t=this.changedValue;"DATE"===this.mode?(e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0)):t&&e&&(e.setHours(t.getHours()),e.setMinutes(t.getMinutes()),e.setSeconds(t.getSeconds()),e.setMilliseconds(t.getMilliseconds())),this.changedValue=e,"DATE"===this.mode&&t!==e&&this.validateSelectedDate()&&this.onOkClick()},e.prototype.onTimeUpdate=function(e){this.changedValue=e},e.prototype.show=function(){var e=this;this.reset(),this.modalRef=this.bsModalService.show(this.datetimepickerTemplate,{animated:!0,backdrop:"static",class:"date-picker-modal modal-dialog-centered"}),setTimeout((function(){e.hideOnClick()}),500)},e.prototype.clear=function(){this.changedValue=null,this.triggerChange(),this.hideModal()},e.prototype.setToday=function(){var e=moment().startOf("day").toDate();this.onDateUpdate(e)},e.prototype.reset=function(){this.changedValue=this._value},e.prototype.hideModal=function(){var e;(null===(e=this.modalRef)||void 0===e?void 0:e.id)&&this.bsModalService.hide(this.modalRef.id)},e.prototype.onCancelClick=function(){this.changedValue=this._value,this.hideModal()},e.prototype.onOkClick=function(){this.validateSelectedDate()&&this.triggerChange(),this.hideModal()},e.prototype.triggerChange=function(){this.value!==this.changedValue&&this.change.emit(this.changedValue)},e.prototype.ngAfterViewInit=function(){},e.prototype.ngOnDestroy=function(){this.hideModal()},e}();g.decorators=[{type:t.Component,args:[{selector:"wm-datetimepicker",template:'\n <ng-template #datetimepickerTemplate>\n <div class="app-datetime-picker">\n <div class="modal-body">\n <div class="mobile-datetime-picker-options">\n\n </div>\n <bs-datepicker-inline\n [bsConfig]="bsDatepickerConfig"\n [datesDisabled]="excludedDatesToDisable"\n bsDatepicker\n [bsValue]="changedValue"\n (bsValueChange)="onDateUpdate($event)"\n *ngIf="mode === \'DATE_TIME\' || mode === \'DATE\'">\n </bs-datepicker-inline>\n <wm-timepicker\n [value]="changedValue"\n [min]="minTime"\n [max]="maxTime"\n (change)="onTimeUpdate($event)"\n *ngIf="mode === \'DATE_TIME\' || mode === \'TIME\'"></wm-timepicker>\n <span class="text-primary date-picker-value">\n {{getDateLabel()}}\n </span>\n </div>\n <div class="modal-footer">\n <button\n *ngIf="mode === \'DATE_TIME\' || mode === \'DATE\'"\n class="btn btn-secondary today-btn"\n (click)="setToday()">{{appLocale.LABEL_TODAY_DATE || "Today" }}</button>\n <button\n class="btn btn-primary pull-right ok-btn"\n *ngIf="mode === \'DATE_TIME\' || mode === \'TIME\'"\n (click)="onOkClick()">{{appLocale.LABEL_OK || "Ok" }}</button>\n <button\n class="btn btn-secondary pull-right clear-btn"\n (click)="clear()">{{appLocale.LABEL_CLEAR_DATE || "Clear" }}</button>\n </div>\n </div>\n </ng-template>\n '}]}],g.ctorParameters=function(){return[{type:t.Injector},{type:d.BsModalService}]},g.propDecorators={datetimepickerTemplate:[{type:t.ViewChild,args:["datetimepickerTemplate",{static:!0}]}],mode:[{type:t.Input}],placement:[{type:t.Input}],_bsDatepickerConfig:[{type:t.Input,args:["config"]}],minTime:[{type:t.Input}],maxTime:[{type:t.Input}],_displayFormat:[{type:t.Input}],change:[{type:t.Output}],excludedDatesToDisable:[{type:t.Input}],value:[{type:t.Input}],bsDatepickerConfig:[{type:t.Input,args:["config"]}],excludedDaysToDisable:[{type:t.Input}],displayFormat:[{type:t.Input}]};var v=function(){function e(e){this.inj=e,this.options={hour:[],minute:[],second:[],meridian:["AM","PM"]},this.value=new Date,this.min=null,this.max=null,this.change=new t.EventEmitter,this.options.hour=this.populateNumbers(0,23),this.options.minute=this.populateNumbers(0,59),this.options.second=this.populateNumbers(0,59)}return e.prototype.populateNumbers=function(e,t){for(var n=[],i=e;i<=t;i++)n.push({label:(i<10?"0":"")+i,value:i});return n},e.prototype.set=function(e,t){e.index;var n=e.value;"HOUR"===t?this.value=moment(this.value).hour(parseInt(n)).toDate():"MINUTE"===t?this.value=moment(this.value).minute(parseInt(n)).toDate():"SECOND"===t?this.value=moment(this.value).second(parseInt(n)).toDate():"MERIDIAN"===t&&(this.value=moment(this.value).minute(n).toDate()),this.min&&this.value<this.min&&(this.value=this.min),this.max&&this.value>this.max&&(this.value=this.max),this.change.emit(this.value)},Object.defineProperty(e.prototype,"hour",{get:function(){return moment(this.value).hour()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minute",{get:function(){return moment(this.value).minute()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"second",{get:function(){return moment(this.value).second()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"meridian",{get:function(){return"AM"},enumerable:!1,configurable:!0}),e.prototype.onDateUpdate=function(e){},e.prototype.ngAfterViewInit=function(){},e}();v.decorators=[{type:t.Component,args:[{selector:"wm-timepicker",template:'\n <wm-pickergroup>\n <wm-picker\n [options]="options.hour"\n [selectedValue]="hour"\n (change)="set($event, \'HOUR\')"></wm-picker>\n <span class="app-time-separator">:</span>\n <wm-picker\n [options]="options.minute"\n [selectedValue]="minute"\n (change)="set($event, \'MINUTE\')"></wm-picker>\n <span class="app-time-separator">:</span>\n <wm-picker\n [options]="options.minute"\n [selectedValue]="second"\n (change)="set($event, \'SECOND\')"></wm-picker>\n </wm-pickergroup>\n '}]}],v.ctorParameters=function(){return[{type:t.Injector}]},v.propDecorators={value:[{type:t.Input}],min:[{type:t.Input}],max:[{type:t.Input}],change:[{type:t.Output}]};var y="CURRENT_DATE",b=["January","February","March","April","May","June","July","August","September","October","November","December"],w="default",P="default";function O(e){return Object.assign(new r.TimepickerConfig,{meridians:n.getLocaleDayPeriods(e.getSelectedLocale(),n.FormStyle.Format,n.TranslationWidth.Abbreviated)})}var E=function(e){function t(t,i){var a=e.call(this,t,i)||this;return a.isReadOnly=!1,a.clicked=!1,a.formatsByLocale={timezone:""},a._dateOptions=new o.BsDatepickerConfig,a.i18nService=a.inj.get(c.AbstractI18nService),a.invokeEventCallback("beforeload"),a.datePipe=a.inj.get(s.ToDatePipe),a.selectedLocale=a.i18nService.getSelectedLocale(),a._dateOptions.todayPosition="left",a._dateOptions.clearPosition="right",a.meridians=n.getLocaleDayPeriods(a.selectedLocale,n.FormStyle.Format,n.TranslationWidth.Abbreviated),a.loadNativeDateInput=c.isMobile()&&!a.showcustompicker,a.cancelLocaleChangeSubscription=a.getAppInstance().subscribe("locale-changed",(function(e){a.datePipe.datePipe.locale=e.angular,a._dateOptions.todayButtonLabel=a.i18nService.getLocalizedMessage("LABEL_TODAY_DATE"),a._dateOptions.clearButtonLabel=a.i18nService.getLocalizedMessage("LABEL_CLEAR_DATE")})),a}return h(t,e),Object.defineProperty(t.prototype,"timeZone",{get:function(){return this.inj.get(c.AbstractI18nService).getTimezone(this)},enumerable:!1,configurable:!0}),t.prototype.isDropDownDisplayEnabledOnInput=function(e){return e===w},t.prototype.isDataEntryModeEnabledOnInput=function(e){return e===P},t.prototype.showValidation=function(e,t,n,i){if(n)return console.warn("min max date validation failed ",i),$(e.target).val(t)},t.prototype.resetDisplayInput=function(){$(this.nativeElement).find(".display-input").val("")},t.prototype.validate=function(e){return this.invalidDateTimeFormat?{invalidDateTimeFormat:{valid:!1}}:!_.isUndefined(this.dateNotInRange)&&this.dateNotInRange?{dateNotInRange:{valid:!1}}:!_.isUndefined(this.timeNotInRange)&&this.timeNotInRange?{timeNotInRange:{valid:!1}}:this.show&&this.required?e.value?null:{required:!0}:(this.validateType="",null)},t.prototype.formatValidation=function(e,t,n){var i=this.datepattern||this.timepattern,o=this.timeZone,a=c.getFormattedDate(this.datePipe,e,i,o,null,null,this);if(t=t.trim())if("timestamp"===i){if(!_.isNaN(t)&&_.parseInt(t)!==a)return this.invalidDateTimeFormat=!0,this.validateType="incorrectformat",this.invokeOnChange(this.datavalue,void 0,!1),!1}else if(n&&(t=c.getFormattedDate(this.datePipe,t,i,o)),t!==a)return this.invalidDateTimeFormat=!0,this.validateType="incorrectformat",this.invokeOnChange(this.datavalue,void 0,!1),!1;return!0},t.prototype.minDateMaxDateValidationOnInput=function(e,t,n,i){var o=this;if(e){var a=e;e=moment(e).startOf("day").toDate();var r=moment(c.getDateObj(this.mindate)).startOf("day").toDate(),s=moment(c.getDateObj(this.maxdate)).startOf("day").toDate();if(this.mindate&&e<r){var l=this.appLocale.LABEL_MINDATE_VALIDATION_MESSAGE+" "+this.mindate+".";return this.invokeOnChange(this.datavalue,void 0,!1),i&&c.getFormattedDate(this.datePipe,r,this.datepattern,this.timeZone,null,null,this)===n?$(t.target).val(n):(this.dateNotInRange=!0,this.validateType="mindate",this.showValidation(t,n,i,l))}if(this.maxdate&&e>s){l=this.appLocale.LABEL_MAXDATE_VALIDATION_MESSAGE+" "+this.maxdate+".";return this.invokeOnChange(this.datavalue,void 0,!1),i&&c.getFormattedDate(this.datePipe,s,this.datepattern,this.timeZone,null,null,this)===n?$(t.target).val(n):(this.dateNotInRange=!0,this.validateType="maxdate",this.showValidation(t,n,i,l))}if(this.excludedates){if((c.isString(this.excludedates)?_.split(this.excludedates,","):this.excludedates).map((function(e){return c.getFormattedDate(o.datePipe,e,o.datepattern,o.timeZone,null,null,o)})).indexOf(c.getFormattedDate(this.datePipe,a,this.datepattern,this.timeZone,null,null,this))>-1)return this.dateNotInRange=!0,this.validateType="excludedates",void this.invokeOnChange(this.datavalue,void 0,!1)}if(this.excludedays){var p=_.split(this.excludedays,","),d=_.get(a,"getDay")?a.getDay():a;if(p.indexOf(d.toString())>-1)return this.dateNotInRange=!0,this.validateType="excludedays",void this.invokeOnChange(this.datavalue,void 0,!1)}}i||(this.dateNotInRange=!1,this.invokeOnChange(this.datavalue,void 0,!1))},t.prototype.hightlightToday=function(){var e=(new Date).getDate().toString();_.filter($("span:contains("+e+")").not(".is-other-month"),(function(t){$(t).text()===e&&$(t).addClass("current-date text-info")}))},t.prototype.isOtheryear=function(e){return 0===e.getMonth()&&11===this.activeDate.getMonth()||11===e.getMonth()&&0===this.activeDate.getMonth()},t.prototype.setActiveDateFocus=function(e,t){var n=this;this.setNextData(e);var i=this.activeDate.getMonth();t||(e.getMonth()<i?this.isOtheryear(e)?this.goToOtherMonthOryear("next","days"):this.goToOtherMonthOryear("previous","days"):e.getMonth()>i&&(this.isOtheryear(e)?this.goToOtherMonthOryear("previous","days"):this.goToOtherMonthOryear("next","days"))),setTimeout((function(){var t=e.getDate().toString();_.filter($("span:contains("+t+")").not(".is-other-month"),(function(i){$(i).text()===t&&($(i).hasClass("selected")&&$(i).parent().attr("aria-selected","true"),$(i).attr("aria-label",moment(e).format("dddd, MMMM Do YYYY")),$("[bsdatepickerdaydecorator]").not(".is-other-month").attr("tabindex","-1"),$(i).attr("tabindex","0"),$(i).focus(),n.activeDate=e)})),e.getMonth()===(new Date).getMonth()&&e.getFullYear()===(new Date).getFullYear()&&n.hightlightToday()}))},t.prototype.goToOtherMonthOryear=function(e,t){var n=$(".bs-datepicker-head ."+e);n.attr("disabled")||(n.trigger("click"),"days"===t?this.loadDays():"month"===t?this.loadMonths():"year"===t&&this.loadYears())},t.prototype.getMonth=function(e,t){var n=new Date(e),i=n.getMonth(),o=n.getFullYear(),a=new Date(o,i+=t),r=a.toLocaleString("en-US",{month:"long"});return{date:a,fullMonth:r}},t.prototype.addDatepickerMouseEvents=function(){var e=this,t=$(".bs-datepicker-head");t.find(".previous").click((function(t){e.next=e.getMonth(e.activeDate,0),e.prev=e.getMonth(e.activeDate,-2),e.clicked=!0,t.originalEvent&&e.setFocusForDate(-1);var n=e.getMonth(e.activeDate,-1);$(".bs-datepicker-head .previous").prepend('<p aria-hidden="false" class="sr-only">Changed to Previous Month, '+n.fullMonth+" and year "+n.date.getFullYear()+"</p>"),setTimeout((function(){$(".bs-datepicker-head .previous").focus()}))})),t.find(".next").click((function(t){e.next=e.getMonth(e.activeDate,2),e.prev=e.getMonth(e.activeDate,0),e.clicked=!0,t.originalEvent&&e.setFocusForDate(1);var n=e.getMonth(e.activeDate,1);$(".bs-datepicker-head .next").prepend('<p aria-hidden="false" class="sr-only">Changed to Next Month, '+n.fullMonth+" and year "+n.date.getFullYear()+"</p>"),setTimeout((function(){$(".bs-datepicker-head .next").focus()}))})),t.find(".current").click((function(t){t.originalEvent&&e.setFocusForCurrentMonthOryear()})),$(".bs-datepicker-body, .bs-datepicker-action-buttons").click((function(t){t.stopPropagation(),t.originalEvent&&e.setFocusForMonthOrDay()})),this.clicked||(t.find(".next").attr("aria-label","Next Month, "+this.next.fullMonth+" "+this.next.date.getFullYear()),t.find(".previous").attr("aria-label","Previous Month, "+this.prev.fullMonth+" "+this.prev.date.getFullYear()))},t.prototype.setFocusForMonthOrDay=function(){var e=$(".bs-datepicker-head .current").first().text(),t=$(".bs-datepicker-body");if(t.find("table.months").length>0){_.parseInt(e)!==this.activeDate.getFullYear()&&this.loadMonths();var n=new Date(_.parseInt(e),this.activeDate.getMonth(),this.activeDate.getDate());this.setActiveMonthFocus(n,!0)}else if(t.find("table.days").length>0){var i=b.indexOf(e);i!==this.activeDate.getMonth()&&this.loadDays();n=new Date(this.activeDate.getFullYear(),i,1);this.setActiveDateFocus(n,!0)}},t.prototype.setFocusForCurrentMonthOryear=function(){var e=$(".bs-datepicker-body");e.find("table.months").length>0?(this.loadMonths(),this.setActiveMonthFocus(this.activeDate,!0)):e.find("table.years").length>0&&(this.loadYears(),this.setActiveYearFocus(this.activeDate,!0))},t.prototype.setFocusForDate=function(e){var t=$(".bs-datepicker-body");if(t.find("table.months").length>0){this.loadMonths();var n=new Date(this.activeDate.getFullYear()+e,0,this.activeDate.getDate());this.setActiveMonthFocus(n,!0)}else if(t.find("table.years").length>0){this.loadYears();var i=t.find("table.years span").first().text();n=new Date(_.parseInt(i),this.activeDate.getMonth(),this.activeDate.getDate());this.setActiveYearFocus(n,!0)}else if(t.find("table.days").length>0){this.loadDays();n=new Date(this.activeDate.getFullYear(),this.activeDate.getMonth()+e,1);this.setActiveDateFocus(n,!0)}},t.prototype.addDatepickerKeyboardEvents=function(e,t){var n=this;this.keyEventPluginInstance=e.keyEventPlugin.constructor,this.elementScope=e;var i=document.querySelector("."+e.dateContainerCls);c.setAttr(i,"tabindex","0"),i.onkeydown=function(e){if("escape"===n.keyEventPluginInstance.getEventFullKey(e)){n.elementScope.hideDatepickerDropdown();var t=n.elementScope.nativeElement.querySelector(".display-input");setTimeout((function(){return t.focus()}))}},this.loadDays(),this.setActiveDateFocus(this.activeDate)},t.prototype.setNextData=function(e){this.next=this.getMonth(e,1),this.prev=this.getMonth(e,-1)},t.prototype.loadDays=function(){var e=this;setTimeout((function(){$("[bsdatepickerdaydecorator]").not(".is-other-month").attr("tabindex","0"),e.addKeyBoardEventsForDays(),e.addDatepickerMouseEvents()}))},t.prototype.addKeyBoardEventsForDays=function(){var e=this;$(".bs-datepicker-body").keydown((function(t){var n,i=e.keyEventPluginInstance.getEventFullKey(t);if("arrowdown"===i)t.preventDefault(),n=moment(e.activeDate).add(7,"days").toDate(),e.setActiveDateFocus(n);else if("arrowup"===i)t.preventDefault(),n=moment(e.activeDate).add(-7,"days").toDate(),e.setActiveDateFocus(n);else if("arrowleft"===i)n=moment(e.activeDate).add(-1,"days").toDate(),e.setActiveDateFocus(n);else if("arrowright"===i)n=moment(e.activeDate).add(1,"days").toDate(),e.setActiveDateFocus(n);else if("pageup"===i)t.preventDefault(),n=moment(e.activeDate).add(-1,"month").toDate(),e.setActiveDateFocus(n);else if("pagedown"===i)t.preventDefault(),n=moment(e.activeDate).add(1,"month").toDate(),e.setActiveDateFocus(n);else if("control.arrowup"===i)$(".bs-datepicker-head .current").first().click(),e.loadMonths(),e.setActiveMonthFocus(e.activeDate);else if("enter"===i){if($(document.activeElement).hasClass("disabled"))return;$(document.activeElement).click(),e.elementScope.hideDatepickerDropdown();var o=e.elementScope.nativeElement.querySelector(".display-input");setTimeout((function(){return o.focus()}))}})),this.focusBlurDatePickerHeadButtons()},t.prototype.focusBlurDatePickerHeadButtons=function(){var e=$(".bs-datepicker-head button");e.on("focus",(function(){$(this).css("background-color","#9AA0A3")})),e.on("blur",(function(){$(this).css("background-color","")}))},t.prototype.loadMonths=function(){var e=this;setTimeout((function(){e.addKeyBoardEventsForMonths(),e.addDatepickerMouseEvents()}))},t.prototype.addKeyBoardEventsForMonths=function(){var e=this;$(".bs-datepicker-body").keydown((function(t){var n,i=e.keyEventPluginInstance.getEventFullKey(t);if("arrowdown"===i)t.preventDefault(),n=moment(e.activeDate).add(3,"month").toDate(),e.setActiveMonthFocus(n);else if("arrowup"===i)t.preventDefault(),n=moment(e.activeDate).add(-3,"month").toDate(),e.setActiveMonthFocus(n);else if("arrowleft"===i)n=moment(e.activeDate).add(-1,"month").toDate(),e.setActiveMonthFocus(n);else if("arrowright"===i)n=moment(e.activeDate).add(1,"month").toDate(),e.setActiveMonthFocus(n);else if("control.arrowup"===i)$(".bs-datepicker-head .current").first().click(),e.loadYears(),e.setActiveYearFocus(e.activeDate);else if("control.arrowdown"===i||"enter"===i){if($(document.activeElement).parent().hasClass("disabled"))return;$(document.activeElement).click(),e.loadDays();var o=new Date(e.activeDate.getFullYear(),e.activeDate.getMonth(),1);e.setActiveDateFocus(o)}})),this.focusBlurDatePickerHeadButtons()},t.prototype.loadYears=function(){var e=this;setTimeout((function(){e.addKeyBoardEventsForYears(),e.addDatepickerMouseEvents()}))},t.prototype.setActiveMonthFocus=function(e,t){var n=this;this.setNextData(e);var i=b[e.getMonth()];t||(e.getFullYear()<this.activeDate.getFullYear()?this.goToOtherMonthOryear("previous","month"):e.getFullYear()>this.activeDate.getFullYear()&&this.goToOtherMonthOryear("next","month")),setTimeout((function(){$(".bs-datepicker-body table.months span").attr("tabindex","-1"),$(".bs-datepicker-body table.months span:contains("+i+")").attr("tabindex","0"),$(".bs-datepicker-body table.months span:contains("+i+")").focus(),n.activeDate=e}))},t.prototype.addKeyBoardEventsForYears=function(){var e=this;$(".bs-datepicker-body").keydown((function(t){var n,i=e.keyEventPluginInstance.getEventFullKey(t);if("arrowdown"===i)t.preventDefault(),n=moment(e.activeDate).add(4,"year").toDate(),e.setActiveYearFocus(n);else if("arrowup"===i)t.preventDefault(),n=moment(e.activeDate).add(-4,"year").toDate(),e.setActiveYearFocus(n);else if("arrowleft"===i)n=moment(e.activeDate).add(-1,"year").toDate(),e.setActiveYearFocus(n);else if("arrowright"===i)n=moment(e.activeDate).add(1,"year").toDate(),e.setActiveYearFocus(n);else if("control.arrowdown"===i||"enter"===i){if($(document.activeElement).parent().hasClass("disabled"))return;$(document.activeElement).click(),e.loadMonths(),e.setActiveMonthFocus(e.activeDate)}})),this.focusBlurDatePickerHeadButtons()},t.prototype.setActiveYearFocus=function(e,t){var n=this,i=e.getFullYear(),o=$(".bs-datepicker-body table.years span"),a=o.first().text(),r=o.last().text();t||(e.getFullYear()<_.parseInt(a)?this.goToOtherMonthOryear("previous","year"):e.getFullYear()>_.parseInt(r)&&this.goToOtherMonthOryear("next","year")),setTimeout((function(){$(".bs-datepicker-body table.years span").attr("tabindex","-1"),$(".bs-datepicker-body table.years span:contains("+i+")").attr("tabindex","0"),$(".bs-datepicker-body table.years span:contains("+i+")").focus(),n.activeDate=e}))},t.prototype.focusTimePickerPopover=function(e){this.keyEventPluginInstance=e.keyEventPlugin.constructor,this.elementScope=e,this.elementScope.ngZone.runOutsideAngular((function(){setTimeout((function(){$("timepicker .form-group").first().find("> input.form-control").focus()}))}))},t.prototype.bindTimePickerKeyboardEvents=function(){var e=this;setTimeout((function(){var t=$("body").find("> bs-dropdown-container timepicker");t.attr("tabindex",0),e.addEventsOnTimePicker(t)}))},t.prototype.focusOnInputEl=function(){var e=this;$(this.nativeElement).closest(".caption-floating").length>0&&setTimeout((function(){$(e.nativeElement).find(".app-textbox").focus()}),100)},t.prototype.isValidDate=function(e){return e&&e instanceof Date&&!isNaN(e.getTime())},t.prototype.timeFormatValidation=function(){var e=$(this.nativeElement).find("input").val(),t=c.getNativeDateObject(e,{meridians:this.meridians,pattern:this.datepattern});this.formatValidation(t,e)&&(this.invalidDateTimeFormat=!1,this.invokeOnChange(this.datavalue,void 0,!1))},t.prototype.updateTimeValue=function(e,t){var n=this;e.length<2?setTimeout((function(){"minutes"===t?n.bsTimePicker.updateMinutes("00"):n.bsTimePicker.updateSeconds("00")}),500):"minutes"===t?this.bsTimePicker.updateMinutes("00"):this.bsTimePicker.updateSeconds("00")},t.prototype.addEventsOnTimePicker=function(e){var t=this,n=e.find(".bs-timepicker-field");n.first().on("keyup",(function(e){var i=e.target.value;_.forEach(n,(function(n,o){if(e.target!==n&&""===n.value&&i.length){var a=1===o?"minutes":"seconds";t.updateTimeValue(i,a)}}))})),this.removeKeyupListener=function(){n.first().off("keyup")},e.on("keydown",(function(e){var n,i,o=$(e.target),a=o.parent(),r=t.elementScope,s=t.keyEventPluginInstance.getEventFullKey(e);if("escape"===s&&r.hideTimepickerDropdown(),o.hasClass("bs-timepicker-field")){if(a.is(":first-child")?"shift.tab"!==s&&"enter"!==s&&"escape"!==s||(r.setIsTimeOpen(!1),t.focus(),n=!0,i=!0):a.is(":last-child")||a.next().next().find("button.disabled").length?"tab"!==s&&"escape"!==s&&"enter"!==s||(r.setIsTimeOpen(!1),t.focus(),n=!0,i=!0):"enter"!==s&&"escape"!==s||(r.setIsTimeOpen(!1),t.focus(),n=!0,i=!0),n&&e.stopPropagation(),i&&e.preventDefault(),r.mintime&&r.maxtime&&!t.isValidDate(r.bsTimeValue)&&("arrowdown"===s?r.bsTimeValue=r.maxTime:"arrowup"===s&&(r.bsTimeValue=r.minTime)),"tab"===s){t.invalidDateTimeFormat=!1,t.invokeOnChange(t.datavalue,void 0,!1);var l=t.datepattern||t.timepattern;c.getFormattedDate(r.datePipe,r.bsTimeValue,l,t.timeZone,null,null,t)===r.displayValue&&$(t.nativeElement).find(".display-input").val(r.displayValue)}"arrowdown"!==s&&"arrowup"!==s||t.timeFormatValidation()}else o.hasClass("btn-default")&&("tab"!==s&&"escape"!==s||(r.setIsTimeOpen(!1),t.focus()))})),e.find("a").on("click",(function(e){var n=t.elementScope,i=$(e.target);n.mintime&&n.maxtime&&!t.isValidDate(n.bsTimeValue)&&(i.find("span").hasClass("bs-chevron-down")?n.bsTimeValue=n.maxTime:i.find("span").hasClass("bs-chevron-up")&&(n.bsTimeValue=n.minTime)),t.timeFormatValidation()}))},t.prototype.updateFormat=function(e){"datepattern"===e?(this._dateOptions.dateInputFormat=this.datepattern,this.showseconds=_.includes(this.datepattern,"s"),this.ismeridian=_.includes(this.datepattern,"h")):"timepattern"===e&&(this.showseconds=_.includes(this.timepattern,"s"),this.ismeridian=_.includes(this.timepattern,"h"))},t.prototype.getMobileInput=function(){return this.nativeElement.querySelector(".mobile-input")},t.prototype.onDateTimeInputBlur=function(){var e=this.getMobileInput();if(e&&!c.hasCordova()){for(var t=this.nativeElement.children,n=0;n<t.length;n++)t[n].classList.remove("add-opacity");e.classList.remove("remove-opacity")}},t.prototype.onDateTimeInputFocus=function(e){if(void 0===e&&(e=!1),this.loadNativeDateInput){var t=this.getMobileInput();if(!e||c.hasCordova())t&&this._triggeredByUser&&(t.focus(),t.click());else{for(var n=this.nativeElement.children,i=0;i<n.length;i++)n[i].classList.add("add-opacity");t.classList.add("remove-opacity")}}},t.prototype.getCordovaPluginDatePickerApi=function(){if(c.isIos())return _.get(window,"cordova.wavemaker.datePicker.selectDate")},t.prototype.showDatePickerModal=function(){this.datetimepickerComponent.show()},t.prototype.blurDateInput=function(e){var t=this.nativeElement.querySelector(".display-input");e&&setTimeout((function(){return t.blur()}))},t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("required"!==t?"datepattern"===t?this.updateFormat(t):"showweeks"===t?this._dateOptions.showWeekNumbers=n:"mindate"===t?(this._dateOptions.minDate=n===y?this.mindate=new Date:c.getDateObj(n),this.minDateMaxDateValidationOnInput(this.datavalue)):"maxdate"===t?(this._dateOptions.maxDate=n===y?this.maxdate=new Date:c.getDateObj(n),this.minDateMaxDateValidationOnInput(this.datavalue)):"excludedates"===t||"excludedays"===t?(this.excludedays&&(this.excludedDaysToDisable=_.split(this.excludedays,",").map((function(e){return+e}))),this.excludedates&&(this.excludedDatesToDisable=this.excludedates,c.isString(this.excludedates)&&(this.excludedDatesToDisable=_.split(this.excludedates,",")),this.excludedDatesToDisable=this.excludedDatesToDisable.map((function(e){return c.getDateObj(e)}))),this.minDateMaxDateValidationOnInput(this.datavalue)):"selectfromothermonth"===t?this._dateOptions.selectFromOtherMonth=n:"todaybutton"===t?this._dateOptions.showTodayButton=n:"clearbutton"===t?this._dateOptions.showClearButton=n:"todaybuttonlabel"===t?this._dateOptions.todayButtonLabel=this.i18nService.getLocalizedMessage(n)||n:"clearbuttonlabel"===t?this._dateOptions.clearButtonLabel=this.i18nService.getLocalizedMessage(n)||n:"showcustompicker"===t?this.loadNativeDateInput=c.isMobile()&&!this.showcustompicker:"adaptiveposition"===t?this._dateOptions.adaptivePosition=n:e.prototype.onPropertyChange.call(this,t,n,i):this._onChange(this.datavalue))},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),this.containerTarget=s.getContainerTargetClass(this.nativeElement),this.isReadOnly="undefined"!=this.dataentrymode&&!this.isDataEntryModeEnabledOnInput(this.dataentrymode);var t=this.getMobileInput();t&&setTimeout((function(){t.style.width="100%",t.style.height="100%"}))},t.prototype.ngOnDestroy=function(){this.dateOnShowSubscription&&this.dateOnShowSubscription.unsubscribe(),this.cancelLocaleChangeSubscription&&this.cancelLocaleChangeSubscription(),e.prototype.ngOnDestroy.call(this)},t.prototype.ngOnDetach=function(){var e;null===(e=this.datetimepickerComponent)||void 0===e||e.hideModal()},t.prototype.setTimezone=function(e){this.i18nService.setTimezone(e,this)},t}(p.BaseFormCustomComponent);E.decorators=[{type:t.Directive}],E.ctorParameters=function(){return[{type:t.Injector},null]},E.propDecorators={bsDropdown:[{type:t.ViewChild,args:[a.BsDropdownDirective]}],bsTimePicker:[{type:t.ViewChild,args:[r.TimepickerComponent]}],datetimepickerComponent:[{type:t.ViewChild,args:[g]}]};var R=new Map([["autofocus",s.PROP_BOOLEAN],["class",s.PROP_STRING],["dataentrymode",Object.assign({value:"default"},s.PROP_STRING)],["datavaluesource",s.PROP_ANY],["datavalue",s.PROP_STRING],["datepattern",s.PROP_STRING],["disabled",s.PROP_BOOLEAN],["excludedays",s.PROP_STRING],["excludedates",s.PROP_STRING],["hint",s.PROP_STRING],["maxdate",s.PROP_STRING],["mindate",s.PROP_STRING],["name",s.PROP_STRING],["outputformat",Object.assign({value:"yyyy-MM-dd"},s.PROP_STRING)],["placeholder",Object.assign({value:"Select Date"},s.PROP_STRING)],["readonly",s.PROP_BOOLEAN],["required",s.PROP_BOOLEAN],["shortcutkey",s.PROP_STRING],["show",Object.assign({value:!0},s.PROP_BOOLEAN)],["showdropdownon",Object.assign({value:"default"},s.PROP_STRING)],["showbuttonbar",Object.assign({value:!0},s.PROP_BOOLEAN)],["showcustompicker",Object.assign({value:!1},s.PROP_BOOLEAN)],["showindevice",Object.assign({displayType:"inline-block",value:"all"},s.PROP_STRING)],["showweeks",Object.assign({value:!1},s.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},s.PROP_NUMBER)],["selectfromothermonth",Object.assign({value:!0},s.PROP_BOOLEAN)],["todaybutton",Object.assign({value:!0},s.PROP_BOOLEAN)],["clearbutton",Object.assign({value:!0},s.PROP_BOOLEAN)],["adaptiveposition",Object.assign({value:!1},s.PROP_BOOLEAN)],["todaybuttonlabel",Object.assign({value:"LABEL_TODAY_DATE"},s.PROP_STRING)],["clearbuttonlabel",Object.assign({value:"LABEL_CLEAR_DATE"},s.PROP_STRING)]]),A=function(){s.register("wm-date",R),s.registerFormWidget(c.FormWidgetType.DATE,new Map(R))},T={widgetType:"wm-date",hostClass:"app-date input-group"},S=function(e){function t(t,n,i,o){var a=e.call(this,t,T)||this;return a.cdRef=n,a.appDefaults=i,a.isOpen=!1,a.isEnterPressedOnDateInput=!1,s.styler(a.nativeElement,a),a.keyEventPlugin=o[1],a.dateContainerCls="app-date-"+a.widgetId,a._dateOptions.containerClass="app-date "+a.dateContainerCls,a._dateOptions.showWeekNumbers=!1,a._bsDefaultLoadCheck=!0,a.datepattern=a.appDefaults.dateFormat||c.getDisplayDateTimeFormat(c.FormWidgetType.DATE),a.updateFormat("datepattern"),a}return h(t,e),Object.defineProperty(t.prototype,"timestamp",{get:function(){return this.bsDataValue?this.bsDataValue.valueOf():void 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dateInputFormat",{get:function(){return this._dateOptions.dateInputFormat||"yyyy-MM-dd"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"displayValue",{get:function(){return c.getFormattedDate(this.datePipe,this.bsDataValue,this.dateInputFormat,this.timeZone,null,this.isCurrentDate,this)||""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nativeDisplayValue",{get:function(){return c.getFormattedDate(this.datePipe,this.bsDataValue,"yyyy-MM-dd",this.timeZone,null,this.isCurrentDate,this)||""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"datavalue",{get:function(){return c.getFormattedDate(this.datePipe,this.bsDataValue,this.outputformat,this.timeZone,null,this.isCurrentDate,this)||""},set:function(e){var t=this;"CURRENT_DATE"===e?(setTimeout((function(){t.bsDataValue=t.timeZone?c.getMomentLocaleObject(t.timeZone):new Date}),50),this.isCurrentDate=!0):(this.bsDataValue=e?c.getDateObj(e,{isNativePicker:this.loadNativeDateInput},this.timeZone):void 0,this.isCurrentDate=!1),this.invokeOnChange(this.datavalue,void 0,!0),this.cdRef.detectChanges()},enumerable:!1,configurable:!0}),t.prototype.onDisplayDateChange=function(e,t){if(void 0===t&&(t=!1),this.isEnterPressedOnDateInput)this.isEnterPressedOnDateInput=!1;else{var n=c.getDateObj(e.target.value,{pattern:this.datepattern,isNativePicker:t});this.formatValidation(n,e.target.value,t)&&(t&&this.minDateMaxDateValidationOnInput(n,e,this.displayValue,t)||this.setDataValue(n))}},t.prototype.setDataValue=function(e){this.invalidDateTimeFormat=!1,this.minDateMaxDateValidationOnInput(e),c.getFormattedDate(this.datePipe,e,this.dateInputFormat,this.timeZone,null,this.isCurrentDate,this)===this.displayValue&&$(this.nativeElement).find(".display-input").val(this.displayValue),this.bsDataValue=e||void 0,this.invokeOnChange(this.datavalue,{},!0)},t.prototype.onDatePickerOpen=function(){this.isOpen=!0,this.bsDataValue?this.activeDate=this.bsDataValue:this.activeDate=new Date,this.bsDataValue||this.hightlightToday(),this.$element.find(".model-holder").width("1px"),$("bs-datepicker-container").attr("aria-label","Use Arrow keys to navigate dates, Choose Date from datepicker"),$(".bs-calendar-container").removeAttr("role");var e=$(".bs-datepicker-container")[0];this.focusTrap=s.setFocusTrap(e,!0),this.focusTrap.activate(),this.addDatepickerKeyboardEvents(this,!1),c.adjustContainerPosition($("bs-datepicker-container"),this.nativeElement,this.bsDatePickerDirective._datepicker),c.adjustContainerRightEdges($("bs-datepicker-container"),this.nativeElement,this.bsDatePickerDirective._datepicker)},t.prototype.onInputBlur=function(e){$(e.relatedTarget).hasClass("current-date")||(this.invokeOnTouched(),this.invokeEventCallback("blur",{$event:e}))},t.prototype.hideDatepickerDropdown=function(){var e;this.invokeOnTouched(),this.isOpen=!1,null===(e=this.focusTrap)||void 0===e||e.deactivate(),this.isEnterPressedOnDateInput=!1,this.deregisterEventListener&&this.deregisterEventListener(),this.blurDateInput(this.isOpen)},t.prototype.handleEvent=function(t,n,i,o){_.includes(["blur","focus","change","click"],n)||e.prototype.handleEvent.call(this,t,n,i,o)},t.prototype.toggleDpDropdown=function(e,t){void 0===t&&(t=!1),this.loadNativeDateInput&&(t||this.onDateTimeInputFocus()),"click"===e.type&&this.invokeEventCallback("click",{$event:e}),e.target&&$(e.target).is("input")&&!this.isDropDownDisplayEnabledOnInput(this.showdropdownon)?e.stopPropagation():(this.bsDatePickerDirective.toggle(),this.addBodyClickListener(this.bsDatePickerDirective.isOpen))},t.prototype.addBodyClickListener=function(e){var t=this;if(e){var n=document.querySelector("body");setTimeout((function(){var e=n.querySelector("."+t.dateContainerCls);t.deregisterEventListener=c.addEventListenerOnElement(n,e,t.nativeElement,"click",t.isDropDownDisplayEnabledOnInput(t.showdropdownon),(function(){t.isOpen=!1}),0,!0)}),350)}},t.prototype.onDisplayKeydown=function(e){if(this.isDropDownDisplayEnabledOnInput(this.showdropdownon))if(e.stopPropagation(),"enter"===this.keyEventPlugin.constructor.getEventFullKey(e)){var t=c.getDateObj(e.target.value,{pattern:this.datepattern});e.preventDefault();var n=c.getFormattedDate(this.datePipe,t,this.dateInputFormat,this.timeZone,null,this.isCurrentDate,this),i=e.target.value.trim();i&&"timestamp"===this.datepattern?_.isNaN(i)||_.parseInt(i)===n||(this.invalidDateTimeFormat=!0,this.invokeOnChange(this.datavalue,e,!1)):i&&i!==n?(this.invalidDateTimeFormat=!0,this.invokeOnChange(this.datavalue,e,!1)):(this.invalidDateTimeFormat=!1,this.isEnterPressedOnDateInput=!0,this.bsDatePickerDirective.bsValue=e.target.value?t:""),this.toggleDpDropdown(e)}else this.hideDatepickerDropdown();else this.hideDatepickerDropdown()},t.prototype.onDateChange=function(e){this._bsDefaultLoadCheck?this._bsDefaultLoadCheck=!1:this.setDataValue(e)},t}(E);S.initializeProps=A(),S.decorators=[{type:t.Component,args:[{selector:"[wmDate]",template:' <input class="form-control app-textbox app-dateinput display-input"\n focus-target\n type="text"\n [name]="name"\n [tabindex]="loadNativeDateInput ? \'-1\' : tabindex"\n [attr.aria-hidden]="!!loadNativeDateInput"\n [value]="displayValue"\n (click)="toggleDpDropdown($event, true)"\n (focus)="onDateTimeInputFocus(); invokeOnFocus($event);"\n (blur)="onInputBlur($event)"\n [disabled]="disabled || readonly"\n [autofocus]="autofocus"\n [required]="required"\n [readOnly]="isReadOnly"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-label]="hint"\n (change)="onDisplayDateChange($event)"\n (keydown)="this._triggeredByUser = true; onDisplayKeydown($event);">\n\n <span class="input-group-btn">\n <button type="button"\n class="btn btn-default btn-time"\n [tabindex]="loadNativeDateInput ? \'-1\' : tabindex"\n [attr.aria-hidden]="!!loadNativeDateInput"\n [disabled]="disabled || readonly"\n [attr.aria-label]="displayValue ? \'Change Date \' + displayValue : \'Choose date by pressing enter\'"\n aria-haspopup="true"\n aria-expanded="false"\n (click)="toggleDpDropdown($event, false)">\n <i aria-hidden="true"\n class="app-icon wm-sl-l sl-calendar"></i>\n </button>\n </span>\n <div style="width: 0;display: inline-block;">\n <input class="model-holder"\n aria-label="datepicker dropdownmenu"\n aria-controls="date"\n [tabindex]="-1"\n [attr.aria-hidden]="!!loadNativeDateInput"\n [container]="containerTarget || \'body\'"\n [bsConfig]="_dateOptions"\n [isOpen]="isOpen"\n #datepicker="bsDatepicker"\n bsDatepicker\n [daysDisabled]="excludedDaysToDisable"\n [datesDisabled]="excludedDatesToDisable"\n placement="bottom right"\n [isDisabled]="disabled || readonly"\n [bsValue]="bsDataValue"\n (onShown)="onDatePickerOpen()"\n (onHidden)="hideDatepickerDropdown()"\n (bsValueChange)="onDateChange($event)">\n</div>\n\n<ng-template [ngIf]="loadNativeDateInput">\n <wm-datetimepicker\n dateTimePicker\n mode="DATE"\n [config]="_dateOptions"\n [placement]="modal"\n [excludedDaysToDisable]="excludedDaysToDisable"\n [excludedDatesToDisable]="excludedDatesToDisable"\n [displayFormat]="dateInputFormat"\n [value]="bsDataValue"\n (change)="onDateChange($event)">\n </wm-datetimepicker>\n <div class="mobile-input mobile-datepicker-container"\n [tabindex]="tabindex || 0"\n (focus)="onDateTimeInputFocus(true); invokeOnFocus($event);"\n (blur)="onDateTimeInputBlur(); invokeOnTouched($event)"\n [attr.aria-label]="displayValue ? \'Change Date\' + displayValue : \'Choose Date\'"\n (click)="!(disabled || readonly || isCurrentDate) && showDatePickerModal()">\n </div>\n</ng-template>\n',providers:[s.provideAs(S,i.NG_VALUE_ACCESSOR,!0),s.provideAs(S,i.NG_VALIDATORS,!0),s.provideAsWidgetRef(S)]}]}],S.ctorParameters=function(){return[{type:t.Injector},{type:t.ChangeDetectorRef},{type:c.AppDefaults},{type:void 0,decorators:[{type:t.Inject,args:[l.EVENT_MANAGER_PLUGINS]}]}]},S.propDecorators={bsDatePickerDirective:[{type:t.ViewChild,args:[o.BsDatepickerDirective]}]};var C=new Map([["autofocus",s.PROP_BOOLEAN],["class",s.PROP_STRING],["dataentrymode",Object.assign({value:"default"},s.PROP_STRING)],["datavaluesource",s.PROP_ANY],["datavalue",s.PROP_STRING],["datepattern",s.PROP_STRING],["disabled",s.PROP_BOOLEAN],["excludedays",s.PROP_STRING],["excludedates",s.PROP_STRING],["hint",s.PROP_STRING],["hourstep",Object.assign({value:1},s.PROP_NUMBER)],["maxdate",s.PROP_STRING],["mindate",s.PROP_STRING],["minutestep",Object.assign({value:15},s.PROP_NUMBER)],["name",s.PROP_STRING],["outputformat",Object.assign({value:"timestamp"},s.PROP_STRING)],["placeholder",Object.assign({value:"Select date time"},s.PROP_STRING)],["readonly",s.PROP_BOOLEAN],["required",s.PROP_BOOLEAN],["secondsstep",Object.assign({value:1},s.PROP_NUMBER)],["shortcutkey",s.PROP_STRING],["show",Object.assign({value:!0},s.PROP_BOOLEAN)],["showdropdownon",Object.assign({value:"default"},s.PROP_STRING)],["showbuttonbar",s.PROP_BOOLEAN],["showcustompicker",Object.assign({value:!1},s.PROP_BOOLEAN)],["showindevice",Object.assign({displayType:"inline-block",value:"all"},s.PROP_STRING)],["showweeks",s.PROP_BOOLEAN],["tabindex",Object.assign({value:0},s.PROP_NUMBER)],["timestamp",s.PROP_STRING],["selectfromothermonth",Object.assign({value:!0},s.PROP_BOOLEAN)],["todaybutton",Object.assign({value:!0},s.PROP_BOOLEAN)],["clearbutton",Object.assign({value:!0},s.PROP_BOOLEAN)],["adaptiveposition",Object.assign({value:!1},s.PROP_BOOLEAN)],["todaybuttonlabel",Object.assign({value:"LABEL_TODAY_DATE"},s.PROP_STRING)],["clearbuttonlabel",Object.assign({value:"LABEL_CLEAR_DATE"},s.PROP_STRING)]]),I=function(){s.register("wm-datetime",C),s.registerFormWidget(c.FormWidgetType.DATETIME,new Map(C)),s.registerFormWidget(c.FormWidgetType.TIMESTAMP,new Map(C))},D={widgetType:"wm-datetime",hostClass:"app-datetime input-group"},x="CURRENT_DATE",N=O,k=function(e){function t(t,n,i,o,a,r){var l=e.call(this,t,D)||this;return l.ngZone=n,l.cdRef=i,l.appDefaults=o,l.isEnterPressedOnDateInput=!1,l.isTimeOpen=!1,l.isDateOpen=!1,l.isCurrentDate=!1,l._debouncedOnChange=_.debounce(l.invokeOnChange,10),l.registerDestroyListener((function(){return l.clearTimeInterval()})),s.styler(l.nativeElement,l),l.app=a,l.keyEventPlugin=r[1],l.dateContainerCls="app-date-"+l.widgetId,l._dateOptions.containerClass="app-date "+l.dateContainerCls,l._dateOptions.showWeekNumbers=!1,l.datepattern=l.appDefaults.dateTimeFormat||c.getDisplayDateTimeFormat(c.FormWidgetType.DATETIME),l.updateFormat("datepattern"),l}return h(t,e),Object.defineProperty(t.prototype,"timestamp",{get:function(){return this.proxyModel?this.proxyModel.valueOf():void 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dateInputFormat",{get:function(){return this._dateOptions.dateInputFormat||"yyyy-MM-ddTHH:mm:ss"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"displayValue",{get:function(){return c.getFormattedDate(this.datePipe,this.proxyModel,this.dateInputFormat,this.timeZone,this.key,this.isCurrentDate,this)||""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nativeDisplayValue",{get:function(){return c.getFormattedDate(this.datePipe,this.proxyModel,"yyyy-MM-ddTHH:mm:ss",this.timeZone,this.key,this.isCurrentDate,this)||""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"datavalue",{get:function(){return this.isCurrentDate&&!this.proxyModel?x:c.getFormattedDate(this.datePipe,this.proxyModel,this.outputformat,this.timeZone,null,null,this)},set:function(e){e===x?(this.isCurrentDate=!0,this.setTimeInterval()):(this.proxyModel=e?c.getDateObj(e,{isNativePicker:this.loadNativeDateInput},this.timeZone):void 0,this.clearTimeInterval(),this.isCurrentDate=!1),this.bsTimeValue=this.bsDateValue=this.proxyModel,this.cdRef.detectChanges()},enumerable:!1,configurable:!0}),t.prototype.setTimeInterval=function(){var e=this;this.timeinterval||(this.timeinterval=setInterval((function(){var t=e.timeZone?c.getMomentLocaleObject(e.timeZone):new Date;e.onModelUpdate(t)}),1e3))},t.prototype.clearTimeInterval=function(){this.timeinterval&&(clearInterval(this.timeinterval),this.timeinterval=null)},t.prototype.toggleTimePicker=function(e,t){this.loadNativeDateInput?this.onDateTimeInputFocus():(this.isTimeOpen=e,t&&"click"===t.type&&this.invokeEventCallback("click",{$event:t}),this.addTimepickerClickListener(this.isTimeOpen))},t.prototype.addTimepickerClickListener=function(e){var t=this;if(e){var n=document.querySelector("body");setTimeout((function(){var e=$(n).find(">bs-dropdown-container .dropdown-menu").get(0);t.deregisterTimepickeEventListener=c.addEventListenerOnElement(n,e,t.nativeElement,"click",t.isDropDownDisplayEnabledOnInput(t.showdropdownon),(function(){t.toggleTimePicker(!1)}),0,!0)}),350)}},t.prototype.setIsTimeOpen=function(e){this.isTimeOpen=e},t.prototype.hideTimepickerDropdown=function(){this.invokeOnTouched(),this.toggleTimePicker(!1),this.deregisterTimepickeEventListener&&this.deregisterTimepickeEventListener();var e=$(this.nativeElement).closest(".app-composite-widget.caption-floating");e.length>0&&this.app.notify("captionPositionAnimate",{displayVal:this.displayValue,nativeEl:e})},t.prototype.onTimepickerOpen=function(){var e=document.querySelectorAll("timepicker");_.forEach(e,(function(e){c.addClass(e.parentElement,"app-datetime",!0)})),this.bsDatePickerDirective.hide(),this.focusTimePickerPopover(this),this.bindTimePickerKeyboardEvents(),c.adjustContainerPosition($("bs-dropdown-container"),this.nativeElement,this.bsDropdown._dropdown,$("bs-dropdown-container .dropdown-menu")),c.adjustContainerRightEdges($("bs-dropdown-container"),this.nativeElement,this.bsDropdown._dropdown,$("bs-dropdown-container .dropdown-menu"))},t.prototype.onDatePickerOpen=function(){this.isDateOpen=!this.isDateOpen,this.toggleTimePicker(!1),this.$element.find(".model-holder").width("1px"),$("bs-datepicker-container").attr("aria-label","Use Arrow keys to navigate dates, Choose Date from datepicker"),$(".bs-calendar-container").removeAttr("role");var e=$(".bs-datepicker-container")[0];this.focusTrap=s.setFocusTrap(e,!0),this.focusTrap.activate(),this.bsDateValue?this.activeDate=this.bsDateValue:this.activeDate=new Date,this.bsDateValue||this.hightlightToday(),this.addDatepickerKeyboardEvents(this,!0),c.adjustContainerPosition($("bs-datepicker-container"),this.nativeElement,this.bsDatePickerDirective._datepicker)},t.prototype.onModelUpdate=function(e,t){if("date"===t&&(this.invalidDateTimeFormat=!1,c.getFormattedDate(this.datePipe,e,this.dateInputFormat,this.timeZone,this.key,this.isCurrentDate,this)===this.displayValue&&$(this.nativeElement).find(".display-input").val(this.displayValue)),this.minDateMaxDateValidationOnInput(e),!e)return this.bsDateValue&&this.bsTimePicker&&(""===this.bsTimePicker.hours||""===this.bsTimePicker.minutes||""===this.bsTimePicker.seconds)?this.bsDateValue=this.bsTimeValue=this.proxyModel=moment(this.bsDateValue).startOf("day").toDate():this.bsDateValue=this.bsTimeValue=this.proxyModel=void 0,void((e!==this.datavalue||!this.datavalue&&this.prevDatavalue)&&this._debouncedOnChange(this.datavalue,{},!0));"date"===t&&this.isDateOpen&&this.toggleTimePicker(!0),this.proxyModel=e,this.proxyModel&&(this.bsDateValue=this.bsTimeValue=e),this._debouncedOnChange(this.datavalue,{},!0),this.cdRef.detectChanges();var n=$(".bs-timepicker-field");if(this.timeZone&&"datetimestamp"===this.key&&n.length){var i=c.getFormattedDate(this.datePipe,e,this.getTimePattern(),this.timeZone,this.key,null,this);this.updateTimepickerFields(i,n)}},t.prototype.getTimePattern=function(){var e,t=this.datepattern.toLowerCase().indexOf("h"),n=this.datepattern.toLowerCase().indexOf(":ss");(n>-1||(n=this.datepattern.toLowerCase().indexOf(":mm"))>-1)&&(n+=3);var i=this.datepattern.toLowerCase().indexOf("a");return e=this.datepattern.substr(t,n),i>-1&&(e+=" a"),e},t.prototype.updateTimepickerFields=function(e,t){for(var n,i=$("timepicker button.text-center"),o=e.split(" "),a=o[0].split(":"),r=0;r<t.length;r++)t[r].value=a[r];(null===(n=null==i?void 0:i.html())||void 0===n?void 0:n.trim())!==o[1]&&i.text(o[1])},t.prototype.preventTpClose=function(e){e.stopImmediatePropagation()},t.prototype.toggleDpDropdown=function(e,t){void 0===t&&(t=!1),this.loadNativeDateInput?t||this.onDateTimeInputFocus():("click"===e.type&&this.invokeEventCallback("click",{$event:e}),e.target&&$(e.target).is("input")&&!this.isDropDownDisplayEnabledOnInput(this.showdropdownon)?e.stopPropagation():(this.bsDatePickerDirective.toggle(),this.addBodyClickListener(this.bsDatePickerDirective.isOpen)))},t.prototype.addBodyClickListener=function(e){var t=this;if(e){var n=document.querySelector("body");setTimeout((function(){var e=n.querySelector("."+t.dateContainerCls);t.deregisterDatepickerEventListener=c.addEventListenerOnElement(n,e,t.nativeElement,"click",t.isDropDownDisplayEnabledOnInput(t.showdropdownon),(function(){t.bsDatePickerDirective.hide()}),0,!0)}),350)}},t.prototype.hideDatepickerDropdown=function(){var e;this.isDateOpen=!1,null===(e=this.focusTrap)||void 0===e||e.deactivate(),this.invokeOnTouched(),this.bsDatePickerDirective.hide(),this.bsDateValue&&this.toggleTimePicker(!0),this.isEnterPressedOnDateInput=!1,this.deregisterDatepickerEventListener&&this.deregisterDatepickerEventListener();var t=$(this.nativeElement).closest(".app-composite-widget.caption-floating");t.length>0&&this.app.notify("captionPositionAnimate",{displayVal:this.displayValue,nativeEl:t}),this.blurDateInput(this.isDateOpen)},t.prototype.onDateChange=function(e,t){if(this.isEnterPressedOnDateInput)this.isEnterPressedOnDateInput=!1;else{var n=e.target.value.trim();n=n?c.getNativeDateObject(n,{pattern:this.loadNativeDateInput?this.outputformat:this.datepattern,meridians:this.meridians,isNativePicker:this.loadNativeDateInput}):void 0,this.formatValidation(n,e.target.value,t)&&(t&&this.minDateMaxDateValidationOnInput(n,e,this.displayValue,t)||(this.invalidDateTimeFormat=!1,this.onModelUpdate(n)))}},t.prototype.onDisplayKeydown=function(e){if(this.isDropDownDisplayEnabledOnInput(this.showdropdownon)){e.stopPropagation();var t=e.target.value.trim(),n=this.keyEventPlugin.constructor.getEventFullKey(e);if("enter"===n||"arrowdown"===n){t=t?c.getNativeDateObject(t,{pattern:this.loadNativeDateInput?this.outputformat:this.datepattern,meridians:this.meridians}):void 0,e.preventDefault();var i=c.getFormattedDate(this.datePipe,t,this.dateInputFormat,this.timeZone,this.key,this.isCurrentDate,this),o=e.target.value.trim();o&&"timestamp"===this.datepattern?_.isNaN(o)||_.parseInt(o)===i||(this.invalidDateTimeFormat=!0,this.invokeOnChange(this.datavalue,e,!1)):o&&o!==i?(this.invalidDateTimeFormat=!0,this.invokeOnChange(this.datavalue,e,!1)):(this.invalidDateTimeFormat=!1,this.isEnterPressedOnDateInput=!0,this.bsDatePickerDirective.bsValue=t),this.toggleDpDropdown(e)}else this.hideDatepickerDropdown(),this.hideTimepickerDropdown()}else this.hideDatepickerDropdown(),this.hideTimepickerDropdown()},t.prototype.isValid=function(e){if(!e){var t=$(this.nativeElement).find("input").val(),n=c.getNativeDateObject(t,{pattern:this.loadNativeDateInput?this.outputformat:this.datepattern,meridians:this.meridians,isNativePicker:this.loadNativeDateInput});if(!this.formatValidation(n,t))return}},t.prototype.handleEvent=function(t,n,i,o){_.includes(["blur","focus","change","click"],n)||e.prototype.handleEvent.call(this,t,n,i,o)},t.prototype.onInputBlur=function(e){$(e.relatedTarget).hasClass("current-date")||(this.invokeOnTouched(),this.invokeEventCallback("blur",{$event:e}))},t}(E);k.initializeProps=I(),k.decorators=[{type:t.Component,args:[{selector:"[wmDateTime]",template:' <div dropdown\n [isOpen]="isTimeOpen"\n autoClose="false"\n [container]="\'body\'"\n (onShown)="onTimepickerOpen()"\n style="display: inherit;">\n <input class="form-control app-textbox display-input"\n [attr.aria-label]="hint"\n focus-target\n [name]="name"\n [tabindex]="loadNativeDateInput ? \'-1\' : tabindex"\n [attr.aria-hidden]="!!loadNativeDateInput"\n type="text"\n [value]="displayValue"\n (click)="toggleDpDropdown($event, true)"\n (focus)="onDateTimeInputFocus(); invokeOnFocus($event);"\n (blur)="onInputBlur($event)"\n (change)="onDateChange($event)"\n [autofocus]="autofocus"\n [disabled]="disabled || readonly || isCurrentDate"\n [required]="required"\n [readOnly]="isReadOnly"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n (keydown)="this._triggeredByUser = true; onDisplayKeydown($event)">\n\n <span class="input-group-btn">\n <button type="button"\n class="btn btn-default btn-date"\n [tabindex]="loadNativeDateInput ? \'-1\' : tabindex"\n [attr.aria-hidden]="!!loadNativeDateInput"\n [disabled]="disabled || readonly || isCurrentDate"\n [attr.aria-label]="displayValue ? \'Change Date \' + displayValue : \'Choose date by pressing enter\'"\n aria-haspopup="true"\n aria-expanded="false"\n (click)="toggleDpDropdown($event, false)">\n <i aria-hidden="true"\n class="app-icon wm-sl-l sl-calendar"></i>\n </button>\n <button type="button"\n class="btn btn-default btn-time"\n [tabindex]="loadNativeDateInput ? \'-1\' : tabindex"\n [attr.aria-hidden]="!!loadNativeDateInput"\n [disabled]="disabled || readonly || isCurrentDate"\n aria-label="Select time"\n aria-haspopup="true"\n aria-expanded="false"\n (click)="toggleTimePicker(!isTimeOpen, $event)">\n <i aria-hidden="true"\n class="app-icon wm-sl-l sl-time"></i>\n </button>\n </span>\n <div style="width: 0;display: inline-block;">\n <input class="model-holder"\n aria-label="datepicker dropdownmenu"\n aria-controls="date"\n focus-target\n [tabindex]="-1"\n [attr.aria-hidden]="!!loadNativeDateInput"\n [container]="containerTarget || \'body\'"\n [bsConfig]="_dateOptions"\n [isOpen]="isDateOpen"\n placement="bottom right"\n (onShown)="onDatePickerOpen()"\n (onHidden)="hideDatepickerDropdown()"\n [daysDisabled]="excludedDaysToDisable"\n [datesDisabled]="excludedDatesToDisable"\n #datepicker=bsDatepicker\n bsDatepicker\n [isDisabled]="disabled || readonly || isCurrentDate"\n [bsValue]="bsDateValue"\n (bsValueChange)="onModelUpdate($event, \'date\')">\n </div>\n <div *dropdownMenu\n class="dropdown-menu"\n aria-label="timepicker dropdown"\n aria-controls="time"\n (click)="preventTpClose($event)">\n <timepicker class="model-holder"\n [showMeridian]="ismeridian"\n [readonlyInput]="disabled || readonly || isCurrentDate"\n [(ngModel)]="bsTimeValue"\n [min]="minTime"\n [max]="maxTime"\n [hourStep]="hourstep"\n [minuteStep]="minutestep"\n [secondsStep]="secondsstep"\n [mousewheel]="true"\n [arrowkeys]="true"\n (isValid)="isValid($event)"\n [showSeconds]="showseconds"\n (ngModelChange)="onModelUpdate($event, \'time\')"></timepicker>\n </div>\n </div>\n<ng-template [ngIf]="loadNativeDateInput">\n <wm-datetimepicker\n dateTimePicker\n [config]="_dateOptions"\n [placement]="modal"\n [excludedDaysToDisable]="excludedDaysToDisable"\n [excludedDatesToDisable]="excludedDatesToDisable"\n [displayFormat]="dateInputFormat"\n [value]="bsDateValue"\n (change)="onModelUpdate($event, \'date\')">\n </wm-datetimepicker>\n <div class="mobile-input mobile-datepicker-container"\n [tabindex]="tabindex || 0"\n (focus)="onDateTimeInputFocus(true); invokeOnFocus($event)"\n (blur)="onDateTimeInputBlur(); invokeOnTouched($event)"\n (click)="!(disabled || readonly || isCurrentDate) && showDatePickerModal()">\n </div>\n</ng-template>\n',providers:[s.provideAs(k,i.NG_VALUE_ACCESSOR,!0),s.provideAs(k,i.NG_VALIDATORS,!0),s.provideAsWidgetRef(k),{provide:r.TimepickerConfig,deps:[c.AbstractI18nService],useFactory:N}]}]}],k.ctorParameters=function(){return[{type:t.Injector},{type:t.NgZone},{type:t.ChangeDetectorRef},{type:c.AppDefaults},{type:c.App},{type:void 0,decorators:[{type:t.Inject,args:[l.EVENT_MANAGER_PLUGINS]}]}]},k.propDecorators={bsDatePickerDirective:[{type:t.ViewChild,args:[o.BsDatepickerDirective]}]};var M=new Map([["autofocus",s.PROP_BOOLEAN],["class",s.PROP_STRING],["dataentrymode",Object.assign({value:"default"},s.PROP_STRING)],["datavaluesource",s.PROP_ANY],["datavalue",s.PROP_STRING],["disabled",s.PROP_BOOLEAN],["hint",s.PROP_STRING],["hourstep",Object.assign({value:1},s.PROP_NUMBER)],["maxtime",s.PROP_STRING],["mintime",s.PROP_STRING],["minutestep",Object.assign({value:15},s.PROP_NUMBER)],["name",s.PROP_STRING],["outputformat",Object.assign({value:"HH:mm:ss"},s.PROP_STRING)],["placeholder",Object.assign({value:"Select time"},s.PROP_STRING)],["readonly",s.PROP_BOOLEAN],["required",s.PROP_BOOLEAN],["shortcutkey",s.PROP_STRING],["show",Object.assign({value:!0},s.PROP_BOOLEAN)],["showdropdownon",Object.assign({value:"default"},s.PROP_STRING)],["showcustompicker",Object.assign({value:!1},s.PROP_BOOLEAN)],["secondsstep",Object.assign({value:1},s.PROP_NUMBER)],["tabindex",Object.assign({value:0},s.PROP_NUMBER)],["timepattern",s.PROP_STRING],["timestamp",s.PROP_STRING]]),L=function(){s.register("wm-time",M),s.registerFormWidget(c.FormWidgetType.TIME,new Map(M))},F="CURRENT_TIME",j={widgetType:"wm-time",hostClass:"input-group app-timeinput"},B=O,G=function(e){function t(t,n,i,o,a){var r=e.call(this,t,j)||this;return r.ngZone=n,r.appDefaults=i,r.status={isopen:!1},r.keyEventPlugin=a[1],s.styler(r.nativeElement,r),r.registerDestroyListener((function(){return r.clearTimeInterval()})),r.timepattern=r.appDefaults.timeFormat||c.getDisplayDateTimeFormat(c.FormWidgetType.TIME),r.updateFormat("timepattern"),r.app=o,r}return h(t,e),Object.defineProperty(t.prototype,"timestamp",{get:function(){return this.bsTimeValue?this.bsTimeValue.valueOf():void 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"datavalue",{get:function(){return this.isCurrentTime&&!this.bsTimeValue?F:c.getFormattedDate(this.datePipe,this.bsTimeValue,this.outputformat,this.timeZone,null,null,this)||""},set:function(e){e?e===F?(this.isCurrentTime=!0,this.setTimeInterval()):(this.clearTimeInterval(),this.bsTimeValue=c.getNativeDateObject(e,{pattern:this.loadNativeDateInput?this.outputformat:void 0,isNativePicker:this.loadNativeDateInput}),this.isCurrentTime=!1,this.mintimeMaxtimeValidation()):(this.bsTimeValue=void 0,this.clearTimeInterval(),this.isCurrentTime=!1),this.invokeOnChange(this.datavalue),c.$appDigest()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"displayValue",{get:function(){return c.getFormattedDate(this.datePipe,this.bsTimeValue,this.timepattern,this.timeZone,null,null,this)||""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nativeDisplayValue",{get:function(){return c.getFormattedDate(this.datePipe,this.bsTimeValue,"HH:mm:ss",this.timeZone,null,null,this)||""},enumerable:!1,configurable:!0}),t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("timepattern"===t&&this.updateFormat("timepattern"),"mintime"===t?(this.minTime=c.getNativeDateObject(n,{pattern:this.loadNativeDateInput?this.outputformat:void 0,isNativePicker:this.loadNativeDateInput}),this.mintimeMaxtimeValidation()):"maxtime"===t?(this.maxTime=c.getNativeDateObject(n,{pattern:this.loadNativeDateInput?this.outputformat:void 0,isNativePicker:this.loadNativeDateInput}),this.mintimeMaxtimeValidation()):e.prototype.onPropertyChange.call(this,t,n,i))},t.prototype.setValidateType=function(e,t,n){this.timeNotInRange&&(n<e?this.validateType="mintime":n>t&&(this.validateType="maxtime"))},t.prototype.mintimeMaxtimeValidation=function(){this.timeNotInRange=this.minTime&&this.maxTime&&(this.bsTimeValue<this.minTime||this.bsTimeValue>this.maxTime),this.setValidateType(this.minTime,this.maxTime,this.bsTimeValue),this.invokeOnChange(this.datavalue,void 0,!1)},t.prototype.toggleDropdown=function(e,t){var n=this;void 0===t&&(t=!1),this.loadNativeDateInput?t||this.onDateTimeInputFocus():("click"===e.type&&this.invokeEventCallback("click",{$event:e}),e.target&&$(e.target).is("input")&&!this.isDropDownDisplayEnabledOnInput(this.showdropdownon)||(this.ngZone.run((function(){n.status.isopen=!n.status.isopen})),this.addBodyClickListener(this.status.isopen)))},t.prototype.preventTpClose=function(e){e.stopImmediatePropagation();var t=$(this.nativeElement).closest(".app-composite-widget.caption-floating");t.length>0&&this.app.notify("captionPositionAnimate",{displayVal:this.displayValue,nativeEl:t})},t.prototype.addBodyClickListener=function(e){var t=this;if(e){var n=document.querySelector("body");setTimeout((function(){var e=$(n).find(">bs-dropdown-container .dropdown-menu").get(0);t.deregisterEventListener=c.addEventListenerOnElement(n,e,t.nativeElement,"click",t.isDropDownDisplayEnabledOnInput(t.showdropdownon),(function(){t.status.isopen=!1}),0,!0)}),350)}},t.prototype.onDisplayKeydown=function(e){if(this.isDropDownDisplayEnabledOnInput(this.showdropdownon)){e.stopPropagation();var t=this.keyEventPlugin.constructor.getEventFullKey(e);"enter"===t||"arrowdown"===t?(e.preventDefault(),this.toggleDropdown(e)):this.hideTimepickerDropdown()}else this.hideTimepickerDropdown()},t.prototype.onDisplayTimeChange=function(e){var t=c.getNativeDateObject(e.target.value,{meridians:this.meridians,pattern:this.loadNativeDateInput?this.outputformat:void 0,isNativePicker:this.loadNativeDateInput});this.formatValidation(t,e.target.value)&&(this.invalidDateTimeFormat=!1,this.onTimeChange(t))},t.prototype.onInputBlur=function(e){$(e.relatedTarget).hasClass("bs-timepicker-field")||(this.invokeOnTouched(),this.invokeEventCallback("blur",{$event:e}))},t.prototype.onTimeChange=function(e,t){var n,i,o;t&&(e=c.getNativeDateObject(e.target.value,{pattern:this.loadNativeDateInput?this.outputformat:void 0,isNativePicker:this.loadNativeDateInput})),e?(this.bsTimeValue=e,this.timeNotInRange=this.minTime&&this.maxTime&&(e<this.minTime||e>this.maxTime),this.setValidateType(this.minTime,this.maxTime,e)):(this.bsTimePicker&&this.bsTimePicker.min&&this.bsTimePicker.max&&(o=moment(new Date(this.bsTimePicker.min)).format("A"),moment(new Date(this.bsTimePicker.max)).format("A"),n=this.bsTimePicker.hours+":"+(this.bsTimePicker.minutes||0)+":"+(this.bsTimePicker.seconds||0)+(this.bsTimePicker.showMeridian?" "+o:""),i=c.getNativeDateObject(n,{pattern:this.loadNativeDateInput?this.outputformat:void 0,isNativePicker:this.loadNativeDateInput}),this.bsTimePicker.meridian=o,this.timeNotInRange=this.bsTimePicker.min>i||this.bsTimePicker.max<i,this.setValidateType(this.bsTimePicker.min,this.bsTimePicker.max,i)),this.bsTimeValue=i),this.invokeOnTouched(),this.invokeOnChange(this.datavalue,{},!0)},t.prototype.setTimeInterval=function(){var e=this;this.timeinterval||(this.timeinterval=setInterval((function(){var t=e.timeZone?c.getMomentLocaleObject(e.timeZone):new Date;t.setSeconds(t.getSeconds()+1),e.datavalue=F,e.onTimeChange(t)}),1e3))},t.prototype.clearTimeInterval=function(){this.timeinterval&&(clearInterval(this.timeinterval),this.timeinterval=null)},t.prototype.setIsTimeOpen=function(e){this.status.isopen=e},t.prototype.handleEvent=function(t,n,i,o){_.includes(["blur","focus","change","click"],n)||e.prototype.handleEvent.call(this,t,n,i,o)},t.prototype.hideTimepickerDropdown=function(){this.invokeOnTouched(),this.status.isopen=!1,this.deregisterEventListener&&this.deregisterEventListener(),this.removeKeyupListener();var e=$(this.nativeElement).closest(".app-composite-widget.caption-floating");e.length>0&&this.app.notify("captionPositionAnimate",{displayVal:this.displayValue,nativeEl:e}),this.blurDateInput(!0)},t.prototype.isValid=function(e){if(!e){var t=$(this.nativeElement).find("input").val(),n=c.getNativeDateObject(t,{meridians:this.meridians,pattern:this.loadNativeDateInput?this.outputformat:void 0,isNativePicker:this.loadNativeDateInput});if(!this.formatValidation(n,t))return}},t.prototype.onShown=function(){var e=document.querySelectorAll("timepicker");_.forEach(e,(function(e){c.addClass(e.parentElement,"app-datetime",!0)})),this.focusTimePickerPopover(this),this.bindTimePickerKeyboardEvents(),c.adjustContainerPosition($("bs-dropdown-container"),this.nativeElement,this.bsDropdown._dropdown,$("bs-dropdown-container .dropdown-menu"))},t.prototype.assignModel=function(){this.displayInputElem||(this.displayInputElem=this.getMobileInput()),this.displayInputElem.value=_.get(this,"nativeDisplayValue")},t}(E);G.initializeProps=L(),G.decorators=[{type:t.Component,args:[{selector:"[wmTime]",template:' <div dropdown [isOpen]="status.isopen" (onShown)="onShown()" (onHidden)="hideTimepickerDropdown()" [container]="\'body\'" style="display: inherit">\n <input class="form-control app-textbox display-input" [attr.aria-label]="hint"\n focus-target\n [tabindex]="tabindex"\n [name]="name"\n type="text"\n role="timer"\n [value]="displayValue"\n [disabled]="disabled || readonly || isCurrentTime"\n [autofocus]="autofocus"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-atomic]="isCurrentTime ? \'true\' : \'false\'"\n [required]="required"\n [readOnly]="isReadOnly"\n (click)="toggleDropdown($event, true)"\n (focus)="onDateTimeInputFocus(); invokeOnFocus($event);"\n (blur)="onInputBlur($event)"\n (change)="onDisplayTimeChange($event)"\n (keydown)="this._triggeredByUser = true; onDisplayKeydown($event)">\n <span class="input-group-btn dropdown-toggle">\n <button type="button" class="btn btn-default btn-date" [tabindex]="tabindex" [disabled]="disabled || readonly || isCurrentTime" aria-label="Select time" aria-haspopup="true" aria-expanded="false" (click)="toggleDropdown($event, false)"><i aria-hidden="true" class="app-icon wm-sl-l sl-time"></i></button>\n </span>\n <div *dropdownMenu class="dropdown-menu" (click)="preventTpClose($event)">\n <timepicker class="model-holder"\n [showMeridian]="ismeridian"\n [readonlyInput]="isDisabled"\n [(ngModel)]="bsTimeValue"\n [disabled]="disabled || readonly || isCurrentTime"\n [min]="minTime"\n [max]="maxTime"\n [hourStep]="hourstep"\n [minuteStep]="minutestep"\n [secondsStep]="secondsstep"\n [mousewheel]="true"\n [arrowkeys]="true"\n (isValid)="isValid($event)"\n [showSeconds]="showseconds" (ngModelChange)="onTimeChange($event)"></timepicker>\n </div>\n </div>\n<ng-template [ngIf]="loadNativeDateInput">\n <wm-datetimepicker\n dateTimePicker\n mode="TIME"\n [minTime]="minTime"\n [maxTime]="maxTime"\n [placement]="modal"\n [displayFormat]="timepattern"\n [value]="bsTimeValue"\n (change)="onTimeChange($event)">\n </wm-datetimepicker>\n <div class="mobile-input mobile-datepicker-container"\n tabindex="1000000"\n (focus)="onDateTimeInputFocus(true); invokeOnFocus($event); assignModel()"\n (blur)="onDateTimeInputBlur(); invokeOnTouched($event)"\n (click)="!(disabled || readonly || isCurrentTime) && showDatePickerModal()">\n </div>\n</ng-template>\n',providers:[s.provideAs(G,i.NG_VALUE_ACCESSOR,!0),s.provideAs(G,i.NG_VALIDATORS,!0),s.provideAsWidgetRef(G),{provide:r.TimepickerConfig,deps:[c.AbstractI18nService],useFactory:B}]}]}],G.ctorParameters=function(){return[{type:t.Injector},{type:t.NgZone},{type:c.AppDefaults},{type:c.App},{type:void 0,decorators:[{type:t.Inject,args:[l.EVENT_MANAGER_PLUGINS]}]}]};var V=function(){};V.decorators=[{type:t.Component,args:[{selector:"wm-pickergroup",template:'\n <div class="app-picker-group">\n <ng-content></ng-content>\n </div>\n '}]}];var W=function(){function e(e){this.inj=e,this.change=new t.EventEmitter,this._selectedIndex=0,this._options=[],this.noOfEmptyElements=2,this.$el=$(e.get(t.ElementRef).nativeElement)}return Object.defineProperty(e.prototype,"selectedValue",{get:function(){return this._selectedValue},set:function(e){this._selectedValue=e,this.reRender()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return this._options},set:function(e){this._options=e.map((function(e){return{label:e.label,value:void 0!==e.value?e.value:e.label}})),this.reRender()},enumerable:!1,configurable:!0}),e.prototype.reRender=function(){var e,t=this;this._selectedIndex=this.options.findIndex((function(e){return e.value===t.selectedValue})),null===(e=this.pickerAnimator)||void 0===e||e.select(this._selectedIndex+this.noOfEmptyElements)},Object.defineProperty(e.prototype,"selectedIndex",{get:function(){return this._selectedIndex},set:function(e){this._selectedIndex=e,this._selectedValue=this.options[e].value,this.change.emit(this.options[e])},enumerable:!1,configurable:!0}),e.prototype.ngAfterViewInit=function(){this.pickerAnimator=new U(this)},e}();W.decorators=[{type:t.Component,args:[{selector:"wm-picker",template:'\n <div class="app-picker">\n <div class="app-picker-option-container">\n <div class="app-picker-option app-picker-empty-option">E</div>\n <div class="app-picker-option app-picker-empty-option">E</div>\n <div *ngFor="let option of options; index as i;" class="app-picker-option">\n {{option.label}}\n </div>\n <div class="app-picker-option app-picker-empty-option">E</div>\n <div class="app-picker-option app-picker-empty-option">E</div>\n </div>\n <div class="app-picker-ruler"></div>\n </div>\n '}]}],W.ctorParameters=function(){return[{type:t.Injector}]},W.propDecorators={change:[{type:t.Output}],selectedValue:[{type:t.Input}],options:[{type:t.Input}]};var U=function(){function e(e){var t=this;this.picker=e;var n=e.selectedIndex+e.noOfEmptyElements,i=function(e){return n+Math.floor(e/16)};this.select(n),this.getElement().swipey({direction:$.fn.swipey.DIRECTIONS.VERTICAL,threshold:10,target:e.$el,onSwipe:function(e,n){t.select(i(-1*n.length))},onSwipeEnd:function(o,a){var r=i(-1*a.length);t.select(r),n=e.selectedIndex+e.noOfEmptyElements}})}return e.prototype.getElement=function(){return this.picker.$el.find(".app-picker-option-container:first")},e.prototype.getOptionElements=function(){return this.getElement().find(".app-picker-option")},e.prototype.select=function(e){var t=this.getOptionElements();if(!(e<this.picker.noOfEmptyElements||e>=t.length-this.picker.noOfEmptyElements)){this.getElement().find(".app-picker-option.app-picker-option-selected").removeClass("app-picker-option-selected"),t.eq(e).addClass("app-picker-option-selected"),this.picker.selectedIndex=e-this.picker.noOfEmptyElements;var n=e-this.picker.noOfEmptyElements,i=e+this.picker.noOfEmptyElements;t.each((function(t,o){if(t>=n&&t<=i){var a=30*(t-e),r=1-.3*Math.abs(t-e);$(o).css({transform:"perspective(500px) rotateX("+a+"deg)",opacity:r}).show()}else $(o).hide()}))}},e}(),q=[S,k,G,g,v,W,V],z=function(){};z.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,o.BsDatepickerModule,a.BsDropdownModule,i.FormsModule,r.TimepickerModule,s.WmComponentsModule],declarations:f([],m(q)),exports:f([],m(q)),entryComponents:[]}]}],e.DateComponent=S,e.DatetimeComponent=k,e.EpochModule=z,e.TimeComponent=G,e["\u02750"]=N,e["\u0275a"]=O,e["\u0275b"]=E,e["\u0275c"]=g,e["\u0275d"]=v,e["\u0275e"]=A,e["\u0275f"]=I,e["\u0275g"]=L,e["\u0275h"]=V,e["\u0275i"]=W,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"),require("@wm/core")):"function"==typeof define&&define.amd?define("@wm/components/input/file-upload",["exports","@angular/core","@angular/common","@wm/components/base","rxjs","@wm/core"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.input=e.wm.components.input||{},e.wm.components.input.fileupload={}),e.ng.core,e.ng.common,e.wm.components.base,e.rxjs,e.wm.core)}(this,(function(e,t,n,i,o,a){"use strict";
|
|
198
198
|
/*! *****************************************************************************
|
|
199
199
|
Copyright (c) Microsoft Corporation.
|
|
200
200
|
|
|
@@ -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",
|
|
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,PROP_BOOLEAN: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(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(),""!==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";
|
|
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";
|
|
521
521
|
/*! *****************************************************************************
|
|
522
522
|
Copyright (c) Microsoft Corporation.
|
|
523
523
|
|
|
@@ -657,7 +657,7 @@ var c=function(e,t){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Arr
|
|
|
657
657
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
658
658
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
659
659
|
PERFORMANCE OF THIS SOFTWARE.
|
|
660
|
-
***************************************************************************** */var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}Object.create;function l(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,a=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return r}function c(e,t,n){if(n||2===arguments.length)for(var i,o=0,a=t.length;o<a;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var p=function(e){function t(t){var n=e.call(this)||this;return n.tabs=t,n._$el=$(n.tabs.getNativeElement()).find(">.tab-content"),n.init(n._$el),n}return s(t,e),t.prototype.calibrate=function(){var e=this.tabs.getActiveTabIndex(),t=this._$el.find(">.tab-pane"),n=0,i=0,o=[];return t.each((function(t,a){return $(a).prop("hidden")||(i++,t===e&&(n=i-1),o.push(a)),!0})),{activeTabIndex:n,noOfTabs:i,panes:o}},t.prototype.bounds=function(){var e=this.calibrate(),t=e.activeTabIndex,n=e.noOfTabs,i=e.panes,o=$(i[0]).width(),a=-1*t*o;return this.clearContentFocus(),{strict:!1,lower:t===n-1?0:-o,center:a,upper:0===t?a:o}},t.prototype.context=function(){return{w:this._$el.width()}},t.prototype.animation=function(){return{transform:"translate3d(${{ ($D + $d)/w * 100 + '%'}}, 0, 0)","-webkit-transform":"translate3d(${{ ($D + $d)/w * 100 + '%'}}, 0, 0)"}},t.prototype.clearContentFocus=function(){var e=this._$el.find(">.tab-pane.active");e.length&&e.find(document.activeElement).length&&document.activeElement.blur()},t.prototype.transitionTabIntoView=function(){var e=this.calibrate(),t=e.activeTabIndex,n=e.noOfTabs,i=e.panes,a=100*n+"%";o.setCSSFromObj(this._$el[0],{maxWidth:a,width:a}),o.addClass(this.tabs.getNativeElement(),"has-transition");var r=100/n+"%";i.forEach((function(e){o.setCSS(e,"width",r)})),o.setCSS(this._$el[0],"transform","translate3d("+-1*t/n*100+"%, 0, 0)")},t.prototype.onUpper=function(e){this.tabs.prev(e),o.$appDigest()},t.prototype.onLower=function(e){this.tabs.next(e),o.$appDigest()},t.prototype.threshold=function(){return 5},t}(a.SwipeAnimation),d=function(){var e=new Map([["class",i.PROP_STRING],["dataset",i.PROP_ANY],["defaultpaneindex",Object.assign({value:0},i.PROP_NUMBER)],["justified",i.PROP_BOOLEAN],["tabsposition",Object.assign({value:"top"},i.PROP_STRING)],["name",i.PROP_STRING],["nodatamessage",Object.assign({value:"No Data Found"},i.PROP_STRING)],["show",Object.assign({value:!0},i.PROP_BOOLEAN)],["statehandler",Object.assign({value:"none"},i.PROP_STRING)],["transition",i.PROP_STRING],["type",i.PROP_STRING]]);o.isMobileApp()&&e.set("transition",Object.assign({value:"slide"},i.PROP_STRING)),i.register("wm-tabs",e)},u=function(){i.register("wm-tabpane",new Map([["active",i.PROP_BOOLEAN],["badgevalue",i.PROP_STRING],["badgetype",Object.assign({value:"default"},i.PROP_STRING)],["class",i.PROP_STRING],["content",i.PROP_STRING],["disabled",i.PROP_BOOLEAN],["dynamicPaneIndex",i.PROP_NUMBER],["heading",i.PROP_STRING],["isdefaulttab",i.PROP_STRING],["isdynamic",i.PROP_BOOLEAN],["name",i.PROP_STRING],["paneicon",i.PROP_STRING],["show",Object.assign({value:!0},i.PROP_BOOLEAN)],["smoothscroll",Object.assign({value:!1},i.PROP_BOOLEAN)],["title",Object.assign({value:"Tab Title"},i.PROP_STRING)]]))},h={widgetType:"wm-tabpane",hostClass:"tab-pane"},m=function(e){function t(t,n,i,a){var r=e.call(this,t,h)||this;return r.tabsRef=n,r.heading=i,r.title=a,r._isFirstLoad=!0,r._isOnLoadTriggered=!1,r.$lazyLoad=o.noop,r.isActive=!1,r.disabled=!1,o.removeAttr(r.nativeElement,"title"),r}return s(t,e),t.prototype.invokeOnSelectCallback=function(e){this.invokeEventCallback("select",{$event:e})},t.prototype.select=function(e){this.isActive||this.disabled||(this.isActive=!0,this.$lazyLoad(),this.redrawChildren(),this.notifyParent(e))},t.prototype.tabpaneHeaderClick=function(e,t){this.invokeEventCallback("headerclick",{$event:e,paneIndex:t})},t.prototype.deselect=function(){this.isActive&&(this.isActive=!1,this.invokeEventCallback("deselect"))},t.prototype.remove=function(){this.isActive&&(this===this.tabsRef.panes.last?this.tabsRef.prev():this.tabsRef.next());var e=this.tabsRef.panes.toArray();e.splice(this.tabsRef.getPaneIndexByRef(this),1),this.tabsRef.panes.reset(c([],l(e))),this.nativeElement.remove(),this.tabsRef.$element.find(".tab-header[data-paneid='"+this.$element.attr("widget-id")+"'] a").remove()},t.prototype.redrawChildren=function(){var e=this;setTimeout((function(){e.reDrawableComponents&&e.reDrawableComponents.forEach((function(e){return e.redraw()})),e._isOnLoadTriggered||e.content||(e.invokeEventCallback("load"),e._isOnLoadTriggered=!0)}),100)},t.prototype.notifyParent=function(e){this.tabsRef.notifyChange(this,e)},t.prototype.handleSwipeLeft=function(){this.tabsRef.next()},t.prototype.handleSwipeRight=function(){this.tabsRef.prev()},t.prototype.handleEvent=function(t,n,i,o){"select"!==n&&e.prototype.handleEvent.call(this,this.nativeElement,n,i,o)},t.prototype.onPropertyChange=function(t,n,i){var o,a=this;"content"===t?this.isActive&&setTimeout((function(){return a.$lazyLoad()}),100):"show"===t?(this.nativeElement.hidden=!n,this._isFirstLoad?this.tabsRef.selectDefaultPaneByIndex(this.tabsRef.defaultpaneindex):!n&&this.isActive?this.tabsRef.next():!n&&this.isActive||null===(o=this.tabsRef.tabsAnimator)||void 0===o||o.transitionTabIntoView(),this._isFirstLoad=!1):e.prototype.onPropertyChange.call(this,t,n,i)},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.title=this.title||this.heading},t.prototype.ngAfterViewInit=function(){i.styler(this.nativeElement.querySelector(".tab-body"),this,i.APPLY_STYLES_TYPE.CONTAINER),e.prototype.ngAfterViewInit.call(this),this.isdynamic&&this.tabsRef.registerDynamicTab(this)},t}(i.StylableComponent);m.initializeProps=u(),m.decorators=[{type:t.Component,args:[{selector:"div[wmTabPane]",template:'<div class="tab-body" partial-container-target [wmSmoothscroll]="smoothscroll">\n <ng-content></ng-content>\n</div>',providers:[i.provideAsWidgetRef(m)]}]}],m.ctorParameters=function(){return[{type:t.Injector},{type:g},{type:void 0,decorators:[{type:t.Attribute,args:["heading"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["title"]}]}]},m.propDecorators={isActive:[{type:t.HostBinding,args:["class.active"]}],disabled:[{type:t.HostBinding,args:["class.disabled"]}],reDrawableComponents:[{type:t.ContentChildren,args:[i.RedrawableDirective,{descendants:!0}]}]};var f={widgetType:"wm-tabs",hostClass:"app-tabs clearfix"},g=function(e){function t(t,n,a,r,s){var l=this,c=o.noop;return(l=e.call(this,t,f,new Promise((function(e){return c=e})))||this).transition=a,l.tabsposition=r,l.statePersistence=s,l.dynamicComponentProvider=n,l.dynamicTabs=[],l.dynamicPaneIndex=0,l.promiseResolverFn=c,i.styler(l.nativeElement,l,i.APPLY_STYLES_TYPE.CONTAINER),l}return s(t,e),t.prototype.animateIn=function(e){var t=$(e);t.siblings(".active").removeClass("active"),t.addClass("active");var n=this.nativeElement.querySelector("ul.nav.nav-tabs"),i=t.prev();i.length?n.scrollLeft=i[0].offsetLeft:n.scrollLeft=0},t.prototype.registerDynamicTab=function(e){if(this.dynamicTabs.push(e),this.dynamicTabs.length===this.dynamicPaneIndex)for(var t=function(e){var t=_.find(n.dynamicTabs,(function(t){return t.dynamicPaneIndex===e}));_.find(n.panes.toArray(),t)||(n.panes.reset(c(c([],l(n.panes.toArray())),[t])),t.active&&setTimeout((function(){t.select()}),20))},n=this,i=0;i<this.dynamicTabs.length;i++)t(i)},t.prototype.addPane=function(e){var t=this;_.isArray(e)||(e=[e]);var n=[];return _.forEach(e,(function(e,i){var o=_.find(t.panes.toArray(),{name:e.name}),a=_.indexOf(n,e.name);if(o||a>0)console.warn("The tab pane with name "+e.name+" already exists");else{var r="",s="";t.dynamicPaneIndex++;var l=e.name?e.name:"tabpane"+(t.panes.toArray().length+(i+1));n.push(l);var c=_.get(e,"params");_.forEach(e,(function(e,t){"params"!==t&&(s=s+" "+t+'="'+e+'"')})),_.forEach(c,(function(e,t){r=r+' <wm-param name="'+t+'" value="'+e+'"></wm-param>'}));var p='<wm-tabpane dynamicPaneIndex="'+(t.dynamicPaneIndex-1)+'" isdynamic="true" name="'+l+'" '+s+">\n "+r+"\n </wm-tabpane>";t._dynamicContext||(t._dynamicContext=Object.create(t.viewParent),t._dynamicContext[t.getAttr("wmTab")]=t),t.dynamicComponentProvider.addComponent(t.getNativeElement().querySelector(".tab-content"),p,t._dynamicContext,{inj:t.inj})}})),n},t.prototype.removePane=function(e){var t=this.getPaneRefByName(e);t&&t.remove()},t.prototype.notifyChange=function(e,t){if(this.isSelectableTab(e)){var n;_.isEmpty(this.activeTab)||this.activeTab.deselect(),this.activeTab=e.getWidget();var i=this.getPaneIndexByRef(e),o=this.statePersistence.computeMode(this.statehandler);if(!this.isPageLoadCall&&o&&"none"!==o.toLowerCase()?this.statePersistence.setWidgetState(this,this.activeTab.name):(this.defaultpaneindex=this.getPaneIndexByRef(e),this.isPageLoadCall=!1),e.invokeOnSelectCallback(t),t&&this.invokeEventCallback("change",{$event:t,newPaneIndex:i,oldPaneIndex:this._oldPaneIndex||0}),this._oldPaneIndex=i,t&&(n=$(t.target).closest("li.tab-header")),!t||!n||!n.length)n=this.nativeElement.querySelector("li[data-paneid="+e.widgetId+"]"),!!$(n).closest(".app-tabs").parent().closest(".app-tabs").length||$(n).children().focus();this.animateIn(n),this.canSlide()&&(this.tabsAnimator||(this.tabsAnimator=new p(this),this.tabsAnimator.setGesturesEnabled(this.canSlide())),this.tabsAnimator.transitionTabIntoView())}},t.prototype.goToTab=function(e){this.isValidPaneIndex(e-1)&&this.getPaneRefByIndex(e-1).select()},t.prototype.getPaneIndexByRef=function(e){return this.panes.toArray().indexOf(e)},t.prototype.getActiveTabIndex=function(){return _.findIndex(this.panes.toArray(),{isActive:!0})},t.prototype.isValidPaneIndex=function(e){return e>=0&&e<this.panes.length},t.prototype.getPaneRefByIndex=function(e){return this.panes.toArray()[e]},t.prototype.getPaneRefByName=function(e){return _.find(this.panes.toArray(),{name:e})},t.prototype.isSelectableTab=function(e){return e.show&&!e.disabled},t.prototype.canSlide=function(){return"slide"===this.transition&&!this.vertical},t.prototype.getSelectableTabAfterIndex=function(e){for(var t=e+1;t<this.panes.length;t++){var n=this.getPaneRefByIndex(t);if(this.isSelectableTab(n))return n}if(e===this.panes.length-1){n=this.getPaneRefByIndex(0);if(this.isSelectableTab(n))return n}},t.prototype.getSelectableTabBeforeIndex=function(e){for(var t=e-1;t>=0;t--){var n=this.getPaneRefByIndex(t);if(this.isSelectableTab(n))return n}if(0===e){n=this.getPaneRefByIndex(this.panes.length-1);if(this.isSelectableTab(n))return n}},t.prototype.next=function(e){var t=this.getSelectableTabAfterIndex(this.getActiveTabIndex());t&&t.select(e)},t.prototype.prev=function(e){var t=this.getSelectableTabBeforeIndex(this.getActiveTabIndex());t&&t.select(e)},t.prototype.selectDefaultPaneByIndex=function(e){if(this.isValidPaneIndex(e)){var t=this.getPaneRefByIndex(e);this.isSelectableTab(t)||(t=this.getSelectableTabAfterIndex(0)),t&&t.select()}},t.prototype.setTabsPosition=function(){var e=this.nativeElement.children[0];this.vertical="left"===this.tabsposition||"right"===this.tabsposition,o.removeClass(this.nativeElement,"inverted"),"bottom"!==this.tabsposition&&"right"!==this.tabsposition||(o.appendNode(e,this.nativeElement),o.addClass(this.nativeElement,"inverted"))},t.prototype.onDataChange=function(e){var t=this;this.fieldDefs=i.createArrayFrom(e),setTimeout((function(){return t.selectDefaultPaneByIndex(t.defaultpaneindex||0)}))},t.prototype.onPropertyChange=function(t,n,i){var o=this;if("defaultpaneindex"===t)this.defaultpaneindex=n;else if("dataset"===t)this.onDataChange(n);else if("statehandler"===t){this.isPageLoadCall=!0;var a=this.statePersistence.getWidgetState(this);if("none"!==n&&a){var r=this.panes.filter((function(e){return a===e.name}));if(r.length){var s=this.getPaneIndexByRef(r[0]);setTimeout((function(){return o.selectDefaultPaneByIndex(s)}),20)}else console.warn("Tab pane name "+a+" in State is incorrect. Falling back to the default pane"),setTimeout((function(){return o.selectDefaultPaneByIndex(o.defaultpaneindex||0)}),20)}else setTimeout((function(){return o.selectDefaultPaneByIndex(o.defaultpaneindex||0)}),20)}else e.prototype.onPropertyChange.call(this,t,n,i)},t.prototype.registerTabsScroll=function(){var e=this;setTimeout((function(){var t,n=e.$element.find("> ul");(t=n.children().last().position())&&t.left>n.width()&&n.on("mousewheel",(function(e){var t=n[0].scrollLeft,i=-1*e.originalEvent.wheelDelta;e.stopPropagation(),e.preventDefault(),n.animate({scrollLeft:t+i},{duration:10})}))}))},t.prototype.onkeydown=function(e){switch(e.key){case"ArrowLeft":case"ArrowUp":this.prev(),e.preventDefault();break;case"ArrowRight":case"ArrowDown":this.next(),e.preventDefault()}},t.prototype.ngAfterContentInit=function(){var t=this;this.promiseResolverFn(),e.prototype.ngAfterContentInit.call(this),this.setTabsPosition(),this.panes.changes.subscribe((function(e){t.panes.length&&t.selectDefaultPaneByIndex(t.defaultpaneindex||0)}))},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),this.registerTabsScroll()},t}(i.StylableComponent);g.initializeProps=d(),g.decorators=[{type:t.Component,args:[{selector:"div[wmTabs]",template:'<ul class="nav nav-tabs" [ngClass]="{\'nav-stacked\': vertical, \'nav-justified\': justified}" role="tablist">\n <li class="tab-header" *ngFor="let pane of panes; let i=index;" [attr.data-paneid]="pane.widgetId" [ngClass]="{\'active\': pane.isActive, \'disabled\': pane.disabled}"\n [hidden]="!pane.show" role="presentation">\n <a class="tab-heading" href="javascript:void(0);" [attr.aria-label]="pane.title" [attr.title]="pane.title" [tabindex]="pane.isActive ? \'0\' : \'-1\'"\n [attr.aria-selected]="pane.isActive" role="tab" (click)="pane.select($event); pane.tabpaneHeaderClick($event, i);" (keydown)="onkeydown($event)">\n <i [ngClass]="[\'app-icon\', pane.paneicon]" *ngIf="pane.paneicon"></i>\n <span [textContent]="pane.title"></span>\n <span *ngIf="pane.badgevalue" class="label label-{{pane.badgetype}}" [textContent]="pane.badgevalue"></span>\n </a>\n </li>\n</ul>\n<div class="tab-content" *ngIf="type !== \'dynamic\'" [ngClass]="{\'tab-stacked\': vertical, \'tab-justified\': justified}">\n <ng-content ngProjectAs="div[wmTabPane]"></ng-content>\n</div>\n<div class="tab-content" *ngIf="type === \'dynamic\'" [ngClass]="{\'tab-stacked\': vertical, \'tab-justified\': justified}">\n <div *ngIf="fieldDefs && !fieldDefs.length">{{nodatamessage}}</div>\n <ng-content select="div[wmRepeatTemplate]"></ng-content>\n</div>\n',exportAs:"wmTabs",providers:[i.provideAsWidgetRef(g)]}]}],g.ctorParameters=function(){return[{type:t.Injector},{type:o.DynamicComponentRefProvider},{type:String,decorators:[{type:t.Attribute,args:["transition"]}]},{type:String,decorators:[{type:t.Attribute,args:["tabsposition"]}]},{type:o.StatePersistence}]},g.propDecorators={panes:[{type:t.ContentChildren,args:[m]}]};var v=[m,g],y=function(){};y.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.WmComponentsModule],declarations:c([],l(v)),exports:c([],l(v)),entryComponents:[]}]}],e.TabPaneComponent=m,e.TabsComponent=g,e.TabsModule=y,e["\u0275a"]=d,e["\u0275b"]=u,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@wm/components/base")):"function"==typeof define&&define.amd?define("@wm/components/containers/tile",["exports","@angular/core","@angular/common","@wm/components/base"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.containers=e.wm.components.containers||{},e.wm.components.containers.tile={}),e.ng.core,e.ng.common,e.wm.components.base)}(this,(function(e,t,n,i){"use strict";
|
|
660
|
+
***************************************************************************** */var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}Object.create;function l(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,a=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return r}function c(e,t,n){if(n||2===arguments.length)for(var i,o=0,a=t.length;o<a;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var p=function(e){function t(t){var n=e.call(this)||this;return n.tabs=t,n._$el=$(n.tabs.getNativeElement()).find(">.tab-content"),n.init(n._$el),n}return s(t,e),t.prototype.calibrate=function(){var e=this.tabs.getActiveTabIndex(),t=this._$el.find(">.tab-pane"),n=0,i=0,o=[];return t.each((function(t,a){return $(a).prop("hidden")||(i++,t===e&&(n=i-1),o.push(a)),!0})),{activeTabIndex:n,noOfTabs:i,panes:o}},t.prototype.bounds=function(){var e=this.calibrate(),t=e.activeTabIndex,n=e.noOfTabs,i=e.panes,o=$(i[0]).width(),a=-1*t*o;return this.clearContentFocus(),{strict:!1,lower:t===n-1?0:-o,center:a,upper:0===t?a:o}},t.prototype.context=function(){return{w:this._$el.width()}},t.prototype.animation=function(){return{transform:"translate3d(${{ ($D + $d)/w * 100 + '%'}}, 0, 0)","-webkit-transform":"translate3d(${{ ($D + $d)/w * 100 + '%'}}, 0, 0)"}},t.prototype.clearContentFocus=function(){var e=this._$el.find(">.tab-pane.active");e.length&&e.find(document.activeElement).length&&document.activeElement.blur()},t.prototype.transitionTabIntoView=function(){var e=this.calibrate(),t=e.activeTabIndex,n=e.noOfTabs,i=e.panes,a=100*n+"%";o.setCSSFromObj(this._$el[0],{maxWidth:a,width:a}),o.addClass(this.tabs.getNativeElement(),"has-transition");var r=100/n+"%";i.forEach((function(e){o.setCSS(e,"width",r)})),o.setCSS(this._$el[0],"transform","translate3d("+-1*t/n*100+"%, 0, 0)")},t.prototype.onUpper=function(e){this.tabs.prev(e),o.$appDigest()},t.prototype.onLower=function(e){this.tabs.next(e),o.$appDigest()},t.prototype.threshold=function(){return 5},t}(a.SwipeAnimation),d=function(){var e=new Map([["class",i.PROP_STRING],["dataset",i.PROP_ANY],["defaultpaneindex",Object.assign({value:0},i.PROP_NUMBER)],["justified",i.PROP_BOOLEAN],["tabsposition",Object.assign({value:"top"},i.PROP_STRING)],["name",i.PROP_STRING],["nodatamessage",Object.assign({value:"No Data Found"},i.PROP_STRING)],["show",Object.assign({value:!0},i.PROP_BOOLEAN)],["statehandler",Object.assign({value:"none"},i.PROP_STRING)],["transition",i.PROP_STRING],["type",i.PROP_STRING]]);o.isMobileApp()&&e.set("transition",Object.assign({value:"slide"},i.PROP_STRING)),i.register("wm-tabs",e)},u=function(){i.register("wm-tabpane",new Map([["active",i.PROP_BOOLEAN],["badgevalue",i.PROP_STRING],["badgetype",Object.assign({value:"default"},i.PROP_STRING)],["class",i.PROP_STRING],["content",i.PROP_STRING],["disabled",i.PROP_BOOLEAN],["dynamicPaneIndex",i.PROP_NUMBER],["heading",i.PROP_STRING],["isdefaulttab",i.PROP_STRING],["isdynamic",i.PROP_BOOLEAN],["name",i.PROP_STRING],["paneicon",i.PROP_STRING],["show",Object.assign({value:!0},i.PROP_BOOLEAN)],["smoothscroll",Object.assign({value:!1},i.PROP_BOOLEAN)],["title",Object.assign({value:"Tab Title"},i.PROP_STRING)]]))},h={widgetType:"wm-tabpane",hostClass:"tab-pane"},m=function(e){function t(t,n,i,a){var r=e.call(this,t,h)||this;return r.tabsRef=n,r.heading=i,r.title=a,r._isFirstLoad=!0,r._isOnLoadTriggered=!1,r.$lazyLoad=o.noop,r.isActive=!1,r.disabled=!1,o.removeAttr(r.nativeElement,"title"),r}return s(t,e),t.prototype.invokeOnSelectCallback=function(e){this.invokeEventCallback("select",{$event:e})},t.prototype.select=function(e,t){this.isActive||this.disabled||(this.isActive=!0,this.$lazyLoad(),this.redrawChildren(),this.notifyParent(e,t))},t.prototype.tabpaneHeaderClick=function(e,t){this.invokeEventCallback("headerclick",{$event:e,paneIndex:t})},t.prototype.deselect=function(){this.isActive&&(this.isActive=!1,this.invokeEventCallback("deselect"))},t.prototype.remove=function(){this.isActive&&(this===this.tabsRef.panes.last?this.tabsRef.prev():this.tabsRef.next());var e=this.tabsRef.panes.toArray();e.splice(this.tabsRef.getPaneIndexByRef(this),1),this.tabsRef.panes.reset(c([],l(e))),this.nativeElement.remove(),this.tabsRef.$element.find(".tab-header[data-paneid='"+this.$element.attr("widget-id")+"'] a").remove()},t.prototype.redrawChildren=function(){var e=this;setTimeout((function(){e.reDrawableComponents&&e.reDrawableComponents.forEach((function(e){return e.redraw()})),e._isOnLoadTriggered||e.content||(e.invokeEventCallback("load"),e._isOnLoadTriggered=!0)}),100)},t.prototype.notifyParent=function(e,t){this.tabsRef.notifyChange(this,e,t)},t.prototype.handleSwipeLeft=function(){this.tabsRef.next()},t.prototype.handleSwipeRight=function(){this.tabsRef.prev()},t.prototype.handleEvent=function(t,n,i,o){"select"!==n&&e.prototype.handleEvent.call(this,this.nativeElement,n,i,o)},t.prototype.onPropertyChange=function(t,n,i){var o,a=this;"content"===t?this.isActive&&setTimeout((function(){return a.$lazyLoad()}),100):"show"===t?(this.nativeElement.hidden=!n,this._isFirstLoad?this.tabsRef.selectDefaultPaneByIndex(this.tabsRef.defaultpaneindex):!n&&this.isActive?this.tabsRef.next():!n&&this.isActive||null===(o=this.tabsRef.tabsAnimator)||void 0===o||o.transitionTabIntoView(),this._isFirstLoad=!1):e.prototype.onPropertyChange.call(this,t,n,i)},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.title=this.title||this.heading},t.prototype.ngAfterViewInit=function(){i.styler(this.nativeElement.querySelector(".tab-body"),this,i.APPLY_STYLES_TYPE.CONTAINER),e.prototype.ngAfterViewInit.call(this),this.isdynamic&&this.tabsRef.registerDynamicTab(this)},t}(i.StylableComponent);m.initializeProps=u(),m.decorators=[{type:t.Component,args:[{selector:"div[wmTabPane]",template:'<div class="tab-body" partial-container-target [wmSmoothscroll]="smoothscroll">\n <ng-content></ng-content>\n</div>',providers:[i.provideAsWidgetRef(m)]}]}],m.ctorParameters=function(){return[{type:t.Injector},{type:g},{type:void 0,decorators:[{type:t.Attribute,args:["heading"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["title"]}]}]},m.propDecorators={isActive:[{type:t.HostBinding,args:["class.active"]}],disabled:[{type:t.HostBinding,args:["class.disabled"]}],reDrawableComponents:[{type:t.ContentChildren,args:[i.RedrawableDirective,{descendants:!0}]}]};var f={widgetType:"wm-tabs",hostClass:"app-tabs clearfix"},g=function(e){function t(t,n,a,r,s){var l=this,c=o.noop;return(l=e.call(this,t,f,new Promise((function(e){return c=e})))||this).transition=a,l.tabsposition=r,l.statePersistence=s,l.dynamicComponentProvider=n,l.dynamicTabs=[],l.dynamicPaneIndex=0,l.promiseResolverFn=c,i.styler(l.nativeElement,l,i.APPLY_STYLES_TYPE.CONTAINER),l}return s(t,e),t.prototype.animateIn=function(e){var t=$(e);t.siblings(".active").removeClass("active"),t.addClass("active");var n=this.nativeElement.querySelector("ul.nav.nav-tabs"),i=t.prev();i.length?n.scrollLeft=i[0].offsetLeft:n.scrollLeft=0},t.prototype.registerDynamicTab=function(e){if(this.dynamicTabs.push(e),this.dynamicTabs.length===this.dynamicPaneIndex)for(var t=function(e){var t=_.find(n.dynamicTabs,(function(t){return t.dynamicPaneIndex===e}));_.find(n.panes.toArray(),t)||(n.panes.reset(c(c([],l(n.panes.toArray())),[t])),t.active&&setTimeout((function(){t.select()}),20))},n=this,i=0;i<this.dynamicTabs.length;i++)t(i)},t.prototype.addPane=function(e){var t=this;_.isArray(e)||(e=[e]);var n=[];return _.forEach(e,(function(e,i){var o=_.find(t.panes.toArray(),{name:e.name}),a=_.indexOf(n,e.name);if(o||a>0)console.warn("The tab pane with name "+e.name+" already exists");else{var r="",s="";t.dynamicPaneIndex++;var l=e.name?e.name:"tabpane"+(t.panes.toArray().length+(i+1));n.push(l);var c=_.get(e,"params");_.forEach(e,(function(e,t){"params"!==t&&(s=s+" "+t+'="'+e+'"')})),_.forEach(c,(function(e,t){r=r+' <wm-param name="'+t+'" value="'+e+'"></wm-param>'}));var p='<wm-tabpane dynamicPaneIndex="'+(t.dynamicPaneIndex-1)+'" isdynamic="true" name="'+l+'" '+s+">\n "+r+"\n </wm-tabpane>";t._dynamicContext||(t._dynamicContext=Object.create(t.viewParent),t._dynamicContext[t.getAttr("wmTab")]=t),t.dynamicComponentProvider.addComponent(t.getNativeElement().querySelector(".tab-content"),p,t._dynamicContext,{inj:t.inj})}})),n},t.prototype.removePane=function(e){var t=this.getPaneRefByName(e);t&&t.remove()},t.prototype.notifyChange=function(e,t,n){if(this.isSelectableTab(e)){var i;_.isEmpty(this.activeTab)||this.activeTab.deselect(),this.activeTab=e.getWidget();var o=this.getPaneIndexByRef(e),a=this.statePersistence.computeMode(this.statehandler);if(!this.isPageLoadCall&&a&&"none"!==a.toLowerCase()?this.statePersistence.setWidgetState(this,this.activeTab.name):(this.defaultpaneindex=this.getPaneIndexByRef(e),this.isPageLoadCall=!1),e.invokeOnSelectCallback(t),t&&this.invokeEventCallback("change",{$event:t,newPaneIndex:o,oldPaneIndex:this._oldPaneIndex||0}),this._oldPaneIndex=o,t&&(i=$(t.target).closest("li.tab-header")),!t||!i||!i.length)i=this.nativeElement.querySelector("li[data-paneid="+e.widgetId+"]"),!!!$(i).closest(".app-tabs").parent().closest(".app-tabs").length&&n&&$(i).children().focus();this.animateIn(i),this.canSlide()&&(this.tabsAnimator||(this.tabsAnimator=new p(this),this.tabsAnimator.setGesturesEnabled(this.canSlide())),this.tabsAnimator.transitionTabIntoView())}},t.prototype.goToTab=function(e){this.isValidPaneIndex(e-1)&&this.getPaneRefByIndex(e-1).select()},t.prototype.getPaneIndexByRef=function(e){return this.panes.toArray().indexOf(e)},t.prototype.getActiveTabIndex=function(){return _.findIndex(this.panes.toArray(),{isActive:!0})},t.prototype.isValidPaneIndex=function(e){return e>=0&&e<this.panes.length},t.prototype.getPaneRefByIndex=function(e){return this.panes.toArray()[e]},t.prototype.getPaneRefByName=function(e){return _.find(this.panes.toArray(),{name:e})},t.prototype.isSelectableTab=function(e){return e.show&&!e.disabled},t.prototype.canSlide=function(){return"slide"===this.transition&&!this.vertical},t.prototype.getSelectableTabAfterIndex=function(e){for(var t=e+1;t<this.panes.length;t++){var n=this.getPaneRefByIndex(t);if(this.isSelectableTab(n))return n}if(e===this.panes.length-1){n=this.getPaneRefByIndex(0);if(this.isSelectableTab(n))return n}},t.prototype.getSelectableTabBeforeIndex=function(e){for(var t=e-1;t>=0;t--){var n=this.getPaneRefByIndex(t);if(this.isSelectableTab(n))return n}if(0===e){n=this.getPaneRefByIndex(this.panes.length-1);if(this.isSelectableTab(n))return n}},t.prototype.next=function(e,t){var n=this.getSelectableTabAfterIndex(this.getActiveTabIndex());n&&n.select(e,t)},t.prototype.prev=function(e,t){var n=this.getSelectableTabBeforeIndex(this.getActiveTabIndex());n&&n.select(e,t)},t.prototype.selectDefaultPaneByIndex=function(e){if(this.isValidPaneIndex(e)){var t=this.getPaneRefByIndex(e);this.isSelectableTab(t)||(t=this.getSelectableTabAfterIndex(0)),t&&t.select()}},t.prototype.setTabsPosition=function(){var e=this.nativeElement.children[0];this.vertical="left"===this.tabsposition||"right"===this.tabsposition,o.removeClass(this.nativeElement,"inverted"),"bottom"!==this.tabsposition&&"right"!==this.tabsposition||(o.appendNode(e,this.nativeElement),o.addClass(this.nativeElement,"inverted"))},t.prototype.onDataChange=function(e){var t=this;this.fieldDefs=i.createArrayFrom(e),setTimeout((function(){return t.selectDefaultPaneByIndex(t.defaultpaneindex||0)}))},t.prototype.onPropertyChange=function(t,n,i){var o=this;if("defaultpaneindex"===t)this.defaultpaneindex=n;else if("dataset"===t)this.onDataChange(n);else if("statehandler"===t){this.isPageLoadCall=!0;var a=this.statePersistence.getWidgetState(this);if("none"!==n&&a){var r=this.panes.filter((function(e){return a===e.name}));if(r.length){var s=this.getPaneIndexByRef(r[0]);setTimeout((function(){return o.selectDefaultPaneByIndex(s)}),20)}else console.warn("Tab pane name "+a+" in State is incorrect. Falling back to the default pane"),setTimeout((function(){return o.selectDefaultPaneByIndex(o.defaultpaneindex||0)}),20)}else setTimeout((function(){return o.selectDefaultPaneByIndex(o.defaultpaneindex||0)}),20)}else e.prototype.onPropertyChange.call(this,t,n,i)},t.prototype.registerTabsScroll=function(){var e=this;setTimeout((function(){var t,n=e.$element.find("> ul");(t=n.children().last().position())&&t.left>n.width()&&n.on("mousewheel",(function(e){var t=n[0].scrollLeft,i=-1*e.originalEvent.wheelDelta;e.stopPropagation(),e.preventDefault(),n.animate({scrollLeft:t+i},{duration:10})}))}))},t.prototype.onkeydown=function(e){switch(e.key){case"ArrowLeft":case"ArrowUp":this.prev(null,!0),e.preventDefault();break;case"ArrowRight":case"ArrowDown":this.next(null,!0),e.preventDefault()}},t.prototype.ngAfterContentInit=function(){var t=this;this.promiseResolverFn(),e.prototype.ngAfterContentInit.call(this),this.setTabsPosition(),this.panes.changes.subscribe((function(e){t.panes.length&&t.selectDefaultPaneByIndex(t.defaultpaneindex||0)}))},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),this.registerTabsScroll()},t}(i.StylableComponent);g.initializeProps=d(),g.decorators=[{type:t.Component,args:[{selector:"div[wmTabs]",template:'<ul class="nav nav-tabs" [ngClass]="{\'nav-stacked\': vertical, \'nav-justified\': justified}" role="tablist">\n <li class="tab-header" *ngFor="let pane of panes; let i=index;" [attr.data-paneid]="pane.widgetId" [ngClass]="{\'active\': pane.isActive, \'disabled\': pane.disabled}"\n [hidden]="!pane.show" role="presentation">\n <a class="tab-heading" href="javascript:void(0);" [attr.aria-label]="pane.title" [attr.title]="pane.title" [tabindex]="pane.isActive ? \'0\' : \'-1\'"\n [attr.aria-selected]="pane.isActive" role="tab" (click)="pane.select($event); pane.tabpaneHeaderClick($event, i);" (keydown)="onkeydown($event)">\n <i [ngClass]="[\'app-icon\', pane.paneicon]" *ngIf="pane.paneicon"></i>\n <span [textContent]="pane.title"></span>\n <span *ngIf="pane.badgevalue" class="label label-{{pane.badgetype}}" [textContent]="pane.badgevalue"></span>\n </a>\n </li>\n</ul>\n<div class="tab-content" *ngIf="type !== \'dynamic\'" [ngClass]="{\'tab-stacked\': vertical, \'tab-justified\': justified}">\n <ng-content ngProjectAs="div[wmTabPane]"></ng-content>\n</div>\n<div class="tab-content" *ngIf="type === \'dynamic\'" [ngClass]="{\'tab-stacked\': vertical, \'tab-justified\': justified}">\n <div *ngIf="fieldDefs && !fieldDefs.length">{{nodatamessage}}</div>\n <ng-content select="div[wmRepeatTemplate]"></ng-content>\n</div>\n',exportAs:"wmTabs",providers:[i.provideAsWidgetRef(g)]}]}],g.ctorParameters=function(){return[{type:t.Injector},{type:o.DynamicComponentRefProvider},{type:String,decorators:[{type:t.Attribute,args:["transition"]}]},{type:String,decorators:[{type:t.Attribute,args:["tabsposition"]}]},{type:o.StatePersistence}]},g.propDecorators={panes:[{type:t.ContentChildren,args:[m]}]};var v=[m,g],y=function(){};y.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.WmComponentsModule],declarations:c([],l(v)),exports:c([],l(v)),entryComponents:[]}]}],e.TabPaneComponent=m,e.TabsComponent=g,e.TabsModule=y,e["\u0275a"]=d,e["\u0275b"]=u,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@wm/components/base")):"function"==typeof define&&define.amd?define("@wm/components/containers/tile",["exports","@angular/core","@angular/common","@wm/components/base"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.containers=e.wm.components.containers||{},e.wm.components.containers.tile={}),e.ng.core,e.ng.common,e.wm.components.base)}(this,(function(e,t,n,i){"use strict";
|
|
661
661
|
/*! *****************************************************************************
|
|
662
662
|
Copyright (c) Microsoft Corporation.
|
|
663
663
|
|