@sutech_jp/raas-react-client 0.0.19 → 0.0.21

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.
@@ -0,0 +1,10 @@
1
+ import { VFC } from 'react';
2
+ declare type ReportConfigProps = {
3
+ url: string;
4
+ width?: string | number;
5
+ height?: string | number;
6
+ hideTenantInfoConfig?: boolean;
7
+ toolbarPosition?: 'top' | 'bottom';
8
+ };
9
+ export declare const ReportConfig: VFC<ReportConfigProps>;
10
+ export {};
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReportConfig = void 0;
4
+ var jsx_runtime_1 = require("react/jsx-runtime");
5
+ var react_1 = require("react");
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;
8
+ var iframe = (0, react_1.useRef)(null);
9
+ (0, react_1.useEffect)(function () {
10
+ var _a;
11
+ var iframeWindow = (_a = iframe.current) === null || _a === void 0 ? void 0 : _a.contentWindow;
12
+ if (!iframeWindow)
13
+ return;
14
+ iframeWindow.postMessage({
15
+ from: 'configClient',
16
+ action: 'onShow',
17
+ props: {
18
+ hideTenantInfoConfig: hideTenantInfoConfig,
19
+ toolbarPosition: toolbarPosition,
20
+ },
21
+ }, '*');
22
+ }, [hideTenantInfoConfig, toolbarPosition]);
23
+ return (0, jsx_runtime_1.jsx)("iframe", { id: "config", src: url, style: { width: width, height: height, border: 0 } });
24
+ };
25
+ exports.ReportConfig = ReportConfig;
@@ -26,6 +26,8 @@ var ReportLayoutGallery = function (_a) {
26
26
  window.addEventListener('message', handleMessage);
27
27
  return function () { return window.removeEventListener('message', handleMessage); };
28
28
  }, [handleMessage]);
29
- return (0, jsx_runtime_1.jsx)("iframe", { id: "gallery", src: url, style: { width: width, height: height, border: 0 } });
29
+ var operation = "".concat(onSelectLayout !== undefined ? 's' : '').concat(onEditLayout !== undefined ? 'e' : '').concat(onCreateLayout !== undefined ? 'c' : '');
30
+ var operationalURL = "".concat(url).concat(operation ? "?operation=".concat(operation) : '');
31
+ return (0, jsx_runtime_1.jsx)("iframe", { id: "gallery", src: operationalURL, style: { width: width, height: height, border: 0 } });
30
32
  };
31
33
  exports.ReportLayoutGallery = ReportLayoutGallery;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sutech_jp/raas-react-client",
3
- "version": "0.0.19",
3
+ "version": "0.0.21",
4
4
  "description": "react client for raas produced by SuTech",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",