Changeset 3313783
- Timestamp:
- 06/18/2025 10:42:38 AM (7 months ago)
- Location:
- advanced-data-table-for-elementor
- Files:
-
- 29 added
- 3 edited
-
assets/icon-128x128.png (added)
-
assets/screenshot-1.png (added)
-
assets/screenshot-2.png (added)
-
assets/screenshot-3.png (added)
-
assets/screenshot-4.png (added)
-
assets/screenshot-5.png (added)
-
assets/screenshot-6.png (added)
-
assets/screenshot-7.png (added)
-
tags/1.0.2 (added)
-
tags/1.0.2/advanced-data-table.php (added)
-
tags/1.0.2/assets (added)
-
tags/1.0.2/assets/css (added)
-
tags/1.0.2/assets/css/adte_style.css (added)
-
tags/1.0.2/assets/css/datatables.min.css (added)
-
tags/1.0.2/assets/js (added)
-
tags/1.0.2/assets/js/adte_script.js (added)
-
tags/1.0.2/assets/js/datatables.min.js (added)
-
tags/1.0.2/languages (added)
-
tags/1.0.2/readme.txt (added)
-
tags/1.0.2/widgets (added)
-
tags/1.0.2/widgets/advanced-data-table-widget.php (added)
-
trunk/advanced-data-table.php (modified) (3 diffs)
-
trunk/assets (added)
-
trunk/assets/css (added)
-
trunk/assets/css/adte_style.css (added)
-
trunk/assets/css/datatables.min.css (added)
-
trunk/assets/js (added)
-
trunk/assets/js/adte_script.js (added)
-
trunk/assets/js/datatables.min.js (added)
-
trunk/languages (added)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/widgets/advanced-data-table-widget.php (modified) (23 diffs)
Legend:
- Unmodified
- Added
- Removed
-
advanced-data-table-for-elementor/trunk/advanced-data-table.php
r3202885 r3313783 4 4 * Plugin Name: Advanced Data Table for Elementor 5 5 * Plugin URI: https://pluginscafe.com/plugin/advanced-data-table-for-elementor 6 * Author: Plugins cafe6 * Author: PluginsCafe 7 7 * Author URI: https://pluginscafe.com 8 * Version: 1.0. 19 * Description: Advanced Data Table for Elementor 8 * Version: 1.0.2 9 * Description: Advanced Data Table for Elementor is a feature-rich addon to build customizable tables with search, filter, pagination, and more. 10 10 * Text Domain: advanced-data-table-for-elementor 11 11 * License: GPL-2.0+ … … 24 24 public static $_instance = null; 25 25 26 const version = '1.0. 1';26 const version = '1.0.2'; 27 27 28 28 public function __construct() { 29 29 $this->define(); 30 30 add_action('elementor/frontend/before_enqueue_scripts', [$this, 'frontend_files']); 31 31 add_action('elementor/widgets/register', [$this, 'register_widget']); 32 32 } 33 33 34 35 /** 36 * Enqueue frontend scripts and styles 37 */ 38 public function frontend_files() { 39 wp_register_style('adte_datatables', ADTE_URL . '/assets/css/datatables.min.css', [], self::version); 40 wp_register_style('adte_style', ADTE_URL . '/assets/css/adte_style.css', [], self::version); 41 42 wp_register_script('adte_datatables', ADTE_URL . '/assets/js/datatables.min.js', [], self::version, true); 43 wp_register_script('adte_script', ADTE_URL . '/assets/js/adte_script.js', ['jquery', 'adte_datatables'], self::version, true); 44 } 34 45 35 46 /** … … 43 54 define('ADTE_AEESTS', ADTE_URL . '/assets'); 44 55 } 45 46 56 47 57 public function register_widget($widgets_manager) { -
advanced-data-table-for-elementor/trunk/readme.txt
r3202885 r3313783 1 1 === Advanced Data Table for Elementor === 2 Author: Plugins cafe2 Author: PluginsCafe 3 3 Contributors: pluginscafe,kaisarahmmed 4 4 Tags: Elementor table, data table, Advanced Table, table builder, table 5 5 Requires at least: 5.0 6 6 Requires PHP: 7.4 7 Tested up to: 6. 7.18 Stable tag: 1.0. 17 Tested up to: 6.8 8 Stable tag: 1.0.2 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html 11 11 12 The easiest and lightweight elementor Advanced Data Table.12 Advanced Data Table for Elementor is a feature-rich addon to build customizable tables with search, filter, pagination, and more. 13 13 14 14 == Description == 15 Advanced Data Table for Elementor, the must-have plugin for Elementor users looking to effortlessly create stunning and functional tables on their WordPress websites. Elementor table allowing you to build and customize tables directly within the familiar Elementor interface. With live customization, you can see your changes in real-time, ensuring every detail matches your vision perfectly. 15 Advanced Data Table for Elementor is a feature-rich addon to build customizable tables with search, filter, pagination, responsiveness and more. Advanced Data Table for Elementor, the must-have plugin for Elementor users looking to effortlessly create stunning and functional tables on their WordPress websites. Elementor table allowing you to build and customize tables directly within the familiar Elementor interface. With live customization, you can see your changes in real-time, ensuring every detail matches your vision perfectly. 16 17 [Demo Tables](https://demo.pluginscafe.com/advanced-data-table-for-elementor/) 18 19 == Key Features: == 20 * Live Customization 21 * Merge & Split Cells 22 * ColSpan Support 23 * RowSpan Support 24 * Icon Support 25 * Text Alignment (Global or Individual) 26 * Text Color (Global or Individual) 27 * Bordered Table Options 28 * Striped Rows 29 * Typography Control 30 * Search, Pagination, Fitler options 31 * Export in CSV, Excel and Copy 32 * and more... 33 34 For search, filter, pagination and more advanced feature, this plugin use [datatables.js](https://datatables.net/) js library. 16 35 17 36 18 37 = Requirements = 19 * PHP 7. 038 * PHP 7.4 20 39 * Elementor 21 40 … … 26 45 27 46 47 == Frequently Asked Questions == 48 49 = Is Table Addons for Elementor compatible with all Elementor themes? = 50 Yes, Advanced Data Table for Elementor is designed to work seamlessly with all Elementor themes. 51 52 = What is advanced settings? = 53 Advanced settings include table search, filters, pagination, responsiveness, and more. Users can easily enable and style each feature as needed. 54 55 = Are there any limitations to the advanced settings? 56 Yes, Colspan and rowspan are not supported with advanced settings, as these features rely on the DataTables.js library. 57 58 = Can I customize the appearance of the tables created with Table Addons for Elementor? = 59 Absolutely! You have full control over the design and styling of your tables, including colors, fonts, borders, and more. 60 61 = Are there any limitations on the number of tables, cells, or rows I can create? = 62 No, there are no limitations. You can create as many tables as you need, with any number of cells and rows. 63 64 = Is Table Addons for Elementor mobile responsive? = 65 Yes, our plugin is built with responsiveness in mind, ensuring that your tables look great on all devices. 66 67 68 == Screenshots == 69 1. Table with advanced features 70 2. Table with basic design 71 3. Table with color and higliter 72 4. Advanced setting options 73 5. Header setting options 74 6. Body setting options 75 7. Table style options 76 77 28 78 == Change log == 79 80 = 1.0.2 = 81 * Added datatable.js 82 * Added ots of design and layout options 29 83 30 84 = 1.0.1 = -
advanced-data-table-for-elementor/trunk/widgets/advanced-data-table-widget.php
r3204095 r3313783 7 7 use \Elementor\Controls_Manager; 8 8 use \Elementor\Group_Control_Typography; 9 use \Elementor\Icons_Manager; 10 use \Elementor\Group_Control_Border; 11 use \Elementor\Group_Control_Box_Shadow; 12 use \Elementor\Group_Control_Background; 9 13 10 14 class ADTE extends Widget_Base { 15 16 public function get_style_depends() { 17 return ['adte_style', 'adte_datatables']; 18 } 19 public function get_script_depends() { 20 return ['adte_datatables', 'adte_script']; 21 } 11 22 12 23 public function get_name() { … … 82 93 83 94 $this->start_controls_section( 84 ' table_header_section',85 [ 86 'label' => esc_html__(' Table Header', 'advanced-data-table-for-elementor'),95 'adte_data_source_section', 96 [ 97 'label' => esc_html__('Data Source', 'advanced-data-table-for-elementor'), 87 98 'tab' => Controls_Manager::TAB_CONTENT, 88 99 ] 89 100 ); 90 101 102 $this->add_control( 103 'adte_data_source', 104 [ 105 'label' => esc_html__('Source', 'advanced-data-table-for-elementor'), 106 'type' => Controls_Manager::SELECT, 107 'options' => call_user_func(function () { 108 $source = []; 109 $source['static'] = __('Static Data', 'advanced-data-table-for-elementor'); 110 111 return $source; 112 }), 113 'default' => 'static', 114 ] 115 ); 116 117 do_action('adte/advanced-data-table/controls', $this); 118 119 $this->end_controls_section(); 120 121 $this->start_controls_section( 122 'adte_table_header_section', 123 [ 124 'label' => esc_html__('Header', 'advanced-data-table-for-elementor'), 125 'tab' => Controls_Manager::TAB_CONTENT, 126 ] 127 ); 128 91 129 $repeater_header = new Repeater(); 130 131 $repeater_header->add_control( 132 'header_content_type', 133 [ 134 'label' => esc_html__('Content Type/View', 'advanced-data-table-for-elementor'), 135 'type' => Controls_Manager::CHOOSE, 136 'default' => 'default', 137 'options' => [ 138 'default' => [ 139 'title' => esc_html__('Default', 'advanced-data-table-for-elementor'), 140 'icon' => 'eicon-text', 141 ], 142 'icon' => [ 143 'title' => esc_html__('Icon', 'advanced-data-table-for-elementor'), 144 'icon' => 'eicon-check-circle', 145 ], 146 ], 147 'render_type' => 'template', 148 'classes' => 'elementor-control-start-end', 149 'style_transfer' => true, 150 'prefix_class' => 'elementor-icon-list--layout-', 151 'label_block' => true 152 ] 153 ); 92 154 93 155 $repeater_header->add_control( … … 101 163 'dynamic' => [ 102 164 'active' => true, 165 ], 166 'condition' => [ 167 'header_content_type' => 'default', 168 ] 169 ] 170 ); 171 172 $repeater_header->add_control( 173 'icon', 174 [ 175 'label' => __('Icons', 'advanced-data-table-for-elementor'), 176 'type' => Controls_Manager::ICONS, 177 'label_block' => true, 178 'default' => [ 179 'value' => 'far fa-check-circle', 180 'library' => 'fa-solid', 181 ], 182 'condition' => [ 183 'header_content_type' => 'icon', 184 ] 185 ] 186 ); 187 188 $repeater_header->add_control( 189 'icon_size', 190 [ 191 'label' => __('Icon Size', 'advanced-data-table-for-elementor'), 192 'type' => Controls_Manager::SLIDER, 193 'size_units' => ['px', '%', 'em', 'rem', 'custom'], 194 'range' => [ 195 'px' => [ 196 'min' => 0, 197 'max' => 300, 198 'step' => 1, 199 ], 200 '%' => [ 201 'min' => 0, 202 'max' => 100, 203 ], 204 ], 205 'default' => [ 206 'unit' => 'px', 207 'size' => 20, 208 ], 209 'selectors' => [ 210 '{{WRAPPER}} table.adte_table .adte_table_header tr {{CURRENT_ITEM}} i' => 'font-size: {{SIZE}}{{UNIT}};', 211 '{{WRAPPER}} table.adte_table .adte_table_header tr {{CURRENT_ITEM}} svg' => 'width: {{SIZE}}{{UNIT}};', 212 ], 213 'condition' => [ 214 'header_content_type' => 'icon', 215 ] 216 ] 217 ); 218 219 $repeater_header->add_control( 220 'advance', 221 [ 222 'label' => __('Advance Settings', 'advanced-data-table-for-elementor'), 223 'type' => Controls_Manager::SWITCHER, 224 'label_off' => __('No', 'advanced-data-table-for-elementor'), 225 'label_on' => __('Yes', 'advanced-data-table-for-elementor'), 226 ] 227 ); 228 229 $repeater_header->add_control( 230 'col_span', 231 [ 232 'label' => __('colSpan', 'advanced-data-table-for-elementor'), 233 'type' => Controls_Manager::SWITCHER, 234 'condition' => [ 235 'advance' => 'yes', 236 ], 237 'label_off' => __('No', 'advanced-data-table-for-elementor'), 238 'label_on' => __('Yes', 'advanced-data-table-for-elementor'), 239 ] 240 ); 241 242 $repeater_header->add_control( 243 'col_span_number', 244 [ 245 'label' => __('Col Span Number', 'advanced-data-table-for-elementor'), 246 'type' => Controls_Manager::NUMBER, 247 'condition' => [ 248 'advance' => 'yes', 249 'col_span' => 'yes', 250 ], 251 'default' => __('1', 'advanced-data-table-for-elementor'), 252 ] 253 ); 254 255 $repeater_header->add_control( 256 'customwidth', 257 [ 258 'label' => __('Custom Width', 'advanced-data-table-for-elementor'), 259 'type' => Controls_Manager::SWITCHER, 260 'condition' => [ 261 'advance' => 'yes', 262 ], 263 'label_off' => __('No', 'advanced-data-table-for-elementor'), 264 'label_on' => __('Yes', 'advanced-data-table-for-elementor'), 265 ] 266 ); 267 $repeater_header->add_responsive_control( 268 'width', 269 [ 270 'label' => __('Width', 'advanced-data-table-for-elementor'), 271 'type' => Controls_Manager::SLIDER, 272 'condition' => [ 273 'advance' => 'yes', 274 'customwidth' => 'yes', 275 ], 276 'range' => [ 277 '%' => [ 278 'min' => 0, 279 'max' => 100, 280 ], 281 'px' => [ 282 'min' => 1, 283 'max' => 1000, 284 ], 285 ], 286 'devices' => ['desktop', 'tablet', 'mobile'], 287 'default' => [ 288 'size' => 30, 289 'unit' => '%', 290 ], 291 'size_units' => ['%', 'px'], 292 'selectors' => [ 293 '{{WRAPPER}} table.adte_table .adte_table_header tr {{CURRENT_ITEM}}' => 'width: {{SIZE}}{{UNIT}};', 294 ] 295 ] 296 ); 297 298 299 $repeater_header->add_control( 300 'header_align', 301 [ 302 'label' => __('Alignment', 'advanced-data-table-for-elementor'), 303 'type' => Controls_Manager::CHOOSE, 304 'options' => [ 305 'left' => [ 306 'title' => __('Left', 'advanced-data-table-for-elementor'), 307 'icon' => 'eicon-h-align-left', 308 ], 309 'center' => [ 310 'title' => __('Center', 'advanced-data-table-for-elementor'), 311 'icon' => 'eicon-h-align-center', 312 ], 313 'right' => [ 314 'title' => __('Right', 'advanced-data-table-for-elementor'), 315 'icon' => 'eicon-h-align-right', 316 ], 317 'justify' => [ 318 'title' => __('Justified', 'advanced-data-table-for-elementor'), 319 'icon' => 'eicon-h-align-stretch', 320 ], 321 ], 322 'default' => '', 323 'selectors' => [ 324 '{{WRAPPER}} table.adte_table .adte_table_header tr {{CURRENT_ITEM}}' => 'text-align: {{VALUE}};', 325 ], 326 'condition' => [ 327 'advance' => 'yes', 328 ] 329 ] 330 ); 331 332 $repeater_header->add_control( 333 'header_v_align', 334 [ 335 'label' => __('Vertical Alignment', 'advanced-data-table-for-elementor'), 336 'type' => Controls_Manager::CHOOSE, 337 'options' => [ 338 'top' => [ 339 'title' => __('Top', 'advanced-data-table-for-elementor'), 340 'icon' => 'eicon-v-align-top', 341 ], 342 'middle' => [ 343 'title' => __('Middle', 'advanced-data-table-for-elementor'), 344 'icon' => 'eicon-v-align-middle', 345 ], 346 'bottom' => [ 347 'title' => __('Bottom', 'advanced-data-table-for-elementor'), 348 'icon' => 'eicon-v-align-bottom', 349 ], 350 ], 351 'default' => '', 352 'selectors' => [ 353 '{{WRAPPER}} table.adte_table .adte_table_header tr {{CURRENT_ITEM}}' => 'vertical-align: {{VALUE}};', 354 ], 355 'condition' => [ 356 'advance' => 'yes', 357 ] 358 ] 359 ); 360 361 $repeater_header->add_control( 362 'header_content_color', 363 [ 364 'label' => __('Text Color', 'advanced-data-table-for-elementor'), 365 'type' => Controls_Manager::COLOR, 366 'selectors' => [ 367 '{{WRAPPER}} table.adte_table .adte_table_header tr {{CURRENT_ITEM}}' => 'color: {{VALUE}};', 368 ], 369 'condition' => [ 370 'advance' => 'yes', 371 ] 372 ] 373 ); 374 375 $repeater_header->add_control( 376 'header_content_bg', 377 [ 378 'label' => __('Background Color', 'advanced-data-table-for-elementor'), 379 'type' => Controls_Manager::COLOR, 380 'selectors' => [ 381 '{{WRAPPER}} table.adte_table .adte_table_header tr {{CURRENT_ITEM}}' => 'background-color: {{VALUE}};', 382 ], 383 'condition' => [ 384 'advance' => 'yes', 103 385 ] 104 386 ] … … 113 395 'default' => [ 114 396 [ 115 'text' => __(' Table Header', 'advanced-data-table-for-elementor'),397 'text' => __('Name', 'advanced-data-table-for-elementor'), 116 398 ], 117 399 [ 118 'text' => __('Table Header', 'advanced-data-table-for-elementor'), 400 'text' => __('Age', 'advanced-data-table-for-elementor'), 401 ], 402 [ 403 'text' => __('Country', 'advanced-data-table-for-elementor'), 404 ], 405 [ 406 'text' => __('Occupation', 'advanced-data-table-for-elementor'), 119 407 ] 120 408 ], … … 122 410 ] 123 411 ); 124 125 126 412 $this->end_controls_section(); 127 413 … … 129 415 'table_body_section', 130 416 [ 131 'label' => __(' TableBody', 'advanced-data-table-for-elementor'),417 'label' => __('Body', 'advanced-data-table-for-elementor'), 132 418 'tab' => Controls_Manager::TAB_CONTENT, 133 419 ] … … 137 423 138 424 $repeater_body->add_control( 139 ' row',425 'adte_table_row', 140 426 [ 141 427 'label' => __('New Row', 'advanced-data-table-for-elementor'), … … 143 429 'label_off' => __('No', 'advanced-data-table-for-elementor'), 144 430 'label_on' => __('Yes', 'advanced-data-table-for-elementor'), 431 'return_value' => esc_html__('Row', 'advanced-data-table-for-elementor'), 145 432 ] 146 433 ); … … 161 448 'icon' => 'eicon-editor-paragraph', 162 449 ], 450 'icon' => [ 451 'title' => esc_html__('Icon', 'advanced-data-table-for-elementor'), 452 'icon' => 'eicon-check-circle', 453 ], 163 454 164 455 ], … … 206 497 ); 207 498 499 //Icon box 500 $repeater_body->add_control( 501 'icon', 502 [ 503 'label' => __('Icons', 'advanced-data-table-for-elementor'), 504 'type' => Controls_Manager::ICONS, 505 'label_block' => true, 506 'default' => [ 507 'value' => 'far fa-check-circle', 508 'library' => 'fa-solid', 509 ], 510 'condition' => [ 511 'body_content_type' => 'icon', 512 ] 513 ] 514 ); 515 208 516 $repeater_body->add_control( 209 517 'advance', … … 270 578 ); 271 579 272 $this->add_control( 273 'table_body', 274 [ 275 'label' => __('Table Body Cell', 'advanced-data-table-for-elementor'), 276 'type' => Controls_Manager::REPEATER, 277 'fields' => $repeater_body->get_controls(), 278 'default' => [ 279 [ 280 'text' => __('Table Data', 'advanced-data-table-for-elementor'), 281 ], 282 [ 283 'text' => __('Table Data', 'advanced-data-table-for-elementor'), 284 ], 285 ], 286 'title_field' => '{{{ text }}}', 287 ] 288 ); 289 290 $this->end_controls_section(); 291 292 $this->start_controls_section( 293 'section_style', 294 [ 295 'label' => __('General Style', 'advanced-data-table-for-elementor'), 296 'tab' => Controls_Manager::TAB_STYLE, 297 ] 298 ); 299 300 $this->add_control( 301 'table_padding', 302 [ 303 'label' => __('Inner Cell Padding', 'advanced-data-table-for-elementor'), 304 'type' => Controls_Manager::DIMENSIONS, 305 'size_units' => ['px', '%', 'em'], 306 'selectors' => [ 307 '{{WRAPPER}} table.adte_table td,{{WRAPPER}} table.adte_table th' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', 308 ], 309 ] 310 ); 311 312 $this->end_controls_section(); 313 314 $this->start_controls_section( 315 'table_header_style', 316 [ 317 'label' => __('Table Header Style', 'advanced-data-table-for-elementor'), 318 'tab' => Controls_Manager::TAB_STYLE, 319 ] 320 ); 321 322 323 $this->add_responsive_control( 324 'header_align', 580 $repeater_body->add_responsive_control( 581 'row_align', 325 582 [ 326 583 'label' => __('Alignment', 'advanced-data-table-for-elementor'), … … 345 602 ], 346 603 'selectors' => [ 347 '{{WRAPPER}} table.adte_table .adte_table_header tr th' => 'text-align: {{VALUE}};', 348 ], 349 ] 350 ); 351 352 $this->add_responsive_control( 353 'header_vertical_align', 604 '{{WRAPPER}} table.adte_table .adte_table_body tr {{CURRENT_ITEM}}' => 'text-align: {{VALUE}};', 605 ], 606 'condition' => [ 607 'advance' => 'yes', 608 ] 609 ] 610 ); 611 612 613 $repeater_body->add_responsive_control( 614 'body_v_align', 354 615 [ 355 616 'label' => __('Vertical Alignment', 'advanced-data-table-for-elementor'), … … 369 630 ], 370 631 ], 371 'selectors' => [ 372 '{{WRAPPER}} table.adte_table .adte_table_header tr th' => 'vertical-align: {{VALUE}};', 373 ], 374 ] 375 ); 376 377 $this->add_control( 378 'header_text_color', 632 'default' => '', 633 'selectors' => [ 634 '{{WRAPPER}} table.adte_table .adte_table_body tr {{CURRENT_ITEM}}' => 'vertical-align: {{VALUE}};', 635 ], 636 'condition' => [ 637 'advance' => 'yes', 638 ] 639 ] 640 ); 641 642 $repeater_body->add_control( 643 'body_content_color', 379 644 [ 380 645 'label' => __('Text Color', 'advanced-data-table-for-elementor'), 381 646 'type' => Controls_Manager::COLOR, 382 647 'selectors' => [ 383 '{{WRAPPER}} table.adte_table .adte_table_header tr th' => 'color: {{VALUE}};', 384 ] 648 '{{WRAPPER}} table.adte_table .adte_table_body tr {{CURRENT_ITEM}}' => 'color: {{VALUE}};', 649 '{{WRAPPER}} table.adte_table .adte_table_body tr {{CURRENT_ITEM}} i' => 'color: {{VALUE}};', 650 '{{WRAPPER}} table.adte_table .adte_table_body tr {{CURRENT_ITEM}} svg' => 'fill: {{VALUE}};', 651 ], 652 'condition' => [ 653 'advance' => 'yes', 654 ] 655 ] 656 ); 657 658 $repeater_body->add_control( 659 'body_content_bg', 660 [ 661 'label' => __('Background Color', 'advanced-data-table-for-elementor'), 662 'type' => Controls_Manager::COLOR, 663 'selectors' => [ 664 '{{WRAPPER}} table.adte_table .adte_table_body tr {{CURRENT_ITEM}}' => 'background-color: {{VALUE}};', 665 ], 666 'condition' => [ 667 'advance' => 'yes', 668 ] 669 ] 670 ); 671 672 $repeater_body->add_control( 673 'adte_repeater_icon_size', 674 [ 675 'label' => __('Icon Size', 'advanced-data-table-for-elementor'), 676 'type' => Controls_Manager::SLIDER, 677 'size_units' => ['px', '%', 'em', 'rem', 'custom'], 678 'range' => [ 679 'px' => [ 680 'min' => 0, 681 'max' => 300, 682 'step' => 1, 683 ], 684 '%' => [ 685 'min' => 0, 686 'max' => 100, 687 ], 688 ], 689 'default' => [ 690 'unit' => 'px' 691 ], 692 'selectors' => [ 693 '{{WRAPPER}} table.adte_table .adte_table_body tr {{CURRENT_ITEM}} i' => 'font-size: {{SIZE}}{{UNIT}};', 694 '{{WRAPPER}} table.adte_table .adte_table_body tr {{CURRENT_ITEM}} svg' => 'height: {{SIZE}}{{UNIT}};width: {{SIZE}}{{UNIT}};', 695 ], 696 'condition' => [ 697 'body_content_type' => 'icon', 698 'advance' => 'yes', 699 ] 700 ] 701 ); 702 703 $this->add_control( 704 'table_body', 705 [ 706 'label' => __('Table Body Cell', 'advanced-data-table-for-elementor'), 707 'type' => Controls_Manager::REPEATER, 708 'fields' => $repeater_body->get_controls(), 709 'default' => [ 710 [ 711 'adte_table_row' => 'Row', 712 'text' => __('John Doe', 'advanced-data-table-for-elementor'), 713 ], 714 [ 715 'text' => __('28', 'advanced-data-table-for-elementor'), 716 ], 717 [ 718 'text' => __('USA', 'advanced-data-table-for-elementor'), 719 ], 720 [ 721 'text' => __('Software Engineer', 'advanced-data-table-for-elementor'), 722 ], 723 [ 724 'adte_table_row' => 'Row', 725 'text' => __('John Smith', 'advanced-data-table-for-elementor'), 726 ], 727 [ 728 'text' => __('32', 'advanced-data-table-for-elementor'), 729 ], 730 [ 731 'text' => __('UK', 'advanced-data-table-for-elementor'), 732 ], 733 [ 734 'text' => __('Graphic Engineer', 'advanced-data-table-for-elementor'), 735 ], 736 ], 737 'title_field' => '{{{ adte_table_row }}}{{ adte_table_row ? " - " : "" }}{{{ text }}}', 738 739 ] 740 ); 741 742 $this->end_controls_section(); 743 744 /** 745 * Advanced Section 746 * This section is for search filter, pagination, and other advanced settings. 747 */ 748 $this->start_controls_section( 749 'adte_table_settings', 750 [ 751 'label' => __('Settings ', 'advanced-data-table-for-elementor'), 752 'tab' => Controls_Manager::TAB_CONTENT, 753 ] 754 ); 755 $this->add_control( 756 'adte_static_data_notice', 757 [ 758 'type' => Controls_Manager::NOTICE, 759 'notice_type' => 'warning', 760 'dismissible' => false, 761 'heading' => esc_html__('Advanced Settings Limitation', 'advanced-data-table-for-elementor'), 762 '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'), 763 'condition' => [ 764 'adte_enable_advanced_settings' => '', 765 'adte_data_source' => 'static' 766 ] 767 ] 768 ); 769 770 $this->add_control( 771 'adte_enable_advanced_settings', 772 [ 773 'label' => __('Enable Advanced Settings', 'advanced-data-table-for-elementor'), 774 'type' => Controls_Manager::SWITCHER, 775 'label_on' => __('Yes', 'advanced-data-table-for-elementor'), 776 'label_off' => __('No', 'advanced-data-table-for-elementor'), 777 'return_value' => 'yes', 778 'default' => '', 779 ], 780 ); 781 782 $this->add_control( 783 'adte_enable_sort', 784 [ 785 'label' => __('Sort', 'advanced-data-table-for-elementor'), 786 'type' => Controls_Manager::SWITCHER, 787 'label_on' => __('Yes', 'advanced-data-table-for-elementor'), 788 'label_off' => __('No', 'advanced-data-table-for-elementor'), 789 'return_value' => 'yes', 790 'default' => '', 791 'condition' => [ 792 'adte_enable_advanced_settings' => 'yes', 793 ] 794 ] 795 ); 796 797 $this->add_control( 798 'adte_show_search', 799 [ 800 'label' => __('Search', 'advanced-data-table-for-elementor'), 801 'type' => Controls_Manager::SWITCHER, 802 'label_on' => __('Yes', 'advanced-data-table-for-elementor'), 803 'label_off' => __('No', 'advanced-data-table-for-elementor'), 804 'return_value' => 'yes', 805 'default' => '', 806 'condition' => [ 807 'adte_enable_advanced_settings' => 'yes', 808 ], 809 ] 810 ); 811 812 $this->add_control( 813 'adte_search_placeholder_text', 814 [ 815 'label' => __('Placeholder', 'advanced-data-table-for-elementor'), 816 'type' => Controls_Manager::TEXT, 817 'default' => __('Search...', 'advanced-data-table-for-elementor'), 818 'condition' => [ 819 'adte_show_search' => 'yes', 820 'adte_enable_advanced_settings' => 'yes', 821 ], 822 'label_block' => false 823 ] 824 ); 825 826 $this->add_control( 827 'adte_enable_pagination', 828 [ 829 'label' => __('Pagination', 'advanced-data-table-for-elementor'), 830 'type' => Controls_Manager::SWITCHER, 831 'label_on' => __('Yes', 'advanced-data-table-for-elementor'), 832 'label_off' => __('No', 'advanced-data-table-for-elementor'), 833 'return_value' => 'yes', 834 'default' => '', 835 'condition' => [ 836 'adte_enable_advanced_settings' => 'yes', 837 ], 838 ] 839 ); 840 841 $this->add_control( 842 'adte_pagination_type', 843 [ 844 'label' => esc_html__('Pagination Type', 'advanced-data-table-for-elementor'), 845 'type' => Controls_Manager::SELECT, 846 'default' => 'icon', 847 'options' => [ 848 'icon' => esc_html__('Icon', 'advanced-data-table-for-elementor'), 849 'text' => esc_html__('Text', 'advanced-data-table-for-elementor'), 850 ], 851 'condition' => [ 852 'adte_enable_advanced_settings' => 'yes', 853 'adte_enable_pagination' => 'yes' 854 ], 855 ] 856 ); 857 858 $this->add_control( 859 'adte_pagination_next_text', 860 [ 861 'label' => esc_html__('Next Button Text', 'advanced-data-table-for-elementor'), 862 'type' => Controls_Manager::TEXT, 863 'default' => esc_html__('Next', 'advanced-data-table-for-elementor'), 864 'condition' => [ 865 'adte_pagination_type' => 'text', 866 'adte_enable_pagination' => 'yes' 867 ] 868 ] 869 ); 870 871 $this->add_control( 872 'adte_pagination_prev_text', 873 [ 874 'label' => esc_html__('Previous Button Text', 'advanced-data-table-for-elementor'), 875 'type' => Controls_Manager::TEXT, 876 'default' => esc_html__('Prev', 'advanced-data-table-for-elementor'), 877 'condition' => [ 878 'adte_pagination_type' => 'text', 879 'adte_enable_pagination' => 'yes' 880 ] 881 ] 882 ); 883 884 $this->add_control( 885 'adte_show_rows_per_page', 886 [ 887 'label' => __('Rows Per Page', 'advanced-data-table-for-elementor'), 888 'type' => Controls_Manager::NUMBER, 889 'default' => '10', 890 'min' => 1, 891 'max' => 100, 892 'step' => 1, 893 'condition' => [ 894 'adte_enable_pagination' => 'yes', 895 'adte_enable_advanced_settings' => 'yes', 896 ], 897 'separator' => 'after' 898 ] 899 ); 900 901 $this->add_control( 902 'adte_show_info', 903 [ 904 'label' => __('Info', 'advanced-data-table-for-elementor'), 905 'type' => Controls_Manager::SWITCHER, 906 'label_on' => __('Yes', 'advanced-data-table-for-elementor'), 907 'label_off' => __('No', 'advanced-data-table-for-elementor'), 908 'return_value' => 'yes', 909 'default' => '', 910 'condition' => [ 911 'adte_enable_advanced_settings' => 'yes', 912 ], 913 ] 914 ); 915 916 $this->add_control( 917 'adte_show_entries', 918 [ 919 'label' => __('Entries', 'advanced-data-table-for-elementor'), 920 'type' => Controls_Manager::SWITCHER, 921 'label_on' => __('Yes', 'advanced-data-table-for-elementor'), 922 'label_off' => __('No', 'advanced-data-table-for-elementor'), 923 'return_value' => 'yes', 924 'default' => '', 925 'condition' => [ 926 'adte_enable_advanced_settings' => 'yes', 927 ], 928 ] 929 ); 930 931 $this->add_control( 932 'adte_show_buttons', 933 [ 934 'label' => __('Buttons', 'advanced-data-table-for-elementor'), 935 'type' => Controls_Manager::SWITCHER, 936 'label_on' => __('Yes', 'advanced-data-table-for-elementor'), 937 'label_off' => __('No', 'advanced-data-table-for-elementor'), 938 'return_value' => 'yes', 939 'default' => '', 940 'condition' => [ 941 'adte_enable_advanced_settings' => 'yes', 942 'adte_show_entries' => '', 943 ], 944 ] 945 ); 946 947 $this->add_control( 948 'adte_enable_responsive', 949 [ 950 'label' => __('Responsive', 'advanced-data-table-for-elementor'), 951 'type' => Controls_Manager::SWITCHER, 952 'label_on' => __('Yes', 'advanced-data-table-for-elementor'), 953 'label_off' => __('No', 'advanced-data-table-for-elementor'), 954 'return_value' => 'yes', 955 'default' => '', 956 'condition' => [ 957 'adte_enable_advanced_settings' => 'yes', 958 ] 959 ] 960 ); 961 962 $this->end_controls_section(); 963 964 /** 965 * Table Style Section 966 */ 967 $this->start_controls_section( 968 'adte_table_style', 969 [ 970 'label' => __('Table', 'advanced-data-table-for-elementor'), 971 'tab' => Controls_Manager::TAB_STYLE, 972 ] 973 ); 974 975 $this->add_group_control( 976 Group_Control_Border::get_type(), 977 [ 978 'name' => 'adte_border', 979 'label' => __('Border', 'advanced-data-table-for-elementor'), 980 'selector' => '{{WRAPPER}} .adte_table_wrapper table.adte_table', 981 ] 982 ); 983 984 $this->add_responsive_control( 985 'adte_table_margin', 986 [ 987 'label' => __('Margin', 'advanced-data-table-for-elementor'), 988 'type' => Controls_Manager::DIMENSIONS, 989 'size_units' => ['px', '%', 'em'], 990 'selectors' => [ 991 '{{WRAPPER}} table.adte_table' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', 992 ], 993 ] 994 ); 995 996 $this->add_group_control( 997 Group_Control_Box_Shadow::get_type(), 998 [ 999 'name' => 'adte_box_shadow', 1000 'label' => __('Box Shadow', 'advanced-data-table-for-elementor'), 1001 'selector' => '{{WRAPPER}} table.adte_table', 1002 ] 1003 ); 1004 1005 $this->end_controls_section(); 1006 1007 $this->start_controls_section( 1008 'adte_header', 1009 [ 1010 'label' => __('Header', 'advanced-data-table-for-elementor'), 1011 'tab' => Controls_Manager::TAB_STYLE, 385 1012 ] 386 1013 ); … … 395 1022 ); 396 1023 397 $this->add_control(398 'header_bg_color',399 [400 'label' => __('Background Color', 'advanced-data-table-for-elementor'),401 'type' => Controls_Manager::COLOR,402 'selectors' => [403 '{{WRAPPER}} table.adte_table .adte_table_header tr th' => 'background-color: {{VALUE}};',404 ]405 ]406 );407 408 $this->end_controls_section();409 410 $this->start_controls_section(411 'table_body_style',412 [413 'label' => __('Table Body Style', 'advanced-data-table-for-elementor'),414 'tab' => Controls_Manager::TAB_STYLE,415 ]416 );417 418 1024 $this->add_responsive_control( 419 ' body_align',1025 'adte_header_align', 420 1026 [ 421 1027 'label' => __('Alignment', 'advanced-data-table-for-elementor'), … … 439 1045 ], 440 1046 ], 441 'selectors' => [ 442 '{{WRAPPER}} table.adte_table .adte_table_body tr td' => 'text-align: {{VALUE}};', 1047 'default' => 'center', 1048 'selectors' => [ 1049 '{{WRAPPER}} table.adte_table .adte_table_header tr th' => 'text-align: {{VALUE}};', 443 1050 ], 444 1051 ] … … 446 1053 447 1054 $this->add_responsive_control( 448 ' body_vertical_align',1055 'adte_header_vertical_align', 449 1056 [ 450 1057 'label' => __('Vertical Alignment', 'advanced-data-table-for-elementor'), … … 465 1072 ], 466 1073 'selectors' => [ 467 '{{WRAPPER}} table.adte_table .adte_table_ body tr td' => 'vertical-align: {{VALUE}};',468 ], 469 ] 470 ); 471 472 $this->add_control( 473 ' body_text_color',1074 '{{WRAPPER}} table.adte_table .adte_table_header tr th' => 'vertical-align: {{VALUE}};', 1075 ], 1076 ] 1077 ); 1078 1079 $this->add_control( 1080 'adte_header_text_color', 474 1081 [ 475 1082 'label' => __('Text Color', 'advanced-data-table-for-elementor'), 476 1083 'type' => Controls_Manager::COLOR, 477 1084 'selectors' => [ 478 '{{WRAPPER}} table.adte_table .adte_table_body tr td' => 'color: {{VALUE}};', 479 ] 1085 '{{WRAPPER}} table.adte_table .adte_table_header tr th' => 'color: {{VALUE}};', 1086 ], 1087 'default' => '#ffffff' 1088 ] 1089 ); 1090 1091 $this->add_control( 1092 'adte_header_bg_color', 1093 [ 1094 'label' => __('Background Color', 'advanced-data-table-for-elementor'), 1095 'type' => Controls_Manager::COLOR, 1096 'selectors' => [ 1097 '{{WRAPPER}} table.adte_table .adte_table_header tr th' => 'background-color: {{VALUE}};', 1098 ], 1099 'default' => '#0077FF' 1100 ] 1101 ); 1102 1103 $this->add_responsive_control( 1104 'adte_header_padding', 1105 [ 1106 'label' => __('Padding', 'advanced-data-table-for-elementor'), 1107 'type' => Controls_Manager::DIMENSIONS, 1108 'size_units' => ['px', '%', 'em'], 1109 'selectors' => [ 1110 '{{WRAPPER}} table.adte_table th' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', 1111 ], 1112 ] 1113 ); 1114 1115 $this->add_group_control( 1116 Group_Control_Border::get_type(), 1117 [ 1118 'name' => 'adte_header_border', 1119 'label' => __('Border', 'advanced-data-table-for-elementor'), 1120 'selector' => '{{WRAPPER}} table.adte_table thead th', 1121 ] 1122 ); 1123 1124 $this->end_controls_section(); 1125 1126 $this->start_controls_section( 1127 'adte_table_body', 1128 [ 1129 'label' => __('Body', 'advanced-data-table-for-elementor'), 1130 'tab' => Controls_Manager::TAB_STYLE, 480 1131 ] 481 1132 ); … … 484 1135 Group_Control_Typography::get_type(), 485 1136 [ 486 'name' => ' body_typography',1137 'name' => 'adte_body_typography', 487 1138 'selector' => '{{WRAPPER}} table.adte_table .adte_table_body', 488 1139 'global' => [ … … 492 1143 ); 493 1144 494 $this->add_control( 495 'body_bg_color', 1145 $this->add_responsive_control( 1146 'adte_body_align', 1147 [ 1148 'label' => __('Alignment', 'advanced-data-table-for-elementor'), 1149 'type' => Controls_Manager::CHOOSE, 1150 'options' => [ 1151 'left' => [ 1152 'title' => __('Left', 'advanced-data-table-for-elementor'), 1153 'icon' => 'eicon-h-align-left', 1154 ], 1155 'center' => [ 1156 'title' => __('Center', 'advanced-data-table-for-elementor'), 1157 'icon' => 'eicon-h-align-center', 1158 ], 1159 'right' => [ 1160 'title' => __('Right', 'advanced-data-table-for-elementor'), 1161 'icon' => 'eicon-h-align-right', 1162 ], 1163 'justify' => [ 1164 'title' => __('Justified', 'advanced-data-table-for-elementor'), 1165 'icon' => 'eicon-h-align-stretch', 1166 ], 1167 ], 1168 'default' => 'center', 1169 'selectors' => [ 1170 '{{WRAPPER}} table.adte_table .adte_table_body tr td' => 'text-align: {{VALUE}};', 1171 ], 1172 ] 1173 ); 1174 1175 $this->add_responsive_control( 1176 'adte_body_vertical_align', 1177 [ 1178 'label' => __('Vertical Alignment', 'advanced-data-table-for-elementor'), 1179 'type' => Controls_Manager::CHOOSE, 1180 'options' => [ 1181 'top' => [ 1182 'title' => __('Top', 'advanced-data-table-for-elementor'), 1183 'icon' => 'eicon-v-align-top', 1184 ], 1185 'middle' => [ 1186 'title' => __('Middle', 'advanced-data-table-for-elementor'), 1187 'icon' => 'eicon-v-align-middle', 1188 ], 1189 'bottom' => [ 1190 'title' => __('Bottom', 'advanced-data-table-for-elementor'), 1191 'icon' => 'eicon-v-align-bottom', 1192 ], 1193 ], 1194 'selectors' => [ 1195 '{{WRAPPER}} table.adte_table .adte_table_body tr td' => 'vertical-align: {{VALUE}};', 1196 ], 1197 ] 1198 ); 1199 1200 $this->add_control( 1201 'adte_body_text_color', 1202 [ 1203 'label' => __('Text Color', 'advanced-data-table-for-elementor'), 1204 'type' => Controls_Manager::COLOR, 1205 'selectors' => [ 1206 '{{WRAPPER}} table.adte_table .adte_table_body tr td' => 'color: {{VALUE}};', 1207 ] 1208 ] 1209 ); 1210 1211 1212 $this->add_control( 1213 'adte_body_bg_color', 496 1214 [ 497 1215 'label' => __('Background Color', 'advanced-data-table-for-elementor'), … … 502 1220 ] 503 1221 ); 1222 1223 $this->add_control( 1224 'adte_body_highlight', 1225 [ 1226 'label' => esc_html__('Highlight', 'advanced-data-table-for-elementor'), 1227 'type' => Controls_Manager::SELECT, 1228 'options' => [ 1229 'none' => esc_html__('None', 'advanced-data-table-for-elementor'), 1230 'first-col' => esc_html__('First Column', 'advanced-data-table-for-elementor'), 1231 'last-col' => esc_html__('Last Column', 'advanced-data-table-for-elementor'), 1232 'even-col' => esc_html__('Even Column', 'advanced-data-table-for-elementor'), 1233 'odd-col' => esc_html__('Odd Column', 'advanced-data-table-for-elementor'), 1234 'even-row' => esc_html__('Even Row', 'advanced-data-table-for-elementor'), 1235 'odd-row' => esc_html__('Odd Row', 'advanced-data-table-for-elementor'), 1236 ], 1237 'default' => 'none', 1238 ] 1239 ); 1240 1241 $this->add_control( 1242 'adte_body_first_col_highlight_color', 1243 [ 1244 'label' => __('Text Color', 'advanced-data-table-for-elementor'), 1245 'type' => Controls_Manager::COLOR, 1246 'default' => '#444444', 1247 'selectors' => [ 1248 '{{WRAPPER}} tbody td:first-child' => 'color: {{VALUE}}', 1249 ], 1250 'condition' => [ 1251 'adte_body_highlight' => 'first-col', 1252 ], 1253 ] 1254 ); 1255 1256 $this->add_control( 1257 'adte_body_first_col_highlight_background', 1258 [ 1259 'label' => __('Background Color', 'advanced-data-table-for-elementor'), 1260 'type' => Controls_Manager::COLOR, 1261 'default' => '#fbfbfb', 1262 'selectors' => [ 1263 '{{WRAPPER}} tbody td:first-child' => 'background-color: {{VALUE}} !important', 1264 ], 1265 'condition' => [ 1266 'adte_body_highlight' => 'first-col', 1267 ], 1268 ] 1269 ); 1270 1271 $this->add_control( 1272 'adte_body_last_col_highlight_color', 1273 [ 1274 'label' => __('Text Color', 'advanced-data-table-for-elementor'), 1275 'type' => Controls_Manager::COLOR, 1276 'default' => '#444444', 1277 'selectors' => [ 1278 '{{WRAPPER}} tbody td:last-child' => 'color: {{VALUE}}', 1279 ], 1280 'condition' => [ 1281 'adte_body_highlight' => 'last-col', 1282 ], 1283 ] 1284 ); 1285 1286 $this->add_control( 1287 'adte_body_last_col_highlight_background', 1288 [ 1289 'label' => __('Background Color', 'advanced-data-table-for-elementor'), 1290 'type' => Controls_Manager::COLOR, 1291 'default' => '#fbfbfb', 1292 'selectors' => [ 1293 '{{WRAPPER}} tbody td:last-child' => 'background-color: {{VALUE}} !important', 1294 ], 1295 'condition' => [ 1296 'adte_body_highlight' => 'last-col', 1297 ], 1298 ] 1299 ); 1300 1301 // even col 1302 $this->add_control( 1303 'adte_body_even_col_highlight_color', 1304 [ 1305 'label' => __('Text Color', 'advanced-data-table-for-elementor'), 1306 'type' => Controls_Manager::COLOR, 1307 'default' => '#444444', 1308 'selectors' => [ 1309 '{{WRAPPER}} tbody td:nth-child(even)' => 'color: {{VALUE}}', 1310 ], 1311 'condition' => [ 1312 'adte_body_highlight' => 'even-col', 1313 ], 1314 ] 1315 ); 1316 1317 $this->add_control( 1318 'adte_body_even_col_highlight_background', 1319 [ 1320 'label' => __('Background Color', 'advanced-data-table-for-elementor'), 1321 'type' => Controls_Manager::COLOR, 1322 'default' => '#fbfbfb', 1323 'selectors' => [ 1324 '{{WRAPPER}} tbody td:nth-child(even)' => 'background-color: {{VALUE}} !important', 1325 ], 1326 'condition' => [ 1327 'adte_body_highlight' => 'even-col', 1328 ], 1329 ] 1330 ); 1331 1332 // odd col 1333 $this->add_control( 1334 'adte_body_odd_col_highlight_color', 1335 [ 1336 'label' => __('Text Color', 'advanced-data-table-for-elementor'), 1337 'type' => Controls_Manager::COLOR, 1338 'default' => '#444444', 1339 'selectors' => [ 1340 '{{WRAPPER}} tbody td:nth-child(odd)' => 'color: {{VALUE}}', 1341 ], 1342 'condition' => [ 1343 'adte_body_highlight' => 'odd-col', 1344 ], 1345 ] 1346 ); 1347 1348 $this->add_control( 1349 'adte_body_odd_col_highlight_background', 1350 [ 1351 'label' => __('Background Color', 'advanced-data-table-for-elementor'), 1352 'type' => Controls_Manager::COLOR, 1353 'default' => '#fbfbfb', 1354 'selectors' => [ 1355 '{{WRAPPER}} tbody td:nth-child(odd)' => 'background-color: {{VALUE}} !important', 1356 ], 1357 'condition' => [ 1358 'adte_body_highlight' => 'odd-col', 1359 ], 1360 ] 1361 ); 1362 1363 // even row 1364 $this->add_control( 1365 'adte_body_even_row_highlight_color', 1366 [ 1367 'label' => __('Text Color', 'advanced-data-table-for-elementor'), 1368 'type' => Controls_Manager::COLOR, 1369 'default' => '#444444', 1370 'selectors' => [ 1371 '{{WRAPPER}} tbody tr:nth-child(even)' => 'color: {{VALUE}}', 1372 '{{WRAPPER}} tbody tr:nth-child(even) td' => 'color: {{VALUE}}', 1373 ], 1374 'condition' => [ 1375 'adte_body_highlight' => 'even-row', 1376 ], 1377 ] 1378 ); 1379 1380 $this->add_control( 1381 'adte_body_even_row_highlight_background', 1382 [ 1383 'label' => __('Background Color', 'advanced-data-table-for-elementor'), 1384 'type' => Controls_Manager::COLOR, 1385 'default' => '#fbfbfb', 1386 'selectors' => [ 1387 '{{WRAPPER}} tbody tr:nth-child(even) td' => 'background-color: {{VALUE}} !important', 1388 ], 1389 'condition' => [ 1390 'adte_body_highlight' => 'even-row', 1391 ], 1392 ] 1393 ); 1394 1395 // odd row 1396 $this->add_control( 1397 'adte_body_odd_row_highlight_color', 1398 [ 1399 'label' => __('Text Color', 'advanced-data-table-for-elementor'), 1400 'type' => Controls_Manager::COLOR, 1401 'default' => '#444444', 1402 'selectors' => [ 1403 '{{WRAPPER}} tbody tr:nth-child(odd)' => 'color: {{VALUE}}', 1404 '{{WRAPPER}} tbody tr:nth-child(odd) td' => 'color: {{VALUE}}', 1405 ], 1406 'condition' => [ 1407 'adte_body_highlight' => 'odd-row', 1408 ], 1409 ] 1410 ); 1411 1412 $this->add_control( 1413 'adte_body_odd_row_highlight_background', 1414 [ 1415 'label' => __('Background Color', 'advanced-data-table-for-elementor'), 1416 'type' => Controls_Manager::COLOR, 1417 'default' => '#fbfbfb', 1418 'selectors' => [ 1419 '{{WRAPPER}} table.adte_table tbody.adte_table_body tr:nth-child(odd) td' => 'background-color: {{VALUE}} !important', 1420 ], 1421 'condition' => [ 1422 'adte_body_highlight' => 'odd-row', 1423 ], 1424 ] 1425 ); 1426 1427 $this->add_responsive_control( 1428 'adte_body_padding', 1429 [ 1430 'label' => __('Padding', 'advanced-data-table-for-elementor'), 1431 'type' => Controls_Manager::DIMENSIONS, 1432 'size_units' => ['px', '%', 'em'], 1433 'selectors' => [ 1434 '{{WRAPPER}} table.adte_table td,{{WRAPPER}} table.adte_table th' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', 1435 ], 1436 ] 1437 ); 1438 1439 $this->add_group_control( 1440 Group_Control_Border::get_type(), 1441 [ 1442 'name' => 'adte_border_border', 1443 'label' => __('Border', 'advanced-data-table-for-elementor'), 1444 'selector' => '{{WRAPPER}} table.adte_table .adte_table_body td', 1445 ] 1446 ); 1447 1448 $this->end_controls_section(); 1449 1450 $this->start_controls_section( 1451 'adte_icon_section', 1452 [ 1453 'label' => __('Icon', 'advanced-data-table-for-elementor'), 1454 'tab' => Controls_Manager::TAB_STYLE, 1455 ] 1456 ); 1457 1458 $this->add_responsive_control( 1459 'adte_icon_size', 1460 [ 1461 'label' => __('Icon Size', 'advanced-data-table-for-elementor'), 1462 'type' => Controls_Manager::SLIDER, 1463 'size_units' => ['px', '%'], 1464 'range' => [ 1465 'px' => [ 1466 'min' => 0, 1467 'max' => 300, 1468 'step' => 1, 1469 ], 1470 '%' => [ 1471 'min' => 0, 1472 'max' => 100, 1473 ], 1474 ], 1475 'default' => [ 1476 'unit' => 'px', 1477 'size' => 16, 1478 ], 1479 'selectors' => [ 1480 '{{WRAPPER}} table.adte_table tr td i' => 'font-size: {{SIZE}}{{UNIT}};', 1481 '{{WRAPPER}} table.adte_table tr td svg' => 'height: {{SIZE}}{{UNIT}};width: {{SIZE}}{{UNIT}};', 1482 ] 1483 ] 1484 ); 1485 1486 $this->add_control( 1487 'adte_icon_color', 1488 [ 1489 'label' => __('Icon Color', 'advanced-data-table-for-elementor'), 1490 'type' => Controls_Manager::COLOR, 1491 'selectors' => [ 1492 '{{WRAPPER}} table.adte_table .adte_table_body tr td i' => 'color: {{VALUE}};', 1493 '{{WRAPPER}} table.adte_table .adte_table_body tr td svg' => 'color: {{VALUE}}; fill: {{VALUE}};', 1494 ] 1495 ] 1496 ); 1497 1498 $this->end_controls_section(); 1499 1500 //Buttons Section 1501 $this->start_controls_section( 1502 'adte_buttons_style_section', 1503 [ 1504 'label' => esc_html__('Buttons', 'advanced-data-table-for-elementor'), 1505 'tab' => Controls_Manager::TAB_STYLE, 1506 'condition' => [ 1507 'adte_show_buttons' => 'yes', 1508 'adte_enable_advanced_settings' => 'yes' 1509 ] 1510 ] 1511 ); 1512 1513 1514 $this->add_responsive_control( 1515 'adte_buttons_gap', 1516 array( 1517 'label' => esc_html__('Gap', 'advanced-data-table-for-elementor'), 1518 'type' => Controls_Manager::SLIDER, 1519 'size_units' => array( 1520 'px', 1521 'em' 1522 ), 1523 'range' => array( 1524 'px' => array( 1525 'min' => 1, 1526 'max' => 100, 1527 ), 1528 ), 1529 'default' => array( 1530 'size' => 8, 1531 'unit' => 'px', 1532 ), 1533 'selectors' => array( 1534 '{{WRAPPER}} .adte_search_wrap .dt-buttons' => 'gap: {{SIZE}}{{UNIT}}', 1535 ), 1536 ) 1537 ); 1538 1539 $this->add_group_control( 1540 Group_Control_Typography::get_type(), 1541 [ 1542 'name' => 'adte_buttons_typography', 1543 'label' => esc_html__('Typography', 'advanced-data-table-for-elementor'), 1544 'selector' => '{{WRAPPER}} .adte_search_wrap .dt-buttons .dt-button', 1545 ] 1546 ); 1547 1548 $this->add_group_control( 1549 Group_Control_Border::get_type(), 1550 [ 1551 'name' => 'adte_buttons_border', 1552 'label' => esc_html__('Border', 'advanced-data-table-for-elementor'), 1553 'selector' => '{{WRAPPER}} .adte_search_wrap .dt-buttons .dt-button', 1554 'fields_options' => [ 1555 'border' => [ 1556 'default' => 'solid', 1557 ], 1558 'width' => [ 1559 'default' => [ 1560 'top' => '1', 1561 'right' => '1', 1562 'bottom' => '1', 1563 'left' => '1', 1564 'unit' => 'px', 1565 'isLinked' => true, 1566 ], 1567 ], 1568 'color' => [ 1569 'default' => 'rgba(124, 90, 247, .3)', 1570 ], 1571 ], 1572 ] 1573 ); 1574 1575 $this->add_responsive_control( 1576 'adte_buttons_padding', 1577 [ 1578 'label' => __('Padding', 'advanced-data-table-for-elementor'), 1579 'type' => Controls_Manager::DIMENSIONS, 1580 'size_units' => ['px', '%', 'em'], 1581 'selectors' => [ 1582 '{{WRAPPER}} .adte_search_wrap .dt-buttons .dt-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', 1583 ], 1584 ] 1585 ); 1586 1587 $this->add_responsive_control( 1588 'adte_buttons_border_radius', 1589 [ 1590 'label' => __('Border Radius', 'advanced-data-table-for-elementor'), 1591 'type' => Controls_Manager::DIMENSIONS, 1592 'size_units' => ['px', '%', 'em'], 1593 'selectors' => [ 1594 '{{WRAPPER}} .adte_search_wrap .dt-buttons .dt-button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', 1595 ], 1596 ] 1597 ); 1598 1599 $this->start_controls_tabs( 1600 'adte_buttons_style_tabs' 1601 ); 1602 1603 $this->start_controls_tab( 1604 'adte_buttons_normal_tab', 1605 [ 1606 'label' => esc_html__('Normal', 'advanced-data-table-for-elementor') 1607 ] 1608 ); 1609 1610 $this->add_control( 1611 'adte_buttons_normal_text_color', 1612 [ 1613 'label' => esc_html__('Color', 'advanced-data-table-for-elementor'), 1614 'type' => Controls_Manager::COLOR, 1615 'selectors' => [ 1616 '{{WRAPPER}} .adte_search_wrap .dt-buttons .dt-button' => 'color: {{VALUE}};', 1617 ], 1618 'default' => '#565656' 1619 ] 1620 ); 1621 $this->add_control( 1622 'adte_buttons_normal_bg_color', 1623 [ 1624 'label' => esc_html__('Background Color', 'advanced-data-table-for-elementor'), 1625 'type' => Controls_Manager::COLOR, 1626 'selectors' => [ 1627 '{{WRAPPER}} .adte_search_wrap .dt-buttons .dt-button' => 'background-color: {{VALUE}};', 1628 ], 1629 'default' => '#ffffff' 1630 ] 1631 ); 1632 1633 $this->end_controls_tab(); 1634 1635 $this->start_controls_tab( 1636 'adte_buttons_hover_tab', 1637 [ 1638 'label' => esc_html__('Hover', 'advanced-data-table-for-elementor') 1639 ] 1640 ); 1641 1642 $this->add_control( 1643 'adte_buttons_hover_text_color', 1644 [ 1645 'label' => esc_html__('Color', 'advanced-data-table-for-elementor'), 1646 'type' => Controls_Manager::COLOR, 1647 'selectors' => [ 1648 '{{WRAPPER}} .adte_search_wrap .dt-buttons .dt-button:hover' => 'color: {{VALUE}};', 1649 ], 1650 'default' => '#555555' 1651 ] 1652 ); 1653 $this->add_control( 1654 'adte_buttons_hover_bg_color', 1655 [ 1656 'label' => esc_html__('Background Color', 'advanced-data-table-for-elementor'), 1657 'type' => Controls_Manager::COLOR, 1658 'selectors' => [ 1659 '{{WRAPPER}} .adte_search_wrap .dt-buttons .dt-button:hover' => 'background-color: {{VALUE}};', 1660 ], 1661 'default' => 'rgba(124, 90, 247, .1)' 1662 ] 1663 ); 1664 1665 $this->end_controls_tab(); 1666 1667 $this->end_controls_tabs(); 1668 1669 $this->end_controls_section(); 1670 1671 1672 // Search section 1673 $this->start_controls_section( 1674 'adte_search_style_section', 1675 [ 1676 'label' => esc_html__('Search', 'advanced-data-table-for-elementor'), 1677 'tab' => Controls_Manager::TAB_STYLE, 1678 'condition' => [ 1679 'adte_show_search' => 'yes', 1680 'adte_enable_advanced_settings' => 'yes' 1681 ] 1682 ] 1683 ); 1684 1685 $this->add_control( 1686 'adte_search_icon_heading', 1687 [ 1688 'label' => esc_html__('Icon:', 'advanced-data-table-for-elementor'), 1689 'type' => Controls_Manager::HEADING, 1690 'separator' => 'before' 1691 ] 1692 ); 1693 1694 $this->add_responsive_control( 1695 'adte_search_icon_font_size', 1696 array( 1697 'label' => esc_html__('Font Size', 'advanced-data-table-for-elementor'), 1698 'type' => Controls_Manager::SLIDER, 1699 'size_units' => array( 1700 'px', 1701 'em', 1702 ), 1703 'range' => array( 1704 'px' => array( 1705 'min' => 1, 1706 'max' => 100, 1707 ), 1708 ), 1709 'default' => array( 1710 'size' => 16, 1711 'unit' => 'px', 1712 ), 1713 'selectors' => array( 1714 '{{WRAPPER}} .adte-search-label i' => 'font-size: {{SIZE}}{{UNIT}}', 1715 ), 1716 ) 1717 ); 1718 1719 $this->start_controls_tabs( 1720 'adte_search_button_tabs' 1721 ); 1722 1723 $this->start_controls_tab( 1724 'adte_search_button_tab', 1725 [ 1726 'label' => esc_html__('Normal', 'advanced-data-table-for-elementor'), 1727 ] 1728 ); 1729 $this->add_control( 1730 'adte_search_icon_color', 1731 [ 1732 'label' => esc_html__('Icon Color', 'advanced-data-table-for-elementor'), 1733 'type' => Controls_Manager::COLOR, 1734 'default' => '#0077FF', 1735 'selectors' => [ 1736 '{{WRAPPER}} .adte-search-label svg' => 'stroke: {{VALUE}};', 1737 ], 1738 ] 1739 ); 1740 1741 $this->add_control( 1742 'adte_search_icon_background_color', 1743 [ 1744 'label' => esc_html__('Background Color', 'advanced-data-table-for-elementor'), 1745 'type' => Controls_Manager::COLOR, 1746 'default' => 'rgba(0, 119, 255, .1)', 1747 'selectors' => [ 1748 '{{WRAPPER}} .dt-search label' => 'background-color: {{VALUE}};', 1749 ], 1750 ] 1751 ); 1752 1753 $this->end_controls_tab(); 1754 1755 $this->start_controls_tab( 1756 'adte_search_button_tab_hover', 1757 [ 1758 'label' => esc_html__('Hover', 'advanced-data-table-for-elementor'), 1759 ] 1760 ); 1761 1762 $this->add_control( 1763 'adte_search_icon_color_hover', 1764 [ 1765 'label' => esc_html__('Icon Color', 'advanced-data-table-for-elementor'), 1766 'type' => Controls_Manager::COLOR, 1767 'default' => '#0077FF', 1768 'selectors' => [ 1769 '{{WRAPPER}} .dt-search label:hover i' => 'color: {{VALUE}};', 1770 ], 1771 ] 1772 ); 1773 1774 $this->add_control( 1775 'adte_search_icon_background_color_hover', 1776 [ 1777 'label' => esc_html__('Background Color', 'advanced-data-table-for-elementor'), 1778 'type' => Controls_Manager::COLOR, 1779 'default' => 'rgba(0, 119, 255, .1)', 1780 'selectors' => [ 1781 '{{WRAPPER}} .dt-search label:hover' => 'background-color: {{VALUE}};', 1782 ], 1783 ] 1784 ); 1785 1786 $this->end_controls_tab(); 1787 1788 $this->end_controls_tabs(); 1789 1790 $this->add_responsive_control( 1791 'adte_search_icon_padding', 1792 [ 1793 'label' => esc_html__('Padding', 'advanced-data-table-for-elementor'), 1794 'type' => Controls_Manager::DIMENSIONS, 1795 'size_units' => ['px', '%', 'em'], 1796 'selectors' => [ 1797 '{{WRAPPER}} .dt-search label' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', 1798 ], 1799 ] 1800 ); 1801 1802 $this->add_responsive_control( 1803 'adte_search_icon_margin', 1804 [ 1805 'label' => esc_html__('Margin', 'advanced-data-table-for-elementor'), 1806 'type' => Controls_Manager::DIMENSIONS, 1807 'size_units' => ['px', '%', 'em'], 1808 'selectors' => [ 1809 '{{WRAPPER}} .adte-search-label' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', 1810 ], 1811 ] 1812 ); 1813 1814 $this->add_control( 1815 'adte_search_input_heading', 1816 [ 1817 'label' => esc_html__('Input:', 'advanced-data-table-for-elementor'), 1818 'type' => Controls_Manager::HEADING, 1819 'separator' => 'before' 1820 ] 1821 ); 1822 1823 $this->add_responsive_control( 1824 'adte_search_input_width', 1825 [ 1826 'label' => esc_html__('Width', 'advanced-data-table-for-elementor'), 1827 'type' => Controls_Manager::SLIDER, 1828 'size_units' => ['px', '%'], 1829 'default' => [ 1830 'size' => 400, 1831 'unit' => 'px' 1832 ], 1833 'mobile_default' => [ 1834 'unit' => '%', 1835 'size' => 100, 1836 ], 1837 'range' => [ 1838 'px' => [ 1839 'min' => 0, 1840 'max' => 1000, 1841 'step' => 1, 1842 ], 1843 '%' => [ 1844 'min' => 0, 1845 'max' => 100, 1846 'step' => 1, 1847 ], 1848 ], 1849 'selectors' => [ 1850 '{{WRAPPER}} .adte_search_wrap .dt-search' => 'width: {{SIZE}}{{UNIT}};', 1851 ], 1852 ] 1853 ); 1854 1855 $this->add_responsive_control( 1856 'adte_search_input_padding', 1857 [ 1858 'label' => esc_html__('Padding', 'advanced-data-table-for-elementor'), 1859 'type' => Controls_Manager::DIMENSIONS, 1860 'size_units' => ['px', 'em', '%'], 1861 'default' => [ 1862 'top' => 9, 1863 'bottom' => 9, 1864 'left' => 12, 1865 'right' => 50, 1866 'unit' => 'px' 1867 ], 1868 'selectors' => [ 1869 '{{WRAPPER}} .dt-search input' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', 1870 ], 1871 ] 1872 ); 1873 1874 $this->add_group_control( 1875 Group_Control_Border::get_type(), 1876 [ 1877 'name' => 'adte_search_input_border', 1878 'label' => esc_html__('Border', 'advanced-data-table-for-elementor'), 1879 'selector' => '{{WRAPPER}} .dt-search input', 1880 ] 1881 ); 1882 1883 $this->add_responsive_control( 1884 'adte_search_input_border_radius', 1885 [ 1886 'label' => esc_html__('Border Radius', 'advanced-data-table-for-elementor'), 1887 'type' => Controls_Manager::DIMENSIONS, 1888 'size_units' => ['px', '%'], 1889 'selectors' => [ 1890 '{{WRAPPER}} .dt-search input' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow: hidden;', 1891 ], 1892 ] 1893 ); 1894 1895 $this->add_group_control( 1896 Group_Control_Box_Shadow::get_type(), 1897 [ 1898 'name' => 'adte_search_input_border_shadow', 1899 'selector' => '{{WRAPPER}} .dt-search input', 1900 ] 1901 ); 1902 1903 $this->add_group_control( 1904 Group_Control_Typography::get_type(), 1905 [ 1906 'name' => 'adte_search_input_text_typography', 1907 'label' => esc_html__('Typography', 'advanced-data-table-for-elementor'), 1908 'selector' => '{{WRAPPER}} .dt-search input', 1909 ] 1910 ); 1911 1912 $this->start_controls_tabs( 1913 'adte_search_input_tabs' 1914 ); 1915 1916 $this->start_controls_tab( 1917 'adte_search_input_normal_tab', 1918 [ 1919 'label' => esc_html__('Normal', 'advanced-data-table-for-elementor'), 1920 ] 1921 ); 1922 1923 $this->add_control( 1924 'adte_search_input_color', 1925 [ 1926 'label' => esc_html__('Color', 'advanced-data-table-for-elementor'), 1927 'type' => Controls_Manager::COLOR, 1928 'selectors' => [ 1929 '{{WRAPPER}} .dt-search input' => 'color: {{VALUE}};', 1930 ], 1931 ] 1932 ); 1933 1934 $this->add_control( 1935 'adte_search_input_background_color', 1936 [ 1937 'label' => esc_html__('Background Color', 'advanced-data-table-for-elementor'), 1938 'type' => Controls_Manager::COLOR, 1939 'selectors' => [ 1940 '{{WRAPPER}} .dt-search input' => 'background-color: {{VALUE}};', 1941 ], 1942 ] 1943 ); 1944 1945 1946 $this->end_controls_tab(); 1947 1948 $this->start_controls_tab( 1949 'adte_search_input_hover_tab', 1950 [ 1951 'label' => esc_html__('Hover', 'advanced-data-table-for-elementor'), 1952 ] 1953 ); 1954 1955 $this->add_control( 1956 'adte_search_input_hover_color', 1957 [ 1958 'label' => esc_html__('Color', 'advanced-data-table-for-elementor'), 1959 'type' => Controls_Manager::COLOR, 1960 'selectors' => [ 1961 '{{WRAPPER}} .dt-search input:hover' => 'color: {{VALUE}};', 1962 ], 1963 ] 1964 ); 1965 1966 $this->add_control( 1967 'adte_search_input_hover_background_color', 1968 [ 1969 'label' => esc_html__('Background Color', 'advanced-data-table-for-elementor'), 1970 'type' => Controls_Manager::COLOR, 1971 'selectors' => [ 1972 '{{WRAPPER}} .dt-search input:hover' => 'background-color: {{VALUE}};', 1973 ], 1974 ] 1975 ); 1976 1977 1978 $this->end_controls_tab(); 1979 1980 $this->start_controls_tab( 1981 'adte_search_input_focus_tab', 1982 [ 1983 'label' => esc_html__('Focus', 'advanced-data-table-for-elementor'), 1984 ] 1985 ); 1986 1987 $this->add_control( 1988 'adte_search_input_focus_color', 1989 [ 1990 'label' => esc_html__('Color', 'advanced-data-table-for-elementor'), 1991 'type' => Controls_Manager::COLOR, 1992 'selectors' => [ 1993 '{{WRAPPER}} .dt-search input:focus' => 'color: {{VALUE}};', 1994 ], 1995 ] 1996 ); 1997 1998 $this->add_control( 1999 'adte_search_input_focus_background_color', 2000 [ 2001 'label' => esc_html__('Background Color', 'advanced-data-table-for-elementor'), 2002 'type' => Controls_Manager::COLOR, 2003 'selectors' => [ 2004 '{{WRAPPER}} .dt-search input:focus' => 'background-color: {{VALUE}};', 2005 ], 2006 ] 2007 ); 2008 2009 $this->end_controls_tab(); 2010 2011 $this->end_controls_tabs(); 2012 2013 $this->end_controls_section(); 2014 2015 // Entries 2016 $this->start_controls_section( 2017 'adte_section_entries_style', 2018 [ 2019 'label' => esc_html__('Entries', 'advanced-data-table-for-elementor'), 2020 'tab' => Controls_Manager::TAB_STYLE, 2021 'condition' => [ 2022 'adte_show_entries' => 'yes', 2023 'adte_enable_advanced_settings' => 'yes' 2024 ] 2025 ] 2026 ); 2027 2028 $this->add_group_control( 2029 Group_Control_Background::get_type(), 2030 array( 2031 'name' => 'adte_entries_background', 2032 'selector' => '{{WRAPPER}} .adte_search_wrap .dt-length label, {{WRAPPER}} .adte_search_wrap .dt-length select', 2033 ) 2034 ); 2035 2036 $this->add_responsive_control( 2037 'adte_entries_padding', 2038 [ 2039 'label' => esc_html__('Padding', 'advanced-data-table-for-elementor'), 2040 'type' => Controls_Manager::DIMENSIONS, 2041 'size_units' => ['px', 'em', '%'], 2042 'selectors' => [ 2043 '{{WRAPPER}} .adte_search_wrap .dt-length select' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', 2044 ], 2045 'default' => [ 2046 'top' => '8', 2047 'right' => '15', 2048 'bottom' => '8', 2049 'left' => '15', 2050 'unit' => 'px', 2051 'isLinked' => false, 2052 ] 2053 ] 2054 ); 2055 2056 $this->add_responsive_control( 2057 'adte_entries_margin', 2058 [ 2059 'label' => esc_html__('Margin', 'advanced-data-table-for-elementor'), 2060 'type' => Controls_Manager::DIMENSIONS, 2061 'size_units' => ['px', 'em', '%'], 2062 'selectors' => [ 2063 '{{WRAPPER}} .adte_search_wrap .dt-length' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', 2064 ], 2065 ] 2066 ); 2067 2068 $this->add_group_control( 2069 Group_Control_Border::get_type(), 2070 [ 2071 'name' => 'adte_entries_border', 2072 'label' => esc_html__('Border', 'advanced-data-table-for-elementor'), 2073 'selector' => '{{WRAPPER}} .adte_search_wrap .dt-length label', 2074 ] 2075 ); 2076 2077 $this->add_group_control( 2078 Group_Control_Box_Shadow::get_type(), 2079 [ 2080 'name' => 'adte_entries_box_shadow', 2081 'selector' => '{{WRAPPER}} .adte_search_wrap .dt-length label', 2082 ] 2083 ); 2084 2085 $this->add_control( 2086 'adte_section_entries_label_heading', 2087 [ 2088 'label' => esc_html__('Label:', 'advanced-data-table-for-elementor'), 2089 'type' => Controls_Manager::HEADING, 2090 'separator' => 'before', 2091 ] 2092 ); 2093 2094 $this->add_group_control( 2095 Group_Control_Typography::get_type(), 2096 [ 2097 'name' => 'adte_section_entries_label_typo', 2098 'label' => esc_html__('Typography', 'advanced-data-table-for-elementor'), 2099 'selector' => '{{WRAPPER}} .adte_search_wrap .dt-length label', 2100 ] 2101 ); 2102 2103 $this->add_control( 2104 'adte_section_entries_label_color', 2105 [ 2106 'label' => esc_html__('Color', 'advanced-data-table-for-elementor'), 2107 'type' => Controls_Manager::COLOR, 2108 'selectors' => [ 2109 '{{WRAPPER}} .adte_search_wrap .dt-length label' => 'color: {{VALUE}};', 2110 ], 2111 ] 2112 ); 2113 2114 $this->add_control( 2115 'adte_section_entries_select_heading', 2116 [ 2117 'label' => esc_html__('Select:', 'advanced-data-table-for-elementor'), 2118 'type' => Controls_Manager::HEADING, 2119 'separator' => 'before', 2120 ] 2121 ); 2122 2123 $this->add_group_control( 2124 Group_Control_Typography::get_type(), 2125 [ 2126 'name' => 'adte_section_entries_select_typography', 2127 'label' => esc_html__('Typography', 'advanced-data-table-for-elementor'), 2128 'selector' => '{{WRAPPER}} .adte_search_wrap .dt-length select', 2129 ] 2130 ); 2131 2132 $this->add_control( 2133 'adte_section_entries_select_color', 2134 [ 2135 'label' => esc_html__('Color', 'advanced-data-table-for-elementor'), 2136 'type' => Controls_Manager::COLOR, 2137 'selectors' => [ 2138 '{{WRAPPER}} .adte_search_wrap .dt-length select' => 'color: {{VALUE}};', 2139 ], 2140 ] 2141 ); 2142 2143 $this->add_group_control( 2144 Group_Control_Border::get_type(), 2145 [ 2146 'name' => 'adte_section_entries_select_border', 2147 'label' => esc_html__('Border', 'advanced-data-table-for-elementor'), 2148 'selector' => '{{WRAPPER}} .adte_search_wrap .dt-length select', 2149 ] 2150 ); 2151 $this->end_controls_section(); 2152 2153 2154 // Info section 2155 $this->start_controls_section( 2156 'adte_info_style', 2157 [ 2158 'label' => esc_html__('Info', 'advanced-data-table-for-elementor'), 2159 'tab' => Controls_Manager::TAB_STYLE, 2160 'condition' => [ 2161 'adte_show_info' => 'yes', 2162 'adte_enable_advanced_settings' => 'yes' 2163 ] 2164 ] 2165 ); 2166 2167 $this->add_group_control( 2168 Group_Control_Typography::get_type(), 2169 [ 2170 'name' => 'adte_info_typography', 2171 'label' => esc_html__('Typography', 'advanced-data-table-for-elementor'), 2172 'selector' => '{{WRAPPER}} .adte_pagination_wrap .dt-info', 2173 ] 2174 ); 2175 2176 $this->start_controls_tabs( 2177 'adte_info_style_tabs' 2178 ); 2179 2180 $this->start_controls_tab( 2181 'adte_info_style_normal_tab', 2182 [ 2183 'label' => esc_html__('Normal', 'advanced-data-table-for-elementor') 2184 ] 2185 ); 2186 2187 $this->add_control( 2188 'adte_info_style_normal_color', 2189 [ 2190 'label' => esc_html__('Color', 'advanced-data-table-for-elementor'), 2191 'type' => Controls_Manager::COLOR, 2192 'selectors' => [ 2193 '{{WRAPPER}} .dt-info' => 'color: {{VALUE}};', 2194 ], 2195 ] 2196 ); 2197 2198 $this->end_controls_tab(); 2199 2200 $this->start_controls_tab( 2201 'adte_info_style_hover_tab', 2202 [ 2203 'label' => esc_html__('Hover', 'advanced-data-table-for-elementor') 2204 ] 2205 ); 2206 2207 $this->add_control( 2208 'adte_info_style_hover_color', 2209 [ 2210 'label' => esc_html__('Color', 'advanced-data-table-for-elementor'), 2211 'type' => Controls_Manager::COLOR, 2212 'selectors' => [ 2213 '{{WRAPPER}} .dt-info:hover' => 'color: {{VALUE}};', 2214 ], 2215 ] 2216 ); 2217 2218 $this->end_controls_tab(); 2219 2220 $this->end_controls_tabs(); 2221 2222 $this->end_controls_section(); 2223 2224 2225 // Pagination section 2226 $this->start_controls_section( 2227 'adte_pagination_style', 2228 [ 2229 'label' => esc_html__('Pagination', 'advanced-data-table-for-elementor'), 2230 'tab' => Controls_Manager::TAB_STYLE, 2231 'condition' => [ 2232 'adte_enable_pagination' => 'yes', 2233 'adte_enable_advanced_settings' => 'yes' 2234 ] 2235 ] 2236 ); 2237 2238 $this->add_responsive_control( 2239 'adte_pagination_number_height', 2240 [ 2241 'label' => esc_html__('Height', 'advanced-data-table-for-elementor'), 2242 'type' => Controls_Manager::SLIDER, 2243 'size_units' => ['px'], 2244 'range' => [ 2245 'px' => [ 2246 'min' => 0, 2247 'max' => 100, 2248 'step' => 1, 2249 ] 2250 ], 2251 'default' => [ 2252 'unit' => 'px', 2253 'size' => 40, 2254 ], 2255 'selectors' => [ 2256 '{{WRAPPER}} .adte_pagination_wrap .dt-paging .dt-paging-button, {{WRAPPER}} .adte_pagination_wrap .dt-paging .dt-paging-button' => 'height: {{SIZE}}{{UNIT}};', 2257 ], 2258 ] 2259 ); 2260 2261 $this->add_responsive_control( 2262 'adte_pagination_number_width', 2263 [ 2264 'label' => esc_html__('Width', 'advanced-data-table-for-elementor'), 2265 'type' => Controls_Manager::SLIDER, 2266 'size_units' => ['px', 'em'], 2267 'range' => [ 2268 'px' => [ 2269 'min' => 0, 2270 'max' => 100, 2271 'step' => 1, 2272 ] 2273 ], 2274 'default' => [ 2275 'unit' => 'px', 2276 'size' => 40, 2277 ], 2278 'selectors' => [ 2279 '{{WRAPPER}} .adte_pagination_wrap .dt-paging .dt-paging-button, {{WRAPPER}} .adte_pagination_wrap .dt-paging .dt-paging-button' => 'width: {{SIZE}}{{UNIT}};', 2280 ], 2281 ] 2282 ); 2283 2284 $this->add_responsive_control( 2285 'adte_pagination_gap', 2286 array( 2287 'label' => esc_html__('Gap', 'advanced-data-table-for-elementor'), 2288 'type' => Controls_Manager::SLIDER, 2289 'size_units' => array( 2290 'px', 2291 'em', 2292 'rem', 2293 ), 2294 'range' => array( 2295 'px' => array( 2296 'min' => 1, 2297 'max' => 100, 2298 ), 2299 ), 2300 'default' => array( 2301 'size' => 10, 2302 'unit' => 'px', 2303 ), 2304 'selectors' => array( 2305 '{{WRAPPER}} .adte_pagination_wrap .dt-paging nav' => 'gap: {{SIZE}}{{UNIT}}', 2306 ), 2307 ) 2308 ); 2309 2310 $this->add_group_control( 2311 Group_Control_Typography::get_type(), 2312 [ 2313 'name' => 'adte_pagination_typography', 2314 'label' => esc_html__('Typography', 'advanced-data-table-for-elementor'), 2315 'selector' => '{{WRAPPER}} .adte_pagination_wrap .dt-paging .dt-paging-button:not(.next,.previous)', 2316 ] 2317 ); 2318 2319 $this->add_group_control( 2320 Group_Control_Border::get_type(), 2321 [ 2322 'name' => 'adte_pagination_border', 2323 'label' => esc_html__('Border', 'advanced-data-table-for-elementor'), 2324 'selector' => '{{WRAPPER}} .dt-paging .dt-paging-button:not(.next,.previous)', 2325 'fields_options' => [ 2326 'border' => [ 2327 'default' => 'solid', 2328 ], 2329 'width' => [ 2330 'default' => [ 2331 'top' => '1', 2332 'right' => '1', 2333 'bottom' => '1', 2334 'left' => '1', 2335 'unit' => 'px', 2336 'isLinked' => true, 2337 ], 2338 ], 2339 'color' => [ 2340 'default' => '#0077FF', 2341 ], 2342 ], 2343 ], 2344 ); 2345 2346 $this->add_responsive_control( 2347 'adte_pagination_border_radius', 2348 [ 2349 'label' => __('Border Radius', 'advanced-data-table-for-elementor'), 2350 'type' => Controls_Manager::DIMENSIONS, 2351 'size_units' => ['px', '%'], 2352 'selectors' => [ 2353 '{{WRAPPER}} .dt-paging .dt-paging-button:not(.next,.previous)' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', 2354 ], 2355 'default' => [ 2356 'top' => '5', 2357 'right' => '5', 2358 'bottom' => '5', 2359 'left' => '5', 2360 'unit' => 'px', 2361 'isLinked' => true, 2362 ] 2363 ] 2364 ); 2365 2366 $this->start_controls_tabs( 2367 'adte_pagination_style_tabs' 2368 ); 2369 2370 $this->start_controls_tab( 2371 'adte_pagination_normal_tab', 2372 [ 2373 'label' => esc_html__('Normal', 'advanced-data-table-for-elementor') 2374 ] 2375 ); 2376 2377 $this->add_control( 2378 'adte_pagination_normal_text_color', 2379 [ 2380 'label' => esc_html__('Color', 'advanced-data-table-for-elementor'), 2381 'type' => Controls_Manager::COLOR, 2382 'selectors' => [ 2383 '{{WRAPPER}} .dt-paging .dt-paging-button:not(.next,.previous)' => 'color: {{VALUE}};', 2384 ], 2385 'default' => '#0077FF' 2386 ] 2387 ); 2388 $this->add_control( 2389 'adte_pagination_normal_bg_color', 2390 [ 2391 'label' => esc_html__('Background Color', 'advanced-data-table-for-elementor'), 2392 'type' => Controls_Manager::COLOR, 2393 'selectors' => [ 2394 '{{WRAPPER}} .dt-paging .dt-paging-button:not(.next,.previous)' => 'background-color: {{VALUE}};', 2395 ], 2396 'default' => '#FFFFFF' 2397 ] 2398 ); 2399 2400 $this->end_controls_tab(); 2401 2402 $this->start_controls_tab( 2403 'adte_pagination_hover_tab', 2404 [ 2405 'label' => esc_html__('Hover', 'advanced-data-table-for-elementor') 2406 ] 2407 ); 2408 2409 $this->add_control( 2410 'adte_pagination_hover_text_color', 2411 [ 2412 'label' => esc_html__('Color', 'advanced-data-table-for-elementor'), 2413 'type' => Controls_Manager::COLOR, 2414 'selectors' => [ 2415 '{{WRAPPER}} .dt-paging .dt-paging-button:not(.next,.previous):hover' => 'color: {{VALUE}};', 2416 ], 2417 'default' => '#FFFFFF' 2418 ] 2419 ); 2420 $this->add_control( 2421 'adte_pagination_hover_bg_color', 2422 [ 2423 'label' => esc_html__('Background Color', 'advanced-data-table-for-elementor'), 2424 'type' => Controls_Manager::COLOR, 2425 'selectors' => [ 2426 '{{WRAPPER}} .dt-paging .dt-paging-button:not(.next,.previous):hover' => 'background-color: {{VALUE}};', 2427 ], 2428 'default' => '#0077FF' 2429 ] 2430 ); 2431 $this->add_control( 2432 'adte_pagination_hover_border_color', 2433 [ 2434 'label' => esc_html__('Border Color', 'advanced-data-table-for-elementor'), 2435 'type' => Controls_Manager::COLOR, 2436 'selectors' => [ 2437 '{{WRAPPER}} .dt-paging .dt-paging-button:not(.next,.previous):hover' => 'border-color: {{VALUE}};', 2438 ], 2439 'default' => '#0077FF' 2440 ] 2441 ); 2442 $this->end_controls_tab(); 2443 2444 $this->start_controls_tab( 2445 'adte_pagination_active_tab', 2446 [ 2447 'label' => esc_html__('Active', 'advanced-data-table-for-elementor') 2448 ] 2449 ); 2450 2451 $this->add_control( 2452 'adte_pagination_active_text_color', 2453 [ 2454 'label' => esc_html__('Color', 'advanced-data-table-for-elementor'), 2455 'type' => Controls_Manager::COLOR, 2456 'selectors' => [ 2457 '{{WRAPPER}} .dt-paging .dt-paging-button.current' => 'color: {{VALUE}};', 2458 '{{WRAPPER}} .dt-paging .dt-paging-button:not(.next,.previous):focus' => 'color: {{VALUE}};', 2459 ], 2460 'default' => '#FFFFFF' 2461 ] 2462 ); 2463 $this->add_control( 2464 'adte_pagination_active_bg_color', 2465 [ 2466 'label' => esc_html__('Background Color', 'advanced-data-table-for-elementor'), 2467 'type' => Controls_Manager::COLOR, 2468 'selectors' => [ 2469 '{{WRAPPER}} .dt-paging .dt-paging-button.current' => 'background-color: {{VALUE}};', 2470 '{{WRAPPER}} .dt-paging .dt-paging-button:not(.next,.previous):focus' => 'background-color: {{VALUE}};', 2471 ], 2472 'default' => '#0077FF' 2473 ] 2474 ); 2475 $this->end_controls_tab(); 2476 2477 $this->end_controls_tabs(); 2478 2479 $this->add_control( 2480 'adte_pagination_prev_next_heading', 2481 [ 2482 'label' => esc_html__('Next and Previous Button Settings', 'advanced-data-table-for-elementor'), 2483 'type' => Controls_Manager::HEADING, 2484 'separator' => 'before' 2485 ] 2486 ); 2487 2488 $this->add_responsive_control( 2489 'adte_pagination_prev_next_button_width', 2490 [ 2491 'label' => esc_html__('Width', 'advanced-data-table-for-elementor'), 2492 'type' => Controls_Manager::SLIDER, 2493 'size_units' => ['px'], 2494 'range' => [ 2495 'px' => [ 2496 'min' => 0, 2497 'max' => 100, 2498 'step' => 1, 2499 ] 2500 ], 2501 'default' => [ 2502 'unit' => 'px', 2503 'size' => 40, 2504 ], 2505 'selectors' => [ 2506 '{{WRAPPER}} .adte_pagination_wrap .dt-paging .dt-paging-button.next, {{WRAPPER}} .adte_pagination_wrap .dt-paging .dt-paging-button.previous' => 'width: {{SIZE}}{{UNIT}};', 2507 ], 2508 ] 2509 ); 2510 2511 $this->add_responsive_control( 2512 'adte_pagination_prev_next_button_height', 2513 [ 2514 'label' => esc_html__('Height', 'advanced-data-table-for-elementor'), 2515 'type' => Controls_Manager::SLIDER, 2516 'size_units' => ['px'], 2517 'range' => [ 2518 'px' => [ 2519 'min' => 0, 2520 'max' => 100, 2521 'step' => 1, 2522 ] 2523 ], 2524 'default' => [ 2525 'unit' => 'px', 2526 'size' => 40, 2527 ], 2528 'selectors' => [ 2529 '{{WRAPPER}} .adte_pagination_wrap .dt-paging .dt-paging-button.next, {{WRAPPER}} .adte_pagination_wrap .dt-paging .dt-paging-button.previous' => 'height: {{SIZE}}{{UNIT}};', 2530 ], 2531 ] 2532 ); 2533 2534 $this->add_group_control( 2535 Group_Control_Typography::get_type(), 2536 [ 2537 'name' => 'adte_pagination_next_prev_typography', 2538 'label' => esc_html__('Typography', 'advanced-data-table-for-elementor'), 2539 'selector' => '{{WRAPPER}} .adte_pagination_wrap .dt-paging .dt-paging-button.next, {{WRAPPER}} .adte_pagination_wrap .dt-paging .dt-paging-button.previous', 2540 ] 2541 ); 2542 2543 $this->add_control( 2544 'adte_pagination_icon_size', 2545 [ 2546 'label' => esc_html__('Icon Size', 'advanced-data-table-for-elementor'), 2547 'type' => Controls_Manager::SLIDER, 2548 'size_units' => ['px'], 2549 'range' => [ 2550 'px' => [ 2551 'min' => 0, 2552 'max' => 100, 2553 'step' => 1, 2554 ] 2555 ], 2556 'default' => [ 2557 'unit' => 'px', 2558 'size' => 18, 2559 ], 2560 'selectors' => [ 2561 '{{WRAPPER}} .dt-paging .dt-paging-button.next svg' => 'width: {{SIZE}}{{UNIT}};height: {{SIZE}}{{UNIT}};', 2562 '{{WRAPPER}} .dt-paging .dt-paging-button.previous svg' => 'width: {{SIZE}}{{UNIT}};height: {{SIZE}}{{UNIT}};' 2563 ], 2564 'condition' => [ 2565 'adte_pagination_type' => 'icon' 2566 ] 2567 ] 2568 ); 2569 2570 2571 $this->add_responsive_control( 2572 'adte_pagination_next_prev_border_radius', 2573 [ 2574 'label' => __('Border Radius', 'advanced-data-table-for-elementor'), 2575 'type' => Controls_Manager::DIMENSIONS, 2576 'size_units' => ['px', '%'], 2577 'selectors' => [ 2578 '{{WRAPPER}} .dt-paging .dt-paging-button.previous' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', 2579 '{{WRAPPER}} .dt-paging .dt-paging-button.next' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', 2580 ], 2581 'default' => [ 2582 'top' => '5', 2583 'right' => '5', 2584 'bottom' => '5', 2585 'left' => '5', 2586 'unit' => 'px', 2587 'isLinked' => true, 2588 ], 2589 ] 2590 ); 2591 2592 $this->add_group_control( 2593 Group_Control_Border::get_type(), 2594 [ 2595 'name' => 'adte_pagination_next_prev_border', 2596 'label' => esc_html__('Border', 'advanced-data-table-for-elementor'), 2597 'selector' => '{{WRAPPER}} .dt-paging .dt-paging-button.next, {{WRAPPER}} .dt-paging .dt-paging-button.previous', 2598 'fields_options' => [ 2599 'border' => [ 2600 'default' => 'solid', 2601 ], 2602 'width' => [ 2603 'default' => [ 2604 'top' => '1', 2605 'right' => '1', 2606 'bottom' => '1', 2607 'left' => '1', 2608 'unit' => 'px', 2609 'isLinked' => true, 2610 ], 2611 ], 2612 'color' => [ 2613 'default' => '#0077FF', 2614 ], 2615 ], 2616 ] 2617 ); 2618 2619 $this->start_controls_tabs( 2620 'adte_pagination_next_prev_style_tabs' 2621 ); 2622 2623 $this->start_controls_tab( 2624 'adte_pagination_nex_prev_normal_tab', 2625 [ 2626 'label' => esc_html__('Normal', 'advanced-data-table-for-elementor') 2627 ] 2628 ); 2629 2630 $this->add_control( 2631 'adte_pagination_nex_prev_normal_text_color', 2632 [ 2633 'label' => esc_html__('Color', 'advanced-data-table-for-elementor'), 2634 'type' => Controls_Manager::COLOR, 2635 'selectors' => [ 2636 '{{WRAPPER}} .dt-paging .dt-paging-button.next' => 'color: {{VALUE}};', 2637 '{{WRAPPER}} .dt-paging .dt-paging-button.previous' => 'color: {{VALUE}};', 2638 ], 2639 'default' => '#0077FF' 2640 ] 2641 ); 2642 $this->add_control( 2643 'adte_pagination_nex_prev_normal_bg_color', 2644 [ 2645 'label' => esc_html__('Background Color', 'advanced-data-table-for-elementor'), 2646 'type' => Controls_Manager::COLOR, 2647 'selectors' => [ 2648 '{{WRAPPER}} .dt-paging .dt-paging-button.next' => 'background-color: {{VALUE}};', 2649 '{{WRAPPER}} .dt-paging .dt-paging-button.previous' => 'background-color: {{VALUE}};', 2650 ], 2651 'default' => '#FFFFFF' 2652 ] 2653 ); 2654 2655 $this->end_controls_tab(); 2656 2657 $this->start_controls_tab( 2658 'adte_pagination_next_prev_hover_tab', 2659 [ 2660 'label' => esc_html__('Hover', 'advanced-data-table-for-elementor') 2661 ] 2662 ); 2663 2664 $this->add_control( 2665 'adte_pagination_nex_prev_hover_text_color', 2666 [ 2667 'label' => esc_html__('Color', 'advanced-data-table-for-elementor'), 2668 'type' => Controls_Manager::COLOR, 2669 'selectors' => [ 2670 '{{WRAPPER}} .dt-paging .dt-paging-button.next:hover' => 'color: {{VALUE}};', 2671 '{{WRAPPER}} .dt-paging .dt-paging-button.previous:hover' => 'color: {{VALUE}};', 2672 ], 2673 'default' => '#FFFFFF' 2674 ] 2675 ); 2676 $this->add_control( 2677 'adte_pagination_nex_prev_hover_bg_color', 2678 [ 2679 'label' => esc_html__('Background Color', 'advanced-data-table-for-elementor'), 2680 'type' => Controls_Manager::COLOR, 2681 'selectors' => [ 2682 '{{WRAPPER}} .dt-paging .dt-paging-button.next:hover' => 'background-color: {{VALUE}};', 2683 '{{WRAPPER}} .dt-paging .dt-paging-button.previous:hover' => 'background-color: {{VALUE}};', 2684 ], 2685 'default' => '#0077FF' 2686 ] 2687 ); 2688 $this->end_controls_tab(); 2689 2690 $this->end_controls_tabs(); 504 2691 505 2692 $this->end_controls_section(); … … 517 2704 $settings = $this->get_settings_for_display(); 518 2705 2706 $table_settings = [ 2707 'search' => ($settings['adte_show_search'] == 'yes') ? true : false, 2708 'responsive' => ($settings['adte_enable_responsive'] == 'yes') ? true : false, 2709 'search_placeholder' => $settings['adte_search_placeholder_text'] ? $settings['adte_search_placeholder_text'] : '', 2710 'pagination' => $settings['adte_enable_pagination'] == 'yes' ? true : false, 2711 'button' => $settings['adte_show_buttons'] == 'yes' ? true : false, 2712 'entries' => $settings['adte_show_entries'] == 'yes' ? true : false, 2713 'info' => $settings['adte_show_info'] == 'yes' ? true : false, 2714 'sort' => $settings['adte_enable_sort'] == 'yes' ? true : false, 2715 'rows_per_page' => $settings['adte_show_rows_per_page'] ? $settings['adte_show_rows_per_page'] : false, 2716 'nav_style' => $settings['adte_pagination_type'] ? $settings['adte_pagination_type'] : false, 2717 'next_text' => $settings['adte_pagination_next_text'] ? $settings['adte_pagination_next_text'] : false, 2718 'prev_text' => $settings['adte_pagination_prev_text'] ? $settings['adte_pagination_prev_text'] : false, 2719 ]; 2720 2721 $this->add_render_attribute('table', 'data-settings', wp_json_encode($table_settings)); 2722 2723 $responsive_class = ''; 2724 if ($settings['adte_enable_advanced_settings'] == '' && $settings['adte_enable_responsive'] == '') { 2725 $responsive_class = ' adte_responsive_scroll'; 2726 } 519 2727 ?> 520 521 <table class="adte_table"> 2728 <div class="adte_table_wrapper adte_data_type-<?php echo esc_attr($settings['adte_data_source']); ?><?php echo esc_attr($responsive_class); ?>" <?php echo $this->get_render_attribute_string('table'); ?>> 2729 <?php $this->get_table_content($settings); ?> 2730 </div> 2731 <?php 2732 } 2733 2734 public function get_table_content($settings) { 2735 2736 if ('static' == $settings['adte_data_source']) { 2737 return $this->static_table_render($settings); 2738 } 2739 2740 $content = apply_filters('adte/advanced-data-table/table_html/integration/' . $settings['adte_data_source'], $settings); 2741 2742 if (is_array($content)) { 2743 return ''; 2744 } 2745 return $content; 2746 } 2747 2748 public function is_rowCol_span_used($settings) { 2749 $data = $settings['table_body']; 2750 $keys = ['col_span', 'row_span']; 2751 2752 foreach ($data as $item) { 2753 foreach ($keys as $key) { 2754 if (isset($item[$key]) && !empty($item[$key])) { 2755 return false; 2756 } 2757 } 2758 } 2759 return true; 2760 } 2761 2762 public function equql_columns_for_static_table($settings) { 2763 $header_column = count($settings['table_header']); 2764 2765 $items = count($settings['table_body']); 2766 $rowCount = 0; 2767 2768 foreach ($settings['table_body'] as $row) { 2769 $isRow = ($row['adte_table_row'] === 'Row') ? 1 : 0; 2770 $rowCount += $isRow; 2771 } 2772 2773 $is_row_match = $rowCount ? ($items % $rowCount == 0) : false; 2774 2775 if (($items % $header_column == 0) && $is_row_match && (($rowCount * $header_column) == $items)) { 2776 return true; 2777 } 2778 2779 return false; 2780 } 2781 2782 protected function static_table_render($settings) { 2783 $table_init_class = ''; 2784 2785 if ('static' == $settings['adte_data_source'] && $this->equql_columns_for_static_table($settings) && $this->is_rowCol_span_used($settings) && $settings['adte_enable_advanced_settings'] == 'yes') { 2786 $table_init_class = 'adte_table_init'; 2787 } 2788 ?> 2789 <table class="adte_table <?php echo esc_attr($table_init_class); ?>"> 522 2790 <thead class="adte_table_header"> 523 2791 <tr> 524 2792 <?php 525 foreach ($settings['table_header'] as $key => $item) { 526 echo '<th>' . esc_attr($item['text']) . '</th>'; 2793 foreach ($settings['table_header'] as $index => $item) { 2794 $table_header_key = $this->get_repeater_setting_key('text', 'table_header', $index); 2795 2796 $this->add_render_attribute($table_header_key, 'class', 'elementor-repeater-item-' . esc_attr($item['_id'])); 2797 2798 if ($settings['adte_enable_sort'] == 'yes') { 2799 $this->add_render_attribute($table_header_key, 'class', 'sorting'); 2800 } 2801 2802 $colspan = ($item['col_span'] == 'yes' && $item['advance'] == 'yes') ? 'colSpan="' . esc_attr($item['col_span_number']) . '"' : ''; 2803 2804 echo '<th ' . wp_kses_post($colspan) . ' ' . wp_kses_post($this->get_render_attribute_string($table_header_key)) . '>'; 2805 2806 switch ($item['header_content_type']) { 2807 case 'icon': 2808 Icons_Manager::render_icon($item['icon'], ['aria-hidden' => 'true']); 2809 break; 2810 default: 2811 echo wp_kses_post($item['text']); 2812 break; 2813 } 2814 2815 echo '</th>'; 527 2816 } 528 2817 ?> … … 532 2821 <tr> 533 2822 <?php 534 foreach ($settings['table_body'] as $key => $item) { 535 if ($item['row'] == 'yes') { 2823 $i = 0; 2824 foreach ($settings['table_body'] as $index => $item) { 2825 $i++; 2826 $table_body_key = $this->get_repeater_setting_key('text', 'table_body', $index); 2827 2828 $this->add_render_attribute($table_body_key, 'class', 'elementor-repeater-item-' . esc_attr($item['_id'])); 2829 $this->add_render_attribute($table_body_key, 'class', 'td-content-type-' . esc_attr($item['body_content_type'])); 2830 2831 if ($item['adte_table_row'] == 'Row' && $i != 1) { 536 2832 echo '</tr><tr>'; 537 2833 } … … 541 2837 $row_span = ($item['row_span'] == 'yes' & $item['advance'] == 'yes') ? 'rowSpan="' . esc_attr($item['row_span_number']) . '"' : ''; 542 2838 543 echo '<td ' . $col_span . ' ' . $row_span . ' >';2839 echo '<td ' . $col_span . ' ' . $row_span . ' ' . wp_kses_post($this->get_render_attribute_string($table_body_key)) . '>'; 544 2840 545 2841 switch ($item['body_content_type']) { 546 2842 case 'editor': 547 2843 echo wp_kses_post($item['text_editor']); 2844 break; 2845 case 'icon': 2846 Icons_Manager::render_icon($item['icon'], ['aria-hidden' => 'true']); 548 2847 break; 549 2848 default:
Note: See TracChangeset
for help on using the changeset viewer.