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 anchorProperty change event anchorChangedProperty 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 escapeThe dialog will close when it has focus and user presses the escape (ESC) key. A close icon will not be created. iconA close icon will automatically be created. The dialog will close when it has focus and user presses the escape (ESC) key. noneA close icon will not be created. No actions will be associated with the escape key. Names
Item Name Property cancelBehaviorProperty change event cancelBehaviorChangedProperty 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 dialogTitleProperty change event dialogTitleChangedProperty 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 headerThe dialog will be draggable by the header. noneThe dialog will not be draggable. Names
Item Name Property dragAffordanceProperty change event dragAffordanceChangedProperty 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 offNo decoration is rendered. onRenders a textured strip at the top of the dialog header in the Redwood theme. Names
Item Name Property headerDecorationProperty change event headerDecorationChangedProperty 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 heightProperty change event heightChangedProperty 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 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 Dialog.
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 Dialog.
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 Dialog.
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 Dialog.
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 Dialog.
- Default Value:
"modal"
Supported Values:
Value Description modalThe dialog is modal. Interactions with other page elements are disabled. Modal dialogs overlay other page elements. modelessDefines a modeless dialog. 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 :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
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 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 Dialog 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"|"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 placementProperty change event placementChangedProperty 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 noneThe dialog will not be interactively resizable. resizableThe dialog will be interactively resizable. Names
Item Name Property resizeBehaviorProperty change event resizeBehaviorChangedProperty 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 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 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 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 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 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