Options
All
  • Public
  • Public/Protected
  • All
Menu

@ebay/nice-modal-react

Index

Properties

default

default: { ModalDef: FC<Record<string, unknown>>; Provider: FC<Record<string, unknown>>; antdDrawer: (modal: NiceModalHandler<Record<string, unknown>>) => { visible: boolean; afterVisibleChange: any; onClose: any }; antdModal: (modal: NiceModalHandler<Record<string, unknown>>) => { visible: boolean; afterClose: any; onCancel: any; onOk: any }; bootstrapDialog: (modal: NiceModalHandler<Record<string, unknown>>) => { show: boolean; onExited: any; onHide: any }; create: <P>(Comp: ComponentType<P>) => FC<P & NiceModalHocProps>; hide: (modal: string | FC<any>) => Promise<unknown>; muiDialog: (modal: NiceModalHandler<Record<string, unknown>>) => { open: boolean; onClose: any; onExited: any }; reducer: (state?: NiceModalStore, action: NiceModalAction) => NiceModalStore; register: <T>(id: string, comp: T, props?: NiceModalArgs<T>) => void; remove: (modalId: string) => void; show: { <T>(modal: T, args?: NiceModalArgs<T>): Promise<unknown>; <T>(modal: T, args?: Record<string, unknown>): Promise<unknown> }; useModal: { (): NiceModalHandler; <T>(modal: T, args?: Record<string, unknown>): NiceModalHandler; <T>(modal: T, args?: NiceModalArgs<T>): NiceModalHandler<NiceModalArgs<T>> } }

Type declaration

  • ModalDef: FC<Record<string, unknown>>
  • Provider: FC<Record<string, unknown>>
  • antdDrawer: (modal: NiceModalHandler<Record<string, unknown>>) => { visible: boolean; afterVisibleChange: any; onClose: any }
      • (modal: NiceModalHandler<Record<string, unknown>>): { visible: boolean; afterVisibleChange: any; onClose: any }
      • Parameters

        Returns { visible: boolean; afterVisibleChange: any; onClose: any }

        • visible: boolean
        • afterVisibleChange: function
          • afterVisibleChange(visible: boolean): void
          • Parameters

            • visible: boolean

            Returns void

        • onClose: function
          • onClose(): void
  • antdModal: (modal: NiceModalHandler<Record<string, unknown>>) => { visible: boolean; afterClose: any; onCancel: any; onOk: any }
      • (modal: NiceModalHandler<Record<string, unknown>>): { visible: boolean; afterClose: any; onCancel: any; onOk: any }
      • Parameters

        Returns { visible: boolean; afterClose: any; onCancel: any; onOk: any }

        • visible: boolean
        • afterClose: function
          • afterClose(): void
        • onCancel: function
          • onCancel(): void
        • onOk: function
          • onOk(): void
  • bootstrapDialog: (modal: NiceModalHandler<Record<string, unknown>>) => { show: boolean; onExited: any; onHide: any }
      • (modal: NiceModalHandler<Record<string, unknown>>): { show: boolean; onExited: any; onHide: any }
      • Parameters

        Returns { show: boolean; onExited: any; onHide: any }

        • show: boolean
        • onExited: function
          • onExited(): void
        • onHide: function
          • onHide(): void
  • create: <P>(Comp: ComponentType<P>) => FC<P & NiceModalHocProps>
  • hide: (modal: string | FC<any>) => Promise<unknown>
      • (modal: string | FC<any>): Promise<unknown>
      • Parameters

        • modal: string | FC<any>

        Returns Promise<unknown>

  • muiDialog: (modal: NiceModalHandler<Record<string, unknown>>) => { open: boolean; onClose: any; onExited: any }
      • (modal: NiceModalHandler<Record<string, unknown>>): { open: boolean; onClose: any; onExited: any }
      • Parameters

        Returns { open: boolean; onClose: any; onExited: any }

        • open: boolean
        • onClose: function
          • onClose(): void
        • onExited: function
          • onExited(): void
  • reducer: (state?: NiceModalStore, action: NiceModalAction) => NiceModalStore
  • register: <T>(id: string, comp: T, props?: NiceModalArgs<T>) => void
      • <T>(id: string, comp: T, props?: NiceModalArgs<T>): void
      • Type parameters

        • T: FunctionComponent<any, T>

        Parameters

        • id: string
        • comp: T
        • Optional props: NiceModalArgs<T>

        Returns void

  • remove: (modalId: string) => void
      • (modalId: string): void
      • Parameters

        • modalId: string

        Returns void

  • show: { <T>(modal: T, args?: NiceModalArgs<T>): Promise<unknown>; <T>(modal: T, args?: Record<string, unknown>): Promise<unknown> }
      • <T>(modal: T, args?: NiceModalArgs<T>): Promise<unknown>
      • <T>(modal: T, args?: Record<string, unknown>): Promise<unknown>
      • Type parameters

        • T: FunctionComponent<any, T>

        Parameters

        • modal: T
        • Optional args: NiceModalArgs<T>

        Returns Promise<unknown>

      • Type parameters

        • T: string

        Parameters

        • modal: T
        • Optional args: Record<string, unknown>

        Returns Promise<unknown>

  • useModal: { (): NiceModalHandler; <T>(modal: T, args?: Record<string, unknown>): NiceModalHandler; <T>(modal: T, args?: NiceModalArgs<T>): NiceModalHandler<NiceModalArgs<T>> }

Variables

Const ModalDef

ModalDef: React.FC<Record<string, unknown>> = ...

Declarative way to register a modal.

param

The id of the modal.

param

The modal Component.

returns

Const Provider

Provider: React.FC<Record<string, unknown>> = ...

Functions

Const antdDrawer

  • antdDrawer(modal: NiceModalHandler<Record<string, unknown>>): { visible: boolean; afterVisibleChange: any; onClose: any }
  • Parameters

    Returns { visible: boolean; afterVisibleChange: any; onClose: any }

    • visible: boolean
    • afterVisibleChange: function
      • afterVisibleChange(visible: boolean): void
      • Parameters

        • visible: boolean

        Returns void

    • onClose: function
      • onClose(): void

Const antdModal

  • antdModal(modal: NiceModalHandler<Record<string, unknown>>): { visible: boolean; afterClose: any; onCancel: any; onOk: any }
  • Parameters

    Returns { visible: boolean; afterClose: any; onCancel: any; onOk: any }

    • visible: boolean
    • afterClose: function
      • afterClose(): void
    • onCancel: function
      • onCancel(): void
    • onOk: function
      • onOk(): void

Const bootstrapDialog

  • bootstrapDialog(modal: NiceModalHandler<Record<string, unknown>>): { show: boolean; onExited: any; onHide: any }
  • Parameters

    Returns { show: boolean; onExited: any; onHide: any }

    • show: boolean
    • onExited: function
      • onExited(): void
    • onHide: function
      • onHide(): void

Const create

Const hide

  • hide(modal: string | FC<any>): Promise<unknown>
  • Parameters

    • modal: string | FC<any>

    Returns Promise<unknown>

Const muiDialog

  • muiDialog(modal: NiceModalHandler<Record<string, unknown>>): { open: boolean; onClose: any; onExited: any }
  • Parameters

    Returns { open: boolean; onClose: any; onExited: any }

    • open: boolean
    • onClose: function
      • onClose(): void
    • onExited: function
      • onExited(): void

Const reducer

Const register

  • register<T>(id: string, comp: T, props?: NiceModalArgs<T>): void
  • Type parameters

    • T: FunctionComponent<any, T>

    Parameters

    • id: string
    • comp: T
    • Optional props: NiceModalArgs<T>

    Returns void

Const remove

  • remove(modalId: string): void
  • Parameters

    • modalId: string

    Returns void

show

  • show<T>(modal: T, args?: NiceModalArgs<T>): Promise<unknown>
  • show<T>(modal: T, args?: Record<string, unknown>): Promise<unknown>
  • Type parameters

    • T: FunctionComponent<any, T>

    Parameters

    • modal: T
    • Optional args: NiceModalArgs<T>

    Returns Promise<unknown>

  • Type parameters

    • T: string

    Parameters

    • modal: T
    • Optional args: Record<string, unknown>

    Returns Promise<unknown>

Const unregister

  • unregister(id: string): void
  • Unregister a modal.

    Parameters

    • id: string

      The id of the modal.

    Returns void

useModal

Generated using TypeDoc