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,355 @@
|
|
|
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.array.includes.js");
|
|
12
|
+
require("core-js/modules/es.string.includes.js");
|
|
13
|
+
require("core-js/modules/es.regexp.exec.js");
|
|
14
|
+
require("core-js/modules/es.regexp.test.js");
|
|
15
|
+
require("core-js/modules/es.promise.js");
|
|
16
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
18
|
+
var _antd = require("antd");
|
|
19
|
+
var _CustomDrawer = _interopRequireDefault(require("../../components/oa-component-drawer/CustomDrawer"));
|
|
20
|
+
var _Typography = _interopRequireDefault(require("../../components/oa-component-typography/Typography"));
|
|
21
|
+
var _CustomTable = _interopRequireDefault(require("../../components/oa-component-table/CustomTable"));
|
|
22
|
+
var _CustomCheckBox = require("../../components/oa-component-checkbox/CustomCheckBox");
|
|
23
|
+
var _CustomInputNumber = _interopRequireDefault(require("../../components/oa-component-input-number/CustomInputNumber"));
|
|
24
|
+
var _CustomInput = _interopRequireDefault(require("../../components/oa-component-input/CustomInput"));
|
|
25
|
+
const _excluded = ["onClose", "onSave", "addedSpareList", "allSpareList", "open"];
|
|
26
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
|
+
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); }
|
|
28
|
+
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; }
|
|
29
|
+
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); }
|
|
30
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
31
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
32
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
33
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
34
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
35
|
+
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; }
|
|
36
|
+
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; }
|
|
37
|
+
/**
|
|
38
|
+
* This component is used to add spare parts to a service order.
|
|
39
|
+
*
|
|
40
|
+
* This component is a drawer that appears on the right side of the screen.
|
|
41
|
+
* It displays a table of all available spare parts.
|
|
42
|
+
* The user can select the spare parts they want to add to the service order by checking the corresponding checkboxes.
|
|
43
|
+
* After selecting the parts, the user can enter the price, discount and hsnId of each part.
|
|
44
|
+
* The user can also cancel the adding of spare parts by clicking the cancel button.
|
|
45
|
+
* After adding the spare parts, the user can save the added spare parts by clicking the save button.
|
|
46
|
+
*
|
|
47
|
+
* @param {{onClose: function, onSave: function, addedSpareList: Array, allSpareList: Array, open: boolean}} props - The props passed to the component.
|
|
48
|
+
* @param {function} props.onClose - The callback function called when the user clicks the cancel button.
|
|
49
|
+
* @param {function} props.onSave - The callback function called when the user clicks the save button.
|
|
50
|
+
* @param {Array} props.addedSpareList - The list of spare parts that have already been added to the service order.
|
|
51
|
+
* @param {Array} props.allSpareList - The list of all available spare parts.
|
|
52
|
+
* @param {boolean} props.open - Whether the drawer is open or not.
|
|
53
|
+
*/
|
|
54
|
+
function AddSparePartWidget(_ref) {
|
|
55
|
+
let {
|
|
56
|
+
onClose,
|
|
57
|
+
onSave,
|
|
58
|
+
addedSpareList,
|
|
59
|
+
allSpareList,
|
|
60
|
+
open
|
|
61
|
+
} = _ref,
|
|
62
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
63
|
+
const [form] = _antd.Form.useForm();
|
|
64
|
+
const [submittable, setSubmittable] = (0, _react.useState)(false);
|
|
65
|
+
const [selectedParts, setSelectedParts] = (0, _react.useState)([]);
|
|
66
|
+
|
|
67
|
+
/*
|
|
68
|
+
Keeping list of IDs of added spare parts as a set, for a quick membership check.
|
|
69
|
+
This will improve performance, since membership checks are required often in the component.
|
|
70
|
+
*/
|
|
71
|
+
const addedSpareIdsList = new Set(addedSpareList.map(addedSpare => addedSpare.scopeId));
|
|
72
|
+
|
|
73
|
+
// Determining which fields are disabled by default.
|
|
74
|
+
(0, _react.useEffect)(() => {
|
|
75
|
+
const newValueForDisabledParts = {};
|
|
76
|
+
allSpareList.forEach(spare => {
|
|
77
|
+
newValueForDisabledParts[spare.scopeId] = false;
|
|
78
|
+
});
|
|
79
|
+
form.resetFields();
|
|
80
|
+
const selectedArray = [];
|
|
81
|
+
addedSpareList.forEach(spare => {
|
|
82
|
+
selectedArray.push(spare.scopeId);
|
|
83
|
+
});
|
|
84
|
+
setSelectedParts(selectedArray);
|
|
85
|
+
}, [addedSpareList, allSpareList]);
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Saves the spare parts selected by the user.
|
|
89
|
+
*
|
|
90
|
+
* This function is called when the user clicks the save button.
|
|
91
|
+
* It validates the form fields, and if there are no errors, it calls the `onSave` callback with the added spare parts.
|
|
92
|
+
* If there are errors, it logs them to the console.
|
|
93
|
+
*
|
|
94
|
+
* @return {void}
|
|
95
|
+
*/
|
|
96
|
+
const handleSave = () => {
|
|
97
|
+
form.validateFields().then(formValues => {
|
|
98
|
+
const formArray = selectedParts
|
|
99
|
+
// Removing the parts that have already been added
|
|
100
|
+
.filter(selectedPart => !addedSpareIdsList.has(selectedPart))
|
|
101
|
+
// Mapping them to the required format.
|
|
102
|
+
.map(selectedPart => ({
|
|
103
|
+
scopeId: selectedPart,
|
|
104
|
+
scopeName: allSpareList.find(spare => spare.scopeId === selectedPart).scopeName,
|
|
105
|
+
cost: formValues["cost-".concat(selectedPart)],
|
|
106
|
+
discount: formValues["discount-".concat(selectedPart)],
|
|
107
|
+
hsnId: formValues["hsnId-".concat(selectedPart)]
|
|
108
|
+
}));
|
|
109
|
+
|
|
110
|
+
// Call to `onSave` callback received from props.
|
|
111
|
+
onSave(formArray);
|
|
112
|
+
}).catch(validationError => {
|
|
113
|
+
console.log(validationError);
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
const dataSource = allSpareList.map(spare => {
|
|
117
|
+
// If the spare is already added, all its fields are disabled.
|
|
118
|
+
if (addedSpareIdsList.has(spare.scopeId)) {
|
|
119
|
+
const partObject = addedSpareList.find(correctSpare => correctSpare.scopeId === spare.scopeId);
|
|
120
|
+
return {
|
|
121
|
+
key: spare.scopeId,
|
|
122
|
+
scopeName: spare.scopeName,
|
|
123
|
+
cost: /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
124
|
+
name: "cost-".concat(spare.scopeId),
|
|
125
|
+
initialValue: partObject === null || partObject === void 0 ? void 0 : partObject.cost
|
|
126
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomInputNumber.default, {
|
|
127
|
+
size: "small",
|
|
128
|
+
prefix: "\u20B9"
|
|
129
|
+
// Setting this input field as disabled, because this part has already been added.
|
|
130
|
+
,
|
|
131
|
+
disabled: true
|
|
132
|
+
})),
|
|
133
|
+
discount: /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
134
|
+
name: "discount-".concat(spare.scopeId),
|
|
135
|
+
initialValue: partObject === null || partObject === void 0 ? void 0 : partObject.discount
|
|
136
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomInputNumber.default, {
|
|
137
|
+
size: "small",
|
|
138
|
+
prefix: "\u20B9"
|
|
139
|
+
// Setting this input field as disabled, because this part has already been added.
|
|
140
|
+
,
|
|
141
|
+
disabled: true
|
|
142
|
+
})),
|
|
143
|
+
hsnId: /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
144
|
+
name: "hsnId-".concat(spare.scopeId),
|
|
145
|
+
initialValue: partObject === null || partObject === void 0 ? void 0 : partObject.hsnId
|
|
146
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomInput.default, {
|
|
147
|
+
size: "small"
|
|
148
|
+
// Setting this input field as disabled, because this part has already been added.
|
|
149
|
+
,
|
|
150
|
+
disabled: true
|
|
151
|
+
}))
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
return {
|
|
155
|
+
key: spare.scopeId,
|
|
156
|
+
scopeName: spare.scopeName,
|
|
157
|
+
cost: /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
158
|
+
name: "cost-".concat(spare.scopeId),
|
|
159
|
+
rules: [{
|
|
160
|
+
// This field is required only if the corresponding part is selected
|
|
161
|
+
required: selectedParts.includes(spare.scopeId),
|
|
162
|
+
message: 'Required field'
|
|
163
|
+
// message: 'Enter the discount value.',
|
|
164
|
+
}],
|
|
165
|
+
initialValue: ""
|
|
166
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomInputNumber.default, {
|
|
167
|
+
size: "small"
|
|
168
|
+
// This field is enabled only if the corresponding part is selected
|
|
169
|
+
,
|
|
170
|
+
disabled: !selectedParts.includes(spare.scopeId),
|
|
171
|
+
prefix: "\u20B9",
|
|
172
|
+
onPaste: e => {
|
|
173
|
+
var _e$clipboardData$getD, _e$clipboardData;
|
|
174
|
+
const pasted = (_e$clipboardData$getD = e === null || e === void 0 || (_e$clipboardData = e.clipboardData) === null || _e$clipboardData === void 0 ? void 0 : _e$clipboardData.getData('Text')) !== null && _e$clipboardData$getD !== void 0 ? _e$clipboardData$getD : '';
|
|
175
|
+
const validDecimalPattern = /^\d+(\.\d*)?$/;
|
|
176
|
+
if (!validDecimalPattern.test(pasted)) {
|
|
177
|
+
e.preventDefault(); // Block invalid paste
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
})),
|
|
181
|
+
discount: /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
182
|
+
name: "discount-".concat(spare.scopeId),
|
|
183
|
+
rules: [{
|
|
184
|
+
required: selectedParts.includes(spare.scopeId),
|
|
185
|
+
message: 'Required field'
|
|
186
|
+
}, {
|
|
187
|
+
validator: (_, value) => {
|
|
188
|
+
const maxDiscount = form.getFieldValue("cost-".concat(spare.scopeId)) || 0;
|
|
189
|
+
if (value > maxDiscount) {
|
|
190
|
+
return Promise.reject(new Error('Discount cannot exceed the Part Price!'));
|
|
191
|
+
}
|
|
192
|
+
return Promise.resolve();
|
|
193
|
+
}
|
|
194
|
+
}],
|
|
195
|
+
initialValue: ""
|
|
196
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomInputNumber.default, {
|
|
197
|
+
size: "small",
|
|
198
|
+
disabled: !selectedParts.includes(spare.scopeId),
|
|
199
|
+
prefix: "\u20B9",
|
|
200
|
+
max: form.getFieldValue("cost-".concat(spare.scopeId)),
|
|
201
|
+
value: form.getFieldValue("discount-".concat(spare.scopeId)),
|
|
202
|
+
onPaste: e => {
|
|
203
|
+
var _e$clipboardData$getD2, _e$clipboardData2;
|
|
204
|
+
const pasted = (_e$clipboardData$getD2 = (_e$clipboardData2 = e.clipboardData) === null || _e$clipboardData2 === void 0 ? void 0 : _e$clipboardData2.getData('Text')) !== null && _e$clipboardData$getD2 !== void 0 ? _e$clipboardData$getD2 : '';
|
|
205
|
+
const validDecimalPattern = /^\d+(\.\d*)?$/;
|
|
206
|
+
if (!validDecimalPattern.test(pasted)) {
|
|
207
|
+
e.preventDefault(); // Block invalid paste
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
onChange: value => {
|
|
211
|
+
const maxDiscount = form.getFieldValue("discount-".concat(spare.scopeId)) || 0;
|
|
212
|
+
if (value > maxDiscount) {
|
|
213
|
+
form.setFieldValue("discount-".concat(spare.scopeId), maxDiscount);
|
|
214
|
+
} else {
|
|
215
|
+
form.setFieldValue("discount-".concat(spare.scopeId), value);
|
|
216
|
+
}
|
|
217
|
+
form.validateFields(["discount-".concat(spare.scopeId)]);
|
|
218
|
+
},
|
|
219
|
+
onBlur: () => {
|
|
220
|
+
// Ensure field is corrected after losing focus
|
|
221
|
+
const value = form.getFieldValue("discount-".concat(spare.scopeId));
|
|
222
|
+
const maxDiscount = form.getFieldValue("cost-".concat(spare.scopeId));
|
|
223
|
+
if (value > maxDiscount) {
|
|
224
|
+
form.setFieldValue("discount-".concat(spare.scopeId), maxDiscount);
|
|
225
|
+
form.validateFields(["discount-".concat(spare.scopeId)]);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
})),
|
|
229
|
+
hsnId: /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
230
|
+
name: "hsnId-".concat(spare.scopeId),
|
|
231
|
+
rules: [{
|
|
232
|
+
// This field is required only if the corresponding part is selected
|
|
233
|
+
required: selectedParts.includes(spare.scopeId),
|
|
234
|
+
message: 'Required field'
|
|
235
|
+
// message: 'Enter the discount value.',
|
|
236
|
+
}],
|
|
237
|
+
initialValue: ""
|
|
238
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomInput.default, {
|
|
239
|
+
size: "small"
|
|
240
|
+
// This field is enabled only if the corresponding part is selected
|
|
241
|
+
,
|
|
242
|
+
disabled: !selectedParts.includes(spare.scopeId)
|
|
243
|
+
}))
|
|
244
|
+
};
|
|
245
|
+
});
|
|
246
|
+
return /*#__PURE__*/_react.default.createElement(_CustomDrawer.default, _extends({
|
|
247
|
+
destroyOnClose: true,
|
|
248
|
+
onClose: onClose,
|
|
249
|
+
open: open,
|
|
250
|
+
placement: "right",
|
|
251
|
+
title: "ADD SPARE PARTS",
|
|
252
|
+
width: "860",
|
|
253
|
+
buttonConfig: [{
|
|
254
|
+
disabled: !submittable,
|
|
255
|
+
callback: handleSave,
|
|
256
|
+
label: 'Save',
|
|
257
|
+
type: 'primary'
|
|
258
|
+
}]
|
|
259
|
+
}, props), /*#__PURE__*/_react.default.createElement(_antd.ConfigProvider, {
|
|
260
|
+
theme: _objectSpread(_objectSpread({}, (0, _CustomCheckBox.getCheckboxTheme)()), {}, {
|
|
261
|
+
components: {
|
|
262
|
+
Form: {
|
|
263
|
+
itemMarginBottom: 0
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
})
|
|
267
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Form, {
|
|
268
|
+
form: form
|
|
269
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomTable.default, {
|
|
270
|
+
size: "middle",
|
|
271
|
+
columns: [{
|
|
272
|
+
title: '',
|
|
273
|
+
dataIndex: 'scopeName',
|
|
274
|
+
key: 'scopeName',
|
|
275
|
+
width: '19%'
|
|
276
|
+
}, {
|
|
277
|
+
title: /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
278
|
+
color: "placeholder-text",
|
|
279
|
+
typography: "type-sl1-700"
|
|
280
|
+
}, "Part price (without gst)"),
|
|
281
|
+
dataIndex: 'cost',
|
|
282
|
+
key: 'cost',
|
|
283
|
+
width: '27%'
|
|
284
|
+
}, {
|
|
285
|
+
title: /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
286
|
+
color: "placeholder-text",
|
|
287
|
+
typography: "type-sl1-700"
|
|
288
|
+
}, "discount (without Gst)"),
|
|
289
|
+
dataIndex: 'discount',
|
|
290
|
+
key: 'discount',
|
|
291
|
+
width: '27%'
|
|
292
|
+
}, {
|
|
293
|
+
title: /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
294
|
+
color: "placeholder-text",
|
|
295
|
+
typography: "type-sl1-700"
|
|
296
|
+
}, "hsn code"),
|
|
297
|
+
dataIndex: 'hsnId',
|
|
298
|
+
key: 'hsnId',
|
|
299
|
+
width: '27%'
|
|
300
|
+
}],
|
|
301
|
+
dataSource: dataSource,
|
|
302
|
+
rowKey: "key",
|
|
303
|
+
pagination: false,
|
|
304
|
+
rowSelection: {
|
|
305
|
+
type: 'checkbox',
|
|
306
|
+
selectedRowKeys: selectedParts,
|
|
307
|
+
onChange: selectedRowKeys => {
|
|
308
|
+
const removedKeys = selectedParts.filter(part => !selectedRowKeys.includes(part));
|
|
309
|
+
removedKeys.forEach(row => {
|
|
310
|
+
form.setFieldValue("hsnId-".concat(row), '');
|
|
311
|
+
form.setFieldValue("discount-".concat(row), '');
|
|
312
|
+
form.setFieldValue("cost-".concat(row), '');
|
|
313
|
+
});
|
|
314
|
+
let submittableFieldPresent = false;
|
|
315
|
+
selectedRowKeys.forEach(selectedPart => {
|
|
316
|
+
// This part is not already added, so it can be submitted.
|
|
317
|
+
if (!addedSpareList.some(addedSpare => addedSpare.scopeId === selectedPart)) {
|
|
318
|
+
submittableFieldPresent = true;
|
|
319
|
+
}
|
|
320
|
+
});
|
|
321
|
+
setSubmittable(submittableFieldPresent);
|
|
322
|
+
setSelectedParts(selectedRowKeys);
|
|
323
|
+
},
|
|
324
|
+
getCheckboxProps: record => ({
|
|
325
|
+
disabled: addedSpareList.some(spare => spare.scopeId === record.key),
|
|
326
|
+
scopeName: record.scopeName
|
|
327
|
+
})
|
|
328
|
+
}
|
|
329
|
+
// scroll={{
|
|
330
|
+
// y: '100%',
|
|
331
|
+
// }}
|
|
332
|
+
}))));
|
|
333
|
+
}
|
|
334
|
+
AddSparePartWidget.propTypes = {
|
|
335
|
+
onClose: _propTypes.default.func.isRequired,
|
|
336
|
+
onSave: _propTypes.default.func.isRequired,
|
|
337
|
+
open: _propTypes.default.bool,
|
|
338
|
+
addedSpareList: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
339
|
+
scopeId: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
340
|
+
scopeName: _propTypes.default.string,
|
|
341
|
+
discount: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
342
|
+
cost: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
343
|
+
hsnId: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number])
|
|
344
|
+
})),
|
|
345
|
+
allSpareList: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
346
|
+
scopeName: _propTypes.default.string.isRequired,
|
|
347
|
+
scopeId: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]).isRequired
|
|
348
|
+
}))
|
|
349
|
+
};
|
|
350
|
+
AddSparePartWidget.defaultProps = {
|
|
351
|
+
addedSpareList: [],
|
|
352
|
+
allSpareList: [],
|
|
353
|
+
open: true
|
|
354
|
+
};
|
|
355
|
+
var _default = exports.default = AddSparePartWidget;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.StickyInfo = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
+
var _templateObject;
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
11
|
+
var _default = exports.default = {};
|
|
12
|
+
const StickyInfo = exports.StickyInfo = _styledComponents.default.section(_templateObject || (_templateObject = _taggedTemplateLiteral(["\nposition: absolute;\nbottom: 80px;\nright: 0;\nleft: 0;\npadding: 0 24px;\n"])));
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = AddressWidget;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
var _Typography = _interopRequireDefault(require("../../components/oa-component-typography/Typography"));
|
|
10
|
+
var _styles = require("./styles");
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
/**
|
|
13
|
+
* AddressWidget component displays the address details.
|
|
14
|
+
*
|
|
15
|
+
* @param {object} address - The address object containing address details.
|
|
16
|
+
*/
|
|
17
|
+
function AddressWidget(_ref) {
|
|
18
|
+
let {
|
|
19
|
+
address
|
|
20
|
+
} = _ref;
|
|
21
|
+
const {
|
|
22
|
+
heading,
|
|
23
|
+
addressLine1,
|
|
24
|
+
addressLine2,
|
|
25
|
+
landmark,
|
|
26
|
+
city,
|
|
27
|
+
pincode
|
|
28
|
+
} = address !== null && address !== void 0 ? address : {};
|
|
29
|
+
return /*#__PURE__*/_react.default.createElement(_styles.AddressContainer, null, heading && /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
30
|
+
typography: "type-b2-400"
|
|
31
|
+
}, heading), /*#__PURE__*/_react.default.createElement(_styles.AddressLines, null, addressLine1 && /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
32
|
+
color: "secondary-content",
|
|
33
|
+
typography: "type-b2-400"
|
|
34
|
+
}, address.addressLine1, ","), /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
35
|
+
color: "secondary-content",
|
|
36
|
+
typography: "type-b2-400"
|
|
37
|
+
}, addressLine2 ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, addressLine2, ",", ' ') : null, landmark ? "".concat(landmark, ", ") : null, city ? "".concat(city, ", ") : null, pincode || null)));
|
|
38
|
+
}
|
|
39
|
+
AddressWidget.propTypes = {
|
|
40
|
+
address: _propTypes.default.shape({
|
|
41
|
+
heading: _propTypes.default.string,
|
|
42
|
+
addressLine1: _propTypes.default.string,
|
|
43
|
+
addressLine2: _propTypes.default.string,
|
|
44
|
+
addressLine3: _propTypes.default.string,
|
|
45
|
+
landmark: _propTypes.default.string,
|
|
46
|
+
pincode: _propTypes.default.string || _propTypes.default.number,
|
|
47
|
+
city: _propTypes.default.string,
|
|
48
|
+
state: _propTypes.default.string,
|
|
49
|
+
type: _propTypes.default.oneOf(['permanent', 'temporary']),
|
|
50
|
+
additional_info: _propTypes.default.shape({
|
|
51
|
+
lat: _propTypes.default.string,
|
|
52
|
+
long: _propTypes.default.string
|
|
53
|
+
})
|
|
54
|
+
}).isRequired
|
|
55
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.AddressLines = exports.AddressContainer = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
+
var _templateObject, _templateObject2;
|
|
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
|
+
var _default = exports.default = {};
|
|
12
|
+
const AddressContainer = exports.AddressContainer = _styledComponents.default.section(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n gap: 12px; \n width: 100%\n"])));
|
|
13
|
+
const AddressLines = exports.AddressLines = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n"])));
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.assign.js");
|
|
4
|
+
require("core-js/modules/es.weak-map.js");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
require("core-js/modules/es.symbol.description.js");
|
|
10
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
var _antd = require("antd");
|
|
14
|
+
var _UploadDownloadWidget = _interopRequireDefault(require("../oa-widget-upload-download/UploadDownloadWidget"));
|
|
15
|
+
var _styles = require("./styles");
|
|
16
|
+
var _CustomRadio = _interopRequireDefault(require("../../components/oa-component-radio/CustomRadio"));
|
|
17
|
+
var _Typography = _interopRequireDefault(require("../../components/oa-component-typography/Typography"));
|
|
18
|
+
var _CustomButton = _interopRequireDefault(require("../../components/oa-component-button/CustomButton"));
|
|
19
|
+
const _excluded = ["children", "description", "docDetails", "approvalForm", "isMandatory", "hasDivider", "isQuestionStyleWidget", "questionId", "title", "viewOnClick", "data-test", "maxLength"];
|
|
20
|
+
/* eslint-disable */
|
|
21
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
22
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
23
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
24
|
+
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); }
|
|
25
|
+
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; }
|
|
26
|
+
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; }
|
|
27
|
+
/**
|
|
28
|
+
* @typedef {import('../../components/oa-component-upload/CustomUpload').DocumentDetails} DocumentDetails
|
|
29
|
+
*
|
|
30
|
+
* @typedef {Object} ApprovalForm
|
|
31
|
+
* @property {boolean} [disabled=false] Whether the approval form is disabled.
|
|
32
|
+
* @property {boolean} [hidden=false] Whether the approval form is hidden.
|
|
33
|
+
* @property {boolean} [invisible=false] Whether the approval form is invisible (preserving layout).
|
|
34
|
+
* @property {boolean} [isApproved] Initial value for the approval status.
|
|
35
|
+
* @property {string} [remarks] Initial value for the remarks.
|
|
36
|
+
*
|
|
37
|
+
* @typedef {Object} Props
|
|
38
|
+
* @property {React.ReactNode} [children] Content to be rendered inside the ApprovalWidget.
|
|
39
|
+
* @property {string} [description] Description for the widget.
|
|
40
|
+
* @property {DocumentDetails} [docDetails] Document details for the widget.
|
|
41
|
+
* @property {ApprovalForm} [approvalForm] Form data for approval.
|
|
42
|
+
* @property {boolean} [isMandatory=false] Whether the widget is mandatory.
|
|
43
|
+
* @property {boolean} [hasDivider=false] Display a divider line beneath the widget.
|
|
44
|
+
* @property {boolean} [isQuestionStyleWidget=false] Whether the widget has a question-style layout.
|
|
45
|
+
* @property {string|number} questionId Identifier for the question.
|
|
46
|
+
* @property {string} title Title of the widget.
|
|
47
|
+
* @property {Function} [viewOnClick] Callback function for the view action.
|
|
48
|
+
* @property {string} ['data-test'] Data test string to be applied to the outermost element.
|
|
49
|
+
*/
|
|
50
|
+
function ApprovalWidget(_ref) {
|
|
51
|
+
var _approvalForm$disable, _approvalForm$disable2, _approvalForm$disable3, _approvalForm$remarks, _approvalForm$disable4;
|
|
52
|
+
let {
|
|
53
|
+
children,
|
|
54
|
+
description,
|
|
55
|
+
docDetails,
|
|
56
|
+
approvalForm,
|
|
57
|
+
isMandatory,
|
|
58
|
+
hasDivider,
|
|
59
|
+
isQuestionStyleWidget,
|
|
60
|
+
questionId,
|
|
61
|
+
title,
|
|
62
|
+
viewOnClick,
|
|
63
|
+
"data-test": dataTest,
|
|
64
|
+
maxLength
|
|
65
|
+
} = _ref,
|
|
66
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
67
|
+
console.log(maxLength, "maxLength2");
|
|
68
|
+
const getInitialValue = isApproved => {
|
|
69
|
+
switch (isApproved) {
|
|
70
|
+
case true:
|
|
71
|
+
return 1;
|
|
72
|
+
case false:
|
|
73
|
+
return 0;
|
|
74
|
+
default:
|
|
75
|
+
return undefined;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
const [isApproved, setIsApproved] = (0, _react.useState)(getInitialValue(approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.isApproved));
|
|
79
|
+
const onRadioChange = event => setIsApproved(event.target.value);
|
|
80
|
+
return /*#__PURE__*/_react.default.createElement(_styles.StyledContainer, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
81
|
+
className: "row"
|
|
82
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
83
|
+
className: approvalForm.hidden ? "col-sm-12 col-md-12 col-lg-12" : "col-sm-12 col-md-7 col-lg-7 gutter"
|
|
84
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
85
|
+
className: "row"
|
|
86
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
87
|
+
className: isQuestionStyleWidget ? "col-sm-12 col-md-12 col-lg-12" : "col-sm-12 col-md-8 col-lg-8 gutter"
|
|
88
|
+
}, title && /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("h4", {
|
|
89
|
+
className: "type-b2-400"
|
|
90
|
+
}, title, isMandatory && /*#__PURE__*/_react.default.createElement(_styles.RedText, null, "*"))), description && /*#__PURE__*/_react.default.createElement(_styles.Styledescription, null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
91
|
+
typography: "type-b2-400",
|
|
92
|
+
color: "secondary-content"
|
|
93
|
+
}, description)), viewOnClick && /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
94
|
+
className: "view-button",
|
|
95
|
+
"data-test": dataTest ? "".concat(dataTest, "--view-button") : undefined,
|
|
96
|
+
onClick: () => viewOnClick(questionId),
|
|
97
|
+
type: "text-only",
|
|
98
|
+
label: isQuestionStyleWidget ? "View Previous Description" : "View History"
|
|
99
|
+
}), children)), !isQuestionStyleWidget && /*#__PURE__*/_react.default.createElement("div", {
|
|
100
|
+
className: "col-sm-12 col-md-4 col-lg-4"
|
|
101
|
+
}, /*#__PURE__*/_react.default.createElement(_UploadDownloadWidget.default, _extends({
|
|
102
|
+
disabled: (_approvalForm$disable = approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.disabled) !== null && _approvalForm$disable !== void 0 ? _approvalForm$disable : false,
|
|
103
|
+
"data-test": dataTest ? "".concat(dataTest, "--upload-download-widget") : undefined
|
|
104
|
+
}, docDetails, {
|
|
105
|
+
formName: isMandatory ? "file-".concat(questionId) : undefined
|
|
106
|
+
}))))), approvalForm.invisible && /*#__PURE__*/_react.default.createElement("div", {
|
|
107
|
+
className: "col-sm-12 col-md-5 col-lg-5"
|
|
108
|
+
}) || !approvalForm.hidden && /*#__PURE__*/_react.default.createElement("div", {
|
|
109
|
+
className: "col-sm-12 col-md-5 col-lg-5"
|
|
110
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
111
|
+
name: "isApproved-".concat(questionId),
|
|
112
|
+
className: "custom-radio-group",
|
|
113
|
+
initialValue: isApproved,
|
|
114
|
+
rules: [{
|
|
115
|
+
required: true,
|
|
116
|
+
message: dataTest ? /*#__PURE__*/_react.default.createElement("span", {
|
|
117
|
+
"data-test": "".concat(dataTest, "--is-approved-validation-message")
|
|
118
|
+
}, "Approval status needs to be selected.") : "Approval status needs to be selected."
|
|
119
|
+
}]
|
|
120
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomRadio.default.Group, {
|
|
121
|
+
"data-test": dataTest ? "".concat(dataTest, "--is-approved-radio-group") : undefined,
|
|
122
|
+
onChange: onRadioChange,
|
|
123
|
+
value: isApproved
|
|
124
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomRadio.default, {
|
|
125
|
+
"data-test": dataTest ? "".concat(dataTest, "--is-approved-radio-yes") : undefined,
|
|
126
|
+
disabled: (_approvalForm$disable2 = approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.disabled) !== null && _approvalForm$disable2 !== void 0 ? _approvalForm$disable2 : false,
|
|
127
|
+
label: "Mark as Approved",
|
|
128
|
+
value: 1
|
|
129
|
+
}), /*#__PURE__*/_react.default.createElement(_CustomRadio.default, {
|
|
130
|
+
"data-test": dataTest ? "".concat(dataTest, "--is-approved-radio-no") : undefined,
|
|
131
|
+
disabled: (_approvalForm$disable3 = approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.disabled) !== null && _approvalForm$disable3 !== void 0 ? _approvalForm$disable3 : false,
|
|
132
|
+
label: "Mark as Pending",
|
|
133
|
+
value: 0
|
|
134
|
+
}))), isApproved === 0 && /*#__PURE__*/_react.default.createElement("section", null, /*#__PURE__*/_react.default.createElement("h5", {
|
|
135
|
+
className: "type-b2-400"
|
|
136
|
+
}, "Remarks"), /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
137
|
+
name: "remarks-".concat(questionId),
|
|
138
|
+
initialValue: (_approvalForm$remarks = approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.remarks) !== null && _approvalForm$remarks !== void 0 ? _approvalForm$remarks : "",
|
|
139
|
+
rules: [{
|
|
140
|
+
required: true,
|
|
141
|
+
message: dataTest ? /*#__PURE__*/_react.default.createElement("span", {
|
|
142
|
+
"data-test": "".concat(dataTest, "--remarks-validation-message")
|
|
143
|
+
}, "Remarks cannot be empty.") : "Remarks cannot be empty."
|
|
144
|
+
}, maxLength && {
|
|
145
|
+
max: maxLength,
|
|
146
|
+
message: dataTest ? /*#__PURE__*/_react.default.createElement("span", {
|
|
147
|
+
"data-test": "".concat(dataTest, "--remarks-maxlength-validation-message")
|
|
148
|
+
}, "Remarks cannot exceed ".concat(maxLength, " characters.")) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "Remarks cannot exceed ".concat(maxLength, " characters."))
|
|
149
|
+
}]
|
|
150
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Input.TextArea, {
|
|
151
|
+
"data-test": dataTest ? "".concat(dataTest, "--remarks") : undefined,
|
|
152
|
+
disabled: (_approvalForm$disable4 = approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.disabled) !== null && _approvalForm$disable4 !== void 0 ? _approvalForm$disable4 : false
|
|
153
|
+
})))) || undefined), hasDivider && /*#__PURE__*/_react.default.createElement(_antd.Divider, null));
|
|
154
|
+
}
|
|
155
|
+
ApprovalWidget.propTypes = {
|
|
156
|
+
children: _propTypes.default.node,
|
|
157
|
+
"data-test": _propTypes.default.string,
|
|
158
|
+
description: _propTypes.default.string,
|
|
159
|
+
// Leave description optional
|
|
160
|
+
docDetails: _propTypes.default.shape({
|
|
161
|
+
multiple: _propTypes.default.bool,
|
|
162
|
+
onUpload: _propTypes.default.func,
|
|
163
|
+
uploadedDocuments: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
164
|
+
name: _propTypes.default.string,
|
|
165
|
+
onDelete: _propTypes.default.func,
|
|
166
|
+
onDownload: _propTypes.default.func
|
|
167
|
+
}))
|
|
168
|
+
}),
|
|
169
|
+
hasDivider: _propTypes.default.bool,
|
|
170
|
+
// Leave hasDivider optional,
|
|
171
|
+
approvalForm: _propTypes.default.shape({
|
|
172
|
+
disabled: _propTypes.default.bool,
|
|
173
|
+
hidden: _propTypes.default.bool,
|
|
174
|
+
invisible: _propTypes.default.bool,
|
|
175
|
+
isApproved: _propTypes.default.bool,
|
|
176
|
+
remarks: _propTypes.default.string
|
|
177
|
+
}),
|
|
178
|
+
isMandatory: _propTypes.default.bool,
|
|
179
|
+
isQuestionStyleWidget: _propTypes.default.bool,
|
|
180
|
+
questionId: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]).isRequired,
|
|
181
|
+
title: _propTypes.default.string.isRequired,
|
|
182
|
+
// Make title required
|
|
183
|
+
viewOnClick: _propTypes.default.func
|
|
184
|
+
};
|
|
185
|
+
ApprovalWidget.defaultProps = {
|
|
186
|
+
children: null,
|
|
187
|
+
"data-test": null,
|
|
188
|
+
description: "",
|
|
189
|
+
docDetails: {},
|
|
190
|
+
approvalForm: {
|
|
191
|
+
disabled: false,
|
|
192
|
+
hidden: false,
|
|
193
|
+
invisible: false
|
|
194
|
+
},
|
|
195
|
+
isMandatory: false,
|
|
196
|
+
hasDivider: false,
|
|
197
|
+
isQuestionStyleWidget: false,
|
|
198
|
+
viewOnClick: null
|
|
199
|
+
};
|
|
200
|
+
var _default = exports.default = ApprovalWidget;
|