typescript-angular-utilities
Advanced tools
Comparing version 2.3.5 to 2.4.0
@@ -1,2 +0,2 @@ | ||
this.rl_utilities=function(t){function e(i){if(r[i])return r[i].exports;var n=r[i]={exports:{},id:i,loaded:!1};return t[i].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var r={};return e.m=t,e.c=r,e.p="output",e(0)}([function(t,e,r){"use strict";var i=r(1),n=r(2);e.behaviors=n;var o=r(4);e.filters=o;var a=r(11);e.services=a;var s=r(51);e.types=s,e.name="rl.utilities",i.module(e.name,[n.name,o.name,a.moduleName])},function(t,e){!function(){t.exports=this.angular}()},function(t,e,r){"use strict";var i=r(1),n=r(3);e.stopEventPropogation=n,e.name="rl.utilities.behaviors",i.module(e.name,[n.moduleName])},function(t,e,r){function i(){"use strict";return{restrict:"A",link:function(t,e,r){e.on(r.rlStopEventPropagation,function(t){t.preventDefault(),t.stopPropagation()})}}}var n=r(1);e.moduleName="rl.utilities.behaviors.stopEventPropogation",e.directiveName="rlStopEventPropagation",n.module(e.moduleName,[]).directive(e.directiveName,i)},function(t,e,r){function i(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}var n=r(1),o=r(5);e.isEmpty=o;var a=r(9);e.truncate=a,i(r(10)),e.name="rl.utilities.filters",n.module(e.name,[o.moduleName,a.moduleName])},function(t,e,r){"use strict";function i(t){return function(e,r){var i=t.isNullOrEmpty(e);return r===!1?!i:i}}var n=r(1),o=r(6);e.moduleName="rl.utilities.filters.isEmpty",e.serviceName="isEmpty",e.filterName=e.serviceName+"Filter",i.$inject=[o.serviceName],n.module(e.moduleName,[o.moduleName]).filter(e.serviceName,i)},function(t,e,r){"use strict";var i=r(1),n=r(7),o=r(8);e.moduleName="rl.utilities.services.object",e.serviceName="objectUtility";var a=function(){function t(t){this.array=t}return t.prototype.isNullOrEmpty=function(t){return null==t?!0:n.isArray(t)?n.any(t)===!1:n.isNumber(t)?n.isNaN(t):""===t},t.prototype.isNullOrWhitespace=function(t){return n.isString(t)&&(t=t.trim()),this.isNullOrEmpty(t)},t.prototype.areEqual=function(t,e){var r=this,i=typeof t,o=typeof e;if(null==t&&null==e)return!0;if(null==t||null==e)return!1;if(i!==o)return!1;if(t instanceof Array){if(t.length!==e.length)return!1;for(var a=0;a<t.length;a++)if(this.areEqual(t[a],e[a])===!1)return!1}else{if("object"!==i)return t===e;var s=n.keys(e);if(n.forIn(t,function(t,i){return n.has(e,i)?r.areEqual(t,e[i])===!1?!1:void r.array.remove(s,i):!1}),n.any(s))return!1}return!0},t.prototype.toString=function(t){return t+""},t.prototype.valueOrDefault=function(t,e){return null!=t?t:e},t.$inject=[o.serviceName],t}();i.module(e.moduleName,[o.moduleName]).service(e.serviceName,a)},function(t,e){!function(){t.exports=this._}()},function(t,e,r){"use strict";var i=r(1),n=r(7);e.moduleName="rl.utilities.services.array",e.serviceName="arrayUtility";var o=function(){function t(){}return t.prototype.findIndexOf=function(t,e){var r;return n.each(t,function(t,i){return e(t)?(r=i,!1):void 0}),null!=r?r:-1},t.prototype.remove=function(t,e){var r;return r=n.isFunction(e)?this.findIndexOf(t,e):n.indexOf(t,e),r>=0?t.splice(r,1)[0]:null},t.prototype.replace=function(t,e,r){var i=n.indexOf(t,e);i>=0&&t.splice(i,1,r)},t.prototype.sum=function(t,e){var r;return r=null!=e?n.map(t,function(t){return e(t)}):t,n.reduce(r,function(t,e){return t+e},0)},t.prototype.toDictionary=function(t,e){return n.reduce(t,function(t,r){return t[e(r)]=r,t},{})},t.prototype.last=function(t){return null!=t&&t.length>0?t[t.length-1]:void 0},t}();i.module(e.moduleName,[]).service(e.serviceName,o)},function(t,e,r){"use strict";function i(t){return function(e,r,i){i=null==i?!1:i;var n=t.isNullOrWhitespace(e)?"":e.toString();return n.length&&null!=r&&n.length>r&&(n=n.substring(0,r),i&&(n+="...")),n}}var n=r(1),o=r(6);e.moduleName="rl.utilities.filters.truncate",e.serviceName="truncate",e.filterName=e.serviceName+"Filter",i.$inject=[o.serviceName],n.module(e.moduleName,[o.moduleName]).filter(e.serviceName,i)},function(t,e){"use strict"},function(t,e,r){"use strict";var i=r(1),n=r(8);e.array=n;var o=r(12);e.autosave=o;var a=r(13);e.autosaveAction=a;var s=r(14);e["boolean"]=s;var u=r(15);e.dataContracts=u;var c=r(22);e.date=c;var l=r(29);e.fileSize=l;var m=r(33);e.genericSearchFilter=m;var f=r(35);e.guid=f;var h=r(23);e.moment=h;var p=r(38);e.notification=p;var v=r(30);e.number=v;var d=r(6);e.object=d;var y=r(41);e.observable=y;var g=r(42);e.parentChildBehavior=g;var N=r(43);e.promise=N;var S=r(34);e.string=S;var $=r(44);e.synchronizedRequests=$;var b=r(45);e.test=b;var D=r(25);e.time=D;var w=r(48);e.validation=w,e.moduleName="rl.utilities.services",i.module(e.moduleName,[n.moduleName,o.moduleName,a.moduleName,s.moduleName,u.moduleName,c.moduleName,l.moduleName,m.moduleName,f.moduleName,h.moduleName,p.moduleName,v.moduleName,d.moduleName,y.moduleName,g.moduleName,N.moduleName,S.moduleName,$.moduleName,D.moduleName,b.moduleName,w.moduleName])},function(t,e,r){"use strict";function i(t,e,r){return{getInstance:function(i){return new s(t,e,r,i)}}}var n=r(1),o=r(7),a=r(13);e.moduleName="rl.utilities.services.autosave",e.factoryName="autosaveFactory";var s=function(){function t(t,e,r,i){var n=this;this.$timeout=e,this.autosaveService=r,this.debounceDuration=1e3,this.autosave=function(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];if(n.contentForm.$pristine)return!0;var r=!0;if(n.hasValidator&&(r=n.validate(),void 0===r&&(r=!0)),r){var i=n.save.apply(n,t);return o.isUndefined(i)||n.autosaveService.trigger(i.then(function(){null!=n.contentForm&&n.contentForm.$setPristine()})),!0}return!1},this.hasValidator=null!=i.validate,this.contentForm=i.contentForm||this.nullForm(),this.save=i.save,this.validate=i.validate,this.initChangeListeners(i),t.$watch(function(){return n.contentForm.$dirty},function(t){t&&(n.setTimer(),n.clearChangeListener=n.setChangeListener(function(){e.cancel(n.timer),n.setTimer()}))})}return t.prototype.setTimer=function(){var t=this;this.timer=this.$timeout(function(){t.clearChangeListener(),t.autosave()},this.debounceDuration)},t.prototype.nullForm=function(){return{$pristine:!1,$dirty:!0,$setPristine:function(){}}},t.prototype.initChangeListeners=function(t){this.setChangeListener=t.setChangeListener||this.nullSetListener,this.clearChangeListener=this.nullClearListener},t.prototype.nullSetListener=function(){return console.log("No change listener available"),this.nullClearListener},t.prototype.nullClearListener=function(){console.log("No change listener register")},t}();i.$inject=["$rootScope","$timeout",a.serviceName],n.module(e.moduleName,[a.moduleName]).factory(e.factoryName,i)},function(t,e,r){"use strict";var i=r(1);e.moduleName="rl.utilities.services.autosaveAction",e.serviceName="autosaveAction";var n=function(){function t(t){var e=this;this.$timeout=t,this.completeMessageDuration=1e3,this.autosaveSuccessful=function(t){return e.resolveAutosave(t,!0)},this.autosaveFailed=function(t){return e.resolveAutosave(t,!1)},this.resolveAutosave=function(t,r){return e._saving=!1,e._complete=!0,e._successful=r,e.$timeout(function(){e._complete=!1},e.completeMessageDuration),t}}return Object.defineProperty(t.prototype,"saving",{get:function(){return this._saving},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"complete",{get:function(){return this._complete},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"successful",{get:function(){return this._successful},enumerable:!0,configurable:!0}),t.prototype.trigger=function(t){return this._saving=!0,t.then(this.autosaveSuccessful)["catch"](this.autosaveFailed)},t.$inject=["$timeout"],t}();i.module(e.moduleName,[]).service(e.serviceName,n)},function(t,e,r){"use strict";var i=r(1);e.moduleName="rl.utilities.services.boolean",e.serviceName="booleanUtility";var n=function(){function t(){}return t.prototype.toBool=function(t){return!!t},t}();i.module(e.moduleName,[]).service(e.serviceName,n)},function(t,e,r){"use strict";function i(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}var n=r(1),o=r(16),a=r(17),s=r(19);e.moduleName="rl.utilities.services.dataContracts",i(r(21));var u=r(17);e.BaseDataService=u.BaseDataService,e.baseDataServiceFactoryName=u.factoryName,i(r(18));var c=r(19);e.BaseSingletonDataService=c.BaseSingletonDataService,e.baseSingletonDataServiceFactoryName=c.factoryName,i(r(20));var l=r(16);e.builderServiceName=l.serviceName,n.module(e.moduleName,[a.moduleName,s.moduleName,o.moduleName])},function(t,e,r){"use strict";var i=r(1),n=r(8),o=r(17),a=r(18),s=r(19),u=r(20);e.moduleName="rl.utilities.services.baseResourceBuilder",e.serviceName="baseResourceBuilder";var c=function(){function t(t,e,r,i){this.$http=t,this.$q=e,this.$rootScope=r,this.array=i}return t.prototype.getLibraryServices=function(){return{$q:this.$q,$rootScope:this.$rootScope}},t.prototype.createResource=function(t){return t.useMock=null==t.endpoint?!0:t.useMock,new o.BaseDataService(this.$http,this.$q,this.array,t.endpoint,t.mockData,t.transform,t.useMock,t.logRequests)},t.prototype.createResourceView=function(t){var e=this.createResource(t);return e.AsSingleton=function(t){return{get:function(){return e.getDetail(t)},update:function(t){return e.update(t)},useMock:e.useMock,logRequests:e.logRequests}},e},t.prototype.createParentResource=function(t){return t.useMock=null==t.endpoint?!0:t.useMock,new a.BaseParentDataService(this.$http,this.$q,this.array,t.endpoint,t.mockData,t.resourceDictionaryBuilder,t.transform,t.useMock,t.logRequests)},t.prototype.createSingletonResource=function(t){return t.useMock=null==t.endpoint?!0:t.useMock,new s.BaseSingletonDataService(this.$http,this.$q,t.endpoint,t.mockData,t.transform,t.useMock,t.logRequests)},t.prototype.createParentSingletonResource=function(t){return t.useMock=null==t.endpoint?!0:t.useMock,new u.BaseParentSingletonDataService(this.$http,this.$q,t.endpoint,t.mockData,t.resourceDictionaryBuilder,t.transform,t.useMock,t.logRequests)},t.$inject=["$http","$q","$rootScope",n.serviceName],t}();e.BaseResourceBuilder=c,i.module(e.moduleName,[n.moduleName]).service(e.serviceName,c)},function(t,e,r){"use strict";function i(t,e,r){return{getInstance:function(i,n,o,a,u){return new s(t,e,r,i,n,o,a,u)}}}var n=r(1),o=r(7),a=r(8);e.moduleName="rl.utilities.services.baseDataService",e.factoryName="baseDataService";var s=function(){function t(t,e,r,i,n,o,a,s){this.$http=t,this.$q=e,this.array=r,this._endpoint=i,this.mockData=n,this.transform=o,this.useMock=a,this.logRequests=s}return Object.defineProperty(t.prototype,"endpoint",{get:function(){return this._endpoint},enumerable:!0,configurable:!0}),t.prototype.getItemEndpoint=function(t){return this.endpoint+"/"+t.toString()},t.prototype.getList=function(t){var e,r=this;return e=this.useMock?this.$q.when(this.mockData):this.$http.get(this.endpoint,{params:t}).then(function(t){return t.data}),e.then(function(t){return null!=r.transform&&(t=o.map(t,r.transform)),r.logRequests&&r.log("getList",t),t})},t.prototype.getDetail=function(t){var e,r=this;return e=this.useMock?this.$q.when(o.find(this.mockData,function(e){return e.id===t})):this.$http.get(this.getItemEndpoint(t)).then(function(t){return t.data}),e.then(function(t){return null!=r.transform&&(t=r.transform(t)),r.logRequests&&r.log("getDetail",t),t})},t.prototype.create=function(t){var e,r=this;if(this.useMock){var i=o.max(this.mockData,"id").id+1;t.id=i,this.mockData.push(t),e=this.$q.when(t)}else e=this.$http.post(this.endpoint,JSON.stringify(t)).then(function(t){return t.data});return e.then(function(t){return r.logRequests&&r.log("create",t),t})},t.prototype.update=function(t){var e,r=this;if(this.useMock){var i=o.find(this.mockData,o.find(this.mockData,function(e){return e.id===t.id}));i=o.assign(i,t),e=this.$q.when()}else e=this.$http.put(this.getItemEndpoint(t.id),t).then(function(){return null});return e.then(function(){r.logRequests&&r.log("update",t)})},t.prototype["delete"]=function(t){var e,r=this;return this.useMock?(this.array.remove(this.mockData,t),e=this.$q.when()):e=this.$http["delete"](this.getItemEndpoint(t.id)).then(function(){return null}),e.then(function(){r.logRequests&&r.log("update",t)})},t.prototype.log=function(t,e){var r=this.useMock?"Mocked ":"",i=null==this.endpoint?"unspecified":this.endpoint;console.log(r+t+" for endpoint "+i+":"),console.log(e)},t}();e.BaseDataService=s,i.$inject=["$http","$q",a.serviceName],e.baseDataServiceFactory=i,n.module(e.moduleName,[a.moduleName]).factory(e.factoryName,i)},function(t,e,r){var i=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},n=r(17),o=function(t){function e(e,r,i,n,o,a,s,u,c){t.call(this,e,r,i,n,o,s,u,c),this.resourceDictionaryBuilder=a}return i(e,t),e.prototype.childContracts=function(t){if(_.isUndefined(t))return this.resourceDictionaryBuilder(this.endpoint);var e=this.resourceDictionaryBuilder(this.endpoint+"/"+t);return _.mapValues(e,function(e){return _.isFunction(e.AsSingleton)?e.AsSingleton(t):e})},e}(n.BaseDataService);e.BaseParentDataService=o},function(t,e,r){"use strict";function i(t,e){return{getInstance:function(r,i,n,o,s){return new a(t,e,r,i,n,o,s)}}}var n=r(1),o=r(7);e.moduleName="rl.utilities.services.baseSingletonDataService",e.factoryName="baseSingletonDataService";var a=function(){function t(t,e,r,i,n,o,a){this.$http=t,this.$q=e,this._endpoint=r,this.mockData=i,this.transform=n,this.useMock=o,this.logRequests=a}return Object.defineProperty(t.prototype,"endpoint",{get:function(){return this._endpoint},enumerable:!0,configurable:!0}),t.prototype.get=function(){var t,e=this;return t=this.useMock?this.$q.when(this.mockData):this.$http.get(this.endpoint).then(function(t){return t.data}),t.then(function(t){return null!=e.transform&&(t=e.transform(t)),e.logRequests&&e.log("get",t),t})},t.prototype.update=function(t){var e,r=this;return this.useMock?(this.mockData=o.assign(this.mockData,t),e=this.$q.when()):e=this.$http.put(this.endpoint,t).then(function(){return null}),e.then(function(){r.logRequests&&r.log("update",t)})},t.prototype.log=function(t,e){var r=this.useMock?"Mocked ":"",i=null==this.endpoint?"unspecified":this.endpoint;console.log(r+t+" for endpoint "+i+":"),console.log(e)},t}();e.BaseSingletonDataService=a,i.$inject=["$http","$q"],e.baseSingletonDataServiceFactory=i,n.module(e.moduleName,[]).factory(e.factoryName,i)},function(t,e,r){var i=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},n=r(19),o=function(t){function e(e,r,i,n,o,a,s,u){t.call(this,e,r,i,n,a,s,u),this.resourceDictionaryBuilder=o}return i(e,t),e.prototype.childContracts=function(){return this.resourceDictionaryBuilder(this.endpoint)},e}(n.BaseSingletonDataService);e.BaseParentSingletonDataService=o},function(t,e){"use strict";var r=function(){function t(t){var e=t.getLibraryServices();this.$q=e.$q,this.$rootScope=e.$rootScope}return t.prototype.flush=function(){this.$rootScope.$digest()},t.prototype.mockGet=function(t,e){return this.baseMockGet(t,"get",e)},t.prototype.mockGetList=function(t,e){return this.baseMockGet(t,"getList",e)},t.prototype.mockGetDetail=function(t,e){return this.baseMockGet(t,"getDetail",e)},t.prototype.baseMockGet=function(t,e,r){var i=this,n=sinon||{spy:function(t){return t}},o=n.spy(function(){return i.$q.when(r)});return t[e]=o,o},t}();e.ContractLibrary=r},function(t,e,r){"use strict";function i(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}var n=r(1),o=r(23),a=r(25),s=r(26),u=r(28);i(r(26)),i(r(28)),e.moduleName="rl.utilities.services.date",n.module(e.moduleName,[o.moduleName,a.moduleName]).service(s.serviceName,s.DateUtility).value(u.dateTimeFormatServiceName,u.defaultFormats)},function(t,e,r){"use strict";function i(){var t=o;return t.createFromInputFallback=function(t){t._d=new Date(t._i)},t}var n=r(1),o=r(24);e.moduleName="rl.utilities.services.momentWrapper",e.serviceName="momentWrapper",e.momentWrapper=i,n.module(e.moduleName,[]).factory(e.serviceName,i)},function(t,e){!function(){t.exports=this.moment}()},function(t,e,r){"use strict";var i=r(1);e.moduleName="rl.utilities.services.time",e.serviceName="timeUtility";var n=function(){function t(){}return t.prototype.millisecondsToSeconds=function(t){return Math.floor(t/1e3)},t.prototype.millisecondsToMinutes=function(t){return Math.floor(this.millisecondsToSeconds(t)/60)},t.prototype.millisecondsToHours=function(t){return Math.floor(this.millisecondsToMinutes(t)/60)},t.prototype.millisecondsToDays=function(t){return Math.floor(this.millisecondsToHours(t)/24)},t}();e.TimeUtility=n,i.module(e.moduleName,[]).service(e.serviceName,n)},function(t,e,r){"use strict";var i=r(7),n=r(25),o=r(23),a=r(27);e.serviceName="dateUtility";var s=function(){function t(t,e){var r=this;this.moment=t,this.time=e,this.baseFormat="MM-DD-YYYY",this.month=[{name:"January",days:function(){return 31}},{name:"February",days:function(t){return r.isLeapYear(t)?29:28}},{name:"March",days:function(){return 31}},{name:"April",days:function(){return 30}},{name:"May",days:function(){return 31}},{name:"June",days:function(){return 30}},{name:"July",days:function(){return 31}},{name:"August",days:function(){return 31}},{name:"September",days:function(){return 30}},{name:"October",days:function(){return 31}},{name:"November",days:function(){return 30}},{name:"December",days:function(){return 31}}]}return t.prototype.isLeapYear=function(t){return 1===new Date(t,1,29).getMonth()},t.prototype.getFullString=function(t){return this.month[t].name},t.prototype.getDays=function(t,e){return this.month[t].days(e)},t.prototype.subtractDates=function(t,e,r){if(null==t||null==e)return null;var i=this.getDate(t,r),n=this.getDate(e,r),o={};return o.days=n.getDate()-i.getDate(),o.years=n.getFullYear()-i.getFullYear(),o.months=n.getMonth()-i.getMonth(),o.days<0&&(o.months-=1,o.days+=this.getDays(i.getMonth(),i.getFullYear())),o.months<0&&(o.years-=1,o.months+=12),o},t.prototype.subtractDateInDays=function(t,e,r){var i=this.subtractDateInMilliseconds(t,e,r);return this.time.millisecondsToDays(i)},t.prototype.subtractDateInMilliseconds=function(t,e,r){if(null==t||null==e)return null;var i=this.getDate(t,r),n=this.getDate(e,r);return n.getTime()-i.getTime()},t.prototype.compareDates=function(t,e,r){var i=this.subtractDateInMilliseconds(e,t,r);return a.getCompareResult(i)},t.prototype.dateInRange=function(t,e,r){return this.compareDates(t,e)===a.CompareResult.less?!1:this.compareDates(t,r)===a.CompareResult.greater?!1:!0},t.prototype.getDate=function(t,e){return i.isDate(t)?t:this.moment(t,this.format(e)).toDate()},t.prototype.getDateFromISOString=function(t){return this.moment(t).toDate()},t.prototype.isDate=function(t,e){return i.isDate(t)||this.moment(t,this.format(e)).isValid()},t.prototype.getNow=function(){return new Date},t.prototype.format=function(t){return null!=t?t:this.baseFormat},t.$inject=[o.serviceName,n.serviceName],t}();e.DateUtility=s},function(t,e){"use strict";function r(t){return 0===t?i.equal:t>0?i.greater:i.less}!function(t){t[t.greater=1]="greater",t[t.equal=0]="equal",t[t.less=-1]="less"}(e.CompareResult||(e.CompareResult={}));var i=e.CompareResult;e.getCompareResult=r},function(t,e){"use strict";e.dateTimeFormatServiceName="dateTimeFormatStrings",e.defaultFormats={dateTimeFormat:"M/D/YYYY h:mm A",dateFormat:"M/D/YYYY",timeFormat:"h:mmA"}},function(t,e,r){"use strict";function i(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}var n=r(1),o=r(30),a=r(31),s=r(32);i(r(31)),i(r(32)),e.moduleName="rl.utilities.services.fileSize",n.module(e.moduleName,[o.moduleName]).factory(a.factoryName,a.fileSizeFactory).filter(s.simpleFilterName,s.fileSizeFilter)},function(t,e,r){"use strict";var i=r(1);e.moduleName="rl.utilities.services.number",e.serviceName="numberUtility";var n;!function(t){t[t.positive=1]="positive",t[t.negative=-1]="negative"}(n||(n={}));var o=function(){function t(){}return t.prototype.preciseRound=function(t,e){var r=t>=0?n.positive:n.negative;return Math.round(t*Math.pow(10,e)+.001*r)/Math.pow(10,e)},t.prototype.integerDivide=function(t,e){return Math.floor(t/e)},t.prototype.roundToStep=function(t,e){if(!e)return t;var r=t%e;return r>=e/2?t+(e-r):t-r},t}();i.module(e.moduleName,[]).service(e.serviceName,o)},function(t,e,r){"use strict";function i(t){return{getInstance:function(e){return new o(t,e)}}}var n=r(30);e.factoryName="fileSizeFactory";var o=function(){function t(t,e){this.BYTES_PER_GB=1073741824,this.BYTES_PER_MB=1048576,this.BYTES_PER_KB=1024,this.bytes=e,e>=this.BYTES_PER_GB?(this.isGB=!0,this.GB=e/this.BYTES_PER_GB,this.GB=t.preciseRound(this.GB,1)):(this.isGB=!1,e>=this.BYTES_PER_MB?(this.isMB=!0,this.MB=e/this.BYTES_PER_MB,this.MB=t.preciseRound(this.MB,1)):(this.isMB=!1,e>=this.BYTES_PER_KB?(this.isKB=!0,this.KB=e/this.BYTES_PER_KB,this.KB=t.preciseRound(this.KB,1)):this.isKB=!1)),this.bytes=Math.round(this.bytes)}return t.prototype.display=function(){return this.isGB?this.GB+" GB":this.isMB?this.MB+" MB":this.isKB?this.KB+" KB":this.bytes+" bytes"},t}();i.$inject=[n.serviceName],e.fileSizeFactory=i},function(t,e,r){"use strict";function i(t){return function(e){var r=t.getInstance(e);return r.display()}}var n=r(31);e.simpleFilterName="fileSize",e.filterName=e.simpleFilterName+"Filter",i.$inject=[n.factoryName],e.fileSizeFilter=i},function(t,e,r){"use strict";function i(t,e){return{getInstance:function(){return new u(t,e)}}}var n=r(1),o=r(7),a=r(6),s=r(34);e.moduleName="rl.utilities.services.genericSearchFilter",e.factoryName="genericSearchFilterFactory",e.filterName="search";var u=function(){function t(t,r){this.object=t,this.string=r,this.type=e.filterName,this.minSearchLength=1,this.caseSensitive=!1}return t.prototype.filter=function(t){return this.object.isNullOrEmpty(this.searchText)||this.searchText.length<this.minSearchLength?!0:this.searchObject(t,this.searchText,this.caseSensitive)},t.prototype.searchObject=function(t,e,r){var i=this;if(o.isObject(t)){var n=o.values(t);return o.any(n,function(t){return i.searchObject(t,e,r)})}var a=this.object.toString(t);return r||(e=e.toLowerCase(),a=a.toLowerCase()),this.string.contains(a,e)},t}();e.GenericSearchFilter=u,i.$inject=[a.serviceName,s.serviceName],n.module(e.moduleName,[a.moduleName,s.moduleName]).factory(e.factoryName,i)},function(t,e,r){"use strict";var i=r(1),n=r(7);e.moduleName="rl.utilities.services.string",e.serviceName="stringUtilityService";var o=function(){function t(){}return t.prototype.toNumber=function(t){return+t},t.prototype.contains=function(t,e){return e?-1!==t.indexOf(e):!0},t.prototype.substitute=function(t){for(var e=this,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];return n.each(r,function(r,i){t=e.replaceAll(t,"\\{"+i+"\\}",r)}),t},t.prototype.replaceAll=function(t,e,r){return t.replace(new RegExp(e,"gi"),r)},t}();e.StringUtilityService=o,i.module(e.moduleName,[]).service(e.serviceName,o)},function(t,e,r){"use strict";var i=r(1),n=r(36);e.moduleName="rl.utilities.services.guid",e.serviceName="guidService";var o=function(){function t(){}return t.prototype.time=function(){return n.v1()},t.prototype.random=function(){return n.v4()},t}();i.module(e.moduleName,[]).service(e.serviceName,o)},function(t,e,r){function i(t,e,r){var i=e&&r||0,n=0;for(e=e||[],t.toLowerCase().replace(/[0-9a-f]{2}/g,function(t){16>n&&(e[i+n++]=c[t])});16>n;)e[i+n++]=0;return e}function n(t,e){var r=e||0,i=u;return i[t[r++]]+i[t[r++]]+i[t[r++]]+i[t[r++]]+"-"+i[t[r++]]+i[t[r++]]+"-"+i[t[r++]]+i[t[r++]]+"-"+i[t[r++]]+i[t[r++]]+"-"+i[t[r++]]+i[t[r++]]+i[t[r++]]+i[t[r++]]+i[t[r++]]+i[t[r++]]}function o(t,e,r){var i=e&&r||0,o=e||[];t=t||{};var a=void 0!==t.clockseq?t.clockseq:h,s=void 0!==t.msecs?t.msecs:(new Date).getTime(),u=void 0!==t.nsecs?t.nsecs:v+1,c=s-p+(u-v)/1e4;if(0>c&&void 0===t.clockseq&&(a=a+1&16383),(0>c||s>p)&&void 0===t.nsecs&&(u=0),u>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");p=s,v=u,h=a,s+=122192928e5;var l=(1e4*(268435455&s)+u)%4294967296;o[i++]=l>>>24&255,o[i++]=l>>>16&255,o[i++]=l>>>8&255,o[i++]=255&l;var m=s/4294967296*1e4&268435455;o[i++]=m>>>8&255,o[i++]=255&m,o[i++]=m>>>24&15|16,o[i++]=m>>>16&255,o[i++]=a>>>8|128,o[i++]=255&a;for(var d=t.node||f,y=0;6>y;y++)o[i+y]=d[y];return e?e:n(o)}function a(t,e,r){var i=e&&r||0;"string"==typeof t&&(e="binary"==t?new Array(16):null,t=null),t=t||{};var o=t.random||(t.rng||s)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e)for(var a=0;16>a;a++)e[i+a]=o[a];return e||n(o)}for(var s=r(37),u=[],c={},l=0;256>l;l++)u[l]=(l+256).toString(16).substr(1),c[u[l]]=l;var m=s(),f=[1|m[0],m[1],m[2],m[3],m[4],m[5]],h=16383&(m[6]<<8|m[7]),p=0,v=0,d=a;d.v1=o,d.v4=a,d.parse=i,d.unparse=n,t.exports=d},function(t,e){(function(e){var r;if(e.crypto&&crypto.getRandomValues){var i=new Uint8Array(16);r=function(){return crypto.getRandomValues(i),i}}if(!r){var n=new Array(16);r=function(){for(var t,e=0;16>e;e++)0===(3&e)&&(t=4294967296*Math.random()),n[e]=t>>>((3&e)<<3)&255;return n}}t.exports=r}).call(e,function(){return this}())},function(t,e,r){"use strict";function i(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}function n(){var t=this,e={notifier:new a.BaseNotifier,setNotifier:function(e){t.notifier=e},$get:function(){return new s(t.notifier)}};return e}var o=r(1),a=r(39);i(r(40)),e.moduleName="rl.utilities.services.notification",e.serviceName="notification";var s=function(){function t(t){this.notifier=t}return t.prototype.info=function(t){this.notifier.info(t)},t.prototype.warning=function(t){this.notifier.warning(t)},t.prototype.error=function(t){this.notifier.error(t)},t.prototype.success=function(t){this.notifier.success(t)},t}();e.NotificationService=s,e.notificationServiceProvider=n,o.module(e.moduleName,[]).provider(e.serviceName,n)},function(t,e){"use strict";var r=function(){function t(){}return t.prototype.info=function(t){this.notify(t)},t.prototype.warning=function(t){this.notify(t)},t.prototype.error=function(t){this.notify(t)},t.prototype.success=function(t){this.notify(t)},t.prototype.notify=function(t){window.alert(t),console.log(t)},t}();e.BaseNotifier=r},function(t,e){"use strict"},function(t,e,r){"use strict";function i(){return{getInstance:function(){return new a}}}var n=r(1),o=r(7);e.moduleName="rl.utilities.services.observable",e.factoryName="observableFactory";var a=function(){function t(){this.watchers=[],this.nextKey=0}return t.prototype.register=function(t,e){var r=this;if(!o.isFunction(t))return console.log("Error: watcher must be a function"),null;var i=this.nextKey;return this.nextKey++,this.watchers[i]={action:t,event:e},function(){r.unregister(i)}},t.prototype.fire=function(t){for(var e=this,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];return o(this.watchers).filter(function(e){return null!=e&&e.event===t}).map(function(t){return t.action.apply(e,r)}).value()},t.prototype.unregister=function(t){this.watchers[t]=null},t}();e.ObservableService=a,e.observableServiceFactory=i,n.module(e.moduleName,[]).factory(e.factoryName,i)},function(t,e,r){"use strict";var i=r(1);e.moduleName="rl.utilities.services.parentChildBehavior",e.serviceName="parentChildBehavior";var n=function(){function t(){}return t.prototype.getChildBehavior=function(t){return t&&null!=t.viewData?t.viewData.behavior:null},t.prototype.triggerChildBehavior=function(t,e){var r=this.getChildBehavior(t);return null==r?null:e(r)},t.prototype.triggerAllChildBehaviors=function(t,e){var r=this.getAllChildBehaviors(t);return _.map(r,function(t){return e(t)})},t.prototype.getAllChildBehaviors=function(t){var e=this;return _(t).map(function(t){return e.getChildBehavior(t)}).filter(function(t){return null!=t}).value()},t.prototype.registerChildBehavior=function(t,e){if(null!=t){null==t.viewData&&(t.viewData={behavior:null});var r=t.viewData.behavior;null==r?t.viewData.behavior=e:t.viewData.behavior=_.extend(r,e)}},t}();e.ParentChildBehaviorService=n,i.module(e.moduleName,[]).service(e.serviceName,n)},function(t,e,r){"use strict";var i=r(1),n=r(7);e.moduleName="rl.utilities.services.promise",e.serviceName="promiseUtility";var o=function(){function t(t,e){this.$q=t,this.$injector=e}return t.prototype.isPromise=function(t){return n.isObject(t)&&n.isFunction(t.then)&&n.isFunction(t["catch"])},t.prototype.resolvePromises=function(t){var e=this,r={};return n.each(t,function(t,i){n.isFunction(t)||n.isArray(t)?r[i]=e.$q.when(e.$injector.invoke(t)):n.isString(t)?r[i]=e.$q.when(e.$injector.get(t)):r[i]=e.$q.when(t)}),this.$q.all(r)},t.$inject=["$q","$injector"],t}();i.module(e.moduleName,[]).service(e.serviceName,o)},function(t,e,r){"use strict";function i(t){return{getInstance:function(e,r){return new o(e,r,t)}}}var n=r(1);e.moduleName="rl.utilities.services.synchronizedRequests",e.factoryName="synchronizedRequests";var o=function(){function t(t,e,r){this.dataProvider=t,this.handleRequest=e,this.$q=r,this.requestId=0}return t.prototype.getData=function(){for(var t=this,e=[],r=0;r<arguments.length;r++)e[r-0]=arguments[r];this.requestId++;var i=this.requestId;this.$q.when(this.dataProvider.apply(this,e)).then(function(){for(var e=[],r=0;r<arguments.length;r++)e[r-0]=arguments[r];i==t.requestId&&t.handleRequest.apply(t,e)})},t}();e.SynchronizedRequestsService=o,i.$inject=["$q"],e.synchronizedRequestsFactory=i,n.module(e.moduleName,[]).factory(e.factoryName,i)},function(t,e,r){function i(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}var n=r(1),o=r(46);e.mock=o,i(r(47)),e.moduleName="rl.utilities.services.test",n.module(e.moduleName,[o.moduleName])},function(t,e,r){"use strict";var i=r(7),n=r(1);e.moduleName="rl.utilities.services.test.mock",e.serviceName="mockUtility";var o=function(){function t(t,e){this.$q=t,this.$rootScope=e}return t.prototype.service=function(t){return i.isUndefined(t)&&(t={}),t._mock_requestList_=[],t},t.prototype.promise=function(t,e,r,n){var o=this;i.isUndefined(n)&&(n=!0),t[e]=sinon.spy(function(){var e=o.$q.defer();return t._mock_requestList_.push({promise:e,data:r,successful:n}),e.promise})},t.prototype.promiseWithCallback=function(t,e,r,n){var o=this;i.isUndefined(n)&&(n=!0),t[e]=sinon.spy(function(){for(var e=[],i=0;i<arguments.length;i++)e[i-0]=arguments[i];var a=o.$q.defer();return t._mock_requestList_.push({promise:a,data:r.apply(o,e),successful:n}),a.promise})},t.prototype.flush=function(t,e){var r=t._mock_requestList_;t._mock_requestList_=[],i.each(r,function(t){t.successful?t.promise.resolve(t.data):t.promise.reject(t.data),i.isUndefined(e)===!1&&e.$digest()}),this.$rootScope.$apply()},t.$inject=["$q","$rootScope"],t}();n.module(e.moduleName,[]).service(e.serviceName,o)},function(t,e,r){"use strict";var i=r(1);r(1);var n=r(7),o=function(){function t(){}return t.prototype.inject=function(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];var r={},o=n.clone(t);return o.push(function(){for(var e=[],i=0;i<arguments.length;i++)e[i-0]=arguments[i];n.each(t,function(t,i){r[t]=e[i]})}),i.mock.inject(o),r},t.prototype.mock=function(t){i.mock.module(function(e){n.each(t,function(t,r){e.value(r.toString(),t)})})},t.prototype.controllerWithBindings=function(t,e,r,i){var o=this.inject("$rootScope","$controller"),a=o.$rootScope,s=o.$controller;return i=n.extend(a.$new(),i),null==r&&(r={}),r.$scope=i,{scope:i,controller:s(t,r,e)}},t.prototype.directive=function(t,e,r){var i=this.inject("$rootScope","$compile");r=n.extend(i.$rootScope.$new(),r);var o=i.$compile,a=o(e)(r);return r.$digest(),{directive:a,scope:a.isolateScope(),controller:a.controller(t)}},t}();e.angularFixture=new o},function(t,e,r){"use strict";var i=r(1),n=r(38),o=r(49),a=r(50);e.moduleName="rl.utilities.services.validation",e.serviceName="validationFactory";var s=function(){function t(t){this.notification=t}return t.prototype.buildNotificationWarningValidator=function(){var t=this;return new o.Validator(function(e){t.notification.warning(e)})},t.prototype.buildNotificationErrorValidator=function(){var t=this;return new o.Validator(function(e){t.notification.error(e)})},t.prototype.buildCustomValidator=function(t){return new o.Validator(t); | ||
},t.prototype.buildCompositeNotificationWarningValidator=function(){var t=this;return new a.CompositeValidator(function(e){t.notification.warning(e)})},t.prototype.buildCompositeNotificationErrorValidator=function(){var t=this;return new a.CompositeValidator(function(e){t.notification.error(e)})},t.prototype.buildCompositeCustomValidator=function(t){return new a.CompositeValidator(t)},t.$inject=[n.serviceName],t}();e.ValidationService=s,i.module(e.moduleName,[n.moduleName]).service(e.serviceName,s)},function(t,e,r){"use strict";var i=r(7),n=function(){function t(t){this.showError=t,this.validationHandlers={},this.nextKey=0}return t.prototype.validate=function(){var t=this,e=!0;return i.each(this.validationHandlers,function(r){var i=t.isActive(r);if(i&&!r.validate()){e=!1;var n=t.errorMessage(r);return t.showError(n),!1}}),e},t.prototype.getErrorCount=function(){var t=this;return i.reduce(this.validationHandlers,function(e,r){var i=t.isActive(r);return i&&!r.validate()&&e++,e},0)},t.prototype.registerValidationHandler=function(t){var e=this,r=this.nextKey;return this.nextKey++,this.validationHandlers[r]=t,function(){e.unregister(r)}},t.prototype.unregister=function(t){delete this.validationHandlers[t]},t.prototype.isActive=function(t){return i.isFunction(t.isActive)&&t.isActive()||null==t.isActive||t.isActive===!0},t.prototype.errorMessage=function(t){return i.isFunction(t.errorMessage)?t.errorMessage():t.errorMessage},t}();e.Validator=n},function(t,e,r){"use strict";var i=r(7),n=r(49),o=function(){function t(t){this.showError=t,this.childValidators={},this.nextKey=0}return t.prototype.validate=function(){var t=!0;return i.each(this.childValidators,function(e){return e.validate()?void 0:(t=!1,!1)}),t},t.prototype.getErrorCount=function(){return i.reduce(this.childValidators,function(t,e){return t+=e.getErrorCount()},0)},t.prototype.buildChildValidator=function(){var t=this,e=new n.Validator(function(e){t.showError(e)}),r=this.nextKey;return this.nextKey++,this.childValidators[r]=e,e.key=r,e},t.prototype.unregisterChild=function(t){delete this.childValidators[t.key]},t}();e.CompositeValidator=o},function(t,e,r){"use strict";function i(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}i(r(27))}]); | ||
this.rl_utilities=function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="output",e(0)}([function(t,e,r){"use strict";var n=r(1),i=r(2);e.behaviors=i;var o=r(4);e.filters=o;var u=r(11);e.services=u;var a=r(49);e.types=a,e.name="rl.utilities",n.module(e.name,[i.name,o.name,u.moduleName])},function(t,e){!function(){t.exports=this.angular}()},function(t,e,r){"use strict";var n=r(1),i=r(3);e.stopEventPropogation=i,e.name="rl.utilities.behaviors",n.module(e.name,[i.moduleName])},function(t,e,r){function n(){"use strict";return{restrict:"A",link:function(t,e,r){e.on(r.rlStopEventPropagation,function(t){t.preventDefault(),t.stopPropagation()})}}}var i=r(1);e.moduleName="rl.utilities.behaviors.stopEventPropogation",e.directiveName="rlStopEventPropagation",i.module(e.moduleName,[]).directive(e.directiveName,n)},function(t,e,r){function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}var i=r(1),o=r(5);e.isEmpty=o;var u=r(9);e.truncate=u,n(r(10)),e.name="rl.utilities.filters",i.module(e.name,[o.moduleName,u.moduleName])},function(t,e,r){"use strict";function n(t){return function(e,r){var n=t.isNullOrEmpty(e);return r===!1?!n:n}}var i=r(1),o=r(6);e.moduleName="rl.utilities.filters.isEmpty",e.serviceName="isEmpty",e.filterName=e.serviceName+"Filter",n.$inject=[o.serviceName],i.module(e.moduleName,[o.moduleName]).filter(e.serviceName,n)},function(t,e,r){"use strict";var n=r(1),i=r(7),o=r(8);e.moduleName="rl.utilities.services.object",e.serviceName="objectUtility";var u=function(){function t(t){this.array=t}return t.prototype.isNullOrEmpty=function(t){return null==t?!0:i.isArray(t)?i.any(t)===!1:i.isNumber(t)?i.isNaN(t):""===t},t.prototype.isNullOrWhitespace=function(t){return i.isString(t)&&(t=t.trim()),this.isNullOrEmpty(t)},t.prototype.areEqual=function(t,e){var r=this,n=typeof t,o=typeof e;if(null==t&&null==e)return!0;if(null==t||null==e)return!1;if(n!==o)return!1;if(t instanceof Array){if(t.length!==e.length)return!1;for(var u=0;u<t.length;u++)if(this.areEqual(t[u],e[u])===!1)return!1}else{if("object"!==n)return t===e;var a=i.keys(e);if(i.forIn(t,function(t,n){return i.has(e,n)?r.areEqual(t,e[n])===!1?!1:void r.array.remove(a,n):!1}),i.any(a))return!1}return!0},t.prototype.toString=function(t){return t+""},t.prototype.valueOrDefault=function(t,e){return null!=t?t:e},t.$inject=[o.serviceName],t}();n.module(e.moduleName,[o.moduleName]).service(e.serviceName,u)},function(t,e){!function(){t.exports=this._}()},function(t,e,r){"use strict";var n=r(1),i=r(7);e.moduleName="rl.utilities.services.array",e.serviceName="arrayUtility";var o=function(){function t(){}return t.prototype.findIndexOf=function(t,e){var r;return i.each(t,function(t,n){return e(t)?(r=n,!1):void 0}),null!=r?r:-1},t.prototype.remove=function(t,e){var r;return r=i.isFunction(e)?this.findIndexOf(t,e):i.indexOf(t,e),r>=0?t.splice(r,1)[0]:null},t.prototype.replace=function(t,e,r){var n=i.indexOf(t,e);n>=0&&t.splice(n,1,r)},t.prototype.sum=function(t,e){var r;return r=null!=e?i.map(t,function(t){return e(t)}):t,i.reduce(r,function(t,e){return t+e},0)},t.prototype.toDictionary=function(t,e){return i.reduce(t,function(t,r){return t[e(r)]=r,t},{})},t.prototype.last=function(t){return null!=t&&t.length>0?t[t.length-1]:void 0},t}();n.module(e.moduleName,[]).service(e.serviceName,o)},function(t,e,r){"use strict";function n(t){return function(e,r,n){n=null==n?!1:n;var i=t.isNullOrWhitespace(e)?"":e.toString();return i.length&&null!=r&&i.length>r&&(i=i.substring(0,r),n&&(i+="...")),i}}var i=r(1),o=r(6);e.moduleName="rl.utilities.filters.truncate",e.serviceName="truncate",e.filterName=e.serviceName+"Filter",n.$inject=[o.serviceName],i.module(e.moduleName,[o.moduleName]).filter(e.serviceName,n)},function(t,e){"use strict"},function(t,e,r){"use strict";var n=r(1),i=r(8);e.array=i;var o=r(12);e["boolean"]=o;var u=r(13);e.dataContracts=u;var a=r(20);e.date=a;var s=r(27);e.fileSize=s;var c=r(31);e.genericSearchFilter=c;var l=r(33);e.guid=l;var f=r(21);e.moment=f;var m=r(36);e.notification=m;var p=r(28);e.number=p;var h=r(6);e.object=h;var d=r(39);e.observable=d;var v=r(40);e.parentChildBehavior=v;var y=r(41);e.promise=y;var g=r(32);e.string=g;var N=r(42);e.synchronizedRequests=N;var S=r(43);e.test=S;var D=r(23);e.time=D;var b=r(46);e.validation=b,e.moduleName="rl.utilities.services",n.module(e.moduleName,[i.moduleName,o.moduleName,u.moduleName,a.moduleName,s.moduleName,c.moduleName,l.moduleName,f.moduleName,m.moduleName,p.moduleName,h.moduleName,d.moduleName,v.moduleName,y.moduleName,g.moduleName,N.moduleName,D.moduleName,S.moduleName,b.moduleName])},function(t,e,r){"use strict";var n=r(1);e.moduleName="rl.utilities.services.boolean",e.serviceName="booleanUtility";var i=function(){function t(){}return t.prototype.toBool=function(t){return!!t},t}();n.module(e.moduleName,[]).service(e.serviceName,i)},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}var i=r(1),o=r(14),u=r(15),a=r(17);e.moduleName="rl.utilities.services.dataContracts",n(r(19));var s=r(15);e.BaseDataService=s.BaseDataService,e.baseDataServiceFactoryName=s.factoryName,n(r(16));var c=r(17);e.BaseSingletonDataService=c.BaseSingletonDataService,e.baseSingletonDataServiceFactoryName=c.factoryName,n(r(18));var l=r(14);e.builderServiceName=l.serviceName,i.module(e.moduleName,[u.moduleName,a.moduleName,o.moduleName])},function(t,e,r){"use strict";var n=r(1),i=r(8),o=r(15),u=r(16),a=r(17),s=r(18);e.moduleName="rl.utilities.services.baseResourceBuilder",e.serviceName="baseResourceBuilder";var c=function(){function t(t,e,r,n){this.$http=t,this.$q=e,this.$rootScope=r,this.array=n}return t.prototype.getLibraryServices=function(){return{$q:this.$q,$rootScope:this.$rootScope}},t.prototype.createResource=function(t){var e=this;t.useMock=null==t.endpoint?!0:t.useMock;var r=new o.BaseDataService(this.$http,this.$q,this.array,t.endpoint,t.mockData,t.transform,t.useMock,t.logRequests);return r.clone=function(t){return e.cloneResource(r,t)},r},t.prototype.createResourceView=function(t){var e=this,r=this.createResource(t);return r.clone=function(t){return e.cloneResource(r,t)},r.AsSingleton=function(t){return{get:function(){return r.getDetail(t)},update:function(t){return r.update(t)},useMock:r.useMock,logRequests:r.logRequests}},r},t.prototype.createParentResource=function(t){var e=this;t.useMock=null==t.endpoint?!0:t.useMock;var r=new u.BaseParentDataService(this.$http,this.$q,this.array,t.endpoint,t.mockData,t.resourceDictionaryBuilder,t.transform,t.useMock,t.logRequests);return r.clone=function(t){return e.cloneParentResource(r,t)},r},t.prototype.createParentResourceView=function(t){var e=this,r=this.createParentResource(t);return r.clone=function(t){return e.cloneParentResource(r,t)},r.AsSingleton=function(t){return{get:function(){return r.getDetail(t)},update:function(t){return r.update(t)},useMock:r.useMock,logRequests:r.logRequests,childContracts:function(){return r.childContracts(t)},clone:r.clone}},r},t.prototype.createSingletonResource=function(t){var e=this;t.useMock=null==t.endpoint?!0:t.useMock;var r=new a.BaseSingletonDataService(this.$http,this.$q,t.endpoint,t.mockData,t.transform,t.useMock,t.logRequests);return r.clone=function(t){return e.cloneSingletonResource(r,t)},r},t.prototype.createParentSingletonResource=function(t){var e=this;t.useMock=null==t.endpoint?!0:t.useMock;var r=new s.BaseParentSingletonDataService(this.$http,this.$q,t.endpoint,t.mockData,t.resourceDictionaryBuilder,t.transform,t.useMock,t.logRequests);return r.clone=function(t){return e.cloneParentSingletonResource(r,t)},r},t.prototype.cloneResource=function(t,e){var r=t;return{getList:function(t){return r.getList(t,e)},getDetail:function(t){return r.getDetail(t,e)},create:function(t){return r.create(t,e)},update:function(t){return r.update(t,e)},"delete":function(t){return r["delete"](t,e)},useMock:r.useMock,logRequests:r.logRequests}},t.prototype.cloneParentResource=function(t,e){var r=this.cloneResource(t,e);return r.childContracts=function(e){return t.childContracts(e)},r},t.prototype.cloneSingletonResource=function(t,e){var r=t;return{get:function(){return r.get(e)},update:function(t){return r.update(t,e)},useMock:r.useMock,logRequests:r.logRequests}},t.prototype.cloneParentSingletonResource=function(t,e){var r=this.cloneSingletonResource(t,e);return r.childContracts=function(){return t.childContracts()},r},t.$inject=["$http","$q","$rootScope",i.serviceName],t}();e.BaseResourceBuilder=c,n.module(e.moduleName,[i.moduleName]).service(e.serviceName,c)},function(t,e,r){"use strict";function n(t,e,r){return{getInstance:function(n,i,o,u,s){return new a(t,e,r,n,i,o,u,s)}}}var i=r(1),o=r(7),u=r(8);e.moduleName="rl.utilities.services.baseDataService",e.factoryName="baseDataService";var a=function(){function t(t,e,r,n,i,o,u,a){this.$http=t,this.$q=e,this.array=r,this._endpoint=n,this.mockData=i,this.transform=o,this.useMock=u,this.logRequests=a}return Object.defineProperty(t.prototype,"endpoint",{get:function(){return this._endpoint},enumerable:!0,configurable:!0}),t.prototype.getItemEndpoint=function(t,e){var r=this.getEndpointOrDefault(e);return r+"/"+t.toString()},t.prototype.getList=function(t,e){var r,n=this;return r=this.useMock?this.$q.when(this.mockData):this.$http.get(this.getEndpointOrDefault(e),{params:t}).then(function(t){return t.data}),r.then(function(t){return null!=n.transform&&(t=o.map(t,n.transform)),n.logRequests&&n.log("getList",t),t})},t.prototype.getDetail=function(t,e){var r,n=this;return r=this.useMock?this.$q.when(o.find(this.mockData,function(e){return e.id===t})):this.$http.get(this.getItemEndpoint(t,e)).then(function(t){return t.data}),r.then(function(t){return null!=n.transform&&(t=n.transform(t)),n.logRequests&&n.log("getDetail",t),t})},t.prototype.create=function(t,e){var r,n=this;if(this.useMock){var i=o.max(this.mockData,"id").id+1;t.id=i,this.mockData.push(t),r=this.$q.when(t)}else r=this.$http.post(this.getEndpointOrDefault(e),JSON.stringify(t)).then(function(t){return t.data});return r.then(function(t){return n.logRequests&&n.log("create",t),t})},t.prototype.update=function(t,e){var r,n=this;if(this.useMock){var i=o.find(this.mockData,o.find(this.mockData,function(e){return e.id===t.id}));i=o.assign(i,t),r=this.$q.when()}else r=this.$http.put(this.getItemEndpoint(t.id,e),t).then(function(){return null});return r.then(function(){n.logRequests&&n.log("update",t)})},t.prototype["delete"]=function(t,e){var r,n=this;return this.useMock?(this.array.remove(this.mockData,t),r=this.$q.when()):r=this.$http["delete"](this.getItemEndpoint(t.id,e)).then(function(){return null}),r.then(function(){n.logRequests&&n.log("update",t)})},t.prototype.log=function(t,e){var r=this.useMock?"Mocked ":"",n=null==this.endpoint?"unspecified":this.endpoint;console.log(r+t+" for endpoint "+n+":"),console.log(e)},t.prototype.getEndpointOrDefault=function(t){return null!=t?t:this.endpoint},t}();e.BaseDataService=a,n.$inject=["$http","$q",u.serviceName],e.baseDataServiceFactory=n,i.module(e.moduleName,[u.moduleName]).factory(e.factoryName,n)},function(t,e,r){var n=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},i=r(15),o=function(t){function e(e,r,n,i,o,u,a,s,c){t.call(this,e,r,n,i,o,a,s,c),this.resourceDictionaryBuilder=u,this._childContracts=this.resourceDictionaryBuilder()}return n(e,t),e.prototype.childContracts=function(t){var e=this;if(_.isUndefined(t))return _.mapValues(this._childContracts,function(t){var r=t.clone();return r.endpoint=e.endpoint+r.endpoint,r});var r=this._childContracts;return _.mapValues(r,function(r){var n=r;return n=_.isFunction(n.AsSingleton)?n.AsSingleton(t):n.clone(),n.endpoint=e.endpoint+"/"+t+n.endpoint,n})},Object.defineProperty(e.prototype,"baseChildContracts",{get:function(){return this._childContracts},enumerable:!0,configurable:!0}),e}(i.BaseDataService);e.BaseParentDataService=o},function(t,e,r){"use strict";function n(t,e){return{getInstance:function(r,n,i,o,a){return new u(t,e,r,n,i,o,a)}}}var i=r(1),o=r(7);e.moduleName="rl.utilities.services.baseSingletonDataService",e.factoryName="baseSingletonDataService";var u=function(){function t(t,e,r,n,i,o,u){this.$http=t,this.$q=e,this._endpoint=r,this.mockData=n,this.transform=i,this.useMock=o,this.logRequests=u}return Object.defineProperty(t.prototype,"endpoint",{get:function(){return this._endpoint},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var e,r=this;return e=this.useMock?this.$q.when(this.mockData):this.$http.get(this.getEndpointOrDefault(t)).then(function(t){return t.data}),e.then(function(t){return null!=r.transform&&(t=r.transform(t)),r.logRequests&&r.log("get",t),t})},t.prototype.update=function(t,e){var r,n=this;return this.useMock?(this.mockData=o.assign(this.mockData,t),r=this.$q.when()):r=this.$http.put(this.getEndpointOrDefault(e),t).then(function(){return null}),r.then(function(){n.logRequests&&n.log("update",t)})},t.prototype.log=function(t,e){var r=this.useMock?"Mocked ":"",n=null==this.endpoint?"unspecified":this.endpoint;console.log(r+t+" for endpoint "+n+":"),console.log(e)},t.prototype.getEndpointOrDefault=function(t){return null!=t?t:this.endpoint},t}();e.BaseSingletonDataService=u,n.$inject=["$http","$q"],e.baseSingletonDataServiceFactory=n,i.module(e.moduleName,[]).factory(e.factoryName,n)},function(t,e,r){var n=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},i=r(17),o=function(t){function e(e,r,n,i,o,u,a,s){t.call(this,e,r,n,i,u,a,s),this.resourceDictionaryBuilder=o}return n(e,t),e.prototype.childContracts=function(){return this.resourceDictionaryBuilder(this.endpoint)},e}(i.BaseSingletonDataService);e.BaseParentSingletonDataService=o},function(t,e){"use strict";var r=function(){function t(t){var e=t.getLibraryServices();this.$q=e.$q,this.$rootScope=e.$rootScope}return t.prototype.flush=function(){this.$rootScope.$digest()},t.prototype.mockGet=function(t,e){return this.baseMockGet(t,"get",e)},t.prototype.mockGetList=function(t,e){return this.baseMockGet(t,"getList",e)},t.prototype.mockGetDetail=function(t,e){return this.baseMockGet(t,"getDetail",e)},t.prototype.baseMockGet=function(t,e,r){var n=this,i=sinon||{spy:function(t){return t}},o=i.spy(function(){return n.$q.when(r)});return t[e]=o,o},t}();e.ContractLibrary=r},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}var i=r(1),o=r(21),u=r(23),a=r(24),s=r(26);n(r(24)),n(r(26)),e.moduleName="rl.utilities.services.date",i.module(e.moduleName,[o.moduleName,u.moduleName]).service(a.serviceName,a.DateUtility).value(s.dateTimeFormatServiceName,s.defaultFormats)},function(t,e,r){"use strict";function n(){var t=o;return t.createFromInputFallback=function(t){t._d=new Date(t._i)},t}var i=r(1),o=r(22);e.moduleName="rl.utilities.services.momentWrapper",e.serviceName="momentWrapper",e.momentWrapper=n,i.module(e.moduleName,[]).factory(e.serviceName,n)},function(t,e){!function(){t.exports=this.moment}()},function(t,e,r){"use strict";var n=r(1);e.moduleName="rl.utilities.services.time",e.serviceName="timeUtility";var i=function(){function t(){}return t.prototype.millisecondsToSeconds=function(t){return Math.floor(t/1e3)},t.prototype.millisecondsToMinutes=function(t){return Math.floor(this.millisecondsToSeconds(t)/60)},t.prototype.millisecondsToHours=function(t){return Math.floor(this.millisecondsToMinutes(t)/60)},t.prototype.millisecondsToDays=function(t){return Math.floor(this.millisecondsToHours(t)/24)},t}();e.TimeUtility=i,n.module(e.moduleName,[]).service(e.serviceName,i)},function(t,e,r){"use strict";var n=r(7),i=r(23),o=r(21),u=r(25);e.serviceName="dateUtility";var a=function(){function t(t,e){var r=this;this.moment=t,this.time=e,this.baseFormat="MM-DD-YYYY",this.month=[{name:"January",days:function(){return 31}},{name:"February",days:function(t){return r.isLeapYear(t)?29:28}},{name:"March",days:function(){return 31}},{name:"April",days:function(){return 30}},{name:"May",days:function(){return 31}},{name:"June",days:function(){return 30}},{name:"July",days:function(){return 31}},{name:"August",days:function(){return 31}},{name:"September",days:function(){return 30}},{name:"October",days:function(){return 31}},{name:"November",days:function(){return 30}},{name:"December",days:function(){return 31}}]}return t.prototype.isLeapYear=function(t){return 1===new Date(t,1,29).getMonth()},t.prototype.getFullString=function(t){return this.month[t].name},t.prototype.getDays=function(t,e){return this.month[t].days(e)},t.prototype.subtractDates=function(t,e,r){if(null==t||null==e)return null;var n=this.getDate(t,r),i=this.getDate(e,r),o={};return o.days=i.getDate()-n.getDate(),o.years=i.getFullYear()-n.getFullYear(),o.months=i.getMonth()-n.getMonth(),o.days<0&&(o.months-=1,o.days+=this.getDays(n.getMonth(),n.getFullYear())),o.months<0&&(o.years-=1,o.months+=12),o},t.prototype.subtractDateInDays=function(t,e,r){var n=this.subtractDateInMilliseconds(t,e,r);return this.time.millisecondsToDays(n)},t.prototype.subtractDateInMilliseconds=function(t,e,r){if(null==t||null==e)return null;var n=this.getDate(t,r),i=this.getDate(e,r);return i.getTime()-n.getTime()},t.prototype.compareDates=function(t,e,r){var n=this.subtractDateInMilliseconds(e,t,r);return u.getCompareResult(n)},t.prototype.dateInRange=function(t,e,r){return this.compareDates(t,e)===u.CompareResult.less?!1:this.compareDates(t,r)===u.CompareResult.greater?!1:!0},t.prototype.getDate=function(t,e){return n.isDate(t)?t:this.moment(t,this.format(e)).toDate()},t.prototype.getDateFromISOString=function(t){return this.moment(t).toDate()},t.prototype.isDate=function(t,e){return n.isDate(t)||this.moment(t,this.format(e)).isValid()},t.prototype.getNow=function(){return new Date},t.prototype.format=function(t){return null!=t?t:this.baseFormat},t.$inject=[o.serviceName,i.serviceName],t}();e.DateUtility=a},function(t,e){"use strict";function r(t){return 0===t?n.equal:t>0?n.greater:n.less}!function(t){t[t.greater=1]="greater",t[t.equal=0]="equal",t[t.less=-1]="less"}(e.CompareResult||(e.CompareResult={}));var n=e.CompareResult;e.getCompareResult=r},function(t,e){"use strict";e.dateTimeFormatServiceName="dateTimeFormatStrings",e.defaultFormats={dateTimeFormat:"M/D/YYYY h:mm A",dateFormat:"M/D/YYYY",timeFormat:"h:mmA"}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}var i=r(1),o=r(28),u=r(29),a=r(30);n(r(29)),n(r(30)),e.moduleName="rl.utilities.services.fileSize",i.module(e.moduleName,[o.moduleName]).factory(u.factoryName,u.fileSizeFactory).filter(a.simpleFilterName,a.fileSizeFilter)},function(t,e,r){"use strict";var n=r(1);e.moduleName="rl.utilities.services.number",e.serviceName="numberUtility";var i;!function(t){t[t.positive=1]="positive",t[t.negative=-1]="negative"}(i||(i={}));var o=function(){function t(){}return t.prototype.preciseRound=function(t,e){var r=t>=0?i.positive:i.negative;return Math.round(t*Math.pow(10,e)+.001*r)/Math.pow(10,e)},t.prototype.integerDivide=function(t,e){return Math.floor(t/e)},t.prototype.roundToStep=function(t,e){if(!e)return t;var r=t%e;return r>=e/2?t+(e-r):t-r},t}();n.module(e.moduleName,[]).service(e.serviceName,o)},function(t,e,r){"use strict";function n(t){return{getInstance:function(e){return new o(t,e)}}}var i=r(28);e.factoryName="fileSizeFactory";var o=function(){function t(t,e){this.BYTES_PER_GB=1073741824,this.BYTES_PER_MB=1048576,this.BYTES_PER_KB=1024,this.bytes=e,e>=this.BYTES_PER_GB?(this.isGB=!0,this.GB=e/this.BYTES_PER_GB,this.GB=t.preciseRound(this.GB,1)):(this.isGB=!1,e>=this.BYTES_PER_MB?(this.isMB=!0,this.MB=e/this.BYTES_PER_MB,this.MB=t.preciseRound(this.MB,1)):(this.isMB=!1,e>=this.BYTES_PER_KB?(this.isKB=!0,this.KB=e/this.BYTES_PER_KB,this.KB=t.preciseRound(this.KB,1)):this.isKB=!1)),this.bytes=Math.round(this.bytes)}return t.prototype.display=function(){return this.isGB?this.GB+" GB":this.isMB?this.MB+" MB":this.isKB?this.KB+" KB":this.bytes+" bytes"},t}();n.$inject=[i.serviceName],e.fileSizeFactory=n},function(t,e,r){"use strict";function n(t){return function(e){var r=t.getInstance(e);return r.display()}}var i=r(29);e.simpleFilterName="fileSize",e.filterName=e.simpleFilterName+"Filter",n.$inject=[i.factoryName],e.fileSizeFilter=n},function(t,e,r){"use strict";function n(t,e){return{getInstance:function(){return new s(t,e)}}}var i=r(1),o=r(7),u=r(6),a=r(32);e.moduleName="rl.utilities.services.genericSearchFilter",e.factoryName="genericSearchFilterFactory",e.filterName="search";var s=function(){function t(t,r){this.object=t,this.string=r,this.type=e.filterName,this.minSearchLength=1,this.caseSensitive=!1}return t.prototype.filter=function(t){return this.object.isNullOrEmpty(this.searchText)||this.searchText.length<this.minSearchLength?!0:this.searchObject(t,this.searchText,this.caseSensitive)},t.prototype.searchObject=function(t,e,r){var n=this;if(o.isObject(t)){var i=o.values(t);return o.any(i,function(t){return n.searchObject(t,e,r)})}var u=this.object.toString(t);return r||(e=e.toLowerCase(),u=u.toLowerCase()),this.string.contains(u,e)},t}();e.GenericSearchFilter=s,n.$inject=[u.serviceName,a.serviceName],i.module(e.moduleName,[u.moduleName,a.moduleName]).factory(e.factoryName,n)},function(t,e,r){"use strict";var n=r(1),i=r(7);e.moduleName="rl.utilities.services.string",e.serviceName="stringUtilityService";var o=function(){function t(){}return t.prototype.toNumber=function(t){return+t},t.prototype.contains=function(t,e){return e?-1!==t.indexOf(e):!0},t.prototype.substitute=function(t){for(var e=this,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];return i.each(r,function(r,n){t=e.replaceAll(t,"\\{"+n+"\\}",r)}),t},t.prototype.replaceAll=function(t,e,r){return t.replace(new RegExp(e,"gi"),r)},t}();e.StringUtilityService=o,n.module(e.moduleName,[]).service(e.serviceName,o)},function(t,e,r){"use strict";var n=r(1),i=r(34);e.moduleName="rl.utilities.services.guid",e.serviceName="guidService";var o=function(){function t(){}return t.prototype.time=function(){return i.v1()},t.prototype.random=function(){return i.v4()},t}();n.module(e.moduleName,[]).service(e.serviceName,o)},function(t,e,r){function n(t,e,r){var n=e&&r||0,i=0;for(e=e||[],t.toLowerCase().replace(/[0-9a-f]{2}/g,function(t){16>i&&(e[n+i++]=c[t])});16>i;)e[n+i++]=0;return e}function i(t,e){var r=e||0,n=s;return n[t[r++]]+n[t[r++]]+n[t[r++]]+n[t[r++]]+"-"+n[t[r++]]+n[t[r++]]+"-"+n[t[r++]]+n[t[r++]]+"-"+n[t[r++]]+n[t[r++]]+"-"+n[t[r++]]+n[t[r++]]+n[t[r++]]+n[t[r++]]+n[t[r++]]+n[t[r++]]}function o(t,e,r){var n=e&&r||0,o=e||[];t=t||{};var u=void 0!==t.clockseq?t.clockseq:p,a=void 0!==t.msecs?t.msecs:(new Date).getTime(),s=void 0!==t.nsecs?t.nsecs:d+1,c=a-h+(s-d)/1e4;if(0>c&&void 0===t.clockseq&&(u=u+1&16383),(0>c||a>h)&&void 0===t.nsecs&&(s=0),s>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");h=a,d=s,p=u,a+=122192928e5;var l=(1e4*(268435455&a)+s)%4294967296;o[n++]=l>>>24&255,o[n++]=l>>>16&255,o[n++]=l>>>8&255,o[n++]=255&l;var f=a/4294967296*1e4&268435455;o[n++]=f>>>8&255,o[n++]=255&f,o[n++]=f>>>24&15|16,o[n++]=f>>>16&255,o[n++]=u>>>8|128,o[n++]=255&u;for(var v=t.node||m,y=0;6>y;y++)o[n+y]=v[y];return e?e:i(o)}function u(t,e,r){var n=e&&r||0;"string"==typeof t&&(e="binary"==t?new Array(16):null,t=null),t=t||{};var o=t.random||(t.rng||a)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e)for(var u=0;16>u;u++)e[n+u]=o[u];return e||i(o)}for(var a=r(35),s=[],c={},l=0;256>l;l++)s[l]=(l+256).toString(16).substr(1),c[s[l]]=l;var f=a(),m=[1|f[0],f[1],f[2],f[3],f[4],f[5]],p=16383&(f[6]<<8|f[7]),h=0,d=0,v=u;v.v1=o,v.v4=u,v.parse=n,v.unparse=i,t.exports=v},function(t,e){(function(e){var r;if(e.crypto&&crypto.getRandomValues){var n=new Uint8Array(16);r=function(){return crypto.getRandomValues(n),n}}if(!r){var i=new Array(16);r=function(){for(var t,e=0;16>e;e++)0===(3&e)&&(t=4294967296*Math.random()),i[e]=t>>>((3&e)<<3)&255;return i}}t.exports=r}).call(e,function(){return this}())},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}function i(){var t=this,e={notifier:new u.BaseNotifier,setNotifier:function(e){t.notifier=e},$get:function(){return new a(t.notifier)}};return e}var o=r(1),u=r(37);n(r(38)),e.moduleName="rl.utilities.services.notification",e.serviceName="notification";var a=function(){function t(t){this.notifier=t}return t.prototype.info=function(t){this.notifier.info(t)},t.prototype.warning=function(t){this.notifier.warning(t)},t.prototype.error=function(t){this.notifier.error(t)},t.prototype.success=function(t){this.notifier.success(t)},t}();e.NotificationService=a,e.notificationServiceProvider=i,o.module(e.moduleName,[]).provider(e.serviceName,i)},function(t,e){"use strict";var r=function(){function t(){}return t.prototype.info=function(t){this.notify(t)},t.prototype.warning=function(t){this.notify(t)},t.prototype.error=function(t){this.notify(t)},t.prototype.success=function(t){this.notify(t)},t.prototype.notify=function(t){window.alert(t),console.log(t)},t}();e.BaseNotifier=r},function(t,e){"use strict"},function(t,e,r){"use strict";function n(){return{getInstance:function(){return new u}}}var i=r(1),o=r(7);e.moduleName="rl.utilities.services.observable",e.factoryName="observableFactory";var u=function(){function t(){this.watchers=[],this.nextKey=0}return t.prototype.register=function(t,e){var r=this;if(!o.isFunction(t))return console.log("Error: watcher must be a function"),null;var n=this.nextKey;return this.nextKey++,this.watchers[n]={action:t,event:e},function(){r.unregister(n)}},t.prototype.fire=function(t){for(var e=this,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];return o(this.watchers).filter(function(e){return null!=e&&e.event===t}).map(function(t){return t.action.apply(e,r)}).value()},t.prototype.unregister=function(t){this.watchers[t]=null},t}();e.ObservableService=u,e.observableServiceFactory=n,i.module(e.moduleName,[]).factory(e.factoryName,n)},function(t,e,r){"use strict";var n=r(1);e.moduleName="rl.utilities.services.parentChildBehavior",e.serviceName="parentChildBehavior";var i=function(){function t(){}return t.prototype.getChildBehavior=function(t){return t&&null!=t.viewData?t.viewData.behavior:null},t.prototype.triggerChildBehavior=function(t,e){var r=this.getChildBehavior(t);return null==r?null:e(r)},t.prototype.triggerAllChildBehaviors=function(t,e){var r=this.getAllChildBehaviors(t);return _.map(r,function(t){return e(t)})},t.prototype.getAllChildBehaviors=function(t){var e=this;return _(t).map(function(t){return e.getChildBehavior(t)}).filter(function(t){return null!=t}).value()},t.prototype.registerChildBehavior=function(t,e){if(null!=t){null==t.viewData&&(t.viewData={behavior:null});var r=t.viewData.behavior;null==r?t.viewData.behavior=e:t.viewData.behavior=_.extend(r,e)}},t}();e.ParentChildBehaviorService=i,n.module(e.moduleName,[]).service(e.serviceName,i)},function(t,e,r){"use strict";var n=r(1),i=r(7);e.moduleName="rl.utilities.services.promise",e.serviceName="promiseUtility";var o=function(){function t(t,e){this.$q=t,this.$injector=e}return t.prototype.isPromise=function(t){return i.isObject(t)&&i.isFunction(t.then)&&i.isFunction(t["catch"])},t.prototype.resolvePromises=function(t){var e=this,r={};return i.each(t,function(t,n){i.isFunction(t)||i.isArray(t)?r[n]=e.$q.when(e.$injector.invoke(t)):i.isString(t)?r[n]=e.$q.when(e.$injector.get(t)):r[n]=e.$q.when(t)}),this.$q.all(r)},t.$inject=["$q","$injector"],t}();n.module(e.moduleName,[]).service(e.serviceName,o)},function(t,e,r){"use strict";function n(t){return{getInstance:function(e,r){return new o(e,r,t)}}}var i=r(1);e.moduleName="rl.utilities.services.synchronizedRequests",e.factoryName="synchronizedRequests";var o=function(){function t(t,e,r){this.dataProvider=t,this.handleRequest=e,this.$q=r,this.requestId=0}return t.prototype.getData=function(){for(var t=this,e=[],r=0;r<arguments.length;r++)e[r-0]=arguments[r];this.requestId++;var n=this.requestId;this.$q.when(this.dataProvider.apply(this,e)).then(function(){for(var e=[],r=0;r<arguments.length;r++)e[r-0]=arguments[r];n==t.requestId&&t.handleRequest.apply(t,e)})},t}();e.SynchronizedRequestsService=o,n.$inject=["$q"],e.synchronizedRequestsFactory=n,i.module(e.moduleName,[]).factory(e.factoryName,n)},function(t,e,r){function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}var i=r(1),o=r(44);e.mock=o,n(r(45)),e.moduleName="rl.utilities.services.test",i.module(e.moduleName,[o.moduleName])},function(t,e,r){"use strict";var n=r(7),i=r(1);e.moduleName="rl.utilities.services.test.mock",e.serviceName="mockUtility";var o=function(){function t(t,e){this.$q=t,this.$rootScope=e}return t.prototype.service=function(t){return n.isUndefined(t)&&(t={}),t._mock_requestList_=[],t},t.prototype.promise=function(t,e,r,i){var o=this;n.isUndefined(i)&&(i=!0),t[e]=sinon.spy(function(){var e=o.$q.defer();return t._mock_requestList_.push({promise:e,data:r,successful:i}),e.promise})},t.prototype.promiseWithCallback=function(t,e,r,i){var o=this;n.isUndefined(i)&&(i=!0),t[e]=sinon.spy(function(){for(var e=[],n=0;n<arguments.length;n++)e[n-0]=arguments[n];var u=o.$q.defer();return t._mock_requestList_.push({promise:u,data:r.apply(o,e),successful:i}),u.promise})},t.prototype.flush=function(t,e){var r=t._mock_requestList_;t._mock_requestList_=[],n.each(r,function(t){t.successful?t.promise.resolve(t.data):t.promise.reject(t.data),n.isUndefined(e)===!1&&e.$digest()}),this.$rootScope.$apply()},t.$inject=["$q","$rootScope"],t}();i.module(e.moduleName,[]).service(e.serviceName,o)},function(t,e,r){"use strict";var n=r(1);r(1);var i=r(7),o=function(){function t(){}return t.prototype.inject=function(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];var r={},o=i.clone(t);return o.push(function(){for(var e=[],n=0;n<arguments.length;n++)e[n-0]=arguments[n];i.each(t,function(t,n){r[t]=e[n]})}),n.mock.inject(o),r},t.prototype.mock=function(t){n.mock.module(function(e){i.each(t,function(t,r){e.value(r.toString(),t)})})},t.prototype.controllerWithBindings=function(t,e,r,n){var o=this.inject("$rootScope","$controller"),u=o.$rootScope,a=o.$controller;return n=i.extend(u.$new(),n),null==r&&(r={}),r.$scope=n,{scope:n,controller:a(t,r,e)}},t.prototype.directive=function(t,e,r){var n=this.inject("$rootScope","$compile");r=i.extend(n.$rootScope.$new(),r);var o=n.$compile,u=o(e)(r);return r.$digest(),{directive:u,scope:u.isolateScope(),controller:u.controller(t)}},t}();e.angularFixture=new o},function(t,e,r){"use strict";var n=r(1),i=r(36),o=r(47),u=r(48);e.moduleName="rl.utilities.services.validation",e.serviceName="validationFactory";var a=function(){function t(t){this.notification=t}return t.prototype.buildNotificationWarningValidator=function(){var t=this;return new o.Validator(function(e){t.notification.warning(e)})},t.prototype.buildNotificationErrorValidator=function(){var t=this;return new o.Validator(function(e){t.notification.error(e)})},t.prototype.buildCustomValidator=function(t){return new o.Validator(t)},t.prototype.buildCompositeNotificationWarningValidator=function(){var t=this;return new u.CompositeValidator(function(e){t.notification.warning(e)})},t.prototype.buildCompositeNotificationErrorValidator=function(){var t=this;return new u.CompositeValidator(function(e){t.notification.error(e)})},t.prototype.buildCompositeCustomValidator=function(t){return new u.CompositeValidator(t)},t.$inject=[i.serviceName],t}();e.ValidationService=a,n.module(e.moduleName,[i.moduleName]).service(e.serviceName,a)},function(t,e,r){"use strict";var n=r(7),i=function(){function t(t){this.showError=t,this.validationHandlers={},this.nextKey=0}return t.prototype.validate=function(){var t=this,e=!0;return n.each(this.validationHandlers,function(r){ | ||
var n=t.isActive(r);if(n&&!r.validate()){e=!1;var i=t.errorMessage(r);return t.showError(i),!1}}),e},t.prototype.getErrorCount=function(){var t=this;return n.reduce(this.validationHandlers,function(e,r){var n=t.isActive(r);return n&&!r.validate()&&e++,e},0)},t.prototype.registerValidationHandler=function(t){var e=this,r=this.nextKey;return this.nextKey++,this.validationHandlers[r]=t,function(){e.unregister(r)}},t.prototype.unregister=function(t){delete this.validationHandlers[t]},t.prototype.isActive=function(t){return n.isFunction(t.isActive)&&t.isActive()||null==t.isActive||t.isActive===!0},t.prototype.errorMessage=function(t){return n.isFunction(t.errorMessage)?t.errorMessage():t.errorMessage},t}();e.Validator=i},function(t,e,r){"use strict";var n=r(7),i=r(47),o=function(){function t(t){this.showError=t,this.childValidators={},this.nextKey=0}return t.prototype.validate=function(){var t=!0;return n.each(this.childValidators,function(e){return e.validate()?void 0:(t=!1,!1)}),t},t.prototype.getErrorCount=function(){return n.reduce(this.childValidators,function(t,e){return t+=e.getErrorCount()},0)},t.prototype.buildChildValidator=function(){var t=this,e=new i.Validator(function(e){t.showError(e)}),r=this.nextKey;return this.nextKey++,this.childValidators[r]=e,e.key=r,e},t.prototype.unregisterChild=function(t){delete this.childValidators[t.key]},t}();e.CompositeValidator=o},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}n(r(25))}]); |
{ | ||
"name": "typescript-angular-utilities", | ||
"version": "2.3.5", | ||
"version": "2.4.0", | ||
"description": "Typescript utility classes published as angular services", | ||
@@ -5,0 +5,0 @@ "author": "Renovo Development Team", |
@@ -31,9 +31,10 @@ import * as angular from 'angular'; | ||
endpoint: string; | ||
private getItemEndpoint(id); | ||
getList(params: TSearchParams): angular.IPromise<TDataType[]>; | ||
getDetail(id: number): angular.IPromise<TDataType>; | ||
create(domainObject: TDataType): angular.IPromise<TDataType>; | ||
update(domainObject: TDataType): angular.IPromise<void>; | ||
delete(domainObject: TDataType): angular.IPromise<void>; | ||
private getItemEndpoint(id, endpoint?); | ||
getList(params: TSearchParams, endpoint?: string): angular.IPromise<TDataType[]>; | ||
getDetail(id: number, endpoint?: string): angular.IPromise<TDataType>; | ||
create(domainObject: TDataType, endpoint?: string): angular.IPromise<TDataType>; | ||
update(domainObject: TDataType, endpoint?: string): angular.IPromise<void>; | ||
delete(domainObject: TDataType, endpoint?: string): angular.IPromise<void>; | ||
private log(requestName, data); | ||
private getEndpointOrDefault(endpoint?); | ||
} | ||
@@ -40,0 +41,0 @@ export interface IBaseDataServiceFactory { |
@@ -25,6 +25,7 @@ 'use strict'; | ||
}); | ||
BaseDataService.prototype.getItemEndpoint = function (id) { | ||
return this.endpoint + '/' + id.toString(); | ||
BaseDataService.prototype.getItemEndpoint = function (id, endpoint) { | ||
var targetEndpoint = this.getEndpointOrDefault(endpoint); | ||
return targetEndpoint + '/' + id.toString(); | ||
}; | ||
BaseDataService.prototype.getList = function (params) { | ||
BaseDataService.prototype.getList = function (params, endpoint) { | ||
var _this = this; | ||
@@ -36,3 +37,3 @@ var promise; | ||
else { | ||
promise = this.$http.get(this.endpoint, { params: params }) | ||
promise = this.$http.get(this.getEndpointOrDefault(endpoint), { params: params }) | ||
.then(function (response) { | ||
@@ -52,3 +53,3 @@ return response.data; | ||
}; | ||
BaseDataService.prototype.getDetail = function (id) { | ||
BaseDataService.prototype.getDetail = function (id, endpoint) { | ||
var _this = this; | ||
@@ -62,3 +63,3 @@ var promise; | ||
else { | ||
promise = this.$http.get(this.getItemEndpoint(id)) | ||
promise = this.$http.get(this.getItemEndpoint(id, endpoint)) | ||
.then(function (response) { | ||
@@ -78,3 +79,3 @@ return response.data; | ||
}; | ||
BaseDataService.prototype.create = function (domainObject) { | ||
BaseDataService.prototype.create = function (domainObject, endpoint) { | ||
var _this = this; | ||
@@ -89,3 +90,3 @@ var promise; | ||
else { | ||
promise = this.$http.post(this.endpoint, JSON.stringify(domainObject)) | ||
promise = this.$http.post(this.getEndpointOrDefault(endpoint), JSON.stringify(domainObject)) | ||
.then(function (result) { | ||
@@ -102,3 +103,3 @@ return result.data; | ||
}; | ||
BaseDataService.prototype.update = function (domainObject) { | ||
BaseDataService.prototype.update = function (domainObject, endpoint) { | ||
var _this = this; | ||
@@ -114,3 +115,3 @@ var promise; | ||
else { | ||
promise = this.$http.put(this.getItemEndpoint(domainObject.id), domainObject).then(function () { return null; }); | ||
promise = this.$http.put(this.getItemEndpoint(domainObject.id, endpoint), domainObject).then(function () { return null; }); | ||
} | ||
@@ -123,3 +124,3 @@ return promise.then(function () { | ||
}; | ||
BaseDataService.prototype.delete = function (domainObject) { | ||
BaseDataService.prototype.delete = function (domainObject, endpoint) { | ||
var _this = this; | ||
@@ -132,3 +133,3 @@ var promise; | ||
else { | ||
promise = this.$http.delete(this.getItemEndpoint(domainObject.id)).then(function () { return null; }); | ||
promise = this.$http.delete(this.getItemEndpoint(domainObject.id, endpoint)).then(function () { return null; }); | ||
} | ||
@@ -147,2 +148,5 @@ return promise.then(function () { | ||
}; | ||
BaseDataService.prototype.getEndpointOrDefault = function (endpoint) { | ||
return endpoint != null ? endpoint : this.endpoint; | ||
}; | ||
return BaseDataService; | ||
@@ -149,0 +153,0 @@ })(); |
@@ -44,7 +44,8 @@ 'use strict'; | ||
private getItemEndpoint(id: number): string { | ||
return this.endpoint + '/' + id.toString(); | ||
private getItemEndpoint(id: number, endpoint?: string): string { | ||
let targetEndpoint: string = this.getEndpointOrDefault(endpoint); | ||
return targetEndpoint + '/' + id.toString(); | ||
} | ||
getList(params: TSearchParams): angular.IPromise<TDataType[]> { | ||
getList(params: TSearchParams, endpoint?: string): angular.IPromise<TDataType[]> { | ||
let promise: angular.IPromise<TDataType[]>; | ||
@@ -54,3 +55,3 @@ if (this.useMock) { | ||
} else { | ||
promise = this.$http.get(this.endpoint, { params: params }) | ||
promise = this.$http.get(this.getEndpointOrDefault(endpoint), { params: params }) | ||
.then((response: angular.IHttpPromiseCallbackArg<TDataType[]>): TDataType[] => { | ||
@@ -71,3 +72,3 @@ return response.data; | ||
getDetail(id: number): angular.IPromise<TDataType> { | ||
getDetail(id: number, endpoint?: string): angular.IPromise<TDataType> { | ||
let promise: angular.IPromise<TDataType>; | ||
@@ -79,3 +80,3 @@ if (this.useMock) { | ||
} else { | ||
promise = this.$http.get(this.getItemEndpoint(id)) | ||
promise = this.$http.get(this.getItemEndpoint(id, endpoint)) | ||
.then((response: angular.IHttpPromiseCallbackArg<TDataType>): TDataType => { | ||
@@ -96,3 +97,3 @@ return response.data; | ||
create(domainObject: TDataType): angular.IPromise<TDataType> { | ||
create(domainObject: TDataType, endpoint?: string): angular.IPromise<TDataType> { | ||
let promise: angular.IPromise<TDataType>; | ||
@@ -105,3 +106,3 @@ if (this.useMock) { | ||
} else { | ||
promise = this.$http.post(this.endpoint, JSON.stringify(domainObject)) | ||
promise = this.$http.post(this.getEndpointOrDefault(endpoint), JSON.stringify(domainObject)) | ||
.then((result: angular.IHttpPromiseCallbackArg<TDataType>): TDataType => { | ||
@@ -119,3 +120,3 @@ return result.data; | ||
update(domainObject: TDataType): angular.IPromise<void> { | ||
update(domainObject: TDataType, endpoint?: string): angular.IPromise<void> { | ||
let promise: angular.IPromise<void>; | ||
@@ -129,3 +130,3 @@ if (this.useMock) { | ||
} else { | ||
promise = this.$http.put<void>(this.getItemEndpoint(domainObject.id), domainObject).then((): void => { return null; }); | ||
promise = this.$http.put<void>(this.getItemEndpoint(domainObject.id, endpoint), domainObject).then((): void => { return null; }); | ||
} | ||
@@ -139,3 +140,3 @@ return promise.then((): void => { | ||
delete(domainObject: TDataType): angular.IPromise<void> { | ||
delete(domainObject: TDataType, endpoint?: string): angular.IPromise<void> { | ||
let promise: angular.IPromise<void>; | ||
@@ -146,3 +147,3 @@ if (this.useMock) { | ||
} else { | ||
promise = this.$http.delete<void>(this.getItemEndpoint(domainObject.id)).then((): void => { return null; }); | ||
promise = this.$http.delete<void>(this.getItemEndpoint(domainObject.id, endpoint)).then((): void => { return null; }); | ||
} | ||
@@ -162,2 +163,6 @@ return promise.then((): void => { | ||
} | ||
private getEndpointOrDefault(endpoint?: string): string { | ||
return endpoint != null ? endpoint : this.endpoint; | ||
} | ||
} | ||
@@ -164,0 +169,0 @@ |
import { IBaseDataService, IBaseDomainObject } from './baseData.service'; | ||
import { IBaseParentDataService } from '../baseParentDataService/baseParentData.service'; | ||
import { IBaseSingletonDataService } from '../baseSingletonDataService/baseSingletonData.service'; | ||
import { IBaseParentSingletonDataService } from '../baseParentSingletonDataService/baseParentSingletonData.service'; | ||
export interface IBaseDataServiceView<TDataType extends IBaseDomainObject, TSearchParams> extends IBaseDataService<TDataType, TSearchParams> { | ||
AsSingleton(parentId: number): IBaseSingletonDataService<TDataType>; | ||
} | ||
export interface IBaseParentDataServiceView<TDataType extends IBaseDomainObject, TSearchParams, TResourceDictionaryType> extends IBaseParentDataService<TDataType, TSearchParams, TResourceDictionaryType> { | ||
AsSingleton(parentId: number): IBaseParentSingletonDataService<TDataType, TResourceDictionaryType>; | ||
} |
'use strict'; | ||
import { IBaseDataService, IBaseDomainObject } from './baseData.service'; | ||
import { IBaseParentDataService } from '../baseParentDataService/baseParentData.service'; | ||
import { IBaseSingletonDataService } from '../baseSingletonDataService/baseSingletonData.service'; | ||
import { IBaseParentSingletonDataService } from '../baseParentSingletonDataService/baseParentSingletonData.service'; | ||
@@ -9,1 +11,6 @@ export interface IBaseDataServiceView<TDataType extends IBaseDomainObject, TSearchParams> extends IBaseDataService<TDataType, TSearchParams> { | ||
} | ||
export interface IBaseParentDataServiceView<TDataType extends IBaseDomainObject, TSearchParams, TResourceDictionaryType> | ||
extends IBaseParentDataService<TDataType, TSearchParams, TResourceDictionaryType>{ | ||
AsSingleton(parentId: number): IBaseParentSingletonDataService<TDataType, TResourceDictionaryType>; | ||
} |
@@ -6,9 +6,12 @@ import * as ng from 'angular'; | ||
childContracts(id?: number): TResourceDictionaryType; | ||
baseChildContracts: TResourceDictionaryType; | ||
} | ||
export declare class BaseParentDataService<TDataType extends IBaseDomainObject, TSearchParams, TResourceDictionaryType> extends BaseDataService<TDataType, TSearchParams> implements IBaseParentDataService<TDataType, TSearchParams, TResourceDictionaryType> { | ||
private resourceDictionaryBuilder; | ||
private _childContracts; | ||
constructor($http: ng.IHttpService, $q: ng.IQService, array: IArrayUtility, endpoint: string, mockData: TDataType[], resourceDictionaryBuilder: { | ||
(baseEndpoint: string): TResourceDictionaryType; | ||
(): TResourceDictionaryType; | ||
}, transform?: ITransformFunction<TDataType>, useMock?: boolean, logRequests?: boolean); | ||
childContracts(id?: number): TResourceDictionaryType; | ||
baseChildContracts: TResourceDictionaryType; | ||
} |
@@ -12,17 +12,35 @@ var __extends = (this && this.__extends) || function (d, b) { | ||
this.resourceDictionaryBuilder = resourceDictionaryBuilder; | ||
this._childContracts = this.resourceDictionaryBuilder(); | ||
} | ||
BaseParentDataService.prototype.childContracts = function (id) { | ||
var _this = this; | ||
if (_.isUndefined(id)) { | ||
return this.resourceDictionaryBuilder(this.endpoint); | ||
return _.mapValues(this._childContracts, function (dataService) { | ||
var contract = dataService.clone(); | ||
contract.endpoint = _this.endpoint + contract.endpoint; | ||
return contract; | ||
}); | ||
} | ||
else { | ||
var dictionary = this.resourceDictionaryBuilder(this.endpoint + '/' + id); | ||
var dictionary = this._childContracts; | ||
return _.mapValues(dictionary, function (dataService) { | ||
if (_.isFunction(dataService.AsSingleton)) { | ||
return dataService.AsSingleton(id); | ||
var contract = dataService; | ||
if (_.isFunction(contract.AsSingleton)) { | ||
contract = contract.AsSingleton(id); | ||
} | ||
return dataService; | ||
else { | ||
contract = contract.clone(); | ||
} | ||
contract.endpoint = _this.endpoint + '/' + id + contract.endpoint; | ||
return contract; | ||
}); | ||
} | ||
}; | ||
Object.defineProperty(BaseParentDataService.prototype, "baseChildContracts", { | ||
get: function () { | ||
return this._childContracts; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
return BaseParentDataService; | ||
@@ -29,0 +47,0 @@ })(baseData_service_1.BaseDataService); |
@@ -12,2 +12,3 @@ import * as ng from 'angular'; | ||
childContracts(id?: number): TResourceDictionaryType; | ||
baseChildContracts: TResourceDictionaryType; | ||
} | ||
@@ -17,4 +18,6 @@ | ||
extends BaseDataService<TDataType, TSearchParams> implements IBaseParentDataService<TDataType, TSearchParams, TResourceDictionaryType> { | ||
private _childContracts: TResourceDictionaryType; | ||
constructor($http: ng.IHttpService, $q: ng.IQService, array: IArrayUtility, endpoint: string, mockData: TDataType[] | ||
, private resourceDictionaryBuilder: { (baseEndpoint: string): TResourceDictionaryType } | ||
, private resourceDictionaryBuilder: { (): TResourceDictionaryType } | ||
, transform?: ITransformFunction<TDataType> | ||
@@ -24,2 +27,3 @@ , useMock?: boolean | ||
super($http, $q, array, endpoint, mockData, transform, useMock, logRequests); | ||
this._childContracts = this.resourceDictionaryBuilder(); | ||
} | ||
@@ -29,13 +33,26 @@ | ||
if (_.isUndefined(id)) { | ||
return this.resourceDictionaryBuilder(this.endpoint); | ||
return <any>_.mapValues(this._childContracts, (dataService: any): IBaseDataService<TDataType, TSearchParams> => { | ||
let contract: any = dataService.clone(); | ||
contract.endpoint = this.endpoint + contract.endpoint; | ||
return contract; | ||
}); | ||
} else { | ||
let dictionary: {[index: string]: any} = this.resourceDictionaryBuilder(this.endpoint + '/' + id); | ||
let dictionary: {[index: string]: any} = this._childContracts; | ||
return <any>_.mapValues(dictionary, (dataService: IBaseDataServiceView<TDataType, TSearchParams>): IBaseSingletonDataService<TDataType> | IBaseDataService<TDataType, TSearchParams> => { | ||
if (_.isFunction(dataService.AsSingleton)) { | ||
return dataService.AsSingleton(id); | ||
let contract: any = dataService; | ||
if (_.isFunction(contract.AsSingleton)) { | ||
contract = contract.AsSingleton(id); | ||
} else { | ||
contract = contract.clone(); | ||
} | ||
return dataService; | ||
contract.endpoint = this.endpoint + '/' + id + contract.endpoint; | ||
return contract; | ||
}); | ||
} | ||
} | ||
get baseChildContracts(): TResourceDictionaryType { | ||
return this._childContracts; | ||
} | ||
} |
@@ -5,3 +5,3 @@ import * as angular from 'angular'; | ||
import { IBaseDataService, IBaseDomainObject, ITransformFunction } from '../baseDataService/baseData.service'; | ||
import { IBaseDataServiceView } from '../baseDataService/baseDataServiceView'; | ||
import { IBaseDataServiceView, IBaseParentDataServiceView } from '../baseDataService/baseDataServiceView'; | ||
import { IBaseParentDataService } from '../baseParentDataService/baseParentData.service'; | ||
@@ -41,3 +41,3 @@ import { IBaseSingletonDataService } from '../baseSingletonDataService/baseSingletonData.service'; | ||
resourceDictionaryBuilder?: { | ||
(baseEndpoint: string): TResourceDictionaryType; | ||
(): TResourceDictionaryType; | ||
}; | ||
@@ -108,2 +108,12 @@ } | ||
/** | ||
* Create a view of a parent resource with sub-resources that can be used as a base resource or | ||
* as a singleton if a parent is selected | ||
*/ | ||
createParentResourceView<TDataType extends IBaseDomainObject, TSearchParams, TResourceDictionaryType>(options: IParentResourceParams<TDataType, TResourceDictionaryType>): IBaseParentDataService<TDataType, TSearchParams, TResourceDictionaryType>; | ||
/** | ||
* Create a view of a parent resource with sub-resources that can be used as a base resource or | ||
* as a singleton if a parent is selected | ||
*/ | ||
createParentResourceView<TDataType extends IBaseDomainObject, TResourceDictionaryType>(options: IParentResourceParams<TDataType, TResourceDictionaryType>): IBaseParentDataService<TDataType, void, TResourceDictionaryType>; | ||
/** | ||
* Deprecated - Create a singleton resource with get and update | ||
@@ -128,4 +138,9 @@ */ | ||
createParentResource<TDataType extends IBaseDomainObject, TSearchParams, TResourceDictionaryType>(options: IParentResourceParams<TDataType, TResourceDictionaryType>): IBaseParentDataService<TDataType, TSearchParams, TResourceDictionaryType>; | ||
createParentResourceView<TDataType extends IBaseDomainObject, TSearchParams, TResourceDictionaryType>(options: IParentResourceParams<TDataType, TResourceDictionaryType>): IBaseParentDataServiceView<TDataType, TSearchParams, TResourceDictionaryType>; | ||
createSingletonResource<TDataType>(options: ISingletonResourceParams<TDataType>): IBaseSingletonDataService<TDataType>; | ||
createParentSingletonResource<TDataType, TResourceDictionaryType>(options: IParentSingletonResourceParams<TDataType, TResourceDictionaryType>): IBaseParentSingletonDataService<TDataType, TResourceDictionaryType>; | ||
private cloneResource<TDataType, TSearchParams>(resource, endpoint); | ||
private cloneParentResource<TDataType, TSearchParams, TResourceDictionaryType>(resource, endpoint); | ||
private cloneSingletonResource<TDataType>(resource, endpoint); | ||
private cloneParentSingletonResource<TDataType, TResourceDictionaryType>(resource, endpoint); | ||
} |
@@ -24,7 +24,12 @@ 'use strict'; | ||
BaseResourceBuilder.prototype.createResource = function (options) { | ||
var _this = this; | ||
options.useMock = options.endpoint == null ? true : options.useMock; | ||
return new baseData_service_1.BaseDataService(this.$http, this.$q, this.array, options.endpoint, options.mockData, options.transform, options.useMock, options.logRequests); | ||
var dataService = new baseData_service_1.BaseDataService(this.$http, this.$q, this.array, options.endpoint, options.mockData, options.transform, options.useMock, options.logRequests); | ||
dataService.clone = function (endpoint) { return _this.cloneResource(dataService, endpoint); }; | ||
return dataService; | ||
}; | ||
BaseResourceBuilder.prototype.createResourceView = function (options) { | ||
var _this = this; | ||
var dataServiceView = this.createResource(options); | ||
dataServiceView.clone = function (endpoint) { return _this.cloneResource(dataServiceView, endpoint); }; | ||
dataServiceView.AsSingleton = function (parentId) { | ||
@@ -41,13 +46,69 @@ return { | ||
BaseResourceBuilder.prototype.createParentResource = function (options) { | ||
var _this = this; | ||
options.useMock = options.endpoint == null ? true : options.useMock; | ||
return new baseParentData_service_1.BaseParentDataService(this.$http, this.$q, this.array, options.endpoint, options.mockData, options.resourceDictionaryBuilder, options.transform, options.useMock, options.logRequests); | ||
var parentDataService = new baseParentData_service_1.BaseParentDataService(this.$http, this.$q, this.array, options.endpoint, options.mockData, options.resourceDictionaryBuilder, options.transform, options.useMock, options.logRequests); | ||
parentDataService.clone = function (endpoint) { return _this.cloneParentResource(parentDataService, endpoint); }; | ||
return parentDataService; | ||
}; | ||
BaseResourceBuilder.prototype.createParentResourceView = function (options) { | ||
var _this = this; | ||
var dataServiceView = this.createParentResource(options); | ||
dataServiceView.clone = function (endpoint) { return _this.cloneParentResource(dataServiceView, endpoint); }; | ||
dataServiceView.AsSingleton = function (parentId) { | ||
return { | ||
get: function () { return dataServiceView.getDetail(parentId); }, | ||
update: function (domainObject) { return dataServiceView.update(domainObject); }, | ||
useMock: dataServiceView.useMock, | ||
logRequests: dataServiceView.logRequests, | ||
childContracts: function () { return dataServiceView.childContracts(parentId); }, | ||
clone: dataServiceView.clone, | ||
}; | ||
}; | ||
return dataServiceView; | ||
}; | ||
BaseResourceBuilder.prototype.createSingletonResource = function (options) { | ||
var _this = this; | ||
options.useMock = options.endpoint == null ? true : options.useMock; | ||
return new baseSingletonData_service_1.BaseSingletonDataService(this.$http, this.$q, options.endpoint, options.mockData, options.transform, options.useMock, options.logRequests); | ||
var dataService = new baseSingletonData_service_1.BaseSingletonDataService(this.$http, this.$q, options.endpoint, options.mockData, options.transform, options.useMock, options.logRequests); | ||
dataService.clone = function (endpoint) { return _this.cloneSingletonResource(dataService, endpoint); }; | ||
return dataService; | ||
}; | ||
BaseResourceBuilder.prototype.createParentSingletonResource = function (options) { | ||
var _this = this; | ||
options.useMock = options.endpoint == null ? true : options.useMock; | ||
return new baseParentSingletonData_service_1.BaseParentSingletonDataService(this.$http, this.$q, options.endpoint, options.mockData, options.resourceDictionaryBuilder, options.transform, options.useMock, options.logRequests); | ||
var parentDataService = new baseParentSingletonData_service_1.BaseParentSingletonDataService(this.$http, this.$q, options.endpoint, options.mockData, options.resourceDictionaryBuilder, options.transform, options.useMock, options.logRequests); | ||
parentDataService.clone = function (endpoint) { return _this.cloneParentSingletonResource(parentDataService, endpoint); }; | ||
return parentDataService; | ||
}; | ||
BaseResourceBuilder.prototype.cloneResource = function (resource, endpoint) { | ||
var castedResource = resource; | ||
return { | ||
getList: function (params) { return castedResource.getList(params, endpoint); }, | ||
getDetail: function (id) { return castedResource.getDetail(id, endpoint); }, | ||
create: function (domainObject) { return castedResource.create(domainObject, endpoint); }, | ||
update: function (domainObject) { return castedResource.update(domainObject, endpoint); }, | ||
delete: function (domainObject) { return castedResource.delete(domainObject, endpoint); }, | ||
useMock: castedResource.useMock, | ||
logRequests: castedResource.logRequests, | ||
}; | ||
}; | ||
BaseResourceBuilder.prototype.cloneParentResource = function (resource, endpoint) { | ||
var clone = this.cloneResource(resource, endpoint); | ||
clone.childContracts = function (id) { return resource.childContracts(id); }; | ||
return clone; | ||
}; | ||
BaseResourceBuilder.prototype.cloneSingletonResource = function (resource, endpoint) { | ||
var castedResource = resource; | ||
return { | ||
get: function () { return castedResource.get(endpoint); }, | ||
update: function (domainObject) { return castedResource.update(domainObject, endpoint); }, | ||
useMock: castedResource.useMock, | ||
logRequests: castedResource.logRequests, | ||
}; | ||
}; | ||
BaseResourceBuilder.prototype.cloneParentSingletonResource = function (resource, endpoint) { | ||
var clone = this.cloneSingletonResource(resource, endpoint); | ||
clone.childContracts = function () { return resource.childContracts(); }; | ||
return clone; | ||
}; | ||
BaseResourceBuilder.$inject = ['$http', '$q', '$rootScope', array_service_1.serviceName]; | ||
@@ -54,0 +115,0 @@ return BaseResourceBuilder; |
@@ -9,3 +9,3 @@ 'use strict'; | ||
import { IBaseDataService, BaseDataService, IBaseDomainObject, ITransformFunction } from '../baseDataService/baseData.service'; | ||
import { IBaseDataServiceView } from '../baseDataService/baseDataServiceView'; | ||
import { IBaseDataServiceView, IBaseParentDataServiceView } from '../baseDataService/baseDataServiceView'; | ||
import { IBaseParentDataService, BaseParentDataService } from '../baseParentDataService/baseParentData.service'; | ||
@@ -51,3 +51,3 @@ import { IBaseSingletonDataService, BaseSingletonDataService } from '../baseSingletonDataService/baseSingletonData.service'; | ||
*/ | ||
resourceDictionaryBuilder?: { (baseEndpoint: string): TResourceDictionaryType }; | ||
resourceDictionaryBuilder?: { (): TResourceDictionaryType }; | ||
} | ||
@@ -128,2 +128,15 @@ | ||
/** | ||
* Create a view of a parent resource with sub-resources that can be used as a base resource or | ||
* as a singleton if a parent is selected | ||
*/ | ||
createParentResourceView<TDataType extends IBaseDomainObject, TSearchParams, TResourceDictionaryType> | ||
(options: IParentResourceParams<TDataType, TResourceDictionaryType>): IBaseParentDataService<TDataType, TSearchParams, TResourceDictionaryType>; | ||
/** | ||
* Create a view of a parent resource with sub-resources that can be used as a base resource or | ||
* as a singleton if a parent is selected | ||
*/ | ||
createParentResourceView<TDataType extends IBaseDomainObject, TResourceDictionaryType> | ||
(options: IParentResourceParams<TDataType, TResourceDictionaryType>): IBaseParentDataService<TDataType, void, TResourceDictionaryType>; | ||
/** | ||
* Deprecated - Create a singleton resource with get and update | ||
@@ -156,3 +169,5 @@ */ | ||
options.useMock = options.endpoint == null ? true : options.useMock; | ||
return new BaseDataService(this.$http, this.$q, this.array, options.endpoint, options.mockData, options.transform, options.useMock, options.logRequests); | ||
let dataService: IBaseDataService<TDataType, TSearchParams> = new BaseDataService(this.$http, this.$q, this.array, options.endpoint, options.mockData, options.transform, options.useMock, options.logRequests); | ||
(<any>dataService).clone = (endpoint: string): IBaseDataService<TDataType, TSearchParams> => { return this.cloneResource(dataService, endpoint); }; | ||
return dataService; | ||
} | ||
@@ -162,2 +177,3 @@ | ||
let dataServiceView: IBaseDataServiceView<TDataType, TSearchParams> = <any>this.createResource(options); | ||
(<any>dataServiceView).clone = (endpoint: string): IBaseDataServiceView<TDataType, TSearchParams> => { return <any>this.cloneResource(dataServiceView, endpoint); }; | ||
dataServiceView.AsSingleton = function(parentId: number): IBaseSingletonDataService<TDataType> { | ||
@@ -177,8 +193,30 @@ return { | ||
options.useMock = options.endpoint == null ? true : options.useMock; | ||
return new BaseParentDataService(this.$http, this.$q, this.array, options.endpoint, options.mockData, options.resourceDictionaryBuilder, options.transform, options.useMock, options.logRequests); | ||
let parentDataService: IBaseParentDataService<TDataType, TSearchParams, TResourceDictionaryType> | ||
= new BaseParentDataService(this.$http, this.$q, this.array, options.endpoint, options.mockData, options.resourceDictionaryBuilder, options.transform, options.useMock, options.logRequests); | ||
(<any>parentDataService).clone = (endpoint: string): IBaseParentDataService<TDataType, TSearchParams, TResourceDictionaryType> => { return this.cloneParentResource(parentDataService, endpoint); }; | ||
return parentDataService; | ||
} | ||
createParentResourceView<TDataType extends IBaseDomainObject, TSearchParams, TResourceDictionaryType> | ||
(options: IParentResourceParams<TDataType, TResourceDictionaryType>): IBaseParentDataServiceView<TDataType, TSearchParams, TResourceDictionaryType> { | ||
let dataServiceView: IBaseParentDataServiceView<TDataType, TSearchParams, TResourceDictionaryType> = <any>this.createParentResource(options); | ||
(<any>dataServiceView).clone = (endpoint: string): IBaseParentDataServiceView<TDataType, TSearchParams, TResourceDictionaryType> => { return <any>this.cloneParentResource(dataServiceView, endpoint); }; | ||
dataServiceView.AsSingleton = function(parentId: number): IBaseParentSingletonDataService<TDataType, TResourceDictionaryType> { | ||
return <any>{ | ||
get(): angular.IPromise<TDataType> { return dataServiceView.getDetail(parentId); }, | ||
update(domainObject: TDataType): angular.IPromise<void> { return dataServiceView.update(domainObject); }, | ||
useMock: dataServiceView.useMock, | ||
logRequests: dataServiceView.logRequests, | ||
childContracts(): TResourceDictionaryType { return dataServiceView.childContracts(parentId); }, | ||
clone: (<any>dataServiceView).clone, | ||
}; | ||
} | ||
return dataServiceView; | ||
} | ||
createSingletonResource<TDataType>(options: ISingletonResourceParams<TDataType>): IBaseSingletonDataService<TDataType> { | ||
options.useMock = options.endpoint == null ? true : options.useMock; | ||
return new BaseSingletonDataService(this.$http, this.$q, options.endpoint, options.mockData, options.transform, options.useMock, options.logRequests); | ||
let dataService: IBaseSingletonDataService<TDataType> = new BaseSingletonDataService(this.$http, this.$q, options.endpoint, options.mockData, options.transform, options.useMock, options.logRequests); | ||
(<any>dataService).clone = (endpoint: string): IBaseSingletonDataService<TDataType> => { return this.cloneSingletonResource(dataService, endpoint); }; | ||
return dataService; | ||
} | ||
@@ -189,4 +227,42 @@ | ||
options.useMock = options.endpoint == null ? true : options.useMock; | ||
return new BaseParentSingletonDataService(this.$http, this.$q, options.endpoint, options.mockData, options.resourceDictionaryBuilder, options.transform, options.useMock, options.logRequests); | ||
let parentDataService: IBaseParentSingletonDataService<TDataType, TResourceDictionaryType> | ||
= new BaseParentSingletonDataService(this.$http, this.$q, options.endpoint, options.mockData, options.resourceDictionaryBuilder, options.transform, options.useMock, options.logRequests); | ||
(<any>parentDataService).clone = (endpoint: string): IBaseParentSingletonDataService<TDataType, TResourceDictionaryType> => { return this.cloneParentSingletonResource(parentDataService, endpoint); }; | ||
return parentDataService; | ||
} | ||
private cloneResource<TDataType extends IBaseDomainObject, TSearchParams>(resource: IBaseDataService<TDataType, TSearchParams>, endpoint: string): IBaseDataService<TDataType, TSearchParams> { | ||
let castedResource: BaseDataService<TDataType, TSearchParams> = <BaseDataService<TDataType, TSearchParams>>resource; | ||
return { | ||
getList(params?: TSearchParams): angular.IPromise<TDataType[]> { return castedResource.getList(params, endpoint); }, | ||
getDetail(id: number): angular.IPromise<TDataType> { return castedResource.getDetail(id, endpoint); }, | ||
create(domainObject: TDataType): angular.IPromise<TDataType> { return castedResource.create(domainObject, endpoint); }, | ||
update(domainObject: TDataType): angular.IPromise<void> { return castedResource.update(domainObject, endpoint); }, | ||
delete(domainObject: TDataType): angular.IPromise<void> { return castedResource.delete(domainObject, endpoint); }, | ||
useMock: castedResource.useMock, | ||
logRequests: castedResource.logRequests, | ||
}; | ||
} | ||
private cloneParentResource<TDataType extends IBaseDomainObject, TSearchParams, TResourceDictionaryType>(resource: IBaseParentDataService<TDataType, TSearchParams, TResourceDictionaryType>, endpoint: string): IBaseParentDataService<TDataType, TSearchParams, TResourceDictionaryType> { | ||
let clone: IBaseParentDataService<TDataType, TSearchParams, TResourceDictionaryType> = <any>this.cloneResource(resource, endpoint); | ||
clone.childContracts = (id: number): TResourceDictionaryType => { return resource.childContracts(id); }; | ||
return clone; | ||
} | ||
private cloneSingletonResource<TDataType>(resource: IBaseSingletonDataService<TDataType>, endpoint: string): IBaseSingletonDataService<TDataType> { | ||
let castedResource: BaseSingletonDataService<TDataType> = <BaseSingletonDataService<TDataType>>resource; | ||
return { | ||
get(): angular.IPromise<TDataType> { return castedResource.get(endpoint); }, | ||
update(domainObject: TDataType): angular.IPromise<void> { return castedResource.update(domainObject, endpoint); }, | ||
useMock: castedResource.useMock, | ||
logRequests: castedResource.logRequests, | ||
}; | ||
} | ||
private cloneParentSingletonResource<TDataType, TResourceDictionaryType>(resource: IBaseParentSingletonDataService<TDataType, TResourceDictionaryType>, endpoint: string): IBaseParentSingletonDataService<TDataType, TResourceDictionaryType> { | ||
let clone: IBaseParentSingletonDataService<TDataType, TResourceDictionaryType> = <any>this.cloneSingletonResource(resource, endpoint); | ||
clone.childContracts = (): TResourceDictionaryType => { return resource.childContracts(); }; | ||
return clone; | ||
} | ||
} | ||
@@ -193,0 +269,0 @@ |
@@ -21,5 +21,6 @@ import * as angular from 'angular'; | ||
endpoint: string; | ||
get(): angular.IPromise<TDataType>; | ||
update(domainObject: TDataType): angular.IPromise<void>; | ||
get(endpoint?: string): angular.IPromise<TDataType>; | ||
update(domainObject: TDataType, endpoint?: string): angular.IPromise<void>; | ||
private log(requestName, data); | ||
private getEndpointOrDefault(endpoint?); | ||
} | ||
@@ -26,0 +27,0 @@ export interface IBaseSingletonDataServiceFactory { |
@@ -23,3 +23,3 @@ 'use strict'; | ||
}); | ||
BaseSingletonDataService.prototype.get = function () { | ||
BaseSingletonDataService.prototype.get = function (endpoint) { | ||
var _this = this; | ||
@@ -31,3 +31,3 @@ var promise; | ||
else { | ||
promise = this.$http.get(this.endpoint) | ||
promise = this.$http.get(this.getEndpointOrDefault(endpoint)) | ||
.then(function (response) { | ||
@@ -47,3 +47,3 @@ return response.data; | ||
}; | ||
BaseSingletonDataService.prototype.update = function (domainObject) { | ||
BaseSingletonDataService.prototype.update = function (domainObject, endpoint) { | ||
var _this = this; | ||
@@ -56,3 +56,3 @@ var promise; | ||
else { | ||
promise = this.$http.put(this.endpoint, domainObject).then(function () { return null; }); | ||
promise = this.$http.put(this.getEndpointOrDefault(endpoint), domainObject).then(function () { return null; }); | ||
} | ||
@@ -71,2 +71,5 @@ return promise.then(function () { | ||
}; | ||
BaseSingletonDataService.prototype.getEndpointOrDefault = function (endpoint) { | ||
return endpoint != null ? endpoint : this.endpoint; | ||
}; | ||
return BaseSingletonDataService; | ||
@@ -73,0 +76,0 @@ })(); |
@@ -32,3 +32,3 @@ 'use strict'; | ||
get(): angular.IPromise<TDataType> { | ||
get(endpoint?: string): angular.IPromise<TDataType> { | ||
let promise: angular.IPromise<TDataType>; | ||
@@ -38,3 +38,3 @@ if (this.useMock) { | ||
} else { | ||
promise = this.$http.get(this.endpoint) | ||
promise = this.$http.get(this.getEndpointOrDefault(endpoint)) | ||
.then((response: angular.IHttpPromiseCallbackArg<TDataType>): TDataType => { | ||
@@ -55,3 +55,3 @@ return response.data; | ||
update(domainObject: TDataType): angular.IPromise<void> { | ||
update(domainObject: TDataType, endpoint?: string): angular.IPromise<void> { | ||
let promise: angular.IPromise<void>; | ||
@@ -62,3 +62,3 @@ if (this.useMock) { | ||
} else { | ||
promise = this.$http.put<void>(this.endpoint, domainObject).then((): void => { return null; }); | ||
promise = this.$http.put<void>(this.getEndpointOrDefault(endpoint), domainObject).then((): void => { return null; }); | ||
} | ||
@@ -78,2 +78,6 @@ return promise.then((): void => { | ||
} | ||
private getEndpointOrDefault(endpoint?: string): string { | ||
return endpoint != null ? endpoint : this.endpoint; | ||
} | ||
} | ||
@@ -80,0 +84,0 @@ |
export declare var moduleName: string; | ||
export * from './baseResourceBuilder/contractLibrary'; | ||
export { IBaseDataService, IBaseDataServiceFactory, IBaseDomainObject, BaseDataService, factoryName as baseDataServiceFactoryName } from './baseDataService/baseData.service'; | ||
export { IBaseDataServiceView } from './baseDataService/baseDataServiceView'; | ||
export { IBaseDataServiceView, IBaseParentDataServiceView } from './baseDataService/baseDataServiceView'; | ||
export * from './baseParentDataService/baseParentData.service'; | ||
@@ -6,0 +6,0 @@ export { IBaseSingletonDataService, IBaseSingletonDataServiceFactory, BaseSingletonDataService, factoryName as baseSingletonDataServiceFactoryName } from './baseSingletonDataService/baseSingletonData.service'; |
@@ -13,3 +13,3 @@ 'use strict'; | ||
export { IBaseDataService, IBaseDataServiceFactory, IBaseDomainObject, BaseDataService, factoryName as baseDataServiceFactoryName } from './baseDataService/baseData.service'; | ||
export { IBaseDataServiceView } from './baseDataService/baseDataServiceView'; | ||
export { IBaseDataServiceView, IBaseParentDataServiceView } from './baseDataService/baseDataServiceView'; | ||
export * from './baseParentDataService/baseParentData.service'; | ||
@@ -16,0 +16,0 @@ export { IBaseSingletonDataService, IBaseSingletonDataServiceFactory, BaseSingletonDataService, factoryName as baseSingletonDataServiceFactoryName } from './baseSingletonDataService/baseSingletonData.service'; |
import * as array from './array/array.service'; | ||
import * as autosave from './autosave/autosave.service'; | ||
import * as autosaveAction from './autosaveAction/autosaveAction.service'; | ||
import * as boolean from './boolean/boolean.service'; | ||
@@ -22,3 +20,3 @@ import * as dataContracts from './dataContracts/dataContracts.module'; | ||
import * as validation from './validation/validation.service'; | ||
export { array, autosave, autosaveAction, boolean, dataContracts, date, fileSize, genericSearchFilter, guid, moment, notification, numberService as number, objectService as object, observable, parentChildBehavior, promise, stringService as string, synchronizedRequests, test, time, validation }; | ||
export { array, boolean, dataContracts, date, fileSize, genericSearchFilter, guid, moment, notification, numberService as number, objectService as object, observable, parentChildBehavior, promise, stringService as string, synchronizedRequests, test, time, validation }; | ||
export declare var moduleName: string; |
@@ -5,6 +5,2 @@ 'use strict'; | ||
exports.array = array; | ||
var autosave = require('./autosave/autosave.service'); | ||
exports.autosave = autosave; | ||
var autosaveAction = require('./autosaveAction/autosaveAction.service'); | ||
exports.autosaveAction = autosaveAction; | ||
var boolean = require('./boolean/boolean.service'); | ||
@@ -49,4 +45,2 @@ exports.boolean = boolean; | ||
array.moduleName, | ||
autosave.moduleName, | ||
autosaveAction.moduleName, | ||
boolean.moduleName, | ||
@@ -53,0 +47,0 @@ dataContracts.moduleName, |
@@ -6,4 +6,2 @@ 'use strict'; | ||
import * as array from './array/array.service'; | ||
import * as autosave from './autosave/autosave.service'; | ||
import * as autosaveAction from './autosaveAction/autosaveAction.service'; | ||
import * as boolean from './boolean/boolean.service'; | ||
@@ -30,4 +28,2 @@ import * as dataContracts from './dataContracts/dataContracts.module'; | ||
array, | ||
autosave, | ||
autosaveAction, | ||
boolean, | ||
@@ -57,4 +53,2 @@ dataContracts, | ||
array.moduleName, | ||
autosave.moduleName, | ||
autosaveAction.moduleName, | ||
boolean.moduleName, | ||
@@ -61,0 +55,0 @@ dataContracts.moduleName, |
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 not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
725938
229
9126