@usecsv/react 0.2.11 → 0.2.13

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.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @usecsv/react v0.2.11
2
+ * @usecsv/react v0.2.13
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.8.0
35
+ * @usecsv/js v0.9.0
36
36
  * (c) layercode
37
37
  * Released under the MIT License.
38
38
  */
@@ -632,7 +632,7 @@ var insertIframe = function (id, importerDisplay) {
632
632
  return iframe;
633
633
  };
634
634
  var useCsvPlugin = function (_a) {
635
- var importerKey = _a.importerKey, user = _a.user, metadata = _a.metadata, onData = _a.onData, onRecordsInitial = _a.onRecordsInitial, onRecordEdit = _a.onRecordEdit, _b = _a.importerDisplay, importerDisplay = _b === void 0 ? "modal" : _b;
635
+ var importerKey = _a.importerKey, user = _a.user, metadata = _a.metadata, onData = _a.onData, onRecordsInitial = _a.onRecordsInitial, onRecordEdit = _a.onRecordEdit, _b = _a.importerDisplay, importerDisplay = _b === void 0 ? "modal" : _b, onClose = _a.onClose;
636
636
  var id = "usecsv-".concat(Math.round(Math.random() * 100000000));
637
637
  return whenDomReady().then(function () {
638
638
  var iframe = insertIframe(id, importerDisplay);
@@ -642,7 +642,7 @@ var useCsvPlugin = function (_a) {
642
642
  };
643
643
  var iframeConnection = connectToChild({
644
644
  iframe: iframe,
645
- methods: __assign(__assign(__assign({ closeIframe: closeIframe }, (onData
645
+ methods: __assign(__assign(__assign(__assign({ closeIframe: closeIframe }, (onData
646
646
  ? {
647
647
  onData: function (data) { return onData(data, closeIframe); },
648
648
  }
@@ -654,13 +654,17 @@ var useCsvPlugin = function (_a) {
654
654
  ? {
655
655
  onRecordEdit: onRecordEdit,
656
656
  }
657
+ : {})), (onClose
658
+ ? {
659
+ onClose: onClose,
660
+ }
657
661
  : {})),
658
662
  });
659
663
  iframeConnection.promise.then(function (child) {
660
664
  var _a;
661
665
  (_a = document.getElementById(id)) === null || _a === void 0 ? void 0 : _a.classList.remove("loading");
662
666
  // eslint-disable-next-line dot-notation
663
- child["setParams"] && child["setParams"]({ importerKey: importerKey, user: user, metadata: metadata });
667
+ child["setParams"] && child["setParams"]({ importerKey: importerKey, user: user, metadata: metadata, importerDisplay: importerDisplay });
664
668
  });
665
669
  return iframeConnection;
666
670
  });