@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.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
|
*/
|
|
@@ -34,7 +34,7 @@ function __rest(s, e) {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
/*!
|
|
37
|
-
* @usecsv/js v0.
|
|
37
|
+
* @usecsv/js v0.8.1
|
|
38
38
|
* (c) layercode
|
|
39
39
|
* Released under the MIT License.
|
|
40
40
|
*/
|
|
@@ -616,20 +616,28 @@ whenDomReady.resume = function (doc) {
|
|
|
616
616
|
|
|
617
617
|
// eslint-disable-next-line dot-notation
|
|
618
618
|
var MOUNT_URL = {"MOUNT_URL":"https://app.usecsv.com/importer"}["MOUNT_URL"] ;
|
|
619
|
-
var insertIframe = function (id) {
|
|
620
|
-
var
|
|
621
|
-
|
|
622
|
-
|
|
619
|
+
var insertIframe = function (id, importerDisplay) {
|
|
620
|
+
var usecsvInlineWrapper = document.getElementById("usecsv-importer-inline-wrapper");
|
|
621
|
+
var usecsvContainerStyles = importerDisplay === "modal" || !usecsvInlineWrapper
|
|
622
|
+
? ".usecsv_container { position: fixed; top: 0px; bottom: 0; right: 0; left: 0; z-index: 100000; }"
|
|
623
|
+
: "";
|
|
624
|
+
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"));
|
|
625
|
+
document.body.insertAdjacentHTML("beforeend", "<div id=".concat(id, " class=\"usecsv_container loading\"></div>"));
|
|
623
626
|
var iframe = document.createElement("iframe");
|
|
624
627
|
iframe.setAttribute("src", MOUNT_URL);
|
|
625
|
-
|
|
628
|
+
var usecsvContainer = document.getElementById(id);
|
|
629
|
+
usecsvContainer === null || usecsvContainer === void 0 ? void 0 : usecsvContainer.appendChild(iframe);
|
|
630
|
+
if (importerDisplay === "inline" && usecsvInlineWrapper) {
|
|
631
|
+
// usecsvInlineWrapper > usecsvContainer > iframe
|
|
632
|
+
usecsvInlineWrapper === null || usecsvInlineWrapper === void 0 ? void 0 : usecsvInlineWrapper.appendChild(usecsvContainer);
|
|
633
|
+
}
|
|
626
634
|
return iframe;
|
|
627
635
|
};
|
|
628
636
|
var useCsvPlugin = function (_a) {
|
|
629
|
-
var importerKey = _a.importerKey, user = _a.user, metadata = _a.metadata, onData = _a.onData, onRecordsInitial = _a.onRecordsInitial, onRecordEdit = _a.onRecordEdit;
|
|
637
|
+
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;
|
|
630
638
|
var id = "usecsv-".concat(Math.round(Math.random() * 100000000));
|
|
631
639
|
return whenDomReady().then(function () {
|
|
632
|
-
var iframe = insertIframe(id);
|
|
640
|
+
var iframe = insertIframe(id, importerDisplay);
|
|
633
641
|
var closeIframe = function () {
|
|
634
642
|
var _a;
|
|
635
643
|
(_a = document.getElementById(id)) === null || _a === void 0 ? void 0 : _a.remove();
|
|
@@ -654,7 +662,7 @@ var useCsvPlugin = function (_a) {
|
|
|
654
662
|
var _a;
|
|
655
663
|
(_a = document.getElementById(id)) === null || _a === void 0 ? void 0 : _a.classList.remove("loading");
|
|
656
664
|
// eslint-disable-next-line dot-notation
|
|
657
|
-
child["setParams"] && child["setParams"]({ importerKey: importerKey, user: user, metadata: metadata });
|
|
665
|
+
child["setParams"] && child["setParams"]({ importerKey: importerKey, user: user, metadata: metadata, importerDisplay: importerDisplay });
|
|
658
666
|
});
|
|
659
667
|
return iframeConnection;
|
|
660
668
|
});
|