oa-componentbook 1.0.1-stage.4 → 1.0.1-stage.400
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 +129 -40
- package/build/components/oa-component-accordion/styles.js +2 -2
- package/build/components/oa-component-button/CustomButton.js +24 -19
- package/build/components/oa-component-button/styles.js +1 -1
- package/build/components/oa-component-checkbox/CustomCheckBox.js +20 -17
- package/build/components/oa-component-checkbox/styles.js +1 -1
- package/build/components/oa-component-datepicker/CustomDatePicker.js +37 -26
- package/build/components/oa-component-drawer/CustomDrawer.js +2 -0
- package/build/components/oa-component-dropdown/CustomDropdown.js +16 -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-icons/MaterialIcon.js +1 -1
- package/build/components/oa-component-info/CustomInfo.js +9 -4
- package/build/components/oa-component-info/styles.js +3 -3
- package/build/components/oa-component-modal/CustomModal.js +51 -46
- package/build/components/oa-component-modal/styles.js +3 -2
- package/build/components/oa-component-pagination/CustomPagination.js +111 -0
- package/build/components/oa-component-pagination/styles.js +12 -0
- package/build/components/oa-component-select/CustomSelect.js +116 -56
- package/build/components/oa-component-steps/CustomSteps.js +117 -0
- package/build/components/oa-component-steps/styles.js +12 -0
- package/build/components/oa-component-table/CustomTable.js +28 -5
- package/build/components/oa-component-table/CustomTableV1.js +610 -0
- package/build/components/oa-component-table/styles.js +1 -1
- package/build/components/oa-component-table/stylesV1.js +19 -0
- package/build/components/oa-component-tabs/CustomTabs.js +1 -1
- package/build/components/oa-component-tag/CustomTag.js +29 -11
- package/build/components/oa-component-tag/styles.js +30 -3
- package/build/components/oa-component-textarea/{TextArea.js → CustomTextArea.js} +4 -4
- package/build/components/oa-component-tooltip/CustomTooltip.js +8 -4
- package/build/components/oa-component-upload/CustomUpload.js +120 -40
- package/build/components/oa-component-viewer/CustomViewer.js +3 -1
- package/build/dev/oa-component-document-viewer/CustomDocumentViewer.js +367 -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-modal/DocumentSideModal.js +166 -0
- package/build/dev/oa-widget-document-modal/styles.js +12 -0
- package/build/dev/oa-widget-document-side-drawer/DocumentSideDrawer.js +196 -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/Car.png +0 -0
- package/build/images/TwoWheeler.png +0 -0
- package/build/images/astronaut_emptystate.png +0 -0
- package/build/images/exportGrp01.png +0 -0
- package/build/images/exportGrp02.png +0 -0
- package/build/images/exportGrp03.png +0 -0
- package/build/images/oaChat.svg +5 -0
- package/build/images/outOfStock.png +0 -0
- package/build/index.js +131 -5
- package/build/layout/DetailDataLayout/DetailDataLayout.js +20 -0
- package/build/layout/DetailDataLayout/components/Form.js +22 -0
- package/build/layout/DetailDataLayout/components/Header.js +32 -0
- package/build/layout/DetailDataLayout/style.css +9 -0
- package/build/layout/DetailDataLayout/styles.js +12 -0
- package/build/layout/EntityOverviewLayout/EntityOverviewLayout.js +235 -0
- package/build/layout/EntityOverviewLayout/reducer/entityOverviewLayoutReducer.js +63 -0
- package/build/layout/EntityOverviewLayout/styles.js +13 -0
- package/build/layout/GenricLayOut/GenricLayOut.js +2314 -0
- package/build/layout/GenricLayOut/components/AppliedFilters.js +91 -0
- package/build/layout/GenricLayOut/components/CardList.js +34 -0
- package/build/layout/GenricLayOut/components/DropdownSearch.js +48 -0
- package/build/layout/GenricLayOut/components/Header.js +74 -0
- package/build/layout/GenricLayOut/components/Modal.js +93 -0
- package/build/layout/GenricLayOut/components/ProfileSection.js +87 -0
- package/build/layout/GenricLayOut/components/Search.js +51 -0
- package/build/layout/GenricLayOut/components/StaticFilter.css +73 -0
- package/build/layout/GenricLayOut/components/StaticFilter.js +37 -0
- package/build/layout/GenricLayOut/reducer/layoutReducer.js +294 -0
- package/build/layout/GenricLayOut/resolver/staticConfigResolver.js +98 -0
- package/build/layout/GenricLayOut/styles.js +30 -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/utils/download-file.js +23 -0
- package/build/widgets/oa-form-widget/FormWidget.js +576 -0
- package/build/widgets/oa-form-widget/FormWidgetStyle.js +18 -0
- package/build/widgets/oa-widget-add-spare-part/AddSparePartCollapseWidget.js +80 -16
- package/build/widgets/oa-widget-add-spare-part/AddSparePartWidget.js +50 -7
- package/build/widgets/oa-widget-address/AddressWidget.js +12 -17
- package/build/widgets/oa-widget-approval/ApprovalWidget.js +19 -11
- package/build/widgets/oa-widget-approval/ApprovalWidgetNew.js +492 -0
- package/build/widgets/oa-widget-approval/styles.js +2 -2
- package/build/widgets/oa-widget-chat/ChatWidget.js +5 -5
- package/build/widgets/oa-widget-close-claim/CloseClaimWidget.js +17 -5
- package/build/widgets/oa-widget-collapsible-key-value/CollapsibleKeyValueWidget.js +396 -0
- package/build/widgets/oa-widget-collapsible-key-value/styles.js +16 -0
- package/build/widgets/oa-widget-content-panel/ContentPanel.js +82 -0
- package/build/widgets/oa-widget-content-panel/styles.js +12 -0
- package/build/widgets/oa-widget-customer-rating-card/CustomerRatingCard.js +5 -5
- package/build/widgets/oa-widget-detailcard/styles.js +1 -1
- package/build/widgets/oa-widget-document-upload/DocUploadWidget.js +6 -9
- package/build/widgets/oa-widget-dropdown-search-input/DropdownSearchInput.js +53 -19
- package/build/widgets/oa-widget-dropdown-search-input/styles.js +1 -1
- 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-guide/GuideWidget.js +70 -0
- package/build/widgets/oa-widget-guide/GuideWidgetStyle.js +12 -0
- package/build/widgets/oa-widget-hub-automation-modal/HubAutomationDeleteBiker.js +24 -0
- package/build/widgets/oa-widget-hub-automation-modal/HubAutomationModal.js +34 -0
- package/build/widgets/oa-widget-hub-automation-modal/HubAutomationModalStyle.js +13 -0
- package/build/widgets/oa-widget-image-carousel/ImageCarouselWidget.js +256 -0
- package/build/widgets/oa-widget-image-carousel/styles.js +23 -0
- package/build/widgets/oa-widget-image-gallery/FullscreenViewer.js +169 -0
- package/build/widgets/oa-widget-image-gallery/ImageGallery.js +87 -0
- package/build/widgets/oa-widget-image-gallery/ThumbnailGrid.js +146 -0
- package/build/widgets/oa-widget-image-gallery/imageCache.js +15 -0
- package/build/widgets/oa-widget-image-gallery/imageGalleryStyle.js +16 -0
- package/build/widgets/oa-widget-item-info-card/InfoCardListWidget.js +60 -0
- package/build/widgets/oa-widget-item-info-card/ItemInfoCardWidget.js +77 -0
- package/build/widgets/oa-widget-item-info-card/styles.css +50 -0
- package/build/widgets/oa-widget-item-info-card/styles.js +14 -0
- package/build/widgets/oa-widget-key-value/KeyValueWidget.js +46 -12
- package/build/widgets/oa-widget-key-value/styles.js +1 -1
- package/build/widgets/oa-widget-kpi/KPICardWidget.js +86 -0
- package/build/widgets/oa-widget-kpi/styles.js +12 -0
- package/build/widgets/oa-widget-map-base-location/AddressDetails.js +21 -7
- package/build/widgets/oa-widget-map-base-location/AddressForm.js +32 -5
- package/build/widgets/oa-widget-map-base-location/MapBaseLocation.js +9 -3
- package/build/widgets/oa-widget-map-base-location/MapComponent.js +17 -2
- package/build/widgets/oa-widget-membershipcard/MembershipCard.js +14 -3
- package/build/widgets/oa-widget-membershipcard/styles.js +1 -1
- package/build/widgets/oa-widget-notes/NotesWidget.js +32 -30
- package/build/widgets/oa-widget-notes/styles.js +4 -3
- package/build/widgets/oa-widget-profile-data/ProfileDataWidget.js +117 -0
- package/build/widgets/oa-widget-profile-data/styles.js +13 -0
- package/build/widgets/oa-widget-progressive-steps/ProgressiveStepsWidget.js +362 -0
- package/build/widgets/oa-widget-progressive-steps/styles.js +12 -0
- package/build/widgets/oa-widget-reimbursement-breakup/ReimbursementBreakupWidget.js +18 -9
- package/build/widgets/oa-widget-reimbursement-breakup/styles.js +1 -1
- package/build/widgets/oa-widget-reupload-drawer/ReUploadDrawer.js +164 -0
- package/build/widgets/oa-widget-select-list-item-modal/SelectListItemModal.js +79 -0
- package/build/widgets/oa-widget-sidebar/SidebarWidget.js +175 -0
- package/build/widgets/oa-widget-sidebar/components/Header.js +33 -0
- package/build/widgets/oa-widget-sidebar/styles.js +13 -0
- package/build/widgets/oa-widget-spare-part/SparePartsWidget.js +57 -29
- package/build/widgets/oa-widget-track-shipment/TrackShipmentWidget.js +28 -6
- package/build/widgets/oa-widget-track-shipment-list/TrackShipmentWidgetList.js +103 -0
- package/build/widgets/oa-widget-track-shipment-list/fn.js +81 -0
- package/build/widgets/oa-widget-user-management/UserManagementWidget.js +352 -0
- package/build/widgets/oa-widget-user-management/styles.js +15 -0
- package/package.json +7 -2
- package/build/dev/oa-widget-track-shipment/TrackShipmentWidget.js +0 -195
- /package/build/{dev/oa-widget-track-shipment → widgets/oa-widget-track-shipment-list}/styles.js +0 -0
|
@@ -0,0 +1,367 @@
|
|
|
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 _Close = _interopRequireDefault(require("@material-ui/icons/Close"));
|
|
17
|
+
var _RotateRight = _interopRequireDefault(require("@material-ui/icons/RotateRight"));
|
|
18
|
+
var _MaterialIcon = _interopRequireDefault(require("../../components/oa-component-icons/MaterialIcon"));
|
|
19
|
+
var _Typography = _interopRequireDefault(require("../../components/oa-component-typography/Typography"));
|
|
20
|
+
var _styles = _interopRequireDefault(require("./styles"));
|
|
21
|
+
var _reactZoomPanPinch = require("react-zoom-pan-pinch");
|
|
22
|
+
var _antd = require("antd");
|
|
23
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
|
+
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); }
|
|
25
|
+
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; }
|
|
26
|
+
/* eslint-disable */
|
|
27
|
+
|
|
28
|
+
_reactPdf.pdfjs.GlobalWorkerOptions.workerSrc = "https://cdnjs.cloudflare.com/ajax/libs/pdf.js/".concat(_reactPdf.pdfjs.version, "/pdf.worker.min.js");
|
|
29
|
+
function CustomDocumentViewer(_ref) {
|
|
30
|
+
let {
|
|
31
|
+
fileType,
|
|
32
|
+
fileUrl,
|
|
33
|
+
onDownload,
|
|
34
|
+
hideZoom,
|
|
35
|
+
hideDownload,
|
|
36
|
+
hidePageNumber,
|
|
37
|
+
hideRotate,
|
|
38
|
+
documentViewerOverlayHeight,
|
|
39
|
+
oaImgCenterHeight,
|
|
40
|
+
docHeight,
|
|
41
|
+
onlyDocumentView,
|
|
42
|
+
setcarouselPageNumberHandler,
|
|
43
|
+
initialSlide,
|
|
44
|
+
// in case of carousel - we can specify the initialSlide for opening specific page
|
|
45
|
+
carouselPageNumber,
|
|
46
|
+
selectedPages,
|
|
47
|
+
deleteSelectedPage
|
|
48
|
+
} = _ref;
|
|
49
|
+
const [totalPages, setTotalPages] = (0, _react.useState)(null);
|
|
50
|
+
const [currentPage, setCurrentPage] = (0, _react.useState)(1); // For image rotation.
|
|
51
|
+
const [rotation, setRotation] = (0, _react.useState)(0);
|
|
52
|
+
const [transformUtils, setTransformUtils] = (0, _react.useState)(null);
|
|
53
|
+
const containerRef = (0, _react.useRef)(null);
|
|
54
|
+
const pageRefs = (0, _react.useRef)([]);
|
|
55
|
+
const carouselRef = (0, _react.useRef)();
|
|
56
|
+
const transformUtilsRefs = (0, _react.useRef)([]); // holds utils per page
|
|
57
|
+
|
|
58
|
+
// When the document loads, update total pages (for PDFs).
|
|
59
|
+
const onDocumentLoadSuccess = _ref2 => {
|
|
60
|
+
let {
|
|
61
|
+
numPages
|
|
62
|
+
} = _ref2;
|
|
63
|
+
return setTotalPages(numPages);
|
|
64
|
+
};
|
|
65
|
+
const handleKeyDown = (0, _react.useCallback)(event => {
|
|
66
|
+
// Early return if not in carousel mode or carousel ref isn't ready
|
|
67
|
+
if (fileType !== "pdfWithCarousel" || !carouselRef.current) return;
|
|
68
|
+
|
|
69
|
+
// Ensure totalPages is valid before arithmetic
|
|
70
|
+
if (!totalPages || typeof totalPages !== "number") return;
|
|
71
|
+
|
|
72
|
+
// Check for right arrow and ensure we're not on the last page
|
|
73
|
+
if (event.key === "ArrowRight" && carouselPageNumber < totalPages - 1) {
|
|
74
|
+
var _carouselRef$current;
|
|
75
|
+
(_carouselRef$current = carouselRef.current) === null || _carouselRef$current === void 0 || _carouselRef$current.next();
|
|
76
|
+
}
|
|
77
|
+
// Check for left arrow and ensure we're not on the first page
|
|
78
|
+
else if (event.key === "ArrowLeft" && carouselPageNumber > 0) {
|
|
79
|
+
var _carouselRef$current2;
|
|
80
|
+
(_carouselRef$current2 = carouselRef.current) === null || _carouselRef$current2 === void 0 || _carouselRef$current2.prev();
|
|
81
|
+
}
|
|
82
|
+
}, [fileType, carouselPageNumber, totalPages]);
|
|
83
|
+
(0, _react.useEffect)(() => {
|
|
84
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
85
|
+
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
86
|
+
}, [handleKeyDown]);
|
|
87
|
+
const handleRotate = (0, _react.useCallback)(() => setRotation(prev => prev + 90), []);
|
|
88
|
+
// Default download function; can be overridden by passing an onDownload prop.
|
|
89
|
+
const defaultDownload = (0, _react.useCallback)(() => {
|
|
90
|
+
if (fileType === "image") {
|
|
91
|
+
fetch(fileUrl, {
|
|
92
|
+
mode: "cors"
|
|
93
|
+
}).then(res => res.blob()).then(blob => {
|
|
94
|
+
const url = URL.createObjectURL(blob);
|
|
95
|
+
const link = document.createElement("a");
|
|
96
|
+
link.href = url;
|
|
97
|
+
link.download = fileUrl.split("/").pop();
|
|
98
|
+
document.body.appendChild(link);
|
|
99
|
+
link.click();
|
|
100
|
+
document.body.removeChild(link);
|
|
101
|
+
URL.revokeObjectURL(url);
|
|
102
|
+
}).catch(error => console.error("Image download failed:", error));
|
|
103
|
+
} else {
|
|
104
|
+
// For PDFs and other file types, use the standard download.
|
|
105
|
+
const link = document.createElement("a");
|
|
106
|
+
link.href = fileUrl;
|
|
107
|
+
link.download = fileUrl.split("/").pop();
|
|
108
|
+
document.body.appendChild(link);
|
|
109
|
+
link.click();
|
|
110
|
+
document.body.removeChild(link);
|
|
111
|
+
}
|
|
112
|
+
}, [fileUrl, fileType]);
|
|
113
|
+
const handleDownload = onDownload || defaultDownload;
|
|
114
|
+
const customNextArrow = /*#__PURE__*/_react.default.createElement("div", {
|
|
115
|
+
className: "custom-slick-arrow custom-next"
|
|
116
|
+
}, /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
117
|
+
icon: _icons.KeyboardArrowRight,
|
|
118
|
+
size: 32
|
|
119
|
+
}));
|
|
120
|
+
const customPrevArrow = /*#__PURE__*/_react.default.createElement("div", {
|
|
121
|
+
className: "custom-slick-arrow custom-prev"
|
|
122
|
+
}, /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
123
|
+
icon: _icons.KeyboardArrowLeft,
|
|
124
|
+
size: 32
|
|
125
|
+
}));
|
|
126
|
+
const handleScroll = (0, _react.useCallback)(() => {
|
|
127
|
+
const container = containerRef.current;
|
|
128
|
+
if (!container) return;
|
|
129
|
+
const containerRect = container.getBoundingClientRect();
|
|
130
|
+
let closestPage = 1;
|
|
131
|
+
let minDistance = Infinity;
|
|
132
|
+
pageRefs.current.forEach((ref, index) => {
|
|
133
|
+
if (ref) {
|
|
134
|
+
const rect = ref.getBoundingClientRect();
|
|
135
|
+
const distance = Math.abs(rect.top - containerRect.top);
|
|
136
|
+
if (distance < minDistance) {
|
|
137
|
+
minDistance = distance;
|
|
138
|
+
closestPage = index + 1;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
setCurrentPage(closestPage);
|
|
143
|
+
}, []);
|
|
144
|
+
const Controls = (0, _react.useMemo)(() => {
|
|
145
|
+
return _ref3 => {
|
|
146
|
+
let {
|
|
147
|
+
zoomIn,
|
|
148
|
+
zoomOut,
|
|
149
|
+
resetTransform
|
|
150
|
+
} = _ref3;
|
|
151
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
152
|
+
className: "customDocumentViewerOverlayHeader"
|
|
153
|
+
}, !hideRotate && fileType === "image" && /*#__PURE__*/_react.default.createElement("div", {
|
|
154
|
+
className: "pageNumber"
|
|
155
|
+
}, /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
156
|
+
color: "primary-background",
|
|
157
|
+
size: 24,
|
|
158
|
+
icon: _RotateRight.default,
|
|
159
|
+
onClick: handleRotate,
|
|
160
|
+
style: {
|
|
161
|
+
cursor: "pointer"
|
|
162
|
+
}
|
|
163
|
+
})), !hidePageNumber && fileType === "pdf" && /*#__PURE__*/_react.default.createElement("div", {
|
|
164
|
+
className: "pageNumber"
|
|
165
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
166
|
+
className: "type-button-500",
|
|
167
|
+
color: "primary-background"
|
|
168
|
+
}, "Page ", currentPage, " of ", totalPages)), !hidePageNumber && fileType === "pdfWithCarousel" && /*#__PURE__*/_react.default.createElement("div", {
|
|
169
|
+
className: "pageNumber"
|
|
170
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
171
|
+
className: "type-button-500",
|
|
172
|
+
color: "primary-background"
|
|
173
|
+
}, "Page ", carouselPageNumber + 1, " out of ", totalPages)), !hideZoom && /*#__PURE__*/_react.default.createElement("div", {
|
|
174
|
+
className: "customDocumentViewerOverlayHeaderIcons"
|
|
175
|
+
}, /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
176
|
+
color: "primary-background",
|
|
177
|
+
size: 24,
|
|
178
|
+
icon: _icons.RemoveRounded,
|
|
179
|
+
onClick: () => zoomOut()
|
|
180
|
+
}), /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
181
|
+
color: "primary-background",
|
|
182
|
+
size: 24,
|
|
183
|
+
icon: _icons.ZoomInRounded,
|
|
184
|
+
onClick: () => resetTransform()
|
|
185
|
+
}), /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
186
|
+
color: "primary-background",
|
|
187
|
+
size: 24,
|
|
188
|
+
icon: _icons.AddRounded,
|
|
189
|
+
onClick: () => zoomIn()
|
|
190
|
+
})), !hideDownload && /*#__PURE__*/_react.default.createElement("div", {
|
|
191
|
+
className: "downloadIcon"
|
|
192
|
+
}, /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
193
|
+
color: "primary-background",
|
|
194
|
+
size: 24,
|
|
195
|
+
icon: _icons.GetAppRounded,
|
|
196
|
+
onClick: handleDownload
|
|
197
|
+
})));
|
|
198
|
+
};
|
|
199
|
+
}, [fileType, hideZoom, hideDownload, hidePageNumber, hideRotate, currentPage, totalPages, handleRotate, handleDownload, carouselPageNumber, transformUtils]);
|
|
200
|
+
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_styles.default, {
|
|
201
|
+
documentViewerOverlayHeight: documentViewerOverlayHeight,
|
|
202
|
+
oaImgCenterHeight: oaImgCenterHeight
|
|
203
|
+
}, fileType === "pdf" && /*#__PURE__*/_react.default.createElement("div", {
|
|
204
|
+
className: "customDocumentViewerOverlay ".concat(docHeight, " ").concat(fileType === "pdf" ? "pdfHeaderStyle" : "", " ").concat(onlyDocumentView ? " onlyDocumentView" : ""),
|
|
205
|
+
onScroll: handleScroll,
|
|
206
|
+
ref: containerRef
|
|
207
|
+
}, /*#__PURE__*/_react.default.createElement(_reactZoomPanPinch.TransformWrapper, {
|
|
208
|
+
initialScale: 1,
|
|
209
|
+
initialPositionX: 200,
|
|
210
|
+
wheel: {
|
|
211
|
+
disabled: true
|
|
212
|
+
},
|
|
213
|
+
pinch: {
|
|
214
|
+
disabled: true
|
|
215
|
+
},
|
|
216
|
+
doubleClick: {
|
|
217
|
+
disabled: true
|
|
218
|
+
}
|
|
219
|
+
}, utils => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(Controls, utils), /*#__PURE__*/_react.default.createElement(_reactZoomPanPinch.TransformComponent, {
|
|
220
|
+
wrapperStyle: {
|
|
221
|
+
overflowY: "auto"
|
|
222
|
+
// height: "calc(100vh - 112px)",
|
|
223
|
+
}
|
|
224
|
+
}, /*#__PURE__*/_react.default.createElement(_reactPdf.Document, {
|
|
225
|
+
file: fileUrl,
|
|
226
|
+
onLoadSuccess: onDocumentLoadSuccess
|
|
227
|
+
}, Array.from({
|
|
228
|
+
length: totalPages
|
|
229
|
+
}, (_, index) => /*#__PURE__*/_react.default.createElement("div", {
|
|
230
|
+
key: "page_".concat(index + 1),
|
|
231
|
+
ref: el => pageRefs.current[index] = el,
|
|
232
|
+
style: {
|
|
233
|
+
marginBottom: "20px",
|
|
234
|
+
display: "flex",
|
|
235
|
+
justifyContent: "center"
|
|
236
|
+
}
|
|
237
|
+
}, /*#__PURE__*/_react.default.createElement(_reactPdf.Page, {
|
|
238
|
+
pageNumber: index + 1,
|
|
239
|
+
scale: 1.0
|
|
240
|
+
})))))))), fileType === "image" && /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_reactZoomPanPinch.TransformWrapper, {
|
|
241
|
+
initialScale: 1
|
|
242
|
+
// wheel={{ disabled: true }}
|
|
243
|
+
,
|
|
244
|
+
initialPositionX: 200,
|
|
245
|
+
initialPositionY: 100
|
|
246
|
+
}, utils => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(Controls, utils), /*#__PURE__*/_react.default.createElement(_reactZoomPanPinch.TransformComponent, {
|
|
247
|
+
wrapperClass: "customDocumentViewerOverlay ".concat(onlyDocumentView ? " onlyDocumentView" : "")
|
|
248
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
249
|
+
src: fileUrl,
|
|
250
|
+
alt: "document",
|
|
251
|
+
style: {
|
|
252
|
+
maxWidth: "100%",
|
|
253
|
+
maxHeight: "50%",
|
|
254
|
+
transform: "rotate(".concat(rotation, "deg)"),
|
|
255
|
+
transformOrigin: "center center",
|
|
256
|
+
transition: "transform 0.3s ease-in-out"
|
|
257
|
+
}
|
|
258
|
+
}))))), fileType === "pdfWithCarousel" && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactPdf.Document, {
|
|
259
|
+
file: fileUrl,
|
|
260
|
+
onLoadSuccess: onDocumentLoadSuccess
|
|
261
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
262
|
+
className: (selectedPages === null || selectedPages === void 0 ? void 0 : selectedPages.length) > 0 ? "controlsWithFooter" : ""
|
|
263
|
+
}, transformUtils && /*#__PURE__*/_react.default.createElement(Controls, transformUtils)), /*#__PURE__*/_react.default.createElement(_antd.Carousel, {
|
|
264
|
+
ref: carouselRef,
|
|
265
|
+
arrows: true,
|
|
266
|
+
infinite: false,
|
|
267
|
+
dots: false,
|
|
268
|
+
nextArrow: customNextArrow,
|
|
269
|
+
beforeChange: (current, next) => {
|
|
270
|
+
setcarouselPageNumberHandler(next);
|
|
271
|
+
const nextUtils = transformUtilsRefs.current[next];
|
|
272
|
+
if (nextUtils) setTransformUtils(nextUtils); // update Controls to work on new page
|
|
273
|
+
// setCarouselPageNumber(next + 1);
|
|
274
|
+
},
|
|
275
|
+
prevArrow: customPrevArrow,
|
|
276
|
+
initialSlide: initialSlide !== null && initialSlide !== void 0 ? initialSlide : 0
|
|
277
|
+
}, Array.from({
|
|
278
|
+
length: totalPages
|
|
279
|
+
}, (_, index) => /*#__PURE__*/_react.default.createElement("div", {
|
|
280
|
+
key: "page_".concat(index + 1),
|
|
281
|
+
ref: el => pageRefs.current[index] = el
|
|
282
|
+
}, /*#__PURE__*/_react.default.createElement(_reactZoomPanPinch.TransformWrapper, {
|
|
283
|
+
initialScale: 1,
|
|
284
|
+
initialPositionX: 200,
|
|
285
|
+
wheel: {
|
|
286
|
+
disabled: true
|
|
287
|
+
},
|
|
288
|
+
pinch: {
|
|
289
|
+
disabled: true
|
|
290
|
+
},
|
|
291
|
+
doubleClick: {
|
|
292
|
+
disabled: true
|
|
293
|
+
},
|
|
294
|
+
onInit: utils => {
|
|
295
|
+
transformUtilsRefs.current[index] = utils;
|
|
296
|
+
if (index === 0) {
|
|
297
|
+
setTransformUtils(utils); // default for initial slide
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}, utils => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactZoomPanPinch.TransformComponent, {
|
|
301
|
+
wrapperStyle: {
|
|
302
|
+
overflowY: "auto",
|
|
303
|
+
display: "flex",
|
|
304
|
+
justifyContent: "center",
|
|
305
|
+
padding: "20px 0"
|
|
306
|
+
}
|
|
307
|
+
}, /*#__PURE__*/_react.default.createElement(_reactPdf.Page, {
|
|
308
|
+
pageNumber: index + 1,
|
|
309
|
+
scale: 1.0
|
|
310
|
+
})))))))), (selectedPages === null || selectedPages === void 0 ? void 0 : selectedPages.length) > 0 && /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
311
|
+
className: "carouselFooter"
|
|
312
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
313
|
+
className: "footerContainer"
|
|
314
|
+
}, selectedPages === null || selectedPages === void 0 ? void 0 : selectedPages.map(pageNumber => /*#__PURE__*/_react.default.createElement("div", {
|
|
315
|
+
className: "imgViewer"
|
|
316
|
+
}, /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
317
|
+
icon: _Close.default,
|
|
318
|
+
size: 20,
|
|
319
|
+
onClick: () => deleteSelectedPage(pageNumber)
|
|
320
|
+
}), /*#__PURE__*/_react.default.createElement(_reactPdf.Document, {
|
|
321
|
+
file: fileUrl
|
|
322
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
323
|
+
key: "page_".concat(pageNumber + 1),
|
|
324
|
+
ref: el => pageRefs.current[pageNumber] = el,
|
|
325
|
+
style: {
|
|
326
|
+
marginBottom: "20px",
|
|
327
|
+
display: "flex",
|
|
328
|
+
justifyContent: "center"
|
|
329
|
+
}
|
|
330
|
+
}, /*#__PURE__*/_react.default.createElement(_reactPdf.Page, {
|
|
331
|
+
pageNumber: pageNumber + 1,
|
|
332
|
+
scale: 1.0
|
|
333
|
+
})))))))))));
|
|
334
|
+
}
|
|
335
|
+
CustomDocumentViewer.propTypes = {
|
|
336
|
+
fileType: _propTypes.default.string.isRequired,
|
|
337
|
+
fileUrl: _propTypes.default.string.isRequired,
|
|
338
|
+
onDownload: _propTypes.default.func,
|
|
339
|
+
hideZoom: _propTypes.default.bool,
|
|
340
|
+
hideDownload: _propTypes.default.bool,
|
|
341
|
+
hidePageNumber: _propTypes.default.bool,
|
|
342
|
+
hideRotate: _propTypes.default.bool,
|
|
343
|
+
documentViewerOverlayHeight: _propTypes.default.string,
|
|
344
|
+
docHeight: _propTypes.default.string,
|
|
345
|
+
oaImgCenterHeight: _propTypes.default.string,
|
|
346
|
+
onlyDocumentView: _propTypes.default.bool,
|
|
347
|
+
setcarouselPageNumberHandler: _propTypes.default.func,
|
|
348
|
+
initialSlide: _propTypes.default.number,
|
|
349
|
+
carouselPageNumber: _propTypes.default.number,
|
|
350
|
+
selectedPages: _propTypes.default.array
|
|
351
|
+
};
|
|
352
|
+
CustomDocumentViewer.defaultProps = {
|
|
353
|
+
onDownload: null,
|
|
354
|
+
hideZoom: false,
|
|
355
|
+
hideDownload: false,
|
|
356
|
+
hidePageNumber: false,
|
|
357
|
+
hideRotate: false,
|
|
358
|
+
documentViewerOverlayHeight: "100vh",
|
|
359
|
+
docHeight: "",
|
|
360
|
+
oaImgCenterHeight: "calc(-114px + 100vh)",
|
|
361
|
+
onlyDocumentView: false,
|
|
362
|
+
setcarouselPageNumberHandler: null,
|
|
363
|
+
initialSlide: 0,
|
|
364
|
+
carouselPageNumber: 0,
|
|
365
|
+
selectedPages: []
|
|
366
|
+
};
|
|
367
|
+
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 position: relative;\n .customDocumentViewerOverlay .react-transform-component {\n background-color: var(--color-primary-content);\n // height: ", ";\n height: calc(100vh - 114px);\n display: flex;\n justify-content: center;\n width: 100%;\n padding: 0;\n margin: 0;\n flex-direction: column;\n align-items: center;\n position: relative;\n overflow: hidden;\n }\n .onlyDocumentView .react-transform-component {\n height: calc(100vh - 114px + 61px);\n }\n .react-pdf__Document {\n height: -webkit-fill-available;\n overflow: auto;\n }\n\n .react-pdf__Page {\n cursor: grab;\n display: contents;\n }\n .react-pdf__Page canvas{\n max-width: 100% !important;\n height: -webkit-fill-available !important;\n }\n .viewerContainer > div {\n position: rtelative;\n }\n .documentPdfHeight {\n height: calc(100vh - 114px);\n }\n .pdfHeaderStyle .react-transform-component {\n display: block;\n }\n .react-transform-component img {\n cursor: grab;\n pointer-events: auto;\n }\n .customDocumentViewerOverlayHeader {\n position: absolute;\n bottom: 16px;\n left: 50%;\n transform: translateX(-50%); /* Center horizontally */\n\n padding: 0 16px;\n height: 40px;\n width: fit-content;\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\n padding: 0 16px;\n height: 40px;\n width: fit-content;\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\n display: flex;\n align-items: center;\n justify-content: center;\n }\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 height: ", ";\n display: flex;\n justify-content: center;\n align-items: center;\n position: relative;\n }\n // slider css from here\n .slick-prev,\n .slick-next {\n z-index: 100;\n width: 36px;\n height: 36px;\n // display: flex !important;\n align-items: center;\n justify-content: center;\n background: #212121;\n border-radius: 50%;\n color: #fff; \n opacity: 1;\n }\n\n .slick-prev::before,\n .slick-next::before {\n font-size: 20px;\n color: white;\n opacity: 1;\n }\n\n .slick-prev {\n left: 8px;\n }\n .slick-next {\n right: 8px;\n }\n"])), props => props.documentViewerOverlayHeight, props => props.oaImgCenterHeight);
|
|
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,166 @@
|
|
|
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/web.dom-collections.iterator.js");
|
|
10
|
+
require("core-js/modules/es.array.includes.js");
|
|
11
|
+
require("core-js/modules/es.string.includes.js");
|
|
12
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
+
var _styles = require("./styles.js");
|
|
14
|
+
var _CustomCheckBox = _interopRequireDefault(require("../../components/oa-component-checkbox/CustomCheckBox"));
|
|
15
|
+
var _Typography = _interopRequireDefault(require("../../components/oa-component-typography/Typography"));
|
|
16
|
+
var _CustomButton = _interopRequireDefault(require("../../components/oa-component-button/CustomButton"));
|
|
17
|
+
var _MaterialIcon = _interopRequireDefault(require("../../components/oa-component-icons/MaterialIcon"));
|
|
18
|
+
var _CustomDocumentViewer = _interopRequireDefault(require("../oa-component-document-viewer/CustomDocumentViewer"));
|
|
19
|
+
var _Close = _interopRequireDefault(require("@material-ui/icons/Close"));
|
|
20
|
+
var _reactPdf = require("react-pdf");
|
|
21
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
+
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); }
|
|
24
|
+
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; }
|
|
25
|
+
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); } /* eslint-disable */
|
|
26
|
+
_reactPdf.pdfjs.GlobalWorkerOptions.workerSrc = "https://cdnjs.cloudflare.com/ajax/libs/pdf.js/".concat(_reactPdf.pdfjs.version, "/pdf.worker.min.js");
|
|
27
|
+
function DocumentSideModal(_ref) {
|
|
28
|
+
let {
|
|
29
|
+
headerIcon,
|
|
30
|
+
headerText,
|
|
31
|
+
infoIcon,
|
|
32
|
+
infoText,
|
|
33
|
+
onClose,
|
|
34
|
+
customDocumentViewerProps,
|
|
35
|
+
initialSelectedPages,
|
|
36
|
+
initialSlide,
|
|
37
|
+
updateSelectedPages,
|
|
38
|
+
maxPages
|
|
39
|
+
} = _ref;
|
|
40
|
+
const [carouselPageNumber, setcarouselPageNumber] = (0, _react.useState)(initialSlide !== null && initialSlide !== void 0 ? initialSlide : 0);
|
|
41
|
+
const [selectedPages, setSelectedPages] = (0, _react.useState)([]); //selected page
|
|
42
|
+
|
|
43
|
+
(0, _react.useEffect)(() => {
|
|
44
|
+
if (initialSelectedPages) {
|
|
45
|
+
setSelectedPages(initialSelectedPages);
|
|
46
|
+
}
|
|
47
|
+
}, [initialSelectedPages]);
|
|
48
|
+
(0, _react.useEffect)(() => {
|
|
49
|
+
document.body.style.overflow = "hidden";
|
|
50
|
+
return () => {
|
|
51
|
+
document.body.style.overflow = "";
|
|
52
|
+
};
|
|
53
|
+
}, []);
|
|
54
|
+
const pageRefs = (0, _react.useRef)([]);
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Handles the checkbox change event.
|
|
58
|
+
* @param {boolean} checked if the checkbox is checked or not.
|
|
59
|
+
* The function will add or remove the current page number from the selectedPages state
|
|
60
|
+
* depending on the checked status. If the checkbox is checked and the selectedPages state
|
|
61
|
+
* length is less than maxPages (default 2), it will add the current page number to the selectedPages state.
|
|
62
|
+
* If the checkbox is unchecked, it will remove the current page number from the selectedPages state.
|
|
63
|
+
*/
|
|
64
|
+
const handleCheckboxChange = checked => {
|
|
65
|
+
setSelectedPages(prevSelectedPages => {
|
|
66
|
+
if (checked) {
|
|
67
|
+
if (!prevSelectedPages.includes(carouselPageNumber) && prevSelectedPages.length < maxPages) {
|
|
68
|
+
return [...prevSelectedPages, carouselPageNumber];
|
|
69
|
+
}
|
|
70
|
+
return prevSelectedPages;
|
|
71
|
+
} else {
|
|
72
|
+
return prevSelectedPages.filter(page => page !== carouselPageNumber);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Updates the current carousel page number.
|
|
79
|
+
*
|
|
80
|
+
* @param {number} value - The new page number to set for the carousel.
|
|
81
|
+
*/
|
|
82
|
+
|
|
83
|
+
const setcarouselPageNumberHandler = value => {
|
|
84
|
+
setcarouselPageNumber(value);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Deletes the page from selectedPages state.
|
|
89
|
+
* @param {number} pageNumber - The page number to delete from the selectedPages state.
|
|
90
|
+
*/
|
|
91
|
+
const deleteSelectedPage = pageNumber => {
|
|
92
|
+
setSelectedPages(prevSelected => {
|
|
93
|
+
return prevSelected === null || prevSelected === void 0 ? void 0 : prevSelected.filter(item => item !== pageNumber);
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
const isPageSelected = (0, _react.useMemo)(() => selectedPages === null || selectedPages === void 0 ? void 0 : selectedPages.includes(carouselPageNumber), [selectedPages, carouselPageNumber]);
|
|
97
|
+
const disableCheckbox = (0, _react.useMemo)(() => !isPageSelected && selectedPages.length >= maxPages, [isPageSelected, selectedPages]);
|
|
98
|
+
return /*#__PURE__*/_react.default.createElement(_styles.Wrapper, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
99
|
+
className: "deviceName"
|
|
100
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
101
|
+
className: "type-t2-700",
|
|
102
|
+
color: "primary-background"
|
|
103
|
+
}, headerText), /*#__PURE__*/_react.default.createElement("div", {
|
|
104
|
+
style: {
|
|
105
|
+
cursor: "pointer"
|
|
106
|
+
}
|
|
107
|
+
}, /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
108
|
+
icon: _Close.default,
|
|
109
|
+
size: 20,
|
|
110
|
+
onClick: onClose
|
|
111
|
+
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
112
|
+
className: "previewSec"
|
|
113
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomDocumentViewer.default, _extends({}, customDocumentViewerProps, {
|
|
114
|
+
setcarouselPageNumberHandler: setcarouselPageNumberHandler,
|
|
115
|
+
initialSlide: initialSlide,
|
|
116
|
+
selectedPages: selectedPages,
|
|
117
|
+
isFooterVisible: selectedPages.length > 0 // <-- new prop
|
|
118
|
+
,
|
|
119
|
+
carouselPageNumber: carouselPageNumber,
|
|
120
|
+
deleteSelectedPage: deleteSelectedPage
|
|
121
|
+
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
122
|
+
className: "footerSec"
|
|
123
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
124
|
+
className: "containerWidth"
|
|
125
|
+
}, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_CustomCheckBox.default, {
|
|
126
|
+
label: "Select Page ".concat(carouselPageNumber + 1),
|
|
127
|
+
checked: isPageSelected,
|
|
128
|
+
disabled: disableCheckbox,
|
|
129
|
+
onChange: e => handleCheckboxChange(e.target.checked)
|
|
130
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
131
|
+
className: "padding-top-4"
|
|
132
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
133
|
+
className: "type-b3-400",
|
|
134
|
+
color: disableCheckbox ? "warning" : "secondary-content"
|
|
135
|
+
}, "(Maximum ".concat(maxPages, " pages can be selected)")))), /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
136
|
+
label: selectedPages.length === 0 ? "Selected" : "".concat(selectedPages.length, " ").concat(selectedPages.length > 1 ? "" : "", " Selected"),
|
|
137
|
+
disabled: selectedPages.length === 0,
|
|
138
|
+
onClick: () => updateSelectedPages(selectedPages)
|
|
139
|
+
}))));
|
|
140
|
+
}
|
|
141
|
+
DocumentSideModal.propTypes = {
|
|
142
|
+
headerText: _propTypes.default.string,
|
|
143
|
+
initialSlide: _propTypes.default.number,
|
|
144
|
+
initialSelectedPages: _propTypes.default.arrayOf(_propTypes.default.number),
|
|
145
|
+
headerIcon: _propTypes.default.elementType,
|
|
146
|
+
// assuming it's a component like an Icon
|
|
147
|
+
infoIcon: _propTypes.default.elementType,
|
|
148
|
+
infoText: _propTypes.default.string,
|
|
149
|
+
onClose: _propTypes.default.func.isRequired,
|
|
150
|
+
customDocumentViewerProps: _propTypes.default.object,
|
|
151
|
+
updateSelectedPages: _propTypes.default.func.isRequired,
|
|
152
|
+
maxPages: _propTypes.default.number
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
// ✅ Default Props
|
|
156
|
+
DocumentSideModal.defaultProps = {
|
|
157
|
+
headerText: "",
|
|
158
|
+
initialSelectedPages: [],
|
|
159
|
+
initialSlide: 0,
|
|
160
|
+
headerIcon: null,
|
|
161
|
+
infoIcon: null,
|
|
162
|
+
infoText: "",
|
|
163
|
+
customDocumentViewerProps: {},
|
|
164
|
+
maxPages: 2
|
|
165
|
+
};
|
|
166
|
+
var _default = exports.default = DocumentSideModal;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.Wrapper = 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 Wrapper = exports.Wrapper = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n.previewSec > div,.previewSec > div > div,.react-pdf__Document .ant-carousel,.slick-list,.slick-track,.slick-slide,.slick-slide > div,.slick-slide > div > div{\nheight: 100%;\n}\n.react-pdf__Document{\nheight: 100% !important;\noverflow: hidden !important;\nposition: relative;\n}\n.imgViewer .react-pdf__Page canvas{\n height: 100% !important;\n width: 100% !important;\n}\n.slick-slider{\n height: 100%;\n}\n display: flex;\n flex-direction: column;\n height: 100dvh;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 1000;\n background: rgba(0, 0, 0, 0.70);\n @media screen and (-webkit-min-device-pixel-ratio: 0) {\n @supports (-webkit-overflow-scrolling: touch) {\n height: auto;\n}\n}\n@media only screen and (max-width: 600px) {\n height: auto;\n}\n \n .react-pdf__Page{\n display: flex !important;\n justify-content: center;\n \n align-items: top;\n\n }\n .carouselFooter{\n height: 88px !important;\n width: 100%;\n color: #fff;\n position: fixed;\n bottom: 72px;\n display: flex;\n align-items: center;\n background: rgba(0, 0, 0, 0.70);\n box-shadow: 0px -4px 12px 0px rgba(0, 0, 0, 0.14);\n \n }\n .footerContainer{\n max-width: 768px;\n margin: 0 auto;\n display: flex;\n gap: 20px;\n width: 100%;\n }\n .imgViewer{\n position: relative;\n width: 56px;\n height: 56px;\n border: 1px solid var(--color-primary-background);\n border-radius: 8px;\n }\n // .imgViewer .react-pdf__Page canvas{\n // position: absolute;\n // top: 0;\n // width: 100%;\n // }\n .imgViewer .react-pdf__Document{\n position: absolute;\n top: 0;\n width: 100%;\n border-radius: 8px;\n }\n .imgViewer svg{\n position: absolute;\n right: -9px;\n color: #fff;\n top: -9px;\n z-index: 9;\n background: var(--color-primary);\n border-radius: 50%;\n cursor: pointer;\n font-weight: bolder;\n padding: 2px;\n }\n .slick-prev, .slick-next{\n display: flex !important;\n }\n .ant-carousel .slick-prev::after, .ant-carousel .slick-next::after {\n display: none;\n }\n .ant-carousel .slick-next:hover,.slick-prev:hover{\n color: #fff;\n background: #212121;\n }\n .ant-carousel .slick-next::before ,.ant-carousel .slick-prev::before {display: none;}\n .slick-slide > div > div{\n display: flex !important;\n flex-direction: column-reverse;\n justify-content: center;\n align-items: center;\n padding: 0px 0 0;\n }\n .slick-disabled{\n display: none !important;\n }\n // .react-transform-component{\n // height: calc(100vh - 178px) !important;\n // }\n \n .react-pdf__Page canvas{\n width: max-content !important;\n height: calc(100dvh - 72px - 48px) !important;\n }\n .react-transform-wrapper{\n overflow-y: hidden !important;\n padding: 0 !important;\n height: 100% !important;\n }\n // .react-pdf__Page__textContent{\n // height: 80% !important;\n // width: auto !important;\n // }\n .deviceName{\n height: 48px;\n background: #212121;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n .deviceName svg{\n position: absolute;\n right: 24px;\n top: 16px;\n color: #FFF;\n }\n .infoSec{\n background: var(--color-background-warning);\n height: 48px;\n color:#212121;\n align-items: center;\n justify-content: center;\n \n }\n .containerWidth{\n max-width: 768px;\n margin: 0 auto;\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 8px 0 !important;\n }\n .containerWidth div{\n display: flex;\n align-items: center;\n gap: 8px;\n }\n .previewSec{\n flex: 1;\n overflow: hidden;\n }\n .withFooter{\n margin: 0 0 84px !important;\n }\n .customDocumentViewerOverlay{\n display: flex;\n flex-direction: column-reverse;\n height: calc(100vh - 180px);\n width: 100%;\n align-items: anchor-center;\n }\n .pageNumber{\n white-space: nowrap;\n }\n .customDocumentViewerOverlayHeader{\n position: fixed !important;\n bottom: 82px !important;\n }\n .controlsWithFooter .customDocumentViewerOverlayHeader{\n bottom: 170px !important;\n }\n .footerSec{\n background: var(--color-primary-background);\n height: 72px;\n }\n .footerSec .containerWidth{\n height: 72px;\n }\n .footerSec .containerWidth div{\n flex-direction: column;\n align-items: flex-start;\n gap: 0;\n }\n\n @media only screen and (max-width: 600px) {\n \n .deviceName {\n justify-content: start;\n padding: 0 16px;\n}\n .footerSec{\n padding: 0 16px;\n }\n .carouselFooter{\n display: flex;\n height: 72px;\n justify-content: flex-start;\n align-items: center;\n}\n .footerContainer{\n padding: 0 16px;\n width: 100%;\n }\n .infoSec{\n padding: 0 16px;\n }\n}\n"])));
|
|
12
|
+
var _default = exports.default = Wrapper;
|