react-asc 23.7.1 → 24.0.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.
@@ -1,10 +1,10 @@
1
1
  import React, { ReactElement } from 'react';
2
2
  import { MenuPosition } from './menu.types';
3
- import { IMenuItemProps } from './MenuItem';
3
+ import { IListItemProps } from '../List';
4
4
  export interface IMenuProps extends React.DetailedHTMLProps<React.HtmlHTMLAttributes<HTMLDivElement>, HTMLDivElement> {
5
5
  toggle?: ReactElement;
6
6
  open?: boolean;
7
- children?: ReactElement<IMenuItemProps> | Array<ReactElement<IMenuItemProps>>;
7
+ children?: ReactElement<IListItemProps> | Array<ReactElement<IListItemProps>>;
8
8
  menuPosition?: MenuPosition;
9
9
  onClickBackdrop?: () => void;
10
10
  }
@@ -1,8 +1,8 @@
1
1
  import React, { ReactElement } from 'react';
2
2
  import { MenuPosition } from './menu.types';
3
- import { IMenuItemProps } from './MenuItem';
3
+ import { IListItemProps } from '../List';
4
4
  export interface IMenuBodyProps {
5
- children?: ReactElement<IMenuItemProps> | Array<ReactElement<IMenuItemProps>>;
5
+ children?: ReactElement<IListItemProps> | Array<ReactElement<IListItemProps>>;
6
6
  className?: string;
7
7
  menuPosition?: MenuPosition;
8
8
  parentRef: React.RefObject<HTMLDivElement>;
@@ -1,8 +1,3 @@
1
- import React, { ReactNode } from 'react';
2
- export interface IMenuItemProps {
3
- key?: string;
4
- children?: ReactNode;
5
- onClick?: (e: React.MouseEvent) => void;
6
- type?: 'item' | 'header';
7
- }
8
- export declare const MenuItem: (props: IMenuItemProps) => JSX.Element;
1
+ /// <reference types="react" />
2
+ import { IListItemProps } from '../List';
3
+ export declare const MenuItem: (props: IListItemProps) => JSX.Element;
@@ -8,7 +8,8 @@ interface IModalProps {
8
8
  description?: string | ReactElement;
9
9
  formControls?: IControls;
10
10
  modalType?: MODALTYPE;
11
- onOk?: (values?: IFormValues) => void;
11
+ onOk: (values?: IFormValues) => void;
12
+ onChange?: (values?: IFormValues) => void;
12
13
  onCancel?: () => void;
13
14
  onBackdropClick?: () => void;
14
15
  isDismissable?: boolean;
@@ -16,5 +17,5 @@ interface IModalProps {
16
17
  fullScreen?: boolean;
17
18
  size?: SIZE;
18
19
  }
19
- export declare const GlobalModal: ({ title, description, formControls, onOk, onCancel, onBackdropClick, isDismissable, buttons, size, fullScreen }: IModalProps) => JSX.Element;
20
+ export declare const GlobalModal: ({ title, description, formControls, onOk, onChange, onCancel, onBackdropClick, isDismissable, buttons, size, fullScreen }: IModalProps) => JSX.Element;
20
21
  export {};
@@ -1,20 +1,23 @@
1
- import { IControls, IFormValues } from '../Form';
1
+ import { IControls } from '../Form';
2
2
  import { ReactElement } from 'react';
3
3
  import { IModalButton } from './modal.interfaces';
4
4
  import { SIZE } from '../component.enums';
5
5
  export interface IModalService {
6
- show(title: string, description: string | ReactElement, options?: IModalOptions): Promise<void | IFormValues>;
6
+ show(title: string, description: string | ReactElement, options?: IModalOptions): Promise<void>;
7
7
  }
8
8
  export interface IModalOptions {
9
- formControls?: IControls;
10
9
  isDismissable?: boolean;
11
10
  buttons?: Array<IModalButton>;
12
11
  fullScreen?: boolean;
13
12
  size?: SIZE;
14
13
  }
14
+ export interface IModalFormOptions extends IModalOptions {
15
+ formControls?: IControls;
16
+ }
15
17
  declare class ModalService implements IModalService {
16
18
  private container;
17
- show(title: string, description: string | ReactElement, options?: IModalOptions): Promise<void | IFormValues>;
19
+ show(title: string, description: string | ReactElement, options?: IModalOptions): Promise<void>;
20
+ showForm<T>(title: string, options?: IModalFormOptions): Promise<T>;
18
21
  private hide;
19
22
  }
20
23
  export declare const modalService: ModalService;
@@ -26,6 +26,7 @@ export * from './List';
26
26
  export * from './LoadingIndicator';
27
27
  export * from './Modal';
28
28
  export * from './NumberSelect';
29
+ export * from './Portal';
29
30
  export * from './ProgressBar';
30
31
  export * from './Sidebar';
31
32
  export * from './Snackbar';
@@ -1,4 +1,5 @@
1
- export declare function useWindowSize(): {
1
+ export interface IUseWindowSize {
2
2
  width: number;
3
3
  height: number;
4
- };
4
+ }
5
+ export declare function useWindowSize(): IUseWindowSize;