oa-componentbook 0.0.0-sit1.1
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/README.md +92 -0
- package/build/MockData.js +2311 -0
- package/build/components/oa-component-accordion/Accordion.js +195 -0
- package/build/components/oa-component-accordion/styles.js +13 -0
- package/build/components/oa-component-auto-complete/CustomAutoComplete.js +167 -0
- package/build/components/oa-component-bar-chart/BarChart.js +295 -0
- package/build/components/oa-component-bread-crumb/CustomBreadCrumb.js +47 -0
- package/build/components/oa-component-button/CustomButton.js +108 -0
- package/build/components/oa-component-button/styles.js +41 -0
- package/build/components/oa-component-checkbox/CustomCheckBox.js +115 -0
- package/build/components/oa-component-checkbox/styles.js +12 -0
- package/build/components/oa-component-count-card/CustomCountCard.js +74 -0
- package/build/components/oa-component-count-card/styles.js +12 -0
- package/build/components/oa-component-datepicker/CustomDatePicker.js +134 -0
- package/build/components/oa-component-demo-border-radius/BorderRadiusDemo.js +35 -0
- package/build/components/oa-component-demo-border-radius/styles.js +12 -0
- package/build/components/oa-component-demo-color-variables/ColorVariablesDemo.js +34 -0
- package/build/components/oa-component-demo-color-variables/styles.js +12 -0
- package/build/components/oa-component-demo-elevation/ElevationDemo.js +22 -0
- package/build/components/oa-component-demo-elevation/styles.js +12 -0
- package/build/components/oa-component-demo-spacing/SpacingScales.js +26 -0
- package/build/components/oa-component-demo-spacing/styles.js +259 -0
- package/build/components/oa-component-drawer/CustomDrawer.js +178 -0
- package/build/components/oa-component-drawer/styles.js +16 -0
- package/build/components/oa-component-dropdown/CustomDropdown.js +102 -0
- package/build/components/oa-component-dropdown/customClass.css +9 -0
- package/build/components/oa-component-dropdown/styles.js +12 -0
- package/build/components/oa-component-feedback-form/FeedbackForm.js +75 -0
- package/build/components/oa-component-feedback-tooltip/FeedbackTooltip.js +69 -0
- package/build/components/oa-component-form-item/CustomFormItem.js +74 -0
- package/build/components/oa-component-header/CustomHeader.js +104 -0
- package/build/components/oa-component-header/styles.js +12 -0
- package/build/components/oa-component-icons/CustomIcon.js +92 -0
- package/build/components/oa-component-icons/MaterialIcon.js +70 -0
- package/build/components/oa-component-icons/SizedSvg.js +42 -0
- package/build/components/oa-component-info/CustomInfo.js +119 -0
- package/build/components/oa-component-info/styles.js +15 -0
- package/build/components/oa-component-input/CustomInput.js +131 -0
- package/build/components/oa-component-input-number/CustomInputNumber.js +140 -0
- package/build/components/oa-component-lable/CustomLable.js +37 -0
- package/build/components/oa-component-lable/styles.js +12 -0
- package/build/components/oa-component-loader/CustomLoader.js +66 -0
- package/build/components/oa-component-modal/CustomModal.js +153 -0
- package/build/components/oa-component-modal/styles.js +14 -0
- package/build/components/oa-component-notification/CustomNotification.js +152 -0
- package/build/components/oa-component-notification/styles.js +12 -0
- package/build/components/oa-component-notification/usage-example.md +44 -0
- 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-popover/CustomPopover.js +58 -0
- package/build/components/oa-component-progress-bar/CustomProgressBar.js +68 -0
- package/build/components/oa-component-progress-bar/styles.js +12 -0
- package/build/components/oa-component-radio/CustomRadio.js +112 -0
- package/build/components/oa-component-radio/styles.js +13 -0
- package/build/components/oa-component-rating/CustomRating.js +13 -0
- package/build/components/oa-component-select/CustomSelect.js +432 -0
- 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 +300 -0
- package/build/components/oa-component-table/CustomTableV1.js +610 -0
- package/build/components/oa-component-table/styles.js +14 -0
- package/build/components/oa-component-table/stylesV1.js +19 -0
- package/build/components/oa-component-tabs/CustomTabs.js +102 -0
- package/build/components/oa-component-tabs/styles.js +13 -0
- package/build/components/oa-component-tag/CustomTag.js +66 -0
- package/build/components/oa-component-tag/styles.js +75 -0
- package/build/components/oa-component-textarea/CustomTextArea.js +74 -0
- package/build/components/oa-component-textarea/styles.js +16 -0
- package/build/components/oa-component-timeline/CustomTimeline.js +65 -0
- package/build/components/oa-component-timeline/styles.js +15 -0
- package/build/components/oa-component-timepicker/CustomTimePicker.js +104 -0
- package/build/components/oa-component-toggle/CustomToggle.js +111 -0
- package/build/components/oa-component-toggle/styles.js +43 -0
- package/build/components/oa-component-tooltip/CustomTooltip.js +70 -0
- package/build/components/oa-component-typography/Typography.js +58 -0
- package/build/components/oa-component-typography/styles.js +13 -0
- package/build/components/oa-component-upload/CustomUpload.js +332 -0
- package/build/components/oa-component-upload/styles.js +13 -0
- package/build/components/oa-component-viewer/CustomViewer.js +273 -0
- package/build/components/oa-component-viewer/styles.js +14 -0
- package/build/constants/ratingConstants.js +194 -0
- 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-timeline/CustomTimeline.js +53 -0
- package/build/dev/oa-component-timeline/styles.js +15 -0
- package/build/dev/oa-component-upload/CustomUpload.js +285 -0
- package/build/dev/oa-component-upload/styles.js +13 -0
- package/build/dev/oa-component-viewer/CustomViewer.js +326 -0
- package/build/dev/oa-component-viewer/styles.js +14 -0
- package/build/dev/oa-widget-document-modal/DocumentSideModal.js +166 -0
- package/build/dev/oa-widget-document-modal/styles.js +12 -0
- package/build/dev/oa-widget-document-side-drawer/DocumentSideDrawer.js +196 -0
- package/build/dev/oa-widget-document-side-drawer/styles.js +12 -0
- package/build/dev/oa-widget-document-upload-card/DocUploadCardWidget.js +179 -0
- package/build/dev/oa-widget-document-upload-card/styles.js +13 -0
- package/build/global-css/BorderRadius.js +22 -0
- package/build/global-css/ColorVariables.js +26 -0
- package/build/global-css/ColorVariablesMap.js +29 -0
- package/build/global-css/CustomDropDownThemes.js +31 -0
- package/build/global-css/Elevation.js +35 -0
- package/build/global-css/GlobalCss.js +26 -0
- package/build/global-css/GridLayout.js +25 -0
- package/build/global-css/SpacingScales.js +11 -0
- package/build/global-css/Typographies.js +26 -0
- package/build/global-css/TypographiesMap.js +71 -0
- package/build/global-css/color-options.js +8 -0
- package/build/global-css/commonStyles.js +11 -0
- package/build/global-css/tooltip-placement-option.js +8 -0
- package/build/global-css/typography-options.js +8 -0
- package/build/images/AC.png +0 -0
- package/build/images/Car.png +0 -0
- package/build/images/Cooler.png +0 -0
- package/build/images/Default.png +0 -0
- package/build/images/Footwear.png +0 -0
- package/build/images/Furniture.png +0 -0
- package/build/images/Glasses.png +0 -0
- package/build/images/HA.png +0 -0
- package/build/images/Laptop.png +0 -0
- package/build/images/Luggage.png +0 -0
- package/build/images/Microwave.png +0 -0
- package/build/images/Mobile.png +0 -0
- package/build/images/PdfSampleImage.png +0 -0
- package/build/images/Refrigerator.png +0 -0
- package/build/images/Shirts.png +0 -0
- package/build/images/Tablets.png +0 -0
- package/build/images/Television.png +0 -0
- package/build/images/TwoWheeler.png +0 -0
- package/build/images/Wallet.png +0 -0
- package/build/images/WashingMachine.png +0 -0
- package/build/images/WaterPurifier.png +0 -0
- package/build/images/Wearable.png +0 -0
- package/build/images/ajax-loader.gif +0 -0
- package/build/images/astronaut_emptystate.png +0 -0
- package/build/images/caution.svg +3 -0
- package/build/images/close.svg +3 -0
- package/build/images/current-location.svg +3 -0
- package/build/images/delete.svg +8 -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/hand-icon.svg +4 -0
- package/build/images/iphone.svg +9 -0
- package/build/images/left-icon.svg +28 -0
- package/build/images/map_pointer.svg +25 -0
- package/build/images/modal-img.svg +8 -0
- package/build/images/oaChat.svg +5 -0
- package/build/images/offer.svg +3 -0
- package/build/images/oneassist-logo.png +0 -0
- package/build/images/outOfStock.png +0 -0
- package/build/images/right-icon.svg +28 -0
- package/build/images/search_ic.svg +3 -0
- package/build/images/search_not_found.svg +7 -0
- package/build/images/upload.svg +8 -0
- package/build/images/zoom.svg +4 -0
- package/build/index.js +763 -0
- package/build/layout/DetailDataLayout/DetailDataLayout.js +20 -0
- package/build/layout/DetailDataLayout/components/Form.js +22 -0
- package/build/layout/DetailDataLayout/components/Header.js +32 -0
- package/build/layout/DetailDataLayout/style.css +9 -0
- package/build/layout/DetailDataLayout/styles.js +12 -0
- package/build/layout/EntityOverviewLayout/EntityOverviewLayout.js +235 -0
- package/build/layout/EntityOverviewLayout/reducer/entityOverviewLayoutReducer.js +63 -0
- package/build/layout/EntityOverviewLayout/styles.js +13 -0
- package/build/layout/GenricLayOut/GenricLayOut.js +2293 -0
- package/build/layout/GenricLayOut/components/AppliedFilters.js +84 -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 +85 -0
- package/build/layout/GenricLayOut/components/ProfileSection.js +87 -0
- package/build/layout/GenricLayOut/components/Search.js +51 -0
- package/build/layout/GenricLayOut/components/StaticFilter.css +73 -0
- package/build/layout/GenricLayOut/components/StaticFilter.js +37 -0
- package/build/layout/GenricLayOut/reducer/layoutReducer.js +294 -0
- package/build/layout/GenricLayOut/resolver/staticConfigResolver.js +98 -0
- package/build/layout/GenricLayOut/styles.js +25 -0
- package/build/layout/paymentAndConsent/CancelScreen.js +46 -0
- package/build/layout/paymentAndConsent/ConsentCard.js +68 -0
- package/build/layout/paymentAndConsent/DetailsCard.js +75 -0
- package/build/layout/paymentAndConsent/DetailsList.js +38 -0
- package/build/layout/paymentAndConsent/Header.js +33 -0
- package/build/layout/paymentAndConsent/InProgressScreen.js +46 -0
- package/build/layout/paymentAndConsent/Loader.js +21 -0
- package/build/layout/paymentAndConsent/Modal.js +28 -0
- package/build/layout/paymentAndConsent/PaymentAndConsent.js +22 -0
- package/build/layout/paymentAndConsent/PaymentCard.js +83 -0
- package/build/layout/paymentAndConsent/Section.js +34 -0
- package/build/layout/paymentAndConsent/SuccessScreen.js +46 -0
- package/build/layout/paymentAndConsent/TimeLineCard.js +28 -0
- package/build/layout/paymentAndConsent/TncList.js +32 -0
- package/build/layout/paymentAndConsent/style.js +12 -0
- package/build/utils/common.js +20 -0
- package/build/utils/download-file.js +23 -0
- package/build/utils/fix-decimal-places.js +24 -0
- package/build/utils/get-uuid.js +41 -0
- package/build/utils/hex-to-rgb.js +30 -0
- package/build/utils/index.js +78 -0
- package/build/utils/random-generators.js +19 -0
- package/build/utils/rupee-formatters.js +69 -0
- package/build/utils/type-checkers.js +16 -0
- package/build/widgets/oa-form-widget/FormWidget.js +544 -0
- package/build/widgets/oa-form-widget/FormWidgetStyle.js +18 -0
- package/build/widgets/oa-widget-add-spare-part/AddSparePartCollapseWidget.js +461 -0
- package/build/widgets/oa-widget-add-spare-part/AddSparePartWidget.js +355 -0
- package/build/widgets/oa-widget-add-spare-part/styles.js +12 -0
- package/build/widgets/oa-widget-address/AddressWidget.js +55 -0
- package/build/widgets/oa-widget-address/styles.js +13 -0
- package/build/widgets/oa-widget-approval/ApprovalWidget.js +200 -0
- package/build/widgets/oa-widget-approval/ApprovalWidgetNew.js +492 -0
- package/build/widgets/oa-widget-approval/styles.js +13 -0
- package/build/widgets/oa-widget-chat/ChatWidget.js +261 -0
- package/build/widgets/oa-widget-chat/styles.js +17 -0
- package/build/widgets/oa-widget-close-claim/CloseClaimWidget.js +256 -0
- package/build/widgets/oa-widget-close-claim/styles.js +12 -0
- package/build/widgets/oa-widget-collapsible-key-value/CollapsibleKeyValueWidget.js +395 -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-custom-details/CustomDetails.js +41 -0
- package/build/widgets/oa-widget-customer-rating-card/CustomerRatingCard.js +147 -0
- package/build/widgets/oa-widget-customer-rating-card/styles.js +12 -0
- package/build/widgets/oa-widget-date-dropdown/DateDropDown.js +385 -0
- package/build/widgets/oa-widget-date-dropdown/styles.js +12 -0
- package/build/widgets/oa-widget-detailcard/MembershipDetailCard.js +182 -0
- package/build/widgets/oa-widget-detailcard/styles.js +12 -0
- package/build/widgets/oa-widget-document-upload/DocUploadWidget.js +264 -0
- package/build/widgets/oa-widget-document-upload/styles.js +13 -0
- package/build/widgets/oa-widget-document-upload-card/DocUploadCardWidget.js +178 -0
- package/build/widgets/oa-widget-document-upload-card/styles.js +13 -0
- package/build/widgets/oa-widget-dropdown-search-input/DropdownSearchInput.js +200 -0
- package/build/widgets/oa-widget-dropdown-search-input/styles.js +12 -0
- package/build/widgets/oa-widget-feedback/FeedbackWidget.js +83 -0
- package/build/widgets/oa-widget-feedback/styles.js +13 -0
- package/build/widgets/oa-widget-form/CustomFormWidget.js +51 -0
- package/build/widgets/oa-widget-form/styles.js +12 -0
- package/build/widgets/oa-widget-googlerating/GoogleRating.js +55 -0
- package/build/widgets/oa-widget-googlerating/styles.js +12 -0
- package/build/widgets/oa-widget-guide/GuideWidget.js +70 -0
- package/build/widgets/oa-widget-guide/GuideWidgetStyle.js +12 -0
- package/build/widgets/oa-widget-header/CustomHeaderWidget.js +98 -0
- package/build/widgets/oa-widget-header/styles.js +12 -0
- package/build/widgets/oa-widget-hub-automation-modal/HubAutomationDeleteBiker.js +24 -0
- package/build/widgets/oa-widget-hub-automation-modal/HubAutomationModal.js +34 -0
- package/build/widgets/oa-widget-hub-automation-modal/HubAutomationModalStyle.js +13 -0
- package/build/widgets/oa-widget-image-carousel/ImageCarouselWidget.js +256 -0
- package/build/widgets/oa-widget-image-carousel/styles.js +23 -0
- package/build/widgets/oa-widget-image-gallery/FullscreenViewer.js +169 -0
- package/build/widgets/oa-widget-image-gallery/ImageGallery.js +87 -0
- package/build/widgets/oa-widget-image-gallery/ThumbnailGrid.js +146 -0
- package/build/widgets/oa-widget-image-gallery/imageCache.js +15 -0
- package/build/widgets/oa-widget-image-gallery/imageGalleryStyle.js +16 -0
- package/build/widgets/oa-widget-input-pattern-pin/CustomPinPatternCaptureWidget.js +395 -0
- package/build/widgets/oa-widget-input-pattern-pin/styles.js +12 -0
- package/build/widgets/oa-widget-item-info-card/InfoCardListWidget.js +60 -0
- package/build/widgets/oa-widget-item-info-card/ItemInfoCardWidget.js +77 -0
- package/build/widgets/oa-widget-item-info-card/styles.css +50 -0
- package/build/widgets/oa-widget-item-info-card/styles.js +14 -0
- package/build/widgets/oa-widget-key-value/KeyValueWidget.js +121 -0
- package/build/widgets/oa-widget-key-value/styles.js +14 -0
- 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-location-access/LocationAccessWidget.js +92 -0
- package/build/widgets/oa-widget-location-access/styles.js +12 -0
- package/build/widgets/oa-widget-map-base-location/AddressDetails.js +84 -0
- package/build/widgets/oa-widget-map-base-location/AddressForm.js +106 -0
- package/build/widgets/oa-widget-map-base-location/CustomModalComponent.js +58 -0
- package/build/widgets/oa-widget-map-base-location/MapBaseLocation.js +93 -0
- package/build/widgets/oa-widget-map-base-location/MapComponent.js +167 -0
- package/build/widgets/oa-widget-map-base-location/styles.js +12 -0
- package/build/widgets/oa-widget-membershipcard/MembershipCard.js +266 -0
- package/build/widgets/oa-widget-membershipcard/styles.js +13 -0
- package/build/widgets/oa-widget-multiple-collapse-with-slots/MultipleCollapseWithSlots.js +85 -0
- package/build/widgets/oa-widget-multiple-collapse-with-slots/checkactive.svg +8 -0
- package/build/widgets/oa-widget-multiple-collapse-with-slots/checkhover.svg +8 -0
- package/build/widgets/oa-widget-multiple-collapse-with-slots/styles.js +16 -0
- package/build/widgets/oa-widget-notes/NotesWidget.js +135 -0
- package/build/widgets/oa-widget-notes/styles.js +13 -0
- package/build/widgets/oa-widget-pincode-base-location/PincodeBaseLocation.js +281 -0
- package/build/widgets/oa-widget-pincode-base-location/styles.js +12 -0
- package/build/widgets/oa-widget-plan-card/PlanCard.js +183 -0
- package/build/widgets/oa-widget-plan-card/styles.js +13 -0
- package/build/widgets/oa-widget-preview/Preview.js +172 -0
- package/build/widgets/oa-widget-preview/ZoomImageComponent.js +95 -0
- package/build/widgets/oa-widget-preview/styles.js +12 -0
- package/build/widgets/oa-widget-profile-data/ProfileDataWidget.js +117 -0
- package/build/widgets/oa-widget-profile-data/styles.js +13 -0
- package/build/widgets/oa-widget-progressive-steps/ProgressiveStepsWidget.js +362 -0
- package/build/widgets/oa-widget-progressive-steps/styles.js +12 -0
- package/build/widgets/oa-widget-reimbursement-breakup/ReimbursementBreakupWidget.js +141 -0
- package/build/widgets/oa-widget-reimbursement-breakup/styles.js +12 -0
- package/build/widgets/oa-widget-repair-service/RepairServiceWidget.js +79 -0
- package/build/widgets/oa-widget-repair-service/styles.js +12 -0
- package/build/widgets/oa-widget-reupload-drawer/ReUploadDrawer.js +164 -0
- package/build/widgets/oa-widget-send-payment-link/SendPaymentLinkWidget.js +224 -0
- package/build/widgets/oa-widget-send-payment-link/styles.js +15 -0
- package/build/widgets/oa-widget-servicecard/ServiceCard.js +185 -0
- package/build/widgets/oa-widget-servicecard/styles.js +13 -0
- package/build/widgets/oa-widget-sidebar/SidebarWidget.js +105 -0
- package/build/widgets/oa-widget-sidebar/components/Header.js +33 -0
- package/build/widgets/oa-widget-sidebar/sidebar.css +0 -0
- package/build/widgets/oa-widget-sidebar/styles.js +13 -0
- package/build/widgets/oa-widget-spare-part/SparePartsCollapseWidget.js +127 -0
- package/build/widgets/oa-widget-spare-part/SparePartsWidget.js +294 -0
- package/build/widgets/oa-widget-spare-part/styles.js +18 -0
- package/build/widgets/oa-widget-stage-timeline/StageTimelineWidget.js +159 -0
- package/build/widgets/oa-widget-stage-timeline/styles.js +29 -0
- package/build/widgets/oa-widget-track-shipment/TrackShipmentWidget.js +232 -0
- package/build/widgets/oa-widget-track-shipment/styles.js +13 -0
- 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-track-shipment-list/styles.js +13 -0
- package/build/widgets/oa-widget-upload-download/UploadDownloadWidget.js +167 -0
- package/build/widgets/oa-widget-upload-download/styles.js +14 -0
- package/build/widgets/oa-widget-user-management/UserManagementWidget.js +352 -0
- package/build/widgets/oa-widget-user-management/styles.js +15 -0
- package/build/widgets/oa-widget-view-history/ViewHistoryWidget.js +181 -0
- package/build/widgets/oa-widget-view-history/styles.js +12 -0
- package/build/widgets/oa-widget-view-previous-description/ViewPreviousDescriptionWidget.js +188 -0
- package/build/widgets/oa-widget-view-previous-description/styles.js +16 -0
- package/package.json +100 -0
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.symbol.description.js");
|
|
4
|
+
require("core-js/modules/es.object.assign.js");
|
|
5
|
+
require("core-js/modules/es.weak-map.js");
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
exports.default = void 0;
|
|
10
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
11
|
+
require("core-js/modules/es.json.stringify.js");
|
|
12
|
+
require("core-js/modules/es.array.includes.js");
|
|
13
|
+
require("core-js/modules/es.string.includes.js");
|
|
14
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
16
|
+
var _antd = require("antd");
|
|
17
|
+
var _KeyboardArrowDown = _interopRequireDefault(require("@material-ui/icons/KeyboardArrowDown"));
|
|
18
|
+
var _KeyboardArrowUp = _interopRequireDefault(require("@material-ui/icons/KeyboardArrowUp"));
|
|
19
|
+
var _Typography = _interopRequireDefault(require("../oa-component-typography/Typography"));
|
|
20
|
+
require("antd/dist/reset.css");
|
|
21
|
+
var _ColorVariablesMap = _interopRequireDefault(require("../../global-css/ColorVariablesMap"));
|
|
22
|
+
var _TypographiesMap = _interopRequireDefault(require("../../global-css/TypographiesMap"));
|
|
23
|
+
var _CustomButton = _interopRequireDefault(require("../oa-component-button/CustomButton"));
|
|
24
|
+
var _CustomTag = _interopRequireDefault(require("../oa-component-tag/CustomTag"));
|
|
25
|
+
var _MaterialIcon = _interopRequireDefault(require("../oa-component-icons/MaterialIcon"));
|
|
26
|
+
var _utils = require("../../utils");
|
|
27
|
+
var _styles = require("./styles");
|
|
28
|
+
var _CustomPagination = _interopRequireDefault(require("../oa-component-pagination/CustomPagination"));
|
|
29
|
+
const _excluded = ["columns", "dataSource", "pagination", "rowKey", "size", "style", "tableBorder", "emptyText", "noOfColumnToShow", "defaultCardShow", "onMobilePageChange", "showNumberPagination"],
|
|
30
|
+
_excluded2 = ["title"];
|
|
31
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
32
|
+
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); }
|
|
33
|
+
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; }
|
|
34
|
+
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); }
|
|
35
|
+
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; }
|
|
36
|
+
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; }
|
|
37
|
+
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; }
|
|
38
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
39
|
+
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); }
|
|
40
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
41
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
42
|
+
/**
|
|
43
|
+
* @description A custom implementation of the Ant Design Table component.
|
|
44
|
+
* @param {array} columns - The columns configuration for the table.
|
|
45
|
+
* @param {array} dataSource - The data for the table.
|
|
46
|
+
* @param {object} pagination - The pagination configuration for the table.
|
|
47
|
+
* @param {string} rowKey - The unique key for identifying table rows.
|
|
48
|
+
* @param {string} size - The size of the table.
|
|
49
|
+
* @param {object} style - The styles for the table.
|
|
50
|
+
* @param {boolean} tableBorder - Whether to show the table border.
|
|
51
|
+
* @param {string} emptyText - The text to display when the table is empty.
|
|
52
|
+
* @param {number} noOfColumnToShow - The number of columns to show in the table.
|
|
53
|
+
* @param {boolean} defaultCardShow - Whether to show the table in the card view by default.
|
|
54
|
+
* @param {object} antDesignProps - The props to be passed to the underlying Ant Design Table component.
|
|
55
|
+
* @returns {JSX.Element} The rendered table component.
|
|
56
|
+
*/
|
|
57
|
+
function CustomTable(_ref) {
|
|
58
|
+
let {
|
|
59
|
+
columns,
|
|
60
|
+
dataSource,
|
|
61
|
+
pagination,
|
|
62
|
+
rowKey,
|
|
63
|
+
size,
|
|
64
|
+
style,
|
|
65
|
+
tableBorder,
|
|
66
|
+
emptyText,
|
|
67
|
+
noOfColumnToShow,
|
|
68
|
+
defaultCardShow,
|
|
69
|
+
onMobilePageChange,
|
|
70
|
+
showNumberPagination
|
|
71
|
+
} = _ref,
|
|
72
|
+
antDesignProps = _objectWithoutProperties(_ref, _excluded);
|
|
73
|
+
const [viewMore, setViewMore] = (0, _react.useState)([]);
|
|
74
|
+
const [cardShow, setCardShow] = (0, _react.useState)(false);
|
|
75
|
+
(0, _react.useEffect)(() => {
|
|
76
|
+
if (window.innerWidth <= 600) {
|
|
77
|
+
if (defaultCardShow) {
|
|
78
|
+
setCardShow(defaultCardShow);
|
|
79
|
+
} else if ((columns === null || columns === void 0 ? void 0 : columns.length) <= 3) {
|
|
80
|
+
setCardShow(false);
|
|
81
|
+
} else {
|
|
82
|
+
setCardShow(true);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}, [defaultCardShow, columns === null || columns === void 0 ? void 0 : columns.length, dataSource === null || dataSource === void 0 ? void 0 : dataSource.length]);
|
|
86
|
+
const uppercaseColumns = columns.map(column => {
|
|
87
|
+
const {
|
|
88
|
+
title
|
|
89
|
+
} = column,
|
|
90
|
+
otherColumnProperties = _objectWithoutProperties(column, _excluded2);
|
|
91
|
+
const titleComponent = (0, _utils.isString)(title) || (0, _utils.isNumber)(title) ? /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
92
|
+
typography: "type-sl1-700"
|
|
93
|
+
}, title) : title;
|
|
94
|
+
return _objectSpread({
|
|
95
|
+
title: titleComponent,
|
|
96
|
+
render: text => {
|
|
97
|
+
if ((0, _utils.isString)(text) || (0, _utils.isNumber)(text)) {
|
|
98
|
+
return /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
99
|
+
typography: "type-b2-400"
|
|
100
|
+
}, text);
|
|
101
|
+
}
|
|
102
|
+
return text;
|
|
103
|
+
}
|
|
104
|
+
}, otherColumnProperties);
|
|
105
|
+
});
|
|
106
|
+
const tableStyle = {
|
|
107
|
+
borderTop: '1px solid var(--color-divider)',
|
|
108
|
+
overflow: 'hidden',
|
|
109
|
+
borderRight: tableBorder ? '1px solid var(--color-divider)' : '0',
|
|
110
|
+
borderBottom: tableBorder ? '1px solid var(--color-divider)' : '0',
|
|
111
|
+
borderLeft: tableBorder ? '1px solid var(--color-divider)' : '0',
|
|
112
|
+
borderRadius: tableBorder ? '4px' : '0'
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* Takes an array and a number, checks if the number is present in the array.
|
|
116
|
+
* If present, removes it; if not, adds it.
|
|
117
|
+
* @param {array} arr - The array to check and update.
|
|
118
|
+
* @param {number} num - The number to check for.
|
|
119
|
+
* @returns {array} The updated array.
|
|
120
|
+
*/
|
|
121
|
+
function checkAndUpdateArray(arr, num) {
|
|
122
|
+
const index = arr.indexOf(num);
|
|
123
|
+
if (index !== -1) {
|
|
124
|
+
arr.splice(index, 1);
|
|
125
|
+
} else {
|
|
126
|
+
arr.push(num);
|
|
127
|
+
}
|
|
128
|
+
return arr;
|
|
129
|
+
}
|
|
130
|
+
const handleViewMore = (index, row) => {
|
|
131
|
+
const tempViewMore = JSON.parse(JSON.stringify(viewMore));
|
|
132
|
+
setViewMore(checkAndUpdateArray(tempViewMore, index));
|
|
133
|
+
};
|
|
134
|
+
const checkLastElementIsAction = colIndex => {
|
|
135
|
+
var _uppercaseColumns;
|
|
136
|
+
if ((uppercaseColumns === null || uppercaseColumns === void 0 || (_uppercaseColumns = uppercaseColumns[uppercaseColumns.length - 1]) === null || _uppercaseColumns === void 0 || (_uppercaseColumns = _uppercaseColumns.key) === null || _uppercaseColumns === void 0 ? void 0 : _uppercaseColumns.toLowerCase()) === 'action' && colIndex === uppercaseColumns.length - 1) {
|
|
137
|
+
return true;
|
|
138
|
+
}
|
|
139
|
+
return false;
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* Given a column's configuration and a row from the table data,
|
|
143
|
+
* returns the content to be rendered for that column in that row.
|
|
144
|
+
* If the column has a render function, calls it with the row's column data and the row itself.
|
|
145
|
+
* If the column has a dataIndex and the row has data at that index,
|
|
146
|
+
* returns the row's data at that index.
|
|
147
|
+
* If neither of the above conditions are met, returns an empty string.
|
|
148
|
+
* @param {object} columnsData - A column's configuration from the table's columns array.
|
|
149
|
+
* @param {object} row - A row from the table data.
|
|
150
|
+
* @returns {string|JSX.Element} The content to be rendered for the column in the row.
|
|
151
|
+
*/
|
|
152
|
+
const getContentToBeRender = (columnsData, row) => {
|
|
153
|
+
if (columnsData.render) {
|
|
154
|
+
return columnsData.render(row[columnsData.dataIndex], row);
|
|
155
|
+
}
|
|
156
|
+
if (columnsData.dataIndex && row[columnsData.dataIndex]) {
|
|
157
|
+
return row[columnsData.dataIndex];
|
|
158
|
+
}
|
|
159
|
+
return '';
|
|
160
|
+
};
|
|
161
|
+
const CheckMoreView = (0, _react.useMemo)(colIndex => {
|
|
162
|
+
var _uppercaseColumns2;
|
|
163
|
+
let tempNoOfColumnToShow = noOfColumnToShow + 1; // bcz of heading
|
|
164
|
+
if ((uppercaseColumns === null || uppercaseColumns === void 0 || (_uppercaseColumns2 = uppercaseColumns[uppercaseColumns.length - 1]) === null || _uppercaseColumns2 === void 0 || (_uppercaseColumns2 = _uppercaseColumns2.key) === null || _uppercaseColumns2 === void 0 ? void 0 : _uppercaseColumns2.toLowerCase()) === 'action') {
|
|
165
|
+
tempNoOfColumnToShow += 1; // for action column
|
|
166
|
+
}
|
|
167
|
+
return uppercaseColumns.length > tempNoOfColumnToShow;
|
|
168
|
+
}, [uppercaseColumns === null || uppercaseColumns === void 0 ? void 0 : uppercaseColumns.length, noOfColumnToShow]);
|
|
169
|
+
return /*#__PURE__*/_react.default.createElement(_styles.MainContainer, null, !cardShow && /*#__PURE__*/_react.default.createElement(_antd.ConfigProvider, {
|
|
170
|
+
theme: {
|
|
171
|
+
components: {
|
|
172
|
+
Table: {
|
|
173
|
+
borderColor: _ColorVariablesMap.default['--color-divider'],
|
|
174
|
+
headerColor: _ColorVariablesMap.default['--color-secondary-content'],
|
|
175
|
+
headerBg: _ColorVariablesMap.default['--color-secondary-background'],
|
|
176
|
+
rowHoverBg: _ColorVariablesMap.default['--color-secondary-background'],
|
|
177
|
+
headerBorderRadius: '0',
|
|
178
|
+
headerSplitColor: _ColorVariablesMap.default['--color-secondary-background'],
|
|
179
|
+
footerColor: _ColorVariablesMap.default['--color-primary-content'],
|
|
180
|
+
cellPaddingBlock: 24,
|
|
181
|
+
cellPaddingBlockMD: 16,
|
|
182
|
+
cellPaddingBlockSM: 12,
|
|
183
|
+
cellPaddingInline: 16,
|
|
184
|
+
cellPaddingInlineMD: 16,
|
|
185
|
+
cellPaddingInlineSM: 16,
|
|
186
|
+
cellFontSize: "".concat(_TypographiesMap.default['type-b2-400']['font-size'], "px"),
|
|
187
|
+
cellFontSizeMD: "".concat(_TypographiesMap.default['type-b2-400']['font-size'], "px"),
|
|
188
|
+
cellFontSizeSM: "".concat(_TypographiesMap.default['type-b2-400']['font-size'], "px"),
|
|
189
|
+
selectionColumnWidth: '54px',
|
|
190
|
+
colorText: _ColorVariablesMap.default['--color-primary-content'],
|
|
191
|
+
rowSelectedHoverBg: _ColorVariablesMap.default['--color-secondary-background']
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
token: {
|
|
195
|
+
controlItemBgActive: _ColorVariablesMap.default['--color-secondary-background']
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}, /*#__PURE__*/_react.default.createElement(_styles.StyledTable, _extends({
|
|
199
|
+
style: _objectSpread(_objectSpread({}, tableStyle), style),
|
|
200
|
+
columns: uppercaseColumns,
|
|
201
|
+
dataSource: dataSource,
|
|
202
|
+
pagination: pagination,
|
|
203
|
+
rowKey: rowKey,
|
|
204
|
+
locale: {
|
|
205
|
+
emptyText
|
|
206
|
+
},
|
|
207
|
+
size: size
|
|
208
|
+
}, antDesignProps, {
|
|
209
|
+
scroll: {
|
|
210
|
+
x: 'max-content'
|
|
211
|
+
}
|
|
212
|
+
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
213
|
+
className: cardShow && dataSource ? 'bottomPadding' : ''
|
|
214
|
+
}, cardShow && dataSource && (dataSource === null || dataSource === void 0 ? void 0 : dataSource.map((row, rowIndex) => {
|
|
215
|
+
var _uppercaseColumns$, _uppercaseColumns3;
|
|
216
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
217
|
+
key: (0, _utils.getUUID)(),
|
|
218
|
+
className: "cardStyles"
|
|
219
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
220
|
+
className: "srDetails"
|
|
221
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
222
|
+
className: "type-t2-700",
|
|
223
|
+
color: "primary-content"
|
|
224
|
+
}, /*#__PURE__*/_react.default.createElement("div", null, uppercaseColumns === null || uppercaseColumns === void 0 || (_uppercaseColumns$ = uppercaseColumns[0]) === null || _uppercaseColumns$ === void 0 ? void 0 : _uppercaseColumns$.title, ":", ' '), getContentToBeRender(uppercaseColumns === null || uppercaseColumns === void 0 ? void 0 : uppercaseColumns[0], row))), uppercaseColumns === null || uppercaseColumns === void 0 ? void 0 : uppercaseColumns.map((column, colIndex) => {
|
|
225
|
+
if (colIndex === 0 || !viewMore.includes(rowIndex) && colIndex > noOfColumnToShow || checkLastElementIsAction(colIndex, uppercaseColumns)) return null;
|
|
226
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
227
|
+
key: (0, _utils.getUUID)(),
|
|
228
|
+
className: "keyValue"
|
|
229
|
+
}, /*#__PURE__*/_react.default.createElement("span", null, column.title), /*#__PURE__*/_react.default.createElement("strong", null, getContentToBeRender(column, row)));
|
|
230
|
+
}), CheckMoreView && /*#__PURE__*/_react.default.createElement("div", {
|
|
231
|
+
className: "showHideBtn"
|
|
232
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
233
|
+
size: "medium",
|
|
234
|
+
type: "text-only",
|
|
235
|
+
label: viewMore.includes(rowIndex) ? 'View Less' : 'View More',
|
|
236
|
+
iconConfig: {
|
|
237
|
+
icon: viewMore.includes(rowIndex) ? /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
238
|
+
icon: _KeyboardArrowUp.default,
|
|
239
|
+
size: 16
|
|
240
|
+
}) : /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
241
|
+
icon: _KeyboardArrowDown.default,
|
|
242
|
+
size: 16
|
|
243
|
+
}),
|
|
244
|
+
position: 'right'
|
|
245
|
+
},
|
|
246
|
+
onClick: () => handleViewMore(rowIndex)
|
|
247
|
+
})), (uppercaseColumns === null || uppercaseColumns === void 0 || (_uppercaseColumns3 = uppercaseColumns[uppercaseColumns.length - 1]) === null || _uppercaseColumns3 === void 0 ? void 0 : _uppercaseColumns3.key) === 'action' && /*#__PURE__*/_react.default.createElement("div", {
|
|
248
|
+
className: "footerCta"
|
|
249
|
+
}, getContentToBeRender(uppercaseColumns === null || uppercaseColumns === void 0 ? void 0 : uppercaseColumns[uppercaseColumns.length - 1], row)));
|
|
250
|
+
}))), cardShow && dataSource && (pagination === null || pagination === void 0 ? void 0 : pagination.showPaginationOnMobile) && /*#__PURE__*/_react.default.createElement("div", {
|
|
251
|
+
className: "fullWidthBtn"
|
|
252
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
253
|
+
"data-test": "button",
|
|
254
|
+
label: "Load More",
|
|
255
|
+
type: "secondary",
|
|
256
|
+
size: "large",
|
|
257
|
+
onClick: () => pagination === null || pagination === void 0 ? void 0 : pagination.onChangeHandlerForMobile()
|
|
258
|
+
})), cardShow && dataSource.length > 0 && onMobilePageChange && showNumberPagination && /*#__PURE__*/_react.default.createElement("div", {
|
|
259
|
+
className: "mobileViewPagination"
|
|
260
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomPagination.default, {
|
|
261
|
+
current: pagination.current,
|
|
262
|
+
pageSize: pagination.pageSize,
|
|
263
|
+
total: pagination.total,
|
|
264
|
+
onChange: page => {
|
|
265
|
+
onMobilePageChange === null || onMobilePageChange === void 0 || onMobilePageChange({
|
|
266
|
+
current: page,
|
|
267
|
+
pageSize: pagination.pageSize
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
})));
|
|
271
|
+
}
|
|
272
|
+
CustomTable.propTypes = {
|
|
273
|
+
columns: _propTypes.default.array,
|
|
274
|
+
dataSource: _propTypes.default.array,
|
|
275
|
+
pagination: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.object]),
|
|
276
|
+
rowKey: _propTypes.default.string,
|
|
277
|
+
size: _propTypes.default.oneOf(['small', 'middle', 'large']),
|
|
278
|
+
style: _propTypes.default.object,
|
|
279
|
+
tableBorder: _propTypes.default.bool,
|
|
280
|
+
emptyText: _propTypes.default.string,
|
|
281
|
+
noOfColumnToShow: _propTypes.default.number,
|
|
282
|
+
defaultCardShow: _propTypes.default.bool,
|
|
283
|
+
onMobilePageChange: _propTypes.default.func,
|
|
284
|
+
showNumberPagination: _propTypes.default.bool
|
|
285
|
+
};
|
|
286
|
+
CustomTable.defaultProps = {
|
|
287
|
+
dataSource: [],
|
|
288
|
+
columns: [],
|
|
289
|
+
pagination: false,
|
|
290
|
+
rowKey: '',
|
|
291
|
+
size: 'middle',
|
|
292
|
+
style: {},
|
|
293
|
+
tableBorder: true,
|
|
294
|
+
emptyText: 'No Data',
|
|
295
|
+
noOfColumnToShow: 5,
|
|
296
|
+
defaultCardShow: false,
|
|
297
|
+
onMobilePageChange: null,
|
|
298
|
+
showNumberPagination: false
|
|
299
|
+
};
|
|
300
|
+
var _default = exports.default = CustomTable;
|