@usecsv/react 0.17.0 → 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.17.0
2
+ * @usecsv/react v0.18.0
3
3
  * (c) usecsv
4
4
  * Released under the MIT License.
5
5
  */
@@ -38,7 +38,7 @@
38
38
  }
39
39
 
40
40
  /*!
41
- * @usecsv/js v0.30.0
41
+ * @usecsv/js v0.31.0
42
42
  * (c) usecsv
43
43
  * Released under the MIT License.
44
44
  */
@@ -701,7 +701,7 @@
701
701
 
702
702
  // eslint-disable-next-line dot-notation
703
703
  var MOUNT_URL = {"MOUNT_URL":"https://app.usecsv.com/importer"}["MOUNT_URL"] ;
704
- var insertIframe = function (id, importerDisplay) {
704
+ var insertIframe = function (id, importerDisplay, iframeId) {
705
705
  var usecsvInlineWrapper = document.getElementById("usecsv-importer-inline-wrapper");
706
706
  var usecsvContainerStyles = importerDisplay === "modal" || !usecsvInlineWrapper
707
707
  ? ".usecsv_container { position: fixed; top: 0px; bottom: 0; right: 0; left: 0; z-index: 100000; }"
@@ -710,6 +710,9 @@
710
710
  document.body.insertAdjacentHTML("beforeend", "<div id=".concat(id, " class=\"usecsv_container loading\"></div>"));
711
711
  var iframe = document.createElement("iframe");
712
712
  iframe.setAttribute("src", MOUNT_URL);
713
+ if (iframeId) {
714
+ iframe.setAttribute("id", iframeId);
715
+ }
713
716
  var usecsvContainer = document.getElementById(id);
714
717
  usecsvContainer === null || usecsvContainer === void 0 ? void 0 : usecsvContainer.appendChild(iframe);
715
718
  if (importerDisplay === "inline" && usecsvInlineWrapper) {
@@ -719,10 +722,10 @@
719
722
  return iframe;
720
723
  };
721
724
  var useCsvPlugin = function (_a) {
722
- 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;
725
+ 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;
723
726
  var id = "usecsv-".concat(Math.round(Math.random() * 100000000));
724
727
  return whenDomReady().then(function () {
725
- var iframe = insertIframe(id, importerDisplay);
728
+ var iframe = insertIframe(id, importerDisplay, iframeId);
726
729
  var closeIframe = function () {
727
730
  var _a;
728
731
  (_a = document.getElementById(id)) === null || _a === void 0 ? void 0 : _a.remove();