oa-componentbook 1.0.1-stage.64 → 1.0.1-stage.66

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,15 +86,16 @@ 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"
91
93
  }, /*#__PURE__*/_react.default.createElement("div", {
92
- className: approvalForm.hidden ? "col-sm-12 col-md-12 col-lg-12" : "col-sm-12 col-md-7 col-lg-7 gutter"
94
+ className: approvalForm.hidden ? 'col-sm-12 col-md-12 col-lg-12' : 'col-sm-12 col-md-9 col-lg-9 gutter'
93
95
  }, /*#__PURE__*/_react.default.createElement("div", {
94
96
  className: "row"
95
97
  }, /*#__PURE__*/_react.default.createElement("div", {
96
- className: isQuestionStyleWidget ? "col-sm-12 col-md-12 col-lg-12" : "col-sm-12 col-md-9 col-lg-9 gutter flexCol12"
98
+ className: isQuestionStyleWidget ? 'col-sm-12 col-md-12 col-lg-12' : 'col-sm-12 col-md-8 col-lg-8 gutter flexCol12'
97
99
  }, title && /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("h4", {
98
100
  className: "type-b2-400"
99
101
  }, title, isMandatory && /*#__PURE__*/_react.default.createElement(_styles.RedText, null, "*"))), description && /*#__PURE__*/_react.default.createElement(_styles.Styledescription, null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
@@ -119,7 +121,7 @@ function ApprovalWidget(_ref) {
119
121
  type: "text-only",
120
122
  label: isQuestionStyleWidget ? "View Previous Description" : "View History"
121
123
  }), children)), !isQuestionStyleWidget && /*#__PURE__*/_react.default.createElement("div", {
122
- className: "col-sm-12 col-md-3 col-lg-3 flexCol8"
124
+ className: "col-sm-12 col-md-4 col-lg-4 flexCol8"
123
125
  }, systemStatus === null || systemStatus === void 0 ? void 0 : systemStatus.map(status => {
124
126
  var _status$items;
125
127
  return /*#__PURE__*/_react.default.createElement("div", null, status.renderType === "text" && /*#__PURE__*/_react.default.createElement(_Typography.default, {
@@ -158,7 +160,7 @@ function ApprovalWidget(_ref) {
158
160
  label: status.label
159
161
  })));
160
162
  })))), approvalForm.invisible && /*#__PURE__*/_react.default.createElement("div", {
161
- className: "col-sm-12 col-md-5 col-lg-5"
163
+ className: "col-sm-12 col-md-4 col-lg-4"
162
164
  }) || !approvalForm.hidden && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, actionRenderType === "text" && /*#__PURE__*/_react.default.createElement("div", {
163
165
  className: "oaActionText"
164
166
  }, (actionContent === null || actionContent === void 0 ? void 0 : actionContent.icon) && /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
@@ -167,8 +169,8 @@ function ApprovalWidget(_ref) {
167
169
  }), /*#__PURE__*/_react.default.createElement(_Typography.default, {
168
170
  typography: "type-b2-400",
169
171
  color: "secondary-content"
170
- }, (_actionContent$label = actionContent === null || actionContent === void 0 ? void 0 : actionContent.label) !== null && _actionContent$label !== void 0 ? _actionContent$label : "-")), actionRenderType === "button" && /*#__PURE__*/_react.default.createElement(_CustomButton.default, actionContent), actionRenderType === "radio" && /*#__PURE__*/_react.default.createElement("div", {
171
- className: "col-sm-12 col-md-5 col-lg-5"
172
+ }, (_actionContent$label = actionContent === null || actionContent === void 0 ? void 0 : actionContent.label) !== null && _actionContent$label !== void 0 ? _actionContent$label : "-")), actionRenderType === "button" && /*#__PURE__*/_react.default.createElement(_CustomButton.default, actionContent), actionRenderType === 'radio' && /*#__PURE__*/_react.default.createElement("div", {
173
+ className: "col-sm-12 col-md-4 col-lg-4"
172
174
  }, /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
173
175
  name: "isApproved-".concat(questionId),
174
176
  className: "custom-radio-group",
@@ -207,13 +209,24 @@ 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
- rules: isMandatory ? [{
212
+ })))), actionRenderType === "buttonWithForm" &&
213
+ /*#__PURE__*/
214
+ // <Form.Item
215
+ // name={`validateDocumentButton#${questionId}`}
216
+ // rules={
217
+ // isMandatory
218
+ // ? [{ required: true, message: "Reason is required" }]
219
+ // : []
220
+ // }
221
+ // >
222
+ //
223
+ // </Form.Item>
224
+ _react.default.createElement(_antd.Form.Item, null, getFieldDecorator("validateDocumentButton#".concat(questionId), {
225
+ rules: [{
213
226
  required: true,
214
- message: "Reason is required"
215
- }] : []
216
- }, /*#__PURE__*/_react.default.createElement(_CustomButton.default, actionContent))) || undefined), hasDivider && /*#__PURE__*/_react.default.createElement(_antd.Divider, null));
227
+ message: "This field is required"
228
+ }]
229
+ })( /*#__PURE__*/_react.default.createElement(_CustomButton.default, actionContent)))) || undefined), hasDivider && /*#__PURE__*/_react.default.createElement(_antd.Divider, null));
217
230
  }
218
231
  ApprovalWidget.propTypes = {
219
232
  children: _propTypes.default.node,
@@ -254,7 +267,8 @@ ApprovalWidget.propTypes = {
254
267
  title: _propTypes.default.string
255
268
  })),
256
269
  documentTitle: _propTypes.default.string,
257
- descriptionTitle: _propTypes.default.string
270
+ descriptionTitle: _propTypes.default.string,
271
+ form: _propTypes.default.object
258
272
  };
259
273
  ApprovalWidget.defaultProps = {
260
274
  children: null,
@@ -270,6 +284,7 @@ ApprovalWidget.defaultProps = {
270
284
  actionContent: {},
271
285
  systemStatus: [],
272
286
  documentTitle: "",
273
- descriptionTitle: ""
287
+ descriptionTitle: "",
288
+ form: null
274
289
  };
275
290
  var _default = exports.default = ApprovalWidget;
@@ -9,5 +9,5 @@ var _templateObject, _templateObject2, _templateObject3;
9
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
10
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
11
11
  const Styledescription = exports.Styledescription = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n // padding: 0 0 8px;\n"])));
12
- const StyledContainer = exports.StyledContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding: 0 0 16px;\n label.ant-radio-wrapper:first-child {\n margin-inline-end: 16px;\n }\n .ant-radio-wrapper {\n white-space: nowrap;\n }\n .paddind-bottom-4 {\n padding: 0 0 4px;\n }\n .container {\n margin-bottom: 16px;\n }\n\n .view-button {\n justify-content: start;\n }\n .ant-form-item.custom-radio-group {\n margin-bottom: 12px;\n }\n\n .ant-divider-horizontal {\n margin: 16px 0px 0px;\n }\n\n .ant-form-item .ant-form-item-control-input {\n min-height: auto;\n }\n\n .ant-radio-group-outline {\n display: flex;\n justify-content: start;\n }\n\n textarea {\n padding: 16px;\n min-height: 88px;\n resize: none;\n border-radius: 4px;\n border: 1px solid var(--color-placeholder-text);\n }\n\n h5 {\n margin: 0 0 4px;\n color: var(--color-primary-content);\n }\n\n radiofield label {\n white-space: nowrap;\n }\n\n docdetailstag a {\n white-space: nowrap;\n }\n .oaCustomerResponse {\n display: flex;\n align-items: center;\n }\n .oaCustomerResponse section {\n padding: 0;\n }\n .oaActionText {\n display: flex;\n gap: 4px;\n align-items: center;\n height: fit-content;\n }\n .flexCol8 {\n display: flex;\n flex-direction: column;\n gap: 8px;\n }\n .flexCol12 {\n display: flex;\n flex-direction: column;\n gap: 12px;\n }\n"])));
12
+ const StyledContainer = exports.StyledContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding: 0 0 16px;\n label.ant-radio-wrapper:first-child {\n margin-inline-end: 16px;\n }\n .ant-radio-wrapper {\n white-space: nowrap;\n }\n .paddind-bottom-4 {\n padding: 0 0 4px;\n }\n .container {\n margin-bottom: 16px;\n }\n\n .view-button {\n justify-content: start;\n }\n .ant-form-item.custom-radio-group {\n margin-bottom: 12px;\n }\n\n .ant-divider-horizontal {\n margin: 16px 0px 0px;\n }\n\n .ant-form-item .ant-form-item-control-input {\n min-height: auto;\n }\n\n .ant-radio-group-outline {\n display: flex;\n justify-content: start;\n }\n\n textarea {\n padding: 16px;\n min-height: 88px;\n resize: none;\n border-radius: 4px;\n border: 1px solid var(--color-placeholder-text);\n }\n\n h5 {\n margin: 0 0 4px;\n color: var(--color-primary-content);\n }\n\n radiofield label {\n white-space: nowrap;\n }\n\n docdetailstag a {\n white-space: nowrap;\n }\n .oaCustomerResponse {\n display: flex;\n align-items: center;\n align-items: flex-start;\n }\n .oaCustomerResponse button{\n padding: 0;\n }\n .oaCustomerResponse section {\n padding: 0;\n }\n .oaActionText {\n display: flex;\n gap: 4px;\n align-items: center;\n height: fit-content;\n }\n .flexCol8 {\n display: flex;\n flex-direction: column;\n gap: 8px;\n }\n .flexCol12 {\n display: flex;\n flex-direction: column;\n gap: 12px;\n }\n .flexCol12 button{\n padding: 0;\n }\n"])));
13
13
  const RedText = exports.RedText = _styledComponents.default.span(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: inline-block;\n color: red;\n margin-left: 4px;\n"])));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oa-componentbook",
3
- "version": "1.0.1-stage.64",
3
+ "version": "1.0.1-stage.66",
4
4
  "private": false,
5
5
  "description": "Reusable components",
6
6
  "main": "build/index.js",