This repository has been archived by the owner on Sep 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
library-preload.js
10 lines (10 loc) · 3.31 KB
/
library-preload.js
1
2
3
4
5
6
7
8
9
10
jQuery.sap.registerPreloadedModules({
"version": "2.0",
"name": "redux.library-preload",
"modules": {
"redux/library.js": "sap.ui.define([\"jquery.sap.global\"],function(){\"use strict\";sap.ui.getCore().initLibrary({name:\"redux\",version:\"0.1.0\",dependencies:[\"sap.ui.core\"]})});",
"redux/ReduxListBinding.js": "sap.ui.define([\"sap/ui/model/ClientListBinding\",\"sap/ui/model/ChangeReason\"],function(t,e){\"use strict\";var i=t.extend(\"redux.ReduxListBinding\");return i.prototype.getContexts=function(t,e){return this.iLastStartIndex=t,this.iLastLength=e,t||(t=0),e||(e=Math.min(this.iLength,this.oModel.iSizeLimit)),this._getContexts(t,e)},i.prototype.getCurrentContexts=function(){return this.getContexts(this.iLastStartIndex,this.iLastLength)},i.prototype.update=function(){var t=this.oModel._getObject(this.sPath,this.oContext);if(t){if(!jQuery.isArray(t))throw new Error(\"A list binding must be represented by an array.\");this.oList=t.slice(0),this.updateIndices(),this.applyFilter(),this.applySort(),this.iLength=this._getLength()}else this.oList=[],this.aIndices=[],this.iLength=0},i.prototype.checkUpdate=function(t){if(!this.bSuspended||this.bIgnoreSuspend||t){var i=this.oModel._getObject(this.sPath,this.oContext);jQuery.sap.equal(this.oList,i)&&!t||(this.update(),this._fireChange({reason:e.Change}))}},i});",
"redux/ReduxModel.js": "sap.ui.define([\"sap/ui/model/ClientModel\",\"sap/ui/model/BindingMode\",\"sap/ui/model/Context\",\"./ReduxPropertyBinding\",\"./ReduxListBinding\"],function(t,e,o,r,n){\"use strict\";var i=t.extend(\"redux.ReduxModel\",{constructor:function(o,r){if(t.call(this),!o)throw new Error(\"Please pass a redux store instance to the redux model.\");var n=this;this.oStore=o,this.sSelectorRoot=r?r.replace(/\\./g,\"/\")+\"/\":\"\",this.sDefaultBindingMode=e.OneWay,this.mSupportedBindingModes={OneWay:!0,TwoWay:!1,OneTime:!1},o.subscribe(function(){n.checkUpdate()})}});return i.prototype.bindProperty=function(t,e,o){return new r(this,t,e,o)},i.prototype.bindList=function(t,e,o,r,i){return new n(this,t,e,o,r,i)},i.prototype.setProperty=function(){throw new Error(\"Do not use setProperty on the redux model. Use actions to update the state\")},i.prototype.getProperty=function(t,e){return this._getObject(t,e)},i.prototype.getStore=function(){return this.oStore},i.prototype._getObject=function(t,e){var r=null;if(e instanceof o?r=this._getObject(e.getPath()):e&&(r=e),!t)return r;var n=this.oStore.getState(),i=0,s=t.split(\"/\");if(!s[0])if(\"selector\"===s[1]){var u=this.sSelectorRoot+s[2].replace(/\\./g,\"/\");r=sap.ui.requireSync(u),i=3}else r=n[s[1]],i=2;for(;r&&s[i];){var p=s[i],a=r[p];r=\"function\"==typeof a?a(this.oStore.getState(),e):a,i+=1}return r},i});",
"redux/ReduxPropertyBinding.js": "sap.ui.define([\"sap/ui/model/ClientPropertyBinding\",\"sap/ui/model/ChangeReason\"],function(e,t){\"use strict\";var n=e.extend(\"redux.ReduxPropertyBinding\");return n.prototype.checkUpdate=function(e){if(!this.bSuspended||e){var n=this._getValue();jQuery.sap.equal(n,this.oValue)&&!e||(this.oValue=n,this._fireChange({reason:t.Change}))}},n.prototype.setValue=function(){throw new Error(\"Do not use setValue on a ReduxBinding. Use actions to update the state\")},n.prototype.setExternalValue=function(){throw new Error(\"Do not use setExternalValue on a ReduxBinding. Use actions to update the state\")},n});"
}
});