oa-componentbook 1.0.1-stage.356 → 1.0.1-stage.358
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.
|
@@ -39,7 +39,7 @@ function MaterialIcon(_ref) {
|
|
|
39
39
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
40
40
|
const renderedIcon = /*#__PURE__*/_react.default.createElement(Icon, _extends({
|
|
41
41
|
style: _objectSpread({
|
|
42
|
-
color: color ? _ColorVariablesMap.default["--color-".concat(color)] : undefined,
|
|
42
|
+
color: color && _ColorVariablesMap.default["--color-".concat(color)] ? _ColorVariablesMap.default["--color-".concat(color)] : color || undefined,
|
|
43
43
|
fontSize: size ? "".concat(size, "px") : 'inherit',
|
|
44
44
|
transition: 'transform .3s ease',
|
|
45
45
|
transform: "rotate(".concat(rotate, "deg)")
|
|
@@ -51,7 +51,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
51
51
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
52
52
|
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 */
|
|
53
53
|
function GenricLayOut(_ref) {
|
|
54
|
-
var _state$
|
|
54
|
+
var _state$misc22, _imageViewer$content, _imageViewer$content2, _leftHeaderFirstButto, _leftHeaderFirstButto2, _state$customDrawer3, _state$customDrawer4, _tabs$list, _tables$columns3, _tables$columns4, _tabs$active3, _state$tables3, _tables$selectionType, _tabs$active4, _tables$selectionType2, _tables$pagination31, _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;
|
|
55
55
|
let {
|
|
56
56
|
config,
|
|
57
57
|
getInitialData,
|
|
@@ -373,7 +373,7 @@ function GenricLayOut(_ref) {
|
|
|
373
373
|
});
|
|
374
374
|
if (value === "") {
|
|
375
375
|
if (handleDropdownSearchInputChange) {
|
|
376
|
-
var _state$tabs4, _tables$pagination5, _tables$pagination6, _tables$sorting5, _tables$sorting6, _tables$filter, _staticFilter$data, _customDrawer$applied3, _state$misc2;
|
|
376
|
+
var _state$tabs4, _tables$pagination5, _tables$pagination6, _tables$sorting5, _tables$sorting6, _tables$filter, _staticFilter$data, _customDrawer$applied3, _header$subHeading5, _header$subHeading6, _state$misc2;
|
|
377
377
|
dispatch({
|
|
378
378
|
type: _layoutReducer.actionTypes.SET_LOADING,
|
|
379
379
|
payload: true
|
|
@@ -381,7 +381,7 @@ function GenricLayOut(_ref) {
|
|
|
381
381
|
const {
|
|
382
382
|
error,
|
|
383
383
|
data
|
|
384
|
-
} = await handleDropdownSearchInputChange(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
384
|
+
} = await handleDropdownSearchInputChange(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
385
385
|
selectedTab: state === null || state === void 0 || (_state$tabs4 = state.tabs) === null || _state$tabs4 === void 0 ? void 0 : _state$tabs4.active,
|
|
386
386
|
current: tables === null || tables === void 0 || (_tables$pagination5 = tables.pagination) === null || _tables$pagination5 === void 0 ? void 0 : _tables$pagination5.current,
|
|
387
387
|
pageSize: tables === null || tables === void 0 || (_tables$pagination6 = tables.pagination) === null || _tables$pagination6 === void 0 ? void 0 : _tables$pagination6.pageSize,
|
|
@@ -391,7 +391,9 @@ function GenricLayOut(_ref) {
|
|
|
391
391
|
columnFilterStatus: tables === null || tables === void 0 ? void 0 : tables.filter
|
|
392
392
|
}), (staticFilter === null || staticFilter === void 0 ? void 0 : staticFilter.visible) && ((_staticFilter$data = staticFilter.data) === null || _staticFilter$data === void 0 || (_staticFilter$data = _staticFilter$data.find(item => item.selected)) === null || _staticFilter$data === void 0 ? void 0 : _staticFilter$data.value) && {
|
|
393
393
|
staticFilter: staticFilter.data.find(item => item.selected).value
|
|
394
|
-
}), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied3 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied3 !== void 0 ? _customDrawer$applied3 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), (
|
|
394
|
+
}), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied3 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied3 !== void 0 ? _customDrawer$applied3 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), (header === null || header === void 0 || (_header$subHeading5 = header.subHeading) === null || _header$subHeading5 === void 0 || (_header$subHeading5 = _header$subHeading5.jsxConfig) === null || _header$subHeading5 === void 0 ? void 0 : _header$subHeading5.type) == "select" ? {
|
|
395
|
+
subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading6 = header.subHeading) === null || _header$subHeading6 === void 0 || (_header$subHeading6 = _header$subHeading6.jsxConfig) === null || _header$subHeading6 === void 0 ? void 0 : _header$subHeading6.value
|
|
396
|
+
} : {}), (_state$misc2 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc2 !== void 0 ? _state$misc2 : {}));
|
|
395
397
|
if (error) {
|
|
396
398
|
showErrorNotification(error);
|
|
397
399
|
dispatch({
|
|
@@ -453,11 +455,11 @@ function GenricLayOut(_ref) {
|
|
|
453
455
|
payload: value
|
|
454
456
|
});
|
|
455
457
|
if (handleDropdownSearchEnter) {
|
|
456
|
-
var _state$tabs5, _tables$pagination7, _tables$pagination8, _tables$sorting7, _tables$sorting8, _tables$filter2, _staticFilter$data2, _customDrawer$applied4, _state$misc3;
|
|
458
|
+
var _state$tabs5, _tables$pagination7, _tables$pagination8, _tables$sorting7, _tables$sorting8, _tables$filter2, _staticFilter$data2, _customDrawer$applied4, _header$subHeading7, _header$subHeading8, _state$misc3;
|
|
457
459
|
const {
|
|
458
460
|
error,
|
|
459
461
|
data
|
|
460
|
-
} = await handleDropdownSearchEnter(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
462
|
+
} = await handleDropdownSearchEnter(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
461
463
|
searchedValue: value,
|
|
462
464
|
selectedTab: state === null || state === void 0 || (_state$tabs5 = state.tabs) === null || _state$tabs5 === void 0 ? void 0 : _state$tabs5.active,
|
|
463
465
|
selectedOption: state === null || state === void 0 ? void 0 : state.dropdownSearch.selectedOption,
|
|
@@ -469,7 +471,9 @@ function GenricLayOut(_ref) {
|
|
|
469
471
|
columnFilterStatus: tables === null || tables === void 0 ? void 0 : tables.filter
|
|
470
472
|
}), (staticFilter === null || staticFilter === void 0 ? void 0 : staticFilter.visible) && ((_staticFilter$data2 = staticFilter.data) === null || _staticFilter$data2 === void 0 || (_staticFilter$data2 = _staticFilter$data2.find(item => item.selected)) === null || _staticFilter$data2 === void 0 ? void 0 : _staticFilter$data2.value) && {
|
|
471
473
|
staticFilter: staticFilter.data.find(item => item.selected).value
|
|
472
|
-
}), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied4 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied4 !== void 0 ? _customDrawer$applied4 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), (
|
|
474
|
+
}), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied4 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied4 !== void 0 ? _customDrawer$applied4 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), (header === null || header === void 0 || (_header$subHeading7 = header.subHeading) === null || _header$subHeading7 === void 0 || (_header$subHeading7 = _header$subHeading7.jsxConfig) === null || _header$subHeading7 === void 0 ? void 0 : _header$subHeading7.type) == "select" ? {
|
|
475
|
+
subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading8 = header.subHeading) === null || _header$subHeading8 === void 0 || (_header$subHeading8 = _header$subHeading8.jsxConfig) === null || _header$subHeading8 === void 0 ? void 0 : _header$subHeading8.value
|
|
476
|
+
} : {}), (_state$misc3 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc3 !== void 0 ? _state$misc3 : {}));
|
|
473
477
|
if (error) {
|
|
474
478
|
showErrorNotification(error);
|
|
475
479
|
dispatch({
|
|
@@ -505,7 +509,7 @@ function GenricLayOut(_ref) {
|
|
|
505
509
|
payload: option === null || option === void 0 ? void 0 : option.value
|
|
506
510
|
});
|
|
507
511
|
if (handleDropdownSearchOptionChange) {
|
|
508
|
-
var _tables$pagination9, _tables$pagination10, _staticFilter$data3, _customDrawer$applied5, _state$misc4;
|
|
512
|
+
var _tables$pagination9, _tables$pagination10, _staticFilter$data3, _customDrawer$applied5, _header$subHeading9, _header$subHeading10, _state$misc4;
|
|
509
513
|
dispatch({
|
|
510
514
|
type: _layoutReducer.actionTypes.SET_LOADING,
|
|
511
515
|
payload: true
|
|
@@ -513,13 +517,15 @@ function GenricLayOut(_ref) {
|
|
|
513
517
|
const {
|
|
514
518
|
error,
|
|
515
519
|
data
|
|
516
|
-
} = await handleDropdownSearchOptionChange(_objectSpread(_objectSpread(_objectSpread({
|
|
520
|
+
} = await handleDropdownSearchOptionChange(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
517
521
|
selectedTab: tabs === null || tabs === void 0 ? void 0 : tabs.active,
|
|
518
522
|
current: tables === null || tables === void 0 || (_tables$pagination9 = tables.pagination) === null || _tables$pagination9 === void 0 ? void 0 : _tables$pagination9.current,
|
|
519
523
|
pageSize: tables === null || tables === void 0 || (_tables$pagination10 = tables.pagination) === null || _tables$pagination10 === void 0 ? void 0 : _tables$pagination10.pageSize
|
|
520
524
|
}, (staticFilter === null || staticFilter === void 0 ? void 0 : staticFilter.visible) && ((_staticFilter$data3 = staticFilter.data) === null || _staticFilter$data3 === void 0 || (_staticFilter$data3 = _staticFilter$data3.find(item => item.selected)) === null || _staticFilter$data3 === void 0 ? void 0 : _staticFilter$data3.value) && {
|
|
521
525
|
staticFilter: staticFilter.data.find(item => item.selected).value
|
|
522
|
-
}), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied5 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied5 !== void 0 ? _customDrawer$applied5 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), (
|
|
526
|
+
}), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied5 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied5 !== void 0 ? _customDrawer$applied5 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), (header === null || header === void 0 || (_header$subHeading9 = header.subHeading) === null || _header$subHeading9 === void 0 || (_header$subHeading9 = _header$subHeading9.jsxConfig) === null || _header$subHeading9 === void 0 ? void 0 : _header$subHeading9.type) == "select" ? {
|
|
527
|
+
subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading10 = header.subHeading) === null || _header$subHeading10 === void 0 || (_header$subHeading10 = _header$subHeading10.jsxConfig) === null || _header$subHeading10 === void 0 ? void 0 : _header$subHeading10.value
|
|
528
|
+
} : {}), (_state$misc4 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc4 !== void 0 ? _state$misc4 : {}));
|
|
523
529
|
if (error) {
|
|
524
530
|
showErrorNotification(error);
|
|
525
531
|
dispatch({
|
|
@@ -611,11 +617,11 @@ function GenricLayOut(_ref) {
|
|
|
611
617
|
payload: null
|
|
612
618
|
});
|
|
613
619
|
if (handleDropdownSearchClear) {
|
|
614
|
-
var _state$tabs6, _tables$pagination11, _tables$pagination12, _tables$sorting9, _tables$sorting10, _tables$filter3, _staticFilter$data4, _customDrawer$applied6, _state$misc5;
|
|
620
|
+
var _state$tabs6, _tables$pagination11, _tables$pagination12, _tables$sorting9, _tables$sorting10, _tables$filter3, _staticFilter$data4, _customDrawer$applied6, _header$subHeading11, _header$subHeading12, _state$misc5;
|
|
615
621
|
const {
|
|
616
622
|
error,
|
|
617
623
|
data
|
|
618
|
-
} = await handleDropdownSearchClear(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
624
|
+
} = await handleDropdownSearchClear(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
619
625
|
selectedTab: state === null || state === void 0 || (_state$tabs6 = state.tabs) === null || _state$tabs6 === void 0 ? void 0 : _state$tabs6.active,
|
|
620
626
|
current: tables === null || tables === void 0 || (_tables$pagination11 = tables.pagination) === null || _tables$pagination11 === void 0 ? void 0 : _tables$pagination11.current,
|
|
621
627
|
pageSize: tables === null || tables === void 0 || (_tables$pagination12 = tables.pagination) === null || _tables$pagination12 === void 0 ? void 0 : _tables$pagination12.pageSize,
|
|
@@ -625,7 +631,9 @@ function GenricLayOut(_ref) {
|
|
|
625
631
|
columnFilterStatus: tables === null || tables === void 0 ? void 0 : tables.filter
|
|
626
632
|
}), (staticFilter === null || staticFilter === void 0 ? void 0 : staticFilter.visible) && ((_staticFilter$data4 = staticFilter.data) === null || _staticFilter$data4 === void 0 || (_staticFilter$data4 = _staticFilter$data4.find(item => item.selected)) === null || _staticFilter$data4 === void 0 ? void 0 : _staticFilter$data4.value) && {
|
|
627
633
|
staticFilter: staticFilter.data.find(item => item.selected).value
|
|
628
|
-
}), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied6 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied6 !== void 0 ? _customDrawer$applied6 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), (
|
|
634
|
+
}), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied6 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied6 !== void 0 ? _customDrawer$applied6 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), (header === null || header === void 0 || (_header$subHeading11 = header.subHeading) === null || _header$subHeading11 === void 0 || (_header$subHeading11 = _header$subHeading11.jsxConfig) === null || _header$subHeading11 === void 0 ? void 0 : _header$subHeading11.type) == "select" ? {
|
|
635
|
+
subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading12 = header.subHeading) === null || _header$subHeading12 === void 0 || (_header$subHeading12 = _header$subHeading12.jsxConfig) === null || _header$subHeading12 === void 0 ? void 0 : _header$subHeading12.value
|
|
636
|
+
} : {}), (_state$misc5 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc5 !== void 0 ? _state$misc5 : {}));
|
|
629
637
|
if (error) {
|
|
630
638
|
showErrorNotification(error);
|
|
631
639
|
dispatch({
|
|
@@ -663,20 +671,20 @@ function GenricLayOut(_ref) {
|
|
|
663
671
|
payload: null
|
|
664
672
|
});
|
|
665
673
|
if (handleInputSearchClear) {
|
|
666
|
-
var _state$tabs7, _tables$pagination13, _tables$pagination14, _tables$sorting11, _tables$sorting12, _customDrawer$applied7, _header$
|
|
674
|
+
var _state$tabs7, _tables$pagination13, _tables$pagination14, _tables$sorting11, _tables$sorting12, _customDrawer$applied7, _header$subHeading13, _header$subHeading14, _state$misc6;
|
|
667
675
|
const {
|
|
668
676
|
error,
|
|
669
677
|
data
|
|
670
|
-
} = await handleInputSearchClear(_objectSpread(_objectSpread(_objectSpread({}, state !== null && state !== void 0 && (_state$tabs7 = state.tabs) !== null && _state$tabs7 !== void 0 && _state$tabs7.active ? {
|
|
678
|
+
} = await handleInputSearchClear(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, state !== null && state !== void 0 && (_state$tabs7 = state.tabs) !== null && _state$tabs7 !== void 0 && _state$tabs7.active ? {
|
|
671
679
|
selectedTab: state.tabs.active
|
|
672
680
|
} : {}), {}, {
|
|
673
681
|
current: tables === null || tables === void 0 || (_tables$pagination13 = tables.pagination) === null || _tables$pagination13 === void 0 ? void 0 : _tables$pagination13.current,
|
|
674
682
|
pageSize: tables === null || tables === void 0 || (_tables$pagination14 = tables.pagination) === null || _tables$pagination14 === void 0 ? void 0 : _tables$pagination14.pageSize,
|
|
675
683
|
field: tables === null || tables === void 0 || (_tables$sorting11 = tables.sorting) === null || _tables$sorting11 === void 0 ? void 0 : _tables$sorting11.sortBy,
|
|
676
684
|
order: tables === null || tables === void 0 || (_tables$sorting12 = tables.sorting) === null || _tables$sorting12 === void 0 ? void 0 : _tables$sorting12.sortDirection
|
|
677
|
-
}, (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied7 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied7 !== void 0 ? _customDrawer$applied7 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), (header === null || header === void 0 || (_header$
|
|
678
|
-
subHeadingSelectVal: header === null || header === void 0 || (_header$
|
|
679
|
-
} : {}));
|
|
685
|
+
}, (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied7 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied7 !== void 0 ? _customDrawer$applied7 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), (header === null || header === void 0 || (_header$subHeading13 = header.subHeading) === null || _header$subHeading13 === void 0 || (_header$subHeading13 = _header$subHeading13.jsxConfig) === null || _header$subHeading13 === void 0 ? void 0 : _header$subHeading13.type) == "select" ? {
|
|
686
|
+
subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading14 = header.subHeading) === null || _header$subHeading14 === void 0 || (_header$subHeading14 = _header$subHeading14.jsxConfig) === null || _header$subHeading14 === void 0 ? void 0 : _header$subHeading14.value
|
|
687
|
+
} : {}), (_state$misc6 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc6 !== void 0 ? _state$misc6 : {}));
|
|
680
688
|
if (error) {
|
|
681
689
|
showErrorNotification(error);
|
|
682
690
|
dispatch({
|
|
@@ -722,14 +730,14 @@ function GenricLayOut(_ref) {
|
|
|
722
730
|
if ((configArgs === null || configArgs === void 0 ? void 0 : configArgs.action) === "OPEN_DRAWER_AND_FETCH") {
|
|
723
731
|
const selectkey = optKey || (configArgs === null || configArgs === void 0 ? void 0 : configArgs.key);
|
|
724
732
|
if (handleTableColumnClick) {
|
|
725
|
-
var _state$
|
|
733
|
+
var _state$misc7;
|
|
726
734
|
const {
|
|
727
735
|
error,
|
|
728
736
|
data
|
|
729
737
|
} = await (handleTableColumnClick === null || handleTableColumnClick === void 0 ? void 0 : handleTableColumnClick(_objectSpread({
|
|
730
738
|
record: record,
|
|
731
739
|
type: configArgs === null || configArgs === void 0 ? void 0 : configArgs.call
|
|
732
|
-
}, (_state$
|
|
740
|
+
}, (_state$misc7 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc7 !== void 0 ? _state$misc7 : {})));
|
|
733
741
|
if (error) {
|
|
734
742
|
showErrorNotification(error);
|
|
735
743
|
} else {
|
|
@@ -999,7 +1007,7 @@ function GenricLayOut(_ref) {
|
|
|
999
1007
|
}
|
|
1000
1008
|
});
|
|
1001
1009
|
if (handleTableChange) {
|
|
1002
|
-
var _state$dropdownSearch3, _state$inputSearch4, _state$tabs9, _header$
|
|
1010
|
+
var _state$dropdownSearch3, _state$inputSearch4, _state$tabs9, _header$subHeading15, _header$subHeading16, _staticFilter$data5, _customDrawer$applied8, _state$misc8;
|
|
1003
1011
|
dispatch({
|
|
1004
1012
|
type: _layoutReducer.actionTypes.SET_LOADING,
|
|
1005
1013
|
payload: true
|
|
@@ -1018,13 +1026,13 @@ function GenricLayOut(_ref) {
|
|
|
1018
1026
|
pageSize: pageSize,
|
|
1019
1027
|
columnFilterStatus: _f,
|
|
1020
1028
|
field: sorter === null || sorter === void 0 ? void 0 : sorter.columnKey
|
|
1021
|
-
}, (header === null || header === void 0 || (_header$
|
|
1022
|
-
subHeadingSelectVal: header === null || header === void 0 || (_header$
|
|
1029
|
+
}, (header === null || header === void 0 || (_header$subHeading15 = header.subHeading) === null || _header$subHeading15 === void 0 || (_header$subHeading15 = _header$subHeading15.jsxConfig) === null || _header$subHeading15 === void 0 ? void 0 : _header$subHeading15.type) == "select" ? {
|
|
1030
|
+
subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading16 = header.subHeading) === null || _header$subHeading16 === void 0 || (_header$subHeading16 = _header$subHeading16.jsxConfig) === null || _header$subHeading16 === void 0 ? void 0 : _header$subHeading16.value
|
|
1023
1031
|
} : {}), (staticFilter === null || staticFilter === void 0 ? void 0 : staticFilter.visible) && ((_staticFilter$data5 = staticFilter.data) === null || _staticFilter$data5 === void 0 || (_staticFilter$data5 = _staticFilter$data5.find(item => item.selected)) === null || _staticFilter$data5 === void 0 ? void 0 : _staticFilter$data5.value) && {
|
|
1024
1032
|
staticFilter: staticFilter.data.find(item => item.selected).value
|
|
1025
1033
|
}), (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)), {}, {
|
|
1026
1034
|
order: (sorter === null || sorter === void 0 ? void 0 : sorter.order) === "ascend" && "ASC" || (sorter === null || sorter === void 0 ? void 0 : sorter.order) === "descend" && "DESC" || ""
|
|
1027
|
-
}, (_state$
|
|
1035
|
+
}, (_state$misc8 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc8 !== void 0 ? _state$misc8 : {}));
|
|
1028
1036
|
if (error) {
|
|
1029
1037
|
showErrorNotification(error);
|
|
1030
1038
|
dispatch({
|
|
@@ -1105,7 +1113,7 @@ function GenricLayOut(_ref) {
|
|
|
1105
1113
|
});
|
|
1106
1114
|
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;
|
|
1107
1115
|
if (handleTabClick) {
|
|
1108
|
-
var _state$
|
|
1116
|
+
var _state$misc9, _tables$pagination15, _tables$pagination16, _tables$sorting13, _tables$sorting14, _state$dropdownSearch4, _header$subHeading17, _header$subHeading18, _customDrawer$applied9, _state$misc10;
|
|
1109
1117
|
dispatch({
|
|
1110
1118
|
type: _layoutReducer.actionTypes.SET_LOADING,
|
|
1111
1119
|
payload: true
|
|
@@ -1113,7 +1121,7 @@ function GenricLayOut(_ref) {
|
|
|
1113
1121
|
const {
|
|
1114
1122
|
error,
|
|
1115
1123
|
data
|
|
1116
|
-
} = await handleTabClick(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, (_state$
|
|
1124
|
+
} = await handleTabClick(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, (_state$misc9 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc9 !== void 0 ? _state$misc9 : {}), {}, {
|
|
1117
1125
|
selectedTab: key,
|
|
1118
1126
|
current: tables === null || tables === void 0 || (_tables$pagination15 = tables.pagination) === null || _tables$pagination15 === void 0 ? void 0 : _tables$pagination15.current,
|
|
1119
1127
|
pageSize: tables === null || tables === void 0 || (_tables$pagination16 = tables.pagination) === null || _tables$pagination16 === void 0 ? void 0 : _tables$pagination16.pageSize,
|
|
@@ -1125,7 +1133,9 @@ function GenricLayOut(_ref) {
|
|
|
1125
1133
|
}, (state === null || state === void 0 || (_state$dropdownSearch4 = state.dropdownSearch) === null || _state$dropdownSearch4 === void 0 || (_state$dropdownSearch4 = _state$dropdownSearch4.value) === null || _state$dropdownSearch4 === void 0 ? void 0 : _state$dropdownSearch4.trim()) && {
|
|
1126
1134
|
searchedValue: state.dropdownSearch.value,
|
|
1127
1135
|
selectedOption: state.dropdownSearch.selectedOption
|
|
1128
|
-
}), (
|
|
1136
|
+
}), (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" ? {
|
|
1137
|
+
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
|
|
1138
|
+
} : {}), (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$misc10 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc10 !== void 0 ? _state$misc10 : {}));
|
|
1129
1139
|
if (error) {
|
|
1130
1140
|
showErrorNotification(error);
|
|
1131
1141
|
dispatch({
|
|
@@ -1219,11 +1229,11 @@ function GenricLayOut(_ref) {
|
|
|
1219
1229
|
return;
|
|
1220
1230
|
}
|
|
1221
1231
|
if (handleDrawerFormOnFinish) {
|
|
1222
|
-
var _state$
|
|
1232
|
+
var _state$misc11;
|
|
1223
1233
|
const {
|
|
1224
1234
|
error,
|
|
1225
1235
|
data
|
|
1226
|
-
} = await (handleDrawerFormOnFinish === null || handleDrawerFormOnFinish === void 0 ? void 0 : handleDrawerFormOnFinish(_objectSpread(_objectSpread(_objectSpread({}, record), formData), (_state$
|
|
1236
|
+
} = await (handleDrawerFormOnFinish === null || handleDrawerFormOnFinish === void 0 ? void 0 : handleDrawerFormOnFinish(_objectSpread(_objectSpread(_objectSpread({}, record), formData), (_state$misc11 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc11 !== void 0 ? _state$misc11 : {})));
|
|
1227
1237
|
if (error) {
|
|
1228
1238
|
showErrorNotification(error);
|
|
1229
1239
|
} else {
|
|
@@ -1247,7 +1257,7 @@ function GenricLayOut(_ref) {
|
|
|
1247
1257
|
|
|
1248
1258
|
// If there are remaining filters, reapply them
|
|
1249
1259
|
if (Object.keys(currentFilters).length > 0) {
|
|
1250
|
-
var _state$dropdownSearch5, _state$inputSearch5, _state$tabs12, _tables$pagination17, _tables$pagination18, _tables$filter6, _tables$sorting15, _header$
|
|
1260
|
+
var _state$dropdownSearch5, _state$inputSearch5, _state$tabs12, _tables$pagination17, _tables$pagination18, _tables$filter6, _tables$sorting15, _header$subHeading19, _header$subHeading20, _staticFilter$data6, _tables$sorting16, _state$misc12;
|
|
1251
1261
|
const {
|
|
1252
1262
|
error,
|
|
1253
1263
|
data
|
|
@@ -1267,13 +1277,13 @@ function GenricLayOut(_ref) {
|
|
|
1267
1277
|
columnFilterStatus: tables === null || tables === void 0 ? void 0 : tables.filter
|
|
1268
1278
|
}), {}, {
|
|
1269
1279
|
field: tables === null || tables === void 0 || (_tables$sorting15 = tables.sorting) === null || _tables$sorting15 === void 0 ? void 0 : _tables$sorting15.sortBy
|
|
1270
|
-
}, (header === null || header === void 0 || (_header$
|
|
1271
|
-
subHeadingSelectVal: header === null || header === void 0 || (_header$
|
|
1280
|
+
}, (header === null || header === void 0 || (_header$subHeading19 = header.subHeading) === null || _header$subHeading19 === void 0 || (_header$subHeading19 = _header$subHeading19.jsxConfig) === null || _header$subHeading19 === void 0 ? void 0 : _header$subHeading19.type) == "select" ? {
|
|
1281
|
+
subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading20 = header.subHeading) === null || _header$subHeading20 === void 0 || (_header$subHeading20 = _header$subHeading20.jsxConfig) === null || _header$subHeading20 === void 0 ? void 0 : _header$subHeading20.value
|
|
1272
1282
|
} : {}), (staticFilter === null || staticFilter === void 0 ? void 0 : staticFilter.visible) && ((_staticFilter$data6 = staticFilter.data) === null || _staticFilter$data6 === void 0 || (_staticFilter$data6 = _staticFilter$data6.find(item => item.selected)) === null || _staticFilter$data6 === void 0 ? void 0 : _staticFilter$data6.value) && {
|
|
1273
1283
|
staticFilter: staticFilter.data.find(item => item.selected).value
|
|
1274
1284
|
}), {}, {
|
|
1275
1285
|
order: tables === null || tables === void 0 || (_tables$sorting16 = tables.sorting) === null || _tables$sorting16 === void 0 ? void 0 : _tables$sorting16.sortDirection
|
|
1276
|
-
}, (_state$
|
|
1286
|
+
}, (_state$misc12 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc12 !== void 0 ? _state$misc12 : {}));
|
|
1277
1287
|
if (error) {
|
|
1278
1288
|
showErrorNotification(error);
|
|
1279
1289
|
dispatch({
|
|
@@ -1305,7 +1315,7 @@ function GenricLayOut(_ref) {
|
|
|
1305
1315
|
const filterFormOnFinish = async formData => {
|
|
1306
1316
|
// Check if this is a cancel/clear action - check both buttonClickType and the actual button data
|
|
1307
1317
|
if (formData.type === "FILTER-CANCEL") {
|
|
1308
|
-
var _state$dropdownSearch6, _state$inputSearch6, _state$tabs13, _tables$pagination19, _tables$pagination20, _tables$filter7, _tables$sorting17, _header$
|
|
1318
|
+
var _state$dropdownSearch6, _state$inputSearch6, _state$tabs13, _tables$pagination19, _tables$pagination20, _tables$filter7, _tables$sorting17, _header$subHeading21, _header$subHeading22, _staticFilter$data7, _tables$sorting18, _state$misc13;
|
|
1309
1319
|
if (isFiltersEmpty(customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)) {
|
|
1310
1320
|
dispatch({
|
|
1311
1321
|
type: _layoutReducer.actionTypes.CUSTOM_DRAWER_CLOSED
|
|
@@ -1328,13 +1338,13 @@ function GenricLayOut(_ref) {
|
|
|
1328
1338
|
columnFilterStatus: tables === null || tables === void 0 ? void 0 : tables.filter
|
|
1329
1339
|
}), {}, {
|
|
1330
1340
|
field: tables === null || tables === void 0 || (_tables$sorting17 = tables.sorting) === null || _tables$sorting17 === void 0 ? void 0 : _tables$sorting17.sortBy
|
|
1331
|
-
}, (header === null || header === void 0 || (_header$
|
|
1332
|
-
subHeadingSelectVal: header === null || header === void 0 || (_header$
|
|
1341
|
+
}, (header === null || header === void 0 || (_header$subHeading21 = header.subHeading) === null || _header$subHeading21 === void 0 || (_header$subHeading21 = _header$subHeading21.jsxConfig) === null || _header$subHeading21 === void 0 ? void 0 : _header$subHeading21.type) == "select" ? {
|
|
1342
|
+
subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading22 = header.subHeading) === null || _header$subHeading22 === void 0 || (_header$subHeading22 = _header$subHeading22.jsxConfig) === null || _header$subHeading22 === void 0 ? void 0 : _header$subHeading22.value
|
|
1333
1343
|
} : {}), (staticFilter === null || staticFilter === void 0 ? void 0 : staticFilter.visible) && ((_staticFilter$data7 = staticFilter.data) === null || _staticFilter$data7 === void 0 || (_staticFilter$data7 = _staticFilter$data7.find(item => item.selected)) === null || _staticFilter$data7 === void 0 ? void 0 : _staticFilter$data7.value) && {
|
|
1334
1344
|
staticFilter: staticFilter.data.find(item => item.selected).value
|
|
1335
1345
|
}), {}, {
|
|
1336
1346
|
order: tables === null || tables === void 0 || (_tables$sorting18 = tables.sorting) === null || _tables$sorting18 === void 0 ? void 0 : _tables$sorting18.sortDirection
|
|
1337
|
-
}, (_state$
|
|
1347
|
+
}, (_state$misc13 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc13 !== void 0 ? _state$misc13 : {}));
|
|
1338
1348
|
if (error) {
|
|
1339
1349
|
showErrorNotification(error);
|
|
1340
1350
|
dispatch({
|
|
@@ -1382,7 +1392,7 @@ function GenricLayOut(_ref) {
|
|
|
1382
1392
|
|
|
1383
1393
|
// Only process filter data if this is actually a filter drawer
|
|
1384
1394
|
if (formData.type === "FILTER-SUBMIT") {
|
|
1385
|
-
var _state$dropdownSearch7, _state$inputSearch7, _ref4, _appliedFilters$filte, _state$tabs14, _config$tables, _config$tables2, _tables$filter8, _tables$sorting19, _header$
|
|
1395
|
+
var _state$dropdownSearch7, _state$inputSearch7, _ref4, _appliedFilters$filte, _state$tabs14, _config$tables, _config$tables2, _tables$filter8, _tables$sorting19, _header$subHeading23, _header$subHeading24, _staticFilter$data8, _tables$sorting20, _state$misc14;
|
|
1386
1396
|
const appliedFilters = {};
|
|
1387
1397
|
Object.keys(formData).forEach(key => {
|
|
1388
1398
|
const value = formData[key];
|
|
@@ -1415,13 +1425,13 @@ function GenricLayOut(_ref) {
|
|
|
1415
1425
|
columnFilterStatus: tables === null || tables === void 0 ? void 0 : tables.filter
|
|
1416
1426
|
}), {}, {
|
|
1417
1427
|
field: tables === null || tables === void 0 || (_tables$sorting19 = tables.sorting) === null || _tables$sorting19 === void 0 ? void 0 : _tables$sorting19.sortBy
|
|
1418
|
-
}, (header === null || header === void 0 || (_header$
|
|
1419
|
-
subHeadingSelectVal: header === null || header === void 0 || (_header$
|
|
1428
|
+
}, (header === null || header === void 0 || (_header$subHeading23 = header.subHeading) === null || _header$subHeading23 === void 0 || (_header$subHeading23 = _header$subHeading23.jsxConfig) === null || _header$subHeading23 === void 0 ? void 0 : _header$subHeading23.type) == "select" ? {
|
|
1429
|
+
subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading24 = header.subHeading) === null || _header$subHeading24 === void 0 || (_header$subHeading24 = _header$subHeading24.jsxConfig) === null || _header$subHeading24 === void 0 ? void 0 : _header$subHeading24.value
|
|
1420
1430
|
} : {}), (staticFilter === null || staticFilter === void 0 ? void 0 : staticFilter.visible) && ((_staticFilter$data8 = staticFilter.data) === null || _staticFilter$data8 === void 0 || (_staticFilter$data8 = _staticFilter$data8.find(item => item.selected)) === null || _staticFilter$data8 === void 0 ? void 0 : _staticFilter$data8.value) && {
|
|
1421
1431
|
staticFilter: staticFilter.data.find(item => item.selected).value
|
|
1422
1432
|
}), {}, {
|
|
1423
1433
|
order: tables === null || tables === void 0 || (_tables$sorting20 = tables.sorting) === null || _tables$sorting20 === void 0 ? void 0 : _tables$sorting20.sortDirection
|
|
1424
|
-
}, (_state$
|
|
1434
|
+
}, (_state$misc14 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc14 !== void 0 ? _state$misc14 : {}));
|
|
1425
1435
|
if (error) {
|
|
1426
1436
|
showErrorNotification(error);
|
|
1427
1437
|
dispatch({
|
|
@@ -1467,7 +1477,7 @@ function GenricLayOut(_ref) {
|
|
|
1467
1477
|
}
|
|
1468
1478
|
} else if (formData.drawerKey === "exportDrawer") {
|
|
1469
1479
|
if (handleSecondaryTableCTAClick) {
|
|
1470
|
-
var _state$dropdownSearch8, _state$inputSearch8, _state$tabs15, _tables$pagination21, _tables$pagination22, _tables$filter9, _tables$sorting21, _tables$sorting22, _header$
|
|
1480
|
+
var _state$dropdownSearch8, _state$inputSearch8, _state$tabs15, _tables$pagination21, _tables$pagination22, _tables$filter9, _tables$sorting21, _tables$sorting22, _header$subHeading25, _header$subHeading26, _staticFilter$data9, _state$misc15;
|
|
1471
1481
|
const {
|
|
1472
1482
|
error,
|
|
1473
1483
|
data
|
|
@@ -1483,8 +1493,8 @@ function GenricLayOut(_ref) {
|
|
|
1483
1493
|
columnFilterStatus: tables === null || tables === void 0 || (_tables$filter9 = tables.filter) === null || _tables$filter9 === void 0 ? void 0 : _tables$filter9.value,
|
|
1484
1494
|
field: tables === null || tables === void 0 || (_tables$sorting21 = tables.sorting) === null || _tables$sorting21 === void 0 ? void 0 : _tables$sorting21.sortBy,
|
|
1485
1495
|
order: tables === null || tables === void 0 || (_tables$sorting22 = tables.sorting) === null || _tables$sorting22 === void 0 ? void 0 : _tables$sorting22.sortDirection
|
|
1486
|
-
}, (header === null || header === void 0 || (_header$
|
|
1487
|
-
subHeadingSelectVal: header === null || header === void 0 || (_header$
|
|
1496
|
+
}, (header === null || header === void 0 || (_header$subHeading25 = header.subHeading) === null || _header$subHeading25 === void 0 || (_header$subHeading25 = _header$subHeading25.jsxConfig) === null || _header$subHeading25 === void 0 ? void 0 : _header$subHeading25.type) == "select" ? {
|
|
1497
|
+
subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading26 = header.subHeading) === null || _header$subHeading26 === void 0 || (_header$subHeading26 = _header$subHeading26.jsxConfig) === null || _header$subHeading26 === void 0 ? void 0 : _header$subHeading26.value
|
|
1488
1498
|
} : {}), (staticFilter === null || staticFilter === void 0 ? void 0 : staticFilter.visible) && ((_staticFilter$data9 = staticFilter.data) === null || _staticFilter$data9 === void 0 || (_staticFilter$data9 = _staticFilter$data9.find(item => item.selected)) === null || _staticFilter$data9 === void 0 ? void 0 : _staticFilter$data9.value) && {
|
|
1489
1499
|
staticFilter: staticFilter.data.find(item => item.selected).value
|
|
1490
1500
|
}), {}, {
|
|
@@ -1492,7 +1502,7 @@ function GenricLayOut(_ref) {
|
|
|
1492
1502
|
toDate: formData === null || formData === void 0 ? void 0 : formData.toDate
|
|
1493
1503
|
}, (formData === null || formData === void 0 ? void 0 : formData.exportType) && {
|
|
1494
1504
|
exportType: formData === null || formData === void 0 ? void 0 : formData.exportType
|
|
1495
|
-
}), (_state$
|
|
1505
|
+
}), (_state$misc15 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc15 !== void 0 ? _state$misc15 : {})));
|
|
1496
1506
|
if (error) {
|
|
1497
1507
|
showErrorNotification(error);
|
|
1498
1508
|
} else {
|
|
@@ -1506,7 +1516,7 @@ function GenricLayOut(_ref) {
|
|
|
1506
1516
|
}
|
|
1507
1517
|
};
|
|
1508
1518
|
const onClearAllAppliedFilters = async () => {
|
|
1509
|
-
var _state$dropdownSearch9, _state$inputSearch9, _state$tabs16, _tables$pagination23, _tables$pagination24, _tables$filter10, _tables$sorting23, _header$
|
|
1519
|
+
var _state$dropdownSearch9, _state$inputSearch9, _state$tabs16, _tables$pagination23, _tables$pagination24, _tables$filter10, _tables$sorting23, _header$subHeading27, _header$subHeading28, _staticFilter$data10, _tables$sorting24, _state$misc16;
|
|
1510
1520
|
const {
|
|
1511
1521
|
error,
|
|
1512
1522
|
data
|
|
@@ -1523,13 +1533,13 @@ function GenricLayOut(_ref) {
|
|
|
1523
1533
|
columnFilterStatus: tables === null || tables === void 0 ? void 0 : tables.filter
|
|
1524
1534
|
}), {}, {
|
|
1525
1535
|
field: tables === null || tables === void 0 || (_tables$sorting23 = tables.sorting) === null || _tables$sorting23 === void 0 ? void 0 : _tables$sorting23.sortBy
|
|
1526
|
-
}, (header === null || header === void 0 || (_header$
|
|
1527
|
-
subHeadingSelectVal: header === null || header === void 0 || (_header$
|
|
1536
|
+
}, (header === null || header === void 0 || (_header$subHeading27 = header.subHeading) === null || _header$subHeading27 === void 0 || (_header$subHeading27 = _header$subHeading27.jsxConfig) === null || _header$subHeading27 === void 0 ? void 0 : _header$subHeading27.type) == "select" ? {
|
|
1537
|
+
subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading28 = header.subHeading) === null || _header$subHeading28 === void 0 || (_header$subHeading28 = _header$subHeading28.jsxConfig) === null || _header$subHeading28 === void 0 ? void 0 : _header$subHeading28.value
|
|
1528
1538
|
} : {}), (staticFilter === null || staticFilter === void 0 ? void 0 : staticFilter.visible) && ((_staticFilter$data10 = staticFilter.data) === null || _staticFilter$data10 === void 0 || (_staticFilter$data10 = _staticFilter$data10.find(item => item.selected)) === null || _staticFilter$data10 === void 0 ? void 0 : _staticFilter$data10.value) && {
|
|
1529
1539
|
staticFilter: staticFilter.data.find(item => item.selected).value
|
|
1530
1540
|
}), {}, {
|
|
1531
1541
|
order: tables === null || tables === void 0 || (_tables$sorting24 = tables.sorting) === null || _tables$sorting24 === void 0 ? void 0 : _tables$sorting24.sortDirection
|
|
1532
|
-
}, (_state$
|
|
1542
|
+
}, (_state$misc16 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc16 !== void 0 ? _state$misc16 : {}));
|
|
1533
1543
|
if (error) {
|
|
1534
1544
|
showErrorNotification(error);
|
|
1535
1545
|
dispatch({
|
|
@@ -1586,14 +1596,14 @@ function GenricLayOut(_ref) {
|
|
|
1586
1596
|
return;
|
|
1587
1597
|
} else if (action === "CLOSE_MODAL_AND_FETCH") {
|
|
1588
1598
|
if (handleModalCloseSuccess) {
|
|
1589
|
-
var _stateRef$current, _state$
|
|
1599
|
+
var _stateRef$current, _state$misc17;
|
|
1590
1600
|
const {
|
|
1591
1601
|
error,
|
|
1592
1602
|
data
|
|
1593
1603
|
} = await (handleModalCloseSuccess === null || handleModalCloseSuccess === void 0 ? void 0 : handleModalCloseSuccess(_objectSpread({
|
|
1594
1604
|
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,
|
|
1595
1605
|
call: buttonConfig === null || buttonConfig === void 0 ? void 0 : buttonConfig.call
|
|
1596
|
-
}, (_state$
|
|
1606
|
+
}, (_state$misc17 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc17 !== void 0 ? _state$misc17 : {})));
|
|
1597
1607
|
if (error) {
|
|
1598
1608
|
showErrorNotification(error);
|
|
1599
1609
|
} else {
|
|
@@ -1710,7 +1720,7 @@ function GenricLayOut(_ref) {
|
|
|
1710
1720
|
};
|
|
1711
1721
|
const rightHeaderSecondButtonClick = async () => {
|
|
1712
1722
|
if ((rightHeaderSecondButton === null || rightHeaderSecondButton === void 0 ? void 0 : rightHeaderSecondButton.action) === "RESET_CUSTOM_DRAWER") {
|
|
1713
|
-
var _state$dropdownSearch10, _state$inputSearch10, _state$tabs17, _tables$pagination25, _tables$pagination26, _tables$filter11, _tables$sorting25, _header$
|
|
1723
|
+
var _state$dropdownSearch10, _state$inputSearch10, _state$tabs17, _tables$pagination25, _tables$pagination26, _tables$filter11, _tables$sorting25, _header$subHeading29, _header$subHeading30, _staticFilter$data11, _tables$sorting26, _state$misc18;
|
|
1714
1724
|
const {
|
|
1715
1725
|
error,
|
|
1716
1726
|
data
|
|
@@ -1727,13 +1737,13 @@ function GenricLayOut(_ref) {
|
|
|
1727
1737
|
columnFilterStatus: tables === null || tables === void 0 ? void 0 : tables.filter
|
|
1728
1738
|
}), {}, {
|
|
1729
1739
|
field: tables === null || tables === void 0 || (_tables$sorting25 = tables.sorting) === null || _tables$sorting25 === void 0 ? void 0 : _tables$sorting25.sortBy
|
|
1730
|
-
}, (header === null || header === void 0 || (_header$
|
|
1731
|
-
subHeadingSelectVal: header === null || header === void 0 || (_header$
|
|
1740
|
+
}, (header === null || header === void 0 || (_header$subHeading29 = header.subHeading) === null || _header$subHeading29 === void 0 || (_header$subHeading29 = _header$subHeading29.jsxConfig) === null || _header$subHeading29 === void 0 ? void 0 : _header$subHeading29.type) == "select" ? {
|
|
1741
|
+
subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading30 = header.subHeading) === null || _header$subHeading30 === void 0 || (_header$subHeading30 = _header$subHeading30.jsxConfig) === null || _header$subHeading30 === void 0 ? void 0 : _header$subHeading30.value
|
|
1732
1742
|
} : {}), (staticFilter === null || staticFilter === void 0 ? void 0 : staticFilter.visible) && ((_staticFilter$data11 = staticFilter.data) === null || _staticFilter$data11 === void 0 || (_staticFilter$data11 = _staticFilter$data11.find(item => item.selected)) === null || _staticFilter$data11 === void 0 ? void 0 : _staticFilter$data11.value) && {
|
|
1733
1743
|
staticFilter: staticFilter.data.find(item => item.selected).value
|
|
1734
1744
|
}), {}, {
|
|
1735
1745
|
order: tables === null || tables === void 0 || (_tables$sorting26 = tables.sorting) === null || _tables$sorting26 === void 0 ? void 0 : _tables$sorting26.sortDirection
|
|
1736
|
-
}, (_state$
|
|
1746
|
+
}, (_state$misc18 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc18 !== void 0 ? _state$misc18 : {}));
|
|
1737
1747
|
if (error) {
|
|
1738
1748
|
showErrorNotification(error);
|
|
1739
1749
|
dispatch({
|
|
@@ -1784,7 +1794,7 @@ function GenricLayOut(_ref) {
|
|
|
1784
1794
|
};
|
|
1785
1795
|
const handleSubHeadingSelect = async val => {
|
|
1786
1796
|
if (val) {
|
|
1787
|
-
var _tables$pagination27, _tables$pagination28, _state$
|
|
1797
|
+
var _tables$pagination27, _tables$pagination28, _state$misc19;
|
|
1788
1798
|
dispatch({
|
|
1789
1799
|
type: _layoutReducer.actionTypes.SET_SUBHEADING_SELECTED_CONFIG,
|
|
1790
1800
|
payload: val
|
|
@@ -1797,7 +1807,7 @@ function GenricLayOut(_ref) {
|
|
|
1797
1807
|
current: tables === null || tables === void 0 || (_tables$pagination27 = tables.pagination) === null || _tables$pagination27 === void 0 ? void 0 : _tables$pagination27.current,
|
|
1798
1808
|
pageSize: tables === null || tables === void 0 || (_tables$pagination28 = tables.pagination) === null || _tables$pagination28 === void 0 ? void 0 : _tables$pagination28.pageSize,
|
|
1799
1809
|
subHeadingSelectVal: val
|
|
1800
|
-
}, (_state$
|
|
1810
|
+
}, (_state$misc19 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc19 !== void 0 ? _state$misc19 : {}));
|
|
1801
1811
|
if (error) {
|
|
1802
1812
|
showErrorNotification(error);
|
|
1803
1813
|
dispatch({
|
|
@@ -1824,7 +1834,7 @@ function GenricLayOut(_ref) {
|
|
|
1824
1834
|
|
|
1825
1835
|
// Call the handler if provided
|
|
1826
1836
|
if (handleTableChange) {
|
|
1827
|
-
var _state$dropdownSearch11, _state$inputSearch11, _state$tabs18, _tables$pagination29, _tables$sorting27, _tables$sorting28, _header$
|
|
1837
|
+
var _state$dropdownSearch11, _state$inputSearch11, _state$tabs18, _tables$pagination29, _tables$sorting27, _tables$sorting28, _header$subHeading31, _header$subHeading32, _customDrawer$applied10, _state$misc20;
|
|
1828
1838
|
dispatch({
|
|
1829
1839
|
type: _layoutReducer.actionTypes.SET_LOADING,
|
|
1830
1840
|
payload: true
|
|
@@ -1845,9 +1855,9 @@ function GenricLayOut(_ref) {
|
|
|
1845
1855
|
filterStatus: filterValue,
|
|
1846
1856
|
field: tables === null || tables === void 0 || (_tables$sorting27 = tables.sorting) === null || _tables$sorting27 === void 0 ? void 0 : _tables$sorting27.sortBy,
|
|
1847
1857
|
order: tables === null || tables === void 0 || (_tables$sorting28 = tables.sorting) === null || _tables$sorting28 === void 0 ? void 0 : _tables$sorting28.sortDirection
|
|
1848
|
-
}, (header === null || header === void 0 || (_header$
|
|
1849
|
-
subHeadingSelectVal: header === null || header === void 0 || (_header$
|
|
1850
|
-
} : {}), (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$
|
|
1858
|
+
}, (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" ? {
|
|
1859
|
+
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
|
|
1860
|
+
} : {}), (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$misc20 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc20 !== void 0 ? _state$misc20 : {}), {}, {
|
|
1851
1861
|
staticFilter: filterValue // Pass static filter value
|
|
1852
1862
|
}));
|
|
1853
1863
|
if (error) {
|
|
@@ -1889,7 +1899,7 @@ function GenricLayOut(_ref) {
|
|
|
1889
1899
|
}
|
|
1890
1900
|
});
|
|
1891
1901
|
if (handleTableChange) {
|
|
1892
|
-
var _state$dropdownSearch12, _state$inputSearch12, _state$tabs19, _tables$filter12, _tables$sorting29, _tables$sorting30, _header$
|
|
1902
|
+
var _state$dropdownSearch12, _state$inputSearch12, _state$tabs19, _tables$filter12, _tables$sorting29, _tables$sorting30, _header$subHeading33, _header$subHeading34, _staticFilter$data12, _customDrawer$applied11, _state$misc21;
|
|
1893
1903
|
const {
|
|
1894
1904
|
error,
|
|
1895
1905
|
data
|
|
@@ -1905,11 +1915,11 @@ function GenricLayOut(_ref) {
|
|
|
1905
1915
|
columnFilterStatus: tables === null || tables === void 0 || (_tables$filter12 = tables.filter) === null || _tables$filter12 === void 0 ? void 0 : _tables$filter12.value,
|
|
1906
1916
|
field: tables === null || tables === void 0 || (_tables$sorting29 = tables.sorting) === null || _tables$sorting29 === void 0 ? void 0 : _tables$sorting29.sortBy,
|
|
1907
1917
|
order: tables === null || tables === void 0 || (_tables$sorting30 = tables.sorting) === null || _tables$sorting30 === void 0 ? void 0 : _tables$sorting30.sortDirection
|
|
1908
|
-
}, (header === null || header === void 0 || (_header$
|
|
1909
|
-
subHeadingSelectVal: header === null || header === void 0 || (_header$
|
|
1918
|
+
}, (header === null || header === void 0 || (_header$subHeading33 = header.subHeading) === null || _header$subHeading33 === void 0 || (_header$subHeading33 = _header$subHeading33.jsxConfig) === null || _header$subHeading33 === void 0 ? void 0 : _header$subHeading33.type) == "select" ? {
|
|
1919
|
+
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
|
|
1910
1920
|
} : {}), (staticFilter === null || staticFilter === void 0 ? void 0 : staticFilter.visible) && ((_staticFilter$data12 = staticFilter.data) === null || _staticFilter$data12 === void 0 || (_staticFilter$data12 = _staticFilter$data12.find(item => item.selected)) === null || _staticFilter$data12 === void 0 ? void 0 : _staticFilter$data12.value) && {
|
|
1911
1921
|
staticFilter: staticFilter.data.find(item => item.selected).value
|
|
1912
|
-
}), (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$
|
|
1922
|
+
}), (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$misc21 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc21 !== void 0 ? _state$misc21 : {}));
|
|
1913
1923
|
if (error) {
|
|
1914
1924
|
showErrorNotification(error);
|
|
1915
1925
|
dispatch({
|
|
@@ -1937,7 +1947,7 @@ function GenricLayOut(_ref) {
|
|
|
1937
1947
|
}
|
|
1938
1948
|
console.log(state, "GenricLayOutstate");
|
|
1939
1949
|
return /*#__PURE__*/_react.default.createElement(_styles.OapageWithDataStyle, {
|
|
1940
|
-
className: (state === null || state === void 0 || (_state$
|
|
1950
|
+
className: (state === null || state === void 0 || (_state$misc22 = state.misc) === null || _state$misc22 === void 0 ? void 0 : _state$misc22.flow) === "hubAutomation" ? "hubAutomationContainer" : ""
|
|
1941
1951
|
}, /*#__PURE__*/_react.default.createElement(_styles.DrawerWithOutFooter, null), /*#__PURE__*/_react.default.createElement("div", {
|
|
1942
1952
|
className: "fullPageLayout"
|
|
1943
1953
|
}, /*#__PURE__*/_react.default.createElement(_GlobalCss.default, null, (sidebar === null || sidebar === void 0 ? void 0 : sidebar.visible) && /*#__PURE__*/_react.default.createElement(_antd.Skeleton, {
|
|
@@ -65,38 +65,40 @@ function FormWidget(props) {
|
|
|
65
65
|
clear
|
|
66
66
|
} = cta !== null && cta !== void 0 ? cta : {};
|
|
67
67
|
const getFieldRules = (itemData, item) => {
|
|
68
|
-
console.log(item, "item");
|
|
69
|
-
console.log(itemData, "itemData");
|
|
70
68
|
if (item.customRulesCheck) {
|
|
71
69
|
return dynamicRules[item === null || item === void 0 ? void 0 : item.name] || (item === null || item === void 0 ? void 0 : item.rules) || [];
|
|
72
70
|
} else {
|
|
73
71
|
return getInputRules(itemData, item);
|
|
74
72
|
}
|
|
75
73
|
};
|
|
74
|
+
const modifedRuleWithItem = item => {
|
|
75
|
+
const temp = item === null || item === void 0 ? void 0 : item.map(r => {
|
|
76
|
+
if (!(r !== null && r !== void 0 && r.checkValidator) || !(r !== null && r !== void 0 && r.rule)) {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
let pattern = r.rule.pattern;
|
|
80
|
+
if (typeof pattern === "string") {
|
|
81
|
+
const regex = new RegExp(pattern);
|
|
82
|
+
pattern = regex;
|
|
83
|
+
}
|
|
84
|
+
return _objectSpread(_objectSpread({}, r.rule), {}, {
|
|
85
|
+
pattern
|
|
86
|
+
});
|
|
87
|
+
}).filter(Boolean);
|
|
88
|
+
return temp;
|
|
89
|
+
};
|
|
76
90
|
const getInputRules = (itemData, item) => {
|
|
77
91
|
var _ref;
|
|
78
|
-
console.log(itemData, item, "getInputRules");
|
|
79
92
|
if (itemData !== null && itemData !== void 0 && itemData.customRules) {
|
|
80
93
|
for (const key in itemData === null || itemData === void 0 ? void 0 : itemData.customRules) {
|
|
81
94
|
if (item[key]) {
|
|
82
|
-
|
|
83
|
-
return
|
|
84
|
-
var _r$rule;
|
|
85
|
-
if (r !== null && r !== void 0 && (_r$rule = r.rule) !== null && _r$rule !== void 0 && _r$rule.pattern) {
|
|
86
|
-
r.rule.pattern = new RegExp(r.rule.pattern);
|
|
87
|
-
}
|
|
88
|
-
return (r === null || r === void 0 ? void 0 : r.checkValidator) && (r === null || r === void 0 ? void 0 : r.rule);
|
|
89
|
-
});
|
|
95
|
+
const modifiedRules = modifedRuleWithItem(itemData === null || itemData === void 0 ? void 0 : itemData.customRules[key]);
|
|
96
|
+
return modifiedRules;
|
|
90
97
|
}
|
|
91
98
|
}
|
|
92
99
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
if (r !== null && r !== void 0 && (_r$rule2 = r.rule) !== null && _r$rule2 !== void 0 && _r$rule2.pattern) {
|
|
96
|
-
r.rule.pattern = new RegExp(r.rule.pattern);
|
|
97
|
-
}
|
|
98
|
-
return (r === null || r === void 0 ? void 0 : r.checkValidator) && (r === null || r === void 0 ? void 0 : r.rule);
|
|
99
|
-
});
|
|
100
|
+
const itemRules = (_ref = itemData || item) === null || _ref === void 0 ? void 0 : _ref.rules;
|
|
101
|
+
return modifedRuleWithItem(itemRules);
|
|
100
102
|
};
|
|
101
103
|
const handleDynamicRuleUpdate = (fieldName, value, dynamicRulesConfig) => {
|
|
102
104
|
if (!dynamicRulesConfig) return;
|
|
@@ -104,7 +106,6 @@ function FormWidget(props) {
|
|
|
104
106
|
var _config$conditions;
|
|
105
107
|
let [targetField, config] = _ref2;
|
|
106
108
|
const condition = (_config$conditions = config.conditions) === null || _config$conditions === void 0 ? void 0 : _config$conditions.find(c => c.type === "equals" ? value == c.value : c.type == "not_equals" ? value != c.value : c.type == "includes" ? value === null || value === void 0 ? void 0 : value.includes(c.value) : c.validator ? c.validator(value) : false);
|
|
107
|
-
console.log(condition, "condition");
|
|
108
109
|
const newRules = condition ? condition.rules : config.defaultRules || [];
|
|
109
110
|
setDynamicRules(prev => _objectSpread(_objectSpread({}, prev), {}, {
|
|
110
111
|
[targetField]: newRules
|
|
@@ -116,7 +117,6 @@ function FormWidget(props) {
|
|
|
116
117
|
}
|
|
117
118
|
});
|
|
118
119
|
};
|
|
119
|
-
console.log(dynamicRules, "dynamicrule");
|
|
120
120
|
const dynamicClassInCaseOfUpload = item => {
|
|
121
121
|
if ((item === null || item === void 0 ? void 0 : item.width) === "full") {
|
|
122
122
|
return "cstUplaodWithFullWidth";
|