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

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.
@@ -10,4 +10,4 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
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 ButtonContainer = exports.ButtonContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n gap: 16px;\n justify-content: flex-end;\n margin: 24px 0 0;\n @media (max-width: 768px) {\n justify-content: space-between;\n button{\n width: 100%;\n }\n }\n"])));
12
12
  const DescriptionContainer = exports.DescriptionContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding: 12px 0 0;\n"])));
13
- const TitleContainer = exports.TitleContainer = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n gap: 16px;\n flex-direction: column;\n margin: 0 0 16px;\n\n img {\n height: 36px;\n width: 36px;\n }\n"])));
13
+ const TitleContainer = exports.TitleContainer = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n gap: 16px;\n flex-direction: column;\n margin: 0 0 16px;\n padding: 0 42px 0 0;\n\n img {\n height: 36px;\n width: 36px;\n }\n"])));
@@ -71,7 +71,7 @@ function ApprovalWidget(_ref) {
71
71
  systemStatus,
72
72
  documentTitle,
73
73
  descriptionTitle,
74
- 'data-test': dataTest
74
+ "data-test": dataTest
75
75
  } = _ref,
76
76
  props = _objectWithoutProperties(_ref, _excluded);
77
77
  const getInitialValue = isApproved => {
@@ -89,11 +89,11 @@ function ApprovalWidget(_ref) {
89
89
  return /*#__PURE__*/_react.default.createElement(_styles.StyledContainer, null, /*#__PURE__*/_react.default.createElement("div", {
90
90
  className: "row"
91
91
  }, /*#__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'
92
+ className: approvalForm.hidden ? "col-sm-12 col-md-12 col-lg-12" : "col-sm-12 col-md-7 col-lg-7 gutter"
93
93
  }, /*#__PURE__*/_react.default.createElement("div", {
94
94
  className: "row"
95
95
  }, /*#__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'
96
+ className: isQuestionStyleWidget ? "col-sm-12 col-md-12 col-lg-12" : "col-sm-12 col-md-9 col-lg-9 gutter flexCol12"
97
97
  }, title && /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("h4", {
98
98
  className: "type-b2-400"
99
99
  }, title, isMandatory && /*#__PURE__*/_react.default.createElement(_styles.RedText, null, "*"))), description && /*#__PURE__*/_react.default.createElement(_styles.Styledescription, null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
@@ -107,7 +107,7 @@ function ApprovalWidget(_ref) {
107
107
  }, /*#__PURE__*/_react.default.createElement(_Typography.default, {
108
108
  typography: "type-b2-400",
109
109
  color: "secondary-content"
110
- }, documentTitle, ' ', "\xA0"), /*#__PURE__*/_react.default.createElement(_UploadDownloadWidget.default, _extends({
110
+ }, documentTitle, " \xA0"), /*#__PURE__*/_react.default.createElement(_UploadDownloadWidget.default, _extends({
111
111
  disabled: (_approvalForm$disable = approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.disabled) !== null && _approvalForm$disable !== void 0 ? _approvalForm$disable : false,
112
112
  "data-test": dataTest ? "".concat(dataTest, "--upload-download-widget") : undefined
113
113
  }, docDetails, {
@@ -117,15 +117,15 @@ function ApprovalWidget(_ref) {
117
117
  "data-test": dataTest ? "".concat(dataTest, "--view-button") : undefined,
118
118
  onClick: () => viewOnClick(questionId),
119
119
  type: "text-only",
120
- label: isQuestionStyleWidget ? 'View Previous Description' : 'View History'
120
+ label: isQuestionStyleWidget ? "View Previous Description" : "View History"
121
121
  }), children)), !isQuestionStyleWidget && /*#__PURE__*/_react.default.createElement("div", {
122
122
  className: "col-sm-12 col-md-3 col-lg-3 flexCol8"
123
123
  }, systemStatus === null || systemStatus === void 0 ? void 0 : systemStatus.map(status => {
124
124
  var _status$items;
125
- return /*#__PURE__*/_react.default.createElement("div", null, status.renderType === 'text' && /*#__PURE__*/_react.default.createElement(_Typography.default, {
125
+ return /*#__PURE__*/_react.default.createElement("div", null, status.renderType === "text" && /*#__PURE__*/_react.default.createElement(_Typography.default, {
126
126
  typography: "type-b2-400",
127
127
  color: "secondary-content"
128
- }, status.label), status.renderType === 'tag' && /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_CustomTag.default, status)), status.renderType === 'toolTip' && ((_status$items = status.items) === null || _status$items === void 0 ? void 0 : _status$items.length) > 0 && /*#__PURE__*/_react.default.createElement(_CustomTooltip.default, {
128
+ }, status.label), status.renderType === "tag" && /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_CustomTag.default, status)), status.renderType === "toolTip" && ((_status$items = status.items) === null || _status$items === void 0 ? void 0 : _status$items.length) > 0 && /*#__PURE__*/_react.default.createElement(_CustomTooltip.default, {
129
129
  overlayClassName: "multipleDocumentTooltip",
130
130
  isDisplayed: true,
131
131
  title: (() => {
@@ -148,8 +148,8 @@ function ApprovalWidget(_ref) {
148
148
  className: "tooltip-item"
149
149
  }, /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
150
150
  size: 20,
151
- icon: item.type === 'positive' ? _Check.default : _Close.default,
152
- color: item.type === 'positive' ? 'positive' : 'negative'
151
+ icon: item.type === "positive" ? _Check.default : _Close.default,
152
+ color: item.type === "positive" ? "positive" : "negative"
153
153
  }), item.title)));
154
154
  }));
155
155
  })()
@@ -159,7 +159,7 @@ function ApprovalWidget(_ref) {
159
159
  })));
160
160
  })))), approvalForm.invisible && /*#__PURE__*/_react.default.createElement("div", {
161
161
  className: "col-sm-12 col-md-5 col-lg-5"
162
- }) || !approvalForm.hidden && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, actionRenderType === 'text' && /*#__PURE__*/_react.default.createElement("div", {
162
+ }) || !approvalForm.hidden && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, actionRenderType === "text" && /*#__PURE__*/_react.default.createElement("div", {
163
163
  className: "oaActionText"
164
164
  }, (actionContent === null || actionContent === void 0 ? void 0 : actionContent.icon) && /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
165
165
  icon: _CheckCircle.default,
@@ -167,7 +167,7 @@ function ApprovalWidget(_ref) {
167
167
  }), /*#__PURE__*/_react.default.createElement(_Typography.default, {
168
168
  typography: "type-b2-400",
169
169
  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", {
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
171
  className: "col-sm-12 col-md-5 col-lg-5"
172
172
  }, /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
173
173
  name: "isApproved-".concat(questionId),
@@ -177,7 +177,7 @@ function ApprovalWidget(_ref) {
177
177
  required: true,
178
178
  message: dataTest ? /*#__PURE__*/_react.default.createElement("span", {
179
179
  "data-test": "".concat(dataTest, "--is-approved-validation-message")
180
- }, "Approval status needs to be selected.") : 'Approval status needs to be selected.'
180
+ }, "Approval status needs to be selected.") : "Approval status needs to be selected."
181
181
  }]
182
182
  }, /*#__PURE__*/_react.default.createElement(_CustomRadio.default.Group, {
183
183
  "data-test": dataTest ? "".concat(dataTest, "--is-approved-radio-group") : undefined,
@@ -197,21 +197,27 @@ function ApprovalWidget(_ref) {
197
197
  className: "type-b2-400"
198
198
  }, "Remarks"), /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
199
199
  name: "remarks-".concat(questionId),
200
- initialValue: (_approvalForm$remarks = approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.remarks) !== null && _approvalForm$remarks !== void 0 ? _approvalForm$remarks : '',
200
+ initialValue: (_approvalForm$remarks = approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.remarks) !== null && _approvalForm$remarks !== void 0 ? _approvalForm$remarks : "",
201
201
  rules: [{
202
202
  required: true,
203
203
  message: dataTest ? /*#__PURE__*/_react.default.createElement("span", {
204
204
  "data-test": "".concat(dataTest, "--remarks-validation-message")
205
- }, "Remarks cannot be empty.") : 'Remarks cannot be empty.'
205
+ }, "Remarks cannot be empty.") : "Remarks cannot be empty."
206
206
  }]
207
207
  }, /*#__PURE__*/_react.default.createElement(_antd.Input.TextArea, {
208
208
  "data-test": dataTest ? "".concat(dataTest, "--remarks") : undefined,
209
209
  disabled: (_approvalForm$disable4 = approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.disabled) !== null && _approvalForm$disable4 !== void 0 ? _approvalForm$disable4 : false
210
- }))))) || undefined), hasDivider && /*#__PURE__*/_react.default.createElement(_antd.Divider, null));
210
+ })))), actionRenderType === "buttonWithForm" && /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
211
+ name: "validateDocumentButton#".concat(questionId),
212
+ rules: isMandatory ? [{
213
+ 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));
211
217
  }
212
218
  ApprovalWidget.propTypes = {
213
219
  children: _propTypes.default.node,
214
- 'data-test': _propTypes.default.string,
220
+ "data-test": _propTypes.default.string,
215
221
  description: _propTypes.default.string,
216
222
  // Leave description optional
217
223
  docDetails: _propTypes.default.shape({
@@ -252,8 +258,8 @@ ApprovalWidget.propTypes = {
252
258
  };
253
259
  ApprovalWidget.defaultProps = {
254
260
  children: null,
255
- 'data-test': undefined,
256
- description: '',
261
+ "data-test": undefined,
262
+ description: "",
257
263
  docDetails: {},
258
264
  approvalForm: {},
259
265
  isMandatory: false,
@@ -263,7 +269,7 @@ ApprovalWidget.defaultProps = {
263
269
  actionRenderType: undefined,
264
270
  actionContent: {},
265
271
  systemStatus: [],
266
- documentTitle: '',
267
- descriptionTitle: ''
272
+ documentTitle: "",
273
+ descriptionTitle: ""
268
274
  };
269
275
  var _default = exports.default = ApprovalWidget;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oa-componentbook",
3
- "version": "1.0.1-stage.63",
3
+ "version": "1.0.1-stage.64",
4
4
  "private": false,
5
5
  "description": "Reusable components",
6
6
  "main": "build/index.js",