@sutech_jp/raas-react-client 0.1.35 → 0.1.37
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.
package/dist/types/webform.d.ts
CHANGED
|
@@ -16,3 +16,47 @@ export declare type CustomValidationResult = {
|
|
|
16
16
|
error: boolean;
|
|
17
17
|
message?: string;
|
|
18
18
|
};
|
|
19
|
+
export declare type ExtensionSchemaDef = {
|
|
20
|
+
container: ExtensionSchemaContainer;
|
|
21
|
+
properties: ExtensionSchemaProperty[];
|
|
22
|
+
};
|
|
23
|
+
export declare type ExtensionSchemaContainer = {
|
|
24
|
+
property: string;
|
|
25
|
+
caption: string;
|
|
26
|
+
};
|
|
27
|
+
export declare type ExtensionSchemaProperty = TextProperty | NumberProperty | DateProperty | DatetimeProperty | BooleanProperty;
|
|
28
|
+
export declare type PropertyBase = {
|
|
29
|
+
property: string;
|
|
30
|
+
caption: string;
|
|
31
|
+
required?: boolean;
|
|
32
|
+
};
|
|
33
|
+
export declare type TextProperty = {
|
|
34
|
+
type: 'text';
|
|
35
|
+
minLength?: number;
|
|
36
|
+
maxLength?: number;
|
|
37
|
+
} & PropertyBase;
|
|
38
|
+
export declare type NumberProperty = {
|
|
39
|
+
type: 'number';
|
|
40
|
+
min?: number;
|
|
41
|
+
max?: number;
|
|
42
|
+
minAcceptEqual?: boolean;
|
|
43
|
+
maxAcceptEqual?: boolean;
|
|
44
|
+
precision?: number;
|
|
45
|
+
} & PropertyBase;
|
|
46
|
+
export declare type DateProperty = {
|
|
47
|
+
type: 'date';
|
|
48
|
+
min?: Date;
|
|
49
|
+
max?: Date;
|
|
50
|
+
minAcceptEqual?: boolean;
|
|
51
|
+
maxAcceptEqual?: boolean;
|
|
52
|
+
} & PropertyBase;
|
|
53
|
+
export declare type DatetimeProperty = {
|
|
54
|
+
type: 'datetime';
|
|
55
|
+
min?: Date;
|
|
56
|
+
max?: Date;
|
|
57
|
+
minAcceptEqual?: boolean;
|
|
58
|
+
maxAcceptEqual?: boolean;
|
|
59
|
+
} & PropertyBase;
|
|
60
|
+
export declare type BooleanProperty = {
|
|
61
|
+
type: 'boolean';
|
|
62
|
+
} & PropertyBase;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VFC } from 'react';
|
|
2
|
-
import { BusinessData, CustomValidationResult, ComponentOptions, ItemValue } from 'src/types/webform';
|
|
2
|
+
import { BusinessData, CustomValidationResult, ComponentOptions, ItemValue, ExtensionSchemaDef } from 'src/types/webform';
|
|
3
3
|
import { Session } from '../types';
|
|
4
4
|
import { ThemeOptions } from '../types/theme';
|
|
5
5
|
declare type Props = {
|
|
@@ -10,11 +10,13 @@ declare type Props = {
|
|
|
10
10
|
layoutId: number;
|
|
11
11
|
values?: BusinessData;
|
|
12
12
|
fileName?: string;
|
|
13
|
+
extensionSchemaDef?: ExtensionSchemaDef;
|
|
13
14
|
options?: ComponentOptions;
|
|
14
15
|
validate?: (property: string, rowIndex: number | undefined, value: ItemValue, values: BusinessData) => Promise<CustomValidationResult>;
|
|
15
16
|
validateAll?: (values: BusinessData) => Promise<CustomValidationResult[]>;
|
|
16
17
|
onChange?: (property: string, rowIndex: number | undefined, value: ItemValue, values: BusinessData) => void;
|
|
17
18
|
onGenerate?: (logId: string) => void;
|
|
19
|
+
onChangeOperating?: (operating: boolean) => void;
|
|
18
20
|
onBack?: () => void;
|
|
19
21
|
};
|
|
20
22
|
export declare const ReportWebForm: VFC<Props>;
|
|
@@ -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 ReportWebForm = 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, values = _a.values, fileName = _a.fileName, options = _a.options, validate = _a.validate, validateAll = _a.validateAll, onChange = _a.onChange, onGenerate = _a.onGenerate, 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, values = _a.values, fileName = _a.fileName, extensionSchemaDef = _a.extensionSchemaDef, options = _a.options, validate = _a.validate, validateAll = _a.validateAll, onChange = _a.onChange, onGenerate = _a.onGenerate, 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);
|
|
@@ -87,7 +87,7 @@ var ReportWebForm = function (_a) {
|
|
|
87
87
|
prevInitialized.current = initialized;
|
|
88
88
|
}, [initialized, values, sendMessage]);
|
|
89
89
|
var handleMessage = (0, react_1.useCallback)(function (e) { return __awaiter(void 0, void 0, void 0, function () {
|
|
90
|
-
var message, from, action, _a, property, rowIndex, value, values_1, result_1, result, values_2, results, _b, property, rowIndex, value, values_3, logId;
|
|
90
|
+
var message, from, action, _a, property, rowIndex, value, values_1, result_1, result, values_2, results, _b, property, rowIndex, value, values_3, logId, operating;
|
|
91
91
|
return __generator(this, function (_c) {
|
|
92
92
|
switch (_c.label) {
|
|
93
93
|
case 0:
|
|
@@ -106,6 +106,7 @@ var ReportWebForm = function (_a) {
|
|
|
106
106
|
layoutId: layoutId,
|
|
107
107
|
values: values,
|
|
108
108
|
fileName: fileName,
|
|
109
|
+
extensionSchemaDef: extensionSchemaDef,
|
|
109
110
|
options: options,
|
|
110
111
|
});
|
|
111
112
|
// 初期化完了状態にする
|
|
@@ -163,6 +164,13 @@ var ReportWebForm = function (_a) {
|
|
|
163
164
|
logId = message.payload;
|
|
164
165
|
onGenerate(logId);
|
|
165
166
|
}
|
|
167
|
+
else if (action === 'onChangeOperating') {
|
|
168
|
+
if (!onChangeOperating) {
|
|
169
|
+
return [2 /*return*/];
|
|
170
|
+
}
|
|
171
|
+
operating = message.payload;
|
|
172
|
+
onChangeOperating(operating);
|
|
173
|
+
}
|
|
166
174
|
else if (action === 'onBack') {
|
|
167
175
|
if (!onBack) {
|
|
168
176
|
return [2 /*return*/];
|
|
@@ -175,10 +183,12 @@ var ReportWebForm = function (_a) {
|
|
|
175
183
|
});
|
|
176
184
|
}); }, [
|
|
177
185
|
customStyles,
|
|
186
|
+
extensionSchemaDef,
|
|
178
187
|
fileName,
|
|
179
188
|
layoutId,
|
|
180
189
|
onBack,
|
|
181
190
|
onChange,
|
|
191
|
+
onChangeOperating,
|
|
182
192
|
onGenerate,
|
|
183
193
|
options,
|
|
184
194
|
sendMessage,
|