sccoreui 5.7.20 → 5.7.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ag-grid/ParentForGrid.js +14 -12
- package/dist/components/ag-grid/advancedFeature/filter/filter.js +2 -2
- package/dist/components/loader/Loader.js +5 -0
- package/dist/types/components/ag-grid/Types.d.ts +7 -3
- package/dist/types/components/loader/Loader.d.ts +2 -6
- package/dist/types/components/types/type.d.ts +6 -0
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const AgGrid_1 = tslib_1.__importDefault(require("./AgGrid"));
|
|
7
7
|
const advanced_feature_1 = tslib_1.__importDefault(require("./advancedFeature/advanced-feature"));
|
|
8
|
+
// import ErrorBoundary from "./error-ui";
|
|
8
9
|
function ParentForGrid(props) {
|
|
9
10
|
const [gridData] = (0, react_1.useState)({
|
|
10
11
|
rowData: props === null || props === void 0 ? void 0 : props.rowData,
|
|
@@ -15,11 +16,16 @@ function ParentForGrid(props) {
|
|
|
15
16
|
const [api, setApi] = (0, react_1.useState)(null);
|
|
16
17
|
const [gridReadyEvent, setGridReadyEvent] = (0, react_1.useState)();
|
|
17
18
|
const [checkedRow, setCheckedRow] = (0, react_1.useState)([]);
|
|
19
|
+
const [emptyResponse] = (0, react_1.useState)({ totalRecords: 0, rowData: [] });
|
|
18
20
|
const [isLoading, setIsLoading] = (0, react_1.useState)(false);
|
|
19
21
|
const [featureDetails, setFeatureDetails] = (0, react_1.useState)({
|
|
20
22
|
searchedText: "",
|
|
21
23
|
filterQueries: [],
|
|
22
|
-
sort: {
|
|
24
|
+
sort: {
|
|
25
|
+
isSortable: false,
|
|
26
|
+
columnToSort: {},
|
|
27
|
+
orderToSort: {}
|
|
28
|
+
}
|
|
23
29
|
// bulkAction: {
|
|
24
30
|
// columnData: {},
|
|
25
31
|
// updatedValue: "",
|
|
@@ -37,29 +43,27 @@ function ParentForGrid(props) {
|
|
|
37
43
|
// Callback to products for getting data
|
|
38
44
|
const getData = (startRow, endRow) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
39
45
|
if (!(props === null || props === void 0 ? void 0 : props.getRowData)) {
|
|
40
|
-
return;
|
|
46
|
+
return emptyResponse; // If callback function to get row data is not provided
|
|
41
47
|
}
|
|
42
48
|
const response = yield props.getRowData(startRow, endRow, featureDetails);
|
|
43
|
-
if (response.rowData) {
|
|
44
|
-
return response
|
|
49
|
+
if (response === null || response === void 0 ? void 0 : response.rowData) {
|
|
50
|
+
return response;
|
|
45
51
|
}
|
|
46
|
-
return
|
|
52
|
+
return emptyResponse;
|
|
47
53
|
});
|
|
48
54
|
// Gets call onLoad,scroll and whenever any featureDetails changed
|
|
49
55
|
const onGridReady = (params) => {
|
|
50
56
|
setIsLoading(true);
|
|
51
|
-
console.log('calling on grid ready');
|
|
52
57
|
setApi(params.api);
|
|
53
58
|
setGridReadyEvent(params);
|
|
54
|
-
console.log(params, "the Params");
|
|
55
59
|
const dataSource = {
|
|
56
60
|
getRows: (params) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
var _a;
|
|
57
62
|
const startRow = params.startRow;
|
|
58
63
|
const endRow = params.endRow;
|
|
59
64
|
const result = yield getData(startRow, endRow);
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
params.successCallback(result, -1);
|
|
65
|
+
if (((_a = result === null || result === void 0 ? void 0 : result.rowData) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
66
|
+
params.successCallback(result === null || result === void 0 ? void 0 : result.rowData, -1);
|
|
63
67
|
}
|
|
64
68
|
else {
|
|
65
69
|
params.failCallback();
|
|
@@ -101,8 +105,6 @@ function ParentForGrid(props) {
|
|
|
101
105
|
callGrid();
|
|
102
106
|
}
|
|
103
107
|
}, [featureDetails.searchedText]);
|
|
104
|
-
console.log(gridData, 'grid data');
|
|
105
|
-
console.log(featureDetails, 'feature details');
|
|
106
108
|
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ style: { height: style.height, width: style.width } }, { children: !isLoading ? ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(advanced_feature_1.default, { featureDetails: featureDetails, setFeatureDetails: setFeatureDetails, columnData: gridData.columnData, props: props, callGrid: callGrid }), (0, jsx_runtime_1.jsx)(AgGrid_1.default, { style: style, gridOptions: gridOptions, onGridReady: onGridReady })] })) : ((0, jsx_runtime_1.jsx)("p", { children: "Loading..." })) })) }));
|
|
107
109
|
}
|
|
108
110
|
exports.default = ParentForGrid;
|
|
@@ -59,13 +59,13 @@ function FilterParent({ columnData, featureDetails, setFeatureDetails, callBackF
|
|
|
59
59
|
return;
|
|
60
60
|
}
|
|
61
61
|
callGrid();
|
|
62
|
-
resettingFilters()
|
|
62
|
+
// resettingFilters()
|
|
63
63
|
};
|
|
64
64
|
(0, react_1.useEffect)(() => {
|
|
65
65
|
var _a;
|
|
66
66
|
console.log(filterRef.current, (_a = filterRef.current) === null || _a === void 0 ? void 0 : _a.toggle, 'filter ref data');
|
|
67
67
|
}, [filterRef.current]);
|
|
68
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(button_1.Button, Object.assign({ text: true, className: "hover:bg-primary-25 ml-2", onClick: (e) => { togglePopup(e); } }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "filter-lines" }) })), (0, jsx_runtime_1.jsxs)(overlaypanel_1.OverlayPanel, Object.assign({ ref: filterRef,
|
|
68
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(button_1.Button, Object.assign({ text: true, className: "hover:bg-primary-25 ml-2", onClick: (e) => { togglePopup(e); } }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "filter-lines" }) })), (0, jsx_runtime_1.jsxs)(overlaypanel_1.OverlayPanel, Object.assign({ ref: filterRef, className: "w-45rem bulk-action-feature" }, { children: [(0, jsx_runtime_1.jsx)(BulkActionHeader, { header: {
|
|
69
69
|
label: "Filters",
|
|
70
70
|
description: "Streamline your search with filter",
|
|
71
71
|
} }), RenderQuery(), (0, jsx_runtime_1.jsx)(BulkActionFooter, { footer: {
|
|
@@ -4,6 +4,11 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const skeleton_1 = require("primereact/skeleton");
|
|
6
6
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
7
|
+
// interface SCLoaderProps {
|
|
8
|
+
// children: ReactElement;
|
|
9
|
+
// isLoading: boolean;
|
|
10
|
+
// loaderClass?: string;
|
|
11
|
+
// }
|
|
7
12
|
const SCLoader = ({ children, isLoading, loaderClass }) => {
|
|
8
13
|
const childClass = children.props.className;
|
|
9
14
|
return ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: isLoading ? (0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { className: loaderClass || childClass }) : children }));
|
|
@@ -29,8 +29,8 @@ export interface SortType {
|
|
|
29
29
|
}
|
|
30
30
|
export interface Sort {
|
|
31
31
|
isSortable: boolean;
|
|
32
|
-
columnToSort: ColumnDef;
|
|
33
|
-
orderToSort: SortType;
|
|
32
|
+
columnToSort: ColumnDef | {};
|
|
33
|
+
orderToSort: SortType | {};
|
|
34
34
|
}
|
|
35
35
|
export interface Operation {
|
|
36
36
|
name: string;
|
|
@@ -46,7 +46,7 @@ export interface Filter {
|
|
|
46
46
|
export interface Features {
|
|
47
47
|
searchedText: string;
|
|
48
48
|
filterQueries: Filter[] | [];
|
|
49
|
-
sort: Sort
|
|
49
|
+
sort: Sort;
|
|
50
50
|
}
|
|
51
51
|
export interface ParentProp {
|
|
52
52
|
}
|
|
@@ -70,3 +70,7 @@ export interface ColumnDef extends ColDef {
|
|
|
70
70
|
maxLength?: number;
|
|
71
71
|
code?: number;
|
|
72
72
|
}
|
|
73
|
+
export interface ResoponseFromCallback {
|
|
74
|
+
totalRecords: number;
|
|
75
|
+
rowData: any[];
|
|
76
|
+
}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import React
|
|
2
|
-
|
|
3
|
-
children: ReactElement;
|
|
4
|
-
isLoading: boolean;
|
|
5
|
-
loaderClass?: string;
|
|
6
|
-
}
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { SCLoaderProps } from "../types/type";
|
|
7
3
|
declare const SCLoader: React.FC<SCLoaderProps>;
|
|
8
4
|
export default SCLoader;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
1
2
|
export interface City {
|
|
2
3
|
name: string;
|
|
3
4
|
code: string;
|
|
@@ -89,6 +90,11 @@ export interface TextFieldProps {
|
|
|
89
90
|
disabled?: boolean;
|
|
90
91
|
isLoading?: boolean;
|
|
91
92
|
}
|
|
93
|
+
export interface SCLoaderProps {
|
|
94
|
+
children: ReactElement;
|
|
95
|
+
isLoading: boolean;
|
|
96
|
+
loaderClass?: string;
|
|
97
|
+
}
|
|
92
98
|
export interface NumberFieldProps {
|
|
93
99
|
errors: any;
|
|
94
100
|
touched: any;
|