sccoreui 5.8.21 → 5.8.23
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 +2 -3
- package/dist/components/ag-grid/AgGrid.js +2 -2
- package/dist/components/ag-grid/ParentForGrid.js +35 -25
- package/dist/components/ag-grid/advancedFeature/new-filter/TableFilter.js +8 -10
- package/dist/components/ag-grid/advancedFeature/new-filter/conditions/Conditions.js +0 -8
- package/dist/components/ag-grid/grid-checkbox.js +2 -3
- package/dist/components/ag-grid/loading-component.js +7 -0
- package/dist/types/components/ag-grid/AgGrid.d.ts +2 -1
- package/dist/types/components/ag-grid/Types.d.ts +3 -3
- package/dist/types/components/ag-grid/grid-checkbox.d.ts +1 -1
- package/dist/types/components/ag-grid/loading-component.d.ts +2 -0
- package/package.json +1 -1
- package/dist/pages/aggrid/AgGrid.js +0 -179
- package/dist/pages/aggrid/BulkAction.js +0 -8
- package/dist/pages/aggrid/id-cell.js +0 -9
- package/dist/pages/avatar/avatar.js +0 -338
- package/dist/pages/badges/badge.js +0 -73
- package/dist/pages/breadcrumb/breadcrumb.js +0 -14
- package/dist/pages/button/button.js +0 -10
- package/dist/pages/button-group/button-group.js +0 -10
- package/dist/pages/chart/chart.js +0 -257
- package/dist/pages/checkbox/checkbox.js +0 -26
- package/dist/pages/checkbox-group/checkbox-group-component.js +0 -21
- package/dist/pages/color-picker/color-picker.js +0 -13
- package/dist/pages/content-dividers/content-dividers.js +0 -11
- package/dist/pages/custom-color-picker/custom-color-picker.js +0 -12
- package/dist/pages/date-picker/date-picker.js +0 -20
- package/dist/pages/dropdown/dropdown-component.js +0 -39
- package/dist/pages/file-upload/file-upload.js +0 -34
- package/dist/pages/flex.js +0 -15
- package/dist/pages/formulaTemplate/formulaTemplate.js +0 -154
- package/dist/pages/frolaTextEditor/froala-text-editor.js +0 -12
- package/dist/pages/home.js +0 -47
- package/dist/pages/input/input-text.js +0 -112
- package/dist/pages/list-box-dropdown/listboxdropdown.js +0 -52
- package/dist/pages/loader-indicator/loader-indicator.js +0 -10
- package/dist/pages/mega-mennu/mega-menu.js +0 -84
- package/dist/pages/multi-select-dropdown/multi-select-dropdown.js +0 -51
- package/dist/pages/not-found/not-found.js +0 -10
- package/dist/pages/paginator/pagination.js +0 -122
- package/dist/pages/progress-bar/progress-bar.js +0 -27
- package/dist/pages/progress-steps/progress-steps.js +0 -24
- package/dist/pages/radio-button/radio-button-component.js +0 -11
- package/dist/pages/shadows/shadows.js +0 -7
- package/dist/pages/slideout-menus/slideout-menus.js +0 -104
- package/dist/pages/sliders/slider.js +0 -39
- package/dist/pages/tabels/table-data.js +0 -2193
- package/dist/pages/tabels/table.js +0 -98
- package/dist/pages/tabs/tabs.js +0 -9
- package/dist/pages/tags/tags.js +0 -70
- package/dist/pages/toast/toast.js +0 -47
- package/dist/pages/toggle/toggle.js +0 -10
- package/dist/pages/tooltip/tooltip.js +0 -13
- package/dist/pages/treeDropdownSelect/treedropdowselect.js +0 -34
- package/dist/pages/types/type.js +0 -2
- package/dist/types/pages/aggrid/AgGrid.d.ts +0 -2
- package/dist/types/pages/aggrid/BulkAction.d.ts +0 -2
- package/dist/types/pages/aggrid/id-cell.d.ts +0 -2
- package/dist/types/pages/avatar/avatar.d.ts +0 -2
- package/dist/types/pages/badges/badge.d.ts +0 -3
- package/dist/types/pages/breadcrumb/breadcrumb.d.ts +0 -2
- package/dist/types/pages/button/button.d.ts +0 -2
- package/dist/types/pages/button-group/button-group.d.ts +0 -2
- package/dist/types/pages/chart/chart.d.ts +0 -2
- package/dist/types/pages/checkbox/checkbox.d.ts +0 -2
- package/dist/types/pages/checkbox-group/checkbox-group-component.d.ts +0 -3
- package/dist/types/pages/color-picker/color-picker.d.ts +0 -2
- package/dist/types/pages/content-dividers/content-dividers.d.ts +0 -2
- package/dist/types/pages/custom-color-picker/custom-color-picker.d.ts +0 -2
- package/dist/types/pages/date-picker/date-picker.d.ts +0 -2
- package/dist/types/pages/dropdown/dropdown-component.d.ts +0 -2
- package/dist/types/pages/file-upload/file-upload.d.ts +0 -3
- package/dist/types/pages/flex.d.ts +0 -2
- package/dist/types/pages/formulaTemplate/formulaTemplate.d.ts +0 -2
- package/dist/types/pages/frolaTextEditor/froala-text-editor.d.ts +0 -2
- package/dist/types/pages/home.d.ts +0 -2
- package/dist/types/pages/input/input-text.d.ts +0 -3
- package/dist/types/pages/list-box-dropdown/listboxdropdown.d.ts +0 -2
- package/dist/types/pages/loader-indicator/loader-indicator.d.ts +0 -3
- package/dist/types/pages/mega-mennu/mega-menu.d.ts +0 -2
- package/dist/types/pages/multi-select-dropdown/multi-select-dropdown.d.ts +0 -2
- package/dist/types/pages/not-found/not-found.d.ts +0 -2
- package/dist/types/pages/paginator/pagination.d.ts +0 -2
- package/dist/types/pages/progress-bar/progress-bar.d.ts +0 -3
- package/dist/types/pages/progress-steps/progress-steps.d.ts +0 -2
- package/dist/types/pages/radio-button/radio-button-component.d.ts +0 -2
- package/dist/types/pages/shadows/shadows.d.ts +0 -2
- package/dist/types/pages/slideout-menus/slideout-menus.d.ts +0 -2
- package/dist/types/pages/sliders/slider.d.ts +0 -1
- package/dist/types/pages/tabels/table-data.d.ts +0 -3
- package/dist/types/pages/tabels/table.d.ts +0 -2
- package/dist/types/pages/tabs/tabs.d.ts +0 -3
- package/dist/types/pages/tags/tags.d.ts +0 -3
- package/dist/types/pages/toast/toast.d.ts +0 -2
- package/dist/types/pages/toggle/toggle.d.ts +0 -2
- package/dist/types/pages/tooltip/tooltip.d.ts +0 -2
- package/dist/types/pages/treeDropdownSelect/treedropdowselect.d.ts +0 -2
- package/dist/types/pages/types/type.d.ts +0 -64
package/dist/App.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
3
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
4
|
// import Home from './pages/home';
|
|
6
5
|
require("./App.scss");
|
|
7
|
-
|
|
6
|
+
// import Home from "./pages/home";
|
|
8
7
|
const App = () => {
|
|
9
|
-
return ((0, jsx_runtime_1.jsx)("div", {
|
|
8
|
+
return ((0, jsx_runtime_1.jsx)("div", {}));
|
|
10
9
|
};
|
|
11
10
|
exports.default = App;
|
|
@@ -12,7 +12,7 @@ const infinite_row_model_1 = require("@ag-grid-community/infinite-row-model");
|
|
|
12
12
|
const LicenceKey_1 = require("./LicenceKey");
|
|
13
13
|
core_1.ModuleRegistry.registerModules([client_side_row_model_1.ClientSideRowModelModule, range_selection_1.RangeSelectionModule, infinite_row_model_1.InfiniteRowModelModule]);
|
|
14
14
|
core_2.LicenseManager.setLicenseKey(LicenceKey_1.LICENSEKEY);
|
|
15
|
-
const AgGrid = ({ style, gridOptions, onGridReady }) => {
|
|
16
|
-
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "ag-theme-quartz ", style: { height: style.height, width: style.width } }, { children: (0, jsx_runtime_1.jsx)(react_1.AgGridReact, Object.assign({ onGridReady: onGridReady, reactiveCustomComponents: true }, gridOptions)) })) }));
|
|
15
|
+
const AgGrid = ({ style, gridOptions, onGridReady, gridRef }) => {
|
|
16
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "ag-theme-quartz ", style: { height: style.height, width: style.width } }, { children: (0, jsx_runtime_1.jsx)(react_1.AgGridReact, Object.assign({ ref: gridRef, onGridReady: onGridReady, reactiveCustomComponents: true }, gridOptions)) })) }));
|
|
17
17
|
};
|
|
18
18
|
exports.default = AgGrid;
|
|
@@ -10,6 +10,7 @@ const MyProvider_1 = tslib_1.__importDefault(require("./MyProvider"));
|
|
|
10
10
|
const error_ui_1 = tslib_1.__importDefault(require("./error-ui"));
|
|
11
11
|
const constants_1 = require("./constants");
|
|
12
12
|
require("./ag-grid.scss");
|
|
13
|
+
const loading_component_1 = tslib_1.__importDefault(require("./loading-component"));
|
|
13
14
|
function ParentForGrid(props) {
|
|
14
15
|
const [gridData, setGridData] = (0, react_1.useState)({
|
|
15
16
|
rowData: [],
|
|
@@ -26,9 +27,9 @@ function ParentForGrid(props) {
|
|
|
26
27
|
const [isLoading, setIsLoading] = (0, react_1.useState)(false);
|
|
27
28
|
const [initialCheckBoxData] = (0, react_1.useState)({
|
|
28
29
|
allBoxChecked: false,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
isIndeterminate: false,
|
|
31
|
+
includedRecords: [],
|
|
32
|
+
excludedRecords: [],
|
|
32
33
|
});
|
|
33
34
|
const initialFeature = {
|
|
34
35
|
searchedText: "",
|
|
@@ -52,6 +53,7 @@ function ParentForGrid(props) {
|
|
|
52
53
|
checkBoxSelection: initialCheckBoxData,
|
|
53
54
|
isRemoveClicked: false
|
|
54
55
|
});
|
|
56
|
+
const gridRef = (0, react_1.useRef)(null);
|
|
55
57
|
// Default column specification
|
|
56
58
|
const defaultColDef = (0, react_1.useMemo)(() => {
|
|
57
59
|
return {
|
|
@@ -64,50 +66,50 @@ function ParentForGrid(props) {
|
|
|
64
66
|
}, []);
|
|
65
67
|
// Function to handle checkbox click events
|
|
66
68
|
const handleCheckboxClick = (rowData) => {
|
|
67
|
-
const {
|
|
68
|
-
if (allBoxChecked &&
|
|
69
|
-
const checkboxData = Object.assign(Object.assign({}, featureDetails.checkBoxSelection), {
|
|
69
|
+
const { excludedRecords, includedRecords, allBoxChecked } = featureDetails.checkBoxSelection;
|
|
70
|
+
if (allBoxChecked && excludedRecords.includes(rowData)) {
|
|
71
|
+
const checkboxData = Object.assign(Object.assign({}, featureDetails.checkBoxSelection), { excludedRecords: excludedRecords.filter((item) => item !== rowData) });
|
|
70
72
|
setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: checkboxData }));
|
|
71
73
|
return;
|
|
72
74
|
}
|
|
73
75
|
else if (allBoxChecked) {
|
|
74
|
-
const checkboxData = Object.assign(Object.assign({}, featureDetails.checkBoxSelection), {
|
|
76
|
+
const checkboxData = Object.assign(Object.assign({}, featureDetails.checkBoxSelection), { excludedRecords: [...excludedRecords, rowData], isIndeterminate: true });
|
|
75
77
|
setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: checkboxData }));
|
|
76
78
|
return;
|
|
77
79
|
}
|
|
78
80
|
// Logic to handle checkbox click events
|
|
79
|
-
if (
|
|
80
|
-
const checkboxData = Object.assign(Object.assign({}, featureDetails.checkBoxSelection), {
|
|
81
|
+
if (includedRecords.includes(rowData)) {
|
|
82
|
+
const checkboxData = Object.assign(Object.assign({}, featureDetails.checkBoxSelection), { includedRecords: includedRecords.filter((item) => item !== rowData) });
|
|
81
83
|
setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: checkboxData }));
|
|
82
84
|
}
|
|
83
85
|
else {
|
|
84
|
-
const checkboxData = Object.assign(Object.assign({}, featureDetails.checkBoxSelection), {
|
|
86
|
+
const checkboxData = Object.assign(Object.assign({}, featureDetails.checkBoxSelection), { includedRecords: [...includedRecords, rowData] });
|
|
85
87
|
setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: checkboxData }));
|
|
86
88
|
}
|
|
87
89
|
};
|
|
88
90
|
const handleHeaderCheckbox = () => {
|
|
89
91
|
const { allBoxChecked } = featureDetails.checkBoxSelection;
|
|
90
|
-
const checkboxData = Object.assign(Object.assign({}, featureDetails.checkBoxSelection), { allBoxChecked: !allBoxChecked,
|
|
92
|
+
const checkboxData = Object.assign(Object.assign({}, featureDetails.checkBoxSelection), { allBoxChecked: !allBoxChecked, isIndeterminate: false, includedRecords: [], excludedRecords: [] });
|
|
91
93
|
setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: checkboxData }));
|
|
92
94
|
};
|
|
93
95
|
// JSX for rendering checkbox in header
|
|
94
96
|
const headerCheckBoxRenderer = (params) => {
|
|
95
97
|
const displayName = params === null || params === void 0 ? void 0 : params.displayName;
|
|
96
|
-
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex" }, { children: [(0, jsx_runtime_1.jsx)(grid_checkbox_1.default, { checked: featureDetails.checkBoxSelection.allBoxChecked, onChange: handleHeaderCheckbox,
|
|
98
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex" }, { children: [(0, jsx_runtime_1.jsx)(grid_checkbox_1.default, { checked: featureDetails.checkBoxSelection.allBoxChecked, onChange: handleHeaderCheckbox, isIndeterminate: featureDetails.checkBoxSelection.isIndeterminate }), (0, jsx_runtime_1.jsx)("p", Object.assign({ className: "px-3" }, { children: displayName }))] })));
|
|
97
99
|
};
|
|
98
100
|
// JSX for rendering checkbox in cells
|
|
99
101
|
const cellCheckBoxRenderer = (params) => {
|
|
100
102
|
const { data } = params;
|
|
101
|
-
const { allBoxChecked,
|
|
103
|
+
const { allBoxChecked, excludedRecords, includedRecords } = featureDetails.checkBoxSelection;
|
|
102
104
|
return ((0, jsx_runtime_1.jsx)(grid_checkbox_1.default, { checked: allBoxChecked
|
|
103
|
-
? !
|
|
104
|
-
:
|
|
105
|
+
? !excludedRecords.includes(data)
|
|
106
|
+
: includedRecords.includes(data), onChange: () => handleCheckboxClick(data), isIndeterminate: false }));
|
|
105
107
|
};
|
|
106
108
|
// Render checkbox as well as initial component/data from props
|
|
107
109
|
const dataCellRenderer = (cellRendererParams, column) => {
|
|
108
110
|
var _a;
|
|
109
111
|
const { initialRenderer, cellCheckBoxRenderer } = cellRendererParams;
|
|
110
|
-
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex" }, { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ className: "pr-3" }, { children: cellCheckBoxRenderer(cellRendererParams) })), typeof initialRenderer === "function" ? (initialRenderer(cellRendererParams)) : ((0, jsx_runtime_1.jsx)("div", { children: (_a = cellRendererParams === null || cellRendererParams === void 0 ? void 0 : cellRendererParams.data) === null || _a === void 0 ? void 0 : _a[column === null || column === void 0 ? void 0 : column.field] }))] })));
|
|
112
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex" }, { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ className: "pr-3 " }, { children: cellCheckBoxRenderer(cellRendererParams) })), typeof initialRenderer === "function" ? (initialRenderer(cellRendererParams)) : ((0, jsx_runtime_1.jsx)("div", { children: (_a = cellRendererParams === null || cellRendererParams === void 0 ? void 0 : cellRendererParams.data) === null || _a === void 0 ? void 0 : _a[column === null || column === void 0 ? void 0 : column.field] }))] })));
|
|
111
113
|
};
|
|
112
114
|
// Callback to products for getting data
|
|
113
115
|
const getData = (startRow, endRow, currentFeatures) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
@@ -116,7 +118,8 @@ function ParentForGrid(props) {
|
|
|
116
118
|
}
|
|
117
119
|
const response = yield props.getRowData(startRow, endRow, currentFeatures);
|
|
118
120
|
setGridData(Object.assign(Object.assign({}, gridData), { rowData: [] }));
|
|
119
|
-
|
|
121
|
+
// Clear selected checkbox
|
|
122
|
+
// setFeatureDetails((prev: any) => ({ ...prev, checkBoxSelection: initialCheckBoxData }));
|
|
120
123
|
// To identify when to stop the callBack
|
|
121
124
|
// const actualEndRow = startRow + (response?.rowData?.length ?? 0);
|
|
122
125
|
const actualEndRow = response === null || response === void 0 ? void 0 : response.totalRecords;
|
|
@@ -141,13 +144,17 @@ function ParentForGrid(props) {
|
|
|
141
144
|
if (!updatedFeatures) {
|
|
142
145
|
currentFeatures = featureDetails;
|
|
143
146
|
}
|
|
147
|
+
setFeatureDetails(currentFeatures);
|
|
144
148
|
if (props.rowModelType === constants_1.ROWMODELTYPE.CLIENT_SIDE) {
|
|
149
|
+
params.api.setGridOption("rowData", []);
|
|
145
150
|
const result = yield getData(0, 0, currentFeatures);
|
|
146
151
|
if (result.rowData) {
|
|
147
152
|
setGridData(Object.assign(Object.assign({}, gridData), { rowData: result.rowData }));
|
|
148
|
-
params.api.setGridOption("rowData", []);
|
|
149
153
|
params.api.applyTransaction({ add: result.rowData });
|
|
150
154
|
}
|
|
155
|
+
else {
|
|
156
|
+
params.api.applyTransaction({ add: [] });
|
|
157
|
+
}
|
|
151
158
|
}
|
|
152
159
|
else if (props.rowModelType === constants_1.ROWMODELTYPE.INFINITE) {
|
|
153
160
|
const dataSource = {
|
|
@@ -160,13 +167,14 @@ function ParentForGrid(props) {
|
|
|
160
167
|
params.successCallback(result === null || result === void 0 ? void 0 : result.rowData, result === null || result === void 0 ? void 0 : result.actualEndRow);
|
|
161
168
|
}
|
|
162
169
|
else {
|
|
163
|
-
params.
|
|
170
|
+
params.successCallback([], 0);
|
|
171
|
+
gridRef.current.api.showNoRowsOverlay();
|
|
172
|
+
// params.failCallback();
|
|
164
173
|
}
|
|
165
174
|
}),
|
|
166
175
|
};
|
|
167
176
|
params.api.setGridOption("datasource", dataSource);
|
|
168
177
|
}
|
|
169
|
-
setFeatureDetails(currentFeatures);
|
|
170
178
|
setIsLoading(false);
|
|
171
179
|
});
|
|
172
180
|
// Get values when cell edited
|
|
@@ -201,7 +209,9 @@ function ParentForGrid(props) {
|
|
|
201
209
|
pinnedTopRowData: props === null || props === void 0 ? void 0 : props.pinnedTopRowData,
|
|
202
210
|
cacheBlockSize: constants_1.BLOCK_SIZE,
|
|
203
211
|
maxBlocksInCache: constants_1.MAX_BLOCKS,
|
|
204
|
-
blockLoadDebounceMillis: constants_1.DEBOUNCE_INTERVAL,
|
|
212
|
+
blockLoadDebounceMillis: constants_1.DEBOUNCE_INTERVAL,
|
|
213
|
+
noRowsOverlayComponent: props === null || props === void 0 ? void 0 : props.noRowsOverlayComponent,
|
|
214
|
+
loadingOverlayComponent: loading_component_1.default,
|
|
205
215
|
};
|
|
206
216
|
// Fucntion to call the grid
|
|
207
217
|
const callGrid = (featureDetails) => {
|
|
@@ -222,9 +232,9 @@ function ParentForGrid(props) {
|
|
|
222
232
|
// useEffect(() => {
|
|
223
233
|
// setCheckBoxSelection({
|
|
224
234
|
// allBoxChecked: false,
|
|
225
|
-
//
|
|
226
|
-
//
|
|
227
|
-
//
|
|
235
|
+
// isIndeterminate: false,
|
|
236
|
+
// includedRecords: [],
|
|
237
|
+
// excludedRecords: [],
|
|
228
238
|
// });
|
|
229
239
|
// }, [featureDetails]);
|
|
230
240
|
console.log(isLoading, gridOptions, props === null || props === void 0 ? void 0 : props.pinnedTopRowData, "is loading state");
|
|
@@ -241,6 +251,6 @@ function ParentForGrid(props) {
|
|
|
241
251
|
callGrid,
|
|
242
252
|
totalRecords,
|
|
243
253
|
initialFeature
|
|
244
|
-
} }, { children: (0, jsx_runtime_1.jsx)(advanced_feature_1.default, { props: props }) })), (0, jsx_runtime_1.jsx)(AgGrid_1.default, { style: style, gridOptions: gridOptions, onGridReady: onGridReady })] }) })) }) }));
|
|
254
|
+
} }, { children: (0, jsx_runtime_1.jsx)(advanced_feature_1.default, { props: props }) })), (0, jsx_runtime_1.jsx)(AgGrid_1.default, { style: style, gridOptions: gridOptions, onGridReady: onGridReady, gridRef: gridRef })] }) })) }) }));
|
|
245
255
|
}
|
|
246
256
|
exports.default = ParentForGrid;
|
|
@@ -21,16 +21,14 @@ const TableFilter = () => {
|
|
|
21
21
|
const [allFieldsFilled, setAllFieldsFilled] = (0, react_1.useState)(false);
|
|
22
22
|
const [enbleApply, setEnbleApply] = (0, react_1.useState)(true);
|
|
23
23
|
const [isOverlayOpened, setIsOverlayOpened] = (0, react_1.useState)(false);
|
|
24
|
-
const tableColumns = columnData === null || columnData === void 0 ? void 0 : columnData.map((eachColumn) => {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
};
|
|
33
|
-
});
|
|
24
|
+
const tableColumns = columnData === null || columnData === void 0 ? void 0 : columnData.filter((eachColumn) => eachColumn === null || eachColumn === void 0 ? void 0 : eachColumn.isFilterable).map((eachColumn) => ({
|
|
25
|
+
name: eachColumn[columnName],
|
|
26
|
+
code: eachColumn[columnId],
|
|
27
|
+
dataType: eachColumn.dataType,
|
|
28
|
+
type: eachColumn.type,
|
|
29
|
+
key: eachColumn === null || eachColumn === void 0 ? void 0 : eachColumn.key,
|
|
30
|
+
options: eachColumn === null || eachColumn === void 0 ? void 0 : eachColumn.options,
|
|
31
|
+
}));
|
|
34
32
|
const defaultCondtion = {
|
|
35
33
|
columnName: "",
|
|
36
34
|
condition: "",
|
|
@@ -12,14 +12,6 @@ const calendar_1 = require("primereact/calendar");
|
|
|
12
12
|
const multi_select_dropdown_1 = tslib_1.__importDefault(require("../../../../multi-select-dropdown/multi-select-dropdown"));
|
|
13
13
|
const Condtions = (props) => {
|
|
14
14
|
const { columnName, condition, value, columnsArray, conditionsArray, index, id, setEnbleApply, updateconditionsArray, removeConditionFromArray, addEmptyCondition, condtionslenght, conditionType, conditionTypes, handleConditionType } = props;
|
|
15
|
-
// const [columnState, setColumnState] = useState(columnName);
|
|
16
|
-
// const [condtionState, setConditionState] = useState(condition);
|
|
17
|
-
// const [dynamicFieldState, setDynamicFieldState] = useState(value);
|
|
18
|
-
// useEffect(() => {
|
|
19
|
-
// setColumnState(columnName);
|
|
20
|
-
// setConditionState(condition);
|
|
21
|
-
// setDynamicFieldState(value);
|
|
22
|
-
// }, [columnName, condition, value]);
|
|
23
15
|
const onAddCondtion = (index) => {
|
|
24
16
|
addEmptyCondition(index);
|
|
25
17
|
};
|
|
@@ -4,9 +4,8 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const checkbox_1 = require("primereact/checkbox");
|
|
6
6
|
const svg_component_1 = tslib_1.__importDefault(require("../../directives/svg-component"));
|
|
7
|
-
const GridCheckBOx = ({ checked, onChange,
|
|
8
|
-
|
|
9
|
-
return ((0, jsx_runtime_1.jsx)(checkbox_1.Checkbox, { icon: isInterminate && (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "minus-square" }), onChange: onChange, checked: checked, className: "" })
|
|
7
|
+
const GridCheckBOx = ({ checked, onChange, isIndeterminate }) => {
|
|
8
|
+
return ((0, jsx_runtime_1.jsx)(checkbox_1.Checkbox, { icon: isIndeterminate && (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "minus-square" }), onChange: onChange, checked: checked, className: "" })
|
|
10
9
|
// <input
|
|
11
10
|
// type="checkbox"
|
|
12
11
|
// checked={checked}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
function LoadingComponent() {
|
|
5
|
+
return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("p", Object.assign({ className: "text-red" }, { children: "...Loading" })) }));
|
|
6
|
+
}
|
|
7
|
+
exports.default = LoadingComponent;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import "ag-grid-community/styles/ag-grid.css";
|
|
2
2
|
import "ag-grid-community/styles/ag-theme-quartz.css";
|
|
3
|
-
declare const AgGrid: ({ style, gridOptions, onGridReady }: {
|
|
3
|
+
declare const AgGrid: ({ style, gridOptions, onGridReady, gridRef }: {
|
|
4
4
|
style: any;
|
|
5
5
|
gridOptions: any;
|
|
6
6
|
onGridReady: any;
|
|
7
|
+
gridRef: any;
|
|
7
8
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
export default AgGrid;
|
|
@@ -64,9 +64,9 @@ export interface ParentProp {
|
|
|
64
64
|
}
|
|
65
65
|
export interface CheckBoxSelection {
|
|
66
66
|
allBoxChecked: boolean;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
isIndeterminate: boolean;
|
|
68
|
+
includedRecords: any[];
|
|
69
|
+
excludedRecords: any[];
|
|
70
70
|
}
|
|
71
71
|
export declare enum ATTRIBUTEDATATYPES {
|
|
72
72
|
STRING = "string",
|
package/package.json
CHANGED
|
@@ -1,179 +0,0 @@
|
|
|
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 react_1 = require("react");
|
|
6
|
-
const ParentForGrid_1 = tslib_1.__importDefault(require("../../components/ag-grid/ParentForGrid"));
|
|
7
|
-
const axios_1 = tslib_1.__importDefault(require("axios"));
|
|
8
|
-
const Types_1 = require("../../components/ag-grid/Types");
|
|
9
|
-
// import IdCell from "./id-cell";
|
|
10
|
-
const constants_1 = require("../../components/ag-grid/constants");
|
|
11
|
-
// import { Dropdown } from "primereact/dropdown";
|
|
12
|
-
const CustomDropDown_1 = tslib_1.__importDefault(require("../../components/ag-grid/CustomDropDown"));
|
|
13
|
-
const BulkAction_1 = tslib_1.__importDefault(require("./BulkAction"));
|
|
14
|
-
// import { ATTRIBUTEDATATYPES } from "../../components/ag-grid/constants";
|
|
15
|
-
const AgGridPage = () => {
|
|
16
|
-
const [rowData, setRowData] = (0, react_1.useState)([]);
|
|
17
|
-
const [shouldRefetch, setShouldRefetch] = (0, react_1.useState)(false);
|
|
18
|
-
const deleteComponent = () => {
|
|
19
|
-
return (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("button", Object.assign({ className: "bg-white", onClick: () => setShouldRefetch(true) }, { children: "Delete" })) });
|
|
20
|
-
};
|
|
21
|
-
const [columnDefs] = (0, react_1.useState)([
|
|
22
|
-
{
|
|
23
|
-
enableHeaderCheckbox: true,
|
|
24
|
-
enableChildCheckbox: true,
|
|
25
|
-
id: "101",
|
|
26
|
-
headerName: "ID",
|
|
27
|
-
field: "id",
|
|
28
|
-
isSortable: false,
|
|
29
|
-
code: 1,
|
|
30
|
-
dataType: Types_1.ATTRIBUTEDATATYPES.STRING,
|
|
31
|
-
editable: true,
|
|
32
|
-
cellRendererSelector: (params) => {
|
|
33
|
-
if (params.node.rowPinned) {
|
|
34
|
-
return {
|
|
35
|
-
component: dropDown,
|
|
36
|
-
params: {
|
|
37
|
-
style: { color: "#5577CC" },
|
|
38
|
-
},
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
// rows that are not pinned don't use any cell renderer
|
|
43
|
-
return undefined;
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
id: "102",
|
|
49
|
-
headerName: "Title",
|
|
50
|
-
cellRendererSelector: (params) => {
|
|
51
|
-
if (params.node.rowPinned) {
|
|
52
|
-
return {
|
|
53
|
-
component: CustomDropDown_1.default,
|
|
54
|
-
params: {
|
|
55
|
-
style: { color: "#5577CC" },
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
// rows that are not pinned don't use any cell renderer
|
|
61
|
-
return undefined;
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
field: "name",
|
|
65
|
-
isSortable: true,
|
|
66
|
-
code: 1,
|
|
67
|
-
dataType: Types_1.ATTRIBUTEDATATYPES.STRING,
|
|
68
|
-
editable: false,
|
|
69
|
-
// rowGroup:true
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
id: "103",
|
|
73
|
-
headerName: "Body",
|
|
74
|
-
field: "body",
|
|
75
|
-
isSortable: true,
|
|
76
|
-
code: 1,
|
|
77
|
-
dataType: Types_1.ATTRIBUTEDATATYPES.STRING,
|
|
78
|
-
editable: false,
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
cellRenderer: deleteComponent
|
|
82
|
-
}
|
|
83
|
-
// {
|
|
84
|
-
// field: "status",
|
|
85
|
-
// minWidth:200,
|
|
86
|
-
// cellRenderer: "statusCellRenderer",
|
|
87
|
-
// cellRendererParams:{onStatusChanged:onStatusChanged},
|
|
88
|
-
// cellRendererSelector:(params)=>{getSelectedDropDown(params)},
|
|
89
|
-
// editable:false
|
|
90
|
-
// },
|
|
91
|
-
]);
|
|
92
|
-
// const [selectedCity, setSelectedCity] = useState(null);
|
|
93
|
-
const dropDown = () => {
|
|
94
|
-
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "card flex justify-content-center" }, { children: (0, jsx_runtime_1.jsx)("p", { children: "My header" }) })));
|
|
95
|
-
};
|
|
96
|
-
console.log(dropDown, 'drop down');
|
|
97
|
-
const pinnedTopRowData = (0, react_1.useMemo)(() => {
|
|
98
|
-
return [
|
|
99
|
-
{ id: "1",
|
|
100
|
-
name: "nitesh",
|
|
101
|
-
body: "working out" }
|
|
102
|
-
];
|
|
103
|
-
}, []);
|
|
104
|
-
// Remove items from - button
|
|
105
|
-
const removeItem = (checkboxSelectionDetails) => {
|
|
106
|
-
const unSelectedData = checkboxSelectionDetails === null || checkboxSelectionDetails === void 0 ? void 0 : checkboxSelectionDetails.unselectedCheckboxData;
|
|
107
|
-
const selectedData = checkboxSelectionDetails === null || checkboxSelectionDetails === void 0 ? void 0 : checkboxSelectionDetails.selectedCheckboxData;
|
|
108
|
-
const isIternminite = checkboxSelectionDetails === null || checkboxSelectionDetails === void 0 ? void 0 : checkboxSelectionDetails.isInterminate;
|
|
109
|
-
console.log(checkboxSelectionDetails, 'coming in remove item products');
|
|
110
|
-
let updatedRowData = [];
|
|
111
|
-
if (isIternminite) {
|
|
112
|
-
updatedRowData = unSelectedData;
|
|
113
|
-
}
|
|
114
|
-
else if ((selectedData === null || selectedData === void 0 ? void 0 : selectedData.length) && !(isIternminite)) {
|
|
115
|
-
const childIds = new Set(selectedData === null || selectedData === void 0 ? void 0 : selectedData.map(child => child.id));
|
|
116
|
-
updatedRowData = rowData.filter(parent => !childIds.has(parent.id));
|
|
117
|
-
}
|
|
118
|
-
console.log(updatedRowData, 'result data from remove items in products');
|
|
119
|
-
return updatedRowData;
|
|
120
|
-
};
|
|
121
|
-
const getCheckedRows = (checkedRows) => {
|
|
122
|
-
console.log(checkedRows, 'checked rows in products');
|
|
123
|
-
};
|
|
124
|
-
const getRowData = (startRow, endRow, featureDetails) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
125
|
-
const features = featureDetails;
|
|
126
|
-
console.log('coming in product', features, startRow, endRow);
|
|
127
|
-
// const conditionToRemoveItem = features.checkBoxSelection.allBoxChecked || features.checkBoxSelection.isInterminate || features.checkBoxSelection.selectedCheckboxData.length || features.checkBoxSelection.unselectedCheckboxData.length
|
|
128
|
-
if (featureDetails.isRemoveClicked) {
|
|
129
|
-
const result = removeItem(features.checkBoxSelection);
|
|
130
|
-
const output = {
|
|
131
|
-
totalRecords: result.length,
|
|
132
|
-
rowData: result
|
|
133
|
-
};
|
|
134
|
-
console.log(output, 'output sending to ag grid');
|
|
135
|
-
return yield output;
|
|
136
|
-
}
|
|
137
|
-
console.log(startRow, endRow, featureDetails, 'params in call back ');
|
|
138
|
-
let totalRecords = 500;
|
|
139
|
-
const serverSideUrl = `https://jsonplaceholder.typicode.com/comments?_start=${startRow}&_end=${endRow}`;
|
|
140
|
-
const clientSideUrl = "https://jsonplaceholder.typicode.com/comments?_limit=20";
|
|
141
|
-
console.log(serverSideUrl, clientSideUrl);
|
|
142
|
-
const result = yield axios_1.default.get(clientSideUrl);
|
|
143
|
-
console.log(result, 'result from api');
|
|
144
|
-
const output = {
|
|
145
|
-
totalRecords: totalRecords,
|
|
146
|
-
rowData: result.data
|
|
147
|
-
};
|
|
148
|
-
setRowData(result.data);
|
|
149
|
-
console.log(rowData);
|
|
150
|
-
setShouldRefetch(false);
|
|
151
|
-
return output;
|
|
152
|
-
});
|
|
153
|
-
const style = {
|
|
154
|
-
height: 700,
|
|
155
|
-
width: 1020
|
|
156
|
-
};
|
|
157
|
-
const myInputData = (params) => {
|
|
158
|
-
console.log(params);
|
|
159
|
-
let optionObject = [
|
|
160
|
-
{ id: '123', label: 'test label 1', value: '123' },
|
|
161
|
-
{ id: '1234', label: 'test label 2', value: '1234' },
|
|
162
|
-
{ id: '1235', label: 'test label 3', value: '1235' },
|
|
163
|
-
{ id: '12356', label: 'test label 4', value: '1235' }
|
|
164
|
-
];
|
|
165
|
-
return optionObject;
|
|
166
|
-
};
|
|
167
|
-
const conditionsToDisplay = {
|
|
168
|
-
displayFilter: true,
|
|
169
|
-
displaySort: true,
|
|
170
|
-
displaySearch: true,
|
|
171
|
-
displayRefresh: true,
|
|
172
|
-
displayRemoveItems: true,
|
|
173
|
-
displayBulkAction: true
|
|
174
|
-
};
|
|
175
|
-
console.log(pinnedTopRowData);
|
|
176
|
-
console.log('clicked my component');
|
|
177
|
-
return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(ParentForGrid_1.default, { columnData: columnDefs, style: style, getRowData: getRowData, dataForDropDown: myInputData, conditionsToDisplay: conditionsToDisplay, rowModelType: constants_1.ROWMODELTYPE.CLIENT_SIDE, pinnedTopRowData: pinnedTopRowData, bulkActionComponent: BulkAction_1.default, getCheckedRows: getCheckedRows, shouldRefetch: shouldRefetch }) }));
|
|
178
|
-
};
|
|
179
|
-
exports.default = AgGridPage;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
-
function BulkAction(props) {
|
|
5
|
-
console.log(props === null || props === void 0 ? void 0 : props.checkBoxSelection, 'props in bulk action');
|
|
6
|
-
return ((0, jsx_runtime_1.jsx)("div", { children: "BulkAction" }));
|
|
7
|
-
}
|
|
8
|
-
exports.default = BulkAction;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
-
function IdCell(data) {
|
|
5
|
-
var _a;
|
|
6
|
-
console.log(data.row, 'data from grid');
|
|
7
|
-
return ((0, jsx_runtime_1.jsx)("div", { children: (_a = data.row) === null || _a === void 0 ? void 0 : _a.id }));
|
|
8
|
-
}
|
|
9
|
-
exports.default = IdCell;
|