@wavemaker/app-runtime-wm-build 11.4.2-rc.5385 → 11.4.3-next.140442
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 +0 -4
- app-runtime-wm-build/wmapp/scripts/wm-libs.min.js +1 -1
- app-runtime-wm-build/wmapp/scripts/wm-loader.js +9 -11
- app-runtime-wm-build/wmapp/scripts/wm-loader.min.js +4 -4
- app-runtime-wm-build/wmapp/styles/css/wm-style.css +1 -1
- app-runtime-wm-build/wmmobile/scripts/wm-libs.js +0 -4
- app-runtime-wm-build/wmmobile/scripts/wm-libs.min.js +1 -1
- app-runtime-wm-build/wmmobile/scripts/wm-mobileloader.js +9 -11
- app-runtime-wm-build/wmmobile/scripts/wm-mobileloader.min.js +4 -4
- app-runtime-wm-build/wmmobile/styles/css/wm-style.css +1 -1
|
@@ -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 u(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function d(e,t,n){if(n||2===arguments.length)for(var i,o=0,r=t.length;o<r;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var h=new Map([["casesensitive",Object.assign({value:!1},r.PROP_BOOLEAN)],["class",r.PROP_STRING],["datacompletemsg",Object.assign({value:"No more data to load"},r.PROP_STRING)],["datafield",Object.assign({value:"All Fields"},r.PROP_STRING)],["dataoptions",r.PROP_ANY],["dataset",r.PROP_ANY],["datasource",r.PROP_ANY],["datavalue",r.PROP_STRING],["datavaluesource",r.PROP_ANY],["dateformat",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["displayimagesrc",r.PROP_STRING],["displaylabel",r.PROP_STRING],["displayexpression",r.PROP_STRING],["dropup",r.PROP_BOOLEAN],["groupby",r.PROP_STRING],["hint",r.PROP_STRING],["imagewidth",Object.assign({value:"16px"},r.PROP_STRING)],["limit",r.PROP_NUMBER],["loadingdatamsg",Object.assign({value:"Loading items..."},r.PROP_STRING)],["match",r.PROP_STRING],["matchmode",r.PROP_STRING],["minchars",r.PROP_NUMBER],["name",r.PROP_STRING],["navsearchbar",Object.assign({value:!1},r.PROP_BOOLEAN)],["orderby",r.PROP_STRING],["placeholder",Object.assign({value:"Search"},r.PROP_STRING)],["position",r.PROP_STRING],["query",r.PROP_STRING],["readonly",r.PROP_BOOLEAN],["required",r.PROP_BOOLEAN],["searchkey",r.PROP_STRING],["searchon",Object.assign({value:"typing"},r.PROP_STRING)],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["showclear",Object.assign({value:!1},r.PROP_BOOLEAN)],["showsearchicon",r.PROP_BOOLEAN],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["type",Object.assign({value:"search"},r.PROP_STRING)],["debouncetime",Object.assign({value:250},r.PROP_NUMBER)],["width",r.PROP_STRING]]),m=function(){r.register("wm-search",h),r.registerFormWidget(l.FormWidgetType.AUTOCOMPLETE,new Map(h)),r.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 r,a=e.query;return new Promise((function(s,l){if(e.searchKey){var c=_.split(e.searchKey,",");r=_.filter(e.dataset,(function(e){return c.some((function(n){var r=_.get(e,n),s=a;return i||(r=_.toLower(_.toString(r)),s=_.toLower(_.toString(s))),t.applyFilter(r,s,o)}))}))}else r=_.isArray(n)&&_.isObject(n[0])?_.filter(n,(function(e){var n=_.values(e).join(" ");return i||(n=_.toLower(n),a=_.toLower(a)),t.applyFilter(n,a)})):_.filter(n,(function(e){return i||(e=_.toLower(e),a=_.toLower(a)),t.applyFilter(e,a,o)}));s({data:r,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){r.interpolateBindExpressions(e.viewParent,t.filterExpr,(function(r){n.filterExpr=t.filterExpr=r,t.filterExpr=r,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,r,a=this,s=t.data,c=_.split(e.binddataset,"."),p=_.slice(c,_.indexOf(c,"dataSet")+1).join(".");return new Promise((function(c,u){var d=t.pagination;if(e.datasource.execute(l.DataSource.Operation.IS_PAGEABLE)&&(o=d.number+1,i=a.isLast(o,e.limit>0&&e.limit||d.totalElements,d.size,d.numberOfElements),r=!0,a.isLastPageForDistinctApi(s,o,d.totalElements,i)))c({data:[],isLastPage:i=!0,hasMoreData:o>1,isPaginatedData:r,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=a.getTransformedData(e.datasource,s)),s.length?c({data:s,isLastPage:i,hasMoreData:o>1,isPaginatedData:r,page:o}):c({data:[],isLastPage:i,hasMoreData:o>1,isPaginatedData:r,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 r=e.call(this,t,y)||this;r.binddatavalue=i,r.binddataset=o,r.query="",r.page=1,r.allowempty=!1,r.app=n,l.addClass(r.nativeElement,"app-search",!0),r.typeaheadDataSource=a.Observable.create((function(e){r.listenQuery&&(r._defaultQueryInvoked=!1,r._loadingItems=!0,e.next(r.query)),r.lastSelectedIndex&&(r.typeahead._container=void 0)})).pipe(s.filter((function(){return r._loadingItems=!1,0===r.minchars||r.query&&r.query.length>=r.minchars})),s.mergeMap((function(e){return r.getDataSourceAsObservable(e)}))),r.dataProvider=new v;var c=r.datavalue$.subscribe((function(e){var t=_.isArray(e)?e[0]:e;if(null===t||""===t)return r._modelByValue="",r.query=r.queryModel="",void(r._lastResult=void 0);r._unsubscribeDv||(r._defaultQueryInvoked=!1,_.isObject(e)||r.prevDatavalue===e||(r._modelByKey=void 0,r.query=r.queryModel=""),r.updateByDatavalue(e)),r.showClosebtn=""!==r.query}));r.registerDestroyListener((function(){return c.unsubscribe()}));var p=r.dataset$.subscribe((function(){r.startIndex=r.datasetItems.length,r._lastResult=void 0;var e=r.datavalue||r.toBeProcessedDatavalue;l.isDefined(e)&&r.updateByDataset(e)}));return r.registerDestroyListener((function(){return p.unsubscribe()})),r}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,a.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,a.of([])}return this._lastQuery=this.query,a.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!==r.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===r.ALLFIELDS&&_.isObject(e))this.queryModel=this.getTransformedData(r.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===r.ALLFIELDS)return this._loadingItems=!1,Promise.resolve([]);var o={dataset:this.dataset?r.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=r.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 r.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),r.styler(this.nativeElement,this),this.containerTarget=r.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:[r.provideAs(b,i.NG_VALUE_ACCESSOR,!0),r.provideAs(b,i.NG_VALIDATORS,!0),r.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,r.WmComponentsModule],declarations:d([],u(P)),exports:d([],u(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 u(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function d(e,t,n){if(n||2===arguments.length)for(var i,o=0,r=t.length;o<r;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var h=new Map([["casesensitive",Object.assign({value:!1},r.PROP_BOOLEAN)],["class",r.PROP_STRING],["datacompletemsg",Object.assign({value:"No more data to load"},r.PROP_STRING)],["datafield",Object.assign({value:"All Fields"},r.PROP_STRING)],["dataoptions",r.PROP_ANY],["dataset",r.PROP_ANY],["datasource",r.PROP_ANY],["datavalue",r.PROP_STRING],["datavaluesource",r.PROP_ANY],["dateformat",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["displayimagesrc",r.PROP_STRING],["displaylabel",r.PROP_STRING],["displayexpression",r.PROP_STRING],["dropup",r.PROP_BOOLEAN],["groupby",r.PROP_STRING],["hint",r.PROP_STRING],["imagewidth",Object.assign({value:"16px"},r.PROP_STRING)],["limit",r.PROP_NUMBER],["loadingdatamsg",Object.assign({value:"Loading items..."},r.PROP_STRING)],["match",r.PROP_STRING],["matchmode",r.PROP_STRING],["minchars",r.PROP_NUMBER],["name",r.PROP_STRING],["navsearchbar",Object.assign({value:!1},r.PROP_BOOLEAN)],["orderby",r.PROP_STRING],["placeholder",Object.assign({value:"Search"},r.PROP_STRING)],["position",r.PROP_STRING],["query",r.PROP_STRING],["readonly",r.PROP_BOOLEAN],["required",r.PROP_BOOLEAN],["searchkey",r.PROP_STRING],["searchon",Object.assign({value:"typing"},r.PROP_STRING)],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["showclear",Object.assign({value:!1},r.PROP_BOOLEAN)],["showsearchicon",r.PROP_BOOLEAN],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["type",Object.assign({value:"search"},r.PROP_STRING)],["debouncetime",Object.assign({value:250},r.PROP_NUMBER)],["width",r.PROP_STRING]]),m=function(){r.register("wm-search",h),r.registerFormWidget(l.FormWidgetType.AUTOCOMPLETE,new Map(h)),r.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 r,a=e.query;return new Promise((function(s,l){if(e.searchKey){var c=_.split(e.searchKey,",");r=_.filter(e.dataset,(function(e){return c.some((function(n){var r=_.get(e,n),s=a;return i||(r=_.toLower(_.toString(r)),s=_.toLower(_.toString(s))),t.applyFilter(r,s,o)}))}))}else r=_.isArray(n)&&_.isObject(n[0])?_.filter(n,(function(e){var n=_.values(e).join(" ");return i||(n=_.toLower(n),a=_.toLower(a)),t.applyFilter(n,a)})):_.filter(n,(function(e){return i||(e=_.toLower(e),a=_.toLower(a)),t.applyFilter(e,a,o)}));s({data:r,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){r.interpolateBindExpressions(e.viewParent,t.filterExpr,(function(r){n.filterExpr=t.filterExpr=r,t.filterExpr=r,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,r,a=this,s=t.data,c=_.split(e.binddataset,"."),p=_.slice(c,_.indexOf(c,"dataSet")+1).join(".");return new Promise((function(c,u){var d=t.pagination;if(e.datasource.execute(l.DataSource.Operation.IS_PAGEABLE)&&(o=d.number+1,i=a.isLast(o,e.limit>0&&e.limit||d.totalElements,d.size,d.numberOfElements),r=!0,a.isLastPageForDistinctApi(s,o,d.totalElements,i)))c({data:[],isLastPage:i=!0,hasMoreData:o>1,isPaginatedData:r,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=a.getTransformedData(e.datasource,s)),s.length?c({data:s,isLastPage:i,hasMoreData:o>1,isPaginatedData:r,page:o}):c({data:[],isLastPage:i,hasMoreData:o>1,isPaginatedData:r,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 r=e.call(this,t,y)||this;r.binddatavalue=i,r.binddataset=o,r.query="",r.page=1,r.allowempty=!1,r.app=n,l.addClass(r.nativeElement,"app-search",!0),r.typeaheadDataSource=a.Observable.create((function(e){r.listenQuery&&(r._defaultQueryInvoked=!1,r._loadingItems=!0,e.next(r.query)),r.lastSelectedIndex&&(r.typeahead._container=void 0)})).pipe(s.filter((function(){return r._loadingItems=!1,0===r.minchars||r.query&&r.query.length>=r.minchars})),s.mergeMap((function(e){return r.getDataSourceAsObservable(e)}))),r.dataProvider=new v;var c=r.datavalue$.subscribe((function(e){var t=_.isArray(e)?e[0]:e;if(null===t||""===t)return r._modelByValue="",r.query=r.queryModel="",void(r._lastResult=void 0);r._unsubscribeDv||(r._defaultQueryInvoked=!1,_.isObject(e)||r.prevDatavalue===e||(r._modelByKey=void 0,r.query=r.queryModel=""),r.updateByDatavalue(e)),r.showClosebtn=""!==r.query}));r.registerDestroyListener((function(){return c.unsubscribe()}));var p=r.dataset$.subscribe((function(){r.startIndex=r.datasetItems.length,r._lastResult=void 0;var e=r.datavalue||r.toBeProcessedDatavalue;l.isDefined(e)&&r.updateByDataset(e)}));return r.registerDestroyListener((function(){return p.unsubscribe()})),r}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,a.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,a.of([])}return this._lastQuery=this.query,a.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!==r.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===r.ALLFIELDS&&_.isObject(e))this.queryModel=this.getTransformedData(r.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===r.ALLFIELDS)return this._loadingItems=!1,Promise.resolve([]);var o={dataset:this.dataset?r.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=r.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 r.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),r.styler(this.nativeElement,this),this.containerTarget=r.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:[r.provideAs(b,i.NG_VALUE_ACCESSOR,!0),r.provideAs(b,i.NG_VALIDATORS,!0),r.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,r.WmComponentsModule],declarations:d([],u(P)),exports:d([],u(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 d=function(e,t){return(d=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}d(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,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function f(e,t,n){if(n||2===arguments.length)for(var i,o=0,r=t.length;o<r;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var 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 r=moment(this.changedValue),a=null===(e=this._bsDatepickerConfig)||void 0===e?void 0:e.minDate,s=null===(t=this._bsDatepickerConfig)||void 0===t?void 0:t.maxDate;if(a&&("DATE"===this.mode&&moment(a).startOf("day").toDate()>this.changedValue||"DATE"!==this.mode&&a>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(r.day()))>=0)return!1;var l=r.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:u.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 a.TimepickerConfig,{meridians:n.getLocaleDayPeriods(e.getSelectedLocale(),n.FormStyle.Format,n.TranslationWidth.Abbreviated)})}var S=function(e){function t(t,i){var r=e.call(this,t,i)||this;return r.isReadOnly=!1,r.clicked=!1,r.formatsByLocale={timezone:""},r._dateOptions=new o.BsDatepickerConfig,r.i18nService=r.inj.get(c.AbstractI18nService),r.invokeEventCallback("beforeload"),r.datePipe=r.inj.get(s.ToDatePipe),r.selectedLocale=r.i18nService.getSelectedLocale(),r._dateOptions.todayPosition="left",r._dateOptions.clearPosition="right",r.meridians=n.getLocaleDayPeriods(r.selectedLocale,n.FormStyle.Format,n.TranslationWidth.Abbreviated),r.loadNativeDateInput=c.isMobile()&&!r.showcustompicker,r.cancelLocaleChangeSubscription=r.getAppInstance().subscribe("locale-changed",(function(e){r.datePipe.datePipe.locale=e.angular,r._dateOptions.todayButtonLabel=r.i18nService.getLocalizedMessage("LABEL_TODAY_DATE"),r._dateOptions.clearButtonLabel=r.i18nService.getLocalizedMessage("LABEL_CLEAR_DATE")})),r}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,r=c.getFormattedDate(this.datePipe,e,i,o,null,null,this);if(t=t.trim())if("timestamp"===i){if(!_.isNaN(t)&&_.parseInt(t)!==r)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!==r)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 r=e;e=moment(e).startOf("day").toDate();var a=moment(c.getDateObj(this.mindate)).startOf("day").toDate(),s=moment(c.getDateObj(this.maxdate)).startOf("day").toDate();if(this.mindate&&e<a){var l=this.appLocale.LABEL_MINDATE_VALIDATION_MESSAGE+" "+this.mindate+".";return this.invokeOnChange(this.datavalue,void 0,!1),i&&c.getFormattedDate(this.datePipe,a,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,r,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,","),u=_.get(r,"getDay")?r.getDay():r;if(p.indexOf(u.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(),r=new Date(o,i+=t),a=r.toLocaleString("en-US",{month:"long"});return{date:r,fullMonth:a}},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"),r=o.first().text(),a=o.last().text();t||(e.getFullYear()<_.parseInt(r)?this.goToOtherMonthOryear("previous","year"):e.getFullYear()>_.parseInt(a)&&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 r=1===o?"minutes":"seconds";t.updateTimeValue(i,r)}}))})),this.removeKeyupListener=function(){n.first().off("keyup")},e.on("keydown",(function(e){var n,i,o=$(e.target),r=o.parent(),a=t.elementScope,s=t.keyEventPluginInstance.getEventFullKey(e);if("escape"===s&&a.hideTimepickerDropdown(),o.hasClass("bs-timepicker-field")){if(r.is(":first-child")?"shift.tab"!==s&&"enter"!==s&&"escape"!==s||(a.setIsTimeOpen(!1),t.focus(),n=!0,i=!0):r.is(":last-child")||r.next().next().find("button.disabled").length?"tab"!==s&&"escape"!==s&&"enter"!==s||(a.setIsTimeOpen(!1),t.focus(),n=!0,i=!0):"enter"!==s&&"escape"!==s||(a.setIsTimeOpen(!1),t.focus(),n=!0,i=!0),n&&e.stopPropagation(),i&&e.preventDefault(),a.mintime&&a.maxtime&&!t.isValidDate(a.bsTimeValue)&&("arrowdown"===s?a.bsTimeValue=a.maxTime:"arrowup"===s&&(a.bsTimeValue=a.minTime)),"tab"===s){t.invalidDateTimeFormat=!1,t.invokeOnChange(t.datavalue,void 0,!1);var l=t.datepattern||t.timepattern;c.getFormattedDate(a.datePipe,a.bsTimeValue,l,t.timeZone,null,null,t)===a.displayValue&&$(t.nativeElement).find(".display-input").val(a.displayValue)}"arrowdown"!==s&&"arrowup"!==s||t.timeFormatValidation()}else o.hasClass("btn-default")&&("tab"!==s&&"escape"!==s||(a.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);S.decorators=[{type:t.Directive}],S.ctorParameters=function(){return[{type:t.Injector},null]},S.propDecorators={bsDropdown:[{type:t.ViewChild,args:[r.BsDropdownDirective]}],bsTimePicker:[{type:t.ViewChild,args:[a.TimepickerComponent]}],datetimepickerComponent:[{type:t.ViewChild,args:[g]}]};var E=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)]]),T=function(){s.register("wm-date",E),s.registerFormWidget(c.FormWidgetType.DATE,new Map(E))},C={widgetType:"wm-date",hostClass:"app-date input-group"},A=function(e){function t(t,n,i,o){var r=e.call(this,t,C)||this;return r.cdRef=n,r.appDefaults=i,r.isOpen=!1,r.isEnterPressedOnDateInput=!1,s.styler(r.nativeElement,r),r.keyEventPlugin=o[1],r.dateContainerCls="app-date-"+r.widgetId,r._dateOptions.containerClass="app-date "+r.dateContainerCls,r._dateOptions.showWeekNumbers=!1,r._bsDefaultLoadCheck=!0,r.datepattern=r.appDefaults.dateFormat||c.getDisplayDateTimeFormat(c.FormWidgetType.DATE),r.updateFormat("datepattern"),r}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}(S);A.initializeProps=T(),A.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(A,i.NG_VALUE_ACCESSOR,!0),s.provideAs(A,i.NG_VALIDATORS,!0),s.provideAsWidgetRef(A)]}]}],A.ctorParameters=function(){return[{type:t.Injector},{type:t.ChangeDetectorRef},{type:c.AppDefaults},{type:void 0,decorators:[{type:t.Inject,args:[l.EVENT_MANAGER_PLUGINS]}]}]},A.propDecorators={bsDatePickerDirective:[{type:t.ViewChild,args:[o.BsDatepickerDirective]}]};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],["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",R),s.registerFormWidget(c.FormWidgetType.DATETIME,new Map(R)),s.registerFormWidget(c.FormWidgetType.TIMESTAMP,new Map(R))},D={widgetType:"wm-datetime",hostClass:"app-datetime input-group"},N="CURRENT_DATE",x=O,k=function(e){function t(t,n,i,o,r,a){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=r,l.keyEventPlugin=a[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?N:c.getFormattedDate(this.datePipe,this.proxyModel,this.outputformat,this.timeZone,null,null,this)},set:function(e){e===N?(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(" "),r=o[0].split(":"),a=0;a<t.length;a++)t[a].value=r[a];(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}(S);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:a.TimepickerConfig,deps:[c.AbstractI18nService],useFactory:x}]}]}],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,r){var a=e.call(this,t,j)||this;return a.ngZone=n,a.appDefaults=i,a.status={isopen:!1},a.keyEventPlugin=r[1],s.styler(a.nativeElement,a),a.registerDestroyListener((function(){return a.clearTimeInterval()})),a.timepattern=a.appDefaults.timeFormat||c.getDisplayDateTimeFormat(c.FormWidgetType.TIME),a.updateFormat("timepattern"),a.app=o,a}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}(S);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:a.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 U=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 W(this)},e}();U.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 '}]}],U.ctorParameters=function(){return[{type:t.Injector}]},U.propDecorators={change:[{type:t.Output}],selectedValue:[{type:t.Input}],options:[{type:t.Input}]};var W=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,r){var a=i(-1*r.length);t.select(a),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 r=30*(t-e),a=1-.3*Math.abs(t-e);$(o).css({transform:"perspective(500px) rotateX("+r+"deg)",opacity:a}).show()}else $(o).hide()}))}},e}(),q=[A,k,G,g,v,U,V],z=function(){};z.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,o.BsDatepickerModule,r.BsDropdownModule,i.FormsModule,a.TimepickerModule,s.WmComponentsModule],declarations:f([],m(q)),exports:f([],m(q)),entryComponents:[]}]}],e.DateComponent=A,e.DatetimeComponent=k,e.EpochModule=z,e.TimeComponent=G,e["\u02750"]=x,e["\u0275a"]=O,e["\u0275b"]=S,e["\u0275c"]=g,e["\u0275d"]=v,e["\u0275e"]=T,e["\u0275f"]=I,e["\u0275g"]=L,e["\u0275h"]=V,e["\u0275i"]=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"),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,r){"use strict";
|
|
197
|
+
***************************************************************************** */var d=function(e,t){return(d=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}d(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,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function f(e,t,n){if(n||2===arguments.length)for(var i,o=0,r=t.length;o<r;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var 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 r=moment(this.changedValue),a=null===(e=this._bsDatepickerConfig)||void 0===e?void 0:e.minDate,s=null===(t=this._bsDatepickerConfig)||void 0===t?void 0:t.maxDate;if(a&&("DATE"===this.mode&&moment(a).startOf("day").toDate()>this.changedValue||"DATE"!==this.mode&&a>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(r.day()))>=0)return!1;var l=r.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:u.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 a.TimepickerConfig,{meridians:n.getLocaleDayPeriods(e.getSelectedLocale(),n.FormStyle.Format,n.TranslationWidth.Abbreviated)})}var S=function(e){function t(t,i){var r=e.call(this,t,i)||this;return r.isReadOnly=!1,r.clicked=!1,r.formatsByLocale={timezone:""},r._dateOptions=new o.BsDatepickerConfig,r.i18nService=r.inj.get(c.AbstractI18nService),r.invokeEventCallback("beforeload"),r.datePipe=r.inj.get(s.ToDatePipe),r.selectedLocale=r.i18nService.getSelectedLocale(),r._dateOptions.todayPosition="left",r._dateOptions.clearPosition="right",r.meridians=n.getLocaleDayPeriods(r.selectedLocale,n.FormStyle.Format,n.TranslationWidth.Abbreviated),r.loadNativeDateInput=c.isMobile()&&!r.showcustompicker,r.cancelLocaleChangeSubscription=r.getAppInstance().subscribe("locale-changed",(function(e){r.datePipe.datePipe.locale=e.angular,r._dateOptions.todayButtonLabel=r.i18nService.getLocalizedMessage("LABEL_TODAY_DATE"),r._dateOptions.clearButtonLabel=r.i18nService.getLocalizedMessage("LABEL_CLEAR_DATE")})),r}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,r=c.getFormattedDate(this.datePipe,e,i,o,null,null,this);if(t=t.trim())if("timestamp"===i){if(!_.isNaN(t)&&_.parseInt(t)!==r)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!==r)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 r=e;e=moment(e).startOf("day").toDate();var a=moment(c.getDateObj(this.mindate)).startOf("day").toDate(),s=moment(c.getDateObj(this.maxdate)).startOf("day").toDate();if(this.mindate&&e<a){var l=this.appLocale.LABEL_MINDATE_VALIDATION_MESSAGE+" "+this.mindate+".";return this.invokeOnChange(this.datavalue,void 0,!1),i&&c.getFormattedDate(this.datePipe,a,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,r,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,","),u=_.get(r,"getDay")?r.getDay():r;if(p.indexOf(u.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(),r=new Date(o,i+=t),a=r.toLocaleString("en-US",{month:"long"});return{date:r,fullMonth:a}},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"),r=o.first().text(),a=o.last().text();t||(e.getFullYear()<_.parseInt(r)?this.goToOtherMonthOryear("previous","year"):e.getFullYear()>_.parseInt(a)&&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 r=1===o?"minutes":"seconds";t.updateTimeValue(i,r)}}))})),this.removeKeyupListener=function(){n.first().off("keyup")},e.on("keydown",(function(e){var n,i,o=$(e.target),r=o.parent(),a=t.elementScope,s=t.keyEventPluginInstance.getEventFullKey(e);if("escape"===s&&a.hideTimepickerDropdown(),o.hasClass("bs-timepicker-field")){if(r.is(":first-child")?"shift.tab"!==s&&"enter"!==s&&"escape"!==s||(a.setIsTimeOpen(!1),t.focus(),n=!0,i=!0):r.is(":last-child")||r.next().next().find("button.disabled").length?"tab"!==s&&"escape"!==s&&"enter"!==s||(a.setIsTimeOpen(!1),t.focus(),n=!0,i=!0):"enter"!==s&&"escape"!==s||(a.setIsTimeOpen(!1),t.focus(),n=!0,i=!0),n&&e.stopPropagation(),i&&e.preventDefault(),a.mintime&&a.maxtime&&!t.isValidDate(a.bsTimeValue)&&("arrowdown"===s?a.bsTimeValue=a.maxTime:"arrowup"===s&&(a.bsTimeValue=a.minTime)),"tab"===s){t.invalidDateTimeFormat=!1,t.invokeOnChange(t.datavalue,void 0,!1);var l=t.datepattern||t.timepattern;c.getFormattedDate(a.datePipe,a.bsTimeValue,l,t.timeZone,null,null,t)===a.displayValue&&$(t.nativeElement).find(".display-input").val(a.displayValue)}"arrowdown"!==s&&"arrowup"!==s||t.timeFormatValidation()}else o.hasClass("btn-default")&&("tab"!==s&&"escape"!==s||(a.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);S.decorators=[{type:t.Directive}],S.ctorParameters=function(){return[{type:t.Injector},null]},S.propDecorators={bsDropdown:[{type:t.ViewChild,args:[r.BsDropdownDirective]}],bsTimePicker:[{type:t.ViewChild,args:[a.TimepickerComponent]}],datetimepickerComponent:[{type:t.ViewChild,args:[g]}]};var E=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)]]),T=function(){s.register("wm-date",E),s.registerFormWidget(c.FormWidgetType.DATE,new Map(E))},C={widgetType:"wm-date",hostClass:"app-date input-group"},A=function(e){function t(t,n,i,o){var r=e.call(this,t,C)||this;return r.cdRef=n,r.appDefaults=i,r.isOpen=!1,r.isEnterPressedOnDateInput=!1,s.styler(r.nativeElement,r),r.keyEventPlugin=o[1],r.dateContainerCls="app-date-"+r.widgetId,r._dateOptions.containerClass="app-date "+r.dateContainerCls,r._dateOptions.showWeekNumbers=!1,r._bsDefaultLoadCheck=!0,r.datepattern=r.appDefaults.dateFormat||c.getDisplayDateTimeFormat(c.FormWidgetType.DATE),r.updateFormat("datepattern"),r}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}(S);A.initializeProps=T(),A.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(A,i.NG_VALUE_ACCESSOR,!0),s.provideAs(A,i.NG_VALIDATORS,!0),s.provideAsWidgetRef(A)]}]}],A.ctorParameters=function(){return[{type:t.Injector},{type:t.ChangeDetectorRef},{type:c.AppDefaults},{type:void 0,decorators:[{type:t.Inject,args:[l.EVENT_MANAGER_PLUGINS]}]}]},A.propDecorators={bsDatePickerDirective:[{type:t.ViewChild,args:[o.BsDatepickerDirective]}]};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],["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",R),s.registerFormWidget(c.FormWidgetType.DATETIME,new Map(R)),s.registerFormWidget(c.FormWidgetType.TIMESTAMP,new Map(R))},D={widgetType:"wm-datetime",hostClass:"app-datetime input-group"},N="CURRENT_DATE",x=O,k=function(e){function t(t,n,i,o,r,a){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=r,l.keyEventPlugin=a[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?N:c.getFormattedDate(this.datePipe,this.proxyModel,this.outputformat,this.timeZone,null,null,this)},set:function(e){e===N?(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(" "),r=o[0].split(":"),a=0;a<t.length;a++)t[a].value=r[a];(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}(S);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:a.TimepickerConfig,deps:[c.AbstractI18nService],useFactory:x}]}]}],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,r){var a=e.call(this,t,j)||this;return a.ngZone=n,a.appDefaults=i,a.status={isopen:!1},a.keyEventPlugin=r[1],s.styler(a.nativeElement,a),a.registerDestroyListener((function(){return a.clearTimeInterval()})),a.timepattern=a.appDefaults.timeFormat||c.getDisplayDateTimeFormat(c.FormWidgetType.TIME),a.updateFormat("timepattern"),a.app=o,a}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}(S);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:a.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 U=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 W(this)},e}();U.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 '}]}],U.ctorParameters=function(){return[{type:t.Injector}]},U.propDecorators={change:[{type:t.Output}],selectedValue:[{type:t.Input}],options:[{type:t.Input}]};var W=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,r){var a=i(-1*r.length);t.select(a),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 r=30*(t-e),a=1-.3*Math.abs(t-e);$(o).css({transform:"perspective(500px) rotateX("+r+"deg)",opacity:a}).show()}else $(o).hide()}))}},e}(),q=[A,k,G,g,v,U,V],z=function(){};z.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,o.BsDatepickerModule,r.BsDropdownModule,i.FormsModule,a.TimepickerModule,s.WmComponentsModule],declarations:f([],m(q)),exports:f([],m(q)),entryComponents:[]}]}],e.DateComponent=A,e.DatetimeComponent=k,e.EpochModule=z,e.TimeComponent=G,e["\u02750"]=x,e["\u0275a"]=O,e["\u0275b"]=S,e["\u0275c"]=g,e["\u0275d"]=v,e["\u0275e"]=T,e["\u0275f"]=I,e["\u0275g"]=L,e["\u0275h"]=V,e["\u0275i"]=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"),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,r){"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,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function c(e,t,n){if(n||2===arguments.length)for(var i,o=0,r=t.length;o<r;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var p=function(){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,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function c(e,t,n){if(n||2===arguments.length)for(var i,o=0,r=t.length;o<r;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var p=function(){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]]))},u={widgetType:"wm-dialog"},d={},h=function(e){function t(t,n,i,o,r){var s=this;null==i&&(i=!0),null==o&&(o=!0),r[0].closeDialog=function(){return s.close()};var l=!a.toBoolean(i)||"static";return s=e.call(this,t,u,{class:"app-dialog modal-dialog "+(n||""),backdrop:l,keyboard:!a.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:d,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,r.InputModule,i.WmComponentsModule],declarations:c([],l(m)),exports:c([],l(m)),entryComponents:[]}]}],e.DesignDialogModule=f,e.DialogComponent=h,e["\u02750"]=d,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,r){"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,r){function a(e){try{l(i.next(e))}catch(e){r(e)}}function s(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))}function y(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}}Object.create;function b(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function w(e,t,n){if(n||2===arguments.length)for(var i,o=0,r=t.length;o<r;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var P=function(){a.register("wm-table",new Map([["boundarylinks",Object.assign({value:!1},a.PROP_BOOLEAN)],["class",a.PROP_STRING],["confirmdelete",Object.assign({value:"Are you sure you want to delete this?"},a.PROP_STRING)],["datasource",a.PROP_STRING],["dataset",a.PROP_ANY],["deletecanceltext",a.PROP_STRING],["deleteoktext",a.PROP_STRING],["deletemessage",Object.assign({value:"Record deleted successfully"},a.PROP_STRING)],["directionlinks",Object.assign({value:!0},a.PROP_BOOLEAN)],["editmode",a.PROP_STRING],["errorstyle",Object.assign({value:"hover"},a.PROP_STRING)],["enablecolumnselection",Object.assign({value:!1},a.PROP_BOOLEAN)],["enablesort",Object.assign({value:!0},a.PROP_BOOLEAN)],["errormessage",a.PROP_STRING],["exportformat",a.PROP_STRING],["exportdatasize",Object.assign({value:100},a.PROP_NUMBER)],["filtermode",a.PROP_STRING],["filternullrecords",Object.assign({value:!0},a.PROP_BOOLEAN)],["forceellipses",Object.assign({value:!0},a.PROP_BOOLEAN)],["formposition",a.PROP_STRING],["gridclass",Object.assign({value:"table-hover"},a.PROP_STRING)],["gridfirstrowselect",a.PROP_BOOLEAN],["iconclass",a.PROP_STRING],["insertmessage",Object.assign({value:"Record added successfully"},a.PROP_STRING)],["isdynamictable",a.PROP_BOOLEAN],["isrowexpansionenabled",a.PROP_BOOLEAN],["loadingdatamsg",Object.assign({value:"Loading..."},a.PROP_STRING)],["loadingicon",Object.assign({value:"fa fa-circle-o-notch fa-spin"},a.PROP_STRING)],["maxsize",Object.assign({value:5},a.PROP_NUMBER)],["multiselect",a.PROP_BOOLEAN],["name",a.PROP_STRING],["navigation",Object.assign({value:"Basic"},a.PROP_STRING)],["navigationalign",Object.assign({value:"left"},a.PROP_STRING)],["nodatamessage",Object.assign({value:"No data found."},a.PROP_STRING)],["ondemandmessage",Object.assign({value:"Load More"},a.PROP_STRING)],["showviewlessbutton",Object.assign({value:!1},a.PROP_BOOLEAN)],["viewlessmessage",Object.assign({value:"View Less"},a.PROP_STRING)],["pagesize",a.PROP_NUMBER],["radioselect",a.PROP_BOOLEAN],["rowclass",a.PROP_STRING],["rowngclass",a.PROP_STRING],["searchlabel",Object.assign({value:"Search"},a.PROP_STRING)],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["showheader",Object.assign({value:!0},a.PROP_BOOLEAN)],["shownewrow",Object.assign({value:!0},a.PROP_BOOLEAN)],["showrecordcount",a.PROP_BOOLEAN],["showrowindex",a.PROP_BOOLEAN],["spacing",Object.assign({value:"normal"},a.PROP_STRING)],["statehandler",Object.assign({value:"none"},a.PROP_STRING)],["subheading",a.PROP_STRING],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["title",a.PROP_STRING],["updatemessage",Object.assign({value:"Record updated successfully"},a.PROP_STRING)]]))},O={widgetType:"wm-table",hostClass:"app-grid app-panel panel"},S={EXCEL:"fa fa-file-excel-o",CSV:"fa fa-file-text-o"},E="rowOperations",T=function(){},C=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},A=function(e){function t(t,n,i,o,r,s,l,c,p,u,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=r,y.paginationService=s,y.viewport=l,y.parentList=c,y.binddataset=p,y.binddatasource=u,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=T,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=T,y.searchSortHandler=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];y._searchSortHandler.apply(y,e)},y.onRowFilterChange=T,y.onFilterConditionSelect=T,y.showClearIcon=T,y.clearRowFilter=T,y.adjustContainer=T,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&&a.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()&&a.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:d.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=d.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;d.$unwatch(i),y.registerDestroyListener(d.$watch(y.rowngclass,y.viewParent,{row:n},(function(e,n){y.callDataGridMethod("applyRowNgClass",a.getConditionalClasses(e,n),t)}),i))}},registerColNgClassWatcher:function(e,t,n,i){if(t["col-ng-class"]){var o=y.getClonedRowObject(e),r=y.widgetId+"_colNgClass_"+n+"_"+i;d.$unwatch(r),y.registerDestroyListener(d.$watch(t["col-ng-class"],y.viewParent,{row:o},(function(e,t){y.callDataGridMethod("applyColNgClass",a.getConditionalClasses(e,t),n,i)}),r))}},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={},r={row:i,colDef:o};y.addEventsToContext(r);var a=y.customExprViewRef.createEmbeddedView(e,r).rootNodes[0],s=a.getAttribute("data-col-identifier");_.extend(o,y.columns[s]),n?y.customExprCompiledSummaryTl[s+t]=a:y.customExprCompiledTl[s+t]=a}};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,r){var a=y.getClonedRowObject(t),s=d.getClonedObject(y.rowDef);if(!1!==y.rowInstance.invokeEventCallback("beforerowexpand",{$event:e,$data:s,row:a})&&s.content)if(r(),y.rowDefMap[n]&&y.rowDefMap[n].content===s.content)y.rowInstance.invokeEventCallback("rowexpand",{$event:e,row:a,$data:y.rowDefInstances[n]});else{y.rowDefMap[n]=s,i.empty(),i.hide(),o.show();var l={row:a,rowDef:s,containerLoad:function(t){setTimeout((function(){o.hide(),i.show(),y.rowDefInstances[n]=t,y.rowInstance.invokeEventCallback("rowexpand",{$event:e,row:a,$data:t})}),500)}},c=y.rowDetailViewRef.createEmbeddedView(y.rowExpansionTmpl,l).rootNodes[0];i[0].appendChild(c),d.$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",a.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,d.$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){d.triggerFn(e.inlineInstance&&e.inlineInstance.redraw),d.triggerFn(e.inlineInstanceNew&&e.inlineInstanceNew.redraw),d.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(){d.$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)&&d.triggerFn(e.loadInlineWidgetData&&e.loadInlineWidgetData.bind(e))}))},applyValidations:function(e,t){t?d.triggerFn(e.applyNewRowValidations&&e.applyNewRowValidations.bind(e)):d.triggerFn(e.applyValidations&&e.applyValidations.bind(e))},removeValidations:function(e){y.fullFieldDefs.forEach((function(t){t.readonly||"rowOperations"===t.binding||(e?d.triggerFn(t.removeNewRowValidations&&t.removeNewRowValidations.bind(t)):d.triggerFn(t.removeValidations&&t.removeValidations.bind(t)))}))}},y._selectedItemsExist=!1,y._onChange=function(){},y._onTouched=function(){},a.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=a.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(d.DataSource.Operation.IS_API_AWARE)&&d.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)}d.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(),d.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",d.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",d.getClonedObject(this._gridData))}}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selecteditem",{get:function(){return this.multiselect?d.getClonedObject(this.items):_.isEmpty(this.items)?{}:d.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?a.EDIT_MODE.FORM:a.EDIT_MODE.DIALOG:this.editmode=this.readonlygrid?a.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=d.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=d.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){d.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===a.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&&(d.$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")?d.getClonedObject(this.datasource.filterExpressions.rules):d.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=d.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=d.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![d.DataSource.Operation.IS_API_AWARE,d.DataSource.Operation.IS_PAGEABLE,d.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=d.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 d.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&&d.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={};!d.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=a.getRowOperationsColumn(),i={name:n.field,field:n.field,isPredefined:!0};this.fieldDefs.length&&(e=_.find(this.fullFieldDefs,{field:E,type:"custom"}),_.remove(this.fieldDefs,{type:"custom",field:E}),_.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){d.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=a.transformData(e,this.name),!this.isNavigationEnabled()&&this._isClientSearch?(t=d.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(r){switch(r.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=r.sent(),i=this.dynamicTableRef.createComponent(n,0,this.inj),d.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,r=0;this.fieldDefs=[],this.headerConfig=[],this.columns={},n=e,t=a.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=r,o++,r++})),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(d.DataSource.Operation.IS_PAGEABLE)&&(t=this.datasource.execute(d.DataSource.Operation.GET_PAGING_OPTIONS),e=_.isEmpty(t)?"":a.getOrderByExpr(t.sort)),e||""},t.prototype.onPropertyChange=function(t,n,i){var o,r=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=d.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===a.NAVIGATION_TYPE.ONDEMAND,this.infScroll=n===a.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){r.exportOptions.push({label:e,icon:S[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){d.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(d.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=d.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!==E&&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(d.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||C($(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){d.$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}(a.StylableComponent);A.initializeProps=P(),A.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:[a.provideAs(A,i.NG_VALUE_ACCESSOR,!0),a.provideAsWidgetRef(A)]}]}],A.ctorParameters=function(){return[{type:t.Injector},{type:i.FormBuilder},{type:d.App},{type:d.DynamicComponentRefProvider},{type:d.StatePersistence},{type:d.PaginationService},{type:d.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:a.TrustAsPipe}]},A.propDecorators={dataNavigator:[{type:t.ViewChild,args:[u.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 R="new",I="edit",D="delete",N=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),d.triggerFn(n)}),250)},e.prototype.initiateSelectItem=function(e,t,n,i,o){var r=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(){(r.table.isNavigationEnabled()||i)&&r.selectItemOnSuccess(t,n,o),"quickedit"!==r.table.editmode||n||r.table.callDataGridMethod("setActiveRow",t)})))},e.prototype.updateVariable=function(e,t){var n=this,i=this.table.datasource;if(i&&(i.execute(d.DataSource.Operation.FETCH_DISTINCT_VALUES),!this.table.isNavigationEnabled())){var o=this.table.sortInfo,r=o&&o.direction?o.field+" "+o.direction:"";a.refreshDataSource(i,{page:1,filterFields:this.table.getFilterFields(this.table.filterInfo),orderBy:r,matchMode:"anywhereignorecase"}).then((function(){d.$appDigest(),n.selectItemOnSuccess(e,!0,t)}))}},e.prototype.insertSuccessHandler=function(e,t){if(e.error)this.table.invokeEventCallback("error",{$event:t.event,$operation:R,$data:e.error}),this.table.onError||this.table.toggleMessage(!0,"error",this.table.errormessage||e.error),d.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(d.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(d.DataSource.Operation.IS_API_AWARE)||this.table.initiateSelectItem(this.table.getNavigationTargetBySortInfo(),e,void 0,!1,t.callBack),d.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=d.extractCurrentItemExpr(i,this.table));for(var o=this.table.$element.parents(".app-list-item"),r=_.map(o,(function(e){return _.parseInt($(e).attr("listitemindex"))})),a=r.length-1;a>=0;a--)i=i.replace("$i",r[a]);n=_.last(r),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(d.DataSource.Operation.SUPPORTS_CRUD)||!n.execute(d.DataSource.Operation.IS_API_AWARE)||"wm.CrudVariable"===n.category){if(!n.execute(d.DataSource.Operation.IS_API_AWARE)){var r=this.generatePath(this.table.binddataset);return n.execute(d.DataSource.Operation.ADD_ITEM,{item:e.row,path:r.path,parentIndex:r.index}),void this.insertSuccessHandler(e.row,e)}n.execute(d.DataSource.Operation.INSERT_RECORD,o).then((function(o){t.insertSuccessHandler(o,e),"wm.CrudVariable"===n.category&&n.execute(d.DataSource.Operation.LIST_RECORDS,{skipToggleState:!0,operation:"list",page:i})}),(function(n){t.table.invokeEventCallback("error",{$event:e.event,$operation:R,$data:n}),t.table.onError||t.table.toggleMessage(!0,"error",t.table.errormessage||n),d.triggerFn(e.error,n),d.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),d.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(d.DataSource.Operation.SUPPORTS_CRUD)?(this.table.initiateSelectItem("current",e,void 0,!1,t.callBack),this.updateVariable(e,t.callBack)):this.table.datasource.execute(d.DataSource.Operation.IS_API_AWARE)||this.table.initiateSelectItem("current",e,void 0,!1,t.callBack),d.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(d.DataSource.Operation.SUPPORTS_CRUD)||!n.execute(d.DataSource.Operation.IS_API_AWARE)||"wm.CrudVariable"===n.category){if(!n.execute(d.DataSource.Operation.IS_API_AWARE)){var r=this.generatePath(this.table.binddataset);return n.execute(d.DataSource.Operation.SET_ITEM,{prevItem:e.prevData,item:e.row,path:r.path,parentIndex:r.index}),void this.updateSuccessHandler(e.row,e)}n.execute(d.DataSource.Operation.UPDATE_RECORD,o).then((function(o){t.updateSuccessHandler(o,e),"wm.CrudVariable"===n.category&&n.execute(d.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),d.triggerFn(e.error,n),d.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(){d.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(d.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(d.DataSource.Operation.SUPPORTS_CRUD)||!o.execute(d.DataSource.Operation.IS_API_AWARE)||this.table._isDependent||"wm.CrudVariable"===o.category){if(!o.execute(d.DataSource.Operation.IS_API_AWARE)){var r=this.generatePath(this.table.binddataset);return o.execute(d.DataSource.Operation.REMOVE_ITEM,{item:e.row,path:r.path,parentIndex:r.index}),void this.deleteSuccessHandler(e.row,void 0,e.evt,e.callBack)}o.execute(d.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(d.DataSource.Operation.LIST_RECORDS,{skipToggleState:!0,operation:"list",page:n})}),(function(t){i.table.isRowDeleted&&(i.table.isRowDeleted=!1),d.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});d.triggerFn(e.cancelRowDeleteCallback)}},e.prototype.deleteRecord=function(e){var t=this;if(!this.table.confirmdelete)return this.deleteFn(e),void d.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(){d.triggerFn(e.cancelRowDeleteCallback),t.dialogService.closeAppConfirmDialog()},onOpen:function(){$(".cancel-action").focus()},onEscape:function(){d.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){d.$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}();N.decorators=[{type:t.Directive,args:[{selector:"[wmTableCUD]"}]}],N.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Self},{type:t.Inject,args:[A]}]},{type:d.AbstractDialogService},{type:d.App}]};var x=["null","empty","nullorempty","isnotnull","isnotempty"],k=function(e,t){if(d.isDefined(e)&&""!==e)return d.isNumberType(t)?_.toNumber(e):t===d.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!d.isDefined(o)&&!_.includes(x,t.matchMode)||d.isNumberType(t.type)&&_.isNull(t.value)?e:e=e.filter((function(e){var r;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 r=_.filter(_.range(n.length),(function(e){return n[e].includes(o)}));_.forEach(r,(function(t){var o=_.get(e,n[t]);i.indexOf(o)<0&&i.push(o)}))}})),i=i.join(" ").toLowerCase()),t.matchMode){case"start":r=_.startsWith(i,o);break;case"end":r=_.endsWith(i,o);break;case"exact":r=_.isEqual(i,o);break;case"notequals":r=!_.isEqual(i,o);break;case"null":r=_.isNull(i);break;case"isnotnull":r=!_.isNull(i);break;case"empty":r=_.isEmpty(i);break;case"isnotempty":r=!_.isEmpty(i);break;case"nullorempty":r=_.isNull(i)||_.isEmpty(i);break;case"lessthan":r=i<o;break;case"lessthanequal":r=i<=o;break;case"greaterthan":r=i>o;break;case"greaterthanequal":r=i>=o;break;default:r=d.isNumberType(t.type)?_.isEqual(i,o):_.includes(i,o)}return r}))},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=a.getMatchModeTypesMap(),e.matchModeMsgs=a.getMatchModeMsgs(e.appLocale),e.emptyMatchModes=x,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(){d.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(d.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(d.DataSource.Operation.SUPPORTS_SERVER_FILTER)?(_.isEmpty(this.table.datasource.execute(d.DataSource.Operation.GET_OPTIONS).filterFields)&&this.clearFilter(!0),void this.resetSortStatus(e)):void(this.table.datasource.execute(d.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()?d.getClonedObject(this.table.__fullData):d.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=d.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),r=this.getLogicalOperator(o);a.refreshDataSource(this.table.datasource,{page:1,filterFields:o,orderBy:i,condition:r}).then((function(){d.$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=d.getClonedObject(e);var o=e&&e.direction?e.field+" "+e.direction:"",r=this.getFilterFields(this.table.filterInfo),s=this.getLogicalOperator(r);n||"none"===this.table.getConfiguredState()||this.table.statePersistence.removeWidgetState(this.table,"pagination"),a.refreshDataSource(this.table.datasource,{page:1,filterFields:r,orderBy:o,condition:s}).then((function(n){d.$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()&&a.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 r=d.getClonedObject(e),s=this.table.datasource;if(s||this.table.dataset){var l={};_.isArray(r)?r.forEach((function(e){j(l,e)})):j(l,r),!1!==this.table.invokeEventCallback("beforefilter",{$event:t,$data:l,columns:l})&&(r=[],_.isEmpty(l)&&!_.isEmpty(o)?_.isArray(o)?_.forEach(o,(function(e){B(r,e)})):B(r,o):_.forEach(l,(function(e,t){r.push({field:t,matchMode:e.matchMode,type:e.type,value:e.value})})),s&&s.execute(d.DataSource.Operation.SUPPORTS_SERVER_FILTER)?this.handleServerSideSearch(r):s&&s.execute(d.DataSource.Operation.IS_API_AWARE)&&s.execute(d.DataSource.Operation.IS_PAGEABLE)?this.handleSinglePageSearch(r):this.handleClientSideSortSearch(r,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()&&a.unsupportedStatePersistenceTypes.indexOf(this.table.navigation)<0){var r={direction:e.direction,field:e.field};e.direction?this.table.statePersistence.setWidgetState(this.table,{sort:r}):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(d.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 d.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()):d.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(d.DataSource.Operation.SUPPORTS_DISTINCT_API)){var n=e.field,i=this.table.fullFieldDefs,o=_.filter(i,{filteronfilter:n}),r=_.get(this.table.rowFilter,[n,"value"]);_.forEach(o,(function(e){var n=e.filteronfilter,i=e.field,o={},s=e.filterwidget;a.isDataSetWidget(s)&&n!==i&&!e.isFilterDataSetBound&&(o[n]=d.isDefined(r)&&""!==r&&null!==r?{value:r}:{},s===d.FormWidgetType.AUTOCOMPLETE&&e.filterInstance.dataoptions?e.filterInstance.dataoptions.filterFields=o:t.table.datasource.execute(d.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){(d.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),r=this.getLogicalOperator(o);a.refreshDataSource(this.table.datasource,{page:t,filterFields:o,orderBy:i,condition:r})}},e}();G.decorators=[{type:t.Directive,args:[{selector:"[wmTableFilterSort]"}]}],G.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Self},{type:t.Inject,args:[A]}]}]};var V=function(){a.register("wm-table-action",new Map([["accessroles",a.PROP_STRING],["action",a.PROP_STRING],["caption",a.PROP_STRING],["class",a.PROP_STRING],["conditionalclass",a.PROP_ANY],["conditionalstyle",a.PROP_ANY],["disabled",Object.assign({value:!1},a.PROP_BOOLEAN)],["display-name",a.PROP_STRING],["hyperlink",a.PROP_STRING],["icon",a.PROP_STRING],["iconclass",a.PROP_STRING],["key",a.PROP_STRING],["position",Object.assign({value:"footer"},a.PROP_STRING)],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["title",a.PROP_STRING],["target",a.PROP_STRING],["widget-type",Object.assign({value:"button"},a.PROP_STRING)]]))},U={widgetType:"wm-table-action",hostClass:""},W=function(e){function t(t,n){var i=e.call(this,t,U)||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}(a.BaseComponent);W.initializeProps=V(),W.decorators=[{type:t.Directive,args:[{selector:"[wmTableAction]",providers:[a.provideAsWidgetRef(W)]}]}],W.ctorParameters=function(){return[{type:t.Injector},{type:A,decorators:[{type:t.Optional}]}]};var q=function(){a.register("wm-table-column",new Map([["accessroles",a.PROP_STRING],["autoclose",Object.assign({value:"outsideClick"},a.PROP_STRING)],["backgroundcolor",a.PROP_STRING],["binding",a.PROP_STRING],["caption",a.PROP_STRING],["checkedvalue",a.PROP_STRING],["col-class",a.PROP_STRING],["collapsible",a.PROP_BOOLEAN],["col-ng-class",a.PROP_STRING],["currencypattern",a.PROP_STRING],["customExpression",a.PROP_BOOLEAN],["dataentrymode",Object.assign({value:"default"},a.PROP_STRING)],["datafield",a.PROP_STRING],["dataoptions",a.PROP_ANY],["dataset",a.PROP_ANY],["datasource",a.PROP_STRING],["dateformat",a.PROP_STRING],["datepattern",a.PROP_STRING],["debouncetime",Object.assign({value:250},a.PROP_NUMBER)],["defaultvalue",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["displayfield",a.PROP_STRING],["displaylabel",a.PROP_STRING],["editdatepattern",a.PROP_STRING],["outputformat",a.PROP_STRING],["edit-widget-type",a.PROP_STRING],["editinputtype",a.PROP_STRING],["exportexpression",a.PROP_STRING],["filterdataset",a.PROP_STRING],["filterdatafield",a.PROP_STRING],["filterdisplayfield",a.PROP_STRING],["filterdisplaylabel",a.PROP_STRING],["filterexpressions",Object.assign({value:"{}"},a.PROP_STRING)],["filtersearchkey",a.PROP_STRING],["filter-on",a.PROP_STRING],["filteronfilter",a.PROP_STRING],["filterplaceholder",a.PROP_STRING],["filterwidget",a.PROP_STRING],["filterinputtype",a.PROP_STRING],["formatpattern",a.PROP_STRING],["custompipeformat",a.PROP_STRING],["fractionsize",a.PROP_STRING],["generator",a.PROP_STRING],["groupby",a.PROP_STRING],["limit",a.PROP_NUMBER],["match",a.PROP_STRING],["matchmode",a.PROP_STRING],["maxchars",a.PROP_NUMBER],["maxvalue",a.PROP_NUMBER],["step",a.PROP_NUMBER],["mobiledisplay",Object.assign({value:!0},a.PROP_BOOLEAN)],["minvalue",a.PROP_NUMBER],["maxdate",a.PROP_STRING],["mindate",a.PROP_STRING],["excludedays",a.PROP_STRING],["excludedates",a.PROP_STRING],["maxtime",a.PROP_STRING],["mintime",a.PROP_STRING],["pcdisplay",Object.assign({value:!0},a.PROP_BOOLEAN)],["period",a.PROP_BOOLEAN],["placeholder",a.PROP_STRING],["prefix",a.PROP_STRING],["primary-key",a.PROP_BOOLEAN],["readonly",a.PROP_BOOLEAN],["regexp",a.PROP_ANY],["related-entity-name",a.PROP_STRING],["required",a.PROP_BOOLEAN],["rowactionsposition",a.PROP_STRING],["searchkey",a.PROP_STRING],["searchable",Object.assign({value:!0},a.PROP_BOOLEAN)],["showinfilter",Object.assign({value:!1},a.PROP_BOOLEAN)],["suffix",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["showcount",a.PROP_BOOLEAN],["showdropdownon",Object.assign({value:"default"},a.PROP_STRING)],["sortable",Object.assign({value:!0},a.PROP_BOOLEAN)],["tabletdisplay",Object.assign({value:!0},a.PROP_BOOLEAN)],["textalignment",Object.assign({value:"left"},a.PROP_STRING)],["textcolor",a.PROP_STRING],["type",Object.assign({value:"string"},a.PROP_STRING)],["uncheckedvalue",a.PROP_STRING],["validationmessage",a.PROP_STRING],["widget-type",a.PROP_STRING],["width",a.PROP_STRING]]))},z=function(){a.register("wm-table-column-group",new Map([["backgroundcolor",a.PROP_STRING],["caption",a.PROP_STRING],["col-class",a.PROP_STRING],["name",a.PROP_STRING],["textalignment",Object.assign({value:"center"},a.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;a.setHeaderConfigForTable(this.table.headerConfig,this.config,i,i?n:t)},t}(a.BaseComponent);Y.initializeProps=z(),Y.decorators=[{type:t.Directive,args:[{selector:"[wmTableColumnGroup]",providers:[a.provideAsWidgetRef(Y)]}]}],Y.ctorParameters=function(){return[{type:t.Injector},{type:Y,decorators:[{type:t.SkipSelf},{type:t.Optional}]},{type:A,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 X=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,r,a){var s=e.call(this,t,K)||this;return s.appDefaults=n,s.table=i,s.group=o,s.bindfilterdataset=r,s.binddataset=a,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(a.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!==a.EDIT_MODE.DIALOG&&this.table.editmode!==a.EDIT_MODE.FORM,this._isNewEditableRow=this._isInlineEditable&&this.table.editmode===a.EDIT_MODE.QUICK_EDIT&&this.table.shownewrow,this.setUpControls(),this._propsInitialized=!0,this.getFormControl()){var r=this.getFormControl().statusChanges.pipe(m.debounceTime(100)).subscribe((function(e){return t.onStatusChange(e,"inlineInstance")}));this.registerDestroyListener((function(){return r.unsubscribe()})),this.fieldValidations=new a.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 a.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 X(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===d.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 r=this.filterControl.valueChanges.subscribe(this.onFilterValueChange.bind(this));this.registerDestroyListener((function(){return r.unsubscribe()}))}},t.prototype.resetFilter=function(){this.filterControl&&this.filterControl.setValue(""),this.filterwidget===d.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!==d.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&&a.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&&a.isDataSetWidget(this.filterwidget)&&!this.bindfilterdataset&&(this.table.datasource.execute(d.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===d.FormWidgetType.AUTOCOMPLETE?(this.filterInstance.dataoptions=a.getDistinctFieldProperties(this.table.datasource,this),this.filterInstance.datasource=this.table.datasource):a.getDistinctValues(this.table.datasource,this.widget,"filterwidget").then((function(t){e._filterDataSet=t.data,e.setFilterWidgetDataSet()}))):this.registerDestroyListener(d.$watch(this.table.binddataset,this.viewParent,{},(function(t){return e.widget.filterdataset=t}),a.getWatchIdentifier(this.widgetId,"filterdataset"))))},t.prototype.loadInlineWidgetData=function(){if(a.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,a.fetchRelatedFieldData(e,this.widget,{relatedField:_.head(t),datafield:_.last(t),widget:"edit-widget-type"})}else e.execute(d.DataSource.Operation.SUPPORTS_DISTINCT_API)&&a.getDistinctValuesForField(e,this.widget,{widget:"edit-widget-type"})}},t.prototype.onDataSourceChange=function(){this.loadFilterData(),this.table.editmode===a.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(a.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===d.FormWidgetType.AUTOCOMPLETE&&(e.filterInstance.displaylabel=e.filterdisplaylabel||t,e.filterInstance.searchkey=e.filtersearchkey||t)}e.filterwidget===d.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===d.FormWidgetType.TIME&&(t="timepattern"),this[e]&&d.isDefined(n)&&(this[e][t]=n)},t.prototype.setUpInlineWidget=function(e){var t=this;this[e].registerReadyStateListener((function(){a.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"]||a.getEditModeWidget(this),this.filterOn=this["filter-on"],this.readonly=d.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||a.getDataTableFilterWidget(this.type||"string"),this.isFilterDataSetBound=!!this.bindfilterdataset,this.defaultvalue=a.getDefaultValue(this.defaultvalue,this.type,this.editWidgetType),d.isDateTimeType(this.type)&&"toDate"===this.formatpattern&&!this.datepattern){var e=d.getDisplayDateTimeFormat(this.type);this.type===d.DataType.DATE?this.datepattern=this.appDefaults.dateFormat||e:this.type===d.DataType.TIME?this.datepattern=this.appDefaults.timeFormat||e:this.type!==d.DataType.TIMESTAMP&&this.type!==d.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=a.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}(a.BaseComponent);J.initializeProps=q(),J.decorators=[{type:t.Directive,args:[{selector:"[wmTableColumn]",providers:[a.provideAsWidgetRef(J)]}]}],J.ctorParameters=function(){return[{type:t.Injector},{type:d.AppDefaults},{type:A,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 Z=function(){a.register("wm-table-row",new Map([["class",a.PROP_STRING],["closeothers",Object.assign({value:!0},a.PROP_BOOLEAN)],["content",a.PROP_STRING],["columnwidth",Object.assign({value:"30px"},a.PROP_STRING)],["collapseicon",a.PROP_STRING],["expandicon",a.PROP_STRING],["height",a.PROP_STRING],["position",Object.assign({value:"0"},a.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}(a.BaseComponent);te.initializeProps=Z(),te.decorators=[{type:t.Directive,args:[{selector:"[wmTableRow]",providers:[a.provideAsWidgetRef(te)]}]}],te.ctorParameters=function(){return[{type:t.Injector},{type:A,decorators:[{type:t.Optional},{type:t.SkipSelf}]}]};var ne=function(){a.register("wm-table-row-action",new Map([["accessroles",a.PROP_STRING],["action",a.PROP_STRING],["caption",a.PROP_STRING],["class ",Object.assign({value:"btn-secondary"},a.PROP_STRING)],["disabled",Object.assign({value:!1},a.PROP_BOOLEAN)],["display-name",a.PROP_STRING],["hyperlink",a.PROP_STRING],["iconclass",a.PROP_STRING],["key",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["target",a.PROP_STRING],["title",a.PROP_STRING],["widget-type",Object.assign({value:"button"},a.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}(a.BaseComponent);oe.initializeProps=ne(),oe.decorators=[{type:t.Directive,args:[{selector:"[wmTableRowAction]",providers:[a.provideAsWidgetRef(oe),{provide:a.Context,useValue:{},multi:!0}]}]}],oe.ctorParameters=function(){return[{type:t.Injector},{type:A,decorators:[{type:t.Optional}]},{type:Array,decorators:[{type:t.Self},{type:t.Inject,args:[a.Context]}]}]};var re=[A,N,G,W,J,Y,te,oe],ae=function(){};ae.decorators=[{type:t.NgModule,args:[{imports:[s.BasicModule,r.BsDropdownModule,n.CommonModule,i.FormsModule,i.ReactiveFormsModule,l.InputModule,p.ListModule,c.MenuModule,u.PaginationModule,o.TooltipModule,a.WmComponentsModule],declarations:w([],b(re)),exports:w([],b(re)),entryComponents:[]}]}],e.TableActionDirective=W,e.TableCUDDirective=N,e.TableColumnDirective=J,e.TableColumnGroupDirective=Y,e.TableComponent=A,e.TableFilterSortDirective=G,e.TableModule=ae,e.TableRowActionDirective=oe,e.TableRowDirective=te,e["\u0275a"]=P,e["\u0275b"]=V,e["\u0275c"]=z,e["\u0275d"]=q,e["\u0275e"]=Z,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,r,a){"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,r){function a(e){try{l(i.next(e))}catch(e){r(e)}}function s(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))}function y(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}}Object.create;function b(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function w(e,t,n){if(n||2===arguments.length)for(var i,o=0,r=t.length;o<r;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var P=function(){a.register("wm-table",new Map([["boundarylinks",Object.assign({value:!1},a.PROP_BOOLEAN)],["class",a.PROP_STRING],["confirmdelete",Object.assign({value:"Are you sure you want to delete this?"},a.PROP_STRING)],["datasource",a.PROP_STRING],["dataset",a.PROP_ANY],["deletecanceltext",a.PROP_STRING],["deleteoktext",a.PROP_STRING],["deletemessage",Object.assign({value:"Record deleted successfully"},a.PROP_STRING)],["directionlinks",Object.assign({value:!0},a.PROP_BOOLEAN)],["editmode",a.PROP_STRING],["errorstyle",Object.assign({value:"hover"},a.PROP_STRING)],["enablecolumnselection",Object.assign({value:!1},a.PROP_BOOLEAN)],["enablesort",Object.assign({value:!0},a.PROP_BOOLEAN)],["errormessage",a.PROP_STRING],["exportformat",a.PROP_STRING],["exportdatasize",Object.assign({value:100},a.PROP_NUMBER)],["filtermode",a.PROP_STRING],["filternullrecords",Object.assign({value:!0},a.PROP_BOOLEAN)],["forceellipses",Object.assign({value:!0},a.PROP_BOOLEAN)],["formposition",a.PROP_STRING],["gridclass",Object.assign({value:"table-hover"},a.PROP_STRING)],["gridfirstrowselect",a.PROP_BOOLEAN],["iconclass",a.PROP_STRING],["insertmessage",Object.assign({value:"Record added successfully"},a.PROP_STRING)],["isdynamictable",a.PROP_BOOLEAN],["isrowexpansionenabled",a.PROP_BOOLEAN],["loadingdatamsg",Object.assign({value:"Loading..."},a.PROP_STRING)],["loadingicon",Object.assign({value:"fa fa-circle-o-notch fa-spin"},a.PROP_STRING)],["maxsize",Object.assign({value:5},a.PROP_NUMBER)],["multiselect",a.PROP_BOOLEAN],["name",a.PROP_STRING],["navigation",Object.assign({value:"Basic"},a.PROP_STRING)],["navigationalign",Object.assign({value:"left"},a.PROP_STRING)],["nodatamessage",Object.assign({value:"No data found."},a.PROP_STRING)],["ondemandmessage",Object.assign({value:"Load More"},a.PROP_STRING)],["showviewlessbutton",Object.assign({value:!1},a.PROP_BOOLEAN)],["viewlessmessage",Object.assign({value:"View Less"},a.PROP_STRING)],["pagesize",a.PROP_NUMBER],["radioselect",a.PROP_BOOLEAN],["rowclass",a.PROP_STRING],["rowngclass",a.PROP_STRING],["searchlabel",Object.assign({value:"Search"},a.PROP_STRING)],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["showheader",Object.assign({value:!0},a.PROP_BOOLEAN)],["shownewrow",Object.assign({value:!0},a.PROP_BOOLEAN)],["showrecordcount",a.PROP_BOOLEAN],["showrowindex",a.PROP_BOOLEAN],["spacing",Object.assign({value:"normal"},a.PROP_STRING)],["statehandler",Object.assign({value:"none"},a.PROP_STRING)],["subheading",a.PROP_STRING],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["title",a.PROP_STRING],["updatemessage",Object.assign({value:"Record updated successfully"},a.PROP_STRING)]]))},O={widgetType:"wm-table",hostClass:"app-grid app-panel panel"},S={EXCEL:"fa fa-file-excel-o",CSV:"fa fa-file-text-o"},E="rowOperations",T=function(){},C=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},A=function(e){function t(t,n,i,o,r,s,l,c,p,u,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=r,y.paginationService=s,y.viewport=l,y.parentList=c,y.binddataset=p,y.binddatasource=u,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=T,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=T,y.searchSortHandler=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];y._searchSortHandler.apply(y,e)},y.onRowFilterChange=T,y.onFilterConditionSelect=T,y.showClearIcon=T,y.clearRowFilter=T,y.adjustContainer=T,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&&a.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()&&a.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:d.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=d.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;d.$unwatch(i),y.registerDestroyListener(d.$watch(y.rowngclass,y.viewParent,{row:n},(function(e,n){y.callDataGridMethod("applyRowNgClass",a.getConditionalClasses(e,n),t)}),i))}},registerColNgClassWatcher:function(e,t,n,i){if(t["col-ng-class"]){var o=y.getClonedRowObject(e),r=y.widgetId+"_colNgClass_"+n+"_"+i;d.$unwatch(r),y.registerDestroyListener(d.$watch(t["col-ng-class"],y.viewParent,{row:o},(function(e,t){y.callDataGridMethod("applyColNgClass",a.getConditionalClasses(e,t),n,i)}),r))}},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={},r={row:i,colDef:o};y.addEventsToContext(r);var a=y.customExprViewRef.createEmbeddedView(e,r).rootNodes[0],s=a.getAttribute("data-col-identifier");_.extend(o,y.columns[s]),n?y.customExprCompiledSummaryTl[s+t]=a:y.customExprCompiledTl[s+t]=a}};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,r){var a=y.getClonedRowObject(t),s=d.getClonedObject(y.rowDef);if(!1!==y.rowInstance.invokeEventCallback("beforerowexpand",{$event:e,$data:s,row:a})&&s.content)if(r(),y.rowDefMap[n]&&y.rowDefMap[n].content===s.content)y.rowInstance.invokeEventCallback("rowexpand",{$event:e,row:a,$data:y.rowDefInstances[n]});else{y.rowDefMap[n]=s,i.empty(),i.hide(),o.show();var l={row:a,rowDef:s,containerLoad:function(t){setTimeout((function(){o.hide(),i.show(),y.rowDefInstances[n]=t,y.rowInstance.invokeEventCallback("rowexpand",{$event:e,row:a,$data:t})}),500)}},c=y.rowDetailViewRef.createEmbeddedView(y.rowExpansionTmpl,l).rootNodes[0];i[0].appendChild(c),d.$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",a.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,d.$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){d.triggerFn(e.inlineInstance&&e.inlineInstance.redraw),d.triggerFn(e.inlineInstanceNew&&e.inlineInstanceNew.redraw),d.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(){d.$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)&&d.triggerFn(e.loadInlineWidgetData&&e.loadInlineWidgetData.bind(e))}))},applyValidations:function(e,t){t?d.triggerFn(e.applyNewRowValidations&&e.applyNewRowValidations.bind(e)):d.triggerFn(e.applyValidations&&e.applyValidations.bind(e))},removeValidations:function(e){y.fullFieldDefs.forEach((function(t){t.readonly||"rowOperations"===t.binding||(e?d.triggerFn(t.removeNewRowValidations&&t.removeNewRowValidations.bind(t)):d.triggerFn(t.removeValidations&&t.removeValidations.bind(t)))}))}},y._selectedItemsExist=!1,y._onChange=function(){},y._onTouched=function(){},a.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=a.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(d.DataSource.Operation.IS_API_AWARE)&&d.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)}d.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(),d.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",d.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",d.getClonedObject(this._gridData))}}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selecteditem",{get:function(){return this.multiselect?d.getClonedObject(this.items):_.isEmpty(this.items)?{}:d.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?a.EDIT_MODE.FORM:a.EDIT_MODE.DIALOG:this.editmode=this.readonlygrid?a.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=d.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=d.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){d.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===a.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&&(d.$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")?d.getClonedObject(this.datasource.filterExpressions.rules):d.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=d.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=d.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![d.DataSource.Operation.IS_API_AWARE,d.DataSource.Operation.IS_PAGEABLE,d.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=d.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 d.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&&d.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={};!d.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=a.getRowOperationsColumn(),i={name:n.field,field:n.field,isPredefined:!0};this.fieldDefs.length&&(e=_.find(this.fullFieldDefs,{field:E,type:"custom"}),_.remove(this.fieldDefs,{type:"custom",field:E}),_.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){d.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=a.transformData(e,this.name),!this.isNavigationEnabled()&&this._isClientSearch?(t=d.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(r){switch(r.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=r.sent(),i=this.dynamicTableRef.createComponent(n,0,this.inj),d.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,r=0;this.fieldDefs=[],this.headerConfig=[],this.columns={},n=e,t=a.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=r,o++,r++})),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(d.DataSource.Operation.IS_PAGEABLE)&&(t=this.datasource.execute(d.DataSource.Operation.GET_PAGING_OPTIONS),e=_.isEmpty(t)?"":a.getOrderByExpr(t.sort)),e||""},t.prototype.onPropertyChange=function(t,n,i){var o,r=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=d.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===a.NAVIGATION_TYPE.ONDEMAND,this.infScroll=n===a.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){r.exportOptions.push({label:e,icon:S[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){d.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(d.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=d.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!==E&&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(d.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||C($(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){d.$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}(a.StylableComponent);A.initializeProps=P(),A.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:[a.provideAs(A,i.NG_VALUE_ACCESSOR,!0),a.provideAsWidgetRef(A)]}]}],A.ctorParameters=function(){return[{type:t.Injector},{type:i.FormBuilder},{type:d.App},{type:d.DynamicComponentRefProvider},{type:d.StatePersistence},{type:d.PaginationService},{type:d.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:a.TrustAsPipe}]},A.propDecorators={dataNavigator:[{type:t.ViewChild,args:[u.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 R="new",I="edit",D="delete",N=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),d.triggerFn(n)}),250)},e.prototype.initiateSelectItem=function(e,t,n,i,o){var r=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(){(r.table.isNavigationEnabled()||i)&&r.selectItemOnSuccess(t,n,o),"quickedit"!==r.table.editmode||n||r.table.callDataGridMethod("setActiveRow",t)})))},e.prototype.updateVariable=function(e,t){var n=this,i=this.table.datasource;if(i&&(i.execute(d.DataSource.Operation.FETCH_DISTINCT_VALUES),!this.table.isNavigationEnabled())){var o=this.table.sortInfo,r=o&&o.direction?o.field+" "+o.direction:"";a.refreshDataSource(i,{page:1,filterFields:this.table.getFilterFields(this.table.filterInfo),orderBy:r,matchMode:"anywhereignorecase"}).then((function(){d.$appDigest(),n.selectItemOnSuccess(e,!0,t)}))}},e.prototype.insertSuccessHandler=function(e,t){if(e.error)this.table.invokeEventCallback("error",{$event:t.event,$operation:R,$data:e.error}),this.table.onError||this.table.toggleMessage(!0,"error",this.table.errormessage||e.error),d.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(d.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(d.DataSource.Operation.IS_API_AWARE)||this.table.initiateSelectItem(this.table.getNavigationTargetBySortInfo(),e,void 0,!1,t.callBack),d.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=d.extractCurrentItemExpr(i,this.table));for(var o=this.table.$element.parents(".app-list-item"),r=_.map(o,(function(e){return _.parseInt($(e).attr("listitemindex"))})),a=r.length-1;a>=0;a--)i=i.replace("$i",r[a]);n=_.last(r),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(d.DataSource.Operation.SUPPORTS_CRUD)||!n.execute(d.DataSource.Operation.IS_API_AWARE)||"wm.CrudVariable"===n.category){if(!n.execute(d.DataSource.Operation.IS_API_AWARE)){var r=this.generatePath(this.table.binddataset);return n.execute(d.DataSource.Operation.ADD_ITEM,{item:e.row,path:r.path,parentIndex:r.index}),void this.insertSuccessHandler(e.row,e)}n.execute(d.DataSource.Operation.INSERT_RECORD,o).then((function(o){t.insertSuccessHandler(o,e),"wm.CrudVariable"===n.category&&n.execute(d.DataSource.Operation.LIST_RECORDS,{skipToggleState:!0,operation:"list",page:i})}),(function(n){t.table.invokeEventCallback("error",{$event:e.event,$operation:R,$data:n}),t.table.onError||t.table.toggleMessage(!0,"error",t.table.errormessage||n),d.triggerFn(e.error,n),d.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),d.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(d.DataSource.Operation.SUPPORTS_CRUD)?(this.table.initiateSelectItem("current",e,void 0,!1,t.callBack),this.updateVariable(e,t.callBack)):this.table.datasource.execute(d.DataSource.Operation.IS_API_AWARE)||this.table.initiateSelectItem("current",e,void 0,!1,t.callBack),d.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(d.DataSource.Operation.SUPPORTS_CRUD)||!n.execute(d.DataSource.Operation.IS_API_AWARE)||"wm.CrudVariable"===n.category){if(!n.execute(d.DataSource.Operation.IS_API_AWARE)){var r=this.generatePath(this.table.binddataset);return n.execute(d.DataSource.Operation.SET_ITEM,{prevItem:e.prevData,item:e.row,path:r.path,parentIndex:r.index}),void this.updateSuccessHandler(e.row,e)}n.execute(d.DataSource.Operation.UPDATE_RECORD,o).then((function(o){t.updateSuccessHandler(o,e),"wm.CrudVariable"===n.category&&n.execute(d.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),d.triggerFn(e.error,n),d.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(){d.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(d.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(d.DataSource.Operation.SUPPORTS_CRUD)||!o.execute(d.DataSource.Operation.IS_API_AWARE)||this.table._isDependent||"wm.CrudVariable"===o.category){if(!o.execute(d.DataSource.Operation.IS_API_AWARE)){var r=this.generatePath(this.table.binddataset);return o.execute(d.DataSource.Operation.REMOVE_ITEM,{item:e.row,path:r.path,parentIndex:r.index}),void this.deleteSuccessHandler(e.row,void 0,e.evt,e.callBack)}o.execute(d.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(d.DataSource.Operation.LIST_RECORDS,{skipToggleState:!0,operation:"list",page:n})}),(function(t){i.table.isRowDeleted&&(i.table.isRowDeleted=!1),d.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});d.triggerFn(e.cancelRowDeleteCallback)}},e.prototype.deleteRecord=function(e){var t=this;if(!this.table.confirmdelete)return this.deleteFn(e),void d.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(){d.triggerFn(e.cancelRowDeleteCallback),t.dialogService.closeAppConfirmDialog()},onOpen:function(){$(".cancel-action").focus()},onEscape:function(){d.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){d.$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}();N.decorators=[{type:t.Directive,args:[{selector:"[wmTableCUD]"}]}],N.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Self},{type:t.Inject,args:[A]}]},{type:d.AbstractDialogService},{type:d.App}]};var x=["null","empty","nullorempty","isnotnull","isnotempty"],k=function(e,t){if(d.isDefined(e)&&""!==e)return d.isNumberType(t)?_.toNumber(e):t===d.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!d.isDefined(o)&&!_.includes(x,t.matchMode)||d.isNumberType(t.type)&&_.isNull(t.value)?e:e=e.filter((function(e){var r;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 r=_.filter(_.range(n.length),(function(e){return n[e].includes(o)}));_.forEach(r,(function(t){var o=_.get(e,n[t]);i.indexOf(o)<0&&i.push(o)}))}})),i=i.join(" ").toLowerCase()),t.matchMode){case"start":r=_.startsWith(i,o);break;case"end":r=_.endsWith(i,o);break;case"exact":r=_.isEqual(i,o);break;case"notequals":r=!_.isEqual(i,o);break;case"null":r=_.isNull(i);break;case"isnotnull":r=!_.isNull(i);break;case"empty":r=_.isEmpty(i);break;case"isnotempty":r=!_.isEmpty(i);break;case"nullorempty":r=_.isNull(i)||_.isEmpty(i);break;case"lessthan":r=i<o;break;case"lessthanequal":r=i<=o;break;case"greaterthan":r=i>o;break;case"greaterthanequal":r=i>=o;break;default:r=d.isNumberType(t.type)?_.isEqual(i,o):_.includes(i,o)}return r}))},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=a.getMatchModeTypesMap(),e.matchModeMsgs=a.getMatchModeMsgs(e.appLocale),e.emptyMatchModes=x,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(){d.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(d.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(d.DataSource.Operation.SUPPORTS_SERVER_FILTER)?(_.isEmpty(this.table.datasource.execute(d.DataSource.Operation.GET_OPTIONS).filterFields)&&this.clearFilter(!0),void this.resetSortStatus(e)):void(this.table.datasource.execute(d.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()?d.getClonedObject(this.table.__fullData):d.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=d.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),r=this.getLogicalOperator(o);a.refreshDataSource(this.table.datasource,{page:1,filterFields:o,orderBy:i,condition:r}).then((function(){d.$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=d.getClonedObject(e);var o=e&&e.direction?e.field+" "+e.direction:"",r=this.getFilterFields(this.table.filterInfo),s=this.getLogicalOperator(r);n||"none"===this.table.getConfiguredState()||this.table.statePersistence.removeWidgetState(this.table,"pagination"),a.refreshDataSource(this.table.datasource,{page:1,filterFields:r,orderBy:o,condition:s}).then((function(n){d.$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()&&a.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 r=d.getClonedObject(e),s=this.table.datasource;if(s||this.table.dataset){var l={};_.isArray(r)?r.forEach((function(e){j(l,e)})):j(l,r),!1!==this.table.invokeEventCallback("beforefilter",{$event:t,$data:l,columns:l})&&(r=[],_.isEmpty(l)&&!_.isEmpty(o)?_.isArray(o)?_.forEach(o,(function(e){B(r,e)})):B(r,o):_.forEach(l,(function(e,t){r.push({field:t,matchMode:e.matchMode,type:e.type,value:e.value})})),s&&s.execute(d.DataSource.Operation.SUPPORTS_SERVER_FILTER)?this.handleServerSideSearch(r):s&&s.execute(d.DataSource.Operation.IS_API_AWARE)&&s.execute(d.DataSource.Operation.IS_PAGEABLE)?this.handleSinglePageSearch(r):this.handleClientSideSortSearch(r,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()&&a.unsupportedStatePersistenceTypes.indexOf(this.table.navigation)<0){var r={direction:e.direction,field:e.field};e.direction?this.table.statePersistence.setWidgetState(this.table,{sort:r}):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(d.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 d.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()):d.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(d.DataSource.Operation.SUPPORTS_DISTINCT_API)){var n=e.field,i=this.table.fullFieldDefs,o=_.filter(i,{filteronfilter:n}),r=_.get(this.table.rowFilter,[n,"value"]);_.forEach(o,(function(e){var n=e.filteronfilter,i=e.field,o={},s=e.filterwidget;a.isDataSetWidget(s)&&n!==i&&!e.isFilterDataSetBound&&(o[n]=d.isDefined(r)&&""!==r&&null!==r?{value:r}:{},s===d.FormWidgetType.AUTOCOMPLETE&&e.filterInstance.dataoptions?e.filterInstance.dataoptions.filterFields=o:t.table.datasource.execute(d.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){(d.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),r=this.getLogicalOperator(o);a.refreshDataSource(this.table.datasource,{page:t,filterFields:o,orderBy:i,condition:r})}},e}();G.decorators=[{type:t.Directive,args:[{selector:"[wmTableFilterSort]"}]}],G.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Self},{type:t.Inject,args:[A]}]}]};var V=function(){a.register("wm-table-action",new Map([["accessroles",a.PROP_STRING],["action",a.PROP_STRING],["caption",a.PROP_STRING],["class",a.PROP_STRING],["conditionalclass",a.PROP_ANY],["conditionalstyle",a.PROP_ANY],["disabled",Object.assign({value:!1},a.PROP_BOOLEAN)],["display-name",a.PROP_STRING],["hyperlink",a.PROP_STRING],["icon",a.PROP_STRING],["iconclass",a.PROP_STRING],["key",a.PROP_STRING],["position",Object.assign({value:"footer"},a.PROP_STRING)],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["title",a.PROP_STRING],["target",a.PROP_STRING],["widget-type",Object.assign({value:"button"},a.PROP_STRING)]]))},U={widgetType:"wm-table-action",hostClass:""},W=function(e){function t(t,n){var i=e.call(this,t,U)||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}(a.BaseComponent);W.initializeProps=V(),W.decorators=[{type:t.Directive,args:[{selector:"[wmTableAction]",providers:[a.provideAsWidgetRef(W)]}]}],W.ctorParameters=function(){return[{type:t.Injector},{type:A,decorators:[{type:t.Optional}]}]};var q=function(){a.register("wm-table-column",new Map([["accessroles",a.PROP_STRING],["autoclose",Object.assign({value:"outsideClick"},a.PROP_STRING)],["backgroundcolor",a.PROP_STRING],["binding",a.PROP_STRING],["caption",a.PROP_STRING],["checkedvalue",a.PROP_STRING],["col-class",a.PROP_STRING],["collapsible",a.PROP_BOOLEAN],["col-ng-class",a.PROP_STRING],["currencypattern",a.PROP_STRING],["customExpression",a.PROP_BOOLEAN],["dataentrymode",Object.assign({value:"default"},a.PROP_STRING)],["datafield",a.PROP_STRING],["dataoptions",a.PROP_ANY],["dataset",a.PROP_ANY],["datasource",a.PROP_STRING],["dateformat",a.PROP_STRING],["datepattern",a.PROP_STRING],["debouncetime",Object.assign({value:250},a.PROP_NUMBER)],["defaultvalue",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["displayfield",a.PROP_STRING],["displaylabel",a.PROP_STRING],["editdatepattern",a.PROP_STRING],["outputformat",a.PROP_STRING],["edit-widget-type",a.PROP_STRING],["editinputtype",a.PROP_STRING],["exportexpression",a.PROP_STRING],["filterdataset",a.PROP_STRING],["filterdatafield",a.PROP_STRING],["filterdisplayfield",a.PROP_STRING],["filterdisplaylabel",a.PROP_STRING],["filterexpressions",Object.assign({value:"{}"},a.PROP_STRING)],["filtersearchkey",a.PROP_STRING],["filter-on",a.PROP_STRING],["filteronfilter",a.PROP_STRING],["filterplaceholder",a.PROP_STRING],["filterwidget",a.PROP_STRING],["filterinputtype",a.PROP_STRING],["formatpattern",a.PROP_STRING],["custompipeformat",a.PROP_STRING],["fractionsize",a.PROP_STRING],["generator",a.PROP_STRING],["groupby",a.PROP_STRING],["limit",a.PROP_NUMBER],["match",a.PROP_STRING],["matchmode",a.PROP_STRING],["maxchars",a.PROP_NUMBER],["maxvalue",a.PROP_NUMBER],["step",a.PROP_NUMBER],["mobiledisplay",Object.assign({value:!0},a.PROP_BOOLEAN)],["minvalue",a.PROP_NUMBER],["maxdate",a.PROP_STRING],["mindate",a.PROP_STRING],["excludedays",a.PROP_STRING],["excludedates",a.PROP_STRING],["maxtime",a.PROP_STRING],["mintime",a.PROP_STRING],["pcdisplay",Object.assign({value:!0},a.PROP_BOOLEAN)],["period",a.PROP_BOOLEAN],["placeholder",a.PROP_STRING],["prefix",a.PROP_STRING],["primary-key",a.PROP_BOOLEAN],["readonly",a.PROP_BOOLEAN],["regexp",a.PROP_ANY],["related-entity-name",a.PROP_STRING],["required",a.PROP_BOOLEAN],["rowactionsposition",a.PROP_STRING],["searchkey",a.PROP_STRING],["searchable",Object.assign({value:!0},a.PROP_BOOLEAN)],["showinfilter",Object.assign({value:!1},a.PROP_BOOLEAN)],["suffix",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["showcount",a.PROP_BOOLEAN],["showdropdownon",Object.assign({value:"default"},a.PROP_STRING)],["sortable",Object.assign({value:!0},a.PROP_BOOLEAN)],["tabletdisplay",Object.assign({value:!0},a.PROP_BOOLEAN)],["textalignment",Object.assign({value:"left"},a.PROP_STRING)],["textcolor",a.PROP_STRING],["type",Object.assign({value:"string"},a.PROP_STRING)],["uncheckedvalue",a.PROP_STRING],["validationmessage",a.PROP_STRING],["widget-type",a.PROP_STRING],["width",a.PROP_STRING]]))},z=function(){a.register("wm-table-column-group",new Map([["backgroundcolor",a.PROP_STRING],["caption",a.PROP_STRING],["col-class",a.PROP_STRING],["name",a.PROP_STRING],["textalignment",Object.assign({value:"center"},a.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;a.setHeaderConfigForTable(this.table.headerConfig,this.config,i,i?n:t)},t}(a.BaseComponent);Y.initializeProps=z(),Y.decorators=[{type:t.Directive,args:[{selector:"[wmTableColumnGroup]",providers:[a.provideAsWidgetRef(Y)]}]}],Y.ctorParameters=function(){return[{type:t.Injector},{type:Y,decorators:[{type:t.SkipSelf},{type:t.Optional}]},{type:A,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 X=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,r,a){var s=e.call(this,t,K)||this;return s.appDefaults=n,s.table=i,s.group=o,s.bindfilterdataset=r,s.binddataset=a,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(a.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!==a.EDIT_MODE.DIALOG&&this.table.editmode!==a.EDIT_MODE.FORM,this._isNewEditableRow=this._isInlineEditable&&this.table.editmode===a.EDIT_MODE.QUICK_EDIT&&this.table.shownewrow,this.setUpControls(),this._propsInitialized=!0,this.getFormControl()){var r=this.getFormControl().statusChanges.pipe(m.debounceTime(100)).subscribe((function(e){return t.onStatusChange(e,"inlineInstance")}));this.registerDestroyListener((function(){return r.unsubscribe()})),this.fieldValidations=new a.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 a.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 X(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===d.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 r=this.filterControl.valueChanges.subscribe(this.onFilterValueChange.bind(this));this.registerDestroyListener((function(){return r.unsubscribe()}))}},t.prototype.resetFilter=function(){this.filterControl&&this.filterControl.setValue(""),this.filterwidget===d.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!==d.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&&a.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&&a.isDataSetWidget(this.filterwidget)&&!this.bindfilterdataset&&(this.table.datasource.execute(d.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===d.FormWidgetType.AUTOCOMPLETE?(this.filterInstance.dataoptions=a.getDistinctFieldProperties(this.table.datasource,this),this.filterInstance.datasource=this.table.datasource):a.getDistinctValues(this.table.datasource,this.widget,"filterwidget").then((function(t){e._filterDataSet=t.data,e.setFilterWidgetDataSet()}))):this.registerDestroyListener(d.$watch(this.table.binddataset,this.viewParent,{},(function(t){return e.widget.filterdataset=t}),a.getWatchIdentifier(this.widgetId,"filterdataset"))))},t.prototype.loadInlineWidgetData=function(){if(a.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,a.fetchRelatedFieldData(e,this.widget,{relatedField:_.head(t),datafield:_.last(t),widget:"edit-widget-type"})}else e.execute(d.DataSource.Operation.SUPPORTS_DISTINCT_API)&&a.getDistinctValuesForField(e,this.widget,{widget:"edit-widget-type"})}},t.prototype.onDataSourceChange=function(){this.loadFilterData(),this.table.editmode===a.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(a.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===d.FormWidgetType.AUTOCOMPLETE&&(e.filterInstance.displaylabel=e.filterdisplaylabel||t,e.filterInstance.searchkey=e.filtersearchkey||t)}e.filterwidget===d.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===d.FormWidgetType.TIME&&(t="timepattern"),this[e]&&d.isDefined(n)&&(this[e][t]=n)},t.prototype.setUpInlineWidget=function(e){var t=this;this[e].registerReadyStateListener((function(){a.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"]||a.getEditModeWidget(this),this.filterOn=this["filter-on"],this.readonly=d.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||a.getDataTableFilterWidget(this.type||"string"),this.isFilterDataSetBound=!!this.bindfilterdataset,this.defaultvalue=a.getDefaultValue(this.defaultvalue,this.type,this.editWidgetType),d.isDateTimeType(this.type)&&"toDate"===this.formatpattern&&!this.datepattern){var e=d.getDisplayDateTimeFormat(this.type);this.type===d.DataType.DATE?this.datepattern=this.appDefaults.dateFormat||e:this.type===d.DataType.TIME?this.datepattern=this.appDefaults.timeFormat||e:this.type!==d.DataType.TIMESTAMP&&this.type!==d.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=a.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}(a.BaseComponent);J.initializeProps=q(),J.decorators=[{type:t.Directive,args:[{selector:"[wmTableColumn]",providers:[a.provideAsWidgetRef(J)]}]}],J.ctorParameters=function(){return[{type:t.Injector},{type:d.AppDefaults},{type:A,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 Z=function(){a.register("wm-table-row",new Map([["class",a.PROP_STRING],["closeothers",Object.assign({value:!0},a.PROP_BOOLEAN)],["content",a.PROP_STRING],["columnwidth",Object.assign({value:"30px"},a.PROP_STRING)],["collapseicon",a.PROP_STRING],["expandicon",a.PROP_STRING],["height",a.PROP_STRING],["position",Object.assign({value:"0"},a.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}(a.BaseComponent);te.initializeProps=Z(),te.decorators=[{type:t.Directive,args:[{selector:"[wmTableRow]",providers:[a.provideAsWidgetRef(te)]}]}],te.ctorParameters=function(){return[{type:t.Injector},{type:A,decorators:[{type:t.Optional},{type:t.SkipSelf}]}]};var ne=function(){a.register("wm-table-row-action",new Map([["accessroles",a.PROP_STRING],["action",a.PROP_STRING],["caption",a.PROP_STRING],["class ",Object.assign({value:"btn-secondary"},a.PROP_STRING)],["disabled",Object.assign({value:!1},a.PROP_BOOLEAN)],["display-name",a.PROP_STRING],["hyperlink",a.PROP_STRING],["iconclass",a.PROP_STRING],["key",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["target",a.PROP_STRING],["title",a.PROP_STRING],["widget-type",Object.assign({value:"button"},a.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}(a.BaseComponent);oe.initializeProps=ne(),oe.decorators=[{type:t.Directive,args:[{selector:"[wmTableRowAction]",providers:[a.provideAsWidgetRef(oe),{provide:a.Context,useValue:{},multi:!0}]}]}],oe.ctorParameters=function(){return[{type:t.Injector},{type:A,decorators:[{type:t.Optional}]},{type:Array,decorators:[{type:t.Self},{type:t.Inject,args:[a.Context]}]}]};var re=[A,N,G,W,J,Y,te,oe],ae=function(){};ae.decorators=[{type:t.NgModule,args:[{imports:[s.BasicModule,r.BsDropdownModule,n.CommonModule,i.FormsModule,i.ReactiveFormsModule,l.InputModule,p.ListModule,c.MenuModule,u.PaginationModule,o.TooltipModule,a.WmComponentsModule],declarations:w([],b(re)),exports:w([],b(re)),entryComponents:[]}]}],e.TableActionDirective=W,e.TableCUDDirective=N,e.TableColumnDirective=J,e.TableColumnGroupDirective=Y,e.TableComponent=A,e.TableFilterSortDirective=G,e.TableModule=ae,e.TableRowActionDirective=oe,e.TableRowDirective=te,e["\u0275a"]=P,e["\u0275b"]=V,e["\u0275c"]=z,e["\u0275d"]=q,e["\u0275e"]=Z,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,r,a){"use strict";
|
|
521
521
|
/*! *****************************************************************************
|
|
522
522
|
Copyright (c) Microsoft Corporation.
|
|
523
523
|
|