Class TJSDocumentDelete
Hierarchy
- TJSDialog
- TJSDocumentDelete (View Summary)
Index
Constructors
Accessors
Methods
Constructors
constructor
- new TJSDocumentDelete(
document: object,
opts?: { context?: object; options?: any },
dialogData?: any,
): TJSDocumentDelete Parameters
- document: object
Document to delete.
Optional
opts: { context?: object; options?: any }Additional context options or dialog positioning options.
Optional
dialogData: anyOptional data to modify dialog.
Returns TJSDocumentDelete
- document: object
Accessors
data
- get data(): TJSDialogData
Returns the dialog data.
Returns TJSDialogData
Dialog data.
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.
managedPromise
- get managedPromise(): ManagedPromise
Returns ManagedPromise
Returns the managed promise.
position
- get position(): TJSPosition
Returns the TJSPosition instance.
Returns TJSPosition
The TJSPosition instance.
reactive
- get reactive(): SvelteReactive
Returns the reactive accessors & Svelte stores for SvelteApplication.
Returns SvelteReactive
The reactive accessors & Svelte stores.
state
- get state(): ApplicationState
Returns the application state manager.
Returns ApplicationState
The application state manager.
svelte
- get svelte(): GetSvelteData
Returns the Svelte helper class w/ various methods to access mounted Svelte components.
Returns GetSvelteData
GetSvelteData
Static
defaultOptions
Methods
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 SvelteApplication.minimize to animate the content area.
Parameters
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 SvelteApplication.minimize to animate the content area.
Parameters
Returns Promise<void>
onSvelteMount
- onSvelteMount(mountedAppShell?: MountedAppShell): void
Provides a callback after all Svelte components are initialized.
Parameters
Optional
mountedAppShell: MountedAppShellThe mounted app shell elements.
Returns void
onSvelteRemount
- onSvelteRemount(mountedAppShell?: MountedAppShell): void
Provides a callback after the main application shell is remounted. This may occur during HMR / hot module replacement or directly invoked from the
elementRootUpdate
callback passed to the application shell component context.Parameters
Optional
mountedAppShell: MountedAppShellThe mounted app shell elements.
Returns void
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
Returns Promise<T>
A promise for dialog resolution.
Static
confirm
- confirm<T>(
data?: TJSDialogOptions & {
onNo?:
| string
| (data?: { application?: TJSDialog<SvelteApp.Options> }) => any;
onYes?:
| string
| (data?: { application?: TJSDialog<SvelteApp.Options> }) => any;
},
options?: SvelteApp.Options,
): 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: TJSDialogOptions & {
onNo?:
| string
| (data?: { application?: TJSDialog<SvelteApp.Options> }) => any;
onYes?:
| string
| (data?: { application?: TJSDialog<SvelteApp.Options> }) => any;
}Confirm dialog options.
Optional
onNo?: string | (data?: { application?: TJSDialog<SvelteApp.Options> }) => 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<SvelteApp.Options> }) => 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: SvelteApp.OptionsSvelteApplication 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?: TJSDialogOptions & {
icon?: string;
label?: string;
onOk?:
| string
| (data?: { application?: TJSDialog<SvelteApp.Options> }) => any;
},
options?: SvelteApp.Options,
): Promise<T> A helper factory method to display a basic "prompt" style TJSDialog with a single button.
Type Parameters
Parameters
Optional
data: TJSDialogOptions & {
icon?: string;
label?: string;
onOk?:
| string
| (data?: { application?: TJSDialog<SvelteApp.Options> }) => 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<SvelteApp.Options> }) => 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: SvelteApp.OptionsSvelteApplication 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(
document: object,
opts?: { context?: object; options?: any },
dialogData?: any,
): Promise<boolean | object> Shows a modal / non-draggable dialog to delete a document.
Parameters
- document: object
Document to delete.
Optional
opts: { context?: object; options?: any }Additional context options or dialog positioning options.
Optional
dialogData: anyOptional data to modify dialog.
Returns Promise<boolean | object>
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.- document: object
Static
wait
- wait<T>(data: TJSDialogOptions, options?: SvelteApp.Options): 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: TJSDialogOptions
Dialog data passed to the TJSDialog constructor.
Optional
options: SvelteApp.OptionsSvelteApplication options passed to the TJSDialog constructor.
Returns Promise<T>
A Promise that resolves to the chosen result.
- data: TJSDialogOptions
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.