Class TJSDocumentDelete
Hierarchy
- TJSDialog
- TJSDocumentDelete (View Summary)
Index
Accessors
Methods
Properties
Accessors
closing
- get closing(): boolean
Whether the Application is currently closing.
Returns boolean
data
element
- get element(): JQuery
Return the active application element, if it currently exists in the DOM
Returns JQuery
elementContent
- get elementContent(): HTMLElement
Returns the content element if an application shell is mounted.
Returns HTMLElement
Content element.
elementTarget
- get elementTarget(): HTMLElement
Returns the target element or main element if no target defined.
Returns HTMLElement
Target element.
id
- get id(): string
Return the CSS application ID which uniquely references this UI element
Returns string
managedPromise
- get managedPromise(): ManagedPromise
Returns ManagedPromise
Returns the managed promise.
popOut
- get popOut(): boolean
Control the rendering style of the application. If popOut is true, the application is rendered in its own wrapper window, otherwise only the inner app content is rendered
Returns boolean
position
- get position(): TJSPosition
Returns the TJSPosition instance.
Returns TJSPosition
The TJSPosition instance.
reactive
rendered
- get rendered(): boolean
Return a flag for whether the Application instance is currently rendered
Returns boolean
state
svelte
template
- get template(): string
The path to the HTML template file which should be used to render the inner content of the app
Returns string
title
- get title(): string
An Application window should define its own title definition logic which may be dynamic depending on its data
Returns string
Static
defaultOptions
Methods
Protected
_activateCoreListeners
Protected
_canDragDrop
Protected
_canDragStart
Protected
_createDragDropHandlers
Protected
_createTabHandlers
Protected
_getHeaderButtons
- _getHeaderButtons(): HeaderButton[]
Protected
Specify the set of config buttons which should appear in the SvelteApp header. Buttons should be returned as an Array of objects. The header buttons which are added to the application can be modified by the
getApplicationHeaderButtons
hook.SvelteApp extends the button functionality with full reactivity for state changes during callbacks. Callbacks receive the button data and can modify it to update the button state.
Returns HeaderButton[]
All header buttons.
Protected
_injectHTML
Protected
_onChangeTab
- _onChangeTab(event: MouseEvent, tabs: Tabs, active: string): void
Handle changes to the active tab in a configured Tabs controller
Parameters
- event: MouseEvent
A left click event
- tabs: Tabs
The TabsV2 controller
- active: string
The new active tab name
Returns void
- event: MouseEvent
Protected
_onDragOver
Protected
_onDragStart
Protected
_onDrop
Protected
_onResize
Protected
_onSearchFilter
- _onSearchFilter(
event: KeyboardEvent,
query: string,
rgx: RegExp,
html: HTMLElement,
): void Handle changes to search filtering controllers which are bound to the Application
Parameters
- event: KeyboardEvent
The key-up event from keyboard input
- query: string
The raw string input to the search field
- rgx: RegExp
The regular expression to test against
- html: HTMLElement
The HTML element which should be filtered
Returns void
- event: KeyboardEvent
Protected
_onToggleMinimize
Protected
_render
- _render(force?: boolean, options?: RenderOptions): Promise<void>
An asynchronous inner function which handles the rendering of the Application
Parameters
Optional
force: booleanRender and display the application even if it is not currently displayed.
Optional
options: RenderOptionsProvided rendering options, see the render function for details
Returns Promise<void>
A Promise that resolves to the Application once rendering is complete
Protected
_renderInner
Protected
_renderOuter
Protected
_replaceHTML
Protected
_restoreScrollPositions
Protected
_saveScrollPositions
activateListeners
activateTab
bringToTop
close
- close(options?: { force?: boolean }): Promise<void>
Close the application and un-register references to it within UI mappings This function returns a Promise which resolves once the window closing animation concludes
Parameters
Optional
options: { force?: boolean }Options which affect how the Application is closed
Returns Promise<void>
A Promise which resolves once the application is closed
getData
- getData(options?: Partial<ApplicationOptions>): object | Promise<object>
An application should define the data object used to render its template. This function may either return an Object directly, or a Promise which resolves to an Object If undefined, the default implementation will return an empty object allowing only for rendering of static HTML
Parameters
Optional
options: Partial<ApplicationOptions>
Returns object | Promise<object>
maximize
- maximize(opts?: { animate?: boolean; duration?: number }): Promise<void>
Provides a mechanism to update the UI options store for maximized.
Note: the sanity check is duplicated from Application.maximize the store is updated before performing the rest of animations. This allows application shells to remove / show any resize handlers correctly. Extra constraint data is stored in a saved position state in SvelteApp.minimize to animate the content area.
Parameters
Optional
opts: { animate?: boolean; duration?: number }Optional parameters.
Optional
animate?: booleanWhen true perform default maximizing animation.
Optional
duration?: numberControls content area animation duration in seconds.
Returns Promise<void>
minimize
- minimize(opts?: { animate?: boolean; duration?: number }): Promise<void>
Provides a mechanism to update the UI options store for minimized.
Note: the sanity check is duplicated from Application.minimize the store is updated before performing the rest of animations. This allows application shells to remove / show any resize handlers correctly. Extra constraint data is stored in a saved position state in SvelteApp.minimize to animate the content area.
Parameters
Optional
opts: { animate?: boolean; duration?: number }Optional parameters.
Optional
animate?: booleanWhen true perform default minimizing animation.
Optional
duration?: numberControls content area animation duration in seconds.
Returns Promise<void>
onSvelteMount
onSvelteRemount
render
- render(force?: boolean, options?: RenderOptions): this
Render the Application by evaluating it's HTML template against the object of data provided by the getData method If the Application is rendered as a pop-out window, wrap the contained HTML in an outer frame with window controls
Parameters
Optional
force: booleanAdd the rendered application to the DOM if it is not already present. If false, the Application will only be re-rendered if it is already present.
Optional
options: RenderOptionsAdditional rendering options which are applied to customize the way that the Application is rendered in the DOM.
Returns this
The rendered Application instance
wait
- wait<T>(options?: { reuse?: boolean }): Promise<T>
Brings to top or renders this dialog returning a Promise that is resolved any button pressed or when the dialog is closed.
Creates an anonymous data defined TJSDialog returning a Promise that can be awaited upon for the user to make a choice.
Note:
null
is returned if the dialog is closed without a user making a choice.Type Parameters
Parameters
Optional
options: { reuse?: boolean }Options.
Optional
reuse?: booleanWhen true if there is an existing managed Promise this allows multiple sources to await on the same result.
Returns Promise<T>
A promise for dialog resolution.
Static
confirm
- confirm<T>(
data?: OptionsData & {
onNo?: string | (data?: { application?: TJSDialog }) => any;
onYes?: string | (data?: { application?: TJSDialog }) => any;
},
options?: OptionsCore,
): Promise<T> A helper factory method to create simple confirmation dialog windows which consist of simple yes / no prompts. If you require more flexibility, a custom TJSDialog instance is preferred. The default focused button is 'yes'. You can change the default focused button by setting
default
toyes
orno
.Type Parameters
Parameters
Optional
data: OptionsData & {
onNo?: string | (data?: { application?: TJSDialog }) => any;
onYes?: string | (data?: { application?: TJSDialog }) => any;
}Confirm dialog options.
Optional
onNo?: string | (data?: { application?: TJSDialog }) => anyCallback function upon
no
; may be an async function. When defined as a string any matching function by name exported from content Svelte component is invoked.Optional
onYes?: string | (data?: { application?: TJSDialog }) => anyCallback function upon
yes
; may be an async function. When defined as a string any matching function by name exported from content Svelte component is invoked.
Optional
options: OptionsCoreSvelteApp options passed to the TJSDialog constructor.
Returns Promise<T>
A promise which resolves with result of yes / no callbacks or true / false.
Static
prompt
- prompt<T>(
data?: OptionsData & {
icon?: string;
label?: string;
onOk?: string | (data?: { application?: TJSDialog }) => any;
},
options?: OptionsCore,
): Promise<T> A helper factory method to display a basic "prompt" style TJSDialog with a single button.
Type Parameters
Parameters
Optional
data: OptionsData & {
icon?: string;
label?: string;
onOk?: string | (data?: { application?: TJSDialog }) => any;
}Prompt dialog options that includes any TJSDialog options along with the following optional fields:
Optional
icon?: stringSet another icon besides
fas fa-check
for button.Optional
label?: stringThe OK prompt button text.
Optional
onOk?: string | (data?: { application?: TJSDialog }) => anyCallback function upon
ok
; may be an async function. When defined as a string any matching function by name exported from content Svelte component is invoked.
Optional
options: OptionsCoreSvelteApp options passed to the TJSDialog constructor.
Returns Promise<T>
The returned value from the provided callback function or
true
if the button is pressed.
Static
show
- show<D extends Document>(
document: D,
options?: OptionsCore,
dialogData?: OptionsData,
): Promise<false | D> Shows a modal / non-draggable dialog to delete a document.
Type Parameters
- D extends Document
Parameters
- document: D
Document to delete.
Optional
options: OptionsCoreTJSDialog / SvelteApp options.
Optional
dialogData: OptionsDataOptional data to modify dialog.
Returns Promise<false | D>
The document if deleted or a falsy value; either 'false' for cancelling or 'null' if the user closed the dialog via
<Esc>
or the close header button.
Static
wait
- wait<T>(data: OptionsData, options?: OptionsCore): Promise<T>
Creates an anonymous data defined TJSDialog returning a Promise that can be awaited upon for the user to make a choice.
Note: By default
null
is returned if the dialog is closed without a user making a choice.Type Parameters
Parameters
- data: OptionsData
Dialog data passed to the TJSDialog constructor.
Optional
options: OptionsCoreSvelteApp options passed to the TJSDialog constructor.
Returns Promise<T>
A Promise that resolves to the chosen result.
- data: OptionsData
Properties
Protected
_dragDrop
DragDrop workflow handlers which are active for this Application
Protected
_element
An internal reference to the HTML element this application renders
_minimized
Track whether the Application is currently minimized
_priorState
The prior render state of this Application. This allows for rendering logic to understand if the application is being rendered for the first time.
Protected
_scrollPositions
Track the most recent scroll positions for any vertically scrolling containers
Protected
_searchFilters
SearchFilter handlers which are active for this Application
_state
Track the render state of the Application
Protected
_tabs
Tab navigation handlers which are active for this Application
appId
The application ID is a unique incrementing integer which is used to identify every application window drawn by the VTT
options
The options provided to this application upon initialization
Static
Readonly
RENDER_STATES
CLOSED: -1;
CLOSING: -2;
ERROR: 3;
NONE: 0;
RENDERED: 2;
RENDERING: 1;
}
Provides a reactive dialog for deleting documents that by default is modal and not draggable. An additional set of accessors for the document assigned are available via the
this.reactive.document
. You may swap out the document at any time by setting it to a different document.