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 disabledProperty change event disabledChangedProperty 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 expandedProperty change event expandedChangedProperty 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 endicon position is end starticon position is start (default, if unspecified) Names
Item Name Property iconPositionProperty change event iconPositionChangedProperty 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 basicbasic, no divider (default, if unspecified) horizontal-ruledisplays a horizontal divider between the header and content Names
Item Name Property variantProperty change event variantChangedProperty 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 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. targetEventTarget | 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 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. targetEventTarget | 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 targetEventTarget | 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 targetEventTarget | null
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