@sutech_jp/raas-react-client 0.0.17 → 0.0.18

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.
@@ -31,10 +31,10 @@ 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, height = _a.height;
35
- var _e = __read((0, react_1.useState)('unauthorized'), 2), formState = _e[0], setFormState = _e[1];
36
- var _f = __read((0, react_1.useState)(), 2), contentHeight = _f[0], setContentHeight = _f[1];
37
- var _g = __read((0, react_1.useState)(false), 2), layoutInitialized = _g[0], setLayoutInitialized = _g[1];
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;
35
+ var _f = __read((0, react_1.useState)('unauthorized'), 2), formState = _f[0], setFormState = _f[1];
36
+ var _g = __read((0, react_1.useState)(), 2), contentHeight = _g[0], setContentHeight = _g[1];
37
+ var _h = __read((0, react_1.useState)(false), 2), layoutInitialized = _h[0], setLayoutInitialized = _h[1];
38
38
  var iframe = (0, react_1.useRef)(null);
39
39
  (0, react_1.useEffect)(function () {
40
40
  var _a;
@@ -116,7 +116,7 @@ var ReportPaperForm = function (_a) {
116
116
  }, [handleMessage]);
117
117
  return ((0, jsx_runtime_1.jsx)("iframe", { ref: iframe, id: "paper-form", name: "paperForm", src: url, style: {
118
118
  width: width,
119
- height: height !== null && height !== void 0 ? height : "".concat(contentHeight ? contentHeight + 10 : 240, "px"),
119
+ height: height || "".concat(contentHeight ? contentHeight + 10 : 240, "px"),
120
120
  border: 0,
121
121
  } }));
122
122
  };
@@ -5,7 +5,7 @@ declare type Ret<D> = {
5
5
  hasRequiredBlank: boolean;
6
6
  onInitialize: (data: D) => void;
7
7
  onReset: () => void;
8
- paperFormArgs: PaperFormArgs<D>;
8
+ paperFormArgs: Required<PaperFormArgs<D>>;
9
9
  generatePdfArgs: {
10
10
  data: D;
11
11
  customData: CustomData;
@@ -19,14 +19,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
19
19
  exports.useReportPaperForm = void 0;
20
20
  var react_1 = require("react");
21
21
  var useReportPaperForm = function (initialData, options) {
22
- var _a = __read((0, react_1.useState)(initialData), 2), data = _a[0], setData = _a[1];
23
- var _b = __read((0, react_1.useState)(initialData), 2), originalData = _b[0], setOriginalData = _b[1];
24
- var _c = __read((0, react_1.useState)([]), 2), customData = _c[0], setCustomData = _c[1];
25
- var _d = __read((0, react_1.useState)([]), 2), reportOptions = _d[0], setReportOptions = _d[1];
26
- var _e = __read((0, react_1.useState)(), 2), layout = _e[0], setLayout = _e[1];
27
- var _f = __read((0, react_1.useState)(0), 2), version = _f[0], setVersion = _f[1]; // flag to force update layout
28
- var _g = __read((0, react_1.useState)(false), 2), dirty = _g[0], setDirty = _g[1];
29
- var _h = __read((0, react_1.useState)(false), 2), hasRequiredBlank = _h[0], setHasRequiredBlank = _h[1];
22
+ var _a, _b;
23
+ var _c = __read((0, react_1.useState)(initialData), 2), data = _c[0], setData = _c[1];
24
+ var _d = __read((0, react_1.useState)(initialData), 2), originalData = _d[0], setOriginalData = _d[1];
25
+ var _e = __read((0, react_1.useState)([]), 2), customData = _e[0], setCustomData = _e[1];
26
+ var _f = __read((0, react_1.useState)([]), 2), reportOptions = _f[0], setReportOptions = _f[1];
27
+ var _g = __read((0, react_1.useState)(), 2), layout = _g[0], setLayout = _g[1];
28
+ var _h = __read((0, react_1.useState)(0), 2), version = _h[0], setVersion = _h[1]; // flag to force update layout
29
+ var _j = __read((0, react_1.useState)(false), 2), dirty = _j[0], setDirty = _j[1];
30
+ var _k = __read((0, react_1.useState)(false), 2), hasRequiredBlank = _k[0], setHasRequiredBlank = _k[1];
30
31
  var onInitialize = (0, react_1.useCallback)(function (data) {
31
32
  setData(data);
32
33
  setOriginalData(data);
@@ -76,8 +77,8 @@ var useReportPaperForm = function (initialData, options) {
76
77
  onRender: onRender,
77
78
  editability: (options === null || options === void 0 ? void 0 : options.editability) || 'none',
78
79
  layoutEditable: (options === null || options === void 0 ? void 0 : options.layoutEditable) || false,
79
- width: options === null || options === void 0 ? void 0 : options.width,
80
- height: options === null || options === void 0 ? void 0 : options.height,
80
+ width: (_a = options === null || options === void 0 ? void 0 : options.width) !== null && _a !== void 0 ? _a : '100%',
81
+ height: (_b = options === null || options === void 0 ? void 0 : options.height) !== null && _b !== void 0 ? _b : 0,
81
82
  version: version,
82
83
  },
83
84
  generatePdfArgs: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sutech_jp/raas-react-client",
3
- "version": "0.0.17",
3
+ "version": "0.0.18",
4
4
  "description": "react client for raas produced by SuTech",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",