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,178 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.weak-map.js");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
require("core-js/modules/es.promise.js");
|
|
9
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
|
+
var _icons = require("@ant-design/icons");
|
|
13
|
+
var _antd = require("antd");
|
|
14
|
+
var _CustomInfo = _interopRequireDefault(require("../../components/oa-component-info/CustomInfo"));
|
|
15
|
+
var _Typography = _interopRequireDefault(require("../../components/oa-component-typography/Typography"));
|
|
16
|
+
var _ColorVariablesMap = _interopRequireDefault(require("../../global-css/ColorVariablesMap"));
|
|
17
|
+
var _styles = require("./styles");
|
|
18
|
+
var _PdfSampleImage = _interopRequireDefault(require("../../images/PdfSampleImage.png"));
|
|
19
|
+
var _upload = _interopRequireDefault(require("../../images/upload.svg"));
|
|
20
|
+
var _CustomIcon = _interopRequireDefault(require("../../components/oa-component-icons/CustomIcon"));
|
|
21
|
+
var _CustomUpload = _interopRequireDefault(require("../../components/oa-component-upload/CustomUpload"));
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
24
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
25
|
+
/**
|
|
26
|
+
* Takes a file and returns a Promise that resolves with the file as a base64 encoded string.
|
|
27
|
+
* The Promise is rejected if there is an error reading the file.
|
|
28
|
+
* @param {File} file The file to be converted to base64
|
|
29
|
+
* @returns {Promise<string>} A Promise that resolves with the file as a base64 encoded string
|
|
30
|
+
*/
|
|
31
|
+
const getBase64 = file => new Promise((resolve, reject) => {
|
|
32
|
+
const reader = new FileReader();
|
|
33
|
+
reader.readAsDataURL(file);
|
|
34
|
+
reader.onload = () => resolve(reader.result);
|
|
35
|
+
reader.onerror = error => reject(error);
|
|
36
|
+
});
|
|
37
|
+
/**
|
|
38
|
+
* Downloads a file from a base64 encoded string.
|
|
39
|
+
* @param {string} base64String The base64 encoded string of the file to be downloaded
|
|
40
|
+
* @param {string} [fileName] The name of the file to be downloaded. If not provided, the file will be downloaded with the name 'download'.
|
|
41
|
+
* @returns {undefined}
|
|
42
|
+
*/
|
|
43
|
+
const downloadFile = (base64String, fileName) => {
|
|
44
|
+
const link = document.createElement('a');
|
|
45
|
+
link.href = base64String;
|
|
46
|
+
link.download = fileName || 'download';
|
|
47
|
+
link.click();
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* A component that allows users to upload documents.
|
|
52
|
+
* The component displays the uploaded documents in a list.
|
|
53
|
+
* The component also allows users to delete the uploaded documents.
|
|
54
|
+
* @param {object} props The props passed to the component
|
|
55
|
+
* @param {array} [props.uploadedDocuments=[]] An array of documents that have already been uploaded
|
|
56
|
+
* @param {function} props.onChange A function that is called whenever the list of uploaded documents changes
|
|
57
|
+
* @param {number} [props.multipleDoc=0] The maximum number of documents that can be uploaded. If set to 0, there is no limit
|
|
58
|
+
* @param {boolean} [props.showDelete=false] Whether or not to show a delete button next to each uploaded document
|
|
59
|
+
* @param {string} [props.subText] A string that is displayed below the heading
|
|
60
|
+
* @param {string} [props.heading] A string that is displayed above the upload button
|
|
61
|
+
* @param {string} [props.formName] The name of the form field that the uploaded documents should be associated with
|
|
62
|
+
* @param {function} [props.getPreview] A function that is called whenever the user clicks on an uploaded document. It should return a Promise that resolves with the URL of the document
|
|
63
|
+
* @param {string} [props.infoText] A string that is displayed below the subText
|
|
64
|
+
* @param {boolean} [props.isMandatory=false] Whether or not the component is mandatory
|
|
65
|
+
* @returns {object} A React component
|
|
66
|
+
*/
|
|
67
|
+
function DocumentUploadCard(props) {
|
|
68
|
+
const {
|
|
69
|
+
uploadedDocuments = [],
|
|
70
|
+
onChange,
|
|
71
|
+
multipleDoc,
|
|
72
|
+
showDelete,
|
|
73
|
+
subText,
|
|
74
|
+
heading,
|
|
75
|
+
formName,
|
|
76
|
+
getPreview,
|
|
77
|
+
infoText,
|
|
78
|
+
isMandatory
|
|
79
|
+
} = props;
|
|
80
|
+
const [previewOpen, setPreviewOpen] = (0, _react.useState)(false);
|
|
81
|
+
const [previewImage, setPreviewImage] = (0, _react.useState)(null);
|
|
82
|
+
const [previewTitle, setPreviewTitle] = (0, _react.useState)('');
|
|
83
|
+
const [loading, setLoading] = (0, _react.useState)(false);
|
|
84
|
+
const [fileList, setFileList] = (0, _react.useState)(uploadedDocuments);
|
|
85
|
+
const handleCancel = () => setPreviewOpen(false);
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Determines if the given file is an image file based on its file extension.
|
|
89
|
+
* @param {string} fileName The name of the file to check
|
|
90
|
+
* @returns {boolean} Whether or not the file is an image file
|
|
91
|
+
*/
|
|
92
|
+
function isImageFile(fileName) {
|
|
93
|
+
var _fileName$split;
|
|
94
|
+
// Extract the file extension from the file name
|
|
95
|
+
const fileExtension = fileName === null || fileName === void 0 || (_fileName$split = fileName.split('.')) === null || _fileName$split === void 0 || (_fileName$split = _fileName$split.pop()) === null || _fileName$split === void 0 ? void 0 : _fileName$split.toLowerCase();
|
|
96
|
+
|
|
97
|
+
// Define an array of image file extensions
|
|
98
|
+
const imageFileExtensions = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'tiff', 'svg'];
|
|
99
|
+
|
|
100
|
+
// Check if the file extension is in the array of image file extensions
|
|
101
|
+
if (imageFileExtensions.indexOf(fileExtension) !== -1) {
|
|
102
|
+
return true;
|
|
103
|
+
}
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
(0, _react.useEffect)(() => {
|
|
107
|
+
setFileList(uploadedDocuments);
|
|
108
|
+
}, [uploadedDocuments === null || uploadedDocuments === void 0 ? void 0 : uploadedDocuments.length]);
|
|
109
|
+
const uploadButton = /*#__PURE__*/_react.default.createElement("button", {
|
|
110
|
+
style: {
|
|
111
|
+
border: 0,
|
|
112
|
+
background: 'none'
|
|
113
|
+
},
|
|
114
|
+
type: "button"
|
|
115
|
+
}, loading ? /*#__PURE__*/_react.default.createElement(_icons.LoadingOutlined, null) : /*#__PURE__*/_react.default.createElement(_CustomIcon.default, {
|
|
116
|
+
className: "UploadImg",
|
|
117
|
+
alt: "phone img",
|
|
118
|
+
src: _upload.default
|
|
119
|
+
}), /*#__PURE__*/_react.default.createElement("div", null, "Upload"));
|
|
120
|
+
return /*#__PURE__*/_react.default.createElement(_styles.MainStyleSec, null, /*#__PURE__*/_react.default.createElement(_styles.StyledSection, null, (heading || subText) && /*#__PURE__*/_react.default.createElement("div", {
|
|
121
|
+
className: "uploadSecPad"
|
|
122
|
+
}, heading && /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
123
|
+
color: "primary-content",
|
|
124
|
+
className: "type-t2-700"
|
|
125
|
+
}, heading, isMandatory && /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
126
|
+
color: "negative"
|
|
127
|
+
}, " *"))), subText && /*#__PURE__*/_react.default.createElement("div", {
|
|
128
|
+
style: {
|
|
129
|
+
whiteSpace: 'pre-line'
|
|
130
|
+
}
|
|
131
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
132
|
+
color: "secondary-content",
|
|
133
|
+
className: "type-b2-400"
|
|
134
|
+
}, subText)), infoText && /*#__PURE__*/_react.default.createElement(_CustomInfo.default, {
|
|
135
|
+
color: "background-warning",
|
|
136
|
+
description: infoText
|
|
137
|
+
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
138
|
+
className: "uploadDiv "
|
|
139
|
+
}, multipleDoc > 0 && /*#__PURE__*/_react.default.createElement("em", null, multipleDoc), /*#__PURE__*/_react.default.createElement(_antd.ConfigProvider, {
|
|
140
|
+
theme: {
|
|
141
|
+
token: {
|
|
142
|
+
colorBorder: _ColorVariablesMap.default['--color-divider'],
|
|
143
|
+
borderRadiusLG: 4,
|
|
144
|
+
colorPrimaryHover: _ColorVariablesMap.default['--color-primary'],
|
|
145
|
+
colorPrimaryBorder: _ColorVariablesMap.default['--color-divider'],
|
|
146
|
+
colorFillAlter: _ColorVariablesMap.default['--color-secondary-background'],
|
|
147
|
+
colorError: _ColorVariablesMap.default['--color-negative'],
|
|
148
|
+
colorText: _ColorVariablesMap.default['--color-secondary-content']
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomUpload.default, props)))));
|
|
152
|
+
}
|
|
153
|
+
DocumentUploadCard.propTypes = {
|
|
154
|
+
uploadedDocuments: _propTypes.default.array,
|
|
155
|
+
onChange: _propTypes.default.func,
|
|
156
|
+
subText: _propTypes.default.string,
|
|
157
|
+
heading: _propTypes.default.string,
|
|
158
|
+
formName: _propTypes.default.string,
|
|
159
|
+
infoText: _propTypes.default.string,
|
|
160
|
+
showDelete: _propTypes.default.bool,
|
|
161
|
+
multipleDoc: _propTypes.default.number,
|
|
162
|
+
getPreview: _propTypes.default.func,
|
|
163
|
+
// Define the getPreview prop type
|
|
164
|
+
isMandatory: _propTypes.default.bool
|
|
165
|
+
};
|
|
166
|
+
DocumentUploadCard.defaultProps = {
|
|
167
|
+
uploadedDocuments: [],
|
|
168
|
+
onChange: () => {},
|
|
169
|
+
subText: '',
|
|
170
|
+
heading: '',
|
|
171
|
+
formName: '',
|
|
172
|
+
infoText: '',
|
|
173
|
+
multipleDoc: 0,
|
|
174
|
+
showDelete: true,
|
|
175
|
+
getPreview: () => {},
|
|
176
|
+
isMandatory: true
|
|
177
|
+
};
|
|
178
|
+
var _default = exports.default = DocumentUploadCard;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.StyledSection = exports.MainStyleSec = void 0;
|
|
7
|
+
var _antd = require("antd");
|
|
8
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
|
+
var _templateObject, _templateObject2;
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
12
|
+
const MainStyleSec = exports.MainStyleSec = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n.ant-form-item{\n margin-bottom: 0;\n}\n.ant-upload button{\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 4px;\n} \n.uploadDiv{\n width: 96px;\n position: relative;\n}\n.uploadDiv em{\n position: absolute;\n right: -9px;\n top: -9px;\n font-style: normal;\n width: 20px;\n height: 20px;\n background: var(--color-warning);\n z-index: 9;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n color: #fff;\n font-size: 12px;\n line-height: 0;\n}\n.UploadImg img{\n height: 24px;\n width: 24px;\n\n}\n.UploadImg{\n justify-content: center;\n cursor: pointer;\n}\n.uploadSecPad div{\n padding: 0 0 8px;\n}\n.anticon-upload{\n font-size: 24px;\n}\n.uploadSecPad{\n width: 100%;\n}\n.uploadSecPad div:last-child{\n padding: 0;\n}\n display: flex;\n flex-direction: column;\n gap: 24px;\n .ant-upload-list-item-done,.ant-upload-list-item-A{\n border: 1px solid var(--color-divider) !important;\n }\n .ant-upload-wrapper.ant-upload-picture-card-wrapper .ant-upload-list.ant-upload-list-picture-card .ant-upload-list-item:hover::before{\n opacity: 1 !important;\n }\n .ant-upload-wrapper.ant-upload-picture-card-wrapper .ant-upload-list.ant-upload-list-picture-card .ant-upload-list-item:hover::before ant-upload-list-item-actions > a\n {\n background: red !important;\n }\n .ant-upload-list-item-actions{\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 16px;\n }\n .ant-upload-wrapper.ant-upload-picture-card-wrapper .ant-upload-list.ant-upload-list-picture-card .ant-upload-list-item::before{\n background: transparent;\n opacity: 1;\n }\n.ant-upload-list-item-actions button{\n background: #212121;\n border-radius: 50px;\n height: 24px !important;\n display: flex;\n align-items: center;\n}\n.ant-btn-text:not(:disabled):not(.ant-btn-disabled):hover{\n background: #212121;\n}\n .ant-upload-list-item-actions a{\n background: #212121;\n border-radius: 50px;\n height: 24px;\n display: flex;\n }\n .ant-upload-wrapper.ant-upload-picture-card-wrapper .ant-upload-list.ant-upload-list-picture-card .ant-upload-list-item-actions,.ant-upload-wrapper .ant-upload-list .ant-upload-list-item .ant-upload-list-item-actions .ant-upload-list-item-action {\n opacity: 1;\n }\n .ant-upload-wrapper .ant-upload-list.ant-upload-list-picture-card .ant-upload-list-item{\n opacity: 1 !important;\n }\n .ant-upload-wrapper.ant-upload-picture-card-wrapper .ant-upload-list.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-eye,.ant-upload-wrapper.ant-upload-picture-card-wrapper .ant-upload-list.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-delete{\n color: #fff;\n }\n @media only screen and (max-width: 600px) {\n .uploadDiv {\n width: 64px;\n }\n .uploadDiv em{\n width: 16px;\n height: 16px;\n }\n }\n"])));
|
|
13
|
+
const StyledSection = exports.StyledSection = _styledComponents.default.section(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n gap: 16px;\n justify-content: space-between;\n h2{\n margin: 0;\n }\n .ant-upload-select, .ant-upload-wrapper, .ant-upload-wrapper, .ant-upload-wrapper.ant-upload-picture-card-wrapper .ant-upload-list.ant-upload-list-picture-card .ant-upload-list-item-container{\n width: 96px;\n height: 96px;\n margin: 0;\n }\n .ant-upload-wrapper.ant-upload-picture-card-wrapper .ant-upload.ant-upload-select{\n width: 96px !important;\n height: 96px !important;\n margin: 0;\n }\n @media only screen and (max-width: 600px) {\n .ant-upload-select, .ant-upload-wrapper, .ant-upload-wrapper, .ant-upload-wrapper.ant-upload-picture-card-wrapper .ant-upload-list.ant-upload-list-picture-card .ant-upload-list-item-container{\n width: 64px;\n height: 64px;\n }\n .ant-upload-wrapper.ant-upload-picture-card-wrapper .ant-upload.ant-upload-select{\n width: 64px !important;\n height: 64px !important;\n }\n .ant-upload-wrapper.ant-upload-picture-card-wrapper .ant-upload-list.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-eye,.ant-upload-wrapper.ant-upload-picture-card-wrapper .ant-upload-list.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-delete{\n font-size:12px;\n margin: 0 !important;\n padding: 0 !important;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n .ant-upload-list-item-actions button {\n height: 16px!important;\n width: 16px !important;\n justify-content: center;\n }\n .ant-upload-list-item-actions a {\n height: 16px;\n width: 16px !important;\n align-items: center;\n justify-content: center;\n}\n .ant-upload-list-item-actions {\n gap: 8px;\n }\n .ant-upload button span + div{\n display: none;\n }\n }\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/web.dom-collections.iterator.js");
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
|
+
var _antd = require("antd");
|
|
13
|
+
var _KeyboardArrowDownOutlined = _interopRequireDefault(require("@material-ui/icons/KeyboardArrowDownOutlined"));
|
|
14
|
+
var _styles = require("./styles");
|
|
15
|
+
var _CustomInput = _interopRequireDefault(require("../../components/oa-component-input/CustomInput"));
|
|
16
|
+
const _excluded = ["options", "onOptionChange", "onInputChange", "onPressEnter", "onClear", "inputValue", "placeholder", "allowClear", "selectedOption"];
|
|
17
|
+
/* eslint-disable */
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
20
|
+
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; }
|
|
21
|
+
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); }
|
|
22
|
+
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; }
|
|
23
|
+
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; }
|
|
24
|
+
/**
|
|
25
|
+
* A dropdown search input component.
|
|
26
|
+
*
|
|
27
|
+
* @param {array} options - An array of objects, each with the following structure:
|
|
28
|
+
* - `label`: The label to be displayed in the dropdown menu.
|
|
29
|
+
* - `value`: The value of the option.
|
|
30
|
+
* - `icon`: The icon to be displayed next to the label in the dropdown menu.
|
|
31
|
+
* - `placeholder`: The placeholder text to be displayed in the search input.
|
|
32
|
+
* @param {function} onOptionChange - A callback to be called when an option is selected from the dropdown menu.
|
|
33
|
+
* - It is called with the selected option as an argument.
|
|
34
|
+
* @param {function} onInputChange - A callback to be called when the search input value changes.
|
|
35
|
+
* - It is called with the event as an argument.
|
|
36
|
+
* @param {function} onPressEnter - A callback to be called when the enter key is pressed in the search input.
|
|
37
|
+
* - It is called with the event as an argument.
|
|
38
|
+
* @param {string} inputValue - The initial value of the search input.
|
|
39
|
+
* @param {string} placeholder - The placeholder text to be displayed in the search input.
|
|
40
|
+
* @param {string} selectedOption - The currently selected option value from parent state.
|
|
41
|
+
* @param {object} props - Additional props to be passed to the underlying `CustomInput` component.
|
|
42
|
+
*
|
|
43
|
+
* @returns {ReactElement} A `DropdownSearchInput` component.
|
|
44
|
+
*/
|
|
45
|
+
function DropdownSearchInput(_ref) {
|
|
46
|
+
var _selectedValue$icon;
|
|
47
|
+
let {
|
|
48
|
+
options,
|
|
49
|
+
onOptionChange,
|
|
50
|
+
onInputChange,
|
|
51
|
+
onPressEnter,
|
|
52
|
+
onClear,
|
|
53
|
+
inputValue,
|
|
54
|
+
placeholder,
|
|
55
|
+
allowClear,
|
|
56
|
+
selectedOption
|
|
57
|
+
} = _ref,
|
|
58
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
59
|
+
const [selectedValue, setSelectedValue] = (0, _react.useState)(null);
|
|
60
|
+
const [internalInputValue, setInternalInputValue] = (0, _react.useState)(inputValue);
|
|
61
|
+
const [isDropdownOpen, setIsDropdownOpen] = (0, _react.useState)(false);
|
|
62
|
+
const [isInitialized, setIsInitialized] = (0, _react.useState)(false);
|
|
63
|
+
|
|
64
|
+
// Sync selectedValue with parent's selectedOption
|
|
65
|
+
(0, _react.useEffect)(() => {
|
|
66
|
+
if (selectedOption && options.length > 0) {
|
|
67
|
+
const option = options.find(opt => opt && opt.value === selectedOption);
|
|
68
|
+
if (option) {
|
|
69
|
+
setSelectedValue(option);
|
|
70
|
+
setIsInitialized(true);
|
|
71
|
+
}
|
|
72
|
+
} else if (options.length > 0 && !isInitialized) {
|
|
73
|
+
// Only set first option as default if no selectedOption is provided and not initialized yet
|
|
74
|
+
const defaultOption = options[0];
|
|
75
|
+
setSelectedValue(defaultOption);
|
|
76
|
+
setIsInitialized(true);
|
|
77
|
+
// Call onOptionChange to notify parent about the default selection
|
|
78
|
+
if (onOptionChange) {
|
|
79
|
+
onOptionChange(defaultOption);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}, [selectedOption, options, isInitialized, onOptionChange]);
|
|
83
|
+
(0, _react.useEffect)(() => {
|
|
84
|
+
setInternalInputValue(inputValue);
|
|
85
|
+
}, [inputValue]);
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Handles the change of the selected value in the dropdown menu.
|
|
89
|
+
*
|
|
90
|
+
* Sets the `selectedValue` state to the selected option, clears the search input
|
|
91
|
+
* value, and calls the `onOptionChange` callback with the selected option as an
|
|
92
|
+
* argument.
|
|
93
|
+
*
|
|
94
|
+
* @param {string} value - The selected value.
|
|
95
|
+
*/
|
|
96
|
+
const handleSelectChange = val => {
|
|
97
|
+
const selectedOption = options.find(option => option && option.value == val);
|
|
98
|
+
setSelectedValue(selectedOption);
|
|
99
|
+
setInternalInputValue("");
|
|
100
|
+
if (onOptionChange) {
|
|
101
|
+
onOptionChange(selectedOption);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Handles the change of the search input value.
|
|
107
|
+
*
|
|
108
|
+
* Updates the `internalInputValue` state with the new search input value,
|
|
109
|
+
* and calls the `onInputChange` callback with the change event as an
|
|
110
|
+
* argument.
|
|
111
|
+
*
|
|
112
|
+
* @param {React.ChangeEvent<HTMLInputElement>} e - The change event.
|
|
113
|
+
*/
|
|
114
|
+
const handleInputChange = e => {
|
|
115
|
+
setInternalInputValue(e.target.value);
|
|
116
|
+
if (onInputChange) {
|
|
117
|
+
onInputChange(e); // Return the event `e` instead of just its value
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
const handleKeyPress = e => {
|
|
121
|
+
if (e.key === "Enter" && onPressEnter) {
|
|
122
|
+
onPressEnter(e);
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Handles the click event on the dropdown menu.
|
|
128
|
+
*
|
|
129
|
+
* Finds the selected option by the clicked key, and calls the
|
|
130
|
+
* `handleSelectChange` function with the selected option's value as an
|
|
131
|
+
* argument.
|
|
132
|
+
*
|
|
133
|
+
* @param {{ key: string }} obj - The event object with the key property.
|
|
134
|
+
*/
|
|
135
|
+
const handleMenuClick = _ref2 => {
|
|
136
|
+
let {
|
|
137
|
+
key
|
|
138
|
+
} = _ref2;
|
|
139
|
+
const selectedOption = options.find(option => option && option.value === key);
|
|
140
|
+
handleSelectChange(selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value);
|
|
141
|
+
};
|
|
142
|
+
const handleClearClick = () => {
|
|
143
|
+
setInternalInputValue("");
|
|
144
|
+
onInputChange === null || onInputChange === void 0 || onInputChange({
|
|
145
|
+
target: {
|
|
146
|
+
value: ""
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
onClear === null || onClear === void 0 || onClear();
|
|
150
|
+
};
|
|
151
|
+
const menu = /*#__PURE__*/_react.default.createElement(_antd.Menu, {
|
|
152
|
+
className: "mobilesIcons",
|
|
153
|
+
onClick: handleMenuClick
|
|
154
|
+
}, options.map(option => /*#__PURE__*/_react.default.createElement(_antd.Menu.Item, {
|
|
155
|
+
key: option.value,
|
|
156
|
+
icon: option.icon()
|
|
157
|
+
}, option.label)));
|
|
158
|
+
return /*#__PURE__*/_react.default.createElement(_styles.StylesContainer, null, /*#__PURE__*/_react.default.createElement(_antd.Dropdown, {
|
|
159
|
+
overlay: menu,
|
|
160
|
+
trigger: ["click"],
|
|
161
|
+
onVisibleChange: setIsDropdownOpen
|
|
162
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Button, {
|
|
163
|
+
className: "mobile-input"
|
|
164
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
165
|
+
className: "mobileVisible"
|
|
166
|
+
}, /*#__PURE__*/_react.default.createElement("span", null, selectedValue === null || selectedValue === void 0 || (_selectedValue$icon = selectedValue.icon) === null || _selectedValue$icon === void 0 ? void 0 : _selectedValue$icon.call(selectedValue)), " ", /*#__PURE__*/_react.default.createElement("small", null, selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.label)), /*#__PURE__*/_react.default.createElement(_KeyboardArrowDownOutlined.default, null))), /*#__PURE__*/_react.default.createElement(_CustomInput.default, _extends({
|
|
167
|
+
allowClear: allowClear,
|
|
168
|
+
value: internalInputValue,
|
|
169
|
+
onChange: handleInputChange,
|
|
170
|
+
onKeyPress: handleKeyPress,
|
|
171
|
+
onClear: handleClearClick,
|
|
172
|
+
placeholder: placeholder || (selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.placeholder),
|
|
173
|
+
className: !allowClear && "noClear"
|
|
174
|
+
}, props)));
|
|
175
|
+
}
|
|
176
|
+
DropdownSearchInput.propTypes = {
|
|
177
|
+
options: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
178
|
+
label: _propTypes.default.string.isRequired,
|
|
179
|
+
value: _propTypes.default.string.isRequired,
|
|
180
|
+
icon: _propTypes.default.node.isRequired,
|
|
181
|
+
placeholder: _propTypes.default.string.isRequired
|
|
182
|
+
})).isRequired,
|
|
183
|
+
onOptionChange: _propTypes.default.func.isRequired,
|
|
184
|
+
onInputChange: _propTypes.default.func.isRequired,
|
|
185
|
+
onPressEnter: _propTypes.default.func,
|
|
186
|
+
inputValue: _propTypes.default.string,
|
|
187
|
+
placeholder: _propTypes.default.string,
|
|
188
|
+
onClear: _propTypes.default.func,
|
|
189
|
+
allowClear: _propTypes.default.bool,
|
|
190
|
+
selectedOption: _propTypes.default.string
|
|
191
|
+
};
|
|
192
|
+
DropdownSearchInput.defaultProps = {
|
|
193
|
+
onPressEnter: null,
|
|
194
|
+
inputValue: "",
|
|
195
|
+
placeholder: "",
|
|
196
|
+
onClear: null,
|
|
197
|
+
allowClear: false,
|
|
198
|
+
selectedOption: null
|
|
199
|
+
};
|
|
200
|
+
var _default = exports.default = DropdownSearchInput;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.StylesContainer = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
+
var _templateObject;
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
11
|
+
const StylesContainer = exports.StylesContainer = _styledComponents.default.section(_templateObject || (_templateObject = _taggedTemplateLiteral(["\ndisplay: flex;\n.mobile-input{\n min-width: 60px;\n height: 48px;\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n border-color: #959595;\n border-right: none;\n align-items: center;\n justify-content: space-between;\n display: flex;\n gap: 4px;\n}\n.ant-input{\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n boder-left: none;\n}\n.dropdown-container {\n display: flex;\n align-items: center;\n } \n .selected-icon {\n display: none;\n margin-left: 10px;\n font-size: 24px;\n }\n .mobileVisible svg,.mobile-input svg{\n color: var(--color-primary);\n }\n .mobileVisible small{display: none;}\n\n\n\n @media (min-width: 768px) {\n .mobileVisible span {\n display: none;\n }\n .mobile-input{\n min-width: 150px;\n align-items: center;\n justify-content: space-between;\n gap: 4\n }\n .mobileVisible small{display: block;font-size: inherit;color: var(--color-primary)}\n \n } \n"])));
|
|
12
|
+
var _default = exports.default = StylesContainer;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.weak-map.js");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _FeedbackForm = _interopRequireDefault(require("../../components/oa-component-feedback-form/FeedbackForm"));
|
|
11
|
+
var _FeedbackTooltip = _interopRequireDefault(require("../../components/oa-component-feedback-tooltip/FeedbackTooltip"));
|
|
12
|
+
var _styles = require("./styles");
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
+
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); }
|
|
15
|
+
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; }
|
|
16
|
+
/** *********** ✨ Codeium Command ⭐ ************ */
|
|
17
|
+
/**
|
|
18
|
+
* FeedbackWidget renders a feedback form and a tooltip with a button to open the form.
|
|
19
|
+
* The widget uses a useEffect hook to set the initial state of the component based on
|
|
20
|
+
* whether the feedback button has been clicked in the past (stored in localStorage).
|
|
21
|
+
* The component also uses a useCallback hook to memoize the functions used to set the
|
|
22
|
+
* state and to handle the button clicks.
|
|
23
|
+
*
|
|
24
|
+
* @param {Object} props - The properties object.
|
|
25
|
+
* @param {string} props.scriptSrc - The source URL for the script tag.
|
|
26
|
+
* @param {string} props.iframeSrc - The source URL for the iframe.
|
|
27
|
+
* @param {ReactElement} props.WrapperComponent - The component to wrap the FeedbackForm component.
|
|
28
|
+
* @param {Function} props.setOpen - The function to call when the feedback button is clicked.
|
|
29
|
+
* @param {boolean} props.open - The current state of the feedback form.
|
|
30
|
+
*
|
|
31
|
+
* @returns {ReactElement} The FeedbackWidget component.
|
|
32
|
+
*/
|
|
33
|
+
/** **** 1deff343-01ad-4bdd-848d-22d1f519f3ff ****** */
|
|
34
|
+
|
|
35
|
+
function FeedbackWidget(props) {
|
|
36
|
+
const {
|
|
37
|
+
scriptSrc,
|
|
38
|
+
iframeSrc,
|
|
39
|
+
WrapperComponent,
|
|
40
|
+
setOpen,
|
|
41
|
+
open,
|
|
42
|
+
onClose
|
|
43
|
+
} = props !== null && props !== void 0 ? props : {};
|
|
44
|
+
const [hasClickedFeedback, setHasClickedFeedback] = (0, _react.useState)(true);
|
|
45
|
+
const [tooltipOpen, setTooltipOpen] = (0, _react.useState)(true);
|
|
46
|
+
(0, _react.useEffect)(() => {
|
|
47
|
+
const feedbackClicked = localStorage.getItem('feedbackButtonClicked');
|
|
48
|
+
if (!feedbackClicked) {
|
|
49
|
+
setHasClickedFeedback(false);
|
|
50
|
+
}
|
|
51
|
+
}, []);
|
|
52
|
+
const onFeedbackButtonClick = (0, _react.useCallback)(() => {
|
|
53
|
+
setTooltipOpen(false);
|
|
54
|
+
setOpen(true);
|
|
55
|
+
localStorage.setItem('feedbackButtonClicked', true);
|
|
56
|
+
setHasClickedFeedback(true);
|
|
57
|
+
}, [setOpen]);
|
|
58
|
+
const onButtonClick = (0, _react.useCallback)(() => {
|
|
59
|
+
setTooltipOpen(false);
|
|
60
|
+
localStorage.setItem('feedbackButtonClicked', true);
|
|
61
|
+
setHasClickedFeedback(true);
|
|
62
|
+
}, [setOpen]);
|
|
63
|
+
return /*#__PURE__*/_react.default.createElement(_styles.OaFeedBackStyle, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
64
|
+
className: !hasClickedFeedback && 'OaMask'
|
|
65
|
+
}), /*#__PURE__*/_react.default.createElement(_FeedbackTooltip.default, {
|
|
66
|
+
setOpen: setOpen,
|
|
67
|
+
hasClickedFeedback: hasClickedFeedback,
|
|
68
|
+
setHasClickedFeedback: setHasClickedFeedback,
|
|
69
|
+
tooltipTitle: "We Value Your Feedback!",
|
|
70
|
+
tooltipDescription: "Please let us know your thoughts.",
|
|
71
|
+
tooltipButtonLabel: "Okay",
|
|
72
|
+
feedbackButtonLabel: "Give Feedback",
|
|
73
|
+
onFeedbackButtonClick: onFeedbackButtonClick,
|
|
74
|
+
onButtonClick: onButtonClick,
|
|
75
|
+
tooltipOpen: tooltipOpen
|
|
76
|
+
}), /*#__PURE__*/_react.default.createElement(WrapperComponent, null, /*#__PURE__*/_react.default.createElement(_FeedbackForm.default, {
|
|
77
|
+
scriptSrc: scriptSrc,
|
|
78
|
+
iframeSrc: iframeSrc,
|
|
79
|
+
open: open,
|
|
80
|
+
onClose: onClose
|
|
81
|
+
})));
|
|
82
|
+
}
|
|
83
|
+
var _default = exports.default = FeedbackWidget;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.OaFeedBackStyle = void 0;
|
|
7
|
+
var _antd = require("antd");
|
|
8
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
|
+
var _templateObject;
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
12
|
+
var _default = exports.default = {};
|
|
13
|
+
const OaFeedBackStyle = exports.OaFeedBackStyle = _styledComponents.default.aside(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .whiteBg{\n position: fixed;\n top: 50%;\n right: 0;\n transform: translate(0%, -50%) rotate(-90deg);\n cursor: pointer;\n z-index: 999;\n }\n .whiteBg button{\n background: #212121 !important;\n border: 1px solid #212121;\n }\n\n .OaMask{\n width: 100%;\n position: fixed;\n background: rgb(0 0 0 / 70%);\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 9;\n top: 0;\n }\n"])));
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = CustomFormWidget;
|
|
7
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
+
var _antd = require("antd");
|
|
11
|
+
var _utils = require("../../utils");
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
/**
|
|
14
|
+
* A wrapper around Ant Design's Form component that accepts an array of objects
|
|
15
|
+
* to be rendered as Form.Items. Each object should have a "label" string, a
|
|
16
|
+
* "formItem" object with props for the Form.Item, and a "child" node to be
|
|
17
|
+
* rendered inside the Form.Item. Optionally, a "secondaryChild" node can be
|
|
18
|
+
* rendered below the Form.Item.
|
|
19
|
+
*
|
|
20
|
+
* @param {function} handleFormSubmit - Called with the form data when the form
|
|
21
|
+
* is submitted.
|
|
22
|
+
* @param {array} formItem - An array of objects to be rendered as Form.Items.
|
|
23
|
+
* @returns {React.ReactElement} A Form component with the given items.
|
|
24
|
+
*/
|
|
25
|
+
function CustomFormWidget(_ref) {
|
|
26
|
+
var _Form$useForm, _Form$useForm2, _formItem$map;
|
|
27
|
+
let {
|
|
28
|
+
handleFormSubmit,
|
|
29
|
+
formItem
|
|
30
|
+
} = _ref;
|
|
31
|
+
const [form] = (_Form$useForm = _antd.Form === null || _antd.Form === void 0 || (_Form$useForm2 = _antd.Form.useForm) === null || _Form$useForm2 === void 0 ? void 0 : _Form$useForm2.call(_antd.Form)) !== null && _Form$useForm !== void 0 ? _Form$useForm : [];
|
|
32
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Form, {
|
|
33
|
+
form: form,
|
|
34
|
+
onFinish: handleFormSubmit
|
|
35
|
+
}, formItem === null || formItem === void 0 || (_formItem$map = formItem.map) === null || _formItem$map === void 0 ? void 0 : _formItem$map.call(formItem, item => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
36
|
+
key: (0, _utils.getUUID)()
|
|
37
|
+
}, item.label && /*#__PURE__*/_react.default.createElement(_antd.Typography, null, item.label), /*#__PURE__*/_react.default.createElement(_antd.Form.Item, item.formItem, item.child), item.secondaryChild)));
|
|
38
|
+
}
|
|
39
|
+
CustomFormWidget.propTypes = {
|
|
40
|
+
handleFormSubmit: _propTypes.default.func,
|
|
41
|
+
formItem: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
42
|
+
label: _propTypes.default.string,
|
|
43
|
+
formItem: _propTypes.default.object,
|
|
44
|
+
child: _propTypes.default.node,
|
|
45
|
+
secondaryChild: _propTypes.default.node
|
|
46
|
+
}))
|
|
47
|
+
};
|
|
48
|
+
CustomFormWidget.defaultProps = {
|
|
49
|
+
handleFormSubmit: () => {},
|
|
50
|
+
formItem: []
|
|
51
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.StyleContainer = 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 StyleContainer = exports.StyleContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\nheader{background: var(--color-primary-background); box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.14);}\n.flexProp{display:flex; flex-direction: row; align-items: center; justify-content: space-between; min-height:60px;}\n.flexSec{display:flex; flex-direction: row; justify-content: flex-start;}\n.flexSec svg{cursor:pointer;}\n.mobView{display:none;}\n.deskView{display:flex;}\n\n@media only screen and (max-width: 600px) {\n.mobView{display:flex;}\n.deskView{display:none;}\n}\n\n\n"])));
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = GoogleRating;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
var _StarOutlined = _interopRequireDefault(require("@material-ui/icons/StarOutlined"));
|
|
10
|
+
var _ThumbUpAltOutlined = _interopRequireDefault(require("@material-ui/icons/ThumbUpAltOutlined"));
|
|
11
|
+
var _styles = require("./styles");
|
|
12
|
+
var _Typography = _interopRequireDefault(require("../../components/oa-component-typography/Typography"));
|
|
13
|
+
var _MaterialIcon = _interopRequireDefault(require("../../components/oa-component-icons/MaterialIcon"));
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
/**
|
|
16
|
+
* GoogleRating component renders a styled section with an optional Material icon and text content.
|
|
17
|
+
*
|
|
18
|
+
* @param {Object} props
|
|
19
|
+
* @param {Object} [props.materialIcon] - The Material UI icon component to be displayed.
|
|
20
|
+
* @param {string} [props.textContent=''] - The text content to be displayed alongside the icon.
|
|
21
|
+
* @param {string} [props.iconColor='defaultColor'] - The color of the icon.
|
|
22
|
+
* @param {number} [props.iconSize=20] - The size of the icon.
|
|
23
|
+
* @returns {ReactElement} The rendered GoogleRating component.
|
|
24
|
+
*/
|
|
25
|
+
function GoogleRating(_ref) {
|
|
26
|
+
let {
|
|
27
|
+
materialIcon,
|
|
28
|
+
textContent,
|
|
29
|
+
iconColor,
|
|
30
|
+
iconSize
|
|
31
|
+
} = _ref;
|
|
32
|
+
return /*#__PURE__*/_react.default.createElement(_styles.GoogleRatingStyle, null, /*#__PURE__*/_react.default.createElement("section", null, materialIcon && /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
33
|
+
color: iconColor,
|
|
34
|
+
icon: materialIcon,
|
|
35
|
+
size: iconSize
|
|
36
|
+
}), /*#__PURE__*/_react.default.createElement("p", null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
37
|
+
color: "primary-content",
|
|
38
|
+
className: "type-b2-400"
|
|
39
|
+
}, textContent), ' ')));
|
|
40
|
+
}
|
|
41
|
+
GoogleRating.propTypes = {
|
|
42
|
+
materialIcon: _propTypes.default.object,
|
|
43
|
+
// Pass the Material UI icon component
|
|
44
|
+
textContent: _propTypes.default.string,
|
|
45
|
+
iconColor: _propTypes.default.string,
|
|
46
|
+
iconSize: _propTypes.default.number
|
|
47
|
+
};
|
|
48
|
+
GoogleRating.defaultProps = {
|
|
49
|
+
materialIcon: null,
|
|
50
|
+
// Provide a default value, e.g., null
|
|
51
|
+
textContent: '',
|
|
52
|
+
iconColor: 'defaultColor',
|
|
53
|
+
iconSize: 20
|
|
54
|
+
};
|
|
55
|
+
// export default GoogleRating
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.GoogleRatingStyle = 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 GoogleRatingStyle = exports.GoogleRatingStyle = _styledComponents.default.aside(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: 16px;\n display: flex;\n justify-content: space-between;\n border-radius: 8px;\n background: var(--color-primary-background);\n p{\n margin: 0;\n }\n section{\n text-align: center;\n margin: 0 24px 0 0;\n\n }\n section:last-child{\n margin: 0;\n }\n"])));
|