@archbase/layout 3.0.25 → 4.0.0
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/containers/index.d.ts +2 -0
- package/dist/containers/mosaic/ArchbaseMosaicLayout.d.ts +43 -0
- package/dist/containers/mosaic/index.d.ts +3 -0
- package/dist/containers/resizable/ArchbaseResizableLayout.d.ts +113 -0
- package/dist/containers/resizable/index.d.ts +2 -0
- package/dist/containers/split-pane/ArchbaseSplitPane.d.ts +18 -27
- package/dist/index.js +1084 -846
- package/package.json +9 -8
|
@@ -5,3 +5,5 @@ export * from './window';
|
|
|
5
5
|
export * from './split-pane';
|
|
6
6
|
export { ArchbaseDockableContainer } from './ArchbaseDockableContainer';
|
|
7
7
|
export type { ArchbaseDockableContainerProps } from './ArchbaseDockableContainer';
|
|
8
|
+
export * from './mosaic';
|
|
9
|
+
export * from './resizable';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { default as React, CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { MosaicNode, MosaicDirection } from 'react-mosaic-component';
|
|
3
|
+
export interface ArchbaseMosaicPanelDef {
|
|
4
|
+
/** Unique identifier for the panel */
|
|
5
|
+
id: string;
|
|
6
|
+
/** Title displayed in the panel header */
|
|
7
|
+
title: string;
|
|
8
|
+
/** Optional icon displayed alongside the title */
|
|
9
|
+
icon?: ReactNode;
|
|
10
|
+
/** The content to render inside the panel */
|
|
11
|
+
component: ReactNode | (() => ReactNode);
|
|
12
|
+
/** Whether the panel can be closed. Defaults to true */
|
|
13
|
+
closable?: boolean;
|
|
14
|
+
/** Custom toolbar controls for the panel window */
|
|
15
|
+
toolbarControls?: ReactNode[];
|
|
16
|
+
}
|
|
17
|
+
export interface ArchbaseMosaicLayoutProps {
|
|
18
|
+
/** Map of panel definitions keyed by panel id */
|
|
19
|
+
panels: Record<string, ArchbaseMosaicPanelDef>;
|
|
20
|
+
/** The initial mosaic tree layout structure */
|
|
21
|
+
initialLayout: MosaicNode<string>;
|
|
22
|
+
/** Callback fired when the layout changes */
|
|
23
|
+
onChange?: (layout: MosaicNode<string> | null) => void;
|
|
24
|
+
/** Callback fired when a panel is closed */
|
|
25
|
+
onPanelClose?: (panelId: string) => void;
|
|
26
|
+
/** View shown when no panels are open */
|
|
27
|
+
zeroStateView?: ReactNode;
|
|
28
|
+
/** Resize configuration */
|
|
29
|
+
resize?: {
|
|
30
|
+
minimumPaneSizePercentage?: number;
|
|
31
|
+
};
|
|
32
|
+
/** Custom inline style */
|
|
33
|
+
style?: CSSProperties;
|
|
34
|
+
/** Custom CSS class name */
|
|
35
|
+
className?: string;
|
|
36
|
+
/** Height of the mosaic container */
|
|
37
|
+
height?: string | number;
|
|
38
|
+
/** Width of the mosaic container */
|
|
39
|
+
width?: string | number;
|
|
40
|
+
}
|
|
41
|
+
declare const ArchbaseMosaicLayout: React.FC<ArchbaseMosaicLayoutProps>;
|
|
42
|
+
export { ArchbaseMosaicLayout };
|
|
43
|
+
export type { MosaicNode, MosaicDirection };
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
export interface ArchbaseResizablePanelDef {
|
|
3
|
+
/** Identificador único do painel */
|
|
4
|
+
id: string;
|
|
5
|
+
/** Conteúdo do painel */
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/** Tamanho padrão do painel em porcentagem */
|
|
8
|
+
defaultSize?: number;
|
|
9
|
+
/** Tamanho mínimo do painel em porcentagem (default 10) */
|
|
10
|
+
minSize?: number;
|
|
11
|
+
/** Tamanho máximo do painel em porcentagem */
|
|
12
|
+
maxSize?: number;
|
|
13
|
+
/** Permite colapsar o painel (default false) */
|
|
14
|
+
collapsible?: boolean;
|
|
15
|
+
/** Tamanho colapsado em porcentagem (default 0) */
|
|
16
|
+
collapsedSize?: number;
|
|
17
|
+
/** Ordem de renderização */
|
|
18
|
+
order?: number;
|
|
19
|
+
}
|
|
20
|
+
export interface ArchbaseResizableLayoutProps {
|
|
21
|
+
/** Direção do layout (default 'horizontal') */
|
|
22
|
+
direction?: 'horizontal' | 'vertical';
|
|
23
|
+
/** Definições dos painéis */
|
|
24
|
+
panels: ArchbaseResizablePanelDef[];
|
|
25
|
+
/** Callback quando o layout muda */
|
|
26
|
+
onLayout?: (sizes: number[]) => void;
|
|
27
|
+
/** Identificador para salvar o layout no localStorage */
|
|
28
|
+
autoSaveId?: string;
|
|
29
|
+
/** Tamanho da alça de redimensionamento em pixels (default 4) */
|
|
30
|
+
handleSize?: number;
|
|
31
|
+
/** ClassName adicional para a alça */
|
|
32
|
+
handleClassName?: string;
|
|
33
|
+
/** Exibe indicador de grip na alça (default true) */
|
|
34
|
+
showHandleGrip?: boolean;
|
|
35
|
+
/** Estilo do container */
|
|
36
|
+
style?: CSSProperties;
|
|
37
|
+
/** ClassName do container */
|
|
38
|
+
className?: string;
|
|
39
|
+
/** Altura do container */
|
|
40
|
+
height?: string | number;
|
|
41
|
+
/** Largura do container */
|
|
42
|
+
width?: string | number;
|
|
43
|
+
}
|
|
44
|
+
export interface ArchbaseResizablePanelProps {
|
|
45
|
+
children: ReactNode;
|
|
46
|
+
/** Identificador único */
|
|
47
|
+
id?: string;
|
|
48
|
+
/** Tamanho padrão em porcentagem */
|
|
49
|
+
defaultSize?: number;
|
|
50
|
+
/** Tamanho mínimo em porcentagem */
|
|
51
|
+
minSize?: number;
|
|
52
|
+
/** Tamanho máximo em porcentagem */
|
|
53
|
+
maxSize?: number;
|
|
54
|
+
/** Permite colapsar */
|
|
55
|
+
collapsible?: boolean;
|
|
56
|
+
/** Tamanho colapsado */
|
|
57
|
+
collapsedSize?: number;
|
|
58
|
+
/** Ordem de renderização */
|
|
59
|
+
order?: number;
|
|
60
|
+
/** Estilo do painel */
|
|
61
|
+
style?: CSSProperties;
|
|
62
|
+
/** ClassName do painel */
|
|
63
|
+
className?: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Wrapper sobre Panel do react-resizable-panels.
|
|
67
|
+
* Pode ser usado de forma standalone (fora do ArchbaseResizableLayout)
|
|
68
|
+
* quando se deseja montar o layout manualmente.
|
|
69
|
+
*/
|
|
70
|
+
export declare const ArchbaseResizablePanel: {
|
|
71
|
+
({ children, id, defaultSize, minSize, maxSize, collapsible, collapsedSize, order, style, className, }: ArchbaseResizablePanelProps): import("react/jsx-runtime").JSX.Element;
|
|
72
|
+
displayName: string;
|
|
73
|
+
};
|
|
74
|
+
export interface ArchbaseResizableHandleProps {
|
|
75
|
+
/** Direção do handle – define a orientação do grip */
|
|
76
|
+
direction?: 'horizontal' | 'vertical';
|
|
77
|
+
/** Tamanho do handle em pixels (default 4) */
|
|
78
|
+
size?: number;
|
|
79
|
+
/** ClassName adicional */
|
|
80
|
+
className?: string;
|
|
81
|
+
/** Exibe indicador de grip (default true) */
|
|
82
|
+
showGrip?: boolean;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Wrapper sobre PanelResizeHandle do react-resizable-panels.
|
|
86
|
+
* Pode ser usado de forma standalone quando se deseja montar o layout manualmente.
|
|
87
|
+
*/
|
|
88
|
+
export declare const ArchbaseResizableHandle: {
|
|
89
|
+
({ direction, size, className, showGrip, }: ArchbaseResizableHandleProps): import("react/jsx-runtime").JSX.Element;
|
|
90
|
+
displayName: string;
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* ArchbaseResizableLayout
|
|
94
|
+
*
|
|
95
|
+
* Wrapper declarativo sobre react-resizable-panels.
|
|
96
|
+
* Recebe um array de `panels` e renderiza o PanelGroup com handles entre eles.
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```tsx
|
|
100
|
+
* <ArchbaseResizableLayout
|
|
101
|
+
* direction="horizontal"
|
|
102
|
+
* autoSaveId="main-layout"
|
|
103
|
+
* panels={[
|
|
104
|
+
* { id: 'sidebar', children: <Sidebar />, defaultSize: 25, minSize: 15, collapsible: true },
|
|
105
|
+
* { id: 'content', children: <Content />, defaultSize: 75 },
|
|
106
|
+
* ]}
|
|
107
|
+
* />
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
export declare const ArchbaseResizableLayout: {
|
|
111
|
+
({ direction, panels, onLayout, autoSaveId, handleSize, handleClassName, showHandleGrip, style, className, height, width, }: ArchbaseResizableLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
112
|
+
displayName: string;
|
|
113
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { ArchbaseResizableLayout, ArchbaseResizablePanel, ArchbaseResizableHandle, } from './ArchbaseResizableLayout';
|
|
2
|
+
export type { ArchbaseResizableLayoutProps, ArchbaseResizablePanelDef, ArchbaseResizablePanelProps, ArchbaseResizableHandleProps, } from './ArchbaseResizableLayout';
|
|
@@ -39,21 +39,29 @@ export interface ArchbaseSplitPaneProps {
|
|
|
39
39
|
* ClassName adicional
|
|
40
40
|
*/
|
|
41
41
|
className?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Chave para persistir layout no localStorage
|
|
44
|
+
*/
|
|
45
|
+
autoSaveId?: string;
|
|
42
46
|
}
|
|
43
47
|
export interface ArchbaseSplitPanePaneProps {
|
|
44
48
|
children: ReactNode;
|
|
45
49
|
/**
|
|
46
|
-
* Tamanho mínimo do painel em
|
|
50
|
+
* Tamanho mínimo do painel em porcentagem
|
|
47
51
|
*/
|
|
48
52
|
minSize?: number | string;
|
|
49
53
|
/**
|
|
50
|
-
* Tamanho máximo do painel em
|
|
54
|
+
* Tamanho máximo do painel em porcentagem
|
|
51
55
|
*/
|
|
52
56
|
maxSize?: number | string;
|
|
53
57
|
/**
|
|
54
|
-
* Tamanho padrão do painel em
|
|
58
|
+
* Tamanho padrão do painel em porcentagem
|
|
55
59
|
*/
|
|
56
60
|
defaultSize?: number | string;
|
|
61
|
+
/**
|
|
62
|
+
* Permitir colapsar o painel
|
|
63
|
+
*/
|
|
64
|
+
collapsible?: boolean;
|
|
57
65
|
/**
|
|
58
66
|
* Estilo adicional do painel
|
|
59
67
|
*/
|
|
@@ -76,49 +84,32 @@ export interface ArchbaseSplitPaneResizerProps {
|
|
|
76
84
|
/**
|
|
77
85
|
* Componente ArchbaseSplitPane
|
|
78
86
|
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
* editores com preview, etc.
|
|
87
|
+
* Layout redimensionável com painéis divisórios baseado em react-resizable-panels.
|
|
88
|
+
* Ideal para master-detail views, painéis laterais, editores com preview, etc.
|
|
82
89
|
*
|
|
83
90
|
* @example
|
|
84
91
|
* ```tsx
|
|
85
92
|
* <ArchbaseSplitPane direction="row">
|
|
86
|
-
* <ArchbaseSplitPanePane>
|
|
93
|
+
* <ArchbaseSplitPanePane defaultSize={30}>
|
|
87
94
|
* <FilterPanel />
|
|
88
95
|
* </ArchbaseSplitPanePane>
|
|
89
96
|
* <ArchbaseSplitPaneResizer />
|
|
90
|
-
* <ArchbaseSplitPanePane>
|
|
97
|
+
* <ArchbaseSplitPanePane defaultSize={70}>
|
|
91
98
|
* <ArchbaseDataGrid />
|
|
92
99
|
* </ArchbaseSplitPanePane>
|
|
93
100
|
* </ArchbaseSplitPane>
|
|
94
101
|
* ```
|
|
95
102
|
*/
|
|
96
|
-
export declare const ArchbaseSplitPane: ({ children, direction, splitterSize, splitterColor, splitterHoverColor,
|
|
103
|
+
export declare const ArchbaseSplitPane: ({ children, direction, splitterSize, splitterColor, splitterHoverColor, style, className, autoSaveId, }: ArchbaseSplitPaneProps) => import("react/jsx-runtime").JSX.Element;
|
|
97
104
|
/**
|
|
98
105
|
* Componente ArchbaseSplitPanePane
|
|
99
106
|
*
|
|
100
107
|
* Representa um painel individual dentro do ArchbaseSplitPane.
|
|
101
|
-
* Deve ser usado como filho direto de ArchbaseSplitPane.
|
|
102
|
-
*
|
|
103
|
-
* @example
|
|
104
|
-
* ```tsx
|
|
105
|
-
* <ArchbaseSplitPanePane minSize={200} maxSize={600}>
|
|
106
|
-
* <Content />
|
|
107
|
-
* </ArchbaseSplitPanePane>
|
|
108
|
-
* ```
|
|
109
108
|
*/
|
|
110
|
-
export declare const ArchbaseSplitPanePane: ({ children, minSize, maxSize, defaultSize, style, className, }: ArchbaseSplitPanePaneProps) => import("react/jsx-runtime").JSX.Element;
|
|
109
|
+
export declare const ArchbaseSplitPanePane: ({ children, minSize, maxSize, defaultSize, collapsible, style, className, }: ArchbaseSplitPanePaneProps) => import("react/jsx-runtime").JSX.Element;
|
|
111
110
|
/**
|
|
112
111
|
* Componente ArchbaseSplitPaneResizer
|
|
113
112
|
*
|
|
114
113
|
* Barra divisória arrastável entre painéis.
|
|
115
|
-
* Deve ser usado entre ArchbaseSplitPanePane components.
|
|
116
|
-
*
|
|
117
|
-
* @example
|
|
118
|
-
* ```tsx
|
|
119
|
-
* <ArchbaseSplitPanePane>...</ArchbaseSplitPanePane>
|
|
120
|
-
* <ArchbaseSplitPaneResizer />
|
|
121
|
-
* <ArchbaseSplitPanePane>...</ArchbaseSplitPanePane>
|
|
122
|
-
* ```
|
|
123
114
|
*/
|
|
124
|
-
export declare const ArchbaseSplitPaneResizer: ({ style, className, }: ArchbaseSplitPaneResizerProps) => import("react/jsx-runtime").JSX.Element;
|
|
115
|
+
export declare const ArchbaseSplitPaneResizer: ({ style, className, ...props }: ArchbaseSplitPaneResizerProps & Record<string, any>) => import("react/jsx-runtime").JSX.Element;
|