sccoreui 6.2.91 → 6.2.92
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/App.js +1 -1
- package/dist/components/ag-grid/advancedFeature/advanced-feature.js +2 -1
- package/dist/components/ag-grid/advancedFeature/global-search.js +4 -1
- package/dist/components/ag-grid/advancedFeature/grid-view-list-view.js +17 -0
- package/dist/components/ag-grid/context-provider.js +5 -1
- package/dist/components/ag-grid/parent-for-grid.js +40 -18
- package/dist/types/components/ag-grid/Types.d.ts +1 -0
- package/dist/types/components/ag-grid/advancedFeature/grid-view-list-view.d.ts +2 -0
- package/dist/types/components/ag-grid/context-provider.d.ts +4 -0
- package/package.json +1 -1
package/dist/App.js
CHANGED
|
@@ -15,6 +15,7 @@ const gridS_search_1 = tslib_1.__importDefault(require("./gridS-search"));
|
|
|
15
15
|
const bulk_edit_action_1 = tslib_1.__importDefault(require("./bulk-edit-action"));
|
|
16
16
|
const column_group_1 = tslib_1.__importDefault(require("./column-group"));
|
|
17
17
|
const type_1 = require("../../types/type");
|
|
18
|
+
const grid_view_list_view_1 = tslib_1.__importDefault(require("./grid-view-list-view"));
|
|
18
19
|
function AdvancedFeatures({ props }) {
|
|
19
20
|
const { featureDetails } = (0, react_1.useContext)(context_provider_1.FeatureContext);
|
|
20
21
|
const conditionsToDisplay = props === null || props === void 0 ? void 0 : props.conditionsToDisplay;
|
|
@@ -30,7 +31,7 @@ function AdvancedFeatures({ props }) {
|
|
|
30
31
|
};
|
|
31
32
|
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (props === null || props === void 0 ? void 0 : props.editMode) ? ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center justify-content-between py-3 px-4" }, { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ className: "flex align-items-center gap-3" }, { children: isComponentVisible(conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayEditHeading) &&
|
|
32
33
|
(props === null || props === void 0 ? void 0 : props.EditHeadingDetails) && (0, jsx_runtime_1.jsx)(EditDetails, {}) })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "flex align-items-center gap-3" }, { children: isComponentVisible(conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displaySearch) && ((0, jsx_runtime_1.jsx)(gridS_search_1.default, {})) })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center gap-3" }, { children: [isComponentVisible(conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displaySidePanel) && ((0, jsx_runtime_1.jsx)(hide_column_1.default, {})), isComponentVisible(conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayBulkEdit) &&
|
|
33
|
-
(props === null || props === void 0 ? void 0 : props.BulkEditComponent) && (0, jsx_runtime_1.jsx)(BulkEdit, {}), (props === null || props === void 0 ? void 0 : props.editMode) && (0, jsx_runtime_1.jsx)(bulk_edit_action_1.default, { props: props })] }))] }))) : ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center justify-content-between py-3 px-4" }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center gap-3" }, { children: [isComponentVisible(conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displaySearch) && ((0, jsx_runtime_1.jsx)(global_search_1.default, { searchPlaceHolder: props === null || props === void 0 ? void 0 : props.placeholder })), isComponentVisible(conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayFilter) && ((0, jsx_runtime_1.jsx)(table_filter_1.default, {})), isComponentVisible(conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayAdvancedFilter) && ((0, jsx_runtime_1.jsx)(AdvanceFilterWrapper, {})), isComponentVisible(conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayRowGroupingElement) && (0, jsx_runtime_1.jsx)(column_group_1.default, { dataFromProps: props })] })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center gap-3" }, { children: [isComponentVisible(conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displaySidePanel) && ((0, jsx_runtime_1.jsx)(hide_column_1.default, {})), isComponentVisible(conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayRemoveItems) && ((0, jsx_runtime_1.jsx)(remove_items_1.default, { removeCallBack: props.removeCallBack })), isComponentVisible(conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayBulkEdit) &&
|
|
34
|
+
(props === null || props === void 0 ? void 0 : props.BulkEditComponent) && (0, jsx_runtime_1.jsx)(BulkEdit, {}), (props === null || props === void 0 ? void 0 : props.editMode) && (0, jsx_runtime_1.jsx)(bulk_edit_action_1.default, { props: props })] }))] }))) : ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center justify-content-between py-3 px-4" }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center gap-3" }, { children: [isComponentVisible(conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displaySearch) && ((0, jsx_runtime_1.jsx)(global_search_1.default, { searchPlaceHolder: props === null || props === void 0 ? void 0 : props.placeholder })), isComponentVisible(conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayFilter) && ((0, jsx_runtime_1.jsx)(table_filter_1.default, {})), isComponentVisible(conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayAdvancedFilter) && ((0, jsx_runtime_1.jsx)(AdvanceFilterWrapper, {})), isComponentVisible(conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayRowGroupingElement) && (0, jsx_runtime_1.jsx)(column_group_1.default, { dataFromProps: props })] })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center gap-3" }, { children: [isComponentVisible(conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displaySidePanel) && ((0, jsx_runtime_1.jsx)(hide_column_1.default, {})), isComponentVisible(conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayGridViewListView) && (0, jsx_runtime_1.jsx)(grid_view_list_view_1.default, {}), isComponentVisible(conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayRemoveItems) && ((0, jsx_runtime_1.jsx)(remove_items_1.default, { removeCallBack: props.removeCallBack })), isComponentVisible(conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayBulkEdit) &&
|
|
34
35
|
(props === null || props === void 0 ? void 0 : props.BulkEditComponent) && (0, jsx_runtime_1.jsx)(BulkEdit, {}), isComponentVisible(conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayBulkAction) &&
|
|
35
36
|
(props === null || props === void 0 ? void 0 : props.bulkActionComponent) && ((0, jsx_runtime_1.jsx)(BulkAction, { checkBoxSelection: featureDetails.checkBoxSelection })), isComponentVisible(conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayRefresh) && ((0, jsx_runtime_1.jsx)(refresh_grid_1.default, {})), isComponentVisible(conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displaySort) && (0, jsx_runtime_1.jsx)(custom_sort_1.default, {}), isComponentVisible(conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayRecords) && ((0, jsx_runtime_1.jsx)(record_detail_1.default, {}))] }))] }))) }));
|
|
36
37
|
}
|
|
@@ -12,12 +12,15 @@ const helper_1 = require("../helper");
|
|
|
12
12
|
const utilComponents_1 = require("../utilComponents");
|
|
13
13
|
const skeleton_1 = require("primereact/skeleton");
|
|
14
14
|
function Search({ searchPlaceHolder }) {
|
|
15
|
-
const { featureDetails, setFeatureDetails, rowModelType, gridApi, quickSearch, conditionsToDisplay, } = (0, react_1.useContext)(context_provider_1.FeatureContext);
|
|
15
|
+
const { featureDetails, setFeatureDetails, rowModelType, gridApi, quickSearch, conditionsToDisplay, setGridViewData, gridView, } = (0, react_1.useContext)(context_provider_1.FeatureContext);
|
|
16
16
|
const [inputValue, deboucedValue, setInputValue] = (0, hooks_1.useDebounce)("", 500);
|
|
17
17
|
const isDisabled = (0, helper_1.isComponentDisable)(conditionsToDisplay.displaySearch);
|
|
18
18
|
(0, react_1.useEffect)(() => {
|
|
19
19
|
var _a, _b, _c;
|
|
20
20
|
if (rowModelType === constants_1.ROWMODELTYPE.CLIENT_SIDE && quickSearch) {
|
|
21
|
+
if (gridView) {
|
|
22
|
+
setGridViewData((state) => (Object.assign(Object.assign({}, state), { searchText: deboucedValue })));
|
|
23
|
+
}
|
|
21
24
|
if (gridApi === null || gridApi === void 0 ? void 0 : gridApi.current) {
|
|
22
25
|
(_a = gridApi === null || gridApi === void 0 ? void 0 : gridApi.current.api) === null || _a === void 0 ? void 0 : _a.setGridOption("quickFilterText", deboucedValue);
|
|
23
26
|
const displayedRowCount = (_b = gridApi === null || gridApi === void 0 ? void 0 : gridApi.current.api) === null || _b === void 0 ? void 0 : _b.getDisplayedRowCount();
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const button_1 = require("primereact/button");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const context_provider_1 = require("../context-provider");
|
|
8
|
+
const svg_component_1 = tslib_1.__importDefault(require("../../../directives/svg-component"));
|
|
9
|
+
const GridViewListView = () => {
|
|
10
|
+
const { gridViewFun, gridView } = (0, react_1.useContext)(context_provider_1.FeatureContext);
|
|
11
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex border-1 border-gray-300 border-round-sm" }, { children: [(0, jsx_runtime_1.jsx)(button_1.Button, { className: `border-round-sm border-noround-right sc_icon_hover ${!gridView
|
|
12
|
+
? "focus:shadow-none"
|
|
13
|
+
: "bg-primary-50 focus:shadow-none border-right-1 border-gray-300"} `, icon: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "grid-01", color: !gridView ? "text-gray-600" : "text-primary-400", size: 18 }), outlined: true, onClick: () => gridViewFun(true), title: "Grid View" }), (0, jsx_runtime_1.jsx)(button_1.Button, { title: "List View", className: `sc_icon_hover border-round-sm border-noround-left border-left-none ${!gridView
|
|
14
|
+
? "bg-primary-50 focus:shadow-none"
|
|
15
|
+
: "focus:shadow-none border-left-1 border-gray-300"} `, icon: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "list", color: !gridView ? "text-primary-400" : "text-gray-600", size: 18 }), outlined: true, onClick: () => gridViewFun(false) })] })));
|
|
16
|
+
};
|
|
17
|
+
exports.default = GridViewListView;
|
|
@@ -6,7 +6,7 @@ const react_1 = require("react");
|
|
|
6
6
|
const helper_1 = require("./helper");
|
|
7
7
|
exports.FeatureContext = (0, react_1.createContext)(null);
|
|
8
8
|
function MyProvider({ children, value }) {
|
|
9
|
-
const { featureDetails, setFeatureDetails, gridData, callGrid, totalRecords, initialFeature, defaultFilters, createView, enableViewCreate, filterModelText, sortModelText, recordDetailModelText, sidePanelText, sortOptions, filterConditions, clearFilters, setGridData, gridApi, updateColumnsForGrid, enableManageColumnsCallback, columnToRender, selectedGroup, setSelectedGroup, initialCheckBoxData, intialColumns, setIntialColumns, rowModelType, quickSearch, enableAdvancedFilter, conditionsToDisplay, } = value;
|
|
9
|
+
const { featureDetails, setFeatureDetails, gridData, callGrid, totalRecords, initialFeature, defaultFilters, createView, enableViewCreate, filterModelText, sortModelText, recordDetailModelText, sidePanelText, sortOptions, filterConditions, clearFilters, setGridData, gridApi, updateColumnsForGrid, enableManageColumnsCallback, columnToRender, selectedGroup, setSelectedGroup, initialCheckBoxData, intialColumns, setIntialColumns, rowModelType, quickSearch, enableAdvancedFilter, conditionsToDisplay, gridViewFun, gridViewData, setGridViewData, gridView } = value;
|
|
10
10
|
// States for sort
|
|
11
11
|
const [columnData] = (0, react_1.useState)(gridData === null || gridData === void 0 ? void 0 : gridData.columnData);
|
|
12
12
|
const [sortValue, setSortValue] = (0, react_1.useState)({});
|
|
@@ -109,6 +109,10 @@ function MyProvider({ children, value }) {
|
|
|
109
109
|
quickSearch,
|
|
110
110
|
enableAdvancedFilter,
|
|
111
111
|
conditionsToDisplay,
|
|
112
|
+
gridViewFun,
|
|
113
|
+
gridViewData,
|
|
114
|
+
setGridViewData,
|
|
115
|
+
gridView
|
|
112
116
|
} }, { children: children })));
|
|
113
117
|
}
|
|
114
118
|
exports.default = MyProvider;
|
|
@@ -15,11 +15,13 @@ const group_checkbox_1 = tslib_1.__importDefault(require("./group-checkbox"));
|
|
|
15
15
|
const utilComponents_1 = require("./utilComponents");
|
|
16
16
|
function ParentForGrid(props) {
|
|
17
17
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
18
|
-
const { gridProps = {} } = props;
|
|
18
|
+
const { gridProps = {}, gridViewTemplate } = props;
|
|
19
19
|
const [gridData, setGridData] = (0, react_1.useState)({
|
|
20
20
|
rowData: [],
|
|
21
21
|
columnData: (0, helper_1.sortColumns)(props === null || props === void 0 ? void 0 : props.columnData),
|
|
22
22
|
});
|
|
23
|
+
const [gridViewData, setGridViewData] = (0, react_1.useState)({ rowData: [], searchText: "" });
|
|
24
|
+
const [gridView, setGridView] = (0, react_1.useState)(false);
|
|
23
25
|
let maxLength = 0;
|
|
24
26
|
// const [style] = useState<Style>(props.style);
|
|
25
27
|
const [api, setApi] = (0, react_1.useState)(null);
|
|
@@ -77,10 +79,9 @@ function ParentForGrid(props) {
|
|
|
77
79
|
};
|
|
78
80
|
}, []);
|
|
79
81
|
// Function to handle header checkbox click event
|
|
80
|
-
const handleHeaderCheckbox = (
|
|
82
|
+
const handleHeaderCheckbox = () => {
|
|
81
83
|
// get the group and subgroupids
|
|
82
84
|
const { firstGroupIds, secondGroupIds } = (0, helper_1.getGroupIds)(gridRef);
|
|
83
|
-
console.log("header props checkbox", props.node);
|
|
84
85
|
const { allBoxChecked } = featureDetails.checkBoxSelection;
|
|
85
86
|
const currentStatus = !allBoxChecked;
|
|
86
87
|
const checkboxData = Object.assign(Object.assign({}, featureDetails.checkBoxSelection), { allBoxChecked: currentStatus, isIndeterminate: false, includedRecords: [], excludedRecords: [], headerCheckBoxStatus: currentStatus
|
|
@@ -100,10 +101,10 @@ function ParentForGrid(props) {
|
|
|
100
101
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
101
102
|
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: `flex align-items-center justify-content-between ${((_a = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _a === void 0 ? void 0 : _a.displayCheckboxOnRight)
|
|
102
103
|
? "w-full pd-r-2"
|
|
103
|
-
: ""}` }, { children: ((_b = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _b === void 0 ? void 0 : _b.displayCheckboxOnRight) ? ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `flex align-items-center justify-content-between w-full ` }, { children: [HeaderComponent ? ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: " mr-auto" }, { children: [" ", (0, jsx_runtime_1.jsx)(HeaderComponent, {}), " "] }))) : ((0, jsx_runtime_1.jsx)("span", { children: headerDisplayName })), (0, jsx_runtime_1.jsx)(grid_checkbox_1.default, { checked: featureDetails.checkBoxSelection.allBoxChecked, onChange: () => handleHeaderCheckbox(
|
|
104
|
+
: ""}` }, { children: ((_b = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _b === void 0 ? void 0 : _b.displayCheckboxOnRight) ? ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `flex align-items-center justify-content-between w-full ` }, { children: [HeaderComponent ? ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: " mr-auto" }, { children: [" ", (0, jsx_runtime_1.jsx)(HeaderComponent, {}), " "] }))) : ((0, jsx_runtime_1.jsx)("span", { children: headerDisplayName })), (0, jsx_runtime_1.jsx)(grid_checkbox_1.default, { checked: featureDetails.checkBoxSelection.allBoxChecked, onChange: () => handleHeaderCheckbox(), isIndeterminate: featureDetails.checkBoxSelection.isIndeterminate &&
|
|
104
105
|
(((_d = (_c = featureDetails.checkBoxSelection) === null || _c === void 0 ? void 0 : _c.excludedRecords) === null || _d === void 0 ? void 0 : _d.length) > 0
|
|
105
106
|
? true
|
|
106
|
-
: false), shouldRenderOnRight: (_e = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _e === void 0 ? void 0 : _e.displayCheckboxOnRight })] }))) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(grid_checkbox_1.default, { checked: featureDetails.checkBoxSelection.allBoxChecked, onChange: () => handleHeaderCheckbox(
|
|
107
|
+
: false), shouldRenderOnRight: (_e = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _e === void 0 ? void 0 : _e.displayCheckboxOnRight })] }))) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(grid_checkbox_1.default, { checked: featureDetails.checkBoxSelection.allBoxChecked, onChange: () => handleHeaderCheckbox(), isIndeterminate: featureDetails.checkBoxSelection.isIndeterminate &&
|
|
107
108
|
(((_g = (_f = featureDetails.checkBoxSelection) === null || _f === void 0 ? void 0 : _f.excludedRecords) === null || _g === void 0 ? void 0 : _g.length) > 0
|
|
108
109
|
? true
|
|
109
110
|
: false), shouldRenderOnRight: (_h = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _h === void 0 ? void 0 : _h.displayCheckboxOnRight }), HeaderComponent ? ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "px-3" }, { children: [" ", (0, jsx_runtime_1.jsx)(HeaderComponent, {}), " "] }))) : ((0, jsx_runtime_1.jsx)("span", { children: headerDisplayName }))] })) })));
|
|
@@ -153,15 +154,21 @@ function ParentForGrid(props) {
|
|
|
153
154
|
currentFeatures = featureDetails;
|
|
154
155
|
}
|
|
155
156
|
if ((props === null || props === void 0 ? void 0 : props.rowModelType) === (constants_1.ROWMODELTYPE === null || constants_1.ROWMODELTYPE === void 0 ? void 0 : constants_1.ROWMODELTYPE.CLIENT_SIDE)) {
|
|
156
|
-
(
|
|
157
|
-
|
|
157
|
+
if (gridView) {
|
|
158
|
+
const result = yield getData(0, 0, currentFeatures);
|
|
159
|
+
setGridViewData(Object.assign(Object.assign({}, gridViewData), { rowData: result.rowData }));
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
params && ((_t = params === null || params === void 0 ? void 0 : params.api) === null || _t === void 0 ? void 0 : _t.setGridOption("rowData", []));
|
|
163
|
+
const result = gridViewData.rowData.length > 0 ? { rowData: gridViewData.rowData, totalRecords: gridViewData.rowData.length } : yield getData(0, 0, currentFeatures);
|
|
158
164
|
if (result.rowData) {
|
|
165
|
+
gridViewData.rowData.length > 0 && setGridViewData({ rowData: [], searchText: "" });
|
|
159
166
|
setGridData(Object.assign(Object.assign({}, gridData), { rowData: result.rowData }));
|
|
160
|
-
gridRef.current.api.hideOverlay();
|
|
161
|
-
(_u = params === null || params === void 0 ? void 0 : params.api) === null || _u === void 0 ? void 0 : _u.applyTransaction({ add: result.rowData });
|
|
167
|
+
gridRef.current && gridRef.current.api.hideOverlay();
|
|
168
|
+
params && ((_u = params === null || params === void 0 ? void 0 : params.api) === null || _u === void 0 ? void 0 : _u.applyTransaction({ add: result.rowData }));
|
|
162
169
|
}
|
|
163
170
|
else {
|
|
164
|
-
(_v = params === null || params === void 0 ? void 0 : params.api) === null || _v === void 0 ? void 0 : _v.applyTransaction({ add: [] });
|
|
171
|
+
params && ((_v = params === null || params === void 0 ? void 0 : params.api) === null || _v === void 0 ? void 0 : _v.applyTransaction({ add: [] }));
|
|
165
172
|
}
|
|
166
173
|
}
|
|
167
174
|
else if (props.rowModelType === constants_1.ROWMODELTYPE.SERVER_SIDE) {
|
|
@@ -182,26 +189,25 @@ function ParentForGrid(props) {
|
|
|
182
189
|
}
|
|
183
190
|
// get data for request from our fake server
|
|
184
191
|
const response = yield getData(startRow, endRow, currentFeatures, params);
|
|
185
|
-
console.log(response, "response");
|
|
186
192
|
// simulating real server call with a 500ms delay
|
|
187
193
|
if (((_x = response.rowData) === null || _x === void 0 ? void 0 : _x.length) > 0) {
|
|
188
194
|
setGridData(Object.assign(Object.assign({}, gridData), { rowData: response.rowData }));
|
|
189
195
|
gridRef.current.api.hideOverlay();
|
|
190
196
|
// supply rows for requested block to grid
|
|
191
|
-
params.success({ rowData: response.rowData });
|
|
197
|
+
params && params.success({ rowData: response.rowData });
|
|
192
198
|
return;
|
|
193
199
|
}
|
|
194
200
|
else {
|
|
195
201
|
// params.fail();
|
|
196
202
|
const gridRows = startRow >= constants_1.BLOCK_SIZE ? gridData.rowData : [];
|
|
197
203
|
if (!((_y = params === null || params === void 0 ? void 0 : params.parentNode) === null || _y === void 0 ? void 0 : _y.id))
|
|
198
|
-
gridRef.current.api.showNoRowsOverlay();
|
|
199
|
-
params.success({ rowData: gridRows });
|
|
204
|
+
gridRef.current && gridRef.current.api.showNoRowsOverlay();
|
|
205
|
+
params && params.success({ rowData: gridRows });
|
|
200
206
|
return;
|
|
201
207
|
}
|
|
202
208
|
}),
|
|
203
209
|
};
|
|
204
|
-
params === null || params === void 0 ? void 0 : params.api.setGridOption("serverSideDatasource", dataSource);
|
|
210
|
+
params && (params === null || params === void 0 ? void 0 : params.api.setGridOption("serverSideDatasource", dataSource));
|
|
205
211
|
}
|
|
206
212
|
});
|
|
207
213
|
// Specify unique id for every row for grid
|
|
@@ -333,8 +339,15 @@ function ParentForGrid(props) {
|
|
|
333
339
|
const popupParent = (0, react_1.useMemo)(() => {
|
|
334
340
|
return document.getElementById("wrapper");
|
|
335
341
|
}, []);
|
|
342
|
+
const onGridPreDestroyed = () => {
|
|
343
|
+
const allData = [];
|
|
344
|
+
api === null || api === void 0 ? void 0 : api.forEachNode((node) => {
|
|
345
|
+
allData.push(node.data);
|
|
346
|
+
});
|
|
347
|
+
setGridViewData(Object.assign(Object.assign({}, gridViewData), { rowData: allData }));
|
|
348
|
+
};
|
|
336
349
|
// Options that grid should have
|
|
337
|
-
const gridOptions = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ columnDefs: (_f = gridData === null || gridData === void 0 ? void 0 : gridData.columnData) === null || _f === void 0 ? void 0 : _f.map((column) => {
|
|
350
|
+
const gridOptions = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ columnDefs: (_f = gridData === null || gridData === void 0 ? void 0 : gridData.columnData) === null || _f === void 0 ? void 0 : _f.map((column) => {
|
|
338
351
|
var _a, _b;
|
|
339
352
|
if ((column === null || column === void 0 ? void 0 : column.enableChildCheckbox) && (column === null || column === void 0 ? void 0 : column.enableHeaderCheckbox)) {
|
|
340
353
|
return Object.assign(Object.assign({}, column), { headerComponent: (params) => headerCheckBoxRenderer(params === null || params === void 0 ? void 0 : params.displayName, (column === null || column === void 0 ? void 0 : column.headerComponent) && ""), cellRenderer: (params) => (0, utilComponents_1.dataCellRenderer)(params, column, props), cellRendererParams: {
|
|
@@ -353,7 +366,9 @@ function ParentForGrid(props) {
|
|
|
353
366
|
dataTypeDefinitions: props === null || props === void 0 ? void 0 : props.dataTypeDefinitions,
|
|
354
367
|
})), { popupParent: popupParent }), ((props === null || props === void 0 ? void 0 : props.treeData) && { treeData: props === null || props === void 0 ? void 0 : props.treeData })), ((props === null || props === void 0 ? void 0 : props.groupDefaultExpanded) && {
|
|
355
368
|
groupDefaultExpanded: props === null || props === void 0 ? void 0 : props.groupDefaultExpanded, // to enable tree data
|
|
356
|
-
})), ((props === null || props === void 0 ? void 0 : props.onRowClicked) ? { onRowClicked: props === null || props === void 0 ? void 0 : props.onRowClicked } : {})), ((props === null || props === void 0 ? void 0 : props.quickSearch) ? { quickSearch: props.quickSearch } : {})),
|
|
369
|
+
})), ((props === null || props === void 0 ? void 0 : props.onRowClicked) ? { onRowClicked: props === null || props === void 0 ? void 0 : props.onRowClicked } : {})), ((props === null || props === void 0 ? void 0 : props.quickSearch) ? { quickSearch: props.quickSearch } : {})), {
|
|
370
|
+
// ...(props?.getDataPath && { getDataPath: props?.getDataPath }), // for clint side tree data enable fetuare
|
|
371
|
+
onGridPreDestroyed: onGridPreDestroyed }), ((props === null || props === void 0 ? void 0 : props.rowDragManaged) ? { rowDragManaged: props === null || props === void 0 ? void 0 : props.rowDragManaged } : {})), gridProps);
|
|
357
372
|
// Fucntion to call the grid
|
|
358
373
|
const callGrid = (featureDetails) => {
|
|
359
374
|
onGridReady(gridReadyEvent, featureDetails);
|
|
@@ -411,6 +426,9 @@ function ParentForGrid(props) {
|
|
|
411
426
|
setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: initialCheckBoxData }));
|
|
412
427
|
}
|
|
413
428
|
}, [props === null || props === void 0 ? void 0 : props.emptyCheckboxStatus]);
|
|
429
|
+
const gridViewFun = (data) => {
|
|
430
|
+
setGridView(data);
|
|
431
|
+
};
|
|
414
432
|
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(error_ui_1.default, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ id: "wrapper", style: { height: gridStyle === null || gridStyle === void 0 ? void 0 : gridStyle.height, width: gridStyle === null || gridStyle === void 0 ? void 0 : gridStyle.width }, className: `ag-grid-container ag-grid-parent-div ${(props === null || props === void 0 ? void 0 : props.enableAdvancedFilter) ? "hide-advance-filter" : ""}` }, { children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(context_provider_1.default, Object.assign({ value: Object.assign(Object.assign({ rowModelType: props.rowModelType, quickSearch: props === null || props === void 0 ? void 0 : props.quickSearch, featureDetails,
|
|
415
433
|
setFeatureDetails,
|
|
416
434
|
gridData,
|
|
@@ -420,7 +438,11 @@ function ParentForGrid(props) {
|
|
|
420
438
|
defaultFilters, createView: props === null || props === void 0 ? void 0 : props.createView, enableViewCreate: (_k = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _k === void 0 ? void 0 : _k.enableViewCreate, filterModelText: (_l = props === null || props === void 0 ? void 0 : props.dynamicText) === null || _l === void 0 ? void 0 : _l.filterModelText, sortModelText: (_m = props === null || props === void 0 ? void 0 : props.dynamicText) === null || _m === void 0 ? void 0 : _m.sortModelText, recordDetailModelText: (_o = props === null || props === void 0 ? void 0 : props.dynamicText) === null || _o === void 0 ? void 0 : _o.recordDetailModelText, sidePanelText: (_p = props === null || props === void 0 ? void 0 : props.dynamicText) === null || _p === void 0 ? void 0 : _p.sidePanelText, sortOptions: (props === null || props === void 0 ? void 0 : props.sortOptions)
|
|
421
439
|
? props.sortOptions
|
|
422
440
|
: constants_1.COLUMN_SORT_OPTIONS, filterConditions: props === null || props === void 0 ? void 0 : props.filterConditions, clearFilters: props === null || props === void 0 ? void 0 : props.clearFilters, setGridData, gridApi: gridRef, updateColumnsForGrid: props === null || props === void 0 ? void 0 : props.updateColumnsForGrid, enableManageColumnsCallback: props.enableManageColumnsCallback, columnToRender: gridData.columnData, selectedGroup: selectedGroup, setSelectedGroup: setSelectedGroup, initialCheckBoxData: initialCheckBoxData, intialColumns,
|
|
423
|
-
setIntialColumns,
|
|
441
|
+
setIntialColumns,
|
|
442
|
+
gridViewFun,
|
|
443
|
+
gridViewData,
|
|
444
|
+
setGridViewData,
|
|
445
|
+
gridView, enableAdvancedFilter: props === null || props === void 0 ? void 0 : props.enableAdvancedFilter }, ((props === null || props === void 0 ? void 0 : props.rowData) && { rowData: props === null || props === void 0 ? void 0 : props.rowData })), { conditionsToDisplay: props === null || props === void 0 ? void 0 : props.conditionsToDisplay }) }, { children: ((_q = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _q === void 0 ? void 0 : _q.displayFeaturesHeader) && ((0, jsx_runtime_1.jsx)(advanced_feature_1.default, { props: props })) })), gridView ? (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: gridViewTemplate(gridViewData) }) : (0, jsx_runtime_1.jsx)(AgGrid_1.default
|
|
424
446
|
// style={{
|
|
425
447
|
// ...gridStyle,
|
|
426
448
|
// height:
|
|
@@ -104,6 +104,7 @@ export interface ConditionsToDisplay {
|
|
|
104
104
|
displayGroupCount?: boolean;
|
|
105
105
|
displayRowGroupingElement?: string;
|
|
106
106
|
isGridAutoHeight?: boolean;
|
|
107
|
+
displayGridViewListView?: string;
|
|
107
108
|
}
|
|
108
109
|
export interface PropsFromProduct {
|
|
109
110
|
columnData: ColumnDef[];
|
|
@@ -33,6 +33,10 @@ interface MyProviderProps {
|
|
|
33
33
|
quickSearch?: boolean;
|
|
34
34
|
enableAdvancedFilter?: boolean;
|
|
35
35
|
conditionsToDisplay: ConditionsToDisplay;
|
|
36
|
+
gridViewFun: (data: boolean) => void;
|
|
37
|
+
gridViewData: any;
|
|
38
|
+
setGridViewData: any;
|
|
39
|
+
gridView: boolean;
|
|
36
40
|
};
|
|
37
41
|
}
|
|
38
42
|
declare function MyProvider({ children, value }: MyProviderProps): import("react/jsx-runtime").JSX.Element;
|