@sutech_jp/raas-react-client 0.0.26 → 0.0.28

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,6 +1,7 @@
1
1
  import { VFC } from 'react';
2
+ import { Session } from '../types';
2
3
  declare type ReportConfigProps = {
3
- url: string;
4
+ session: Session | undefined;
4
5
  width?: string | number;
5
6
  height?: string | number;
6
7
  hideTenantInfoConfig?: boolean;
@@ -4,7 +4,7 @@ exports.ReportConfig = void 0;
4
4
  var jsx_runtime_1 = require("react/jsx-runtime");
5
5
  var react_1 = require("react");
6
6
  var ReportConfig = function (_a) {
7
- var url = _a.url, _b = _a.width, width = _b === void 0 ? '100%' : _b, _c = _a.height, height = _c === void 0 ? '100%' : _c, _d = _a.hideTenantInfoConfig, hideTenantInfoConfig = _d === void 0 ? false : _d, _e = _a.toolbarPosition, toolbarPosition = _e === void 0 ? 'bottom' : _e;
7
+ var session = _a.session, _b = _a.width, width = _b === void 0 ? '100%' : _b, _c = _a.height, height = _c === void 0 ? '100%' : _c, _d = _a.hideTenantInfoConfig, hideTenantInfoConfig = _d === void 0 ? false : _d, _e = _a.toolbarPosition, toolbarPosition = _e === void 0 ? 'bottom' : _e;
8
8
  var iframe = (0, react_1.useRef)(null);
9
9
  var handleMessage = (0, react_1.useCallback)(function (e) {
10
10
  var _a;
@@ -32,6 +32,6 @@ var ReportConfig = function (_a) {
32
32
  window.addEventListener('message', handleMessage);
33
33
  return function () { return window.removeEventListener('message', handleMessage); };
34
34
  }, [handleMessage]);
35
- return (0, jsx_runtime_1.jsx)("iframe", { ref: iframe, id: "config", src: url, style: { width: width, height: height, border: 0 } });
35
+ return (0, jsx_runtime_1.jsx)("iframe", { ref: iframe, id: "config", src: session === null || session === void 0 ? void 0 : session.newUrl, style: { width: width, height: height, border: 0 } });
36
36
  };
37
37
  exports.ReportConfig = ReportConfig;
@@ -1,6 +1,7 @@
1
1
  import { VFC } from 'react';
2
+ import { Session } from '../types';
2
3
  declare type Props = {
3
- url: string;
4
+ session: Session | undefined;
4
5
  data?: Record<string, any>;
5
6
  width?: string | number;
6
7
  height?: string | number;
@@ -4,7 +4,7 @@ exports.ReportDesigner = void 0;
4
4
  var jsx_runtime_1 = require("react/jsx-runtime");
5
5
  var react_1 = require("react");
6
6
  var ReportDesigner = function (_a) {
7
- var url = _a.url, data = _a.data, _b = _a.width, width = _b === void 0 ? '100%' : _b, _c = _a.height, height = _c === void 0 ? '100%' : _c, onBack = _a.onBack;
7
+ var session = _a.session, data = _a.data, _b = _a.width, width = _b === void 0 ? '100%' : _b, _c = _a.height, height = _c === void 0 ? '100%' : _c, onBack = _a.onBack;
8
8
  var iframe = (0, react_1.useRef)(null);
9
9
  var handleMessage = (0, react_1.useCallback)(function (e) {
10
10
  var _a;
@@ -32,6 +32,6 @@ var ReportDesigner = function (_a) {
32
32
  window.addEventListener('message', handleMessage);
33
33
  return function () { return window.removeEventListener('message', handleMessage); };
34
34
  }, [handleMessage]);
35
- return (0, jsx_runtime_1.jsx)("iframe", { ref: iframe, id: "designer", src: url, style: { width: width, height: height, border: 0 } });
35
+ return (0, jsx_runtime_1.jsx)("iframe", { ref: iframe, id: "designer", src: session === null || session === void 0 ? void 0 : session.newUrl, style: { width: width, height: height, border: 0 } });
36
36
  };
37
37
  exports.ReportDesigner = ReportDesigner;
@@ -1,3 +1,3 @@
1
1
  import { ReactElement } from 'react';
2
2
  import { ReportPaperFormProps } from '../types';
3
- export declare const ReportPaperForm: <D>({ url, layoutId, data, onDataUpdate, customData, onCustomDataUpdate, onRender, reportOptions, layout, onLayoutUpdate, editability, layoutEditable, version, width, height, }: ReportPaperFormProps<D>) => ReactElement;
3
+ export declare const ReportPaperForm: <D>({ session, layoutId, data, onDataUpdate, customData, onCustomDataUpdate, onRender, reportOptions, layout, onLayoutUpdate, editability, layoutEditable, version, width, height, }: ReportPaperFormProps<D>) => ReactElement;
@@ -31,7 +31,7 @@ exports.ReportPaperForm = void 0;
31
31
  var jsx_runtime_1 = require("react/jsx-runtime");
32
32
  var react_1 = require("react");
33
33
  var ReportPaperForm = function (_a) {
34
- var url = _a.url, layoutId = _a.layoutId, data = _a.data, onDataUpdate = _a.onDataUpdate, customData = _a.customData, onCustomDataUpdate = _a.onCustomDataUpdate, onRender = _a.onRender, reportOptions = _a.reportOptions, layout = _a.layout, onLayoutUpdate = _a.onLayoutUpdate, _b = _a.editability, editability = _b === void 0 ? 'none' : _b, _c = _a.layoutEditable, layoutEditable = _c === void 0 ? false : _c, version = _a.version, _d = _a.width, width = _d === void 0 ? '100%' : _d, _e = _a.height, height = _e === void 0 ? 0 : _e;
34
+ var session = _a.session, layoutId = _a.layoutId, data = _a.data, onDataUpdate = _a.onDataUpdate, customData = _a.customData, onCustomDataUpdate = _a.onCustomDataUpdate, onRender = _a.onRender, reportOptions = _a.reportOptions, layout = _a.layout, onLayoutUpdate = _a.onLayoutUpdate, _b = _a.editability, editability = _b === void 0 ? 'none' : _b, _c = _a.layoutEditable, layoutEditable = _c === void 0 ? false : _c, version = _a.version, _d = _a.width, width = _d === void 0 ? '100%' : _d, _e = _a.height, height = _e === void 0 ? 0 : _e;
35
35
  var _f = __read((0, react_1.useState)('unauthorized'), 2), formState = _f[0], setFormState = _f[1];
36
36
  var _g = __read((0, react_1.useState)(), 2), contentHeight = _g[0], setContentHeight = _g[1];
37
37
  var _h = __read((0, react_1.useState)(false), 2), layoutInitialized = _h[0], setLayoutInitialized = _h[1];
@@ -114,7 +114,7 @@ var ReportPaperForm = function (_a) {
114
114
  window.addEventListener('message', handleMessage);
115
115
  return function () { return window.removeEventListener('message', handleMessage); };
116
116
  }, [handleMessage]);
117
- return ((0, jsx_runtime_1.jsx)("iframe", { ref: iframe, id: "paper-form", name: "paperForm", src: url, style: {
117
+ return ((0, jsx_runtime_1.jsx)("iframe", { ref: iframe, id: "paper-form", name: "paperForm", src: session === null || session === void 0 ? void 0 : session.newUrl, style: {
118
118
  width: width,
119
119
  height: height || "".concat(contentHeight ? contentHeight + 10 : 240, "px"),
120
120
  border: 0,
@@ -1,6 +1,7 @@
1
1
  import { FC } from 'react';
2
+ import { Session } from '../types';
2
3
  declare type LayoutGalleryProps = {
3
- url: string;
4
+ session: Session | undefined;
4
5
  width?: string | number;
5
6
  height?: string | number;
6
7
  onSelectLayout?: (layoutId?: number) => void;
@@ -4,7 +4,7 @@ exports.ReportLayoutGallery = void 0;
4
4
  var jsx_runtime_1 = require("react/jsx-runtime");
5
5
  var react_1 = require("react");
6
6
  var ReportLayoutGallery = function (_a) {
7
- var url = _a.url, _b = _a.width, width = _b === void 0 ? '100%' : _b, _c = _a.height, height = _c === void 0 ? '100%' : _c, onSelectLayout = _a.onSelectLayout, onEditLayout = _a.onEditLayout, onCreateLayout = _a.onCreateLayout;
7
+ var session = _a.session, _b = _a.width, width = _b === void 0 ? '100%' : _b, _c = _a.height, height = _c === void 0 ? '100%' : _c, onSelectLayout = _a.onSelectLayout, onEditLayout = _a.onEditLayout, onCreateLayout = _a.onCreateLayout;
8
8
  var iframe = (0, react_1.useRef)(null);
9
9
  var handleMessage = (0, react_1.useCallback)(function (e) {
10
10
  var _a, _b, _c, _d, _e;
@@ -41,6 +41,6 @@ var ReportLayoutGallery = function (_a) {
41
41
  window.addEventListener('message', handleMessage);
42
42
  return function () { return window.removeEventListener('message', handleMessage); };
43
43
  }, [handleMessage]);
44
- return (0, jsx_runtime_1.jsx)("iframe", { ref: iframe, id: "gallery", src: url, style: { width: width, height: height, border: 0 } });
44
+ return (0, jsx_runtime_1.jsx)("iframe", { ref: iframe, id: "gallery", src: session === null || session === void 0 ? void 0 : session.newUrl, style: { width: width, height: height, border: 0 } });
45
45
  };
46
46
  exports.ReportLayoutGallery = ReportLayoutGallery;
@@ -26,7 +26,12 @@ export declare type PaperFormArgs<D> = {
26
26
  height?: string | number;
27
27
  } & (LayoutEditable | LayoutNotEditable);
28
28
  export declare type ReportPaperFormProps<D> = {
29
- url: string;
29
+ session: Session | undefined;
30
30
  layoutId: number;
31
31
  } & PaperFormArgs<D>;
32
+ export declare type Session = {
33
+ application: string;
34
+ url: string;
35
+ newUrl: string;
36
+ };
32
37
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sutech_jp/raas-react-client",
3
- "version": "0.0.26",
3
+ "version": "0.0.28",
4
4
  "description": "react client for raas produced by SuTech",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",