react-upload-gallery
Advanced tools
Comparing version 0.2.0 to 0.3.0
@@ -33,2 +33,3 @@ "use strict"; | ||
source: null, | ||
alias: null, | ||
onSuccess: func, | ||
@@ -74,2 +75,3 @@ onWarning: func, | ||
source: _propTypes["default"].func, | ||
alias: _propTypes["default"].func, | ||
onSuccess: _propTypes["default"].func, | ||
@@ -76,0 +78,0 @@ onWarning: _propTypes["default"].func, |
@@ -294,5 +294,16 @@ "use strict"; | ||
var append = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; | ||
var source = this.props.source; | ||
source = typeof source === "function" ? source(response) : response.source; | ||
this.setImage(uid, _objectSpread({ | ||
var _this$props2 = this.props, | ||
source = _this$props2.source, | ||
alias = _this$props2.alias; | ||
var fields = {}; // extra object elements from the server service | ||
if (typeof alias === "function") { | ||
fields = alias(response); | ||
} | ||
if (!fields.source) { | ||
source = typeof source === "function" ? source(response) : response.source; | ||
} | ||
this.setImage(uid, _objectSpread(_objectSpread({ | ||
source: source, | ||
@@ -303,3 +314,3 @@ done: true, | ||
progress: 100 | ||
}, append), function () { | ||
}, append), fields), function () { | ||
return _this6.props.onSuccess(_this6.state.images.find(function (item) { | ||
@@ -496,3 +507,3 @@ return item.uid === uid; | ||
var images, | ||
_this$props2, | ||
_this$props3, | ||
rules, | ||
@@ -515,3 +526,3 @@ accept, | ||
images = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : []; | ||
_this$props2 = this.props, rules = _this$props2.rules, accept = _this$props2.accept, acceptType = _this$props2.acceptType; | ||
_this$props3 = this.props, rules = _this$props3.rules, accept = _this$props3.accept, acceptType = _this$props3.acceptType; | ||
images = images.concat(this.state.images); | ||
@@ -614,7 +625,7 @@ /* | ||
data = _ref3.data; | ||
var _this$props3 = this.props, | ||
send = _this$props3.send, | ||
action = _this$props3.action, | ||
headers = _this$props3.headers, | ||
customRequest = _this$props3.customRequest; | ||
var _this$props4 = this.props, | ||
send = _this$props4.send, | ||
action = _this$props4.action, | ||
headers = _this$props4.headers, | ||
customRequest = _this$props4.customRequest; | ||
var request = customRequest || _Request["default"]; | ||
@@ -656,6 +667,6 @@ | ||
value: function showChildren(options) { | ||
var _this$props4 = this.props, | ||
type = _this$props4.type, | ||
sorting = _this$props4.sorting, | ||
children = _this$props4.children, | ||
var _this$props5 = this.props, | ||
type = _this$props5.type, | ||
sorting = _this$props5.sorting, | ||
children = _this$props5.children, | ||
images = this.state.images; | ||
@@ -687,9 +698,9 @@ | ||
var _this$props5 = this.props, | ||
className = _this$props5.className, | ||
style = _this$props5.style, | ||
accept = _this$props5.accept, | ||
acceptType = _this$props5.acceptType, | ||
header = _this$props5.header, | ||
footer = _this$props5.footer; | ||
var _this$props6 = this.props, | ||
className = _this$props6.className, | ||
style = _this$props6.style, | ||
accept = _this$props6.accept, | ||
acceptType = _this$props6.acceptType, | ||
header = _this$props6.header, | ||
footer = _this$props6.footer; | ||
var contextValue = { | ||
@@ -696,0 +707,0 @@ images: images, |
{ | ||
"name": "react-upload-gallery", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"license": "MIT", | ||
@@ -8,6 +8,6 @@ "author": "Muhammet INAN", | ||
"type": "git", | ||
"url": "https://github.com/TPMinan/react-upload-gallery.git" | ||
"url": "https://github.com/m-inan/react-upload-gallery.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/TPMinan/react-upload-gallery/issues" | ||
"url": "https://github.com/m-inan/react-upload-gallery/issues" | ||
}, | ||
@@ -14,0 +14,0 @@ "keywords": [ |
@@ -85,2 +85,3 @@ # React Upload Gallery | ||
| `source` | `Function` | `null` | Enter the url of the photo from the returned answer. `(response) => response.url` | | ||
| `alias` | `Function` | `null` | Can include the data of the image to be loaded in the object and change its name. `(response) => ({ id: response.imageID, slug: response.slug })` | | ||
| `onSuccess` | `Function` | `empty` | Return for uploaded image. `function(image)` | | ||
@@ -214,3 +215,3 @@ | `onWarning` | `Function` | `empty` | Returns elements that do not conform to rules created in `accept` or` rules`. [Rules](#Rules) | | ||
<RUG | ||
onConfirmDelet={(currentImage, images) => { | ||
onConfirmDelete={(currentImage, images) => { | ||
return new Promise(resolve => { | ||
@@ -334,3 +335,3 @@ // For example, you can affect the loading screen here | ||
### Dependencies | ||
React Upload Gallery [react-sortable-hoc](https://github.com/clauderic/react-sortable-hoc), [@Babel/runtime](https://babeljs.io/docs/en/babel-runtime) and [Prop-Types](https://www.npmjs.com/package/prop-types) needs packages. | ||
React Upload Gallery needs [react-sortable-hoc](https://github.com/clauderic/react-sortable-hoc) package. | ||
@@ -337,0 +338,0 @@ ### Reporting Issues |
Sorry, the diff of this file is too big to display
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
291196
24
2312
343
3
1
1