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.
StaticBASE_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.
StaticDEFAULT_StaticemittedStaticMODE_Parts for each view
StaticPARTSStaticRENDER_The sequence of rendering states that describe the Application life-cycle.
StaticTABSThe 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 the sheet in edit mode?
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?
The operational mode of this sheet
Change the operational mode of this sheet. Changing this value will also change the mode in which subsequent RollTableSheet instances first render.
Is this Application instance currently rendered?
The current render state of the Application.
Convenience references to window header elements.
InternalWait 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
InternalPerform 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
Optionalasync?: booleanAwait the result of the handler function?
OptionaldebugText?: stringDebugging text to log for the event
OptionaleventName?: stringAn event name to dispatch for registered listeners
OptionalhandlerArgs?: any[]Arguments passed to the handler function
OptionalhookArgs?: any[]Arguments passed to the requested hook function
OptionalhookName?: stringA hook name to dispatch for this and all parent classes
OptionalhookResponse?: booleanAdd the handler response to hookArgs
OptionalparentClassHooks?: 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
Optionaloptions: { once?: boolean } = {}Options which configure the event listener
Optionalonce?: 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
Optionaloptions: {Additional options which affect tab navigation
Optionalevent?: EventAn interaction event which caused the tab change, if any
Optionalforce?: booleanForce changing the tab even if the new tab is already active
OptionalnavElement?: HTMLElementAn explicit navigation element being modified
OptionalupdatePosition?: booleanUpdate application position after changing the tab?
Close the Application, removing it from the DOM.
Optionaloptions: 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.
Optionaloptions: 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.
Optionalposition: Partial<ApplicationPosition>New Application positioning data
The updated application position
Toggle display of the Application controls menu. Only applicable to window Applications.
Optionalexpanded: booleanSet the controls visibility to a specific state. Otherwise, the visible state is toggled from its current value
Optionaloptions: { animate?: boolean } = {}Options to configure the toggling behavior.
Optionalanimate?: booleanAnimate the controls toggling.
A Promise which resolves once the control expansion animation is complete
Protected_animateProtectedDisplay a roulette style animation when a Roll Table result is drawn from the sheet.
An Array of drawn table results to highlight
A Promise that resolves once the animation is complete
Protected_animateProtectedAnimate a "roulette" through the table until arriving at the final loop and a drawn result
The list element being iterated
The result IDs which have already been drawn
The number of times to loop through the animation
The desired animation time in milliseconds
The desired pixel offset of the result within the list
A Promise that resolves once the animation is complete
Protected_attachProtectedAttach event listeners to the Application frame.
Protected_createProtectedCreate 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
Optionaloptions: { container?: HTMLElement; hookName?: string; parentClassHooks?: boolean } = {}Additional options which affect ContextMenu construction
Optionalcontainer?: HTMLElementA parent HTMLElement which contains the selector target
OptionalhookName?: stringThe hook name
OptionalparentClassHooks?: booleanWhether to call hooks for the parent classes in the inheritance chain.
A created ContextMenu or null if no menu items were defined
Protected_createProtectedCreate a Table Result from initial data and with reasonable defaults.
Protected_flashProtectedDisplay a flashing animation on the selected result to emphasize the draw
The HTML li item of the winning result
A Promise that resolves once the animation is complete
Protected_getProtectedConfigure the array of header control menu options
Protected_getProtectedGet the configuration for a tabs group.
The ID of a tabs group
Protected_insertProtectedInsert the application HTML element into the DOM. Subclasses may override this method to customize how the application is inserted.
The element to insert
Protected_onProtectedA 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_onProtectedHandle click events on a tab within the Application.
Protected_onProtectedCreate a Compendium or Document result from a dropped document.
The triggering drop event
Protected_onProtectedActions performed after the Application is re-positioned.
The requested application position
Protected_onProtectedHandle submission for an Application which uses the form element.
The form configuration for which this handler is bound
The form submission event
Protected_postProtectedPerform post-render finalization actions.
Prepared context data.
Provided render options.
Protected_preProtectedActions performed before closing the Application. Pre-close steps are awaited by the close process.
Provided render options
Protected_preProtectedActions performed before a first render of the Application.
Prepared context data
Provided render options
Protected_prepareProtectedPrepare sheet data for a single TableResult.
The result from which to prepare
The sheet data for this result
Protected_preProtectedActions performed before the Application is re-positioned. Pre-position steps are not awaited because setPosition is synchronous.
The requested application position
Protected_processProtectedCustomize 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_processProtectedSubmit 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
Optionaloptions: Partial<DatabaseUpdateOperation | DatabaseCreateOperation> = {}Additional options altering the request
Protected_removeProtectedRemove 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_renderProtectedRender a header control button.
Protected_replaceHTMLProtectedReplace 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_sortProtectedCompare a pair of results for sorted display in this sheet.
Sheet data for a result
Sheet data for a different result
A comparator return value expected by Array#sort
Protected_tearProtectedRemove elements from the DOM and trigger garbage collection as part of application closure.
Protected_toggleProtectedDisable or reenable all form fields in this application.
Should the fields be disabled?
Protected_updateProtectedWhen the Application is rendered, optionally update aspects of the window frame.
Options provided at render-time
Protected_updateProtectedTranslate 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
Protected#getProtectedPrepare the details HTML for a single result.
Static_migrateInternalProvide a deprecation path for converted V1 document sheets.
The first parameter received by this class's constructor
Any additional parameters received
StaticinheritanceIterate over the inheritance chain of this Application. The chain includes this Application itself and all parents until the base application is encountered.
StaticparseCSSDimensionParse 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
StaticwaitWait for any images in the given element to load.
The element.
The Application responsible for editing, displaying, and using a single RollTable document.
Mixes
HandlebarsApplication