oa-componentbook 1.0.1-stage.9 → 1.0.1-stage.91
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/build/components/oa-component-accordion/Accordion.js +9 -4
- package/build/components/oa-component-feedback-form/FeedbackForm.js +75 -0
- package/build/components/oa-component-feedback-tooltip/FeedbackTooltip.js +69 -0
- package/build/components/oa-component-modal/styles.js +1 -1
- package/build/dev/oa-component-document-viewer/CustomDocumentViewer.js +281 -0
- package/build/dev/oa-component-document-viewer/styles.js +12 -0
- package/build/dev/oa-component-upload/CustomUpload.js +3 -0
- package/build/dev/oa-widget-document-side-drawer/DocumentSideDrawer.js +130 -0
- package/build/dev/oa-widget-document-side-drawer/styles.js +12 -0
- package/build/global-css/GlobalCss.js +2 -1
- package/build/global-css/GridLayout.js +1 -1
- package/build/global-css/commonStyles.js +11 -0
- package/build/images/oaChat.svg +5 -0
- package/build/index.js +56 -0
- package/build/layout/paymentAndConsent/CancelScreen.js +46 -0
- package/build/layout/paymentAndConsent/ConsentCard.js +68 -0
- package/build/layout/paymentAndConsent/DetailsCard.js +75 -0
- package/build/layout/paymentAndConsent/DetailsList.js +38 -0
- package/build/layout/paymentAndConsent/Header.js +33 -0
- package/build/layout/paymentAndConsent/InProgressScreen.js +46 -0
- package/build/layout/paymentAndConsent/Loader.js +21 -0
- package/build/layout/paymentAndConsent/Modal.js +28 -0
- package/build/layout/paymentAndConsent/PaymentAndConsent.js +22 -0
- package/build/layout/paymentAndConsent/PaymentCard.js +83 -0
- package/build/layout/paymentAndConsent/Section.js +34 -0
- package/build/layout/paymentAndConsent/SuccessScreen.js +46 -0
- package/build/layout/paymentAndConsent/TimeLineCard.js +28 -0
- package/build/layout/paymentAndConsent/TncList.js +32 -0
- package/build/layout/paymentAndConsent/style.js +12 -0
- package/build/widgets/oa-widget-add-spare-part/AddSparePartCollapseWidget.js +17 -11
- package/build/widgets/oa-widget-approval/ApprovalWidgetNew.js +373 -0
- package/build/widgets/oa-widget-approval/styles.js +2 -2
- package/build/widgets/oa-widget-document-upload/DocUploadWidget.js +6 -6
- package/build/widgets/oa-widget-feedback/FeedbackWidget.js +83 -0
- package/build/widgets/oa-widget-feedback/styles.js +13 -0
- package/build/widgets/oa-widget-image-carousel/ImageCarouselWidget.js +257 -0
- package/build/widgets/oa-widget-image-carousel/styles.js +23 -0
- package/build/widgets/oa-widget-map-base-location/AddressDetails.js +6 -4
- package/build/widgets/oa-widget-map-base-location/AddressForm.js +26 -3
- package/build/widgets/oa-widget-map-base-location/MapBaseLocation.js +5 -3
- package/build/widgets/oa-widget-membershipcard/MembershipCard.js +5 -7
- package/build/widgets/oa-widget-notes/NotesWidget.js +2 -1
- package/build/widgets/oa-widget-reupload-drawer/ReUploadDrawer.js +164 -0
- package/build/widgets/oa-widget-track-shipment/TrackShipmentWidget.js +4 -2
- package/build/widgets/oa-widget-track-shipment-list/TrackShipmentWidgetList.js +71 -30
- package/build/widgets/oa-widget-track-shipment-list/fn.js +8 -8
- package/package.json +6 -3
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.assign.js");
|
|
4
|
+
require("core-js/modules/es.weak-map.js");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
require("core-js/modules/es.symbol.description.js");
|
|
10
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
var _antd = require("antd");
|
|
14
|
+
var _CheckCircle = _interopRequireDefault(require("@material-ui/icons/CheckCircle"));
|
|
15
|
+
var _Check = _interopRequireDefault(require("@material-ui/icons/Check"));
|
|
16
|
+
var _Close = _interopRequireDefault(require("@material-ui/icons/Close"));
|
|
17
|
+
var _UploadDownloadWidget = _interopRequireDefault(require("../oa-widget-upload-download/UploadDownloadWidget"));
|
|
18
|
+
var _styles = require("./styles");
|
|
19
|
+
var _CustomRadio = _interopRequireDefault(require("../../components/oa-component-radio/CustomRadio"));
|
|
20
|
+
var _Typography = _interopRequireDefault(require("../../components/oa-component-typography/Typography"));
|
|
21
|
+
var _CustomButton = _interopRequireDefault(require("../../components/oa-component-button/CustomButton"));
|
|
22
|
+
var _MaterialIcon = _interopRequireDefault(require("../../components/oa-component-icons/MaterialIcon"));
|
|
23
|
+
var _CustomTag = _interopRequireDefault(require("../../components/oa-component-tag/CustomTag"));
|
|
24
|
+
var _CustomTooltip = _interopRequireDefault(require("../../components/oa-component-tooltip/CustomTooltip"));
|
|
25
|
+
const _excluded = ["children", "description", "docDetails", "multipleDocDetails", "approvalForm", "isMandatory", "hasDivider", "isQuestionStyleWidget", "questionId", "title", "viewOnClick", "actionRenderType", "actionContent", "systemStatus", "documentTitle", "descriptionTitle", "data-test", "form", "columnDynamicCssClass", "tooltipPlacement"];
|
|
26
|
+
/* eslint-disable */
|
|
27
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
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); }
|
|
29
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
30
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
31
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
32
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
33
|
+
/**
|
|
34
|
+
* @typedef {import('../../components/oa-component-upload/CustomUpload').DocumentDetails} DocumentDetails
|
|
35
|
+
*
|
|
36
|
+
* @typedef {Object} ApprovalForm
|
|
37
|
+
* @property {boolean} [disabled=false] Whether the approval form is disabled.
|
|
38
|
+
* @property {boolean} [hidden=false] Whether the approval form is hidden.
|
|
39
|
+
* @property {boolean} [invisible=false] Whether the approval form is invisible (preserving layout).
|
|
40
|
+
* @property {boolean} [isApproved] Initial value for the approval status.
|
|
41
|
+
* @property {string} [remarks] Initial value for the remarks.
|
|
42
|
+
*
|
|
43
|
+
* @typedef {Object} Props
|
|
44
|
+
* @property {React.ReactNode} [children] Content to be rendered inside the ApprovalWidget.
|
|
45
|
+
* @property {string} [description] Description for the widget.
|
|
46
|
+
* @property {DocumentDetails} [docDetails] Document details for the widget.
|
|
47
|
+
* @property {ApprovalForm} [approvalForm] Form data for approval.
|
|
48
|
+
* @property {boolean} [isMandatory=false] Whether the widget is mandatory.
|
|
49
|
+
* @property {boolean} [hasDivider=false] Display a divider line beneath the widget.
|
|
50
|
+
* @property {boolean} [isQuestionStyleWidget=false] Whether the widget has a question-style layout.
|
|
51
|
+
* @property {string|number} questionId Identifier for the question.
|
|
52
|
+
* @property {string} title Title of the widget.
|
|
53
|
+
* @property {Function} [viewOnClick] Callback function for the view action.
|
|
54
|
+
* @property {string} ['data-test'] Data test string to be applied to the outermost element.
|
|
55
|
+
*/
|
|
56
|
+
function ApprovalWidget(_ref) {
|
|
57
|
+
var _approvalForm$disable2, _actionContent$label, _approvalForm$disable3, _approvalForm$disable4, _approvalForm$disable5, _approvalForm$remarks, _approvalForm$disable6, _approvalForm$disable7, _approvalForm$disable8, _approvalForm$disable9, _approvalForm$disable10;
|
|
58
|
+
let {
|
|
59
|
+
children,
|
|
60
|
+
description,
|
|
61
|
+
docDetails,
|
|
62
|
+
multipleDocDetails,
|
|
63
|
+
approvalForm,
|
|
64
|
+
isMandatory,
|
|
65
|
+
hasDivider,
|
|
66
|
+
isQuestionStyleWidget,
|
|
67
|
+
questionId,
|
|
68
|
+
title,
|
|
69
|
+
viewOnClick,
|
|
70
|
+
actionRenderType,
|
|
71
|
+
actionContent,
|
|
72
|
+
systemStatus,
|
|
73
|
+
documentTitle,
|
|
74
|
+
descriptionTitle,
|
|
75
|
+
"data-test": dataTest,
|
|
76
|
+
form,
|
|
77
|
+
columnDynamicCssClass,
|
|
78
|
+
tooltipPlacement
|
|
79
|
+
} = _ref,
|
|
80
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
81
|
+
const getInitialValue = isApproved => {
|
|
82
|
+
switch (isApproved) {
|
|
83
|
+
case true:
|
|
84
|
+
return 1;
|
|
85
|
+
case false:
|
|
86
|
+
return 0;
|
|
87
|
+
default:
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
const [isApproved, setIsApproved] = (0, _react.useState)(getInitialValue(approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.isApproved));
|
|
92
|
+
const [radioButtonValue, setRadioButtonValue] = (0, _react.useState)(null);
|
|
93
|
+
const getFieldDecorator = form === null || form === void 0 ? void 0 : form.getFieldDecorator;
|
|
94
|
+
const onRadioChange = event => setIsApproved(event.target.value);
|
|
95
|
+
const onChangeRadioWithForm = event => setRadioButtonValue(event.target.value);
|
|
96
|
+
return /*#__PURE__*/_react.default.createElement(_styles.StyledContainer, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
97
|
+
className: "row"
|
|
98
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
99
|
+
className: columnDynamicCssClass === null || columnDynamicCssClass === void 0 ? void 0 : columnDynamicCssClass.firstColumn
|
|
100
|
+
}, title && /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("h4", {
|
|
101
|
+
className: "type-b2-400"
|
|
102
|
+
}, title, isMandatory && /*#__PURE__*/_react.default.createElement(_styles.RedText, null, "*"))), description && /*#__PURE__*/_react.default.createElement(_styles.Styledescription, null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
103
|
+
typography: "type-b2-400",
|
|
104
|
+
color: "secondary-content"
|
|
105
|
+
}, descriptionTitle), /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
106
|
+
typography: "type-b2-400",
|
|
107
|
+
color: "primary-content"
|
|
108
|
+
}, description)), !isQuestionStyleWidget && ((multipleDocDetails === null || multipleDocDetails === void 0 ? void 0 : multipleDocDetails.length) > 0 ? multipleDocDetails.map(docDetails => {
|
|
109
|
+
var _approvalForm$disable;
|
|
110
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
111
|
+
className: "oaCustomerResponse"
|
|
112
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
113
|
+
typography: "type-b2-400",
|
|
114
|
+
color: "secondary-content"
|
|
115
|
+
}, docDetails.documentTitle, " \xA0"), /*#__PURE__*/_react.default.createElement(_UploadDownloadWidget.default, _extends({
|
|
116
|
+
disabled: (_approvalForm$disable = approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.disabled) !== null && _approvalForm$disable !== void 0 ? _approvalForm$disable : false,
|
|
117
|
+
"data-test": dataTest ? "".concat(dataTest, "--upload-download-widget") : undefined
|
|
118
|
+
}, docDetails, {
|
|
119
|
+
formName: isMandatory ? "file-".concat(questionId) : undefined
|
|
120
|
+
})));
|
|
121
|
+
}) : /*#__PURE__*/_react.default.createElement("div", {
|
|
122
|
+
className: "oaCustomerResponse"
|
|
123
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
124
|
+
typography: "type-b2-400",
|
|
125
|
+
color: "secondary-content"
|
|
126
|
+
}, documentTitle, " \xA0"), /*#__PURE__*/_react.default.createElement(_UploadDownloadWidget.default, _extends({
|
|
127
|
+
disabled: (_approvalForm$disable2 = approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.disabled) !== null && _approvalForm$disable2 !== void 0 ? _approvalForm$disable2 : false,
|
|
128
|
+
"data-test": dataTest ? "".concat(dataTest, "--upload-download-widget") : undefined
|
|
129
|
+
}, docDetails, {
|
|
130
|
+
formName: isMandatory ? "file-".concat(questionId) : undefined
|
|
131
|
+
})))), viewOnClick && /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
132
|
+
className: "view-button",
|
|
133
|
+
"data-test": dataTest ? "".concat(dataTest, "--view-button") : undefined,
|
|
134
|
+
onClick: () => viewOnClick(questionId),
|
|
135
|
+
type: "text-only",
|
|
136
|
+
label:
|
|
137
|
+
// isQuestionStyleWidget
|
|
138
|
+
// ? "View Previous Description"
|
|
139
|
+
// :
|
|
140
|
+
"View History"
|
|
141
|
+
}), children)), /*#__PURE__*/_react.default.createElement("div", {
|
|
142
|
+
className: columnDynamicCssClass === null || columnDynamicCssClass === void 0 ? void 0 : columnDynamicCssClass.secondColumn
|
|
143
|
+
}, systemStatus === null || systemStatus === void 0 ? void 0 : systemStatus.map(status => {
|
|
144
|
+
var _status$items;
|
|
145
|
+
return /*#__PURE__*/_react.default.createElement("div", null, status.renderType === "text" && /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
146
|
+
typography: "type-b2-400",
|
|
147
|
+
color: "secondary-content"
|
|
148
|
+
}, 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, {
|
|
149
|
+
overlayClassName: "multipleDocumentTooltip",
|
|
150
|
+
isDisplayed: true,
|
|
151
|
+
placement: tooltipPlacement // Pass placement as a prop
|
|
152
|
+
,
|
|
153
|
+
title: (() => {
|
|
154
|
+
const totalItems = status.items.length;
|
|
155
|
+
const numColumns = totalItems === 1 ? 1 : 2; // 1 column if only 1 item, else 2 columns
|
|
156
|
+
|
|
157
|
+
const col1Size = Math.ceil(totalItems / numColumns); // First column gets extra if odd
|
|
158
|
+
const col2Size = totalItems - col1Size; // Remaining items go to second column
|
|
159
|
+
|
|
160
|
+
const columns = [status.items.slice(0, col1Size),
|
|
161
|
+
// First column
|
|
162
|
+
status.items.slice(col1Size) // Second column
|
|
163
|
+
];
|
|
164
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (status === null || status === void 0 ? void 0 : status.title) && /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
165
|
+
typography: "type-sl1-700",
|
|
166
|
+
color: "secondary-content"
|
|
167
|
+
}, status.title), /*#__PURE__*/_react.default.createElement("div", {
|
|
168
|
+
className: "tooltip-grid",
|
|
169
|
+
style: {
|
|
170
|
+
flexDirection: totalItems === 1 ? "column" : "row",
|
|
171
|
+
// Make it single column if only 1 item
|
|
172
|
+
width: totalItems === 1 ? "100%" : "auto" // Full width if only 1 item
|
|
173
|
+
}
|
|
174
|
+
}, columns.map((columnItems, colIndex) => /*#__PURE__*/_react.default.createElement("div", {
|
|
175
|
+
key: "col-".concat(colIndex),
|
|
176
|
+
className: "tooltip-column"
|
|
177
|
+
}, columnItems.map(item => /*#__PURE__*/_react.default.createElement("li", {
|
|
178
|
+
key: item.title,
|
|
179
|
+
className: "tooltip-item"
|
|
180
|
+
}, !(status !== null && status !== void 0 && status.hideIcon) && /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
181
|
+
size: 20,
|
|
182
|
+
icon: item.type === "positive" ? _Check.default : _Close.default,
|
|
183
|
+
color: item.type === "positive" ? "positive" : "negative"
|
|
184
|
+
}), /*#__PURE__*/_react.default.createElement("p", null, item.title)))))));
|
|
185
|
+
})()
|
|
186
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
187
|
+
type: "text-only",
|
|
188
|
+
label: status.label
|
|
189
|
+
})));
|
|
190
|
+
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
191
|
+
className: columnDynamicCssClass === null || columnDynamicCssClass === void 0 ? void 0 : columnDynamicCssClass.thirdColumn
|
|
192
|
+
}, actionRenderType === "text" && /*#__PURE__*/_react.default.createElement("div", {
|
|
193
|
+
className: "oaActionText"
|
|
194
|
+
}, (actionContent === null || actionContent === void 0 ? void 0 : actionContent.icon) && /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
195
|
+
icon: _CheckCircle.default,
|
|
196
|
+
color: "secondary-content"
|
|
197
|
+
}), /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
198
|
+
typography: "type-b2-400",
|
|
199
|
+
color: "secondary-content"
|
|
200
|
+
}, (_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, _extends({
|
|
201
|
+
disabled: (_approvalForm$disable3 = approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.disabled) !== null && _approvalForm$disable3 !== void 0 ? _approvalForm$disable3 : false
|
|
202
|
+
}, actionContent)), actionRenderType === "radio" &&
|
|
203
|
+
/*#__PURE__*/
|
|
204
|
+
//className="col-sm-12 col-md-4 col-lg-4"
|
|
205
|
+
_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
206
|
+
name: "isApproved-".concat(questionId),
|
|
207
|
+
className: "custom-radio-group",
|
|
208
|
+
initialValue: isApproved,
|
|
209
|
+
rules: [{
|
|
210
|
+
required: true,
|
|
211
|
+
message: dataTest ? /*#__PURE__*/_react.default.createElement("span", {
|
|
212
|
+
"data-test": "".concat(dataTest, "--is-approved-validation-message")
|
|
213
|
+
}, "Approval status needs to be selected.") : "Approval status needs to be selected."
|
|
214
|
+
}]
|
|
215
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomRadio.default.Group, {
|
|
216
|
+
"data-test": dataTest ? "".concat(dataTest, "--is-approved-radio-group") : undefined,
|
|
217
|
+
onChange: onRadioChange,
|
|
218
|
+
value: isApproved
|
|
219
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomRadio.default, {
|
|
220
|
+
"data-test": dataTest ? "".concat(dataTest, "--is-approved-radio-yes") : undefined,
|
|
221
|
+
disabled: (_approvalForm$disable4 = approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.disabled) !== null && _approvalForm$disable4 !== void 0 ? _approvalForm$disable4 : false,
|
|
222
|
+
label: "Mark as Approved",
|
|
223
|
+
value: 1
|
|
224
|
+
}), /*#__PURE__*/_react.default.createElement(_CustomRadio.default, {
|
|
225
|
+
"data-test": dataTest ? "".concat(dataTest, "--is-approved-radio-no") : undefined,
|
|
226
|
+
disabled: (_approvalForm$disable5 = approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.disabled) !== null && _approvalForm$disable5 !== void 0 ? _approvalForm$disable5 : false,
|
|
227
|
+
label: "Mark as Pending",
|
|
228
|
+
value: 0
|
|
229
|
+
}))), isApproved === 0 && /*#__PURE__*/_react.default.createElement("section", null, /*#__PURE__*/_react.default.createElement("h5", {
|
|
230
|
+
className: "type-b2-400"
|
|
231
|
+
}, "Remarks"), /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
232
|
+
name: "remarks-".concat(questionId),
|
|
233
|
+
initialValue: (_approvalForm$remarks = approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.remarks) !== null && _approvalForm$remarks !== void 0 ? _approvalForm$remarks : "",
|
|
234
|
+
rules: [{
|
|
235
|
+
required: true,
|
|
236
|
+
message: dataTest ? /*#__PURE__*/_react.default.createElement("span", {
|
|
237
|
+
"data-test": "".concat(dataTest, "--remarks-validation-message")
|
|
238
|
+
}, "Remarks cannot be empty.") : "Remarks cannot be empty."
|
|
239
|
+
}]
|
|
240
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Input.TextArea, {
|
|
241
|
+
"data-test": dataTest ? "".concat(dataTest, "--remarks") : undefined,
|
|
242
|
+
disabled: (_approvalForm$disable6 = approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.disabled) !== null && _approvalForm$disable6 !== void 0 ? _approvalForm$disable6 : false
|
|
243
|
+
})))), actionRenderType === "buttonWithForm" && /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
244
|
+
validateStatus: form.getFieldError("validateDocumentButton#".concat(questionId)) ? "error" : "",
|
|
245
|
+
help: form.getFieldError("validateDocumentButton#".concat(questionId)) || ""
|
|
246
|
+
}, getFieldDecorator("validateDocumentButton#".concat(questionId), {
|
|
247
|
+
rules: isMandatory ? [{
|
|
248
|
+
required: true,
|
|
249
|
+
message: "This field is required"
|
|
250
|
+
}] : []
|
|
251
|
+
})( /*#__PURE__*/_react.default.createElement(_CustomButton.default, _extends({}, actionContent, {
|
|
252
|
+
disabled: (_approvalForm$disable7 = approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.disabled) !== null && _approvalForm$disable7 !== void 0 ? _approvalForm$disable7 : false
|
|
253
|
+
})))), actionRenderType === "radioWithForm" && /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
254
|
+
className: "custom-radio-group",
|
|
255
|
+
validateStatus: form.getFieldError("icQues_status_".concat(questionId)) ? "error" : "",
|
|
256
|
+
help: form.getFieldError("icQues_status_".concat(questionId)) || ""
|
|
257
|
+
}, getFieldDecorator("icQues_status_".concat(questionId), {
|
|
258
|
+
rules: isMandatory ? [{
|
|
259
|
+
required: true,
|
|
260
|
+
message: dataTest ? /*#__PURE__*/_react.default.createElement("span", {
|
|
261
|
+
"data-test": "".concat(dataTest, "--is-approved-validation-message")
|
|
262
|
+
}, "Approval status needs to be selected.") : "Approval status needs to be selected."
|
|
263
|
+
}] : []
|
|
264
|
+
})( /*#__PURE__*/_react.default.createElement(_CustomRadio.default.Group, {
|
|
265
|
+
"data-test": dataTest ? "".concat(dataTest, "--is-approved-radio-group") : undefined,
|
|
266
|
+
onChange: onChangeRadioWithForm,
|
|
267
|
+
value: radioButtonValue
|
|
268
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomRadio.default, {
|
|
269
|
+
"data-test": dataTest ? "".concat(dataTest, "--is-approved-radio-yes") : undefined,
|
|
270
|
+
label: "Mark as Approved",
|
|
271
|
+
value: "Complete",
|
|
272
|
+
disabled: (_approvalForm$disable8 = approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.disabled) !== null && _approvalForm$disable8 !== void 0 ? _approvalForm$disable8 : false
|
|
273
|
+
}), /*#__PURE__*/_react.default.createElement(_CustomRadio.default, {
|
|
274
|
+
"data-test": dataTest ? "".concat(dataTest, "--is-approved-radio-no") : undefined,
|
|
275
|
+
label: "Mark as Pending",
|
|
276
|
+
value: "Incomplete",
|
|
277
|
+
disabled: (_approvalForm$disable9 = approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.disabled) !== null && _approvalForm$disable9 !== void 0 ? _approvalForm$disable9 : false
|
|
278
|
+
})))), form.getFieldValue("icQues_status_".concat(questionId)) == "Incomplete" && /*#__PURE__*/_react.default.createElement("section", null, /*#__PURE__*/_react.default.createElement("h5", {
|
|
279
|
+
className: "type-b2-400"
|
|
280
|
+
}, "Remarks"), /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
281
|
+
validateStatus: form.getFieldError("icQues_remarks_".concat(questionId)) ? "error" : "",
|
|
282
|
+
help: form.getFieldError("icQues_remarks_".concat(questionId)) || ""
|
|
283
|
+
}, getFieldDecorator("icQues_remarks_".concat(questionId), {
|
|
284
|
+
rules: isMandatory ? [{
|
|
285
|
+
required: true,
|
|
286
|
+
message: dataTest ? /*#__PURE__*/_react.default.createElement("span", {
|
|
287
|
+
"data-test": "".concat(dataTest, "--remarks-validation-message")
|
|
288
|
+
}, "Remarks cannot be empty.") : "Remarks cannot be empty."
|
|
289
|
+
}] : []
|
|
290
|
+
})( /*#__PURE__*/_react.default.createElement(_antd.Input.TextArea, {
|
|
291
|
+
"data-test": dataTest ? "".concat(dataTest, "--remarks") : undefined,
|
|
292
|
+
disabled: (_approvalForm$disable10 = approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.disabled) !== null && _approvalForm$disable10 !== void 0 ? _approvalForm$disable10 : false
|
|
293
|
+
}))))), actionRenderType === "buttonWithFormV4" && /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
294
|
+
name: "validateDocumentButton#".concat(questionId),
|
|
295
|
+
initialValue: approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.isApproved,
|
|
296
|
+
rules: isMandatory ? [{
|
|
297
|
+
required: true,
|
|
298
|
+
message: dataTest ? /*#__PURE__*/_react.default.createElement("span", {
|
|
299
|
+
"data-test": "".concat(dataTest, "--is-approved-validation-message")
|
|
300
|
+
}, "Approval status needs to be selected.") : "Approval status needs to be selected."
|
|
301
|
+
}] : []
|
|
302
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomButton.default, actionContent)))), hasDivider && /*#__PURE__*/_react.default.createElement(_antd.Divider, null));
|
|
303
|
+
}
|
|
304
|
+
ApprovalWidget.propTypes = {
|
|
305
|
+
children: _propTypes.default.node,
|
|
306
|
+
"data-test": _propTypes.default.string,
|
|
307
|
+
description: _propTypes.default.string,
|
|
308
|
+
// Leave description optional
|
|
309
|
+
docDetails: _propTypes.default.shape({
|
|
310
|
+
multiple: _propTypes.default.bool,
|
|
311
|
+
onUpload: _propTypes.default.func,
|
|
312
|
+
uploadedDocuments: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
313
|
+
name: _propTypes.default.string,
|
|
314
|
+
onDelete: _propTypes.default.func,
|
|
315
|
+
onDownload: _propTypes.default.func
|
|
316
|
+
}))
|
|
317
|
+
}),
|
|
318
|
+
multipleDocDetails: _propTypes.default.array,
|
|
319
|
+
hasDivider: _propTypes.default.bool,
|
|
320
|
+
// Leave hasDivider optional,
|
|
321
|
+
approvalForm: _propTypes.default.shape({
|
|
322
|
+
disabled: _propTypes.default.bool,
|
|
323
|
+
hidden: _propTypes.default.bool,
|
|
324
|
+
invisible: _propTypes.default.bool,
|
|
325
|
+
isApproved: _propTypes.default.bool,
|
|
326
|
+
remarks: _propTypes.default.string
|
|
327
|
+
}),
|
|
328
|
+
isMandatory: _propTypes.default.bool,
|
|
329
|
+
isQuestionStyleWidget: _propTypes.default.bool,
|
|
330
|
+
questionId: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]).isRequired,
|
|
331
|
+
title: _propTypes.default.string.isRequired,
|
|
332
|
+
// Make title required
|
|
333
|
+
viewOnClick: _propTypes.default.func,
|
|
334
|
+
actionRenderType: _propTypes.default.string,
|
|
335
|
+
actionContent: _propTypes.default.shape({
|
|
336
|
+
label: _propTypes.default.string
|
|
337
|
+
}),
|
|
338
|
+
systemStatus: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
339
|
+
renderType: _propTypes.default.string,
|
|
340
|
+
label: _propTypes.default.string,
|
|
341
|
+
title: _propTypes.default.string
|
|
342
|
+
})),
|
|
343
|
+
documentTitle: _propTypes.default.string,
|
|
344
|
+
descriptionTitle: _propTypes.default.string,
|
|
345
|
+
form: _propTypes.default.object,
|
|
346
|
+
tooltipPlacement: _propTypes.default.string,
|
|
347
|
+
columnDynamicCssClass: _propTypes.default.object
|
|
348
|
+
};
|
|
349
|
+
ApprovalWidget.defaultProps = {
|
|
350
|
+
children: null,
|
|
351
|
+
"data-test": undefined,
|
|
352
|
+
description: "",
|
|
353
|
+
docDetails: {},
|
|
354
|
+
approvalForm: {},
|
|
355
|
+
isMandatory: false,
|
|
356
|
+
hasDivider: false,
|
|
357
|
+
isQuestionStyleWidget: false,
|
|
358
|
+
viewOnClick: undefined,
|
|
359
|
+
actionRenderType: undefined,
|
|
360
|
+
actionContent: {},
|
|
361
|
+
systemStatus: [],
|
|
362
|
+
documentTitle: "",
|
|
363
|
+
descriptionTitle: "",
|
|
364
|
+
form: null,
|
|
365
|
+
tooltipPlacement: "bottom",
|
|
366
|
+
// Default placement
|
|
367
|
+
columnDynamicCssClass: {
|
|
368
|
+
firstColumn: "col-sm-12 col-md-5 col-lg-5",
|
|
369
|
+
secondColumn: "col-sm-12 col-md-4 col-lg-4 flexCol8",
|
|
370
|
+
thirdColumn: "col-sm-12 col-md-3 col-lg-3"
|
|
371
|
+
}
|
|
372
|
+
};
|
|
373
|
+
var _default = exports.default = ApprovalWidget;
|
|
@@ -8,6 +8,6 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
8
8
|
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
|
-
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;\
|
|
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 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"])));
|
|
@@ -86,8 +86,8 @@ function DocumentUpload(props) {
|
|
|
86
86
|
const handleCancel = () => setPreviewOpen(false);
|
|
87
87
|
|
|
88
88
|
/**
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
* Determines if the given file is an image file based on its file extension.
|
|
90
|
+
*/
|
|
91
91
|
function isImageFile(fileName) {
|
|
92
92
|
var _fileName$split;
|
|
93
93
|
// Extract the file extension from the file name
|
|
@@ -192,10 +192,10 @@ function DocumentUpload(props) {
|
|
|
192
192
|
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
193
193
|
color: "secondary-content",
|
|
194
194
|
className: "type-b2-400"
|
|
195
|
-
}, subText)), infoText && /*#__PURE__*/_react.default.createElement(
|
|
196
|
-
color: "
|
|
197
|
-
|
|
198
|
-
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
195
|
+
}, subText)), infoText && /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
196
|
+
color: "negative",
|
|
197
|
+
className: "type-b2-400"
|
|
198
|
+
}, infoText)), /*#__PURE__*/_react.default.createElement("div", {
|
|
199
199
|
className: "uploadDiv"
|
|
200
200
|
}, multipleDoc > 0 && /*#__PURE__*/_react.default.createElement("em", null, multipleDoc), /*#__PURE__*/_react.default.createElement(_antd.ConfigProvider, {
|
|
201
201
|
theme: {
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.weak-map.js");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _FeedbackForm = _interopRequireDefault(require("../../components/oa-component-feedback-form/FeedbackForm"));
|
|
11
|
+
var _FeedbackTooltip = _interopRequireDefault(require("../../components/oa-component-feedback-tooltip/FeedbackTooltip"));
|
|
12
|
+
var _styles = require("./styles");
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
+
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); }
|
|
15
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
|
+
/** *********** ✨ Codeium Command ⭐ ************ */
|
|
17
|
+
/**
|
|
18
|
+
* FeedbackWidget renders a feedback form and a tooltip with a button to open the form.
|
|
19
|
+
* The widget uses a useEffect hook to set the initial state of the component based on
|
|
20
|
+
* whether the feedback button has been clicked in the past (stored in localStorage).
|
|
21
|
+
* The component also uses a useCallback hook to memoize the functions used to set the
|
|
22
|
+
* state and to handle the button clicks.
|
|
23
|
+
*
|
|
24
|
+
* @param {Object} props - The properties object.
|
|
25
|
+
* @param {string} props.scriptSrc - The source URL for the script tag.
|
|
26
|
+
* @param {string} props.iframeSrc - The source URL for the iframe.
|
|
27
|
+
* @param {ReactElement} props.WrapperComponent - The component to wrap the FeedbackForm component.
|
|
28
|
+
* @param {Function} props.setOpen - The function to call when the feedback button is clicked.
|
|
29
|
+
* @param {boolean} props.open - The current state of the feedback form.
|
|
30
|
+
*
|
|
31
|
+
* @returns {ReactElement} The FeedbackWidget component.
|
|
32
|
+
*/
|
|
33
|
+
/** **** 1deff343-01ad-4bdd-848d-22d1f519f3ff ****** */
|
|
34
|
+
|
|
35
|
+
function FeedbackWidget(props) {
|
|
36
|
+
const {
|
|
37
|
+
scriptSrc,
|
|
38
|
+
iframeSrc,
|
|
39
|
+
WrapperComponent,
|
|
40
|
+
setOpen,
|
|
41
|
+
open,
|
|
42
|
+
onClose
|
|
43
|
+
} = props !== null && props !== void 0 ? props : {};
|
|
44
|
+
const [hasClickedFeedback, setHasClickedFeedback] = (0, _react.useState)(true);
|
|
45
|
+
const [tooltipOpen, setTooltipOpen] = (0, _react.useState)(true);
|
|
46
|
+
(0, _react.useEffect)(() => {
|
|
47
|
+
const feedbackClicked = localStorage.getItem('feedbackButtonClicked');
|
|
48
|
+
if (!feedbackClicked) {
|
|
49
|
+
setHasClickedFeedback(false);
|
|
50
|
+
}
|
|
51
|
+
}, []);
|
|
52
|
+
const onFeedbackButtonClick = (0, _react.useCallback)(() => {
|
|
53
|
+
setTooltipOpen(false);
|
|
54
|
+
setOpen(true);
|
|
55
|
+
localStorage.setItem('feedbackButtonClicked', true);
|
|
56
|
+
setHasClickedFeedback(true);
|
|
57
|
+
}, [setOpen]);
|
|
58
|
+
const onButtonClick = (0, _react.useCallback)(() => {
|
|
59
|
+
setTooltipOpen(false);
|
|
60
|
+
localStorage.setItem('feedbackButtonClicked', true);
|
|
61
|
+
setHasClickedFeedback(true);
|
|
62
|
+
}, [setOpen]);
|
|
63
|
+
return /*#__PURE__*/_react.default.createElement(_styles.OaFeedBackStyle, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
64
|
+
className: !hasClickedFeedback && 'OaMask'
|
|
65
|
+
}), /*#__PURE__*/_react.default.createElement(_FeedbackTooltip.default, {
|
|
66
|
+
setOpen: setOpen,
|
|
67
|
+
hasClickedFeedback: hasClickedFeedback,
|
|
68
|
+
setHasClickedFeedback: setHasClickedFeedback,
|
|
69
|
+
tooltipTitle: "We Value Your Feedback!",
|
|
70
|
+
tooltipDescription: "Please let us know your thoughts.",
|
|
71
|
+
tooltipButtonLabel: "Okay",
|
|
72
|
+
feedbackButtonLabel: "Give Feedback",
|
|
73
|
+
onFeedbackButtonClick: onFeedbackButtonClick,
|
|
74
|
+
onButtonClick: onButtonClick,
|
|
75
|
+
tooltipOpen: tooltipOpen
|
|
76
|
+
}), /*#__PURE__*/_react.default.createElement(WrapperComponent, null, /*#__PURE__*/_react.default.createElement(_FeedbackForm.default, {
|
|
77
|
+
scriptSrc: scriptSrc,
|
|
78
|
+
iframeSrc: iframeSrc,
|
|
79
|
+
open: open,
|
|
80
|
+
onClose: onClose
|
|
81
|
+
})));
|
|
82
|
+
}
|
|
83
|
+
var _default = exports.default = FeedbackWidget;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.OaFeedBackStyle = void 0;
|
|
7
|
+
var _antd = require("antd");
|
|
8
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
|
+
var _templateObject;
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
12
|
+
var _default = exports.default = {};
|
|
13
|
+
const OaFeedBackStyle = exports.OaFeedBackStyle = _styledComponents.default.aside(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .whiteBg{\n position: fixed;\n top: 50%;\n right: 0;\n transform: translate(0%, -50%) rotate(-90deg);\n cursor: pointer;\n z-index: 999;\n }\n .whiteBg button{\n background: #212121 !important;\n border: 1px solid #212121;\n }\n\n .OaMask{\n width: 100%;\n position: fixed;\n background: rgb(0 0 0 / 70%);\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 9;\n top: 0;\n }\n"])));
|