start_controls_section( 'adte_data_source_section', [ 'label' => esc_html__('Data Source', 'advanced-data-table-for-elementor'), 'tab' => Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'adte_data_source', [ 'label' => esc_html__('Source', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SELECT, 'options' => call_user_func(function () { $source = []; $source['static'] = __('Static Data', 'advanced-data-table-for-elementor'); $source['csv'] = __('CSV', 'advanced-data-table-for-elementor'); $source['user'] = __('WordPress Users', 'advanced-data-table-for-elementor'); $source['post'] = __('WordPress Posts', 'advanced-data-table-for-elementor'); $source['page'] = __('WordPress Pages', 'advanced-data-table-for-elementor'); return $source; }), 'default' => 'static', ] ); $this->add_control( 'adte_csv_type', [ 'label' => esc_html__('File Type', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SELECT, 'options' => [ 'file' => esc_html__('Upload File', 'advanced-data-table-for-elementor'), 'url' => esc_html__('Remote File URL', 'advanced-data-table-for-elementor'), ], 'default' => 'file', 'condition' => [ 'adte_data_source' => 'csv', ], ] ); $this->add_control( 'adte_csv_file', [ 'label' => esc_html__('Upload CSV File', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::MEDIA, 'media_type' => array(), 'condition' => [ 'adte_data_source' => 'csv', 'adte_csv_type' => 'file', ], 'dynamic' => [ 'active' => true, ] ] ); $this->add_control( 'adte_csv_url', [ 'label' => esc_html__('Enter a CSV File URL', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::URL, 'show_external' => false, 'label_block' => true, 'condition' => [ 'adte_data_source' => 'csv', 'adte_csv_type' => 'url' ], 'dynamic' => [ 'active' => true, ], ] ); $repeater_user = new Repeater(); $repeater_user->add_control( 'column_heading', [ 'label' => esc_html__('Column Heading', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::TEXT, 'default' => esc_html__('User Column', 'advanced-data-table-for-elementor'), 'label_block' => true, ] ); $repeater_user->add_control( 'user_field', [ 'label' => esc_html__('User Field', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SELECT, 'options' => [ 'first_name' => __('First Name', 'advanced-data-table-for-elementor'), 'last_name' => __('Last Name', 'advanced-data-table-for-elementor'), 'user_login' => __('Username', 'advanced-data-table-for-elementor'), 'profile_image' => __('Profile Image', 'advanced-data-table-for-elementor'), 'user_url' => __('Website URL', 'advanced-data-table-for-elementor'), 'description' => __('Bio', 'advanced-data-table-for-elementor'), 'user_email' => __('Email', 'advanced-data-table-for-elementor'), 'roles' => __('User Role', 'advanced-data-table-for-elementor'), ], 'default' => 'first_name', ] ); $repeater_user->add_control( 'advance', [ 'label' => __('Advance Settings', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SWITCHER, 'label_off' => __('No', 'advanced-data-table-for-elementor'), 'label_on' => __('Yes', 'advanced-data-table-for-elementor'), ] ); $repeater_user->add_control( 'customwidth', [ 'label' => __('Custom Width', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SWITCHER, 'condition' => [ 'advance' => 'yes', ], 'label_off' => __('No', 'advanced-data-table-for-elementor'), 'label_on' => __('Yes', 'advanced-data-table-for-elementor'), ] ); $repeater_user->add_responsive_control( 'width', [ 'label' => __('Width', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SLIDER, 'condition' => [ 'advance' => 'yes', 'customwidth' => 'yes', ], 'range' => [ '%' => [ 'min' => 0, 'max' => 100, ], 'px' => [ 'min' => 1, 'max' => 1000, ], ], 'devices' => ['desktop', 'tablet', 'mobile'], 'default' => [ 'size' => 30, 'unit' => '%', ], 'size_units' => ['%', 'px'], 'selectors' => [ '{{WRAPPER}} table.adte_table .adte_table_header tr th{{CURRENT_ITEM}}' => 'width: {{SIZE}}{{UNIT}};', '{{WRAPPER}} table.adte_table .adte_table_body tr td{{CURRENT_ITEM}}' => 'width: {{SIZE}}{{UNIT}};', ] ] ); $repeater_user->add_control( 'user_align', [ 'label' => __('Alignment', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => __('Left', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-h-align-left', ], 'center' => [ 'title' => __('Center', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-h-align-center', ], 'right' => [ 'title' => __('Right', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-h-align-right', ], 'justify' => [ 'title' => __('Justified', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-h-align-stretch', ], ], 'default' => '', 'selectors' => [ '{{WRAPPER}} table.adte_table .adte_table_header tr th{{CURRENT_ITEM}}' => 'text-align: {{VALUE}};', '{{WRAPPER}} table.adte_table .adte_table_body tr td{{CURRENT_ITEM}}' => 'text-align: {{VALUE}};', ], 'condition' => [ 'advance' => 'yes', ] ] ); $repeater_user->add_control( 'user_v_align', [ 'label' => __('Vertical Alignment', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'top' => [ 'title' => __('Top', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-v-align-top', ], 'middle' => [ 'title' => __('Middle', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-v-align-middle', ], 'bottom' => [ 'title' => __('Bottom', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-v-align-bottom', ], ], 'default' => '', 'selectors' => [ '{{WRAPPER}} table.adte_table .adte_table_header tr th{{CURRENT_ITEM}}' => 'vertical-align: {{VALUE}};', '{{WRAPPER}} table.adte_table .adte_table_body tr td{{CURRENT_ITEM}}' => 'vertical-align: {{VALUE}};', ], 'condition' => [ 'advance' => 'yes', ] ] ); $repeater_user->add_control( 'user_content_color', [ 'label' => __('Text Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} table.adte_table .adte_table_header tr th{{CURRENT_ITEM}}' => 'color: {{VALUE}};', '{{WRAPPER}} table.adte_table .adte_table_body tr td{{CURRENT_ITEM}}' => 'color: {{VALUE}};', ], 'condition' => [ 'advance' => 'yes', ] ] ); $repeater_user->add_control( 'user_content_bg', [ 'label' => __('Background Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} table.adte_table .adte_table_header tr th{{CURRENT_ITEM}}' => 'background-color: {{VALUE}};', '{{WRAPPER}} table.adte_table .adte_table_body tr td{{CURRENT_ITEM}}' => 'background-color: {{VALUE}};', ], 'condition' => [ 'advance' => 'yes', ] ] ); $this->add_control( 'adte_user_columns', [ 'label' => esc_html__('User Columns', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::REPEATER, 'fields' => $repeater_user->get_controls(), 'default' => [ [ 'column_heading' => __('First Name', 'advanced-data-table-for-elementor'), 'user_field' => 'first_name', ], [ 'column_heading' => __('Last Name', 'advanced-data-table-for-elementor'), 'user_field' => 'last_name', ], [ 'column_heading' => __('Email', 'advanced-data-table-for-elementor'), 'user_field' => 'user_email', ], ], 'title_field' => '{{{ column_heading }}}', 'condition' => [ 'adte_data_source' => 'user', ], ] ); $repeater_post = new Repeater(); $repeater_post->add_control( 'column_heading', [ 'label' => esc_html__('Column Heading', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::TEXT, 'default' => esc_html__('Post Column', 'advanced-data-table-for-elementor'), 'label_block' => true, ] ); $repeater_post->add_control( 'post_field', [ 'label' => esc_html__('Post Field', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SELECT, 'options' => [ 'post_title' => __('Title', 'advanced-data-table-for-elementor'), 'featured_image' => __('Featured Image', 'advanced-data-table-for-elementor'), 'post_excerpt' => __('Excerpt', 'advanced-data-table-for-elementor'), 'post_content' => __('Content', 'advanced-data-table-for-elementor'), 'permalink' => __('Permalink', 'advanced-data-table-for-elementor'), 'author' => __('Author', 'advanced-data-table-for-elementor'), 'post_date' => __('Date', 'advanced-data-table-for-elementor'), 'categories' => __('Categories', 'advanced-data-table-for-elementor'), 'tags' => __('Tags', 'advanced-data-table-for-elementor'), 'comment_count' => __('Comments', 'advanced-data-table-for-elementor'), 'post_status' => __('Status', 'advanced-data-table-for-elementor'), 'ID' => __('ID', 'advanced-data-table-for-elementor'), ], 'default' => 'post_title', ] ); $repeater_post->add_control( 'link_to_post', [ 'label' => __('Link to Post', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SWITCHER, 'label_off' => __('No', 'advanced-data-table-for-elementor'), 'label_on' => __('Yes', 'advanced-data-table-for-elementor'), 'condition' => [ 'post_field' => ['post_title', 'featured_image'], ], ] ); $repeater_post->add_control( 'advance', [ 'label' => __('Advance Settings', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SWITCHER, 'label_off' => __('No', 'advanced-data-table-for-elementor'), 'label_on' => __('Yes', 'advanced-data-table-for-elementor'), ] ); $repeater_post->add_control( 'customwidth', [ 'label' => __('Custom Width', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SWITCHER, 'condition' => [ 'advance' => 'yes', ], 'label_off' => __('No', 'advanced-data-table-for-elementor'), 'label_on' => __('Yes', 'advanced-data-table-for-elementor'), ] ); $repeater_post->add_responsive_control( 'width', [ 'label' => __('Width', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SLIDER, 'condition' => [ 'advance' => 'yes', 'customwidth' => 'yes', ], 'range' => [ '%' => [ 'min' => 0, 'max' => 100, ], 'px' => [ 'min' => 1, 'max' => 1000, ], ], 'devices' => ['desktop', 'tablet', 'mobile'], 'default' => [ 'size' => 30, 'unit' => '%', ], 'size_units' => ['%', 'px'], 'selectors' => [ '{{WRAPPER}} table.adte_table .adte_table_header tr th{{CURRENT_ITEM}}' => 'width: {{SIZE}}{{UNIT}};', '{{WRAPPER}} table.adte_table .adte_table_body tr td{{CURRENT_ITEM}}' => 'width: {{SIZE}}{{UNIT}};', ] ] ); $repeater_post->add_control( 'post_align', [ 'label' => __('Alignment', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => __('Left', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-h-align-left', ], 'center' => [ 'title' => __('Center', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-h-align-center', ], 'right' => [ 'title' => __('Right', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-h-align-right', ], 'justify' => [ 'title' => __('Justified', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-h-align-stretch', ], ], 'default' => '', 'selectors' => [ '{{WRAPPER}} table.adte_table .adte_table_header tr th{{CURRENT_ITEM}}' => 'text-align: {{VALUE}};', '{{WRAPPER}} table.adte_table .adte_table_body tr td{{CURRENT_ITEM}}' => 'text-align: {{VALUE}};', ], 'condition' => [ 'advance' => 'yes', ] ] ); $repeater_post->add_control( 'post_v_align', [ 'label' => __('Vertical Alignment', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'top' => [ 'title' => __('Top', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-v-align-top', ], 'middle' => [ 'title' => __('Middle', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-v-align-middle', ], 'bottom' => [ 'title' => __('Bottom', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-v-align-bottom', ], ], 'default' => '', 'selectors' => [ '{{WRAPPER}} table.adte_table .adte_table_header tr th{{CURRENT_ITEM}}' => 'vertical-align: {{VALUE}};', '{{WRAPPER}} table.adte_table .adte_table_body tr td{{CURRENT_ITEM}}' => 'vertical-align: {{VALUE}};', ], 'condition' => [ 'advance' => 'yes', ] ] ); $repeater_post->add_control( 'post_content_color', [ 'label' => __('Text Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} table.adte_table .adte_table_header tr th{{CURRENT_ITEM}}' => 'color: {{VALUE}};', '{{WRAPPER}} table.adte_table .adte_table_body tr td{{CURRENT_ITEM}}' => 'color: {{VALUE}};', ], 'condition' => [ 'advance' => 'yes', ] ] ); $repeater_post->add_control( 'post_content_bg', [ 'label' => __('Background Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} table.adte_table .adte_table_header tr th{{CURRENT_ITEM}}' => 'background-color: {{VALUE}};', '{{WRAPPER}} table.adte_table .adte_table_body tr td{{CURRENT_ITEM}}' => 'background-color: {{VALUE}};', ], 'condition' => [ 'advance' => 'yes', ] ] ); $this->add_control( 'adte_post_columns', [ 'label' => esc_html__('Post Columns', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::REPEATER, 'fields' => $repeater_post->get_controls(), 'default' => [ [ 'column_heading' => __('Title', 'advanced-data-table-for-elementor'), 'post_field' => 'post_title', ], [ 'column_heading' => __('Author', 'advanced-data-table-for-elementor'), 'post_field' => 'author', ], [ 'column_heading' => __('Date', 'advanced-data-table-for-elementor'), 'post_field' => 'post_date', ], [ 'column_heading' => __('Categories', 'advanced-data-table-for-elementor'), 'post_field' => 'categories', ], ], 'title_field' => '{{{ column_heading }}}', 'condition' => [ 'adte_data_source' => ['post', 'page'], ], ] ); $this->add_control( 'adte_posts_per_page', [ 'label' => __('Number of Items', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::NUMBER, 'default' => 10, 'min' => -1, 'max' => 500, 'description' => __('Maximum number of posts to show. Use -1 to show all.', 'advanced-data-table-for-elementor'), 'condition' => [ 'adte_data_source' => ['post', 'page'], ], 'separator' => 'before', ] ); $this->add_control( 'adte_orderby', [ 'label' => __('Order By', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SELECT, 'options' => [ 'date' => __('Date', 'advanced-data-table-for-elementor'), 'title' => __('Title', 'advanced-data-table-for-elementor'), 'modified' => __('Last Modified', 'advanced-data-table-for-elementor'), 'menu_order' => __('Menu Order', 'advanced-data-table-for-elementor'), 'comment_count' => __('Comment Count', 'advanced-data-table-for-elementor'), 'rand' => __('Random', 'advanced-data-table-for-elementor'), ], 'default' => 'date', 'condition' => [ 'adte_data_source' => ['post', 'page'], ], ] ); $this->add_control( 'adte_order', [ 'label' => __('Order', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SELECT, 'options' => [ 'DESC' => __('Descending', 'advanced-data-table-for-elementor'), 'ASC' => __('Ascending', 'advanced-data-table-for-elementor'), ], 'default' => 'DESC', 'condition' => [ 'adte_data_source' => ['post', 'page'], ], ] ); $this->end_controls_section(); $this->start_controls_section( 'adte_table_header_section', [ 'label' => esc_html__('Header', 'advanced-data-table-for-elementor'), 'tab' => Controls_Manager::TAB_CONTENT, 'condition' => [ 'adte_data_source' => 'static', ] ] ); $repeater_header = new Repeater(); $repeater_header->add_control( 'header_content_type', [ 'label' => esc_html__('Content Type/View', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::CHOOSE, 'default' => 'default', 'options' => [ 'default' => [ 'title' => esc_html__('Default', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-text', ], 'icon' => [ 'title' => esc_html__('Icon', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-check-circle', ], ], 'render_type' => 'template', 'classes' => 'elementor-control-start-end', 'style_transfer' => true, 'prefix_class' => 'elementor-icon-list--layout-', 'label_block' => true ] ); $repeater_header->add_control( 'text', [ 'label' => __('Text', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::TEXTAREA, 'label_block' => true, 'placeholder' => __('Table header', 'advanced-data-table-for-elementor'), 'default' => __('Table header', 'advanced-data-table-for-elementor'), 'dynamic' => [ 'active' => true, ], 'condition' => [ 'header_content_type' => 'default', ] ] ); $repeater_header->add_control( 'icon', [ 'label' => __('Icons', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::ICONS, 'label_block' => true, 'default' => [ 'value' => 'far fa-check-circle', 'library' => 'fa-solid', ], 'condition' => [ 'header_content_type' => 'icon', ] ] ); $repeater_header->add_control( 'icon_size', [ 'label' => __('Icon Size', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SLIDER, 'size_units' => ['px', '%', 'em', 'rem', 'custom'], 'range' => [ 'px' => [ 'min' => 0, 'max' => 300, 'step' => 1, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'default' => [ 'unit' => 'px', 'size' => 20, ], 'selectors' => [ '{{WRAPPER}} table.adte_table .adte_table_header tr {{CURRENT_ITEM}} i' => 'font-size: {{SIZE}}{{UNIT}};', '{{WRAPPER}} table.adte_table .adte_table_header tr {{CURRENT_ITEM}} svg' => 'width: {{SIZE}}{{UNIT}};', ], 'condition' => [ 'header_content_type' => 'icon', ] ] ); $repeater_header->add_control( 'advance', [ 'label' => __('Advance Settings', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SWITCHER, 'label_off' => __('No', 'advanced-data-table-for-elementor'), 'label_on' => __('Yes', 'advanced-data-table-for-elementor'), ] ); $repeater_header->add_control( 'col_span', [ 'label' => __('colSpan', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SWITCHER, 'condition' => [ 'advance' => 'yes', ], 'label_off' => __('No', 'advanced-data-table-for-elementor'), 'label_on' => __('Yes', 'advanced-data-table-for-elementor'), ] ); $repeater_header->add_control( 'col_span_number', [ 'label' => __('Col Span Number', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::NUMBER, 'condition' => [ 'advance' => 'yes', 'col_span' => 'yes', ], 'default' => __('1', 'advanced-data-table-for-elementor'), ] ); $repeater_header->add_control( 'customwidth', [ 'label' => __('Custom Width', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SWITCHER, 'condition' => [ 'advance' => 'yes', ], 'label_off' => __('No', 'advanced-data-table-for-elementor'), 'label_on' => __('Yes', 'advanced-data-table-for-elementor'), ] ); $repeater_header->add_responsive_control( 'width', [ 'label' => __('Width', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SLIDER, 'condition' => [ 'advance' => 'yes', 'customwidth' => 'yes', ], 'range' => [ '%' => [ 'min' => 0, 'max' => 100, ], 'px' => [ 'min' => 1, 'max' => 1000, ], ], 'devices' => ['desktop', 'tablet', 'mobile'], 'default' => [ 'size' => 30, 'unit' => '%', ], 'size_units' => ['%', 'px'], 'selectors' => [ '{{WRAPPER}} table.adte_table .adte_table_header tr {{CURRENT_ITEM}}' => 'width: {{SIZE}}{{UNIT}};', ] ] ); $repeater_header->add_control( 'header_align', [ 'label' => __('Alignment', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => __('Left', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-h-align-left', ], 'center' => [ 'title' => __('Center', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-h-align-center', ], 'right' => [ 'title' => __('Right', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-h-align-right', ], 'justify' => [ 'title' => __('Justified', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-h-align-stretch', ], ], 'default' => '', 'selectors' => [ '{{WRAPPER}} table.adte_table .adte_table_header tr {{CURRENT_ITEM}}' => 'text-align: {{VALUE}};', ], 'condition' => [ 'advance' => 'yes', ] ] ); $repeater_header->add_control( 'header_v_align', [ 'label' => __('Vertical Alignment', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'top' => [ 'title' => __('Top', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-v-align-top', ], 'middle' => [ 'title' => __('Middle', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-v-align-middle', ], 'bottom' => [ 'title' => __('Bottom', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-v-align-bottom', ], ], 'default' => '', 'selectors' => [ '{{WRAPPER}} table.adte_table .adte_table_header tr {{CURRENT_ITEM}}' => 'vertical-align: {{VALUE}};', ], 'condition' => [ 'advance' => 'yes', ] ] ); $repeater_header->add_control( 'header_content_color', [ 'label' => __('Text Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} table.adte_table .adte_table_header tr {{CURRENT_ITEM}}' => 'color: {{VALUE}};', ], 'condition' => [ 'advance' => 'yes', ] ] ); $repeater_header->add_control( 'header_content_bg', [ 'label' => __('Background Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} table.adte_table .adte_table_header tr {{CURRENT_ITEM}}' => 'background-color: {{VALUE}};', ], 'condition' => [ 'advance' => 'yes', ] ] ); $this->add_control( 'table_header', [ 'label' => __('Table Header Cell', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::REPEATER, 'fields' => $repeater_header->get_controls(), 'default' => [ [ 'text' => __('Name', 'advanced-data-table-for-elementor'), ], [ 'text' => __('Age', 'advanced-data-table-for-elementor'), ], [ 'text' => __('Country', 'advanced-data-table-for-elementor'), ], [ 'text' => __('Occupation', 'advanced-data-table-for-elementor'), ] ], 'title_field' => '{{{ text }}}' ] ); $this->end_controls_section(); $this->start_controls_section( 'table_body_section', [ 'label' => __('Body', 'advanced-data-table-for-elementor'), 'tab' => Controls_Manager::TAB_CONTENT, 'condition' => [ 'adte_data_source' => 'static', ] ] ); $repeater_body = new Repeater(); $repeater_body->add_control( 'adte_table_row', [ 'label' => __('New Row', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SWITCHER, 'label_off' => __('No', 'advanced-data-table-for-elementor'), 'label_on' => __('Yes', 'advanced-data-table-for-elementor'), 'return_value' => esc_html__('Row', 'advanced-data-table-for-elementor'), ] ); $repeater_body->add_control( 'body_content_type', [ 'label' => esc_html__('Content Type/View', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::CHOOSE, 'default' => 'default', 'options' => [ 'default' => [ 'title' => esc_html__('Default', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-text', ], 'editor' => [ 'title' => esc_html__('Editor', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-editor-paragraph', ], 'icon' => [ 'title' => esc_html__('Icon', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-check-circle', ], 'image' => [ 'title' => esc_html__('Image', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-image', ], 'button' => [ 'title' => esc_html__('Button', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-button', ], ], 'render_type' => 'template', 'classes' => 'elementor-control-start-end', 'style_transfer' => true, 'prefix_class' => 'elementor-icon-list--layout-', 'label_block' => true, 'separator' => 'before', ] ); $repeater_body->add_control( 'text', [ 'label' => __('Text', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::TEXTAREA, 'label_block' => true, 'placeholder' => __('Table Data', 'advanced-data-table-for-elementor'), 'default' => __('Table Data', 'advanced-data-table-for-elementor'), 'dynamic' => [ 'active' => true, ], 'condition' => [ 'body_content_type' => 'default', ] ] ); $repeater_body->add_control( 'text_editor', [ 'label' => __('Editor', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::WYSIWYG, 'label_block' => true, 'placeholder' => __('Table Data', 'advanced-data-table-for-elementor'), 'default' => __('Table Data', 'advanced-data-table-for-elementor'), 'dynamic' => [ 'active' => true, ], 'condition' => [ 'body_content_type' => 'editor', ] ] ); //Icon box $repeater_body->add_control( 'icon', [ 'label' => __('Icons', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::ICONS, 'label_block' => true, 'default' => [ 'value' => 'far fa-check-circle', 'library' => 'fa-solid', ], 'condition' => [ 'body_content_type' => 'icon', ] ] ); //Image box $repeater_body->add_control( 'adte_image', [ 'label' => __('Image', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::MEDIA, 'label_block' => true, 'condition' => [ 'body_content_type' => 'image', ] ] ); $repeater_body->add_control( 'image_settings', [ 'label' => __('Image Settings', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SWITCHER, 'label_off' => __('No', 'advanced-data-table-for-elementor'), 'label_on' => __('Yes', 'advanced-data-table-for-elementor'), 'condition' => [ 'body_content_type' => 'image', ] ] ); $repeater_body->add_control( 'image_width', [ 'label' => esc_html__('Image Width', 'advanced-data-table-for-elementor'), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => ['px', '%'], 'range' => [ 'px' => [ 'min' => 10, 'max' => 500, 'step' => 1, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'default' => [ 'unit' => 'px', 'size' => 80, ], 'selectors' => [ '{{WRAPPER}} table.adte_table tr {{CURRENT_ITEM}} img' => 'width: {{SIZE}}{{UNIT}};', ], 'condition' => [ 'image_settings' => 'yes', ] ] ); $repeater_body->add_control( 'image_height', [ 'label' => esc_html__('Image Height', 'advanced-data-table-for-elementor'), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => ['px', '%'], 'range' => [ 'px' => [ 'min' => 10, 'max' => 500, 'step' => 1, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'default' => [ 'unit' => '%', 'size' => 100, ], 'selectors' => [ '{{WRAPPER}} table.adte_table tr {{CURRENT_ITEM}} img' => 'height: {{SIZE}}{{UNIT}};', ], 'condition' => [ 'image_settings' => 'yes', ] ] ); //body button $repeater_body->add_control( 'button_text', [ 'label' => __('Button Text', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::TEXT, 'label_block' => false, 'dynamic' => [ // This enables the Dynamic Tags wrench icon 'active' => true, ], 'condition' => [ 'body_content_type' => 'button', ], 'default' => __('Read More', 'advanced-data-table-for-elementor'), ] ); $repeater_body->add_control( 'button_link', [ 'label' => __('Button Link', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::URL, 'label_block' => true, 'dynamic' => [ // This enables the Dynamic Tags wrench icon 'active' => true, ], 'condition' => [ 'body_content_type' => 'button', ], 'default' => [ 'url' => '#', 'is_external' => true, 'nofollow' => true, ], ] ); $repeater_body->add_control( 'button_id', [ 'label' => __('Button ID', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::TEXT, 'label_block' => false, 'condition' => [ 'body_content_type' => 'button', ] ] ); //Advanced column settings $repeater_body->add_control( 'advance', [ 'label' => __('Advance Settings', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SWITCHER, 'label_off' => __('No', 'advanced-data-table-for-elementor'), 'label_on' => __('Yes', 'advanced-data-table-for-elementor'), ] ); $repeater_body->add_control( 'col_span', [ 'label' => __('colSpan', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SWITCHER, 'condition' => [ 'advance' => 'yes', ], 'label_off' => __('No', 'advanced-data-table-for-elementor'), 'label_on' => __('Yes', 'advanced-data-table-for-elementor'), ] ); $repeater_body->add_control( 'col_span_number', [ 'label' => __('Col Span Number', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::NUMBER, 'condition' => [ 'advance' => 'yes', 'col_span' => 'yes', ], 'placeholder' => __('1', 'advanced-data-table-for-elementor'), 'default' => __('1', 'advanced-data-table-for-elementor'), ] ); $repeater_body->add_control( 'row_span', [ 'label' => __('rowSpan', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SWITCHER, 'condition' => [ 'advance' => 'yes', ], 'label_off' => __('No', 'advanced-data-table-for-elementor'), 'label_on' => __('Yes', 'advanced-data-table-for-elementor'), ] ); $repeater_body->add_control( 'row_span_number', [ 'label' => __('Row Span Number', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::NUMBER, 'condition' => [ 'advance' => 'yes', 'row_span' => 'yes', ], 'placeholder' => __('1', 'advanced-data-table-for-elementor'), 'default' => __('1', 'advanced-data-table-for-elementor'), ] ); $repeater_body->add_responsive_control( 'row_align', [ 'label' => __('Alignment', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => __('Left', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-h-align-left', ], 'center' => [ 'title' => __('Center', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-h-align-center', ], 'right' => [ 'title' => __('Right', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-h-align-right', ], 'justify' => [ 'title' => __('Justified', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-h-align-stretch', ], ], 'selectors' => [ '{{WRAPPER}} table.adte_table .adte_table_body tr {{CURRENT_ITEM}}' => 'text-align: {{VALUE}};', ], 'condition' => [ 'advance' => 'yes', ] ] ); $repeater_body->add_responsive_control( 'body_v_align', [ 'label' => __('Vertical Alignment', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'top' => [ 'title' => __('Top', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-v-align-top', ], 'middle' => [ 'title' => __('Middle', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-v-align-middle', ], 'bottom' => [ 'title' => __('Bottom', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-v-align-bottom', ], ], 'default' => '', 'selectors' => [ '{{WRAPPER}} table.adte_table .adte_table_body tr {{CURRENT_ITEM}}' => 'vertical-align: {{VALUE}};', ], 'condition' => [ 'advance' => 'yes', ] ] ); $repeater_body->add_control( 'body_content_color', [ 'label' => __('Text Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} table.adte_table .adte_table_body tr {{CURRENT_ITEM}}' => 'color: {{VALUE}};', '{{WRAPPER}} table.adte_table .adte_table_body tr {{CURRENT_ITEM}} i' => 'color: {{VALUE}};', '{{WRAPPER}} table.adte_table .adte_table_body tr {{CURRENT_ITEM}} svg' => 'fill: {{VALUE}};', ], 'condition' => [ 'advance' => 'yes', ] ] ); $repeater_body->add_control( 'body_content_bg', [ 'label' => __('Background Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} table.adte_table .adte_table_body tr {{CURRENT_ITEM}}' => 'background-color: {{VALUE}};', ], 'condition' => [ 'advance' => 'yes', ] ] ); $repeater_body->add_control( 'adte_repeater_icon_size', [ 'label' => __('Icon Size', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SLIDER, 'size_units' => ['px', '%', 'em', 'rem', 'custom'], 'range' => [ 'px' => [ 'min' => 0, 'max' => 300, 'step' => 1, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'default' => [ 'unit' => 'px' ], 'selectors' => [ '{{WRAPPER}} table.adte_table .adte_table_body tr {{CURRENT_ITEM}} i' => 'font-size: {{SIZE}}{{UNIT}};', '{{WRAPPER}} table.adte_table .adte_table_body tr {{CURRENT_ITEM}} svg' => 'height: {{SIZE}}{{UNIT}};width: {{SIZE}}{{UNIT}};', ], 'condition' => [ 'body_content_type' => 'icon', 'advance' => 'yes', ] ] ); $this->add_control( 'table_body', [ 'label' => __('Table Body Cell', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::REPEATER, 'fields' => $repeater_body->get_controls(), 'default' => [ [ 'adte_table_row' => 'Row', 'text' => __('John Doe', 'advanced-data-table-for-elementor'), ], [ 'text' => __('28', 'advanced-data-table-for-elementor'), ], [ 'text' => __('USA', 'advanced-data-table-for-elementor'), ], [ 'text' => __('Software Engineer', 'advanced-data-table-for-elementor'), ], [ 'adte_table_row' => 'Row', 'text' => __('John Smith', 'advanced-data-table-for-elementor'), ], [ 'text' => __('32', 'advanced-data-table-for-elementor'), ], [ 'text' => __('UK', 'advanced-data-table-for-elementor'), ], [ 'text' => __('Graphic Engineer', 'advanced-data-table-for-elementor'), ], ], 'title_field' => '{{{ adte_table_row }}}{{ adte_table_row ? " - " : "" }}{{{ text }}}', ] ); $this->end_controls_section(); /** * Advanced Section * This section is for search filter, pagination, and other advanced settings. */ $this->start_controls_section( 'adte_table_settings', [ 'label' => __('Settings ', 'advanced-data-table-for-elementor'), 'tab' => Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'adte_static_data_notice', [ 'type' => Controls_Manager::NOTICE, 'notice_type' => 'warning', 'dismissible' => false, 'heading' => esc_html__('Advanced Settings Limitation', 'advanced-data-table-for-elementor'), 'content' => esc_html__('When using Advanced Table Settings, the colspan and rowspan features are not supported in static data tables.', 'advanced-data-table-for-elementor'), 'condition' => [ 'adte_enable_advanced_settings' => '', 'adte_data_source' => 'static' ] ] ); $this->add_control( 'adte_enable_advanced_settings', [ 'label' => __('Enable Advanced Settings', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SWITCHER, 'label_on' => __('Yes', 'advanced-data-table-for-elementor'), 'label_off' => __('No', 'advanced-data-table-for-elementor'), 'return_value' => 'yes', 'default' => '', ], ); $this->add_control( 'adte_enable_sort', [ 'label' => __('Sort', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SWITCHER, 'label_on' => __('Yes', 'advanced-data-table-for-elementor'), 'label_off' => __('No', 'advanced-data-table-for-elementor'), 'return_value' => 'yes', 'default' => '', 'condition' => [ 'adte_enable_advanced_settings' => 'yes', ] ] ); $this->add_control( 'adte_show_search', [ 'label' => __('Search', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SWITCHER, 'label_on' => __('Yes', 'advanced-data-table-for-elementor'), 'label_off' => __('No', 'advanced-data-table-for-elementor'), 'return_value' => 'yes', 'default' => '', 'condition' => [ 'adte_enable_advanced_settings' => 'yes', ], ] ); $this->add_control( 'adte_search_placeholder_text', [ 'label' => __('Placeholder', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::TEXT, 'default' => __('Search...', 'advanced-data-table-for-elementor'), 'condition' => [ 'adte_show_search' => 'yes', 'adte_enable_advanced_settings' => 'yes', ], 'label_block' => false ] ); $this->add_control( 'adte_enable_pagination', [ 'label' => __('Pagination', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SWITCHER, 'label_on' => __('Yes', 'advanced-data-table-for-elementor'), 'label_off' => __('No', 'advanced-data-table-for-elementor'), 'return_value' => 'yes', 'default' => '', 'condition' => [ 'adte_enable_advanced_settings' => 'yes', ], ] ); $this->add_control( 'adte_pagination_type', [ 'label' => esc_html__('Pagination Type', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SELECT, 'default' => 'icon', 'options' => [ 'icon' => esc_html__('Icon', 'advanced-data-table-for-elementor'), 'text' => esc_html__('Text', 'advanced-data-table-for-elementor'), ], 'condition' => [ 'adte_enable_advanced_settings' => 'yes', 'adte_enable_pagination' => 'yes' ], ] ); $this->add_control( 'adte_pagination_next_text', [ 'label' => esc_html__('Next Button Text', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::TEXT, 'default' => esc_html__('Next', 'advanced-data-table-for-elementor'), 'condition' => [ 'adte_pagination_type' => 'text', 'adte_enable_pagination' => 'yes' ] ] ); $this->add_control( 'adte_pagination_prev_text', [ 'label' => esc_html__('Previous Button Text', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::TEXT, 'default' => esc_html__('Prev', 'advanced-data-table-for-elementor'), 'condition' => [ 'adte_pagination_type' => 'text', 'adte_enable_pagination' => 'yes' ] ] ); $this->add_control( 'adte_show_rows_per_page', [ 'label' => __('Rows Per Page', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::NUMBER, 'default' => '10', 'min' => 1, 'max' => 100, 'step' => 1, 'condition' => [ 'adte_enable_pagination' => 'yes', 'adte_enable_advanced_settings' => 'yes', ], 'separator' => 'after' ] ); $this->add_control( 'adte_show_info', [ 'label' => __('Info', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SWITCHER, 'label_on' => __('Yes', 'advanced-data-table-for-elementor'), 'label_off' => __('No', 'advanced-data-table-for-elementor'), 'return_value' => 'yes', 'default' => '', 'condition' => [ 'adte_enable_advanced_settings' => 'yes', ], ] ); $this->add_control( 'adte_show_entries', [ 'label' => __('Entries', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SWITCHER, 'label_on' => __('Yes', 'advanced-data-table-for-elementor'), 'label_off' => __('No', 'advanced-data-table-for-elementor'), 'return_value' => 'yes', 'default' => '', 'condition' => [ 'adte_enable_advanced_settings' => 'yes', ], ] ); $this->add_control( 'adte_show_buttons', [ 'label' => __('Export Buttons', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SWITCHER, 'label_on' => __('Yes', 'advanced-data-table-for-elementor'), 'label_off' => __('No', 'advanced-data-table-for-elementor'), 'return_value' => 'yes', 'default' => '', 'condition' => [ 'adte_enable_advanced_settings' => 'yes', 'adte_show_entries' => '', ], ] ); $this->add_control( 'adte_enable_responsive', [ 'label' => __('Responsive', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SWITCHER, 'label_on' => __('Yes', 'advanced-data-table-for-elementor'), 'label_off' => __('No', 'advanced-data-table-for-elementor'), 'return_value' => 'yes', 'default' => '', 'condition' => [ 'adte_enable_advanced_settings' => 'yes', ] ] ); $this->end_controls_section(); /** * Table Style Section */ $this->start_controls_section( 'adte_table_style', [ 'label' => __('Table', 'advanced-data-table-for-elementor'), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'adte_border', 'label' => __('Border', 'advanced-data-table-for-elementor'), 'selector' => '{{WRAPPER}} .adte_table_wrapper table.adte_table', ] ); $this->add_responsive_control( 'adte_table_margin', [ 'label' => __('Margin', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%', 'em'], 'selectors' => [ '{{WRAPPER}} table.adte_table' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'adte_box_shadow', 'label' => __('Box Shadow', 'advanced-data-table-for-elementor'), 'selector' => '{{WRAPPER}} table.adte_table', ] ); $this->add_control( 'adte_border_type', [ 'label' => __('Border Type', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SELECT, 'options' => [ 'collapse' => __('Collapse', 'advanced-data-table-for-elementor'), 'separate' => __('separate', 'advanced-data-table-for-elementor'), ], 'default' => 'collapse', 'selectors' => [ '{{WRAPPER}} table.adte_table' => 'border-collapse: {{VALUE}};', ], ] ); $this->add_control( 'adte_popover_toggle', [ 'label' => esc_html__('Border Spacing', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::POPOVER_TOGGLE, 'label_off' => esc_html__('Default', 'advanced-data-table-for-elementor'), 'label_on' => esc_html__('Custom', 'advanced-data-table-for-elementor'), 'return_value' => 'yes', 'condition' => [ 'adte_border_type' => 'separate', ], ] ); $this->start_popover(); $this->add_control( 'adte_border_spacing', [ 'label' => esc_html__('Spacing', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SLIDER, 'size_units' => ['px'], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, 'step' => 1, ], ], 'default' => [ 'unit' => 'px', 'size' => 5, ], 'selectors' => [ '{{WRAPPER}} table.adte_table' => 'border-spacing: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'adte_border_cell_radius', [ 'label' => __('Border Radius', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em'], 'selectors' => [ '{{WRAPPER}} table.adte_table td, {{WRAPPER}} table.adte_table th' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'condition' => [ 'adte_border_type' => 'separate', ], ] ); $this->end_popover(); $this->end_controls_section(); $this->start_controls_section( 'adte_header', [ 'label' => __('Header', 'advanced-data-table-for-elementor'), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'label' => __('Typography', 'advanced-data-table-for-elementor'), 'name' => 'header_typography', 'selector' => '{{WRAPPER}} table.adte_table .adte_table_header tr th', ] ); $this->add_responsive_control( 'adte_header_align', [ 'label' => __('Alignment', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => __('Left', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-h-align-left', ], 'center' => [ 'title' => __('Center', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-h-align-center', ], 'right' => [ 'title' => __('Right', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-h-align-right', ], 'justify' => [ 'title' => __('Justified', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-h-align-stretch', ], ], 'default' => 'center', 'selectors' => [ '{{WRAPPER}} table.adte_table .adte_table_header tr th' => 'text-align: {{VALUE}};', ], ] ); $this->add_responsive_control( 'adte_header_vertical_align', [ 'label' => __('Vertical Alignment', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'top' => [ 'title' => __('Top', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-v-align-top', ], 'middle' => [ 'title' => __('Middle', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-v-align-middle', ], 'bottom' => [ 'title' => __('Bottom', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-v-align-bottom', ], ], 'selectors' => [ '{{WRAPPER}} table.adte_table .adte_table_header tr th' => 'vertical-align: {{VALUE}};', ], ] ); $this->add_control( 'adte_header_text_color', [ 'label' => __('Text Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} table.adte_table .adte_table_header tr th' => 'color: {{VALUE}};', ], 'default' => '#ffffff' ] ); $this->add_control( 'adte_header_bg_color', [ 'label' => __('Background Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} table.adte_table .adte_table_header tr th' => 'background-color: {{VALUE}};', ], 'default' => '#0077FF' ] ); $this->add_responsive_control( 'adte_header_padding', [ 'label' => __('Padding', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%', 'em'], 'selectors' => [ '{{WRAPPER}} table.adte_table th' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'adte_header_border', 'label' => __('Border', 'advanced-data-table-for-elementor'), 'selector' => '{{WRAPPER}} table.adte_table thead th', ] ); $this->end_controls_section(); $this->start_controls_section( 'adte_table_body', [ 'label' => __('Body', 'advanced-data-table-for-elementor'), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'adte_body_typography', 'selector' => '{{WRAPPER}} table.adte_table .adte_table_body', 'global' => [ 'default' => \Elementor\Core\Kits\Documents\Tabs\Global_Typography::TYPOGRAPHY_TEXT, ], ] ); $this->add_responsive_control( 'adte_body_align', [ 'label' => __('Alignment', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => __('Left', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-h-align-left', ], 'center' => [ 'title' => __('Center', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-h-align-center', ], 'right' => [ 'title' => __('Right', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-h-align-right', ], 'justify' => [ 'title' => __('Justified', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-h-align-stretch', ], ], 'default' => 'center', 'selectors' => [ '{{WRAPPER}} table.adte_table .adte_table_body tr td' => 'text-align: {{VALUE}};', ], ] ); $this->add_responsive_control( 'adte_body_vertical_align', [ 'label' => __('Vertical Alignment', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'top' => [ 'title' => __('Top', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-v-align-top', ], 'middle' => [ 'title' => __('Middle', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-v-align-middle', ], 'bottom' => [ 'title' => __('Bottom', 'advanced-data-table-for-elementor'), 'icon' => 'eicon-v-align-bottom', ], ], 'selectors' => [ '{{WRAPPER}} table.adte_table .adte_table_body tr td' => 'vertical-align: {{VALUE}};', ], ] ); $this->add_control( 'adte_body_text_color', [ 'label' => __('Text Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} table.adte_table .adte_table_body tr td' => 'color: {{VALUE}};', ] ] ); $this->add_control( 'adte_body_bg_color', [ 'label' => __('Background Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} table.adte_table .adte_table_body tr td' => 'background-color: {{VALUE}};', ] ] ); $this->add_control( 'adte_body_highlight', [ 'label' => esc_html__('Highlight', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SELECT, 'options' => [ 'none' => esc_html__('None', 'advanced-data-table-for-elementor'), 'first-col' => esc_html__('First Column', 'advanced-data-table-for-elementor'), 'last-col' => esc_html__('Last Column', 'advanced-data-table-for-elementor'), 'even-col' => esc_html__('Even Column', 'advanced-data-table-for-elementor'), 'odd-col' => esc_html__('Odd Column', 'advanced-data-table-for-elementor'), 'even-row' => esc_html__('Even Row', 'advanced-data-table-for-elementor'), 'odd-row' => esc_html__('Odd Row', 'advanced-data-table-for-elementor'), ], 'default' => 'none', ] ); $this->add_control( 'adte_body_first_col_highlight_color', [ 'label' => __('Text Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'default' => '#444444', 'selectors' => [ '{{WRAPPER}} tbody td:first-child' => 'color: {{VALUE}}', ], 'condition' => [ 'adte_body_highlight' => 'first-col', ], ] ); $this->add_control( 'adte_body_first_col_highlight_background', [ 'label' => __('Background Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'default' => '#fbfbfb', 'selectors' => [ '{{WRAPPER}} tbody td:first-child' => 'background-color: {{VALUE}} !important', ], 'condition' => [ 'adte_body_highlight' => 'first-col', ], ] ); $this->add_control( 'adte_body_last_col_highlight_color', [ 'label' => __('Text Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'default' => '#444444', 'selectors' => [ '{{WRAPPER}} tbody td:last-child' => 'color: {{VALUE}}', ], 'condition' => [ 'adte_body_highlight' => 'last-col', ], ] ); $this->add_control( 'adte_body_last_col_highlight_background', [ 'label' => __('Background Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'default' => '#fbfbfb', 'selectors' => [ '{{WRAPPER}} tbody td:last-child' => 'background-color: {{VALUE}} !important', ], 'condition' => [ 'adte_body_highlight' => 'last-col', ], ] ); // even col $this->add_control( 'adte_body_even_col_highlight_color', [ 'label' => __('Text Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'default' => '#444444', 'selectors' => [ '{{WRAPPER}} tbody td:nth-child(even)' => 'color: {{VALUE}}', ], 'condition' => [ 'adte_body_highlight' => 'even-col', ], ] ); $this->add_control( 'adte_body_even_col_highlight_background', [ 'label' => __('Background Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'default' => '#fbfbfb', 'selectors' => [ '{{WRAPPER}} tbody td:nth-child(even)' => 'background-color: {{VALUE}} !important', ], 'condition' => [ 'adte_body_highlight' => 'even-col', ], ] ); // odd col $this->add_control( 'adte_body_odd_col_highlight_color', [ 'label' => __('Text Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'default' => '#444444', 'selectors' => [ '{{WRAPPER}} tbody td:nth-child(odd)' => 'color: {{VALUE}}', ], 'condition' => [ 'adte_body_highlight' => 'odd-col', ], ] ); $this->add_control( 'adte_body_odd_col_highlight_background', [ 'label' => __('Background Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'default' => '#fbfbfb', 'selectors' => [ '{{WRAPPER}} tbody td:nth-child(odd)' => 'background-color: {{VALUE}} !important', ], 'condition' => [ 'adte_body_highlight' => 'odd-col', ], ] ); // even row $this->add_control( 'adte_body_even_row_highlight_color', [ 'label' => __('Text Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'default' => '#444444', 'selectors' => [ '{{WRAPPER}} tbody tr:nth-child(even)' => 'color: {{VALUE}}', '{{WRAPPER}} tbody tr:nth-child(even) td' => 'color: {{VALUE}}', ], 'condition' => [ 'adte_body_highlight' => 'even-row', ], ] ); $this->add_control( 'adte_body_even_row_highlight_background', [ 'label' => __('Background Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'default' => '#fbfbfb', 'selectors' => [ '{{WRAPPER}} tbody tr:nth-child(even) td' => 'background-color: {{VALUE}} !important', ], 'condition' => [ 'adte_body_highlight' => 'even-row', ], ] ); // odd row $this->add_control( 'adte_body_odd_row_highlight_color', [ 'label' => __('Text Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'default' => '#444444', 'selectors' => [ '{{WRAPPER}} tbody tr:nth-child(odd)' => 'color: {{VALUE}}', '{{WRAPPER}} tbody tr:nth-child(odd) td' => 'color: {{VALUE}}', ], 'condition' => [ 'adte_body_highlight' => 'odd-row', ], ] ); $this->add_control( 'adte_body_odd_row_highlight_background', [ 'label' => __('Background Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'default' => '#fbfbfb', 'selectors' => [ '{{WRAPPER}} table.adte_table tbody.adte_table_body tr:nth-child(odd) td' => 'background-color: {{VALUE}} !important', ], 'condition' => [ 'adte_body_highlight' => 'odd-row', ], ] ); $this->add_responsive_control( 'adte_body_padding', [ 'label' => __('Padding', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%', 'em'], 'default' => [ 'top' => '15', 'right' => '15', 'bottom' => '15', 'left' => '15', 'unit' => 'px', 'isLinked' => true, ], 'selectors' => [ '{{WRAPPER}} table.adte_table td,{{WRAPPER}} table.adte_table th' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'adte_border_border', 'label' => __('Border', 'advanced-data-table-for-elementor'), 'selector' => '{{WRAPPER}} table.adte_table .adte_table_body td', ] ); $this->end_controls_section(); $this->start_controls_section( 'adte_icon_section', [ 'label' => __('Icon', 'advanced-data-table-for-elementor'), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'adte_icon_size', [ 'label' => __('Icon Size', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SLIDER, 'size_units' => ['px', '%'], 'range' => [ 'px' => [ 'min' => 0, 'max' => 300, 'step' => 1, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'default' => [ 'unit' => 'px', 'size' => 16, ], 'selectors' => [ '{{WRAPPER}} table.adte_table tr td i' => 'font-size: {{SIZE}}{{UNIT}};', '{{WRAPPER}} table.adte_table tr td svg' => 'height: {{SIZE}}{{UNIT}};width: {{SIZE}}{{UNIT}};', ] ] ); $this->add_control( 'adte_icon_color', [ 'label' => __('Icon Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} table.adte_table .adte_table_body tr td i' => 'color: {{VALUE}};', '{{WRAPPER}} table.adte_table .adte_table_body tr td svg' => 'color: {{VALUE}}; fill: {{VALUE}};', ] ] ); $this->end_controls_section(); //Buttons Section $this->start_controls_section( 'adte_buttons_style_section', [ 'label' => esc_html__('Export Buttons', 'advanced-data-table-for-elementor'), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'adte_show_buttons' => 'yes', 'adte_enable_advanced_settings' => 'yes' ] ] ); $this->add_responsive_control( 'adte_buttons_gap', array( 'label' => esc_html__('Gap', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SLIDER, 'size_units' => array( 'px', 'em' ), 'range' => array( 'px' => array( 'min' => 1, 'max' => 100, ), ), 'default' => array( 'size' => 8, 'unit' => 'px', ), 'selectors' => array( '{{WRAPPER}} .adte_search_wrap .dt-buttons' => 'gap: {{SIZE}}{{UNIT}}', ), ) ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'adte_buttons_typography', 'label' => esc_html__('Typography', 'advanced-data-table-for-elementor'), 'selector' => '{{WRAPPER}} .adte_search_wrap .dt-buttons .dt-button', ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'adte_buttons_border', 'label' => esc_html__('Border', 'advanced-data-table-for-elementor'), 'selector' => '{{WRAPPER}} .adte_search_wrap .dt-buttons .dt-button', 'fields_options' => [ 'border' => [ 'default' => 'solid', ], 'width' => [ 'default' => [ 'top' => '1', 'right' => '1', 'bottom' => '1', 'left' => '1', 'unit' => 'px', 'isLinked' => true, ], ], 'color' => [ 'default' => 'rgba(124, 90, 247, .3)', ], ], ] ); $this->add_responsive_control( 'adte_buttons_padding', [ 'label' => __('Padding', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%', 'em'], 'selectors' => [ '{{WRAPPER}} .adte_search_wrap .dt-buttons .dt-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'default' => [ 'top' => '10', 'right' => '20', 'bottom' => '10', 'left' => '20', 'unit' => 'px', 'isLinked' => true, ], ] ); $this->add_responsive_control( 'adte_buttons_border_radius', [ 'label' => __('Border Radius', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%', 'em'], 'selectors' => [ '{{WRAPPER}} .adte_search_wrap .dt-buttons .dt-button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->start_controls_tabs( 'adte_buttons_style_tabs' ); $this->start_controls_tab( 'adte_buttons_normal_tab', [ 'label' => esc_html__('Normal', 'advanced-data-table-for-elementor') ] ); $this->add_control( 'adte_buttons_normal_text_color', [ 'label' => esc_html__('Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .adte_search_wrap .dt-buttons .dt-button' => 'color: {{VALUE}};', ], 'default' => '#565656' ] ); $this->add_control( 'adte_buttons_normal_bg_color', [ 'label' => esc_html__('Background Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .adte_search_wrap .dt-buttons .dt-button' => 'background-color: {{VALUE}};', ], 'default' => '#ffffff' ] ); $this->end_controls_tab(); $this->start_controls_tab( 'adte_buttons_hover_tab', [ 'label' => esc_html__('Hover', 'advanced-data-table-for-elementor') ] ); $this->add_control( 'adte_buttons_hover_text_color', [ 'label' => esc_html__('Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .adte_search_wrap .dt-buttons .dt-button:hover' => 'color: {{VALUE}};', ], 'default' => '#555555' ] ); $this->add_control( 'adte_buttons_hover_bg_color', [ 'label' => esc_html__('Background Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .adte_search_wrap .dt-buttons .dt-button:hover' => 'background-color: {{VALUE}};', ], 'default' => 'rgba(124, 90, 247, .1)' ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->end_controls_section(); // Image style section $this->start_controls_section( 'adte_image_section', [ 'label' => __('Image', 'advanced-data-table-for-elementor'), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( \Elementor\Group_Control_Image_Size::get_type(), [ 'name' => 'adte_image_size', // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude 'exclude' => ['custom'], 'include' => [], 'default' => 'large', ] ); $this->add_control( 'adte_image_width', [ 'label' => esc_html__('Image Width', 'advanced-data-table-for-elementor'), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => ['px', '%'], 'range' => [ 'px' => [ 'min' => 10, 'max' => 500, 'step' => 1, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'default' => [ 'unit' => 'px', 'size' => 80, ], 'selectors' => [ '{{WRAPPER}} table.adte_table tr td img' => 'width: {{SIZE}}{{UNIT}};', ] ] ); $this->add_control( 'adte_image_height', [ 'label' => esc_html__('Image Height', 'advanced-data-table-for-elementor'), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => ['px', '%'], 'range' => [ 'px' => [ 'min' => 10, 'max' => 500, 'step' => 1, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'default' => [ 'unit' => '%', 'size' => 100, ], 'selectors' => [ '{{WRAPPER}} table.adte_table tr td img' => 'height: {{SIZE}}{{UNIT}};', ] ] ); $this->add_responsive_control( 'adte_image_border_radius', [ 'label' => __('Border Radius', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%', 'em'], 'selectors' => [ '{{WRAPPER}} .adte_table_body tr td img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); // Button style section $this->start_controls_section( 'adte_btn_section', [ 'label' => __('Button', 'advanced-data-table-for-elementor'), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->start_controls_tabs('adte_btn_tabs'); $this->start_controls_tab( 'adte_btn_normal', [ 'label' => esc_html__('Normal', 'advanced-data-table-for-elementor'), ] ); $this->add_control( 'adte_btn_text_color', [ 'label' => esc_html__('Text Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'default' => '#FFFFFF', 'selectors' => [ '{{WRAPPER}} .adte_col_button' => 'fill: {{VALUE}}; color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'background', 'types' => ['classic', 'gradient'], // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude 'exclude' => ['image'], 'selector' => '{{WRAPPER}} .adte_col_button', 'fields_options' => [ 'background' => [ 'default' => 'classic', ], 'color' => [ 'global' => [ 'default' => Global_Colors::COLOR_ACCENT, ], ], ], ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'adte_btn_box_shadow', 'selector' => '{{WRAPPER}} .adte_col_button', ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'adte_btn_border', 'selector' => '{{WRAPPER}} .adte_col_button', ] ); $this->end_controls_tab(); $this->start_controls_tab( 'adte_btn_hover', [ 'label' => esc_html__('Hover', 'advanced-data-table-for-elementor'), ] ); $this->add_control( 'adte_btn_hover_color', [ 'label' => esc_html__('Text Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .adte_col_button:hover, {{WRAPPER}} .adte_col_button:focus' => 'color: {{VALUE}};', '{{WRAPPER}} .adte_col_button:hover svg, {{WRAPPER}} .adte_col_button:focus svg' => 'fill: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'adte_btn_background_hover', 'types' => ['classic', 'gradient'], // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude 'exclude' => ['image'], 'selector' => '{{WRAPPER}} .adte_col_button:hover, {{WRAPPER}} .adte_col_button:focus', 'fields_options' => [ 'background' => [ 'default' => 'classic', ], ], ] ); $this->add_control( 'adte_btn_hover_border_color', [ 'label' => esc_html__('Border Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .adte_col_button:hover, {{WRAPPER}} .adte_col_button:focus' => 'border-color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'adte_btn_hover_box_shadow', 'selector' => '{{WRAPPER}} .adte_col_button:hover, {{WRAPPER}} .adte_col_button:focus', ] ); $this->add_control( 'adte_btn_hover_transition_duration', [ 'label' => esc_html__('Transition Duration', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SLIDER, 'size_units' => ['s', 'ms', 'custom'], 'default' => [ 'unit' => 's', ], 'selectors' => [ '{{WRAPPER}} .adte_col_button' => 'transition-duration: {{SIZE}}{{UNIT}};', ], ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->add_responsive_control( 'adte_btn_border_radius', [ 'label' => esc_html__('Border Radius', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em'], 'selectors' => [ '{{WRAPPER}} .adte_col_button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'default' => [ 'top' => '30', 'right' => '30', 'bottom' => '30', 'left' => '30', 'unit' => 'px', 'isLinked' => true, ], ] ); $this->add_responsive_control( 'adte_btn_padding', [ 'label' => esc_html__('Padding', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em'], 'selectors' => [ '{{WRAPPER}} .adte_col_button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'default' => [ 'top' => '10', 'right' => '20', 'bottom' => '10', 'left' => '20', 'unit' => 'px', 'isLinked' => false, ], ] ); $this->end_controls_section(); // Search section $this->start_controls_section( 'adte_search_style_section', [ 'label' => esc_html__('Search', 'advanced-data-table-for-elementor'), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'adte_show_search' => 'yes', 'adte_enable_advanced_settings' => 'yes' ] ] ); $this->add_control( 'adte_search_icon_heading', [ 'label' => esc_html__('Icon:', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::HEADING, 'separator' => 'before' ] ); $this->add_responsive_control( 'adte_search_icon_font_size', array( 'label' => esc_html__('Font Size', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SLIDER, 'size_units' => array( 'px', 'em', ), 'range' => array( 'px' => array( 'min' => 1, 'max' => 100, ), ), 'default' => array( 'size' => 16, 'unit' => 'px', ), 'selectors' => array( '{{WRAPPER}} .adte-search-label i' => 'font-size: {{SIZE}}{{UNIT}}', ), ) ); $this->start_controls_tabs( 'adte_search_button_tabs' ); $this->start_controls_tab( 'adte_search_button_tab', [ 'label' => esc_html__('Normal', 'advanced-data-table-for-elementor'), ] ); $this->add_control( 'adte_search_icon_color', [ 'label' => esc_html__('Icon Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'default' => '#0077FF', 'selectors' => [ '{{WRAPPER}} .adte-search-label svg' => 'stroke: {{VALUE}};', ], ] ); $this->add_control( 'adte_search_icon_background_color', [ 'label' => esc_html__('Background Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'default' => 'rgba(0, 119, 255, .1)', 'selectors' => [ '{{WRAPPER}} .dt-search label' => 'background-color: {{VALUE}};', ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'adte_search_button_tab_hover', [ 'label' => esc_html__('Hover', 'advanced-data-table-for-elementor'), ] ); $this->add_control( 'adte_search_icon_color_hover', [ 'label' => esc_html__('Icon Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'default' => '#0077FF', 'selectors' => [ '{{WRAPPER}} .dt-search label:hover i' => 'color: {{VALUE}};', ], ] ); $this->add_control( 'adte_search_icon_background_color_hover', [ 'label' => esc_html__('Background Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'default' => 'rgba(0, 119, 255, .1)', 'selectors' => [ '{{WRAPPER}} .dt-search label:hover' => 'background-color: {{VALUE}};', ], ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->add_responsive_control( 'adte_search_icon_padding', [ 'label' => esc_html__('Padding', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%', 'em'], 'selectors' => [ '{{WRAPPER}} .dt-search label' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'adte_search_icon_margin', [ 'label' => esc_html__('Margin', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%', 'em'], 'selectors' => [ '{{WRAPPER}} .adte-search-label' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'adte_search_input_heading', [ 'label' => esc_html__('Input:', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::HEADING, 'separator' => 'before' ] ); $this->add_responsive_control( 'adte_search_input_width', [ 'label' => esc_html__('Width', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SLIDER, 'size_units' => ['px', '%'], 'default' => [ 'size' => 400, 'unit' => 'px' ], 'mobile_default' => [ 'unit' => '%', 'size' => 100, ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 1000, 'step' => 1, ], '%' => [ 'min' => 0, 'max' => 100, 'step' => 1, ], ], 'selectors' => [ '{{WRAPPER}} .adte_search_wrap .dt-search' => 'width: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'adte_search_input_padding', [ 'label' => esc_html__('Padding', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em', '%'], 'default' => [ 'top' => 9, 'bottom' => 9, 'left' => 12, 'right' => 50, 'unit' => 'px' ], 'selectors' => [ '{{WRAPPER}} .dt-search input' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'adte_search_input_border', 'label' => esc_html__('Border', 'advanced-data-table-for-elementor'), 'selector' => '{{WRAPPER}} .dt-search input', ] ); $this->add_responsive_control( 'adte_search_input_border_radius', [ 'label' => esc_html__('Border Radius', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%'], 'selectors' => [ '{{WRAPPER}} .dt-search input' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow: hidden;', ], ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'adte_search_input_border_shadow', 'selector' => '{{WRAPPER}} .dt-search input', ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'adte_search_input_text_typography', 'label' => esc_html__('Typography', 'advanced-data-table-for-elementor'), 'selector' => '{{WRAPPER}} .dt-search input', ] ); $this->start_controls_tabs( 'adte_search_input_tabs' ); $this->start_controls_tab( 'adte_search_input_normal_tab', [ 'label' => esc_html__('Normal', 'advanced-data-table-for-elementor'), ] ); $this->add_control( 'adte_search_input_color', [ 'label' => esc_html__('Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .dt-search input' => 'color: {{VALUE}};', ], ] ); $this->add_control( 'adte_search_input_background_color', [ 'label' => esc_html__('Background Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .dt-search input' => 'background-color: {{VALUE}};', ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'adte_search_input_hover_tab', [ 'label' => esc_html__('Hover', 'advanced-data-table-for-elementor'), ] ); $this->add_control( 'adte_search_input_hover_color', [ 'label' => esc_html__('Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .dt-search input:hover' => 'color: {{VALUE}};', ], ] ); $this->add_control( 'adte_search_input_hover_background_color', [ 'label' => esc_html__('Background Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .dt-search input:hover' => 'background-color: {{VALUE}};', ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'adte_search_input_focus_tab', [ 'label' => esc_html__('Focus', 'advanced-data-table-for-elementor'), ] ); $this->add_control( 'adte_search_input_focus_color', [ 'label' => esc_html__('Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .dt-search input:focus' => 'color: {{VALUE}};', ], ] ); $this->add_control( 'adte_search_input_focus_background_color', [ 'label' => esc_html__('Background Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .dt-search input:focus' => 'background-color: {{VALUE}};', ], ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->end_controls_section(); // Entries $this->start_controls_section( 'adte_section_entries_style', [ 'label' => esc_html__('Entries', 'advanced-data-table-for-elementor'), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'adte_show_entries' => 'yes', 'adte_enable_advanced_settings' => 'yes' ] ] ); $this->add_group_control( Group_Control_Background::get_type(), array( 'name' => 'adte_entries_background', 'selector' => '{{WRAPPER}} .adte_search_wrap .dt-length label, {{WRAPPER}} .adte_search_wrap .dt-length select', ) ); $this->add_responsive_control( 'adte_entries_padding', [ 'label' => esc_html__('Padding', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em', '%'], 'selectors' => [ '{{WRAPPER}} .adte_search_wrap .dt-length select' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'default' => [ 'top' => '8', 'right' => '15', 'bottom' => '8', 'left' => '15', 'unit' => 'px', 'isLinked' => false, ] ] ); $this->add_responsive_control( 'adte_entries_margin', [ 'label' => esc_html__('Margin', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em', '%'], 'selectors' => [ '{{WRAPPER}} .adte_search_wrap .dt-length' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'adte_entries_border', 'label' => esc_html__('Border', 'advanced-data-table-for-elementor'), 'selector' => '{{WRAPPER}} .adte_search_wrap .dt-length label', ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'adte_entries_box_shadow', 'selector' => '{{WRAPPER}} .adte_search_wrap .dt-length label', ] ); $this->add_control( 'adte_section_entries_label_heading', [ 'label' => esc_html__('Label:', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'adte_section_entries_label_typo', 'label' => esc_html__('Typography', 'advanced-data-table-for-elementor'), 'selector' => '{{WRAPPER}} .adte_search_wrap .dt-length label', ] ); $this->add_control( 'adte_section_entries_label_color', [ 'label' => esc_html__('Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .adte_search_wrap .dt-length label' => 'color: {{VALUE}};', ], ] ); $this->add_control( 'adte_section_entries_select_heading', [ 'label' => esc_html__('Select:', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'adte_section_entries_select_typography', 'label' => esc_html__('Typography', 'advanced-data-table-for-elementor'), 'selector' => '{{WRAPPER}} .adte_search_wrap .dt-length select', ] ); $this->add_control( 'adte_section_entries_select_color', [ 'label' => esc_html__('Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .adte_search_wrap .dt-length select' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'adte_section_entries_select_border', 'label' => esc_html__('Border', 'advanced-data-table-for-elementor'), 'selector' => '{{WRAPPER}} .adte_search_wrap .dt-length select', ] ); $this->end_controls_section(); // Info section $this->start_controls_section( 'adte_info_style', [ 'label' => esc_html__('Info', 'advanced-data-table-for-elementor'), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'adte_show_info' => 'yes', 'adte_enable_advanced_settings' => 'yes' ] ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'adte_info_typography', 'label' => esc_html__('Typography', 'advanced-data-table-for-elementor'), 'selector' => '{{WRAPPER}} .adte_pagination_wrap .dt-info', ] ); $this->start_controls_tabs( 'adte_info_style_tabs' ); $this->start_controls_tab( 'adte_info_style_normal_tab', [ 'label' => esc_html__('Normal', 'advanced-data-table-for-elementor') ] ); $this->add_control( 'adte_info_style_normal_color', [ 'label' => esc_html__('Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .dt-info' => 'color: {{VALUE}};', ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'adte_info_style_hover_tab', [ 'label' => esc_html__('Hover', 'advanced-data-table-for-elementor') ] ); $this->add_control( 'adte_info_style_hover_color', [ 'label' => esc_html__('Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .dt-info:hover' => 'color: {{VALUE}};', ], ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->end_controls_section(); // Pagination section $this->start_controls_section( 'adte_pagination_style', [ 'label' => esc_html__('Pagination', 'advanced-data-table-for-elementor'), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'adte_enable_pagination' => 'yes', 'adte_enable_advanced_settings' => 'yes' ] ] ); $this->add_responsive_control( 'adte_pagination_number_height', [ 'label' => esc_html__('Height', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SLIDER, 'size_units' => ['px'], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, 'step' => 1, ] ], 'default' => [ 'unit' => 'px', 'size' => 40, ], 'selectors' => [ '{{WRAPPER}} .adte_pagination_wrap .dt-paging .dt-paging-button, {{WRAPPER}} .adte_pagination_wrap .dt-paging .dt-paging-button' => 'height: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'adte_pagination_number_width', [ 'label' => esc_html__('Width', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SLIDER, 'size_units' => ['px', 'em'], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, 'step' => 1, ] ], 'default' => [ 'unit' => 'px', 'size' => 40, ], 'selectors' => [ '{{WRAPPER}} .adte_pagination_wrap .dt-paging .dt-paging-button, {{WRAPPER}} .adte_pagination_wrap .dt-paging .dt-paging-button' => 'width: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'adte_pagination_gap', array( 'label' => esc_html__('Gap', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SLIDER, 'size_units' => array( 'px', 'em', 'rem', ), 'range' => array( 'px' => array( 'min' => 1, 'max' => 100, ), ), 'default' => array( 'size' => 10, 'unit' => 'px', ), 'selectors' => array( '{{WRAPPER}} .adte_pagination_wrap .dt-paging nav' => 'gap: {{SIZE}}{{UNIT}}', ), ) ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'adte_pagination_typography', 'label' => esc_html__('Typography', 'advanced-data-table-for-elementor'), 'selector' => '{{WRAPPER}} .adte_pagination_wrap .dt-paging .dt-paging-button:not(.next,.previous)', ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'adte_pagination_border', 'label' => esc_html__('Border', 'advanced-data-table-for-elementor'), 'selector' => '{{WRAPPER}} .dt-paging .dt-paging-button:not(.next,.previous)', 'fields_options' => [ 'border' => [ 'default' => 'solid', ], 'width' => [ 'default' => [ 'top' => '1', 'right' => '1', 'bottom' => '1', 'left' => '1', 'unit' => 'px', 'isLinked' => true, ], ], 'color' => [ 'default' => '#0077FF', ], ], ], ); $this->add_responsive_control( 'adte_pagination_border_radius', [ 'label' => __('Border Radius', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%'], 'selectors' => [ '{{WRAPPER}} .dt-paging .dt-paging-button:not(.next,.previous)' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'default' => [ 'top' => '5', 'right' => '5', 'bottom' => '5', 'left' => '5', 'unit' => 'px', 'isLinked' => true, ] ] ); $this->start_controls_tabs( 'adte_pagination_style_tabs' ); $this->start_controls_tab( 'adte_pagination_normal_tab', [ 'label' => esc_html__('Normal', 'advanced-data-table-for-elementor') ] ); $this->add_control( 'adte_pagination_normal_text_color', [ 'label' => esc_html__('Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .dt-paging .dt-paging-button:not(.next,.previous)' => 'color: {{VALUE}};', ], 'default' => '#0077FF' ] ); $this->add_control( 'adte_pagination_normal_bg_color', [ 'label' => esc_html__('Background Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .dt-paging .dt-paging-button:not(.next,.previous)' => 'background-color: {{VALUE}};', ], 'default' => '#FFFFFF' ] ); $this->end_controls_tab(); $this->start_controls_tab( 'adte_pagination_hover_tab', [ 'label' => esc_html__('Hover', 'advanced-data-table-for-elementor') ] ); $this->add_control( 'adte_pagination_hover_text_color', [ 'label' => esc_html__('Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .dt-paging .dt-paging-button:not(.next,.previous):hover' => 'color: {{VALUE}};', ], 'default' => '#FFFFFF' ] ); $this->add_control( 'adte_pagination_hover_bg_color', [ 'label' => esc_html__('Background Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .dt-paging .dt-paging-button:not(.next,.previous):hover' => 'background-color: {{VALUE}};', ], 'default' => '#0077FF' ] ); $this->add_control( 'adte_pagination_hover_border_color', [ 'label' => esc_html__('Border Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .dt-paging .dt-paging-button:not(.next,.previous):hover' => 'border-color: {{VALUE}};', ], 'default' => '#0077FF' ] ); $this->end_controls_tab(); $this->start_controls_tab( 'adte_pagination_active_tab', [ 'label' => esc_html__('Active', 'advanced-data-table-for-elementor') ] ); $this->add_control( 'adte_pagination_active_text_color', [ 'label' => esc_html__('Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .dt-paging .dt-paging-button.current' => 'color: {{VALUE}};', '{{WRAPPER}} .dt-paging .dt-paging-button:not(.next,.previous):focus' => 'color: {{VALUE}};', ], 'default' => '#FFFFFF' ] ); $this->add_control( 'adte_pagination_active_bg_color', [ 'label' => esc_html__('Background Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .dt-paging .dt-paging-button.current' => 'background-color: {{VALUE}};', '{{WRAPPER}} .dt-paging .dt-paging-button:not(.next,.previous):focus' => 'background-color: {{VALUE}};', ], 'default' => '#0077FF' ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->add_control( 'adte_pagination_prev_next_heading', [ 'label' => esc_html__('Next and Previous Button Settings', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::HEADING, 'separator' => 'before' ] ); $this->add_responsive_control( 'adte_pagination_prev_next_button_width', [ 'label' => esc_html__('Width', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SLIDER, 'size_units' => ['px'], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, 'step' => 1, ] ], 'default' => [ 'unit' => 'px', 'size' => 40, ], 'selectors' => [ '{{WRAPPER}} .adte_pagination_wrap .dt-paging .dt-paging-button.next, {{WRAPPER}} .adte_pagination_wrap .dt-paging .dt-paging-button.previous' => 'width: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'adte_pagination_prev_next_button_height', [ 'label' => esc_html__('Height', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SLIDER, 'size_units' => ['px'], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, 'step' => 1, ] ], 'default' => [ 'unit' => 'px', 'size' => 40, ], 'selectors' => [ '{{WRAPPER}} .adte_pagination_wrap .dt-paging .dt-paging-button.next, {{WRAPPER}} .adte_pagination_wrap .dt-paging .dt-paging-button.previous' => 'height: {{SIZE}}{{UNIT}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'adte_pagination_next_prev_typography', 'label' => esc_html__('Typography', 'advanced-data-table-for-elementor'), 'selector' => '{{WRAPPER}} .adte_pagination_wrap .dt-paging .dt-paging-button.next, {{WRAPPER}} .adte_pagination_wrap .dt-paging .dt-paging-button.previous', ] ); $this->add_control( 'adte_pagination_icon_size', [ 'label' => esc_html__('Icon Size', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::SLIDER, 'size_units' => ['px'], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, 'step' => 1, ] ], 'default' => [ 'unit' => 'px', 'size' => 18, ], 'selectors' => [ '{{WRAPPER}} .dt-paging .dt-paging-button.next svg' => 'width: {{SIZE}}{{UNIT}};height: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .dt-paging .dt-paging-button.previous svg' => 'width: {{SIZE}}{{UNIT}};height: {{SIZE}}{{UNIT}};' ], 'condition' => [ 'adte_pagination_type' => 'icon' ] ] ); $this->add_responsive_control( 'adte_pagination_next_prev_border_radius', [ 'label' => __('Border Radius', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%'], 'selectors' => [ '{{WRAPPER}} .dt-paging .dt-paging-button.previous' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .dt-paging .dt-paging-button.next' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'default' => [ 'top' => '5', 'right' => '5', 'bottom' => '5', 'left' => '5', 'unit' => 'px', 'isLinked' => true, ], ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'adte_pagination_next_prev_border', 'label' => esc_html__('Border', 'advanced-data-table-for-elementor'), 'selector' => '{{WRAPPER}} .dt-paging .dt-paging-button.next, {{WRAPPER}} .dt-paging .dt-paging-button.previous', 'fields_options' => [ 'border' => [ 'default' => 'solid', ], 'width' => [ 'default' => [ 'top' => '1', 'right' => '1', 'bottom' => '1', 'left' => '1', 'unit' => 'px', 'isLinked' => true, ], ], 'color' => [ 'default' => '#0077FF', ], ], ] ); $this->start_controls_tabs( 'adte_pagination_next_prev_style_tabs' ); $this->start_controls_tab( 'adte_pagination_nex_prev_normal_tab', [ 'label' => esc_html__('Normal', 'advanced-data-table-for-elementor') ] ); $this->add_control( 'adte_pagination_nex_prev_normal_text_color', [ 'label' => esc_html__('Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .dt-paging .dt-paging-button.next' => 'color: {{VALUE}};', '{{WRAPPER}} .dt-paging .dt-paging-button.previous' => 'color: {{VALUE}};', ], 'default' => '#0077FF' ] ); $this->add_control( 'adte_pagination_nex_prev_normal_bg_color', [ 'label' => esc_html__('Background Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .dt-paging .dt-paging-button.next' => 'background-color: {{VALUE}};', '{{WRAPPER}} .dt-paging .dt-paging-button.previous' => 'background-color: {{VALUE}};', ], 'default' => '#FFFFFF' ] ); $this->end_controls_tab(); $this->start_controls_tab( 'adte_pagination_next_prev_hover_tab', [ 'label' => esc_html__('Hover', 'advanced-data-table-for-elementor') ] ); $this->add_control( 'adte_pagination_nex_prev_hover_text_color', [ 'label' => esc_html__('Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .dt-paging .dt-paging-button.next:hover' => 'color: {{VALUE}};', '{{WRAPPER}} .dt-paging .dt-paging-button.previous:hover' => 'color: {{VALUE}};', ], 'default' => '#FFFFFF' ] ); $this->add_control( 'adte_pagination_nex_prev_hover_bg_color', [ 'label' => esc_html__('Background Color', 'advanced-data-table-for-elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .dt-paging .dt-paging-button.next:hover' => 'background-color: {{VALUE}};', '{{WRAPPER}} .dt-paging .dt-paging-button.previous:hover' => 'background-color: {{VALUE}};', ], 'default' => '#0077FF' ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->end_controls_section(); } /** * Render list widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * @access protected */ protected function render() { $settings = $this->get_settings_for_display(); $table_settings = [ 'search' => ($settings['adte_show_search'] == 'yes') ? true : false, 'responsive' => ($settings['adte_enable_responsive'] == 'yes') ? true : false, 'search_placeholder' => $settings['adte_search_placeholder_text'] ? $settings['adte_search_placeholder_text'] : '', 'pagination' => $settings['adte_enable_pagination'] == 'yes' ? true : false, 'button' => $settings['adte_show_buttons'] == 'yes' ? true : false, 'entries' => $settings['adte_show_entries'] == 'yes' ? true : false, 'info' => $settings['adte_show_info'] == 'yes' ? true : false, 'sort' => $settings['adte_enable_sort'] == 'yes' ? true : false, 'rows_per_page' => $settings['adte_show_rows_per_page'] ? $settings['adte_show_rows_per_page'] : false, 'nav_style' => $settings['adte_pagination_type'] ? $settings['adte_pagination_type'] : false, 'next_text' => $settings['adte_pagination_next_text'] ? $settings['adte_pagination_next_text'] : false, 'prev_text' => $settings['adte_pagination_prev_text'] ? $settings['adte_pagination_prev_text'] : false, ]; $this->add_render_attribute('table', 'data-settings', wp_json_encode($table_settings)); $responsive_class = ''; if ($settings['adte_enable_advanced_settings'] == '' && $settings['adte_enable_responsive'] == '') { $responsive_class = ' adte_responsive_scroll'; } ?>
' . esc_html__('Please add columns to display.', 'advanced-data-table-for-elementor') . '
'; return; } $users = get_users(); $table_init_class = 'adte_table_init'; ?>| get_render_attribute_string($table_header_key); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>> |
|---|
| ID, 50); } elseif ('roles' === $field) { $roles = $user->roles; echo esc_html(implode(', ', $roles)); } else { echo esc_html($user->{$field}); } ?> |
%s
', sprintf( /* translators: %s: post type label */ esc_html__('No published %s found.', 'advanced-data-table-for-elementor'), esc_html($label) ) ); return; } $table_init_class = 'adte_table_init'; ?>| get_render_attribute_string($table_header_key); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>> |
|---|
| get_post_cell_value($post, $field, $link, $settings); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- value is escaped in the helper ?> |
| get_render_attribute_string($table_header_key) . '>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped switch ($item['header_content_type']) { case 'icon': Icons_Manager::render_icon($item['icon'], ['aria-hidden' => 'true']); break; default: echo wp_kses_post($item['text']); break; } echo ' | '; } ?>
|---|
| get_render_attribute_string($table_body_key) . '>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped switch ($item['body_content_type']) { case 'editor': echo wp_kses_post($item['text_editor']); break; case 'icon': Icons_Manager::render_icon($item['icon'], ['aria-hidden' => 'true']); break; case 'image': $this->render_image($settings, $item); break; case 'button': $this->render_button($item); break; default: echo wp_kses_post($item['text']); break; } echo ' | '; } echo '
' . esc_html__('Invalid file type. Please upload a valid CSV file.', 'advanced-data-table-for-elementor') . '
'; return; } $csv_url = wp_get_attachment_url($attachment_id); } elseif ($settings['adte_csv_type'] == 'url' && !empty($settings['adte_csv_url']['url'])) { $url_candidate = $settings['adte_csv_url']['url']; // VALIDATION 1: Check if the URL string ends with .csv. $path_parts = pathinfo(wp_parse_url($url_candidate, PHP_URL_PATH)); if (!isset($path_parts['extension']) || strtolower($path_parts['extension']) !== 'csv') { echo '' . esc_html__('Invalid URL. The URL must point to a file ending with a .csv extension.', 'advanced-data-table-for-elementor') . '
'; return; } $csv_url = $url_candidate; } } // If a valid source was found, parse the data. Otherwise, show a general error. if ($csv_url) { $this->parse_csv_data($csv_url, $settings); } else { echo '' . esc_html__('Please provide a CSV file or a valid URL.', 'advanced-data-table-for-elementor') . '
'; } } /** * Parses CSV data from a given VALIDATED URL and renders it as an HTML table. * This function assumes the source has already been validated. * * @param string $file The URL to the CSV file. * @param array $settings The widget settings. */ protected function parse_csv_data($file, $settings) { // Fetch the full file content. $response = wp_remote_get($file); /* translators: %s: WP_Error message returned by wp_remote_get() */ if (is_wp_error($response)) { $msg = $response->get_error_message(); printf( '%s
', sprintf( /* translators: %s: error message */ esc_html__('Could not retrieve the remote file. Error: %s', 'advanced-data-table-for-elementor'), esc_html($msg) ) ); return; } if (200 !== wp_remote_retrieve_response_code($response)) { echo '' . esc_html__('An unexpected error occurred while fetching the file.', 'advanced-data-table-for-elementor') . '
'; return; } $csv_body = wp_remote_retrieve_body($response); // Check if the file body is empty. if (empty($csv_body)) { echo '' . esc_html__('The CSV file is empty.', 'advanced-data-table-for-elementor') . '
'; return; } // Proceed with parsing and rendering the table. $data = str_getcsv($csv_body, "\n"); if (empty($data) || empty($data[0])) { echo '' . esc_html__('The CSV file is empty or could not be read.', 'advanced-data-table-for-elementor') . '
'; return; } $datatable_js_class = ($settings['adte_enable_advanced_settings'] == 'yes') ? 'adte_table_init' : ''; $header_row = str_getcsv($data[0]); ?>