oa-componentbook 1.0.1-stage.65 → 1.0.1-stage.67
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.
|
@@ -22,7 +22,7 @@ var _CustomButton = _interopRequireDefault(require("../../components/oa-componen
|
|
|
22
22
|
var _MaterialIcon = _interopRequireDefault(require("../../components/oa-component-icons/MaterialIcon"));
|
|
23
23
|
var _CustomTag = _interopRequireDefault(require("../../components/oa-component-tag/CustomTag"));
|
|
24
24
|
var _CustomTooltip = _interopRequireDefault(require("../../components/oa-component-tooltip/CustomTooltip"));
|
|
25
|
-
const _excluded = ["children", "description", "docDetails", "approvalForm", "isMandatory", "hasDivider", "isQuestionStyleWidget", "questionId", "title", "viewOnClick", "actionRenderType", "actionContent", "systemStatus", "documentTitle", "descriptionTitle", "data-test"];
|
|
25
|
+
const _excluded = ["children", "description", "docDetails", "approvalForm", "isMandatory", "hasDivider", "isQuestionStyleWidget", "questionId", "title", "viewOnClick", "actionRenderType", "actionContent", "systemStatus", "documentTitle", "descriptionTitle", "data-test", "form"];
|
|
26
26
|
/* eslint-disable */
|
|
27
27
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
28
28
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
@@ -71,7 +71,8 @@ function ApprovalWidget(_ref) {
|
|
|
71
71
|
systemStatus,
|
|
72
72
|
documentTitle,
|
|
73
73
|
descriptionTitle,
|
|
74
|
-
"data-test": dataTest
|
|
74
|
+
"data-test": dataTest,
|
|
75
|
+
form
|
|
75
76
|
} = _ref,
|
|
76
77
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
77
78
|
const getInitialValue = isApproved => {
|
|
@@ -85,6 +86,7 @@ function ApprovalWidget(_ref) {
|
|
|
85
86
|
}
|
|
86
87
|
};
|
|
87
88
|
const [isApproved, setIsApproved] = (0, _react.useState)(getInitialValue(approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.isApproved));
|
|
89
|
+
const getFieldDecorator = form === null || form === void 0 ? void 0 : form.getFieldDecorator;
|
|
88
90
|
const onRadioChange = event => setIsApproved(event.target.value);
|
|
89
91
|
return /*#__PURE__*/_react.default.createElement(_styles.StyledContainer, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
90
92
|
className: "row"
|
|
@@ -207,13 +209,12 @@ function ApprovalWidget(_ref) {
|
|
|
207
209
|
}, /*#__PURE__*/_react.default.createElement(_antd.Input.TextArea, {
|
|
208
210
|
"data-test": dataTest ? "".concat(dataTest, "--remarks") : undefined,
|
|
209
211
|
disabled: (_approvalForm$disable4 = approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.disabled) !== null && _approvalForm$disable4 !== void 0 ? _approvalForm$disable4 : false
|
|
210
|
-
})))), actionRenderType === "buttonWithForm" && /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
211
|
-
name: "validateDocumentButton#".concat(questionId),
|
|
212
|
+
})))), actionRenderType === "buttonWithForm" && /*#__PURE__*/_react.default.createElement(_antd.Form.Item, null, getFieldDecorator("validateDocumentButton#".concat(questionId), {
|
|
212
213
|
rules: isMandatory ? [{
|
|
213
214
|
required: true,
|
|
214
|
-
message: "
|
|
215
|
+
message: "This field is required"
|
|
215
216
|
}] : []
|
|
216
|
-
}
|
|
217
|
+
})( /*#__PURE__*/_react.default.createElement(_CustomButton.default, actionContent)))) || undefined), hasDivider && /*#__PURE__*/_react.default.createElement(_antd.Divider, null));
|
|
217
218
|
}
|
|
218
219
|
ApprovalWidget.propTypes = {
|
|
219
220
|
children: _propTypes.default.node,
|
|
@@ -254,7 +255,8 @@ ApprovalWidget.propTypes = {
|
|
|
254
255
|
title: _propTypes.default.string
|
|
255
256
|
})),
|
|
256
257
|
documentTitle: _propTypes.default.string,
|
|
257
|
-
descriptionTitle: _propTypes.default.string
|
|
258
|
+
descriptionTitle: _propTypes.default.string,
|
|
259
|
+
form: _propTypes.default.object
|
|
258
260
|
};
|
|
259
261
|
ApprovalWidget.defaultProps = {
|
|
260
262
|
children: null,
|
|
@@ -270,6 +272,7 @@ ApprovalWidget.defaultProps = {
|
|
|
270
272
|
actionContent: {},
|
|
271
273
|
systemStatus: [],
|
|
272
274
|
documentTitle: "",
|
|
273
|
-
descriptionTitle: ""
|
|
275
|
+
descriptionTitle: "",
|
|
276
|
+
form: null
|
|
274
277
|
};
|
|
275
278
|
var _default = exports.default = ApprovalWidget;
|