@sutech_jp/datatraveler-react-client 0.0.21 → 0.0.23
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,9 +1,9 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
|
-
import { Binder, DataTravelerResult, Mapper, ImportType, UseReportType } from './types';
|
|
2
|
+
import { Binder, DataTravelerResult, Mapper, ImportType, UseReportType, Session } from './types';
|
|
3
3
|
declare type Props<D> = {
|
|
4
4
|
application: string;
|
|
5
5
|
schema: string;
|
|
6
|
-
|
|
6
|
+
session: Session | undefined;
|
|
7
7
|
googleToken?: string;
|
|
8
8
|
onImport: (result: DataTravelerResult<D>) => void;
|
|
9
9
|
onCancel?: () => void;
|
|
@@ -15,5 +15,5 @@ declare type Props<D> = {
|
|
|
15
15
|
height?: number;
|
|
16
16
|
report?: UseReportType;
|
|
17
17
|
};
|
|
18
|
-
export declare const DataTravelerImport: <D>({ application, schema,
|
|
18
|
+
export declare const DataTravelerImport: <D>({ application, schema, session, googleToken, importType, currentData, mapper, binder, width, height, report, onImport, onCancel, }: Props<D>) => ReactElement;
|
|
19
19
|
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 application = _a.application, schema = _a.schema,
|
|
7
|
+
var application = _a.application, schema = _a.schema, session = _a.session, googleToken = _a.googleToken, _b = _a.importType, importType = _b === void 0 ? googleToken ? 'gss' : 'csv' : _b, _c = _a.currentData, currentData = _c === void 0 ? [] : _c, _d = _a.mapper, mapper = _d === void 0 ? {} : _d, _e = _a.binder, binder = _e === void 0 ? {} : _e, width = _a.width, height = _a.height, report = _a.report, 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;
|
|
@@ -61,9 +61,10 @@ var DataTravelerImport = function (_a) {
|
|
|
61
61
|
window.addEventListener('message', handleMessage);
|
|
62
62
|
return function () { return window.removeEventListener('message', handleMessage); };
|
|
63
63
|
}, [handleMessage]);
|
|
64
|
-
return ((0, jsx_runtime_1.jsx)("iframe", { ref: iframe, id: "datatraveler", name: "datatraveler",
|
|
65
|
-
width: width !== undefined ? "".concat(width, "px") : '
|
|
66
|
-
height: height !== undefined ? "".concat(height, "px") : '
|
|
64
|
+
return ((0, jsx_runtime_1.jsx)("iframe", { ref: iframe, id: "datatraveler", name: "datatraveler", src: session === null || session === void 0 ? void 0 : session.newUrl, style: {
|
|
65
|
+
width: width !== undefined ? "".concat(width, "px") : '100%',
|
|
66
|
+
height: height !== undefined ? "".concat(height, "px") : '100%',
|
|
67
|
+
border: 0,
|
|
67
68
|
} }));
|
|
68
69
|
};
|
|
69
70
|
exports.DataTravelerImport = DataTravelerImport;
|
package/dist/types.d.ts
CHANGED