@vuu-ui/vuu-layout 0.5.14 → 0.5.16
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/package.json +6 -4
- package/types/vuu-layout/src/Component.d.ts +7 -0
- package/types/vuu-layout/src/DraggableLayout.d.ts +6 -0
- package/types/vuu-layout/src/chest-of-drawers/Chest.d.ts +10 -0
- package/types/vuu-layout/src/chest-of-drawers/Drawer.d.ts +18 -0
- package/types/vuu-layout/src/chest-of-drawers/index.d.ts +2 -0
- package/types/vuu-layout/src/common-types.d.ts +8 -0
- package/types/vuu-layout/src/debug.d.ts +2 -0
- package/types/vuu-layout/src/drag-drop/BoxModel.d.ts +143 -0
- package/types/vuu-layout/src/drag-drop/DragState.d.ts +46 -0
- package/types/vuu-layout/src/drag-drop/Draggable.d.ts +23 -0
- package/types/vuu-layout/src/drag-drop/DropMenu.d.ts +10 -0
- package/types/vuu-layout/src/drag-drop/DropTarget.d.ts +61 -0
- package/types/vuu-layout/src/drag-drop/DropTargetRenderer.d.ts +18 -0
- package/types/vuu-layout/src/drag-drop/dragDropTypes.d.ts +51 -0
- package/types/vuu-layout/src/drag-drop/index.d.ts +4 -0
- package/types/vuu-layout/src/editable-label/EditableLabel.d.ts +9 -0
- package/types/vuu-layout/src/editable-label/index.d.ts +1 -0
- package/types/vuu-layout/src/flexbox/Flexbox.d.ts +5 -0
- package/types/vuu-layout/src/flexbox/FlexboxLayout.d.ts +6 -0
- package/types/vuu-layout/src/flexbox/FluidGrid.d.ts +7 -0
- package/types/vuu-layout/src/flexbox/FluidGridLayout.d.ts +6 -0
- package/types/vuu-layout/src/flexbox/Splitter.d.ts +13 -0
- package/types/vuu-layout/src/flexbox/flexbox-utils.d.ts +12 -0
- package/types/vuu-layout/src/flexbox/flexboxTypes.d.ts +51 -0
- package/types/vuu-layout/src/flexbox/index.d.ts +4 -0
- package/types/vuu-layout/src/flexbox/useResponsiveSizing.d.ts +10 -0
- package/types/vuu-layout/src/flexbox/useSplitterResizing.d.ts +2 -0
- package/types/vuu-layout/src/index.d.ts +19 -0
- package/types/vuu-layout/src/layout-action.d.ts +21 -0
- package/types/vuu-layout/src/layout-header/ActionButton.d.ts +8 -0
- package/types/vuu-layout/src/layout-header/Header.d.ts +13 -0
- package/types/vuu-layout/src/layout-header/index.d.ts +1 -0
- package/types/vuu-layout/src/layout-provider/LayoutProvider.d.ts +14 -0
- package/types/vuu-layout/src/layout-provider/LayoutProviderContext.d.ts +8 -0
- package/types/vuu-layout/src/layout-provider/index.d.ts +2 -0
- package/types/vuu-layout/src/layout-provider/useLayoutDragDrop.d.ts +4 -0
- package/types/vuu-layout/src/layout-reducer/flexUtils.d.ts +22 -0
- package/types/vuu-layout/src/layout-reducer/index.d.ts +4 -0
- package/types/vuu-layout/src/layout-reducer/insert-layout-element.d.ts +8 -0
- package/types/vuu-layout/src/layout-reducer/layout-reducer.d.ts +3 -0
- package/types/vuu-layout/src/layout-reducer/layoutTypes.d.ts +130 -0
- package/types/vuu-layout/src/layout-reducer/layoutUtils.d.ts +28 -0
- package/types/vuu-layout/src/layout-reducer/remove-layout-element.d.ts +3 -0
- package/types/vuu-layout/src/layout-reducer/replace-layout-element.d.ts +6 -0
- package/types/vuu-layout/src/layout-reducer/resize-flex-children.d.ts +3 -0
- package/types/vuu-layout/src/layout-reducer/wrap-layout-element.d.ts +9 -0
- package/types/vuu-layout/src/layout-view/View.d.ts +5 -0
- package/types/vuu-layout/src/layout-view/ViewContext.d.ts +18 -0
- package/types/vuu-layout/src/layout-view/index.d.ts +4 -0
- package/types/vuu-layout/src/layout-view/useView.d.ts +21 -0
- package/types/vuu-layout/src/layout-view/useViewActionDispatcher.d.ts +8 -0
- package/types/vuu-layout/src/layout-view/useViewResize.d.ts +7 -0
- package/types/vuu-layout/src/layout-view/viewTypes.d.ts +18 -0
- package/types/vuu-layout/src/palette/Palette.d.ts +18 -0
- package/types/vuu-layout/src/palette/PaletteSalt.d.ts +14 -0
- package/types/vuu-layout/src/palette/index.d.ts +2 -0
- package/types/vuu-layout/src/placeholder/Placeholder.d.ts +12 -0
- package/types/vuu-layout/src/placeholder/index.d.ts +1 -0
- package/types/vuu-layout/src/registry/ComponentRegistry.d.ts +14 -0
- package/types/vuu-layout/src/registry/index.d.ts +1 -0
- package/types/vuu-layout/src/responsive/breakpoints.d.ts +4 -0
- package/types/vuu-layout/src/responsive/index.d.ts +3 -0
- package/types/vuu-layout/src/responsive/measureMinimumNodeSize.d.ts +1 -0
- package/types/vuu-layout/src/responsive/overflowUtils.d.ts +2 -0
- package/types/vuu-layout/src/responsive/use-breakpoints.d.ts +7 -0
- package/types/vuu-layout/src/responsive/useResizeObserver.d.ts +12 -0
- package/types/vuu-layout/src/responsive/utils.d.ts +6 -0
- package/types/vuu-layout/src/stack/Stack.d.ts +4 -0
- package/types/vuu-layout/src/stack/StackLayout.d.ts +7 -0
- package/types/vuu-layout/src/stack/index.d.ts +3 -0
- package/types/vuu-layout/src/stack/stackTypes.d.ts +20 -0
- package/types/vuu-layout/src/tabs/TabPanel.d.ts +7 -0
- package/types/vuu-layout/src/tabs/index.d.ts +1 -0
- package/types/vuu-layout/src/tools/config-wrapper/ConfigWrapper.d.ts +2 -0
- package/types/vuu-layout/src/tools/config-wrapper/index.d.ts +1 -0
- package/types/vuu-layout/src/tools/devtools-box/layout-configurator.d.ts +31 -0
- package/types/vuu-layout/src/tools/devtools-tree/layout-tree-viewer.d.ts +5 -0
- package/types/vuu-layout/src/tools/index.d.ts +3 -0
- package/types/vuu-layout/src/use-persistent-state.d.ts +11 -0
- package/types/vuu-layout/src/utils/index.d.ts +5 -0
- package/types/vuu-layout/src/utils/pathUtils.d.ts +18 -0
- package/types/vuu-layout/src/utils/propUtils.d.ts +5 -0
- package/types/vuu-layout/src/utils/refUtils.d.ts +2 -0
- package/types/vuu-layout/src/utils/styleUtils.d.ts +3 -0
- package/types/vuu-layout/src/utils/typeOf.d.ts +4 -0
- package/types/vuu-popups/src/popup/index.d.ts +1 -0
- package/types/vuu-popups/src/popup/popup-service.d.ts +34 -0
- package/types/vuu-popups/src/portal/Portal.d.ts +8 -0
- package/types/vuu-popups/src/portal/index.d.ts +3 -0
- package/types/vuu-popups/src/portal/portal-utils.d.ts +1 -0
- package/types/vuu-popups/src/portal/render-portal.d.ts +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vuu-ui/vuu-layout",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.16",
|
|
4
4
|
"description": "VUU Layout Components",
|
|
5
5
|
"author": "heswell",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"@salt-ds/core": "1.0.0",
|
|
9
9
|
"@salt-ds/icons": "1.0.0",
|
|
10
10
|
"@heswell/salt-lab": "1.0.0-alpha.0",
|
|
11
|
-
"@vuu-ui/vuu-utils": "0.5.
|
|
11
|
+
"@vuu-ui/vuu-utils": "0.5.16",
|
|
12
12
|
"classnames": "^2.2.6",
|
|
13
13
|
"react": "^17.0.2",
|
|
14
14
|
"react-dom": "^17.0.2"
|
|
@@ -18,8 +18,10 @@
|
|
|
18
18
|
"esm",
|
|
19
19
|
"index.css",
|
|
20
20
|
"index.css.map",
|
|
21
|
-
"README.md"
|
|
21
|
+
"README.md",
|
|
22
|
+
"/types"
|
|
22
23
|
],
|
|
23
24
|
"module": "esm/index.js",
|
|
24
|
-
"main": "cjs/index.js"
|
|
25
|
+
"main": "cjs/index.js",
|
|
26
|
+
"types": "types/index.d.ts"
|
|
25
27
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React, { HTMLAttributes } from 'react';
|
|
2
|
+
import './Component.css';
|
|
3
|
+
export interface ComponentProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
resizeable?: boolean;
|
|
5
|
+
}
|
|
6
|
+
declare const Component: React.FunctionComponent<ComponentProps>;
|
|
7
|
+
export default Component;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactElement } from "react";
|
|
2
|
+
import "./Chest.css";
|
|
3
|
+
export interface ChestProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
children: ReactElement[];
|
|
5
|
+
}
|
|
6
|
+
declare const Chest: {
|
|
7
|
+
(props: ChestProps): JSX.Element;
|
|
8
|
+
displayName: string;
|
|
9
|
+
};
|
|
10
|
+
export default Chest;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
import "./Drawer.css";
|
|
3
|
+
export interface DrawerProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
clickToOpen?: boolean;
|
|
5
|
+
defaultOpen: boolean;
|
|
6
|
+
inline?: boolean;
|
|
7
|
+
open?: boolean;
|
|
8
|
+
peekaboo?: boolean;
|
|
9
|
+
position?: "left" | "right" | "top" | "bottom";
|
|
10
|
+
sizeOpen?: number;
|
|
11
|
+
sizeClosed?: number;
|
|
12
|
+
toggleButton?: "start" | "end";
|
|
13
|
+
}
|
|
14
|
+
declare const Drawer: {
|
|
15
|
+
({ children, className: classNameProp, clickToOpen, defaultOpen, sizeOpen, sizeClosed, style: styleProp, open: openProp, position, inline, onClick, peekaboo, toggleButton, ...props }: DrawerProps): JSX.Element;
|
|
16
|
+
displayName: string;
|
|
17
|
+
};
|
|
18
|
+
export default Drawer;
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
import { LayoutModel } from "../layout-reducer";
|
|
3
|
+
import { DragDropRect, DropPos, RelativePosition } from "./dragDropTypes";
|
|
4
|
+
export declare const positionValues: {
|
|
5
|
+
north: number;
|
|
6
|
+
east: number;
|
|
7
|
+
south: number;
|
|
8
|
+
west: number;
|
|
9
|
+
header: number;
|
|
10
|
+
centre: number;
|
|
11
|
+
absolute: number;
|
|
12
|
+
};
|
|
13
|
+
export declare const RelativeDropPosition: {
|
|
14
|
+
AFTER: RelativePosition;
|
|
15
|
+
BEFORE: RelativePosition;
|
|
16
|
+
};
|
|
17
|
+
export declare const Position: Readonly<{
|
|
18
|
+
North: Readonly<{
|
|
19
|
+
offset: number;
|
|
20
|
+
valueOf: () => number;
|
|
21
|
+
toString: () => "header" | "absolute" | "north" | "east" | "south" | "west" | "centre";
|
|
22
|
+
North: boolean;
|
|
23
|
+
South: boolean;
|
|
24
|
+
East: boolean;
|
|
25
|
+
West: boolean;
|
|
26
|
+
Header: boolean;
|
|
27
|
+
Centre: boolean;
|
|
28
|
+
NorthOrSouth: boolean;
|
|
29
|
+
EastOrWest: boolean;
|
|
30
|
+
NorthOrWest: boolean;
|
|
31
|
+
SouthOrEast: boolean;
|
|
32
|
+
Absolute: boolean;
|
|
33
|
+
}>;
|
|
34
|
+
East: Readonly<{
|
|
35
|
+
offset: number;
|
|
36
|
+
valueOf: () => number;
|
|
37
|
+
toString: () => "header" | "absolute" | "north" | "east" | "south" | "west" | "centre";
|
|
38
|
+
North: boolean;
|
|
39
|
+
South: boolean;
|
|
40
|
+
East: boolean;
|
|
41
|
+
West: boolean;
|
|
42
|
+
Header: boolean;
|
|
43
|
+
Centre: boolean;
|
|
44
|
+
NorthOrSouth: boolean;
|
|
45
|
+
EastOrWest: boolean;
|
|
46
|
+
NorthOrWest: boolean;
|
|
47
|
+
SouthOrEast: boolean;
|
|
48
|
+
Absolute: boolean;
|
|
49
|
+
}>;
|
|
50
|
+
South: Readonly<{
|
|
51
|
+
offset: number;
|
|
52
|
+
valueOf: () => number;
|
|
53
|
+
toString: () => "header" | "absolute" | "north" | "east" | "south" | "west" | "centre";
|
|
54
|
+
North: boolean;
|
|
55
|
+
South: boolean;
|
|
56
|
+
East: boolean;
|
|
57
|
+
West: boolean;
|
|
58
|
+
Header: boolean;
|
|
59
|
+
Centre: boolean;
|
|
60
|
+
NorthOrSouth: boolean;
|
|
61
|
+
EastOrWest: boolean;
|
|
62
|
+
NorthOrWest: boolean;
|
|
63
|
+
SouthOrEast: boolean;
|
|
64
|
+
Absolute: boolean;
|
|
65
|
+
}>;
|
|
66
|
+
West: Readonly<{
|
|
67
|
+
offset: number;
|
|
68
|
+
valueOf: () => number;
|
|
69
|
+
toString: () => "header" | "absolute" | "north" | "east" | "south" | "west" | "centre";
|
|
70
|
+
North: boolean;
|
|
71
|
+
South: boolean;
|
|
72
|
+
East: boolean;
|
|
73
|
+
West: boolean;
|
|
74
|
+
Header: boolean;
|
|
75
|
+
Centre: boolean;
|
|
76
|
+
NorthOrSouth: boolean;
|
|
77
|
+
EastOrWest: boolean;
|
|
78
|
+
NorthOrWest: boolean;
|
|
79
|
+
SouthOrEast: boolean;
|
|
80
|
+
Absolute: boolean;
|
|
81
|
+
}>;
|
|
82
|
+
Header: Readonly<{
|
|
83
|
+
offset: number;
|
|
84
|
+
valueOf: () => number;
|
|
85
|
+
toString: () => "header" | "absolute" | "north" | "east" | "south" | "west" | "centre";
|
|
86
|
+
North: boolean;
|
|
87
|
+
South: boolean;
|
|
88
|
+
East: boolean;
|
|
89
|
+
West: boolean;
|
|
90
|
+
Header: boolean;
|
|
91
|
+
Centre: boolean;
|
|
92
|
+
NorthOrSouth: boolean;
|
|
93
|
+
EastOrWest: boolean;
|
|
94
|
+
NorthOrWest: boolean;
|
|
95
|
+
SouthOrEast: boolean;
|
|
96
|
+
Absolute: boolean;
|
|
97
|
+
}>;
|
|
98
|
+
Centre: Readonly<{
|
|
99
|
+
offset: number;
|
|
100
|
+
valueOf: () => number;
|
|
101
|
+
toString: () => "header" | "absolute" | "north" | "east" | "south" | "west" | "centre";
|
|
102
|
+
North: boolean;
|
|
103
|
+
South: boolean;
|
|
104
|
+
East: boolean;
|
|
105
|
+
West: boolean;
|
|
106
|
+
Header: boolean;
|
|
107
|
+
Centre: boolean;
|
|
108
|
+
NorthOrSouth: boolean;
|
|
109
|
+
EastOrWest: boolean;
|
|
110
|
+
NorthOrWest: boolean;
|
|
111
|
+
SouthOrEast: boolean;
|
|
112
|
+
Absolute: boolean;
|
|
113
|
+
}>;
|
|
114
|
+
Absolute: Readonly<{
|
|
115
|
+
offset: number;
|
|
116
|
+
valueOf: () => number;
|
|
117
|
+
toString: () => "header" | "absolute" | "north" | "east" | "south" | "west" | "centre";
|
|
118
|
+
North: boolean;
|
|
119
|
+
South: boolean;
|
|
120
|
+
East: boolean;
|
|
121
|
+
West: boolean;
|
|
122
|
+
Header: boolean;
|
|
123
|
+
Centre: boolean;
|
|
124
|
+
NorthOrSouth: boolean;
|
|
125
|
+
EastOrWest: boolean;
|
|
126
|
+
NorthOrWest: boolean;
|
|
127
|
+
SouthOrEast: boolean;
|
|
128
|
+
Absolute: boolean;
|
|
129
|
+
}>;
|
|
130
|
+
}>;
|
|
131
|
+
export interface Measurements {
|
|
132
|
+
[key: string]: DragDropRect;
|
|
133
|
+
}
|
|
134
|
+
export declare class BoxModel {
|
|
135
|
+
static measure(model: ReactElement, dropTargetPaths?: string[]): Measurements;
|
|
136
|
+
static allBoxesContainingPoint(layout: LayoutModel, measurements: Measurements, x: number, y: number, validDropTargets?: string[]): LayoutModel[];
|
|
137
|
+
}
|
|
138
|
+
export declare function pointPositionWithinRect(x: number, y: number, rect: DragDropRect, borderZone?: number): {
|
|
139
|
+
pctX: number;
|
|
140
|
+
pctY: number;
|
|
141
|
+
closeToTheEdge: number;
|
|
142
|
+
};
|
|
143
|
+
export declare function getPosition(x: number, y: number, rect: DragDropRect, targetOrientation?: "row" | "column"): DropPos;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { DragDropRect } from './dragDropTypes';
|
|
2
|
+
export declare type IntrinsicSizes = {
|
|
3
|
+
height?: number;
|
|
4
|
+
width?: number;
|
|
5
|
+
};
|
|
6
|
+
interface ZoneRange {
|
|
7
|
+
hi: number;
|
|
8
|
+
lo: number;
|
|
9
|
+
}
|
|
10
|
+
declare type DragConstraint = {
|
|
11
|
+
zone: {
|
|
12
|
+
x: ZoneRange;
|
|
13
|
+
y: ZoneRange;
|
|
14
|
+
};
|
|
15
|
+
pos: {
|
|
16
|
+
x: ZoneRange;
|
|
17
|
+
y: ZoneRange;
|
|
18
|
+
};
|
|
19
|
+
mouse: {
|
|
20
|
+
x: ZoneRange;
|
|
21
|
+
y: ZoneRange;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
interface ExtendedZoneRange {
|
|
25
|
+
lo: boolean;
|
|
26
|
+
hi: boolean;
|
|
27
|
+
mousePct: number;
|
|
28
|
+
mousePos: number;
|
|
29
|
+
pos: number;
|
|
30
|
+
}
|
|
31
|
+
export declare class DragState {
|
|
32
|
+
constraint: DragConstraint;
|
|
33
|
+
x: ExtendedZoneRange;
|
|
34
|
+
y: ExtendedZoneRange;
|
|
35
|
+
intrinsicSize: IntrinsicSizes | undefined;
|
|
36
|
+
constructor(zone: DragDropRect, mouseX: number, mouseY: number, measurements: DragDropRect, intrinsicSize?: IntrinsicSizes);
|
|
37
|
+
init(zone: DragDropRect, mouseX: number, mouseY: number, rect: DragDropRect, intrinsicSize?: IntrinsicSizes): void;
|
|
38
|
+
outOfBounds(): boolean;
|
|
39
|
+
inBounds(): boolean;
|
|
40
|
+
dropX(): number;
|
|
41
|
+
dropY(): number;
|
|
42
|
+
hasIntrinsicSize(): number | undefined;
|
|
43
|
+
update(xy: 'x' | 'y', mousePos: number): boolean;
|
|
44
|
+
private dropXY;
|
|
45
|
+
}
|
|
46
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
import { rect } from "../common-types";
|
|
3
|
+
import { IntrinsicSizes } from "./DragState";
|
|
4
|
+
import { DropTarget } from "./DropTarget";
|
|
5
|
+
export declare type DragStartCallback = (e: MouseEvent, x: number, y: number) => void;
|
|
6
|
+
export declare type DragMoveCallback = (x: number | undefined, y: number | undefined) => void;
|
|
7
|
+
export declare type DragEndCallback = (droppedTarget: Partial<DropTarget>) => void;
|
|
8
|
+
export declare type DragInstructions = {
|
|
9
|
+
DoNotRemove?: boolean;
|
|
10
|
+
DoNotTransform?: boolean;
|
|
11
|
+
dragThreshold?: number;
|
|
12
|
+
RemoveDraggableOnDragEnd?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare const Draggable: {
|
|
15
|
+
handleMousedown(e: MouseEvent, dragStartCallback: DragStartCallback, dragInstructions?: DragInstructions): void;
|
|
16
|
+
initDrag(rootContainer: ReactElement, dragContainerPath: string, { top, left, right, bottom }: rect, dragPos: {
|
|
17
|
+
x: number;
|
|
18
|
+
y: number;
|
|
19
|
+
}, dragHandler: {
|
|
20
|
+
drag: DragMoveCallback;
|
|
21
|
+
drop: DragEndCallback;
|
|
22
|
+
}, intrinsicSize?: IntrinsicSizes, dropTargets?: string[]): string;
|
|
23
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
import { DropTarget } from "./DropTarget";
|
|
3
|
+
import "./DropMenu.css";
|
|
4
|
+
export declare function computeMenuPosition(dropTarget: DropTarget, offsetTop?: number, offsetLeft?: number): [number, number, "left" | "bottom" | "right" | "top"];
|
|
5
|
+
export interface DropMenuProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
dropTarget: DropTarget;
|
|
7
|
+
onHover: (target: DropTarget | null) => void;
|
|
8
|
+
orientation?: "left" | "top" | "right" | "bottom";
|
|
9
|
+
}
|
|
10
|
+
export declare const DropMenu: ({ className, dropTarget, onHover, orientation, }: DropMenuProps) => JSX.Element;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { rectTuple } from "../common-types";
|
|
2
|
+
import { LayoutModel } from "../layout-reducer";
|
|
3
|
+
import { Measurements } from "./BoxModel";
|
|
4
|
+
import { DragDropRect, DropPos, DropPosTab } from "./dragDropTypes";
|
|
5
|
+
import { DragState } from "./DragState";
|
|
6
|
+
export declare const isTabstrip: (dropTarget: DropTarget) => boolean | undefined;
|
|
7
|
+
export interface DropTargetProps {
|
|
8
|
+
component: LayoutModel;
|
|
9
|
+
pos: DropPos;
|
|
10
|
+
clientRect: DragDropRect;
|
|
11
|
+
nextDropTarget: DropTarget | null;
|
|
12
|
+
}
|
|
13
|
+
export declare type GuideLine = [
|
|
14
|
+
number,
|
|
15
|
+
number,
|
|
16
|
+
number,
|
|
17
|
+
number,
|
|
18
|
+
number,
|
|
19
|
+
number,
|
|
20
|
+
number,
|
|
21
|
+
number
|
|
22
|
+
];
|
|
23
|
+
export interface TargetDropOutline {
|
|
24
|
+
l: number;
|
|
25
|
+
r: number;
|
|
26
|
+
t: number;
|
|
27
|
+
b: number;
|
|
28
|
+
tabLeft?: number;
|
|
29
|
+
tabWidth?: number;
|
|
30
|
+
tabHeight?: number;
|
|
31
|
+
guideLines?: GuideLine;
|
|
32
|
+
}
|
|
33
|
+
export declare class DropTarget {
|
|
34
|
+
private active;
|
|
35
|
+
box: unknown;
|
|
36
|
+
clientRect: DragDropRect;
|
|
37
|
+
component: LayoutModel;
|
|
38
|
+
dropRect: rectTuple | undefined;
|
|
39
|
+
nextDropTarget: DropTarget | null;
|
|
40
|
+
pos: DropPos;
|
|
41
|
+
constructor({ component, pos, clientRect, nextDropTarget, }: DropTargetProps);
|
|
42
|
+
targetTabPos(tab: DropPosTab): number;
|
|
43
|
+
/**
|
|
44
|
+
* Determine what will be rendered by the dropTargetRenderer
|
|
45
|
+
*
|
|
46
|
+
* @param {*} lineWidth
|
|
47
|
+
* @param {*} dragState
|
|
48
|
+
* @returns {l, t, r, b, tabLeft, tabWidth, tabHeight}
|
|
49
|
+
*/
|
|
50
|
+
getTargetDropOutline(lineWidth: number, dragState?: DragState): TargetDropOutline;
|
|
51
|
+
getDropTabOutline(lineWidth: number, tab: DropPosTab): TargetDropOutline;
|
|
52
|
+
getIntrinsicDropRect(dragState: DragState): TargetDropOutline;
|
|
53
|
+
/**
|
|
54
|
+
* @returns [left, top, right, bottom]
|
|
55
|
+
*/
|
|
56
|
+
getDropRectOutline(lineWidth: number, dragState?: DragState): number[] | null;
|
|
57
|
+
activate(): this;
|
|
58
|
+
toArray(this: DropTarget): DropTarget[];
|
|
59
|
+
static getActiveDropTarget(dropTarget: DropTarget | null): DropTarget | null;
|
|
60
|
+
}
|
|
61
|
+
export declare function identifyDropTarget(x: number, y: number, rootLayout: LayoutModel, measurements: Measurements, intrinsicSize?: number, validDropTargets?: string[]): DropTarget | null;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DragDropRect } from "./dragDropTypes";
|
|
2
|
+
import { DragState } from "./DragState";
|
|
3
|
+
import { DropTarget } from "./DropTarget";
|
|
4
|
+
import "./DropTargetRenderer.css";
|
|
5
|
+
declare type Point = [number, number];
|
|
6
|
+
declare type TabMode = "full-view" | "tab-only";
|
|
7
|
+
export default class DropTargetCanvas {
|
|
8
|
+
private currentPath;
|
|
9
|
+
private tabMode;
|
|
10
|
+
constructor();
|
|
11
|
+
prepare(dragRect: DragDropRect, tabMode?: TabMode): void;
|
|
12
|
+
clear(): void;
|
|
13
|
+
get hoverDropTarget(): DropTarget | null;
|
|
14
|
+
getPoints(x: number, y: number, width: number, height: number, tabLeft?: number, tabWidth?: number, tabHeight?: number): Point[];
|
|
15
|
+
draw(dropTarget: DropTarget, dragState: DragState): void;
|
|
16
|
+
drawTarget(dropTarget: DropTarget, dragState?: DragState): void;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { rect } from '../common-types';
|
|
2
|
+
export interface DragDropRect extends rect {
|
|
3
|
+
children?: DragDropRect[];
|
|
4
|
+
header?: {
|
|
5
|
+
top: number;
|
|
6
|
+
left: number;
|
|
7
|
+
right: number;
|
|
8
|
+
bottom: number;
|
|
9
|
+
titleWidth?: number;
|
|
10
|
+
};
|
|
11
|
+
height: number;
|
|
12
|
+
scrolling?: {
|
|
13
|
+
id: string;
|
|
14
|
+
scrollTop: number;
|
|
15
|
+
scrollHeight: number;
|
|
16
|
+
};
|
|
17
|
+
Stack?: {
|
|
18
|
+
left: number;
|
|
19
|
+
right: number;
|
|
20
|
+
}[];
|
|
21
|
+
width: number;
|
|
22
|
+
}
|
|
23
|
+
export interface DropPosition {
|
|
24
|
+
Absolute: boolean;
|
|
25
|
+
Centre: boolean;
|
|
26
|
+
East: boolean;
|
|
27
|
+
EastOrWest: boolean;
|
|
28
|
+
Header: boolean;
|
|
29
|
+
North: boolean;
|
|
30
|
+
NorthOrSouth: boolean;
|
|
31
|
+
offset: number;
|
|
32
|
+
South: boolean;
|
|
33
|
+
SouthOrEast: boolean;
|
|
34
|
+
West: boolean;
|
|
35
|
+
}
|
|
36
|
+
export declare type RelativePosition = 'after' | 'before';
|
|
37
|
+
export declare type DropPosTab = {
|
|
38
|
+
index: number;
|
|
39
|
+
left: number;
|
|
40
|
+
positionRelativeToTab: RelativePosition;
|
|
41
|
+
width: number;
|
|
42
|
+
};
|
|
43
|
+
export interface DropPos {
|
|
44
|
+
closeToTheEdge: number;
|
|
45
|
+
height?: number;
|
|
46
|
+
position: DropPosition;
|
|
47
|
+
tab?: DropPosTab;
|
|
48
|
+
width?: number;
|
|
49
|
+
x: number;
|
|
50
|
+
y: number;
|
|
51
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FocusEvent, HTMLAttributes, KeyboardEvent, MouseEvent } from 'react';
|
|
2
|
+
import './EditableLabel.css';
|
|
3
|
+
export interface EditableLabelProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
onEnterEditMode?: (evt: MouseEvent) => void;
|
|
5
|
+
onExitEditMode?: (evt: FocusEvent | KeyboardEvent, value: string) => void;
|
|
6
|
+
value: string;
|
|
7
|
+
}
|
|
8
|
+
declare const EditableLabel: ({ className: classNameProp, onEnterEditMode, onExitEditMode, value: valueProp }: EditableLabelProps) => JSX.Element;
|
|
9
|
+
export default EditableLabel;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as EditableLabel } from './EditableLabel';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FlexboxProps } from "./flexboxTypes";
|
|
3
|
+
import "./FluidGrid.css";
|
|
4
|
+
export interface FluidGridProps extends FlexboxProps {
|
|
5
|
+
showGrid?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const FluidGrid: import("react").ForwardRefExoticComponent<FluidGridProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { HTMLAttributes } from 'react';
|
|
2
|
+
import './Splitter.css';
|
|
3
|
+
export declare type SplitterDragStartHandler = (index: number) => void;
|
|
4
|
+
export declare type SplitterDragHandler = (index: number, distance: number) => void;
|
|
5
|
+
export declare type SplitterDragEndHandler = () => void;
|
|
6
|
+
export interface SplitterProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onDrag' | 'onDragStart'> {
|
|
7
|
+
column: boolean;
|
|
8
|
+
index: number;
|
|
9
|
+
onDragStart: SplitterDragStartHandler;
|
|
10
|
+
onDrag: SplitterDragHandler;
|
|
11
|
+
onDragEnd: SplitterDragEndHandler;
|
|
12
|
+
}
|
|
13
|
+
export declare const Splitter: React.NamedExoticComponent<SplitterProps>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import type { BreakPoint, ContentMeta } from './flexboxTypes';
|
|
3
|
+
export declare const SPLITTER = 1;
|
|
4
|
+
export declare const PLACEHOLDER = 2;
|
|
5
|
+
export declare const gatherChildMeta: (children: ReactElement[], dimension: 'width' | 'height', breakPoints?: BreakPoint[]) => {
|
|
6
|
+
index: number;
|
|
7
|
+
flexOpen: boolean;
|
|
8
|
+
intrinsicSize: number | undefined;
|
|
9
|
+
resizeable: any;
|
|
10
|
+
}[];
|
|
11
|
+
export declare const findSplitterAndPlaceholderPositions: (childMeta: ContentMeta[]) => any[];
|
|
12
|
+
export declare const identifyResizeParties: (contentMeta: ContentMeta[], idx: number) => (number[] | undefined)[];
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { CSSProperties, HTMLAttributes, MutableRefObject, ReactElement, ReactNode } from "react";
|
|
2
|
+
import { SplitterProps } from "./Splitter";
|
|
3
|
+
export interface LayoutContainerProps {
|
|
4
|
+
resizeable?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface FlexboxProps extends LayoutContainerProps, HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
breakPoints?: BreakPointsProp;
|
|
8
|
+
children: ReactElement[];
|
|
9
|
+
cols?: number;
|
|
10
|
+
column?: true;
|
|
11
|
+
fullPage?: number;
|
|
12
|
+
flexFill?: boolean;
|
|
13
|
+
gap?: number;
|
|
14
|
+
onSplitterMoved?: (content: ContentMeta[]) => void;
|
|
15
|
+
row?: true;
|
|
16
|
+
spacing?: number;
|
|
17
|
+
splitterSize?: number;
|
|
18
|
+
}
|
|
19
|
+
export interface FlexboxLayoutProps extends FlexboxProps {
|
|
20
|
+
path: string;
|
|
21
|
+
}
|
|
22
|
+
export interface SplitterHookProps {
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
onSplitterMoved?: (content: ContentMeta[]) => void;
|
|
25
|
+
style?: CSSProperties;
|
|
26
|
+
}
|
|
27
|
+
export interface SplitterHookResult {
|
|
28
|
+
content: ReactElement[];
|
|
29
|
+
rootRef: MutableRefObject<HTMLDivElement | null>;
|
|
30
|
+
}
|
|
31
|
+
export declare type SplitterFactory = (index: number) => ReactElement<SplitterProps>;
|
|
32
|
+
export declare type ContentMeta = {
|
|
33
|
+
currentSize?: number;
|
|
34
|
+
flexOpen?: boolean;
|
|
35
|
+
flexBasis?: number;
|
|
36
|
+
intrinsicSize?: number;
|
|
37
|
+
minSize?: number;
|
|
38
|
+
placeholder?: boolean;
|
|
39
|
+
resizeable?: boolean;
|
|
40
|
+
shim?: boolean;
|
|
41
|
+
splitter?: boolean;
|
|
42
|
+
};
|
|
43
|
+
export declare type FlexSize = {
|
|
44
|
+
size: number;
|
|
45
|
+
minSize: number;
|
|
46
|
+
};
|
|
47
|
+
export declare type BreakPoint = "xs" | "sm" | "md" | "lg" | "xl";
|
|
48
|
+
export declare type BreakPoints = BreakPoint[];
|
|
49
|
+
export declare type BreakPointsProp = {
|
|
50
|
+
[keys in BreakPoint]?: number;
|
|
51
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CSSProperties, ReactElement } from "react";
|
|
2
|
+
export declare const useResponsiveSizing: ({ children: childrenProp, cols: colsProp, style, }: {
|
|
3
|
+
children: ReactElement[];
|
|
4
|
+
cols?: number | undefined;
|
|
5
|
+
style?: CSSProperties | undefined;
|
|
6
|
+
}) => {
|
|
7
|
+
cols: number;
|
|
8
|
+
content: ReactElement<any, string | import("react").JSXElementConstructor<any>>[] | undefined;
|
|
9
|
+
rootRef: import("react").MutableRefObject<null>;
|
|
10
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export * from "@vuu-ui/vuu-popups/src/dialog";
|
|
2
|
+
export * from "./chest-of-drawers";
|
|
3
|
+
export * from "./common-types";
|
|
4
|
+
export { default as Component } from "./Component";
|
|
5
|
+
export * from "./drag-drop";
|
|
6
|
+
export * from "./DraggableLayout";
|
|
7
|
+
export * from "./flexbox";
|
|
8
|
+
export { Action } from "./layout-action";
|
|
9
|
+
export * from "./layout-header";
|
|
10
|
+
export * from "./layout-provider";
|
|
11
|
+
export * from "./layout-view";
|
|
12
|
+
export * from "./palette";
|
|
13
|
+
export * from "./placeholder";
|
|
14
|
+
export * from "./registry";
|
|
15
|
+
export * from "./responsive";
|
|
16
|
+
export * from "./stack";
|
|
17
|
+
export * from "./tools";
|
|
18
|
+
export * from "./use-persistent-state";
|
|
19
|
+
export * from "./utils";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const Action: {
|
|
2
|
+
ADD: string;
|
|
3
|
+
BLUR: string;
|
|
4
|
+
BLUR_SPLITTER: string;
|
|
5
|
+
DRAG_START: string;
|
|
6
|
+
DRAG_STARTED: string;
|
|
7
|
+
DRAG_DROP: string;
|
|
8
|
+
FOCUS: string;
|
|
9
|
+
FOCUS_SPLITTER: string;
|
|
10
|
+
INITIALIZE: string;
|
|
11
|
+
MAXIMIZE: string;
|
|
12
|
+
MINIMIZE: string;
|
|
13
|
+
REMOVE: string;
|
|
14
|
+
REPLACE: string;
|
|
15
|
+
RESTORE: string;
|
|
16
|
+
SAVE: string;
|
|
17
|
+
SET_TITLE: string;
|
|
18
|
+
SPLITTER_RESIZE: string;
|
|
19
|
+
SWITCH_TAB: string;
|
|
20
|
+
TEAR_OUT: string;
|
|
21
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HTMLAttributes, MouseEvent } from 'react';
|
|
2
|
+
export interface ActionButtonProps extends Omit<HTMLAttributes<HTMLButtonElement>, 'onClick'> {
|
|
3
|
+
actionId: 'maximize' | 'minimize' | 'restore' | 'tearout';
|
|
4
|
+
iconName?: string;
|
|
5
|
+
onClick: (evt: MouseEvent, actionId: 'maximize' | 'minimize' | 'restore' | 'tearout') => void;
|
|
6
|
+
}
|
|
7
|
+
declare const ActionButton: ({ actionId, className, iconName, onClick, ...props }: ActionButtonProps) => JSX.Element;
|
|
8
|
+
export default ActionButton;
|