Provides storage for all dialog options through individual accessors and get, merge, replace and set methods that safely access and update data changed to the mounted DialogShell component reactively.

interface TJSDialogData {
    buttons: {
        [key: string]: TJSDialogButtonData;
    };
    content: string | TJSSvelteConfig;
    default: string;
    draggable: boolean;
    focusAuto: boolean;
    focusFirst: boolean;
    focusKeep: boolean;
    minimizable: boolean;
    modal: boolean;
    modalOptions: TJSDialogModalOptions;
    notifyError: boolean;
    onClose: string | ((data?: {
        application?: TJSDialog;
    }) => any);
    rejectClose: boolean;
    resizable: boolean;
    resolveId: boolean;
    title: string;
    transition: TJSDialogTransitionOptions;
    zIndex: number;
    clone(): TJSDialogOptions;
    get(accessor: string, defaultValue?: any): any;
    merge(data: TJSDialogOptions): void;
    replace(data: any): void;
    set(accessor: string, value: any): boolean;
}

Accessors

  • get content(): string | TJSSvelteConfig
  • Returns string | TJSSvelteConfig

    The Svelte configuration object or HTML string content.

  • set content(content): void
  • Set the Svelte configuration object or HTML string content.

    Parameters

    • content: string | TJSSvelteConfig

      New Svelte configuration object or HTML string content.

    Returns void

  • get default(): string
  • Returns string

    The default button ID to focus initially.

  • set default(newDefault): void
  • Set the default button ID to focus initially.

    Parameters

    • newDefault: string

      New default button ID to focus initially.

    Returns void

  • get draggable(): boolean
  • Returns boolean

    The dialog draggable state; draggable when true.

  • set draggable(draggable): void
  • Set the dialog state; draggable when true.

    Parameters

    • draggable: boolean

      New dialog draggable state; draggable when true.

    Returns void

  • get focusAuto(): boolean
  • Returns boolean

    When true auto-management of app focus is enabled.

  • set focusAuto(focusAuto): void
  • Set the dialog auto-management of app focus.

    Parameters

    • focusAuto: boolean

      New dialog auto-management of app focus.

    Returns void

  • get focusFirst(): boolean
  • Returns boolean

    When true the first focusable element that isn't a button is focused.

  • set focusFirst(focusFirst): void
  • Set the dialog first focusable element state.

    Parameters

    • focusFirst: boolean

      New dialog first focusable element state.

    Returns void

  • get focusKeep(): boolean
  • Returns boolean

    When focusAuto and focusKeep is true; keeps internal focus.

  • set focusKeep(focusKeep): void
  • Set the dialog focusKeep state. When focusAuto and focusKeep is true; keeps internal focus.

    Parameters

    • focusKeep: boolean

      New dialog focusKeep state.

    Returns void

  • get minimizable(): boolean
  • Returns boolean

    When true the dialog is minimizable.

  • set minimizable(minimizable): void
  • Set the dialog minimizable state. When true the dialog is minimizable.

    Parameters

    • minimizable: boolean

      New dialog minimizable state.

    Returns void

  • get modal(): boolean
  • Returns boolean

    When true a modal dialog is displayed.

  • set modal(modal): void
  • Set the dialog modal state. When true a modal dialog is displayed.

    Parameters

    • modal: boolean

      New dialog modal state.

    Returns void

  • get notifyError(): boolean
  • Returns boolean

    When true and an error is raised in dialog callback functions post a UI error notification.

  • set notifyError(notifyError): void
  • Set the dialog notifyError state. When true and an error is raised in dialog callback functions post a UI error notification.

    Parameters

    • notifyError: boolean

      New dialog notifyError state.

    Returns void

  • get onClose(): string | ((data?: {
        application?: TJSDialog;
    }) => any)
  • Returns string | ((data?: {
        application?: TJSDialog;
    }) => any)

    Callback invoked when dialog is closed; no button option selected. When defined as a string any matching function by name exported from content Svelte component is invoked.

  • set onClose(onClose): void
  • Set callback invoked when dialog is closed; no button option selected. When defined as a string any matching function by name exported from content Svelte component is invoked..

    Parameters

    • onClose: string | ((data?: {
          application?: TJSDialog;
      }) => any)

      New dialog onClose state.

    Returns void

  • get rejectClose(): boolean
  • Returns boolean

    Dialog rejectClose state. When true and a Promise has been created by TJSDialog.wait and the Promise is not in the process of being resolved or rejected on close of the dialog any onClose function is invoked and any result that is undefined will cause the Promise to then be rejected..

  • set rejectClose(rejectClose): void
  • Set the dialog rejectClose state.

    Parameters

    • rejectClose: boolean

      New dialog rejectClose state.

    Returns void

  • get resizable(): boolean
  • Returns boolean

    When true the dialog is resizable.

  • set resizable(resizable): void
  • Set the dialog resizable state. When true the dialog is resizable.

    Parameters

    • resizable: boolean

      New dialog resizable state.

    Returns void

  • get resolveId(): boolean
  • Returns boolean

    When true and resolving any Promises and there are undefined results from any button callbacks the button ID is resolved.

  • set resolveId(resolveId): void
  • Set the dialog resolveId state. When true and resolving any Promises and there are undefined results from any button callbacks the button ID is resolved.

    Parameters

    • resolveId: boolean

      New dialog resolveId state.

    Returns void

  • get title(): string
  • Returns string

    The dialog window title.

  • set title(title): void
  • Set the dialog window title.

    Parameters

    • title: string

      New dialog window title.

    Returns void

  • get zIndex(): number
  • Returns number

    A specific z-index for the dialog. Pass null for the dialog to act like other applications in regard bringing to top when activated.

  • set zIndex(zIndex): void
  • Set specific z-index for the dialog.

    Parameters

    • zIndex: number

      New z-index for the dialog.

    Returns void

Methods

  • Provides a cloned copy of the dialog data. Note: The content attribute is not cloned as complex / props may be present.

    Returns TJSDialogOptions

    A clone of the dialog data.

  • Provides a way to safely get this dialogs data given an accessor string which describes the entries to walk. To access deeper entries into the object format the accessor string with . between entries to walk.

    Parameters

    • accessor: string

      The path / key to set. You can set multiple levels.

    • OptionaldefaultValue: any

      A default value returned if the accessor is not found.

    Returns any

    Value at the accessor.

  • Parameters

    Returns void

  • Replaces all dialog data; this is reactive.

    Parameters

    • data: any

      Dialog data.

    Returns void

  • Provides a way to safely set this dialogs data given an accessor string which describes the entries to walk. To access deeper entries into the object format the accessor string with . between entries to walk.

    Automatically the dialog data will be updated in the associated DialogShell Svelte component.

    Parameters

    • accessor: string

      The path / key to set. You can set multiple levels.

    • value: any

      Value to set.

    Returns boolean

    True if successful.