Usage
Signature:
interface CPopupElement
Typescript Import Format
//To typecheck the element APIs, import as below.
import { CPopupElement } from "oj-c/popup";
//For the transpiled javascript to load the element's module, import as below
import "oj-c/popup";
For additional information visit:
Note: Application logic should not interact with the component's properties or invoke its methods until the BusyContext indicates that the component is ready for interaction.
Slots
JET components that allow child content support slots. Please see the slots section of the JET component overview doc for more information on allowed slot content and slot types.
Attributes
-
anchor :(string|Element|Coords)
-
Specifies Popup's anchor. Popup is placed relatively to its anchor.
Names
Item Name Property anchor
Property change event anchorChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-anchor-changed
-
auto-dismiss :"none"|"focusLoss"
-
Specifies the auto dismissal behavior.
- Default Value:
"focusLoss"
Names
Item Name Property autoDismiss
Property change event autoDismissChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-auto-dismiss-changed
-
collision :"none"|"flip"|"fit"|"flipfit"|"flipcenter"
-
Specifies rule for alternate placement alignment.
- Default Value:
"fit"
Names
Item Name Property collision
Property change event collisionChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-collision-changed
-
height :(number|string)
-
Specifies height of the Popup content.
Names
Item Name Property height
Property change event heightChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-height-changed
-
initial-focus :"auto"|"none"|"popup"|"firstFocusable"
-
Specifies if the Popup sets focus to its content when initially open.
- Default Value:
"auto"
Names
Item Name Property initialFocus
Property change event initialFocusChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-initial-focus-changed
-
launcher :(string|Element)
-
Specifies Popup's launcher. After Popup closes, it returns focus to launcher.
Names
Item Name Property launcher
Property change event launcherChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-launcher-changed
-
max-height :(number|string)
-
Specifies maxHeight of the Popup content.
- Default Value:
calc(100vw - 3rem)
Names
Item Name Property maxHeight
Property change event maxHeightChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-max-height-changed
-
max-width :(number|string)
-
Specifies maxWidth of the Popup content.
- Default Value:
calc(100vw - 3rem)
Names
Item Name Property maxWidth
Property change event maxWidthChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-max-width-changed
-
min-height :(number|string)
-
Specifies minHeight of the Popup content.
Names
Item Name Property minHeight
Property change event minHeightChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-min-height-changed
-
min-width :(number|string)
-
Specifies minWidth of the Popup content.
Names
Item Name Property minWidth
Property change event minWidthChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-min-width-changed
-
modality :"modal"|"modeless"
-
Specifies modality of the Popup.
- Default Value:
"modeless"
Names
Item Name Property modality
Property change event modalityChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-modality-changed
-
offset :oj-c.Popup.PopupOffset
-
Specifies displacement of the Popup from the anchor element placement along the specified axes.
Names
Item Name Property offset
Property change event offsetChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-offset-changed
-
opened* :boolean
-
Specifies whether the Popup is open.
- Default Value:
false
- Supports writeback:
true
Names
Item Name Property opened
Property change event openedChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-opened*-changed
-
placement :"center"|"end"|"start"|"top"|"bottom"|"top-start"|"top-end"|"bottom-end"|"bottom-start"|"top-start-corner"|"top-end-corner"|"start-top"|"start-bottom"|"start-top-corner"|"start-bottom-corner"|"bottom-start-corner"|"bottom-end-corner"|"end-top"|"end-bottom"|"end-top-corner"|"end-bottom-corner"
-
Specifies displacement of the Popup from the anchor element placement along the specified axes. The offset object consists of mainAxis and crossAxis properties. The direction in which these properties are applied depends on the current value of the position property. The
mainAxis
property represents the distance between the Popup and the anchor. ThecrossAxis
property represents the deviation in the opposite axis to the main axis - the skidding between the Popup and the anchor.Names
Item Name Property placement
Property change event placementChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-placement-changed
-
tail :"none"|"simple"
-
Specifies Popup's tail. Simple tail is an arrow pointing to Popup's anchor.
- Default Value:
"none"
Names
Item Name Property tail
Property change event tailChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-tail-changed
-
width :(number|string)
-
Specifies width of the Popup content.
Names
Item Name Property width
Property change event widthChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-width-changed
Events
-
ojBeforeClose
-
Triggered immediately before the popup closes. Call
event.preventDefault()
in the event listener to veto the event synchronously, which prevents the popup from closing. Callevent.detail.accept(Promise.reject());
in the event listener to veto the event asynchronously, which prevents the popup from closing.Properties:
All of the event payloads listed below can be found under
event.detail
. See Events and Listeners for additional information.Name Type Description accept
function This method can be called with an application-created Promise to cancel this event asynchronously. The Promise should be resolved or rejected to accept or cancel the event, respectively. -
ojClose
-
Triggered immediately after the popup closes.
See Events and Listeners for additional information.
-
ojFocus
-
Triggered immediately after the popup receives focus.
See Events and Listeners for additional information.
-
ojOpen
-
Triggered immediately after the popup opens.
See Events and Listeners for additional information.
Methods
-
getProperty(property) : {any}
-
Retrieves the value of a property or a subproperty.
Parameters:
Name Type Description property
The property name to get. Supports dot notation for subproperty access. Returns:
- Type
- any
-
setProperties(properties) : {void}
-
Performs a batch set of properties.
Parameters:
Name Type Description properties
An object containing the property and value pairs to set. Returns:
- Type
- void
-
setProperty(property, value) : {void}
-
Sets a property or a single subproperty for complex properties and notifies the component of the change, triggering a corresponding event.
Parameters:
Name Type Description property
The property name to set. Supports dot notation for subproperty access. value
The new value to set the property to. Returns:
- Type
- void