Window Typescript API

Interface

Window

Window or Dialog displays the interactive custom confirmations, message boxes, alerts, warnings, errors, and modal dialogs.

Selector

smart-window

Properties

addNewTabboolean

Determines if 'Add New' Tab inside the Tabs element is visible. Applicable only to TabsWindow

Default valuefalse

animationAnimation

Sets or gets the animation mode. Animation is disabled when the property is set to 'none'

Default valueadvanced

collapsedboolean

Determines if the window is collapsed or not. When collapsed the only the header of the window is visible.

Default valuefalse

closeOnMaskClickboolean

When a modal window is opened, thid property determines if clicking on the mask closes the window or not.

Default valuefalse

dataSource{label: string, content: string}[]

Determines the data source that will be loaded to the TabsWindow. Applicable only to TabsWindow.

disabledboolean

Enables or disables the window.

Default valuefalse

disableSnapboolean

Enables or disables the window snapping feature.

Default valuefalse

dropPositionWindowDropPosition

Applicable to TabsWindow when docked inside a DockingLayout Custom Element.
Determines where the window(it's tab items as well) can be dropped inside the DockingLayout.
The property is an array that accepts multiple positions. Note: Positions with prefix 'layout-' are applied to the Tab item children of the TabsWidnow owner that is being dragged. The rest of the positions indicate the allowed drop position inside the hovered target(TabsWindow). Used only by smartDockingLayout custom elements. Determines the possible drop position inside the DockingLayout. The following values are allowed.

Default value

footerPositionWindowFooterPosition

Determines the position of the footer of the window element.

Default valuetop

footerTemplateany

Determines the template for the Dialog section of the window. By default footerTemplate is null.

headerButtonsstring[]

Set's the buttons that will be visible in the header section.

headerTemplateany

Determines the template for the Dialog section of the window. By default headerTemplate is null.

headerPositionTabPosition

Determines the position of the header of the window element.

Default valuetop

labelstring

The label of the window that appears in the header area.

Default value"

liveResizeboolean

When enabled the resizing operation happens live. By default it's not enabled and during resizing a highlighter around the edges of the window appears to outline the current size of the element.

Default valuefalse

layoutany

Applicable only to TabsWindow when used with a DockingLayout custom element.Used only by smartDockingLayout. Determines the owner smartDockingLayout that the window belongs to. When the tabsWindow has been removed from a DockingLayout element, the property is used to indicate that it belongs to that particular Dockinglayout. Accepts a string, representing the ID of a smartDockingLayout on the page, or an instance of smartDokcingLayout.

localestring

Sets or gets the language. Used in conjunction with the property messages.

Default value"en

lockedboolean

Applicable only to TabsWindow when docked inside a DockingLayout Custom Element.Determines of the item can be resized or not.

Default valuefalse

localizeFormatFunctionany

Callback, related to localization module.

maximizedboolean

Determines if the window is maximized or not. When maximized the window covers the whole viewport.

Default valuefalse

messagesany

Sets or gets an object specifying strings used in the widget that can be localized. Used in conjunction with the property locale.

Default value


"en": {

"propertyUnknownType": "'{{name}}' property is with undefined 'type' member!",

"propertyInvalidValue": "Invalid '{{name}}' property value! Actual value: {{actualValue}}, Expected value: {{value}}!",

"propertyInvalidValueType": "Invalid '{{name}}' property value type! Actual type: {{actualType}}, Expected type: {{type}}!",

"elementNotInDOM": "Element does not exist in DOM! Please, add the element to the DOM, before invoking a method.",

"moduleUndefined": "Module is undefined.",

"missingReference": "{{elementType}}: Missing reference to {{files}}.",

"htmlTemplateNotSuported": "{{elementType}}: Browser doesn't support HTMLTemplate elements.",

"invalidTemplate": "{{elementType}}: '{{property}}' property accepts a string that must match the id of an HTMLTemplate element from the DOM."

}


modalboolean

Determines if the window is modal or not. If true the user can only interact with the window and nothing else on the page.

Default valuefalse

maxstring | number | null

Applicable to TabsWindow when docked inside a DockingLayout Custom Element. Determines the max size of the item.

Default value

minstring | number | null

Applicable to TabsWindow when docked inside DockingLayout Custom Element. Determines the min size of the item.

Default value

minimizedboolean

Determines if the window is minimized or not. When minimized the window is docked at the bottom left corner of the viewport.

Default valuefalse

openedboolean

Determines if the window is visible or not.

Default valuefalse

pinnedboolean

Determines if the window is pinned or not. Pinned window is a window that can't be dragged but can be resized.

Default valuefalse

readonlyboolean

If the element is readonly, users cannot interact with it.

Default valuefalse

resizeIndicatorboolean

When applied a resize indicator is displayed in the bottom right corner of the window and resizing operation can be initiated only from its position.

Default valuefalse

resizeModeWindowResizeMode

Determines the resizing mode of the window.
Several modes are available:

  • none - resizing is disabled.
  • vertical - vertical resizing is allowed.
  • horizontal - horizontal resizing is allowed.
  • both - horizontal and vertical resizing is allowed.
  • top - the window can only be resized from the top side.
  • bottom - the window is resizable only from the bottom side.
  • left - the window can be resized only from the left side.
  • right - the window can be resized only from the right side.

Default valuenone

selectedIndexnumber | null

Sets or gets which tab is selected. Applicable only to TabsWindow.

selectionModeTabSelectionMode

Determines the way the user can switch between tabs. Applicable only to TabsWindow.

Default valueclick

siblingsany

A getter that returns the siblings (that share the same parent) of a LayoutPanel item that is docked inside a DockingLayout. The siblings are also DockingLayout items ( LayoutPanels).Applicable only to TabsWindow when docked inside a DockingLayout.

sizestring

Applicable to TabsWindow when nested inside a DockingLayout Custom Element. Determines the size of the item.

Default value"

tabCloseButtonsboolean

Sets or gets whether close buttons are displayed inside the Tab Strip of the TabsWindow. Applicable only to TabsWindow.

Default valuefalse

tabCloseButtonModeWindowTabCloseButtonMode

Determines if the close button is visible on select or always. Applicable only to TabsWindow.

Default valuedefault

tabOverflowOverflow

Sets or gets the Tabs scroll buttons behavior. Applicable only when tabLayout is 'scroll'. Applicable only to TabsWindow.

Default valueauto

tabPositionTabPosition

Detetmines Tab Strip is positioned of the TabsWindow. Applicable only to TabsWindow.

Default valuetop

tabScrollButtonsPositionLayoutPosition

Sets or gets the position of the scroll buttons inside the Tab header of the TabsWindow. Applicable only to TabsWindow.

Default valueboth

tabTextOrientationOrientation

Sets or gets the orientation of the text in the tabs labels of the TabsWindow. Applicable only to TabsWindow.

Default valuehorizontal

themestring

Determines the theme. Theme defines the look of the element

Default value"

unfocusableboolean

If is set to true, the element cannot be focused.

Default valuefalse

windowParentany

Determines the actual parent of the element. The window can size and move only in the area of that element.

onopening((this: Window, ev: Event) => any) | null

This event is triggered just before the window starts opening.

Arguments

evEvent

onopen((this: Window, ev: Event) => any) | null

This event is triggered when the window is opened( visible ).

Arguments

evEvent

onclosing((this: Window, ev: Event) => any) | null

This event is triggered just before the window starts closing.

Arguments

evEvent

onclose((this: Window, ev: Event) => any) | null

This event is triggered when the window is closed( hidden )

Arguments

evEvent

oncollapse((this: Window, ev: Event) => any) | null

This event is triggered when the window is collapsed.

Arguments

evEvent

ondragend((this: Window, ev: Event) => any) | null

This event is triggered when window's dragging is ended.

Arguments

evEvent

ondragstart((this: Window, ev: Event) => any) | null

This event is triggered when window's dragging is started.

Arguments

evEvent

onexpand((this: Window, ev: Event) => any) | null

This event is triggered when the window is expanded.

Arguments

evEvent

onmaximize((this: Window, ev: Event) => any) | null

This event is triggered when the window is maximized.

Arguments

evEvent

onminimize((this: Window, ev: Event) => any) | null

This event is triggered when the window is minimized.

Arguments

evEvent

onresizeend((this: Window, ev: Event) => any) | null

This event is triggered when window's resizing is ended.

Arguments

evEvent

onresizestart((this: Window, ev: Event) => any) | null

This event is triggered when window's resizing is started.

Arguments

evEvent

onrestore((this: Window, ev: Event) => any) | null

This event is triggered when the window is restored to it's previous state before maximization.

Arguments

evEvent

Methods

appendChild( node: Node): T

Arguments

nodeNode

A TabItem element that should be added to the rest of the items as the last item.

ReturnsNode

bringToFront(): void

Sets the window to the top level so the user can interact with it.


clear(): void

Clears the content of the Window.


close(): void

Closes the window.


collapse(): HTMLElement

Collapses the window.

ReturnsHTMLElement

ensureVisible( index: number): void

Makes sure a tab item is visible by scrolling to it. Applicable only to TabsWindow.

Arguments

indexnumber

The index of the tab to scroll to.


expand(): any[]

Expands the window after being collapsed.

Returnsany[]

insert( index: number, details: any): void

Inserts a new tab and an associated content section. Applicable only to TabsWindow.

Arguments

indexnumber

The index to insert a new tab at.

detailsany

An Object with the fields "label", "labelSize", "content" and "group".


insertBefore( newNode: Node, referenceNode?: Node | null): T

Arguments

newNodeNode

The "smart-tab-item" node to insert.

referenceNode?Node | null

The "smart-tab-item" node before which newNode is inserted.

ReturnsNode

removeAt( index: number): void

Removes a tab and its associated content section. Applicable only to TabsWindow.

Arguments

indexnumber

The index of the tab to remove.


removeChild( node: Node): T

Arguments

nodeNode

The "smart-tab-item" node to remove.

ReturnsNode

maximize(): void

Maximizes the window to fill the area.


minimize(): void

Minimizes the window.


open(): void

Opens the window


pin(): void

Pins the window. Disables window dragging.


restore(): void

Restores the window to it's previous size before maximization/minimization.


select( index: number): void

Selects a tab. Applicalbe only to TabsWindow elements.

Arguments

indexnumber

The index of the tab to select.


unpin(): void

Unpins the window. Enables window dragging.


update( index: number, label: string, content: string | HTMLElement): void

Updates a tab and its associated content section. Applicalbe only to TabsWindow elements.

Arguments

indexnumber

The index of the tab to update.

labelstring

The new label of the tab. The value can be the id of an HTMLTemplateElement

contentstring | HTMLElement

The new content of the tab.



Enums

Animation

None Simple Advanced

LayoutPosition

Near Far Both

Orientation

Horizontal Vertical

Overflow

Auto Hidden Scroll

TabPosition

Top Bottom Left Right Hidden

TabSelectionMode

Click Dblclick Mouseenter None

WindowDropPosition

All Top Bottom Left Right Center Header LayoutTop LayoutBottom LayoutLeft LayoutRight

WindowFooterPosition

Bottom None

WindowResizeMode

None Horizontal Vertical Both Top Bottom Left Right

WindowTabCloseButtonMode

Default Selected