2022-09-12 07:13:52 +00:00
|
|
|
const AccordionProps = [
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'multiple',
|
|
|
|
type: 'boolean',
|
|
|
|
default: 'false',
|
|
|
|
description: 'When enabled, multiple tabs can be activated at the same time.'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'activeIndex',
|
|
|
|
type: 'number|array',
|
|
|
|
default: 'null',
|
|
|
|
description: 'Index of the active tab or an array of indexes in multiple mode.'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'lazy',
|
|
|
|
type: 'boolean',
|
|
|
|
default: 'false',
|
|
|
|
description: 'When enabled, hidden tabs are not rendered at all. Defaults to false that hides tabs with css.'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'expandIcon',
|
|
|
|
type: 'string',
|
2023-04-03 08:27:59 +00:00
|
|
|
default: 'null',
|
2022-09-14 14:26:41 +00:00
|
|
|
description: 'Icon of a collapsed tab.'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'collapseIcon',
|
|
|
|
type: 'string',
|
2023-04-03 08:27:59 +00:00
|
|
|
default: 'null',
|
2022-09-14 14:26:41 +00:00
|
|
|
description: 'Icon of a expanded tab.'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'tabindex',
|
|
|
|
type: 'number',
|
|
|
|
default: '0',
|
|
|
|
description: 'Index of the element in tabbing order.'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'selectOnFocus',
|
|
|
|
type: 'boolean',
|
|
|
|
default: 'false',
|
|
|
|
description: 'When enabled, the focused tab is activated.'
|
2023-03-24 12:37:26 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'pt',
|
|
|
|
type: 'any',
|
|
|
|
default: 'null',
|
|
|
|
description: 'Uses to pass attributes to DOM elements inside the component.'
|
2023-07-06 13:20:37 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'unstyled',
|
|
|
|
type: 'boolean',
|
|
|
|
default: 'false',
|
|
|
|
description: 'When enabled, it removes component related styles in the core.'
|
2022-09-12 07:13:52 +00:00
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
const AccordionEvents = [
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'tab-open',
|
|
|
|
description: 'Callback to invoke when a tab gets expanded.',
|
2022-09-12 07:13:52 +00:00
|
|
|
arguments: [
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'originalEvent',
|
|
|
|
type: 'object',
|
|
|
|
description: 'Original event'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'index',
|
|
|
|
type: 'number',
|
|
|
|
description: 'Opened tab index'
|
2022-09-12 07:13:52 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'tab-close',
|
|
|
|
description: 'Callback to invoke when an active tab is collapsed by clicking on the header.',
|
2022-09-12 07:13:52 +00:00
|
|
|
arguments: [
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'originalEvent',
|
|
|
|
type: 'object',
|
|
|
|
description: 'Original event'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'index',
|
|
|
|
type: 'number',
|
|
|
|
description: 'Closed tab index'
|
2022-09-12 07:13:52 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'tab-click',
|
|
|
|
description: 'Callback to invoke when an active tab is clicked.',
|
2022-09-12 07:13:52 +00:00
|
|
|
arguments: [
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'originalEvent',
|
|
|
|
type: 'object',
|
|
|
|
description: 'Original event'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'index',
|
|
|
|
type: 'number',
|
|
|
|
description: 'Index of the clicked tab'
|
2022-09-12 07:13:52 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
accordion: {
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'Accordion',
|
|
|
|
description: 'Accordion groups a collection of contents in tabs.',
|
2022-09-12 07:13:52 +00:00
|
|
|
props: AccordionProps,
|
|
|
|
events: AccordionEvents
|
|
|
|
}
|
|
|
|
};
|