sccoreui 6.4.0 → 6.4.2

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 (122) hide show
  1. package/dist/App.js +0 -2
  2. package/dist/components/ag-grid/helper.js +16 -6
  3. package/dist/components/ag-grid/parent-for-grid.js +6 -3
  4. package/dist/components/list-box-dropdown/virtualization-component.js +44 -21
  5. package/dist/types/components/ag-grid/helper.d.ts +1 -1
  6. package/package.json +2 -2
  7. package/dist/pages/RowGroupingServerside/DragandDropFeatures.js +0 -49
  8. package/dist/pages/RowGroupingServerside/RowGroupingServerSide.js +0 -125
  9. package/dist/pages/RowGroupingServerside/dummyData.js +0 -226
  10. package/dist/pages/VirtualScrollDropDown/VirtualScrollDropDown.js +0 -9
  11. package/dist/pages/aggrid/AgGrid.js +0 -837
  12. package/dist/pages/aggrid/BulkAction.js +0 -9
  13. package/dist/pages/aggrid/RowGroupTrail.js +0 -125
  14. package/dist/pages/aggrid/Template.js +0 -11
  15. package/dist/pages/aggrid/TestingWIthAdminConfig.js +0 -243
  16. package/dist/pages/aggrid/TestingWithAdminClientSide.js +0 -447
  17. package/dist/pages/aggrid/fakeServer.js +0 -95
  18. package/dist/pages/aggrid/id-cell.js +0 -9
  19. package/dist/pages/aggrid/interface.js +0 -2
  20. package/dist/pages/avatar/avatar.js +0 -338
  21. package/dist/pages/badges/badge.js +0 -73
  22. package/dist/pages/breadcrumb/breadcrumb.js +0 -14
  23. package/dist/pages/button/button.js +0 -10
  24. package/dist/pages/button-group/button-group.js +0 -10
  25. package/dist/pages/chart/chart.js +0 -257
  26. package/dist/pages/checkbox/checkbox.js +0 -26
  27. package/dist/pages/checkbox-group/checkbox-group-component.js +0 -21
  28. package/dist/pages/color-picker/color-picker.js +0 -13
  29. package/dist/pages/content-dividers/content-dividers.js +0 -11
  30. package/dist/pages/custom-color-picker/custom-color-picker.js +0 -12
  31. package/dist/pages/custom-multiselect/CustomMultiSelect.js +0 -37
  32. package/dist/pages/date-picker/date-picker.js +0 -20
  33. package/dist/pages/dropdown/dropdown-component.js +0 -39
  34. package/dist/pages/file-upload/file-upload.js +0 -34
  35. package/dist/pages/flex.js +0 -15
  36. package/dist/pages/formulaTemplate/formulaTemplate.js +0 -105
  37. package/dist/pages/frolaTextEditor/froala-text-editor.js +0 -14
  38. package/dist/pages/home.js +0 -58
  39. package/dist/pages/input/input-text.js +0 -112
  40. package/dist/pages/list-box-dropdown/listboxdropdown.js +0 -91
  41. package/dist/pages/loader-indicator/loader-indicator.js +0 -10
  42. package/dist/pages/mega-mennu/mega-menu.js +0 -84
  43. package/dist/pages/multi-select-dropdown/multi-select-dropdown.js +0 -51
  44. package/dist/pages/not-found/not-found.js +0 -10
  45. package/dist/pages/paginator/pagination.js +0 -122
  46. package/dist/pages/progress-bar/progress-bar.js +0 -27
  47. package/dist/pages/progress-steps/progress-steps.js +0 -24
  48. package/dist/pages/radio-button/radio-button-component.js +0 -11
  49. package/dist/pages/shadows/shadows.js +0 -7
  50. package/dist/pages/slideout-menus/slideout-menus.js +0 -104
  51. package/dist/pages/sliders/slider.js +0 -39
  52. package/dist/pages/tabels/table-data.js +0 -2193
  53. package/dist/pages/tabels/table.js +0 -98
  54. package/dist/pages/tabs/tabs.js +0 -9
  55. package/dist/pages/tags/tags.js +0 -70
  56. package/dist/pages/testingcomponents/NormalAgGrid.js +0 -58
  57. package/dist/pages/testingcomponents/TestComponent.js +0 -69
  58. package/dist/pages/testingcomponents/data.js +0 -326
  59. package/dist/pages/testingcomponents/fom-feild-testing/MainformComp.js +0 -16
  60. package/dist/pages/toast/toast.js +0 -47
  61. package/dist/pages/toggle/toggle.js +0 -10
  62. package/dist/pages/tooltip/tooltip.js +0 -13
  63. package/dist/pages/treeDropdownSelect/treedropdowselect.js +0 -34
  64. package/dist/pages/types/type.js +0 -2
  65. package/dist/types/pages/RowGroupingServerside/DragandDropFeatures.d.ts +0 -4
  66. package/dist/types/pages/RowGroupingServerside/RowGroupingServerSide.d.ts +0 -4
  67. package/dist/types/pages/RowGroupingServerside/dummyData.d.ts +0 -9
  68. package/dist/types/pages/VirtualScrollDropDown/VirtualScrollDropDown.d.ts +0 -2
  69. package/dist/types/pages/aggrid/AgGrid.d.ts +0 -2
  70. package/dist/types/pages/aggrid/BulkAction.d.ts +0 -2
  71. package/dist/types/pages/aggrid/RowGroupTrail.d.ts +0 -4
  72. package/dist/types/pages/aggrid/Template.d.ts +0 -2
  73. package/dist/types/pages/aggrid/TestingWIthAdminConfig.d.ts +0 -2
  74. package/dist/types/pages/aggrid/TestingWithAdminClientSide.d.ts +0 -2
  75. package/dist/types/pages/aggrid/fakeServer.d.ts +0 -7
  76. package/dist/types/pages/aggrid/id-cell.d.ts +0 -2
  77. package/dist/types/pages/aggrid/interface.d.ts +0 -12
  78. package/dist/types/pages/avatar/avatar.d.ts +0 -2
  79. package/dist/types/pages/badges/badge.d.ts +0 -3
  80. package/dist/types/pages/breadcrumb/breadcrumb.d.ts +0 -2
  81. package/dist/types/pages/button/button.d.ts +0 -2
  82. package/dist/types/pages/button-group/button-group.d.ts +0 -2
  83. package/dist/types/pages/chart/chart.d.ts +0 -2
  84. package/dist/types/pages/checkbox/checkbox.d.ts +0 -2
  85. package/dist/types/pages/checkbox-group/checkbox-group-component.d.ts +0 -3
  86. package/dist/types/pages/color-picker/color-picker.d.ts +0 -2
  87. package/dist/types/pages/content-dividers/content-dividers.d.ts +0 -2
  88. package/dist/types/pages/custom-color-picker/custom-color-picker.d.ts +0 -2
  89. package/dist/types/pages/custom-multiselect/CustomMultiSelect.d.ts +0 -2
  90. package/dist/types/pages/date-picker/date-picker.d.ts +0 -2
  91. package/dist/types/pages/dropdown/dropdown-component.d.ts +0 -2
  92. package/dist/types/pages/file-upload/file-upload.d.ts +0 -3
  93. package/dist/types/pages/flex.d.ts +0 -2
  94. package/dist/types/pages/formulaTemplate/formulaTemplate.d.ts +0 -2
  95. package/dist/types/pages/frolaTextEditor/froala-text-editor.d.ts +0 -2
  96. package/dist/types/pages/home.d.ts +0 -2
  97. package/dist/types/pages/input/input-text.d.ts +0 -3
  98. package/dist/types/pages/list-box-dropdown/listboxdropdown.d.ts +0 -2
  99. package/dist/types/pages/loader-indicator/loader-indicator.d.ts +0 -3
  100. package/dist/types/pages/mega-mennu/mega-menu.d.ts +0 -2
  101. package/dist/types/pages/multi-select-dropdown/multi-select-dropdown.d.ts +0 -2
  102. package/dist/types/pages/not-found/not-found.d.ts +0 -2
  103. package/dist/types/pages/paginator/pagination.d.ts +0 -2
  104. package/dist/types/pages/progress-bar/progress-bar.d.ts +0 -3
  105. package/dist/types/pages/progress-steps/progress-steps.d.ts +0 -2
  106. package/dist/types/pages/radio-button/radio-button-component.d.ts +0 -2
  107. package/dist/types/pages/shadows/shadows.d.ts +0 -2
  108. package/dist/types/pages/slideout-menus/slideout-menus.d.ts +0 -2
  109. package/dist/types/pages/sliders/slider.d.ts +0 -1
  110. package/dist/types/pages/tabels/table-data.d.ts +0 -3
  111. package/dist/types/pages/tabels/table.d.ts +0 -2
  112. package/dist/types/pages/tabs/tabs.d.ts +0 -3
  113. package/dist/types/pages/tags/tags.d.ts +0 -3
  114. package/dist/types/pages/testingcomponents/NormalAgGrid.d.ts +0 -4
  115. package/dist/types/pages/testingcomponents/TestComponent.d.ts +0 -4
  116. package/dist/types/pages/testingcomponents/data.d.ts +0 -1
  117. package/dist/types/pages/testingcomponents/fom-feild-testing/MainformComp.d.ts +0 -2
  118. package/dist/types/pages/toast/toast.d.ts +0 -2
  119. package/dist/types/pages/toggle/toggle.d.ts +0 -2
  120. package/dist/types/pages/tooltip/tooltip.d.ts +0 -2
  121. package/dist/types/pages/treeDropdownSelect/treedropdowselect.d.ts +0 -2
  122. package/dist/types/pages/types/type.d.ts +0 -64
package/dist/App.js CHANGED
@@ -2,10 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const jsx_runtime_1 = require("react/jsx-runtime");
4
4
  require("./App.scss");
5
- // import FroalaTextEditor from "./components/froala-editor/FroalaEditor";
6
5
  // import Home from "./pages/home";
7
6
  const App = () => {
8
- // const [selectedCountries, setSelectedCountries] = useState(null);
9
7
  return (0, jsx_runtime_1.jsx)("div", { className: "m-6" });
10
8
  };
11
9
  exports.default = App;
@@ -62,7 +62,7 @@ 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
67
  if (allBoxChecked) {
68
68
  return !excludedRecords.includes(row);
@@ -71,12 +71,19 @@ const getCheckedStatus = (row, featureDetails, GRID_CHECKBOX_STATUS, setFeatureD
71
71
  if (headerCheckBoxStatus === GRID_CHECKBOX_STATUS.NEUTRAL &&
72
72
  (row === null || row === void 0 ? void 0 : row.isSelected)) {
73
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] }) })));
74
+ // includedRecords.push(row);
75
+ // setFeatureDetails((prev) => ({
76
+ // ...prev,
77
+ // checkBoxSelection: {
78
+ // ...prev.checkBoxSelection,
79
+ // includedRecords: [...includedRecords],
80
+ // },
81
+ // }));
82
+ return !(excludedRecords === null || excludedRecords === void 0 ? void 0 : excludedRecords.includes(row));
76
83
  }
77
84
  return true;
78
85
  }
79
- return includedRecords.includes(row);
86
+ return (excludedRecords === null || excludedRecords === void 0 ? void 0 : excludedRecords.includes(row)) ? false : includedRecords.includes(row);
80
87
  }
81
88
  };
82
89
  exports.getCheckedStatus = getCheckedStatus;
@@ -258,7 +265,10 @@ const updateRecords = (rowData, featureDetails, gridData) => {
258
265
  return false; // Exclude this item from the new array
259
266
  }
260
267
  })
261
- : [...includedRecords, rowData]; // Add rowData if it's not already included
268
+ : (rowData === null || rowData === void 0 ? void 0 : rowData.isSelected) ? [...includedRecords] : [...includedRecords, rowData]; // Add rowData if it's not already included
269
+ newExcludedRecords = (excludedRecords === null || excludedRecords === void 0 ? void 0 : excludedRecords.includes(rowData))
270
+ ? 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))
271
+ : (rowData === null || rowData === void 0 ? void 0 : rowData.isSelected) ? [...excludedRecords, rowData] : excludedRecords;
262
272
  // Check if all records are included; reset if so
263
273
  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
274
  return {
@@ -274,7 +284,7 @@ const updateRecords = (rowData, featureDetails, gridData) => {
274
284
  }
275
285
  // Otherwise, update the included records
276
286
  else {
277
- return Object.assign(Object.assign({}, featureDetails === null || featureDetails === void 0 ? void 0 : featureDetails.checkBoxSelection), { includedRecords: newIncludedRecords });
287
+ return Object.assign(Object.assign({}, featureDetails === null || featureDetails === void 0 ? void 0 : featureDetails.checkBoxSelection), { includedRecords: newIncludedRecords, excludedRecords: newExcludedRecords });
278
288
  }
279
289
  }
280
290
  };
@@ -110,12 +110,15 @@ 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
+ (0, helper_1.handleCheckboxClick)({ checked: true }, data, featureDetails, gridData, setFeatureDetails, groupingColumns, setSelectedGroup, selectColumns);
115
+ };
113
116
  // JSX for rendering checkbox in cells
114
117
  const cellCheckBoxRenderer = (params) => {
115
118
  var _a, _b;
116
119
  const { data } = params;
117
120
  // const { allBoxChecked, excludedRecords, includedRecords } = featureDetails.checkBoxSelection;
118
- const isChecked = (0, helper_1.getCheckedStatus)(data, featureDetails, constants_1.GRID_CHECKBOX_STATUS, setFeatureDetails);
121
+ const isChecked = (0, helper_1.getCheckedStatus)(data, featureDetails, constants_1.GRID_CHECKBOX_STATUS);
119
122
  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 }));
120
123
  };
121
124
  // Callback to products for getting data
@@ -349,7 +352,7 @@ function ParentForGrid(props) {
349
352
  setGridViewData(Object.assign(Object.assign({}, gridViewData), { rowData: allData }));
350
353
  };
351
354
  // Options that grid should have
352
- 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) => {
355
+ 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) => {
353
356
  var _a, _b;
354
357
  if ((column === null || column === void 0 ? void 0 : column.enableChildCheckbox) && (column === null || column === void 0 ? void 0 : column.enableHeaderCheckbox)) {
355
358
  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: {
@@ -368,7 +371,7 @@ function ParentForGrid(props) {
368
371
  dataTypeDefinitions: props === null || props === void 0 ? void 0 : props.dataTypeDefinitions,
369
372
  })), { 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) && {
370
373
  groupDefaultExpanded: props === null || props === void 0 ? void 0 : props.groupDefaultExpanded, // to enable tree data
371
- })), ((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 } : {})), {
374
+ })), ((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 } : {})), {
372
375
  // ...(props?.getDataPath && { getDataPath: props?.getDataPath }), // for clint side tree data enable fetuare
373
376
  onGridPreDestroyed: onGridPreDestroyed }), ((props === null || props === void 0 ? void 0 : props.rowDragManaged) ? { rowDragManaged: props === null || props === void 0 ? void 0 : props.rowDragManaged } : {})), gridProps);
374
377
  // Fucntion to call the grid
@@ -10,8 +10,11 @@ const hooks_1 = require("primereact/hooks");
10
10
  const skeleton_1 = require("primereact/skeleton");
11
11
  function RowVirtualizerDynamic(props) {
12
12
  var _a, _b;
13
- const { optionTemplate, optionLabel, filterPlaceholder, matchKey = "id", values, multiple = false, onSelectionChange, fetchData } = props;
13
+ const { optionTemplate, optionLabel, filterPlaceholder, matchKey = "id", values, multiple = false, onSelectionChange, fetchData, emptyMessage, emptyFilterMessage } = props;
14
14
  const parentRef = React.useRef(null);
15
+ const loadingRef = React.useRef(true);
16
+ const allCount = React.useRef(null);
17
+ const totalRecordsCount = React.useRef(null);
15
18
  const initialFetch = {
16
19
  pageIndex: 0,
17
20
  pageSize: 100,
@@ -28,43 +31,59 @@ function RowVirtualizerDynamic(props) {
28
31
  estimateSize: () => 45,
29
32
  enabled,
30
33
  });
31
- // 👇 Scroll handler
34
+ // Scroll handler
32
35
  const handleScroll = () => {
33
36
  const el = parentRef.current;
34
37
  if (!el)
35
38
  return;
36
39
  const scrollOffset = el.scrollTop + el.clientHeight;
37
40
  const threshold = el.scrollHeight - 100;
38
- if (scrollOffset >= threshold) {
41
+ const checCount = allCount.current ? allCount.current > totalRecordsCount.current : true;
42
+ if (scrollOffset >= threshold && !loadingRef.current && checCount) {
39
43
  setLoading(true);
40
- // near bottom, simulate fetch
44
+ loadingRef.current = true;
41
45
  fetchMoreData(Object.assign(Object.assign({}, initialFetch), { pageIndex: pageIndex.current }));
42
46
  }
43
47
  };
44
48
  const fetchMoreData = (props) => tslib_1.__awaiter(this, void 0, void 0, function* () {
49
+ var _c;
45
50
  try {
46
- const data = yield fetchData(props);
47
- if (data) {
48
- setData(prev => [
49
- ...prev,
50
- ...data // simulate fetch
51
- ]);
51
+ const object = yield fetchData(props);
52
+ if (object) {
53
+ loadingRef.current = false;
54
+ if ((props === null || props === void 0 ? void 0 : props.searchTerm) && (props === null || props === void 0 ? void 0 : props.searchTerm) !== "") {
55
+ totalRecordsCount.current = (_c = object === null || object === void 0 ? void 0 : object.data) === null || _c === void 0 ? void 0 : _c.length;
56
+ allCount.current = object === null || object === void 0 ? void 0 : object.totalRecords;
57
+ pageIndex.current = 0;
58
+ setData(object === null || object === void 0 ? void 0 : object.data);
59
+ }
60
+ else {
61
+ setData(prev => {
62
+ const totalData = [...prev, ...object === null || object === void 0 ? void 0 : object.data];
63
+ totalRecordsCount.current = totalData.length;
64
+ return totalData;
65
+ });
66
+ }
52
67
  setLoading(false);
68
+ allCount.current = object === null || object === void 0 ? void 0 : object.totalRecords;
53
69
  pageIndex.current = pageIndex.current + 1;
54
70
  }
55
71
  }
56
72
  catch (error) {
73
+ console.error("Error fetching data:", error);
74
+ loadingRef.current = false;
57
75
  setLoading(false);
58
76
  }
59
77
  });
60
78
  React.useEffect(() => {
79
+ loadingRef.current = true;
80
+ setLoading(true);
61
81
  fetchMoreData(Object.assign(Object.assign({}, initialFetch), { searchTerm: debouncedValue }));
62
82
  }, [debouncedValue]);
63
- // 👇 Attach scroll event
64
83
  React.useEffect(() => {
65
84
  const el = parentRef.current;
66
85
  el && el.addEventListener('scroll', handleScroll);
67
- return () => el.removeEventListener('scroll', handleScroll);
86
+ return () => el === null || el === void 0 ? void 0 : el.removeEventListener('scroll', handleScroll);
68
87
  }, []);
69
88
  const items = virtualizer.getVirtualItems();
70
89
  const handleSelect = (item) => {
@@ -80,12 +99,14 @@ function RowVirtualizerDynamic(props) {
80
99
  }
81
100
  onSelectionChange && onSelectionChange(newSelection);
82
101
  };
83
- return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: 'p-listbox' }, { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ className: "p-listbox-header", "data-pc-section": "header" }, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "p-listbox-filter-container", "data-pc-section": "filtercontainer" }, { children: (0, jsx_runtime_1.jsxs)("span", Object.assign({ className: 'p-input-icon-right flex-order-1' }, { children: [inputValue === "" ?
84
- (0, jsx_runtime_1.jsx)("span", Object.assign({ className: "p-input-suffix cursor-pointer" }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "search-md", size: 12 }) })) :
85
- (0, jsx_runtime_1.jsx)("span", Object.assign({ className: "p-input-suffix cursor-pointer", onClick: (e) => {
86
- e.stopPropagation();
87
- setInputValue("");
88
- } }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "x-close", size: 12 }) })), (0, jsx_runtime_1.jsx)(inputtext_1.InputText, { value: inputValue, onChange: (e) => setInputValue(e.target.value), placeholder: filterPlaceholder, className: 'w-full' })] })) })) })), (0, jsx_runtime_1.jsx)("div", Object.assign({ ref: parentRef, className: "List w-full bg-gray shadow-3", style: {
102
+ // Render Skeletons
103
+ const renderSkeletons = () => {
104
+ return Array.from({ length: 10 }).map((_, index) => ((0, jsx_runtime_1.jsx)("li", Object.assign({ className: "p-listbox-item cursor-pointer p-1" }, { children: (0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { height: "30px", width: "100%" }) }), index)));
105
+ };
106
+ return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "p-listbox" }, { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ className: "p-listbox-header", "data-pc-section": "header" }, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "p-listbox-filter-container", "data-pc-section": "filtercontainer" }, { children: (0, jsx_runtime_1.jsxs)("span", Object.assign({ className: "p-input-icon-right flex-order-1" }, { children: [inputValue === "" ? ((0, jsx_runtime_1.jsx)("span", Object.assign({ className: "p-input-suffix cursor-pointer" }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "search-md", size: 12 }) }))) : ((0, jsx_runtime_1.jsx)("span", Object.assign({ className: "p-input-suffix cursor-pointer", onClick: (e) => {
107
+ e.stopPropagation();
108
+ setInputValue("");
109
+ } }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "x-close", size: 12 }) }))), (0, jsx_runtime_1.jsx)(inputtext_1.InputText, { value: inputValue, onChange: (e) => setInputValue(e.target.value), placeholder: filterPlaceholder, className: "w-full" })] })) })) })), (0, jsx_runtime_1.jsx)("div", Object.assign({ ref: parentRef, className: "List virtual-box w-full bg-gray shadow-3", style: {
89
110
  height: 400,
90
111
  overflowY: 'auto',
91
112
  contain: 'strict',
@@ -93,7 +114,7 @@ function RowVirtualizerDynamic(props) {
93
114
  height: virtualizer.getTotalSize(),
94
115
  width: '100%',
95
116
  position: 'relative',
96
- } }, { children: (0, jsx_runtime_1.jsx)("ul", Object.assign({ className: 'p-listbox-list', style: {
117
+ }, className: `${data.length === 0 ? "flex-column flex justify-content-around align-items-center h-full w-full" : ""}` }, { children: loadingRef.current && (data === null || data === void 0 ? void 0 : data.length) === 0 ? ((0, jsx_runtime_1.jsx)("ul", Object.assign({ className: "p-listbox-list w-full" }, { children: renderSkeletons() }))) : (data === null || data === void 0 ? void 0 : data.length) === 0 ? (debouncedValue && debouncedValue !== "" ? ((0, jsx_runtime_1.jsx)("span", { children: emptyFilterMessage })) : ((0, jsx_runtime_1.jsx)("span", { children: emptyMessage }))) : ((0, jsx_runtime_1.jsx)("ul", Object.assign({ className: "p-listbox-list w-full", style: {
97
118
  position: 'absolute',
98
119
  top: 0,
99
120
  left: 0,
@@ -101,7 +122,9 @@ function RowVirtualizerDynamic(props) {
101
122
  transform: `translateY(${(_b = (_a = items[0]) === null || _a === void 0 ? void 0 : _a.start) !== null && _b !== void 0 ? _b : 0}px)`,
102
123
  } }, { children: items.map((virtualRow) => {
103
124
  var _a;
104
- return ((0, jsx_runtime_1.jsx)("li", Object.assign({ "data-index": virtualRow.index, ref: virtualizer.measureElement, onClick: () => handleSelect(data[virtualRow.index]), className: `p-listbox-item ${virtualRow.index % 2 ? 'ListItemOdd' : 'ListItemEven'} ${values.some((y) => { var _a; return (y === null || y === void 0 ? void 0 : y[matchKey]) === ((_a = data[virtualRow.index]) === null || _a === void 0 ? void 0 : _a[matchKey]); }) ? "p-highlight" : ""} cursor-pointer` }, { children: loading ? (0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { height: '30px', width: '100%' }) : (0, jsx_runtime_1.jsx)("div", { children: optionTemplate ? optionTemplate(data[virtualRow.index]) : (0, jsx_runtime_1.jsx)("div", { children: (_a = data[virtualRow.index]) === null || _a === void 0 ? void 0 : _a[optionLabel] }) }) }), virtualRow.key));
105
- }) })) })) }))] })));
125
+ return ((0, jsx_runtime_1.jsx)("li", Object.assign({ "data-index": virtualRow.index, ref: virtualizer.measureElement, onClick: () => handleSelect(data[virtualRow.index]), className: `p-listbox-item ${virtualRow.index % 2 ? 'ListItemOdd' : 'ListItemEven'} ${values.some((y) => { var _a; return (y === null || y === void 0 ? void 0 : y[matchKey]) === ((_a = data[virtualRow.index]) === null || _a === void 0 ? void 0 : _a[matchKey]); })
126
+ ? "p-highlight"
127
+ : ""} cursor-pointer` }, { children: loading ? ((0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { height: "30px", width: "100%" })) : (optionTemplate ? optionTemplate(data[virtualRow.index]) : (0, jsx_runtime_1.jsx)("div", { children: (_a = data[virtualRow.index]) === null || _a === void 0 ? void 0 : _a[optionLabel] })) }), virtualRow.key));
128
+ }) }))) })) }))] })));
106
129
  }
107
130
  exports.default = RowVirtualizerDynamic;
@@ -5,7 +5,7 @@ export declare const isComponentDisable: (state?: string) => boolean;
5
5
  export declare const applyDefaultFilters: (defaultFilters: any) => any;
6
6
  export declare const parseIfNeeded: (value: any) => any;
7
7
  export declare const sortColumns: (columns: any) => any;
8
- export declare const getCheckedStatus: (row: any, featureDetails: any, GRID_CHECKBOX_STATUS: any, setFeatureDetails: any) => any;
8
+ export declare const getCheckedStatus: (row: any, featureDetails: any, GRID_CHECKBOX_STATUS: any) => any;
9
9
  export declare const updateCells: (updatedRowData: any, setUpdateRowData: any, api: any) => void;
10
10
  export declare const fillOperation: (params: any, api: any, editedRecords: any, setEditedRecords: any) => Promise<void>;
11
11
  export declare const autoGroupColumnDef: (isTreeEnable: boolean, headerName: string, groupField: string, GroupHeaderComponent: React.FC, headerCheckboxRenderer: React.FC, enableCheckboxForGroupHeader: boolean, displayGroupCount: boolean, rowGroupColumnWidth: number, ChildRendererForGroup?: React.FC, HeaderRendererForGroup?: React.FC) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sccoreui",
3
- "version": "6.4.00",
3
+ "version": "6.4.02",
4
4
  "description": "ui-sccore",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -94,4 +94,4 @@
94
94
  "last 1 safari version"
95
95
  ]
96
96
  }
97
- }
97
+ }
@@ -1,49 +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
- 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;
@@ -1,125 +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
- 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;