@archbase/layout 3.0.0 → 3.0.2
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/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 +102 -102
- 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
|
@@ -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.2",
|
|
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.2",
|
|
29
|
+
"@archbase/data": "3.0.2",
|
|
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
|