sccoreui 6.1.54 → 6.1.55

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.
@@ -159,7 +159,7 @@ const mergeArrays = (currentUpdatedRows, updatedRecords) => {
159
159
  // Convert map back to array
160
160
  return Array.from(mergedMap.values());
161
161
  };
162
- const autoGroupColumnDef = (isTreeEnable, headerName, groupField, GroupHeaderComponent) => {
162
+ const autoGroupColumnDef = (isTreeEnable, headerName, groupField, GroupHeaderComponent, headerCheckboxRenderer, enableCheckboxForGroupHeader) => {
163
163
  if (isTreeEnable) {
164
164
  return {
165
165
  headerName: headerName ? headerName : "Group",
@@ -173,7 +173,7 @@ const autoGroupColumnDef = (isTreeEnable, headerName, groupField, GroupHeaderCom
173
173
  else {
174
174
  return {
175
175
  field: groupField || "group",
176
- headerComponent: GroupHeaderComponent,
176
+ headerComponent: enableCheckboxForGroupHeader ? () => headerCheckboxRenderer("", GroupHeaderComponent) : GroupHeaderComponent,
177
177
  cellRenderer: "agGroupCellRenderer",
178
178
  cellRendererParams: {
179
179
  suppressCount: true,
@@ -105,10 +105,8 @@ function ParentForGrid(props) {
105
105
  setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: checkboxData }));
106
106
  };
107
107
  // JSX for rendering checkbox in header
108
- const headerCheckBoxRenderer = (params, column) => {
109
- const displayName = params === null || params === void 0 ? void 0 : params.displayName;
110
- const HeaderComponent = column === null || column === void 0 ? void 0 : column.headerComponent;
111
- return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center " }, { children: [(0, jsx_runtime_1.jsx)(grid_checkbox_1.default, { checked: featureDetails.checkBoxSelection.allBoxChecked, onChange: handleHeaderCheckbox, isIndeterminate: featureDetails.checkBoxSelection.isIndeterminate }), 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", Object.assign({ className: "px-3" }, { children: displayName }))] })));
108
+ const headerCheckBoxRenderer = (headerDisplayName, HeaderComponent) => {
109
+ return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center " }, { children: [(0, jsx_runtime_1.jsx)(grid_checkbox_1.default, { checked: featureDetails.checkBoxSelection.allBoxChecked, onChange: handleHeaderCheckbox, isIndeterminate: featureDetails.checkBoxSelection.isIndeterminate }), 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", Object.assign({ className: "px-3" }, { children: headerDisplayName }))] })));
112
110
  };
113
111
  // JSX for rendering checkbox in cells
114
112
  const cellCheckBoxRenderer = (params) => {
@@ -232,7 +230,7 @@ function ParentForGrid(props) {
232
230
  columnDefs: gridData.columnData.map((column) => {
233
231
  var _a, _b;
234
232
  if (column.enableChildCheckbox && column.enableHeaderCheckbox) {
235
- return Object.assign(Object.assign({}, column), { headerComponent: (params) => headerCheckBoxRenderer(params, column), cellRenderer: (params) => dataCellRenderer(params, column), headerName: (_a = column === null || column === void 0 ? void 0 : column.headerName) === null || _a === void 0 ? void 0 : _a.toUpperCase(), cellRendererParams: {
233
+ 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) => dataCellRenderer(params, column), headerName: (_a = column === null || column === void 0 ? void 0 : column.headerName) === null || _a === void 0 ? void 0 : _a.toUpperCase(), cellRendererParams: {
236
234
  initialRenderer: (column === null || column === void 0 ? void 0 : column.cellRenderer) ? column === null || column === void 0 ? void 0 : column.cellRenderer : null,
237
235
  cellCheckBoxRenderer: cellCheckBoxRenderer,
238
236
  } });
@@ -241,7 +239,7 @@ function ParentForGrid(props) {
241
239
  return Object.assign(Object.assign({}, column), { headerName: (_b = column === null || column === void 0 ? void 0 : column.headerName) === null || _b === void 0 ? void 0 : _b.toUpperCase() });
242
240
  }
243
241
  }),
244
- autoGroupColumnDef: (0, helper_1.autoGroupColumnDef)((props === null || props === void 0 ? void 0 : props.enableTree) ? true : false, props === null || props === void 0 ? void 0 : props.treeHeaderName, props === null || props === void 0 ? void 0 : props.groupField, props === null || props === void 0 ? void 0 : props.GroupHeaderComponent),
242
+ autoGroupColumnDef: (0, helper_1.autoGroupColumnDef)((props === null || props === void 0 ? void 0 : props.enableTree) ? true : false, props === null || props === void 0 ? void 0 : props.treeHeaderName, props === null || props === void 0 ? void 0 : props.groupField, props === null || props === void 0 ? void 0 : props.GroupHeaderComponent, headerCheckBoxRenderer, props === null || props === void 0 ? void 0 : props.enableCheckboxForGroupHeader),
245
243
  treeData: (props === null || props === void 0 ? void 0 : props.enableTree) ? props === null || props === void 0 ? void 0 : props.enableTree : false,
246
244
  getDataPath: (props === null || props === void 0 ? void 0 : props.enableTree) ? getDataPath : null,
247
245
  defaultColDef: defaultColDef,
@@ -128,6 +128,7 @@ export interface PropsFromProduct {
128
128
  saveBulkEdit?: () => void;
129
129
  groupField?: string;
130
130
  GroupHeaderComponent?: React.FC;
131
+ enableCheckboxForGroupHeader?: boolean;
131
132
  }
132
133
  export interface ResoponseFromCallback {
133
134
  totalRecords: number;
@@ -4,7 +4,7 @@ export declare const sortColumns: (columns: any) => any;
4
4
  export declare const getCheckedStatus: (row: any, featureDetails: any, GRID_CHECKBOX_STATUS: any, setFeatureDetails: any) => any;
5
5
  export declare const updateCells: (updatedRowData: any, setUpdateRowData: any, api: any) => void;
6
6
  export declare const fillOperation: (params: any, api: any, parentNode: any, editedRecords: any, setEditedRecords: any) => Promise<void>;
7
- export declare const autoGroupColumnDef: (isTreeEnable: any, headerName: any, groupField: any, GroupHeaderComponent: any) => {
7
+ export declare const autoGroupColumnDef: (isTreeEnable: any, headerName: any, groupField: any, GroupHeaderComponent: any, headerCheckboxRenderer: any, enableCheckboxForGroupHeader: any) => {
8
8
  headerName: any;
9
9
  minWidth: number;
10
10
  cellRendererParams: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sccoreui",
3
- "version": "6.1.54",
3
+ "version": "6.1.55",
4
4
  "description": "ui-sccore",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",