oa-componentbook 1.0.1-stage.63 → 1.0.1-stage.65
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
|
-
|
|
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-
|
|
92
|
+
className: approvalForm.hidden ? 'col-sm-12 col-md-12 col-lg-12' : 'col-sm-12 col-md-9 col-lg-9 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-
|
|
96
|
+
className: isQuestionStyleWidget ? 'col-sm-12 col-md-12 col-lg-12' : 'col-sm-12 col-md-8 col-lg-8 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,
|
|
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 ?
|
|
120
|
+
label: isQuestionStyleWidget ? "View Previous Description" : "View History"
|
|
121
121
|
}), children)), !isQuestionStyleWidget && /*#__PURE__*/_react.default.createElement("div", {
|
|
122
|
-
className: "col-sm-12 col-md-
|
|
122
|
+
className: "col-sm-12 col-md-4 col-lg-4 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 ===
|
|
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 ===
|
|
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 ===
|
|
152
|
-
color: item.type ===
|
|
151
|
+
icon: item.type === "positive" ? _Check.default : _Close.default,
|
|
152
|
+
color: item.type === "positive" ? "positive" : "negative"
|
|
153
153
|
}), item.title)));
|
|
154
154
|
}));
|
|
155
155
|
})()
|
|
@@ -158,8 +158,8 @@ function ApprovalWidget(_ref) {
|
|
|
158
158
|
label: status.label
|
|
159
159
|
})));
|
|
160
160
|
})))), approvalForm.invisible && /*#__PURE__*/_react.default.createElement("div", {
|
|
161
|
-
className: "col-sm-12 col-md-
|
|
162
|
-
}) || !approvalForm.hidden && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, actionRenderType ===
|
|
161
|
+
className: "col-sm-12 col-md-4 col-lg-4"
|
|
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,8 +167,8 @@ 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 :
|
|
171
|
-
className: "col-sm-12 col-md-
|
|
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-4 col-lg-4"
|
|
172
172
|
}, /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
173
173
|
name: "isApproved-".concat(questionId),
|
|
174
174
|
className: "custom-radio-group",
|
|
@@ -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.") :
|
|
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.") :
|
|
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
|
-
}))))
|
|
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
|
-
|
|
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
|
-
|
|
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;
|
|
@@ -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"])));
|