@visns-studio/visns-components 4.6.8 → 4.6.9

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.
@@ -20,6 +20,10 @@ import NumberFilter from '@inovua/reactdatagrid-community/NumberFilter';
20
20
  import SelectFilter from '@inovua/reactdatagrid-community/SelectFilter';
21
21
  import DateFilter from '@inovua/reactdatagrid-community/DateFilter';
22
22
  import ReactDataGrid from '@inovua/reactdatagrid-community';
23
+ // import NumberFilter from '@visns-studio/visns-datagrid-enterprise/NumberFilter';
24
+ // import SelectFilter from '@visns-studio/visns-datagrid-enterprise/SelectFilter';
25
+ // import DateFilter from '@visns-studio/visns-datagrid-enterprise/DateFilter';
26
+ // import ReactDataGrid from '@visns-studio/visns-datagrid-enterprise';
23
27
  import { Gallery } from 'react-grid-gallery';
24
28
  import { confirmAlert } from 'react-confirm-alert';
25
29
  import { toast } from 'react-toastify';
@@ -211,29 +211,58 @@ function GenericIndex({ layout = 'full', setting, userProfile }) {
211
211
  }, [rowsSelected, setting?.functions?.checkboxUpdate]);
212
212
 
213
213
  const renderTable = useCallback(() => {
214
- // Find the active subnav item with show: true
215
- const activeSubnav = subnav.find((item) => item.show === true);
216
-
217
- // Check if the config.id matches the active subnav id
218
- if (
219
- activeSubnav &&
220
- activeSubnav.id === config.id &&
221
- config.ajaxSetting &&
222
- config.form &&
223
- config.columns &&
224
- config.settings
225
- ) {
214
+ const isConfigValid = (config) => {
226
215
  return (
227
- <Table
228
- {...config}
229
- ref={gridRef}
230
- gridHeight={windowHeight * 0.65}
231
- setConfig={setConfig}
232
- setTotal={setTotal}
233
- style={userProfile?.settings?.style || {}}
234
- userProfile={userProfile}
235
- />
216
+ config.ajaxSetting &&
217
+ config.form &&
218
+ config.columns &&
219
+ config.settings
236
220
  );
221
+ };
222
+
223
+ const renderTableComponent = () => (
224
+ <Table
225
+ {...config}
226
+ ref={gridRef}
227
+ gridHeight={windowHeight * 0.65}
228
+ setConfig={setConfig}
229
+ setTotal={setTotal}
230
+ style={userProfile?.settings?.style || {}}
231
+ userProfile={userProfile}
232
+ />
233
+ );
234
+
235
+ if (subnav) {
236
+ // Find the active subnav item with show: true
237
+ const activeSubnav = subnav.find((item) => item.show === true);
238
+
239
+ // Check if the config.id matches the active subnav id
240
+ if (
241
+ activeSubnav &&
242
+ activeSubnav.id === config.id &&
243
+ isConfigValid(config)
244
+ ) {
245
+ return renderTableComponent();
246
+ }
247
+
248
+ // Check for active alternative subnav
249
+ const activeAltSubNav = subnav.find(
250
+ (item) =>
251
+ item.class === 'subactive' || item.class === 'activetab'
252
+ );
253
+
254
+ const activeTabExist =
255
+ config.ajaxSetting?.where?.some(
256
+ (w) =>
257
+ w.id === activeAltSubNav?.id &&
258
+ parseInt(w.value) === parseInt(activeAltSubNav?.value)
259
+ ) || false;
260
+
261
+ if (isConfigValid(config) && activeTabExist) {
262
+ return renderTableComponent();
263
+ }
264
+ } else if (isConfigValid(config)) {
265
+ return renderTableComponent();
237
266
  }
238
267
 
239
268
  return null;
package/package.json CHANGED
@@ -2,6 +2,7 @@
2
2
  "dependencies": {
3
3
  "@fontsource/barlow": "^5.0.13",
4
4
  "@inovua/reactdatagrid-community": "^5.10.2",
5
+ "@inovua/reactdatagrid-enterprise": "^5.10.2",
5
6
  "@nivo/bar": "^0.87.0",
6
7
  "@nivo/core": "^0.87.0",
7
8
  "@nivo/line": "^0.87.0",
@@ -11,10 +12,10 @@
11
12
  "akar-icons": "^1.9.31",
12
13
  "array-move": "^4.0.0",
13
14
  "awesome-debounce-promise": "^2.1.0",
14
- "axios": "^1.7.3",
15
+ "axios": "^1.7.4",
15
16
  "dayjs": "^1.11.12",
16
17
  "file-saver": "^2.0.5",
17
- "framer-motion": "^11.3.21",
18
+ "framer-motion": "^11.3.27",
18
19
  "html-react-parser": "^5.1.12",
19
20
  "lodash": "^4.17.21",
20
21
  "lodash.debounce": "^4.0.8",
@@ -58,7 +59,7 @@
58
59
  "react-dom": "^17.0.1"
59
60
  },
60
61
  "name": "@visns-studio/visns-components",
61
- "version": "4.6.8",
62
+ "version": "4.6.9",
62
63
  "description": "Various packages to assist in the development of our Custom Applications.",
63
64
  "main": "index.js",
64
65
  "scripts": {