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|oj-c.Popup.Coords)
-
Specifies Popup's anchor. Popup is placed relatively to its anchor.
Names
Item Name Property anchorProperty change event anchorChangedProperty 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 autoDismissProperty change event autoDismissChangedProperty 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 collisionProperty change event collisionChangedProperty 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 heightProperty change event heightChangedProperty 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 initialFocusProperty change event initialFocusChangedProperty 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 launcherProperty change event launcherChangedProperty 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 maxHeightProperty change event maxHeightChangedProperty 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 maxWidthProperty change event maxWidthChangedProperty 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 minHeightProperty change event minHeightChangedProperty 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 minWidthProperty change event minWidthChangedProperty 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 modalityProperty change event modalityChangedProperty 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 offsetProperty change event offsetChangedProperty 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 openedProperty change event openedChangedProperty 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
mainAxisproperty represents the distance between the Popup and the anchor. ThecrossAxisproperty represents the deviation in the opposite axis to the main axis - the skidding between the Popup and the anchor.Names
Item Name Property placementProperty change event placementChangedProperty 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 tailProperty change event tailChangedProperty 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 widthProperty change event widthChangedProperty 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 acceptfunction 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 propertyThe 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 propertiesAn 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 propertyThe property name to set. Supports dot notation for subproperty access. valueThe new value to set the property to. Returns:
- Type
- void
Type Definitions
-
Coords
-
Properties:
Name Type Argument contextElementElement <optional>
xnumber ynumber -
PopupOffset
-
Properties:
Name Type Argument xnumber <optional>
ynumber <optional>