@visns-studio/visns-components 4.6.7 → 4.6.8
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.
|
@@ -51,6 +51,7 @@ function useConfig(setting, tabs, filters, setRowsSelected, tableSetting) {
|
|
|
51
51
|
if (activeTabConfig) {
|
|
52
52
|
setConfig((currentConfig) => ({
|
|
53
53
|
...currentConfig,
|
|
54
|
+
id: activeTabConfig.id,
|
|
54
55
|
ajaxSetting: activeTabConfig.ajaxSetting,
|
|
55
56
|
form: activeTabConfig.form,
|
|
56
57
|
columns: activeTabConfig.columns,
|
|
@@ -209,12 +210,20 @@ function GenericIndex({ layout = 'full', setting, userProfile }) {
|
|
|
209
210
|
}
|
|
210
211
|
}, [rowsSelected, setting?.functions?.checkboxUpdate]);
|
|
211
212
|
|
|
212
|
-
const renderTable = useCallback(
|
|
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 &&
|
|
214
221
|
config.ajaxSetting &&
|
|
215
222
|
config.form &&
|
|
216
223
|
config.columns &&
|
|
217
|
-
config.settings
|
|
224
|
+
config.settings
|
|
225
|
+
) {
|
|
226
|
+
return (
|
|
218
227
|
<Table
|
|
219
228
|
{...config}
|
|
220
229
|
ref={gridRef}
|
|
@@ -224,9 +233,11 @@ function GenericIndex({ layout = 'full', setting, userProfile }) {
|
|
|
224
233
|
style={userProfile?.settings?.style || {}}
|
|
225
234
|
userProfile={userProfile}
|
|
226
235
|
/>
|
|
227
|
-
)
|
|
228
|
-
|
|
229
|
-
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
return null;
|
|
240
|
+
}, [config, subnav, windowHeight, userProfile, setConfig, setTotal]);
|
|
230
241
|
|
|
231
242
|
const renderContentBasedOnType = useCallback(() => {
|
|
232
243
|
switch (config.type) {
|
package/package.json
CHANGED