Derivate of Foundry's Item.createDialog() functionality.

Hierarchy

  • FormApplication
    • CreateDialog

Constructors

  • Parameters

    • Optionaldata: object = {}

      Initial item data

    • Optionaloptions: {
          options: undefined | object;
          pack: any;
          parent: any;
          resolve: undefined | Function;
          types: string[];
      } = {}

      Optional configuration

      • options: undefined | object

        FormApplication options

      • pack: any

        Pack reference given to Item.create()

      • parent: any

        Parent reference given to Item.create()

      • resolve: undefined | Function

        Resolve callback

      • types: string[]

        Array of types to limit the choices to.

    Returns CreateDialog

Properties

createData: object = {}
pack: any
parent: any
resolve: undefined | Function
types: string[]

Accessors

  • get template(): string
  • The path to the HTML template file which should be used to render the inner content of the app

    Returns string

  • get title(): string
  • An Application window should define its own title definition logic which may be dynamic depending on its data

    Returns string

  • get defaultOptions(): {
        classes: string[];
        closeOnSubmit: boolean;
        height: string;
        submitOnChange: boolean;
        submitOnClose: boolean;
    }
  • Assign the default options which are supported by the entity edit sheet.

    Returns {
        classes: string[];
        closeOnSubmit: boolean;
        height: string;
        submitOnChange: boolean;
        submitOnClose: boolean;
    }

    The default options for this FormApplication class

    • classes: string[]
    • closeOnSubmit: boolean
    • height: string
    • submitOnChange: boolean
    • submitOnClose: boolean

    Application.defaultOptions

    foundry.utils.mergeObject(super.defaultOptions, {
    classes: ["form"],
    closeOnSubmit: true,
    editable: true,
    sheetConfig: false,
    submitOnChange: false,
    submitOnClose: false
    });

Methods

  • This method is called upon form submission after form data is validated

    Parameters

    • event: any

      The initial triggering submission event

    • formData: any

      The object of validated form data with which to update the object

    Returns void

    A Promise which resolves once the update operation has completed

  • Returns {
        defaultName: any;
        folder: any;
        folders: {
            [k: string]: T;
        };
        hasFolders: boolean;
        name: any;
        subtype: any;
        subtypes: null | {};
        type: any;
        types: {
            [k: string]: T;
        };
    }

    • defaultName: any
    • folder: any
    • folders: {
          [k: string]: T;
      }
      • [k: string]: T
    • hasFolders: boolean
    • name: any
    • subtype: any
    • subtypes: null | {}
    • type: any
    • types: {
          [k: string]: T;
      }
      • [k: string]: T
  • Wait for dialog to the resolved.

    Parameters

    • Optionaldata: object

      Initial data to pass to the constructor.

    • Optionaloptions: object = {}

      Options to pass to the constructor.

    Returns Promise<null | Item>

    Created item or null.