oa-componentbook 1.0.1-stage.431 → 1.0.1-stage.432
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.
|
@@ -47,18 +47,18 @@ const getBase64 = file => new Promise((resolve, reject) => {
|
|
|
47
47
|
* @returns {undefined}
|
|
48
48
|
*/
|
|
49
49
|
const downloadFile = (base64String, fileName) => {
|
|
50
|
-
const link = document.createElement(
|
|
50
|
+
const link = document.createElement('a');
|
|
51
51
|
link.href = base64String;
|
|
52
|
-
link.download = fileName ||
|
|
52
|
+
link.download = fileName || 'download';
|
|
53
53
|
link.click();
|
|
54
54
|
};
|
|
55
55
|
function isImageFile(fileName) {
|
|
56
56
|
var _fileName$split;
|
|
57
57
|
// Extract the file extension from the file name
|
|
58
|
-
const fileExtension = fileName === null || fileName === void 0 || (_fileName$split = fileName.split(
|
|
58
|
+
const fileExtension = fileName === null || fileName === void 0 || (_fileName$split = fileName.split('.')) === null || _fileName$split === void 0 || (_fileName$split = _fileName$split.pop()) === null || _fileName$split === void 0 ? void 0 : _fileName$split.toLowerCase();
|
|
59
59
|
|
|
60
60
|
// Define an array of image file extensions
|
|
61
|
-
const imageFileExtensions = [
|
|
61
|
+
const imageFileExtensions = ['jpg', 'jpeg', 'png'];
|
|
62
62
|
|
|
63
63
|
// Check if the file extension is in the array of image file extensions
|
|
64
64
|
if (imageFileExtensions.indexOf(fileExtension) !== -1) {
|
|
@@ -107,7 +107,7 @@ function DocumentUpload(_ref) {
|
|
|
107
107
|
antDesignProps = _objectWithoutProperties(_ref, _excluded);
|
|
108
108
|
const [previewOpen, setPreviewOpen] = (0, _react.useState)(false);
|
|
109
109
|
const [previewImage, setPreviewImage] = (0, _react.useState)(null);
|
|
110
|
-
const [previewTitle, setPreviewTitle] = (0, _react.useState)(
|
|
110
|
+
const [previewTitle, setPreviewTitle] = (0, _react.useState)('');
|
|
111
111
|
const [loading, setLoading] = (0, _react.useState)(false);
|
|
112
112
|
const [fileList, setFileList] = (0, _react.useState)(uploadedDocuments);
|
|
113
113
|
const [deleteConfirmation, setDeleteConfirmation] = (0, _react.useState)(false);
|
|
@@ -125,7 +125,7 @@ function DocumentUpload(_ref) {
|
|
|
125
125
|
}
|
|
126
126
|
if (file !== null && file !== void 0 && file.originFileObj) {
|
|
127
127
|
setPreviewImage(file);
|
|
128
|
-
} else if ((file === null || file === void 0 ? void 0 : file.fileType) ===
|
|
128
|
+
} else if ((file === null || file === void 0 ? void 0 : file.fileType) === 'thumbnail') {
|
|
129
129
|
const url = await getPreview();
|
|
130
130
|
setPreviewImage(url);
|
|
131
131
|
} else {
|
|
@@ -141,17 +141,16 @@ function DocumentUpload(_ref) {
|
|
|
141
141
|
file
|
|
142
142
|
} = _ref2;
|
|
143
143
|
if (antDesignProps !== null && antDesignProps !== void 0 && antDesignProps.customRequest) {
|
|
144
|
-
const isError = newFileList.some(f => (f === null || f === void 0 ? void 0 : f.status) ===
|
|
144
|
+
const isError = newFileList.some(f => (f === null || f === void 0 ? void 0 : f.status) === 'error');
|
|
145
145
|
if (isError) {
|
|
146
146
|
setFileList([]);
|
|
147
147
|
setIsError(true);
|
|
148
148
|
setLoading(false);
|
|
149
149
|
return;
|
|
150
|
-
} else {
|
|
151
|
-
setIsError(false);
|
|
152
150
|
}
|
|
151
|
+
setIsError(false);
|
|
153
152
|
setFileList(newFileList);
|
|
154
|
-
const isUploading = newFileList.some(f => f.status ===
|
|
153
|
+
const isUploading = newFileList.some(f => f.status === 'uploading');
|
|
155
154
|
setLoading(isUploading);
|
|
156
155
|
return;
|
|
157
156
|
}
|
|
@@ -163,7 +162,7 @@ function DocumentUpload(_ref) {
|
|
|
163
162
|
try {
|
|
164
163
|
if ((file === null || file === void 0 ? void 0 : file.uid) === (files === null || files === void 0 ? void 0 : files.uid)) {
|
|
165
164
|
await handleCustomOnChange(files);
|
|
166
|
-
modifiedFile.status =
|
|
165
|
+
modifiedFile.status = 'done';
|
|
167
166
|
if (!isImageFile(file === null || file === void 0 ? void 0 : file.name)) {
|
|
168
167
|
modifiedFile.url = _PdfSampleImage.default;
|
|
169
168
|
}
|
|
@@ -178,7 +177,7 @@ function DocumentUpload(_ref) {
|
|
|
178
177
|
setFileList(tempList);
|
|
179
178
|
};
|
|
180
179
|
const getUploadButtonIcon = () => {
|
|
181
|
-
if ((uploadButtonConfig === null || uploadButtonConfig === void 0 ? void 0 : uploadButtonConfig.icon) ===
|
|
180
|
+
if ((uploadButtonConfig === null || uploadButtonConfig === void 0 ? void 0 : uploadButtonConfig.icon) === 'PlusOutlined') {
|
|
182
181
|
return /*#__PURE__*/_react.default.createElement(_icons.PlusOutlined, null);
|
|
183
182
|
}
|
|
184
183
|
return /*#__PURE__*/_react.default.createElement(_icons.UploadOutlined, null);
|
|
@@ -186,10 +185,10 @@ function DocumentUpload(_ref) {
|
|
|
186
185
|
const uploadButton = /*#__PURE__*/_react.default.createElement("button", {
|
|
187
186
|
style: {
|
|
188
187
|
border: 0,
|
|
189
|
-
background:
|
|
188
|
+
background: 'none'
|
|
190
189
|
},
|
|
191
190
|
type: "button"
|
|
192
|
-
}, loading ? /*#__PURE__*/_react.default.createElement(_icons.LoadingOutlined, null) : getUploadButtonIcon(), /*#__PURE__*/_react.default.createElement("div", null, uploadButtonConfig !== null && uploadButtonConfig !== void 0 && uploadButtonConfig.text ? uploadButtonConfig === null || uploadButtonConfig === void 0 ? void 0 : uploadButtonConfig.text :
|
|
191
|
+
}, loading ? /*#__PURE__*/_react.default.createElement(_icons.LoadingOutlined, null) : getUploadButtonIcon(), /*#__PURE__*/_react.default.createElement("div", null, uploadButtonConfig !== null && uploadButtonConfig !== void 0 && uploadButtonConfig.text ? uploadButtonConfig === null || uploadButtonConfig === void 0 ? void 0 : uploadButtonConfig.text : 'Upload'));
|
|
193
192
|
const DeleteFile = async () => {
|
|
194
193
|
await deleteHandler(selectedFile, isEmptyFileList => {
|
|
195
194
|
if (isEmptyFileList) {
|
|
@@ -203,7 +202,7 @@ function DocumentUpload(_ref) {
|
|
|
203
202
|
};
|
|
204
203
|
const handleRemove = file => new Promise((resolve, reject) => {
|
|
205
204
|
// If file is uploading, cancel immediately without confirmation
|
|
206
|
-
if ((file === null || file === void 0 ? void 0 : file.status) ===
|
|
205
|
+
if ((file === null || file === void 0 ? void 0 : file.status) === 'uploading') {
|
|
207
206
|
// Remove file from list immediately to cancel upload
|
|
208
207
|
const newFileList = fileList.filter(f => f.uid !== file.uid);
|
|
209
208
|
setFileList(newFileList);
|
|
@@ -213,7 +212,7 @@ function DocumentUpload(_ref) {
|
|
|
213
212
|
}
|
|
214
213
|
|
|
215
214
|
// If file is done or error, show confirmation modal
|
|
216
|
-
if ((file === null || file === void 0 ? void 0 : file.status) ===
|
|
215
|
+
if ((file === null || file === void 0 ? void 0 : file.status) === 'done' || (file === null || file === void 0 ? void 0 : file.status) === 'error') {
|
|
217
216
|
setSelectedFile(file);
|
|
218
217
|
setDeleteConfirmation(true);
|
|
219
218
|
resolve(false); // Prevent removal until confirmed
|
|
@@ -231,18 +230,18 @@ function DocumentUpload(_ref) {
|
|
|
231
230
|
// Get the appropriate remove icon based on file status
|
|
232
231
|
const getRemoveIcon = file => {
|
|
233
232
|
// Show cross icon during upload (to cancel)
|
|
234
|
-
if ((file === null || file === void 0 ? void 0 : file.status) ===
|
|
233
|
+
if ((file === null || file === void 0 ? void 0 : file.status) === 'uploading') {
|
|
235
234
|
return /*#__PURE__*/_react.default.createElement(_icons.CloseOutlined, null);
|
|
236
235
|
}
|
|
237
236
|
// Show delete icon after upload is done or if upload failed
|
|
238
|
-
if ((file === null || file === void 0 ? void 0 : file.status) ===
|
|
237
|
+
if ((file === null || file === void 0 ? void 0 : file.status) === 'done' || (file === null || file === void 0 ? void 0 : file.status) === 'error') {
|
|
239
238
|
return /*#__PURE__*/_react.default.createElement(_icons.DeleteOutlined, null);
|
|
240
239
|
}
|
|
241
240
|
// Default to delete icon
|
|
242
241
|
return /*#__PURE__*/_react.default.createElement(_icons.DeleteOutlined, null);
|
|
243
242
|
};
|
|
244
243
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.MainStyleSec, null, /*#__PURE__*/_react.default.createElement(_styles.StyledSection, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
245
|
-
onClick: listType ===
|
|
244
|
+
onClick: listType === 'picture' ? () => {
|
|
246
245
|
var _inst$upload, _inst$nativeElement, _inst$nativeElement$q, _inst$querySelector, _input$click;
|
|
247
246
|
if ((fileList === null || fileList === void 0 ? void 0 : fileList.length) >= noOfUpload) return;
|
|
248
247
|
const inst = uploadRef.current;
|
|
@@ -253,17 +252,17 @@ function DocumentUpload(_ref) {
|
|
|
253
252
|
const input = (inst === null || inst === void 0 || (_inst$upload = inst.upload) === null || _inst$upload === void 0 ? void 0 : _inst$upload.input) || (inst === null || inst === void 0 ? void 0 : inst.fileInput) || (inst === null || inst === void 0 || (_inst$nativeElement = inst.nativeElement) === null || _inst$nativeElement === void 0 || (_inst$nativeElement$q = _inst$nativeElement.querySelector) === null || _inst$nativeElement$q === void 0 ? void 0 : _inst$nativeElement$q.call(_inst$nativeElement, 'input[type="file"]')) || (inst === null || inst === void 0 || (_inst$querySelector = inst.querySelector) === null || _inst$querySelector === void 0 ? void 0 : _inst$querySelector.call(inst, 'input[type="file"]'));
|
|
254
253
|
input === null || input === void 0 || (_input$click = input.click) === null || _input$click === void 0 || _input$click.call(input);
|
|
255
254
|
} : null,
|
|
256
|
-
className: listType ===
|
|
255
|
+
className: listType === 'picture' ? "uploadSecPad ".concat(isError && 'errorBorder') : 'uploadDiv'
|
|
257
256
|
}, multipleDoc > 0 && /*#__PURE__*/_react.default.createElement("em", null, multipleDoc), /*#__PURE__*/_react.default.createElement(_antd.ConfigProvider, {
|
|
258
257
|
theme: {
|
|
259
258
|
token: {
|
|
260
|
-
colorBorder: _ColorVariablesMap.default[
|
|
259
|
+
colorBorder: _ColorVariablesMap.default['--color-divider'],
|
|
261
260
|
borderRadiusLG: 4,
|
|
262
|
-
colorPrimaryHover: _ColorVariablesMap.default[
|
|
263
|
-
colorPrimaryBorder: _ColorVariablesMap.default[
|
|
264
|
-
colorFillAlter: _ColorVariablesMap.default[
|
|
265
|
-
colorError: _ColorVariablesMap.default[
|
|
266
|
-
colorText: _ColorVariablesMap.default[
|
|
261
|
+
colorPrimaryHover: _ColorVariablesMap.default['--color-primary'],
|
|
262
|
+
colorPrimaryBorder: _ColorVariablesMap.default['--color-divider'],
|
|
263
|
+
colorFillAlter: _ColorVariablesMap.default['--color-secondary-background'],
|
|
264
|
+
colorError: _ColorVariablesMap.default['--color-negative'],
|
|
265
|
+
colorText: _ColorVariablesMap.default['--color-secondary-content']
|
|
267
266
|
}
|
|
268
267
|
}
|
|
269
268
|
}, /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
@@ -271,10 +270,10 @@ function DocumentUpload(_ref) {
|
|
|
271
270
|
rules: [{
|
|
272
271
|
validator: (rule, value) => {
|
|
273
272
|
if (isMandatory && !(value !== null && value !== void 0 && value.length)) {
|
|
274
|
-
if (typeof value ===
|
|
273
|
+
if (typeof value === 'object' && Object.keys(value).length > 0) {
|
|
275
274
|
return Promise.resolve();
|
|
276
275
|
}
|
|
277
|
-
return Promise.reject(new Error(
|
|
276
|
+
return Promise.reject(new Error('Please upload the document.'));
|
|
278
277
|
}
|
|
279
278
|
return Promise.resolve();
|
|
280
279
|
}
|
|
@@ -282,7 +281,7 @@ function DocumentUpload(_ref) {
|
|
|
282
281
|
}, /*#__PURE__*/_react.default.createElement(_antd.Upload, _extends({
|
|
283
282
|
onClick: e => e.stopPropagation(),
|
|
284
283
|
ref: uploadRef,
|
|
285
|
-
listType: listType
|
|
284
|
+
listType: listType || 'picture-card',
|
|
286
285
|
fileList: fileList,
|
|
287
286
|
onPreview: notShowPreviewButton ? undefined : handlePreview,
|
|
288
287
|
onChange: handleChange,
|
|
@@ -311,17 +310,17 @@ function DocumentUpload(_ref) {
|
|
|
311
310
|
}), deleteConfirmation && /*#__PURE__*/_react.default.createElement(_CustomModal.default, {
|
|
312
311
|
buttonConfig: [{
|
|
313
312
|
callback: () => DeleteFile(),
|
|
314
|
-
label:
|
|
315
|
-
type:
|
|
313
|
+
label: 'Yes, Delete',
|
|
314
|
+
type: 'danger-primary'
|
|
316
315
|
}],
|
|
317
316
|
imgSrc: deleteModalConfig !== null && deleteModalConfig !== void 0 && deleteModalConfig.deleteImage ? deleteModalConfig.deleteImage : _handIcon.default,
|
|
318
317
|
open: deleteConfirmation,
|
|
319
318
|
onCancel: () => {
|
|
320
319
|
setDeleteConfirmation(false);
|
|
321
320
|
},
|
|
322
|
-
title: deleteModalConfig !== null && deleteModalConfig !== void 0 && deleteModalConfig.title ? deleteModalConfig.title :
|
|
321
|
+
title: deleteModalConfig !== null && deleteModalConfig !== void 0 && deleteModalConfig.title ? deleteModalConfig.title : 'Delete Item?',
|
|
323
322
|
className: "delete-modal-confirmation"
|
|
324
|
-
}, deleteModalConfig !== null && deleteModalConfig !== void 0 && deleteModalConfig.body ? deleteModalConfig.body :
|
|
323
|
+
}, deleteModalConfig !== null && deleteModalConfig !== void 0 && deleteModalConfig.body ? deleteModalConfig.body : 'This action will permanently delete the selected item'));
|
|
325
324
|
}
|
|
326
325
|
DocumentUpload.propTypes = {
|
|
327
326
|
uploadedDocuments: _propTypes.default.array,
|
|
@@ -350,7 +349,7 @@ DocumentUpload.propTypes = {
|
|
|
350
349
|
DocumentUpload.defaultProps = {
|
|
351
350
|
uploadedDocuments: [],
|
|
352
351
|
handleCustomOnChange: () => {},
|
|
353
|
-
formName:
|
|
352
|
+
formName: '',
|
|
354
353
|
multipleDoc: 0,
|
|
355
354
|
showDelete: true,
|
|
356
355
|
getPreview: () => {},
|
|
@@ -53,7 +53,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
53
53
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
54
54
|
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); } /* eslint-disable */
|
|
55
55
|
function GenricLayOut(_ref) {
|
|
56
|
-
var _state$
|
|
56
|
+
var _state$misc31, _sidebar$mobileMenuIt, _imageViewer$content, _imageViewer$content2, _leftHeaderFirstButto, _leftHeaderFirstButto2, _infoPanel$data, _infoPanel$data2, _infoPanel$data3, _infoPanel$data4, _infoPanel$data5, _state$customDrawer3, _state$customDrawer4, _tabs$list, _tables$columns3, _tables$columns4, _tabs$active3, _state$tables7, _tables$selectionType, _tabs$active4, _tables$selectionType2, _tables$pagination17, _drawer$data, _tabs$active5, _drawer$data$drawer$a, _drawer$data2, _tabs$active6, _tabs$active7, _nestedDrawer$data, _nestedDrawer$data$ca, _nestedDrawer$data2, _customDrawer$data, _customDrawer$data2, _contentPanel$dataSou, _tables$tableFooter, _tables$selectedRowKe, _tables$tableFooter2, _tables$tableFooter3, _tables$tableFooter5;
|
|
57
57
|
let {
|
|
58
58
|
config,
|
|
59
59
|
getInitialData,
|
|
@@ -958,6 +958,41 @@ function GenricLayOut(_ref) {
|
|
|
958
958
|
});
|
|
959
959
|
}
|
|
960
960
|
}
|
|
961
|
+
} else if ((configArgs === null || configArgs === void 0 ? void 0 : configArgs.action) === "CHANGE_ROW") {
|
|
962
|
+
if (handleTableColumnClick) {
|
|
963
|
+
var _state$misc14;
|
|
964
|
+
const {
|
|
965
|
+
error,
|
|
966
|
+
data
|
|
967
|
+
} = await (handleTableColumnClick === null || handleTableColumnClick === void 0 ? void 0 : handleTableColumnClick(_objectSpread({
|
|
968
|
+
record: record,
|
|
969
|
+
type: configArgs === null || configArgs === void 0 ? void 0 : configArgs.call
|
|
970
|
+
}, (_state$misc14 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc14 !== void 0 ? _state$misc14 : {})));
|
|
971
|
+
if (error) {
|
|
972
|
+
showErrorNotification(error);
|
|
973
|
+
} else {
|
|
974
|
+
var _state$tables2, _state$tables3, _state$misc15;
|
|
975
|
+
const {
|
|
976
|
+
error,
|
|
977
|
+
data: tableData
|
|
978
|
+
} = await (handleActionOnTableCTAClick === null || handleActionOnTableCTAClick === void 0 ? void 0 : handleActionOnTableCTAClick(_objectSpread({
|
|
979
|
+
record: state === null || state === void 0 || (_state$tables2 = state.tables) === null || _state$tables2 === void 0 ? void 0 : _state$tables2.data,
|
|
980
|
+
currentChange: data,
|
|
981
|
+
type: "changeRow",
|
|
982
|
+
tableConfig: state === null || state === void 0 || (_state$tables3 = state.tables) === null || _state$tables3 === void 0 ? void 0 : _state$tables3.columns
|
|
983
|
+
}, (_state$misc15 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc15 !== void 0 ? _state$misc15 : {})));
|
|
984
|
+
console.log("tableData", tableData);
|
|
985
|
+
if (error) {
|
|
986
|
+
showErrorNotification(error);
|
|
987
|
+
} else {
|
|
988
|
+
var _tableData$record, _state$tables4;
|
|
989
|
+
dispatch({
|
|
990
|
+
type: _layoutReducer.actionTypes.CHANGE_ROW,
|
|
991
|
+
payload: (_tableData$record = tableData === null || tableData === void 0 ? void 0 : tableData.record) !== null && _tableData$record !== void 0 ? _tableData$record : [...(state === null || state === void 0 || (_state$tables4 = state.tables) === null || _state$tables4 === void 0 ? void 0 : _state$tables4.data)]
|
|
992
|
+
});
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
}
|
|
961
996
|
}
|
|
962
997
|
};
|
|
963
998
|
|
|
@@ -1023,11 +1058,11 @@ function GenricLayOut(_ref) {
|
|
|
1023
1058
|
}
|
|
1024
1059
|
} else if ((configData === null || configData === void 0 ? void 0 : configData.action) === "ACTION_ON_CTA") {
|
|
1025
1060
|
if (handleTableFooterApi) {
|
|
1026
|
-
var _state$
|
|
1061
|
+
var _state$tables5;
|
|
1027
1062
|
const {
|
|
1028
1063
|
error,
|
|
1029
1064
|
data
|
|
1030
|
-
} = await (handleTableFooterApi === null || handleTableFooterApi === void 0 ? void 0 : handleTableFooterApi(state === null || state === void 0 || (_state$
|
|
1065
|
+
} = await (handleTableFooterApi === null || handleTableFooterApi === void 0 ? void 0 : handleTableFooterApi(state === null || state === void 0 || (_state$tables5 = state.tables) === null || _state$tables5 === void 0 ? void 0 : _state$tables5.selectedRowKeys, state));
|
|
1031
1066
|
if (error) {
|
|
1032
1067
|
showErrorNotification(error);
|
|
1033
1068
|
} else {
|
|
@@ -1125,7 +1160,7 @@ function GenricLayOut(_ref) {
|
|
|
1125
1160
|
}
|
|
1126
1161
|
});
|
|
1127
1162
|
if (handleTableChange) {
|
|
1128
|
-
var _state$dropdownSearch3, _state$inputSearch4, _state$tabs8, _header$subHeading15, _header$subHeading16, _staticFilter$data6, _customDrawer$applied8, _state$
|
|
1163
|
+
var _state$dropdownSearch3, _state$inputSearch4, _state$tabs8, _header$subHeading15, _header$subHeading16, _staticFilter$data6, _customDrawer$applied8, _state$misc16, _state$staticFilter$m5, _state$staticFilter5;
|
|
1129
1164
|
dispatch({
|
|
1130
1165
|
type: _layoutReducer.actionTypes.SET_LOADING,
|
|
1131
1166
|
payload: true
|
|
@@ -1150,7 +1185,7 @@ function GenricLayOut(_ref) {
|
|
|
1150
1185
|
staticFilter: staticFilter.data.find(item => item.selected).value
|
|
1151
1186
|
}), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied8 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied8 !== void 0 ? _customDrawer$applied8 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), {}, {
|
|
1152
1187
|
order: (sorter === null || sorter === void 0 ? void 0 : sorter.order) === "ascend" && "ASC" || (sorter === null || sorter === void 0 ? void 0 : sorter.order) === "descend" && "DESC" || ""
|
|
1153
|
-
}, (_state$
|
|
1188
|
+
}, (_state$misc16 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc16 !== void 0 ? _state$misc16 : {}), {}, {
|
|
1154
1189
|
multiSelectValue: (_state$staticFilter$m5 = state === null || state === void 0 || (_state$staticFilter5 = state.staticFilter) === null || _state$staticFilter5 === void 0 ? void 0 : _state$staticFilter5.multiSelectValue) !== null && _state$staticFilter$m5 !== void 0 ? _state$staticFilter$m5 : []
|
|
1155
1190
|
}));
|
|
1156
1191
|
if (error) {
|
|
@@ -1233,7 +1268,7 @@ function GenricLayOut(_ref) {
|
|
|
1233
1268
|
});
|
|
1234
1269
|
const selectedStaticFilterValue = tables !== null && tables !== void 0 && tables.staticFilterKey && (tables === null || tables === void 0 ? void 0 : tables.staticFilterKey) == key && Array.isArray(staticFilter.data) ? (_staticFilter$data$fi2 = staticFilter.data.find(item => item.selected)) === null || _staticFilter$data$fi2 === void 0 ? void 0 : _staticFilter$data$fi2.value : undefined;
|
|
1235
1270
|
if (handleTabClick) {
|
|
1236
|
-
var _state$
|
|
1271
|
+
var _state$misc17, _tables$pagination, _tables$pagination2, _tables$sorting13, _tables$sorting14, _state$dropdownSearch4, _header$subHeading17, _header$subHeading18, _customDrawer$applied9, _state$misc18, _state$staticFilter$m6, _state$staticFilter6;
|
|
1237
1272
|
dispatch({
|
|
1238
1273
|
type: _layoutReducer.actionTypes.SET_LOADING,
|
|
1239
1274
|
payload: true
|
|
@@ -1241,7 +1276,7 @@ function GenricLayOut(_ref) {
|
|
|
1241
1276
|
const {
|
|
1242
1277
|
error,
|
|
1243
1278
|
data
|
|
1244
|
-
} = await handleTabClick(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, (_state$
|
|
1279
|
+
} = await handleTabClick(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, (_state$misc17 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc17 !== void 0 ? _state$misc17 : {}), {}, {
|
|
1245
1280
|
selectedTab: key,
|
|
1246
1281
|
current: tables === null || tables === void 0 || (_tables$pagination = tables.pagination) === null || _tables$pagination === void 0 ? void 0 : _tables$pagination.current,
|
|
1247
1282
|
pageSize: tables === null || tables === void 0 || (_tables$pagination2 = tables.pagination) === null || _tables$pagination2 === void 0 ? void 0 : _tables$pagination2.pageSize,
|
|
@@ -1255,7 +1290,7 @@ function GenricLayOut(_ref) {
|
|
|
1255
1290
|
selectedOption: state.dropdownSearch.selectedOption
|
|
1256
1291
|
}), (header === null || header === void 0 || (_header$subHeading17 = header.subHeading) === null || _header$subHeading17 === void 0 || (_header$subHeading17 = _header$subHeading17.jsxConfig) === null || _header$subHeading17 === void 0 ? void 0 : _header$subHeading17.type) == "select" ? {
|
|
1257
1292
|
subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading18 = header.subHeading) === null || _header$subHeading18 === void 0 || (_header$subHeading18 = _header$subHeading18.jsxConfig) === null || _header$subHeading18 === void 0 ? void 0 : _header$subHeading18.value
|
|
1258
|
-
} : {}), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied9 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied9 !== void 0 ? _customDrawer$applied9 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), (_state$
|
|
1293
|
+
} : {}), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied9 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied9 !== void 0 ? _customDrawer$applied9 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), (_state$misc18 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc18 !== void 0 ? _state$misc18 : {}), {}, {
|
|
1259
1294
|
multiSelectValue: (_state$staticFilter$m6 = state === null || state === void 0 || (_state$staticFilter6 = state.staticFilter) === null || _state$staticFilter6 === void 0 ? void 0 : _state$staticFilter6.multiSelectValue) !== null && _state$staticFilter$m6 !== void 0 ? _state$staticFilter$m6 : []
|
|
1260
1295
|
}));
|
|
1261
1296
|
if (error) {
|
|
@@ -1351,11 +1386,11 @@ function GenricLayOut(_ref) {
|
|
|
1351
1386
|
return;
|
|
1352
1387
|
}
|
|
1353
1388
|
if (handleDrawerFormOnFinish) {
|
|
1354
|
-
var _state$
|
|
1389
|
+
var _state$misc19;
|
|
1355
1390
|
const {
|
|
1356
1391
|
error,
|
|
1357
1392
|
data
|
|
1358
|
-
} = await (handleDrawerFormOnFinish === null || handleDrawerFormOnFinish === void 0 ? void 0 : handleDrawerFormOnFinish(_objectSpread(_objectSpread(_objectSpread({}, record), formData), (_state$
|
|
1393
|
+
} = await (handleDrawerFormOnFinish === null || handleDrawerFormOnFinish === void 0 ? void 0 : handleDrawerFormOnFinish(_objectSpread(_objectSpread(_objectSpread({}, record), formData), (_state$misc19 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc19 !== void 0 ? _state$misc19 : {})));
|
|
1359
1394
|
if (error) {
|
|
1360
1395
|
showErrorNotification(error);
|
|
1361
1396
|
} else {
|
|
@@ -1379,7 +1414,7 @@ function GenricLayOut(_ref) {
|
|
|
1379
1414
|
|
|
1380
1415
|
// If there are remaining filters, reapply them
|
|
1381
1416
|
if (Object.keys(currentFilters).length > 0) {
|
|
1382
|
-
var _state$dropdownSearch5, _state$inputSearch5, _state$tabs11, _tables$pagination3, _tables$pagination4, _tables$filter6, _tables$sorting15, _header$subHeading19, _header$subHeading20, _staticFilter$data7, _tables$sorting16, _state$
|
|
1417
|
+
var _state$dropdownSearch5, _state$inputSearch5, _state$tabs11, _tables$pagination3, _tables$pagination4, _tables$filter6, _tables$sorting15, _header$subHeading19, _header$subHeading20, _staticFilter$data7, _tables$sorting16, _state$misc20, _state$staticFilter$m7, _state$staticFilter7;
|
|
1383
1418
|
const {
|
|
1384
1419
|
error,
|
|
1385
1420
|
data
|
|
@@ -1405,7 +1440,7 @@ function GenricLayOut(_ref) {
|
|
|
1405
1440
|
staticFilter: staticFilter.data.find(item => item.selected).value
|
|
1406
1441
|
}), {}, {
|
|
1407
1442
|
order: tables === null || tables === void 0 || (_tables$sorting16 = tables.sorting) === null || _tables$sorting16 === void 0 ? void 0 : _tables$sorting16.sortDirection
|
|
1408
|
-
}, (_state$
|
|
1443
|
+
}, (_state$misc20 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc20 !== void 0 ? _state$misc20 : {}), {}, {
|
|
1409
1444
|
multiSelectValue: (_state$staticFilter$m7 = state === null || state === void 0 || (_state$staticFilter7 = state.staticFilter) === null || _state$staticFilter7 === void 0 ? void 0 : _state$staticFilter7.multiSelectValue) !== null && _state$staticFilter$m7 !== void 0 ? _state$staticFilter$m7 : []
|
|
1410
1445
|
}));
|
|
1411
1446
|
if (error) {
|
|
@@ -1439,7 +1474,7 @@ function GenricLayOut(_ref) {
|
|
|
1439
1474
|
const filterFormOnFinish = async formData => {
|
|
1440
1475
|
// Check if this is a cancel/clear action - check both buttonClickType and the actual button data
|
|
1441
1476
|
if (formData.type === "FILTER-CANCEL") {
|
|
1442
|
-
var _state$dropdownSearch6, _state$inputSearch6, _state$tabs12, _tables$pagination5, _tables$pagination6, _tables$filter7, _tables$sorting17, _header$subHeading21, _header$subHeading22, _staticFilter$data8, _tables$sorting18, _state$
|
|
1477
|
+
var _state$dropdownSearch6, _state$inputSearch6, _state$tabs12, _tables$pagination5, _tables$pagination6, _tables$filter7, _tables$sorting17, _header$subHeading21, _header$subHeading22, _staticFilter$data8, _tables$sorting18, _state$misc21, _state$staticFilter$m8, _state$staticFilter8;
|
|
1443
1478
|
if (isFiltersEmpty(customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)) {
|
|
1444
1479
|
dispatch({
|
|
1445
1480
|
type: _layoutReducer.actionTypes.CUSTOM_DRAWER_CLOSED
|
|
@@ -1468,7 +1503,7 @@ function GenricLayOut(_ref) {
|
|
|
1468
1503
|
staticFilter: staticFilter.data.find(item => item.selected).value
|
|
1469
1504
|
}), {}, {
|
|
1470
1505
|
order: tables === null || tables === void 0 || (_tables$sorting18 = tables.sorting) === null || _tables$sorting18 === void 0 ? void 0 : _tables$sorting18.sortDirection
|
|
1471
|
-
}, (_state$
|
|
1506
|
+
}, (_state$misc21 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc21 !== void 0 ? _state$misc21 : {}), {}, {
|
|
1472
1507
|
multiSelectValue: (_state$staticFilter$m8 = state === null || state === void 0 || (_state$staticFilter8 = state.staticFilter) === null || _state$staticFilter8 === void 0 ? void 0 : _state$staticFilter8.multiSelectValue) !== null && _state$staticFilter$m8 !== void 0 ? _state$staticFilter$m8 : []
|
|
1473
1508
|
}));
|
|
1474
1509
|
if (error) {
|
|
@@ -1518,7 +1553,7 @@ function GenricLayOut(_ref) {
|
|
|
1518
1553
|
|
|
1519
1554
|
// Only process filter data if this is actually a filter drawer
|
|
1520
1555
|
if (formData.type === "FILTER-SUBMIT") {
|
|
1521
|
-
var _state$dropdownSearch7, _state$inputSearch7, _ref4, _appliedFilters$filte, _state$tabs13, _config$tables29, _config$tables30, _tables$filter8, _tables$sorting19, _header$subHeading23, _header$subHeading24, _staticFilter$data9, _tables$sorting20, _state$
|
|
1556
|
+
var _state$dropdownSearch7, _state$inputSearch7, _ref4, _appliedFilters$filte, _state$tabs13, _config$tables29, _config$tables30, _tables$filter8, _tables$sorting19, _header$subHeading23, _header$subHeading24, _staticFilter$data9, _tables$sorting20, _state$misc22, _state$staticFilter$m9, _state$staticFilter9;
|
|
1522
1557
|
const appliedFilters = {};
|
|
1523
1558
|
Object.keys(formData).forEach(key => {
|
|
1524
1559
|
const value = formData[key];
|
|
@@ -1557,7 +1592,7 @@ function GenricLayOut(_ref) {
|
|
|
1557
1592
|
staticFilter: staticFilter.data.find(item => item.selected).value
|
|
1558
1593
|
}), {}, {
|
|
1559
1594
|
order: tables === null || tables === void 0 || (_tables$sorting20 = tables.sorting) === null || _tables$sorting20 === void 0 ? void 0 : _tables$sorting20.sortDirection
|
|
1560
|
-
}, (_state$
|
|
1595
|
+
}, (_state$misc22 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc22 !== void 0 ? _state$misc22 : {}), {}, {
|
|
1561
1596
|
multiSelectValue: (_state$staticFilter$m9 = state === null || state === void 0 || (_state$staticFilter9 = state.staticFilter) === null || _state$staticFilter9 === void 0 ? void 0 : _state$staticFilter9.multiSelectValue) !== null && _state$staticFilter$m9 !== void 0 ? _state$staticFilter$m9 : []
|
|
1562
1597
|
}));
|
|
1563
1598
|
if (error) {
|
|
@@ -1612,7 +1647,7 @@ function GenricLayOut(_ref) {
|
|
|
1612
1647
|
}
|
|
1613
1648
|
});
|
|
1614
1649
|
if (handleSecondaryTableCTAClick) {
|
|
1615
|
-
var _state$dropdownSearch8, _state$inputSearch8, _state$tabs14, _tables$pagination7, _tables$pagination8, _tables$filter9, _tables$sorting21, _tables$sorting22, _header$subHeading25, _header$subHeading26, _staticFilter$data10, _state$
|
|
1650
|
+
var _state$dropdownSearch8, _state$inputSearch8, _state$tabs14, _tables$pagination7, _tables$pagination8, _tables$filter9, _tables$sorting21, _tables$sorting22, _header$subHeading25, _header$subHeading26, _staticFilter$data10, _state$misc23, _state$staticFilter$m10, _state$staticFilter10;
|
|
1616
1651
|
const {
|
|
1617
1652
|
error,
|
|
1618
1653
|
data
|
|
@@ -1637,7 +1672,7 @@ function GenricLayOut(_ref) {
|
|
|
1637
1672
|
toDate: formData === null || formData === void 0 ? void 0 : formData.toDate
|
|
1638
1673
|
}, appliedFilters), (formData === null || formData === void 0 ? void 0 : formData.exportType) && {
|
|
1639
1674
|
exportType: formData === null || formData === void 0 ? void 0 : formData.exportType
|
|
1640
|
-
}), (_state$
|
|
1675
|
+
}), (_state$misc23 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc23 !== void 0 ? _state$misc23 : {}), {}, {
|
|
1641
1676
|
multiSelectValue: (_state$staticFilter$m10 = state === null || state === void 0 || (_state$staticFilter10 = state.staticFilter) === null || _state$staticFilter10 === void 0 ? void 0 : _state$staticFilter10.multiSelectValue) !== null && _state$staticFilter$m10 !== void 0 ? _state$staticFilter$m10 : []
|
|
1642
1677
|
})));
|
|
1643
1678
|
if (error) {
|
|
@@ -1653,7 +1688,7 @@ function GenricLayOut(_ref) {
|
|
|
1653
1688
|
}
|
|
1654
1689
|
};
|
|
1655
1690
|
const onClearAllAppliedFilters = async () => {
|
|
1656
|
-
var _state$dropdownSearch9, _state$inputSearch9, _state$tabs15, _tables$pagination9, _tables$pagination10, _tables$filter10, _tables$sorting23, _header$subHeading27, _header$subHeading28, _staticFilter$data11, _tables$sorting24, _state$
|
|
1691
|
+
var _state$dropdownSearch9, _state$inputSearch9, _state$tabs15, _tables$pagination9, _tables$pagination10, _tables$filter10, _tables$sorting23, _header$subHeading27, _header$subHeading28, _staticFilter$data11, _tables$sorting24, _state$misc24, _state$staticFilter$m11, _state$staticFilter11;
|
|
1657
1692
|
const {
|
|
1658
1693
|
error,
|
|
1659
1694
|
data
|
|
@@ -1676,7 +1711,7 @@ function GenricLayOut(_ref) {
|
|
|
1676
1711
|
staticFilter: staticFilter.data.find(item => item.selected).value
|
|
1677
1712
|
}), {}, {
|
|
1678
1713
|
order: tables === null || tables === void 0 || (_tables$sorting24 = tables.sorting) === null || _tables$sorting24 === void 0 ? void 0 : _tables$sorting24.sortDirection
|
|
1679
|
-
}, (_state$
|
|
1714
|
+
}, (_state$misc24 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc24 !== void 0 ? _state$misc24 : {}), {}, {
|
|
1680
1715
|
multiSelectValue: (_state$staticFilter$m11 = state === null || state === void 0 || (_state$staticFilter11 = state.staticFilter) === null || _state$staticFilter11 === void 0 ? void 0 : _state$staticFilter11.multiSelectValue) !== null && _state$staticFilter$m11 !== void 0 ? _state$staticFilter$m11 : []
|
|
1681
1716
|
}));
|
|
1682
1717
|
if (error) {
|
|
@@ -1735,14 +1770,14 @@ function GenricLayOut(_ref) {
|
|
|
1735
1770
|
return;
|
|
1736
1771
|
} else if (action === "CLOSE_MODAL_AND_FETCH") {
|
|
1737
1772
|
if (handleModalCloseSuccess) {
|
|
1738
|
-
var _stateRef$current, _state$
|
|
1773
|
+
var _stateRef$current, _state$misc25;
|
|
1739
1774
|
const {
|
|
1740
1775
|
error,
|
|
1741
1776
|
data
|
|
1742
1777
|
} = await (handleModalCloseSuccess === null || handleModalCloseSuccess === void 0 ? void 0 : handleModalCloseSuccess(_objectSpread({
|
|
1743
1778
|
modalValue: stateRef === null || stateRef === void 0 || (_stateRef$current = stateRef.current) === null || _stateRef$current === void 0 || (_stateRef$current = _stateRef$current.modal) === null || _stateRef$current === void 0 ? void 0 : _stateRef$current.value,
|
|
1744
1779
|
call: buttonConfig === null || buttonConfig === void 0 ? void 0 : buttonConfig.call
|
|
1745
|
-
}, (_state$
|
|
1780
|
+
}, (_state$misc25 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc25 !== void 0 ? _state$misc25 : {})));
|
|
1746
1781
|
if (error) {
|
|
1747
1782
|
showErrorNotification(error);
|
|
1748
1783
|
} else {
|
|
@@ -1756,11 +1791,11 @@ function GenricLayOut(_ref) {
|
|
|
1756
1791
|
}
|
|
1757
1792
|
} else {
|
|
1758
1793
|
if (handleDrawerFormOnFinish) {
|
|
1759
|
-
var _state$tables$selecte, _state$
|
|
1794
|
+
var _state$tables$selecte, _state$tables6, _state$misc26;
|
|
1760
1795
|
let req = {};
|
|
1761
1796
|
req.type = "APPROVE";
|
|
1762
|
-
req.orderUUID = (_state$tables$selecte = state === null || state === void 0 || (_state$
|
|
1763
|
-
req.misc = (_state$
|
|
1797
|
+
req.orderUUID = (_state$tables$selecte = state === null || state === void 0 || (_state$tables6 = state.tables) === null || _state$tables6 === void 0 || (_state$tables6 = _state$tables6.selectedRowKeys) === null || _state$tables6 === void 0 ? void 0 : _state$tables6.map(item => item.orderUUID)) !== null && _state$tables$selecte !== void 0 ? _state$tables$selecte : [];
|
|
1798
|
+
req.misc = (_state$misc26 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc26 !== void 0 ? _state$misc26 : {};
|
|
1764
1799
|
const {
|
|
1765
1800
|
error,
|
|
1766
1801
|
data
|
|
@@ -1874,7 +1909,7 @@ function GenricLayOut(_ref) {
|
|
|
1874
1909
|
};
|
|
1875
1910
|
const rightHeaderSecondButtonClick = async () => {
|
|
1876
1911
|
if ((rightHeaderSecondButton === null || rightHeaderSecondButton === void 0 ? void 0 : rightHeaderSecondButton.action) === "RESET_CUSTOM_DRAWER") {
|
|
1877
|
-
var _state$dropdownSearch10, _state$inputSearch10, _state$tabs16, _tables$pagination11, _tables$pagination12, _tables$filter11, _tables$sorting25, _header$subHeading29, _header$subHeading30, _staticFilter$data12, _tables$sorting26, _state$
|
|
1912
|
+
var _state$dropdownSearch10, _state$inputSearch10, _state$tabs16, _tables$pagination11, _tables$pagination12, _tables$filter11, _tables$sorting25, _header$subHeading29, _header$subHeading30, _staticFilter$data12, _tables$sorting26, _state$misc27, _state$staticFilter$m12, _state$staticFilter12;
|
|
1878
1913
|
const {
|
|
1879
1914
|
error,
|
|
1880
1915
|
data
|
|
@@ -1897,7 +1932,7 @@ function GenricLayOut(_ref) {
|
|
|
1897
1932
|
staticFilter: staticFilter.data.find(item => item.selected).value
|
|
1898
1933
|
}), {}, {
|
|
1899
1934
|
order: tables === null || tables === void 0 || (_tables$sorting26 = tables.sorting) === null || _tables$sorting26 === void 0 ? void 0 : _tables$sorting26.sortDirection
|
|
1900
|
-
}, (_state$
|
|
1935
|
+
}, (_state$misc27 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc27 !== void 0 ? _state$misc27 : {}), {}, {
|
|
1901
1936
|
multiSelectValue: (_state$staticFilter$m12 = state === null || state === void 0 || (_state$staticFilter12 = state.staticFilter) === null || _state$staticFilter12 === void 0 ? void 0 : _state$staticFilter12.multiSelectValue) !== null && _state$staticFilter$m12 !== void 0 ? _state$staticFilter$m12 : []
|
|
1902
1937
|
}));
|
|
1903
1938
|
if (error) {
|
|
@@ -1950,7 +1985,7 @@ function GenricLayOut(_ref) {
|
|
|
1950
1985
|
};
|
|
1951
1986
|
const handleSubHeadingSelect = async val => {
|
|
1952
1987
|
if (val) {
|
|
1953
|
-
var _state$tabs17, _tables$pagination13, _tables$pagination14, _state$
|
|
1988
|
+
var _state$tabs17, _tables$pagination13, _tables$pagination14, _state$misc28;
|
|
1954
1989
|
dispatch({
|
|
1955
1990
|
type: _layoutReducer.actionTypes.SET_SUBHEADING_SELECTED_CONFIG,
|
|
1956
1991
|
payload: val
|
|
@@ -1964,7 +1999,7 @@ function GenricLayOut(_ref) {
|
|
|
1964
1999
|
current: tables === null || tables === void 0 || (_tables$pagination13 = tables.pagination) === null || _tables$pagination13 === void 0 ? void 0 : _tables$pagination13.current,
|
|
1965
2000
|
pageSize: tables === null || tables === void 0 || (_tables$pagination14 = tables.pagination) === null || _tables$pagination14 === void 0 ? void 0 : _tables$pagination14.pageSize,
|
|
1966
2001
|
subHeadingSelectVal: val
|
|
1967
|
-
}, (_state$
|
|
2002
|
+
}, (_state$misc28 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc28 !== void 0 ? _state$misc28 : {}));
|
|
1968
2003
|
if (error) {
|
|
1969
2004
|
showErrorNotification(error);
|
|
1970
2005
|
dispatch({
|
|
@@ -2000,7 +2035,7 @@ function GenricLayOut(_ref) {
|
|
|
2000
2035
|
|
|
2001
2036
|
// Call the handler if provided
|
|
2002
2037
|
if (handleTableChange) {
|
|
2003
|
-
var _state$dropdownSearch11, _state$inputSearch11, _state$tabs18, _tables$pagination15, _tables$sorting27, _tables$sorting28, _header$subHeading31, _header$subHeading32, _customDrawer$applied10, _state$
|
|
2038
|
+
var _state$dropdownSearch11, _state$inputSearch11, _state$tabs18, _tables$pagination15, _tables$sorting27, _tables$sorting28, _header$subHeading31, _header$subHeading32, _customDrawer$applied10, _state$misc29;
|
|
2004
2039
|
dispatch({
|
|
2005
2040
|
type: _layoutReducer.actionTypes.SET_LOADING,
|
|
2006
2041
|
payload: true
|
|
@@ -2022,7 +2057,7 @@ function GenricLayOut(_ref) {
|
|
|
2022
2057
|
order: tables === null || tables === void 0 || (_tables$sorting28 = tables.sorting) === null || _tables$sorting28 === void 0 ? void 0 : _tables$sorting28.sortDirection
|
|
2023
2058
|
}, (header === null || header === void 0 || (_header$subHeading31 = header.subHeading) === null || _header$subHeading31 === void 0 || (_header$subHeading31 = _header$subHeading31.jsxConfig) === null || _header$subHeading31 === void 0 ? void 0 : _header$subHeading31.type) == "select" ? {
|
|
2024
2059
|
subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading32 = header.subHeading) === null || _header$subHeading32 === void 0 || (_header$subHeading32 = _header$subHeading32.jsxConfig) === null || _header$subHeading32 === void 0 ? void 0 : _header$subHeading32.value
|
|
2025
|
-
} : {}), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied10 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied10 !== void 0 ? _customDrawer$applied10 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), (_state$
|
|
2060
|
+
} : {}), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied10 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied10 !== void 0 ? _customDrawer$applied10 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), (_state$misc29 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc29 !== void 0 ? _state$misc29 : {}), {}, {
|
|
2026
2061
|
staticFilter: filterValue,
|
|
2027
2062
|
// Pass static filter value
|
|
2028
2063
|
multiSelectValue: multiSelectValue
|
|
@@ -2066,7 +2101,7 @@ function GenricLayOut(_ref) {
|
|
|
2066
2101
|
}
|
|
2067
2102
|
});
|
|
2068
2103
|
if (handleTableChange) {
|
|
2069
|
-
var _state$dropdownSearch12, _state$inputSearch12, _state$tabs19, _tables$filter12, _tables$sorting29, _tables$sorting30, _header$subHeading33, _header$subHeading34, _staticFilter$data13, _customDrawer$applied11, _state$
|
|
2104
|
+
var _state$dropdownSearch12, _state$inputSearch12, _state$tabs19, _tables$filter12, _tables$sorting29, _tables$sorting30, _header$subHeading33, _header$subHeading34, _staticFilter$data13, _customDrawer$applied11, _state$misc30, _state$staticFilter$m13, _state$staticFilter13;
|
|
2070
2105
|
const {
|
|
2071
2106
|
error,
|
|
2072
2107
|
data
|
|
@@ -2086,7 +2121,7 @@ function GenricLayOut(_ref) {
|
|
|
2086
2121
|
subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading34 = header.subHeading) === null || _header$subHeading34 === void 0 || (_header$subHeading34 = _header$subHeading34.jsxConfig) === null || _header$subHeading34 === void 0 ? void 0 : _header$subHeading34.value
|
|
2087
2122
|
} : {}), (staticFilter === null || staticFilter === void 0 ? void 0 : staticFilter.visible) && ((_staticFilter$data13 = staticFilter.data) === null || _staticFilter$data13 === void 0 || (_staticFilter$data13 = _staticFilter$data13.find(item => item.selected)) === null || _staticFilter$data13 === void 0 ? void 0 : _staticFilter$data13.value) && {
|
|
2088
2123
|
staticFilter: staticFilter.data.find(item => item.selected).value
|
|
2089
|
-
}), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied11 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied11 !== void 0 ? _customDrawer$applied11 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), (_state$
|
|
2124
|
+
}), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied11 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied11 !== void 0 ? _customDrawer$applied11 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), (_state$misc30 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc30 !== void 0 ? _state$misc30 : {}), {}, {
|
|
2090
2125
|
multiSelectValue: (_state$staticFilter$m13 = state === null || state === void 0 || (_state$staticFilter13 = state.staticFilter) === null || _state$staticFilter13 === void 0 ? void 0 : _state$staticFilter13.multiSelectValue) !== null && _state$staticFilter$m13 !== void 0 ? _state$staticFilter$m13 : []
|
|
2091
2126
|
}));
|
|
2092
2127
|
if (error) {
|
|
@@ -2117,7 +2152,7 @@ function GenricLayOut(_ref) {
|
|
|
2117
2152
|
console.log(state, "GenricLayOutstate");
|
|
2118
2153
|
return /*#__PURE__*/_react.default.createElement(_styles.OapageWithDataStyle, {
|
|
2119
2154
|
marginBottom: infoPanel !== null && infoPanel !== void 0 && infoPanel.bottomMarginRequired ? "18px" : "0",
|
|
2120
|
-
className: (state === null || state === void 0 || (_state$
|
|
2155
|
+
className: (state === null || state === void 0 || (_state$misc31 = state.misc) === null || _state$misc31 === void 0 ? void 0 : _state$misc31.flow) === "hubAutomation" ? "hubAutomationContainer" : ""
|
|
2121
2156
|
}, /*#__PURE__*/_react.default.createElement(_styles.DrawerWithOutFooter, null), /*#__PURE__*/_react.default.createElement("div", {
|
|
2122
2157
|
className: "fullPageLayout"
|
|
2123
2158
|
}, /*#__PURE__*/_react.default.createElement(_GlobalCss.default, null, (sidebar === null || sidebar === void 0 ? void 0 : sidebar.visible) && /*#__PURE__*/_react.default.createElement(_antd.Skeleton, {
|
|
@@ -2310,7 +2345,7 @@ function GenricLayOut(_ref) {
|
|
|
2310
2345
|
onChange: onTableChange,
|
|
2311
2346
|
customTableChange: customTableChange,
|
|
2312
2347
|
pagination: tables === null || tables === void 0 ? void 0 : tables.pagination,
|
|
2313
|
-
selectedRows: (state === null || state === void 0 || (_state$
|
|
2348
|
+
selectedRows: (state === null || state === void 0 || (_state$tables7 = state.tables) === null || _state$tables7 === void 0 ? void 0 : _state$tables7.selectedRowKeys) || [],
|
|
2314
2349
|
rowSelection: (tables === null || tables === void 0 || (_tables$selectionType = tables.selectionType) === null || _tables$selectionType === void 0 ? void 0 : _tables$selectionType[(_tabs$active4 = tabs === null || tabs === void 0 ? void 0 : tabs.active) !== null && _tabs$active4 !== void 0 ? _tabs$active4 : "default"]) && Object.assign({
|
|
2315
2350
|
type: tables === null || tables === void 0 || (_tables$selectionType2 = tables.selectionType) === null || _tables$selectionType2 === void 0 ? void 0 : _tables$selectionType2[tabs === null || tabs === void 0 ? void 0 : tabs.active]
|
|
2316
2351
|
}, rowSelection),
|
|
@@ -56,7 +56,8 @@ const actionTypes = exports.actionTypes = {
|
|
|
56
56
|
CLEAR_ALL_APPLIED_FILTERS: "CLEAR_ALL_APPLIED_FILTERS",
|
|
57
57
|
UPDATE_FILTER_FORM_VALUES: "UPDATE_FILTER_FORM_VALUES",
|
|
58
58
|
SET_STATIC_FILTER: "SET_STATIC_FILTER",
|
|
59
|
-
SET_PROFILE_DATA: "SET_PROFILE_DATA"
|
|
59
|
+
SET_PROFILE_DATA: "SET_PROFILE_DATA",
|
|
60
|
+
CHANGE_ROW: "CHANGE_ROW"
|
|
60
61
|
};
|
|
61
62
|
function getFieldDefaultValue(widget) {
|
|
62
63
|
switch (widget) {
|
|
@@ -300,6 +301,10 @@ const genericLayoutReducer = exports.genericLayoutReducer = (0, _immer.produce)(
|
|
|
300
301
|
case actionTypes.SET_PROFILE_DATA:
|
|
301
302
|
draft.profileData = _objectSpread(_objectSpread({}, draft.profileData), action.payload);
|
|
302
303
|
break;
|
|
304
|
+
case actionTypes.CHANGE_ROW:
|
|
305
|
+
console.log("Row changed to:", action.payload);
|
|
306
|
+
draft.tables.data = action.payload;
|
|
307
|
+
break;
|
|
303
308
|
default:
|
|
304
309
|
break;
|
|
305
310
|
}
|