Usage
Signature:
interface CDialogElement
Typescript Import Format
//To typecheck the element APIs, import as below.
import { CDialogElement } from "oj-c/dialog";
//For the transpiled javascript to load the element's module, import as below
import "oj-c/dialog";
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.
-
body
-
The content node to be shown within the Dialog body.
-
footer
-
The content node to be shown within the Dialog footer.
-
header
-
The content node to be shown within the Dialog header. If a header slot is not specified by the user, the dialog-title attribute will be used instead.
Attributes
-
anchor :(string|Element|oj-c.Dialog.Coords)
-
Specifies Dialog's anchor. Dialog is placed relative to its anchor. If not specified, it is placed relative to window.
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
-
cancel-behavior :"icon"|"escape"|"none"
-
Specifies the cancel behavior of the Dialog. Note that the cancelBehavior applies to both automatic and user-defined headers.
- Default Value:
"none"
Supported Values:
Value Description escape
The dialog will close when it has focus and user presses the escape (ESC) key. A close icon will not be created. icon
A close icon will automatically be created. The dialog will close when it has focus and user presses the escape (ESC) key. none
A close icon will not be created. No actions will be associated with the escape key. Names
Item Name Property cancelBehavior
Property change event cancelBehaviorChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-cancel-behavior-changed
-
dialog-title :string
-
Specifies title if header slot is not defined (custom header).
Names
Item Name Property dialogTitle
Property change event dialogTitleChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-dialog-title-changed
-
drag-affordance :"none"|"header"
-
Specifies whether the Dialog is draggable.
- Default Value:
"none"
Supported Values:
Value Description header
The dialog will be draggable by the header. none
The dialog will not be draggable. Names
Item Name Property dragAffordance
Property change event dragAffordanceChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-drag-affordance-changed
-
header-decoration :"on"|"off"
-
Specifies whether decorative stripe at the top is present.
- Default Value:
"on"
Supported Values:
Value Description off
No decoration is rendered. on
Renders a textured strip at the top of the dialog header in the Redwood theme. Names
Item Name Property headerDecoration
Property change event headerDecorationChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-header-decoration-changed
-
height :(number|string)
-
Specifies height of the Dialog.
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
-
launcher :(string|Element)
-
Specifies Dialog's launcher. After Dialog closes, it returns focus to the 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 Dialog.
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 Dialog.
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 Dialog.
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 Dialog.
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 Dialog.
- Default Value:
"modal"
Supported Values:
Value Description modal
The dialog is modal. Interactions with other page elements are disabled. Modal dialogs overlay other page elements. modeless
Defines a modeless dialog. 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 :number|{ mainAxis?: number; crossAxis?: number; }
-
Specifies displacement of the Dialog from the anchor element placement along the specified axes. The offset object consists of mainAxis and crossAxis properties. The direction in which these propertie are applied depends on the current value of the position property. If a number is used, it represents the main axis. 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 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 Dialog 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"|"start-top"|"start-bottom"|"bottom-start"|"bottom-end"|"end-top"|"end-bottom"
-
Specifies the location the dialog will appear relative to another element. If not specified, the default dialog position is "center" on desktop and "bottom-start" on phone.
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
-
resize-behavior :"none"|"resizable"
-
Specifies whether the Dialog is resizable.
- Default Value:
"none"
Supported Values:
Value Description none
The dialog will not be interactively resizable. resizable
The dialog will be interactively resizable. Names
Item Name Property resizeBehavior
Property change event resizeBehaviorChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-resize-behavior-changed
-
width :(number|string)
-
Specifies width of the Dialog.
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 Dialog closes. Call
event.preventDefault()
in the event listener to veto the event synchronously, which prevents the Dialog from closing. Callevent.detail.accept(Promise.reject());
in the event listener to veto the event asynchronously, which prevents the Dialog 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 Dialog closes.
See Events and Listeners for additional information.
-
ojDragEnd
-
Triggered immediately after the Dialog stops moving.
See Events and Listeners for additional information.
-
ojDragMove
-
Triggered when the Dialog moves.
See Events and Listeners for additional information.
-
ojDragStart
-
Triggered immediately before the Dialog moves.
See Events and Listeners for additional information.
-
ojFocus
-
Triggered immediately after the Dialog receives focus.
See Events and Listeners for additional information.
-
ojOpen
-
Triggered immediately after the Dialog opens.
See Events and Listeners for additional information.
-
ojResize
-
Triggered when the Dialog resizes.
See Events and Listeners for additional information.
-
ojResizeEnd
-
Triggered immediately after the Dialog stops resizing.
See Events and Listeners for additional information.
-
ojResizeStart
-
Triggered immediately before the Dialog resizes.
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
Type Definitions
-
Coords
-
Properties:
Name Type Argument contextElement
Element <optional>
x
number y
number