@usecsv/react 0.2.5 → 0.2.6

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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @usecsv/react v0.2.5
2
+ * @usecsv/react v0.2.6
3
3
  * (c) layercode
4
4
  * Released under the MIT License.
5
5
  */
@@ -32,7 +32,7 @@ function __rest(s, e) {
32
32
  }
33
33
 
34
34
  /*!
35
- * @usecsv/js v0.3.0
35
+ * @usecsv/js v0.3.1
36
36
  * (c) layercode
37
37
  * Released under the MIT License.
38
38
  */
@@ -628,12 +628,17 @@ var useCsvPlugin = function (_a) {
628
628
  var id = "usecsv-".concat(Math.round(Math.random() * 100000000));
629
629
  return whenDomReady().then(function () {
630
630
  var iframe = insertIframe(id);
631
+ var closeIframe = function () {
632
+ var _a;
633
+ (_a = document.getElementById(id)) === null || _a === void 0 ? void 0 : _a.remove();
634
+ };
631
635
  var iframeConnection = connectToChild({
632
636
  iframe: iframe,
633
- methods: __assign({ closeIframe: function () {
634
- var _a;
635
- (_a = document.getElementById(id)) === null || _a === void 0 ? void 0 : _a.remove();
636
- } }, (onData ? { onData: onData } : {})),
637
+ methods: __assign({ closeIframe: closeIframe }, (onData
638
+ ? {
639
+ onData: function (data) { return onData(data, closeIframe); },
640
+ }
641
+ : {})),
637
642
  });
638
643
  iframeConnection.promise.then(function (child) {
639
644
  var _a;