Interface representing the API for an accordion component.
collapse(
itemId
):void
Given the itemId, will collapse the corresponding accordion-item.
If the itemId is not valid, nothing will happen.
string
void
collapseAll():
void
It will collapse all the accordion-items in the accordion.
void
expand(
itemId
):void
Given the itemId, will expand the corresponding accordion-item.
If the itemId is not valid, nothing will happen.
string
void
expandAll():
void
It will expand all the items in the accordion.
If closeOthers
is true
it will expand only the last accordion-item.
void
registerItem(
itemConfig
?):AccordionItemWidget
Creates a new accordionItem.
PropsConfig
<AccordionItemProps
>
toggle(
itemId
):void
Given the itemId, will toggle the corresponding accordion-item.
If the itemId is not valid, nothing will happen.
string
void
Directive to represent the body of an accordion item.
This directive provides a template reference for the AccordionItemContext.
Directive for creating an accordion component.
This directive extends the BaseWidgetDirective
and provides various inputs and outputs
to customize the behavior and appearance of the accordion and its items.
readonly
className:InputSignal
<undefined
|string
>
CSS classes to be applied on the widget main container
''
readonly
closeOthers:InputSignalWithTransform
<undefined
|boolean
,unknown
>
If true
, only one accordion-item at the time can stay open.
false
readonly
itemAnimated:InputSignalWithTransform
<undefined
|boolean
,unknown
>
If true
, accordion-item will be animated.
true
readonly
itemBodyClassName:InputSignal
<undefined
|string
>
CSS classes to add on the accordion-item body DOM element.
''
readonly
itemBodyContainerClassName:InputSignal
<undefined
|string
>
CSS classes to add on the accordion-item body container DOM element. The accordion-item body container is the DOM element on what the itemTransition is applied.
''
readonly
itemButtonClassName:InputSignal
<undefined
|string
>
CSS classes to add on the accordion-item toggle button DOM element.
''
readonly
itemClassName:InputSignal
<undefined
|string
>
CSS classes to add on the accordion-item DOM element.
''
readonly
itemDestroyOnHide:InputSignalWithTransform
<undefined
|boolean
,unknown
>
If true
, the accordion-item body container will be removed from the DOM when the accordion-item is collapsed. It will be just hidden otherwise.
true
readonly
itemHeaderClassName:InputSignal
<undefined
|string
>
CSS classes to add on the accordion-item header DOM element.
''
readonly
itemHeadingTag:InputSignal
<undefined
|string
>
The html tag to use for the accordion-item-header.
''
readonly
itemHidden:OutputEmitterRef
<string
>
An event fired when an item is hidden.
Event payload is the id of the item.
() => {}
readonly
itemShown:OutputEmitterRef
<string
>
An event fired when an item is shown.
Event payload is the id of the item.
() => {}
readonly
itemStructure:InputSignal
<SlotContent
<AccordionItemContext
>>
Structure of the accordion-item. The default item structure is: accordion-item
contains accordion header and accordion-item body container; the accordion header contains the accordion button
(that contains header
), while the accordion-item body container contains the accordion body (that contains children
).
The itemTransition is applied on this element.
It is a prop of the accordion-item.
readonly
itemTransition:InputSignal
<undefined
|TransitionFn
>
The transition to use for the accordion-item body-container when the accordion-item is toggled.
collapseVerticalTransition
get api():
W
["api"
]
Retrieves the widget api
W
["api"
]
the widget api
get directives():
W
["directives"
]
Retrieves the widget directives
W
["directives"
]
the widget directives
get state():
AngularState
<W
>
Retrieves the widget state. Each property of the state is exposed through an Angular Signal
AngularState
<W
>
the widget state
Interface representing the directives used in the Accordion component.
accordionDirective:
Directive
Directive to put on the accordion DOM element
Directive to be used as an accordion header.
This directive provides a template reference for the AccordionItemContext.
Interface representing the API for an accordion item.
collapse():
void
It will collapse the accordion-item.
void
expand():
void
It will expand the accordion-item.
void
initDone():
void
Method to be called after the initialization to allow animations.
void
toggle():
void
It will toggle the accordion-item.
void
AccordionItemComponent is a component that represents an item within an accordion.
readonly
animated:InputSignalWithTransform
<undefined
|boolean
,unknown
>
If true
, accordion-item will be animated.
readonly
bodyClassName:InputSignal
<undefined
|string
>
CSS classes to add on the accordion-item body DOM element.
readonly
bodyContainerClassName:InputSignal
<undefined
|string
>
CSS classes to add on the accordion-item body container DOM element. The accordion-item body container is the DOM element on what the itemTransition is applied.
readonly
buttonClassName:InputSignal
<undefined
|string
>
CSS classes to add on the accordion-item collapse DOM element.
readonly
children:InputSignal
<SlotContent
<AccordionItemContext
>>
Content present in the accordion body.
It is a prop of the accordion-item.
readonly
className:InputSignal
<undefined
|string
>
CSS classes to be applied on the widget main container
''
readonly
destroyOnHide:InputSignalWithTransform
<undefined
|boolean
,unknown
>
If true
, the accordion-item body container will be removed from the DOM when the accordion-item is collapsed. It will be just hidden otherwise.
readonly
disabled:InputSignalWithTransform
<undefined
|boolean
,unknown
>
If true
, the accordion-item will be disabled.
It will not react to user's clicks, but still will be possible to toggle programmatically.
readonly
header:InputSignal
<SlotContent
<AccordionItemContext
>>
Content present in the accordion button inside the accordion header.
It is a prop of the accordion-item.
readonly
headerClassName:InputSignal
<undefined
|string
>
CSS classes to add on the accordion-item header DOM element.
readonly
headingTag:InputSignal
<undefined
|string
>
The html tag to use for the accordion-item-header.
readonly
hidden:OutputEmitterRef
<void
>
An event fired when an item is hidden.
readonly
id:InputSignal
<undefined
|string
>
The id of the accordion-item. It can be used for controlling the accordion-item via the accordion api.
readonly
shown:OutputEmitterRef
<void
>
An event fired when an item is shown.
readonly
structure:InputSignal
<SlotContent
<AccordionItemContext
>>
Structure of the accordion-item. The default item structure is: accordion-item
contains accordion header and accordion-item body container; the accordion header contains the accordion button
(that contains header
), while the accordion-item body container contains the accordion body (that contains children
).
The itemTransition is applied on this element.
It is a prop of the accordion-item.
readonly
transition:InputSignal
<undefined
|TransitionFn
>
The transition to use for the accordion-item body-container when the accordion-item is toggled.
readonly
visible:InputSignalWithTransform
<undefined
|boolean
,unknown
>
If true
, the accordion-item will be visible (expanded). Otherwise, it will be hidden (collapsed).
readonly
visibleChange:OutputEmitterRef
<boolean
>
An event fired when the visible
value changes.
Event payload is the new value of visible.
get api():
W
["api"
]
Retrieves the widget api
W
["api"
]
the widget api
get directives():
W
["directives"
]
Retrieves the widget directives
W
["directives"
]
the widget directives
get state():
AngularState
<W
>
Retrieves the widget state. Each property of the state is exposed through an Angular Signal
AngularState
<W
>
the widget state
ngAfterViewInit():
void
A callback method that is invoked immediately after Angular has completed initialization of a component's view. It is invoked only once when the view is instantiated.
void
AfterViewInit.ngAfterViewInit
Represents the context for an accordion item within the accordion component.
api:
AccordionItemApi
all the api functions to interact with the widget
directives:
AccordionItemDirectives
directives to be used on html elements in the template of the widget or in the slots
state:
AngularState
<AccordionItemWidget
>
The state of the widget. Each property of the state is exposed through an Angular Signal
const
accordionItemDefaultSlotStructure:SlotContent
<AccordionItemContext
>
Represents the default slot structure for an accordion item.
Interface representing the directives used in an accordion item.
bodyContainerAttrsDirective:
Directive
Directive to apply aria attributes to the expanded body panel
bodyContainerDirective:
Directive
Directive to be put on the accordion-item body container. It will handle the animation.
bodyDirective:
Directive
Directive to put on the accordion-item body.
buttonDirective:
Directive
Directive to put on the button element that will control the collapsing of the accordion-item.
headerDirective:
Directive
Directive to put on the accordion-item header that will contain the button element.
itemDirective:
Directive
Directive to be put on the accordion-item. It will handle adding the accordion-item to the accordion.
toggleDirective:
Directive
Directive to use in special cases, if the accordion header does not use a button element to control the collapsing.
transitionDirective:
Directive
Directive to apply the itemTransition
Represents the properties for an Accordion item component.
animated:
boolean
If true
, accordion-item will be animated.
bodyClassName:
string
CSS classes to add on the accordion-item body DOM element.
bodyContainerClassName:
string
CSS classes to add on the accordion-item body container DOM element. The accordion-item body container is the DOM element on what the itemTransition is applied.
buttonClassName:
string
CSS classes to add on the accordion-item collapse DOM element.
children:
SlotContent
<AccordionItemContext
>
Content present in the accordion body.
It is a prop of the accordion-item.
className:
string
CSS classes to be applied on the widget main container
''
destroyOnHide:
boolean
If true
, the accordion-item body container will be removed from the DOM when the accordion-item is collapsed. It will be just hidden otherwise.
disabled:
boolean
If true
, the accordion-item will be disabled.
It will not react to user's clicks, but still will be possible to toggle programmatically.
header:
SlotContent
<AccordionItemContext
>
Content present in the accordion button inside the accordion header.
It is a prop of the accordion-item.
headerClassName:
string
CSS classes to add on the accordion-item header DOM element.
headingTag:
string
The html tag to use for the accordion-item-header.
id:
string
The id of the accordion-item. It can be used for controlling the accordion-item via the accordion api.
onHidden: () =>
void
An event fired when an item is hidden.
void
onShown: () =>
void
An event fired when an item is shown.
void
onVisibleChange: (
visible
) =>void
An event fired when the visible
value changes.
Event payload is the new value of visible.
boolean
void
structure:
SlotContent
<AccordionItemContext
>
Structure of the accordion-item. The default item structure is: accordion-item
contains accordion header and accordion-item body container; the accordion header contains the accordion button
(that contains header
), while the accordion-item body container contains the accordion body (that contains children
).
The itemTransition is applied on this element.
It is a prop of the accordion-item.
transition:
TransitionFn
The transition to use for the accordion-item body-container when the accordion-item is toggled.
visible:
boolean
If true
, the accordion-item will be visible (expanded). Otherwise, it will be hidden (collapsed).
Represents the state of an accordion item, extending the core item state and additional properties specific to the accordion item.
bodyClassName:
string
CSS classes to add on the accordion-item body DOM element.
bodyContainerClassName:
string
CSS classes to add on the accordion-item body container DOM element. The accordion-item body container is the DOM element on what the itemTransition is applied.
buttonClassName:
string
CSS classes to add on the accordion-item collapse DOM element.
children:
SlotContent
<AccordionItemContext
>
Content present in the accordion body.
It is a prop of the accordion-item.
className:
string
CSS classes to be applied on the widget main container
''
disabled:
boolean
If true
, the accordion-item will be disabled.
It will not react to user's clicks, but still will be possible to toggle programmatically.
header:
SlotContent
<AccordionItemContext
>
Content present in the accordion button inside the accordion header.
It is a prop of the accordion-item.
headerClassName:
string
CSS classes to add on the accordion-item header DOM element.
headingTag:
string
The html tag to use for the accordion-item-header.
id:
string
The id of the accordion-item. It can be used for controlling the accordion-item via the accordion api.
shouldBeInDOM:
boolean
If true
the content of the accordion-item collapse should be in DOM. Its value depends on the
value of the visible
and destroyOnHide
.
structure:
SlotContent
<AccordionItemContext
>
Structure of the accordion-item. The default item structure is: accordion-item
contains accordion header and accordion-item body container; the accordion header contains the accordion button
(that contains header
), while the accordion-item body container contains the accordion body (that contains children
).
The itemTransition is applied on this element.
It is a prop of the accordion-item.
visible:
boolean
If true
, the accordion-item will be visible (expanded). Otherwise, it will be hidden (collapsed).
Directive that represents the structure of an accordion item.
This directive provides a template reference for the AccordionItemContext. It also includes a static method to guard the template context type.
AccordionItemWidget:
Widget
<AccordionItemProps
,AccordionItemState
,AccordionItemApi
,AccordionItemDirectives
>
Represents a widget for an accordion item.
Represents the state of an AccordionItem component.
className:
string
CSS classes to be applied on the widget main container
''
closeOthers:
boolean
If true
, only one accordion-item at the time can stay open.
false
itemAnimated:
boolean
If true
, accordion-item will be animated.
true
itemBodyClassName:
string
CSS classes to add on the accordion-item body DOM element.
''
itemBodyContainerClassName:
string
CSS classes to add on the accordion-item body container DOM element. The accordion-item body container is the DOM element on what the itemTransition is applied.
''
itemButtonClassName:
string
CSS classes to add on the accordion-item toggle button DOM element.
''
itemClassName:
string
CSS classes to add on the accordion-item DOM element.
''
itemDestroyOnHide:
boolean
If true
, the accordion-item body container will be removed from the DOM when the accordion-item is collapsed. It will be just hidden otherwise.
true
itemHeaderClassName:
string
CSS classes to add on the accordion-item header DOM element.
''
itemHeadingTag:
string
The html tag to use for the accordion-item-header.
''
itemStructure:
SlotContent
<AccordionItemContext
>
Structure of the accordion-item. The default item structure is: accordion-item
contains accordion header and accordion-item body container; the accordion header contains the accordion button
(that contains header
), while the accordion-item body container contains the accordion body (that contains children
).
The itemTransition is applied on this element.
It is a prop of the accordion-item.
itemTransition:
TransitionFn
The transition to use for the accordion-item body-container when the accordion-item is toggled.
collapseVerticalTransition
onItemHidden: (
itemId
) =>void
An event fired when an item is hidden.
Event payload is the id of the item.
string
void
() => {}
onItemShown: (
itemId
) =>void
An event fired when an item is shown.
Event payload is the id of the item.
string
void
() => {}
Represents the state of an Accordion component.
className:
string
CSS classes to be applied on the widget main container
''
itemStructure:
SlotContent
<AccordionItemContext
>
Structure of the accordion-item. The default item structure is: accordion-item
contains accordion header and accordion-item body container; the accordion header contains the accordion button
(that contains header
), while the accordion-item body container contains the accordion body (that contains children
).
The itemTransition is applied on this element.
It is a prop of the accordion-item.
itemWidgets:
AccordionItemWidget
[]
Array containing all the accordion-items contained in the accordion.
AccordionWidget:
Widget
<AccordionProps
,AccordionState
,AccordionApi
,AccordionDirectives
>
Represents an Accordion widget type.
createAccordion(
props
?):AccordionWidget
Create an AccordionWidget with given config props
an AccordionWidget
createAccordionItem(
props
?):AccordionItemWidget
Create an AccordionItemWidget with given config props
an AccordionItemWidget
factoryCreateAccordion(
itemFactory
?,accordionItemProps
?,accordionConfig
?,accordionValidator
?):WidgetFactory
<AccordionWidget
>
Create an accordion WidgetFactory based on a item factory and the list of item props that should inherit from the parent accordion
WidgetFactory
<AccordionItemWidget
>
the item factory
string
[]
the list of item props
the default accordion config
ConfigValidator
<AccordionProps
>
the validator of props
WidgetFactory
<AccordionWidget
>
the accordion widget factory
getAccordionDefaultConfig():
AccordionProps
Retrieve a shallow copy of the default accordion config
the default accordion config