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) => { visible: boolean; afterVisibleChange: any; onClose: any }; antdModal: (modal: NiceModalHandler) => { visible: boolean; afterClose: any; onCancel: any; onOk: any }; bootstrapDialog: (modal: NiceModalHandler) => { show: boolean; onExited: any; onHide: any }; create: <P>(Comp: ComponentType<P>) => FC<P & NiceModalHocProps>; hide: (modal: string | FC<any>) => Promise<unknown>; muiDialog: (modal: NiceModalHandler) => { open: boolean; onClose: any; onExited: any }; reducer: (state?: NiceModalStore, action: NiceModalAction) => NiceModalStore; register: (id: string, comp: FC<any>, props?: Record<string, unknown>) => void; remove: (modalId: string) => void; show: (modal: string | FC<any>, args?: Record<string, unknown>) => Promise<unknown>; useModal: (...params: UseModalArgs) => NiceModalHandler }

Type declaration

  • ModalDef: FC<Record<string, unknown>>
  • Provider: FC<Record<string, unknown>>
  • antdDrawer: (modal: NiceModalHandler) => { visible: boolean; afterVisibleChange: any; onClose: any }
      • (modal: NiceModalHandler): { 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) => { visible: boolean; afterClose: any; onCancel: any; onOk: any }
      • (modal: NiceModalHandler): { 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) => { 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) => { 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: (id: string, comp: FC<any>, props?: Record<string, unknown>) => void
      • (id: string, comp: FC<any>, props?: Record<string, unknown>): void
      • Parameters

        • id: string
        • comp: FC<any>
        • Optional props: Record<string, unknown>

        Returns void

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

        • modalId: string

        Returns void

  • show: (modal: string | FC<any>, args?: Record<string, unknown>) => Promise<unknown>
      • (modal: string | FC<any>, args?: Record<string, unknown>): Promise<unknown>
      • Parameters

        • modal: string | FC<any>
        • Optional args: Record<string, unknown>

        Returns Promise<unknown>

  • useModal: (...params: UseModalArgs) => NiceModalHandler

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): { 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): { 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): { show: boolean; onExited: any; onHide: any }

Const create

Const hide

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

    • modal: string | FC<any>

    Returns Promise<unknown>

Const muiDialog

  • muiDialog(modal: NiceModalHandler): { 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(id: string, comp: FC<any>, props?: Record<string, unknown>): void
  • Parameters

    • id: string
    • comp: FC<any>
    • Optional props: Record<string, unknown>

    Returns void

Const remove

  • remove(modalId: string): void
  • Parameters

    • modalId: string

    Returns void

Const show

  • show(modal: string | FC<any>, args?: Record<string, unknown>): Promise<unknown>
  • Parameters

    • modal: string | FC<any>
    • 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

Const useModal

Generated using TypeDoc