@opengeoweb/shared 4.3.0 → 4.5.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.
Files changed (27) hide show
  1. package/index.esm.js +403 -136
  2. package/index.umd.js +414 -148
  3. package/lib/components/CustomAccordion/CustomAccordion.d.ts +10 -0
  4. package/lib/components/CustomAccordion/CustomAccordion.spec.d.ts +1 -0
  5. package/lib/components/CustomAccordion/CustomAccordion.stories.d.ts +13 -0
  6. package/lib/components/CustomAccordion/index.d.ts +1 -0
  7. package/lib/components/CustomTooltip/CustomTooltip.d.ts +8 -0
  8. package/lib/components/CustomTooltip/CustomTooltip.spec.d.ts +1 -0
  9. package/lib/components/CustomTooltip/index.d.ts +1 -0
  10. package/lib/components/DraggableResizable/Draggable.d.ts +3 -3
  11. package/lib/components/DraggableResizable/Resizable.d.ts +1 -0
  12. package/lib/components/DraggableResizable/types.d.ts +1 -3
  13. package/lib/components/EnableButton/EnableButton.d.ts +2 -0
  14. package/lib/components/ManagerButton/ManagerButton.d.ts +1 -0
  15. package/lib/components/StatusTag/StatusTag.stories.d.ts +21 -1
  16. package/lib/components/ToolContainer/ToolContainerDraggable.d.ts +9 -2
  17. package/lib/components/ToolContainer/types.d.ts +2 -1
  18. package/lib/components/WithEggs/WithEggs.d.ts +3 -0
  19. package/lib/components/WithEggs/WithEggs.spec.d.ts +1 -0
  20. package/lib/components/WithEggs/index.d.ts +1 -0
  21. package/lib/components/index.d.ts +3 -0
  22. package/lib/hooks/index.d.ts +1 -0
  23. package/lib/hooks/useMakeSureContainerStaysInsideWindow/useMakeSureContainerStaysInsideWindow.d.ts +4 -0
  24. package/lib/hooks/useMakeSureContainerStaysInsideWindow/useMakeSureContainerStaysInsideWindow.spec.d.ts +1 -0
  25. package/lib/utils/containerQueryHelper.d.ts +1 -0
  26. package/lib/utils/index.d.ts +1 -0
  27. package/package.json +6 -4
@@ -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,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 * from './CustomTooltip';
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- declare type Position = {
2
+ export declare type DraggablePosition = {
3
3
  x: number;
4
4
  y: number;
5
5
  };
@@ -7,8 +7,8 @@ interface DraggableComponentProps {
7
7
  nodeRef?: React.RefObject<HTMLElement>;
8
8
  children?: React.ReactNode;
9
9
  bounds?: 'parent' | string;
10
- position?: Position;
11
- onStop?: (event: React.MouseEvent<HTMLElement>, pos: Position) => void;
10
+ position?: DraggablePosition;
11
+ onStop?: (event: React.MouseEvent<HTMLElement>, pos: DraggablePosition) => void;
12
12
  onMouseDown?: (event: MouseEvent) => void;
13
13
  handle?: string;
14
14
  }
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
2
  import { ResizableComponentProps } from './types';
3
+ export declare const isDraggingClassName = "is-dragging";
3
4
  declare const ResizeComponent: React.FC<ResizableComponentProps>;
4
5
  export default ResizeComponent;
@@ -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 {};
@@ -3,6 +3,8 @@ interface EnableLayerProps {
3
3
  isEnabled?: boolean;
4
4
  title: string;
5
5
  onChangeEnableLayer: (enable: boolean) => void;
6
+ className?: string;
7
+ id?: string;
6
8
  }
7
9
  export declare const EnableButton: React.FC<EnableLayerProps>;
8
10
  export {};
@@ -8,5 +8,6 @@ export interface ManagerButtonProps extends IconButtonProps {
8
8
  icon: React.ReactNode;
9
9
  testId: string;
10
10
  isAccessible?: boolean;
11
+ children?: React.ReactElement;
11
12
  }
12
13
  export declare const ManagerButton: React.FC<ManagerButtonProps>;
@@ -3,7 +3,27 @@ declare const _default: {
3
3
  title: string;
4
4
  };
5
5
  export default _default;
6
- export declare const StatusTags: {
6
+ export declare const StatusTagsGWTheme: {
7
7
  (): React.ReactElement;
8
8
  storyName: string;
9
9
  };
10
+ export declare const StatusTagsLight: {
11
+ (): React.ReactElement;
12
+ storyName: string;
13
+ parameters: {
14
+ zeplinLink: {
15
+ name: string;
16
+ link: string;
17
+ }[];
18
+ };
19
+ };
20
+ export declare const StatusTagsDark: {
21
+ (): React.ReactElement;
22
+ storyName: string;
23
+ parameters: {
24
+ zeplinLink: {
25
+ name: string;
26
+ link: string;
27
+ }[];
28
+ };
29
+ };
@@ -1,5 +1,7 @@
1
1
  import React from 'react';
2
- import { ResizableComponentProps, Size } from '../DraggableResizable/types';
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
- leftComponent?: React.ReactNode;
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
- leftComponent?: React.ReactNode;
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,3 @@
1
+ import * as React from 'react';
2
+ import { Egg } from '@redux-eggs/core';
3
+ export declare function withEggs(eggs: Egg[]): (Component: React.FC) => React.FC;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export { withEggs } from './WithEggs';
@@ -17,3 +17,6 @@ export * from './EnableButton';
17
17
  export * from './AlertIcon';
18
18
  export * from './TooltipSelect';
19
19
  export * from './Avatar';
20
+ export * from './WithEggs';
21
+ export * from './CustomTooltip';
22
+ export * from './CustomAccordion';
@@ -3,3 +3,4 @@ export * from './usePoller/usePoller';
3
3
  export * from './usePrevious/usePrevious';
4
4
  export * from './useIsMounted/useIsMounted';
5
5
  export * from './useDraftFormHelpers/useDraftFormHelpers';
6
+ export * from './useMakeSureContainerStaysInsideWindow/useMakeSureContainerStaysInsideWindow';
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { DraggablePosition } from '../../components/DraggableResizable/Draggable';
3
+ export declare const adjustPosition: (bbox: DOMRect, containingView: DOMRect, position: DraggablePosition, setPosition: (position: DraggablePosition) => void) => void;
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;
@@ -1 +1,2 @@
1
1
  export * from './axiosErrorUtils';
2
+ export * from './containerQueryHelper';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/shared",
3
- "version": "4.3.0",
3
+ "version": "4.5.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,15 +14,17 @@
14
14
  "peerDependencies": {
15
15
  "react": "^17.0.2",
16
16
  "@mui/material": "^5.10.8",
17
- "@opengeoweb/theme": "4.3.0",
17
+ "@opengeoweb/theme": "4.5.0",
18
18
  "react-draggable": "^4.4.5",
19
19
  "re-resizable": "^6.9.0",
20
- "lodash": "^4.17.20",
21
- "@opengeoweb/form-fields": "4.3.0",
20
+ "@redux-eggs/core": "^2.2.0",
21
+ "react-redux": "^8.0.4",
22
+ "@opengeoweb/form-fields": "4.5.0",
22
23
  "react-hook-form": "^6.12.1",
23
24
  "moment": "^2.29.0",
24
25
  "moment-timezone": "^0.5.31",
25
26
  "@mui/x-date-pickers": "^5.0.4",
27
+ "lodash": "^4.17.20",
26
28
  "axios": "^0.25.0"
27
29
  }
28
30
  }