oa-componentbook 1.0.1-stage.4 → 1.0.1-stage.400
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 +129 -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-drawer/CustomDrawer.js +2 -0
- package/build/components/oa-component-dropdown/CustomDropdown.js +16 -4
- 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-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 +51 -46
- 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-select/CustomSelect.js +116 -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 +610 -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-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/{TextArea.js → CustomTextArea.js} +4 -4
- package/build/components/oa-component-tooltip/CustomTooltip.js +8 -4
- package/build/components/oa-component-upload/CustomUpload.js +120 -40
- package/build/components/oa-component-viewer/CustomViewer.js +3 -1
- 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 +3 -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/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/oaChat.svg +5 -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 +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 +2314 -0
- package/build/layout/GenricLayOut/components/AppliedFilters.js +91 -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 +93 -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 +30 -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/download-file.js +23 -0
- package/build/widgets/oa-form-widget/FormWidget.js +576 -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-feedback/FeedbackWidget.js +83 -0
- package/build/widgets/oa-widget-feedback/styles.js +13 -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-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-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 +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 +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 +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 +79 -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 +57 -29
- 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 +352 -0
- package/build/widgets/oa-widget-user-management/styles.js +15 -0
- package/package.json +7 -2
- 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
|
@@ -22,9 +22,10 @@ var _Typography = _interopRequireDefault(require("../oa-component-typography/Typ
|
|
|
22
22
|
var _ColorVariablesMap = _interopRequireDefault(require("../../global-css/ColorVariablesMap"));
|
|
23
23
|
require("antd/dist/reset.css");
|
|
24
24
|
var _Elevation = require("../../global-css/Elevation");
|
|
25
|
-
const _excluded = ["allText", "children", "defaultValue", "data-test", "mode", "onSelectionChange", "options", "placeholder"],
|
|
25
|
+
const _excluded = ["allText", "children", "defaultValue", "data-test", "mode", "onSelectionChange", "options", "placeholder", "maxSelectForMultiSelect", "onCustomSelect"],
|
|
26
26
|
_excluded2 = ["label", "disabled", "value"];
|
|
27
27
|
var _templateObject;
|
|
28
|
+
/* eslint-disable */
|
|
28
29
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
30
|
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); }
|
|
30
31
|
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; }
|
|
@@ -40,7 +41,7 @@ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(
|
|
|
40
41
|
const {
|
|
41
42
|
Option
|
|
42
43
|
} = _antd.Select;
|
|
43
|
-
const StyledSelect = (0, _styledComponents.default)(_antd.Select)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n /* Hiding the last tag in case of All being selected. */\n
|
|
44
|
+
const StyledSelect = (0, _styledComponents.default)(_antd.Select)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n /* Hiding the last tag in case of All being selected. */\n .ant-select-selection-overflow-item.ant-select-selection-overflow-item-rest {\n display: ", ";\n }\n .ant-select-selection-item-content {\n max-width: 70px;\n }\n"])), props => props.maxTagCount === 1 ? "none" : undefined);
|
|
44
45
|
|
|
45
46
|
/**
|
|
46
47
|
* Takes an array of values and an object mapping values to labels and returns an
|
|
@@ -75,17 +76,18 @@ function CustomSelect(_ref) {
|
|
|
75
76
|
allText,
|
|
76
77
|
children,
|
|
77
78
|
defaultValue,
|
|
78
|
-
|
|
79
|
+
"data-test": dataTest,
|
|
79
80
|
mode,
|
|
80
81
|
onSelectionChange,
|
|
81
82
|
options,
|
|
82
|
-
placeholder
|
|
83
|
+
placeholder,
|
|
84
|
+
maxSelectForMultiSelect,
|
|
85
|
+
onCustomSelect
|
|
83
86
|
} = _ref,
|
|
84
87
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
85
88
|
// If allText is present in default values, we select all the options manually.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
if (mode === 'multiple' && allText && defaultValue !== null && defaultValue !== void 0 && defaultValue.includes(allText)) {
|
|
89
|
+
const actualDefaultValue = mode === "multiple" ? [...defaultValue] : defaultValue;
|
|
90
|
+
if (mode === "multiple" && allText && defaultValue !== null && defaultValue !== void 0 && defaultValue.includes(allText)) {
|
|
89
91
|
var _options$filter$map, _options$filter;
|
|
90
92
|
// Emptying the array first.
|
|
91
93
|
actualDefaultValue.length = 0;
|
|
@@ -99,52 +101,77 @@ function CustomSelect(_ref) {
|
|
|
99
101
|
return !((_option$disabled = option === null || option === void 0 ? void 0 : option.disabled) !== null && _option$disabled !== void 0 ? _option$disabled : false);
|
|
100
102
|
})) === null || _options$filter === void 0 ? void 0 : _options$filter.map(option => option.value)) !== null && _options$filter$map !== void 0 ? _options$filter$map : []));
|
|
101
103
|
}
|
|
102
|
-
const
|
|
104
|
+
const [selectedOptions, setSelectedOptions] = (0, _react.useState)(actualDefaultValue);
|
|
105
|
+
const valueLabelMap = Array.isArray(options) && (options === null || options === void 0 ? void 0 : options.reduce((accumulator, option) => {
|
|
103
106
|
var _option$label;
|
|
104
107
|
accumulator[option.value] = (_option$label = option === null || option === void 0 ? void 0 : option.label) !== null && _option$label !== void 0 ? _option$label : option.value;
|
|
105
108
|
return accumulator;
|
|
106
|
-
}, {});
|
|
107
|
-
const actualOptions = options
|
|
109
|
+
}, {}));
|
|
110
|
+
const actualOptions = Array.isArray(options) && options.map(option => {
|
|
108
111
|
const {
|
|
109
112
|
label,
|
|
110
113
|
disabled = false,
|
|
111
114
|
value
|
|
112
115
|
} = option,
|
|
113
116
|
otherProperties = _objectWithoutProperties(option, _excluded2);
|
|
117
|
+
const shouldDisableOption = (option, selectedOptions, maxSelectForMultiSelect, allText) => {
|
|
118
|
+
var _selectedOptions$filt;
|
|
119
|
+
// If option is already disabled, keep it disabled
|
|
120
|
+
if (option.disabled) return true;
|
|
121
|
+
|
|
122
|
+
// If no max limit, don't disable
|
|
123
|
+
if (!maxSelectForMultiSelect) return false;
|
|
124
|
+
|
|
125
|
+
// If this option is already selected, don't disable it (so user can deselect)
|
|
126
|
+
if (selectedOptions !== null && selectedOptions !== void 0 && selectedOptions.includes(option.value)) return false;
|
|
127
|
+
|
|
128
|
+
// If this is the 'all' option, don't disable it
|
|
129
|
+
if (option.value === allText) return false;
|
|
130
|
+
|
|
131
|
+
// Check if we've reached the max limit (excluding allText)
|
|
132
|
+
const actualSelectionCount = (selectedOptions === null || selectedOptions === void 0 || (_selectedOptions$filt = selectedOptions.filter(val => val !== allText)) === null || _selectedOptions$filt === void 0 ? void 0 : _selectedOptions$filt.length) || 0;
|
|
133
|
+
return actualSelectionCount >= maxSelectForMultiSelect;
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
// Determine if this option should be disabled due to max limit
|
|
137
|
+
const shouldBeDisabled = shouldDisableOption(option, selectedOptions, maxSelectForMultiSelect, allText);
|
|
138
|
+
const finalDisabled = disabled || shouldBeDisabled;
|
|
114
139
|
if ((0, _utils.isString)(label) || (0, _utils.isNumber)(label)) {
|
|
115
140
|
return _objectSpread({
|
|
116
141
|
label: /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
117
|
-
color:
|
|
142
|
+
color: finalDisabled ? "placeholder-text" : undefined,
|
|
118
143
|
typography: "type-b2-400",
|
|
144
|
+
title: label,
|
|
119
145
|
"data-test": dataTest ? "".concat(dataTest, "-(").concat(label, ")") : undefined
|
|
120
146
|
}, label),
|
|
121
|
-
disabled,
|
|
147
|
+
disabled: finalDisabled,
|
|
122
148
|
value
|
|
123
149
|
}, otherProperties);
|
|
124
150
|
}
|
|
125
151
|
if ( /*#__PURE__*/_react.default.isValidElement(label)) {
|
|
126
152
|
return _objectSpread({
|
|
127
153
|
label: dataTest ? /*#__PURE__*/_react.default.cloneElement(label, {
|
|
128
|
-
|
|
154
|
+
"data-test": "".concat(dataTest, "-(").concat(label, ")")
|
|
129
155
|
}) : label,
|
|
130
|
-
disabled,
|
|
156
|
+
disabled: finalDisabled,
|
|
131
157
|
value
|
|
132
158
|
}, otherProperties);
|
|
133
159
|
}
|
|
134
160
|
if ((0, _utils.isString)(value) || (0, _utils.isNumber)(value)) {
|
|
135
161
|
return _objectSpread({
|
|
136
162
|
label: /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
137
|
-
color:
|
|
163
|
+
color: finalDisabled ? "placeholder-text" : undefined,
|
|
138
164
|
typography: "type-b2-400",
|
|
139
165
|
"data-test": dataTest ? "".concat(dataTest, "-(").concat(value, ")") : undefined
|
|
140
166
|
}, value),
|
|
141
167
|
value,
|
|
142
|
-
disabled
|
|
168
|
+
disabled: finalDisabled
|
|
143
169
|
}, otherProperties);
|
|
144
170
|
}
|
|
145
|
-
return option
|
|
171
|
+
return _objectSpread(_objectSpread({}, option), {}, {
|
|
172
|
+
disabled: finalDisabled
|
|
173
|
+
});
|
|
146
174
|
});
|
|
147
|
-
const [selectedOptions, setSelectedOptions] = (0, _react.useState)(actualDefaultValue);
|
|
148
175
|
|
|
149
176
|
/**
|
|
150
177
|
* Return a placeholder text for the maxTagCount option.
|
|
@@ -203,7 +230,18 @@ function CustomSelect(_ref) {
|
|
|
203
230
|
value
|
|
204
231
|
});
|
|
205
232
|
};
|
|
206
|
-
|
|
233
|
+
/**
|
|
234
|
+
* Checks if maximum selection limit has been reached
|
|
235
|
+
* @param {Array} currentSelection - Current selected options array
|
|
236
|
+
* @param {Boolean} isSelecting - Whether we're selecting (true) or deselecting (false)
|
|
237
|
+
* @returns {Boolean} - True if max limit would be exceeded
|
|
238
|
+
*/
|
|
239
|
+
const isMaxSelectReached = currentSelection => {
|
|
240
|
+
var _currentSelection$fil;
|
|
241
|
+
// Count selections excluding allText if present
|
|
242
|
+
const actualSelectionCount = (currentSelection === null || currentSelection === void 0 || (_currentSelection$fil = currentSelection.filter(option => option !== allText)) === null || _currentSelection$fil === void 0 ? void 0 : _currentSelection$fil.length) || 0;
|
|
243
|
+
return actualSelectionCount >= maxSelectForMultiSelect;
|
|
244
|
+
};
|
|
207
245
|
/**
|
|
208
246
|
* This function is called whenever the selection changes for a multiple select.
|
|
209
247
|
* @param {Boolean} select - True if the option was selected, false if it was deselected.
|
|
@@ -222,6 +260,10 @@ function CustomSelect(_ref) {
|
|
|
222
260
|
newlySelectedOptions.splice(allIndex, 1);
|
|
223
261
|
}
|
|
224
262
|
if (select) {
|
|
263
|
+
if (maxSelectForMultiSelect && value !== allText && isMaxSelectReached(newlySelectedOptions)) {
|
|
264
|
+
// Don't proceed with selection if max limit reached
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
225
267
|
if (value === allText) {
|
|
226
268
|
newlySelectedOptions.length = 0; // Emptying the array.
|
|
227
269
|
|
|
@@ -229,7 +271,7 @@ function CustomSelect(_ref) {
|
|
|
229
271
|
addAllOptions(options, newlySelectedOptions);
|
|
230
272
|
} else {
|
|
231
273
|
safePush(newlySelectedOptions, value);
|
|
232
|
-
const enabledOptions = options.filter(option => {
|
|
274
|
+
const enabledOptions = options === null || options === void 0 ? void 0 : options.filter(option => {
|
|
233
275
|
var _option$disabled2;
|
|
234
276
|
return !((_option$disabled2 = option === null || option === void 0 ? void 0 : option.disabled) !== null && _option$disabled2 !== void 0 ? _option$disabled2 : false);
|
|
235
277
|
});
|
|
@@ -249,14 +291,14 @@ function CustomSelect(_ref) {
|
|
|
249
291
|
onSelectionChange(valuesArrayToOptionArray(optionsWithoutAllText, valueLabelMap));
|
|
250
292
|
setSelectedOptions(newlySelectedOptions);
|
|
251
293
|
};
|
|
252
|
-
const onOptionsChange = mode ===
|
|
294
|
+
const onOptionsChange = mode === "multiple" ? onOptionsChangeForMultiple : onOptionsChangeForSingle;
|
|
253
295
|
return /*#__PURE__*/_react.default.createElement(_antd.ConfigProvider, {
|
|
254
296
|
theme: {
|
|
255
297
|
components: {
|
|
256
298
|
Select: {
|
|
257
|
-
optionHeight: (props === null || props === void 0 ? void 0 : props.size) ===
|
|
258
|
-
optionSelectedBg: _ColorVariablesMap.default[
|
|
259
|
-
optionSelectedColor: _ColorVariablesMap.default[
|
|
299
|
+
optionHeight: (props === null || props === void 0 ? void 0 : props.size) === "small" ? "36px" : "52px",
|
|
300
|
+
optionSelectedBg: _ColorVariablesMap.default["--color-primary-background"],
|
|
301
|
+
optionSelectedColor: _ColorVariablesMap.default["--color-primary"]
|
|
260
302
|
// optionPadding: [3, 2],
|
|
261
303
|
// optionPadding: (props?.size === 'small') ? '8px 12px' : '16 16',
|
|
262
304
|
// activeShadow: '0px 0px 4px 0px red', // Box shadow for active select box.
|
|
@@ -264,18 +306,18 @@ function CustomSelect(_ref) {
|
|
|
264
306
|
},
|
|
265
307
|
token: {
|
|
266
308
|
// controlOutline: '4px 4px 4px 4px red', // an attempt at applying box shadow
|
|
267
|
-
colorTextPlaceholder: _ColorVariablesMap.default[
|
|
309
|
+
colorTextPlaceholder: _ColorVariablesMap.default["--color-placeholder-text"],
|
|
268
310
|
// Color of placeholder text
|
|
269
|
-
colorTextQuaternary: _ColorVariablesMap.default[
|
|
311
|
+
colorTextQuaternary: _ColorVariablesMap.default["--color-secondary-content"],
|
|
270
312
|
// Color of dropdown arrow.
|
|
271
313
|
|
|
272
|
-
colorPrimary: _ColorVariablesMap.default[
|
|
314
|
+
colorPrimary: _ColorVariablesMap.default["--color-primary"],
|
|
273
315
|
// for active color of select
|
|
274
|
-
colorPrimaryHover: _ColorVariablesMap.default[
|
|
316
|
+
colorPrimaryHover: _ColorVariablesMap.default["--color-primary"],
|
|
275
317
|
// for hover color of select
|
|
276
|
-
borderRadius:
|
|
318
|
+
borderRadius: "4px",
|
|
277
319
|
// For border radius of select text field.
|
|
278
|
-
borderRadiusLG:
|
|
320
|
+
borderRadiusLG: "4px",
|
|
279
321
|
// For border radius of dropdown
|
|
280
322
|
controlHeight: 48,
|
|
281
323
|
// height of text field (tag height is half of this, i.e. 24px)
|
|
@@ -283,46 +325,56 @@ function CustomSelect(_ref) {
|
|
|
283
325
|
// height of small text field
|
|
284
326
|
|
|
285
327
|
// This controls padding of larger text box
|
|
286
|
-
controlPaddingHorizontalSM: (props === null || props === void 0 ? void 0 : props.size) ===
|
|
328
|
+
controlPaddingHorizontalSM: (props === null || props === void 0 ? void 0 : props.size) === "small" ? 13 : 17,
|
|
287
329
|
// 1 extra so that it shows 12px and 16px in browser console.
|
|
288
|
-
paddingSM: (props === null || props === void 0 ? void 0 : props.size) ===
|
|
330
|
+
paddingSM: (props === null || props === void 0 ? void 0 : props.size) === "small" ? 13 : 17,
|
|
289
331
|
// paddingSM is what determines padding of input box.
|
|
290
332
|
|
|
291
|
-
controlItemBgHover: _ColorVariablesMap.default[
|
|
333
|
+
controlItemBgHover: _ColorVariablesMap.default["--color-background-info"],
|
|
292
334
|
// hover color of items
|
|
293
|
-
colorBgElevated: _ColorVariablesMap.default[
|
|
335
|
+
colorBgElevated: _ColorVariablesMap.default["--color-primary-background"],
|
|
294
336
|
// background color of dropdown
|
|
295
337
|
// multipleItemHeight: 100,
|
|
296
|
-
colorBgContainerDisabled: _ColorVariablesMap.default[
|
|
338
|
+
colorBgContainerDisabled: _ColorVariablesMap.default["--color-divider"],
|
|
297
339
|
// background color of disabled select
|
|
298
|
-
colorBorder: _ColorVariablesMap.default[
|
|
299
|
-
colorFillSecondary: _ColorVariablesMap.default[
|
|
340
|
+
colorBorder: _ColorVariablesMap.default["--color-placeholder-text"],
|
|
341
|
+
colorFillSecondary: _ColorVariablesMap.default["--color-secondary-background"],
|
|
300
342
|
// background color for tags
|
|
301
343
|
|
|
302
|
-
colorText: _ColorVariablesMap.default[
|
|
344
|
+
colorText: _ColorVariablesMap.default["--color-primary-content"],
|
|
303
345
|
// Text color of unselected options in dropdown
|
|
304
|
-
colorTextDisabled: _ColorVariablesMap.default[
|
|
346
|
+
colorTextDisabled: _ColorVariablesMap.default["--color-secondary-content"],
|
|
305
347
|
// Text color when disabled
|
|
306
348
|
|
|
307
|
-
colorIcon: _ColorVariablesMap.default[
|
|
349
|
+
colorIcon: _ColorVariablesMap.default["--color-primary-content"],
|
|
308
350
|
// Color of cross icon
|
|
309
|
-
colorError: _ColorVariablesMap.default[
|
|
351
|
+
colorError: _ColorVariablesMap.default["--color-negative"],
|
|
310
352
|
// Error color
|
|
311
|
-
colorErrorBorderHover: _ColorVariablesMap.default[
|
|
353
|
+
colorErrorBorderHover: _ColorVariablesMap.default["--color-negative"],
|
|
312
354
|
// Hover error color should be same as error color
|
|
313
|
-
boxShadowSecondary: _Elevation.ElevationMap[
|
|
355
|
+
boxShadowSecondary: _Elevation.ElevationMap["elevation-white-1"] // Box shadow of dropdown.
|
|
314
356
|
}
|
|
315
357
|
}
|
|
316
358
|
}, /*#__PURE__*/_react.default.createElement(StyledSelect, _extends({
|
|
317
359
|
"data-test": dataTest,
|
|
318
360
|
dropdownStyle: {
|
|
319
|
-
padding:
|
|
361
|
+
padding: "0px"
|
|
320
362
|
},
|
|
321
363
|
mode: mode,
|
|
322
|
-
maxTagCount: (selectedOptions === null || selectedOptions === void 0 || (_selectedOptions$inde2 = selectedOptions.indexOf) === null || _selectedOptions$inde2 === void 0 ? void 0 : _selectedOptions$inde2.call(selectedOptions, allText)) === -1 ?
|
|
364
|
+
maxTagCount: (selectedOptions === null || selectedOptions === void 0 || (_selectedOptions$inde2 = selectedOptions.indexOf) === null || _selectedOptions$inde2 === void 0 ? void 0 : _selectedOptions$inde2.call(selectedOptions, allText)) === -1 ? "responsive" : 1,
|
|
323
365
|
maxTagPlaceholder: getMaxTagPlaceholder,
|
|
324
366
|
onDeselect: (0, _utils.isFunction)(onSelectionChange) ? value => onOptionsChange(false, value) : undefined,
|
|
325
|
-
onSelect: (0, _utils.isFunction)(onSelectionChange)
|
|
367
|
+
onSelect: (0, _utils.isFunction)(onSelectionChange) || (0, _utils.isFunction)(onCustomSelect) ? value => {
|
|
368
|
+
if ((0, _utils.isFunction)(onSelectionChange)) {
|
|
369
|
+
onOptionsChange(true, value);
|
|
370
|
+
}
|
|
371
|
+
if ((0, _utils.isFunction)(onCustomSelect)) {
|
|
372
|
+
const fullOption = options === null || options === void 0 ? void 0 : options.find(opt => opt.value === value);
|
|
373
|
+
if (fullOption) {
|
|
374
|
+
onCustomSelect(fullOption);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
} : undefined,
|
|
326
378
|
suffixIcon: /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
327
379
|
icon: _KeyboardArrowDown.default,
|
|
328
380
|
size: 20
|
|
@@ -333,13 +385,19 @@ function CustomSelect(_ref) {
|
|
|
333
385
|
placeholder: placeholder
|
|
334
386
|
}, props), allText && /*#__PURE__*/_react.default.createElement(Option, {
|
|
335
387
|
value: allText
|
|
336
|
-
}, allText), children || (actualOptions === null || actualOptions === void 0 ? void 0 : actualOptions.map(actualOption => {
|
|
388
|
+
}, allText), children || Array.isArray(actualOptions) && (actualOptions === null || actualOptions === void 0 ? void 0 : actualOptions.map(actualOption => {
|
|
337
389
|
var _actualOption$disable;
|
|
338
390
|
return /*#__PURE__*/_react.default.createElement(Option, {
|
|
339
391
|
disabled: (_actualOption$disable = actualOption.disabled) !== null && _actualOption$disable !== void 0 ? _actualOption$disable : false,
|
|
340
392
|
value: actualOption.value,
|
|
341
|
-
key: (0, _utils.getUUID)()
|
|
342
|
-
|
|
393
|
+
key: (0, _utils.getUUID)(),
|
|
394
|
+
label: actualOption.label
|
|
395
|
+
}, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, actualOption.label, (actualOption === null || actualOption === void 0 ? void 0 : actualOption.subLabel) && /*#__PURE__*/_react.default.createElement("div", {
|
|
396
|
+
className: "margin-top-4"
|
|
397
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
398
|
+
typography: "type-b3-400",
|
|
399
|
+
color: "secondary-content"
|
|
400
|
+
}, actualOption === null || actualOption === void 0 ? void 0 : actualOption.subLabel))));
|
|
343
401
|
}))));
|
|
344
402
|
}
|
|
345
403
|
CustomSelect.Option = _antd.Select.Option;
|
|
@@ -347,8 +405,8 @@ CustomSelect.propTypes = {
|
|
|
347
405
|
allText: _propTypes.default.string,
|
|
348
406
|
children: _propTypes.default.node,
|
|
349
407
|
defaultValue: _propTypes.default.oneOfType([_propTypes.default.array, _propTypes.default.string, _propTypes.default.number]),
|
|
350
|
-
|
|
351
|
-
mode: _propTypes.default.oneOf([
|
|
408
|
+
"data-test": _propTypes.default.string,
|
|
409
|
+
mode: _propTypes.default.oneOf(["multiple", "tags"]),
|
|
352
410
|
onSelectionChange: _propTypes.default.func,
|
|
353
411
|
options: _propTypes.default.arrayOf(
|
|
354
412
|
// Checked from antd's github
|
|
@@ -356,17 +414,19 @@ CustomSelect.propTypes = {
|
|
|
356
414
|
label: _propTypes.default.node,
|
|
357
415
|
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]).isRequired
|
|
358
416
|
})),
|
|
359
|
-
size: _propTypes.default.oneOf([
|
|
360
|
-
placeholder: _propTypes.default.string
|
|
417
|
+
size: _propTypes.default.oneOf(["small", "middle"]),
|
|
418
|
+
placeholder: _propTypes.default.string,
|
|
419
|
+
maxSelectForMultiSelect: _propTypes.default.number
|
|
361
420
|
};
|
|
362
421
|
CustomSelect.defaultProps = {
|
|
363
422
|
allText: null,
|
|
364
423
|
children: null,
|
|
365
424
|
defaultValue: [],
|
|
366
|
-
|
|
425
|
+
"data-test": null,
|
|
367
426
|
mode: null,
|
|
368
427
|
onSelectionChange: null,
|
|
369
428
|
options: [],
|
|
370
|
-
size:
|
|
371
|
-
placeholder:
|
|
429
|
+
size: "middle",
|
|
430
|
+
placeholder: "",
|
|
431
|
+
maxSelectForMultiSelect: null
|
|
372
432
|
};
|
|
@@ -0,0 +1,117 @@
|
|
|
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
|
+
require("core-js/modules/es.symbol.description.js");
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
var _antd = require("antd");
|
|
12
|
+
var _utils = require("../../utils");
|
|
13
|
+
var _styles = require("./styles");
|
|
14
|
+
const _excluded = ["data", "data-test", "current", "direction", "size", "labelPlacement", "progressDot", "responsive", "onChange", "style"],
|
|
15
|
+
_excluded2 = ["key", "title", "subTitle", "description", "icon", "status", "disabled"];
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
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); }
|
|
18
|
+
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; }
|
|
19
|
+
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; }
|
|
20
|
+
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; }
|
|
21
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
22
|
+
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); }
|
|
23
|
+
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; }
|
|
24
|
+
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; }
|
|
25
|
+
/**
|
|
26
|
+
* CustomSteps: Wrapper around Ant Design Steps with a data-driven API.
|
|
27
|
+
* - Parent controls current step and can customize via props.
|
|
28
|
+
* - Accepts `data.steps` array with step configs.
|
|
29
|
+
*/
|
|
30
|
+
function CustomSteps(_ref) {
|
|
31
|
+
var _data$steps;
|
|
32
|
+
let {
|
|
33
|
+
data,
|
|
34
|
+
'data-test': dataTest,
|
|
35
|
+
current,
|
|
36
|
+
direction,
|
|
37
|
+
size,
|
|
38
|
+
labelPlacement,
|
|
39
|
+
progressDot,
|
|
40
|
+
responsive,
|
|
41
|
+
onChange,
|
|
42
|
+
style
|
|
43
|
+
} = _ref,
|
|
44
|
+
antDesignProps = _objectWithoutProperties(_ref, _excluded);
|
|
45
|
+
const items = ((_data$steps = data === null || data === void 0 ? void 0 : data.steps) !== null && _data$steps !== void 0 ? _data$steps : []).map(_ref2 => {
|
|
46
|
+
let {
|
|
47
|
+
key,
|
|
48
|
+
title,
|
|
49
|
+
subTitle,
|
|
50
|
+
description,
|
|
51
|
+
icon,
|
|
52
|
+
status,
|
|
53
|
+
disabled
|
|
54
|
+
} = _ref2,
|
|
55
|
+
otherProps = _objectWithoutProperties(_ref2, _excluded2);
|
|
56
|
+
return _objectSpread({
|
|
57
|
+
key: key !== null && key !== void 0 ? key : (0, _utils.getUUID)(),
|
|
58
|
+
title: dataTest && ((0, _utils.isString)(title) || (0, _utils.isNumber)(title)) ? /*#__PURE__*/_react.default.createElement("span", {
|
|
59
|
+
"data-test": "".concat(dataTest, "--title-(").concat(title, ")")
|
|
60
|
+
}, title) : title,
|
|
61
|
+
subTitle,
|
|
62
|
+
description,
|
|
63
|
+
icon,
|
|
64
|
+
status,
|
|
65
|
+
disabled
|
|
66
|
+
}, otherProps);
|
|
67
|
+
});
|
|
68
|
+
return /*#__PURE__*/_react.default.createElement(_styles.StepsContainer, {
|
|
69
|
+
style: style
|
|
70
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Steps, _extends({
|
|
71
|
+
current: current,
|
|
72
|
+
direction: direction,
|
|
73
|
+
size: size,
|
|
74
|
+
labelPlacement: labelPlacement,
|
|
75
|
+
progressDot: progressDot,
|
|
76
|
+
responsive: responsive,
|
|
77
|
+
items: items,
|
|
78
|
+
onChange: onChange
|
|
79
|
+
}, antDesignProps)));
|
|
80
|
+
}
|
|
81
|
+
CustomSteps.propTypes = {
|
|
82
|
+
data: _propTypes.default.shape({
|
|
83
|
+
steps: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
84
|
+
key: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
85
|
+
title: _propTypes.default.node,
|
|
86
|
+
subTitle: _propTypes.default.node,
|
|
87
|
+
description: _propTypes.default.node,
|
|
88
|
+
icon: _propTypes.default.node,
|
|
89
|
+
status: _propTypes.default.oneOf(['wait', 'process', 'finish', 'error']),
|
|
90
|
+
disabled: _propTypes.default.bool
|
|
91
|
+
}))
|
|
92
|
+
}),
|
|
93
|
+
'data-test': _propTypes.default.string,
|
|
94
|
+
current: _propTypes.default.number,
|
|
95
|
+
direction: _propTypes.default.oneOf(['horizontal', 'vertical']),
|
|
96
|
+
size: _propTypes.default.oneOf(['default', 'small']),
|
|
97
|
+
labelPlacement: _propTypes.default.oneOf(['horizontal', 'vertical']),
|
|
98
|
+
progressDot: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.func]),
|
|
99
|
+
responsive: _propTypes.default.bool,
|
|
100
|
+
onChange: _propTypes.default.func,
|
|
101
|
+
style: _propTypes.default.object
|
|
102
|
+
};
|
|
103
|
+
CustomSteps.defaultProps = {
|
|
104
|
+
data: {
|
|
105
|
+
steps: []
|
|
106
|
+
},
|
|
107
|
+
'data-test': null,
|
|
108
|
+
current: 0,
|
|
109
|
+
direction: 'horizontal',
|
|
110
|
+
size: 'default',
|
|
111
|
+
labelPlacement: 'horizontal',
|
|
112
|
+
progressDot: false,
|
|
113
|
+
responsive: true,
|
|
114
|
+
onChange: undefined,
|
|
115
|
+
style: {}
|
|
116
|
+
};
|
|
117
|
+
var _default = exports.default = CustomSteps;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.StepsContainer = 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 StepsContainer = exports.StepsContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\n"])));
|
|
@@ -25,7 +25,8 @@ var _CustomTag = _interopRequireDefault(require("../oa-component-tag/CustomTag")
|
|
|
25
25
|
var _MaterialIcon = _interopRequireDefault(require("../oa-component-icons/MaterialIcon"));
|
|
26
26
|
var _utils = require("../../utils");
|
|
27
27
|
var _styles = require("./styles");
|
|
28
|
-
|
|
28
|
+
var _CustomPagination = _interopRequireDefault(require("../oa-component-pagination/CustomPagination"));
|
|
29
|
+
const _excluded = ["columns", "dataSource", "pagination", "rowKey", "size", "style", "tableBorder", "emptyText", "noOfColumnToShow", "defaultCardShow", "onMobilePageChange", "showNumberPagination"],
|
|
29
30
|
_excluded2 = ["title"];
|
|
30
31
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
32
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
@@ -64,7 +65,9 @@ function CustomTable(_ref) {
|
|
|
64
65
|
tableBorder,
|
|
65
66
|
emptyText,
|
|
66
67
|
noOfColumnToShow,
|
|
67
|
-
defaultCardShow
|
|
68
|
+
defaultCardShow,
|
|
69
|
+
onMobilePageChange,
|
|
70
|
+
showNumberPagination
|
|
68
71
|
} = _ref,
|
|
69
72
|
antDesignProps = _objectWithoutProperties(_ref, _excluded);
|
|
70
73
|
const [viewMore, setViewMore] = (0, _react.useState)([]);
|
|
@@ -202,7 +205,11 @@ function CustomTable(_ref) {
|
|
|
202
205
|
emptyText
|
|
203
206
|
},
|
|
204
207
|
size: size
|
|
205
|
-
}, antDesignProps
|
|
208
|
+
}, antDesignProps, {
|
|
209
|
+
scroll: {
|
|
210
|
+
x: 'max-content'
|
|
211
|
+
}
|
|
212
|
+
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
206
213
|
className: cardShow && dataSource ? 'bottomPadding' : ''
|
|
207
214
|
}, cardShow && dataSource && (dataSource === null || dataSource === void 0 ? void 0 : dataSource.map((row, rowIndex) => {
|
|
208
215
|
var _uppercaseColumns$, _uppercaseColumns3;
|
|
@@ -248,6 +255,18 @@ function CustomTable(_ref) {
|
|
|
248
255
|
type: "secondary",
|
|
249
256
|
size: "large",
|
|
250
257
|
onClick: () => pagination === null || pagination === void 0 ? void 0 : pagination.onChangeHandlerForMobile()
|
|
258
|
+
})), cardShow && dataSource.length > 0 && onMobilePageChange && showNumberPagination && /*#__PURE__*/_react.default.createElement("div", {
|
|
259
|
+
className: "mobileViewPagination"
|
|
260
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomPagination.default, {
|
|
261
|
+
current: pagination.current,
|
|
262
|
+
pageSize: pagination.pageSize,
|
|
263
|
+
total: pagination.total,
|
|
264
|
+
onChange: page => {
|
|
265
|
+
onMobilePageChange === null || onMobilePageChange === void 0 || onMobilePageChange({
|
|
266
|
+
current: page,
|
|
267
|
+
pageSize: pagination.pageSize
|
|
268
|
+
});
|
|
269
|
+
}
|
|
251
270
|
})));
|
|
252
271
|
}
|
|
253
272
|
CustomTable.propTypes = {
|
|
@@ -260,7 +279,9 @@ CustomTable.propTypes = {
|
|
|
260
279
|
tableBorder: _propTypes.default.bool,
|
|
261
280
|
emptyText: _propTypes.default.string,
|
|
262
281
|
noOfColumnToShow: _propTypes.default.number,
|
|
263
|
-
defaultCardShow: _propTypes.default.bool
|
|
282
|
+
defaultCardShow: _propTypes.default.bool,
|
|
283
|
+
onMobilePageChange: _propTypes.default.func,
|
|
284
|
+
showNumberPagination: _propTypes.default.bool
|
|
264
285
|
};
|
|
265
286
|
CustomTable.defaultProps = {
|
|
266
287
|
dataSource: [],
|
|
@@ -272,6 +293,8 @@ CustomTable.defaultProps = {
|
|
|
272
293
|
tableBorder: true,
|
|
273
294
|
emptyText: 'No Data',
|
|
274
295
|
noOfColumnToShow: 5,
|
|
275
|
-
defaultCardShow: false
|
|
296
|
+
defaultCardShow: false,
|
|
297
|
+
onMobilePageChange: null,
|
|
298
|
+
showNumberPagination: false
|
|
276
299
|
};
|
|
277
300
|
var _default = exports.default = CustomTable;
|