oa-componentbook 1.0.1-stage.45 → 1.0.1-stage.451
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/oa-component-accordion/Accordion.js +147 -40
- package/build/components/oa-component-accordion/styles.js +2 -2
- package/build/components/oa-component-button/CustomButton.js +24 -19
- package/build/components/oa-component-button/styles.js +1 -1
- package/build/components/oa-component-checkbox/CustomCheckBox.js +20 -17
- package/build/components/oa-component-checkbox/styles.js +1 -1
- package/build/components/oa-component-datepicker/CustomDatePicker.js +37 -26
- package/build/components/oa-component-document-details-panel/DocumentDetailsPanel.js +154 -0
- package/build/components/oa-component-drawer/CustomDrawer.js +2 -0
- package/build/components/oa-component-dropdown/CustomDropdown.js +16 -4
- package/build/components/oa-component-icons/MaterialIcon.js +1 -1
- package/build/components/oa-component-info/CustomInfo.js +9 -4
- package/build/components/oa-component-info/styles.js +3 -3
- package/build/components/oa-component-modal/CustomModal.js +59 -48
- package/build/components/oa-component-modal/styles.js +3 -2
- package/build/components/oa-component-pagination/CustomPagination.js +111 -0
- package/build/components/oa-component-pagination/styles.js +12 -0
- package/build/components/oa-component-progress-bar/CustomProgressBar.js +8 -4
- package/build/components/oa-component-select/CustomSelect.js +130 -56
- package/build/components/oa-component-steps/CustomSteps.js +117 -0
- package/build/components/oa-component-steps/styles.js +12 -0
- package/build/components/oa-component-table/CustomTable.js +28 -5
- package/build/components/oa-component-table/CustomTableV1.js +613 -0
- package/build/components/oa-component-table/styles.js +1 -1
- package/build/components/oa-component-table/stylesV1.js +19 -0
- package/build/components/oa-component-table-with-search-and-filter/TableWithSearchAndFilter.js +469 -0
- package/build/components/oa-component-table-with-search-and-filter/styles.js +23 -0
- package/build/components/oa-component-tabs/CustomTabs.js +1 -1
- package/build/components/oa-component-tag/CustomTag.js +29 -11
- package/build/components/oa-component-tag/styles.js +30 -3
- package/build/components/oa-component-textarea/CustomTextArea.js +161 -0
- package/build/components/oa-component-textarea/constants.js +39 -0
- package/build/components/oa-component-textarea/styles.js +12 -3
- package/build/components/oa-component-tooltip/CustomTooltip.js +8 -4
- package/build/components/oa-component-upload/CustomUpload.js +129 -42
- package/build/components/oa-component-viewer/CustomViewer.js +17 -11
- package/build/dev/oa-component-document-viewer/CustomDocumentViewer.js +367 -0
- package/build/dev/oa-component-document-viewer/styles.js +12 -0
- package/build/dev/oa-component-upload/CustomUpload.js +116 -29
- package/build/dev/oa-component-upload/styles.js +2 -2
- package/build/dev/oa-widget-document-modal/DocumentSideModal.js +166 -0
- package/build/dev/oa-widget-document-modal/styles.js +12 -0
- package/build/dev/oa-widget-document-side-drawer/DocumentSideDrawer.js +200 -0
- package/build/dev/oa-widget-document-side-drawer/styles.js +12 -0
- package/build/dev/oa-widget-document-viewer-with-details/DocumentViewerWithDetails.js +123 -0
- package/build/global-css/GlobalCss.js +2 -1
- package/build/global-css/GridLayout.js +1 -1
- package/build/global-css/commonStyles.js +11 -0
- package/build/images/Car.png +0 -0
- package/build/images/TwoWheeler.png +0 -0
- package/build/images/astronaut_emptystate.png +0 -0
- package/build/images/exportGrp01.png +0 -0
- package/build/images/exportGrp02.png +0 -0
- package/build/images/exportGrp03.png +0 -0
- package/build/images/outOfStock.png +0 -0
- package/build/index.js +131 -5
- package/build/layout/DetailDataLayout/DetailDataLayout.js +20 -0
- package/build/layout/DetailDataLayout/components/Form.js +22 -0
- package/build/layout/DetailDataLayout/components/Header.js +32 -0
- package/build/layout/DetailDataLayout/style.css +9 -0
- package/build/layout/DetailDataLayout/styles.js +12 -0
- package/build/layout/EntityOverviewLayout/EntityOverviewLayout.js +403 -0
- package/build/layout/EntityOverviewLayout/reducer/entityOverviewLayoutReducer.js +85 -0
- package/build/layout/EntityOverviewLayout/styles.js +13 -0
- package/build/layout/GenricLayOut/GenricLayOut.js +2421 -0
- package/build/layout/GenricLayOut/components/AppliedFilters.js +90 -0
- package/build/layout/GenricLayOut/components/CardList.js +34 -0
- package/build/layout/GenricLayOut/components/DropdownSearch.js +48 -0
- package/build/layout/GenricLayOut/components/Header.js +74 -0
- package/build/layout/GenricLayOut/components/Modal.js +96 -0
- package/build/layout/GenricLayOut/components/ProfileSection.js +219 -0
- package/build/layout/GenricLayOut/components/Search.js +51 -0
- package/build/layout/GenricLayOut/components/StaticFilter.css +73 -0
- package/build/layout/GenricLayOut/components/StaticFilter.js +37 -0
- package/build/layout/GenricLayOut/reducer/layoutReducer.js +310 -0
- package/build/layout/GenricLayOut/resolver/staticConfigResolver.js +98 -0
- package/build/layout/GenricLayOut/styles.js +42 -0
- package/build/utils/download-file.js +23 -0
- package/build/widgets/oa-form-widget/FormWidget.js +577 -0
- package/build/widgets/oa-form-widget/FormWidgetStyle.js +18 -0
- package/build/widgets/oa-widget-add-spare-part/AddSparePartCollapseWidget.js +80 -16
- package/build/widgets/oa-widget-add-spare-part/AddSparePartWidget.js +50 -7
- package/build/widgets/oa-widget-address/AddressWidget.js +12 -17
- package/build/widgets/oa-widget-approval/ApprovalWidget.js +19 -11
- package/build/widgets/oa-widget-approval/ApprovalWidgetNew.js +492 -0
- package/build/widgets/oa-widget-approval/styles.js +2 -2
- package/build/widgets/oa-widget-chat/ChatWidget.js +5 -5
- package/build/widgets/oa-widget-close-claim/CloseClaimWidget.js +17 -5
- package/build/widgets/oa-widget-collapsible-key-value/CollapsibleKeyValueWidget.js +396 -0
- package/build/widgets/oa-widget-collapsible-key-value/styles.js +16 -0
- package/build/widgets/oa-widget-content-panel/ContentPanel.js +82 -0
- package/build/widgets/oa-widget-content-panel/styles.js +12 -0
- package/build/widgets/oa-widget-customer-rating-card/CustomerRatingCard.js +5 -5
- package/build/widgets/oa-widget-detailcard/styles.js +1 -1
- package/build/widgets/oa-widget-document-upload/DocUploadWidget.js +6 -9
- package/build/widgets/oa-widget-dropdown-search-input/DropdownSearchInput.js +53 -19
- package/build/widgets/oa-widget-dropdown-search-input/styles.js +1 -1
- package/build/widgets/oa-widget-guide/GuideWidget.js +70 -0
- package/build/widgets/oa-widget-guide/GuideWidgetStyle.js +12 -0
- package/build/widgets/oa-widget-hub-automation-modal/HubAutomationDeleteBiker.js +24 -0
- package/build/widgets/oa-widget-hub-automation-modal/HubAutomationModal.js +34 -0
- package/build/widgets/oa-widget-hub-automation-modal/HubAutomationModalStyle.js +13 -0
- package/build/widgets/oa-widget-image-carousel/ImageCarouselWidget.js +74 -48
- package/build/widgets/oa-widget-image-carousel/styles.js +16 -5
- package/build/widgets/oa-widget-image-gallery/FullscreenViewer.js +169 -0
- package/build/widgets/oa-widget-image-gallery/ImageGallery.js +87 -0
- package/build/widgets/oa-widget-image-gallery/ThumbnailGrid.js +146 -0
- package/build/widgets/oa-widget-image-gallery/imageCache.js +15 -0
- package/build/widgets/oa-widget-image-gallery/imageGalleryStyle.js +16 -0
- package/build/widgets/oa-widget-item-info-card/InfoCardListWidget.js +60 -0
- package/build/widgets/oa-widget-item-info-card/ItemInfoCardWidget.js +83 -0
- package/build/widgets/oa-widget-item-info-card/styles.css +50 -0
- package/build/widgets/oa-widget-item-info-card/styles.js +14 -0
- package/build/widgets/oa-widget-key-value/KeyValueWidget.js +46 -12
- package/build/widgets/oa-widget-key-value/styles.js +1 -1
- package/build/widgets/oa-widget-kpi/KPICardWidget.js +86 -0
- package/build/widgets/oa-widget-kpi/styles.js +12 -0
- package/build/widgets/oa-widget-map-base-location/AddressDetails.js +21 -7
- package/build/widgets/oa-widget-map-base-location/AddressForm.js +32 -5
- package/build/widgets/oa-widget-map-base-location/MapBaseLocation.js +9 -3
- package/build/widgets/oa-widget-map-base-location/MapComponent.js +17 -2
- package/build/widgets/oa-widget-membershipcard/MembershipCard.js +14 -3
- package/build/widgets/oa-widget-membershipcard/styles.js +1 -1
- package/build/widgets/oa-widget-notes/NotesWidget.js +32 -30
- package/build/widgets/oa-widget-notes/styles.js +4 -3
- package/build/widgets/oa-widget-profile-data/ProfileDataWidget.js +165 -0
- package/build/widgets/oa-widget-profile-data/styles.js +13 -0
- package/build/widgets/oa-widget-progressive-steps/ProgressiveStepsWidget.js +362 -0
- package/build/widgets/oa-widget-progressive-steps/styles.js +12 -0
- package/build/widgets/oa-widget-reimbursement-breakup/ReimbursementBreakupWidget.js +18 -9
- package/build/widgets/oa-widget-reimbursement-breakup/styles.js +1 -1
- package/build/widgets/oa-widget-reupload-drawer/ReUploadDrawer.js +164 -0
- package/build/widgets/oa-widget-select-list-item-modal/SelectListItemModal.js +91 -0
- package/build/widgets/oa-widget-sidebar/SidebarWidget.js +175 -0
- package/build/widgets/oa-widget-sidebar/components/Header.js +33 -0
- package/build/widgets/oa-widget-sidebar/styles.js +13 -0
- package/build/widgets/oa-widget-spare-part/SparePartsWidget.js +63 -35
- package/build/widgets/oa-widget-track-shipment/TrackShipmentWidget.js +28 -6
- package/build/widgets/oa-widget-track-shipment-list/TrackShipmentWidgetList.js +103 -0
- package/build/widgets/oa-widget-track-shipment-list/fn.js +81 -0
- package/build/widgets/oa-widget-user-management/UserManagementWidget.js +407 -0
- package/build/widgets/oa-widget-user-management/styles.js +15 -0
- package/package.json +3 -1
- package/build/components/oa-component-textarea/TextArea.js +0 -74
- package/build/dev/oa-widget-track-shipment/TrackShipmentWidget.js +0 -195
- /package/build/{dev/oa-widget-track-shipment → widgets/oa-widget-track-shipment-list}/styles.js +0 -0
|
@@ -0,0 +1,154 @@
|
|
|
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 _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
|
+
var _Typography = _interopRequireDefault(require("../oa-component-typography/Typography"));
|
|
11
|
+
var _CustomButton = _interopRequireDefault(require("../oa-component-button/CustomButton"));
|
|
12
|
+
var _templateObject;
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
15
|
+
/**
|
|
16
|
+
* Styled container for the details panel
|
|
17
|
+
*/
|
|
18
|
+
const PanelContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background: var(--color-background, #fff);\n height: 100%;\n width: 100%;\n box-sizing: border-box;\n\n .panel-title {\n margin: 0 0 24px 0;\n }\n\n .table-container {\n border: 1px solid var(--color-border, #e8e8e8);\n border-radius: 4px;\n overflow: hidden;\n margin-bottom: 24px;\n }\n\n .section-header {\n background: var(--color-background-secondary, #f5f5f5);\n padding: 12px 16px;\n margin: 0;\n border-bottom: 1px solid var(--color-border, #e8e8e8);\n }\n\n .details-table {\n width: 100%;\n margin: 0;\n border-collapse: collapse;\n background: var(--color-background, #fff);\n }\n\n .details-row {\n border-bottom: 1px solid var(--color-border-light, #f0f0f0);\n }\n\n .details-row:last-child {\n border-bottom: none;\n }\n\n .details-label {\n width: 140px;\n min-width: 140px;\n padding: 16px;\n padding-right: 16px;\n text-align: left;\n vertical-align: top;\n }\n\n .details-value {\n padding: 16px;\n word-break: break-word;\n font-weight: 500;\n vertical-align: top;\n }\n\n .details-actions {\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n gap: 16px;\n margin-top: 0;\n padding-top: 0;\n border-top: none;\n }\n\n .details-actions button {\n padding: 0;\n }\n\n .children-container {\n margin-top: 24px;\n }\n"])));
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* DocumentDetailsPanel Component
|
|
22
|
+
*
|
|
23
|
+
* A reusable panel for displaying document/invoice details with key-value pairs.
|
|
24
|
+
* Can be used standalone or as children of DocumentSideDrawer, Modal, etc.
|
|
25
|
+
* Uses existing Typography and CustomButton components.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* // Standalone usage
|
|
29
|
+
* <DocumentDetailsPanel
|
|
30
|
+
* title="Check if the below details are correct"
|
|
31
|
+
* sectionTitle="INVOICE DETAILS"
|
|
32
|
+
* details={[
|
|
33
|
+
* { label: 'Date', value: '17 Nov 2025' },
|
|
34
|
+
* { label: 'Invoice Number', value: 'IEXPS8790L' },
|
|
35
|
+
* ]}
|
|
36
|
+
* actions={[
|
|
37
|
+
* { label: 'Download Invoice', onClick: () => {}, icon: <MaterialIcon icon={GetAppIcon} /> },
|
|
38
|
+
* ]}
|
|
39
|
+
* />
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* // With DocumentSideDrawer
|
|
43
|
+
* <DocumentSideDrawer title="VALIDATE" documentConfig={...}>
|
|
44
|
+
* <DocumentDetailsPanel
|
|
45
|
+
* title="Verify the details"
|
|
46
|
+
* details={[...]}
|
|
47
|
+
* actions={[...]}
|
|
48
|
+
* />
|
|
49
|
+
* </DocumentSideDrawer>
|
|
50
|
+
*/
|
|
51
|
+
function DocumentDetailsPanel(_ref) {
|
|
52
|
+
let {
|
|
53
|
+
title,
|
|
54
|
+
sectionTitle,
|
|
55
|
+
details,
|
|
56
|
+
actions,
|
|
57
|
+
children,
|
|
58
|
+
className,
|
|
59
|
+
style
|
|
60
|
+
} = _ref;
|
|
61
|
+
return /*#__PURE__*/_react.default.createElement(PanelContainer, {
|
|
62
|
+
className: className,
|
|
63
|
+
style: style
|
|
64
|
+
}, title && /*#__PURE__*/_react.default.createElement("div", {
|
|
65
|
+
className: "panel-title"
|
|
66
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
67
|
+
typography: "type-t2-700",
|
|
68
|
+
color: "primary-content"
|
|
69
|
+
}, title)), (sectionTitle || details && details.length > 0) && /*#__PURE__*/_react.default.createElement("div", {
|
|
70
|
+
className: "table-container"
|
|
71
|
+
}, sectionTitle && /*#__PURE__*/_react.default.createElement("div", {
|
|
72
|
+
className: "section-header"
|
|
73
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
74
|
+
typography: "type-sl1-700",
|
|
75
|
+
color: "secondary-content"
|
|
76
|
+
}, sectionTitle)), details && details.length > 0 && /*#__PURE__*/_react.default.createElement("table", {
|
|
77
|
+
className: "details-table",
|
|
78
|
+
role: "table",
|
|
79
|
+
"aria-label": sectionTitle || 'Details'
|
|
80
|
+
}, /*#__PURE__*/_react.default.createElement("tbody", null, details.map((detail, index) => {
|
|
81
|
+
const rowKey = detail.key || "detail-".concat(detail.label, "-").concat(index);
|
|
82
|
+
return /*#__PURE__*/_react.default.createElement("tr", {
|
|
83
|
+
className: "details-row",
|
|
84
|
+
key: rowKey
|
|
85
|
+
}, /*#__PURE__*/_react.default.createElement("th", {
|
|
86
|
+
className: "details-label",
|
|
87
|
+
scope: "row"
|
|
88
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
89
|
+
typography: "type-b2-400",
|
|
90
|
+
color: "secondary-content"
|
|
91
|
+
}, detail.label)), /*#__PURE__*/_react.default.createElement("td", {
|
|
92
|
+
className: "details-value"
|
|
93
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
94
|
+
typography: "type-b2-400",
|
|
95
|
+
color: "primary-content"
|
|
96
|
+
}, detail.value)));
|
|
97
|
+
})))), actions && actions.length > 0 && /*#__PURE__*/_react.default.createElement("div", {
|
|
98
|
+
className: "details-actions",
|
|
99
|
+
role: "group",
|
|
100
|
+
"aria-label": "Document actions"
|
|
101
|
+
}, actions.map((action, index) => {
|
|
102
|
+
const actionKey = action.key || "action-".concat(action.label, "-").concat(index);
|
|
103
|
+
return /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
104
|
+
key: actionKey,
|
|
105
|
+
label: action.label,
|
|
106
|
+
onClick: action.onClick,
|
|
107
|
+
type: "text-only",
|
|
108
|
+
size: "medium",
|
|
109
|
+
"aria-label": action.ariaLabel || action.label,
|
|
110
|
+
iconConfig: {
|
|
111
|
+
icon: action.icon || null,
|
|
112
|
+
position: 'left'
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
})), children && /*#__PURE__*/_react.default.createElement("div", {
|
|
116
|
+
className: "children-container"
|
|
117
|
+
}, children));
|
|
118
|
+
}
|
|
119
|
+
DocumentDetailsPanel.propTypes = {
|
|
120
|
+
/** Title text displayed at the top of the panel */
|
|
121
|
+
title: _propTypes.default.string,
|
|
122
|
+
/** Section header text (e.g., "INVOICE DETAILS") */
|
|
123
|
+
sectionTitle: _propTypes.default.string,
|
|
124
|
+
/** Array of detail items to display as key-value pairs */
|
|
125
|
+
details: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
126
|
+
key: _propTypes.default.string,
|
|
127
|
+
label: _propTypes.default.string.isRequired,
|
|
128
|
+
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number, _propTypes.default.node]).isRequired
|
|
129
|
+
})),
|
|
130
|
+
/** Array of action buttons/links to display */
|
|
131
|
+
actions: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
132
|
+
key: _propTypes.default.string,
|
|
133
|
+
label: _propTypes.default.string.isRequired,
|
|
134
|
+
onClick: _propTypes.default.func,
|
|
135
|
+
icon: _propTypes.default.node,
|
|
136
|
+
ariaLabel: _propTypes.default.string
|
|
137
|
+
})),
|
|
138
|
+
/** Additional content to render below the details */
|
|
139
|
+
children: _propTypes.default.node,
|
|
140
|
+
/** Additional CSS class */
|
|
141
|
+
className: _propTypes.default.string,
|
|
142
|
+
/** Inline styles */
|
|
143
|
+
style: _propTypes.default.object
|
|
144
|
+
};
|
|
145
|
+
DocumentDetailsPanel.defaultProps = {
|
|
146
|
+
title: null,
|
|
147
|
+
sectionTitle: null,
|
|
148
|
+
details: [],
|
|
149
|
+
actions: [],
|
|
150
|
+
children: null,
|
|
151
|
+
className: '',
|
|
152
|
+
style: {}
|
|
153
|
+
};
|
|
154
|
+
var _default = exports.default = DocumentDetailsPanel;
|
|
@@ -114,11 +114,13 @@ function CustomDrawer(_ref) {
|
|
|
114
114
|
title: isBaseDrawer ? /*#__PURE__*/_react.default.createElement(_styles.BaseDrawerTitle, null, DrawerTitle(title), /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
115
115
|
color: "primary-content",
|
|
116
116
|
icon: _CloseRounded.default,
|
|
117
|
+
className: "drawerCloseRoundedIcon",
|
|
117
118
|
onClick: handleClose,
|
|
118
119
|
size: 20,
|
|
119
120
|
"data-test": dataTest ? "".concat(dataTest, "--close-drawer-button") : undefined
|
|
120
121
|
})) : /*#__PURE__*/_react.default.createElement(_styles.LayeredDrawerTitle, null, /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
121
122
|
color: "primary-content",
|
|
123
|
+
className: "drawerCloseRoundedIcon",
|
|
122
124
|
icon: _ArrowBackIosRounded.default,
|
|
123
125
|
onClick: handleClose,
|
|
124
126
|
size: 20,
|
|
@@ -36,7 +36,8 @@ function CustomDropdown(_ref) {
|
|
|
36
36
|
firstLetterIcon,
|
|
37
37
|
trigger,
|
|
38
38
|
placement,
|
|
39
|
-
type
|
|
39
|
+
type,
|
|
40
|
+
onMenuItemClick
|
|
40
41
|
// dropDownHeading,
|
|
41
42
|
} = _ref;
|
|
42
43
|
const firstLetter = (displayText === null || displayText === void 0 || (_displayText$split = displayText.split(' ')) === null || _displayText$split === void 0 || (_displayText$split = _displayText$split[1]) === null || _displayText$split === void 0 ? void 0 : _displayText$split.charAt(0).toUpperCase()) || 'H'; // Extract the first letter after Hi.
|
|
@@ -52,7 +53,16 @@ function CustomDropdown(_ref) {
|
|
|
52
53
|
}
|
|
53
54
|
}, /*#__PURE__*/_react.default.createElement(_styles.default, null, firstLetterIcon && firstLetter && /*#__PURE__*/_react.default.createElement("small", null, firstLetter), /*#__PURE__*/_react.default.createElement(_antd.Dropdown, {
|
|
54
55
|
menu: {
|
|
55
|
-
items
|
|
56
|
+
items,
|
|
57
|
+
onClick: _ref2 => {
|
|
58
|
+
let {
|
|
59
|
+
key
|
|
60
|
+
} = _ref2;
|
|
61
|
+
const clickedItem = items.find(item => item.key === key);
|
|
62
|
+
if (clickedItem) {
|
|
63
|
+
onMenuItemClick(clickedItem);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
56
66
|
},
|
|
57
67
|
trigger: trigger,
|
|
58
68
|
placement: placement,
|
|
@@ -69,7 +79,8 @@ CustomDropdown.propTypes = {
|
|
|
69
79
|
firstLetterIcon: _propTypes.default.bool,
|
|
70
80
|
trigger: _propTypes.default.string,
|
|
71
81
|
placement: _propTypes.default.string,
|
|
72
|
-
type: _propTypes.default.string
|
|
82
|
+
type: _propTypes.default.string,
|
|
83
|
+
onMenuItemClick: _propTypes.default.func
|
|
73
84
|
// dropDownHeading: PropTypes.string,
|
|
74
85
|
};
|
|
75
86
|
CustomDropdown.defaultProps = {
|
|
@@ -85,6 +96,7 @@ CustomDropdown.defaultProps = {
|
|
|
85
96
|
firstLetterIcon: false,
|
|
86
97
|
trigger: ['click'],
|
|
87
98
|
placement: 'bottomRight',
|
|
88
|
-
type: 'default'
|
|
99
|
+
type: 'default',
|
|
100
|
+
onMenuItemClick: () => {}
|
|
89
101
|
// dropDownHeading: '',
|
|
90
102
|
};
|
|
@@ -39,7 +39,7 @@ function MaterialIcon(_ref) {
|
|
|
39
39
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
40
40
|
const renderedIcon = /*#__PURE__*/_react.default.createElement(Icon, _extends({
|
|
41
41
|
style: _objectSpread({
|
|
42
|
-
color: color ? _ColorVariablesMap.default["--color-".concat(color)] : undefined,
|
|
42
|
+
color: color && _ColorVariablesMap.default["--color-".concat(color)] ? _ColorVariablesMap.default["--color-".concat(color)] : color || undefined,
|
|
43
43
|
fontSize: size ? "".concat(size, "px") : 'inherit',
|
|
44
44
|
transition: 'transform .3s ease',
|
|
45
45
|
transform: "rotate(".concat(rotate, "deg)")
|
|
@@ -27,6 +27,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
27
27
|
* @param {string} fontColor - The color of the text.
|
|
28
28
|
* @param {object} iconConfig - Configuration for the icon.
|
|
29
29
|
* @param {string} title - The title to be displayed.
|
|
30
|
+
* @param {string} borderColor - The border color of the component.
|
|
30
31
|
*
|
|
31
32
|
* @returns {ReactElement} A styled component with the specified properties.
|
|
32
33
|
*/
|
|
@@ -37,7 +38,8 @@ function CustomInfo(_ref) {
|
|
|
37
38
|
description,
|
|
38
39
|
fontColor,
|
|
39
40
|
iconConfig,
|
|
40
|
-
title
|
|
41
|
+
title,
|
|
42
|
+
borderColor
|
|
41
43
|
} = _ref;
|
|
42
44
|
/**
|
|
43
45
|
* Renders the icon based on the presence of a title.
|
|
@@ -65,7 +67,8 @@ function CustomInfo(_ref) {
|
|
|
65
67
|
}, renderIcon()) : renderIcon();
|
|
66
68
|
};
|
|
67
69
|
return /*#__PURE__*/_react.default.createElement(_styles.InfoContainer, {
|
|
68
|
-
$color: color
|
|
70
|
+
$color: color,
|
|
71
|
+
$borderColor: borderColor
|
|
69
72
|
}, /*#__PURE__*/_react.default.createElement(_styles.RowFlex, null, iconConfig.position === 'left' && conditionallyAddTooltipToIcon(), /*#__PURE__*/_react.default.createElement(_styles.ColFlex, null, title && /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
70
73
|
color: fontColor,
|
|
71
74
|
typography: "type-t2-700"
|
|
@@ -96,7 +99,8 @@ CustomInfo.propTypes = {
|
|
|
96
99
|
position: _propTypes.default.oneOf(['left', 'right']),
|
|
97
100
|
tooltipText: _propTypes.default.string
|
|
98
101
|
}),
|
|
99
|
-
title: _propTypes.default.string
|
|
102
|
+
title: _propTypes.default.string,
|
|
103
|
+
borderColor: _propTypes.default.string
|
|
100
104
|
};
|
|
101
105
|
CustomInfo.defaultProps = {
|
|
102
106
|
buttonConfig: {
|
|
@@ -110,5 +114,6 @@ CustomInfo.defaultProps = {
|
|
|
110
114
|
},
|
|
111
115
|
fontColor: 'primary-content',
|
|
112
116
|
title: '',
|
|
113
|
-
description: ''
|
|
117
|
+
description: '',
|
|
118
|
+
borderColor: ''
|
|
114
119
|
};
|
|
@@ -8,8 +8,8 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
8
8
|
var _templateObject, _templateObject2, _templateObject3;
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
10
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
11
|
-
const RowFlex = exports.RowFlex = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n
|
|
12
|
-
const ColFlex = exports.ColFlex = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n
|
|
11
|
+
const RowFlex = exports.RowFlex = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n gap: 8px;\n"])));
|
|
12
|
+
const ColFlex = exports.ColFlex = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n gap: 8px;\n"])));
|
|
13
13
|
const InfoContainer = exports.InfoContainer = (0, _styledComponents.default)(RowFlex).attrs({
|
|
14
14
|
as: 'section'
|
|
15
|
-
})(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding: 12px;\n align-items: center;\n border-radius: 8px;\n background-color: var(--color-", ");\n \n button {\n margin-left: 8px;\n }
|
|
15
|
+
})(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding: 12px;\n align-items: center;\n border-radius: 8px;\n background-color: var(--color-", ");\n border: 1px solid var(--color-", ");\n\n button {\n margin-left: 8px;\n }\n"])), props => props.$color, props => props.$borderColor);
|
|
@@ -14,53 +14,58 @@ var _Typography = _interopRequireDefault(require("../oa-component-typography/Typ
|
|
|
14
14
|
var _typographyOptions = require("../../global-css/typography-options");
|
|
15
15
|
var _utils = require("../../utils");
|
|
16
16
|
var _styles = require("./styles");
|
|
17
|
-
const _excluded = ["buttonConfig", "children", "data-test", "imgSrc", "onCancel", "open", "title", "typographies", "width"];
|
|
17
|
+
const _excluded = ["buttonConfig", "children", "data-test", "imgSrc", "onCancel", "open", "title", "typographies", "width", "bgColor", "showCloseIcon", "maskClosable"];
|
|
18
|
+
/* eslint-disable */
|
|
18
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
20
|
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
21
|
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
22
|
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
|
/**
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
24
|
+
* This is a custom Modal component that extends the default antd Modal
|
|
25
|
+
* component.
|
|
26
|
+
*
|
|
27
|
+
* The open state of the modal is controlled by the parent component.
|
|
28
|
+
*
|
|
29
|
+
* The parent can also provide a callback function to be called when the
|
|
30
|
+
* cancel button is clicked.
|
|
31
|
+
*
|
|
32
|
+
* The width of the modal can be customized by providing a width prop.
|
|
33
|
+
*
|
|
34
|
+
* The buttons for the modal can be customized by providing a buttonConfig
|
|
35
|
+
* prop.
|
|
36
|
+
*
|
|
37
|
+
* The title of the modal can be provided as a string or as an image.
|
|
38
|
+
*
|
|
39
|
+
* The children of the modal can be provided as a string or a number, or as
|
|
40
|
+
* JSX elements.
|
|
41
|
+
*
|
|
42
|
+
* The typography of the title and description can be customized by providing
|
|
43
|
+
* a typographies object.
|
|
44
|
+
*
|
|
45
|
+
* The modal is centered by default.
|
|
46
|
+
*
|
|
47
|
+
* The modal is rendered with a gray background.
|
|
48
|
+
*
|
|
49
|
+
* The modal is rendered with a close button.
|
|
50
|
+
*
|
|
51
|
+
* The parent can provide additional props to the Modal component.
|
|
52
|
+
*/
|
|
52
53
|
function CustomModal(_ref) {
|
|
53
54
|
let {
|
|
54
55
|
buttonConfig,
|
|
55
56
|
children,
|
|
56
|
-
|
|
57
|
+
"data-test": dataTest,
|
|
57
58
|
imgSrc,
|
|
58
59
|
// This callback function provided by parent is called upon clicking on the cancel button
|
|
59
60
|
onCancel,
|
|
60
61
|
open,
|
|
61
62
|
title,
|
|
62
63
|
typographies,
|
|
63
|
-
width
|
|
64
|
+
width,
|
|
65
|
+
bgColor,
|
|
66
|
+
showCloseIcon = true,
|
|
67
|
+
// Add this prop with default value
|
|
68
|
+
maskClosable = true // Control whether clicking mask closes modal
|
|
64
69
|
} = _ref,
|
|
65
70
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
66
71
|
/*
|
|
@@ -75,15 +80,15 @@ function CustomModal(_ref) {
|
|
|
75
80
|
return /*#__PURE__*/_react.default.createElement(_antd.ConfigProvider, {
|
|
76
81
|
theme: {
|
|
77
82
|
token: {
|
|
78
|
-
colorBgMask:
|
|
83
|
+
colorBgMask: bgColor || "rgba(0, 0, 0, 0.7)"
|
|
79
84
|
}
|
|
80
85
|
}
|
|
81
86
|
}, open && /*#__PURE__*/_react.default.createElement(_antd.Modal, _extends({
|
|
82
|
-
closeIcon: /*#__PURE__*/_react.default.createElement(_icons.CloseCircleFilled, {
|
|
87
|
+
closeIcon: showCloseIcon ? /*#__PURE__*/_react.default.createElement(_icons.CloseCircleFilled, {
|
|
83
88
|
style: {
|
|
84
|
-
fontSize:
|
|
89
|
+
fontSize: "26px"
|
|
85
90
|
}
|
|
86
|
-
}),
|
|
91
|
+
}) : false,
|
|
87
92
|
centered: true,
|
|
88
93
|
"data-test": dataTest,
|
|
89
94
|
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({
|
|
@@ -94,17 +99,21 @@ function CustomModal(_ref) {
|
|
|
94
99
|
onClick: button.callback,
|
|
95
100
|
size: "large",
|
|
96
101
|
type: button === null || button === void 0 ? void 0 : button.type,
|
|
97
|
-
"data-test": button[
|
|
102
|
+
"data-test": button["data-test"]
|
|
98
103
|
})))),
|
|
99
104
|
onCancel: handleCancel,
|
|
100
105
|
open: open,
|
|
101
106
|
title: (title || imgSrc) && /*#__PURE__*/_react.default.createElement(_styles.TitleContainer, null, imgSrc && /*#__PURE__*/_react.default.createElement("img", {
|
|
102
107
|
src: imgSrc,
|
|
103
|
-
alt: ""
|
|
108
|
+
alt: "",
|
|
109
|
+
onError: e => {
|
|
110
|
+
e.target.style.display = "none";
|
|
111
|
+
}
|
|
104
112
|
}), /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
105
113
|
typography: typographies.title
|
|
106
114
|
}, title)),
|
|
107
|
-
width: width
|
|
115
|
+
width: width,
|
|
116
|
+
maskClosable: maskClosable
|
|
108
117
|
}, props), children && /*#__PURE__*/_react.default.createElement(_styles.DescriptionContainer, null,
|
|
109
118
|
// The label is a string or a number
|
|
110
119
|
((0, _utils.isString)(children) || (0, _utils.isNumber)(children)) && /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
@@ -116,17 +125,17 @@ CustomModal.propTypes = {
|
|
|
116
125
|
// Array of button configurations
|
|
117
126
|
buttonConfig: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
118
127
|
callback: _propTypes.default.func.isRequired,
|
|
119
|
-
|
|
128
|
+
"data-test": _propTypes.default.string,
|
|
120
129
|
label: _propTypes.default.string,
|
|
121
130
|
iconConfig: _propTypes.default.shape({
|
|
122
131
|
icon: _propTypes.default.node,
|
|
123
|
-
position: _propTypes.default.oneOf([
|
|
132
|
+
position: _propTypes.default.oneOf(["left", "right"]),
|
|
124
133
|
style: _propTypes.default.objectOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]))
|
|
125
134
|
}),
|
|
126
|
-
type: _propTypes.default.oneOf([
|
|
135
|
+
type: _propTypes.default.oneOf(["primary", "secondary", "text-only", "danger-primary", "danger-secondary", "danger-text-only"])
|
|
127
136
|
})),
|
|
128
137
|
children: _propTypes.default.node,
|
|
129
|
-
|
|
138
|
+
"data-test": _propTypes.default.string,
|
|
130
139
|
title: _propTypes.default.string,
|
|
131
140
|
typographies: _propTypes.default.shape({
|
|
132
141
|
title: _propTypes.default.oneOf(_typographyOptions.typographyOptions),
|
|
@@ -135,19 +144,21 @@ CustomModal.propTypes = {
|
|
|
135
144
|
imgSrc: _propTypes.default.string,
|
|
136
145
|
onCancel: _propTypes.default.func.isRequired,
|
|
137
146
|
open: _propTypes.default.bool,
|
|
138
|
-
width: _propTypes.default.string || _propTypes.default.number
|
|
147
|
+
width: _propTypes.default.string || _propTypes.default.number,
|
|
148
|
+
showCloseIcon: _propTypes.default.bool
|
|
139
149
|
};
|
|
140
150
|
CustomModal.defaultProps = {
|
|
141
151
|
buttonConfig: [],
|
|
142
152
|
children: null,
|
|
143
|
-
|
|
153
|
+
"data-test": null,
|
|
144
154
|
imgSrc: null,
|
|
145
155
|
open: true,
|
|
146
156
|
title: null,
|
|
147
157
|
typographies: {
|
|
148
|
-
title:
|
|
149
|
-
children:
|
|
158
|
+
title: "type-t1-500",
|
|
159
|
+
children: "type-b2-400"
|
|
150
160
|
},
|
|
151
|
-
width: 416
|
|
161
|
+
width: 416,
|
|
162
|
+
showCloseIcon: true
|
|
152
163
|
};
|
|
153
164
|
var _default = exports.default = CustomModal;
|
|
@@ -6,8 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.TitleContainer = exports.DescriptionContainer = exports.ButtonContainer = void 0;
|
|
7
7
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
8
|
var _templateObject, _templateObject2, _templateObject3;
|
|
9
|
+
/* eslint-disable */
|
|
9
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
11
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
11
|
-
const ButtonContainer = exports.ButtonContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n gap: 16px;\n justify-content: flex-end;\n margin:
|
|
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"])));
|
|
12
13
|
const DescriptionContainer = exports.DescriptionContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding: 12px 0 0;\n"])));
|
|
13
|
-
const TitleContainer = exports.TitleContainer = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\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,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 = {};
|
|
@@ -18,6 +18,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
18
18
|
* @param {number} totalStep - The total number of steps in the progress.
|
|
19
19
|
* @param {string} headingColor - The color used for the step text heading.
|
|
20
20
|
* @param {string} barColor - The color used for the progress bar.
|
|
21
|
+
* @param {boolean} showStepText - Whether to display the step text (Step X out of Y).
|
|
21
22
|
*
|
|
22
23
|
* @returns {React.ReactElement} A component displaying the current progress.
|
|
23
24
|
*/
|
|
@@ -26,9 +27,10 @@ function ProgressBar(_ref) {
|
|
|
26
27
|
currentStep,
|
|
27
28
|
totalStep,
|
|
28
29
|
headingColor,
|
|
29
|
-
barColor
|
|
30
|
+
barColor,
|
|
31
|
+
showStepText
|
|
30
32
|
} = _ref;
|
|
31
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
33
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, showStepText && /*#__PURE__*/_react.default.createElement("div", {
|
|
32
34
|
className: "margin-bottom-8"
|
|
33
35
|
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
34
36
|
color: headingColor,
|
|
@@ -57,12 +59,14 @@ ProgressBar.propTypes = {
|
|
|
57
59
|
currentStep: _propTypes.default.number,
|
|
58
60
|
totalStep: _propTypes.default.number,
|
|
59
61
|
headingColor: _propTypes.default.string,
|
|
60
|
-
barColor: _propTypes.default.string
|
|
62
|
+
barColor: _propTypes.default.string,
|
|
63
|
+
showStepText: _propTypes.default.bool
|
|
61
64
|
};
|
|
62
65
|
ProgressBar.defaultProps = {
|
|
63
66
|
currentStep: 1,
|
|
64
67
|
totalStep: 1,
|
|
65
68
|
headingColor: 'positive',
|
|
66
|
-
barColor: 'positive'
|
|
69
|
+
barColor: 'positive',
|
|
70
|
+
showStepText: true
|
|
67
71
|
};
|
|
68
72
|
var _default = exports.default = ProgressBar;
|