!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/material/core"),require("remult"),require("remult/src/remult3"),require("@angular/common"),require("@angular/forms"),require("@angular/cdk/bidi"),require("@angular/material/dialog"),require("remult/src/server-action"),require("@angular/router"),require("@angular/common/http"),require("@angular/material/progress-spinner"),require("rxjs/operators"),require("@angular/platform-browser/animations"),require("@angular/material/form-field"),require("@angular/material/input"),require("@angular/material/button"),require("@angular/material/list"),require("@angular/material/icon"),require("@angular/material/checkbox"),require("@angular/material/tooltip"),require("@angular/material/menu")):"function"==typeof define&&define.amd?define("@remult/angular",["exports","@angular/core","@angular/material/core","remult","remult/src/remult3","@angular/common","@angular/forms","@angular/cdk/bidi","@angular/material/dialog","remult/src/server-action","@angular/router","@angular/common/http","@angular/material/progress-spinner","rxjs/operators","@angular/platform-browser/animations","@angular/material/form-field","@angular/material/input","@angular/material/button","@angular/material/list","@angular/material/icon","@angular/material/checkbox","@angular/material/tooltip","@angular/material/menu"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).remult=t.remult||{},t.remult.angular={}),t.ng.core,t.ng.material.core,t.remult,t.remult3,t.ng.common,t.ng.forms,t.ng.cdk.bidi,t.ng.material.dialog,t.serverAction,t.ng.router,t.ng.common.http,t.ng.material.progressSpinner,t.rxjs.operators,t.ng.platformBrowser.animations,t.ng.material.formField,t.ng.material.input,t.ng.material.button,t.ng.material.list,t.ng.material.icon,t.ng.material.checkbox,t.ng.material.tooltip,t.ng.material.menu)}(this,(function(t,e,n,i,r,o,s,a,l,u,c,h,d,p,f,g,m,y,v,w,C,b,R){"use strict";
/*! *****************************************************************************
    Copyright (c) Microsoft Corporation.

    Permission to use, copy, modify, and/or distribute this software for any
    purpose with or without fee is hereby granted.

    THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
    REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
    AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
    INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
    LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
    OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
    PERFORMANCE OF THIS SOFTWARE.
    ***************************************************************************** */var I=function(t,e){return(I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function x(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}I(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function _(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))}function k(t,e){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}Object.create;function O(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function L(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s}function D(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(L(arguments[e]));return t}Object.create;var A=function(){function t(t,e,n,i,r){this.currentRow=t,this.allowUpdate=e,this.filterHelper=n,this.showArea=i,this._getRowColumn=r,this.settingsByKey={},this.doWhenWeHaveContext=[],this.designMode=!1,this._colListChangeListeners=[],this.items=[],this.numOfColumnsInGrid=5,this.augmented=new Map}return t.prototype.__showArea=function(){return this.showArea()},t.prototype.__getColumn=function(t,e){var n;if(t.field)return e&&(n=i.getEntityRef(e).fields.find(B(t.field))),n||(n=t.field),n},t.prototype.__visible=function(t,e){return void 0===t.visible||this.getRowColumn({col:t,row:e},(function(e,n){return t.visible(n,e)}))},t.prototype.allowClick=function(t,e){return!!t.click&&(!!this._getEditable(t,e)&&(void 0===t.allowClick||this.getRowColumn({col:t,row:e},(function(e,n){return t.allowClick(n,e)}))))},t.prototype.getRowColumn=function(t,e){var n,i=t.row;return this._getRowColumn&&t.col.field&&i&&(n=this._getRowColumn(i,B(t.col.field))),n||(n=t.col.field),!i&&n&&(i=n.container),e(n,i)},t.prototype.__dataControlStyle=function(t){if(t.width&&t.width.trim().length>0)return(+t.width).toString()==t.width?t.width+"px":t.width},t.prototype.add=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return _(this,void 0,void 0,(function(){var e,n,i,r,o,s,a,l,u;return k(this,(function(c){switch(c.label){case 0:e=[];try{for(n=O(t),i=n.next();!i.done;i=n.next())(r=i.value)&&(void 0,s=r,a=r,(!(o=r).field&&s.valueConverter||a.metadata)&&(o={field:r}),o.field&&M(o.field,o),o.getValue&&o,e.push(this.buildDropDown(o)),this.items.push(o))}catch(t){l={error:t}}finally{try{i&&!i.done&&(u=n.return)&&u.call(n)}finally{if(l)throw l.error}}return[4,Promise.all(e)];case 1:return c.sent(),[2,Promise.resolve()]}}))}))},t.prototype.setContext=function(t){var e,n;this.remult=t;try{for(var i=O(this.doWhenWeHaveContext),r=i.next();!r.done;r=i.next()){(0,r.value)(t)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}},t.prototype.buildDropDown=function(t){return _(this,void 0,void 0,(function(){var e,n,i,r,o,s,a,l,u,c,h,d,p,f,g=this;return k(this,(function(m){switch(m.label){case 0:if(!t.valueList)return[3,5];if(e=t.valueList,n=[],t.valueList=n,!(e instanceof Array))return[3,1];try{for(i=O(e),r=i.next();!r.done;r=i.next())o=r.value,"string"==(s=typeof o)||"number"==s?n.push({id:o,caption:o}):(a=o)&&null!=a.id&&n.push(a)}catch(t){p={error:t}}finally{try{r&&!r.done&&(f=i.return)&&f.call(i)}finally{if(p)throw p.error}}return[3,4];case 1:return"function"!=typeof e?[3,2]:(l=e,u=function(e){return _(g,void 0,void 0,(function(){var i;return k(this,(function(r){switch(r.label){case 0:return[4,l(e)];case 1:return void 0===(i=r.sent())?t.valueList=void 0:n.push.apply(n,D(i)),S(n,t.field),[2]}}))}))},this.remult?u(this.remult):this.doWhenWeHaveContext.push((function(t){return _(g,void 0,void 0,(function(){return k(this,(function(e){return[2,u(t)]}))}))})),[3,4]);case 2:return h=(c=n.push).apply,d=[n],[4,e];case 3:h.apply(c,d.concat([D.apply(void 0,[m.sent()])])),m.label=4;case 4:S(n,t.field),m.label=5;case 5:return[2,Promise.resolve()]}}))}))},t.prototype.colListChanged=function(){this._lastNumOfColumnsInGrid=-1,this._colListChangeListeners.forEach((function(t){return t()}))},t.prototype.onColListChange=function(t){this._colListChangeListeners.push(t)},t.prototype.moveCol=function(t,e){var n=this.items.indexOf(t),i=n+e;i<0||i>=this.items.length||(this.items.splice(n,1),this.items.splice(i,0,t),this.colListChanged())},t.prototype.filterRows=function(t){t.valueList&&(t.useContainsFilter=!1),this.filterHelper.filterColumn(t.field,!1,t.useContainsFilter)},t.prototype.clearFilter=function(t){this.filterHelper.filterColumn(t.field,!0,!1)},t.prototype._shouldShowFilterDialog=function(t){return!1},t.prototype.deleteCol=function(t){this.items.splice(this.items.indexOf(t),1),this.colListChanged()},t.prototype.addCol=function(t,e){this.items.splice(this.items.indexOf(t)+1,0,e),this.colListChanged()},t.prototype._getEditable=function(t,e){return!!this.allowUpdate()&&(!!t.field&&(void 0===t.readonly||!function(t,e){if("function"==typeof t){return t(e)}return t}(t.readonly,e)))},t.prototype._click=function(t,e){this.getRowColumn({col:t,row:e},(function(e,n){t.click(n,e)}))},t.prototype._getColDisplayValue=function(t,e){var n,i,r;if(t.getValue)r=this.getRowColumn({row:e,col:t},(function(e,n){return t.getValue(n,e)}));else if(t.field){if(t.valueList)try{for(var o=O(t.valueList),s=o.next();!s.done;s=o.next()){var a=s.value;if(a.id==this.__getColumn(t,e).value)return a.caption}}catch(t){n={error:t}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}r=this.__getColumn(t,e).displayValue}return r},t.prototype._getColDataType=function(t){return t.inputType?t.inputType:"text"},t.prototype._getColumnClass=function(t,e){return t.cssClass?"function"==typeof t.cssClass?(0,t.cssClass)(e):t.cssClass:""},t.prototype._getError=function(t,e){if(t.field)return this.__getColumn(t,e).error},t.prototype.autoGenerateColumnsBasedOnData=function(t){var e,n;if(0==this.items.length&&t)try{for(var i=O(t.fields),r=i.next();!r.done;r=i.next()){var o=r.value;"id"==o.key&&o.valueType===String||this.add(o)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}},t.prototype.__changeWidth=function(t,e){var n=t.width;n||(n="50"),n=(+n+e).toString(),t.width=n},t.prototype._colValueChanged=function(t,e){return this.getRowColumn({col:t,row:e},(function(e,n){if(t.valueList){var i=t.valueList.find((function(t){return t.id==e.inputValue}));(null==i?void 0:i.entity)&&r.getEntitySettings(B(t.field).valueType,!1)&&(e.value=i.entity)}if(!t.valueChange)return!1;t.valueChange(n,e)}))},t.prototype.augment=function(t,e){this.augmented.get(e)||(t(B(e.field),e),this.augmented.set(e,!0))},t.prototype._initColumnsArrays=function(t){var e,n;if(this._lastColumnCount!=this.items.length||this._lastNumOfColumnsInGrid!=this.numOfColumnsInGrid){this._lastNumOfColumnsInGrid=this.numOfColumnsInGrid,this._lastColumnCount=this.items.length,this.gridColumns=[],this.nonGridColumns=[];var i=0;try{for(var r=O(this.items),o=r.next();!o.done;o=r.next()){var s=o.value;this.augment(t,s),i++<this._lastNumOfColumnsInGrid?this.gridColumns.push(s):this.nonGridColumns.push(s)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}}},t.prototype.getGridColumns=function(t){return this._initColumnsArrays(t),this.gridColumns},t.prototype.getNonGridColumns=function(t){return this._initColumnsArrays(t),this.nonGridColumns},t}();var F=function(){function t(t){var e=this;t.dbName||(t.dbName=t.key),this.options=r.decorateColumnSettings(t,t.remult),this.dataControl=t,!this.dataControl.valueList&&this.options.valueConverter instanceof i.ValueListInfo&&(this.dataControl.valueList=this.options.valueConverter.getValues()),t.caption||(t.caption="caption"),t.key||(t.key=t.caption),this.inputType=t.inputType,t.defaultValue&&(this._value=t.defaultValue(void 0)),this.originalValue=this._value;var n=this.options.valueConverter?this.options.valueConverter:void 0;n&&(t.inputType||(t.inputType=n.inputType)),this.metadata={allowNull:t.allowNull,caption:t.caption,options:this.options,valueConverter:n,valueType:t.valueType,key:t.key,dbName:t.dbName,dbReadOnly:!1,inputType:t.inputType,isServerExpression:!1,getDbName:function(){return _(e,void 0,void 0,(function(){return k(this,(function(e){return[2,t.dbName]}))}))},target:void 0}}return t.prototype.validate=function(){return _(this,void 0,void 0,(function(){return k(this,(function(t){return[2,!0]}))}))},t.prototype.subscribe=function(t){throw new Error("Method not implemented.")},t.prototype.valueIsNull=function(){return null===this.value},t.prototype.originalValueIsNull=function(){return null===this.originalValue},t.prototype.load=function(){throw new Error("Method not implemented.")},Object.defineProperty(t.prototype,"displayValue",{get:function(){return this.options.displayValue?this.options.displayValue(this.value,void 0):this.value.toString()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(t){this._value=t,this.dataControl.valueChange&&this.dataControl.valueChange(void 0,this)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inputValue",{get:function(){return this.metadata.valueConverter.toInput(this.value,this.inputType)},set:function(t){this.value=this.metadata.valueConverter.fromInput(t,this.inputType)},enumerable:!1,configurable:!0}),t.prototype.valueChanged=function(){return this.originalValue!=this.value},t}();function S(t,e){var n=B(e);(null==n?void 0:n.valueType)===Number&&t.splice.apply(t,D([0,t.length],t.map((function(t){var e;return Object.assign(Object.assign({},t),{id:null===(e=t.id)||void 0===e?void 0:e.toString()})}))))}var T=Symbol("configDataControlField");function B(t){if(t){var e=t,n=t;return n.metadata&&(e=n.metadata),e}}function M(t,e){var n;if(t instanceof F)for(var r in t.dataControl)if(Object.prototype.hasOwnProperty.call(t.dataControl,r)){var o=t.dataControl[r];void 0===e[r]&&(e[r]=o)}var s,a=B(t);if(a.target&&(s=Reflect.getMetadata(T,a.target,a.key)))for(var r in s)if(Object.prototype.hasOwnProperty.call(s,r)){o=s[r];void 0===e[r]&&(e[r]=o)}if(a.valueType&&(s=Reflect.getMetadata(T,a.valueType)))for(var r in s)if(Object.prototype.hasOwnProperty.call(s,r)){o=s[r];void 0===e[r]&&(e[r]=o)}void 0===e.valueList&&a&&a.valueConverter instanceof i.ValueListInfo&&(e.valueList=a.valueConverter.getValues()),!e.caption&&a.caption&&(e.caption=a.caption),!e.inputType&&a.inputType&&(e.inputType=a.inputType),null==e.readonly&&(a.dbReadOnly&&(e.readonly=!0),"boolean"==typeof(null===(n=a.options)||void 0===n?void 0:n.allowApiUpdate)&&(e.readonly=!a.options.allowApiUpdate))}var P=function(t,e,n){var i,r;if(this.settings=t,this.fields=e,this.lines=[],null==e&&((e=new A((function(){}),(function(){return!0}),void 0,(function(){return!0}),(function(){}))).numOfColumnsInGrid=0,this.fields=e),t&&t.fields)try{for(var o=O(t.fields(n)),s=o.next();!s.done;s=o.next()){var a=s.value;if(Array.isArray(a)){var l=e.items.length;e.add.apply(e,D(a));for(var u=[],c=l;c<e.items.length;c++)u.push(e.items[c]);this.lines.push(u)}else e.add(a),(l=e.items[e.items.length-1]).width="",this.lines.push([l])}}catch(t){i={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}},E=function(){function t(t){var e=this;this.repository=t,this.items=[],this.lastGetId=0,t.addEventListener({deleted:function(t){e.removeItem(t)}})}return t.prototype[Symbol.iterator]=function(){return this.items[Symbol.iterator]()},t.prototype.removeItem=function(t){var e=this.items.indexOf(t);e>=0&&this.items.splice(e,1)},t.prototype.map=function(t){return t},t.prototype.count=function(t){return this.repository.count(t)},t.prototype.get=function(t){var e=this,n=++this.lastGetId;return this.repository.find(t).then((function(t){var i=t.map((function(t){return e.map(t)}));return n==e.lastGetId&&(e.items=i),i}))},t.prototype.add=function(){var t=this.map(this.repository.create());return this.items.push(t),t},t}(),G=function(){function t(t,e){this.reloadData=t,this.repository=e,this.filterColumns=[],this.forceEqual=[]}return t.prototype.isFiltered=function(t){return this.filterColumns.indexOf(B(t))>=0},t.prototype.filterColumn=function(t,e,n){var i=B(t);i&&(e?(this.filterColumns.splice(this.filterColumns.indexOf(i,1),1),this.forceEqual.splice(this.forceEqual.indexOf(i,1),1)):this.filterColumns.indexOf(i)<0&&(this.filterColumns.push(i),!1===n&&this.forceEqual.push(i)),this.reloadData())},t.prototype.addToFindOptions=function(t){var e=this;this.filterColumns.forEach((function(n){var o,s=e.filterRow[n.key],a=s;if(n.valueType==Number||n.valueType==Date||n.valueType==Boolean||null!=r.getEntitySettings(n.valueType,!1)||e.forceEqual.find((function(t){return n.key==t.key}))){if(n.valueType==Date&&s){var l=s;a={$gte:l=new Date(l.getFullYear(),l.getMonth(),l.getDate()),$lt:new Date(l.getFullYear(),l.getMonth(),l.getDate()+1)}}}else a={$contains:i.getEntityRef(e.filterRow).fields[n.key].inputValue};var u=((o={})[n.key]=a,o);if(t.where){var c=t.where;t.where={$and:[c,u]}}else t.where=u}))},t}(),V=(function(){function t(t,e){var n,r=this;if(this.repository=t,this.settings=e,this.showSelectColumn=!1,this.allowUpdate=!1,this.allowInsert=!1,this.allowDelete=!1,this.showDataArea=!1,this._buttons=[],this.filterHelper=new G((function(){r.page=1,r.reloadData()}),this.repository),this.page=1,this.selectedRows=[],this._selectedAll=!1,this.rowsPerPageOptions=[10,25,50,100],e||(this.settings=e={}),this.restList=new E(t),t&&(this.filterHelper.filterRow=t.create(),t.addEventListener({validating:function(t){return _(r,void 0,void 0,(function(){return k(this,(function(e){switch(e.label){case 0:return this.onValidate?[4,this.onValidate(t)]:[3,2];case 1:e.sent(),e.label=2;case 2:return this.onSavingRow?[4,this.onSavingRow(t)]:[3,4];case 3:e.sent(),e.label=4;case 4:return[2]}}))}))}})),this.columns=new A((function(){return r.currentRow}),(function(){return r.allowUpdate}),this.filterHelper,(function(){return!!r.currentRow}),(function(t,e){return r.repository.getEntityRef(t).fields.find(e)})),e){if(e.columnSettings){var o=e.columnSettings(t.metadata.fields);(n=this.columns).add.apply(n,D(o))}void 0!==e.allowCrud&&(void 0===e.allowUpdate&&(e.allowUpdate=e.allowCrud),void 0===e.allowDelete&&(e.allowDelete=e.allowCrud),void 0===e.allowInsert&&(e.allowInsert=e.allowCrud)),e.allowUpdate&&(this.allowUpdate=!0),e.allowDelete&&(this.allowDelete=!0),e.allowInsert&&(this.allowInsert=!0),e.showDataArea&&(this.showDataArea=e.showDataArea),void 0===e.showPagination&&(e.showPagination=!0),null!=e.numOfColumnsInGrid&&(this.columns.numOfColumnsInGrid=e.numOfColumnsInGrid),e.rowButtons&&(this._buttons=e.rowButtons),e.rowCssClass&&(this.rowClass=e.rowCssClass),e.saving&&(this.onSavingRow=e.saving),e.enterRow&&(this.onEnterRow=e.enterRow),e.newRow&&(this.onNewRow=e.newRow),e.validation&&(this.onValidate=e.validation),e.caption&&(this.caption=e.caption),!this.caption&&t&&(this.caption=t.metadata.caption),e.page&&(this.page=e.page),e.rowsInPage?this.rowsPerPage=e.rowsInPage:this.rowsPerPage=25,this.rowsPerPageOptions.indexOf(this.rowsPerPage)<0&&(this.rowsPerPageOptions.push(this.rowsPerPage),this.rowsPerPageOptions.sort((function(t,e){return+t-+e}))),e.orderBy&&(this._currentOrderBy=i.Sort.translateOrderByToSort(this.repository.metadata,this.settings.orderBy))}}t.prototype.undoChanges=function(t){var e=this.getRowHelper(t);e.undoChanges(),e.isNew()&&this.restList.removeItem(t)},t.prototype.initOrigList=function(){var t;this.origList||(this.origList=[],this.origNumOfColumns=this.columns.numOfColumnsInGrid,(t=this.origList).push.apply(t,D(this.columns.items)))},t.prototype.userChooseColumns=function(){this.initOrigList(),this.currList||this.resetColumns(),this.showSelectColumn=!this.showSelectColumn},t.prototype.resetColumns=function(){this.currList=[],this.columns.items=this.currList,this.columns.numOfColumnsInGrid=this.origNumOfColumns;for(var t=0;t<this.origList.length;t++)this.currList.push(this.origList[t])},t.prototype.deleteCol=function(t){this.columns.deleteCol(t),this.columns.numOfColumnsInGrid--},t.prototype.addNewRow=function(){var t=this.restList.add();this.onNewRow&&this.onNewRow(t),this.setCurrentRow(t)},t.prototype.addArea=function(t){var e=this,n=new A((function(){return e.currentRow}),(function(){return e.allowUpdate}),this.filterHelper,(function(){return!!e.currentRow}),(function(t,n){return e.repository.getEntityRef(t).fields.find(n)}));return n.numOfColumnsInGrid=0,new P(t,n,this.repository.metadata.fields)},t.prototype.setCurrentRow=function(t){this.currentRow!=t&&(this.currentRow=t,this.onEnterRow&&t&&this.onEnterRow(t))},t.prototype.nextRow=function(){var t=this;if(!this.currentRow&&this.items.length>0&&this.setCurrentRow(this.items[0]),this.currentRow){var e=this.items.indexOf(this.currentRow);e<this.items.length-1?this.setCurrentRow(this.items[e+1]):this.nextPage().then((function(){t.items.length>0&&t.setCurrentRow(t.items[0])}))}},t.prototype.previousRowAllowed=function(){return this.currentRow&&this.items.indexOf(this.currentRow)>0||this.page>1},t.prototype.previousRow=function(){var t=this;if(this.previousRowAllowed()){var e=this.items.indexOf(this.currentRow);e>0?this.setCurrentRow(this.items[e-1]):this.page>1&&this.previousPage().then((function(){t.items.length>0&&t.setCurrentRow(t.items[t.items.length-1])}))}},t.prototype.deleteCurentRow=function(){this.deleteCurrentRowAllowed&&this.currentRowAsRestListItemRow().delete()},t.prototype.currentRowAsRestListItemRow=function(){this.currentRow&&this.getRowHelper(this.currentRow)},t.prototype.getRowHelper=function(t){return this.repository.getEntityRef(t)},t.prototype.cancelCurrentRowChanges=function(){this.currentRowAsRestListItemRow()&&this.currentRowAsRestListItemRow()&&this.currentRowAsRestListItemRow().undoChanges()},t.prototype.deleteCurrentRowAllowed=function(){return this.currentRowAsRestListItemRow()&&this.currentRowAsRestListItemRow().delete&&this.allowDelete&&!this.currentRowAsRestListItemRow().isNew()},t.prototype.currentRowChanged=function(){return this.currentRowAsRestListItemRow()&&this.currentRowAsRestListItemRow().wasChanged()},t.prototype.saveCurrentRow=function(){this.currentRowAsRestListItemRow()&&this.currentRowAsRestListItemRow().save&&this.currentRowAsRestListItemRow().save()},t.prototype._doSavingRow=function(t){return i.getEntityRef(t).save()},t.prototype.nextPage=function(){return this.page++,this.reloadData()},t.prototype.previousPage=function(){if(!(this.page<=1))return this.page--,this.reloadData()},t.prototype.firstPage=function(){return this.page=1,this.reloadData()},t.prototype.selectedChanged=function(t){this.isSelected(t)?(this.selectedRows.splice(this.selectedRows.indexOf(t),1),this._selectedAll=!1):(this.selectedRows.push(t),this._selectedAll=this.selectedRows.length==this.totalRows)},t.prototype.clickOnselectCheckboxFor=function(t,e){var n,i;if(e)if(this.lastSelectedRowWithShift){var r=!1;try{for(var o=O(this.items),s=o.next();!s.done;s=o.next()){var a=s.value;if(r){if(a==t||a==this.lastSelectedRowWithShift)return void(this.lastSelectedRowWithShift=void 0);this.selectedChanged(a)}else r=a==t||a==this.lastSelectedRowWithShift}}catch(t){n={error:t}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}}else this.lastSelectedRowWithShift=t;this.lastSelectedRowWithShift=t},t.prototype.isSelected=function(t){return this.selectedRows.indexOf(t)>=0},t.prototype.selectAllIntermitent=function(){return this.selectedRows.length>0&&(this.selectedRows.length!=this.items.length||!this._selectedAll)},t.prototype.selectAllChecked=function(){return this.selectedRows.length>0&&this.selectedRows.length==this.items.length&&this._selectedAll},t.prototype.selectAllChanged=function(t){var e;this.selectedRows.splice(0),t.checked?((e=this.selectedRows).push.apply(e,D(this.items)),this._selectedAll=!0):this._selectedAll=!1},t.prototype.get=function(t){return t.where&&(this.settings.where=function(){return t.where}),t.orderBy&&(this._currentOrderBy=i.Sort.translateOrderByToSort(this.repository.metadata,t.orderBy)),this.page=1,this.reloadData()},t.prototype.sort=function(t){var e=!1;this._currentOrderBy&&this._currentOrderBy.Segments.length>0&&this._currentOrderBy.Segments[0].field.key==t.key&&(this._currentOrderBy.Segments[0].isDescending=!this._currentOrderBy.Segments[0].isDescending,e=!0),e||(this._currentOrderBy=new i.Sort({field:t})),this.reloadData()},t.prototype.sortedAscending=function(t){return!!this._currentOrderBy&&(!!t&&(this._currentOrderBy.Segments.length>0&&this._currentOrderBy.Segments[0].field.key==t.key&&!this._currentOrderBy.Segments[0].isDescending))},t.prototype.sortedDescending=function(t){return!!this._currentOrderBy&&(!!t&&(this._currentOrderBy.Segments.length>0&&this._currentOrderBy.Segments[0].field.key==t.key&&!!this._currentOrderBy.Segments[0].isDescending))},t.prototype.reloadData=function(){return _(this,void 0,void 0,(function(){var t,e,n=this;return k(this,(function(r){switch(r.label){case 0:return[4,this._internalBuildFindOptions()];case 1:return t=r.sent(),this.columns.autoGenerateColumnsBasedOnData(this.repository.metadata),e=this.restList.get(t).then((function(t){var e,r;return n.selectedRows=n.selectedRows.map((function(e){var n=i.getEntityRef(e).getId(),r=t.find((function(t){return i.getEntityRef(t).getId()==n}));return void 0!==r?r:e})),0==n.restList.items.length?n.setCurrentRow(void 0):n.setCurrentRow(n.restList.items[0]),(null===(e=n.settings)||void 0===e?void 0:e.rowsLoaded)&&(null===(r=n.settings)||void 0===r||r.rowsLoaded(n.restList.items)),n.restList})),this.settings&&this.settings.knowTotalRows&&this.restList.count(t.where).then((function(t){n.totalRows=t})),[2,e]}}))}))},t.prototype._internalBuildFindOptions=function(){return _(this,void 0,void 0,(function(){var t,e;return k(this,(function(n){switch(n.label){case 0:return t={},this.settings.where?(e=t,[4,i.Filter.resolve(this.settings.where)]):[3,2];case 1:e.where=n.sent(),n.label=2;case 2:return this.settings.orderBy&&(t.orderBy=this.settings.orderBy),this._currentOrderBy&&(t.orderBy=this._currentOrderBy.toEntityOrderBy()),t.limit=this.rowsPerPage,this.page>1&&(t.page=this.page),this.filterHelper.addToFindOptions(t),[2,t]}}))}))},t.prototype.getFilterWithSelectedRows=function(){return _(this,void 0,void 0,(function(){var t;return k(this,(function(e){switch(e.label){case 0:return[4,this._internalBuildFindOptions()];case 1:return t=e.sent(),this.selectedRows.length>0&&!this._selectedAll&&(t.where={$and:[t.where,this.repository.metadata.idMetadata.createIdInFilter(this.selectedRows)]}),[2,t]}}))}))},Object.defineProperty(t.prototype,"items",{get:function(){if(this.restList)return this.restList.items},enumerable:!1,configurable:!0})}(),function(){this.dataControlAugmenter=function(){}}),W=function(){function t(t,e){this.plugin=t,this.componentFactoryResolver=e,this.done=!1,this.notReadonly=!1,this.settings=new A(void 0,(function(){return!0}),void 0,void 0,(function(){})),this.dummy={inputValue:""},this.ngErrorStateMatches=new(function(t){function e(e){var n=t.call(this)||this;return n.parent=e,n}return x(e,t),e.prototype.isErrorState=function(){return!!this.parent.getError()},e}(n.ErrorStateMatcher))(this)}return Object.defineProperty(t.prototype,"field",{set:function(t){this.map={field:t},M(this.map.field,this.map),this.settings.augment(this.plugin.dataControlAugmenter,this.map),this.initCustomComponent()},enumerable:!1,configurable:!0}),t.prototype.initCustomComponent=function(){var t,e;if(null===(e=null===(t=this.map)||void 0===t?void 0:t.customComponent)||void 0===e?void 0:e.component){if(this.done)return;var n=this.map.field;if(!n.metadata)return void(this.map.customComponent=void 0);this.done=!0;var i=this.componentFactoryResolver.resolveComponentFactory(this.map.customComponent.component),r=this.theId;r.clear(),r.createComponent(i).instance.args={fieldRef:n,settings:this.map}}},t.prototype.showDescription=function(){return this.map.field&&this.map.getValue||!this._getEditable()},t.prototype.getDropDown=function(){return this.map.valueList},t.prototype.showClick=function(){return!!this.map.click&&(!!this._getEditable()&&(void 0===this.map.allowClick||this.settings.allowClick(this.map,this.record)))},t.prototype.click=function(){this.showClick()&&this.settings._click(this.map,this.record)},t.prototype.getClickIcon=function(){return this.map.clickIcon?this.map.clickIcon:"keyboard_arrow_down"},t.prototype.dataControlStyle=function(){return this.settings.__dataControlStyle(this.map)},t.prototype._getColumn=function(){return this.map.field?this.settings.__getColumn(this.map,this.record):this.dummy},t.prototype._getEditable=function(){return!!this.notReadonly||this.settings._getEditable(this.map,this.record)},t.prototype.ngOnChanges=function(){this.initCustomComponent()},t.prototype.isSelect=function(){return!(!this.map.valueList||!this._getEditable())},t.prototype.showTextBox=function(){return!this.isSelect()&&!this.showCheckbox()},t.prototype.showCheckbox=function(){return"checkbox"==this.settings._getColDataType(this.map)},t.prototype.getError=function(){return this.settings._getError(this.map,this.record)},t.prototype.getStyle=function(){return this.showDescription()?this.map.hideDataOnInput||!this._getEditable()?{display:"none"}:{width:"50px"}:{}},t.prototype.getFloatLabel=function(){return this.showDescription()&&this.settings._getColDisplayValue(this.map,this.record)?"always":"auto"},t}();W.decorators=[{type:e.Component,args:[{selector:"data-control",template:'<div class="data-control2">\r\n    <ng-template #theId></ng-template>\r\n    <ng-container *ngIf="!map.customComponent">\r\n        <mat-form-field appearance="outline" [floatLabel]="getFloatLabel()" *ngIf="showTextBox()"\r\n            class="full-width-form-field dense-form-field">\r\n            <mat-label>{{map.caption}}</mat-label>\r\n            <div style="display:flex;">\r\n                <input #theId matInput [(ngModel)]="_getColumn().inputValue" type="{{settings._getColDataType(map)}}"\r\n                    (ngModelChange)="settings._colValueChanged(map,record)" [errorStateMatcher]="ngErrorStateMatches"\r\n                    [ngStyle]="getStyle()"\r\n                    [ngModelOptions]="{ updateOn: settings._getColDataType(map)==\'number\'? \'blur\':\'change\' }" />\r\n                <div *ngIf="showDescription()" style="white-space: nowrap;\r\n            overflow: hidden;\r\n            text-overflow: ellipsis;\r\n            padding-left:10px;width:100%;" (click)="click()">\r\n                    {{settings._getColDisplayValue(map,record)}}&nbsp;</div>\r\n            </div>\r\n            <button mat-icon-button matSuffix *ngIf="showClick()" (click)="click()">\r\n                <mat-icon>{{getClickIcon()}} </mat-icon>\r\n            </button>\r\n            <mat-error *ngIf="getError()" [id]="\'theId\'">{{getError()}}</mat-error>\r\n        </mat-form-field>\r\n        <mat-form-field appearance="outline" [floatLabel]="getFloatLabel()" *ngIf="isSelect()"\r\n            class="full-width-form-field dense-form-field">\r\n            <mat-label>{{map.caption}}</mat-label>\r\n            <div *ngIf="isSelect()">\r\n                <select matNativeControl [(ngModel)]="_getColumn().inputValue"\r\n                    (ngModelChange)="settings._colValueChanged(map,record)">\r\n                    <option *ngFor="let v of getDropDown()" [ngValue]="v.id">{{v.caption}}</option>\r\n                </select>\r\n            </div>\r\n            <mat-error *ngIf="getError()" [id]="theId">{{getError()}}</mat-error>\r\n        </mat-form-field>\r\n\r\n        <div *ngIf="showCheckbox()">\r\n            <mat-checkbox #theId1 [(ngModel)]="_getColumn().inputValue"\r\n                (ngModelChange)="settings._colValueChanged(map,record)" class="fix-label">{{map.caption}}</mat-checkbox>\r\n            <mat-error *ngIf="getError()" [id]="\'theId1\'">{{getError()}}</mat-error>\r\n        </div>\r\n    </ng-container>\r\n</div>',styles:[""]}]}],W.ctorParameters=function(){return[{type:V},{type:e.ComponentFactoryResolver}]},W.propDecorators={map:[{type:e.Input}],field:[{type:e.Input}],theId:[{type:e.ViewChild,args:["theId",{read:e.ViewContainerRef,static:!0}]}],record:[{type:e.Input}],notReadonly:[{type:e.Input}],settings:[{type:e.Input}]};var H=function(){function t(){this.rightToLeft=!1,this.settings=new A(void 0,(function(){return!0}),void 0,void 0,(function(){})),this.dummy={inputValue:""},this.ngErrorStateMatches=new(function(t){function e(e){var n=t.call(this)||this;return n.parent=e,n}return x(e,t),e.prototype.isErrorState=function(){return!!this.parent.getError()},e}(n.ErrorStateMatcher))(this)}return Object.defineProperty(t.prototype,"column",{set:function(t){this.map={field:t},M(this.map.field,this.map)},enumerable:!1,configurable:!0}),t.prototype.showDescription=function(){return this.map.field&&this.map.getValue||!this._getEditable()},t.prototype.showClick=function(){return!!this.map.click&&(!!this._getEditable()&&(void 0===this.map.allowClick||this.settings.allowClick(this.map,this.record)))},t.prototype.getClickIcon=function(){return this.map.clickIcon?this.map.clickIcon:"keyboard_arrow_down"},t.prototype.dataControlStyle=function(){return this.settings.__dataControlStyle(this.map)},t.prototype._getColumn=function(){return this.map.field?this.settings.__getColumn(this.map,this.record):this.dummy},t.prototype.click=function(){this.showClick()&&this.settings._click(this.map,this.record)},t.prototype._getEditable=function(){return!!this.notReadonly||this.settings._getEditable(this.map,this.record)},t.prototype.ngOnChanges=function(){},t.prototype.getDropDown=function(){return this.map.valueList},t.prototype.isSelect=function(){return!(!this.map.valueList||!this._getEditable())},t.prototype.showTextBox=function(){return!this.isSelect()&&!this.showCheckbox()&&this._getEditable()},t.prototype.showReadonlyText=function(){return!this._getEditable()},t.prototype.showCheckbox=function(){return"checkbox"==this.settings._getColDataType(this.map)},t.prototype.getError=function(){return this.settings._getError(this.map,this.record)},t.prototype.getStyle=function(){return this.showDescription()?this.map.hideDataOnInput||!this._getEditable()?{display:"none"}:{width:"50px"}:{width:"100%"}},t.prototype.getFloatLabel=function(){return this.showDescription()&&this.settings._getColDisplayValue(this.map,this.record)?"always":""},t}();H.decorators=[{type:e.Component,args:[{selector:"data-control3",template:'<div class="data-control3" #myDiv>\r\n    <div style="display:flex;width:100%;" *ngIf="showTextBox()">\r\n        <input #theId matInput [(ngModel)]="_getColumn().inputValue" type="{{settings._getColDataType(map)}}"\r\n            (ngModelChange)="settings._colValueChanged(map,record)" [errorStateMatcher]="ngErrorStateMatches"\r\n            [ngStyle]="getStyle()"\r\n            [ngModelOptions]="{ updateOn: settings._getColDataType(map)==\'number\'? \'blur\':\'change\' }" />\r\n        <div *ngIf="showDescription()" style="white-space: nowrap;\r\n            overflow: hidden;\r\n            text-overflow: ellipsis;\r\n            padding-left:10px; width:100%;" (click)="click()">\r\n            {{settings._getColDisplayValue(map,record)}}&nbsp;</div>\r\n        <button mat-icon-button *ngIf="showClick()" (click)="click()" class="row-button">\r\n            <mat-icon style="height:19px;">{{getClickIcon()}} </mat-icon>\r\n        </button>\r\n    </div>\r\n    <div *ngIf="showReadonlyText()&&!showCheckbox()" style="\r\n            overflow: hidden;\r\n            padding-left:10px; width:100%;">\r\n        {{settings._getColDisplayValue(map,record)}}&nbsp;</div>\r\n    <div *ngIf="isSelect()" class="my-select" [class.rtl-select]="rightToLeft">\r\n        <select matNativeControl [(ngModel)]="_getColumn().inputValue"\r\n            (ngModelChange)="settings._colValueChanged(map,record)">\r\n            <option *ngFor="let v of getDropDown()" [ngValue]="v.id">{{v.caption}}</option>\r\n\r\n        </select>\r\n    </div>\r\n\r\n    <div *ngIf="showCheckbox()">\r\n        <mat-checkbox *ngIf="!showReadonlyText()" #theId1 [(ngModel)]="_getColumn().inputValue"\r\n            (ngModelChange)="settings._colValueChanged(map,record)" class="fix-label"></mat-checkbox>\r\n        <mat-icon style="font-size:18px;height:20px" *ngIf="showReadonlyText()&&_getColumn().inputValue">check\r\n        </mat-icon>\r\n    </div>\r\n\r\n</div>\r\n<mat-error *ngIf="getError()" [id]="theId" style="font-size: 75%;">{{getError()}}</mat-error>',styles:['.my-select:after{content:"";width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid;position:absolute;top:50%;right:0;pointer-events:none;color:rgba(0,0,0,.54);margin-top:-5px}.rtl-select:after{right:auto;left:0}.my-select{position:relative;width:100%}.data-control3{display:flex;width:100%}.row-button{height:auto;line-height:normal}input{border:none;outline:0;padding:0;margin:0;font-size:inherit;font-family:inherit}']}]}],H.propDecorators={map:[{type:e.Input}],column:[{type:e.Input}],rightToLeft:[{type:e.Input}],record:[{type:e.Input}],notReadonly:[{type:e.Input}],settings:[{type:e.Input}]};var N=function(){function t(t){this.dialog=t,this.searchString=""}return t.prototype.selectFirst=function(){var t,e;try{for(var n=O(this.values),i=n.next();!i.done;i=n.next()){var r=i.value;if(this.matchesFilter(r))return void this.select(r)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}},t.prototype.matchesFilter=function(t){return t.caption.toLocaleLowerCase().includes(this.searchString.toLocaleLowerCase())},t.prototype.args=function(t){this.values=t.values,this.onSelect=t.onSelect,this.title=t.title},t.prototype.select=function(t){this.onSelect(t),this.dialog.close()},t}();N.decorators=[{type:e.Component,args:[{template:'<h1 mat-dialog-title>{{title}}</h1>\r\n\r\n<div mat-dialog-content>\r\n    <form (submit)="selectFirst()">\r\n        <mat-form-field>\r\n            <input matInput [(ngModel)]="searchString" [ngModelOptions]="{standalone: true}"> \r\n        </mat-form-field>\r\n    </form>\r\n    <mat-nav-list role="list" *ngIf="values">\r\n        <ng-container *ngFor="let o of values">\r\n            <mat-list-item role="listitem" style="height:36px"\r\n                *ngIf="matchesFilter(o)" (click)="select(o)">\r\n                {{o.caption}}\r\n            </mat-list-item>\r\n            <mat-divider *ngIf="matchesFilter(o)"></mat-divider>\r\n        </ng-container>\r\n    </mat-nav-list>\r\n</div>\r\n<div mat-dialog-actions>\r\n\r\n    <button mat-icon-button mat-dialog-close>\r\n        <mat-icon>clear</mat-icon>\r\n    </button>\r\n</div>'}]}],N.ctorParameters=function(){return[{type:l.MatDialogRef}]};var j=function(){function t(t){this.dialog=t}return t.prototype.setFilter=function(){this.info.settings.columns.filterRows(this.info.filterColumnToAdd),this.dialog.close()},t.prototype.clear=function(){this.info.settings.columns.clearFilter(this.info.filterColumnToAdd),this.dialog.close()},t}();j.decorators=[{type:e.Component,args:[{template:'<h1 mat-dialog-title *ngIf="!info.rightToLeft">Filter {{this.info.filterColumnToAdd?.caption}}</h1>\r\n<h1 mat-dialog-title *ngIf="info.rightToLeft">סינון {{this.info.filterColumnToAdd?.caption}}</h1>\r\n<div mat-dialog-content>\r\n\r\n    <data-control *ngIf="this.info.filterColumnToAdd" [settings]="info.settings.columns" [map]="info.filterColumnToAdd"\r\n        [record]="info.settings.columns.filterHelper.filterRow" [notReadonly]="true"></data-control>\r\n</div>\r\n<div mat-dialog-actions>\r\n    <button mat-icon-button (click)="setFilter()">\r\n        <mat-icon>check</mat-icon>\r\n    </button>\r\n    <button mat-icon-button (click)="clear()">\r\n        <mat-icon>clear</mat-icon>\r\n    </button>\r\n</div>'}]}],j.ctorParameters=function(){return[{type:l.MatDialogRef}]};var q=function(){function t(t,e){this.remult=t,this.showFilterButton=!1,this.showAddFilter=!1,this.editFilterVisible=!1,this.rightToLeft=!1,this.rightToLeft="rtl"===e.value}return t.prototype.getCurrentFilterValue=function(t){this.settings.initOrigList();var e=this.settings.origList.find((function(e){return e.field==t}));return this.settings.filterHelper.filterRow[t.key]instanceof Date?this.settings.filterHelper.filterRow[t.key].toLocaleDateString():this.settings.columns._getColDisplayValue(e,this.settings.filterHelper.filterRow)},t.prototype.cancelAddFilter=function(){},t.prototype.showEditFilter=function(t){this.filterColumnToAdd=this.settings.origList.find((function(e){return e.field==t})),this.editFilterVisible=!0,this.showAddFilter=!1},t.prototype.userFilterButton=function(){this.showFilterButton=!this.showFilterButton,this.settings.initOrigList(),0==this.settings.filterHelper.filterColumns.length&&this.showAddAnotherFilterDialog()},t.prototype.showAddAnotherFilterDialog=function(){return _(this,void 0,void 0,(function(){var t=this;return k(this,(function(e){switch(e.label){case 0:return this.settings.initOrigList(),this.filterColumnToAdd=void 0,[4,rt(N,(function(e){return e.args({title:t.rightToLeft?"בחר עמודה לסינון":"Select Column to Filter",values:t.settings.origList,onSelect:function(e){return t.filterColumnToAdd=e}})}))];case 1:return e.sent(),this.filterColumnToAdd?[4,rt(j,(function(e){return e.info=t}))]:[3,3];case 2:e.sent(),e.label=3;case 3:return this.showAddFilter=!0,this.filterColumnToAdd=void 0,[2]}}))}))},t.prototype.editFilter=function(t){return _(this,void 0,void 0,(function(){var e=this;return k(this,(function(n){switch(n.label){case 0:return this.filterColumnToAdd=this.settings.origList.find((function(e){return e.field==t})),[4,rt(j,(function(t){return t.info=e}))];case 1:return n.sent(),[2]}}))}))},t.prototype.confirmEditFilter=function(){this.settings.columns.filterRows(this.filterColumnToAdd),this.editFilterVisible=!1},t.prototype.clearEditFilter=function(){this.settings.columns.clearFilter(this.filterColumnToAdd),this.editFilterVisible=!1},t.prototype.addFilter=function(){this.settings.columns.filterRows(this.filterColumnToAdd),this.showAddFilter=!1},t.prototype.cancelAddNewFilter=function(){this.showAddFilter=!1},t}();q.decorators=[{type:e.Component,args:[{selector:"Data-Filter",template:'<span (click)="showAddAnotherFilterDialog()" #theDiv class="link" \r\n    *ngIf="settings.columns.filterHelper.filterColumns.length>0"><span>{{rightToLeft?\'סינון\': \'Filter\'}}</span></span>\r\n<span *ngIf="settings.columns.filterHelper.filterColumns.length>0">: </span>\r\n<span *ngFor="let map of settings.columns.filterHelper.filterColumns ; let i = index">\r\n    <span *ngIf="i>0"> <span *ngIf="!rightToLeft">and</span><span *ngIf="rightToLeft">וגם</span> </span>\r\n    <span (click)="editFilter(map)" class="link"> {{map.caption}} = "{{this.getCurrentFilterValue(map)}}"</span>\r\n</span>',styles:[".link {\n        cursor:pointer;\n        color:blue;\n        text-decoration:underline;\n   }"]}]}],q.ctorParameters=function(){return[{type:i.Remult},{type:a.Directionality}]},q.propDecorators={settings:[{type:e.Input}]};var U=function(){function t(t,e,n){this.remult=t,this.plugin=n,this.rightToLeft=!1,this.displayButtons=!0,this.displayVCR=!0,this.rowButtons=[],this.gridButtons=[],this.keys=[],this.page=1,this.rightToLeft="rtl"===e.value}return t.prototype.addCol=function(t){return _(this,void 0,void 0,(function(){var e=this;return k(this,(function(n){switch(n.label){case 0:return[4,rt(N,(function(n){return n.args({values:e.settings.origList,onSelect:function(n){e.settings.columns.addCol(t,n),e.settings.columns.numOfColumnsInGrid++}})}))];case 1:return n.sent(),[2]}}))}))},t.prototype.getColFlex=function(t){return"0 0 "+this.getColWidth(t)},t.prototype.getColWidth=function(t){var e=this.settings.columns.__dataControlStyle(t);return e||(e="200px"),e},t.prototype.test=function(){},t.prototype.getTotalRows=function(){return this.settings.totalRows?Math.ceil(this.settings.totalRows/this.settings.rowsPerPage):this.rightToLeft?"רבים":"many"},t.prototype.getBottomLine=function(){if(0==this.settings.items.length)return"";var t=(this.settings.page-1)*this.settings.rowsPerPage+1;return t+" - "+(t+this.settings.items.length-1)+(this.rightToLeft?" מתוך ":" of ")+(this.settings.totalRows?this.settings.totalRows:this.rightToLeft?"רבים":"many")},t.prototype.dragStart=function(t){this.tempDragColumn=t},t.prototype.dragOver=function(t,e){e.preventDefault()},t.prototype.onDrop=function(t){var e=this.settings.columns.items.indexOf(this.tempDragColumn);this.settings.columns.items.splice(e,1);var n=this.settings.columns.items.indexOf(t);n==e&&n++,this.settings.columns.items.splice(n,0,this.tempDragColumn),this.settings.columns.colListChanged()},t.prototype._getHeight=function(){if(this.height)return(+this.height).toString()==this.height?this.height+"px":this.height},t.prototype.isFiltered=function(t){return this.settings.columns.filterHelper.isFiltered(t)},t.prototype.showFilterColumnDialog=function(t){t.field&&(this.settings.initOrigList(),this.dataFilterInfo.editFilter(B(t.field)))},t.prototype.getButtonCssClass=function(t,e){return t.cssClass?"function"==typeof t.cssClass?t.cssClass(e):t.cssClass.toString():""},t.prototype.getButtonText=function(t,e){return t.textInMenu?"function"==typeof t.textInMenu?e?t.textInMenu(e):"":t.textInMenu:t.name},t.prototype.clickOnselectCheckboxFor=function(t,e){this.settings.clickOnselectCheckboxFor(t,e.shiftKey)},t.prototype.hasVisibleButton=function(t){return this.rowButtons.find((function(e){return e.visible(t)}))},t.prototype.hasVisibleGridButtons=function(){return this.gridButtons.find((function(t){return t.visible()}))},t.prototype.addButton=function(t){if(t.click||(t.click=function(t){}),t.visible||(t.visible=function(t){return!0}),t.cssClass){if("function"!=typeof t.cssClass){var e=t.cssClass;t.cssClass=function(t){return e}}}else t.cssClass=function(t){return"btn"};return this.rowButtons.push(t),t},t.prototype.rowClicked=function(t){this.settings.setCurrentRow(t)},t.prototype.nextPage=function(){this.page++},t.prototype.previousPage=function(){this.page<=1||this.page--},t.prototype.showSaveAllButton=function(){var t=this;return this.settings.items.find((function(e){return t.settings.getRowHelper(e).wasChanged()}))},t.prototype.saveAllText=function(){var t=this;return this.rightToLeft?"שמור "+this.settings.items.filter((function(e){return t.settings.getRowHelper(e).wasChanged()})).length+" שורות":"save "+this.settings.items.filter((function(e){return t.settings.getRowHelper(e).wasChanged()})).length+" rows"},t.prototype.saveAllClick=function(){return _(this,void 0,void 0,(function(){var t=this;return k(this,(function(e){switch(e.label){case 0:return[4,Promise.all(this.settings.items.filter((function(e){return t.settings.getRowHelper(e).wasChanged()})).map((function(e){return t.settings.getRowHelper(e).save()})))];case 1:return e.sent(),[2]}}))}))},t.prototype.ngOnChanges=function(){var t,e,n,i=this;if(this.settings){if(this.rowButtons=[],this.gridButtons=[],this.gridButtons.push({visible:function(){return i.showSaveAllButton()},textInMenu:function(){return i.saveAllText()},click:function(){return _(i,void 0,void 0,(function(){return k(this,(function(t){switch(t.label){case 0:return[4,this.saveAllClick()];case 1:return t.sent(),[2]}}))}))}}),this.gridButtons.push({icon:"filter_alt",textInMenu:function(){return i.rightToLeft?"סינון":"Filter"},click:function(){return i.dataFilterInfo.showAddAnotherFilterDialog()},visible:function(){return!0}}),this.settings.columns.setContext(this.remult),this.settings.settings.gridButtons&&(t=this.gridButtons).push.apply(t,D(this.settings.settings.gridButtons.map((function(t){return t.visible||(t.visible=function(){return!0}),t})))),this.settings.allowUpdate&&(this.addButton({name:"",icon:"check",cssClass:"glyphicon glyphicon-ok btn-success",visible:function(t){return i.settings.getRowHelper(t).wasChanged()},showInLine:!0,textInMenu:function(){return i.rightToLeft?"שמור":"save"},click:function(t){i.settings._doSavingRow(t)}}),this.addButton({name:"",icon:"cancel",cssClass:"btn btn-danger glyphicon glyphicon-ban-circle",visible:function(t){return i.settings.getRowHelper(t).wasChanged()},showInLine:!0,textInMenu:function(){return i.rightToLeft?"בטל שינוים":"cancel"},click:function(t){i.settings.undoChanges(t)}})),this.settings.allowDelete&&this.addButton({name:"",visible:function(t){return t&&!i.settings.getRowHelper(t).isNew()},icon:"delete",textInMenu:function(){return i.rightToLeft?"מחק":"Delete"},click:function(t){return _(i,void 0,void 0,(function(){return k(this,(function(e){switch(e.label){case 0:return this.settings.settings.confirmDelete?[4,this.settings.settings.confirmDelete(t)]:[3,2];case 1:if(!e.sent())return[2];e.label=2;case 2:return this.settings.getRowHelper(t).delete(),[2]}}))}))},cssClass:"btn-danger glyphicon glyphicon-trash"}),this.settings._buttons)try{for(var r=O(this.settings._buttons),o=r.next();!o.done;o=r.next()){var s=o.value;this.addButton(s)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}!this.records&&this.settings&&this.settings.reloadData().then((function(t){i.records=t}))}},t.prototype._getRowClass=function(t){var e="dataGridRow ";return this.settings.rowClass&&(e+=this.settings.rowClass(t)),t==this.settings.currentRow&&(e+=" active"),e},t.prototype._getRowColumnClass=function(t,e){return this.settings.columns._getColumnClass(t,e)+" dataGridDataCell"},t}();U.decorators=[{type:e.Component,args:[{selector:"data-grid",template:'<div style="height: 100%;display: flex;flex-direction: column;">\r\n  <Data-Filter [settings]="settings" #dataFilter style="flex-shrink: 0;">\r\n  </Data-Filter>\r\n  <div class="dataGrid" #dataGridDiv *ngIf="settings&&settings.columns" [style.height]="_getHeight()">\r\n    <div class="inner-wrapper">\r\n      <div class="dataGridHeaderArea">\r\n        <div class="dataGridRow">\r\n          <div class="data-grid-row-more-buttons dataGridDataCell">\r\n\r\n            <button mat-icon-button [matMenuTriggerFor]="updatedRowOptions" *ngIf="hasVisibleGridButtons()">\r\n              <mat-icon>more_vert</mat-icon>\r\n            </button>\r\n\r\n          </div>\r\n          <div class="data-grid-row-selection dataGridDataCell" *ngIf="settings.settings.allowSelection">\r\n\r\n            <mat-checkbox [indeterminate]="settings.selectAllIntermitent()" [checked]="settings.selectAllChecked()"\r\n              [matTooltip]="!settings.selectAllChecked()? settings.selectedRows.length:settings.totalRows?settings.totalRows:rightToLeft ? \'רבים\' : \'many\'"\r\n              (change)="settings.selectAllChanged($event)">\r\n            </mat-checkbox>\r\n\r\n          </div>\r\n          <mat-menu #updatedRowOptions="matMenu">\r\n\r\n            <ng-container *ngFor="let b of gridButtons">\r\n              <button mat-menu-item *ngIf="b.visible()" (click)="b.click()">\r\n                <mat-icon *ngIf="b.icon">{{b.icon}}</mat-icon>{{b.textInMenu?b.textInMenu(): b.name}}\r\n              </button>\r\n            </ng-container>\r\n          </mat-menu>\r\n          <div class="dataGridHeaderCell headerWithFilter"\r\n            *ngFor="let map of settings.columns.getGridColumns(this.plugin.dataControlAugmenter)"\r\n            [style.flex]="getColFlex(map)" [style.width]="getColWidth(map)" draggable="true"\r\n            (dragstart)="dragStart(map)" (dragover)="dragOver(map,$event)" (drop)="onDrop(map)">\r\n\r\n            <span (click)="settings.sort(map.field)">{{map.caption}}</span>\r\n\r\n\r\n            <span class="filterButton" *ngIf="map.field" [class.filteredFilterButton]="isFiltered(map.field)"\r\n              (click)="showFilterColumnDialog(map)">\r\n              <mat-icon>filter_alt</mat-icon>\r\n            </span>\r\n\r\n            <mat-icon *ngIf="settings.sortedAscending(map.field)">arrow_downward</mat-icon>\r\n            <mat-icon class="glyphicon glyphicon-chevron-down pull-right" *ngIf="settings.sortedDescending(map.field)">\r\n              arrow_upward</mat-icon>\r\n          </div>\r\n          <div class="dataGridButtonHeaderCell" *ngIf="rowButtons&& rowButtons.length>0&&displayButtons"\r\n            [class.col-xs-1]="rowButtons&&rowButtons.length<3">\r\n            <button mat-icon-button *ngIf="showSaveAllButton()" (click)="saveAllClick()"\r\n              style="line-height:36px;max-height:28px">\r\n              <mat-icon [matTooltip]="saveAllText()" class="row-button" style="font-size:24px">done_all</mat-icon>\r\n            </button>\r\n          </div>\r\n        </div>\r\n      </div>\r\n      <div class="dataGridBodyArea">\r\n        <div class="dataGridRow" *ngFor="let record of records" [className]="_getRowClass(record)"\r\n          (click)="rowClicked(record)">\r\n          <div class="data-grid-row-more-buttons dataGridDataCell">\r\n\r\n            <button mat-icon-button [matMenuTriggerFor]="updatedRowOptions" *ngIf="hasVisibleButton(record) ">\r\n              <mat-icon>expand_more</mat-icon>\r\n            </button>\r\n\r\n          </div>\r\n          <div class="data-grid-row-selection dataGridDataCell" *ngIf="settings.settings.allowSelection">\r\n\r\n            <mat-checkbox [checked]="settings.isSelected(record)" (change)="settings.selectedChanged(record)"\r\n              (click)="clickOnselectCheckboxFor(record,$event)">\r\n            </mat-checkbox>\r\n\r\n          </div>\r\n          <mat-menu #updatedRowOptions="matMenu">\r\n            <ng-container *ngFor="let b of rowButtons">\r\n              <button mat-menu-item *ngIf="b.visible(record)" (click)="b.click(record)">\r\n                <mat-icon *ngIf="b.icon">{{b.icon}}</mat-icon>{{getButtonText(b,record)}}\r\n              </button>\r\n            </ng-container>\r\n\r\n          </mat-menu>\r\n          <div class="dataGridDataCell" *ngFor="let map of settings.columns.getGridColumns(this.plugin.dataControlAugmenter)"\r\n            [className]="_getRowColumnClass(map,record)" [style.flex]="getColFlex(map)"\r\n            [style.width]="getColWidth(map)">\r\n            <data-control3 [settings]="settings.columns" [map]="map" [record]="record" [rightToLeft]="rightToLeft">\r\n            </data-control3>\r\n          </div>\r\n          <div class="dataGridButtonCell" *ngIf="rowButtons.length>0&&displayButtons" style="white-space:nowrap">\r\n            <ng-container *ngFor="let b of rowButtons">\r\n              <button mat-icon-button *ngIf="b.visible(record)&&b.icon&&b.showInLine" (click)="b.click(record)"\r\n                matTooltip="{{getButtonText(b,record)}}" class="row-button">\r\n                <mat-icon *ngIf="b.icon">{{b.icon}} </mat-icon> {{b.name}}\r\n              </button>\r\n              <button mat-raised-button *ngIf="b.visible(record)&&!b.icon&&b.showInLine" (click)="b.click(record)"\r\n                class="row-button">\r\n                {{b.name}}\r\n              </button>\r\n            </ng-container>\r\n\r\n          </div>\r\n        </div>\r\n\r\n      </div>\r\n    </div>\r\n  </div>\r\n  <div class="dataGridFooterArea" *ngIf="records&&settings.settings.showPagination">\r\n    <div class="dataGridFooterButtonGroup">\r\n      <button mat-icon-button (click)="settings.userChooseColumns()">\r\n        <mat-icon>settings</mat-icon>\r\n      </button>\r\n\r\n      <span class="hide-on-narrow">{{rightToLeft?\'שורות בדף\': \'lines per page\'}}\r\n        <select class="form-control" style="width:80px;display:inline-block" [(ngModel)]="settings.rowsPerPage"\r\n          (change)="settings.reloadData()">\r\n          <option *ngFor="let r of settings.rowsPerPageOptions" value="{{r}}">{{r}}</option>\r\n        </select>\r\n      </span>\r\n    </div>\r\n    <div class="dataGridFooterButtonGroup">\r\n      <button mat-icon-button (click)="settings.firstPage()">\r\n        <mat-icon>{{rightToLeft?\'last_page\':\'first_page\'}} </mat-icon>\r\n      </button>\r\n      <button mat-icon-button [disabled]="settings.page==1" (click)="settings.previousPage()">\r\n        <mat-icon>{{rightToLeft?\'chevron_right\':\'chevron_left\'}}</mat-icon>\r\n      </button>\r\n      {{getBottomLine()}}\r\n\r\n      <button mat-icon-button [disabled]="!(records.items&& records.items.length>0)" (click)="settings.nextPage()">\r\n        <mat-icon>{{!rightToLeft?\'chevron_right\':\'chevron_left\'}}</mat-icon>\r\n      </button>\r\n      <button mat-icon-button *ngIf="settings.allowUpdate &&settings.allowInsert" (click)="settings.addNewRow()">\r\n        <mat-icon>add</mat-icon>\r\n      </button>\r\n    </div>\r\n    <div *ngIf="settings.showSelectColumn" class="selectColumnsArea">\r\n      Select Columns\r\n      <ol>\r\n        <ng-container *ngFor="let c of settings.currList; let i=index">\r\n          <li *ngIf="i<settings.columns.numOfColumnsInGrid">\r\n            <select [(ngModel)]="settings.currList[i]" class="form-control selectColumnCombo" style="max-width:100px"\r\n              (change)="settings.columns.colListChanged()">\r\n              <option *ngFor="let o of settings.origList" [ngValue]="o">{{o.caption}}</option>\r\n            </select>\r\n            <input [(ngModel)]="c.width" style="width:50px;display:inline;">\r\n            <button mat-icon-button *ngIf="settings.currList.length>1" (click)="settings.deleteCol(c)">\r\n              <mat-icon>cancel</mat-icon>\r\n            </button>\r\n            <button mat-icon-button (click)="addCol(c)">\r\n              <mat-icon>add</mat-icon>\r\n            </button>\r\n            <button mat-icon-button *ngIf="i<settings.currList.length-1" (click)="settings.columns.moveCol(c,1)">\r\n              <mat-icon>keyboard_arrow_down</mat-icon>\r\n            </button>\r\n            <button mat-icon-button *ngIf="i>0" (click)="settings.columns.moveCol(c,-1)">\r\n              <mat-icon>keyboard_arrow_up</mat-icon>\r\n            </button>\r\n          </li>\r\n        </ng-container>\r\n      </ol>\r\n      <button (click)="settings.resetColumns()" class="btn glyphicon glyphicon-repeat"></button>\r\n    </div>\r\n  </div>\r\n\r\n\r\n\r\n\r\n  <data-area *ngIf="settings.showDataArea" [settings]="settings" [columns]="2"></data-area>\r\n</div>',styles:[".row-button{height:auto;line-height:normal}.inner-wrapper{display:inline-block}.dataGrid{overflow:auto;border:1px solid #e0e0e0;height:100%}.dataGridRow{display:flex}.dataGridHeaderArea{position:sticky;top:0;clear:both;background-color:#f5f5f5;z-index:3}.dataGridHeaderArea mat-icon{font-size:16px;height:18px;width:18px;line-height:18px}.dataGridFooterButtonGroup{display:inline-block}.dataGridFooterArea{width:100%;bottom:0;left:0;background-color:#f5f5f5}.dataGridDataCell,.dataGridHeaderCell{padding:4px}.dataGridDataCell{border-top:1px solid #e0e0e0}.data-grid-row-more-buttons{border-left:1px solid #e0e0e0;border-right:1px solid #e0e0e0;padding-left:0;padding-right:0;width:18px}.data-grid-row-more-buttons mat-icon{font-size:16px;height:17px;width:18px;line-height:17px}.data-grid-row-more-buttons button{width:auto;height:auto;line-height:18px}.data-grid-row-selection{width:18px}.dataGridFooterArea{border:1px solid #e0e0e0}.filterDialog{background-color:#fff;position:absolute;padding:10px;border:2px solid grey;z-index:800;border-radius:5px;width:200px}.filterDialog .form-group{margin-right:0;margin-left:0}.designModeButton span{visibility:hidden}.designModeButton:hover span{visibility:visible}.selectColumnCombo{display:inline-block;width:auto}.selectColumnsArea{display:block}.headerWithFilter .filterButton{visibility:hidden}.headerWithFilter .filteredFilterButton,.headerWithFilter:hover .filterButton{visibility:visible}table input{min-width:75px}table select{min-width:100px}.dataGridFooterArea{box-sizing:border-box}@media (max-width:500px){.hide-on-narrow{display:none}}"]}]}],U.ctorParameters=function(){return[{type:i.Remult},{type:a.Directionality},{type:V}]},U.propDecorators={width:[{type:e.Input}],height:[{type:e.Input}],displayButtons:[{type:e.Input}],displayVCR:[{type:e.Input}],records:[{type:e.Input}],settings:[{type:e.Input}],dataFilterInfo:[{type:e.ViewChild,args:[q]}]};var z=function(){function t(t,e){this.router=t,this.injector=e}return t.prototype.navigateToComponent=function(t){var e=this,n=!1;this.router.config.forEach((function(i){n||i.component==t&&(n=!0,e.router.navigate(["/"+i.path]))})),n||console.warn("couldn't find path for ",t,this.router.config)},t.prototype.canNavigateToRoute=function(t){var e,n;if(!t.canActivate)return!0;try{for(var i=O(t.canActivate),r=i.next();!r.done;r=i.next()){var o=r.value,s=this.injector.get(o);if(s&&s.canActivate){var a=new K;if(a.routeConfig=t,!s.canActivate(a,void 0))return!1}}}catch(t){e={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return!0},t}();z.decorators=[{type:e.Injectable}],z.ctorParameters=function(){return[{type:c.Router},{type:e.Injector}]};var $=function(){function t(t,e,n){this.remult=t,this.router=e,this.helper=n}return t.prototype.isAllowed=function(){return!0},t.prototype.canActivate=function(e){if(this.remult.authenticated()&&this.remult.isAllowed(this.isAllowed()))return!0;if(!(e instanceof K)){var n=t.componentToNavigateIfNotAllowed;null!=n?this.helper.navigateToComponent(n):this.router.navigate(["/"])}return!1},t}();$.decorators=[{type:e.Injectable}],$.ctorParameters=function(){return[{type:i.Remult},{type:c.Router},{type:z}]};var J=function(){function t(t,e){this.remult=t,this.router=e}return t.prototype.canActivate=function(t){return!this.remult.authenticated()},t}();J.decorators=[{type:e.Injectable}],J.ctorParameters=function(){return[{type:i.Remult},{type:c.Router}]};var K=function(t){function e(){return t.call(this)||this}return x(e,t),e}(c.ActivatedRouteSnapshot),Y=function(){function t(){this.mode="indeterminate",this.value=0}return t.prototype.ngOnInit=function(){},t}();Y.decorators=[{type:e.Component,args:[{selector:"app-wait",template:'<mat-progress-spinner [mode]="mode" [value]="value" >\r\n</mat-progress-spinner>',styles:[""]}]}],Y.ctorParameters=function(){return[]};var Q=function(){function t(e){this.dialog=e,this.id=0,this.numOfWaits=0,this.disableWait=0,t.singleInstance=this}return t.prototype.donotWait=function(t){return _(this,void 0,void 0,(function(){return k(this,(function(e){switch(e.label){case 0:this.disableWait++,e.label=1;case 1:return e.trys.push([1,,3,4]),[4,t()];case 2:return[2,e.sent()];case 3:return this.disableWait--,[7];case 4:return[2]}}))}))},t.prototype.donotWaitNonAsync=function(t){this.disableWait++;try{return t()}finally{this.disableWait--}},t.prototype.log=function(t,e){},t.prototype.doWhileShowingBusy=function(t){return _(this,void 0,void 0,(function(){var e;return k(this,(function(n){switch(n.label){case 0:e=this.showBusy(),n.label=1;case 1:return n.trys.push([1,,3,4]),[4,t()];case 2:return[2,n.sent()];case 3:return e(),[7];case 4:return[2]}}))}))},t.prototype.startBusyWithProgress=function(){var t=this;if(this.disableWait)return{close:function(){},progress:function(){}};var e=!1,n=this.dialog.open(Y,{disableClose:!0,autoFocus:!1,restoreFocus:!1});return{close:function(){return _(t,void 0,void 0,(function(){return k(this,(function(t){switch(t.label){case 0:return e?(n.componentInstance.value=100,[4,new Promise((function(t){return setTimeout((function(){return t(0)}),250)}))]):[3,2];case 1:t.sent(),t.label=2;case 2:return n.close(),[2]}}))}))},progress:function(t){t>0&&(e=!0,n.componentInstance.mode="determinate",n.componentInstance.value=100*t)}}},t.prototype.showBusy=function(){var t=this,e=this.id++;return this.disableWait?function(){}:(this.log(e,"start busy "),0==this.numOfWaits&&setTimeout((function(){t.numOfWaits>0&&!t.waitRef&&(t.log(e,"actual start busy "),t.waitRef=t.dialog.open(Y,{disableClose:!0}))}),300),this.numOfWaits++,function(){t.numOfWaits--,t.log(e,"close busy "),0==t.numOfWaits&&(t.log(e,"close top busy "),t.waitRef&&(t.log(e,"actual close top busy "),t.waitRef.close(),t.waitRef=void 0))})},t}();Q.decorators=[{type:e.Injectable}],Q.ctorParameters=function(){return[{type:l.MatDialog}]};var X=function(){function t(t){this.busy=t}return t.prototype.intercept=function(t,e){var n=this.busy.showBusy();return e.handle(t).pipe(p.finalize((function(){return n()})))},t}();X.decorators=[{type:e.Injectable}],X.ctorParameters=function(){return[{type:Q}]};var Z=function(){function t(t,e){this.remult=t,this.plugin=e,this.settings={fields:new A((function(){}),(function(){return!1}),void 0,(function(){return!0}),(function(){})),lines:void 0},this.columns=1}return t.prototype.ngOnChanges=function(){var t=this;if(this.object&&(this.settings=new P({fields:function(){return D(i.getFields(t.object,t.remult))}})),this.settings&&this.settings.fields){this.settings.fields.setContext(this.remult),this.settings.fields.onColListChange((function(){return t.lastCols=void 0}));var e=this.settings;e.settings&&e.settings.numberOfColumnAreas&&(this.columns=e.settings.numberOfColumnAreas)}},t.prototype.getColWidth=function(t){return this.settings.fields.__dataControlStyle(t)},t.prototype._getRowColumnClass=function(t){return this.settings.fields._getColumnClass(t,this.settings.fields.currentRow())+" dataGridDataCell"},t.prototype.theColumns=function(){this.settings.columns&&!this.settings.fields&&(this.settings.fields=this.settings.columns);var t=this.settings.fields.getNonGridColumns(this.plugin.dataControlAugmenter);if(t==this.lastAllCols)return this.lastCols;this.lastAllCols=t;var e,n=[];this.lastCols=n;for(var i=0;i<this.columns;i++)n.push([]);e=this.settings.lines?this.settings.lines:t.map((function(t){return[t]}));var r=Math.round(e.length/this.columns);for(i=0;i<e.length;i++)n[Math.floor(i/r)].push(e[i]);return this.lastCols},t}();Z.decorators=[{type:e.Component,args:[{selector:"data-area",template:'<div class="column-container">\r\n    <div *ngFor="let col of theColumns()">\r\n        <ng-container *ngFor="let line of col">\r\n            <div class="one-line">\r\n                <ng-container *ngFor="let map of line">\r\n                    <data-control [settings]="settings.fields" [map]="map" [record]="settings.fields.currentRow()"\r\n                        *ngIf="settings.fields.__visible(map,settings.fields.currentRow())"\r\n                        [className]="_getRowColumnClass(map)" \r\n                        [style.maxWidth]="getColWidth(map)">\r\n                    </data-control>\r\n                </ng-container>\r\n            </div>\r\n        </ng-container>\r\n    </div>\r\n</div>',encapsulation:e.ViewEncapsulation.None,styles:[".one-line{display:flex;justify-content:space-between}.one-line>*{margin-left:.2em;margin-right:.2em;flex-basis:1px;flex-grow:1}@media only screen and (min-width:768px){.column-container{display:flex;width:100%}.column-container>div{width:100%}}"]}]}],Z.ctorParameters=function(){return[{type:i.Remult},{type:V}]},Z.propDecorators={settings:[{type:e.Input}],object:[{type:e.Input}],columns:[{type:e.Input}]};var tt=function(){};tt.decorators=[{type:e.NgModule,args:[{declarations:[W,Z,q,U,Y,H,N,j],imports:[s.FormsModule,o.CommonModule,h.HttpClientModule,d.MatProgressSpinnerModule,l.MatDialogModule,f.BrowserAnimationsModule,g.MatFormFieldModule,y.MatButtonModule,v.MatListModule,b.MatTooltipModule,m.MatInputModule,w.MatIconModule,s.ReactiveFormsModule,C.MatCheckboxModule,R.MatMenuModule,a.BidiModule],providers:[{provide:i.Remult,useFactory:it,deps:[h.HttpClient,l.MatDialog]},J,$,z,Q,V,{provide:h.HTTP_INTERCEPTORS,useClass:X,multi:!0}],exports:[W,q,U,Z,N],entryComponents:[Y,N,j]}]}];var et,nt=Symbol("dialogConfigMember");function it(t,e){var n=this,r=new i.Remult(t);return et=e,u.actionInfo.runActionWithoutBlockingUI=function(t){return _(n,void 0,void 0,(function(){return k(this,(function(e){switch(e.label){case 0:return[4,Q.singleInstance.donotWait(t)];case 1:return[2,e.sent()]}}))}))},u.actionInfo.startBusyWithProgress=function(){return Q.singleInstance.startBusyWithProgress()},r}function rt(t,e,n){return _(this,void 0,void 0,(function(){var i,r;return k(this,(function(o){switch(o.label){case 0:return i=et.open(t,t[nt]),e&&e(i.componentInstance),i.beforeClosed?[4,i.beforeClosed().toPromise()]:[3,2];case 1:return r=o.sent(),[3,4];case 2:return[4,i.beforeClose().toPromise()];case 3:r=o.sent(),o.label=4;case 4:return n?[2,n(i.componentInstance)]:[2,r]}}))}))}var ot=function(){function t(t){this.repository=t,this.cache=new Map}return t.prototype.get=function(t){return this.getInternal(t).value},t.prototype.getId=function(t){return this.getInternal(this.repository.metadata.idMetadata.getIdFilter(t)).value},t.prototype.found=function(t){return this.getInternal(t).found},t.prototype.getInternal=function(t){return this._internalGetByOptions({where:t})},t.prototype._internalGetByOptions=function(t){var e=i.Filter.entityFilterToJson(this.repository.metadata,t.where),n=JSON.stringify(e),o=this.cache.get(n);if(void 0!==o){if(!this.repository.getEntityRef(o.value).wasDeleted())return this.cache.get(n);o=void 0,this.cache.set(n,void 0)}(o=new st).value=this.repository.create(),r.__updateEntityBasedOnWhere(this.repository.metadata,t.where,o.value),this.cache.set(n,o);var s=!1;for(var a in e){if(Object.prototype.hasOwnProperty.call(e,a))if(void 0!==e[a]){s=!0;break}}return null!=t&&null!=n&&s?(o.promise=this.repository.find(t).then((function(t){return o.loading=!1,t.length>0&&(o.value=t[0],o.found=!0),o})),o):(o.loading=!1,o.found=!1,o.promise=Promise.resolve(o),o)},t.prototype.getAsync=function(t){return this.getInternal(t).promise.then((function(t){return t.value}))},t}(),st=function(){this.found=!1,this.loading=!0,this.value={}};t.AuthenticatedGuard=$,t.BusyService=Q,t.DataArea2Component=Z,t.DataControl2Component=W,t.DataControl3Component=H,t.DataFilterInfoComponent=q,t.DataGrid2Component=U,t.DialogConfig=function(t){return function(e){return e[nt]=t,e}},t.Lookup=ot,t.NotAuthenticatedGuard=J,t.RemultAngularPluginsService=V,t.RemultModule=tt,t.RouteHelperService=z,t.SelectValueDialogComponent=N,t.buildContext=it,t.lookupRowInfo=st,t.openDialog=rt,t.ɵa=X,t.ɵb=Y,t.ɵc=j,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=remult-angular.umd.min.js.map