print_render_attribute_string( 'elementor-tabs' ); ?>>
$item ) {
$tab_count = $index + 1;
$tab_id = empty( $item['element_id'] )
? 'e-n-tab-title-' . $widget_number . $tab_count
: $item['element_id'];
$item_settings = [
'index' => $index,
'tab_count' => $tab_count,
'tab_id' => $tab_id,
'container_id' => 'e-n-tab-content-' . $widget_number . $tab_count,
'widget_number' => $widget_number,
'item' => $item,
'settings' => $settings,
];
$this->tab_item_settings[] = $item_settings;
$this->render_tab_titles_html( $item_settings );
}
?>
render_tab_containers_html( $settings ); ?>
experiments->is_feature_active( 'e_nested_atomic_repeaters' ) ) {
return array_merge( parent::get_initial_config(), [
'support_improved_repeaters' => true,
'target_container' => [ '.e-n-tabs-heading' ],
'node' => 'button',
] );
}
return parent::get_initial_config();
}
protected function content_template_single_repeater_item() {
?>
<#
const tabIndex = view.collection.length,
elementUid = view.getIDInt().toString(),
item = data,
hoverAnimationSetting = view?.container?.settings?.attributes?.hover_animation;
hoverAnimationClass = hoverAnimationSetting
? `elementor-animation-${ hoverAnimationSetting }`
: '';
#>
content_template_single_item( '{{ tabIndex }}', '{{ item }}', '{{ elementUid }}', '{{ hoverAnimationClass }}' );
}
protected function content_template() {
?>
<# const elementUid = view.getIDInt().toString(); #>
<# if ( settings['tabs'] ) { #>
<# _.each( settings['tabs'], function( item, index ) {
const tabIndex = index,
hoverAnimationSetting = settings['hover_animation'],
hoverAnimationClass = hoverAnimationSetting
? `elementor-animation-${ hoverAnimationSetting }`
: '';
#>
content_template_single_item( '{{ tabIndex }}', '{{ item }}', '{{ elementUid }}', '{{ hoverAnimationClass }}' ); ?>
<# } ); #>
<# } #>
<#
const tabCount = tabIndex + 1,
tabId = item.element_id
? item.element_id
: 'e-n-tab-title-' + elementUid + ( tabIndex + 1 ),
tabUid = elementUid + tabCount,
tabIcon = elementor.helpers.renderIcon( view, item.tab_icon, { 'aria-hidden': true }, 'i' , 'object' ),
activeTabIcon = item.tab_icon_active.value
? elementor.helpers.renderIcon( view, item.tab_icon_active, { 'aria-hidden': true }, 'i' , 'object' )
: tabIcon,
escapedHoverAnimationClass = _.escape( hoverAnimationClass );
view.addRenderAttribute( 'tab-title', {
'id': tabId,
'class': [ 'e-n-tab-title',escapedHoverAnimationClass ],
'data-tab-index': tabCount,
'role': 'tab',
'aria-selected': 1 === tabCount ? 'true' : 'false',
'tabindex': 1 === tabCount ? '0' : '-1',
'aria-controls': 'e-n-tab-content-' + tabUid,
'style': '--n-tabs-title-order: ' + tabCount + ';',
}, null, true );
view.addRenderAttribute( 'tab-title-text', {
'class': [ 'e-n-tab-title-text' ],
'data-binding-type': 'repeater-item',
'data-binding-repeater-name': 'tabs',
'data-binding-setting': [ 'tab_title' ],
'data-binding-index': tabCount,
'data-binding-dynamic': 'true',
}, null, true );
view.addRenderAttribute( 'tab-icon', {
'class': [ 'e-n-tab-icon' ],
'data-binding-type': 'repeater-item',
'data-binding-repeater-name': 'tabs',
'data-binding-setting': [ 'tab_icon', 'tab_icon_active' ],
'data-binding-index': tabCount,
}, null, true );
#>