@usecsv/react 0.2.10 → 0.2.12
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/CHANGELOG.md +14 -0
- package/build/index.cjs +18 -10
- package/build/index.cjs.map +1 -1
- package/build/index.esm.js +18 -10
- package/build/index.esm.js.map +1 -1
- package/build/index.js +18 -10
- package/build/index.js.map +1 -1
- package/build/index.mjs +18 -10
- package/build/index.mjs.map +1 -1
- package/build/index.umd.js +18 -10
- package/build/index.umd.js.map +1 -1
- package/build/index.umd.min.js +4 -4
- package/build/index.umd.min.js.map +1 -1
- package/package.json +2 -2
package/build/index.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @usecsv/react v0.2.
|
|
2
|
+
* @usecsv/react v0.2.12
|
|
3
3
|
* (c) layercode
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
/*!
|
|
41
|
-
* @usecsv/js v0.
|
|
41
|
+
* @usecsv/js v0.8.1
|
|
42
42
|
* (c) layercode
|
|
43
43
|
* Released under the MIT License.
|
|
44
44
|
*/
|
|
@@ -620,20 +620,28 @@
|
|
|
620
620
|
|
|
621
621
|
// eslint-disable-next-line dot-notation
|
|
622
622
|
var MOUNT_URL = {"MOUNT_URL":"https://app.usecsv.com/importer"}["MOUNT_URL"] ;
|
|
623
|
-
var insertIframe = function (id) {
|
|
624
|
-
var
|
|
625
|
-
|
|
626
|
-
|
|
623
|
+
var insertIframe = function (id, importerDisplay) {
|
|
624
|
+
var usecsvInlineWrapper = document.getElementById("usecsv-importer-inline-wrapper");
|
|
625
|
+
var usecsvContainerStyles = importerDisplay === "modal" || !usecsvInlineWrapper
|
|
626
|
+
? ".usecsv_container { position: fixed; top: 0px; bottom: 0; right: 0; left: 0; z-index: 100000; }"
|
|
627
|
+
: "";
|
|
628
|
+
insertCss_2("\n ".concat(usecsvContainerStyles, "\n .usecsv_container iframe {\n width: 100%;\n height: 100%;\n position: absolute;\n border-width: 0;\n }\n .usecsv_container {\n overflow: hidden;\n overscroll-behavior-x: none;\n }\n"));
|
|
629
|
+
document.body.insertAdjacentHTML("beforeend", "<div id=".concat(id, " class=\"usecsv_container loading\"></div>"));
|
|
627
630
|
var iframe = document.createElement("iframe");
|
|
628
631
|
iframe.setAttribute("src", MOUNT_URL);
|
|
629
|
-
|
|
632
|
+
var usecsvContainer = document.getElementById(id);
|
|
633
|
+
usecsvContainer === null || usecsvContainer === void 0 ? void 0 : usecsvContainer.appendChild(iframe);
|
|
634
|
+
if (importerDisplay === "inline" && usecsvInlineWrapper) {
|
|
635
|
+
// usecsvInlineWrapper > usecsvContainer > iframe
|
|
636
|
+
usecsvInlineWrapper === null || usecsvInlineWrapper === void 0 ? void 0 : usecsvInlineWrapper.appendChild(usecsvContainer);
|
|
637
|
+
}
|
|
630
638
|
return iframe;
|
|
631
639
|
};
|
|
632
640
|
var useCsvPlugin = function (_a) {
|
|
633
|
-
var importerKey = _a.importerKey, user = _a.user, metadata = _a.metadata, onData = _a.onData, onRecordsInitial = _a.onRecordsInitial, onRecordEdit = _a.onRecordEdit;
|
|
641
|
+
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;
|
|
634
642
|
var id = "usecsv-".concat(Math.round(Math.random() * 100000000));
|
|
635
643
|
return whenDomReady().then(function () {
|
|
636
|
-
var iframe = insertIframe(id);
|
|
644
|
+
var iframe = insertIframe(id, importerDisplay);
|
|
637
645
|
var closeIframe = function () {
|
|
638
646
|
var _a;
|
|
639
647
|
(_a = document.getElementById(id)) === null || _a === void 0 ? void 0 : _a.remove();
|
|
@@ -658,7 +666,7 @@
|
|
|
658
666
|
var _a;
|
|
659
667
|
(_a = document.getElementById(id)) === null || _a === void 0 ? void 0 : _a.classList.remove("loading");
|
|
660
668
|
// eslint-disable-next-line dot-notation
|
|
661
|
-
child["setParams"] && child["setParams"]({ importerKey: importerKey, user: user, metadata: metadata });
|
|
669
|
+
child["setParams"] && child["setParams"]({ importerKey: importerKey, user: user, metadata: metadata, importerDisplay: importerDisplay });
|
|
662
670
|
});
|
|
663
671
|
return iframeConnection;
|
|
664
672
|
});
|