Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@remult/angular

Package Overview
Dependencies
Maintainers
2
Versions
305
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@remult/angular - npm Package Compare versions

Comparing version 0.13.5 to 0.13.6

2

bundles/remult-angular-interfaces.umd.min.js

@@ -15,3 +15,3 @@ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("remult"),require("remult/src/remult3")):"function"==typeof define&&define.amd?define("@remult/angular/interfaces",["exports","remult","remult/src/remult3"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).remult=t.remult||{},t.remult.angular=t.remult.angular||{},t.remult.angular.interfaces={}),t.remult,t.remult3)}(this,(function(t,e,i){"use strict";

PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function n(t,e,i,n){return new(i||(i=Promise))((function(r,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function l(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,l)}a((n=n.apply(t,e||[])).next())}))}function r(t,e){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(o){return function(l){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=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++,n=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],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,l])}}}Object.create;function o(t){var e="function"==typeof Symbol&&Symbol.iterator,i=e&&t[e],n=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function s(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var n,r,o=i.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return s}function l(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(s(arguments[e]));return t}Object.create;var a=function(){function t(t,e,i,n,r){this.currentRow=t,this.allowUpdate=e,this.filterHelper=i,this.showArea=n,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,i){var n;if(t.field)return i&&(n=e.getEntityRef(i).fields.find(f(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,i){return t.visible(i,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,i){return t.allowClick(i,e)}))))},t.prototype.getRowColumn=function(t,e){var i,n=t.row;return this._getRowColumn&&t.col.field&&n&&(i=this._getRowColumn(n,f(t.col.field))),i||(i=t.col.field),!n&&i&&(n=i.container),e(i,n)},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 n(this,void 0,void 0,(function(){var e,i,n,s,l,a,u,h,c;return r(this,(function(r){switch(r.label){case 0:e=[];try{for(i=o(t),n=i.next();!n.done;n=i.next())(s=n.value)&&(void 0,a=s,u=s,(!(l=s).field&&a.valueConverter||u.metadata)&&(l={field:s}),l.field&&p(l.field,l),l.getValue&&l,e.push(this.buildDropDown(l)),this.items.push(l))}catch(t){h={error:t}}finally{try{n&&!n.done&&(c=i.return)&&c.call(i)}finally{if(h)throw h.error}}return[4,Promise.all(e)];case 1:return r.sent(),[2,Promise.resolve()]}}))}))},t.prototype.setContext=function(t){var e,i;this.remult=t;try{for(var n=o(this.doWhenWeHaveContext),r=n.next();!r.done;r=n.next()){(0,r.value)(t)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(i=n.return)&&i.call(n)}finally{if(e)throw e.error}}},t.prototype.buildDropDown=function(t){return n(this,void 0,void 0,(function(){var e,i,s,a,u,h,d,f,p,y,w,v,m,g,C=this;return r(this,(function(R){switch(R.label){case 0:if(!t.valueList)return[3,5];if(e=t.valueList,i=[],t.valueList=i,!(e instanceof Array))return[3,1];try{for(s=o(e),a=s.next();!a.done;a=s.next())u=a.value,"string"==(h=typeof u)||"number"==h?i.push({id:u,caption:u}):(d=u)&&null!=d.id&&i.push(d)}catch(t){m={error:t}}finally{try{a&&!a.done&&(g=s.return)&&g.call(s)}finally{if(m)throw m.error}}return[3,4];case 1:return"function"!=typeof e?[3,2]:(f=e,p=function(e){return n(C,void 0,void 0,(function(){var n;return r(this,(function(r){switch(r.label){case 0:return[4,f(e)];case 1:return void 0===(n=r.sent())?t.valueList=void 0:i.push.apply(i,l(n)),c(i,t.field),[2]}}))}))},this.remult?p(this.remult):this.doWhenWeHaveContext.push((function(t){return n(C,void 0,void 0,(function(){return r(this,(function(e){return[2,p(t)]}))}))})),[3,4]);case 2:return w=(y=i.push).apply,v=[i],[4,e];case 3:w.apply(y,v.concat([l.apply(void 0,[R.sent()])])),R.label=4;case 4:c(i,t.field),R.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 i=this.items.indexOf(t),n=i+e;n<0||n>=this.items.length||(this.items.splice(i,1),this.items.splice(n,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||!u(t.readonly,e)))},t.prototype._click=function(t,e){this.getRowColumn({col:t,row:e},(function(e,i){t.click(i,e)}))},t.prototype._getColDisplayValue=function(t,e){var i,n,r;if(t.getValue)r=this.getRowColumn({row:e,col:t},(function(e,i){return t.getValue(i,e)}));else if(t.field){if(t.valueList)try{for(var s=o(t.valueList),l=s.next();!l.done;l=s.next()){var a=l.value;if(a.id==this.__getColumn(t,e).value)return a.caption}}catch(t){i={error:t}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.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,i;if(0==this.items.length&&t)try{for(var n=o(t.fields),r=n.next();!r.done;r=n.next()){var s=r.value;"id"==s.key&&s.valueType===String||this.add(s)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(i=n.return)&&i.call(n)}finally{if(e)throw e.error}}},t.prototype.__changeWidth=function(t,e){var i=t.width;i||(i="50"),i=(+i+e).toString(),t.width=i},t.prototype._colValueChanged=function(t,e){return this.getRowColumn({col:t,row:e},(function(e,n){if(t.valueList){var r=t.valueList.find((function(t){return t.id==e.inputValue}));(null==r?void 0:r.entity)&&i.getEntitySettings(f(t.field).valueType,!1)&&(e.value=r.entity)}if(!t.valueChange)return!1;t.valueChange(n,e)}))},t.prototype.augment=function(t,e){this.augmented.get(e)||(t(f(e.field),e),this.augmented.set(e,!0))},t.prototype._initColumnsArrays=function(t){var e,i;if(this._lastColumnCount!=this.items.length||this._lastNumOfColumnsInGrid!=this.numOfColumnsInGrid){this._lastNumOfColumnsInGrid=this.numOfColumnsInGrid,this._lastColumnCount=this.items.length,this.gridColumns=[],this.nonGridColumns=[];var n=0;try{for(var r=o(this.items),s=r.next();!s.done;s=r.next()){var l=s.value;this.augment(t,l),n++<this._lastNumOfColumnsInGrid?this.gridColumns.push(l):this.nonGridColumns.push(l)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(i=r.return)&&i.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}();function u(t,e){return"function"==typeof t?t(e):t}var h=function(){function t(t){var o=this;t.dbName||(t.dbName=t.key),this.options=i.decorateColumnSettings(t,t.remult),this.dataControl=t,!this.dataControl.valueList&&this.options.valueConverter instanceof e.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 s=this.options.valueConverter?this.options.valueConverter:void 0;s&&(t.inputType||(t.inputType=s.inputType)),this.metadata={allowNull:t.allowNull,caption:t.caption,options:this.options,valueConverter:s,valueType:t.valueType,key:t.key,dbName:t.dbName,dbReadOnly:!1,inputType:t.inputType,isServerExpression:!1,getDbName:function(){return n(o,void 0,void 0,(function(){return r(this,(function(e){return[2,t.dbName]}))}))},target:void 0}}return t.prototype.validate=function(){return n(this,void 0,void 0,(function(){return r(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 c(t,e){var i=f(e);(null==i?void 0:i.valueType)===Number&&t.splice.apply(t,l([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 d=Symbol("configDataControlField");function f(t){if(t){var e=t,i=t;return i.metadata&&(e=i.metadata),e}}function p(t,i){var n;if(t instanceof h)for(var r in t.dataControl)if(Object.prototype.hasOwnProperty.call(t.dataControl,r)){var o=t.dataControl[r];void 0===i[r]&&(i[r]=o)}var s,l=f(t);if(l.target&&(s=Reflect.getMetadata(d,l.target,l.key)))for(var r in s)if(Object.prototype.hasOwnProperty.call(s,r)){o=s[r];void 0===i[r]&&(i[r]=o)}if(l.valueType&&(s=Reflect.getMetadata(d,l.valueType)))for(var r in s)if(Object.prototype.hasOwnProperty.call(s,r)){o=s[r];void 0===i[r]&&(i[r]=o)}void 0===i.valueList&&l&&l.valueConverter instanceof e.ValueListInfo&&(i.valueList=l.valueConverter.getValues()),!i.caption&&l.caption&&(i.caption=l.caption),!i.inputType&&l.inputType&&(i.inputType=l.inputType),null==i.readonly&&(l.dbReadOnly&&(i.readonly=!0),"boolean"==typeof(null===(n=l.options)||void 0===n?void 0:n.allowApiUpdate)&&(i.readonly=!l.options.allowApiUpdate))}var y=function(t,e,i){var n,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 s=o(t.fields(i)),u=s.next();!u.done;u=s.next()){var h=u.value;if(Array.isArray(h)){var c=e.items.length;e.add.apply(e,l(h));for(var d=[],f=c;f<e.items.length;f++)d.push(e.items[f]);this.lines.push(d)}else e.add(h),(c=e.items[e.items.length-1]).width="",this.lines.push([c])}}catch(t){n={error:t}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}},w=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,i=++this.lastGetId;return this.repository.find(t).then((function(t){var n=t.map((function(t){return e.map(t)}));return i==e.lastGetId&&(e.items=n),n}))},t.prototype.add=function(){var t=this.map(this.repository.create());return this.items.push(t),t},t}(),v=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(f(t))>=0},t.prototype.filterColumn=function(t,e,i){var n=f(t);n&&(e?(this.filterColumns.splice(this.filterColumns.indexOf(n,1),1),this.forceEqual.splice(this.forceEqual.indexOf(n,1),1)):this.filterColumns.indexOf(n)<0&&(this.filterColumns.push(n),!1===i&&this.forceEqual.push(n)),this.reloadData())},t.prototype.addToFindOptions=function(t){var n=this;this.filterColumns.forEach((function(r){var o,s=n.filterRow[r.key],l=s;if(r.valueType==Number||r.valueType==Date||r.valueType==Boolean||null!=i.getEntitySettings(r.valueType,!1)||n.forceEqual.find((function(t){return r.key==t.key}))){if(r.valueType==Date&&s){var a=s;l={$gte:a=new Date(a.getFullYear(),a.getMonth(),a.getDate()),$lt:new Date(a.getFullYear(),a.getMonth(),a.getDate()+1)}}}else l={$contains:e.getEntityRef(n.filterRow).fields[r.key].inputValue};var u=((o={})[r.key]=l,o);if(t.where){var h=t.where;t.where={$and:[h,u]}}else t.where=u}))},t}(),m=function(){function t(t,i){var o,s=this;if(this.repository=t,this.settings=i,this.showSelectColumn=!1,this.allowUpdate=!1,this.allowInsert=!1,this.allowDelete=!1,this.showDataArea=!1,this._buttons=[],this.filterHelper=new v((function(){s.page=1,s.reloadData()}),this.repository),this.page=1,this.selectedRows=[],this._selectedAll=!1,this.rowsPerPageOptions=[10,25,50,100],i||(this.settings=i={}),this.restList=new w(t),t&&(this.filterHelper.filterRow=t.create(),t.addEventListener({validating:function(t){return n(s,void 0,void 0,(function(){return r(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 s.currentRow}),(function(){return s.allowUpdate}),this.filterHelper,(function(){return!!s.currentRow}),(function(t,e){return s.repository.getEntityRef(t).fields.find(e)})),i){if(i.columnSettings){var u=i.columnSettings(t.metadata.fields);(o=this.columns).add.apply(o,l(u))}void 0!==i.allowCrud&&(void 0===i.allowUpdate&&(i.allowUpdate=i.allowCrud),void 0===i.allowDelete&&(i.allowDelete=i.allowCrud),void 0===i.allowInsert&&(i.allowInsert=i.allowCrud)),i.allowUpdate&&(this.allowUpdate=!0),i.allowDelete&&(this.allowDelete=!0),i.allowInsert&&(this.allowInsert=!0),i.showDataArea&&(this.showDataArea=i.showDataArea),void 0===i.showPagination&&(i.showPagination=!0),null!=i.numOfColumnsInGrid&&(this.columns.numOfColumnsInGrid=i.numOfColumnsInGrid),i.rowButtons&&(this._buttons=i.rowButtons),i.rowCssClass&&(this.rowClass=i.rowCssClass),i.saving&&(this.onSavingRow=i.saving),i.enterRow&&(this.onEnterRow=i.enterRow),i.newRow&&(this.onNewRow=i.newRow),i.validation&&(this.onValidate=i.validation),i.caption&&(this.caption=i.caption),!this.caption&&t&&(this.caption=t.metadata.caption),i.page&&(this.page=i.page),i.rowsInPage?this.rowsPerPage=i.rowsInPage:this.rowsPerPage=25,this.rowsPerPageOptions.indexOf(this.rowsPerPage)<0&&(this.rowsPerPageOptions.push(this.rowsPerPage),this.rowsPerPageOptions.sort((function(t,e){return+t-+e}))),i.orderBy&&(this._currentOrderBy=e.Sort.translateOrderByToSort(this.repository.metadata,this.settings.orderBy))}}return 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,l(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,i=new a((function(){return e.currentRow}),(function(){return e.allowUpdate}),this.filterHelper,(function(){return!!e.currentRow}),(function(t,i){return e.repository.getEntityRef(t).fields.find(i)}));return i.numOfColumnsInGrid=0,new y(t,i,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 e.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 i,n;if(e)if(this.lastSelectedRowWithShift){var r=!1;try{for(var s=o(this.items),l=s.next();!l.done;l=s.next()){var a=l.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){i={error:t}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.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,l(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=e.Sort.translateOrderByToSort(this.repository.metadata,t.orderBy)),this.page=1,this.reloadData()},t.prototype.sort=function(t){var i=!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,i=!0),i||(this._currentOrderBy=new e.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 n(this,void 0,void 0,(function(){var t,i,n=this;return r(this,(function(r){switch(r.label){case 0:return[4,this._internalBuildFindOptions()];case 1:return t=r.sent(),this.columns.autoGenerateColumnsBasedOnData(this.repository.metadata),i=this.restList.get(t).then((function(t){var i,r;return n.selectedRows=n.selectedRows.map((function(i){var n=e.getEntityRef(i).getId(),r=t.find((function(t){return e.getEntityRef(t).getId()==n}));return void 0!==r?r:i})),0==n.restList.items.length?n.setCurrentRow(void 0):n.setCurrentRow(n.restList.items[0]),(null===(i=n.settings)||void 0===i?void 0:i.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,i]}}))}))},t.prototype._internalBuildFindOptions=function(){return n(this,void 0,void 0,(function(){var t,i;return r(this,(function(n){switch(n.label){case 0:return t={},this.settings.where?(i=t,[4,e.Filter.resolve(this.settings.where)]):[3,2];case 1:i.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 n(this,void 0,void 0,(function(){var t;return r(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}),t}();t.DataAreaSettings=y,t.DataControl=function(t){return function(e,i){if(Reflect.defineMetadata(d,t,e,i),void 0===i)return e}},t.FieldCollection=a,t.GridSettings=m,t.InputField=h,t.configDataControlField=d,t.decorateDataSettings=p,t.getFieldDefinition=f,t.getValueList=function(t,e){return n(this,void 0,void 0,(function(){var i,n,s,l,a,u,h;return r(this,(function(r){switch(r.label){case 0:if(e||(e={}),e.idField||(e.idField=function(t){return t.idMetadata.field}),!e.captionField){i=e.idField(t.metadata),n=function(t){if(t!=i)return e.captionField=function(e){return e.fields.find(t)},"break"};try{for(s=o(t.metadata.fields),l=s.next();!l.done&&(a=l.value,"break"!==n(a));l=s.next());}catch(t){u={error:t}}finally{try{l&&!l.done&&(h=s.return)&&h.call(s)}finally{if(u)throw u.error}}}return[4,t.find({where:e.where,orderBy:e.orderBy,limit:1e3})];case 1:return[2,r.sent().map((function(i){return{id:t.getEntityRef(i).fields.find(e.idField(t.metadata)).value,caption:t.getEntityRef(i).fields.find(e.captionField(t.metadata)).value,entity:i}}))]}}))}))},t.valueOrEntityExpressionToValue=u,t.ɵa=v,Object.defineProperty(t,"__esModule",{value:!0})}));
***************************************************************************** */function n(t,e,i,n){return new(i||(i=Promise))((function(r,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function l(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,l)}a((n=n.apply(t,e||[])).next())}))}function r(t,e){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(o){return function(l){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=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++,n=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],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,l])}}}Object.create;function o(t){var e="function"==typeof Symbol&&Symbol.iterator,i=e&&t[e],n=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function s(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var n,r,o=i.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return s}function l(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(s(arguments[e]));return t}Object.create;var a=function(){function t(t,e,i,n,r){this.currentRow=t,this.allowUpdate=e,this.filterHelper=i,this.showArea=n,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,i){var n;if(t.field)return i&&(n=e.getEntityRef(i).fields.find(f(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,i){return t.visible(i,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,i){return t.allowClick(i,e)}))))},t.prototype.getRowColumn=function(t,e){var i,n=t.row;return this._getRowColumn&&t.col.field&&n&&(i=this._getRowColumn(n,f(t.col.field))),i||(i=t.col.field),!n&&i&&(n=i.container),e(i,n)},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 n(this,void 0,void 0,(function(){var e,i,n,s,l,a,u,h,c;return r(this,(function(r){switch(r.label){case 0:e=[];try{for(i=o(t),n=i.next();!n.done;n=i.next())(s=n.value)&&(void 0,a=s,u=s,(!(l=s).field&&a.valueConverter||u.metadata)&&(l={field:s}),l.field&&p(l.field,l),l.getValue&&l,e.push(this.buildDropDown(l)),this.items.push(l))}catch(t){h={error:t}}finally{try{n&&!n.done&&(c=i.return)&&c.call(i)}finally{if(h)throw h.error}}return[4,Promise.all(e)];case 1:return r.sent(),[2,Promise.resolve()]}}))}))},t.prototype.setContext=function(t){var e,i;this.remult=t;try{for(var n=o(this.doWhenWeHaveContext),r=n.next();!r.done;r=n.next()){(0,r.value)(t)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(i=n.return)&&i.call(n)}finally{if(e)throw e.error}}},t.prototype.buildDropDown=function(t){return n(this,void 0,void 0,(function(){var e,i,s,a,u,h,d,f,p,y,w,v,m,g,C=this;return r(this,(function(R){switch(R.label){case 0:if(!t.valueList)return[3,5];if(e=t.valueList,i=[],t.valueList=i,!(e instanceof Array))return[3,1];try{for(s=o(e),a=s.next();!a.done;a=s.next())u=a.value,"string"==(h=typeof u)||"number"==h?i.push({id:u,caption:u}):(d=u)&&null!=d.id&&i.push(d)}catch(t){m={error:t}}finally{try{a&&!a.done&&(g=s.return)&&g.call(s)}finally{if(m)throw m.error}}return[3,4];case 1:return"function"!=typeof e?[3,2]:(f=e,p=function(e){return n(C,void 0,void 0,(function(){var n;return r(this,(function(r){switch(r.label){case 0:return[4,f(e)];case 1:return void 0===(n=r.sent())?t.valueList=void 0:i.push.apply(i,l(n)),c(i,t.field),[2]}}))}))},this.remult?p(this.remult):this.doWhenWeHaveContext.push((function(t){return n(C,void 0,void 0,(function(){return r(this,(function(e){return[2,p(t)]}))}))})),[3,4]);case 2:return w=(y=i.push).apply,v=[i],[4,e];case 3:w.apply(y,v.concat([l.apply(void 0,[R.sent()])])),R.label=4;case 4:c(i,t.field),R.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 i=this.items.indexOf(t),n=i+e;n<0||n>=this.items.length||(this.items.splice(i,1),this.items.splice(n,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||!u(t.readonly,e)))},t.prototype._click=function(t,e){this.getRowColumn({col:t,row:e},(function(e,i){t.click(i,e)}))},t.prototype._getColDisplayValue=function(t,e){var i,n,r;if(t.getValue)r=this.getRowColumn({row:e,col:t},(function(e,i){return t.getValue(i,e)}));else if(t.field){if(t.valueList)try{for(var s=o(t.valueList),l=s.next();!l.done;l=s.next()){var a=l.value;if(a.id==this.__getColumn(t,e).value)return a.caption}}catch(t){i={error:t}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.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,i;if(0==this.items.length&&t)try{for(var n=o(t.fields),r=n.next();!r.done;r=n.next()){var s=r.value;"id"==s.key&&s.valueType===String||this.add(s)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(i=n.return)&&i.call(n)}finally{if(e)throw e.error}}},t.prototype.__changeWidth=function(t,e){var i=t.width;i||(i="50"),i=(+i+e).toString(),t.width=i},t.prototype._colValueChanged=function(t,e){return this.getRowColumn({col:t,row:e},(function(e,n){if(t.valueList){var r=t.valueList.find((function(t){return t.id==e.inputValue}));(null==r?void 0:r.entity)&&i.getEntitySettings(f(t.field).valueType,!1)&&(e.value=r.entity)}if(!t.valueChange)return!1;t.valueChange(n,e)}))},t.prototype.augment=function(t,e){this.augmented.get(e)||(t(f(e.field),e),this.augmented.set(e,!0))},t.prototype._initColumnsArrays=function(t){var e,i;if(this._lastColumnCount!=this.items.length||this._lastNumOfColumnsInGrid!=this.numOfColumnsInGrid){this._lastNumOfColumnsInGrid=this.numOfColumnsInGrid,this._lastColumnCount=this.items.length,this.gridColumns=[],this.nonGridColumns=[];var n=0;try{for(var r=o(this.items),s=r.next();!s.done;s=r.next()){var l=s.value;this.augment(t,l),n++<this._lastNumOfColumnsInGrid?this.gridColumns.push(l):this.nonGridColumns.push(l)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(i=r.return)&&i.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}();function u(t,e){return"function"==typeof t?t(e):t}var h=function(){function t(t){var o=this;t.dbName||(t.dbName=t.key),this.options=i.decorateColumnSettings(t,t.remult),this.dataControl=t,!this.dataControl.valueList&&this.options.valueConverter instanceof e.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 s=this.options.valueConverter?this.options.valueConverter:void 0;s&&(t.inputType||(t.inputType=s.inputType)),this.metadata={allowNull:t.allowNull,caption:t.caption,options:this.options,valueConverter:s,valueType:t.valueType,key:t.key,dbName:t.dbName,dbReadOnly:!1,inputType:t.inputType,isServerExpression:!1,getDbName:function(){return n(o,void 0,void 0,(function(){return r(this,(function(e){return[2,t.dbName]}))}))},target:void 0}}return t.prototype.validate=function(){return n(this,void 0,void 0,(function(){return r(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 c(t,e){var i=f(e);(null==i?void 0:i.valueType)===Number&&t.splice.apply(t,l([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 d=Symbol("configDataControlField");function f(t){if(t){var e=t,i=t;return i.metadata&&(e=i.metadata),e}}function p(t,i){var n;if(t instanceof h)for(var r in t.dataControl)if(Object.prototype.hasOwnProperty.call(t.dataControl,r)){var o=t.dataControl[r];void 0===i[r]&&(i[r]=o)}var s,l=f(t);if(l.target&&(s=Reflect.getMetadata(d,l.target,l.key)))for(var r in s)if(Object.prototype.hasOwnProperty.call(s,r)){o=s[r];void 0===i[r]&&(i[r]=o)}if(l.valueType&&(s=Reflect.getMetadata(d,l.valueType)))for(var r in s)if(Object.prototype.hasOwnProperty.call(s,r)){o=s[r];void 0===i[r]&&(i[r]=o)}void 0===i.valueList&&l&&l.valueConverter instanceof e.ValueListInfo&&(i.valueList=l.valueConverter.getValues()),!i.caption&&l.caption&&(i.caption=l.caption),!i.inputType&&l.inputType&&(i.inputType=l.inputType),null==i.readonly&&(l.dbReadOnly&&(i.readonly=!0),"boolean"==typeof(null===(n=l.options)||void 0===n?void 0:n.allowApiUpdate)&&(i.readonly=!l.options.allowApiUpdate))}var y=function(t,e,i){var n,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 s=o(t.fields(i)),u=s.next();!u.done;u=s.next()){var h=u.value;if(Array.isArray(h)){var c=e.items.length;e.add.apply(e,l(h));for(var d=[],f=c;f<e.items.length;f++)d.push(e.items[f]);this.lines.push(d)}else e.add(h),(c=e.items[e.items.length-1]).width="",this.lines.push([c])}}catch(t){n={error:t}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}},w=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,i=++this.lastGetId;return this.repository.find(t).then((function(t){var n=t.map((function(t){return e.map(t)}));return i==e.lastGetId&&(e.items=n),n}))},t.prototype.add=function(){var t=this.map(this.repository.create());return this.items.push(t),t},t}(),v=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(f(t))>=0},t.prototype.filterColumn=function(t,e,i){var n=f(t);n&&(e?(this.filterColumns.splice(this.filterColumns.indexOf(n,1),1),this.forceEqual.splice(this.forceEqual.indexOf(n,1),1)):this.filterColumns.indexOf(n)<0&&(this.filterColumns.push(n),!1===i&&this.forceEqual.push(n)),this.reloadData())},t.prototype.addToFindOptions=function(t){var n=this;this.filterColumns.forEach((function(r){var o,s=n.filterRow[r.key],l=s;if(r.valueType==Number||r.valueType==Date||r.valueType==Boolean||null!=i.getEntitySettings(r.valueType,!1)||n.forceEqual.find((function(t){return r.key==t.key}))){if(r.valueType==Date&&s){var a=s;l={$gte:a=new Date(a.getFullYear(),a.getMonth(),a.getDate()),$lt:new Date(a.getFullYear(),a.getMonth(),a.getDate()+1)}}}else l={$contains:e.getEntityRef(n.filterRow).fields[r.key].inputValue};var u=((o={})[r.key]=l,o);if(t.where){var h=t.where;t.where={$and:[h,u]}}else t.where=u}))},t}(),m=function(){function t(t,i){var o,s=this;if(this.repository=t,this.settings=i,this.showSelectColumn=!1,this.allowUpdate=!1,this.allowInsert=!1,this.allowDelete=!1,this.showDataArea=!1,this._buttons=[],this.filterHelper=new v((function(){s.page=1,s.reloadData()}),this.repository),this.page=1,this.selectedRows=[],this._selectedAll=!1,this.rowsPerPageOptions=[10,25,50,100],i||(this.settings=i={}),this.restList=new w(t),t&&(this.filterHelper.filterRow=t.create(),t.addEventListener({validating:function(t){return n(s,void 0,void 0,(function(){return r(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 s.currentRow}),(function(){return s.allowUpdate}),this.filterHelper,(function(){return!!s.currentRow}),(function(t,e){return s.repository.getEntityRef(t).fields.find(e)})),i){if(i.columnSettings){var u=i.columnSettings(t.metadata.fields);(o=this.columns).add.apply(o,l(u))}void 0!==i.allowCrud&&(void 0===i.allowUpdate&&(i.allowUpdate=i.allowCrud),void 0===i.allowDelete&&(i.allowDelete=i.allowCrud),void 0===i.allowInsert&&(i.allowInsert=i.allowCrud)),i.allowUpdate&&(this.allowUpdate=!0),i.allowDelete&&(this.allowDelete=!0),i.allowInsert&&(this.allowInsert=!0),i.showDataArea&&(this.showDataArea=i.showDataArea),void 0===i.showPagination&&(i.showPagination=!0),null!=i.numOfColumnsInGrid&&(this.columns.numOfColumnsInGrid=i.numOfColumnsInGrid),i.rowButtons&&(this._buttons=i.rowButtons),i.rowCssClass&&(this.rowClass=i.rowCssClass),i.saving&&(this.onSavingRow=i.saving),i.enterRow&&(this.onEnterRow=i.enterRow),i.newRow&&(this.onNewRow=i.newRow),i.validation&&(this.onValidate=i.validation),i.caption&&(this.caption=i.caption),!this.caption&&t&&(this.caption=t.metadata.caption),i.page&&(this.page=i.page),i.rowsInPage?this.rowsPerPage=i.rowsInPage:this.rowsPerPage=25,this.rowsPerPageOptions.indexOf(this.rowsPerPage)<0&&(this.rowsPerPageOptions.push(this.rowsPerPage),this.rowsPerPageOptions.sort((function(t,e){return+t-+e}))),i.orderBy&&(this._currentOrderBy=e.Sort.translateOrderByToSort(this.repository.metadata,this.settings.orderBy))}}return 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,l(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,i=new a((function(){return e.currentRow}),(function(){return e.allowUpdate}),this.filterHelper,(function(){return!!e.currentRow}),(function(t,i){return e.repository.getEntityRef(t).fields.find(i)}));return i.numOfColumnsInGrid=0,new y(t,i,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 e.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 i,n;if(e)if(this.lastSelectedRowWithShift){var r=!1;try{for(var s=o(this.items),l=s.next();!l.done;l=s.next()){var a=l.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){i={error:t}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.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,l(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=e.Sort.translateOrderByToSort(this.repository.metadata,t.orderBy)),this.page=1,this.reloadData()},t.prototype.sort=function(t){var i=!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,i=!0),i||(this._currentOrderBy=new e.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 n(this,void 0,void 0,(function(){var t,i,n=this;return r(this,(function(r){switch(r.label){case 0:return[4,this._internalBuildFindOptions()];case 1:return t=r.sent(),this.columns.autoGenerateColumnsBasedOnData(this.repository.metadata),i=this.restList.get(t).then((function(t){var i,r;return n.selectedRows=n.selectedRows.map((function(i){var n=e.getEntityRef(i).getId(),r=t.find((function(t){return e.getEntityRef(t).getId()==n}));return void 0!==r?r:i})),0==n.restList.items.length?n.setCurrentRow(void 0):n.setCurrentRow(n.restList.items[0]),(null===(i=n.settings)||void 0===i?void 0:i.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,i]}}))}))},t.prototype._internalBuildFindOptions=function(){return n(this,void 0,void 0,(function(){var t,i;return r(this,(function(n){switch(n.label){case 0:return t={},this.settings.where?(i=t,[4,e.Filter.resolve(this.settings.where)]):[3,2];case 1:i.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 n(this,void 0,void 0,(function(){var t;return r(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}),t}();t.DataAreaSettings=y,t.DataControl=function(t){return function(e,i){if(Reflect.defineMetadata(d,t,e,i),void 0===i)return e}},t.FieldCollection=a,t.GridSettings=m,t.InputField=h,t.configDataControlField=d,t.decorateDataSettings=p,t.getEntityValueList=function(t,e){return n(this,void 0,void 0,(function(){var i,n,s,l,a,u,h;return r(this,(function(r){switch(r.label){case 0:if(e||(e={}),e.idField||(e.idField=function(t){return t.idMetadata.field}),!e.captionField){i=e.idField(t.metadata),n=function(t){if(t!=i)return e.captionField=function(e){return e.fields.find(t)},"break"};try{for(s=o(t.metadata.fields),l=s.next();!l.done&&(a=l.value,"break"!==n(a));l=s.next());}catch(t){u={error:t}}finally{try{l&&!l.done&&(h=s.return)&&h.call(s)}finally{if(u)throw u.error}}}return[4,t.find({where:e.where,orderBy:e.orderBy,limit:1e3})];case 1:return[2,r.sent().map((function(i){return{id:t.getEntityRef(i).fields.find(e.idField(t.metadata)).value,caption:t.getEntityRef(i).fields.find(e.captionField(t.metadata)).value,entity:i}}))]}}))}))},t.getFieldDefinition=f,t.valueOrEntityExpressionToValue=u,t.ɵa=v,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=remult-angular-interfaces.umd.min.js.map

@@ -381,3 +381,3 @@ import { __awaiter } from "tslib";

/** returns an array of values that can be used in the value list property of a data control object */
export function getValueList(repository, args) {
export function getEntityValueList(repository, args) {
return __awaiter(this, void 0, void 0, function* () {

@@ -413,2 +413,2 @@ if (!args) {

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29sdW1uLWNvbGxlY3Rpb24uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9idWlsZC1hbmd1bGFyL3Byb2plY3RzL2FuZ3VsYXIvaW50ZXJmYWNlcy9zcmMvY29sdW1uLWNvbGxlY3Rpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUNBLE9BQU8sRUFBMkMsWUFBWSxFQUF3SSxhQUFhLEVBQUUsTUFBTSxRQUFRLENBQUM7QUFFcE8sT0FBTyxFQUF3QyxvQkFBb0IsRUFBRSxrQkFBa0IsRUFBMkIsTUFBTSwyQkFBMkIsQ0FBQztBQUVwSixPQUFPLEVBQUUsc0JBQXNCLEVBQUUsaUJBQWlCLEVBQWlCLE1BQU0sb0JBQW9CLENBQUM7QUFPOUYsTUFBTSxPQUFPLGVBQWU7SUFFMUIsWUFBbUIsVUFBcUIsRUFBVSxXQUEwQixFQUFTLFlBQW1DLEVBQVUsUUFBdUIsRUFBVSxhQUF1RTtRQUF2TixlQUFVLEdBQVYsVUFBVSxDQUFXO1FBQVUsZ0JBQVcsR0FBWCxXQUFXLENBQWU7UUFBUyxpQkFBWSxHQUFaLFlBQVksQ0FBdUI7UUFBVSxhQUFRLEdBQVIsUUFBUSxDQUFlO1FBQVUsa0JBQWEsR0FBYixhQUFhLENBQTBEO1FBMkRsTyxrQkFBYSxHQUFRLEVBQUUsQ0FBQztRQXNDeEIsd0JBQW1CLEdBQW9DLEVBQUUsQ0FBQztRQXNEbEUsZUFBVSxHQUFHLEtBQUssQ0FBQztRQUtuQiw0QkFBdUIsR0FBbUIsRUFBRSxDQUFDO1FBNEk3QyxVQUFLLEdBQTBCLEVBQUUsQ0FBQztRQUdsQyx1Qk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GNvbCwgcm93IH0sIChjLCByb3cpID0+IGNvbC5hbGxvd0NsaWNrKHJvdywgYykpO1xyXG4gIH1cclxuICBnZXRSb3dDb2x1bW48VD4oYXJnczogeyBjb2w6IERhdGFDb250cm9sU2V0dGluZ3M8YW55Piwgcm93OiBhbnkgfSwgd2hhdDogKGM6IEZpZWxkUmVmPGFueSwgYW55Piwgcm93OiBhbnkpID0+IFQpIHtcclxuICAgIGxldCBmaWVsZDogRmllbGRSZWY8YW55LCBhbnk+O1xyXG4gICAgbGV0IHJvdyA9IGFyZ3Mucm93O1xyXG4gICAgaWYgKHRoaXMuX2dldFJvd0NvbHVtbiAmJiBhcmdzLmNvbC5maWVsZCAmJiByb3cpIHtcclxuICAgICAgZmllbGQgPSB0aGlzLl9nZXRSb3dDb2x1bW4ocm93LCBnZXRGaWVsZERlZmluaXRpb24oYXJncy5jb2wuZmllbGQpKTtcclxuICAgIH1cclxuICAgIGlmICghZmllbGQpXHJcbiAgICAgIGZpZWxkID0gYXJncy5jb2wuZmllbGQgYXMgdW5rbm93biBhcyBGaWVsZFJlZjxhbnksIGFueT47XHJcbiAgICBpZiAoIXJvdyAmJiBmaWVsZClcclxuICAgICAgcm93ID0gZmllbGQuY29udGFpbmVyO1xyXG4gICAgcmV0dXJuIHdoYXQoZmllbGQsIHJvdyk7XHJcbiAgfVxyXG5cclxuICBfX2RhdGFDb250cm9sU3R5bGUobWFwOiBEYXRhQ29udHJvbFNldHRpbmdzKTogc3RyaW5nIHtcclxuXHJcbiAgICBpZiAobWFwLndpZHRoICYmIG1hcC53aWR0aC50cmltKCkubGVuZ3RoID4gMCkge1xyXG4gICAgICBpZiAoKCttYXAud2lkdGgpLnRvU3RyaW5nKCkgPT0gbWFwLndpZHRoKVxyXG4gICAgICAgIHJldHVybiBtYXAud2lkdGggKyBcInB4XCI7XHJcbiAgICAgIHJldHVybiBtYXAud2lkdGg7XHJcbiAgICB9XHJcbiAgICByZXR1cm4gdW5kZWZpbmVkO1xyXG5cclxu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W0gfSk7XHJcbiAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgbGV0IHggPSBpdGVtIGFzIFZhbHVlTGlzdEl0ZW07XHJcbiAgICAgICAgICAgIGlmICh4ICYmIHguaWQgIT0gdW5kZWZpbmVkKSB7XHJcbiAgICAgICAgICAgICAgcmVzdWx0LnB1c2goeCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgIH1cclxuICAgICAgZWxzZSBpZiAodHlwZW9mIG9yaWcgPT09IFwiZnVuY3Rpb25cIikge1xyXG4gICAgICAgIGxldCB0aGVGdW5jID0gb3JpZyBhcyAoKHJlbXVsdDogUmVtdWx0KSA9PiBQcm9taXNlPFZhbHVlTGlzdEl0ZW1bXT4pO1xyXG4gICAgICAgIGxldCB0b2RvID0gYXN5bmMgKHJlbXVsdDogUmVtdWx0KSA9PiB7XHJcbiAgICAgICAgICBsZXQgeCA9IGF3YWl0IHRoZUZ1bmMocmVtdWx0KTtcclxuICAgICAgICAgIGlmICh4ID09PSB1bmRlZmluZWQpXHJcbiAgICAgICAgICAgIHMudmFsdWVMaXN0ID0gdW5kZWZpbmVkO1xyXG4gICAgICAgICAgZWxzZVxyXG4gICAgICAgICAgICByZXN1bHQucHVzaCguLi54KTtcclxuICAgICAgICAgIGZpeFJlc3VsdChyZXN1bHQsIHMuZmllbGQpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAodGhpcy5yZW11bHQpIHtcclxuICAgICAgICAgIHRvZG8odGhpcy5yZW11bHQpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlXHJcbiAgICAgICAgICB0aGlzLmRvV2hlbldlSGF2ZUNvbnRleHQucHVzaChhc3luYyByZW11bHQgPT4gdG9kbyhyZW11bHQpKTtcclxuXHJcbiAgICAgIH1cclxuICAgICAgZWxzZSB7XHJcbiAgICAgICAgcmVzdWx0LnB1c2goLi4uKGF3YWl0IChvcmlnIGFzIChQcm9taXNlP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AgICBpZiAoY29sLnZpc2libGUgPT09IHVuZGVmaW5lZClcclxuICAgICAgcmV0dXJuIHRydWU7XHJcbiAgICByZXR1cm4gdGhpcy5nZXRSb3dDb2x1bW4oeyBjb2wsIHJvdyB9LCAoYywgcm93KSA9PiBjb2wudmlzaWJsZShyb3csIGMpKTtcclxuICB9XHJcbiAgYWxsb3dDbGljayhjb2w6IERhdGFDb250cm9sU2V0dGluZ3M8YW55LCBhbnk+LCByb3c6IGFueSkge1xyXG4gICAgaWYgKCFjb2wuY2xpY2spXHJcbiAgICAgIHJldHVybiBmYWxzZTtcclxuICAgIGlmICghdGhpcy5fZ2V0RWRpdGFibGUoY29sLCByb3cpKVxyXG4gICAgICByZXR1cm4gZmFsc2U7XHJcbiAgICBpZiAoY29sLmFsbG93Q2xpY2sgPT09IHVuZGVmaW5lZCkge1xyXG4gICAgICByZXR1cm4gdHJ1ZTtcclxuICAgIH1cclxuICAgIHJldHVybiB0aGlzLmdldFJvd0NvbHVtbih7IGNvbCwgcm93IH0sIChjLCByb3cpID0+IGNvbC5hbGxvd0NsaWNrKHJvdywgYykpO1xyXG4gIH1cclxuICBnZXRSb3dDb2x1bW48VD4oYXJnczogeyBjb2w6IERhdGFDb250cm9sU2V0dGluZ3M8YW55Piwgcm93OiBhbnkgfSwgd2hhdDogKGM6IEZpZWxkUmVmPGFueSwgYW55Piwgcm93OiBhbnkpID0+IFQpIHtcclxuICAgIGxldCBmaWVsZDogRmllbGRSZWY8YW55LCBhbnk+O1xyXG4gICAgbGV0IHJvdyA9IGFyZ3Mucm93O1xyXG4gICAgaWYgKHRoaXMuX2dldFJvd0NvbHVtbiAmJiBhcmdzLmNvbC5maWVsZCAmJiByb3cpIHtcclxuICAgICAgZmllbGQgPSB0aGlzLl9nZXRSb3dDb2x1bW4ocm93LCBnZXRGaWVsZERlZmluaXRpb24oYXJncy5jb2wuZmllbGQpKTtcclxuICAgIH1cclxuICAgIGlmICghZmllbGQpXHJcbiAgICAgIGZpZWxkID0g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DogRGF0YUNvbnRyb2xTZXR0aW5ncykgPT4gdm9pZDsiXX0=

@@ -381,3 +381,3 @@ import { getEntityRef, ValueListInfo, Sort, Filter } from 'remult';

/** returns an array of values that can be used in the value list property of a data control object */
function getValueList(repository, args) {
function getEntityValueList(repository, args) {
return __awaiter(this, void 0, void 0, function* () {

@@ -985,3 +985,3 @@ if (!args) {

export { DataAreaSettings, DataControl, FieldCollection, GridSettings, InputField, configDataControlField, decorateDataSettings, getFieldDefinition, getValueList, valueOrEntityExpressionToValue, FilterHelper as ɵa };
export { DataAreaSettings, DataControl, FieldCollection, GridSettings, InputField, configDataControlField, decorateDataSettings, getEntityValueList, getFieldDefinition, valueOrEntityExpressionToValue, FilterHelper as ɵa };
//# sourceMappingURL=remult-angular-interfaces.js.map

@@ -1,1 +0,1 @@

{"__symbolic":"module","version":4,"metadata":{"DataControlInfo":{"__symbolic":"interface"},"DataControlSettings":{"__symbolic":"interface"},"CustomDataComponent":{"__symbolic":"interface"},"CustomComponentArgs":{"__symbolic":"interface"},"configDataControlField":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"Symbol"},"arguments":["configDataControlField"]},"getFieldDefinition":{"__symbolic":"function"},"decorateDataSettings":{"__symbolic":"function"},"ValueOrEntityExpression":{"__symbolic":"interface"},"DataControl":{"__symbolic":"function","parameters":["settings"],"value":{"__symbolic":"error","message":"Lambda not supported","line":120,"character":11,"module":"./src/data-control-interfaces"}},"IDataAreaSettings":{"__symbolic":"interface"},"DataAreaSettings":{"__symbolic":"class","arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"any","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":14,"character":50,"context":{"typeName":"rowType"},"module":"./src/data-area-settings"}]},{"__symbolic":"reference","name":"FieldCollection"},{"__symbolic":"reference","name":"FieldsMetadata","module":"remult","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":14,"character":126,"context":{"typeName":"rowType"},"module":"./src/data-area-settings"}]}]}]}},"DataAreaFieldsSetting":{"__symbolic":"interface"},"GridSettings":{"__symbolic":"class","arity":1,"members":{"undoChanges":[{"__symbolic":"method"}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Repository","module":"remult","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":15,"character":45,"context":{"typeName":"rowType"},"module":"./src/grid-settings"}]},{"__symbolic":"reference","name":"any","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":15,"character":87,"context":{"typeName":"rowType"},"module":"./src/grid-settings"}]}]}],"initOrigList":[{"__symbolic":"method"}],"userChooseColumns":[{"__symbolic":"method"}],"resetColumns":[{"__symbolic":"method"}],"deleteCol":[{"__symbolic":"method"}],"addNewRow":[{"__symbolic":"method"}],"addArea":[{"__symbolic":"method"}],"setCurrentRow":[{"__symbolic":"method"}],"nextRow":[{"__symbolic":"method"}],"previousRowAllowed":[{"__symbolic":"method"}],"previousRow":[{"__symbolic":"method"}],"deleteCurentRow":[{"__symbolic":"method"}],"currentRowAsRestListItemRow":[{"__symbolic":"method"}],"getRowHelper":[{"__symbolic":"method"}],"cancelCurrentRowChanges":[{"__symbolic":"method"}],"deleteCurrentRowAllowed":[{"__symbolic":"method"}],"currentRowChanged":[{"__symbolic":"method"}],"saveCurrentRow":[{"__symbolic":"method"}],"_doSavingRow":[{"__symbolic":"method"}],"nextPage":[{"__symbolic":"method"}],"previousPage":[{"__symbolic":"method"}],"firstPage":[{"__symbolic":"method"}],"selectedChanged":[{"__symbolic":"method"}],"clickOnselectCheckboxFor":[{"__symbolic":"method"}],"isSelected":[{"__symbolic":"method"}],"selectAllIntermitent":[{"__symbolic":"method"}],"selectAllChecked":[{"__symbolic":"method"}],"selectAllChanged":[{"__symbolic":"method"}],"get":[{"__symbolic":"method"}],"sort":[{"__symbolic":"method"}],"sortedAscending":[{"__symbolic":"method"}],"sortedDescending":[{"__symbolic":"method"}],"reloadData":[{"__symbolic":"method"}],"_internalBuildFindOptions":[{"__symbolic":"method"}],"getFilterWithSelectedRows":[{"__symbolic":"method"}]}},"IDataSettings":{"__symbolic":"interface"},"RowButton":{"__symbolic":"interface"},"GridButton":{"__symbolic":"interface"},"FieldCollection":{"__symbolic":"class","arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Expression form not supported","line":14,"character":33,"module":"./src/column-collection"},{"__symbolic":"error","message":"Expression form not supported","line":14,"character":65,"module":"./src/column-collection"},{"__symbolic":"reference","name":"ɵa"},{"__symbolic":"error","message":"Expression form not supported","line":14,"character":142,"module":"./src/column-collection"},{"__symbolic":"error","message":"Expression form not supported","line":14,"character":180,"module":"./src/column-collection"}]}],"__showArea":[{"__symbolic":"method"}],"__getColumn":[{"__symbolic":"method"}],"__visible":[{"__symbolic":"method"}],"allowClick":[{"__symbolic":"method"}],"getRowColumn":[{"__symbolic":"method"}],"__dataControlStyle":[{"__symbolic":"method"}],"add":[{"__symbolic":"method"},{"__symbolic":"method"},{"__symbolic":"method"}],"setContext":[{"__symbolic":"method"}],"buildDropDown":[{"__symbolic":"method"}],"colListChanged":[{"__symbolic":"method"}],"onColListChange":[{"__symbolic":"method"}],"moveCol":[{"__symbolic":"method"}],"filterRows":[{"__symbolic":"method"}],"clearFilter":[{"__symbolic":"method"}],"_shouldShowFilterDialog":[{"__symbolic":"method"}],"deleteCol":[{"__symbolic":"method"}],"addCol":[{"__symbolic":"method"}],"_getEditable":[{"__symbolic":"method"}],"_click":[{"__symbolic":"method"}],"_getColDisplayValue":[{"__symbolic":"method"}],"_getColDataType":[{"__symbolic":"method"}],"_getColumnClass":[{"__symbolic":"method"}],"_getError":[{"__symbolic":"method"}],"autoGenerateColumnsBasedOnData":[{"__symbolic":"method"}],"__changeWidth":[{"__symbolic":"method"}],"_colValueChanged":[{"__symbolic":"method"}],"augment":[{"__symbolic":"method"}],"_initColumnsArrays":[{"__symbolic":"method"}],"getGridColumns":[{"__symbolic":"method"}],"getNonGridColumns":[{"__symbolic":"method"}]}},"valueOrEntityExpressionToValue":{"__symbolic":"function"},"InputField":{"__symbolic":"class","arity":1,"members":{"validate":[{"__symbolic":"method"}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Expression form not supported","line":367,"character":14,"module":"./src/column-collection"}]}],"subscribe":[{"__symbolic":"method"}],"valueIsNull":[{"__symbolic":"method"}],"originalValueIsNull":[{"__symbolic":"method"}],"load":[{"__symbolic":"method"}],"valueChanged":[{"__symbolic":"method"}]}},"getValueList":{"__symbolic":"function"},"ExtendedValueListItem":{"__symbolic":"interface"},"dataControlAugmenter":{"__symbolic":"interface"},"ɵa":{"__symbolic":"class","arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Expression form not supported","line":12,"character":34,"module":"./src/filter-helper"},{"__symbolic":"reference","name":"Repository","module":"remult","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":12,"character":77,"context":{"typeName":"rowType"},"module":"./src/filter-helper"}]}]}],"isFiltered":[{"__symbolic":"method"}],"filterColumn":[{"__symbolic":"method"}],"addToFindOptions":[{"__symbolic":"method"}]}}},"origins":{"DataControlInfo":"./src/data-control-interfaces","DataControlSettings":"./src/data-control-interfaces","CustomDataComponent":"./src/data-control-interfaces","CustomComponentArgs":"./src/data-control-interfaces","configDataControlField":"./src/data-control-interfaces","getFieldDefinition":"./src/data-control-interfaces","decorateDataSettings":"./src/data-control-interfaces","ValueOrEntityExpression":"./src/data-control-interfaces","DataControl":"./src/data-control-interfaces","IDataAreaSettings":"./src/data-area-settings","DataAreaSettings":"./src/data-area-settings","DataAreaFieldsSetting":"./src/data-area-settings","GridSettings":"./src/grid-settings","IDataSettings":"./src/grid-settings","RowButton":"./src/grid-settings","GridButton":"./src/grid-settings","FieldCollection":"./src/column-collection","valueOrEntityExpressionToValue":"./src/column-collection","InputField":"./src/column-collection","getValueList":"./src/column-collection","ExtendedValueListItem":"./src/column-collection","dataControlAugmenter":"./src/column-collection","ɵa":"./src/filter-helper"},"importAs":"@remult/angular/interfaces"}
{"__symbolic":"module","version":4,"metadata":{"DataControlInfo":{"__symbolic":"interface"},"DataControlSettings":{"__symbolic":"interface"},"CustomDataComponent":{"__symbolic":"interface"},"CustomComponentArgs":{"__symbolic":"interface"},"configDataControlField":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"Symbol"},"arguments":["configDataControlField"]},"getFieldDefinition":{"__symbolic":"function"},"decorateDataSettings":{"__symbolic":"function"},"ValueOrEntityExpression":{"__symbolic":"interface"},"DataControl":{"__symbolic":"function","parameters":["settings"],"value":{"__symbolic":"error","message":"Lambda not supported","line":120,"character":11,"module":"./src/data-control-interfaces"}},"IDataAreaSettings":{"__symbolic":"interface"},"DataAreaSettings":{"__symbolic":"class","arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"any","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":14,"character":50,"context":{"typeName":"rowType"},"module":"./src/data-area-settings"}]},{"__symbolic":"reference","name":"FieldCollection"},{"__symbolic":"reference","name":"FieldsMetadata","module":"remult","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":14,"character":126,"context":{"typeName":"rowType"},"module":"./src/data-area-settings"}]}]}]}},"DataAreaFieldsSetting":{"__symbolic":"interface"},"GridSettings":{"__symbolic":"class","arity":1,"members":{"undoChanges":[{"__symbolic":"method"}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Repository","module":"remult","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":15,"character":45,"context":{"typeName":"rowType"},"module":"./src/grid-settings"}]},{"__symbolic":"reference","name":"any","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":15,"character":87,"context":{"typeName":"rowType"},"module":"./src/grid-settings"}]}]}],"initOrigList":[{"__symbolic":"method"}],"userChooseColumns":[{"__symbolic":"method"}],"resetColumns":[{"__symbolic":"method"}],"deleteCol":[{"__symbolic":"method"}],"addNewRow":[{"__symbolic":"method"}],"addArea":[{"__symbolic":"method"}],"setCurrentRow":[{"__symbolic":"method"}],"nextRow":[{"__symbolic":"method"}],"previousRowAllowed":[{"__symbolic":"method"}],"previousRow":[{"__symbolic":"method"}],"deleteCurentRow":[{"__symbolic":"method"}],"currentRowAsRestListItemRow":[{"__symbolic":"method"}],"getRowHelper":[{"__symbolic":"method"}],"cancelCurrentRowChanges":[{"__symbolic":"method"}],"deleteCurrentRowAllowed":[{"__symbolic":"method"}],"currentRowChanged":[{"__symbolic":"method"}],"saveCurrentRow":[{"__symbolic":"method"}],"_doSavingRow":[{"__symbolic":"method"}],"nextPage":[{"__symbolic":"method"}],"previousPage":[{"__symbolic":"method"}],"firstPage":[{"__symbolic":"method"}],"selectedChanged":[{"__symbolic":"method"}],"clickOnselectCheckboxFor":[{"__symbolic":"method"}],"isSelected":[{"__symbolic":"method"}],"selectAllIntermitent":[{"__symbolic":"method"}],"selectAllChecked":[{"__symbolic":"method"}],"selectAllChanged":[{"__symbolic":"method"}],"get":[{"__symbolic":"method"}],"sort":[{"__symbolic":"method"}],"sortedAscending":[{"__symbolic":"method"}],"sortedDescending":[{"__symbolic":"method"}],"reloadData":[{"__symbolic":"method"}],"_internalBuildFindOptions":[{"__symbolic":"method"}],"getFilterWithSelectedRows":[{"__symbolic":"method"}]}},"IDataSettings":{"__symbolic":"interface"},"RowButton":{"__symbolic":"interface"},"GridButton":{"__symbolic":"interface"},"FieldCollection":{"__symbolic":"class","arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Expression form not supported","line":14,"character":33,"module":"./src/column-collection"},{"__symbolic":"error","message":"Expression form not supported","line":14,"character":65,"module":"./src/column-collection"},{"__symbolic":"reference","name":"ɵa"},{"__symbolic":"error","message":"Expression form not supported","line":14,"character":142,"module":"./src/column-collection"},{"__symbolic":"error","message":"Expression form not supported","line":14,"character":180,"module":"./src/column-collection"}]}],"__showArea":[{"__symbolic":"method"}],"__getColumn":[{"__symbolic":"method"}],"__visible":[{"__symbolic":"method"}],"allowClick":[{"__symbolic":"method"}],"getRowColumn":[{"__symbolic":"method"}],"__dataControlStyle":[{"__symbolic":"method"}],"add":[{"__symbolic":"method"},{"__symbolic":"method"},{"__symbolic":"method"}],"setContext":[{"__symbolic":"method"}],"buildDropDown":[{"__symbolic":"method"}],"colListChanged":[{"__symbolic":"method"}],"onColListChange":[{"__symbolic":"method"}],"moveCol":[{"__symbolic":"method"}],"filterRows":[{"__symbolic":"method"}],"clearFilter":[{"__symbolic":"method"}],"_shouldShowFilterDialog":[{"__symbolic":"method"}],"deleteCol":[{"__symbolic":"method"}],"addCol":[{"__symbolic":"method"}],"_getEditable":[{"__symbolic":"method"}],"_click":[{"__symbolic":"method"}],"_getColDisplayValue":[{"__symbolic":"method"}],"_getColDataType":[{"__symbolic":"method"}],"_getColumnClass":[{"__symbolic":"method"}],"_getError":[{"__symbolic":"method"}],"autoGenerateColumnsBasedOnData":[{"__symbolic":"method"}],"__changeWidth":[{"__symbolic":"method"}],"_colValueChanged":[{"__symbolic":"method"}],"augment":[{"__symbolic":"method"}],"_initColumnsArrays":[{"__symbolic":"method"}],"getGridColumns":[{"__symbolic":"method"}],"getNonGridColumns":[{"__symbolic":"method"}]}},"valueOrEntityExpressionToValue":{"__symbolic":"function"},"InputField":{"__symbolic":"class","arity":1,"members":{"validate":[{"__symbolic":"method"}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Expression form not supported","line":367,"character":14,"module":"./src/column-collection"}]}],"subscribe":[{"__symbolic":"method"}],"valueIsNull":[{"__symbolic":"method"}],"originalValueIsNull":[{"__symbolic":"method"}],"load":[{"__symbolic":"method"}],"valueChanged":[{"__symbolic":"method"}]}},"getEntityValueList":{"__symbolic":"function"},"ExtendedValueListItem":{"__symbolic":"interface"},"dataControlAugmenter":{"__symbolic":"interface"},"ɵa":{"__symbolic":"class","arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Expression form not supported","line":12,"character":34,"module":"./src/filter-helper"},{"__symbolic":"reference","name":"Repository","module":"remult","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":12,"character":77,"context":{"typeName":"rowType"},"module":"./src/filter-helper"}]}]}],"isFiltered":[{"__symbolic":"method"}],"filterColumn":[{"__symbolic":"method"}],"addToFindOptions":[{"__symbolic":"method"}]}}},"origins":{"DataControlInfo":"./src/data-control-interfaces","DataControlSettings":"./src/data-control-interfaces","CustomDataComponent":"./src/data-control-interfaces","CustomComponentArgs":"./src/data-control-interfaces","configDataControlField":"./src/data-control-interfaces","getFieldDefinition":"./src/data-control-interfaces","decorateDataSettings":"./src/data-control-interfaces","ValueOrEntityExpression":"./src/data-control-interfaces","DataControl":"./src/data-control-interfaces","IDataAreaSettings":"./src/data-area-settings","DataAreaSettings":"./src/data-area-settings","DataAreaFieldsSetting":"./src/data-area-settings","GridSettings":"./src/grid-settings","IDataSettings":"./src/grid-settings","RowButton":"./src/grid-settings","GridButton":"./src/grid-settings","FieldCollection":"./src/column-collection","valueOrEntityExpressionToValue":"./src/column-collection","InputField":"./src/column-collection","getEntityValueList":"./src/column-collection","ExtendedValueListItem":"./src/column-collection","dataControlAugmenter":"./src/column-collection","ɵa":"./src/filter-helper"},"importAs":"@remult/angular/interfaces"}

@@ -101,3 +101,3 @@ import { FieldMetadata, FieldRef, EntityMetadata, ValueListItem, EntityRef, FieldOptions, Remult, ValueConverter, Unobserve, Repository, EntityOrderBy, EntityFilter } from "remult";

/** returns an array of values that can be used in the value list property of a data control object */
export declare function getValueList<T>(repository: Repository<T>, args?: {
export declare function getEntityValueList<T>(repository: Repository<T>, args?: {
idField?: (e: EntityMetadata<T>) => FieldMetadata;

@@ -104,0 +104,0 @@ captionField?: (e: EntityMetadata<T>) => FieldMetadata;

{
"name": "@remult/angular",
"version": "0.13.5",
"version": "0.13.6",
"description": "an angular module for remult",

@@ -5,0 +5,0 @@ "homepage": "https://remult.dev/",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc