@archbase/admin 3.0.19 → 3.0.22
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/dist/ArchbaseAliveAbleRoutes.d.ts +12 -58
- package/dist/ArchbaseNavigationProgress.d.ts +10 -0
- package/dist/archbase-admin-3.0.22.tgz +0 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2265 -2111
- package/package.json +12 -11
|
@@ -6,72 +6,26 @@ interface KeepAliveVisibilityContextValue {
|
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
8
|
* Hook para acessar o estado de visibilidade do componente keep-alive.
|
|
9
|
-
* Use este hook quando precisar reagir a mudanças de visibilidade da tab,
|
|
10
|
-
* por exemplo, para recalcular dimensões de grids ou gráficos.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* import { useKeepAliveVisibility } from '@archbase/admin';
|
|
14
|
-
*
|
|
15
|
-
* function MeuGrid() {
|
|
16
|
-
* const { isVisible } = useKeepAliveVisibility();
|
|
17
|
-
* const gridRef = useRef();
|
|
18
|
-
*
|
|
19
|
-
* useEffect(() => {
|
|
20
|
-
* if (isVisible && gridRef.current) {
|
|
21
|
-
* // Força recálculo de dimensões quando tab fica visível
|
|
22
|
-
* gridRef.current.api?.sizeColumnsToFit();
|
|
23
|
-
* }
|
|
24
|
-
* }, [isVisible]);
|
|
25
|
-
*
|
|
26
|
-
* return <DataGrid ref={gridRef} ... />;
|
|
27
|
-
* }
|
|
28
9
|
*/
|
|
29
10
|
export declare const useKeepAliveVisibility: () => KeepAliveVisibilityContextValue;
|
|
30
|
-
/**
|
|
31
|
-
* Hook para acessar os parâmetros da rota atual.
|
|
32
|
-
* Este hook funciona tanto dentro quanto fora do contexto do React Router Routes,
|
|
33
|
-
* sendo essencial para componentes que usam keepAlive.
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* // Dentro de um componente com keepAlive
|
|
37
|
-
* const { id } = useArchbaseRouteParams();
|
|
38
|
-
*/
|
|
39
11
|
export declare const useArchbaseRouteParams: <T extends Params<string> = Params<string>>() => T;
|
|
40
|
-
/**
|
|
41
|
-
* Hook de compatibilidade que funciona tanto com React Router quanto com keep-alive.
|
|
42
|
-
*
|
|
43
|
-
* Este hook tenta obter os parâmetros do React Router primeiro. Se não encontrar
|
|
44
|
-
* parâmetros (objeto vazio ou todos os valores undefined), usa o contexto do keep-alive.
|
|
45
|
-
*
|
|
46
|
-
* Use este hook como substituto direto do useParams do React Router para garantir
|
|
47
|
-
* compatibilidade com componentes que podem ou não usar keepAlive.
|
|
48
|
-
*
|
|
49
|
-
* @example
|
|
50
|
-
* // Substitui useParams do react-router-dom
|
|
51
|
-
* import { useParams } from '@archbase/admin';
|
|
52
|
-
* const { id } = useParams<{ id: string }>();
|
|
53
|
-
*
|
|
54
|
-
* @example
|
|
55
|
-
* // Funciona tanto com keepAlive: true quanto keepAlive: false
|
|
56
|
-
* const { id, slug } = useParams<{ id: string; slug: string }>();
|
|
57
|
-
*/
|
|
58
12
|
export declare const useParams: <T extends Params<string> = Params<string>>() => T;
|
|
59
|
-
interface CachedComponent {
|
|
60
|
-
element: ReactNode;
|
|
61
|
-
params: Params<string>;
|
|
62
|
-
lastAccessedAt: number;
|
|
63
|
-
}
|
|
64
13
|
interface KeepAliveCacheContextValue {
|
|
65
|
-
|
|
66
|
-
requestedUnregister: Set<string>;
|
|
67
|
-
register: (cacheKey: string, component: ReactNode, params: Params<string>) => void;
|
|
68
|
-
unregister: (cacheKey: string) => void;
|
|
69
|
-
updateParams: (cacheKey: string, params: Params<string>) => void;
|
|
14
|
+
/** @deprecated Use destroy() instead */
|
|
70
15
|
requestUnregister: (path: string) => void;
|
|
71
|
-
|
|
72
|
-
|
|
16
|
+
destroy: (cacheKey: string) => void;
|
|
17
|
+
destroyAll: () => void;
|
|
18
|
+
destroyOther: (cacheKey: string) => void;
|
|
19
|
+
getCacheNodes: () => any[];
|
|
73
20
|
}
|
|
74
21
|
export declare const useKeepAliveCache: () => KeepAliveCacheContextValue;
|
|
22
|
+
/**
|
|
23
|
+
* Provider separado para o cache context. Deve envolver tanto o TabContainer
|
|
24
|
+
* quanto o ArchbaseAliveAbleRoutes para que ambos tenham acesso ao cache.
|
|
25
|
+
*/
|
|
26
|
+
export declare const KeepAliveCacheProvider: ({ children }: {
|
|
27
|
+
children: ReactNode;
|
|
28
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
75
29
|
export interface ArchbaseKeepAliveRouteProps extends Omit<RouteProps, 'element'> {
|
|
76
30
|
component?: ReactNode | React.ComponentType;
|
|
77
31
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface NavigationProgressContextValue {
|
|
3
|
+
start: () => void;
|
|
4
|
+
done: () => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const useNavigationProgress: () => NavigationProgressContextValue;
|
|
7
|
+
export declare function NavigationProgressProvider({ children }: {
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
Binary file
|
package/dist/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.archbase-admin-action{position:relative;display:block;width:100%;padding:.625rem .75rem;border-radius:var(--mantine-radius-sm)}.archbase-admin-action:hover{background-color:light-dark(var(--mantine-color-gray-1),var(--mantine-color-dark-4))}
|
|
1
|
+
.archbase-admin-action{position:relative;display:block;width:100%;padding:.625rem .75rem;border-radius:var(--mantine-radius-sm)}.archbase-admin-action:hover{background-color:light-dark(var(--mantine-color-gray-1),var(--mantine-color-dark-4))}.archbase-nav-progress{position:fixed;top:0;left:0;width:100%;height:3px;z-index:9999;pointer-events:none;opacity:0;transition:opacity .2s}.archbase-nav-progress[data-active=true]{opacity:1}.archbase-nav-progress-bar{height:100%;background:var(--mantine-primary-color-filled, #228be6);border-radius:0 2px 2px 0;animation:archbase-nav-progress-indeterminate 1.2s ease-in-out infinite;transform-origin:left}@keyframes archbase-nav-progress-indeterminate{0%{width:0%;margin-left:0%}50%{width:60%;margin-left:20%}to{width:0%;margin-left:100%}}
|
package/dist/index.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export { ArchbaseNavigationContext, ArchbaseNavigationProvider, useArchbaseNavig
|
|
|
16
16
|
export type { ArchbaseNavigationContextValues, ArchbaseNavigationListenerType } from './ArchbaseNavigation.context';
|
|
17
17
|
export { navigationDataSample } from './navigationData';
|
|
18
18
|
export type { ArchbaseNavigationItem, ArchbaseCommandColor, ArchbaseCommandMenu, ArchbaseOwner, ArchbaseCompany, ArchbaseTabItem, LocationDataItem, } from './types';
|
|
19
|
-
export { ArchbaseKeepAliveRoute, ArchbaseAliveAbleRoutes, useKeepAliveVisibility, useArchbaseRouteParams, useParams, useKeepAliveCache } from './ArchbaseAliveAbleRoutes';
|
|
19
|
+
export { ArchbaseKeepAliveRoute, ArchbaseAliveAbleRoutes, KeepAliveCacheProvider, useKeepAliveVisibility, useArchbaseRouteParams, useParams, useKeepAliveCache } from './ArchbaseAliveAbleRoutes';
|
|
20
20
|
export type { ArchbaseKeepAliveRouteProps, ArchbaseAliveAbleRoutesProps } from './ArchbaseAliveAbleRoutes';
|
|
21
21
|
export type { CommandPaletteButtonProps, ArchbaseSpotlightActionData } from './CommandPaletteButton';
|
|
22
22
|
export { CommandPaletteButton } from './CommandPaletteButton';
|
|
@@ -33,4 +33,5 @@ export { ArchbaseDrawerTrigger } from './drawer/DrawerTrigger';
|
|
|
33
33
|
export { useArchbaseDrawer } from './drawer/useArchbaseDrawer';
|
|
34
34
|
export { ArchbaseMyProfileModal, defaultMyProfileModalOptions } from './ArchbaseMyProfileModal';
|
|
35
35
|
export type { ArchbaseMyProfileModalProps, MyProfileModalOptions } from './ArchbaseMyProfileModal';
|
|
36
|
+
export { NavigationProgressProvider, useNavigationProgress } from './ArchbaseNavigationProgress';
|
|
36
37
|
export * from './hooks';
|