armstrong-react
Advanced tools
Comparing version
@@ -14,14 +14,21 @@ "use strict"; | ||
function JsonEntityBinder(data) { | ||
var _this = this; | ||
this.data = data; | ||
this.getKeyValue = function (keyName) { | ||
return _this.data[keyName]; | ||
}; | ||
this.setKeyValue = function (keyName, value) { | ||
_this.data[keyName] = value; | ||
}; | ||
this.getValue = function (dataPath) { | ||
return properyPathResolver_1.PropertyPathResolver.getValue(_this.data, dataPath); | ||
}; | ||
this.setValue = function (dataPath, value) { | ||
properyPathResolver_1.PropertyPathResolver.setValue(_this.data, dataPath, value); | ||
_this.lastDataPathSet = dataPath; | ||
}; | ||
this.toJson = function () { | ||
return _this.data; | ||
}; | ||
} | ||
JsonEntityBinder.prototype.getValue = function (dataPath) { | ||
return properyPathResolver_1.PropertyPathResolver.getValue(this.data, dataPath); | ||
}; | ||
JsonEntityBinder.prototype.setValue = function (dataPath, value) { | ||
properyPathResolver_1.PropertyPathResolver.setValue(this.data, dataPath, value); | ||
this.lastDataPathSet = dataPath; | ||
}; | ||
JsonEntityBinder.prototype.toJson = function () { | ||
return this.data; | ||
}; | ||
return JsonEntityBinder; | ||
@@ -28,0 +35,0 @@ }()); |
@@ -30,2 +30,6 @@ /// <reference types="react" /> | ||
lastDataPathSet?: string; | ||
/** Gets a value for the key name (does NOT use dot notation)*/ | ||
getKeyValue<TKey extends keyof T>(keyName: TKey): T[TKey]; | ||
/** Sets a value for the key name (does NOT use dot notation)*/ | ||
setKeyValue<TKey extends keyof T>(keyName: TKey, value: T[TKey]): void; | ||
/** Gets a value for the data path (uses dot notation)*/ | ||
@@ -32,0 +36,0 @@ getValue(dataPath: string): any; |
{ | ||
"name": "armstrong-react", | ||
"version": "2.3.17", | ||
"version": "2.3.18", | ||
"description": "Rocketmakers Armstrong library of React components", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
705300
0.14%14107
0.14%