Usage
Signature:
interface CCollapsibleElement
Typescript Import Format
//To typecheck the element APIs, import as below.
import { CCollapsibleElement } from "oj-c/collapsible";
//For the transpiled javascript to load the element's module, import as below
import "oj-c/collapsible";
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.
-
Default
-
The default slot is the content of the collapsible. The oj-c-collapsible element accepts plain text or DOM nodes as children for the default slot.
-
header
-
The header slot is the collapsible's header. If not specified, the header contains only an open/close icon. Note that the header text is required for JET collapsible for accessibility purposes.
Attributes
-
disabled :boolean
-
Disables the collapsible if set to
true
.- Default Value:
false
Names
Item Name Property disabled
Property change event disabledChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-disabled-changed
-
expanded :boolean
-
Specifies if the content is expanded.
- Default Value:
false
- Supports writeback:
true
Names
Item Name Property expanded
Property change event expandedChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-expanded-changed
-
icon-position :"start"|"end"
-
Controls placement of the icon in the header.
- Default Value:
"start"
Supported Values:
Value Description end
icon position is end start
icon position is start (default, if unspecified) Names
Item Name Property iconPosition
Property change event iconPositionChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-icon-position-changed
-
variant :"basic"|"horizontal-rule"
-
Controls display of the optional divider below the header.
- Default Value:
"basic"
Supported Values:
Value Description basic
basic, no divider (default, if unspecified) horizontal-rule
displays a horizontal divider between the header and content Names
Item Name Property variant
Property change event variantChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-variant-changed
Events
-
ojBeforeCollapse
-
Triggered immediately before the collapsible is collapsed.
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. target
EventTarget | null -
ojBeforeExpand
-
Triggered immediately before the collapsible is expanded.
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. target
EventTarget | null -
ojCollapse
-
Triggered after the collapsible has been collapsed.
Properties:
All of the event payloads listed below can be found under
event.detail
. See Events and Listeners for additional information.Name Type target
EventTarget | null -
ojExpand
-
Triggered after the collapsible has been expanded (after animation completes).
Properties:
All of the event payloads listed below can be found under
event.detail
. See Events and Listeners for additional information.Name Type target
EventTarget | null
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