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,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
var _antd = require("antd");
|
|
10
|
+
var _icons = require("@ant-design/icons");
|
|
11
|
+
var _styles = require("./styles");
|
|
12
|
+
var _Typography = _interopRequireDefault(require("../oa-component-typography/Typography"));
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
+
const text = /*#__PURE__*/_react.default.createElement("span", null, "prompt text");
|
|
15
|
+
/**
|
|
16
|
+
* CustomLabel component displays a label with optional info circle tooltip.
|
|
17
|
+
*
|
|
18
|
+
* @param {boolean} showInfoCircle - Flag to show the info circle tooltip.
|
|
19
|
+
*/
|
|
20
|
+
function CustomLabel(_ref) {
|
|
21
|
+
let {
|
|
22
|
+
showInfoCircle
|
|
23
|
+
} = _ref;
|
|
24
|
+
return /*#__PURE__*/_react.default.createElement(_styles.Stylelabels, {
|
|
25
|
+
className: "type-b2-400"
|
|
26
|
+
}, "CustomLabel", showInfoCircle && /*#__PURE__*/_react.default.createElement(_antd.Tooltip, {
|
|
27
|
+
placement: "topLeft",
|
|
28
|
+
title: text
|
|
29
|
+
}, /*#__PURE__*/_react.default.createElement(_icons.InfoCircleFilled, null)));
|
|
30
|
+
}
|
|
31
|
+
CustomLabel.propTypes = {
|
|
32
|
+
showInfoCircle: _propTypes.default.bool
|
|
33
|
+
};
|
|
34
|
+
CustomLabel.defaultProps = {
|
|
35
|
+
showInfoCircle: false
|
|
36
|
+
};
|
|
37
|
+
var _default = exports.default = CustomLabel;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.Stylelabels = 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 Stylelabels = exports.Stylelabels = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: var(--color-primary-content);\n margin: 0 0 4px;\n display: inline-flex;\n .anticon-info-circle{\n margin: 0 0 0 8px;\n color: var(--color-secondary-content);\n cursor: pointer;\n .ant-tooltip-placement-bottomLeft .ant-tooltip-arrow {\n left: 3px;\n }\n\n .ant-tooltip-inner {\n background-color: var(--color-primary-content);\n }\n }\n"])));
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.assign.js");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
+
var _antd = require("antd");
|
|
11
|
+
var _ColorVariablesMap = _interopRequireDefault(require("../../global-css/ColorVariablesMap"));
|
|
12
|
+
const _excluded = ["children", "contentHeight", "delay", "size", "spinning"];
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
+
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); }
|
|
15
|
+
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; }
|
|
16
|
+
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; }
|
|
17
|
+
/**
|
|
18
|
+
* A custom loader component that extends Ant Design's Spin component.
|
|
19
|
+
*
|
|
20
|
+
* @param {React.ReactNode} children - The DOM element on which the loader should be centered.
|
|
21
|
+
* @param {string} contentHeight - The height of the content that this loader is spinning over.
|
|
22
|
+
* @param {number} delay - The delay in which the loader should be displayed.
|
|
23
|
+
* @param {string} size - The size of the loader (small, default, or large).
|
|
24
|
+
* @param {boolean} spinning - Determines whether the loader is displayed or hidden.
|
|
25
|
+
* @param {object} antDesignProps - Any additional props that should be passed to the Ant Design Spin component.
|
|
26
|
+
* @returns {ReactElement} The rendered CustomLoader component.
|
|
27
|
+
*/
|
|
28
|
+
function CustomLoader(_ref) {
|
|
29
|
+
let {
|
|
30
|
+
children,
|
|
31
|
+
contentHeight,
|
|
32
|
+
delay,
|
|
33
|
+
size,
|
|
34
|
+
spinning
|
|
35
|
+
} = _ref,
|
|
36
|
+
antDesignProps = _objectWithoutProperties(_ref, _excluded);
|
|
37
|
+
return /*#__PURE__*/_react.default.createElement(_antd.ConfigProvider, {
|
|
38
|
+
theme: {
|
|
39
|
+
components: {
|
|
40
|
+
Spin: {
|
|
41
|
+
contentHeight
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
token: {
|
|
45
|
+
colorPrimary: _ColorVariablesMap.default['--color-primary']
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Spin, _extends({
|
|
49
|
+
delay: delay,
|
|
50
|
+
size: size,
|
|
51
|
+
spinning: spinning
|
|
52
|
+
}, antDesignProps), children));
|
|
53
|
+
}
|
|
54
|
+
CustomLoader.propTypes = {
|
|
55
|
+
children: _propTypes.default.node.isRequired,
|
|
56
|
+
contentHeight: _propTypes.default.string,
|
|
57
|
+
delay: _propTypes.default.number,
|
|
58
|
+
size: _propTypes.default.oneOf(['small', 'default', 'large']),
|
|
59
|
+
spinning: _propTypes.default.bool.isRequired
|
|
60
|
+
};
|
|
61
|
+
CustomLoader.defaultProps = {
|
|
62
|
+
contentHeight: 'none',
|
|
63
|
+
delay: 500,
|
|
64
|
+
size: 'default'
|
|
65
|
+
};
|
|
66
|
+
var _default = exports.default = CustomLoader;
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.assign.js");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
+
var _antd = require("antd");
|
|
11
|
+
var _icons = require("@ant-design/icons");
|
|
12
|
+
var _CustomButton = _interopRequireDefault(require("../oa-component-button/CustomButton"));
|
|
13
|
+
var _Typography = _interopRequireDefault(require("../oa-component-typography/Typography"));
|
|
14
|
+
var _typographyOptions = require("../../global-css/typography-options");
|
|
15
|
+
var _utils = require("../../utils");
|
|
16
|
+
var _styles = require("./styles");
|
|
17
|
+
const _excluded = ["buttonConfig", "children", "data-test", "imgSrc", "onCancel", "open", "title", "typographies", "width"];
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
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); }
|
|
20
|
+
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; }
|
|
21
|
+
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; }
|
|
22
|
+
/**
|
|
23
|
+
* This is a custom Modal component that extends the default antd Modal
|
|
24
|
+
* component.
|
|
25
|
+
*
|
|
26
|
+
* The open state of the modal is controlled by the parent component.
|
|
27
|
+
*
|
|
28
|
+
* The parent can also provide a callback function to be called when the
|
|
29
|
+
* cancel button is clicked.
|
|
30
|
+
*
|
|
31
|
+
* The width of the modal can be customized by providing a width prop.
|
|
32
|
+
*
|
|
33
|
+
* The buttons for the modal can be customized by providing a buttonConfig
|
|
34
|
+
* prop.
|
|
35
|
+
*
|
|
36
|
+
* The title of the modal can be provided as a string or as an image.
|
|
37
|
+
*
|
|
38
|
+
* The children of the modal can be provided as a string or a number, or as
|
|
39
|
+
* JSX elements.
|
|
40
|
+
*
|
|
41
|
+
* The typography of the title and description can be customized by providing
|
|
42
|
+
* a typographies object.
|
|
43
|
+
*
|
|
44
|
+
* The modal is centered by default.
|
|
45
|
+
*
|
|
46
|
+
* The modal is rendered with a gray background.
|
|
47
|
+
*
|
|
48
|
+
* The modal is rendered with a close button.
|
|
49
|
+
*
|
|
50
|
+
* The parent can provide additional props to the Modal component.
|
|
51
|
+
*/
|
|
52
|
+
function CustomModal(_ref) {
|
|
53
|
+
let {
|
|
54
|
+
buttonConfig,
|
|
55
|
+
children,
|
|
56
|
+
'data-test': dataTest,
|
|
57
|
+
imgSrc,
|
|
58
|
+
// This callback function provided by parent is called upon clicking on the cancel button
|
|
59
|
+
onCancel,
|
|
60
|
+
open,
|
|
61
|
+
title,
|
|
62
|
+
typographies,
|
|
63
|
+
width
|
|
64
|
+
} = _ref,
|
|
65
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
66
|
+
/*
|
|
67
|
+
We make our own callback function, which makes a call to the `onCancel`
|
|
68
|
+
function given to use by the parent.
|
|
69
|
+
This is beneficial if we want some of our actions to be executed when
|
|
70
|
+
cancel is executed.
|
|
71
|
+
*/
|
|
72
|
+
const handleCancel = () => {
|
|
73
|
+
onCancel();
|
|
74
|
+
};
|
|
75
|
+
return /*#__PURE__*/_react.default.createElement(_antd.ConfigProvider, {
|
|
76
|
+
theme: {
|
|
77
|
+
token: {
|
|
78
|
+
colorBgMask: 'rgba(0, 0, 0, 0.7)'
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}, open && /*#__PURE__*/_react.default.createElement(_antd.Modal, _extends({
|
|
82
|
+
closeIcon: /*#__PURE__*/_react.default.createElement(_icons.CloseCircleFilled, {
|
|
83
|
+
style: {
|
|
84
|
+
fontSize: '26px'
|
|
85
|
+
}
|
|
86
|
+
}),
|
|
87
|
+
centered: true,
|
|
88
|
+
"data-test": dataTest,
|
|
89
|
+
footer: (buttonConfig === null || buttonConfig === void 0 ? void 0 : buttonConfig.length) > 0 && /*#__PURE__*/_react.default.createElement(_styles.ButtonContainer, null, buttonConfig === null || buttonConfig === void 0 ? void 0 : buttonConfig.map(button => /*#__PURE__*/_react.default.createElement(_CustomButton.default, _extends({
|
|
90
|
+
key: (0, _utils.getUUID)()
|
|
91
|
+
}, button, {
|
|
92
|
+
iconConfig: button === null || button === void 0 ? void 0 : button.iconConfig,
|
|
93
|
+
label: button.label,
|
|
94
|
+
onClick: button.callback,
|
|
95
|
+
size: "large",
|
|
96
|
+
type: button === null || button === void 0 ? void 0 : button.type,
|
|
97
|
+
"data-test": button['data-test']
|
|
98
|
+
})))),
|
|
99
|
+
onCancel: handleCancel,
|
|
100
|
+
open: open,
|
|
101
|
+
title: (title || imgSrc) && /*#__PURE__*/_react.default.createElement(_styles.TitleContainer, null, imgSrc && /*#__PURE__*/_react.default.createElement("img", {
|
|
102
|
+
src: imgSrc,
|
|
103
|
+
alt: ""
|
|
104
|
+
}), /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
105
|
+
typography: typographies.title
|
|
106
|
+
}, title)),
|
|
107
|
+
width: width
|
|
108
|
+
}, props), children && /*#__PURE__*/_react.default.createElement(_styles.DescriptionContainer, null,
|
|
109
|
+
// The label is a string or a number
|
|
110
|
+
((0, _utils.isString)(children) || (0, _utils.isNumber)(children)) && /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
111
|
+
color: "secondary-content",
|
|
112
|
+
typography: typographies.children
|
|
113
|
+
}, children) || children)));
|
|
114
|
+
}
|
|
115
|
+
CustomModal.propTypes = {
|
|
116
|
+
// Array of button configurations
|
|
117
|
+
buttonConfig: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
118
|
+
callback: _propTypes.default.func.isRequired,
|
|
119
|
+
'data-test': _propTypes.default.string,
|
|
120
|
+
label: _propTypes.default.string,
|
|
121
|
+
iconConfig: _propTypes.default.shape({
|
|
122
|
+
icon: _propTypes.default.node,
|
|
123
|
+
position: _propTypes.default.oneOf(['left', 'right']),
|
|
124
|
+
style: _propTypes.default.objectOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]))
|
|
125
|
+
}),
|
|
126
|
+
type: _propTypes.default.oneOf(['primary', 'secondary', 'text-only', 'danger-primary', 'danger-secondary', 'danger-text-only'])
|
|
127
|
+
})),
|
|
128
|
+
children: _propTypes.default.node,
|
|
129
|
+
'data-test': _propTypes.default.string,
|
|
130
|
+
title: _propTypes.default.string,
|
|
131
|
+
typographies: _propTypes.default.shape({
|
|
132
|
+
title: _propTypes.default.oneOf(_typographyOptions.typographyOptions),
|
|
133
|
+
children: _propTypes.default.oneOf(_typographyOptions.typographyOptions)
|
|
134
|
+
}),
|
|
135
|
+
imgSrc: _propTypes.default.string,
|
|
136
|
+
onCancel: _propTypes.default.func.isRequired,
|
|
137
|
+
open: _propTypes.default.bool,
|
|
138
|
+
width: _propTypes.default.string || _propTypes.default.number
|
|
139
|
+
};
|
|
140
|
+
CustomModal.defaultProps = {
|
|
141
|
+
buttonConfig: [],
|
|
142
|
+
children: null,
|
|
143
|
+
'data-test': null,
|
|
144
|
+
imgSrc: null,
|
|
145
|
+
open: true,
|
|
146
|
+
title: null,
|
|
147
|
+
typographies: {
|
|
148
|
+
title: 'type-t1-500',
|
|
149
|
+
children: 'type-b2-400'
|
|
150
|
+
},
|
|
151
|
+
width: 416
|
|
152
|
+
};
|
|
153
|
+
var _default = exports.default = CustomModal;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TitleContainer = exports.DescriptionContainer = exports.ButtonContainer = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
9
|
+
/* eslint-disable */
|
|
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 ButtonContainer = exports.ButtonContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n gap: 16px;\n justify-content: flex-end;\n margin: 36px 0 0;\n @media (max-width: 768px) {\n justify-content: space-between;\n button{\n width: 100%;\n }\n }\n"])));
|
|
13
|
+
const DescriptionContainer = exports.DescriptionContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding: 12px 0 0;\n"])));
|
|
14
|
+
const TitleContainer = exports.TitleContainer = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n margin: 32px 0 0 0;\n display: flex;\n flex-direction: column;\n gap: 16px;\n img {\n height: 36px;\n width: 36px;\n }\n"])));
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.weak-map.js");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.notificationOptions = exports.default = void 0;
|
|
8
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
9
|
+
require("core-js/modules/es.symbol.description.js");
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
|
+
var _antd = require("antd");
|
|
13
|
+
var _CloseRounded = _interopRequireDefault(require("@material-ui/icons/CloseRounded"));
|
|
14
|
+
var _CheckCircle = _interopRequireDefault(require("@material-ui/icons/CheckCircle"));
|
|
15
|
+
var _Cancel = _interopRequireDefault(require("@material-ui/icons/Cancel"));
|
|
16
|
+
var _Typography = _interopRequireDefault(require("../oa-component-typography/Typography"));
|
|
17
|
+
var _MaterialIcon = _interopRequireDefault(require("../oa-component-icons/MaterialIcon"));
|
|
18
|
+
var _typographyOptions = require("../../global-css/typography-options");
|
|
19
|
+
var _styles = require("./styles");
|
|
20
|
+
const _excluded = ["description", "duration", "onClick", "onClose", "title", "type"];
|
|
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 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; }
|
|
25
|
+
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; }
|
|
26
|
+
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; }
|
|
27
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
28
|
+
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); }
|
|
29
|
+
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; }
|
|
30
|
+
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; }
|
|
31
|
+
// Import the styles from the separate file
|
|
32
|
+
|
|
33
|
+
const notificationOptions = exports.notificationOptions = ['positive', 'negative'];
|
|
34
|
+
const Notification = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
35
|
+
let {
|
|
36
|
+
storyConfig,
|
|
37
|
+
// Useful only for the purpose of displaying in storybook
|
|
38
|
+
onClick: _onClick,
|
|
39
|
+
onClose,
|
|
40
|
+
placement,
|
|
41
|
+
typographies
|
|
42
|
+
} = _ref;
|
|
43
|
+
const [api, contextHolder] = _antd.notification.useNotification({
|
|
44
|
+
placement
|
|
45
|
+
});
|
|
46
|
+
const openNotification = (0, _react.useCallback)(_ref2 => {
|
|
47
|
+
let {
|
|
48
|
+
description,
|
|
49
|
+
duration,
|
|
50
|
+
onClick: onClickDynamic = () => {},
|
|
51
|
+
onClose: onCloseDynamic = () => {},
|
|
52
|
+
title,
|
|
53
|
+
type
|
|
54
|
+
} = _ref2,
|
|
55
|
+
otherConfig = _objectWithoutProperties(_ref2, _excluded);
|
|
56
|
+
// type can be success or failure
|
|
57
|
+
|
|
58
|
+
let descriptionColor = type === 'success' ? 'secondary-content' : 'secondary-content';
|
|
59
|
+
const titleColor = type === 'success' ? 'positive' : 'negative';
|
|
60
|
+
const borderColor = type === 'success' ? 'var(--color-positive)' : 'var(--color-negative)';
|
|
61
|
+
let defaultStyle = {
|
|
62
|
+
padding: '12px 16px',
|
|
63
|
+
borderRadius: '4px',
|
|
64
|
+
borderLeft: "4px solid ".concat(borderColor),
|
|
65
|
+
boxShadow: '0px 2px 8px 0px rgba(0, 0, 0, 0.12)',
|
|
66
|
+
display: 'flex',
|
|
67
|
+
justifyContent: 'space-between',
|
|
68
|
+
alignItems: 'center',
|
|
69
|
+
backgroundColor: '#fff'
|
|
70
|
+
};
|
|
71
|
+
if ((otherConfig === null || otherConfig === void 0 ? void 0 : otherConfig.mode) === 'dark') {
|
|
72
|
+
defaultStyle = {
|
|
73
|
+
backgroundColor: '#212121',
|
|
74
|
+
textAlign: 'left',
|
|
75
|
+
borderRadius: '12px',
|
|
76
|
+
padding: '16px'
|
|
77
|
+
};
|
|
78
|
+
descriptionColor = type === 'success' ? 'primary-background' : 'primary-background';
|
|
79
|
+
}
|
|
80
|
+
const customNotification = /*#__PURE__*/_react.default.createElement(_styles.StyledNotification, null, (otherConfig === null || otherConfig === void 0 ? void 0 : otherConfig.showIcon) && /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
81
|
+
color: titleColor,
|
|
82
|
+
icon: type === 'success' ? _CheckCircle.default : _Cancel.default,
|
|
83
|
+
size: 24
|
|
84
|
+
}), /*#__PURE__*/_react.default.createElement("div", null, title && /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
85
|
+
color: titleColor,
|
|
86
|
+
typography: typographies.title
|
|
87
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
88
|
+
className: "Headtitle"
|
|
89
|
+
}, title)), /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
90
|
+
color: descriptionColor,
|
|
91
|
+
typography: typographies.description
|
|
92
|
+
}, /*#__PURE__*/_react.default.createElement("small", null, description))));
|
|
93
|
+
const handleClose = () => {
|
|
94
|
+
onClose();
|
|
95
|
+
onCloseDynamic();
|
|
96
|
+
};
|
|
97
|
+
api.open(_objectSpread({
|
|
98
|
+
message: customNotification,
|
|
99
|
+
style: defaultStyle,
|
|
100
|
+
closeIcon: /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
101
|
+
color: (otherConfig === null || otherConfig === void 0 ? void 0 : otherConfig.mode) === 'dark' ? 'primary-background' : 'primary-content',
|
|
102
|
+
icon: _CloseRounded.default,
|
|
103
|
+
onClick: handleClose,
|
|
104
|
+
size: 20
|
|
105
|
+
}),
|
|
106
|
+
onClick: () => {
|
|
107
|
+
_onClick();
|
|
108
|
+
onClickDynamic();
|
|
109
|
+
},
|
|
110
|
+
onClose: handleClose,
|
|
111
|
+
duration: duration !== null && duration !== void 0 ? duration : 4.5
|
|
112
|
+
}, otherConfig));
|
|
113
|
+
}, [api, _onClick, onClose, typographies]);
|
|
114
|
+
(0, _react.useImperativeHandle)(ref, () => ({
|
|
115
|
+
openNotification
|
|
116
|
+
}));
|
|
117
|
+
|
|
118
|
+
// This is only for the purpose of displaying the notification in storybook.
|
|
119
|
+
(0, _react.useEffect)(() => {
|
|
120
|
+
if (storyConfig != null) {
|
|
121
|
+
openNotification(storyConfig);
|
|
122
|
+
}
|
|
123
|
+
}, [storyConfig, openNotification]);
|
|
124
|
+
return contextHolder;
|
|
125
|
+
});
|
|
126
|
+
Notification.propTypes = {
|
|
127
|
+
onClick: _propTypes.default.func,
|
|
128
|
+
onClose: _propTypes.default.func,
|
|
129
|
+
placement: _propTypes.default.oneOf(['topLeft', 'topRight', 'bottomLeft', 'bottomRight', 'bottom']),
|
|
130
|
+
storyConfig: _propTypes.default.shape({
|
|
131
|
+
description: _propTypes.default.string,
|
|
132
|
+
title: _propTypes.default.string,
|
|
133
|
+
type: _propTypes.default.oneOf(['success', 'failure'])
|
|
134
|
+
}),
|
|
135
|
+
typographies: _propTypes.default.shape({
|
|
136
|
+
button: _propTypes.default.oneOf(_typographyOptions.typographyOptions),
|
|
137
|
+
description: _propTypes.default.oneOf(_typographyOptions.typographyOptions),
|
|
138
|
+
title: _propTypes.default.oneOf(_typographyOptions.typographyOptions)
|
|
139
|
+
})
|
|
140
|
+
};
|
|
141
|
+
Notification.defaultProps = {
|
|
142
|
+
onClick: () => {},
|
|
143
|
+
onClose: () => {},
|
|
144
|
+
placement: 'topRight',
|
|
145
|
+
storyConfig: null,
|
|
146
|
+
typographies: {
|
|
147
|
+
button: 'type-button-500',
|
|
148
|
+
description: 'type-b3-400',
|
|
149
|
+
title: 'type-b2-400'
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
var _default = exports.default = Notification;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.StyledNotification = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
+
var _templateObject; // NotificationStyles.js
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
11
|
+
var _default = exports.default = {};
|
|
12
|
+
const StyledNotification = exports.StyledNotification = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n.ant-notification-notice-close{\n position: inherit !important;\n}\n .ant-notification-notice-close svg{\n font-size: 24px !important;\n height: auto;\n }\n.ant-notification-notice-message{\n margin-bottom: 0;\n}\n display: flex;\n justify-content: space-between; \n align-items: center;\n gap: 12px;\n small{\n font-size: inherit;\n display: block; \n }\n .Headtitle{\n padding: 0 0 4px;\n }\n .anticon-close{\n color: var(--color-secondary-content);\n \n }\n \n"])));
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Usage Example of CustomNotification component
|
|
2
|
+
|
|
3
|
+
## Explanation
|
|
4
|
+
|
|
5
|
+
We need to use refs in order to use this commponent since the method for calling this notification is quite complex.
|
|
6
|
+
|
|
7
|
+
So, we expose that method to the parent using refs. Take a look at the code example below for better understanding.
|
|
8
|
+
|
|
9
|
+
## Code snippet
|
|
10
|
+
|
|
11
|
+
```jsx
|
|
12
|
+
function App() {
|
|
13
|
+
const myRef = useRef(null);
|
|
14
|
+
|
|
15
|
+
const onClick = () => {
|
|
16
|
+
console.log('click callback for Notification');
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const onClose = () => {
|
|
20
|
+
console.log('close callback for Notification');
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<>
|
|
25
|
+
<CustomButton
|
|
26
|
+
label="trigger notification"
|
|
27
|
+
onClick={() => myRef.current.openNotification({
|
|
28
|
+
description: 'Notification description HERE',
|
|
29
|
+
title: 'Notification title HERE',
|
|
30
|
+
type: 'Failure',
|
|
31
|
+
})}
|
|
32
|
+
/>
|
|
33
|
+
<CustomNotification
|
|
34
|
+
onClick={onClick}
|
|
35
|
+
onClose={onClose}
|
|
36
|
+
placement="bottomLeft"
|
|
37
|
+
ref={myRef}
|
|
38
|
+
/>
|
|
39
|
+
</>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export default App;
|
|
44
|
+
```
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.assign.js");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
+
var _antd = require("antd");
|
|
11
|
+
var _ColorVariablesMap = _interopRequireDefault(require("../../global-css/ColorVariablesMap"));
|
|
12
|
+
var _TypographiesMap = _interopRequireDefault(require("../../global-css/TypographiesMap"));
|
|
13
|
+
var _styles = require("./styles");
|
|
14
|
+
const _excluded = ["current", "total", "pageSize", "onChange", "onShowSizeChange", "pageSizeOptions", "showSizeChanger", "showQuickJumper", "showTotal", "size", "style"];
|
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
+
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); }
|
|
17
|
+
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; }
|
|
18
|
+
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; }
|
|
19
|
+
/**
|
|
20
|
+
* @description A custom wrapper for Ant Design Pagination component with consistent theming.
|
|
21
|
+
* @param {number} current - The current page number (1-based).
|
|
22
|
+
* @param {number} total - The total number of items.
|
|
23
|
+
* @param {number} pageSize - The number of items per page.
|
|
24
|
+
* @param {function} onChange - Callback function when page changes.
|
|
25
|
+
* @param {function} onShowSizeChange - Callback function when page size changes.
|
|
26
|
+
* @param {array} pageSizeOptions - Array of page size options.
|
|
27
|
+
* @param {boolean} showSizeChanger - Whether to show the page size selector.
|
|
28
|
+
* @param {boolean} showQuickJumper - Whether to show the quick jumper input.
|
|
29
|
+
* @param {boolean} showTotal - Whether to show the total items count.
|
|
30
|
+
* @param {string} size - The size of the pagination component.
|
|
31
|
+
* @param {object} style - Custom styles for the component.
|
|
32
|
+
* @param {object} antDesignProps - Additional props to pass to Ant Design Pagination.
|
|
33
|
+
* @returns {JSX.Element} The rendered pagination component.
|
|
34
|
+
*/
|
|
35
|
+
function CustomPagination(_ref) {
|
|
36
|
+
let {
|
|
37
|
+
current = 1,
|
|
38
|
+
total = 0,
|
|
39
|
+
pageSize = 10,
|
|
40
|
+
onChange,
|
|
41
|
+
onShowSizeChange,
|
|
42
|
+
pageSizeOptions = [10, 20, 50, 100],
|
|
43
|
+
showSizeChanger = true,
|
|
44
|
+
showQuickJumper = false,
|
|
45
|
+
showTotal = true,
|
|
46
|
+
size = 'default',
|
|
47
|
+
style
|
|
48
|
+
} = _ref,
|
|
49
|
+
antDesignProps = _objectWithoutProperties(_ref, _excluded);
|
|
50
|
+
const renderTotal = (totalItems, range) => {
|
|
51
|
+
if (!showTotal) return null;
|
|
52
|
+
return "Showing ".concat(range[0], "-").concat(range[1], " of ").concat(totalItems, " items");
|
|
53
|
+
};
|
|
54
|
+
return /*#__PURE__*/_react.default.createElement(_styles.MainContainer, {
|
|
55
|
+
style: style
|
|
56
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.ConfigProvider, {
|
|
57
|
+
theme: {
|
|
58
|
+
components: {
|
|
59
|
+
Pagination: {}
|
|
60
|
+
},
|
|
61
|
+
token: {
|
|
62
|
+
colorPrimary: '#014FC5',
|
|
63
|
+
colorPrimaryBorder: '#014FC5',
|
|
64
|
+
colorPrimaryHover: '#82A9E2',
|
|
65
|
+
colorText: '#212121',
|
|
66
|
+
colorTextDisabled: '#BFBFBF',
|
|
67
|
+
colorTextPlaceholder: '#959595',
|
|
68
|
+
borderRadius: 2,
|
|
69
|
+
colorBorder: '#E0E0E0'
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Pagination, _extends({
|
|
73
|
+
current: current,
|
|
74
|
+
total: total,
|
|
75
|
+
pageSize: pageSize,
|
|
76
|
+
onChange: onChange,
|
|
77
|
+
onShowSizeChange: onShowSizeChange,
|
|
78
|
+
showSizeChanger: showSizeChanger,
|
|
79
|
+
showQuickJumper: showQuickJumper,
|
|
80
|
+
showTotal: renderTotal,
|
|
81
|
+
pageSizeOptions: pageSizeOptions,
|
|
82
|
+
size: size
|
|
83
|
+
}, antDesignProps))));
|
|
84
|
+
}
|
|
85
|
+
CustomPagination.propTypes = {
|
|
86
|
+
current: _propTypes.default.number,
|
|
87
|
+
total: _propTypes.default.number,
|
|
88
|
+
pageSize: _propTypes.default.number,
|
|
89
|
+
onChange: _propTypes.default.func,
|
|
90
|
+
onShowSizeChange: _propTypes.default.func,
|
|
91
|
+
pageSizeOptions: _propTypes.default.arrayOf(_propTypes.default.number),
|
|
92
|
+
showSizeChanger: _propTypes.default.bool,
|
|
93
|
+
showQuickJumper: _propTypes.default.bool,
|
|
94
|
+
showTotal: _propTypes.default.bool,
|
|
95
|
+
size: _propTypes.default.oneOf(['default', 'small']),
|
|
96
|
+
style: _propTypes.default.object
|
|
97
|
+
};
|
|
98
|
+
CustomPagination.defaultProps = {
|
|
99
|
+
current: 1,
|
|
100
|
+
total: 0,
|
|
101
|
+
pageSize: 10,
|
|
102
|
+
onChange: undefined,
|
|
103
|
+
onShowSizeChange: undefined,
|
|
104
|
+
pageSizeOptions: [10, 20, 50, 100],
|
|
105
|
+
showSizeChanger: true,
|
|
106
|
+
showQuickJumper: false,
|
|
107
|
+
showTotal: true,
|
|
108
|
+
size: 'default',
|
|
109
|
+
style: undefined
|
|
110
|
+
};
|
|
111
|
+
var _default = exports.default = CustomPagination;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.MainContainer = 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 MainContainer = exports.MainContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ant-pagination-item {\n border: 1px solid #E0E0E0;\n }\n .ant-pagination-item-active {\n border: 1px solid #014FC5;\n }\n .mobile-pagination{margin: 0;padding:0;}\n .ant-pagination-total-text,.ant-pagination-options{display: none;}\n"])));
|
|
12
|
+
var _default = exports.default = {};
|