@usecsv/react 0.16.4 → 0.18.0

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.16.4
2
+ * @usecsv/react v0.18.0
3
3
  * (c) usecsv
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.29.4
35
+ * @usecsv/js v0.31.0
36
36
  * (c) usecsv
37
37
  * Released under the MIT License.
38
38
  */
@@ -695,7 +695,7 @@ whenDomReady.resume = function (doc) {
695
695
 
696
696
  // eslint-disable-next-line dot-notation
697
697
  var MOUNT_URL = {"MOUNT_URL":"https://app.usecsv.com/importer"}["MOUNT_URL"] ;
698
- var insertIframe = function (id, importerDisplay) {
698
+ var insertIframe = function (id, importerDisplay, iframeId) {
699
699
  var usecsvInlineWrapper = document.getElementById("usecsv-importer-inline-wrapper");
700
700
  var usecsvContainerStyles = importerDisplay === "modal" || !usecsvInlineWrapper
701
701
  ? ".usecsv_container { position: fixed; top: 0px; bottom: 0; right: 0; left: 0; z-index: 100000; }"
@@ -704,6 +704,9 @@ var insertIframe = function (id, importerDisplay) {
704
704
  document.body.insertAdjacentHTML("beforeend", "<div id=".concat(id, " class=\"usecsv_container loading\"></div>"));
705
705
  var iframe = document.createElement("iframe");
706
706
  iframe.setAttribute("src", MOUNT_URL);
707
+ if (iframeId) {
708
+ iframe.setAttribute("id", iframeId);
709
+ }
707
710
  var usecsvContainer = document.getElementById(id);
708
711
  usecsvContainer === null || usecsvContainer === void 0 ? void 0 : usecsvContainer.appendChild(iframe);
709
712
  if (importerDisplay === "inline" && usecsvInlineWrapper) {
@@ -713,10 +716,10 @@ var insertIframe = function (id, importerDisplay) {
713
716
  return iframe;
714
717
  };
715
718
  var useCsvPlugin = function (_a) {
716
- 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, theme = _a.theme, batchSize = _a.batchSize, sampleFileURL = _a.sampleFileURL, downloadExampleButton = _a.downloadExampleButton, dynamicColumns = _a.dynamicColumns, defaultLanguage = _a.defaultLanguage, onError = _a.onError, customText = _a.customText, acceptedFileFormats = _a.acceptedFileFormats, onFileUpload = _a.onFileUpload, columnWidth = _a.columnWidth, onMatchColumns = _a.onMatchColumns;
719
+ 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, theme = _a.theme, batchSize = _a.batchSize, sampleFileURL = _a.sampleFileURL, downloadExampleButton = _a.downloadExampleButton, dynamicColumns = _a.dynamicColumns, defaultLanguage = _a.defaultLanguage, onError = _a.onError, customText = _a.customText, acceptedFileFormats = _a.acceptedFileFormats, onFileUpload = _a.onFileUpload, columnWidth = _a.columnWidth, onMatchColumns = _a.onMatchColumns, iframeId = _a.iframeId;
717
720
  var id = "usecsv-".concat(Math.round(Math.random() * 100000000));
718
721
  return whenDomReady().then(function () {
719
- var iframe = insertIframe(id, importerDisplay);
722
+ var iframe = insertIframe(id, importerDisplay, iframeId);
720
723
  var closeIframe = function () {
721
724
  var _a;
722
725
  (_a = document.getElementById(id)) === null || _a === void 0 ? void 0 : _a.remove();