@compill/admin 1.0.63 → 1.0.65
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.
- package/index.cjs.js +3 -3
- package/index.esm.js +4 -4
- package/package.json +1 -1
package/index.cjs.js
CHANGED
@@ -2894,8 +2894,8 @@ function MenuItem(_a) {
|
|
2894
2894
|
} = _a,
|
2895
2895
|
props = __rest$1(_a, ["icon", "path", "depth", "darkMode", "subMenu", "children"]);
|
2896
2896
|
const location = reactRouterDom.useLocation();
|
2897
|
-
const selected = location.pathname.startsWith(path.startsWith("/") ? path : `/${path}`);
|
2898
|
-
|
2897
|
+
const selected = path == "/" ? location.pathname == "/" : location.pathname.startsWith(path.startsWith("/") ? path : `/${path}`);
|
2898
|
+
const match = reactRouterDom.useMatch("/" + path) != null;
|
2899
2899
|
// const selected = match != null
|
2900
2900
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
2901
2901
|
children: [jsxRuntime.jsxs(reactRouterDom.Link, {
|
@@ -2926,7 +2926,7 @@ function MenuItem(_a) {
|
|
2926
2926
|
path: icon,
|
2927
2927
|
opacity: selected ? "100" : "60"
|
2928
2928
|
}), children]
|
2929
|
-
})),
|
2929
|
+
})), match && jsxRuntime.jsx("div", {
|
2930
2930
|
position: "absolute",
|
2931
2931
|
bgColor: darkMode ? "white" : "black",
|
2932
2932
|
bgOpacity: "90",
|
package/index.esm.js
CHANGED
@@ -4,7 +4,7 @@ import Link from 'next/link';
|
|
4
4
|
import React, { useRef, useCallback, useContext as useContext$2, useLayoutEffect, useEffect, createContext } from 'react';
|
5
5
|
import { INVALIDATE_API } from '@compill/admin-api';
|
6
6
|
import { useApiMutation, useMutate, useInvalidateMutation, useApiQuery, useInvalidateQuery, useInvalidateParentMutation, useApiQueries } from '@compill/api';
|
7
|
-
import { useNavigate, useParams, Outlet, useLocation, Link as Link$1 } from 'react-router-dom';
|
7
|
+
import { useNavigate, useParams, Outlet, useLocation, useMatch, Link as Link$1 } from 'react-router-dom';
|
8
8
|
import { toast } from 'react-toastify';
|
9
9
|
import { SubmitButton, FormProvider, TextArea, FormRenderer, mergeInitialFormValues, FieldLabel } from '@compill/form';
|
10
10
|
import { useFormikContext, Field, Formik, Form } from 'formik';
|
@@ -2884,8 +2884,8 @@ function MenuItem(_a) {
|
|
2884
2884
|
} = _a,
|
2885
2885
|
props = __rest$1(_a, ["icon", "path", "depth", "darkMode", "subMenu", "children"]);
|
2886
2886
|
const location = useLocation();
|
2887
|
-
const selected = location.pathname.startsWith(path.startsWith("/") ? path : `/${path}`);
|
2888
|
-
|
2887
|
+
const selected = path == "/" ? location.pathname == "/" : location.pathname.startsWith(path.startsWith("/") ? path : `/${path}`);
|
2888
|
+
const match = useMatch("/" + path) != null;
|
2889
2889
|
// const selected = match != null
|
2890
2890
|
return jsxs(Fragment, {
|
2891
2891
|
children: [jsxs(Link$1, {
|
@@ -2916,7 +2916,7 @@ function MenuItem(_a) {
|
|
2916
2916
|
path: icon,
|
2917
2917
|
opacity: selected ? "100" : "60"
|
2918
2918
|
}), children]
|
2919
|
-
})),
|
2919
|
+
})), match && jsx("div", {
|
2920
2920
|
position: "absolute",
|
2921
2921
|
bgColor: darkMode ? "white" : "black",
|
2922
2922
|
bgOpacity: "90",
|