@sutech_jp/raas-react-client 0.1.43 → 0.1.44

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.
@@ -13,6 +13,7 @@ declare type Props = {
13
13
  options?: ComponentOptions;
14
14
  onChange?: (property: string, rowIndex: number | undefined, value: ItemValue, dataList: BusinessDataList) => void;
15
15
  onChangeRow?: (operation: RowOperation, dataList: BusinessDataList) => void;
16
+ onReset?: (property: string, rowIndex: number | undefined, dataList: BusinessDataList) => void;
16
17
  onCompleteInput?: (dataList: BusinessDataList) => Promise<void>;
17
18
  onChangeOperating?: (operating: boolean) => void;
18
19
  onBack?: () => void;
@@ -57,7 +57,7 @@ var jsx_runtime_1 = require("react/jsx-runtime");
57
57
  var react_1 = require("react");
58
58
  var targetOrigin_1 = require("../util/targetOrigin");
59
59
  var ReportWebFormBulk = function (_a) {
60
- var session = _a.session, _b = _a.width, width = _b === void 0 ? '100%' : _b, _c = _a.height, height = _c === void 0 ? '100%' : _c, customStyles = _a.customStyles, layoutId = _a.layoutId, dataList = _a.dataList, extensionSchemaDef = _a.extensionSchemaDef, options = _a.options, onChange = _a.onChange, onChangeRow = _a.onChangeRow, onCompleteInput = _a.onCompleteInput, onChangeOperating = _a.onChangeOperating, onBack = _a.onBack;
60
+ var session = _a.session, _b = _a.width, width = _b === void 0 ? '100%' : _b, _c = _a.height, height = _c === void 0 ? '100%' : _c, customStyles = _a.customStyles, layoutId = _a.layoutId, dataList = _a.dataList, extensionSchemaDef = _a.extensionSchemaDef, options = _a.options, onChange = _a.onChange, onChangeRow = _a.onChangeRow, onReset = _a.onReset, onCompleteInput = _a.onCompleteInput, onChangeOperating = _a.onChangeOperating, onBack = _a.onBack;
61
61
  var _d = __read((0, react_1.useState)(false), 2), initialized = _d[0], setInitialized = _d[1];
62
62
  var prevInitialized = (0, react_1.useRef)(false);
63
63
  var iframe = (0, react_1.useRef)(null);
@@ -74,9 +74,9 @@ var ReportWebFormBulk = function (_a) {
74
74
  }, (0, targetOrigin_1.getTargetOrigin)(session === null || session === void 0 ? void 0 : session.newUrl));
75
75
  }, [session === null || session === void 0 ? void 0 : session.newUrl]);
76
76
  var handleMessage = (0, react_1.useCallback)(function (e) { return __awaiter(void 0, void 0, void 0, function () {
77
- var message, from, action, _a, property, rowIndex, value, dataList_1, _b, operation, dataList_2, dataList_3, operating;
78
- return __generator(this, function (_c) {
79
- switch (_c.label) {
77
+ var message, from, action, _a, property, rowIndex, value, dataList_1, _b, operation, dataList_2, _c, property, rowIndex, dataList_3, dataList_4, operating;
78
+ return __generator(this, function (_d) {
79
+ switch (_d.label) {
80
80
  case 0:
81
81
  if ((0, targetOrigin_1.getTargetOrigin)(session === null || session === void 0 ? void 0 : session.newUrl) !== '*' && e.origin !== (0, targetOrigin_1.getTargetOrigin)(session === null || session === void 0 ? void 0 : session.newUrl)) {
82
82
  return [2 /*return*/];
@@ -97,7 +97,7 @@ var ReportWebFormBulk = function (_a) {
97
97
  });
98
98
  // 初期化完了状態にする
99
99
  setInitialized(true);
100
- return [3 /*break*/, 6];
100
+ return [3 /*break*/, 7];
101
101
  case 1:
102
102
  if (!(action === 'onChange')) return [3 /*break*/, 2];
103
103
  if (!onChange) {
@@ -105,7 +105,7 @@ var ReportWebFormBulk = function (_a) {
105
105
  }
106
106
  _a = message.payload, property = _a.property, rowIndex = _a.rowIndex, value = _a.value, dataList_1 = _a.dataList;
107
107
  onChange(property, rowIndex, value, dataList_1);
108
- return [3 /*break*/, 6];
108
+ return [3 /*break*/, 7];
109
109
  case 2:
110
110
  if (!(action === 'onChangeRow')) return [3 /*break*/, 3];
111
111
  if (!onChangeRow) {
@@ -113,26 +113,34 @@ var ReportWebFormBulk = function (_a) {
113
113
  }
114
114
  _b = message.payload, operation = _b.operation, dataList_2 = _b.dataList;
115
115
  onChangeRow(operation, dataList_2);
116
- return [3 /*break*/, 6];
116
+ return [3 /*break*/, 7];
117
117
  case 3:
118
- if (!(action === 'onCompleteInput')) return [3 /*break*/, 5];
118
+ if (!(action === 'onReset')) return [3 /*break*/, 4];
119
+ if (!onReset) {
120
+ return [2 /*return*/];
121
+ }
122
+ _c = message.payload, property = _c.property, rowIndex = _c.rowIndex, dataList_3 = _c.dataList;
123
+ onReset(property, rowIndex, dataList_3);
124
+ return [3 /*break*/, 7];
125
+ case 4:
126
+ if (!(action === 'onCompleteInput')) return [3 /*break*/, 6];
119
127
  if (!onCompleteInput) {
120
128
  // 結果メッセージを送信
121
129
  sendMessage('onCompleted', {}, message.messageId);
122
130
  return [2 /*return*/];
123
131
  }
124
- dataList_3 = message.payload;
132
+ dataList_4 = message.payload;
125
133
  // 入力完了処理を同期待ちする
126
- return [4 /*yield*/, onCompleteInput(dataList_3)
134
+ return [4 /*yield*/, onCompleteInput(dataList_4)
127
135
  // 結果メッセージを送信
128
136
  ];
129
- case 4:
137
+ case 5:
130
138
  // 入力完了処理を同期待ちする
131
- _c.sent();
139
+ _d.sent();
132
140
  // 結果メッセージを送信
133
141
  sendMessage('onCompleted', {}, message.messageId);
134
- return [3 /*break*/, 6];
135
- case 5:
142
+ return [3 /*break*/, 7];
143
+ case 6:
136
144
  if (action === 'onChangeOperating') {
137
145
  if (!onChangeOperating) {
138
146
  return [2 /*return*/];
@@ -146,8 +154,8 @@ var ReportWebFormBulk = function (_a) {
146
154
  }
147
155
  onBack();
148
156
  }
149
- _c.label = 6;
150
- case 6: return [2 /*return*/];
157
+ _d.label = 7;
158
+ case 7: return [2 /*return*/];
151
159
  }
152
160
  });
153
161
  }); }, [
@@ -159,6 +167,7 @@ var ReportWebFormBulk = function (_a) {
159
167
  onChange,
160
168
  onChangeOperating,
161
169
  onChangeRow,
170
+ onReset,
162
171
  onCompleteInput,
163
172
  options,
164
173
  sendMessage,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sutech_jp/raas-react-client",
3
- "version": "0.1.43",
3
+ "version": "0.1.44",
4
4
  "description": "react client for raas produced by SuTech",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",