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.
Files changed (47) hide show
  1. package/build/components/oa-component-accordion/Accordion.js +9 -4
  2. package/build/components/oa-component-feedback-form/FeedbackForm.js +75 -0
  3. package/build/components/oa-component-feedback-tooltip/FeedbackTooltip.js +69 -0
  4. package/build/components/oa-component-modal/styles.js +1 -1
  5. package/build/dev/oa-component-document-viewer/CustomDocumentViewer.js +281 -0
  6. package/build/dev/oa-component-document-viewer/styles.js +12 -0
  7. package/build/dev/oa-component-upload/CustomUpload.js +3 -0
  8. package/build/dev/oa-widget-document-side-drawer/DocumentSideDrawer.js +130 -0
  9. package/build/dev/oa-widget-document-side-drawer/styles.js +12 -0
  10. package/build/global-css/GlobalCss.js +2 -1
  11. package/build/global-css/GridLayout.js +1 -1
  12. package/build/global-css/commonStyles.js +11 -0
  13. package/build/images/oaChat.svg +5 -0
  14. package/build/index.js +56 -0
  15. package/build/layout/paymentAndConsent/CancelScreen.js +46 -0
  16. package/build/layout/paymentAndConsent/ConsentCard.js +68 -0
  17. package/build/layout/paymentAndConsent/DetailsCard.js +75 -0
  18. package/build/layout/paymentAndConsent/DetailsList.js +38 -0
  19. package/build/layout/paymentAndConsent/Header.js +33 -0
  20. package/build/layout/paymentAndConsent/InProgressScreen.js +46 -0
  21. package/build/layout/paymentAndConsent/Loader.js +21 -0
  22. package/build/layout/paymentAndConsent/Modal.js +28 -0
  23. package/build/layout/paymentAndConsent/PaymentAndConsent.js +22 -0
  24. package/build/layout/paymentAndConsent/PaymentCard.js +83 -0
  25. package/build/layout/paymentAndConsent/Section.js +34 -0
  26. package/build/layout/paymentAndConsent/SuccessScreen.js +46 -0
  27. package/build/layout/paymentAndConsent/TimeLineCard.js +28 -0
  28. package/build/layout/paymentAndConsent/TncList.js +32 -0
  29. package/build/layout/paymentAndConsent/style.js +12 -0
  30. package/build/widgets/oa-widget-add-spare-part/AddSparePartCollapseWidget.js +17 -11
  31. package/build/widgets/oa-widget-approval/ApprovalWidgetNew.js +373 -0
  32. package/build/widgets/oa-widget-approval/styles.js +2 -2
  33. package/build/widgets/oa-widget-document-upload/DocUploadWidget.js +6 -6
  34. package/build/widgets/oa-widget-feedback/FeedbackWidget.js +83 -0
  35. package/build/widgets/oa-widget-feedback/styles.js +13 -0
  36. package/build/widgets/oa-widget-image-carousel/ImageCarouselWidget.js +257 -0
  37. package/build/widgets/oa-widget-image-carousel/styles.js +23 -0
  38. package/build/widgets/oa-widget-map-base-location/AddressDetails.js +6 -4
  39. package/build/widgets/oa-widget-map-base-location/AddressForm.js +26 -3
  40. package/build/widgets/oa-widget-map-base-location/MapBaseLocation.js +5 -3
  41. package/build/widgets/oa-widget-membershipcard/MembershipCard.js +5 -7
  42. package/build/widgets/oa-widget-notes/NotesWidget.js +2 -1
  43. package/build/widgets/oa-widget-reupload-drawer/ReUploadDrawer.js +164 -0
  44. package/build/widgets/oa-widget-track-shipment/TrackShipmentWidget.js +4 -2
  45. package/build/widgets/oa-widget-track-shipment-list/TrackShipmentWidgetList.js +71 -30
  46. package/build/widgets/oa-widget-track-shipment-list/fn.js +8 -8
  47. package/package.json +6 -3
@@ -0,0 +1,257 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.symbol.description.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.promise.js");
11
+ var _react = _interopRequireWildcard(require("react"));
12
+ var _propTypes = _interopRequireDefault(require("prop-types"));
13
+ var _antd = require("antd");
14
+ var _icons = require("@ant-design/icons");
15
+ var _TouchAppRounded = _interopRequireDefault(require("@material-ui/icons/TouchAppRounded"));
16
+ var _reactZoomPanPinch = require("react-zoom-pan-pinch");
17
+ var _Fullscreen = _interopRequireDefault(require("@material-ui/icons/Fullscreen"));
18
+ var _ArrowForwardRounded = _interopRequireDefault(require("@material-ui/icons/ArrowForwardRounded"));
19
+ var _ArrowBackRounded = _interopRequireDefault(require("@material-ui/icons/ArrowBackRounded"));
20
+ var _CustomButton = _interopRequireDefault(require("../../components/oa-component-button/CustomButton"));
21
+ var _CustomModal = _interopRequireDefault(require("../../components/oa-component-modal/CustomModal"));
22
+ var _styles = require("./styles");
23
+ var _MaterialIcon = _interopRequireDefault(require("../../components/oa-component-icons/MaterialIcon"));
24
+ var _CustomLoader = _interopRequireDefault(require("../../components/oa-component-loader/CustomLoader"));
25
+ var _CustomDrawer = _interopRequireDefault(require("../../components/oa-component-drawer/CustomDrawer"));
26
+ var _Typography = _interopRequireDefault(require("../../components/oa-component-typography/Typography"));
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 ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
31
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
32
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
33
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
34
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
35
+ /**
36
+ * ImageCarouselWidget is a component that displays images in a carousel and allows zooming and switching between original and heatmap images.
37
+ * @param {object} props The props passed to the component
38
+ * @param {array} [props.images={}] An object with keys representing image types and values as arrays of images
39
+ * @param {boolean} [props.visible=false] Whether the modal is visible
40
+ * @param {function} [props.onClose] A function that is called when the modal is closed
41
+ * @returns {object} A React component
42
+ */
43
+ function ImageCarouselWidget(_ref) {
44
+ let {
45
+ images = [],
46
+ visible,
47
+ onClose,
48
+ headingSuffixText,
49
+ typeToNamemapping,
50
+ s3DownloadApiUrl,
51
+ initialImageType
52
+ } = _ref;
53
+ const [currentIndex, setCurrentIndex] = (0, _react.useState)(0);
54
+ const [showHeatmap, setShowHeatmap] = (0, _react.useState)(initialImageType === 'heatmap');
55
+ const [fullscreen, setFullscreen] = (0, _react.useState)(false);
56
+ const [imageUrls, setImageUrls] = (0, _react.useState)([]);
57
+ const [loading, setLoading] = (0, _react.useState)(false);
58
+ const carouselRef = _react.default.useRef(null);
59
+
60
+ // Fetch image URL by UUID
61
+ const fetchImageUrl = uuid => fetch("".concat(s3DownloadApiUrl).concat(uuid)).then(response => response.json()).then(data => {
62
+ var _data$data;
63
+ return data === null || data === void 0 || (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.downloadUrl;
64
+ }) // Assuming the API response has `src` key for the image URL
65
+ .catch(error => {
66
+ console.error('Error fetching image URL:', error);
67
+ return ''; // Return an empty string if there's an error
68
+ });
69
+
70
+ // Fetch image URLs for all grouped images
71
+ (0, _react.useEffect)(() => {
72
+ const fetchImages = async () => {
73
+ setLoading(true);
74
+ const urls = await Promise.all(images.map(async img => {
75
+ const imageSrcUrl = await fetchImageUrl(showHeatmap ? img.heatmapDocId : img.originalDocId); // Fetch URL for the image
76
+ return _objectSpread(_objectSpread({}, img), showHeatmap ? {
77
+ heatmapImageUrl: imageSrcUrl
78
+ } : {
79
+ originalImageUrl: imageSrcUrl
80
+ });
81
+ }));
82
+ console.log(urls);
83
+ setImageUrls(urls);
84
+ setLoading(false);
85
+ };
86
+ fetchImages();
87
+ }, [images === null || images === void 0 ? void 0 : images.length]);
88
+
89
+ // Enter fullscreen for the whole document
90
+ const enterFullscreen = () => {
91
+ if (document.documentElement.requestFullscreen) {
92
+ document.documentElement.requestFullscreen();
93
+ } else if (document.documentElement.mozRequestFullScreen) {
94
+ // Firefox
95
+ document.documentElement.mozRequestFullScreen();
96
+ } else if (document.documentElement.webkitRequestFullscreen) {
97
+ // Chrome, Safari, Opera
98
+ document.documentElement.webkitRequestFullscreen();
99
+ } else if (document.documentElement.msRequestFullscreen) {
100
+ // IE/Edge
101
+ document.documentElement.msRequestFullscreen();
102
+ }
103
+ setFullscreen(true);
104
+ };
105
+
106
+ // Exit fullscreen
107
+ const exitFullscreen = () => {
108
+ if (document.exitFullscreen) {
109
+ document.exitFullscreen();
110
+ } else if (document.mozCancelFullScreen) {
111
+ // Firefox
112
+ document.mozCancelFullScreen();
113
+ } else if (document.webkitExitFullscreen) {
114
+ // Chrome, Safari and Opera
115
+ document.webkitExitFullscreen();
116
+ } else if (document.msExitFullscreen) {
117
+ // IE/Edge
118
+ document.msExitFullscreen();
119
+ }
120
+ setFullscreen(false);
121
+ };
122
+ const handleFullscreenToggle = () => {
123
+ if (fullscreen) {
124
+ exitFullscreen();
125
+ } else {
126
+ enterFullscreen();
127
+ }
128
+ };
129
+ const handleImageChange = newIndex => {
130
+ setCurrentIndex(newIndex);
131
+ };
132
+ const handleShowHeatmap = async () => {
133
+ const currentViewType = !showHeatmap; // Toggle the current view mode (show heatmap or not)
134
+ setLoading(true);
135
+
136
+ // Fetching URLs for all images based on the new view mode
137
+ const updatedImages = await Promise.all(imageUrls.map(async img => {
138
+ var _img$heatmapImageUrl, _img$originalImageUrl;
139
+ // Check if the image is already fetched
140
+ const isImageAlreadyFetched = currentViewType && ((_img$heatmapImageUrl = img.heatmapImageUrl) === null || _img$heatmapImageUrl === void 0 ? void 0 : _img$heatmapImageUrl.length) > 0 || !currentViewType && ((_img$originalImageUrl = img.originalImageUrl) === null || _img$originalImageUrl === void 0 ? void 0 : _img$originalImageUrl.length) > 0;
141
+ // Fetch the image URL only if it's not already fetched
142
+ if (!isImageAlreadyFetched) {
143
+ const imageSrcUrl = await fetchImageUrl(currentViewType ? img.heatmapDocId : img.originalDocId);
144
+ // Return the updated image object with the appropriate URL
145
+ return _objectSpread(_objectSpread({}, img), currentViewType ? {
146
+ heatmapImageUrl: imageSrcUrl
147
+ } : {
148
+ originalImageUrl: imageSrcUrl
149
+ });
150
+ }
151
+ // If image is already fetched, return it as is
152
+ return img;
153
+ }));
154
+
155
+ // Update state with the new image URLs
156
+ setImageUrls(updatedImages);
157
+ setLoading(false);
158
+ setShowHeatmap(currentViewType); // Toggle the view mode
159
+ };
160
+ const currentImage = imageUrls[currentIndex];
161
+
162
+ // Conditionally hide the buttons when on the first or last image
163
+ const isFirstImage = currentIndex === 0;
164
+ const isLastImage = currentIndex === imageUrls.length - 1;
165
+ return /*#__PURE__*/_react.default.createElement(_styles.ImageCarouselModalStyle, null, /*#__PURE__*/_react.default.createElement(_styles.GlobalStyleForImageCarousel, null), /*#__PURE__*/_react.default.createElement(_CustomModal.default, {
166
+ open: visible,
167
+ onCancel: onClose,
168
+ footer: null,
169
+ className: fullscreen ? 'fullscreenModal imageCarouselModalStyle' : 'imageCarouselModalStyle'
170
+ }, /*#__PURE__*/_react.default.createElement(_CustomLoader.default, {
171
+ spinning: loading
172
+ }, !fullscreen && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
173
+ className: "type-t2-700",
174
+ color: "primary-content"
175
+ }, typeToNamemapping && typeToNamemapping[currentImage === null || currentImage === void 0 ? void 0 : currentImage.imageType] ? typeToNamemapping[currentImage === null || currentImage === void 0 ? void 0 : currentImage.imageType] : currentImage === null || currentImage === void 0 ? void 0 : currentImage.imageType, ' ', headingSuffixText), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
176
+ className: "type-b3-400",
177
+ color: "negative"
178
+ }, currentImage === null || currentImage === void 0 ? void 0 : currentImage.rejectReason)), /*#__PURE__*/_react.default.createElement("div", {
179
+ className: "margin-top-24 margin-bottom-12"
180
+ }, /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
181
+ onClick: handleShowHeatmap,
182
+ type: "text-only",
183
+ label: showHeatmap ? 'View Original Image' : 'View Heatmap Image'
184
+ })), /*#__PURE__*/_react.default.createElement(_styles.ImageCarouselModalStyle, null, /*#__PURE__*/_react.default.createElement(_antd.Carousel, {
185
+ ref: carouselRef,
186
+ afterChange: handleImageChange,
187
+ dots: true,
188
+ infinite: true
189
+ }, imageUrls.map(img => /*#__PURE__*/_react.default.createElement("div", {
190
+ className: "carouselItem",
191
+ key: img.imageType
192
+ }, /*#__PURE__*/_react.default.createElement("div", {
193
+ className: "imageCarouselIconZoom"
194
+ }, /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
195
+ icon: _Fullscreen.default,
196
+ onClick: handleFullscreenToggle
197
+ })), /*#__PURE__*/_react.default.createElement("img", {
198
+ src: showHeatmap ? img.heatmapImageUrl : img.originalImageUrl,
199
+ alt: img.imageType,
200
+ style: {
201
+ width: '100%',
202
+ objectFit: 'contain'
203
+ }
204
+ })))), window.innerWidth > 600 && /*#__PURE__*/_react.default.createElement(_styles.CarouselButtons, null, /*#__PURE__*/_react.default.createElement("div", {
205
+ className: "sliderArrowSection"
206
+ }, !isFirstImage && /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
207
+ color: "primary-content",
208
+ className: "leftArrow",
209
+ size: 24,
210
+ icon: _ArrowBackRounded.default,
211
+ onClick: () => carouselRef.current.prev()
212
+ }), !isLastImage && /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
213
+ color: "primary-content",
214
+ className: "rightArrow",
215
+ size: 24,
216
+ icon: _ArrowForwardRounded.default,
217
+ onClick: () => carouselRef.current.next()
218
+ }))))), fullscreen && /*#__PURE__*/_react.default.createElement(_styles.FullscreenZoom, null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
219
+ className: "type-t2-700",
220
+ color: "primary-background"
221
+ }, typeToNamemapping && typeToNamemapping[currentImage === null || currentImage === void 0 ? void 0 : currentImage.imageType] ? typeToNamemapping[currentImage === null || currentImage === void 0 ? void 0 : currentImage.imageType] : currentImage === null || currentImage === void 0 ? void 0 : currentImage.imageType, ' ', headingSuffixText), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
222
+ className: "type-b3-400",
223
+ color: "primary-background"
224
+ }, currentImage === null || currentImage === void 0 ? void 0 : currentImage.rejectReason)), /*#__PURE__*/_react.default.createElement(_styles.CloseButtonStyle, null, /*#__PURE__*/_react.default.createElement(_icons.CloseOutlined, {
225
+ onClick: handleFullscreenToggle
226
+ })), /*#__PURE__*/_react.default.createElement(_styles.ZoomImgBox, null, /*#__PURE__*/_react.default.createElement(_reactZoomPanPinch.TransformWrapper, null, /*#__PURE__*/_react.default.createElement(_reactZoomPanPinch.TransformComponent, null, /*#__PURE__*/_react.default.createElement("img", {
227
+ src: showHeatmap ? currentImage === null || currentImage === void 0 ? void 0 : currentImage.heatmapImageUrl : currentImage === null || currentImage === void 0 ? void 0 : currentImage.originalImageUrl,
228
+ alt: currentImage === null || currentImage === void 0 ? void 0 : currentImage.imageType
229
+ })))), /*#__PURE__*/_react.default.createElement("div", {
230
+ className: "pinchZoom"
231
+ }, /*#__PURE__*/_react.default.createElement("div", {
232
+ className: "margin-right-16"
233
+ }, /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
234
+ icon: _TouchAppRounded.default,
235
+ size: 20,
236
+ color: "primary-background"
237
+ })), /*#__PURE__*/_react.default.createElement(_Typography.default, {
238
+ className: "type-b2-400",
239
+ color: "primary-background"
240
+ }, "Pinch in/out to zoom"))))));
241
+ }
242
+ ImageCarouselWidget.propTypes = {
243
+ images: _propTypes.default.array.isRequired,
244
+ visible: _propTypes.default.bool.isRequired,
245
+ onClose: _propTypes.default.func.isRequired,
246
+ headingSuffixText: _propTypes.default.string,
247
+ typeToNamemapping: _propTypes.default.object,
248
+ s3DownloadApiUrl: _propTypes.default.string,
249
+ initialImageType: _propTypes.default.string
250
+ };
251
+ ImageCarouselWidget.defaultProps = {
252
+ headingSuffixText: 'Damage',
253
+ typeToNamemapping: {},
254
+ s3DownloadApiUrl: '',
255
+ initialImageType: 'heatmap'
256
+ };
257
+ var _default = exports.default = ImageCarouselWidget;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.weak-map.js");
4
+ require("core-js/modules/web.dom-collections.iterator.js");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = exports.ZoomImgBox = exports.PinchZoom = exports.ImageCarouselWidgetStyle = exports.ImageCarouselModalStyle = exports.GlobalStyleForImageCarousel = exports.FullscreenZoom = exports.CloseButtonStyle = exports.CarouselStyle = exports.CarouselButtons = void 0;
9
+ var _styledComponents = _interopRequireWildcard(require("styled-components"));
10
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
11
+ 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); }
12
+ 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; }
13
+ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
14
+ var _default = exports.default = {};
15
+ const ImageCarouselWidgetStyle = exports.ImageCarouselWidgetStyle = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\n\n\n"])));
16
+ const CarouselStyle = exports.CarouselStyle = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n\n"])));
17
+ const ZoomImgBox = exports.ZoomImgBox = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n\nheight: calc(100vh - 150px);\n display: flex;\n align-items: center;\n justify-content: center; margin-bottom: 12px;\n\n"])));
18
+ const PinchZoom = exports.PinchZoom = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: center;\n align-items: center;\n"])));
19
+ const CloseButtonStyle = exports.CloseButtonStyle = _styledComponents.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n background: #fff;\n border-radius: 50%;\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n top: -12px;\n right: 0;\n cursor: pointer\n"])));
20
+ const FullscreenZoom = exports.FullscreenZoom = _styledComponents.default.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n .pinchZoom{ \n display: flex;\n justify-content: center;\n align-items: center;\n\n .closeBtn{background: #fff;\n border-radius: 50%;\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n top: -12px;\n right: 0;\n cursor: pointer;\n}\n}\n"])));
21
+ const ImageCarouselModalStyle = exports.ImageCarouselModalStyle = _styledComponents.default.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n\n.ant-carousel{ background:#F6F6F6; max-width:550px; padding:24px 48px 56px 48px; border-radius:16px;}\n\n\n\n.ant-carousel .slick-dots li {\n width: 10px;\n height: 10px;\n border-radius: 50%;\n margin-inline: 4px;\n padding: 0;\n text-align: center;\n text-indent: -999px;\n vertical-align: top;\n}\n\n.ant-carousel .slick-dots li button {\n width: 10px;\n height: 10px;\n background: #959595;\n border: 0;\n opacity: 1;\n border-radius: 50%;\n}\n\n.ant-carousel .slick-dots li.slick-active button {background: #014FC5 !important;}\n.carouselItem{ display: flex !important;\n align-items: center;\n justify-content: center;}\n\n\n @media only screen and (max-width: 600px) {\n .imageCarouselIconZoom{display:flex !important;}\n .ant-carousel{ background: no-repeat;\n max-width: none;\n padding: 0;\n border-radius: 0;}\n\n}\n\n\n\n.imageCarouselIconZoom{background: #fff; display: none;\n border-radius: 4px;\n width: 24px;\n height: 24px;\n justify-content: center;\n align-items: center; right: 8px;\n position: absolute;\n top: 8px; z-index:9;\n}\n.imageCarouselIconZoom svg{font-size:20px !important; margin-top:3px;}\n.imageCarouselIconZoom button{ height: auto;\n line-height: normal;}\n.carouselItem {position: relative;}\n.carouselItem img{border-radius:8px;}\n\n.ant-carousel .slick-dots-bottom { bottom: -30px;}\n.carouselItem{height:100%};\n.slick-slide > div{height:100%;}\n.fullscreenModal .ant-modal-close{display:none;}\n.closeBtn{background: #fff;\n border-radius: 50%;\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n top: -12px;\n right: 0;\n cursor: pointer;}\n\n .zoomImgBox{display:block;}\n\n"])));
22
+ const GlobalStyleForImageCarousel = exports.GlobalStyleForImageCarousel = (0, _styledComponents.createGlobalStyle)(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n\n.imageCarouselModalStyle .ant-modal-body{max-height: none; height:100%;}\n.fullscreenModal .ant-modal-content{background:#000;}\n.fullscreenModal .ant-modal-close{display:none;}\n.ant-modal{ width:auto !important;}\n\n\n@media only screen and (max-width: 600px) {\n .imageCarouselModalStyle .ant-modal-content {top: 0; border-radius: 0px;}\n .slick-slide{height:calc(100vh - 210px) !important; background:#000; border-radius:8px;}\n\n}\n"])));
23
+ const CarouselButtons = exports.CarouselButtons = _styledComponents.default.div(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n\n.sliderArrowSection{position: absolute;\n top: 57%;\n width: 100%;}\n\n .leftArrow {\n position: absolute;\n left: 6px;\n top: 0;\n}\n .rightArrow{position: absolute;\n right: 6px;\n top: 0;}\n\n\n"])));
@@ -33,7 +33,8 @@ function AddressDetails(_ref) {
33
33
  geolocationData,
34
34
  pinCodeServisible,
35
35
  editLocationHandler,
36
- onFinish
36
+ onFinish,
37
+ showAddressType
37
38
  } = _ref;
38
39
  return /*#__PURE__*/_react.default.createElement("div", {
39
40
  className: "addresBoxDiv"
@@ -49,12 +50,12 @@ function AddressDetails(_ref) {
49
50
  }, /*#__PURE__*/_react.default.createElement(_Typography.default, {
50
51
  className: "type-b3-400",
51
52
  color: "secondary-content"
52
- }, (_geolocationData$addr2 = geolocationData.addressLine2) === null || _geolocationData$addr2 === void 0 ? void 0 : _geolocationData$addr2.secondaryAddress, (_geolocationData$addr3 = geolocationData.addressLine2) !== null && _geolocationData$addr3 !== void 0 && (_geolocationData$addr3 = _geolocationData$addr3.mainAddress) !== null && _geolocationData$addr3 !== void 0 && _geolocationData$addr3.includes(geolocationData.pincode) || (_geolocationData$addr4 = geolocationData.addressLine2) !== null && _geolocationData$addr4 !== void 0 && (_geolocationData$addr4 = _geolocationData$addr4.secondaryAddress) !== null && _geolocationData$addr4 !== void 0 && _geolocationData$addr4.includes(geolocationData.pincode) ? '' : ", ".concat(geolocationData.pincode)))), pinCodeServisible && /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
53
+ }, (_geolocationData$addr2 = geolocationData.addressLine2) === null || _geolocationData$addr2 === void 0 ? void 0 : _geolocationData$addr2.secondaryAddress, (_geolocationData$addr3 = geolocationData.addressLine2) !== null && _geolocationData$addr3 !== void 0 && (_geolocationData$addr3 = _geolocationData$addr3.mainAddress) !== null && _geolocationData$addr3 !== void 0 && _geolocationData$addr3.includes(geolocationData.pincode) || (_geolocationData$addr4 = geolocationData.addressLine2) !== null && _geolocationData$addr4 !== void 0 && (_geolocationData$addr4 = _geolocationData$addr4.secondaryAddress) !== null && _geolocationData$addr4 !== void 0 && _geolocationData$addr4.includes(geolocationData.pincode) ? "" : ", ".concat(geolocationData.pincode)))), pinCodeServisible && /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
53
54
  iconConfig: {
54
55
  icon: /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
55
56
  icon: _EditOutlined.default
56
57
  }),
57
- position: 'left'
58
+ position: "left"
58
59
  },
59
60
  size: "small",
60
61
  label: "Edit location",
@@ -62,7 +63,8 @@ function AddressDetails(_ref) {
62
63
  onClick: editLocationHandler
63
64
  })), pinCodeServisible ? /*#__PURE__*/_react.default.createElement(_AddressForm.default, {
64
65
  geolocationData: geolocationData,
65
- onFinish: onFinish
66
+ onFinish: onFinish,
67
+ showAddressType: showAddressType
66
68
  }) : /*#__PURE__*/_react.default.createElement(_Typography.default, {
67
69
  color: "negative"
68
70
  }, "Pincode according to your pin on map is Non-serviceable, please move the pin to serviceable pincode."));
@@ -10,6 +10,7 @@ var _antd = require("antd");
10
10
  var _CustomInput = _interopRequireDefault(require("../../components/oa-component-input/CustomInput"));
11
11
  var _Typography = _interopRequireDefault(require("../../components/oa-component-typography/Typography"));
12
12
  var _CustomButton = _interopRequireDefault(require("../../components/oa-component-button/CustomButton"));
13
+ var _CustomRadio = _interopRequireDefault(require("../../components/oa-component-radio/CustomRadio"));
13
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
15
  /* eslint-disable */
15
16
 
@@ -28,7 +29,8 @@ function AddressForm(props) {
28
29
  const [form] = _antd.Form.useForm();
29
30
  const {
30
31
  geolocationData,
31
- onFinish
32
+ onFinish,
33
+ showAddressType
32
34
  } = props;
33
35
  return /*#__PURE__*/_react.default.createElement(_antd.Form, {
34
36
  form: form,
@@ -51,7 +53,7 @@ function AddressForm(props) {
51
53
  name: "houseNo",
52
54
  rules: [{
53
55
  required: true,
54
- message: 'Please input your House no. / Flat / Floor!'
56
+ message: "Please input your House no. / Flat / Floor!"
55
57
  }]
56
58
  }, /*#__PURE__*/_react.default.createElement(_CustomInput.default, {
57
59
  placeholder: "Type here",
@@ -67,7 +69,28 @@ function AddressForm(props) {
67
69
  name: "landmark"
68
70
  }, /*#__PURE__*/_react.default.createElement(_CustomInput.default, {
69
71
  placeholder: "Type here"
70
- })))), /*#__PURE__*/_react.default.createElement("div", {
72
+ })))), showAddressType && /*#__PURE__*/_react.default.createElement("div", {
73
+ className: "margin-top-12"
74
+ }, /*#__PURE__*/_react.default.createElement(_Typography.default, {
75
+ color: "primary-content",
76
+ className: "type-b2-400"
77
+ }, "Address Type", /*#__PURE__*/_react.default.createElement(_Typography.default, {
78
+ color: "negative"
79
+ }, "*")), /*#__PURE__*/_react.default.createElement("div", {
80
+ className: "margin-top-4"
81
+ }, /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
82
+ name: "addressType",
83
+ rules: [{
84
+ required: true,
85
+ message: "Please select Address Type"
86
+ }]
87
+ }, /*#__PURE__*/_react.default.createElement(_CustomRadio.default.Group, null, /*#__PURE__*/_react.default.createElement(_CustomRadio.default, {
88
+ value: "RESIDENTIAL",
89
+ label: "Residential"
90
+ }), /*#__PURE__*/_react.default.createElement(_CustomRadio.default, {
91
+ value: "COMMERCIAL",
92
+ label: "Commercial"
93
+ }))))), /*#__PURE__*/_react.default.createElement("div", {
71
94
  className: "buttonBottom margin-top-24"
72
95
  }, /*#__PURE__*/_react.default.createElement(_antd.Form.Item, null, /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
73
96
  type: "primary",
@@ -44,7 +44,8 @@ function MapBaseLocation(_ref) {
44
44
  form,
45
45
  onFinish,
46
46
  openLocationNotDetectedModal,
47
- setOpenLocationNotDetectedModalState
47
+ setOpenLocationNotDetectedModalState,
48
+ showAddressType
48
49
  } = _ref;
49
50
  return /*#__PURE__*/_react.default.createElement(_styles.MapStyles, null, /*#__PURE__*/_react.default.createElement("div", {
50
51
  className: "containerMap"
@@ -58,7 +59,7 @@ function MapBaseLocation(_ref) {
58
59
  googleMapURL: googleMapURL,
59
60
  loadingElement: /*#__PURE__*/_react.default.createElement("div", {
60
61
  style: {
61
- height: '100%'
62
+ height: "100%"
62
63
  }
63
64
  }),
64
65
  containerElement: /*#__PURE__*/_react.default.createElement("div", {
@@ -66,7 +67,7 @@ function MapBaseLocation(_ref) {
66
67
  }),
67
68
  mapElement: /*#__PURE__*/_react.default.createElement("div", {
68
69
  style: {
69
- height: '100%'
70
+ height: "100%"
70
71
  }
71
72
  }),
72
73
  googleMapRef: googleMapRef,
@@ -74,6 +75,7 @@ function MapBaseLocation(_ref) {
74
75
  fetchAddressFromGoogleApi: fetchAddressFromGoogleApi,
75
76
  setOpenLocationNotDetectedModal: setOpenLocationNotDetectedModal
76
77
  }), /*#__PURE__*/_react.default.createElement(_AddressDetails.default, {
78
+ showAddressType: showAddressType,
77
79
  geolocationData: geolocationData,
78
80
  pinCodeServisible: pinCodeServisible,
79
81
  editLocationHandler: editLocationHandler,
@@ -118,12 +118,7 @@ function MembershipCard(_ref) {
118
118
  }, /*#__PURE__*/_react.default.createElement("label", null, ' ', /*#__PURE__*/_react.default.createElement(_Typography.default, {
119
119
  color: primaryInfo.type === 'success' ? 'positive' : 'negative',
120
120
  className: "type-t2-700"
121
- }, primaryInfo.label))), tag && /*#__PURE__*/_react.default.createElement("div", {
122
- className: "topPad24"
123
- }, /*#__PURE__*/_react.default.createElement(_CustomTag.default, {
124
- label: tag.text,
125
- type: tag.type
126
- }))), /*#__PURE__*/_react.default.createElement("div", {
121
+ }, primaryInfo.label)))), /*#__PURE__*/_react.default.createElement("div", {
127
122
  className: "imgBg"
128
123
  }, /*#__PURE__*/_react.default.createElement(_CustomIcon.default, {
129
124
  alt: "phone img",
@@ -134,7 +129,10 @@ function MembershipCard(_ref) {
134
129
  }, itemsToShow.join(', '), remainingItems.length > 0 && /*#__PURE__*/_react.default.createElement("span", {
135
130
  role: "button",
136
131
  tabIndex: 0
137
- }, "...+".concat(remainingItems.length, " more")))), primaryPanel && /*#__PURE__*/_react.default.createElement("div", {
132
+ }, "...+".concat(remainingItems.length, " more")))), tag && /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_CustomTag.default, {
133
+ label: tag.text,
134
+ type: tag.type
135
+ })), primaryPanel && /*#__PURE__*/_react.default.createElement("div", {
138
136
  onClick: primaryPanel.name,
139
137
  onKeyDown: e => {
140
138
  if (e.key === 'Enter') primaryPanel.name();
@@ -76,7 +76,8 @@ function NotesWidget(_ref) {
76
76
  value: noteInputValue,
77
77
  onChange: event => setNoteInputValue(event.target.value),
78
78
  onBlur: handleBlur,
79
- placeholder: "Type here .."
79
+ placeholder: "Type here ..",
80
+ maxLength: 500
80
81
  });
81
82
  }
82
83
  return /*#__PURE__*/_react.default.createElement("div", {
@@ -0,0 +1,164 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.object.assign.js");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ require("core-js/modules/es.array.includes.js");
9
+ require("core-js/modules/es.string.includes.js");
10
+ require("core-js/modules/es.promise.js");
11
+ var _react = _interopRequireDefault(require("react"));
12
+ var _Info = _interopRequireDefault(require("@material-ui/icons/Info"));
13
+ var _propTypes = _interopRequireDefault(require("prop-types"));
14
+ var _antd = require("antd");
15
+ var _InfoOutlined = _interopRequireDefault(require("@material-ui/icons/InfoOutlined"));
16
+ var _CustomDrawer = _interopRequireDefault(require("../../components/oa-component-drawer/CustomDrawer"));
17
+ var _MaterialIcon = _interopRequireDefault(require("../../components/oa-component-icons/MaterialIcon"));
18
+ var _CustomInfo = _interopRequireDefault(require("../../components/oa-component-info/CustomInfo"));
19
+ var _Typography = _interopRequireDefault(require("../../components/oa-component-typography/Typography"));
20
+ var _CustomUpload = _interopRequireDefault(require("../../dev/oa-component-upload/CustomUpload"));
21
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22
+ 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); }
23
+ function GenericUpload(_ref) {
24
+ var _config$documents;
25
+ let {
26
+ config,
27
+ uploadHandler,
28
+ deleteHandler: _deleteHandler,
29
+ downloadHandler,
30
+ previewHandler,
31
+ visible,
32
+ onClose,
33
+ validationConfig = {
34
+ maxSize: 5,
35
+ allowedTypes: ['image/jpeg', 'image/png', 'image/jpg', 'application/pdf'],
36
+ customValidation: null
37
+ },
38
+ uploadedDocuments,
39
+ showDelete = true,
40
+ showPreview = false,
41
+ form
42
+ } = _ref;
43
+ const validateFile = (file, docTypeId) => {
44
+ const isValidType = validationConfig.allowedTypes.includes(file.type);
45
+ if (!isValidType) {
46
+ form.setFields([{
47
+ name: docTypeId,
48
+ errors: ["Only ".concat(validationConfig.allowedTypes.map(type => type.split('/')[1].toUpperCase()).join('/'), " files are allowed!")]
49
+ }]);
50
+ return false;
51
+ }
52
+ const isValidSize = file.size / 1024 / 1024 < validationConfig.maxSize;
53
+ if (!isValidSize) {
54
+ form.setFields([{
55
+ name: docTypeId,
56
+ errors: ["File must be smaller than ".concat(validationConfig.maxSize, "MB!")]
57
+ }]);
58
+ return false;
59
+ }
60
+ if (validationConfig.customValidation) {
61
+ return validationConfig.customValidation(file, docTypeId);
62
+ }
63
+ return true;
64
+ };
65
+ const handleUpload = async (file, docTypeId, documentId) => {
66
+ if (!validateFile(file, docTypeId)) {
67
+ return null;
68
+ }
69
+ return uploadHandler(file, docTypeId, documentId);
70
+ };
71
+ return /*#__PURE__*/_react.default.createElement(_CustomDrawer.default, {
72
+ title: config.title,
73
+ width: config.width,
74
+ open: visible,
75
+ onClose: onClose,
76
+ buttonConfig: config.buttonConfig
77
+ }, config.systemInfo && /*#__PURE__*/_react.default.createElement("div", {
78
+ className: "margin-bottom-32"
79
+ }, /*#__PURE__*/_react.default.createElement(_CustomInfo.default, _extends({}, config.systemInfo, {
80
+ iconConfig: {
81
+ icon: /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
82
+ icon: _InfoOutlined.default,
83
+ size: 24,
84
+ color: "negative"
85
+ }),
86
+ position: 'left'
87
+ }
88
+ }))), (config === null || config === void 0 ? void 0 : config.heading) && /*#__PURE__*/_react.default.createElement("div", {
89
+ className: "padding-bottom-32"
90
+ }, /*#__PURE__*/_react.default.createElement(_Typography.default, {
91
+ className: "type-t1-500",
92
+ color: "primary-content"
93
+ }, config.heading, ' ')), /*#__PURE__*/_react.default.createElement(_antd.Form, {
94
+ form: form
95
+ }, (_config$documents = config.documents) === null || _config$documents === void 0 ? void 0 : _config$documents.map(item => /*#__PURE__*/_react.default.createElement("div", {
96
+ key: item.docTypeId
97
+ }, /*#__PURE__*/_react.default.createElement("div", {
98
+ className: "padding-bottom-4"
99
+ }, /*#__PURE__*/_react.default.createElement(_Typography.default, {
100
+ typography: "type-b2-500",
101
+ color: "primary-content"
102
+ }, item === null || item === void 0 ? void 0 : item.docName)), /*#__PURE__*/_react.default.createElement(_CustomUpload.default, {
103
+ isMandatory: true,
104
+ handleCustomOnChange: (file, status) => handleUpload(file, item.docTypeId, item.documentId),
105
+ formName: item.docTypeId,
106
+ uploadedDocuments: uploadedDocuments && uploadedDocuments[item.docTypeId] ? [uploadedDocuments[item.docTypeId]] : [],
107
+ deleteHandler: selectedFile => _deleteHandler(item.docTypeId),
108
+ downloadCallback: file => downloadHandler(item.docTypeId),
109
+ getPreview: previewHandler || (() => {}),
110
+ showDelete: showDelete,
111
+ showPreview: showPreview,
112
+ accept: validationConfig.allowedTypes.join(', '),
113
+ docName: item.docName
114
+ })))));
115
+ }
116
+ GenericUpload.propTypes = {
117
+ config: _propTypes.default.shape({
118
+ title: _propTypes.default.string.isRequired,
119
+ width: _propTypes.default.number,
120
+ buttonConfig: _propTypes.default.arrayOf(_propTypes.default.shape({
121
+ callback: _propTypes.default.func,
122
+ label: _propTypes.default.string,
123
+ type: _propTypes.default.string
124
+ })),
125
+ systemInfo: _propTypes.default.shape({
126
+ title: _propTypes.default.string,
127
+ color: _propTypes.default.string,
128
+ description: _propTypes.default.node
129
+ }),
130
+ heading: _propTypes.default.string,
131
+ documents: _propTypes.default.arrayOf(_propTypes.default.shape({
132
+ title: _propTypes.default.string,
133
+ docTypeId: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
134
+ docName: _propTypes.default.string
135
+ }))
136
+ }).isRequired,
137
+ uploadHandler: _propTypes.default.func.isRequired,
138
+ deleteHandler: _propTypes.default.func.isRequired,
139
+ downloadHandler: _propTypes.default.func.isRequired,
140
+ previewHandler: _propTypes.default.func,
141
+ validationConfig: _propTypes.default.shape({
142
+ maxSize: _propTypes.default.number,
143
+ allowedTypes: _propTypes.default.arrayOf(_propTypes.default.string),
144
+ customValidation: _propTypes.default.func
145
+ }),
146
+ uploadedDocuments: _propTypes.default.object,
147
+ showDelete: _propTypes.default.bool,
148
+ showPreview: _propTypes.default.bool,
149
+ form: _propTypes.default.object.isRequired,
150
+ visible: _propTypes.default.bool.isRequired,
151
+ onClose: _propTypes.default.func.isRequired
152
+ };
153
+ GenericUpload.defaultProps = {
154
+ previewHandler: () => {},
155
+ validationConfig: {
156
+ maxSize: 5,
157
+ allowedTypes: ['image/jpeg', 'image/png', 'image/jpg', 'application/pdf'],
158
+ customValidation: null
159
+ },
160
+ uploadedDocuments: {},
161
+ showDelete: true,
162
+ showPreview: false
163
+ };
164
+ var _default = exports.default = GenericUpload;
@@ -121,7 +121,9 @@ function TrackShipmentWidget(_ref) {
121
121
  }, /*#__PURE__*/_react.default.createElement(_CustomTimeline.default, {
122
122
  currentStep: isOnDeliveryStage ? stepsData.length : stepsData.length - 1,
123
123
  stepsData: stepsData
124
- })), errorReason && /*#__PURE__*/_react.default.createElement(_CustomInfo.default, {
124
+ })), errorReason && /*#__PURE__*/_react.default.createElement("div", {
125
+ className: "margin-top-16 margin-bottom-16"
126
+ }, /*#__PURE__*/_react.default.createElement(_CustomInfo.default, {
125
127
  iconConfig: {
126
128
  icon: /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
127
129
  color: "warning",
@@ -131,7 +133,7 @@ function TrackShipmentWidget(_ref) {
131
133
  position: 'left'
132
134
  },
133
135
  description: errorReason
134
- }), (tableData === null || tableData === void 0 ? void 0 : tableData.length) > 0 && /*#__PURE__*/_react.default.createElement(_CustomTable.default, {
136
+ })), (tableData === null || tableData === void 0 ? void 0 : tableData.length) > 0 && /*#__PURE__*/_react.default.createElement(_CustomTable.default, {
135
137
  bordered: true,
136
138
  rowKey: "key",
137
139
  columns: [{