sccoreui 6.1.69 → 6.1.71

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.
@@ -105,8 +105,8 @@ function ParentForGrid(props) {
105
105
  };
106
106
  // JSX for rendering checkbox in header
107
107
  const headerCheckBoxRenderer = (headerDisplayName, HeaderComponent) => {
108
- var _a, _b, _c, _d;
109
- 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) ? "w-full pd-r-2" : ""}` }, { 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, shouldRenderOnRight: (_c = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _c === void 0 ? void 0 : _c.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, shouldRenderOnRight: (_d = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _d === void 0 ? void 0 : _d.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 }))] })) })));
108
+ var _a, _b, _c, _d, _e, _f;
109
+ 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) ? "w-full pd-r-2" : ""}` }, { 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 && (((_d = (_c = featureDetails.checkBoxSelection) === null || _c === void 0 ? void 0 : _c.excludedRecords) === null || _d === void 0 ? void 0 : _d.length) > 0 ? true : 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, shouldRenderOnRight: (_f = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _f === void 0 ? void 0 : _f.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 }))] })) })));
110
110
  };
111
111
  // JSX for rendering checkbox in cells
112
112
  const cellCheckBoxRenderer = (params) => {
@@ -216,9 +216,30 @@ function ParentForGrid(props) {
216
216
  var _a, _b, _c;
217
217
  return (_b = (_a = fillOperationParams === null || fillOperationParams === void 0 ? void 0 : fillOperationParams.rowNode) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b[(_c = fillOperationParams === null || fillOperationParams === void 0 ? void 0 : fillOperationParams.column) === null || _c === void 0 ? void 0 : _c.colId];
218
218
  };
219
+ // Reference to get the data for tree grid
219
220
  const getDataPath = (0, react_1.useCallback)((data) => {
220
221
  return data.orgHierarchy;
221
222
  }, []);
223
+ // Render group child conditionally with/without checkbox
224
+ const RenderGroupChild = () => {
225
+ // Cell renderer with checkbox
226
+ const cellRendererConditionally = (params) => {
227
+ var _a, _b;
228
+ if ((_a = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _a === void 0 ? void 0 : _a.displayCheckboxForGroupChild) {
229
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { 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" }, { children: [props === null || props === void 0 ? void 0 : props.ChildComponentForGroup(), cellCheckBoxRenderer(params)] }))) : ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center justify-content-between" }, { children: [cellCheckBoxRenderer(params), props === null || props === void 0 ? void 0 : props.ChildComponentForGroup(params)] }))) }));
230
+ }
231
+ else {
232
+ return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: props === null || props === void 0 ? void 0 : props.ChildComponentForGroup(params) });
233
+ }
234
+ };
235
+ // Group default values
236
+ return (0, helper_1.autoGroupColumnDef)((props === null || props === void 0 ? void 0 : props.enableTree) ? true : false, // If tree enable
237
+ props === null || props === void 0 ? void 0 : props.treeHeaderName, // Tree header name
238
+ props === null || props === void 0 ? void 0 : props.groupField, // Group field
239
+ props === null || props === void 0 ? void 0 : props.GroupHeaderComponent, // Header component
240
+ headerCheckBoxRenderer, //
241
+ props === null || props === void 0 ? void 0 : props.enableCheckboxForGroupHeader, cellRendererConditionally);
242
+ };
222
243
  // Options that grid should have
223
244
  const gridOptions = {
224
245
  columnDefs: gridData.columnData.map((column) => {
@@ -233,7 +254,7 @@ function ParentForGrid(props) {
233
254
  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() });
234
255
  }
235
256
  }),
236
- 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, props === null || props === void 0 ? void 0 : props.ChildComponentForGroup),
257
+ autoGroupColumnDef: RenderGroupChild(),
237
258
  treeData: (props === null || props === void 0 ? void 0 : props.enableTree) ? props === null || props === void 0 ? void 0 : props.enableTree : false,
238
259
  getDataPath: (props === null || props === void 0 ? void 0 : props.enableTree) ? getDataPath : null,
239
260
  defaultColDef: defaultColDef,
@@ -257,7 +278,7 @@ function ParentForGrid(props) {
257
278
  onFillEnd: wrapperToFillOpertation,
258
279
  fillOperation: myOpertaion,
259
280
  getRowId: getRowId,
260
- fillHandleDirection: 'y'
281
+ fillHandleDirection: "y",
261
282
  };
262
283
  // Fucntion to call the grid
263
284
  const callGrid = (featureDetails) => {
@@ -95,6 +95,7 @@ export interface ConditionsToDisplay {
95
95
  displayEditHeading?: boolean;
96
96
  displayFeaturesHeader?: boolean;
97
97
  displayCheckboxOnRight?: boolean;
98
+ displayCheckboxForGroupChild?: boolean;
98
99
  }
99
100
  export interface PropsFromProduct {
100
101
  columnData: ColumnDef[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sccoreui",
3
- "version": "6.1.69",
3
+ "version": "6.1.71",
4
4
  "description": "ui-sccore",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",