* @since 1.0.1 */ class TestimonialCarousel extends UiCoreWidget { public $is_slider; use Carousel_Trait; use Testimonial_Trait; use Animation_Trait; public function get_name() { return 'uicore-testimonial-carousel'; } public function get_title() { return esc_html__('Testimonial Carousel', 'uicore-elements'); } public function get_icon() { return 'eicon-testimonial ui-e-widget'; } public function get_categories() { return ['uicore']; } public function get_keywords() { return ['testimonial', 'review', 'services', 'cards', 'box', 'features', 'testimonial', 'client', 'carousel', 'slide']; } public function get_styles() { return [ 'testimonial-carousel', 'animation', // hover animations 'entrance', // entrance basic style 'e-animations' => [ // entrance animations 'condition' => [ 'animation_assets' => 'false' ], 'external' => true, ] ]; } public function get_scripts() { return [ 'carousel', 'testimonial' => [ 'condition' => [ 'layout' => 'layout_5' ], ], 'entrance' => [ 'condition' => [ 'animate_items' => 'ui-e-grid-animate' ], ] ]; } protected function register_controls() { $this->register_testimonial_repeater_controls('Testimonial Carousel Items'); // Repeater Controls // Additional Carousel Controls $this->start_controls_section( 'section_review_additional_settings', [ 'label' => __('Additional Settings', 'uicore-elements'), 'tab' => Controls_Manager::TAB_CONTENT, ] ); $this->TRAIT_register_entrace_asset_helper(); // Animation asset condition $this->register_specific_testimonial_controls('layout'); if(!$this->is_slider){ $this->register_carousel_additional_controls(); // Carousel Additionals } $this->register_testimonial_additional_controls(); // Testimonial Additionals $this->end_controls_section(); $this->start_controls_section( 'section_carousel_settings', [ 'label' => __('Carousel Settings', 'uicore-elements'), ] ); $this->register_carousel_settings_controls($this->is_slider); // Carousel settings $this->end_controls_section(); $this->register_navigation_controls(); // Navigation settings $this->start_controls_section( 'section_style_review_items', [ 'label' => esc_html__( 'Items', 'uicore-elements' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); // move it to specific controls $this->add_control( 'item_gap', [ 'label' => esc_html__( 'Inner Content Spacing', 'uicore-elements' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%', 'em' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 50, 'step' => 1, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'default' => [ 'unit' => 'px', 'size' => 15, ], 'selectors' => [ '{{WRAPPER}} .ui-e-testimonial-flex' => 'margin-bottom: {{SIZE}}{{UNIT}};', ], 'conditions' => [ 'relation' => 'and', 'terms' => [ [ 'name' => 'image_inline', 'operator' => '===', 'value' => 'yes', ], [ 'name' => 'layout', 'operator' => 'in', 'value' => ['layout_2'], ], ], ], ] ); $this->register_all_carousel_item_style_controls(); $this->end_controls_section(); $this->register_style_controls(); // All Testimonial components styles $this->register_navigation_style_controls(); // Carousel Navigation Styles $this->start_controls_section( 'section_style_animations', [ 'label' => __('Animations', 'uicore-elements'), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->register_testimonial_animation_controls(); $this->end_controls_section(); } public function render() { $ID = $this->get_ID(); $settings = $this->get_settings_for_display(); $this->add_render_attribute('review-carousel', 'class', ['ui-e-carousel', "carousel-$ID"]); ?>