Application instance configuration options.
The current position of the application with respect to the window.document.body.
If this Application uses tabbed navigation groups, this mapping is updated whenever the changeTab method is called.
Reports the active tab for each group, with a value of null
indicating no tab is active.
Subclasses may override this property to define default tabs for each group.
Static
Internal
_appAn incrementing integer Application ID.
Static
Internal
_maxZThe current maximum z-index of any displayed Application.
Static
BASE_Designates which upstream Application class in this class' inheritance chain is the base application. Any DEFAULT_OPTIONS of super-classes further upstream of the BASE_APPLICATION are ignored. Hook events for super-classes further upstream of the BASE_APPLICATION are not dispatched.
Static
DEFAULT_Static
emittedStatic
PARTSStatic
RENDER_The sequence of rendering states that describe the Application life-cycle.
Static
TABSConfiguration of application tabs, with an entry per tab group.
The CSS class list of this Application instance
The Document instance associated with the application
The HTMLElement which renders this Application into the DOM.
Does this Application have a top-level form element?
Does this Application instance render within an outer window frame?
The HTML element ID of this Application instance.
This provides a readonly view into the internal ID used by this application.
This getter should not be overridden by subclasses, which should instead configure the ID in DEFAULT_OPTIONS
or
by defining a uniqueId
during _initializeApplicationOptions
.
Is this Document sheet editable by the current User? This is governed by the editPermission threshold configured for the class.
Is this Document sheet visible to the current User? This is governed by the viewPermission threshold configured for the class.
Is this Application instance currently minimized?
Is this Application instance currently rendered?
The current render state of the Application.
Convenience references to window header elements.
Internal
Wait for a CSS transition to complete for an element.
The element which is transitioning
A timeout in milliseconds in case the transitionend event does not occur
Internal
Perform an event in the application life-cycle. Await an internal life-cycle method defined by the class. Optionally dispatch an event for any registered listeners.
A handler function to call
Options which configure event handling
Optional
async?: booleanAwait the result of the handler function?
Optional
debugText?: stringDebugging text to log for the event
Optional
eventName?: stringAn event name to dispatch for registered listeners
Optional
handlerArgs?: any[]Arguments passed to the handler function
Optional
hookArgs?: any[]Arguments passed to the requested hook function
Optional
hookName?: stringA hook name to dispatch for this and all parent classes
Optional
hookResponse?: booleanAdd the handler response to hookArgs
Optional
parentClassHooks?: booleanCall hooks for parent classes in the inheritance chain?
A promise which resoles once the handler is complete if async is true
Abstract
_renderHTMLRender an HTMLElement for the Application. An Application subclass must implement this method in order for the Application to be renderable.
Context data for the render operation
Options which configure application rendering behavior
The result of HTML rendering may be implementation specific. Whatever value is returned here is passed to _replaceHTML
Add a new event listener for a certain type of event.
The type of event being registered for
The listener function called when the event occurs
Optional
options: { once?: boolean } = {}Options which configure the event listener
Optional
once?: booleanShould the event only be responded to once and then removed
Bring this Application window to the front of the rendering stack by increasing its z-index. Once ApplicationV1 is deprecated we should switch from _maxZ to ApplicationV2#maxZ We should also eliminate ui.activeWindow in favor of only ApplicationV2#frontApp
Change the active tab within a tab group in this Application instance.
The name of the tab which should become active
The name of the tab group which defines the set of tabs
Optional
options: {Additional options which affect tab navigation
Optional
event?: EventAn interaction event which caused the tab change, if any
Optional
force?: booleanForce changing the tab even if the new tab is already active
Optional
navElement?: HTMLElementAn explicit navigation element being modified
Optional
updatePosition?: booleanUpdate application position after changing the tab?
Close the Application, removing it from the DOM.
Optional
options: Partial<ApplicationClosingOptions> = {}Options which modify how the application is closed.
A Promise which resolves to the closed Application instance
Dispatch an event on this target.
The Event to dispatch
Was default behavior for the event prevented?
Restore the Application to its original dimensions.
Minimize the Application, collapsing it to a minimal header.
Remove an event listener for a certain type of event.
The type of event being removed
The listener function being removed
Render the Application, creating its HTMLElement and replacing its innerHTML. Add it to the DOM if it is not currently rendered and rendering is forced. Otherwise, re-render its contents.
Optional
options: boolean | ApplicationRenderOptions & DocumentSheetRenderOptions = {}Options which configure application rendering behavior. A boolean is interpreted as the "force" option.
Optional
_options: ApplicationRenderOptions & DocumentSheetRenderOptions = {}Legacy options for backwards-compatibility with the original ApplicationV1#render signature.
A Promise which resolves to the rendered Application instance
Update the Application element position using provided data which is merged with the prior position.
Optional
position: Partial<ApplicationPosition>New Application positioning data
The updated application position
Programmatically submit an ApplicationV2 instance which implements a single top-level form.
Optional
submitOptions: object = {}Arbitrary options which are supported by and provided to the configured form submission handler.
A promise that resolves to the returned result of the form submission handler, if any.
Toggle display of the Application controls menu. Only applicable to window Applications.
Optional
expanded: booleanSet the controls visibility to a specific state. Otherwise, the visible state is toggled from its current value
Optional
options: { animate?: boolean } = {}Options to configure the toggling behavior.
Optional
animate?: booleanAnimate the controls toggling.
A Promise which resolves once the control expansion animation is complete
Protected
_attachProtected
Attach event listeners to the Application frame.
Protected
_createProtected
Create a ContextMenu instance used in this Application.
A handler function that provides initial context options
A CSS selector to which the ContextMenu will be bound
Optional
options: { container?: HTMLElement; hookName?: string; parentClassHooks?: boolean } = {}Additional options which affect ContextMenu construction
Optional
container?: HTMLElementA parent HTMLElement which contains the selector target
Optional
hookName?: stringThe hook name
Optional
parentClassHooks?: booleanWhether to call hooks for the parent classes in the inheritance chain.
A created ContextMenu or null if no menu items were defined
Protected
_getProtected
_getProtected
_getProtected
Configure the array of header control menu options
Protected
_getProtected
Get the configuration for a tabs group.
The ID of a tabs group
Protected
_insertProtected
Insert the application HTML element into the DOM. Subclasses may override this method to customize how the application is inserted.
The element to insert
Protected
_onProtected
A generic event handler for action clicks which can be extended by subclasses. Action handlers defined in DEFAULT_OPTIONS are called first. This method is only called for actions which have no defined handler.
The originating click event
The capturing HTML element which defined a [data-action]
Protected
_onProtected
Handle click events on a tab within the Application.
Protected
_onProtected
Actions performed after the Application is re-positioned.
The requested application position
Protected
_onProtected
Handle toggling the revealed state of a secret embedded in some content.
The triggering event.
Protected
_onProtected
Handle submission for an Application which uses the form element.
The form configuration for which this handler is bound
The form submission event
Protected
_postProtected
Perform post-render finalization actions.
Prepared context data.
Provided render options.
Protected
_preProtected
Actions performed before closing the Application. Pre-close steps are awaited by the close process.
Provided render options
Protected
_preProtected
Actions performed before a first render of the Application.
Prepared context data
Provided render options
Protected
_prepareProtected
Prepare data used to update the Document upon form submission. This data is cleaned and validated before being returned for further processing.
The originating form submission event
The form element that was submitted
Processed data for the submitted form
Optional
updateData: objectAdditional data passed in if this form is submitted manually which should be merged with prepared formData.
Prepared submission data as an object
Protected
_prepareProtected
Prepare application tab data for a single tab group.
The ID of the tab group to prepare
Protected
_preProtected
Actions performed before the Application is re-positioned. Pre-position steps are not awaited because setPosition is synchronous.
The requested application position
Protected
_preProtected
Actions performed before any render of the Application. Pre-render steps are awaited by the render process.
Prepared context data
Provided render options
Protected
_processProtected
Customize how form data is extracted into an expanded object.
The originating form submission event
The form element that was submitted
Processed data for the submitted form
An expanded object of processed form data
Protected
_processProtected
Submit a document update or creation request based on the processed form data.
The originating form submission event
The form element that was submitted
Processed and validated form data to be used for a document update
Optional
options: Partial<DatabaseUpdateOperation | DatabaseCreateOperation> = {}Additional options altering the request
Protected
_removeProtected
Remove the application HTML element from the DOM. Subclasses may override this method to customize how the application element is removed.
The element to be removed
Protected
_renderProtected
Render a header control button.
Protected
_replaceHTMLProtected
Replace the HTML of the application with the result provided by the rendering backend. An Application subclass should implement this method in order for the Application to be renderable.
The result returned by the application rendering backend
The content element into which the rendered result must be inserted
Options which configure application rendering behavior
Protected
_tearProtected
Remove elements from the DOM and trigger garbage collection as part of application closure.
Protected
_toggleProtected
Disable or reenable all form fields in this application.
Should the fields be disabled?
Protected
_updateProtected
When the Application is rendered, optionally update aspects of the window frame.
Options provided at render-time
Protected
_updateProtected
Translate a requested application position updated into a resolved allowed position for the Application. Subclasses may override this method to implement more advanced positioning behavior.
Requested Application positioning data
Resolved Application positioning data
Static
_migrateInternal
Provide a deprecation path for converted V1 document sheets.
The first parameter received by this class's constructor
Any additional parameters received
Static
inheritanceIterate over the inheritance chain of this Application. The chain includes this Application itself and all parents until the base application is encountered.
Static
parseCSSDimensionParse a CSS style rule into a number of pixels which apply to that dimension.
The CSS style rule
The relevant dimension of the parent element
The parsed style dimension in pixels
Static
waitWait for any images in the given element to load.
The element.
The Scene Region configuration application.
Mixes
HandlebarsApplication