@sutech_jp/raas-react-client 0.1.47 → 0.1.48
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.
|
@@ -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 ReportWebFormEditMulti = 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,
|
|
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, validate = _a.validate, validateAll = _a.validateAll, onChange = _a.onChange, onChangeList = _a.onChangeList, onChangeRow = _a.onChangeRow, 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,7 +74,7 @@ var ReportWebFormEditMulti = 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, dataIndex, property, listProperty, rowIndex, value,
|
|
77
|
+
var message, from, action, _a, dataIndex, property, listProperty, rowIndex, value, dataList_1, result_1, result, _b, dataIndex, values, dataList_2, results, _c, dataIndex, property, listProperty, rowIndex, value, dataList_3, _d, dataIndex, changes, dataList_4, _e, dataIndex, operation, dataList_5, dataList_6, operating;
|
|
78
78
|
return __generator(this, function (_f) {
|
|
79
79
|
switch (_f.label) {
|
|
80
80
|
case 0:
|
|
@@ -91,8 +91,7 @@ var ReportWebFormEditMulti = function (_a) {
|
|
|
91
91
|
sendMessage('onShow', {
|
|
92
92
|
customStyles: customStyles,
|
|
93
93
|
layoutId: layoutId,
|
|
94
|
-
|
|
95
|
-
fileName: fileName,
|
|
94
|
+
dataList: dataList,
|
|
96
95
|
extensionSchemaDef: extensionSchemaDef,
|
|
97
96
|
options: options,
|
|
98
97
|
});
|
|
@@ -101,7 +100,7 @@ var ReportWebFormEditMulti = function (_a) {
|
|
|
101
100
|
return [3 /*break*/, 11];
|
|
102
101
|
case 1:
|
|
103
102
|
if (!(action === 'onValidate')) return [3 /*break*/, 3];
|
|
104
|
-
_a = message.payload, dataIndex = _a.dataIndex, property = _a.property, listProperty = _a.listProperty, rowIndex = _a.rowIndex, value = _a.value,
|
|
103
|
+
_a = message.payload, dataIndex = _a.dataIndex, property = _a.property, listProperty = _a.listProperty, rowIndex = _a.rowIndex, value = _a.value, dataList_1 = _a.dataList;
|
|
105
104
|
if (!validate) {
|
|
106
105
|
result_1 = {
|
|
107
106
|
type: 'custom',
|
|
@@ -112,7 +111,7 @@ var ReportWebFormEditMulti = function (_a) {
|
|
|
112
111
|
sendMessage('onValidated', result_1, message.messageId);
|
|
113
112
|
return [2 /*return*/];
|
|
114
113
|
}
|
|
115
|
-
return [4 /*yield*/, validate(dataIndex, property, listProperty, rowIndex, value,
|
|
114
|
+
return [4 /*yield*/, validate(dataIndex, property, listProperty, rowIndex, value, dataList_1)
|
|
116
115
|
// バリデーション結果を送信
|
|
117
116
|
];
|
|
118
117
|
case 2:
|
|
@@ -127,8 +126,8 @@ var ReportWebFormEditMulti = function (_a) {
|
|
|
127
126
|
sendMessage('onValidatedAll', [], message.messageId);
|
|
128
127
|
return [2 /*return*/];
|
|
129
128
|
}
|
|
130
|
-
_b = message.payload, dataIndex = _b.dataIndex,
|
|
131
|
-
return [4 /*yield*/, validateAll(dataIndex,
|
|
129
|
+
_b = message.payload, dataIndex = _b.dataIndex, values = _b.values, dataList_2 = _b.dataList;
|
|
130
|
+
return [4 /*yield*/, validateAll(dataIndex, values, dataList_2)
|
|
132
131
|
// バリデーション結果を送信
|
|
133
132
|
];
|
|
134
133
|
case 4:
|
|
@@ -141,24 +140,24 @@ var ReportWebFormEditMulti = function (_a) {
|
|
|
141
140
|
if (!onChange) {
|
|
142
141
|
return [2 /*return*/];
|
|
143
142
|
}
|
|
144
|
-
_c = message.payload, dataIndex = _c.dataIndex, property = _c.property, listProperty = _c.listProperty, rowIndex = _c.rowIndex, value = _c.value,
|
|
145
|
-
onChange(dataIndex, property, listProperty, rowIndex, value,
|
|
143
|
+
_c = message.payload, dataIndex = _c.dataIndex, property = _c.property, listProperty = _c.listProperty, rowIndex = _c.rowIndex, value = _c.value, dataList_3 = _c.dataList;
|
|
144
|
+
onChange(dataIndex, property, listProperty, rowIndex, value, dataList_3);
|
|
146
145
|
return [3 /*break*/, 11];
|
|
147
146
|
case 6:
|
|
148
147
|
if (!(action === 'onChangeList')) return [3 /*break*/, 7];
|
|
149
148
|
if (!onChangeList) {
|
|
150
149
|
return [2 /*return*/];
|
|
151
150
|
}
|
|
152
|
-
_d = message.payload, dataIndex = _d.dataIndex, changes = _d.changes,
|
|
153
|
-
onChangeList(dataIndex, changes,
|
|
151
|
+
_d = message.payload, dataIndex = _d.dataIndex, changes = _d.changes, dataList_4 = _d.dataList;
|
|
152
|
+
onChangeList(dataIndex, changes, dataList_4);
|
|
154
153
|
return [3 /*break*/, 11];
|
|
155
154
|
case 7:
|
|
156
155
|
if (!(action === 'onChangeRow')) return [3 /*break*/, 8];
|
|
157
156
|
if (!onChangeRow) {
|
|
158
157
|
return [2 /*return*/];
|
|
159
158
|
}
|
|
160
|
-
_e = message.payload, dataIndex = _e.dataIndex, operation = _e.operation,
|
|
161
|
-
onChangeRow(dataIndex, operation,
|
|
159
|
+
_e = message.payload, dataIndex = _e.dataIndex, operation = _e.operation, dataList_5 = _e.dataList;
|
|
160
|
+
onChangeRow(dataIndex, operation, dataList_5);
|
|
162
161
|
return [3 /*break*/, 11];
|
|
163
162
|
case 8:
|
|
164
163
|
if (!(action === 'onCompleteInput')) return [3 /*break*/, 10];
|
|
@@ -167,9 +166,9 @@ var ReportWebFormEditMulti = function (_a) {
|
|
|
167
166
|
sendMessage('onCompleted', {}, message.messageId);
|
|
168
167
|
return [2 /*return*/];
|
|
169
168
|
}
|
|
170
|
-
|
|
169
|
+
dataList_6 = message.payload;
|
|
171
170
|
// 入力完了処理を同期待ちする
|
|
172
|
-
return [4 /*yield*/, onCompleteInput(
|
|
171
|
+
return [4 /*yield*/, onCompleteInput(dataList_6)
|
|
173
172
|
// 結果メッセージを送信
|
|
174
173
|
];
|
|
175
174
|
case 9:
|
|
@@ -198,8 +197,8 @@ var ReportWebFormEditMulti = function (_a) {
|
|
|
198
197
|
});
|
|
199
198
|
}); }, [
|
|
200
199
|
customStyles,
|
|
200
|
+
dataList,
|
|
201
201
|
extensionSchemaDef,
|
|
202
|
-
fileName,
|
|
203
202
|
layoutId,
|
|
204
203
|
onBack,
|
|
205
204
|
onChange,
|
|
@@ -212,7 +211,6 @@ var ReportWebFormEditMulti = function (_a) {
|
|
|
212
211
|
session === null || session === void 0 ? void 0 : session.newUrl,
|
|
213
212
|
validate,
|
|
214
213
|
validateAll,
|
|
215
|
-
values,
|
|
216
214
|
]);
|
|
217
215
|
// リスナーの登録は必ず先に済ませる必要があるため、useLayoutEffect を使用する
|
|
218
216
|
(0, react_1.useLayoutEffect)(function () {
|
|
@@ -227,11 +225,11 @@ var ReportWebFormEditMulti = function (_a) {
|
|
|
227
225
|
// 両方が true の場合のみデータ更新メッセージを送信する
|
|
228
226
|
if (initialized && wasInitialized) {
|
|
229
227
|
// データの更新があった場合は、データを送信する
|
|
230
|
-
sendMessage('onUpdateData',
|
|
228
|
+
sendMessage('onUpdateData', dataList);
|
|
231
229
|
}
|
|
232
230
|
// 現在の initialized の値を保存
|
|
233
231
|
prevInitialized.current = initialized;
|
|
234
|
-
}, [initialized,
|
|
232
|
+
}, [initialized, dataList, sendMessage]);
|
|
235
233
|
return (0, jsx_runtime_1.jsx)("iframe", { ref: iframe, id: "webform-edit-multi", src: session === null || session === void 0 ? void 0 : session.newUrl, style: { width: width, height: height, border: 0 } });
|
|
236
234
|
};
|
|
237
235
|
exports.ReportWebFormEditMulti = ReportWebFormEditMulti;
|