@archbase/layout 3.0.0 → 3.0.3
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/LICENSE +21 -0
- package/README.md +51 -0
- package/dist/ArchbaseCard.d.ts +2 -0
- package/dist/ArchbaseContainer.d.ts +2 -0
- package/dist/ArchbaseGroup.d.ts +2 -0
- package/dist/ArchbaseStack.d.ts +2 -0
- package/dist/barrel-exports.d.ts +12 -0
- package/dist/containers/ArchbaseDockableContainer.d.ts +17 -0
- package/dist/containers/advancedtabs/ArchbaseAdvancedTabs.d.ts +47 -0
- package/dist/containers/advancedtabs/index.d.ts +2 -0
- package/dist/containers/form/ArchbaseForm.d.ts +5 -0
- package/dist/containers/form/index.d.ts +1 -0
- package/dist/containers/index.d.ts +7 -0
- package/dist/containers/split-pane/ArchbaseSplitPane.d.ts +124 -0
- package/dist/containers/split-pane/index.d.ts +2 -0
- package/dist/containers/window/ArchbaseFloatingWindow.d.ts +23 -0
- package/dist/containers/window/index.d.ts +2 -0
- package/dist/containers/window/setupTests.d.ts +0 -0
- package/dist/dock/ArchbaseDockLayout.d.ts +2 -0
- package/dist/dock/ArchbaseDockLayout.types.d.ts +50 -0
- package/dist/dock/ArchbaseDockLayoutPreset.d.ts +5 -0
- package/dist/dock/index.d.ts +3 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +1 -1
- package/dist/spaces/components/ArchbaseSpace.d.ts +6 -0
- package/dist/spaces/components/ArchbaseSpaceAnchored.d.ts +88 -0
- package/dist/spaces/components/ArchbaseSpaceCentered.d.ts +6 -0
- package/dist/spaces/components/ArchbaseSpaceCenteredVertically.d.ts +6 -0
- package/dist/spaces/components/ArchbaseSpaceCustom.d.ts +18 -0
- package/dist/spaces/components/ArchbaseSpaceFill.d.ts +3 -0
- package/dist/spaces/components/ArchbaseSpaceFixed.d.ts +9 -0
- package/dist/spaces/components/ArchbaseSpaceInfo.d.ts +9 -0
- package/dist/spaces/components/ArchbaseSpaceLayer.d.ts +7 -0
- package/dist/spaces/components/ArchbaseSpaceOptions.d.ts +7 -0
- package/dist/spaces/components/ArchbaseSpacePositioned.d.ts +16 -0
- package/dist/spaces/components/ArchbaseSpaceViewPort.d.ts +11 -0
- package/dist/spaces/components/index.d.ts +11 -0
- package/dist/spaces/core-dragging.d.ts +8 -0
- package/dist/spaces/core-react.d.ts +78 -0
- package/dist/spaces/core-resizing.d.ts +12 -0
- package/dist/spaces/core-types.d.ts +167 -0
- package/dist/spaces/core-utils.d.ts +12 -0
- package/dist/spaces/core.d.ts +2 -0
- package/dist/spaces/index.d.ts +5 -0
- package/package.json +12 -11
- package/dist/archbase-layout-3.0.0.tgz +0 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Edson Martins
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# @archbase/layout
|
|
2
|
+
|
|
3
|
+
Layout components for Archbase React.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @archbase/layout
|
|
9
|
+
# or
|
|
10
|
+
pnpm add @archbase/layout
|
|
11
|
+
# or
|
|
12
|
+
yarn add @archbase/layout
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Features
|
|
16
|
+
|
|
17
|
+
- **Split Pane**: Resizable split panes
|
|
18
|
+
- **Dock Layout**: Advanced dock layout system using Dockview
|
|
19
|
+
- **Responsive Layout**: Mobile-friendly layout components
|
|
20
|
+
- **Sidebar Components**: Collapsible sidebar components
|
|
21
|
+
- **Header/Footer**: Reusable header and footer components
|
|
22
|
+
|
|
23
|
+
## Dependencies
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
{
|
|
27
|
+
"@mantine/core": "8.3.12",
|
|
28
|
+
"@mantine/hooks": "8.3.12",
|
|
29
|
+
"@tabler/icons-react": "^3.27.0",
|
|
30
|
+
"react": ">=18.0.0",
|
|
31
|
+
"react-dom": ">=18.0.0"
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Usage
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
import {
|
|
39
|
+
SplitPane,
|
|
40
|
+
DockLayout,
|
|
41
|
+
ArchbaseLayout
|
|
42
|
+
} from '@archbase/layout';
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## License
|
|
46
|
+
|
|
47
|
+
MIT © Edson Martins
|
|
48
|
+
|
|
49
|
+
## Documentation
|
|
50
|
+
|
|
51
|
+
For full documentation, visit [https://react.archbase.dev](https://react.archbase.dev)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { ArchbaseSpaceCentered } from './spaces/components/ArchbaseSpaceCentered';
|
|
2
|
+
export { ArchbaseSpaceCenteredVertically } from './spaces/components/ArchbaseSpaceCenteredVertically';
|
|
3
|
+
export { ArchbaseSpaceCustom } from './spaces/components/ArchbaseSpaceCustom';
|
|
4
|
+
export { ArchbaseSpaceFill } from './spaces/components/ArchbaseSpaceFill';
|
|
5
|
+
export { ArchbaseSpaceFixed } from './spaces/components/ArchbaseSpaceFixed';
|
|
6
|
+
export { ArchbaseSpaceLayer } from './spaces/components/ArchbaseSpaceLayer';
|
|
7
|
+
export { ArchbaseSpacePositioned } from './spaces/components/ArchbaseSpacePositioned';
|
|
8
|
+
export { ArchbaseSpaceInfo } from './spaces/components/ArchbaseSpaceInfo';
|
|
9
|
+
export { ArchbaseSpaceViewPort } from './spaces/components/ArchbaseSpaceViewPort';
|
|
10
|
+
export { ArchbaseSpaceOptions } from './spaces/components/ArchbaseSpaceOptions';
|
|
11
|
+
export { ArchbaseSpaceTop, ArchbaseSpaceBottom, ArchbaseSpaceLeft, ArchbaseSpaceRight, ArchbaseSpaceTopResizable, ArchbaseSpaceBottomResizable, ArchbaseSpaceLeftResizable, ArchbaseSpaceRightResizable } from './spaces/components/ArchbaseSpaceAnchored';
|
|
12
|
+
export { ArchbaseForm } from './containers/form/ArchbaseForm';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface ArchbaseDockableContainerProps {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
title: string;
|
|
5
|
+
reducedTitle: string;
|
|
6
|
+
containerWidth?: string;
|
|
7
|
+
backgroundColor?: string;
|
|
8
|
+
hiddenBackgroundColor?: string;
|
|
9
|
+
withBorder?: boolean;
|
|
10
|
+
hiddenWidth?: string;
|
|
11
|
+
position?: 'left' | 'right';
|
|
12
|
+
onShow?: () => void;
|
|
13
|
+
onHide?: () => void;
|
|
14
|
+
defaultIsDocked?: boolean;
|
|
15
|
+
defaultIsVisible?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare const ArchbaseDockableContainer: ({ children, title, reducedTitle, containerWidth, backgroundColor, hiddenBackgroundColor, withBorder, hiddenWidth, position, onShow, onHide, defaultIsDocked, defaultIsVisible, }: ArchbaseDockableContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { default as React, CSSProperties, ReactNode } from 'react';
|
|
2
|
+
export interface ArchbaseAdvancedTabItem {
|
|
3
|
+
key: any;
|
|
4
|
+
favicon: ReactNode | string | undefined;
|
|
5
|
+
title: string;
|
|
6
|
+
customTitle?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ArchbaseAdvancedTabProps {
|
|
9
|
+
favicon: ReactNode | string | undefined;
|
|
10
|
+
title: string;
|
|
11
|
+
/** Título customizado que aparecerá na aba. Pode ser utilizado $title para interpolar o valor na string do customTitle */
|
|
12
|
+
customTitle?: string;
|
|
13
|
+
activeTab: boolean;
|
|
14
|
+
position: number;
|
|
15
|
+
contentWidth: number;
|
|
16
|
+
onClick: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
17
|
+
onClose: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
18
|
+
setDragging: Function;
|
|
19
|
+
tabsContentWidth: number;
|
|
20
|
+
animateTabMove: Function;
|
|
21
|
+
isDragging: boolean;
|
|
22
|
+
id: any;
|
|
23
|
+
index: number;
|
|
24
|
+
sorting: boolean;
|
|
25
|
+
showButtonClose: boolean;
|
|
26
|
+
onCloseAllTabs?: () => void;
|
|
27
|
+
onCloseLeftTabs?: (tabId: string) => void;
|
|
28
|
+
onCloseRightTabs?: (tabId: string) => void;
|
|
29
|
+
onCloseOtherTabs?: (tabId: string) => void;
|
|
30
|
+
totalTabs?: number;
|
|
31
|
+
}
|
|
32
|
+
export interface ArchbaseAdvancedTabsProps {
|
|
33
|
+
currentTabs: ArchbaseAdvancedTabItem[];
|
|
34
|
+
buttonCloseOnlyActiveTab: boolean;
|
|
35
|
+
activeTab: any;
|
|
36
|
+
onTabChange: Function;
|
|
37
|
+
onTabClose: Function;
|
|
38
|
+
className?: string;
|
|
39
|
+
style?: CSSProperties;
|
|
40
|
+
dark: boolean;
|
|
41
|
+
onClick: Function;
|
|
42
|
+
onCloseAllTabs?: () => void;
|
|
43
|
+
onCloseLeftTabs?: (tabId: string) => void;
|
|
44
|
+
onCloseRightTabs?: (tabId: string) => void;
|
|
45
|
+
onCloseOtherTabs?: (tabId: string) => void;
|
|
46
|
+
}
|
|
47
|
+
export declare const ArchbaseAdvancedTabs: React.FC<ArchbaseAdvancedTabsProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ArchbaseForm } from './ArchbaseForm';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './form';
|
|
2
|
+
export * from '../spaces';
|
|
3
|
+
export * from './advancedtabs';
|
|
4
|
+
export * from './window';
|
|
5
|
+
export * from './split-pane';
|
|
6
|
+
export { ArchbaseDockableContainer } from './ArchbaseDockableContainer';
|
|
7
|
+
export type { ArchbaseDockableContainerProps } from './ArchbaseDockableContainer';
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
export interface ArchbaseSplitPaneProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
/**
|
|
5
|
+
* Direção do split
|
|
6
|
+
* @default 'row'
|
|
7
|
+
*/
|
|
8
|
+
direction?: 'row' | 'column';
|
|
9
|
+
/**
|
|
10
|
+
* Tamanho do separador em pixels
|
|
11
|
+
* @default 4
|
|
12
|
+
*/
|
|
13
|
+
splitterSize?: number | string;
|
|
14
|
+
/**
|
|
15
|
+
* Cor do separador
|
|
16
|
+
*/
|
|
17
|
+
splitterColor?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Cor do separador em hover
|
|
20
|
+
*/
|
|
21
|
+
splitterHoverColor?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Raio da barra divisória
|
|
24
|
+
*/
|
|
25
|
+
splitterRadius?: number | string;
|
|
26
|
+
/**
|
|
27
|
+
* Exibe knob na barra divisória
|
|
28
|
+
*/
|
|
29
|
+
withKnob?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Opacidade da barra divisória
|
|
32
|
+
*/
|
|
33
|
+
opacity?: number | string;
|
|
34
|
+
/**
|
|
35
|
+
* Estilo adicional do container
|
|
36
|
+
*/
|
|
37
|
+
style?: React.CSSProperties;
|
|
38
|
+
/**
|
|
39
|
+
* ClassName adicional
|
|
40
|
+
*/
|
|
41
|
+
className?: string;
|
|
42
|
+
}
|
|
43
|
+
export interface ArchbaseSplitPanePaneProps {
|
|
44
|
+
children: ReactNode;
|
|
45
|
+
/**
|
|
46
|
+
* Tamanho mínimo do painel em pixels
|
|
47
|
+
*/
|
|
48
|
+
minSize?: number | string;
|
|
49
|
+
/**
|
|
50
|
+
* Tamanho máximo do painel em pixels
|
|
51
|
+
*/
|
|
52
|
+
maxSize?: number | string;
|
|
53
|
+
/**
|
|
54
|
+
* Tamanho padrão do painel em pixels ou porcentagem
|
|
55
|
+
*/
|
|
56
|
+
defaultSize?: number | string;
|
|
57
|
+
/**
|
|
58
|
+
* Estilo adicional do painel
|
|
59
|
+
*/
|
|
60
|
+
style?: React.CSSProperties;
|
|
61
|
+
/**
|
|
62
|
+
* ClassName adicional
|
|
63
|
+
*/
|
|
64
|
+
className?: string;
|
|
65
|
+
}
|
|
66
|
+
export interface ArchbaseSplitPaneResizerProps {
|
|
67
|
+
/**
|
|
68
|
+
* Estilo adicional do resizer
|
|
69
|
+
*/
|
|
70
|
+
style?: React.CSSProperties;
|
|
71
|
+
/**
|
|
72
|
+
* ClassName adicional
|
|
73
|
+
*/
|
|
74
|
+
className?: string;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Componente ArchbaseSplitPane
|
|
78
|
+
*
|
|
79
|
+
* Wrapper sobre @gfazioli/mantine-split-pane para criar layouts redimensionáveis
|
|
80
|
+
* com painéis divisórios. Ideal para master-detail views, painéis laterais,
|
|
81
|
+
* editores com preview, etc.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```tsx
|
|
85
|
+
* <ArchbaseSplitPane direction="row">
|
|
86
|
+
* <ArchbaseSplitPanePane>
|
|
87
|
+
* <FilterPanel />
|
|
88
|
+
* </ArchbaseSplitPanePane>
|
|
89
|
+
* <ArchbaseSplitPaneResizer />
|
|
90
|
+
* <ArchbaseSplitPanePane>
|
|
91
|
+
* <ArchbaseDataGrid />
|
|
92
|
+
* </ArchbaseSplitPanePane>
|
|
93
|
+
* </ArchbaseSplitPane>
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
export declare const ArchbaseSplitPane: ({ children, direction, splitterSize, splitterColor, splitterHoverColor, splitterRadius, withKnob, opacity, style, className, }: ArchbaseSplitPaneProps) => import("react/jsx-runtime").JSX.Element;
|
|
97
|
+
/**
|
|
98
|
+
* Componente ArchbaseSplitPanePane
|
|
99
|
+
*
|
|
100
|
+
* 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
|
+
*/
|
|
110
|
+
export declare const ArchbaseSplitPanePane: ({ children, minSize, maxSize, defaultSize, style, className, }: ArchbaseSplitPanePaneProps) => import("react/jsx-runtime").JSX.Element;
|
|
111
|
+
/**
|
|
112
|
+
* Componente ArchbaseSplitPaneResizer
|
|
113
|
+
*
|
|
114
|
+
* 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
|
+
*/
|
|
124
|
+
export declare const ArchbaseSplitPaneResizer: ({ style, className, }: ArchbaseSplitPaneResizerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface ArchbaseFloatingWindowProps {
|
|
3
|
+
id: string;
|
|
4
|
+
children?: any;
|
|
5
|
+
height: number;
|
|
6
|
+
width: number;
|
|
7
|
+
top?: number;
|
|
8
|
+
left?: number;
|
|
9
|
+
resizable?: boolean;
|
|
10
|
+
titleBar?: {
|
|
11
|
+
icon?: string | HTMLImageElement;
|
|
12
|
+
title?: string;
|
|
13
|
+
buttons?: {
|
|
14
|
+
minimize?: boolean;
|
|
15
|
+
maximize?: boolean;
|
|
16
|
+
close?: () => void;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
style?: React.CSSProperties;
|
|
20
|
+
/** Referência para o container que envolve o componente filho */
|
|
21
|
+
innerRef?: React.RefObject<HTMLInputElement> | undefined;
|
|
22
|
+
}
|
|
23
|
+
export declare const ArchbaseFloatingWindow: React.FC<ArchbaseFloatingWindowProps>;
|
|
File without changes
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { ArchbaseDockLayoutProps } from './ArchbaseDockLayout.types';
|
|
2
|
+
export declare function ArchbaseDockLayout({ components, defaultLayout, watermark, hideBorders, autoHideHeaders, onLayoutChange, onPanelClose, onPanelOpen, style, className, height, disabled, }: ArchbaseDockLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
export type DockComponentType = 'panel' | 'gridview' | 'splitview' | 'dockview';
|
|
3
|
+
export interface DockPanelComponent {
|
|
4
|
+
id: string;
|
|
5
|
+
title: string;
|
|
6
|
+
component: React.ComponentType<any>;
|
|
7
|
+
tabComponent?: React.ComponentType<any>;
|
|
8
|
+
params?: Record<string, any>;
|
|
9
|
+
minimumSize?: number;
|
|
10
|
+
maximumSize?: number;
|
|
11
|
+
isClosable?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface DockLayoutConfig {
|
|
14
|
+
direction?: 'horizontal' | 'vertical';
|
|
15
|
+
defaultSize?: number[];
|
|
16
|
+
minimumSize?: number[];
|
|
17
|
+
maximumSize?: number[];
|
|
18
|
+
proportions?: number[];
|
|
19
|
+
}
|
|
20
|
+
export interface ArchbaseDockLayoutProps {
|
|
21
|
+
components: Record<string, DockPanelComponent>;
|
|
22
|
+
defaultLayout?: string | object;
|
|
23
|
+
watermark?: string | ReactNode;
|
|
24
|
+
hideBorders?: boolean;
|
|
25
|
+
autoHideHeaders?: boolean;
|
|
26
|
+
onLayoutChange?: (layout: object) => void;
|
|
27
|
+
onPanelClose?: (panelId: string) => void;
|
|
28
|
+
onPanelOpen?: (panelId: string) => void;
|
|
29
|
+
style?: CSSProperties;
|
|
30
|
+
className?: string;
|
|
31
|
+
height?: string | number;
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface DockPanelProps {
|
|
35
|
+
componentId: string;
|
|
36
|
+
params?: Record<string, any>;
|
|
37
|
+
onClose?: () => void;
|
|
38
|
+
style?: CSSProperties;
|
|
39
|
+
className?: string;
|
|
40
|
+
}
|
|
41
|
+
export type DockLayoutPreset = 'dashboard' | 'ide' | 'explorer' | 'analytics' | 'custom';
|
|
42
|
+
export interface ArchbaseDockLayoutPresetProps {
|
|
43
|
+
preset: DockLayoutPreset;
|
|
44
|
+
components?: Record<string, DockPanelComponent>;
|
|
45
|
+
onPanelClose?: (panelId: string) => void;
|
|
46
|
+
onPanelOpen?: (panelId: string) => void;
|
|
47
|
+
style?: CSSProperties;
|
|
48
|
+
className?: string;
|
|
49
|
+
height?: string | number;
|
|
50
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ArchbaseDockLayoutPresetProps } from './ArchbaseDockLayout.types';
|
|
2
|
+
/**
|
|
3
|
+
* Preset de layouts para casos de uso comuns
|
|
4
|
+
*/
|
|
5
|
+
export declare function ArchbaseDockLayoutPreset({ preset, components: userComponents, onPanelClose, onPanelOpen, style, className, height, }: ArchbaseDockLayoutPresetProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { ArchbaseDockLayout } from './ArchbaseDockLayout';
|
|
2
|
+
export { ArchbaseDockLayoutPreset } from './ArchbaseDockLayoutPreset';
|
|
3
|
+
export type { ArchbaseDockLayoutProps, DockPanelComponent, DockLayoutConfig, DockPanelProps, ArchbaseDockLayoutPresetProps, DockLayoutPreset, DockComponentType, } from './ArchbaseDockLayout.types';
|
package/dist/index.d.ts
ADDED
package/dist/index.js
CHANGED
|
@@ -1039,7 +1039,7 @@ const ri = ({ children: t, ...i }) => /* @__PURE__ */ c(Vt.Provider, { value: i,
|
|
|
1039
1039
|
onCloseRightTabs: S,
|
|
1040
1040
|
onCloseOtherTabs: w,
|
|
1041
1041
|
totalTabs: I
|
|
1042
|
-
} = t, { t: B } = Ht(), [P, x] = V(0), [T, _] = V(!1), [k, N] = V(null), [q, D] = V(null), [ot, L] = V(!1), [F, tt] = V(0), [nt, U] = V(!1), lt = it(null), $ = 9, E = 84, H = 60, W = 48;
|
|
1042
|
+
} = t, { t: B } = Ht("archbase"), [P, x] = V(0), [T, _] = V(!1), [k, N] = V(null), [q, D] = V(null), [ot, L] = V(!1), [F, tt] = V(0), [nt, U] = V(!1), lt = it(null), $ = 9, E = 84, H = 60, W = 48;
|
|
1043
1043
|
et(() => (document.addEventListener("mousemove", j), document.addEventListener("mouseup", O), () => {
|
|
1044
1044
|
document.removeEventListener("mousemove", j), document.addEventListener("mouseup", O);
|
|
1045
1045
|
})), et(() => {
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IArchbaseSpaceInnerProps } from '../core-react';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export declare class ArchbaseSpace extends React.Component<IArchbaseSpaceInnerProps> {
|
|
4
|
+
_react_spaces_uniqueid?: string;
|
|
5
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { IArchbaseSpaceCommonProps, IResizeHandleProps } from '../core-react';
|
|
2
|
+
import { ResizeHandlePlacement, SizeUnit } from '../core-types';
|
|
3
|
+
import * as PropTypes from 'prop-types';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
export interface IArchbaseResizableProps extends IArchbaseSpaceCommonProps {
|
|
6
|
+
size: SizeUnit;
|
|
7
|
+
order?: number;
|
|
8
|
+
handleSize?: number;
|
|
9
|
+
touchHandleSize?: number;
|
|
10
|
+
handlePlacement?: ResizeHandlePlacement;
|
|
11
|
+
handleRender?: (handleProps: IResizeHandleProps) => React.ReactNode;
|
|
12
|
+
minimumSize?: number;
|
|
13
|
+
maximumSize?: number;
|
|
14
|
+
onResizeStart?: () => void | boolean;
|
|
15
|
+
onResizeEnd?: (newSize: SizeUnit) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare const resizableProps: {
|
|
18
|
+
size: PropTypes.Validator<NonNullable<NonNullable<string | number>>>;
|
|
19
|
+
order: PropTypes.Requireable<number>;
|
|
20
|
+
handleSize: PropTypes.Requireable<number>;
|
|
21
|
+
touchHandleSize: PropTypes.Requireable<number>;
|
|
22
|
+
handlePlacement: PropTypes.Requireable<ResizeHandlePlacement>;
|
|
23
|
+
handleRender: PropTypes.Requireable<(...args: any[]) => any>;
|
|
24
|
+
minimumSize: PropTypes.Requireable<number>;
|
|
25
|
+
maximumSize: PropTypes.Requireable<number>;
|
|
26
|
+
onResizeStart: PropTypes.Requireable<(...args: any[]) => any>;
|
|
27
|
+
onResizeEnd: PropTypes.Requireable<(...args: any[]) => any>;
|
|
28
|
+
id: PropTypes.Requireable<string>;
|
|
29
|
+
className: PropTypes.Requireable<string>;
|
|
30
|
+
style: PropTypes.Requireable<object>;
|
|
31
|
+
as: PropTypes.Requireable<any>;
|
|
32
|
+
centerContent: PropTypes.Requireable<import('..').CenterType>;
|
|
33
|
+
zIndex: PropTypes.Requireable<number>;
|
|
34
|
+
scrollable: PropTypes.Requireable<boolean>;
|
|
35
|
+
trackSize: PropTypes.Requireable<boolean>;
|
|
36
|
+
allowOverflow: PropTypes.Requireable<boolean>;
|
|
37
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
38
|
+
onDoubleClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
39
|
+
onMouseDown: PropTypes.Requireable<(...args: any[]) => any>;
|
|
40
|
+
onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>;
|
|
41
|
+
onMouseLeave: PropTypes.Requireable<(...args: any[]) => any>;
|
|
42
|
+
onMouseMove: PropTypes.Requireable<(...args: any[]) => any>;
|
|
43
|
+
onTouchStart: PropTypes.Requireable<(...args: any[]) => any>;
|
|
44
|
+
onTouchMove: PropTypes.Requireable<(...args: any[]) => any>;
|
|
45
|
+
onTouchEnd: PropTypes.Requireable<(...args: any[]) => any>;
|
|
46
|
+
};
|
|
47
|
+
export interface IArchbaseAnchorProps extends IArchbaseResizableProps {
|
|
48
|
+
resizable?: boolean;
|
|
49
|
+
}
|
|
50
|
+
export declare const anchoredProps: {
|
|
51
|
+
resizable: PropTypes.Requireable<boolean>;
|
|
52
|
+
size: PropTypes.Validator<NonNullable<NonNullable<string | number>>>;
|
|
53
|
+
order: PropTypes.Requireable<number>;
|
|
54
|
+
handleSize: PropTypes.Requireable<number>;
|
|
55
|
+
touchHandleSize: PropTypes.Requireable<number>;
|
|
56
|
+
handlePlacement: PropTypes.Requireable<ResizeHandlePlacement>;
|
|
57
|
+
handleRender: PropTypes.Requireable<(...args: any[]) => any>;
|
|
58
|
+
minimumSize: PropTypes.Requireable<number>;
|
|
59
|
+
maximumSize: PropTypes.Requireable<number>;
|
|
60
|
+
onResizeStart: PropTypes.Requireable<(...args: any[]) => any>;
|
|
61
|
+
onResizeEnd: PropTypes.Requireable<(...args: any[]) => any>;
|
|
62
|
+
id: PropTypes.Requireable<string>;
|
|
63
|
+
className: PropTypes.Requireable<string>;
|
|
64
|
+
style: PropTypes.Requireable<object>;
|
|
65
|
+
as: PropTypes.Requireable<any>;
|
|
66
|
+
centerContent: PropTypes.Requireable<import('..').CenterType>;
|
|
67
|
+
zIndex: PropTypes.Requireable<number>;
|
|
68
|
+
scrollable: PropTypes.Requireable<boolean>;
|
|
69
|
+
trackSize: PropTypes.Requireable<boolean>;
|
|
70
|
+
allowOverflow: PropTypes.Requireable<boolean>;
|
|
71
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
72
|
+
onDoubleClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
73
|
+
onMouseDown: PropTypes.Requireable<(...args: any[]) => any>;
|
|
74
|
+
onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>;
|
|
75
|
+
onMouseLeave: PropTypes.Requireable<(...args: any[]) => any>;
|
|
76
|
+
onMouseMove: PropTypes.Requireable<(...args: any[]) => any>;
|
|
77
|
+
onTouchStart: PropTypes.Requireable<(...args: any[]) => any>;
|
|
78
|
+
onTouchMove: PropTypes.Requireable<(...args: any[]) => any>;
|
|
79
|
+
onTouchEnd: PropTypes.Requireable<(...args: any[]) => any>;
|
|
80
|
+
};
|
|
81
|
+
export declare const ArchbaseSpaceLeftResizable: React.FC<IArchbaseResizableProps>;
|
|
82
|
+
export declare const ArchbaseSpaceLeft: React.FC<IArchbaseAnchorProps>;
|
|
83
|
+
export declare const ArchbaseSpaceTopResizable: React.FC<IArchbaseResizableProps>;
|
|
84
|
+
export declare const ArchbaseSpaceTop: React.FC<IArchbaseAnchorProps>;
|
|
85
|
+
export declare const ArchbaseSpaceRightResizable: React.FC<IArchbaseResizableProps>;
|
|
86
|
+
export declare const ArchbaseSpaceRight: React.FC<IArchbaseAnchorProps>;
|
|
87
|
+
export declare const ArchbaseSpaceBottomResizable: React.FC<IArchbaseResizableProps>;
|
|
88
|
+
export declare const ArchbaseSpaceBottom: React.FC<IArchbaseAnchorProps>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Type, SizeUnit, AnchorType, ResizeType } from '../core-types';
|
|
2
|
+
import { IArchbaseSpaceCommonProps } from '../core-react';
|
|
3
|
+
import { IArchbaseAnchorProps } from './ArchbaseSpaceAnchored';
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
type IArchbaseSpaceCustomProps = Omit<IArchbaseSpaceCommonProps & IArchbaseAnchorProps, "size"> & {
|
|
6
|
+
type?: Type;
|
|
7
|
+
anchor?: AnchorType;
|
|
8
|
+
anchorSize?: SizeUnit;
|
|
9
|
+
left?: SizeUnit | undefined;
|
|
10
|
+
top?: SizeUnit | undefined;
|
|
11
|
+
right?: SizeUnit | undefined;
|
|
12
|
+
bottom?: SizeUnit | undefined;
|
|
13
|
+
width?: SizeUnit | undefined;
|
|
14
|
+
height?: SizeUnit | undefined;
|
|
15
|
+
resizeTypes?: ResizeType[];
|
|
16
|
+
};
|
|
17
|
+
export declare const ArchbaseSpaceCustom: React.FC<IArchbaseSpaceCustomProps>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SizeUnit } from '../core-types';
|
|
2
|
+
import { IArchbaseSpaceCommonProps } from '../core-react';
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
interface IArchbaseSpaceFixedProps extends IArchbaseSpaceCommonProps {
|
|
5
|
+
width?: SizeUnit;
|
|
6
|
+
height: SizeUnit;
|
|
7
|
+
}
|
|
8
|
+
export declare const ArchbaseSpaceFixed: React.FC<IArchbaseSpaceFixedProps>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
interface IArchbaseSpaceSpaceInfoProps {
|
|
3
|
+
children: (info: DOMRect) => React.ReactElement;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated use useCurrentSpace() hook instead
|
|
7
|
+
*/
|
|
8
|
+
export declare const ArchbaseSpaceInfo: React.FC<IArchbaseSpaceSpaceInfoProps>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SizeUnit, ResizeType } from '../core-types';
|
|
2
|
+
import { IArchbaseSpaceCommonProps } from '../core-react';
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
interface IArchbaseSpacePositionedProps extends IArchbaseSpaceCommonProps {
|
|
5
|
+
left?: SizeUnit;
|
|
6
|
+
top?: SizeUnit;
|
|
7
|
+
right?: SizeUnit;
|
|
8
|
+
bottom?: SizeUnit;
|
|
9
|
+
width?: SizeUnit;
|
|
10
|
+
height?: SizeUnit;
|
|
11
|
+
resizable?: ResizeType[];
|
|
12
|
+
onResizeStart?: () => void | boolean;
|
|
13
|
+
onResizeEnd?: (newSize: SizeUnit) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare const ArchbaseSpacePositioned: React.FC<IArchbaseSpacePositionedProps>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SizeUnit } from '../core-types';
|
|
2
|
+
import { IArchbaseSpaceCommonProps } from '../core-react';
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
interface IArchbaseSpaceViewPortProps extends IArchbaseSpaceCommonProps {
|
|
5
|
+
left?: SizeUnit;
|
|
6
|
+
right?: SizeUnit;
|
|
7
|
+
top?: SizeUnit;
|
|
8
|
+
bottom?: SizeUnit;
|
|
9
|
+
}
|
|
10
|
+
export declare const ArchbaseSpaceViewPort: React.FC<IArchbaseSpaceViewPortProps>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './ArchbaseSpaceAnchored';
|
|
2
|
+
export * from './ArchbaseSpaceCentered';
|
|
3
|
+
export * from './ArchbaseSpaceCenteredVertically';
|
|
4
|
+
export * from './ArchbaseSpaceCustom';
|
|
5
|
+
export * from './ArchbaseSpaceFill';
|
|
6
|
+
export * from './ArchbaseSpaceFixed';
|
|
7
|
+
export * from './ArchbaseSpaceLayer';
|
|
8
|
+
export * from './ArchbaseSpacePositioned';
|
|
9
|
+
export * from './ArchbaseSpaceInfo';
|
|
10
|
+
export * from './ArchbaseSpaceViewPort';
|
|
11
|
+
export * from './ArchbaseSpaceOptions';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SyntheticEvent } from 'react';
|
|
2
|
+
import { ISpaceDefinition, ISpaceStore, EndEvent, MoveEvent, OnDragEnd } from './core-types';
|
|
3
|
+
export declare function createDrag(store: ISpaceStore): {
|
|
4
|
+
startDrag<T extends SyntheticEvent<HTMLElement> | MouseEvent | TouchEvent>(e: T, space: ISpaceDefinition, endEvent: EndEvent, moveEvent: MoveEvent, getCoords: (event: T) => {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
}, onDragEnd?: OnDragEnd): void;
|
|
8
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { ISpaceProps, ISpaceStore, ISpaceDefinition, CenterType, ISpaceContext, ICommonProps } from './core-types';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as PropTypes from "prop-types";
|
|
4
|
+
export declare const useEffectOnce: (effect: () => void | (() => void)) => void;
|
|
5
|
+
export declare const ParentContext: React.Context<string>;
|
|
6
|
+
export declare const DOMRectContext: React.Context<DOMRect>;
|
|
7
|
+
export declare const LayerContext: React.Context<number>;
|
|
8
|
+
export declare const OptionsContext: React.Context<IArchbaseSpacesOptions>;
|
|
9
|
+
export declare const currentStore: ISpaceStore;
|
|
10
|
+
export declare const commonProps: {
|
|
11
|
+
id: PropTypes.Requireable<string>;
|
|
12
|
+
className: PropTypes.Requireable<string>;
|
|
13
|
+
style: PropTypes.Requireable<object>;
|
|
14
|
+
as: PropTypes.Requireable<any>;
|
|
15
|
+
centerContent: PropTypes.Requireable<CenterType>;
|
|
16
|
+
zIndex: PropTypes.Requireable<number>;
|
|
17
|
+
scrollable: PropTypes.Requireable<boolean>;
|
|
18
|
+
trackSize: PropTypes.Requireable<boolean>;
|
|
19
|
+
allowOverflow: PropTypes.Requireable<boolean>;
|
|
20
|
+
handleRender: PropTypes.Requireable<(...args: any[]) => any>;
|
|
21
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
22
|
+
onDoubleClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
23
|
+
onMouseDown: PropTypes.Requireable<(...args: any[]) => any>;
|
|
24
|
+
onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>;
|
|
25
|
+
onMouseLeave: PropTypes.Requireable<(...args: any[]) => any>;
|
|
26
|
+
onMouseMove: PropTypes.Requireable<(...args: any[]) => any>;
|
|
27
|
+
onTouchStart: PropTypes.Requireable<(...args: any[]) => any>;
|
|
28
|
+
onTouchMove: PropTypes.Requireable<(...args: any[]) => any>;
|
|
29
|
+
onTouchEnd: PropTypes.Requireable<(...args: any[]) => any>;
|
|
30
|
+
};
|
|
31
|
+
export interface IArchbaseSpacesOptions {
|
|
32
|
+
debug?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface IReactEvents {
|
|
35
|
+
onClick?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
36
|
+
onDoubleClick?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
37
|
+
onMouseDown?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
38
|
+
onMouseEnter?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
39
|
+
onMouseLeave?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
40
|
+
onMouseMove?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
41
|
+
onTouchStart?: (event: React.TouchEvent<HTMLElement>) => void;
|
|
42
|
+
onTouchMove?: (event: React.TouchEvent<HTMLElement>) => void;
|
|
43
|
+
onTouchEnd?: (event: React.TouchEvent<HTMLElement>) => void;
|
|
44
|
+
}
|
|
45
|
+
export interface IArchbaseSpaceCommonProps extends ICommonProps, IReactEvents {
|
|
46
|
+
style?: React.CSSProperties;
|
|
47
|
+
as?: keyof HTMLElementTagNameMap | React.ComponentType<ICommonProps>;
|
|
48
|
+
children?: React.ReactNode;
|
|
49
|
+
}
|
|
50
|
+
export interface IArchbaseSpaceInnerProps extends IArchbaseSpaceCommonProps, ISpaceProps, IReactEvents {
|
|
51
|
+
handleRender?: (handleProps: IResizeHandleProps) => React.ReactNode;
|
|
52
|
+
}
|
|
53
|
+
export interface IArchbaseSpacesOptions {
|
|
54
|
+
debug?: boolean;
|
|
55
|
+
}
|
|
56
|
+
export declare function useForceUpdate(): () => void;
|
|
57
|
+
export declare function useUniqueId(): string;
|
|
58
|
+
export declare function useSpace(props: IArchbaseSpaceInnerProps): {
|
|
59
|
+
space: ISpaceDefinition;
|
|
60
|
+
resizeHandles: {
|
|
61
|
+
mouseHandles: IResizeHandleProps[];
|
|
62
|
+
};
|
|
63
|
+
domRect: DOMRect;
|
|
64
|
+
elementRef: React.RefObject<HTMLElement>;
|
|
65
|
+
};
|
|
66
|
+
export interface IResizeHandleProps {
|
|
67
|
+
id?: string;
|
|
68
|
+
key: string | number;
|
|
69
|
+
className?: string;
|
|
70
|
+
onMouseDown: (e: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
71
|
+
onTouchStart: (e: React.TouchEvent<HTMLElement>) => void;
|
|
72
|
+
}
|
|
73
|
+
export declare function useSpaceResizeHandles(store: ISpaceStore, space: ISpaceDefinition): {
|
|
74
|
+
mouseHandles: IResizeHandleProps[];
|
|
75
|
+
};
|
|
76
|
+
export declare function useArchbaseCurrentSpace(): ISpaceContext;
|
|
77
|
+
export declare let SSR_SUPPORT_ENABLED: boolean;
|
|
78
|
+
export declare function enabledSsrSupport(): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SyntheticEvent } from 'react';
|
|
2
|
+
import { ISpaceDefinition, ResizeType, ISpaceStore, OnResizeEnd, EndEvent, MoveEvent } from './core-types';
|
|
3
|
+
export interface IResizeChange {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function createResize(store: ISpaceStore): {
|
|
8
|
+
startResize<T extends SyntheticEvent<HTMLElement> | MouseEvent | TouchEvent>(e: T, resizeType: ResizeType, space: ISpaceDefinition, endEvent: EndEvent, moveEvent: MoveEvent, getCoords: (event: T) => {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
}, onResizeEnd?: OnResizeEnd): void;
|
|
12
|
+
};
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
export type ResizeMouseEvent = React.MouseEvent<HTMLElement, MouseEvent>;
|
|
2
|
+
export type ResizeTouchEvent = React.TouchEvent<HTMLElement>;
|
|
3
|
+
export type OnResizeStart = ((resizeType?: ResizeType) => void | boolean) | undefined;
|
|
4
|
+
export type OnResizeEnd = ((newSize: SizeUnit, domRect: DOMRect, resizeType?: ResizeType) => void) | undefined;
|
|
5
|
+
export type OnDragEnd = (position: IPosition, moved: boolean) => void;
|
|
6
|
+
export declare enum Type {
|
|
7
|
+
ViewPort = "viewport",
|
|
8
|
+
Fixed = "fixed",
|
|
9
|
+
Fill = "fill",
|
|
10
|
+
Positioned = "positioned",
|
|
11
|
+
Anchored = "anchored",
|
|
12
|
+
Custom = "custom"
|
|
13
|
+
}
|
|
14
|
+
export declare enum AnchorType {
|
|
15
|
+
Left = "anchor-left",
|
|
16
|
+
Right = "anchor-right",
|
|
17
|
+
Top = "anchor-top",
|
|
18
|
+
Bottom = "anchor-bottom"
|
|
19
|
+
}
|
|
20
|
+
export declare enum Orientation {
|
|
21
|
+
Horizontal = 0,
|
|
22
|
+
Vertical = 1
|
|
23
|
+
}
|
|
24
|
+
export type SizeUnit = number | string | undefined;
|
|
25
|
+
export declare enum ResizeType {
|
|
26
|
+
All = "resize-all",
|
|
27
|
+
Left = "resize-left",
|
|
28
|
+
Right = "resize-right",
|
|
29
|
+
Top = "resize-top",
|
|
30
|
+
Bottom = "resize-bottom",
|
|
31
|
+
TopLeft = "resize-topleft",
|
|
32
|
+
TopRight = "resize-topright",
|
|
33
|
+
BottomLeft = "resize-bottomleft",
|
|
34
|
+
BottomRight = "resize-bottomright"
|
|
35
|
+
}
|
|
36
|
+
export declare enum ResizeHandlePlacement {
|
|
37
|
+
OverlayInside = "overlay-inside",
|
|
38
|
+
Inside = "inside",
|
|
39
|
+
OverlayBoundary = "overlay-boundary"
|
|
40
|
+
}
|
|
41
|
+
export declare enum CenterType {
|
|
42
|
+
None = "none",
|
|
43
|
+
Vertical = "vertical",
|
|
44
|
+
HorizontalVertical = "horizontalVertical"
|
|
45
|
+
}
|
|
46
|
+
export declare enum MoveEvent {
|
|
47
|
+
Mouse = "mousemove",
|
|
48
|
+
Touch = "touchmove"
|
|
49
|
+
}
|
|
50
|
+
export declare enum EndEvent {
|
|
51
|
+
Mouse = "mouseup",
|
|
52
|
+
Touch = "touchend"
|
|
53
|
+
}
|
|
54
|
+
export interface ICommonProps {
|
|
55
|
+
id?: string;
|
|
56
|
+
className?: string;
|
|
57
|
+
centerContent?: CenterType;
|
|
58
|
+
zIndex?: number;
|
|
59
|
+
scrollable?: boolean;
|
|
60
|
+
trackSize?: boolean;
|
|
61
|
+
allowOverflow?: boolean;
|
|
62
|
+
}
|
|
63
|
+
export interface ISpaceProps extends ICommonProps {
|
|
64
|
+
type: Type;
|
|
65
|
+
anchor?: AnchorType | undefined;
|
|
66
|
+
order?: number | undefined;
|
|
67
|
+
position?: IPositionalProps | undefined;
|
|
68
|
+
handleSize?: number | undefined;
|
|
69
|
+
handlePlacement?: ResizeHandlePlacement;
|
|
70
|
+
touchHandleSize?: number | undefined;
|
|
71
|
+
minimumSize?: number | undefined;
|
|
72
|
+
maximumSize?: number | undefined;
|
|
73
|
+
onResizeStart?: OnResizeStart;
|
|
74
|
+
onResizeEnd?: OnResizeEnd;
|
|
75
|
+
}
|
|
76
|
+
export interface ISpaceStore {
|
|
77
|
+
getSpaces: () => ISpaceDefinition[];
|
|
78
|
+
getSpace: (id: string) => ISpaceDefinition | undefined;
|
|
79
|
+
addSpace: (space: ISpaceDefinition) => void;
|
|
80
|
+
updateSpace: (space: ISpaceDefinition, props: ISpaceProps) => void;
|
|
81
|
+
updateStyles: (space: ISpaceDefinition) => void;
|
|
82
|
+
removeSpace: (space: ISpaceDefinition) => void;
|
|
83
|
+
createSpace: (parent: string | undefined, props: ISpaceProps, update: () => void) => ISpaceDefinition;
|
|
84
|
+
startMouseResize: (resizeType: ResizeType, space: ISpaceDefinition, event: React.MouseEvent<HTMLElement>, onResizeEnd?: OnResizeEnd) => void;
|
|
85
|
+
startTouchResize: (resizeType: ResizeType, space: ISpaceDefinition, event: React.TouchEvent<HTMLElement>, onResizeEnd?: OnResizeEnd) => void;
|
|
86
|
+
startMouseDrag: (space: ISpaceDefinition, event: ResizeMouseEvent, onDragEnd?: OnDragEnd) => void;
|
|
87
|
+
startTouchDrag: (space: ISpaceDefinition, event: ResizeTouchEvent, onDragEnd?: OnDragEnd) => void;
|
|
88
|
+
}
|
|
89
|
+
export interface IPosition {
|
|
90
|
+
left?: SizeUnit | undefined;
|
|
91
|
+
top?: SizeUnit | undefined;
|
|
92
|
+
right?: SizeUnit | undefined;
|
|
93
|
+
bottom?: SizeUnit | undefined;
|
|
94
|
+
width?: SizeUnit | undefined;
|
|
95
|
+
height?: SizeUnit | undefined;
|
|
96
|
+
}
|
|
97
|
+
export interface IPositionalProps extends IPosition {
|
|
98
|
+
leftResizable?: boolean;
|
|
99
|
+
topResizable?: boolean;
|
|
100
|
+
rightResizable?: boolean;
|
|
101
|
+
bottomResizable?: boolean;
|
|
102
|
+
topLeftResizable?: boolean;
|
|
103
|
+
topRightResizable?: boolean;
|
|
104
|
+
bottomLeftResizable?: boolean;
|
|
105
|
+
bottomRightResizable?: boolean;
|
|
106
|
+
}
|
|
107
|
+
export interface ISize {
|
|
108
|
+
size: SizeUnit;
|
|
109
|
+
adjusted: SizeUnit[];
|
|
110
|
+
resized: number;
|
|
111
|
+
}
|
|
112
|
+
export interface ISpaceDefinition {
|
|
113
|
+
update: () => void;
|
|
114
|
+
updateParent: () => void;
|
|
115
|
+
adjustLeft: (adjusted: SizeUnit[]) => boolean;
|
|
116
|
+
adjustRight: (adjusted: SizeUnit[]) => boolean;
|
|
117
|
+
adjustTop: (adjusted: SizeUnit[]) => boolean;
|
|
118
|
+
adjustBottom: (adjusted: SizeUnit[]) => boolean;
|
|
119
|
+
adjustEdge: (adjusted: SizeUnit[]) => boolean;
|
|
120
|
+
anchoredChildren: (children: ISpaceDefinition[], anchor: AnchorType, zIndex: number) => ISpaceDefinition[];
|
|
121
|
+
onResizeStart?: OnResizeStart;
|
|
122
|
+
onResizeEnd?: OnResizeEnd;
|
|
123
|
+
element: HTMLElement;
|
|
124
|
+
id: string;
|
|
125
|
+
type: Type;
|
|
126
|
+
anchor?: AnchorType;
|
|
127
|
+
orientation: Orientation;
|
|
128
|
+
scrollable: boolean;
|
|
129
|
+
order?: number;
|
|
130
|
+
position: "fixed" | "absolute" | "relative";
|
|
131
|
+
children: ISpaceDefinition[];
|
|
132
|
+
parentId: string | undefined;
|
|
133
|
+
store: ISpaceStore;
|
|
134
|
+
left: ISize;
|
|
135
|
+
top: ISize;
|
|
136
|
+
right: ISize;
|
|
137
|
+
bottom: ISize;
|
|
138
|
+
width: ISize;
|
|
139
|
+
height: ISize;
|
|
140
|
+
zIndex: number;
|
|
141
|
+
dimension: DOMRect;
|
|
142
|
+
centerContent: "none" | "vertical" | "horizontalVertical";
|
|
143
|
+
resizing: boolean;
|
|
144
|
+
minimumSize?: number;
|
|
145
|
+
maximumSize?: number;
|
|
146
|
+
handleSize: number;
|
|
147
|
+
touchHandleSize: number;
|
|
148
|
+
handlePlacement: ResizeHandlePlacement;
|
|
149
|
+
canResizeTop: boolean;
|
|
150
|
+
canResizeLeft: boolean;
|
|
151
|
+
canResizeRight: boolean;
|
|
152
|
+
canResizeBottom: boolean;
|
|
153
|
+
canResizeTopLeft: boolean;
|
|
154
|
+
canResizeTopRight: boolean;
|
|
155
|
+
canResizeBottomLeft: boolean;
|
|
156
|
+
canResizeBottomRight: boolean;
|
|
157
|
+
allowOverflow: boolean;
|
|
158
|
+
ssrStyle: string;
|
|
159
|
+
}
|
|
160
|
+
export interface ISpaceContext {
|
|
161
|
+
size: DOMRect;
|
|
162
|
+
layer: number;
|
|
163
|
+
startMouseDrag: (e: ResizeMouseEvent, onDragEnd?: OnDragEnd) => void;
|
|
164
|
+
startTouchDrag: (e: ResizeTouchEvent, onDragEnd?: OnDragEnd) => void;
|
|
165
|
+
forceUpdate: () => void;
|
|
166
|
+
ssrStyle?: string;
|
|
167
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ISpaceDefinition, SizeUnit, ISize } from './core-types';
|
|
2
|
+
export declare function omit<K extends string, T extends Record<K, unknown>>(object: T, ...keys: K[]): Omit<T, K>;
|
|
3
|
+
export declare function shortuuid(): string;
|
|
4
|
+
export declare function getSizeString(size: SizeUnit): string;
|
|
5
|
+
export declare function css(size: ISize, dontAddCalc?: boolean): string;
|
|
6
|
+
export declare function coalesce<T>(...args: T[]): T;
|
|
7
|
+
export declare function adjustmentsEqual(item1: SizeUnit[], item2: SizeUnit[]): boolean;
|
|
8
|
+
export declare function throttle<F extends (...args: any) => any>(callback: F, limit: number): (...args: any) => void;
|
|
9
|
+
export declare function styleDefinition(space: ISpaceDefinition): string;
|
|
10
|
+
export declare function updateStyleDefinition(space: ISpaceDefinition): void;
|
|
11
|
+
export declare function removeStyleDefinition(space: ISpaceDefinition): void;
|
|
12
|
+
export declare function isServer(): boolean;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ISpaceContext, IPosition, OnResizeStart, OnResizeEnd, OnDragEnd, ResizeMouseEvent, ResizeTouchEvent } from './core-types';
|
|
2
|
+
export * from './components';
|
|
3
|
+
export { ResizeHandlePlacement, ResizeType, AnchorType, CenterType, Type } from './core-types';
|
|
4
|
+
export type { ISpaceContext, IPosition, OnResizeStart, OnResizeEnd, OnDragEnd, ResizeMouseEvent, ResizeTouchEvent };
|
|
5
|
+
export { useArchbaseCurrentSpace, enabledSsrSupport } from './core-react';
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@archbase/layout",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3",
|
|
4
4
|
"description": "Layout components for Archbase React",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"module": "dist/index.js",
|
|
7
|
-
"types": "dist/index.d.ts",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
@@ -25,26 +25,27 @@
|
|
|
25
25
|
"author": "Edson Martins",
|
|
26
26
|
"license": "MIT",
|
|
27
27
|
"dependencies": {
|
|
28
|
+
"@archbase/core": "3.0.3",
|
|
29
|
+
"@archbase/data": "3.0.3",
|
|
28
30
|
"@gfazioli/mantine-split-pane": "^2.5.6",
|
|
29
31
|
"css-element-queries": "^1.2.3",
|
|
30
32
|
"dockview-react": "^4.12.0",
|
|
31
33
|
"i18next": "^25.3.1",
|
|
32
34
|
"lodash": "4.17.21",
|
|
33
35
|
"prop-types": "15.8.1",
|
|
34
|
-
"react": "^19.
|
|
35
|
-
"react-dom": "^19.
|
|
36
|
+
"react": "^19.2.3",
|
|
37
|
+
"react-dom": "^19.2.3",
|
|
36
38
|
"react-i18next": "^15.1.2",
|
|
37
|
-
"usehooks-ts": "^2.16.0"
|
|
38
|
-
"@archbase/core": "3.0.0",
|
|
39
|
-
"@archbase/data": "3.0.0"
|
|
39
|
+
"usehooks-ts": "^2.16.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/lodash": "^4.14.200",
|
|
43
43
|
"@types/prop-types": "^15.7.12",
|
|
44
|
-
"@types/react": "^19.0.
|
|
45
|
-
"@types/react-dom": "^19.0.
|
|
44
|
+
"@types/react": "^19.0.6",
|
|
45
|
+
"@types/react-dom": "^19.0.2",
|
|
46
46
|
"typescript": "^5.7.0",
|
|
47
47
|
"vite": "^6.3.5",
|
|
48
|
+
"vite-plugin-dts": "^4.5.4",
|
|
48
49
|
"vitest": "^2.0.0"
|
|
49
50
|
},
|
|
50
51
|
"peerDependencies": {
|
|
Binary file
|