oa-componentbook 1.0.1-stage.9 → 1.0.1-stage.90
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
|
@@ -45,6 +45,8 @@ CollapseIcon.propTypes = {
|
|
|
45
45
|
* @param {string | number} [key] - Key to be used for the collapsible panel.
|
|
46
46
|
* @param {string | number} [defaultActiveKey] - Key of the collapsible panel that should be active by default.
|
|
47
47
|
* @param {boolean} [hasContentPadding=true] - Whether to apply content padding to the collapsible panel or not.
|
|
48
|
+
* @param {Function} [onChange=() => {}] - Function to be called when the panel is expanded or collapsed.
|
|
49
|
+
* @param {string | number} [activeKey] - Key of the collapsible panel that is currently active.
|
|
48
50
|
*/
|
|
49
51
|
function Accordion(_ref2) {
|
|
50
52
|
let {
|
|
@@ -57,7 +59,8 @@ function Accordion(_ref2) {
|
|
|
57
59
|
defaultActiveKey,
|
|
58
60
|
hasContentPadding,
|
|
59
61
|
// New prop to determine whether to apply contentPadding
|
|
60
|
-
onChange
|
|
62
|
+
onChange,
|
|
63
|
+
activeKey
|
|
61
64
|
} = _ref2;
|
|
62
65
|
const themeConfig = {
|
|
63
66
|
components: {
|
|
@@ -77,7 +80,7 @@ function Accordion(_ref2) {
|
|
|
77
80
|
}, /*#__PURE__*/_react.default.createElement(_antd.Collapse.Panel, {
|
|
78
81
|
"data-test": dataTest ? "".concat(dataTest, "--complete") : undefined,
|
|
79
82
|
collapsible: disabled ? 'disabled' : undefined,
|
|
80
|
-
key: key,
|
|
83
|
+
key: activeKey || key,
|
|
81
84
|
header: /*#__PURE__*/_react.default.createElement("div", {
|
|
82
85
|
"data-test": dataTest ? "".concat(dataTest, "--header") : undefined,
|
|
83
86
|
className: "type-button-500"
|
|
@@ -96,7 +99,8 @@ Accordion.propTypes = {
|
|
|
96
99
|
// New prop for controlling contentPadding
|
|
97
100
|
key: _propTypes.default.string,
|
|
98
101
|
defaultActiveKey: _propTypes.default.string,
|
|
99
|
-
onChange: _propTypes.default.func
|
|
102
|
+
onChange: _propTypes.default.func,
|
|
103
|
+
activeKey: _propTypes.default.string || _propTypes.default.number
|
|
100
104
|
};
|
|
101
105
|
Accordion.defaultProps = {
|
|
102
106
|
body: '',
|
|
@@ -107,6 +111,7 @@ Accordion.defaultProps = {
|
|
|
107
111
|
defaultActiveKey: '1',
|
|
108
112
|
hasContentPadding: true,
|
|
109
113
|
// Default value for contentPadding
|
|
110
|
-
onChange: () => {}
|
|
114
|
+
onChange: () => {},
|
|
115
|
+
activeKey: null
|
|
111
116
|
};
|
|
112
117
|
var _default = exports.default = Accordion;
|
|
@@ -0,0 +1,75 @@
|
|
|
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 _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
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); }
|
|
13
|
+
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; }
|
|
14
|
+
/** *********** ✨ Codeium Command ⭐ ************ */
|
|
15
|
+
/**
|
|
16
|
+
* FeedbackForm component renders an iframe and a script tag.
|
|
17
|
+
*
|
|
18
|
+
* @param {Object} props - The properties object.
|
|
19
|
+
* @param {string} props.iframeSrc - The source URL for the iframe.
|
|
20
|
+
* @param {string} props.scriptSrc - The source URL for the script.
|
|
21
|
+
* @param {boolean} props.open - A boolean value to control the effect.
|
|
22
|
+
*
|
|
23
|
+
* The component uses a useEffect hook to send a postMessage to the iframe
|
|
24
|
+
* content window once the iframe has loaded, enabling specific settings.
|
|
25
|
+
* The iframe is styled to fill the entire viewport.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/** **** 1da5e3d4-a27c-425d-956f-e856770f0f0d ****** */
|
|
29
|
+
function FeedbackForm(_ref) {
|
|
30
|
+
let {
|
|
31
|
+
iframeSrc,
|
|
32
|
+
scriptSrc,
|
|
33
|
+
open
|
|
34
|
+
} = _ref;
|
|
35
|
+
const [iframeKey, setIframeKey] = (0, _react.useState)(0);
|
|
36
|
+
(0, _react.useEffect)(() => {
|
|
37
|
+
const iframe = document.getElementById('s2c_embed_90232');
|
|
38
|
+
if (iframe) {
|
|
39
|
+
iframe.onload = function () {
|
|
40
|
+
const ifrmContWin = iframe.contentWindow;
|
|
41
|
+
const sendPostMsg = 'hideHeader=false&hideFooter=false';
|
|
42
|
+
ifrmContWin.postMessage(sendPostMsg, '*');
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
setIframeKey(prevKey => prevKey + 1);
|
|
46
|
+
}, [open]);
|
|
47
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
48
|
+
style: {
|
|
49
|
+
margin: 0,
|
|
50
|
+
height: '100%',
|
|
51
|
+
overflow: 'hidden'
|
|
52
|
+
}
|
|
53
|
+
}, /*#__PURE__*/_react.default.createElement("iframe", {
|
|
54
|
+
key: iframeKey,
|
|
55
|
+
id: "s2c_embed_90232",
|
|
56
|
+
width: "100%",
|
|
57
|
+
frameBorder: "0" // Removed line gap
|
|
58
|
+
,
|
|
59
|
+
src: iframeSrc,
|
|
60
|
+
style: {
|
|
61
|
+
height: '100%',
|
|
62
|
+
width: '100%'
|
|
63
|
+
},
|
|
64
|
+
title: "Feedback Survey"
|
|
65
|
+
}), /*#__PURE__*/_react.default.createElement("script", {
|
|
66
|
+
type: "text/javascript",
|
|
67
|
+
src: scriptSrc
|
|
68
|
+
}));
|
|
69
|
+
}
|
|
70
|
+
FeedbackForm.propTypes = {
|
|
71
|
+
iframeSrc: _propTypes.default.string.isRequired,
|
|
72
|
+
scriptSrc: _propTypes.default.string.isRequired,
|
|
73
|
+
open: _propTypes.default.bool.isRequired
|
|
74
|
+
};
|
|
75
|
+
var _default = exports.default = FeedbackForm;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _CustomButton = _interopRequireDefault(require("../oa-component-button/CustomButton"));
|
|
9
|
+
var _CustomTooltip = _interopRequireDefault(require("../oa-component-tooltip/CustomTooltip"));
|
|
10
|
+
var _Typography = _interopRequireDefault(require("../oa-component-typography/Typography"));
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
/** *********** ✨ Codeium Command ⭐ ************ */
|
|
13
|
+
/**
|
|
14
|
+
* FeedbackTooltip component displays a tooltip with a title, description, and buttons.
|
|
15
|
+
*
|
|
16
|
+
* @param {Object} props - The properties object.
|
|
17
|
+
* @param {boolean} props.hasClickedFeedback - Flag indicating if feedback button was clicked.
|
|
18
|
+
* @param {string} props.tooltipTitle - Title text for the tooltip.
|
|
19
|
+
* @param {string} props.tooltipDescription - Description text for the tooltip.
|
|
20
|
+
* @param {string} props.tooltipButtonLabel - Label for the tooltip button.
|
|
21
|
+
* @param {string} props.feedbackButtonLabel - Label for the feedback button.
|
|
22
|
+
* @param {Function} props.onButtonClick - Callback function for the tooltip button click.
|
|
23
|
+
* @param {Function} props.onFeedbackButtonClick - Callback function for the feedback button click.
|
|
24
|
+
* @param {boolean} props.tooltipOpen - Flag to control the visibility of the tooltip.
|
|
25
|
+
*
|
|
26
|
+
* @returns {ReactElement} The rendered FeedbackTooltip component.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/** **** 8ccbdb54-5c16-4cae-9d57-f492fd44997c ****** */
|
|
30
|
+
|
|
31
|
+
function FeedbackTooltip(props) {
|
|
32
|
+
const {
|
|
33
|
+
hasClickedFeedback,
|
|
34
|
+
tooltipTitle,
|
|
35
|
+
tooltipDescription,
|
|
36
|
+
tooltipButtonLabel,
|
|
37
|
+
feedbackButtonLabel,
|
|
38
|
+
onButtonClick,
|
|
39
|
+
onFeedbackButtonClick,
|
|
40
|
+
tooltipOpen
|
|
41
|
+
} = props !== null && props !== void 0 ? props : {};
|
|
42
|
+
return /*#__PURE__*/_react.default.createElement(_CustomTooltip.default, {
|
|
43
|
+
open: tooltipOpen && !hasClickedFeedback,
|
|
44
|
+
overlayClassName: "OaTooltip",
|
|
45
|
+
placement: "left",
|
|
46
|
+
title: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
47
|
+
className: "type-t1-500",
|
|
48
|
+
color: "primary-content"
|
|
49
|
+
}, tooltipTitle), /*#__PURE__*/_react.default.createElement("div", {
|
|
50
|
+
className: "padding-top-4 padding-bottom-32"
|
|
51
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
52
|
+
className: "type-b2-400",
|
|
53
|
+
color: "secondary-content"
|
|
54
|
+
}, tooltipDescription)), /*#__PURE__*/_react.default.createElement("div", {
|
|
55
|
+
className: "OaFooterBtn"
|
|
56
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
57
|
+
label: tooltipButtonLabel,
|
|
58
|
+
onClick: onButtonClick
|
|
59
|
+
})))
|
|
60
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
61
|
+
className: "whiteBg"
|
|
62
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
63
|
+
className: "feedbackBtn",
|
|
64
|
+
onClick: onFeedbackButtonClick,
|
|
65
|
+
size: "large",
|
|
66
|
+
label: feedbackButtonLabel
|
|
67
|
+
})));
|
|
68
|
+
}
|
|
69
|
+
var _default = exports.default = FeedbackTooltip;
|
|
@@ -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"])));
|
|
@@ -0,0 +1,281 @@
|
|
|
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
|
+
require("core-js/modules/es.promise.js");
|
|
10
|
+
require("core-js/modules/web.url.js");
|
|
11
|
+
require("core-js/modules/web.url-search-params.js");
|
|
12
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
|
+
var _reactPdf = require("react-pdf");
|
|
15
|
+
var _icons = require("@material-ui/icons");
|
|
16
|
+
var _RotateRight = _interopRequireDefault(require("@material-ui/icons/RotateRight"));
|
|
17
|
+
var _MaterialIcon = _interopRequireDefault(require("../../components/oa-component-icons/MaterialIcon"));
|
|
18
|
+
var _Typography = _interopRequireDefault(require("../../components/oa-component-typography/Typography"));
|
|
19
|
+
var _styles = _interopRequireDefault(require("./styles"));
|
|
20
|
+
var _system = require("@material-ui/system");
|
|
21
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
22
|
+
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); }
|
|
23
|
+
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; }
|
|
24
|
+
/* eslint-disable */
|
|
25
|
+
|
|
26
|
+
_reactPdf.pdfjs.GlobalWorkerOptions.workerSrc = "//cdnjs.cloudflare.com/ajax/libs/pdf.js/".concat(_reactPdf.pdfjs.version, "/pdf.worker.js");
|
|
27
|
+
const ZOOM_STEP = 0.2;
|
|
28
|
+
const MIN_ZOOM = 0.5;
|
|
29
|
+
const MAX_ZOOM = 3.0;
|
|
30
|
+
function CustomDocumentViewer(_ref) {
|
|
31
|
+
let {
|
|
32
|
+
fileType,
|
|
33
|
+
fileUrl,
|
|
34
|
+
onDownload,
|
|
35
|
+
hideZoom,
|
|
36
|
+
hideDownload,
|
|
37
|
+
hidePageNumber,
|
|
38
|
+
hideRotate,
|
|
39
|
+
documentViewerOverlayHeight,
|
|
40
|
+
docHeight
|
|
41
|
+
} = _ref;
|
|
42
|
+
const [totalPages, setTotalPages] = (0, _react.useState)(null);
|
|
43
|
+
const [scale, setScale] = (0, _react.useState)(1.0);
|
|
44
|
+
const [currentPage, setCurrentPage] = (0, _react.useState)(1);
|
|
45
|
+
// For image rotation.
|
|
46
|
+
const [rotation, setRotation] = (0, _react.useState)(0);
|
|
47
|
+
const containerRef = (0, _react.useRef)(null);
|
|
48
|
+
const pageRefs = (0, _react.useRef)([]);
|
|
49
|
+
|
|
50
|
+
// When the document loads, update total pages (for PDFs).
|
|
51
|
+
const onDocumentLoadSuccess = _ref2 => {
|
|
52
|
+
let {
|
|
53
|
+
numPages
|
|
54
|
+
} = _ref2;
|
|
55
|
+
setTotalPages(numPages);
|
|
56
|
+
};
|
|
57
|
+
// Zoom handlers.
|
|
58
|
+
const handleZoomIn = (0, _react.useCallback)(() => setScale(prev => Math.min(prev + ZOOM_STEP, MAX_ZOOM)), []);
|
|
59
|
+
const handleZoomOut = (0, _react.useCallback)(() => setScale(prev => Math.max(prev - ZOOM_STEP, MIN_ZOOM)), []);
|
|
60
|
+
const handleResetZoom = (0, _react.useCallback)(() => setScale(1.0), []);
|
|
61
|
+
|
|
62
|
+
// Single rotation handler for images – rotates 90° clockwise each click.
|
|
63
|
+
const handleRotate = (0, _react.useCallback)(() => {
|
|
64
|
+
setRotation(prev => prev + 90);
|
|
65
|
+
}, []);
|
|
66
|
+
|
|
67
|
+
// Default download function; can be overridden by passing an onDownload prop.
|
|
68
|
+
const defaultDownload = (0, _react.useCallback)(() => {
|
|
69
|
+
if (fileType === "image") {
|
|
70
|
+
// Fetch the image as a blob to force download.
|
|
71
|
+
fetch(fileUrl, {
|
|
72
|
+
mode: "cors"
|
|
73
|
+
}).then(res => res.blob()).then(blob => {
|
|
74
|
+
const url = window.URL.createObjectURL(blob);
|
|
75
|
+
const link = document.createElement("a");
|
|
76
|
+
link.href = url;
|
|
77
|
+
link.download = fileUrl.split("/").pop();
|
|
78
|
+
document.body.appendChild(link);
|
|
79
|
+
link.click();
|
|
80
|
+
document.body.removeChild(link);
|
|
81
|
+
window.URL.revokeObjectURL(url);
|
|
82
|
+
}).catch(error => {
|
|
83
|
+
console.error("Image download failed:", error);
|
|
84
|
+
});
|
|
85
|
+
} else {
|
|
86
|
+
// For PDFs and other file types, use the standard download.
|
|
87
|
+
const link = document.createElement("a");
|
|
88
|
+
link.href = fileUrl;
|
|
89
|
+
link.download = fileUrl.split("/").pop();
|
|
90
|
+
document.body.appendChild(link);
|
|
91
|
+
link.click();
|
|
92
|
+
document.body.removeChild(link);
|
|
93
|
+
}
|
|
94
|
+
}, [fileUrl, fileType]);
|
|
95
|
+
const handleDownload = onDownload || defaultDownload;
|
|
96
|
+
|
|
97
|
+
// Enable dragging when zoomed in.
|
|
98
|
+
(0, _react.useEffect)(() => {
|
|
99
|
+
const container = containerRef.current;
|
|
100
|
+
if (!container) return;
|
|
101
|
+
let isDragging = false;
|
|
102
|
+
let startX;
|
|
103
|
+
let startY;
|
|
104
|
+
let scrollLeft;
|
|
105
|
+
let scrollTop;
|
|
106
|
+
const onMouseDown = e => {
|
|
107
|
+
if (scale > 1.0) {
|
|
108
|
+
isDragging = true;
|
|
109
|
+
container.style.cursor = "grabbing";
|
|
110
|
+
startX = e.pageX;
|
|
111
|
+
startY = e.pageY;
|
|
112
|
+
scrollLeft = container.scrollLeft;
|
|
113
|
+
scrollTop = container.scrollTop;
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
const onMouseMove = e => {
|
|
117
|
+
if (!isDragging) return;
|
|
118
|
+
e.preventDefault();
|
|
119
|
+
const deltaX = e.pageX - startX;
|
|
120
|
+
const deltaY = e.pageY - startY;
|
|
121
|
+
container.scrollLeft = scrollLeft - deltaX;
|
|
122
|
+
container.scrollTop = scrollTop - deltaY;
|
|
123
|
+
};
|
|
124
|
+
const onMouseUp = function onMouseUp() {
|
|
125
|
+
isDragging = false;
|
|
126
|
+
container.style.cursor = scale > 1.0 ? "grab" : "auto";
|
|
127
|
+
};
|
|
128
|
+
container.addEventListener("mousedown", onMouseDown);
|
|
129
|
+
container.addEventListener("mousemove", onMouseMove);
|
|
130
|
+
container.addEventListener("mouseup", onMouseUp);
|
|
131
|
+
container.addEventListener("mouseleave", onMouseUp);
|
|
132
|
+
return () => {
|
|
133
|
+
container.removeEventListener("mousedown", onMouseDown);
|
|
134
|
+
container.removeEventListener("mousemove", onMouseMove);
|
|
135
|
+
container.removeEventListener("mouseup", onMouseUp);
|
|
136
|
+
container.removeEventListener("mouseleave", onMouseUp);
|
|
137
|
+
};
|
|
138
|
+
}, [scale]);
|
|
139
|
+
|
|
140
|
+
// (Optional) Scroll event to update the current page (for PDFs).
|
|
141
|
+
const handleScroll = () => {
|
|
142
|
+
const container = containerRef.current;
|
|
143
|
+
if (!container) return;
|
|
144
|
+
const containerRect = container.getBoundingClientRect();
|
|
145
|
+
let closestPage = 1;
|
|
146
|
+
let minDistance = Infinity;
|
|
147
|
+
pageRefs.current.forEach((ref, index) => {
|
|
148
|
+
if (ref) {
|
|
149
|
+
const rect = ref.getBoundingClientRect();
|
|
150
|
+
const distance = Math.abs(rect.top - containerRect.top);
|
|
151
|
+
if (distance < minDistance) {
|
|
152
|
+
minDistance = distance;
|
|
153
|
+
closestPage = index + 1;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
setCurrentPage(closestPage);
|
|
158
|
+
};
|
|
159
|
+
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_styles.default, {
|
|
160
|
+
documentViewerOverlayHeight: documentViewerOverlayHeight
|
|
161
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
162
|
+
ref: containerRef,
|
|
163
|
+
className: "customDocumentViewerOverlay ".concat(docHeight),
|
|
164
|
+
style: {
|
|
165
|
+
cursor: scale > 1.0 ? "grab" : "auto"
|
|
166
|
+
},
|
|
167
|
+
onScroll: handleScroll
|
|
168
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
169
|
+
className: "customDocumentViewerOverlayHeader"
|
|
170
|
+
}, fileType === "pdf" && !hidePageNumber ? /*#__PURE__*/_react.default.createElement("div", {
|
|
171
|
+
className: "pageNumber"
|
|
172
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
173
|
+
className: "type-button-500",
|
|
174
|
+
color: "primary-background"
|
|
175
|
+
}, "Page ", currentPage, " of ", totalPages)) : fileType === "image" && !hideRotate ? /*#__PURE__*/_react.default.createElement("div", {
|
|
176
|
+
className: "pageNumber"
|
|
177
|
+
}, /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
178
|
+
color: "primary-background",
|
|
179
|
+
size: 24,
|
|
180
|
+
icon: _RotateRight.default,
|
|
181
|
+
onClick: handleRotate,
|
|
182
|
+
style: {
|
|
183
|
+
cursor: "pointer"
|
|
184
|
+
}
|
|
185
|
+
})) : null, !hideZoom && /*#__PURE__*/_react.default.createElement("div", {
|
|
186
|
+
className: "customDocumentViewerOverlayHeaderIcons"
|
|
187
|
+
}, /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
188
|
+
color: "primary-background",
|
|
189
|
+
size: 24,
|
|
190
|
+
icon: _icons.RemoveRounded,
|
|
191
|
+
onClick: handleZoomOut,
|
|
192
|
+
style: {
|
|
193
|
+
cursor: scale === MIN_ZOOM ? "not-allowed" : "pointer"
|
|
194
|
+
}
|
|
195
|
+
}), /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
196
|
+
color: "primary-background",
|
|
197
|
+
size: 24,
|
|
198
|
+
icon: _icons.ZoomInRounded,
|
|
199
|
+
onClick: handleResetZoom,
|
|
200
|
+
style: {
|
|
201
|
+
cursor: scale === 1.0 ? "not-allowed" : "pointer"
|
|
202
|
+
}
|
|
203
|
+
}), /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
204
|
+
color: "primary-background",
|
|
205
|
+
size: 24,
|
|
206
|
+
icon: _icons.AddRounded,
|
|
207
|
+
onClick: handleZoomIn,
|
|
208
|
+
style: {
|
|
209
|
+
cursor: scale === MAX_ZOOM ? "not-allowed" : "pointer"
|
|
210
|
+
}
|
|
211
|
+
})), !hideDownload && /*#__PURE__*/_react.default.createElement("div", {
|
|
212
|
+
className: "downloadIcon"
|
|
213
|
+
}, /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
214
|
+
color: "primary-background",
|
|
215
|
+
size: 24,
|
|
216
|
+
icon: _icons.GetAppRounded,
|
|
217
|
+
onClick: handleDownload
|
|
218
|
+
}))), fileType === "pdf" && /*#__PURE__*/_react.default.createElement("div", {
|
|
219
|
+
style: {
|
|
220
|
+
transform: "scale(".concat(scale, ")"),
|
|
221
|
+
transformOrigin: "top center"
|
|
222
|
+
}
|
|
223
|
+
}, /*#__PURE__*/_react.default.createElement(_reactPdf.Document, {
|
|
224
|
+
file: fileUrl,
|
|
225
|
+
onLoadSuccess: onDocumentLoadSuccess
|
|
226
|
+
}, Array.from({
|
|
227
|
+
length: totalPages
|
|
228
|
+
}, (_, index) => /*#__PURE__*/_react.default.createElement("div", {
|
|
229
|
+
key: "page_".concat(index + 1),
|
|
230
|
+
ref: el => pageRefs.current[index] = el,
|
|
231
|
+
style: {
|
|
232
|
+
marginBottom: "20px",
|
|
233
|
+
display: "flex",
|
|
234
|
+
justifyContent: "center"
|
|
235
|
+
}
|
|
236
|
+
}, /*#__PURE__*/_react.default.createElement(_reactPdf.Page, {
|
|
237
|
+
pageNumber: index + 1,
|
|
238
|
+
scale: 1.0
|
|
239
|
+
}))))), fileType === "image" && /*#__PURE__*/_react.default.createElement("div", {
|
|
240
|
+
className: "oaImgCenter",
|
|
241
|
+
style: {
|
|
242
|
+
transform: "scale(".concat(scale, ") rotate(").concat(rotation, "deg)"),
|
|
243
|
+
transformOrigin: scale > 1.4 ? "left top" : "center center"
|
|
244
|
+
}
|
|
245
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
246
|
+
src: fileUrl,
|
|
247
|
+
alt: "document",
|
|
248
|
+
style: {
|
|
249
|
+
transition: "transform 0.3s ease-in-out",
|
|
250
|
+
maxWidth: "100%",
|
|
251
|
+
maxHeight: "80vh"
|
|
252
|
+
}
|
|
253
|
+
})))));
|
|
254
|
+
}
|
|
255
|
+
CustomDocumentViewer.propTypes = {
|
|
256
|
+
fileType: _propTypes.default.string.isRequired,
|
|
257
|
+
// "pdf" or "image"
|
|
258
|
+
fileUrl: _propTypes.default.string.isRequired,
|
|
259
|
+
onDownload: _propTypes.default.func,
|
|
260
|
+
// Optional custom download function
|
|
261
|
+
hideZoom: _propTypes.default.bool,
|
|
262
|
+
// If true, hide zoom controls (for PDFs)
|
|
263
|
+
hideDownload: _propTypes.default.bool,
|
|
264
|
+
// If true, hide download button
|
|
265
|
+
hidePageNumber: _propTypes.default.bool,
|
|
266
|
+
// If true, hide page number display (for PDFs)
|
|
267
|
+
hideRotate: _propTypes.default.bool,
|
|
268
|
+
// If true, hide rotate control (for images)
|
|
269
|
+
documentViewerOverlayHeight: _propTypes.default.string,
|
|
270
|
+
docHeight: _propTypes.default.string
|
|
271
|
+
};
|
|
272
|
+
CustomDocumentViewer.defaultProps = {
|
|
273
|
+
onDownload: null,
|
|
274
|
+
hideZoom: false,
|
|
275
|
+
hideDownload: false,
|
|
276
|
+
hidePageNumber: false,
|
|
277
|
+
hideRotate: false,
|
|
278
|
+
documentViewerOverlayHeight: "100vh",
|
|
279
|
+
docHeight: ""
|
|
280
|
+
};
|
|
281
|
+
var _default = exports.default = CustomDocumentViewer;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
+
var _templateObject;
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
11
|
+
const DocumentViewerContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .customDocumentViewerOverlay {\n background-color: var(--color-primary-content);\n height: ", ";\n display: flex;\n justify-content: flex-start;\n width: 100%;\n padding: 0;\n margin: 0;\n flex-direction: column;\n overflow: auto;\n align-items: center; position: relative;\n }\n\n .documentPdfHeight{height:calc(100vh - 114px);}\n\n .customDocumentViewerOverlayHeader {\n position: fixed;\n padding: 0 16px;\n bottom: 74px;\n left: auto;\n right: auto;\n border-radius: 4px;\n z-index: 99;\n background: rgba(0, 0, 0, 0.7);\n box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.34);\n display: flex;\n align-items: center;\n justify-content: center;\n height: 40px;\n top:auto;\n }\n .customDocumentViewerOverlayHeaderIcons {\n display: flex;\n padding: 8px 0;\n flex-direction: row;\n gap: 16px;\n }\n\n .downloadIcon {\n border-left: solid 1px #fff;\n padding-left: 16px;\n margin-left: 16px;\n height: 100%;\n align-items: center;\n display: flex;\n }\n .pageNumber {\n border-right: solid 1px #fff;\n padding-right: 16px;\n margin-right: 16px;\n height: 100%;\n align-items: center;\n display: flex;\n }\n .ant-radio-group {\n display: flex;\n white-space: nowrap;\n }\n .oaImgCenter{\n height: calc(-114px + 100vh);\n display: flex;\n justify-content: center;\n align-items: center;\n position: relative;\n }\n"])), props => props.documentViewerOverlayHeight);
|
|
12
|
+
var _default = exports.default = DocumentViewerContainer;
|
|
@@ -196,6 +196,9 @@ function DocumentUpload(_ref) {
|
|
|
196
196
|
rules: [{
|
|
197
197
|
validator: (rule, value) => {
|
|
198
198
|
if (isMandatory && !(value !== null && value !== void 0 && value.length)) {
|
|
199
|
+
if (typeof value === 'object' && Object.keys(value).length > 0) {
|
|
200
|
+
return Promise.resolve();
|
|
201
|
+
}
|
|
199
202
|
return Promise.reject(new Error('Please upload the document.'));
|
|
200
203
|
}
|
|
201
204
|
return Promise.resolve();
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
require("react-pdf/dist/esm/Page/AnnotationLayer.css");
|
|
10
|
+
var _Typography = _interopRequireDefault(require("../../components/oa-component-typography/Typography"));
|
|
11
|
+
var _CustomDrawer = _interopRequireDefault(require("../../components/oa-component-drawer/CustomDrawer"));
|
|
12
|
+
var _CustomDocumentViewer = _interopRequireDefault(require("../oa-component-document-viewer/CustomDocumentViewer"));
|
|
13
|
+
var _CustomTag = _interopRequireDefault(require("../../components/oa-component-tag/CustomTag"));
|
|
14
|
+
var _CustomButton = _interopRequireDefault(require("../../components/oa-component-button/CustomButton"));
|
|
15
|
+
var _CustomTooltip = _interopRequireDefault(require("../../components/oa-component-tooltip/CustomTooltip"));
|
|
16
|
+
var _MaterialIcon = _interopRequireDefault(require("../../components/oa-component-icons/MaterialIcon"));
|
|
17
|
+
var _Close = _interopRequireDefault(require("@material-ui/icons/Close"));
|
|
18
|
+
var _Check = _interopRequireDefault(require("@material-ui/icons/Check"));
|
|
19
|
+
var _styles = _interopRequireDefault(require("./styles"));
|
|
20
|
+
const _excluded = ["title", "handleCloseDrawer", "documentConfig", "drawerWidth", "drawerButtonConfig", "drawerTagConfig", "onlyDocumentView"];
|
|
21
|
+
/* eslint-disable */
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
+
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; }
|
|
24
|
+
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; }
|
|
25
|
+
function DocumentSideDrawer(_ref) {
|
|
26
|
+
var _drawerTagConfig$view;
|
|
27
|
+
let {
|
|
28
|
+
title,
|
|
29
|
+
handleCloseDrawer,
|
|
30
|
+
documentConfig,
|
|
31
|
+
drawerWidth,
|
|
32
|
+
drawerButtonConfig,
|
|
33
|
+
drawerTagConfig,
|
|
34
|
+
onlyDocumentView
|
|
35
|
+
} = _ref,
|
|
36
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
37
|
+
// Calculate the drawer width based on documentConfig or fallback to 480
|
|
38
|
+
const calculatedWidth = drawerWidth !== null && drawerWidth !== void 0 ? drawerWidth : documentConfig ? 1200 : 480;
|
|
39
|
+
return /*#__PURE__*/_react.default.createElement(_CustomDrawer.default, {
|
|
40
|
+
buttonConfig: drawerButtonConfig,
|
|
41
|
+
"data-test": "document-side-drawer",
|
|
42
|
+
className: "documentDrawer",
|
|
43
|
+
width: calculatedWidth,
|
|
44
|
+
onClose: handleCloseDrawer,
|
|
45
|
+
title: title
|
|
46
|
+
}, /*#__PURE__*/_react.default.createElement(_styles.default, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
47
|
+
className: "viewerContainer"
|
|
48
|
+
}, documentConfig && /*#__PURE__*/_react.default.createElement(_CustomDocumentViewer.default, documentConfig), !onlyDocumentView && /*#__PURE__*/_react.default.createElement("div", {
|
|
49
|
+
className: "rightContSection"
|
|
50
|
+
}, drawerTagConfig && /*#__PURE__*/_react.default.createElement("div", {
|
|
51
|
+
className: "grayBoxSec"
|
|
52
|
+
}, drawerTagConfig.heading && /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
53
|
+
className: "type-t2-700",
|
|
54
|
+
color: "primary-content"
|
|
55
|
+
}, drawerTagConfig.heading), /*#__PURE__*/_react.default.createElement("div", {
|
|
56
|
+
className: "margin-top-16 statusSec"
|
|
57
|
+
}, drawerTagConfig.tag && (
|
|
58
|
+
// Conditionally render CustomTag or Typography based on tag type
|
|
59
|
+
drawerTagConfig.tag.type ? /*#__PURE__*/_react.default.createElement(_CustomTag.default, {
|
|
60
|
+
label: drawerTagConfig.tag.label,
|
|
61
|
+
type: drawerTagConfig.tag.type
|
|
62
|
+
}) : /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
63
|
+
typography: "type-button-500"
|
|
64
|
+
}, drawerTagConfig.tag.label)), ((_drawerTagConfig$view = drawerTagConfig.viewDetails) === null || _drawerTagConfig$view === void 0 || (_drawerTagConfig$view = _drawerTagConfig$view.items) === null || _drawerTagConfig$view === void 0 ? void 0 : _drawerTagConfig$view.length) > 0 && /*#__PURE__*/_react.default.createElement(_CustomTooltip.default, {
|
|
65
|
+
overlayClassName: "multipleDocumentTooltip",
|
|
66
|
+
isDisplayed: true,
|
|
67
|
+
title: ((_drawerTagConfig$view2, _drawerTagConfig$view3, _drawerTagConfig$view4, _drawerTagConfig$view5) => {
|
|
68
|
+
const totalItems = (_drawerTagConfig$view2 = drawerTagConfig.viewDetails) === null || _drawerTagConfig$view2 === void 0 ? void 0 : _drawerTagConfig$view2.items.length;
|
|
69
|
+
const numColumns = totalItems === 1 ? 1 : 2; // 1 column if only 1 item, else 2 columns
|
|
70
|
+
|
|
71
|
+
const col1Size = Math.ceil(totalItems / numColumns); // First column gets extra if odd
|
|
72
|
+
const col2Size = totalItems - col1Size; // Remaining items go to second column
|
|
73
|
+
|
|
74
|
+
const columns = [(_drawerTagConfig$view3 = drawerTagConfig.viewDetails) === null || _drawerTagConfig$view3 === void 0 ? void 0 : _drawerTagConfig$view3.items.slice(0, col1Size), // First column
|
|
75
|
+
(_drawerTagConfig$view4 = drawerTagConfig.viewDetails) === null || _drawerTagConfig$view4 === void 0 ? void 0 : _drawerTagConfig$view4.items.slice(col1Size) // Second column
|
|
76
|
+
];
|
|
77
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, ((_drawerTagConfig$view5 = drawerTagConfig.viewDetails) === null || _drawerTagConfig$view5 === void 0 ? void 0 : _drawerTagConfig$view5.title) && /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
78
|
+
typography: "type-sl1-700",
|
|
79
|
+
color: "secondary-content"
|
|
80
|
+
}, drawerTagConfig.viewDetails.title), /*#__PURE__*/_react.default.createElement("div", {
|
|
81
|
+
className: "tooltip-grid",
|
|
82
|
+
style: {
|
|
83
|
+
flexDirection: totalItems === 1 ? "column" : "row",
|
|
84
|
+
// Single column if only 1 item
|
|
85
|
+
width: totalItems === 1 ? "100%" : "auto" // Full width if only 1 item
|
|
86
|
+
}
|
|
87
|
+
}, columns.map((columnItems, colIndex) => /*#__PURE__*/_react.default.createElement("div", {
|
|
88
|
+
key: "col-".concat(colIndex),
|
|
89
|
+
className: "tooltip-column"
|
|
90
|
+
}, columnItems.map(item => /*#__PURE__*/_react.default.createElement("li", {
|
|
91
|
+
key: item.title,
|
|
92
|
+
className: "tooltip-item"
|
|
93
|
+
}, /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
94
|
+
size: 20,
|
|
95
|
+
icon: item.type === "positive" ? _Check.default : _Close.default,
|
|
96
|
+
color: item.type === "positive" ? "positive" : "negative"
|
|
97
|
+
}), /*#__PURE__*/_react.default.createElement("p", null, item.title)))))));
|
|
98
|
+
})()
|
|
99
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
100
|
+
type: "text-only",
|
|
101
|
+
label: drawerTagConfig.viewDetails.label
|
|
102
|
+
})))), props.children))));
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Define the prop types to enforce correct data types for the props
|
|
106
|
+
DocumentSideDrawer.propTypes = {
|
|
107
|
+
title: _propTypes.default.string,
|
|
108
|
+
handleCloseDrawer: _propTypes.default.func,
|
|
109
|
+
documentConfig: _propTypes.default.object,
|
|
110
|
+
// Pass the document configuration as an object
|
|
111
|
+
drawerWidth: _propTypes.default.string,
|
|
112
|
+
// Optional custom drawer width
|
|
113
|
+
drawerButtonConfig: _propTypes.default.object,
|
|
114
|
+
// Button configuration for the drawer
|
|
115
|
+
drawerTagConfig: _propTypes.default.object,
|
|
116
|
+
// Tag configuration (heading, tag, viewDetails)
|
|
117
|
+
onlyDocumentView: _propTypes.default.bool // Optional prop to render only document viewer
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
// Default props to provide fallback values for optional props
|
|
121
|
+
DocumentSideDrawer.defaultProps = {
|
|
122
|
+
title: "",
|
|
123
|
+
handleCloseDrawer: () => {},
|
|
124
|
+
documentConfig: null,
|
|
125
|
+
drawerWidth: null,
|
|
126
|
+
drawerButtonConfig: null,
|
|
127
|
+
drawerTagConfig: null,
|
|
128
|
+
onlyDocumentView: false
|
|
129
|
+
};
|
|
130
|
+
var _default = exports.default = DocumentSideDrawer;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
+
var _templateObject;
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
11
|
+
const ViewerContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .viewerContainer > div {\n flex: 1;\n box-sizing: border-box;\n }\n .viewerContainer {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n }\n .rightContSection {\n display: flex;\n flex-direction: column;\n padding: 24px;\n }\n .grayBoxSec {\n border-radius: 8px;\n background: #f6f6f6;\n padding: 12px 16px;\n }\n .statusSec {\n display: flex;\n flex-direction: row;\n align-items: center;\n }\n .statusSec button {\n margin-left: 8px;\n }\n"])));
|
|
12
|
+
var _default = exports.default = ViewerContainer;
|