oa-componentbook 1.0.1-stage.43 → 1.0.1-stage.431
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 +131 -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-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 +59 -48
- 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 +130 -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 +612 -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/CustomTextArea.js +161 -0
- package/build/components/oa-component-textarea/constants.js +39 -0
- package/build/components/oa-component-textarea/styles.js +12 -3
- package/build/components/oa-component-tooltip/CustomTooltip.js +8 -4
- package/build/components/oa-component-upload/CustomUpload.js +129 -42
- package/build/components/oa-component-viewer/CustomViewer.js +17 -11
- 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 +135 -47
- package/build/dev/oa-component-upload/styles.js +2 -2
- 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/outOfStock.png +0 -0
- package/build/index.js +110 -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 +262 -0
- package/build/layout/EntityOverviewLayout/reducer/entityOverviewLayoutReducer.js +68 -0
- package/build/layout/EntityOverviewLayout/styles.js +13 -0
- package/build/layout/GenricLayOut/GenricLayOut.js +2401 -0
- package/build/layout/GenricLayOut/components/AppliedFilters.js +90 -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 +96 -0
- package/build/layout/GenricLayOut/components/ProfileSection.js +219 -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 +306 -0
- package/build/layout/GenricLayOut/resolver/staticConfigResolver.js +98 -0
- package/build/layout/GenricLayOut/styles.js +42 -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-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 +99 -57
- package/build/widgets/oa-widget-image-carousel/styles.js +16 -5
- 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 +83 -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 +165 -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 +91 -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 +63 -35
- 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 +354 -0
- package/build/widgets/oa-widget-user-management/styles.js +15 -0
- package/package.json +3 -1
- package/build/components/oa-component-textarea/TextArea.js +0 -74
- 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,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
require("core-js/modules/es.json.stringify.js");
|
|
8
|
+
require("core-js/modules/es.regexp.exec.js");
|
|
9
|
+
require("core-js/modules/es.string.replace.js");
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
|
+
var _Typography = _interopRequireDefault(require("../../components/oa-component-typography/Typography"));
|
|
13
|
+
var _MaterialIcon = _interopRequireDefault(require("../../components/oa-component-icons/MaterialIcon"));
|
|
14
|
+
var _ChevronRight = _interopRequireDefault(require("@material-ui/icons/ChevronRight"));
|
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
+
/* eslint-disable */
|
|
17
|
+
|
|
18
|
+
const SelectListItemModal = _ref => {
|
|
19
|
+
var _modalContent$header, _modalContent$header2, _modalContent$subHead, _modalContent$subHead2, _modalContent$listIte;
|
|
20
|
+
let {
|
|
21
|
+
modalContent,
|
|
22
|
+
onItemSelect,
|
|
23
|
+
handleSwitchSelectItem
|
|
24
|
+
} = _ref;
|
|
25
|
+
const avatarColors = (modalContent === null || modalContent === void 0 ? void 0 : modalContent.avatarColors) || [];
|
|
26
|
+
const handleItemSelect = item => {
|
|
27
|
+
// Store selected item data in session storage as selectedEnterprise
|
|
28
|
+
sessionStorage.setItem("selectedEnterprise", JSON.stringify(item));
|
|
29
|
+
|
|
30
|
+
// Call the onItemSelect callback if provided
|
|
31
|
+
if (onItemSelect) {
|
|
32
|
+
onItemSelect(item);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Reroute to modalContent.reroute if provided
|
|
36
|
+
if (modalContent !== null && modalContent !== void 0 && modalContent.reroute) {
|
|
37
|
+
window.location.replace(modalContent.reroute);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
const getAvatarStyle = index => {
|
|
41
|
+
if (avatarColors.length === 0) {
|
|
42
|
+
// Default colors if no colors provided
|
|
43
|
+
return {
|
|
44
|
+
backgroundColor: "#f0f0f0",
|
|
45
|
+
color: "#333"
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Use modulo to cycle through colors
|
|
50
|
+
const colorIndex = index % avatarColors.length;
|
|
51
|
+
return avatarColors[colorIndex];
|
|
52
|
+
};
|
|
53
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (modalContent === null || modalContent === void 0 ? void 0 : modalContent.header) && /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
54
|
+
typography: modalContent === null || modalContent === void 0 || (_modalContent$header = modalContent.header) === null || _modalContent$header === void 0 ? void 0 : _modalContent$header.type,
|
|
55
|
+
color: "primary-content"
|
|
56
|
+
}, modalContent === null || modalContent === void 0 || (_modalContent$header2 = modalContent.header) === null || _modalContent$header2 === void 0 ? void 0 : _modalContent$header2.text), (modalContent === null || modalContent === void 0 ? void 0 : modalContent.subHeading) && /*#__PURE__*/_react.default.createElement("div", {
|
|
57
|
+
className: "margin-top-12"
|
|
58
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
59
|
+
typography: modalContent === null || modalContent === void 0 || (_modalContent$subHead = modalContent.subHeading) === null || _modalContent$subHead === void 0 ? void 0 : _modalContent$subHead.type,
|
|
60
|
+
color: "secondary-content"
|
|
61
|
+
}, modalContent === null || modalContent === void 0 || (_modalContent$subHead2 = modalContent.subHeading) === null || _modalContent$subHead2 === void 0 ? void 0 : _modalContent$subHead2.text)), /*#__PURE__*/_react.default.createElement("div", {
|
|
62
|
+
className: "select-list-container"
|
|
63
|
+
}, Array.isArray(modalContent === null || modalContent === void 0 ? void 0 : modalContent.listItem) && (modalContent === null || modalContent === void 0 || (_modalContent$listIte = modalContent.listItem) === null || _modalContent$listIte === void 0 ? void 0 : _modalContent$listIte.map((item, index) => {
|
|
64
|
+
var _item$label;
|
|
65
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
66
|
+
key: index,
|
|
67
|
+
className: "select-list-item",
|
|
68
|
+
onClick: () => handleItemSelect(item)
|
|
69
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
70
|
+
className: "item-avatar",
|
|
71
|
+
style: getAvatarStyle(index)
|
|
72
|
+
}, (_item$label = item.label) === null || _item$label === void 0 || (_item$label = _item$label.charAt(0)) === null || _item$label === void 0 ? void 0 : _item$label.toUpperCase()), /*#__PURE__*/_react.default.createElement("div", {
|
|
73
|
+
className: "item-content"
|
|
74
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
75
|
+
typography: "type-t2-700",
|
|
76
|
+
color: "primary-content"
|
|
77
|
+
}, item.label)), /*#__PURE__*/_react.default.createElement("div", {
|
|
78
|
+
className: "item-arrow"
|
|
79
|
+
}, /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
80
|
+
icon: _ChevronRight.default,
|
|
81
|
+
size: 20,
|
|
82
|
+
color: "primary"
|
|
83
|
+
})));
|
|
84
|
+
}))));
|
|
85
|
+
};
|
|
86
|
+
SelectListItemModal.propTypes = {
|
|
87
|
+
modalContent: _propTypes.default.object,
|
|
88
|
+
onItemSelect: _propTypes.default.func,
|
|
89
|
+
avatarColors: _propTypes.default.array
|
|
90
|
+
};
|
|
91
|
+
var _default = exports.default = SelectListItemModal;
|
|
@@ -0,0 +1,175 @@
|
|
|
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.regexp.exec.js");
|
|
10
|
+
require("core-js/modules/es.string.replace.js");
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _antd = require("antd");
|
|
13
|
+
var _reactRouterDom = require("react-router-dom");
|
|
14
|
+
var _Menu = _interopRequireDefault(require("@material-ui/icons/Menu"));
|
|
15
|
+
var _Header = _interopRequireDefault(require("./components/Header"));
|
|
16
|
+
var _MaterialIcon = _interopRequireDefault(require("../../components/oa-component-icons/MaterialIcon"));
|
|
17
|
+
var _Typography = _interopRequireDefault(require("../../components/oa-component-typography/Typography"));
|
|
18
|
+
var _styles = _interopRequireWildcard(require("./styles"));
|
|
19
|
+
var _CustomDropdown = _interopRequireDefault(require("../../components/oa-component-dropdown/CustomDropdown"));
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
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); }
|
|
22
|
+
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; }
|
|
23
|
+
/* eslint-disable */
|
|
24
|
+
|
|
25
|
+
const {
|
|
26
|
+
Sider
|
|
27
|
+
} = _antd.Layout;
|
|
28
|
+
const {
|
|
29
|
+
SubMenu
|
|
30
|
+
} = _antd.Menu;
|
|
31
|
+
function SidebarWidget(_ref) {
|
|
32
|
+
var _mobileMenuItems$item, _footer$item, _menuItems$items, _footer$item2, _footer$item3, _footer$icons$;
|
|
33
|
+
let {
|
|
34
|
+
heading,
|
|
35
|
+
menuItems = [],
|
|
36
|
+
mobileMenuItems = [],
|
|
37
|
+
footer,
|
|
38
|
+
location,
|
|
39
|
+
history,
|
|
40
|
+
handleFooterClick,
|
|
41
|
+
profileData
|
|
42
|
+
} = _ref;
|
|
43
|
+
const [openKeys, setOpenKeys] = (0, _react.useState)([]);
|
|
44
|
+
|
|
45
|
+
// Determine which menu items to use and whether to show profile icon
|
|
46
|
+
const shouldShowProfileIcon = (mobileMenuItems === null || mobileMenuItems === void 0 || (_mobileMenuItems$item = mobileMenuItems.items) === null || _mobileMenuItems$item === void 0 ? void 0 : _mobileMenuItems$item.length) > 0;
|
|
47
|
+
const activeMenuItems = shouldShowProfileIcon ? mobileMenuItems : menuItems;
|
|
48
|
+
|
|
49
|
+
// Find which submenu contains the current path and set it as open by default
|
|
50
|
+
(0, _react.useEffect)(() => {
|
|
51
|
+
const currentPath = location.pathname;
|
|
52
|
+
const items = (menuItems === null || menuItems === void 0 ? void 0 : menuItems.items) || [];
|
|
53
|
+
|
|
54
|
+
// Find if current path is in any submenu
|
|
55
|
+
for (const item of items) {
|
|
56
|
+
if (item !== null && item !== void 0 && item.children && (item === null || item === void 0 ? void 0 : item.children.length) > 0) {
|
|
57
|
+
var _item$children;
|
|
58
|
+
const hasCurrentPath = item === null || item === void 0 || (_item$children = item.children) === null || _item$children === void 0 ? void 0 : _item$children.some(child => (child === null || child === void 0 ? void 0 : child.path) === currentPath);
|
|
59
|
+
if (hasCurrentPath) {
|
|
60
|
+
setOpenKeys([item === null || item === void 0 ? void 0 : item.key]);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// If no match found, open the first submenu by default
|
|
67
|
+
const firstSubmenu = items === null || items === void 0 ? void 0 : items.find(item => {
|
|
68
|
+
var _item$children2;
|
|
69
|
+
return (item === null || item === void 0 ? void 0 : item.children) && (item === null || item === void 0 || (_item$children2 = item.children) === null || _item$children2 === void 0 ? void 0 : _item$children2.length) > 0;
|
|
70
|
+
});
|
|
71
|
+
if (firstSubmenu) {
|
|
72
|
+
setOpenKeys([firstSubmenu === null || firstSubmenu === void 0 ? void 0 : firstSubmenu.key]);
|
|
73
|
+
}
|
|
74
|
+
}, [location.pathname, menuItems]);
|
|
75
|
+
|
|
76
|
+
// Simple menu click handler
|
|
77
|
+
const handleMenuClick = _ref2 => {
|
|
78
|
+
let {
|
|
79
|
+
key
|
|
80
|
+
} = _ref2;
|
|
81
|
+
history.replace(key);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
// Handle submenu open/close
|
|
85
|
+
const handleOpenChange = keys => {
|
|
86
|
+
setOpenKeys(keys);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
// Simple render function for menu items
|
|
90
|
+
const renderMenuItem = item => {
|
|
91
|
+
var _item$children3;
|
|
92
|
+
if (item !== null && item !== void 0 && item.children && (item === null || item === void 0 || (_item$children3 = item.children) === null || _item$children3 === void 0 ? void 0 : _item$children3.length) > 0) {
|
|
93
|
+
var _item$children4;
|
|
94
|
+
return /*#__PURE__*/_react.default.createElement(SubMenu, {
|
|
95
|
+
key: item.key,
|
|
96
|
+
title: /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, item === null || item === void 0 ? void 0 : item.iconConfig), item === null || item === void 0 ? void 0 : item.label)
|
|
97
|
+
}, item === null || item === void 0 || (_item$children4 = item.children) === null || _item$children4 === void 0 ? void 0 : _item$children4.map(child => /*#__PURE__*/_react.default.createElement(_antd.Menu.Item, {
|
|
98
|
+
key: child === null || child === void 0 ? void 0 : child.path
|
|
99
|
+
}, child === null || child === void 0 ? void 0 : child.label)));
|
|
100
|
+
} else {
|
|
101
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Menu.Item, {
|
|
102
|
+
key: item.path
|
|
103
|
+
}, /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, item === null || item === void 0 ? void 0 : item.iconConfig), item === null || item === void 0 ? void 0 : item.label);
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
return /*#__PURE__*/_react.default.createElement(_styles.default, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
107
|
+
className: "oaLeftLayouts"
|
|
108
|
+
}, /*#__PURE__*/_react.default.createElement(Sider, {
|
|
109
|
+
width: 250,
|
|
110
|
+
theme: "light",
|
|
111
|
+
className: "sidebar"
|
|
112
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
113
|
+
className: "logoContainer"
|
|
114
|
+
}, (heading === null || heading === void 0 ? void 0 : heading.visible) && /*#__PURE__*/_react.default.createElement(_Header.default, heading), /*#__PURE__*/_react.default.createElement("div", {
|
|
115
|
+
className: "notShowInDesktop"
|
|
116
|
+
}, (activeMenuItems === null || activeMenuItems === void 0 ? void 0 : activeMenuItems.visible) && /*#__PURE__*/_react.default.createElement(_CustomDropdown.default, {
|
|
117
|
+
items: [...((activeMenuItems === null || activeMenuItems === void 0 ? void 0 : activeMenuItems.items) || []), ...(footer !== null && footer !== void 0 && footer.visible ? [{
|
|
118
|
+
label: footer === null || footer === void 0 || (_footer$item = footer.item) === null || _footer$item === void 0 ? void 0 : _footer$item.label,
|
|
119
|
+
key: "footerAction",
|
|
120
|
+
onClick: handleFooterClick,
|
|
121
|
+
danger: true
|
|
122
|
+
}] : [])],
|
|
123
|
+
trigger: ["click"],
|
|
124
|
+
type: "primary",
|
|
125
|
+
onMenuItemClick: key => {
|
|
126
|
+
if ((key === null || key === void 0 ? void 0 : key.key) === "footerAction") {
|
|
127
|
+
handleFooterClick();
|
|
128
|
+
} else {
|
|
129
|
+
history.replace(key === null || key === void 0 ? void 0 : key.path);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}, shouldShowProfileIcon && profileData !== null && profileData !== void 0 && profileData.visible ? /*#__PURE__*/_react.default.createElement(_styles.ProfileIcon, {
|
|
133
|
+
style: {
|
|
134
|
+
backgroundColor: "var(--color-".concat((profileData === null || profileData === void 0 ? void 0 : profileData.iconBgColor) || "primary", ")"),
|
|
135
|
+
color: "var(--color-".concat((profileData === null || profileData === void 0 ? void 0 : profileData.iconColor) || "primary-content", ")")
|
|
136
|
+
}
|
|
137
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
138
|
+
color: "white",
|
|
139
|
+
typography: profileData === null || profileData === void 0 ? void 0 : profileData.mwebTypographyType
|
|
140
|
+
}, profileData === null || profileData === void 0 ? void 0 : profileData.iconText)) : /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
141
|
+
color: "primary",
|
|
142
|
+
icon: _Menu.default,
|
|
143
|
+
size: 20
|
|
144
|
+
})))), /*#__PURE__*/_react.default.createElement("div", {
|
|
145
|
+
className: "notShowInMobile"
|
|
146
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
147
|
+
className: "sidebarContent"
|
|
148
|
+
}, (menuItems === null || menuItems === void 0 ? void 0 : menuItems.visible) && /*#__PURE__*/_react.default.createElement(_antd.Menu, {
|
|
149
|
+
theme: "light",
|
|
150
|
+
mode: "inline",
|
|
151
|
+
selectedKeys: [location.pathname],
|
|
152
|
+
openKeys: openKeys,
|
|
153
|
+
onOpenChange: handleOpenChange,
|
|
154
|
+
className: "menu",
|
|
155
|
+
onClick: handleMenuClick
|
|
156
|
+
}, menuItems === null || menuItems === void 0 || (_menuItems$items = menuItems.items) === null || _menuItems$items === void 0 ? void 0 : _menuItems$items.map(item => renderMenuItem(item))), (footer === null || footer === void 0 ? void 0 : footer.visible) && /*#__PURE__*/_react.default.createElement("div", {
|
|
157
|
+
className: "logoutDiv",
|
|
158
|
+
onClick: () => handleFooterClick()
|
|
159
|
+
}, /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, footer === null || footer === void 0 || (_footer$item2 = footer.item) === null || _footer$item2 === void 0 ? void 0 : _footer$item2.iconConfig), /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
160
|
+
color: "negative",
|
|
161
|
+
typography: "type-button-500"
|
|
162
|
+
}, footer === null || footer === void 0 || (_footer$item3 = footer.item) === null || _footer$item3 === void 0 ? void 0 : _footer$item3.label)))))), (footer === null || footer === void 0 ? void 0 : footer.icons) && footer.icons.length > 0 && /*#__PURE__*/_react.default.createElement("div", {
|
|
163
|
+
className: "footerLogoSection notShowInMobile"
|
|
164
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
165
|
+
color: "secondary-content",
|
|
166
|
+
typography: "type-b2-400"
|
|
167
|
+
}, "Powered by"), /*#__PURE__*/_react.default.createElement("div", {
|
|
168
|
+
className: "footerLogoContainer"
|
|
169
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Image, {
|
|
170
|
+
src: (_footer$icons$ = footer.icons[0]) === null || _footer$icons$ === void 0 ? void 0 : _footer$icons$.icon,
|
|
171
|
+
preview: false,
|
|
172
|
+
className: "footerLogo"
|
|
173
|
+
}))));
|
|
174
|
+
}
|
|
175
|
+
var _default = exports.default = (0, _reactRouterDom.withRouter)(SidebarWidget);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _antd = require("antd");
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
/* eslint-disable */
|
|
11
|
+
|
|
12
|
+
function Header(_ref) {
|
|
13
|
+
let {
|
|
14
|
+
icons = [],
|
|
15
|
+
text = null
|
|
16
|
+
} = _ref;
|
|
17
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
18
|
+
className: "leftLogoSec"
|
|
19
|
+
}, icons === null || icons === void 0 ? void 0 : icons.map(_ref2 => {
|
|
20
|
+
let {
|
|
21
|
+
icon,
|
|
22
|
+
showLine
|
|
23
|
+
} = _ref2;
|
|
24
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_antd.Image, {
|
|
25
|
+
src: icon,
|
|
26
|
+
preview: false,
|
|
27
|
+
className: "logo logo-mobile-height"
|
|
28
|
+
}));
|
|
29
|
+
}), text && /*#__PURE__*/_react.default.createElement(_antd.Typography, {
|
|
30
|
+
typography: "type-h3-500"
|
|
31
|
+
}, text));
|
|
32
|
+
}
|
|
33
|
+
var _default = exports.default = Header;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.ProfileIcon = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
+
var _templateObject, _templateObject2; // styles.js
|
|
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 OalayoutStyle = _styledComponents.default.aside(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .oaLeftLayouts {\n padding: 24px 8px;\n background: #f6f6f6;\n height: auto;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n\n .logoContainer {\n padding: 12px;\n display: flex;\n justify-content: space-between;\n height: 110px;\n width: 220px;\n align-items: center;\n margin: 0 0 16px 0;\n }\n\n .logoutDiv {\n display: flex;\n flex-direction: row;\n margin: 48px 0 0 16px;\n gap: 8px;\n cursor: pointer;\n }\n\n .leftLogoSec {\n display: flex;\n flex-direction: row;\n gap: 8px;\n }\n\n .logo-mobile-height {\n height: auto;\n }\n\n // .logoContainer em {\n // width: 1px;\n // background: #e0e0e0;\n // }\n // .logoContainer img {\n // height: 32px;\n // }\n .ant-layout-sider-light,\n .ant-menu-light {\n background: transparent;\n }\n\n /* Regular menu items */\n .ant-menu-item {\n padding: 16px;\n border-radius: 50px;\n margin: 0 0 8px;\n height: auto;\n line-height: normal;\n border-radius: 999px;\n border: 1px solid #e0e0e0;\n background: #fff;\n }\n\n /* SubMenu title styling - this is the parent item - same size as regular items */\n .ant-menu-submenu-title {\n padding: 24px;\n border-radius: 50px;\n margin: 0 0 8px;\n height: auto;\n line-height: normal;\n border-radius: 999px;\n border: 1px solid #e0e0e0;\n background: #fff;\n display: flex;\n align-items: center;\n }\n\n /* SubMenu items - these are the children - should be plain text */\n .ant-menu-submenu .ant-menu-item {\n margin: 8px 0;\n padding: 8px 24px;\n border-radius: 0;\n background: transparent;\n border: none;\n margin-left: 16px;\n color: #666;\n font-size: 14px;\n height: auto;\n line-height: 1.4;\n }\n\n /* Add extra spacing for last nested item */\n .ant-menu-submenu .ant-menu-item:last-child {\n margin-bottom: 12px;\n }\n\n /* REMOVED: Open SubMenu styling - this was making ALL open submenus blue */\n /* .ant-menu-submenu-open > .ant-menu-submenu-title {\n background: #014fc5;\n color: #fff;\n padding: 24px; \n } */\n\n /* NEW: Only make parent blue when it contains a selected child */\n .ant-menu-submenu-open:has(.ant-menu-item-selected)\n > .ant-menu-submenu-title {\n background: #014fc5;\n color: #fff;\n padding: 24px;\n }\n\n /* Fallback for browsers that don't support :has() */\n .ant-menu-submenu-open > .ant-menu-submenu-title {\n background: #fff;\n color: #000;\n padding: 24px;\n }\n\n /* SubMenu title content */\n .ant-menu-item .ant-menu-title-content {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 8px;\n }\n\n .ant-menu-submenu-title .ant-menu-title-content {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 8px;\n }\n\n /* Add styling to span elements inside SubMenu title content */\n .ant-menu-submenu-title .ant-menu-title-content span {\n display: flex;\n gap: 8px;\n align-items: center;\n }\n\n /* Selected states */\n .ant-menu-item-active {\n background: #014fc5;\n color: #fff;\n }\n .ant-menu-item-selected {\n background: #014fc5;\n color: #fff;\n }\n\n /* SubMenu selected item - should be bold black when selected */\n .ant-menu-submenu .ant-menu-item-selected {\n background: transparent;\n color: #000;\n font-weight: bold;\n border-radius: 0;\n }\n\n /* Hover effects */\n .ant-menu-light:not(.ant-menu-horizontal)\n .ant-menu-item:not(.ant-menu-item-selected):hover,\n :where(.css-dev-only-do-not-override-zcfrx9).ant-menu-light\n > .ant-menu:not(.ant-menu-horizontal)\n .ant-menu-item:not(.ant-menu-item-selected):hover {\n background: #014fc5;\n color: #fff;\n }\n\n /* SubMenu title hover - should be blue on hover */\n .ant-menu-submenu-title:hover {\n background: #014fc5 !important;\n color: #fff !important;\n padding: 24px !important;\n }\n\n /* Nested items hover - should be bold black when hovered */\n .ant-menu-submenu .ant-menu-item:hover {\n background: transparent !important;\n color: #000 !important;\n font-weight: bold !important;\n border-radius: 0;\n }\n\n /* Make Orders parent blue when hovering over submenu items */\n .ant-menu-submenu:hover .ant-menu-submenu-title {\n background: #014fc5 !important;\n color: #fff !important;\n padding: 24px !important;\n }\n\n .ant-menu-light.ant-menu-root.ant-menu-inline {\n border: none;\n }\n\n /* SubMenu arrow styling */\n .ant-menu-submenu-arrow {\n color: inherit;\n }\n\n /* SubMenu content area */\n .ant-menu-sub {\n background: transparent !important;\n padding: 8px 0;\n }\n\n /* Remove default SubMenu styling */\n .ant-menu-submenu .ant-menu-sub {\n background: transparent !important;\n box-shadow: none !important;\n }\n\n .notShowInDesktop {\n display: none;\n }\n\n .footerLogoSection {\n margin-top: auto;\n margin-bottom: 40px;\n padding: 0 16px;\n display: flex;\n flex-direction: column;\n gap: 12px;\n width: 172px;\n height: 75px;\n }\n\n .footerLogoContainer {\n display: flex;\n align-items: center;\n }\n\n .footerLogo {\n width: 172px;\n height: 43px;\n }\n\n @media only screen and (max-width: 600px) {\n .oaLeftLayouts {\n background: #fff;\n padding: 0 16px;\n height: auto;\n display: block;\n }\n .logoContainer {\n padding: 0;\n align-items: center;\n width: 100%;\n height: 80px;\n }\n\n .logo-mobile-height {\n height: 56px;\n }\n\n .notShowInMobile {\n display: none;\n }\n .notShowInDesktop {\n display: flex;\n }\n\n .oaLeftLayouts .ant-layout-sider {\n max-width: none !important;\n width: 100% !important;\n }\n p.ant-dropdown-trigger {\n margin-bottom: 0;\n }\n .layoutHeadingPage * {\n max-width: 200px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n }\n"])));
|
|
12
|
+
const ProfileIcon = exports.ProfileIcon = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 36px;\n height: 36px;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: all 0.2s ease;\n box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--color-primary);\n\n &:hover {\n transform: scale(1.05);\n }\n"])));
|
|
13
|
+
var _default = exports.default = OalayoutStyle;
|
|
@@ -25,8 +25,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
25
25
|
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); }
|
|
26
26
|
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; }
|
|
27
27
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
28
|
-
const FlexContainer = _styledComponents.default.section(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n gap: 16px;\n .text-only-size{\n justify-content: left;\n }\n small{\n color: var(--color-secondary-content);\n display: block;\n }\n"])));
|
|
29
|
-
const CostBreakdown = _styledComponents.default.aside(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background: var(--color-secondary-background);\n padding: 0 12px;\n border-radius: 4px;\n ul{\n display: flex;\n margin: 0;\n border-bottom: 1px solid var(--color-divider);\n padding: 12px 0;\n }\n ul:last-child{\n border-bottom: none;\n }\n ul li{\n width: 100%;\n list-style: none;\n }\n ul li:first-child{\n color: var(--color-primary-content);\n font-style: normal;\n }\n ul li:last-child{\n font-style: normal;\n color: var(--color-secondary-content);\n }\n"])));
|
|
28
|
+
const FlexContainer = _styledComponents.default.section(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n gap: 16px;\n .text-only-size{\n justify-content: left;\n }\n small{\n color: var(--color-secondary-content);\n display: block;\n }\n .costClass span {\n display: block;\n text-align: end; \n }\n"])));
|
|
29
|
+
const CostBreakdown = _styledComponents.default.aside(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background: var(--color-secondary-background);\n padding: 0 12px;\n border-radius: 4px;\n ul{\n display: flex;\n margin: 0;\n border-bottom: 1px solid var(--color-divider);\n padding: 12px 0;\n }\n ul:last-child{\n border-bottom: none;\n }\n ul li{\n width: 100%;\n list-style: none;\n }\n ul li:first-child{\n color: var(--color-primary-content);\n font-style: normal;\n }\n ul li:last-child{\n font-style: normal;\n color: var(--color-secondary-content);\n }\n .font-bold{\n font-weight: 700;\n }\n .subHeadingclass{\n color:rgba(113, 113, 113, 1);\n font-weight: 400;\n }\n\n .alignItemsClass{\n display: flex;\n flex-direction: column;\n justify-content: start;\n gap: 4px;\n }\n .breakDownLastChild{\n text-align: right;\n margin-right: 8px;\n }\n \n"])));
|
|
30
30
|
// Mapping of how costs are covered
|
|
31
31
|
const costCoveredBy = {
|
|
32
32
|
costToCompany: 'Cost to Company',
|
|
@@ -34,27 +34,33 @@ const costCoveredBy = {
|
|
|
34
34
|
costToInsurer: 'Cost to Insurer',
|
|
35
35
|
costToOneassist: 'Cost to OneAssist',
|
|
36
36
|
totalCoverAmount: 'Total Cover Amount',
|
|
37
|
-
remainingCoverAmount: 'Remaining Cover Amount'
|
|
37
|
+
remainingCoverAmount: 'Remaining Cover Amount',
|
|
38
|
+
totalAmount: 'Total Amount',
|
|
39
|
+
coveredAmount: 'Covered Amount',
|
|
40
|
+
amountToPay: 'Amount to Pay'
|
|
38
41
|
};
|
|
39
42
|
|
|
40
43
|
// Renders the cost with currency formatting
|
|
41
|
-
const renderCost = cost => {
|
|
44
|
+
const renderCost = (cost, config) => {
|
|
42
45
|
if ( /*#__PURE__*/_react.default.isValidElement(cost)) {
|
|
43
46
|
return /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
44
|
-
typography:
|
|
47
|
+
typography: config !== null && config !== void 0 && config.isBold ? 'type-b2-700' : 'type-b2-400',
|
|
48
|
+
color: config !== null && config !== void 0 && config.fontColor ? config === null || config === void 0 ? void 0 : config.fontColor : ''
|
|
45
49
|
}, cost);
|
|
46
50
|
}
|
|
47
51
|
if (!Number.isNaN(cost)) {
|
|
48
52
|
var _Number;
|
|
49
53
|
return /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
50
|
-
|
|
54
|
+
color: config !== null && config !== void 0 && config.fontColor ? config === null || config === void 0 ? void 0 : config.fontColor : '',
|
|
55
|
+
typography: config !== null && config !== void 0 && config.isBold ? 'type-b2-700' : 'type-b2-400'
|
|
51
56
|
}, (_Number = Number(cost)) === null || _Number === void 0 ? void 0 : _Number.toLocaleString('en-IN', {
|
|
52
57
|
style: 'currency',
|
|
53
58
|
currency: 'INR'
|
|
54
59
|
}));
|
|
55
60
|
}
|
|
56
61
|
return /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
57
|
-
|
|
62
|
+
color: config !== null && config !== void 0 && config.fontColor ? config === null || config === void 0 ? void 0 : config.fontColor : '',
|
|
63
|
+
typography: config !== null && config !== void 0 && config.isBold ? 'type-b2-700' : 'type-b2-400'
|
|
58
64
|
}, cost);
|
|
59
65
|
};
|
|
60
66
|
|
|
@@ -107,9 +113,12 @@ function SparePartsWidget(_ref) {
|
|
|
107
113
|
onViewPriceHistory,
|
|
108
114
|
showGST,
|
|
109
115
|
showDiscount,
|
|
110
|
-
showSparePartsInfo = true
|
|
116
|
+
showSparePartsInfo = true,
|
|
117
|
+
keySettings = {},
|
|
118
|
+
showNonCoverageMessage,
|
|
119
|
+
unCoveredScopeDescription
|
|
111
120
|
} = _ref;
|
|
112
|
-
const sparePartList = [...scopeDetails.
|
|
121
|
+
const sparePartList = [...scopeDetails.coveredScope, ...scopeDetails.unCoveredScope];
|
|
113
122
|
const showActionList = sparePartList.some(sparePart => {
|
|
114
123
|
var _sparePart$action;
|
|
115
124
|
return (sparePart === null || sparePart === void 0 || (_sparePart$action = sparePart.action) === null || _sparePart$action === void 0 ? void 0 : _sparePart$action.length) > 0;
|
|
@@ -123,7 +132,9 @@ function SparePartsWidget(_ref) {
|
|
|
123
132
|
typography: "type-b2-400"
|
|
124
133
|
}, scopeName), (record === null || record === void 0 ? void 0 : record.subText) && /*#__PURE__*/_react.default.createElement("small", {
|
|
125
134
|
className: "type-b2-400"
|
|
126
|
-
}, "(", record === null || record === void 0 ? void 0 : record.subText, ")"),
|
|
135
|
+
}, "(", record === null || record === void 0 ? void 0 : record.subText, ")"), (record === null || record === void 0 ? void 0 : record.extraNode) && /*#__PURE__*/_react.default.createElement("div", {
|
|
136
|
+
className: "extraNode"
|
|
137
|
+
}, record.extraNode), showPriceHistory && !['Transport Charge', 'Labour Charge'].includes(scopeName) && /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
127
138
|
onClick: () => {
|
|
128
139
|
onViewPriceHistory(record);
|
|
129
140
|
},
|
|
@@ -131,16 +142,29 @@ function SparePartsWidget(_ref) {
|
|
|
131
142
|
label: "View Price History",
|
|
132
143
|
type: "text-only"
|
|
133
144
|
}))
|
|
134
|
-
}
|
|
145
|
+
}];
|
|
146
|
+
if (coverageShow) {
|
|
147
|
+
columns.push({
|
|
148
|
+
title: 'Coverage',
|
|
149
|
+
dataIndex: 'isCovered',
|
|
150
|
+
width: '20%',
|
|
151
|
+
key: 'isCovered',
|
|
152
|
+
render: (text, record) => renderCoverage(record.isCovered, record.className)
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
// Coverga show column need to be shown first
|
|
156
|
+
columns.push({
|
|
135
157
|
title: 'Cost',
|
|
136
158
|
width: '20%',
|
|
137
159
|
dataIndex: 'cost',
|
|
160
|
+
className: 'costClass',
|
|
138
161
|
key: 'cost',
|
|
139
162
|
render: (cost, record) => /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
140
163
|
className: "row",
|
|
141
164
|
style: {
|
|
142
165
|
gap: '4px',
|
|
143
|
-
cursor: 'pointer'
|
|
166
|
+
cursor: 'pointer',
|
|
167
|
+
justifyContent: 'flex-end'
|
|
144
168
|
}
|
|
145
169
|
}, ' ', /*#__PURE__*/_react.default.createElement("span", null, renderCost(record.cost - record.discount)), (record === null || record === void 0 ? void 0 : record.showCostInfo) && /*#__PURE__*/_react.default.createElement(_antd.Tooltip, {
|
|
146
170
|
title: "Basic Price : ".concat(record.basicPrice, " , Discount : ").concat(record.discount)
|
|
@@ -149,16 +173,7 @@ function SparePartsWidget(_ref) {
|
|
|
149
173
|
}, /*#__PURE__*/_react.default.createElement(_icons.InfoCircleFilled, null)))), (record === null || record === void 0 ? void 0 : record.subText2) && /*#__PURE__*/_react.default.createElement("small", {
|
|
150
174
|
className: "type-b2-400"
|
|
151
175
|
}, "(", record === null || record === void 0 ? void 0 : record.subText2, ")"))
|
|
152
|
-
}
|
|
153
|
-
if (coverageShow) {
|
|
154
|
-
columns.push({
|
|
155
|
-
title: 'Coverage',
|
|
156
|
-
dataIndex: 'isCovered',
|
|
157
|
-
width: '20%',
|
|
158
|
-
key: 'isCovered',
|
|
159
|
-
render: (text, record) => renderCoverage(record.isCovered, record.className)
|
|
160
|
-
});
|
|
161
|
-
}
|
|
176
|
+
});
|
|
162
177
|
if (showDiscount) {
|
|
163
178
|
columns.push({
|
|
164
179
|
title: 'Discount',
|
|
@@ -196,9 +211,9 @@ function SparePartsWidget(_ref) {
|
|
|
196
211
|
var _scopeDetails$unCover;
|
|
197
212
|
const unCoveredScope = (scopeDetails === null || scopeDetails === void 0 ? void 0 : scopeDetails.unCoveredScope) || [];
|
|
198
213
|
const coveredScope = (scopeDetails === null || scopeDetails === void 0 ? void 0 : scopeDetails.coveredScope) || [];
|
|
199
|
-
return /*#__PURE__*/_react.default.createElement(FlexContainer, null, (scopeDetails === null || scopeDetails === void 0 || (_scopeDetails$unCover = scopeDetails.unCoveredScope) === null || _scopeDetails$unCover === void 0 ? void 0 : _scopeDetails$unCover.length) > 0 && coverageShow && /*#__PURE__*/_react.default.createElement(_CustomInfo.default, {
|
|
214
|
+
return /*#__PURE__*/_react.default.createElement(FlexContainer, null, showNonCoverageMessage && (scopeDetails === null || scopeDetails === void 0 || (_scopeDetails$unCover = scopeDetails.unCoveredScope) === null || _scopeDetails$unCover === void 0 ? void 0 : _scopeDetails$unCover.length) > 0 && coverageShow && /*#__PURE__*/_react.default.createElement(_CustomInfo.default, {
|
|
200
215
|
color: "background-warning",
|
|
201
|
-
description:
|
|
216
|
+
description: unCoveredScopeDescription,
|
|
202
217
|
iconConfig: {
|
|
203
218
|
icon: /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
204
219
|
color: "warning",
|
|
@@ -208,18 +223,25 @@ function SparePartsWidget(_ref) {
|
|
|
208
223
|
}
|
|
209
224
|
}), showSparePartsInfo && /*#__PURE__*/_react.default.createElement(_CustomTable.default, {
|
|
210
225
|
columns: columns,
|
|
211
|
-
dataSource: [...
|
|
226
|
+
dataSource: [...coveredScope, ...unCoveredScope],
|
|
212
227
|
pagination: false,
|
|
213
228
|
size: "middle"
|
|
214
229
|
}), showCostBreakdown && /*#__PURE__*/_react.default.createElement(CostBreakdown, null, Object.keys(scopeDetails).map((key, index) => {
|
|
215
230
|
if (costCoveredBy[key] && scopeDetails[key] != null && scopeDetails[key] !== undefined) {
|
|
231
|
+
const config = keySettings[key] || {};
|
|
232
|
+
const className = "type-b2-400 alignItemsClass ".concat(config !== null && config !== void 0 && config.isBold ? 'font-bold' : '');
|
|
216
233
|
return /*#__PURE__*/_react.default.createElement("ul", {
|
|
217
234
|
key: (0, _utils.getUUID)()
|
|
218
235
|
}, /*#__PURE__*/_react.default.createElement("li", {
|
|
219
|
-
className:
|
|
220
|
-
},
|
|
221
|
-
|
|
222
|
-
},
|
|
236
|
+
className: className
|
|
237
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
238
|
+
color: config !== null && config !== void 0 && config.fontColor ? config === null || config === void 0 ? void 0 : config.fontColor : ''
|
|
239
|
+
}, costCoveredBy[key]), ' ', (config === null || config === void 0 ? void 0 : config.subHeading) && /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
240
|
+
className: "subHeadingclass",
|
|
241
|
+
typography: "type-b2-400"
|
|
242
|
+
}, config === null || config === void 0 ? void 0 : config.subHeading)), ' ', /*#__PURE__*/_react.default.createElement("li", {
|
|
243
|
+
className: "".concat(className, " breakDownLastChild")
|
|
244
|
+
}, renderCost(scopeDetails[key], config)));
|
|
223
245
|
}
|
|
224
246
|
return null; // To satisfy React key warning
|
|
225
247
|
})));
|
|
@@ -230,8 +252,8 @@ function SparePartsWidget(_ref) {
|
|
|
230
252
|
// Define prop types for SpareParts component
|
|
231
253
|
SparePartsWidget.propTypes = {
|
|
232
254
|
scopeDetails: _propTypes.default.shape({
|
|
233
|
-
|
|
234
|
-
|
|
255
|
+
coveredScope: _propTypes.default.array,
|
|
256
|
+
unCoveredScope: _propTypes.default.array
|
|
235
257
|
}),
|
|
236
258
|
actions: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
237
259
|
'data-test': _propTypes.default.string,
|
|
@@ -245,7 +267,10 @@ SparePartsWidget.propTypes = {
|
|
|
245
267
|
onViewPriceHistory: _propTypes.default.func,
|
|
246
268
|
showSparePartsInfo: _propTypes.default.bool,
|
|
247
269
|
showGST: _propTypes.default.bool,
|
|
248
|
-
showDiscount: _propTypes.default.bool
|
|
270
|
+
showDiscount: _propTypes.default.bool,
|
|
271
|
+
keySettings: _propTypes.default.shape({}),
|
|
272
|
+
showNonCoverageMessage: _propTypes.default.bool,
|
|
273
|
+
unCoveredScopeDescription: _propTypes.default.string
|
|
249
274
|
};
|
|
250
275
|
|
|
251
276
|
// Define default props for SpareParts component
|
|
@@ -253,14 +278,17 @@ SparePartsWidget.defaultProps = {
|
|
|
253
278
|
showCostBreakdown: true,
|
|
254
279
|
coverageShow: true,
|
|
255
280
|
scopeDetails: {
|
|
256
|
-
|
|
257
|
-
|
|
281
|
+
coveredScope: [],
|
|
282
|
+
unCoveredScope: []
|
|
258
283
|
},
|
|
259
284
|
actions: null,
|
|
260
285
|
showPriceHistory: false,
|
|
261
286
|
onViewPriceHistory: data => console.log(data),
|
|
262
287
|
showSparePartsInfo: true,
|
|
263
288
|
showGST: false,
|
|
264
|
-
showDiscount: false
|
|
289
|
+
showDiscount: false,
|
|
290
|
+
keySettings: {},
|
|
291
|
+
showNonCoverageMessage: true,
|
|
292
|
+
unCoveredScopeDescription: 'Multiple components need to be repaired which are not covered in this plan'
|
|
265
293
|
};
|
|
266
294
|
var _default = exports.default = SparePartsWidget;
|
|
@@ -9,12 +9,14 @@ exports.default = void 0;
|
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
var _FileCopyOutlined = _interopRequireDefault(require("@material-ui/icons/FileCopyOutlined"));
|
|
12
|
+
var _InfoOutlined = _interopRequireDefault(require("@material-ui/icons/InfoOutlined"));
|
|
12
13
|
var _AddressWidget = _interopRequireDefault(require("../oa-widget-address/AddressWidget"));
|
|
13
14
|
var _CustomTable = _interopRequireDefault(require("../../components/oa-component-table/CustomTable"));
|
|
14
15
|
var _CustomTimeline = _interopRequireDefault(require("../../components/oa-component-timeline/CustomTimeline"));
|
|
15
16
|
var _MaterialIcon = _interopRequireDefault(require("../../components/oa-component-icons/MaterialIcon"));
|
|
16
17
|
var _styles = require("./styles");
|
|
17
18
|
var _CustomNotification = _interopRequireDefault(require("../../components/oa-component-notification/CustomNotification"));
|
|
19
|
+
var _CustomInfo = _interopRequireDefault(require("../../components/oa-component-info/CustomInfo"));
|
|
18
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
21
|
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); }
|
|
20
22
|
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; }
|
|
@@ -41,7 +43,9 @@ function TrackShipmentWidget(_ref) {
|
|
|
41
43
|
tableData,
|
|
42
44
|
title,
|
|
43
45
|
toAddress,
|
|
44
|
-
heading
|
|
46
|
+
heading,
|
|
47
|
+
partnerName,
|
|
48
|
+
errorReason
|
|
45
49
|
} = _ref;
|
|
46
50
|
// local variables
|
|
47
51
|
const deilveryStageText = 'SHIPMENT DELIVERED to Customer';
|
|
@@ -81,7 +85,7 @@ function TrackShipmentWidget(_ref) {
|
|
|
81
85
|
const isOnDeliveryStage = Array.isArray(tableData) && tableData.length > 0 && ((_tableData = tableData[tableData.length - 1]) === null || _tableData === void 0 ? void 0 : _tableData.oneassistDisplayStatus) === deilveryStageText && ((_tableData2 = tableData[tableData.length - 1]) === null || _tableData2 === void 0 ? void 0 : _tableData2.toDate) === null;
|
|
82
86
|
|
|
83
87
|
// remove duplicate consicutive objects only show single unique objects
|
|
84
|
-
const stepsData = tableData.map(item => ({
|
|
88
|
+
const stepsData = tableData === null || tableData === void 0 ? void 0 : tableData.map(item => ({
|
|
85
89
|
title: item.oneassistDisplayStatus,
|
|
86
90
|
status: getCircleClass(item, true)
|
|
87
91
|
})).filter((item, index) => {
|
|
@@ -96,7 +100,7 @@ function TrackShipmentWidget(_ref) {
|
|
|
96
100
|
className: "type-t1-500"
|
|
97
101
|
}, title) : null, /*#__PURE__*/_react.default.createElement("h3", {
|
|
98
102
|
className: "type-t1-500"
|
|
99
|
-
}, heading), /*#__PURE__*/_react.default.createElement("p", {
|
|
103
|
+
}, heading), awbNumber && /*#__PURE__*/_react.default.createElement("p", {
|
|
100
104
|
className: "type-b2-400 disFlex"
|
|
101
105
|
}, "AWB Number:", awbNumber, awbNumber && /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
102
106
|
icon: _FileCopyOutlined.default,
|
|
@@ -106,16 +110,30 @@ function TrackShipmentWidget(_ref) {
|
|
|
106
110
|
cursor: 'pointer',
|
|
107
111
|
color: '014FC5'
|
|
108
112
|
}
|
|
109
|
-
})),
|
|
113
|
+
})), partnerName && /*#__PURE__*/_react.default.createElement("p", {
|
|
114
|
+
className: "type-b2-400 disFlex"
|
|
115
|
+
}, "Partner:", partnerName), fromAddress && toAddress && /*#__PURE__*/_react.default.createElement(_styles.AddressesContainer, null, /*#__PURE__*/_react.default.createElement(_AddressWidget.default, {
|
|
110
116
|
address: fromAddress
|
|
111
117
|
}), /*#__PURE__*/_react.default.createElement(_AddressWidget.default, {
|
|
112
118
|
address: toAddress
|
|
113
|
-
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
119
|
+
})), (stepsData === null || stepsData === void 0 ? void 0 : stepsData.length) > 0 && /*#__PURE__*/_react.default.createElement("div", {
|
|
114
120
|
className: "cstScroll"
|
|
115
121
|
}, /*#__PURE__*/_react.default.createElement(_CustomTimeline.default, {
|
|
116
122
|
currentStep: isOnDeliveryStage ? stepsData.length : stepsData.length - 1,
|
|
117
123
|
stepsData: stepsData
|
|
118
|
-
})), /*#__PURE__*/_react.default.createElement(
|
|
124
|
+
})), errorReason && /*#__PURE__*/_react.default.createElement("div", {
|
|
125
|
+
className: "margin-top-16 margin-bottom-16"
|
|
126
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomInfo.default, {
|
|
127
|
+
iconConfig: {
|
|
128
|
+
icon: /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
129
|
+
color: "warning",
|
|
130
|
+
size: 24,
|
|
131
|
+
icon: _InfoOutlined.default
|
|
132
|
+
}),
|
|
133
|
+
position: 'left'
|
|
134
|
+
},
|
|
135
|
+
description: errorReason
|
|
136
|
+
})), (tableData === null || tableData === void 0 ? void 0 : tableData.length) > 0 && /*#__PURE__*/_react.default.createElement(_CustomTable.default, {
|
|
119
137
|
bordered: true,
|
|
120
138
|
rowKey: "key",
|
|
121
139
|
columns: [{
|
|
@@ -158,6 +176,8 @@ function TrackShipmentWidget(_ref) {
|
|
|
158
176
|
}
|
|
159
177
|
TrackShipmentWidget.propTypes = {
|
|
160
178
|
awbNumber: _propTypes.default.string.isRequired,
|
|
179
|
+
errorReason: _propTypes.default.string,
|
|
180
|
+
partnerName: _propTypes.default.string,
|
|
161
181
|
fromAddress: _propTypes.default.shape({
|
|
162
182
|
heading: _propTypes.default.string,
|
|
163
183
|
addressLine1: _propTypes.default.string,
|
|
@@ -198,6 +218,8 @@ TrackShipmentWidget.propTypes = {
|
|
|
198
218
|
})
|
|
199
219
|
};
|
|
200
220
|
TrackShipmentWidget.defaultProps = {
|
|
221
|
+
errorReason: '',
|
|
222
|
+
partnerName: '',
|
|
201
223
|
fromAddress: {
|
|
202
224
|
heading: ''
|
|
203
225
|
},
|