@opengeoweb/shared 4.4.0 → 4.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.esm.js +480 -115
- package/index.umd.js +483 -122
- package/lib/components/CustomAccordion/CustomAccordion.d.ts +10 -0
- package/lib/components/CustomAccordion/CustomAccordion.spec.d.ts +1 -0
- package/lib/components/CustomAccordion/CustomAccordion.stories.d.ts +13 -0
- package/lib/components/CustomAccordion/index.d.ts +1 -0
- package/lib/components/CustomTooltip/CustomTooltip.d.ts +8 -0
- package/lib/components/CustomTooltip/CustomTooltip.spec.d.ts +1 -0
- package/lib/components/CustomTooltip/index.d.ts +1 -0
- package/lib/components/DraggableResizable/Resizable.d.ts +1 -0
- package/lib/components/DraggableResizable/types.d.ts +1 -3
- package/lib/components/EnableButton/EnableButton.d.ts +2 -0
- package/lib/components/ManagerButton/ManagerButton.d.ts +1 -0
- package/lib/components/ToolContainer/ToolContainerDraggable.d.ts +9 -2
- package/lib/components/ToolContainer/types.d.ts +2 -1
- package/lib/components/ToolContainer/useHandleSizeFromOutsideComponent.d.ts +33 -0
- package/lib/components/ToolContainer/useHandleSizeFromOutsideComponent.spec.d.ts +1 -0
- package/lib/components/index.d.ts +2 -0
- package/lib/hooks/useMakeSureContainerStaysInsideWindow/useMakeSureContainerStaysInsideWindow.d.ts +1 -0
- package/lib/utils/containerQueryHelper.d.ts +1 -0
- package/lib/utils/index.d.ts +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { AccordionProps, SxProps, Theme } from '@mui/material';
|
|
3
|
+
export interface CustomAccordionProps extends Omit<AccordionProps, 'title'> {
|
|
4
|
+
title?: string | React.ReactNode;
|
|
5
|
+
expandedElevation?: number;
|
|
6
|
+
collapsedElevation?: number;
|
|
7
|
+
transitionDuration?: number;
|
|
8
|
+
detailsSx?: SxProps<Theme>;
|
|
9
|
+
}
|
|
10
|
+
export declare const CustomAccordion: React.FC<CustomAccordionProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
};
|
|
5
|
+
export default _default;
|
|
6
|
+
export declare const CustomAccordionLight: {
|
|
7
|
+
(): React.ReactElement;
|
|
8
|
+
storyName: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const CustomAccordionDark: {
|
|
11
|
+
(): React.ReactElement;
|
|
12
|
+
storyName: string;
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CustomAccordion';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { TooltipProps } from '@mui/material';
|
|
3
|
+
export declare const defaultDelay = 1000;
|
|
4
|
+
export declare const useControlledTooltip: () => [
|
|
5
|
+
boolean,
|
|
6
|
+
React.Dispatch<React.SetStateAction<boolean>>
|
|
7
|
+
];
|
|
8
|
+
export declare const CustomTooltip: React.FC<TooltipProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CustomTooltip';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ResizableProps } from 're-resizable';
|
|
3
|
-
declare type Position = {
|
|
3
|
+
export declare type Position = {
|
|
4
4
|
top: number;
|
|
5
5
|
left?: number;
|
|
6
6
|
right?: number;
|
|
@@ -10,11 +10,9 @@ export declare type Size = {
|
|
|
10
10
|
height?: number | string;
|
|
11
11
|
};
|
|
12
12
|
export interface ResizableComponentProps extends Omit<ResizableProps, 'size'> {
|
|
13
|
-
startPosition?: Position;
|
|
14
13
|
startSize?: Size;
|
|
15
14
|
setSize?: (size: Size) => void;
|
|
16
15
|
size?: Size;
|
|
17
16
|
children: React.ReactNode;
|
|
18
17
|
onResizeStart?: () => void;
|
|
19
18
|
}
|
|
20
|
-
export {};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { SxProps } from '@mui/material';
|
|
3
|
+
import { DraggablePosition } from '../DraggableResizable/Draggable';
|
|
4
|
+
import { Position, ResizableComponentProps, Size } from '../DraggableResizable/types';
|
|
3
5
|
import { HeaderSize } from './types';
|
|
4
6
|
export declare const calculateDialogSizeAndPosition: () => {
|
|
5
7
|
width: number;
|
|
@@ -8,6 +10,7 @@ export declare const calculateDialogSizeAndPosition: () => {
|
|
|
8
10
|
left: number;
|
|
9
11
|
};
|
|
10
12
|
interface DraggableComponentProps extends Omit<ResizableComponentProps, 'bounds'> {
|
|
13
|
+
startPosition?: Position;
|
|
11
14
|
onStartResize?: () => void;
|
|
12
15
|
isOpen?: boolean;
|
|
13
16
|
onClose?: () => void;
|
|
@@ -15,11 +18,15 @@ interface DraggableComponentProps extends Omit<ResizableComponentProps, 'bounds'
|
|
|
15
18
|
headerSize?: HeaderSize;
|
|
16
19
|
initialMaxHeight?: string | number;
|
|
17
20
|
onChangeSize?: (size: Size) => void;
|
|
21
|
+
onDragEnd?: (position: DraggablePosition, size: Size) => void;
|
|
18
22
|
onMouseDown?: () => void;
|
|
19
23
|
bounds?: 'parent' | string;
|
|
20
24
|
order?: number;
|
|
21
25
|
source?: 'app' | 'module';
|
|
22
|
-
|
|
26
|
+
leftHeaderComponent?: React.ReactNode;
|
|
27
|
+
rightHeaderComponent?: React.ReactNode;
|
|
28
|
+
hasElevation?: boolean;
|
|
29
|
+
sx?: SxProps;
|
|
23
30
|
}
|
|
24
31
|
declare const DraggableComponent: React.FC<DraggableComponentProps>;
|
|
25
32
|
export default DraggableComponent;
|
|
@@ -7,7 +7,8 @@ export interface ToolHeaderProps {
|
|
|
7
7
|
onClose?: () => void;
|
|
8
8
|
className?: string;
|
|
9
9
|
isDraggable?: boolean;
|
|
10
|
-
|
|
10
|
+
leftHeaderComponent?: React.ReactNode;
|
|
11
|
+
rightHeaderComponent?: React.ReactNode;
|
|
11
12
|
}
|
|
12
13
|
export interface ToolContainerProps extends PaperProps, ToolHeaderProps {
|
|
13
14
|
isResizable?: boolean;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ControlPosition } from 'react-draggable';
|
|
3
|
+
import { Size } from '../DraggableResizable/types';
|
|
4
|
+
interface PositionAndSizeProps {
|
|
5
|
+
currentX: number;
|
|
6
|
+
newWidth: number;
|
|
7
|
+
maxWidth: number;
|
|
8
|
+
position: ControlPosition;
|
|
9
|
+
startSize: Size;
|
|
10
|
+
}
|
|
11
|
+
interface PositionAndSizePropsRight extends PositionAndSizeProps {
|
|
12
|
+
currentWidth: number;
|
|
13
|
+
}
|
|
14
|
+
export declare const getRightPositionAndSize: ({ currentX, currentWidth, newWidth, maxWidth, position, startSize, }: PositionAndSizePropsRight) => {
|
|
15
|
+
size: Size;
|
|
16
|
+
position: ControlPosition;
|
|
17
|
+
};
|
|
18
|
+
export declare const getLeftPositionAndSize: ({ currentX, newWidth, maxWidth, position, startSize, }: PositionAndSizeProps) => {
|
|
19
|
+
size: Size;
|
|
20
|
+
position: ControlPosition;
|
|
21
|
+
};
|
|
22
|
+
interface UseHandleSizeFromOutsideComponentProps {
|
|
23
|
+
nodeRef: React.RefObject<HTMLDivElement>;
|
|
24
|
+
startSize: Size;
|
|
25
|
+
bounds?: 'parent' | string;
|
|
26
|
+
isRightAligned: boolean;
|
|
27
|
+
size: Size;
|
|
28
|
+
setSize: (size: Size) => void;
|
|
29
|
+
position: ControlPosition;
|
|
30
|
+
setPosition: (position: ControlPosition) => void;
|
|
31
|
+
}
|
|
32
|
+
export declare const useHandleSizeFromOutsideComponent: ({ nodeRef, startSize, bounds, isRightAligned, size, setSize, position, setPosition, }: UseHandleSizeFromOutsideComponentProps) => void;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/hooks/useMakeSureContainerStaysInsideWindow/useMakeSureContainerStaysInsideWindow.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DraggablePosition } from '../../components/DraggableResizable/Draggable';
|
|
3
|
+
export declare const adjustPosition: (bbox: DOMRect, containingView: DOMRect, position: DraggablePosition, setPosition: (position: DraggablePosition) => void) => void;
|
|
3
4
|
export declare const useMakeSureContainerStaysInsideWindow: (nodeRef: React.RefObject<HTMLDivElement>, position: DraggablePosition, setPosition: (position: DraggablePosition) => void) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const IS_JEST: boolean;
|
package/lib/utils/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/shared",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.6.0",
|
|
4
4
|
"description": "GeoWeb shared library with shared components and utils for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
"peerDependencies": {
|
|
15
15
|
"react": "^17.0.2",
|
|
16
16
|
"@mui/material": "^5.10.8",
|
|
17
|
-
"@opengeoweb/theme": "4.
|
|
17
|
+
"@opengeoweb/theme": "4.6.0",
|
|
18
18
|
"react-draggable": "^4.4.5",
|
|
19
19
|
"re-resizable": "^6.9.0",
|
|
20
20
|
"@redux-eggs/core": "^2.2.0",
|
|
21
21
|
"react-redux": "^8.0.4",
|
|
22
|
-
"@opengeoweb/form-fields": "4.
|
|
22
|
+
"@opengeoweb/form-fields": "4.6.0",
|
|
23
23
|
"react-hook-form": "^6.12.1",
|
|
24
24
|
"moment": "^2.29.0",
|
|
25
25
|
"moment-timezone": "^0.5.31",
|