Class TJSFolderDelete
Hierarchy
- TJSDialog
- TJSFolderDelete (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
elementTarget
id
-
get id(): string
Return the CSS application ID which uniquely references this UI element
Returns string
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
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
StaticdefaultOptions
Methods
Protected_activateCoreListeners
-
Activate required listeners which must be enabled on every Application. These are internal interactions which should not be overridden by downstream subclasses.
Parameters
- html: JQuery
Returns void
Protected_callHooks
-
Call all hooks for all applications in the inheritance chain.
Parameters
- hookName: string | ((className: string) => string)
The hook being triggered, which formatted with the Application class name
OptionalhookArgs: unknown[]The arguments passed to the hook calls
Returns void
- hookName: string | ((className: string) => string)
Protected_canDragDrop
-
Define whether a user is able to conclude a drag-and-drop workflow for a given drop selector
Parameters
- selector: string
The candidate HTML selector for the drop target
Returns boolean
Can the current user drop on this selector?
- selector: string
Protected_canDragStart
-
Define whether a user is able to begin a dragstart workflow for a given drag selector
Parameters
- selector: string
The candidate HTML selector for dragging
Returns boolean
Can the current user drag this selector?
- selector: string
Protected_getHeaderButtons
-
ProtectedSpecify 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
getApplicationHeaderButtonshook.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_onChangeTab
-
Handle changes to the active tab in a configured Tabs controller
Parameters
- event: MouseEvent
A left click event
- tabs: Tabs
The Tabs controller
- active: string
The new active tab name
Returns void
- event: MouseEvent
Protected_onDragOver
-
Callback actions which occur when a dragged element is over a drop target.
Parameters
- event: DragEvent
originating DragEvent
Returns void
- event: DragEvent
Protected_onDragStart
-
Callback actions which occur at the beginning of a drag start workflow.
Parameters
- event: DragEvent
The originating DragEvent
Returns void
- event: DragEvent
Protected_onDrop
-
Callback actions which occur when a dragged element is dropped on a target.
Parameters
- event: DragEvent
The originating DragEvent
Returns void
- event: DragEvent
Protected_onResize
-
Additional actions to take when the application window is resized
Parameters
- event: Event
Returns void
Protected_onSearchFilter
-
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 regular expression to test against
- rgx: RegExp
The regular expression to test against
- html: HTMLElement
The HTML element which should be filtered
Returns void
- event: KeyboardEvent
Protected_onToggleMinimize
-
Handle application minimization behavior - collapsing content and reducing the size of the header
Parameters
- ev: Event
Returns void
Protected_render
-
_render(
force?: boolean,
options?: RenderOptions<
SvelteApp.Options<SvelteComponent<any, any, any>, AbstractExternal>,
>,
): Promise<void>An asynchronous inner function which handles the rendering of the Application
Parameters
Optionalforce: booleanRender and display the application even if it is not currently displayed. (default:
false)Optionaloptions: RenderOptions<
SvelteApp.Options<SvelteComponent<any, any, any>, AbstractExternal>,
>Additional options which update the current values of the Application#options object (default:
{})
Returns Promise<void>
A Promise that resolves to the Application once rendering is complete
Protected_renderOuter
-
Render the outer application wrapper
Returns Promise<JQuery<HTMLElement>>
A promise resolving to the constructed jQuery object
Protected_restoreScrollPositions
-
Restore the scroll positions of containers within the app after re-rendering the content
Parameters
- html: JQuery
The HTML object being traversed
Returns void
- html: JQuery
Protected_saveScrollPositions
-
Persist the scroll positions of containers within the app before re-rendering the content
Parameters
- html: JQuery
The HTML object being traversed
Returns void
- html: JQuery
_waitForImages
-
Wait for any images present in the Application to load.
Returns Promise<void>
A Promise that resolves when all images have loaded.
activateListeners
-
After rendering, activate event listeners which provide interactivity for the Application. This is where user-defined Application subclasses should attach their event-handling logic.
Parameters
- html: JQuery
Returns void
activateTab
-
Change the currently active tab
Parameters
- tabName: string
The target tab name to switch to
Optionaloptions: { group?: string; triggerCallback?: boolean }Options which configure changing the tab (default:
{})-
Optionalgroup?: stringA specific named tab group, useful if multiple sets of tabs are present
-
OptionaltriggerCallback?: booleanWhether to trigger tab-change callback functions (default:
true)
-
Returns void
- tabName: string
bringToTop
-
Bring the application to the top of the rendering stack
Returns void
close
-
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
Optionaloptions: CloseOptionsOptions which affect how the Application is closed (default:
{})
Returns Promise<void>
A Promise which resolves once the application is closed
getData
-
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
Optionaloptions: Partial<Options>(unused, default:
{})
Returns MaybePromise<object>
maximize
-
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
Optionalopts: { animate?: boolean; duration?: number }Optional parameters.
-
Optionalanimate?: booleanWhen true perform default maximizing animation.
-
Optionalduration?: numberControls content area animation duration in seconds.
-
Returns Promise<void>
minimize
-
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
Optionalopts: { animate?: boolean; duration?: number }Optional parameters.
-
Optionalanimate?: booleanWhen true perform default minimizing animation.
-
Optionalduration?: numberControls content area animation duration in seconds.
-
Returns Promise<void>
onSvelteMount
-
Provides a callback after all Svelte components are initialized.
Returns void
onSvelteRemount
-
Provides a callback after the main application shell is remounted. This may occur during HMR / hot module replacement or directly invoked from the
elementRootUpdatecallback passed to the application shell component context.Returns void
render
-
render(
force?: boolean,
options?: RenderOptions<
SvelteApp.Options<SvelteComponent<any, any, any>, AbstractExternal>,
>,
): thisRender 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
Optionalforce: 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. (default:
false)Optionaloptions: RenderOptions<
SvelteApp.Options<SvelteComponent<any, any, any>, AbstractExternal>,
>Additional rendering options which are applied to customize the way that the Application is rendered in the DOM. (default:
{})
Returns this
The rendered Application instance
wait
-
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:
nullis returned if the dialog is closed without a user making a choice.Type Parameters
- T
Parameters
Optionaloptions: { reuse?: boolean }Options.
-
Optionalreuse?: 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.
Staticconfirm
-
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
defaulttoyesorno.Type Parameters
- T
Parameters
Optionaldata: OptionsData & {
onNo?: string | ((data?: { application?: TJSDialog }) => any);
onYes?: string | ((data?: { application?: TJSDialog }) => any);
}Confirm dialog options.
-
OptionalonNo?: string | ((data?: { application?: TJSDialog }) => any)Callback 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. -
OptionalonYes?: string | ((data?: { application?: TJSDialog }) => any)Callback 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.
-
Optionaloptions: OptionsCoreSvelteApp options passed to the TJSDialog constructor.
Returns Promise<T>
A promise which resolves with result of yes / no callbacks or true / false.
Staticprompt
-
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
- T
Parameters
Optionaldata: 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:
-
Optionalicon?: stringSet another icon besides
fas fa-checkfor button. -
Optionallabel?: stringThe OK prompt button text.
-
OptionalonOk?: string | ((data?: { application?: TJSDialog }) => any)Callback 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.
-
Optionaloptions: OptionsCoreSvelteApp options passed to the TJSDialog constructor.
Returns Promise<T>
The returned value from the provided callback function or
trueif the button is pressed.
Staticshow
-
show(
document: Folder,
options?: OptionsCore,
dialogData?: OptionsData,
): Promise<
| false
| Folder<
| "Actor"
| "Adventure"
| "Cards"
| "Item"
| "JournalEntry"
| "Macro"
| "Playlist"
| "RollTable"
| "Scene"
| "Compendium",
>,
>Deletes a folder and does delete sub-folders / documents.
Parameters
- document: Folder
Folder to delete.
Optionaloptions: OptionsCoreOptions to pass to TJSDialog / SvelteApp.
OptionaldialogData: OptionsDataOptional data to modify dialog.
Returns Promise<
| false
| Folder<
| "Actor"
| "Adventure"
| "Cards"
| "Item"
| "JournalEntry"
| "Macro"
| "Playlist"
| "RollTable"
| "Scene"
| "Compendium",
>,
>The deleted Folder or a falsy value; either 'false' for cancelling or 'null' if the user closed the dialog via
<Esc>or the close header button. - document: Folder
Staticwait
-
Creates an anonymous data defined TJSDialog returning a Promise that can be awaited upon for the user to make a choice.
Note: By default
nullis returned if the dialog is closed without a user making a choice.Type Parameters
- T
Parameters
- data: OptionsData
Dialog data passed to the TJSDialog constructor.
Optionaloptions: OptionsCoreSvelteApp options passed to the TJSDialog constructor.
Returns Promise<T>
A Promise that resolves to the chosen result.
Properties
Protected_dragDrop
DragDrop workflow handlers which are active for this Application
Protected_element
An internal reference to the HTML element this application renders
Protected_minimized
Track whether the Application is currently minimized
Protected_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
Protected_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
StaticRENDER_STATES
{
CLOSED: -1;
CLOSING: -2;
ERROR: 3;
NONE: 0;
RENDERED: 2;
RENDERING: 1;
},
>
The sequence of rendering states that track the Application life-cycle.
Provides a reactive dialog for deleting a folder that by default is modal and not draggable. An additional set of accessors for the folder assigned are available via the
this.reactive.document. You may swap out the folder at any time by setting it to a different folder document.