Component properties passed to the constructor. This is normally used only by managed components and is usually undefined for independent coponents.
Remembered virtual node object through which the component can request services. This is undefined in the component's costructor but will be defined before the call to the (optional) willMount method.
Returns the number of buttons in the button bar
Events that can be fired by the Popup component
Determines whether the component is currently mounted. If a component has asynchronous functionality (e.g. fetching data from a server), component's code may be executed after it was alrady unmounted. This property allows the component to handle this situation.
Determines whether the popup is currently open.
Gets or sets the flag determining whether the popup is currently visible or hidden.
Gets or sets the flag determining whether the popup is currently visible or hidden.
Returns the value set by the close() method. If the popup is open, the value is undefined.
Adds a button to the button bar
Schedules the given function to be called after all components scheduled to be updated in the Mimbl tick have already been updated.
Function to be called
Object that will be used as "this" value when the function is called. If this parameter is undefined, the component instance will be used (which allows scheduling regular unbound components' methods). This parameter will be ignored if the the function is already bound or is an arrow function.
Schedules the given function to be called before any components scheduled to be updated in the Mimbl tick are updated.
Function to be called
Object that will be used as "this" value when the function is called. If this parameter is undefined, the component instance will be used (which allows scheduling regular unbound components' methods). This parameter will be ignored if the function is already bound or is an arrow function.
Closes the popup and passes a value to be used as a return value. For the modal popups, this value will be the resolved value of the promise returned by the showModal() method. For modeless popups, this value will be available as the returnValue property.
Returns the default style definition instance or class
Determines whether the dialog is currently open as modal.
Determines whether the dialog is currently open as modeless.
Moves the dialog to the given coordinates. The coordinates are adjusted so that at least some part of the dialog at the top-left corner remains visible in order to the user to be able to continue moving it.
This method is called when the popup is being closed. If derived classes override it they must call super.onClose().
This method is called when the popup opens. If derived classes override it they must call super.onOpen().
Displays the popup as a modeless dialog. The method will throw an exception if the popup is already open as a modal popup.
Adds a button to the button bar
Replaces the current content of the popup with the given one.
Displays the popup as a modeless dialog and returns a promise that is resolved when the popup is closed. The resolved value of the promise is the value passed to the close() method. The method will return a rejected promise if the popup is already open.
Starts monitoring mouse movements and moves the popup with the mouse. This method is intented to be called from a mousedown event handled either by a derived class or by the popup caller.
Stops monitoring mouse movements. This method allows programmatically interrupt dialog moving operations.
This method is called by the component to request to be updated. If no arguments are provided, the entire component is requested to be updated. If arguments are provided, they indicate what rendering functions should be updated.
Optional rendering function to invoke
Optional value to use as "this" when invoking the rendering function. If undefined, the component's "this" will be used.
Optional key which distinguishes between multiple uses of the same function. This can be either the "arg" or the "key" property originally passed to the FunProxy component.
If derived classes override this method, they must call super.willMount()
If derived classes override this method, they must call super.willUnmount()
Creates a wrapper function with the same signature as the given callback so that if the original callback throws an exception, it is processed by the Mimbl error handling mechanism so that the exception bubbles from this component up the hierarchy until a component that knows to handle errors is found.
Use this method before passing callbacks to document and window event handlers as well as non-DOM objects that use callbacks, e.g. fetch, Promise, setTimeout, etc. For example:
class ResizeMonitor extends mim.Component
{
private onWindowResize(e: Event): void {};
wrapper: (e: Event): void;
public startResizeMonitoring()
{
this.wrapper = this.wrapCallback( this.onWindowResize);
window.addEventListener( "resize", this.wrapper);
}
public stopResizeMonitoring()
{
window.removeEventListener( "resize", this.wrapper);
this.wrapper = undefined;
}
}
Method/function to be wrapped
Optional value of "this" to bind the callback to. If this parameter is undefined, the component instance will be used. This parameter will be ignored if the the function is already bound or is an arrow function.
Type determining whether and how a Mimbl tick should be scheduled after callback invocation.
Function that has the same signature as the given callback and that should be used instead of the original callback
Generated using TypeDoc
The Dialog class is a popup that divides the popup area into three sections: caption, body and button bar. The caption area can be used to move the dialog around.