pollination-react-io 0.0.31 → 0.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.esm.js +7 -6
- package/build/index.esm.js.map +1 -1
- package/build/index.js +7 -6
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.esm.js
CHANGED
|
@@ -6619,10 +6619,10 @@ var css_248z$1 = "span.label {\n font-family: -apple-system, BlinkMacSystemFont
|
|
|
6619
6619
|
styleInject(css_248z$1);
|
|
6620
6620
|
|
|
6621
6621
|
var FileInput = function (_a) {
|
|
6622
|
-
var disabled = _a.disabled
|
|
6622
|
+
var disabled = _a.disabled, onChange = _a.onChange;
|
|
6623
6623
|
var onDrop = useCallback(function (acceptedFiles) {
|
|
6624
|
-
|
|
6625
|
-
}, []);
|
|
6624
|
+
onChange(acceptedFiles[0]);
|
|
6625
|
+
}, [onChange]);
|
|
6626
6626
|
var _b = useDropzone({
|
|
6627
6627
|
onDrop: onDrop,
|
|
6628
6628
|
accept: {
|
|
@@ -6684,11 +6684,12 @@ var GetModel = function (_a) {
|
|
|
6684
6684
|
}
|
|
6685
6685
|
}, [getHbjson, key, subscribe]);
|
|
6686
6686
|
return (host === 'web' ?
|
|
6687
|
-
React__default.createElement(FileInput, { onChange: function (
|
|
6688
|
-
if (
|
|
6687
|
+
React__default.createElement(FileInput, { onChange: function (file) {
|
|
6688
|
+
if (!file)
|
|
6689
6689
|
return;
|
|
6690
|
-
var file = event.target.files[0];
|
|
6691
6690
|
var fr = new FileReader();
|
|
6691
|
+
fr.onabort = function () { return console.log('file reading was aborted'); };
|
|
6692
|
+
fr.onerror = function () { return console.log('file reading has failed'); };
|
|
6692
6693
|
fr.onload = function (e) {
|
|
6693
6694
|
setParentState(this.result);
|
|
6694
6695
|
};
|