sccoreui 6.4.43 → 6.4.44

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.
Files changed (130) hide show
  1. package/dist/components/ag-grid/advancedFeature/custom-sort.js +3 -2
  2. package/dist/components/ag-grid/advancedFeature/global-search.js +3 -5
  3. package/dist/components/ag-grid/advancedFeature/new-filter/table-filter.js +1 -15
  4. package/dist/components/ag-grid/constants.js +14 -6
  5. package/dist/components/ag-grid/context-provider.js +7 -1
  6. package/dist/components/ag-grid/helper.js +25 -20
  7. package/dist/components/ag-grid/parent-for-grid.js +19 -5
  8. package/dist/pages/RowGroupingServerside/DragandDropFeatures.js +49 -0
  9. package/dist/pages/RowGroupingServerside/RowGroupingServerSide.js +125 -0
  10. package/dist/pages/RowGroupingServerside/dummyData.js +226 -0
  11. package/dist/pages/VirtualScrollDropDown/VirtualScrollDropDown.js +9 -0
  12. package/dist/pages/aggrid/AgGrid.js +837 -0
  13. package/dist/pages/aggrid/BulkAction.js +9 -0
  14. package/dist/pages/aggrid/ProductGrid.js +73 -0
  15. package/dist/pages/aggrid/RowGroupTrail.js +125 -0
  16. package/dist/pages/aggrid/Template.js +11 -0
  17. package/dist/pages/aggrid/TestingWIthAdminConfig.js +254 -0
  18. package/dist/pages/aggrid/TestingWithAdminClientSide.js +605 -0
  19. package/dist/pages/aggrid/fakeServer.js +95 -0
  20. package/dist/pages/aggrid/id-cell.js +9 -0
  21. package/dist/pages/aggrid/interface.js +2 -0
  22. package/dist/pages/avatar/avatar.js +338 -0
  23. package/dist/pages/badges/badge.js +73 -0
  24. package/dist/pages/breadcrumb/breadcrumb.js +14 -0
  25. package/dist/pages/button/button.js +10 -0
  26. package/dist/pages/button-group/button-group.js +10 -0
  27. package/dist/pages/chart/chart.js +257 -0
  28. package/dist/pages/checkbox/checkbox.js +26 -0
  29. package/dist/pages/checkbox-group/checkbox-group-component.js +21 -0
  30. package/dist/pages/color-picker/color-picker.js +13 -0
  31. package/dist/pages/content-dividers/content-dividers.js +11 -0
  32. package/dist/pages/custom-color-picker/custom-color-picker.js +12 -0
  33. package/dist/pages/custom-multiselect/CustomMultiSelect.js +37 -0
  34. package/dist/pages/date-picker/date-picker.js +20 -0
  35. package/dist/pages/dropdown/dropdown-component.js +39 -0
  36. package/dist/pages/file-upload/file-upload.js +34 -0
  37. package/dist/pages/flex.js +15 -0
  38. package/dist/pages/formulaTemplate/formulaTemplate.js +105 -0
  39. package/dist/pages/frolaTextEditor/froala-text-editor.js +14 -0
  40. package/dist/pages/home.js +59 -0
  41. package/dist/pages/input/input-text.js +112 -0
  42. package/dist/pages/list-box-dropdown/listboxdropdown.js +98 -0
  43. package/dist/pages/loader-indicator/loader-indicator.js +10 -0
  44. package/dist/pages/mega-mennu/mega-menu.js +84 -0
  45. package/dist/pages/multi-select-dropdown/multi-select-dropdown.js +51 -0
  46. package/dist/pages/not-found/not-found.js +10 -0
  47. package/dist/pages/paginator/pagination.js +122 -0
  48. package/dist/pages/progress-bar/progress-bar.js +27 -0
  49. package/dist/pages/progress-steps/progress-steps.js +24 -0
  50. package/dist/pages/radio-button/radio-button-component.js +11 -0
  51. package/dist/pages/service.js +45 -0
  52. package/dist/pages/shadows/shadows.js +7 -0
  53. package/dist/pages/slideout-menus/slideout-menus.js +104 -0
  54. package/dist/pages/sliders/slider.js +39 -0
  55. package/dist/pages/tabels/table-data.js +2193 -0
  56. package/dist/pages/tabels/table.js +98 -0
  57. package/dist/pages/tabs/tabs.js +9 -0
  58. package/dist/pages/tags/tags.js +70 -0
  59. package/dist/pages/testingcomponents/NormalAgGrid.js +58 -0
  60. package/dist/pages/testingcomponents/TestComponent.js +69 -0
  61. package/dist/pages/testingcomponents/data.js +326 -0
  62. package/dist/pages/testingcomponents/fom-feild-testing/MainformComp.js +16 -0
  63. package/dist/pages/toast/toast.js +47 -0
  64. package/dist/pages/toggle/toggle.js +10 -0
  65. package/dist/pages/tooltip/tooltip.js +13 -0
  66. package/dist/pages/treeDropdownSelect/treedropdowselect.js +34 -0
  67. package/dist/pages/types/type.js +2 -0
  68. package/dist/types/components/ag-grid/constants.d.ts +1 -1
  69. package/dist/types/components/ag-grid/helper.d.ts +1 -1
  70. package/dist/types/pages/RowGroupingServerside/DragandDropFeatures.d.ts +4 -0
  71. package/dist/types/pages/RowGroupingServerside/RowGroupingServerSide.d.ts +4 -0
  72. package/dist/types/pages/RowGroupingServerside/dummyData.d.ts +9 -0
  73. package/dist/types/pages/VirtualScrollDropDown/VirtualScrollDropDown.d.ts +2 -0
  74. package/dist/types/pages/aggrid/AgGrid.d.ts +2 -0
  75. package/dist/types/pages/aggrid/BulkAction.d.ts +2 -0
  76. package/dist/types/pages/aggrid/ProductGrid.d.ts +2 -0
  77. package/dist/types/pages/aggrid/RowGroupTrail.d.ts +4 -0
  78. package/dist/types/pages/aggrid/Template.d.ts +2 -0
  79. package/dist/types/pages/aggrid/TestingWIthAdminConfig.d.ts +2 -0
  80. package/dist/types/pages/aggrid/TestingWithAdminClientSide.d.ts +2 -0
  81. package/dist/types/pages/aggrid/fakeServer.d.ts +7 -0
  82. package/dist/types/pages/aggrid/id-cell.d.ts +2 -0
  83. package/dist/types/pages/aggrid/interface.d.ts +12 -0
  84. package/dist/types/pages/avatar/avatar.d.ts +2 -0
  85. package/dist/types/pages/badges/badge.d.ts +3 -0
  86. package/dist/types/pages/breadcrumb/breadcrumb.d.ts +2 -0
  87. package/dist/types/pages/button/button.d.ts +2 -0
  88. package/dist/types/pages/button-group/button-group.d.ts +2 -0
  89. package/dist/types/pages/chart/chart.d.ts +2 -0
  90. package/dist/types/pages/checkbox/checkbox.d.ts +2 -0
  91. package/dist/types/pages/checkbox-group/checkbox-group-component.d.ts +3 -0
  92. package/dist/types/pages/color-picker/color-picker.d.ts +2 -0
  93. package/dist/types/pages/content-dividers/content-dividers.d.ts +2 -0
  94. package/dist/types/pages/custom-color-picker/custom-color-picker.d.ts +2 -0
  95. package/dist/types/pages/custom-multiselect/CustomMultiSelect.d.ts +2 -0
  96. package/dist/types/pages/date-picker/date-picker.d.ts +2 -0
  97. package/dist/types/pages/dropdown/dropdown-component.d.ts +2 -0
  98. package/dist/types/pages/file-upload/file-upload.d.ts +3 -0
  99. package/dist/types/pages/flex.d.ts +2 -0
  100. package/dist/types/pages/formulaTemplate/formulaTemplate.d.ts +2 -0
  101. package/dist/types/pages/frolaTextEditor/froala-text-editor.d.ts +2 -0
  102. package/dist/types/pages/home.d.ts +2 -0
  103. package/dist/types/pages/input/input-text.d.ts +3 -0
  104. package/dist/types/pages/list-box-dropdown/listboxdropdown.d.ts +2 -0
  105. package/dist/types/pages/loader-indicator/loader-indicator.d.ts +3 -0
  106. package/dist/types/pages/mega-mennu/mega-menu.d.ts +2 -0
  107. package/dist/types/pages/multi-select-dropdown/multi-select-dropdown.d.ts +2 -0
  108. package/dist/types/pages/not-found/not-found.d.ts +2 -0
  109. package/dist/types/pages/paginator/pagination.d.ts +2 -0
  110. package/dist/types/pages/progress-bar/progress-bar.d.ts +3 -0
  111. package/dist/types/pages/progress-steps/progress-steps.d.ts +2 -0
  112. package/dist/types/pages/radio-button/radio-button-component.d.ts +2 -0
  113. package/dist/types/pages/service.d.ts +5 -0
  114. package/dist/types/pages/shadows/shadows.d.ts +2 -0
  115. package/dist/types/pages/slideout-menus/slideout-menus.d.ts +2 -0
  116. package/dist/types/pages/sliders/slider.d.ts +1 -0
  117. package/dist/types/pages/tabels/table-data.d.ts +3 -0
  118. package/dist/types/pages/tabels/table.d.ts +2 -0
  119. package/dist/types/pages/tabs/tabs.d.ts +3 -0
  120. package/dist/types/pages/tags/tags.d.ts +3 -0
  121. package/dist/types/pages/testingcomponents/NormalAgGrid.d.ts +4 -0
  122. package/dist/types/pages/testingcomponents/TestComponent.d.ts +4 -0
  123. package/dist/types/pages/testingcomponents/data.d.ts +1 -0
  124. package/dist/types/pages/testingcomponents/fom-feild-testing/MainformComp.d.ts +2 -0
  125. package/dist/types/pages/toast/toast.d.ts +2 -0
  126. package/dist/types/pages/toggle/toggle.d.ts +2 -0
  127. package/dist/types/pages/tooltip/tooltip.d.ts +2 -0
  128. package/dist/types/pages/treeDropdownSelect/treedropdowselect.d.ts +2 -0
  129. package/dist/types/pages/types/type.d.ts +64 -0
  130. package/package.json +2 -2
@@ -12,6 +12,7 @@ const context_provider_1 = require("../context-provider");
12
12
  const helper_1 = require("../helper");
13
13
  const utilComponents_1 = require("../utilComponents");
14
14
  const FeatureSkeleton_1 = tslib_1.__importDefault(require("../../skeletons/FeatureSkeleton"));
15
+ const constants_1 = tslib_1.__importDefault(require("../constants"));
15
16
  function Sort() {
16
17
  var _a, _b;
17
18
  const { sortValue, setSortValue, sortBy, setSortBy, isOverlayOpened, setIsOverlayOpened, featureDetails, callGrid, columnData, sortModelText, sortOptions, conditionsToDisplay, } = (0, react_1.useContext)(context_provider_1.FeatureContext);
@@ -57,7 +58,7 @@ function Sort() {
57
58
  if (!((sortInfo === null || sortInfo === void 0 ? void 0 : sortInfo.isSortable) && (sortInfo === null || sortInfo === void 0 ? void 0 : sortInfo.columnToSort) && (sortInfo === null || sortInfo === void 0 ? void 0 : sortInfo.orderToSort))) {
58
59
  return;
59
60
  }
60
- const currentFeature = Object.assign({}, featureDetails);
61
+ const currentFeature = Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: constants_1.default.initialCheckBoxState });
61
62
  currentFeature.sort = sortInfo;
62
63
  return currentFeature;
63
64
  };
@@ -78,7 +79,7 @@ function Sort() {
78
79
  columnToSort: "",
79
80
  orderToSort: "",
80
81
  };
81
- const currentFeatureDetails = Object.assign({}, featureDetails);
82
+ const currentFeatureDetails = Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: constants_1.default.initialCheckBoxState });
82
83
  currentFeatureDetails.sort = sortDetails;
83
84
  callGrid(currentFeatureDetails);
84
85
  };
@@ -6,14 +6,12 @@ const inputtext_1 = require("primereact/inputtext");
6
6
  const svg_component_1 = tslib_1.__importDefault(require("../../../directives/svg-component"));
7
7
  const react_1 = require("react");
8
8
  const context_provider_1 = require("../context-provider");
9
- const hooks_1 = require("primereact/hooks");
10
- const constants_1 = require("../constants");
9
+ const constants_1 = tslib_1.__importStar(require("../constants"));
11
10
  const helper_1 = require("../helper");
12
11
  const utilComponents_1 = require("../utilComponents");
13
12
  const skeleton_1 = require("primereact/skeleton");
14
13
  function Search({ searchPlaceHolder }) {
15
- const { featureDetails, setFeatureDetails, rowModelType, gridApi, quickSearch, conditionsToDisplay, setGridViewData, gridView, } = (0, react_1.useContext)(context_provider_1.FeatureContext);
16
- const [inputValue, deboucedValue, setInputValue] = (0, hooks_1.useDebounce)("", 500);
14
+ const { featureDetails, setFeatureDetails, rowModelType, gridApi, quickSearch, conditionsToDisplay, setGridViewData, gridView, inputValue, deboucedValue, setInputValue } = (0, react_1.useContext)(context_provider_1.FeatureContext);
17
15
  const isDisabled = (0, helper_1.isComponentDisable)(conditionsToDisplay.displaySearch);
18
16
  (0, react_1.useEffect)(() => {
19
17
  var _a, _b, _c;
@@ -33,7 +31,7 @@ function Search({ searchPlaceHolder }) {
33
31
  }
34
32
  }
35
33
  else {
36
- setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { searchedText: deboucedValue }));
34
+ setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: constants_1.default.initialCheckBoxState, searchedText: deboucedValue }));
37
35
  }
38
36
  }, [deboucedValue]);
39
37
  return (0, utilComponents_1.skeletonLoding)() ? ((0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { height: "40px", width: "336px" })) : ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `p-input-icon-left ${inputValue.length > 0 ? "p-input-icon-right" : ""}` }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: "p-input-prefix zoom_animate" }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { color: "#667085", icon: "search-lg", size: 18, disabled: isDisabled }) })), inputValue.length > 0 && ((0, jsx_runtime_1.jsx)("span", Object.assign({ className: "p-input-suffix cursor-pointer zoom_animate", onClick: () => {
@@ -57,24 +57,10 @@ const TableFilter = () => {
57
57
  };
58
58
  return queryToAdd;
59
59
  });
60
- const requestFilters = allQueries.map((element) => {
61
- var _a, _b, _c, _d, _e;
62
- return ({
63
- fieldName: (_b = (_a = element === null || element === void 0 ? void 0 : element.selectedColumn) === null || _a === void 0 ? void 0 : _a.code) === null || _b === void 0 ? void 0 : _b.code,
64
- fieldValue: element === null || element === void 0 ? void 0 : element.value.toString(),
65
- conditionalOperator: element === null || element === void 0 ? void 0 : element.selectedOperation,
66
- logicalOperator: element.logicalOperator,
67
- attributeType: ((_d = (_c = element === null || element === void 0 ? void 0 : element.selectedColumn) === null || _c === void 0 ? void 0 : _c.code) === null || _d === void 0 ? void 0 : _d.attributeType)
68
- ? (_e = element === null || element === void 0 ? void 0 : element.selectedColumn) === null || _e === void 0 ? void 0 : _e.code.attributeType
69
- : 1,
70
- });
71
- });
72
60
  setGlobalFilters(array);
73
61
  const currentFeature = Object.assign({}, featureDetails);
74
62
  currentFeature.filterQueries = allQueries;
75
- setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { filterQueries: allQueries }));
76
- console.log("payload", requestFilters);
77
- // setConditionsArray(requestFilters);
63
+ setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: constants_1.default.initialCheckBoxState, filterQueries: allQueries }));
78
64
  callGrid(currentFeature);
79
65
  return [];
80
66
  };
@@ -415,6 +415,19 @@ const accessBasedOnDataType = [
415
415
  ];
416
416
  const defaultOptionValueColumn = { order: 1, labelName: "", value: "", upload: "", actions: "" };
417
417
  const columnSortTypes = [{ id: 1, label: "Low - High", sortId: 1, dataType: "integer" }, { id: 2, label: "High - Low", sortId: 2, dataType: "integer" }, { id: 3, label: "A - Z", sortId: 1, dataType: "string" }, { id: 4, label: "Z - A", sortId: 2, dataType: "string" }, { id: 5, sortId: 1, label: "Min -Max", dataType: "date" }, { id: 6, sortId: 2, label: "Max - Min", dataType: "date" }];
418
+ var GRID_CHECKBOX_STATUS;
419
+ (function (GRID_CHECKBOX_STATUS) {
420
+ GRID_CHECKBOX_STATUS[GRID_CHECKBOX_STATUS["NEUTRAL"] = 1] = "NEUTRAL";
421
+ GRID_CHECKBOX_STATUS[GRID_CHECKBOX_STATUS["CHECKED"] = 2] = "CHECKED";
422
+ GRID_CHECKBOX_STATUS[GRID_CHECKBOX_STATUS["UNCHECKED"] = 3] = "UNCHECKED";
423
+ })(GRID_CHECKBOX_STATUS = exports.GRID_CHECKBOX_STATUS || (exports.GRID_CHECKBOX_STATUS = {}));
424
+ const initialCheckBoxState = {
425
+ allBoxChecked: false,
426
+ isIndeterminate: false,
427
+ includedRecords: [],
428
+ excludedRecords: [],
429
+ headerCheckBoxStatus: GRID_CHECKBOX_STATUS.NEUTRAL,
430
+ };
418
431
  const constants = {
419
432
  maxCodeLength,
420
433
  maxNameLength,
@@ -424,12 +437,7 @@ const constants = {
424
437
  maxSortInputLength,
425
438
  accessBasedOnDataType,
426
439
  minSortInputLength,
440
+ initialCheckBoxState
427
441
  };
428
- var GRID_CHECKBOX_STATUS;
429
- (function (GRID_CHECKBOX_STATUS) {
430
- GRID_CHECKBOX_STATUS[GRID_CHECKBOX_STATUS["NEUTRAL"] = 1] = "NEUTRAL";
431
- GRID_CHECKBOX_STATUS[GRID_CHECKBOX_STATUS["CHECKED"] = 2] = "CHECKED";
432
- GRID_CHECKBOX_STATUS[GRID_CHECKBOX_STATUS["UNCHECKED"] = 3] = "UNCHECKED";
433
- })(GRID_CHECKBOX_STATUS = exports.GRID_CHECKBOX_STATUS || (exports.GRID_CHECKBOX_STATUS = {}));
434
442
  exports.EMPTY_RECORD = "--";
435
443
  exports.default = constants;
@@ -4,6 +4,7 @@ exports.FeatureContext = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const helper_1 = require("./helper");
7
+ const hooks_1 = require("primereact/hooks");
7
8
  exports.FeatureContext = (0, react_1.createContext)(null);
8
9
  function MyProvider({ children, value }) {
9
10
  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;
@@ -13,6 +14,7 @@ function MyProvider({ children, value }) {
13
14
  const [sortBy, setSortBy] = (0, react_1.useState)({});
14
15
  const [isOverlayOpened, setIsOverlayOpened] = (0, react_1.useState)(false);
15
16
  const [viewName, setViewName] = (0, react_1.useState)("");
17
+ const [inputValue, deboucedValue, setInputValue] = (0, hooks_1.useDebounce)("", 500);
16
18
  // States for filter
17
19
  const [queries, setQueries] = (0, react_1.useState)(() => {
18
20
  var _a;
@@ -42,6 +44,7 @@ function MyProvider({ children, value }) {
42
44
  setSortBy({});
43
45
  setSortValue({});
44
46
  callGrid(emptyFeatures);
47
+ setInputValue("");
45
48
  };
46
49
  (0, react_1.useEffect)(() => {
47
50
  if (defaultFilters.length) {
@@ -112,7 +115,10 @@ function MyProvider({ children, value }) {
112
115
  gridViewFun,
113
116
  gridViewData,
114
117
  setGridViewData,
115
- gridView
118
+ gridView,
119
+ inputValue,
120
+ deboucedValue,
121
+ setInputValue
116
122
  } }, { children: children })));
117
123
  }
118
124
  exports.default = MyProvider;
@@ -62,21 +62,22 @@ const sortColumns = (columns) => {
62
62
  };
63
63
  exports.sortColumns = sortColumns;
64
64
  // Give checkbox checked status
65
- const getCheckedStatus = (row, featureDetails, GRID_CHECKBOX_STATUS, setFeatureDetails) => {
65
+ const getCheckedStatus = (row, featureDetails, GRID_CHECKBOX_STATUS) => {
66
66
  const { allBoxChecked, excludedRecords, includedRecords, headerCheckBoxStatus, } = featureDetails.checkBoxSelection;
67
+ const isExcluded = excludedRecords.some(r => r.id === row.id);
68
+ const isIncluded = includedRecords.some(r => r.id === row.id);
67
69
  if (allBoxChecked) {
68
- return !excludedRecords.includes(row);
70
+ return !isExcluded;
69
71
  }
70
72
  else {
71
73
  if (headerCheckBoxStatus === GRID_CHECKBOX_STATUS.NEUTRAL &&
72
74
  (row === null || row === void 0 ? void 0 : row.isSelected)) {
73
- if (!includedRecords.includes(row)) {
74
- includedRecords.push(row);
75
- setFeatureDetails((prev) => (Object.assign(Object.assign({}, prev), { checkBoxSelection: Object.assign(Object.assign({}, prev.checkBoxSelection), { includedRecords: [...includedRecords] }) })));
75
+ if (!isIncluded) {
76
+ return !isExcluded;
76
77
  }
77
78
  return true;
78
79
  }
79
- return includedRecords.includes(row);
80
+ return isExcluded ? false : isIncluded;
80
81
  }
81
82
  };
82
83
  exports.getCheckedStatus = getCheckedStatus;
@@ -226,14 +227,14 @@ exports.autoGroupColumnDef = autoGroupColumnDef;
226
227
  // This function determines how to update `includedRecords` and `excludedRecords`
227
228
  // depending on whether all checkboxes are checked or not (`allBoxChecked` state)
228
229
  const updateRecords = (rowData, featureDetails, gridData) => {
229
- var _a, _b, _c;
230
+ var _a, _b;
230
231
  const { excludedRecords, includedRecords, allBoxChecked } = featureDetails.checkBoxSelection;
231
232
  let newExcludedRecords = [...excludedRecords];
232
233
  let newIncludedRecords = [...includedRecords];
233
234
  // When all checkboxes are checked
234
235
  if (allBoxChecked) {
235
236
  // Update excluded records: add or remove the current rowData
236
- newExcludedRecords = (excludedRecords === null || excludedRecords === void 0 ? void 0 : excludedRecords.includes(rowData))
237
+ newExcludedRecords = (excludedRecords === null || excludedRecords === void 0 ? void 0 : excludedRecords.some((x) => (x === null || x === void 0 ? void 0 : x.id) === (rowData === null || rowData === void 0 ? void 0 : rowData.id)))
237
238
  ? excludedRecords === null || excludedRecords === void 0 ? void 0 : excludedRecords.filter((item) => (item === null || item === void 0 ? void 0 : item.id) !== (rowData === null || rowData === void 0 ? void 0 : rowData.id))
238
239
  : [...excludedRecords, rowData];
239
240
  // Check if all records are excluded; reset if so
@@ -248,7 +249,7 @@ const updateRecords = (rowData, featureDetails, gridData) => {
248
249
  // When not all checkboxes are checked
249
250
  else {
250
251
  // Update included records: add or remove the current rowData
251
- newIncludedRecords = (includedRecords === null || includedRecords === void 0 ? void 0 : includedRecords.includes(rowData))
252
+ newIncludedRecords = (includedRecords === null || includedRecords === void 0 ? void 0 : includedRecords.some((x) => (x === null || x === void 0 ? void 0 : x.id) === (rowData === null || rowData === void 0 ? void 0 : rowData.id)))
252
253
  ? includedRecords === null || includedRecords === void 0 ? void 0 : includedRecords.filter((item) => {
253
254
  if ((item === null || item === void 0 ? void 0 : item.id) !== (rowData === null || rowData === void 0 ? void 0 : rowData.id)) {
254
255
  return item;
@@ -258,23 +259,27 @@ const updateRecords = (rowData, featureDetails, gridData) => {
258
259
  return false; // Exclude this item from the new array
259
260
  }
260
261
  })
261
- : [...includedRecords, rowData]; // Add rowData if it's not already included
262
+ : (rowData === null || rowData === void 0 ? void 0 : rowData.isSelected) ? [...includedRecords] : [...includedRecords, rowData]; // Add rowData if it's not already included
263
+ newExcludedRecords = (excludedRecords === null || excludedRecords === void 0 ? void 0 : excludedRecords.some((x) => (x === null || x === void 0 ? void 0 : x.id) === (rowData === null || rowData === void 0 ? void 0 : rowData.id)))
264
+ ? excludedRecords === null || excludedRecords === void 0 ? void 0 : excludedRecords.filter((item) => (item === null || item === void 0 ? void 0 : item.id) !== (rowData === null || rowData === void 0 ? void 0 : rowData.id))
265
+ : (rowData === null || rowData === void 0 ? void 0 : rowData.isSelected) ? [...excludedRecords, rowData] : excludedRecords;
262
266
  // Check if all records are included; reset if so
263
- if ((newIncludedRecords === null || newIncludedRecords === void 0 ? void 0 : newIncludedRecords.length) === ((_b = gridData === null || gridData === void 0 ? void 0 : gridData.rowData) === null || _b === void 0 ? void 0 : _b.length)) {
264
- return {
265
- excludedRecords: [],
266
- includedRecords: [],
267
- isIndeterminate: false,
268
- allBoxChecked: true,
269
- };
270
- }
267
+ // if (newIncludedRecords?.length === gridData?.rowData?.length) {
268
+ // return {
269
+ // ...featureDetails?.checkBoxSelection,
270
+ // excludedRecords: [],
271
+ // includedRecords: [],
272
+ // isIndeterminate: false,
273
+ // allBoxChecked: true,
274
+ // };
275
+ // }
271
276
  // Check if all records are excluded; reset if so
272
- else if ((newExcludedRecords === null || newExcludedRecords === void 0 ? void 0 : newExcludedRecords.length) === ((_c = gridData === null || gridData === void 0 ? void 0 : gridData.rowData) === null || _c === void 0 ? void 0 : _c.length)) {
277
+ if ((newExcludedRecords === null || newExcludedRecords === void 0 ? void 0 : newExcludedRecords.length) === ((_b = gridData === null || gridData === void 0 ? void 0 : gridData.rowData) === null || _b === void 0 ? void 0 : _b.length)) {
273
278
  return exports.initialCheckBoxData;
274
279
  }
275
280
  // Otherwise, update the included records
276
281
  else {
277
- return Object.assign(Object.assign({}, featureDetails === null || featureDetails === void 0 ? void 0 : featureDetails.checkBoxSelection), { includedRecords: newIncludedRecords });
282
+ return Object.assign(Object.assign({}, featureDetails === null || featureDetails === void 0 ? void 0 : featureDetails.checkBoxSelection), { includedRecords: newIncludedRecords, excludedRecords: newExcludedRecords });
278
283
  }
279
284
  }
280
285
  };
@@ -110,13 +110,27 @@ function ParentForGrid(props) {
110
110
  ? true
111
111
  : 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 }))] })) })));
112
112
  };
113
+ const onRowClickSelection = (data) => {
114
+ console.log(data, "data-check");
115
+ // handleCheckboxClick(
116
+ // { checked: true },
117
+ // data,
118
+ // featureDetails,
119
+ // gridData,
120
+ // setFeatureDetails,
121
+ // groupingColumns,
122
+ // setSelectedGroup,
123
+ // selectColumns
124
+ // )
125
+ };
113
126
  // JSX for rendering checkbox in cells
114
127
  const cellCheckBoxRenderer = (params) => {
115
- var _a, _b;
128
+ var _a, _b, _c, _d;
116
129
  const { data } = params;
117
130
  // const { allBoxChecked, excludedRecords, includedRecords } = featureDetails.checkBoxSelection;
118
- const isChecked = (0, helper_1.getCheckedStatus)(data, featureDetails, constants_1.GRID_CHECKBOX_STATUS, setFeatureDetails);
119
- return ((0, jsx_runtime_1.jsx)(grid_checkbox_1.default, { checked: isChecked, disabled: ((_a = params === null || params === void 0 ? void 0 : params.data) === null || _a === void 0 ? void 0 : _a.tagged) || false, onChange: (e) => (0, helper_1.handleCheckboxClick)(e, params, featureDetails, gridData, setFeatureDetails, groupingColumns, setSelectedGroup, selectColumns), isIndeterminate: false, shouldRenderOnRight: (_b = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _b === void 0 ? void 0 : _b.displayCheckboxOnRight }));
131
+ const isChecked = (0, helper_1.getCheckedStatus)(data, featureDetails, constants_1.GRID_CHECKBOX_STATUS);
132
+ console.log(featureDetails, (_a = params === null || params === void 0 ? void 0 : params.data) === null || _a === void 0 ? void 0 : _a.tagged, "check-data");
133
+ return ((0, jsx_runtime_1.jsx)(grid_checkbox_1.default, { checked: ((_b = params === null || params === void 0 ? void 0 : params.data) === null || _b === void 0 ? void 0 : _b.tagged) || isChecked, disabled: ((_c = params === null || params === void 0 ? void 0 : params.data) === null || _c === void 0 ? void 0 : _c.tagged) || false, onChange: (e) => (0, helper_1.handleCheckboxClick)(e, params, featureDetails, gridData, setFeatureDetails, groupingColumns, setSelectedGroup, selectColumns), isIndeterminate: false, shouldRenderOnRight: (_d = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _d === void 0 ? void 0 : _d.displayCheckboxOnRight }));
120
134
  };
121
135
  // Callback to products for getting data
122
136
  const getData = (startRow, endRow, currentFeatures, params) => tslib_1.__awaiter(this, void 0, void 0, function* () {
@@ -348,7 +362,7 @@ function ParentForGrid(props) {
348
362
  setGridViewData(Object.assign(Object.assign({}, gridViewData), { rowData: allData }));
349
363
  };
350
364
  // Options that grid should have
351
- const gridOptions = Object.assign(Object.assign(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) => {
365
+ const gridOptions = Object.assign(Object.assign(Object.assign(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) => {
352
366
  var _a, _b;
353
367
  if ((column === null || column === void 0 ? void 0 : column.enableChildCheckbox) && (column === null || column === void 0 ? void 0 : column.enableHeaderCheckbox)) {
354
368
  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: {
@@ -367,7 +381,7 @@ function ParentForGrid(props) {
367
381
  dataTypeDefinitions: props === null || props === void 0 ? void 0 : props.dataTypeDefinitions,
368
382
  })), { 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) && {
369
383
  groupDefaultExpanded: props === null || props === void 0 ? void 0 : props.groupDefaultExpanded, // to enable tree data
370
- })), ((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 } : {})), {
384
+ })), ((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.onRowSelection) ? { onRowClicked: onRowClickSelection } : {})), ((props === null || props === void 0 ? void 0 : props.quickSearch) ? { quickSearch: props.quickSearch } : {})), {
371
385
  // ...(props?.getDataPath && { getDataPath: props?.getDataPath }), // for clint side tree data enable fetuare
372
386
  onGridPreDestroyed: onGridPreDestroyed }), ((props === null || props === void 0 ? void 0 : props.rowDragManaged) ? { rowDragManaged: props === null || props === void 0 ? void 0 : props.rowDragManaged } : {})), gridProps);
373
387
  // Fucntion to call the grid
@@ -0,0 +1,49 @@
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
+ require("@ag-grid-community/styles/ag-grid.css");
7
+ require("@ag-grid-community/styles/ag-theme-quartz.css");
8
+ const parent_for_grid_1 = tslib_1.__importDefault(require("../../components/ag-grid/parent-for-grid"));
9
+ const constants_1 = require("../../components/ag-grid/constants");
10
+ const type_1 = require("../../components/types/type");
11
+ const dummyData_1 = require("./dummyData");
12
+ const DragAndDropFeatureTesting = () => {
13
+ const containerStyle = (0, react_1.useMemo)(() => ({ width: "100%", height: "500px" }), []);
14
+ const gridStyle = (0, react_1.useMemo)(() => ({ height: "500px", width: "100%" }), []);
15
+ const [columnDefs] = (0, react_1.useState)([
16
+ { field: "employeeId", rowDrag: true, suppressFillHandle: true },
17
+ { field: "employeeName", },
18
+ { field: "jobTitle" },
19
+ { field: "employmentType" },
20
+ ]);
21
+ const defaultColDef = (0, react_1.useMemo)(() => {
22
+ return {
23
+ width: 240,
24
+ flex: 1,
25
+ sortable: false,
26
+ };
27
+ }, []);
28
+ const getRowData = () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
29
+ debugger;
30
+ var allRows = yield (0, dummyData_1.getNormalData)();
31
+ const result = { rowData: allRows };
32
+ return result;
33
+ });
34
+ const initialConditions = {
35
+ displayAdvancedFilter: false,
36
+ displaySort: true,
37
+ displayFeaturesHeader: true,
38
+ displaySearch: type_1.VisibilityState.ENABLE,
39
+ displayFilter: type_1.VisibilityState.ENABLE
40
+ };
41
+ const gridApi = (0, react_1.useRef)(null);
42
+ return ((0, jsx_runtime_1.jsx)("div", Object.assign({ style: containerStyle }, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ style: gridStyle, className: "ag-theme-quartz" }, { children: (0, jsx_runtime_1.jsx)(parent_for_grid_1.default, { getGridRef: gridApi, columnData: columnDefs, style: { height: "500px" },
43
+ // rowData={dummyData}
44
+ getRowData: getRowData, conditionsToDisplay: initialConditions, rowModelType: constants_1.ROWMODELTYPE.CLIENT_SIDE, shouldRefetch: false, filterConditions: [
45
+ { id: 1, label: "AND" },
46
+ { id: 2, label: "OR" },
47
+ ], columnDefs: columnDefs, defaultColDef: defaultColDef, rowDragManaged: true }) })) })));
48
+ };
49
+ exports.default = DragAndDropFeatureTesting;
@@ -0,0 +1,125 @@
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
+ require("@ag-grid-community/styles/ag-grid.css");
7
+ require("@ag-grid-community/styles/ag-theme-quartz.css");
8
+ const core_1 = require("@ag-grid-community/core");
9
+ const column_tool_panel_1 = require("@ag-grid-enterprise/column-tool-panel");
10
+ const menu_1 = require("@ag-grid-enterprise/menu");
11
+ const row_grouping_1 = require("@ag-grid-enterprise/row-grouping");
12
+ const server_side_row_model_1 = require("@ag-grid-enterprise/server-side-row-model");
13
+ const dummyData_1 = require("./dummyData");
14
+ const parent_for_grid_1 = tslib_1.__importDefault(require("../../components/ag-grid/parent-for-grid"));
15
+ const constants_1 = require("../../components/ag-grid/constants");
16
+ const type_1 = require("../../components/types/type");
17
+ core_1.ModuleRegistry.registerModules([
18
+ column_tool_panel_1.ColumnsToolPanelModule,
19
+ menu_1.MenuModule,
20
+ row_grouping_1.RowGroupingModule,
21
+ server_side_row_model_1.ServerSideRowModelModule,
22
+ ]);
23
+ const GridRowGroupingSSRM = () => {
24
+ const containerStyle = (0, react_1.useMemo)(() => ({ width: "100%", height: "500px" }), []);
25
+ const gridStyle = (0, react_1.useMemo)(() => ({ height: "500px", width: "100%" }), []);
26
+ const [text, setText] = (0, react_1.useState)("");
27
+ const [columnDefs] = (0, react_1.useState)([
28
+ { field: "employeeId", },
29
+ { field: "employeeName", },
30
+ { field: "jobTitle" },
31
+ { field: "employmentType" },
32
+ ]);
33
+ const defaultColDef = (0, react_1.useMemo)(() => {
34
+ return {
35
+ width: 240,
36
+ flex: 1,
37
+ sortable: false,
38
+ };
39
+ }, []);
40
+ const autoGroupColumnDef = (0, react_1.useMemo)(() => {
41
+ return {
42
+ field: "employeeName",
43
+ headerName: `Search Results`,
44
+ headerCheckboxSelection: true,
45
+ cellRendererParams: {
46
+ innerRenderer: () => {
47
+ // Add custom styling or content to the group label
48
+ return ((0, jsx_runtime_1.jsx)("div", { children: "kjasdnfkjasdf" }));
49
+ },
50
+ checkbox: true,
51
+ },
52
+ };
53
+ }, []);
54
+ const isServerSideGroupOpenByDefault = (0, react_1.useCallback)((params) => {
55
+ // open first two levels by default
56
+ if (text === "") {
57
+ return false;
58
+ }
59
+ return params.rowNode.level < 2;
60
+ }, [text]);
61
+ const isServerSideGroup = (0, react_1.useCallback)((dataItem) => {
62
+ // indicate if node is a group
63
+ return dataItem.group;
64
+ }, []);
65
+ const getServerSideGroupKey = (0, react_1.useCallback)((dataItem) => {
66
+ // specify which group key to use
67
+ return dataItem.id;
68
+ }, []);
69
+ const getRowData = (a, b, c, d) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
70
+ console.log(a, b);
71
+ console.log(c, d, "params");
72
+ setText(c.searchedText);
73
+ var allRows = yield (0, dummyData_1.getAllData)(c.searchedText);
74
+ const result = { rowData: allRows };
75
+ return result;
76
+ // setTimeout(() => {
77
+ // params.success(result);
78
+ // }, 200);
79
+ });
80
+ // const onGridReady = useCallback((params: GridReadyEvent) => {
81
+ // params.api!.setGridOption("serverSideDatasource", { getRows: getData });
82
+ // }, []);
83
+ const initialConditions = {
84
+ displayAdvancedFilter: false,
85
+ displaySort: true,
86
+ displayFeaturesHeader: true,
87
+ displaySearch: type_1.VisibilityState.ENABLE,
88
+ displayFilter: type_1.VisibilityState.ENABLE
89
+ };
90
+ const rowSelection = (0, react_1.useMemo)(() => {
91
+ return {
92
+ mode: "multiRow",
93
+ };
94
+ }, []);
95
+ const gridApi = (0, react_1.useRef)(null);
96
+ const onSelectionChanged = (0, react_1.useCallback)(() => {
97
+ const selectedRows = gridApi.current.api.getServerSideSelectionState(); // Get selected rows
98
+ // const allRowsSelected = gridApi.current.api.getSelectedRows().length === gridApi.current.api.getDisplayedRowCount();
99
+ console.log("Selected rows: ", selectedRows);
100
+ console.log("Selected----- ");
101
+ // If all rows are selected, you can perform your custom logic
102
+ }, [gridApi]);
103
+ // const onFilterTextBoxChanged = useCallback(() => {
104
+ // const cahed = gridApi.current.api.getCacheBlockState(); // See loaded blocks
105
+ // gridApi.current.api.forEachNode((node) => console.log(node.data, cahed, "cache")); // Access cached rows
106
+ // // gridApi.current!.api.setGridOption(
107
+ // // "quickFilterText",
108
+ // // (document.getElementById("filter-text-box") as HTMLInputElement).value,
109
+ // // );
110
+ // }, []);
111
+ return ((0, jsx_runtime_1.jsx)("div", Object.assign({ style: containerStyle }, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ style: gridStyle, className: "ag-theme-quartz" }, { children: (0, jsx_runtime_1.jsx)(parent_for_grid_1.default, { getGridRef: gridApi, columnData: columnDefs, style: { height: "500px" }, getRowData: getRowData, conditionsToDisplay: initialConditions, rowModelType: constants_1.ROWMODELTYPE.SERVER_SIDE, shouldRefetch: false, filterConditions: [
112
+ { id: 1, label: "AND" },
113
+ { id: 2, label: "OR" },
114
+ ],
115
+ // GroupHeaderComponent={GroupHeaderComponent}
116
+ enableCheckboxForGroupHeader: true,
117
+ // AdvancedFilter={AdvancedFilter}
118
+ serverSideInitialRowCount: 3, treeData: true, gridProps: {
119
+ isServerSideGroupOpenByDefault,
120
+ isServerSideGroup,
121
+ getServerSideGroupKey,
122
+ rowSelection: "multiple"
123
+ }, columnDefs: columnDefs, defaultColDef: defaultColDef, autoGroupColumnDef: autoGroupColumnDef, rowSelection: rowSelection, onSelectionChanged: onSelectionChanged }) })) })));
124
+ };
125
+ exports.default = GridRowGroupingSSRM;