a modal box that follows a long task: a title, a bar, and the lines of what is done
in a
, in a fixed font, a
each: a string is text, an UnsafeHtml is html. An
error, a warning are coloured on all their width, a bar on their left. addSection puts
the lines that follow in a section that folds. Ctrl+A selects the lines.
done( ) shows its button OK: after an error or a warning it waits for it, their counts
on the left of the bar; else it closes the box after 5s, the seconds left in the button.
a section at the end, open: the lines that follow go in it. A click on its title folds
it; its title has the icon of the worst of its lines (an error, a warning)
Adds a keyboard shortcut to the component. It works while the focus
is in the component, and while the focus is nowhere if this component
is the last one with shortcuts that had it: of two views that are shown
together, the one the user works in answers.
A key that a child has used (it prevented its default, or stopped its
propagation) is not a shortcut. Nor is a key typed in a field, unless
editable is set.
Parameters
keys: string|string[]
"Mod+C", "Shift+Mod+Z", "Delete"... or several of them. Mod is Ctrl, or Cmd on a Mac.
Appends content to the end of the component's DOM element.
Content can be a single Component, an array of Components, a string, an array of strings,
raw HTML, an array of raw HTML, a number, or a boolean.
the task is over: the button OK is shown. After an error or a warning it waits for
a click, their counts on the left of the bar ("2 errors / 1 warning"); without one it counts the
seconds left, "OK (5s)", and closes the box at 0
Returns void
enable
enable(ena?:boolean):this
Enables or disables the component.
This sets or removes the disabled and inert attributes of the component itself. Its children
are not changed: the browser makes all that is inside an inert element inactive.
Parameters
ena: boolean = true
If true, the component is enabled; if false, it's disabled. Defaults to true.
Dispatches an event with a given name and payload to all registered listeners.
If no listeners are registered for the event name, or if no EventSource has been initialized, this method does nothing.
Retrieves the integer value of a data-* attribute from the component's DOM element.
Returns undefined if the attribute is not present or cannot be parsed as a number.
Parameters
name: string
The suffix of the data- attribute.
Returns number
The integer value of the data-* attribute, or undefined.
Retrieves the computed inline CSS style value for a specific property.
This only returns styles explicitly set via setStyle or setStyleValue, not inherited or stylesheet-defined styles.
Registers an event listener for a specific event name.
The listener will be invoked when an event with the given name is fired.
Returns an object with an off() method, which can be used to conveniently remove this specific listener.
Attaches a listener for global messages dispatched by the application.
The listener is automatically removed when the component's DOM element is removed.
Prepends content to the beginning of the component's DOM element.
Content can be a single Component, an array of Components, a string, an array of strings,
raw HTML, an array of raw HTML, a number, or a boolean.
Removes one or more CSS classes from the component's DOM element.
If * is passed as the class name, all classes will be removed.
Multiple classes can be provided as a space-separated string.
Parameters
cls: string
The CSS class(es) to remove, or * to clear all.
Returns void
removeClassEx
removeClassEx(re:RegExp):void
Removes all CSS classes from the component's DOM element that match a given regular expression.
Parameters
re: RegExp
The regular expression to match against class names.
Sets an interval that repeatedly executes a callback function after a specified delay.
If a timeout with the same name already exists, it will be cleared before the new one is set.
Parameters
name: string
A unique string identifier for this timeout.
ms: number
The delay in milliseconds before the callback is executed.
Sets multiple inline CSS styles on the component's DOM element.
Numeric values for properties like width or height will automatically append "px" unless they are unitless.
Sets a single inline CSS style property on the component's DOM element.
Numeric values for properties like width or height will automatically append "px" unless they are unitless.
Sets a timeout that executes a callback function after a specified delay.
If a timeout with the same name already exists, it will be cleared before the new one is set.
Parameters
name: string
A unique string identifier for this timeout.
ms: number
The delay in milliseconds before the callback is executed.
callback: ()=>void
The function to execute after the delay.
Returns void
setTitle
setTitle(title:string):void
Parameters
title: string
Returns void
setWidth
setWidth(w:string|number):void
Sets the width of the component.
Parameters
w: string|number
The width value. Can be a number (interpreted as pixels) or a string (e.g., "100px", "50%").
Returns void
show
show(show?:boolean):this
each time it opens: the focus on its first field
Parameters
show: boolean = true
Returns this
showAsync
showAsync():Promise<string>
! cannot stop close action
Returns Promise<string>
toggleClass
toggleClass(cls:string):void
Toggles the presence of one or more CSS classes on the component's DOM element.
If a class is present, it's removed; otherwise, it's added.
Multiple classes can be provided as a space-separated string.
Creates a new Component or an array of Components from JSX elements.
This method is typically called by the TypeScript/JavaScript compiler when JSX is transpiled.
Creates a fragment, which is an array of components without a parent DOM element.
Used for grouping multiple children in JSX without introducing an extra DOM node.
a modal box that follows a long task: a title, a bar, and the lines of what is done in a
Settings
On This Page
Constructors
Properties
Methods