@sutech_jp/datatraveler-react-client 0.0.12 → 0.0.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.
|
@@ -6,6 +6,8 @@ export declare type DataImportResult<D> = {
|
|
|
6
6
|
dataImportLogId: string;
|
|
7
7
|
};
|
|
8
8
|
declare type Props<D> = {
|
|
9
|
+
application: string;
|
|
10
|
+
schema: string;
|
|
9
11
|
url: string;
|
|
10
12
|
importDef: DataImportDef<D>;
|
|
11
13
|
googleToken?: string;
|
|
@@ -16,5 +18,5 @@ declare type Props<D> = {
|
|
|
16
18
|
width?: number;
|
|
17
19
|
height?: number;
|
|
18
20
|
};
|
|
19
|
-
export declare const DataTravelerImport: <D>({ url, importDef, googleToken, currentData, maps, width, height, onImport, onCancel, }: Props<D>) => ReactElement;
|
|
21
|
+
export declare const DataTravelerImport: <D>({ application, schema, url, importDef, googleToken, currentData, maps, width, height, onImport, onCancel, }: Props<D>) => ReactElement;
|
|
20
22
|
export {};
|
|
@@ -4,7 +4,7 @@ exports.DataTravelerImport = void 0;
|
|
|
4
4
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
var react_1 = require("react");
|
|
6
6
|
var DataTravelerImport = function (_a) {
|
|
7
|
-
var url = _a.url, importDef = _a.importDef, googleToken = _a.googleToken, _b = _a.currentData, currentData = _b === void 0 ? [] : _b, _c = _a.maps, maps = _c === void 0 ? {} : _c, width = _a.width, height = _a.height, onImport = _a.onImport, onCancel = _a.onCancel;
|
|
7
|
+
var application = _a.application, schema = _a.schema, url = _a.url, importDef = _a.importDef, googleToken = _a.googleToken, _b = _a.currentData, currentData = _b === void 0 ? [] : _b, _c = _a.maps, maps = _c === void 0 ? {} : _c, width = _a.width, height = _a.height, onImport = _a.onImport, onCancel = _a.onCancel;
|
|
8
8
|
var iframe = (0, react_1.useRef)(null);
|
|
9
9
|
var handleMessage = (0, react_1.useCallback)(function (e) {
|
|
10
10
|
var _a;
|
|
@@ -22,6 +22,8 @@ var DataTravelerImport = function (_a) {
|
|
|
22
22
|
iframeWindow.postMessage({
|
|
23
23
|
from: 'dataTravelerClient',
|
|
24
24
|
action: 'onShow',
|
|
25
|
+
application: application,
|
|
26
|
+
schema: schema,
|
|
25
27
|
importDef: importDef,
|
|
26
28
|
currentData: currentData,
|
|
27
29
|
maps: maps,
|
|
@@ -39,7 +41,7 @@ var DataTravelerImport = function (_a) {
|
|
|
39
41
|
else if (action === 'onCancel') {
|
|
40
42
|
onCancel && onCancel();
|
|
41
43
|
}
|
|
42
|
-
}, [importDef, currentData, maps, onCancel, googleToken, width, height, onImport]);
|
|
44
|
+
}, [application, schema, importDef, currentData, maps, onCancel, googleToken, width, height, onImport]);
|
|
43
45
|
(0, react_1.useEffect)(function () {
|
|
44
46
|
window.addEventListener('message', handleMessage);
|
|
45
47
|
return function () { return window.removeEventListener('message', handleMessage); };
|
|
@@ -6,6 +6,8 @@ declare type DataImportResult<D> = {
|
|
|
6
6
|
dataImportLogId: string;
|
|
7
7
|
};
|
|
8
8
|
declare type Props<D> = {
|
|
9
|
+
application: string;
|
|
10
|
+
schema: string;
|
|
9
11
|
url: string;
|
|
10
12
|
entitySchemas: EntitySchema[];
|
|
11
13
|
googleToken?: string;
|
|
@@ -17,5 +19,5 @@ declare type Props<D> = {
|
|
|
17
19
|
width?: number;
|
|
18
20
|
height?: number;
|
|
19
21
|
};
|
|
20
|
-
export declare const DataTravelerImportNew: <D>({ url, entitySchemas, googleToken, csvParseSetting, currentData, maps, width, height, onImport, onCancel, }: Props<D>) => ReactElement;
|
|
22
|
+
export declare const DataTravelerImportNew: <D>({ application, schema, url, entitySchemas, googleToken, csvParseSetting, currentData, maps, width, height, onImport, onCancel, }: Props<D>) => ReactElement;
|
|
21
23
|
export {};
|
|
@@ -4,7 +4,7 @@ exports.DataTravelerImportNew = void 0;
|
|
|
4
4
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
var react_1 = require("react");
|
|
6
6
|
var DataTravelerImportNew = function (_a) {
|
|
7
|
-
var url = _a.url, entitySchemas = _a.entitySchemas, googleToken = _a.googleToken, _b = _a.csvParseSetting, csvParseSetting = _b === void 0 ? {} : _b, _c = _a.currentData, currentData = _c === void 0 ? [] : _c, _d = _a.maps, maps = _d === void 0 ? {} : _d, width = _a.width, height = _a.height, onImport = _a.onImport, onCancel = _a.onCancel;
|
|
7
|
+
var application = _a.application, schema = _a.schema, url = _a.url, entitySchemas = _a.entitySchemas, googleToken = _a.googleToken, _b = _a.csvParseSetting, csvParseSetting = _b === void 0 ? {} : _b, _c = _a.currentData, currentData = _c === void 0 ? [] : _c, _d = _a.maps, maps = _d === void 0 ? {} : _d, width = _a.width, height = _a.height, onImport = _a.onImport, onCancel = _a.onCancel;
|
|
8
8
|
var iframe = (0, react_1.useRef)(null);
|
|
9
9
|
var handleMessage = (0, react_1.useCallback)(function (e) {
|
|
10
10
|
var _a;
|
|
@@ -22,6 +22,8 @@ var DataTravelerImportNew = function (_a) {
|
|
|
22
22
|
iframeWindow.postMessage({
|
|
23
23
|
from: 'dataTravelerClient',
|
|
24
24
|
action: 'onShow',
|
|
25
|
+
application: application,
|
|
26
|
+
schema: schema,
|
|
25
27
|
entitySchemas: entitySchemas,
|
|
26
28
|
csvParseSetting: csvParseSetting,
|
|
27
29
|
currentData: currentData,
|
|
@@ -40,7 +42,19 @@ var DataTravelerImportNew = function (_a) {
|
|
|
40
42
|
else if (action === 'onCancel') {
|
|
41
43
|
onCancel && onCancel();
|
|
42
44
|
}
|
|
43
|
-
}, [
|
|
45
|
+
}, [
|
|
46
|
+
application,
|
|
47
|
+
schema,
|
|
48
|
+
entitySchemas,
|
|
49
|
+
csvParseSetting,
|
|
50
|
+
currentData,
|
|
51
|
+
maps,
|
|
52
|
+
onCancel,
|
|
53
|
+
googleToken,
|
|
54
|
+
width,
|
|
55
|
+
height,
|
|
56
|
+
onImport,
|
|
57
|
+
]);
|
|
44
58
|
(0, react_1.useEffect)(function () {
|
|
45
59
|
window.addEventListener('message', handleMessage);
|
|
46
60
|
return function () { return window.removeEventListener('message', handleMessage); };
|