oa-componentbook 1.0.1-stage.44 → 1.0.1-stage.440
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 +123 -43
- 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-icons/MaterialIcon.js +1 -1
- 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-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 +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/outOfStock.png +0 -0
- package/build/index.js +114 -2
- 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 +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 +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-list/fn.js +16 -4
- 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 +4 -2
- package/build/components/oa-component-textarea/TextArea.js +0 -74
|
@@ -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", "fixedValue"],
|
|
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,19 @@ 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,
|
|
86
|
+
fixedValue
|
|
83
87
|
} = _ref,
|
|
84
88
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
85
89
|
// 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)) {
|
|
90
|
+
const actualDefaultValue = mode === "multiple" ? [...defaultValue] : defaultValue;
|
|
91
|
+
if (mode === "multiple" && allText && defaultValue !== null && defaultValue !== void 0 && defaultValue.includes(allText)) {
|
|
89
92
|
var _options$filter$map, _options$filter;
|
|
90
93
|
// Emptying the array first.
|
|
91
94
|
actualDefaultValue.length = 0;
|
|
@@ -99,52 +102,77 @@ function CustomSelect(_ref) {
|
|
|
99
102
|
return !((_option$disabled = option === null || option === void 0 ? void 0 : option.disabled) !== null && _option$disabled !== void 0 ? _option$disabled : false);
|
|
100
103
|
})) === null || _options$filter === void 0 ? void 0 : _options$filter.map(option => option.value)) !== null && _options$filter$map !== void 0 ? _options$filter$map : []));
|
|
101
104
|
}
|
|
102
|
-
const
|
|
105
|
+
const [selectedOptions, setSelectedOptions] = (0, _react.useState)(actualDefaultValue);
|
|
106
|
+
const valueLabelMap = Array.isArray(options) && (options === null || options === void 0 ? void 0 : options.reduce((accumulator, option) => {
|
|
103
107
|
var _option$label;
|
|
104
108
|
accumulator[option.value] = (_option$label = option === null || option === void 0 ? void 0 : option.label) !== null && _option$label !== void 0 ? _option$label : option.value;
|
|
105
109
|
return accumulator;
|
|
106
|
-
}, {});
|
|
107
|
-
const actualOptions = options
|
|
110
|
+
}, {}));
|
|
111
|
+
const actualOptions = Array.isArray(options) && options.map(option => {
|
|
108
112
|
const {
|
|
109
113
|
label,
|
|
110
114
|
disabled = false,
|
|
111
115
|
value
|
|
112
116
|
} = option,
|
|
113
117
|
otherProperties = _objectWithoutProperties(option, _excluded2);
|
|
118
|
+
const shouldDisableOption = (option, selectedOptions, maxSelectForMultiSelect, allText) => {
|
|
119
|
+
var _selectedOptions$filt;
|
|
120
|
+
// If option is already disabled, keep it disabled
|
|
121
|
+
if (option.disabled) return true;
|
|
122
|
+
|
|
123
|
+
// If no max limit, don't disable
|
|
124
|
+
if (!maxSelectForMultiSelect) return false;
|
|
125
|
+
|
|
126
|
+
// If this option is already selected, don't disable it (so user can deselect)
|
|
127
|
+
if (selectedOptions !== null && selectedOptions !== void 0 && selectedOptions.includes(option.value)) return false;
|
|
128
|
+
|
|
129
|
+
// If this is the 'all' option, don't disable it
|
|
130
|
+
if (option.value === allText) return false;
|
|
131
|
+
|
|
132
|
+
// Check if we've reached the max limit (excluding allText)
|
|
133
|
+
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;
|
|
134
|
+
return actualSelectionCount >= maxSelectForMultiSelect;
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
// Determine if this option should be disabled due to max limit
|
|
138
|
+
const shouldBeDisabled = shouldDisableOption(option, selectedOptions, maxSelectForMultiSelect, allText);
|
|
139
|
+
const finalDisabled = disabled || shouldBeDisabled;
|
|
114
140
|
if ((0, _utils.isString)(label) || (0, _utils.isNumber)(label)) {
|
|
115
141
|
return _objectSpread({
|
|
116
142
|
label: /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
117
|
-
color:
|
|
143
|
+
color: finalDisabled ? "placeholder-text" : undefined,
|
|
118
144
|
typography: "type-b2-400",
|
|
145
|
+
title: label,
|
|
119
146
|
"data-test": dataTest ? "".concat(dataTest, "-(").concat(label, ")") : undefined
|
|
120
147
|
}, label),
|
|
121
|
-
disabled,
|
|
148
|
+
disabled: finalDisabled,
|
|
122
149
|
value
|
|
123
150
|
}, otherProperties);
|
|
124
151
|
}
|
|
125
152
|
if ( /*#__PURE__*/_react.default.isValidElement(label)) {
|
|
126
153
|
return _objectSpread({
|
|
127
154
|
label: dataTest ? /*#__PURE__*/_react.default.cloneElement(label, {
|
|
128
|
-
|
|
155
|
+
"data-test": "".concat(dataTest, "-(").concat(label, ")")
|
|
129
156
|
}) : label,
|
|
130
|
-
disabled,
|
|
157
|
+
disabled: finalDisabled,
|
|
131
158
|
value
|
|
132
159
|
}, otherProperties);
|
|
133
160
|
}
|
|
134
161
|
if ((0, _utils.isString)(value) || (0, _utils.isNumber)(value)) {
|
|
135
162
|
return _objectSpread({
|
|
136
163
|
label: /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
137
|
-
color:
|
|
164
|
+
color: finalDisabled ? "placeholder-text" : undefined,
|
|
138
165
|
typography: "type-b2-400",
|
|
139
166
|
"data-test": dataTest ? "".concat(dataTest, "-(").concat(value, ")") : undefined
|
|
140
167
|
}, value),
|
|
141
168
|
value,
|
|
142
|
-
disabled
|
|
169
|
+
disabled: finalDisabled
|
|
143
170
|
}, otherProperties);
|
|
144
171
|
}
|
|
145
|
-
return option
|
|
172
|
+
return _objectSpread(_objectSpread({}, option), {}, {
|
|
173
|
+
disabled: finalDisabled
|
|
174
|
+
});
|
|
146
175
|
});
|
|
147
|
-
const [selectedOptions, setSelectedOptions] = (0, _react.useState)(actualDefaultValue);
|
|
148
176
|
|
|
149
177
|
/**
|
|
150
178
|
* Return a placeholder text for the maxTagCount option.
|
|
@@ -168,6 +196,11 @@ function CustomSelect(_ref) {
|
|
|
168
196
|
array.push(element);
|
|
169
197
|
}
|
|
170
198
|
};
|
|
199
|
+
const safeUnshift = (array, element) => {
|
|
200
|
+
if (!array.includes(element)) {
|
|
201
|
+
array.unshift(element);
|
|
202
|
+
}
|
|
203
|
+
};
|
|
171
204
|
|
|
172
205
|
/**
|
|
173
206
|
* Given an array of options, add all non-disabled options to the newlySelectedOptions array.
|
|
@@ -203,7 +236,18 @@ function CustomSelect(_ref) {
|
|
|
203
236
|
value
|
|
204
237
|
});
|
|
205
238
|
};
|
|
206
|
-
|
|
239
|
+
/**
|
|
240
|
+
* Checks if maximum selection limit has been reached
|
|
241
|
+
* @param {Array} currentSelection - Current selected options array
|
|
242
|
+
* @param {Boolean} isSelecting - Whether we're selecting (true) or deselecting (false)
|
|
243
|
+
* @returns {Boolean} - True if max limit would be exceeded
|
|
244
|
+
*/
|
|
245
|
+
const isMaxSelectReached = currentSelection => {
|
|
246
|
+
var _currentSelection$fil;
|
|
247
|
+
// Count selections excluding allText if present
|
|
248
|
+
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;
|
|
249
|
+
return actualSelectionCount >= maxSelectForMultiSelect;
|
|
250
|
+
};
|
|
207
251
|
/**
|
|
208
252
|
* This function is called whenever the selection changes for a multiple select.
|
|
209
253
|
* @param {Boolean} select - True if the option was selected, false if it was deselected.
|
|
@@ -222,6 +266,10 @@ function CustomSelect(_ref) {
|
|
|
222
266
|
newlySelectedOptions.splice(allIndex, 1);
|
|
223
267
|
}
|
|
224
268
|
if (select) {
|
|
269
|
+
if (maxSelectForMultiSelect && value !== allText && isMaxSelectReached(newlySelectedOptions)) {
|
|
270
|
+
// Don't proceed with selection if max limit reached
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
225
273
|
if (value === allText) {
|
|
226
274
|
newlySelectedOptions.length = 0; // Emptying the array.
|
|
227
275
|
|
|
@@ -229,7 +277,7 @@ function CustomSelect(_ref) {
|
|
|
229
277
|
addAllOptions(options, newlySelectedOptions);
|
|
230
278
|
} else {
|
|
231
279
|
safePush(newlySelectedOptions, value);
|
|
232
|
-
const enabledOptions = options.filter(option => {
|
|
280
|
+
const enabledOptions = options === null || options === void 0 ? void 0 : options.filter(option => {
|
|
233
281
|
var _option$disabled2;
|
|
234
282
|
return !((_option$disabled2 = option === null || option === void 0 ? void 0 : option.disabled) !== null && _option$disabled2 !== void 0 ? _option$disabled2 : false);
|
|
235
283
|
});
|
|
@@ -243,20 +291,26 @@ function CustomSelect(_ref) {
|
|
|
243
291
|
var _newlySelectedOptions2;
|
|
244
292
|
newlySelectedOptions.splice((_newlySelectedOptions2 = newlySelectedOptions.indexOf) === null || _newlySelectedOptions2 === void 0 ? void 0 : _newlySelectedOptions2.call(newlySelectedOptions, value), 1);
|
|
245
293
|
}
|
|
294
|
+
|
|
295
|
+
// If fixedValue has values, push them to the beginning of newlySelectedOptions
|
|
296
|
+
// BUT only if "All" is not currently selected
|
|
297
|
+
if ((fixedValue === null || fixedValue === void 0 ? void 0 : fixedValue.length) > 0 && !(newlySelectedOptions !== null && newlySelectedOptions !== void 0 && newlySelectedOptions.includes(allText))) {
|
|
298
|
+
fixedValue.forEach(val => safeUnshift(newlySelectedOptions, val));
|
|
299
|
+
}
|
|
246
300
|
const optionsWithoutAllText = newlySelectedOptions.filter(option => option !== allText);
|
|
247
301
|
|
|
248
302
|
// Passing the data to parent, using a callback.
|
|
249
303
|
onSelectionChange(valuesArrayToOptionArray(optionsWithoutAllText, valueLabelMap));
|
|
250
304
|
setSelectedOptions(newlySelectedOptions);
|
|
251
305
|
};
|
|
252
|
-
const onOptionsChange = mode ===
|
|
306
|
+
const onOptionsChange = mode === "multiple" ? onOptionsChangeForMultiple : onOptionsChangeForSingle;
|
|
253
307
|
return /*#__PURE__*/_react.default.createElement(_antd.ConfigProvider, {
|
|
254
308
|
theme: {
|
|
255
309
|
components: {
|
|
256
310
|
Select: {
|
|
257
|
-
optionHeight: (props === null || props === void 0 ? void 0 : props.size) ===
|
|
258
|
-
optionSelectedBg: _ColorVariablesMap.default[
|
|
259
|
-
optionSelectedColor: _ColorVariablesMap.default[
|
|
311
|
+
optionHeight: (props === null || props === void 0 ? void 0 : props.size) === "small" ? "36px" : "52px",
|
|
312
|
+
optionSelectedBg: _ColorVariablesMap.default["--color-primary-background"],
|
|
313
|
+
optionSelectedColor: _ColorVariablesMap.default["--color-primary"]
|
|
260
314
|
// optionPadding: [3, 2],
|
|
261
315
|
// optionPadding: (props?.size === 'small') ? '8px 12px' : '16 16',
|
|
262
316
|
// activeShadow: '0px 0px 4px 0px red', // Box shadow for active select box.
|
|
@@ -264,18 +318,18 @@ function CustomSelect(_ref) {
|
|
|
264
318
|
},
|
|
265
319
|
token: {
|
|
266
320
|
// controlOutline: '4px 4px 4px 4px red', // an attempt at applying box shadow
|
|
267
|
-
colorTextPlaceholder: _ColorVariablesMap.default[
|
|
321
|
+
colorTextPlaceholder: _ColorVariablesMap.default["--color-placeholder-text"],
|
|
268
322
|
// Color of placeholder text
|
|
269
|
-
colorTextQuaternary: _ColorVariablesMap.default[
|
|
323
|
+
colorTextQuaternary: _ColorVariablesMap.default["--color-secondary-content"],
|
|
270
324
|
// Color of dropdown arrow.
|
|
271
325
|
|
|
272
|
-
colorPrimary: _ColorVariablesMap.default[
|
|
326
|
+
colorPrimary: _ColorVariablesMap.default["--color-primary"],
|
|
273
327
|
// for active color of select
|
|
274
|
-
colorPrimaryHover: _ColorVariablesMap.default[
|
|
328
|
+
colorPrimaryHover: _ColorVariablesMap.default["--color-primary"],
|
|
275
329
|
// for hover color of select
|
|
276
|
-
borderRadius:
|
|
330
|
+
borderRadius: "4px",
|
|
277
331
|
// For border radius of select text field.
|
|
278
|
-
borderRadiusLG:
|
|
332
|
+
borderRadiusLG: "4px",
|
|
279
333
|
// For border radius of dropdown
|
|
280
334
|
controlHeight: 48,
|
|
281
335
|
// height of text field (tag height is half of this, i.e. 24px)
|
|
@@ -283,46 +337,56 @@ function CustomSelect(_ref) {
|
|
|
283
337
|
// height of small text field
|
|
284
338
|
|
|
285
339
|
// This controls padding of larger text box
|
|
286
|
-
controlPaddingHorizontalSM: (props === null || props === void 0 ? void 0 : props.size) ===
|
|
340
|
+
controlPaddingHorizontalSM: (props === null || props === void 0 ? void 0 : props.size) === "small" ? 13 : 17,
|
|
287
341
|
// 1 extra so that it shows 12px and 16px in browser console.
|
|
288
|
-
paddingSM: (props === null || props === void 0 ? void 0 : props.size) ===
|
|
342
|
+
paddingSM: (props === null || props === void 0 ? void 0 : props.size) === "small" ? 13 : 17,
|
|
289
343
|
// paddingSM is what determines padding of input box.
|
|
290
344
|
|
|
291
|
-
controlItemBgHover: _ColorVariablesMap.default[
|
|
345
|
+
controlItemBgHover: _ColorVariablesMap.default["--color-background-info"],
|
|
292
346
|
// hover color of items
|
|
293
|
-
colorBgElevated: _ColorVariablesMap.default[
|
|
347
|
+
colorBgElevated: _ColorVariablesMap.default["--color-primary-background"],
|
|
294
348
|
// background color of dropdown
|
|
295
349
|
// multipleItemHeight: 100,
|
|
296
|
-
colorBgContainerDisabled: _ColorVariablesMap.default[
|
|
350
|
+
colorBgContainerDisabled: _ColorVariablesMap.default["--color-divider"],
|
|
297
351
|
// background color of disabled select
|
|
298
|
-
colorBorder: _ColorVariablesMap.default[
|
|
299
|
-
colorFillSecondary: _ColorVariablesMap.default[
|
|
352
|
+
colorBorder: _ColorVariablesMap.default["--color-placeholder-text"],
|
|
353
|
+
colorFillSecondary: _ColorVariablesMap.default["--color-secondary-background"],
|
|
300
354
|
// background color for tags
|
|
301
355
|
|
|
302
|
-
colorText: _ColorVariablesMap.default[
|
|
356
|
+
colorText: _ColorVariablesMap.default["--color-primary-content"],
|
|
303
357
|
// Text color of unselected options in dropdown
|
|
304
|
-
colorTextDisabled: _ColorVariablesMap.default[
|
|
358
|
+
colorTextDisabled: _ColorVariablesMap.default["--color-secondary-content"],
|
|
305
359
|
// Text color when disabled
|
|
306
360
|
|
|
307
|
-
colorIcon: _ColorVariablesMap.default[
|
|
361
|
+
colorIcon: _ColorVariablesMap.default["--color-primary-content"],
|
|
308
362
|
// Color of cross icon
|
|
309
|
-
colorError: _ColorVariablesMap.default[
|
|
363
|
+
colorError: _ColorVariablesMap.default["--color-negative"],
|
|
310
364
|
// Error color
|
|
311
|
-
colorErrorBorderHover: _ColorVariablesMap.default[
|
|
365
|
+
colorErrorBorderHover: _ColorVariablesMap.default["--color-negative"],
|
|
312
366
|
// Hover error color should be same as error color
|
|
313
|
-
boxShadowSecondary: _Elevation.ElevationMap[
|
|
367
|
+
boxShadowSecondary: _Elevation.ElevationMap["elevation-white-1"] // Box shadow of dropdown.
|
|
314
368
|
}
|
|
315
369
|
}
|
|
316
370
|
}, /*#__PURE__*/_react.default.createElement(StyledSelect, _extends({
|
|
317
371
|
"data-test": dataTest,
|
|
318
372
|
dropdownStyle: {
|
|
319
|
-
padding:
|
|
373
|
+
padding: "0px"
|
|
320
374
|
},
|
|
321
375
|
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 ?
|
|
376
|
+
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
377
|
maxTagPlaceholder: getMaxTagPlaceholder,
|
|
324
378
|
onDeselect: (0, _utils.isFunction)(onSelectionChange) ? value => onOptionsChange(false, value) : undefined,
|
|
325
|
-
onSelect: (0, _utils.isFunction)(onSelectionChange)
|
|
379
|
+
onSelect: (0, _utils.isFunction)(onSelectionChange) || (0, _utils.isFunction)(onCustomSelect) ? value => {
|
|
380
|
+
if ((0, _utils.isFunction)(onSelectionChange)) {
|
|
381
|
+
onOptionsChange(true, value);
|
|
382
|
+
}
|
|
383
|
+
if ((0, _utils.isFunction)(onCustomSelect)) {
|
|
384
|
+
const fullOption = options === null || options === void 0 ? void 0 : options.find(opt => opt.value === value);
|
|
385
|
+
if (fullOption) {
|
|
386
|
+
onCustomSelect(fullOption);
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
} : undefined,
|
|
326
390
|
suffixIcon: /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
327
391
|
icon: _KeyboardArrowDown.default,
|
|
328
392
|
size: 20
|
|
@@ -333,13 +397,19 @@ function CustomSelect(_ref) {
|
|
|
333
397
|
placeholder: placeholder
|
|
334
398
|
}, props), allText && /*#__PURE__*/_react.default.createElement(Option, {
|
|
335
399
|
value: allText
|
|
336
|
-
}, allText), children || (actualOptions === null || actualOptions === void 0 ? void 0 : actualOptions.map(actualOption => {
|
|
400
|
+
}, allText), children || Array.isArray(actualOptions) && (actualOptions === null || actualOptions === void 0 ? void 0 : actualOptions.map(actualOption => {
|
|
337
401
|
var _actualOption$disable;
|
|
338
402
|
return /*#__PURE__*/_react.default.createElement(Option, {
|
|
339
403
|
disabled: (_actualOption$disable = actualOption.disabled) !== null && _actualOption$disable !== void 0 ? _actualOption$disable : false,
|
|
340
404
|
value: actualOption.value,
|
|
341
|
-
key: (0, _utils.getUUID)()
|
|
342
|
-
|
|
405
|
+
key: (0, _utils.getUUID)(),
|
|
406
|
+
label: actualOption.label
|
|
407
|
+
}, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, actualOption.label, (actualOption === null || actualOption === void 0 ? void 0 : actualOption.subLabel) && /*#__PURE__*/_react.default.createElement("div", {
|
|
408
|
+
className: "margin-top-4"
|
|
409
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
410
|
+
typography: "type-b3-400",
|
|
411
|
+
color: "secondary-content"
|
|
412
|
+
}, actualOption === null || actualOption === void 0 ? void 0 : actualOption.subLabel))));
|
|
343
413
|
}))));
|
|
344
414
|
}
|
|
345
415
|
CustomSelect.Option = _antd.Select.Option;
|
|
@@ -347,8 +417,8 @@ CustomSelect.propTypes = {
|
|
|
347
417
|
allText: _propTypes.default.string,
|
|
348
418
|
children: _propTypes.default.node,
|
|
349
419
|
defaultValue: _propTypes.default.oneOfType([_propTypes.default.array, _propTypes.default.string, _propTypes.default.number]),
|
|
350
|
-
|
|
351
|
-
mode: _propTypes.default.oneOf([
|
|
420
|
+
"data-test": _propTypes.default.string,
|
|
421
|
+
mode: _propTypes.default.oneOf(["multiple", "tags"]),
|
|
352
422
|
onSelectionChange: _propTypes.default.func,
|
|
353
423
|
options: _propTypes.default.arrayOf(
|
|
354
424
|
// Checked from antd's github
|
|
@@ -356,17 +426,21 @@ CustomSelect.propTypes = {
|
|
|
356
426
|
label: _propTypes.default.node,
|
|
357
427
|
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]).isRequired
|
|
358
428
|
})),
|
|
359
|
-
size: _propTypes.default.oneOf([
|
|
360
|
-
placeholder: _propTypes.default.string
|
|
429
|
+
size: _propTypes.default.oneOf(["small", "middle"]),
|
|
430
|
+
placeholder: _propTypes.default.string,
|
|
431
|
+
maxSelectForMultiSelect: _propTypes.default.number,
|
|
432
|
+
fixedValue: _propTypes.default.arrayOf(_propTypes.default.string)
|
|
361
433
|
};
|
|
362
434
|
CustomSelect.defaultProps = {
|
|
363
435
|
allText: null,
|
|
364
436
|
children: null,
|
|
365
437
|
defaultValue: [],
|
|
366
|
-
|
|
438
|
+
"data-test": null,
|
|
367
439
|
mode: null,
|
|
368
440
|
onSelectionChange: null,
|
|
369
441
|
options: [],
|
|
370
|
-
size:
|
|
371
|
-
placeholder:
|
|
442
|
+
size: "middle",
|
|
443
|
+
placeholder: "",
|
|
444
|
+
maxSelectForMultiSelect: null,
|
|
445
|
+
fixedValue: []
|
|
372
446
|
};
|
|
@@ -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;
|