sccoreui 6.1.19 → 6.1.20

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.
@@ -14,8 +14,7 @@ const hide_column_1 = tslib_1.__importDefault(require("./hide-column"));
14
14
  function AdvancedFeatures({ props }) {
15
15
  const { featureDetails } = (0, react_1.useContext)(context_provider_1.FeatureContext);
16
16
  const conditionsToDisplay = props === null || props === void 0 ? void 0 : props.conditionsToDisplay;
17
- const { bulkActionComponent: BulkAction, BulkEditComponent: BulkEdit, discardEditComponent: DiscardEdit, SaveEdit: SaveChanges } = props;
18
- return ((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: [(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 })), (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayFilter) && (0, jsx_runtime_1.jsx)(table_filter_1.default, {})] })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center gap-3" }, { children: [(conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displaySidePanel) && (0, jsx_runtime_1.jsx)(hide_column_1.default, {}), (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayRemoveItems) && (0, jsx_runtime_1.jsx)(remove_items_1.default, {}), (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayBulkEdit) && (props === null || props === void 0 ? void 0 : props.BulkEditComponent) && (0, jsx_runtime_1.jsx)(BulkEdit, {}), (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayDiscardEdit) && (props === null || props === void 0 ? void 0 : props.discardEditComponent) && (0, jsx_runtime_1.jsx)(DiscardEdit, {}), (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayBulkAction) &&
19
- (props === null || props === void 0 ? void 0 : props.bulkActionComponent) && ((0, jsx_runtime_1.jsx)(BulkAction, { checkBoxSelection: featureDetails.checkBoxSelection })), (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displaySaveEditButton) && (props === null || props === void 0 ? void 0 : props.SaveEdit) && (0, jsx_runtime_1.jsx)(SaveChanges, {}), (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayRefresh) && (0, jsx_runtime_1.jsx)(refresh_grid_1.default, {}), (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displaySort) && (0, jsx_runtime_1.jsx)(custom_sort_1.default, {}), (0, jsx_runtime_1.jsx)(record_detail_1.default, {})] }))] })));
17
+ const { bulkActionComponent: BulkAction, BulkEditComponent: BulkEdit, discardEditComponent: DiscardEdit, SaveEdit: SaveChanges, EditHeadingDetails: EditDetails } = props;
18
+ 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: (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayEditHeading) && (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: (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 })) })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center gap-3" }, { children: [(conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displaySidePanel) && (0, jsx_runtime_1.jsx)(hide_column_1.default, {}), (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayBulkEdit) && (props === null || props === void 0 ? void 0 : props.BulkEditComponent) && (0, jsx_runtime_1.jsx)(BulkEdit, {}), (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayDiscardEdit) && (props === null || props === void 0 ? void 0 : props.discardEditComponent) && (0, jsx_runtime_1.jsx)(DiscardEdit, {}), (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displaySaveEditButton) && (props === null || props === void 0 ? void 0 : props.SaveEdit) && ((0, jsx_runtime_1.jsx)(SaveChanges, {}))] }))] }))) : ((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: [(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 })), (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayFilter) && (0, jsx_runtime_1.jsx)(table_filter_1.default, {})] })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center gap-3" }, { children: [(conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displaySidePanel) && (0, jsx_runtime_1.jsx)(hide_column_1.default, {}), (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayRemoveItems) && (0, jsx_runtime_1.jsx)(remove_items_1.default, {}), (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayBulkEdit) && (props === null || props === void 0 ? void 0 : props.BulkEditComponent) && (0, jsx_runtime_1.jsx)(BulkEdit, {}), (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayBulkAction) && (props === null || props === void 0 ? void 0 : props.bulkActionComponent) && ((0, jsx_runtime_1.jsx)(BulkAction, { checkBoxSelection: featureDetails.checkBoxSelection })), (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayRefresh) && (0, jsx_runtime_1.jsx)(refresh_grid_1.default, {}), (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displaySort) && (0, jsx_runtime_1.jsx)(custom_sort_1.default, {}), (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayRecords) && (0, jsx_runtime_1.jsx)(record_detail_1.default, {})] }))] }))) }));
20
19
  }
21
20
  exports.default = AdvancedFeatures;
@@ -79,29 +79,12 @@ const updateCells = (updatedRowData, setUpdateRowData, api) => {
79
79
  };
80
80
  exports.updateCells = updateCells;
81
81
  // Fill data in grid through drag
82
- const fillOperation = (params, api, callBack, parentRowData, editedRecords, setEditedRecords) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
82
+ const fillOperation = (params, api, parentRowData, editedRecords, setEditedRecords) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
83
83
  const { finalRange } = params;
84
84
  const { startRow, endRow, columns,
85
85
  // startColumn
86
86
  } = finalRange;
87
87
  const columnDetails = columns[0].colDef;
88
- // const selectedColumn: ColumnDef = startColumn?.userProvidedColDef || columnDetails;
89
- // console.log(selectedColumn)
90
- const handleError = () => {
91
- alert("Sorry, cannot update for now");
92
- };
93
- // const rangeDetails: RangeDetails = {
94
- // parentRowData: parentRowData,
95
- // selectedColumn: selectedColumn,
96
- // childIds:getChildRowIds(startRow.rowIndex,endRow.rowIndex,api,parentRowData.id)
97
- // };
98
- if (!callBack) {
99
- return handleError();
100
- }
101
- // Get updated rows
102
- // const getResponse = await callBack(rangeDetails);
103
- // // Throw error if not success
104
- // if (!getResponse.isSuccess) return handleError();
105
88
  // Get current updated rows
106
89
  const currentUpdatedRows = [];
107
90
  // Collect all selected rows
@@ -157,20 +140,3 @@ const mergeArrays = (currentUpdatedRows, updatedRecords) => {
157
140
  // Convert map back to array
158
141
  return Array.from(mergedMap.values());
159
142
  };
160
- // // Give child ids for fill update
161
- // const getChildRowIds = (startIndex,endIndex,api,parentId) => {
162
- // const ids = [];
163
- // if (!(startIndex >= 0) || !(endIndex > 0)) {
164
- // return [];
165
- // }
166
- // for (let i = startIndex; i <= endIndex; i++) {
167
- // // Get the row node
168
- // const rowNode = api.getDisplayedRowAtIndex(i);
169
- // if (!rowNode) continue; // Skip if rowNode is undefined
170
- // const rowData = rowNode?.data;
171
- // if (rowData.id && rowData.id !== parentId) {
172
- // ids.push(rowData.id);
173
- // }
174
- // }
175
- // return ids;
176
- // };
@@ -233,7 +233,7 @@ function ParentForGrid(props) {
233
233
  };
234
234
  // Update cell from front end and give a call back to products
235
235
  const wrapperToFillOpertation = (params) => {
236
- (0, helper_1.fillOperation)(params, api, props === null || props === void 0 ? void 0 : props.updateCell, initalDragRowData, props === null || props === void 0 ? void 0 : props.editedRecords, props === null || props === void 0 ? void 0 : props.setEditedRecords);
236
+ (0, helper_1.fillOperation)(params, api, initalDragRowData, props === null || props === void 0 ? void 0 : props.editedRecords, props === null || props === void 0 ? void 0 : props.setEditedRecords);
237
237
  };
238
238
  // const returnRenderColumn = useCallback(() => {
239
239
  // let columnToReturn: ColumnDef[] = [];
@@ -281,7 +281,8 @@ function ParentForGrid(props) {
281
281
  enableFillHandle: (_b = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _b === void 0 ? void 0 : _b.enableFillHandle,
282
282
  onFillEnd: wrapperToFillOpertation,
283
283
  onCellMouseDown: onCellMouseDown,
284
- getRowId: getRowId // Assing ids for grid to identify uniquely in server side
284
+ getRowId: getRowId,
285
+ fillHandleDirection: 'y'
285
286
  };
286
287
  // Fucntion to call the grid
287
288
  const callGrid = (featureDetails) => {
@@ -338,6 +339,11 @@ function ParentForGrid(props) {
338
339
  const reOrderedColumns = updatedColumnDefs.sort((a, b) => a.seq - b.seq);
339
340
  gridRef.current.api.setGridOption("columnDefs", reOrderedColumns);
340
341
  }, [props === null || props === void 0 ? void 0 : props.columnData]);
342
+ (0, react_1.useEffect)(() => {
343
+ if (props === null || props === void 0 ? void 0 : props.emptyCheckboxStatus) {
344
+ setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: initialCheckBoxData }));
345
+ }
346
+ }, [props === null || props === void 0 ? void 0 : props.emptyCheckboxStatus]);
341
347
  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({ style: { height: style.height, width: style.width }, className: "ag-grid-container border-1 border-gray-200 border-round" }, { children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(context_provider_1.default, Object.assign({ value: {
342
348
  featureDetails,
343
349
  setFeatureDetails,
@@ -1,5 +1,6 @@
1
1
  import { ColDef } from "@ag-grid-community/core";
2
2
  import { GRID_CHECKBOX_STATUS } from "./constants";
3
+ import React from "react";
3
4
  export interface ColumnDef extends ColDef {
4
5
  id: string;
5
6
  dataType: any;
@@ -89,6 +90,7 @@ export interface ConditionsToDisplay {
89
90
  displaySearch?: boolean;
90
91
  displayRefresh?: boolean;
91
92
  displayRemoveItems?: boolean;
93
+ displayRecords?: boolean;
92
94
  displayGrouping?: boolean;
93
95
  displayColumnHide?: boolean;
94
96
  displayBulkAction?: boolean;
@@ -98,6 +100,7 @@ export interface ConditionsToDisplay {
98
100
  displayBulkEdit?: boolean;
99
101
  displayDiscardEdit?: boolean;
100
102
  displaySaveEditButton?: boolean;
103
+ displayEditHeading?: boolean;
101
104
  }
102
105
  export interface PropsFromProduct {
103
106
  columnData: ColumnDef[];
@@ -109,13 +112,22 @@ export interface PropsFromProduct {
109
112
  rowModelType?: string;
110
113
  getCheckedRows?: () => void;
111
114
  shouldRefetch?: boolean;
112
- noRowsOverlayComponent?: React.FC;
115
+ defaultFilters?: any[];
116
+ noRowsOverlayComponent?: React.Component;
113
117
  createView?: () => void;
114
118
  dynamicText?: DynamicText;
115
119
  sortOptions?: any[];
116
120
  filterConditions?: FilterCondition[];
117
121
  clearFilters?: Boolean;
118
122
  updateColumnsForGrid?: (columns: ColumnDef) => void;
123
+ BulkEditComponent?: React.Component;
124
+ editMode?: boolean;
125
+ discardEditComponent?: React.Component;
126
+ SaveEdit?: React.Component;
127
+ setEditedRecords?: () => void;
128
+ editedRecords?: any[];
129
+ emptyCheckboxStatus?: boolean;
130
+ EditHeadingDetails?: React.Component;
119
131
  }
120
132
  export interface ResoponseFromCallback {
121
133
  totalRecords: number;
@@ -3,4 +3,4 @@ export declare const parseIfNeeded: (value: any) => any;
3
3
  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
- export declare const fillOperation: (params: any, api: any, callBack: any, parentRowData: any, editedRecords: any, setEditedRecords: any) => Promise<void>;
6
+ export declare const fillOperation: (params: any, api: any, parentRowData: any, editedRecords: any, setEditedRecords: any) => Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sccoreui",
3
- "version": "6.1.19",
3
+ "version": "6.1.20",
4
4
  "description": "ui-sccore",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",