new Box(id, properties) → {Object}
Parameters:
| Name |
Type |
Description |
id |
String
|
The id of the component. |
properties |
Object
|
HTMLElement
|
The properties used to initialize the component or the container element. |
Properties:
- Mixes In:
Returns:
An instance of the component.
-
Type
-
Object
Extends
Classes
- BoxEvents
Members
Gets or sets a value indicating whether the box's horizontal position is aligned to the left, center or right of the expander element or pointer.
Type:
Gets or sets a value indicating whether the box's vertical position is aligned to the top, center or bottom of the expander element or pointer.
Type:
animation :animation
Type:
Properties:
| Name |
Type |
Description |
showType |
componyx.UI.Box.AnimationTypeOption
|
Gets or sets the animation type used when showing the box. |
showClass |
String
|
Gets or sets the CSS class applied when showing the box. |
showDirection |
String
|
Gets or sets the animation direction (down, right, up, left) used when showing the box. |
showFade |
Boolean
|
Gets or sets a value indicating if fading is used when showing the box. |
hideType |
componyx.UI.Box.AnimationTypeOption
|
Gets or sets the animation type used when hiding the box. |
hideClass |
String
|
Gets or sets the CSS class applied when hiding the box. |
hideDirection |
String
|
Gets or sets the animation direction (top, right, bottom, left) used when hiding the box. |
hideFade |
Boolean
|
Gets or sets a value indicating if fading is used when hiding the box. |
autoFit :Boolean
Gets or sets a value indicating whether the box should try to fit when the window is too small.
Type:
autoFocus :Boolean
Gets or sets a value indicating whether the first element of the focusable list should get focus when the box is shown.
Type:
autoInvertAnimation :Boolean
Gets or sets a value indicating whether the animation direction should be auto inverted when the box is inverted.
Type:
autoInvertFit :Boolean
Gets or sets a value indicating whether the box should try to fit inverted when the window is too small.
Type:
Gets or sets the auto position of the box.
Type:
autoResizeFit :Boolean
Gets or sets a value indicating whether the box should be resized when the window is too small.
Type:
bottom :String
Gets or sets the bottom position of the box. Overwrites the property if already defined through Style.
Type:
contentTag :String
Gets the tag name of the content element.
Type:
cssClassContent :String
Gets or sets the css class of the box content.
Type:
cssClassHorizontalInverted :String
Gets or sets the css class of the box when AutoInvertFit is true and the box is inverted horizontally.
Type:
cssClassModal :String
Gets or sets the css class of the box modal overlay.
Type:
cssClassVerticalInverted :String
Gets or sets the css class of the box when AutoInvertFit is true and the box is inverted vertically.
Type:
Type:
- See:
-
draggable :Boolean
Gets or sets a value indicating whether the box is draggable.
Type:
enterKeySubmitter :HTMLElement|String|null
Gets or sets the submitter element or element-id on which to fire a click event when the enter-key is pressed within a field inside the box element.
Type:
-
HTMLElement
|
String
|
null
Type:
Gets or sets the expand direction.
Type:
expander :HTMLElement|String|null
Gets or sets the expander element or element-id.
Type:
-
HTMLElement
|
String
|
null
handleFocus :Boolean
Gets or sets a value indicating whether the box should handle focus events for focusable child elements. Only applies when modal is false.
Type:
height :String
Gets or sets the height of the box. Overwrites the property if already defined through Style.
Type:
hideOnOutsideClick :Boolean
Gets or sets a value indicating whether the box is hidden when the user clicks outside the box.
Type:
left :String
Gets or sets the left position of the box. Overwrites the property if already defined through Style.
Type:
modal :Boolean
Gets or sets a value indicating whether the box is displayed as modal popup.
Type:
resizeToMaxHeight :Boolean
Gets or sets a value indicating whether the box is either resized to the window height or available (inverted) space when auto resized.
Type:
resizeToMaxWidth :Boolean
Gets or sets a value indicating whether the box is either resized to the window width or available (inverted) space when auto resized.
Type:
right :String
Gets or sets the right position of the box. Overwrites the property if already defined through Style.
Type:
stretchToContent :Boolean
Gets or sets a value indicating if the box element must stretch to the size of the content element. This setting is useful when the box is positioned absolute/fixed and the content element is a flex-box (display:flex).
Type:
stretchToExpander :Boolean
Gets or sets a value indicating if the box element must stretch to the size of the expander element. The content width has priority over the expander width when stretchToContent is enabled and the content exceeds the expander width.
Type:
tabIndexFocus :Boolean
Gets or sets a value indicating whether the focusable list is ordered by tabindex (requires all elements to have a tabindex set).
Type:
top :String
Gets or sets the top position of the box. Overwrites the property if already defined through Style.
Type:
trackPointer :Boolean
Gets or sets a value indicating whether the box position tracks the pointer when AutoPosition is set to Pointer.
Type:
width :String
Gets or sets the width of the box. Overwrites the property if already defined through Style.
Type:
(static, readonly) AlignXOption :number
Type:
Properties:
| Name |
Type |
Description |
LEFT |
number
|
|
CENTER |
number
|
|
RIGHT |
number
|
|
getName |
number
|
|
(static, readonly) AlignYOption :number
Type:
Properties:
| Name |
Type |
Description |
TOP |
number
|
|
CENTER |
number
|
|
BOTTOM |
number
|
|
getName |
number
|
|
(static, readonly) AnimationTypeOption :number
Type:
Properties:
| Name |
Type |
Description |
NONE |
number
|
|
SLIDE |
number
|
|
REVEAL |
number
|
|
CSS |
number
|
|
(static, readonly) AutoPositionOption :number
Type:
Properties:
| Name |
Type |
Description |
NONE |
number
|
|
TOPLEFT |
number
|
|
TOPCENTER |
number
|
|
TOPRIGHT |
number
|
|
LEFT |
number
|
|
CENTER |
number
|
|
RIGHT |
number
|
|
BOTTOMLEFT |
number
|
|
BOTTOMCENTER |
number
|
|
BOTTOMRIGHT |
number
|
|
POINTER |
number
|
|
EXPAND |
number
|
|
(static, readonly) ExpandDirectionOption :number
Type:
Properties:
| Name |
Type |
Description |
DOWN |
number
|
|
RIGHT |
number
|
|
UP |
number
|
|
LEFT |
number
|
|
getName |
number
|
|
Methods
destroy()
- See:
-
hide(instantopt)
Parameters:
| Name |
Type |
Attributes |
Description |
instant |
Boolean
|
<optional>
|
A value indicating if the box should be hidden instantly without animation. |
render()
setContentTemplate(content)
Adds the content template.
Parameters:
| Name |
Type |
Description |
content |
HTMLElement
|
Array.<HTMLElement>
|
DocumentFragment
|
String
|
The content template. |
show(instantopt, pointerCoordinatesopt)
Parameters:
| Name |
Type |
Attributes |
Description |
instant |
boolean
|
<optional>
|
A value indicating if the box should be shown instantly without animation. |
pointerCoordinates |
Object
|
<optional>
|
Optional pointer coordinates for POINTER auto-positioning. Pass these when the show is deferred (e.g. via setTimeout), as the original pointer event may no longer be available by then. |
stopAnimation()
suppressNextChangeEvent(action)
Suppresses any change events fired by the underlying input element during the execution of the provided action. Use this when programmatically setting a component value to prevent the change event from propagating as a user interaction.
The suppression is automatically lifted after the action completes, even if it throws.
Parameters:
| Name |
Type |
Description |
action |
function
|
The action to execute with change events suppressed. |
- Mixes In:
toggle()
Shows or hides the component.
update(contentopt, showopt)
Updates the box view to stretch and position with the updated content.
Parameters:
| Name |
Type |
Attributes |
Default |
Description |
content |
HTMLElement
|
Array.<HTMLElement>
|
DocumentFragment
|
String
|
<optional>
|
|
A new content template. |
show |
Boolean
|
<optional>
|
true
|
A value indicating if the box should be displayed when hidden. |
Type Definitions
AutoFitEventArgs
Box auto fit event arguments.
Type:
Properties:
| Name |
Type |
Description |
fitX |
Boolean
|
A value indicating if the box was fitted horizontally. |
fitY |
Boolean
|
A value indicating if the box was fitted vertically. |
invertedX |
Boolean
|
A value indicating if the box position was inverted horizontally. |
invertedY |
Boolean
|
A value indicating if the box position was inverted vertically. |
resizedX |
Boolean
|
A value indicating if the box was resized horizontally. |
resizedY |
Boolean
|
A value indicating if the box was resized vertically. |
HideEventArgs
Box hide event arguments.
Type:
Properties:
| Name |
Type |
Description |
event |
Event
|
The original event object. |
cancel |
Boolean
|
Set to true to cancel hiding the box. |