Override and extend the core ItemSheet implementation to handle game system specific item types

Hierarchy (View Summary)

Constructors

Accessors

  • get template(): string
  • Return a dynamic reference to the HTML template path used to render this Item Sheet

    Returns string

    • Template path
  • get defaultOptions(): InsertKeys<
        {},
        OmitByValue<
            {
                classes: string[];
                dragDrop: (
                    | { dragSelector: string; dropSelector: string }
                    | { dragSelector: string; dropSelector: null }
                )[];
                scrollY: string[];
                tabs: {
                    contentSelector: string;
                    group: string;
                    initial: string;
                    navSelector: string;
                }[];
                width: number;
            },
            never,
        >,
    >
  • Returns InsertKeys<
        {},
        OmitByValue<
            {
                classes: string[];
                dragDrop: (
                    | { dragSelector: string; dropSelector: string }
                    | { dragSelector: string; dropSelector: null }
                )[];
                scrollY: string[];
                tabs: {
                    contentSelector: string;
                    group: string;
                    initial: string;
                    navSelector: string;
                }[];
                width: number;
            },
            never,
        >,
    >

    foundry.utils.mergeObject(super.defaultOptions, {
    template: "templates/sheets/item-sheet.html",
    width: 500,
    closeOnSubmit: false,
    submitOnClose: true,
    submitOnChange: true,
    resizable: true,
    baseApplication: "ItemSheet",
    id: "item"
    })

Methods

  • Internal

    Parameters

    • event: Event

      Click event

    • Optionaltooltip: boolean = false

      Is this event from locked tooltip?

    Returns undefined

  • Internal

    Handle dropping content-linkable data to <textarea> or text <input>

    Parameters

    • event: DragEvent

    Returns Promise<undefined | Partial<Record<string, unknown>>>

  • Parameters

    • item: any

    Returns { addons: any[]; basics: {}; materials: {} }

  • Activate listeners for interactive item sheet events

    Parameters

    • html: JQuery<HTMLElement>

    Returns void

  • Prepare item sheet data Start with the base item data and extending with additional properties for rendering.

    Returns Promise<
        {
            canClassLink: boolean;
            config: config;
            cssClass: string;
            document: ItemPF;
            editable: boolean;
            inContainer: boolean;
            isGM: boolean;
            item: ItemPF;
            itemType: string;
            labels: Record<string, string>;
            name: null | string;
            owned: boolean;
            owner: boolean;
            rollData: object;
            system: any;
            tag: any;
        },
    >