PluginProbe ʕ •ᴥ•ʔ
Essential Addons for Elementor – Popular Elementor Templates & Widgets / 5.8.7
Essential Addons for Elementor – Popular Elementor Templates & Widgets v5.8.7
6.6.5 6.6.4 6.6.3 5.7.3 5.7.4 5.8.0 5.8.1 5.8.10 5.8.11 5.8.12 5.8.13 5.8.14 5.8.15 5.8.16 5.8.18 5.8.2 5.8.3 5.8.4 5.8.5 5.8.6 5.8.7 5.8.8 5.8.9 5.9.0 5.9.1 5.9.10 5.9.11 5.9.12 5.9.13 5.9.14 5.9.15 5.9.16 5.9.17 5.9.18 5.9.19 5.9.2 5.9.20 5.9.21 5.9.22 5.9.23 5.9.24 5.9.25 5.9.26 5.9.27 5.9.3 5.9.4 5.9.5 5.9.6 5.9.7 5.9.8 5.9.9 6.0.0 6.0.1 6.0.10 6.0.11 6.0.12 6.0.13 6.0.14 6.0.15 6.0.2 6.0.3 6.0.4 6.0.5 6.0.6 6.0.7 6.0.8 6.0.9 6.1.0 6.1.1 6.1.10 6.1.11 trunk 6.1.12 1.0.0 6.1.13 1.0.1 6.1.14 1.1.0 6.1.15 2.0 6.1.17 2.1 6.1.18 2.10.0 6.1.19 2.10.1 6.1.2 2.10.2 6.1.20 2.10.3 6.1.3 2.10.4 6.1.4 2.10.5 6.1.5 2.2.0 6.1.6 2.2.1 6.1.7 2.2.2 6.1.8 2.2.3 6.1.9 2.2.4 6.2.0 2.2.5 6.2.1 2.3.0 6.2.2 2.3.1 6.2.3 2.4.0 6.2.4 2.4.1 6.3.0 2.4.2 6.3.1 2.4.3 6.3.2 2.5.0 6.3.3 2.6.0 6.4.0 2.7.0 6.5.0 2.7.1 6.5.1 2.7.10 6.5.10 2.7.11 6.5.11 2.7.2 6.5.12 2.7.3 6.5.13 2.7.4 6.5.2 2.7.5 6.5.3 2.7.6 6.5.4 2.7.7 6.5.5 2.7.8 6.5.6 2.7.9 6.5.7 2.8.0 6.5.8 2.8.1 6.5.9 2.8.2 6.6.0 2.8.3 6.6.1 2.8.4 6.6.2 2.8.5 2.8.6 2.8.7 2.9.0 2.9.1 2.9.2 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8 2.9.9 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.4.1 3.1.5 3.2.0 3.3.0 3.3.1 3.3.2 3.3.3 3.4.0 3.5.0 3.5.1 3.5.2 3.6.0 3.6.1 3.6.2 3.7.0 3.7.1 3.7.2 3.8.0 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.9.0 3.9.1 3.9.2 3.9.3 3.9.4 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.1.0 4.1.1 4.1.2 4.2.0 4.2.1 4.2.2 4.2.3 4.2.4 4.3.0 4.3.1 4.3.2 4.3.3 4.3.4 4.3.5 4.3.6 4.3.7 4.3.8 4.3.9 4.4.0 4.4.1 4.5.0 4.5.1 4.5.2 4.5.3 4.5.4 4.5.5 4.6.0 4.6.1 4.6.2 4.6.3 4.6.4 4.6.5 4.6.6 4.7.0 4.7.1 4.7.2 4.7.3 4.7.4 4.7.5 4.8.0 4.8.1 4.8.2 4.8.3 4.8.4 4.9.0 4.9.1 4.9.2 4.9.3 4.9.4 4.9.5 4.9.6 4.9.7 5.0.0 5.0.1 5.0.10 5.0.11 5.0.12 5.0.13 5.0.2 5.0.3 5.0.4 5.0.5 5.0.6 5.0.7 5.0.8 5.0.9 5.1.0 5.1.1 5.1.2 5.1.3 5.1.4 5.1.5 5.1.6 5.1.7 5.1.8 5.1.9 5.2.0 5.2.1 5.2.2 5.2.3 5.2.4 5.3.0 5.3.1 5.3.2 5.4.6 5.5.5 5.6.5 5.7.2
essential-addons-for-elementor-lite / includes / Elements / Data_Table.php
essential-addons-for-elementor-lite / includes / Elements Last commit date
Adv_Accordion.php 2 years ago Adv_Tabs.php 2 years ago Advanced_Data_Table.php 2 years ago Better_Payment.php 4 years ago Betterdocs_Category_Box.php 2 years ago Betterdocs_Category_Grid.php 2 years ago Betterdocs_Search_Form.php 2 years ago Business_Reviews.php 2 years ago Caldera_Forms.php 2 years ago Career_Page.php 4 years ago Contact_Form_7.php 2 years ago Content_Ticker.php 2 years ago Countdown.php 2 years ago Creative_Button.php 2 years ago Crowdfundly_All_Campaign.php 4 years ago Crowdfundly_Organization.php 4 years ago Crowdfundly_Single_Campaign.php 4 years ago Cta_Box.php 2 years ago Data_Table.php 2 years ago Dual_Color_Header.php 2 years ago EmbedPress.php 4 years ago Event_Calendar.php 2 years ago Facebook_Feed.php 2 years ago Fancy_Text.php 2 years ago Feature_List.php 2 years ago Filterable_Gallery.php 2 years ago Flip_Box.php 2 years ago FluentForm.php 2 years ago Formstack.php 2 years ago GravityForms.php 2 years ago Image_Accordion.php 2 years ago Info_Box.php 2 years ago Interactive_Circle.php 2 years ago Login_Register.php 2 years ago NFT_Gallery.php 2 years ago NinjaForms.php 2 years ago Post_Grid.php 2 years ago Post_Timeline.php 2 years ago Pricing_Table.php 2 years ago Product_Grid.php 2 years ago Progress_Bar.php 2 years ago SVG_Draw.php 3 years ago Simple_Menu.php 2 years ago Sticky_Video.php 2 years ago Team_Member.php 2 years ago Testimonial.php 2 years ago Tooltip.php 2 years ago Twitter_Feed.php 2 years ago TypeForm.php 2 years ago WeForms.php 2 years ago Woo_Cart.php 2 years ago Woo_Checkout.php 2 years ago Woo_Product_Carousel.php 2 years ago Woo_Product_Compare.php 4 years ago Woo_Product_Gallery.php 2 years ago Woocommerce_Review.php 4 years ago WpForms.php 2 years ago index.php 3 years ago
Data_Table.php
1473 lines
1 <?php
2
3 namespace Essential_Addons_Elementor\Elements;
4
5 // If this file is called directly, abort.
6 if (!defined('ABSPATH')) {
7 exit;
8 }
9
10 use \Elementor\Controls_Manager;
11 use \Elementor\Group_Control_Border;
12 use \Elementor\Group_Control_Typography;
13 use \Elementor\Plugin;
14 use \Elementor\Utils;
15 use \Elementor\Widget_Base;
16 use \Elementor\Repeater;
17 use Elementor\Icons_Manager;
18
19 use \Essential_Addons_Elementor\Classes\Helper;
20
21 class Data_Table extends Widget_Base {
22
23
24 public $unique_id = null;
25 public function get_name()
26 {
27 return 'eael-data-table';
28 }
29
30 public function get_title()
31 {
32 return esc_html__('Data Table', 'essential-addons-for-elementor-lite');
33 }
34
35 public function get_icon()
36 {
37 return 'eaicon-data-table';
38 }
39
40 public function get_categories()
41 {
42 return ['essential-addons-elementor'];
43 }
44
45 public function get_keywords()
46 {
47 return [
48 'table',
49 'ea table',
50 'data table',
51 'ea data table',
52 'export eable',
53 'CSV',
54 'comparison table',
55 'grid',
56 'ea',
57 'essential addons',
58 ];
59 }
60
61 public function get_custom_help_url()
62 {
63 return 'https://essential-addons.com/elementor/docs/data-table/';
64 }
65
66 protected function register_controls()
67 {
68
69 /**
70 * Data Table Header
71 */
72 $this->start_controls_section(
73 'eael_section_data_table_header',
74 [
75 'label' => esc_html__('Header', 'essential-addons-for-elementor-lite')
76 ]
77 );
78
79 do_action('eael_section_data_table_enabled', $this);
80
81 if (!apply_filters('eael/pro_enabled', false)) {
82
83 $this->add_control(
84 'eael_section_data_table_enabled', [
85 'label' => sprintf( __( 'Enable Table Sorting %s', 'essential-addons-for-elementor-lite' ), __( '<i class="eael-pro-labe eicon-pro-icon"></i>', 'essential-addons-for-elementor-lite' ) ),
86 'type' => Controls_Manager::SWITCHER,
87 'label_on' => esc_html__( 'Yes', 'essential-addons-for-elementor-lite' ),
88 'label_off' => esc_html__( 'No', 'essential-addons-for-elementor-lite' ),
89 'return_value' => 'true',
90 'classes' => 'eael-pro-control',
91 ] );
92
93 $this->add_control(
94 'eael_pricing_table_style_pro_alert',
95 [
96 'label' => esc_html__('Sorting feature is available in pro version!', 'essential-addons-for-elementor-lite'),
97 'type' => Controls_Manager::HEADING,
98 'condition' => [
99 'eael_section_data_table_enabled' => 'true',
100 ]
101 ]
102 );
103 }
104
105 $repeater = new Repeater();
106
107 $repeater->add_control(
108 'eael_data_table_header_col',
109 [
110 'label' => esc_html__('Column Name', 'essential-addons-for-elementor-lite'),
111 'default' => esc_html__('Table Header', 'essential-addons-for-elementor-lite'),
112 'type' => Controls_Manager::TEXT,
113 'dynamic' => ['active' => true],
114 'label_block' => false,
115 'ai' => [
116 'active' => false,
117 ],
118 ]
119 );
120
121 $repeater->add_control(
122 'eael_data_table_header_col_span',
123 [
124 'label' => esc_html__('Column Span', 'essential-addons-for-elementor-lite'),
125 'default' => '',
126 'type' => Controls_Manager::TEXT,
127 'dynamic' => ['active' => true],
128 'label_block' => false,
129 'ai' => [
130 'active' => false,
131 ],
132 ]
133 );
134
135 $repeater->add_control(
136 'eael_data_table_header_col_icon_enabled',
137 [
138 'label' => esc_html__('Enable Header Icon', 'essential-addons-for-elementor-lite'),
139 'type' => Controls_Manager::SWITCHER,
140 'label_on' => __('yes', 'essential-addons-for-elementor-lite'),
141 'label_off' => __('no', 'essential-addons-for-elementor-lite'),
142 'default' => 'false',
143 'return_value' => 'true',
144 ]
145 );
146
147 $repeater->add_control(
148 'eael_data_table_header_icon_type',
149 [
150 'label' => esc_html__('Header Icon Type', 'essential-addons-for-elementor-lite'),
151 'type' => Controls_Manager::CHOOSE,
152 'options' => [
153 'none' => [
154 'title' => esc_html__('None', 'essential-addons-for-elementor-lite'),
155 'icon' => 'fa fa-ban',
156 ],
157 'icon' => [
158 'title' => esc_html__('Icon', 'essential-addons-for-elementor-lite'),
159 'icon' => 'fa fa-star',
160 ],
161 'image' => [
162 'title' => esc_html__('Image', 'essential-addons-for-elementor-lite'),
163 'icon' => 'eicon-image-bold',
164 ],
165 ],
166 'default' => 'icon',
167 'condition' => [
168 'eael_data_table_header_col_icon_enabled' => 'true'
169 ]
170 ]
171 );
172
173 // Comment on this control
174 $repeater->add_control(
175 'eael_data_table_header_col_icon_new',
176 [
177 'label' => esc_html__('Icon', 'essential-addons-for-elementor-lite'),
178 'type' => Controls_Manager::ICONS,
179 'fa4compatibility' => 'eael_data_table_header_col_icon',
180 'default' => [
181 'value' => 'fas fa-star',
182 'library' => 'solid',
183 ],
184 'condition' => [
185 'eael_data_table_header_col_icon_enabled' => 'true',
186 'eael_data_table_header_icon_type' => 'icon'
187 ]
188 ]
189 );
190
191 $repeater->add_control(
192 'eael_data_table_header_col_img',
193 [
194 'label' => esc_html__( 'Image', 'essential-addons-for-elementor-lite'),
195 'type' => Controls_Manager::MEDIA,
196 'default' => [
197 'url' => Utils::get_placeholder_image_src(),
198 ],
199 'condition' => [
200 'eael_data_table_header_icon_type' => 'image'
201 ],
202 'ai' => [
203 'active' => false,
204 ],
205 ]
206 );
207
208 $repeater->add_control(
209 'eael_data_table_header_col_img_size',
210 [
211 'label' => esc_html__( 'Image Size(px)', 'essential-addons-for-elementor-lite'),
212 'default' => '25',
213 'type' => Controls_Manager::NUMBER,
214 'label_block' => false,
215 'condition' => [
216 'eael_data_table_header_icon_type' => 'image'
217 ]
218 ]
219 );
220
221 $repeater->add_control(
222 'eael_data_table_header_css_class',
223 [
224 'label' => esc_html__( 'CSS Class', 'essential-addons-for-elementor-lite'),
225 'type' => Controls_Manager::TEXT,
226 'dynamic' => [ 'active' => true ],
227 'label_block' => false,
228 'ai' => [
229 'active' => false,
230 ],
231 ]
232 );
233
234 $repeater->add_control(
235 'eael_data_table_header_css_id',
236 [
237 'label' => esc_html__( 'CSS ID', 'essential-addons-for-elementor-lite'),
238 'type' => Controls_Manager::TEXT,
239 'dynamic' => [ 'active' => true ],
240 'label_block' => false,
241 'ai' => [
242 'active' => false,
243 ],
244 ]
245 );
246
247 $this->add_control(
248 'eael_data_table_header_cols_data',
249 [
250 'type' => Controls_Manager::REPEATER,
251 'seperator' => 'before',
252 'default' => [
253 [ 'eael_data_table_header_col' => 'Table Header' ],
254 [ 'eael_data_table_header_col' => 'Table Header' ],
255 [ 'eael_data_table_header_col' => 'Table Header' ],
256 [ 'eael_data_table_header_col' => 'Table Header' ],
257 ],
258 'fields' => $repeater->get_controls() ,
259 'title_field' => '{{eael_data_table_header_col}}',
260 ]
261 );
262
263 $this->end_controls_section();
264
265 /**
266 * Data Table Content
267 */
268 $this->start_controls_section(
269 'eael_section_data_table_cotnent',
270 [
271 'label' => esc_html__( 'Content', 'essential-addons-for-elementor-lite')
272 ]
273 );
274
275 $repeater = new Repeater();
276
277 $repeater->add_control(
278 'eael_data_table_content_row_type',
279 [
280 'label' => esc_html__( 'Row Type', 'essential-addons-for-elementor-lite'),
281 'type' => Controls_Manager::SELECT,
282 'default' => 'row',
283 'label_block' => false,
284 'options' => [
285 'row' => esc_html__( 'Row', 'essential-addons-for-elementor-lite'),
286 'col' => esc_html__( 'Column', 'essential-addons-for-elementor-lite'),
287 ]
288 ]
289 );
290
291 $repeater->add_control(
292 'eael_data_table_content_row_colspan',
293 [
294 'label' => esc_html__( 'Col Span', 'essential-addons-for-elementor-lite'),
295 'type' => Controls_Manager::NUMBER,
296 'description' => esc_html__( 'Default: 1 (optional).'),
297 'default' => 1,
298 'min' => 1,
299 'label_block' => true,
300 'condition' => [
301 'eael_data_table_content_row_type' => 'col'
302 ]
303 ]
304 );
305
306 $repeater->add_control(
307 'eael_data_table_content_type',
308 [
309 'label' => esc_html__( 'Content Type', 'essential-addons-for-elementor-lite'),
310 'type' => Controls_Manager::CHOOSE,
311 'options' => [
312 'icon' => [
313 'title' => esc_html__( 'Icon', 'essential-addons-for-elementor-lite'),
314 'icon' => 'fa fa-info',
315 ],
316 'textarea' => [
317 'title' => esc_html__( 'Textarea', 'essential-addons-for-elementor-lite'),
318 'icon' => 'fa fa-text-width',
319 ],
320 'editor' => [
321 'title' => esc_html__( 'Editor', 'essential-addons-for-elementor-lite'),
322 'icon' => 'eicon-pencil',
323 ],
324 'template' => [
325 'title' => esc_html__( 'Templates', 'essential-addons-for-elementor-lite'),
326 'icon' => 'fa fa-file',
327 ]
328 ],
329 'default' => 'textarea',
330 'condition' => [
331 'eael_data_table_content_row_type' => 'col'
332 ]
333 ]
334 );
335
336 $repeater->add_control(
337 'eael_data_table_content_row_rowspan',
338 [
339 'label' => esc_html__( 'Row Span', 'essential-addons-for-elementor-lite'),
340 'type' => Controls_Manager::NUMBER,
341 'description' => esc_html__( 'Default: 1 (optional).'),
342 'default' => 1,
343 'min' => 1,
344 'label_block' => true,
345 'condition' => [
346 'eael_data_table_content_row_type' => 'col'
347 ]
348 ]
349 );
350
351 $repeater->add_control(
352 'eael_primary_templates_for_tables',
353 [
354 'label' => __( 'Choose Template', 'essential-addons-for-elementor-lite'),
355 'type' => Controls_Manager::SELECT,
356 'options' => Helper::get_elementor_templates(),
357 'condition' => [
358 'eael_data_table_content_type' => 'template',
359 ],
360 ]
361 );
362
363 $repeater->add_control(
364 'eael_data_table_icon_content_new',
365 [
366 'label' => esc_html__( 'Icon', 'essential-addons-for-elementor-lite'),
367 'type' => Controls_Manager::ICONS,
368 'fa4compatibility' => 'eael_data_table_icon_content',
369 'default' => [
370 'value' => 'fas fa-home',
371 'library' => 'fa-solid',
372 ],
373 'condition' => [
374 'eael_data_table_content_type' => [ 'icon' ]
375 ]
376 ]
377 );
378
379 $repeater->add_control(
380 'eael_data_table_content_row_title',
381 [
382 'label' => esc_html__( 'Cell Text', 'essential-addons-for-elementor-lite'),
383 'type' => Controls_Manager::TEXTAREA,
384 'dynamic' => ['active' => true],
385 'label_block' => true,
386 'default' => esc_html__( 'Content', 'essential-addons-for-elementor-lite'),
387 'condition' => [
388 'eael_data_table_content_row_type' => 'col',
389 'eael_data_table_content_type' => 'textarea'
390 ]
391 ]
392 );
393
394 $repeater->add_control(
395 'eael_data_table_content_row_content',
396 [
397 'label' => esc_html__( 'Cell Text', 'essential-addons-for-elementor-lite'),
398 'type' => Controls_Manager::WYSIWYG,
399 'label_block' => true,
400 'default' => esc_html__( 'Content', 'essential-addons-for-elementor-lite'),
401 'condition' => [
402 'eael_data_table_content_row_type' => 'col',
403 'eael_data_table_content_type' => 'editor'
404 ]
405 ]
406 );
407
408 $repeater->add_control(
409 'eael_data_table_content_row_title_link',
410 [
411 'label' => esc_html__( 'Link', 'essential-addons-for-elementor-lite'),
412 'type' => Controls_Manager::URL,
413 'dynamic' => ['active' => true],
414 'label_block' => true,
415 'default' => [
416 'url' => '',
417 'is_external' => '',
418 ],
419 'show_external' => true,
420 'separator' => 'before',
421 'condition' => [
422 'eael_data_table_content_row_type' => 'col',
423 'eael_data_table_content_type' => 'textarea'
424 ],
425 ]
426 );
427
428 $repeater->add_control(
429 'eael_data_table_content_row_css_class',
430 [
431 'label' => esc_html__( 'CSS Class', 'essential-addons-for-elementor-lite'),
432 'type' => Controls_Manager::TEXT,
433 'dynamic' => [ 'active' => true ],
434 'label_block' => false,
435 'condition' => [
436 'eael_data_table_content_row_type' => 'col'
437 ],
438 'ai' => [
439 'active' => false,
440 ],
441 ]
442 );
443
444 $repeater->add_control(
445 'eael_data_table_content_row_css_id',
446 [
447 'label' => esc_html__( 'CSS ID', 'essential-addons-for-elementor-lite'),
448 'type' => Controls_Manager::TEXT,
449 'dynamic' => [ 'active' => true ],
450 'label_block' => false,
451 'condition' => [
452 'eael_data_table_content_row_type' => 'col'
453 ],
454 'ai' => [
455 'active' => false,
456 ],
457 ]
458 );
459
460 $this->add_control(
461 'eael_data_table_content_rows',
462 [
463 'type' => Controls_Manager::REPEATER,
464 'seperator' => 'before',
465 'default' => [
466 [ 'eael_data_table_content_row_type' => 'row' ],
467 [ 'eael_data_table_content_row_type' => 'col' ],
468 [ 'eael_data_table_content_row_type' => 'col' ],
469 [ 'eael_data_table_content_row_type' => 'col' ],
470 [ 'eael_data_table_content_row_type' => 'col' ],
471 ],
472 'fields' => $repeater->get_controls() ,
473 'title_field' => '{{eael_data_table_content_row_type}}::{{eael_data_table_content_row_title || eael_data_table_content_row_content}}',
474 ]
475 );
476
477 $this->end_controls_section();
478
479 // export
480 $this->start_controls_section(
481 'ea_section_adv_data_table_export',
482 [
483 'label' => esc_html__('Export', 'essential-addons-for-elementor-lite'),
484 ]
485 );
486
487 $this->add_control(
488 'ea_adv_data_table_export_csv_button',
489 [
490 'label' => __('Export table as CSV file', 'essential-addons-for-elementor-lite'),
491 'type' => Controls_Manager::BUTTON,
492 'text' => __('Export', 'essential-addons-for-elementor-lite'),
493 'event' => 'ea:table:export',
494 ]
495 );
496
497 $this->end_controls_section();
498
499 if(!apply_filters('eael/pro_enabled', false)) {
500 $this->start_controls_section(
501 'eael_section_pro',
502 [
503 'label' => __( 'Go Premium for More Features', 'essential-addons-for-elementor-lite')
504 ]
505 );
506
507 $this->add_control(
508 'eael_control_get_pro',
509 [
510 'label' => __( 'Unlock more possibilities', 'essential-addons-for-elementor-lite'),
511 'type' => Controls_Manager::CHOOSE,
512 'options' => [
513 '1' => [
514 'title' => '',
515 'icon' => 'fa fa-unlock-alt',
516 ],
517 ],
518 'default' => '1',
519 'description' => '<span class="pro-feature"> Get the <a href="https://wpdeveloper.com/upgrade/ea-pro" target="_blank">Pro version</a> for more stunning elements and customization options.</span>'
520 ]
521 );
522
523 $this->end_controls_section();
524 }
525
526 /**
527 * -------------------------------------------
528 * Tab Style (Data Table Style)
529 * -------------------------------------------
530 */
531 $this->start_controls_section(
532 'eael_section_data_table_style_settings',
533 [
534 'label' => esc_html__( 'General Style', 'essential-addons-for-elementor-lite'),
535 'tab' => Controls_Manager::TAB_STYLE
536 ]
537 );
538
539 $this->add_responsive_control(
540 'table_width',
541 [
542 'label' => __('Width', 'essential-addons-for-elementor-lite'),
543 'type' => Controls_Manager::SLIDER,
544 'default' => [
545 'size' => 100,
546 'unit' => '%',
547 ],
548 'size_units' => ['%', 'px'],
549 'range' => [
550 '%' => [
551 'min' => 1,
552 'max' => 100,
553 ],
554 'px' => [
555 'min' => 1,
556 'max' => 1200,
557 ],
558 ],
559 'selectors' => [
560 '{{WRAPPER}} .eael-data-table' => 'max-width: {{SIZE}}{{UNIT}};',
561 ],
562 ]
563 );
564
565 $this->add_control(
566 'table_alignment',
567 [
568 'label' => __('Alignment', 'essential-addons-for-elementor-lite'),
569 'type' => Controls_Manager::CHOOSE,
570 'label_block' => false,
571 'default' => 'center',
572 'options' => [
573 'left' => [
574 'title' => __('Left', 'essential-addons-for-elementor-lite'),
575 'icon' => 'eicon-h-align-left',
576 ],
577 'center' => [
578 'title' => __('Center', 'essential-addons-for-elementor-lite'),
579 'icon' => 'eicon-h-align-center',
580 ],
581 'right' => [
582 'title' => __('Right', 'essential-addons-for-elementor-lite'),
583 'icon' => 'eicon-h-align-right',
584 ],
585 ],
586 'prefix_class' => 'eael-table-align-',
587 ]
588 );
589
590 $this->end_controls_section();
591
592 /**
593 * -------------------------------------------
594 * Tab Style (Data Table Header Style)
595 * -------------------------------------------
596 */
597 $this->start_controls_section(
598 'eael_section_data_table_title_style_settings',
599 [
600 'label' => esc_html__( 'Header Style', 'essential-addons-for-elementor-lite'),
601 'tab' => Controls_Manager::TAB_STYLE
602 ]
603 );
604
605
606 $this->add_control(
607 'eael_section_data_table_header_radius',
608 [
609 'label' => esc_html__( 'Header Border Radius', 'essential-addons-for-elementor-lite'),
610 'type' => Controls_Manager::SLIDER,
611 'range' => [
612 'px' => [
613 'max' => 50,
614 ],
615 ],
616 'selectors' => [
617 '{{WRAPPER}} .eael-data-table thead tr th:first-child' => 'border-radius: {{SIZE}}px 0px 0px 0px;',
618 '{{WRAPPER}} .eael-data-table thead tr th:last-child' => 'border-radius: 0px {{SIZE}}px 0px 0px;',
619 '.rtl {{WRAPPER}} .eael-data-table thead tr th:first-child' => 'border-radius: 0px {{SIZE}}px 0px 0px;',
620 '.rtl {{WRAPPER}} .eael-data-table thead tr th:last-child' => 'border-radius: {{SIZE}}px 0px 0px 0px;',
621 ],
622 ]
623 );
624
625 $this->add_responsive_control(
626 'eael_data_table_each_header_padding',
627 [
628 'label' => esc_html__( 'Padding', 'essential-addons-for-elementor-lite'),
629 'type' => Controls_Manager::DIMENSIONS,
630 'size_units' => [ 'px', 'em' ],
631 'selectors' => [
632 '{{WRAPPER}} .eael-data-table .table-header th' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
633 '{{WRAPPER}} .eael-data-table tbody tr td .th-mobile-screen' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
634 ],
635 ]
636 );
637
638 $this->start_controls_tabs('eael_data_table_header_title_clrbg');
639
640 $this->start_controls_tab( 'eael_data_table_header_title_normal', [ 'label' => esc_html__( 'Normal', 'essential-addons-for-elementor-lite') ] );
641
642 $this->add_control(
643 'eael_data_table_header_title_color',
644 [
645 'label' => esc_html__( 'Color', 'essential-addons-for-elementor-lite'),
646 'type' => Controls_Manager::COLOR,
647 'default' => '#fff',
648 'selectors' => [
649 '{{WRAPPER}} .eael-data-table thead tr th' => 'color: {{VALUE}};',
650 '{{WRAPPER}} table.dataTable thead .sorting:after' => 'color: {{VALUE}};',
651 '{{WRAPPER}} table.dataTable thead .sorting_asc:after' => 'color: {{VALUE}};',
652 '{{WRAPPER}} table.dataTable thead .sorting_desc:after' => 'color: {{VALUE}};',
653 ],
654 ]
655 );
656
657 $this->add_control(
658 'eael_data_table_header_title_bg_color',
659 [
660 'label' => esc_html__( 'Background Color', 'essential-addons-for-elementor-lite'),
661 'type' => Controls_Manager::COLOR,
662 'default' => '#4a4893',
663 'selectors' => [
664 '{{WRAPPER}} .eael-data-table thead tr th' => 'background-color: {{VALUE}};'
665 ],
666 ]
667 );
668
669 $this->add_group_control(
670 Group_Control_Border::get_type(),
671 [
672 'name' => 'eael_data_table_header_border',
673 'label' => esc_html__( 'Border', 'essential-addons-for-elementor-lite'),
674 'selector' => '{{WRAPPER}} .eael-data-table thead tr th'
675 ]
676 );
677
678 $this->end_controls_tab();
679
680 $this->start_controls_tab( 'eael_data_table_header_title_hover', [ 'label' => esc_html__( 'Hover', 'essential-addons-for-elementor-lite') ] );
681
682 $this->add_control(
683 'eael_data_table_header_title_hover_color',
684 [
685 'label' => esc_html__( 'Color', 'essential-addons-for-elementor-lite'),
686 'type' => Controls_Manager::COLOR,
687 'default' => '#fff',
688 'selectors' => [
689 '{{WRAPPER}} .eael-data-table thead tr th:hover' => 'color: {{VALUE}};',
690 '{{WRAPPER}} table.dataTable thead .sorting:after:hover' => 'color: {{VALUE}};',
691 '{{WRAPPER}} table.dataTable thead .sorting_asc:after:hover' => 'color: {{VALUE}};',
692 '{{WRAPPER}} table.dataTable thead .sorting_desc:after:hover' => 'color: {{VALUE}};',
693 ],
694 ]
695 );
696
697 $this->add_control(
698 'eael_data_table_header_title_hover_bg_color',
699 [
700 'label' => esc_html__( 'Background Color', 'essential-addons-for-elementor-lite'),
701 'type' => Controls_Manager::COLOR,
702 'selectors' => [
703 '{{WRAPPER}} .eael-data-table thead tr th:hover' => 'background-color: {{VALUE}};',
704 ],
705 ]
706 );
707
708 $this->add_group_control(
709 Group_Control_Border::get_type(),
710 [
711 'name' => 'eael_data_table_header_hover_border',
712 'label' => esc_html__( 'Border', 'essential-addons-for-elementor-lite'),
713 'selector' => '{{WRAPPER}} .eael-data-table thead tr th:hover',
714 ]
715 );
716
717 $this->end_controls_tab();
718
719 $this->end_controls_tabs();
720
721 $this->add_group_control(
722 Group_Control_Typography::get_type(),
723 [
724 'name' => 'eael_data_table_header_title_typography',
725 'selector' => '{{WRAPPER}} .eael-data-table thead > tr th .data-table-header-text',
726 ]
727 );
728
729 $this->add_responsive_control(
730 'header_icon_size',
731 [
732 'label' => __('Icon Size', 'essential-addons-for-elementor-lite'),
733 'type' => Controls_Manager::SLIDER,
734 'size_units' => ['px'],
735 'range' => [
736 'px' => [
737 'min' => 1,
738 'max' => 70,
739 ],
740 ],
741 'default' => [
742 'size' => 20,
743 ],
744 'selectors' => [
745 '{{WRAPPER}} .eael-data-table thead tr th i' => 'font-size: {{SIZE}}{{UNIT}};',
746 '{{WRAPPER}} .eael-data-table thead tr th .data-table-header-svg-icon' => 'height: {{SIZE}}{{UNIT}}; width: {{SIZE}}{{UNIT}};',
747 ],
748 ]
749 );
750
751 $this->add_responsive_control(
752 'header_icon_position_from_top',
753 [
754 'label' => __('Icon Position', 'essential-addons-for-elementor-lite'),
755 'type' => Controls_Manager::SLIDER,
756 'size_units' => ['px', '%'],
757 'range' => [
758 'px' => [
759 'min' => 1,
760 'max' => 70,
761 ],
762 '%' => [
763 'min' => 0,
764 'max' => 100,
765 ],
766 ],
767 'selectors' => [
768 '{{WRAPPER}} .eael-data-table thead tr th .data-header-icon' => 'top: {{SIZE}}{{UNIT}};',
769 ],
770 ]
771 );
772
773 $this->add_responsive_control(
774 'header_icon_space',
775 [
776 'label' => __('Icon Space', 'essential-addons-for-elementor-lite'),
777 'type' => Controls_Manager::SLIDER,
778 'size_units' => ['px'],
779 'range' => [
780 'px' => [
781 'min' => 1,
782 'max' => 70,
783 ],
784 ],
785 'selectors' => [
786 '{{WRAPPER}} .eael-data-table thead tr th i, {{WRAPPER}} .eael-data-table thead tr th img' => 'margin-right: {{SIZE}}{{UNIT}};'
787 ]
788 ]
789 );
790
791 $this->add_responsive_control(
792 'eael_data_table_header_title_alignment',
793 [
794 'label' => esc_html__( 'Title Alignment', 'essential-addons-for-elementor-lite'),
795 'type' => Controls_Manager::CHOOSE,
796 'label_block' => true,
797 'options' => [
798 'left' => [
799 'title' => esc_html__( 'Left', 'essential-addons-for-elementor-lite'),
800 'icon' => 'eicon-text-align-left',
801 ],
802 'center' => [
803 'title' => esc_html__( 'Center', 'essential-addons-for-elementor-lite'),
804 'icon' => 'eicon-text-align-center',
805 ],
806 'right' => [
807 'title' => esc_html__( 'Right', 'essential-addons-for-elementor-lite'),
808 'icon' => 'eicon-text-align-right',
809 ],
810 ],
811 'default' => 'left',
812 'prefix_class' => 'eael-dt-th-align%s-',
813 ]
814 );
815
816 $this->end_controls_section();
817
818 /**
819 * -------------------------------------------
820 * Tab Style (Data Table Content Style)
821 * -------------------------------------------
822 */
823 $this->start_controls_section(
824 'eael_section_data_table_content_style_settings',
825 [
826 'label' => esc_html__( 'Content Style', 'essential-addons-for-elementor-lite'),
827 'tab' => Controls_Manager::TAB_STYLE
828 ]
829 );
830
831 $this->start_controls_tabs('eael_data_table_content_row_cell_styles');
832
833 $this->start_controls_tab('eael_data_table_odd_cell_style', ['label' => esc_html__( 'Normal', 'essential-addons-for-elementor-lite')]);
834
835 $this->add_control(
836 'eael_data_table_content_odd_style_heading',
837 [
838 'label' => esc_html__( 'ODD Cell', 'essential-addons-for-elementor-lite'),
839 'type' => Controls_Manager::HEADING,
840 ]
841 );
842
843 $this->add_control(
844 'eael_data_table_content_color_odd',
845 [
846 'label' => esc_html__( 'Color ( Odd Row )', 'essential-addons-for-elementor-lite'),
847 'type' => Controls_Manager::COLOR,
848 'default' => '#6d7882',
849 'selectors' => [
850 '{{WRAPPER}} .eael-data-table tbody > tr:nth-child(2n) td' => 'color: {{VALUE}};',
851 ],
852 ]
853 );
854
855 $this->add_control(
856 'eael_data_table_content_bg_odd',
857 [
858 'label' => esc_html__( 'Background ( Odd Row )', 'essential-addons-for-elementor-lite'),
859 'type' => Controls_Manager::COLOR,
860 'default' => '#f2f2f2',
861 'selectors' => [
862 '{{WRAPPER}} .eael-data-table tbody > tr:nth-child(2n) td' => 'background: {{VALUE}};',
863 ],
864 ]
865 );
866
867 $this->add_control(
868 'eael_data_table_content_even_style_heading',
869 [
870 'label' => esc_html__( 'Even Cell', 'essential-addons-for-elementor-lite'),
871 'type' => Controls_Manager::HEADING,
872 'separator' => 'before'
873 ]
874 );
875
876 $this->add_control(
877 'eael_data_table_content_even_color',
878 [
879 'label' => esc_html__( 'Color ( Even Row )', 'essential-addons-for-elementor-lite'),
880 'type' => Controls_Manager::COLOR,
881 'default' => '#6d7882',
882 'selectors' => [
883 '{{WRAPPER}} .eael-data-table tbody > tr:nth-child(2n+1) td' => 'color: {{VALUE}};',
884 ],
885 ]
886 );
887
888 $this->add_control(
889 'eael_data_table_content_bg_even_color',
890 [
891 'label' => esc_html__( 'Background Color (Even Row)', 'essential-addons-for-elementor-lite'),
892 'type' => Controls_Manager::COLOR,
893 'default' => '',
894 'selectors' => [
895 '{{WRAPPER}} .eael-data-table tbody > tr:nth-child(2n+1) td' => 'background-color: {{VALUE}};',
896 ],
897 ]
898 );
899
900 $this->add_group_control(
901 Group_Control_Border::get_type(),
902 [
903 'name' => 'eael_data_table_cell_border',
904 'label' => esc_html__( 'Border', 'essential-addons-for-elementor-lite'),
905 'selector' => '{{WRAPPER}} .eael-data-table tbody tr td',
906 'separator' => 'before'
907 ]
908 );
909
910 $this->add_responsive_control(
911 'eael_data_table_each_cell_padding',
912 [
913 'label' => esc_html__( 'Padding', 'essential-addons-for-elementor-lite'),
914 'type' => Controls_Manager::DIMENSIONS,
915 'size_units' => [ 'px', 'em' ],
916 'selectors' => [
917 '{{WRAPPER}} .eael-data-table tbody tr td' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
918 ],
919 ]
920 );
921
922 $this->end_controls_tab();
923
924 $this->start_controls_tab('eael_data_table_odd_cell_hover_style', ['label' => esc_html__( 'Hover', 'essential-addons-for-elementor-lite')]);
925
926 $this->add_control(
927 'eael_data_table_content_hover_color_odd',
928 [
929 'label' => esc_html__( 'Color ( Odd Row )', 'essential-addons-for-elementor-lite'),
930 'type' => Controls_Manager::COLOR,
931 'selectors' => [
932 '{{WRAPPER}} .eael-data-table tbody > tr:nth-child(2n) td:hover' => 'color: {{VALUE}};',
933 ],
934 ]
935 );
936
937 $this->add_control(
938 'eael_data_table_content_hover_bg_odd',
939 [
940 'label' => esc_html__( 'Background ( Odd Row )', 'essential-addons-for-elementor-lite'),
941 'type' => Controls_Manager::COLOR,
942 'selectors' => [
943 '{{WRAPPER}} .eael-data-table tbody > tr:nth-child(2n) td:hover' => 'background: {{VALUE}};',
944 ],
945 ]
946 );
947
948 $this->add_control(
949 'eael_data_table_content_even_hover_style_heading',
950 [
951 'label' => esc_html__( 'Even Cell', 'essential-addons-for-elementor-lite'),
952 'type' => Controls_Manager::HEADING,
953 ]
954 );
955
956 $this->add_control(
957 'eael_data_table_content_hover_color_even',
958 [
959 'label' => esc_html__( 'Color ( Even Row )', 'essential-addons-for-elementor-lite'),
960 'type' => Controls_Manager::COLOR,
961 'default' => '#6d7882',
962 'selectors' => [
963 '{{WRAPPER}} .eael-data-table tbody > tr:nth-child(2n+1) td:hover' => 'color: {{VALUE}};',
964 ],
965 ]
966 );
967
968 $this->add_control(
969 'eael_data_table_content_bg_even_hover_color',
970 [
971 'label' => esc_html__( 'Background Color (Even Row)', 'essential-addons-for-elementor-lite'),
972 'type' => Controls_Manager::COLOR,
973 'default' => '',
974 'selectors' => [
975 '{{WRAPPER}} .eael-data-table tbody > tr:nth-child(2n+1) td:hover' => 'background-color: {{VALUE}};',
976 ],
977 ]
978 );
979
980 $this->end_controls_tab();
981
982 $this->end_controls_tabs();
983
984 $this->add_group_control(
985 Group_Control_Typography::get_type(),
986 [
987 'name' => 'eael_data_table_content_typography',
988 'selector' => '{{WRAPPER}} .eael-data-table tbody tr td'
989 ]
990 );
991
992 $this->add_control(
993 'eael_data_table_content_link_typo',
994 [
995 'label' => esc_html__( 'Link Color', 'essential-addons-for-elementor-lite'),
996 'type' => Controls_Manager::HEADING,
997 'separator' => 'before'
998 ]
999 );
1000
1001 /* Table Content Link */
1002 $this->start_controls_tabs( 'eael_data_table_link_tabs' );
1003
1004 // Normal State Tab
1005 $this->start_controls_tab( 'eael_data_table_link_normal', [ 'label' => esc_html__( 'Normal', 'essential-addons-for-elementor-lite') ] );
1006
1007 $this->add_control(
1008 'eael_data_table_link_normal_text_color',
1009 [
1010 'label' => esc_html__( 'Text Color', 'essential-addons-for-elementor-lite'),
1011 'type' => Controls_Manager::COLOR,
1012 'default' => '#c15959',
1013 'selectors' => [
1014 '{{WRAPPER}} .eael-data-table-wrap table td a' => 'color: {{VALUE}};',
1015 ],
1016 ]
1017 );
1018
1019 $this->end_controls_tab();
1020
1021 // Hover State Tab
1022 $this->start_controls_tab( 'eael_data_table_link_hover', [ 'label' => esc_html__( 'Hover', 'essential-addons-for-elementor-lite') ] );
1023
1024 $this->add_control(
1025 'eael_data_table_link_hover_text_color',
1026 [
1027 'label' => esc_html__( 'Text Color', 'essential-addons-for-elementor-lite'),
1028 'type' => Controls_Manager::COLOR,
1029 'default' => '#6d7882',
1030 'selectors' => [
1031 '{{WRAPPER}} .eael-data-table-wrap table td a:hover' => 'color: {{VALUE}};',
1032 ],
1033 ]
1034 );
1035
1036 $this->end_controls_tab();
1037
1038 $this->end_controls_tabs();
1039
1040 $this->add_responsive_control(
1041 'eael_data_table_content_alignment',
1042 [
1043 'label' => esc_html__( 'Content Alignment', 'essential-addons-for-elementor-lite'),
1044 'type' => Controls_Manager::CHOOSE,
1045 'label_block' => true,
1046 'options' => [
1047 'left' => [
1048 'title' => esc_html__( 'Left', 'essential-addons-for-elementor-lite'),
1049 'icon' => 'eicon-text-align-left',
1050 ],
1051 'center' => [
1052 'title' => esc_html__( 'Center', 'essential-addons-for-elementor-lite'),
1053 'icon' => 'eicon-text-align-center',
1054 ],
1055 'right' => [
1056 'title' => esc_html__( 'Right', 'essential-addons-for-elementor-lite'),
1057 'icon' => 'eicon-text-align-right',
1058 ],
1059 ],
1060 // 'toggle' => true,
1061 'default' => 'left',
1062 'selectors' => [
1063 '{{WRAPPER}} .eael-data-table tbody .td-content-wrapper' => 'text-align: {{VALUE}};'
1064 ],
1065 // 'prefix_class' => 'eael-dt-td-align%s-',
1066 ]
1067 );
1068
1069 /* Table Content Icon Style*/
1070
1071 $this->add_control(
1072 'eael_data_table_content_icon_style',
1073 [
1074 'label' => esc_html__( 'Icon Style', 'essential-addons-for-elementor-lite'),
1075 'type' => Controls_Manager::HEADING,
1076 'separator' => 'before'
1077 ]
1078 );
1079
1080 $this->add_responsive_control(
1081 'eael_data_table_content_icon_size',
1082 [
1083 'label' => __('Icon Size', 'essential-addons-for-elementor-lite'),
1084 'type' => Controls_Manager::SLIDER,
1085 'size_units' => ['px'],
1086 'range' => [
1087 'px' => [
1088 'min' => 1,
1089 'max' => 70,
1090 ],
1091 ],
1092 'default' => [
1093 'size' => 20,
1094 ],
1095 'selectors' => [
1096 '{{WRAPPER}} .eael-data-table tbody .td-content-wrapper .eael-datatable-icon i' => 'font-size: {{SIZE}}{{UNIT}};',
1097 '{{WRAPPER}} .eael-data-table tbody .td-content-wrapper .eael-datatable-icon svg' => 'height: {{SIZE}}{{UNIT}}; width: {{SIZE}}{{UNIT}};',
1098 ],
1099 'separator' => 'before'
1100 ]
1101 );
1102
1103 $this->start_controls_tabs( 'eael_data_table_icon_tabs' );
1104
1105 // Normal State Tab
1106 $this->start_controls_tab( 'eael_data_table_icon_normal', [ 'label' => esc_html__( 'Normal', 'essential-addons-for-elementor-lite') ] );
1107
1108 $this->add_control(
1109 'eael_data_table_icon_normal_color',
1110 [
1111 'label' => esc_html__( 'Icon Color', 'essential-addons-for-elementor-lite'),
1112 'type' => Controls_Manager::COLOR,
1113 'default' => '#c15959',
1114 'selectors' => [
1115 '{{WRAPPER}} .eael-data-table tbody .td-content-wrapper .eael-datatable-icon i' => 'color: {{VALUE}};',
1116 '{{WRAPPER}} .eael-data-table tbody .td-content-wrapper .eael-datatable-icon svg' => 'fill: {{VALUE}};',
1117 ],
1118 ]
1119 );
1120
1121 $this->end_controls_tab();
1122
1123 // Hover State Tab
1124 $this->start_controls_tab( 'eael_data_table_icon_hover', [ 'label' => esc_html__( 'Hover', 'essential-addons-for-elementor-lite') ] );
1125
1126 $this->add_control(
1127 'eael_data_table_link_hover_color',
1128 [
1129 'label' => esc_html__( 'Icon Color', 'essential-addons-for-elementor-lite'),
1130 'type' => Controls_Manager::COLOR,
1131 'default' => '#6d7882',
1132 'selectors' => [
1133 '{{WRAPPER}} .eael-data-table tbody .td-content-wrapper:hover .eael-datatable-icon i' => 'color: {{VALUE}};',
1134 '{{WRAPPER}} .eael-data-table tbody .td-content-wrapper:hover .eael-datatable-icon svg' => 'fill: {{VALUE}};',
1135 ],
1136 ]
1137 );
1138
1139 $this->end_controls_tab();
1140
1141 $this->end_controls_tabs();
1142
1143 $this->end_controls_section();
1144
1145 /**
1146 * -------------------------------------------
1147 * Responsive Style (Data Table Content Style)
1148 * -------------------------------------------
1149 */
1150 $this->start_controls_section(
1151 'eael_section_data_table_responsive_style_settings',
1152 [
1153 'label' => esc_html__( 'Responsive Options', 'essential-addons-for-elementor-lite'),
1154 'devices' => [ 'tablet', 'mobile' ],
1155 'tab' => Controls_Manager::TAB_STYLE
1156 ]
1157 );
1158
1159 $this->add_control(
1160 'eael_enable_responsive_header_styles',
1161 [
1162 'label' => __( 'Enable Responsive Table', 'essential-addons-for-elementor-lite'),
1163 'description' => esc_html__( 'If enabled, table header will be automatically responsive for mobile.', 'essential-addons-for-elementor-lite'),
1164 'type' => Controls_Manager::SWITCHER,
1165 'label_on' => esc_html__( 'Yes', 'essential-addons-for-elementor-lite'),
1166 'label_off' => esc_html__( 'No', 'essential-addons-for-elementor-lite'),
1167 'return_value' => 'yes',
1168 ]
1169 );
1170
1171 $this->add_control(
1172 'eael_data_table_responsive_breakpoint',
1173 [
1174 'label' => esc_html__( 'Custom Breakpoint', 'essential-addons-for-elementor-lite'),
1175 'type' => Controls_Manager::NUMBER,
1176 'default' => 767,
1177 'min' => 100,
1178 'description' => esc_html__( 'Responsive styles working till this screen size.', 'essential-addons-for-elementor-lite'),
1179 'condition' => [
1180 'eael_enable_responsive_header_styles' => 'yes'
1181 ]
1182 ]
1183 );
1184
1185 $this->add_responsive_control(
1186 'mobile_table_header_width',
1187 [
1188 'label' => __('Width', 'essential-addons-for-elementor-lite'),
1189 'type' => Controls_Manager::SLIDER,
1190 'default' => [
1191 'size' => 100,
1192 'unit' => 'px',
1193 ],
1194 'size_units' => ['px'],
1195 'range' => [
1196 'px' => [
1197 'min' => 1,
1198 'max' => 200,
1199 ],
1200 ],
1201 'selectors' => [
1202 '{{WRAPPER}} .eael-data-table .th-mobile-screen' => 'flex-basis: {{SIZE}}px;',
1203 ],
1204 'condition' => [
1205 'eael_enable_responsive_header_styles' => 'yes',
1206 ],
1207 ]
1208 );
1209
1210 $this->add_responsive_control(
1211 'eael_data_table_responsive_header_color',
1212 [
1213 'label' => esc_html__( 'Color', 'essential-addons-for-elementor-lite'),
1214 'type' => Controls_Manager::COLOR,
1215 'default' => '',
1216 'selectors' => [
1217 '{{WRAPPER}} .eael-data-table tbody .th-mobile-screen' => 'color: {{VALUE}};'
1218 ],
1219 'condition' => [
1220 'eael_enable_responsive_header_styles' => 'yes'
1221 ]
1222 ]
1223 );
1224
1225 $this->add_responsive_control(
1226 'eael_data_table_responsive_header_bg_color',
1227 [
1228 'label' => esc_html__( 'Background Color', 'essential-addons-for-elementor-lite'),
1229 'type' => Controls_Manager::COLOR,
1230 'default' => '',
1231 'selectors' => [
1232 '{{WRAPPER}} .eael-data-table tbody .th-mobile-screen' => 'background-color: {{VALUE}};'
1233 ],
1234 'condition' => [
1235 'eael_enable_responsive_header_styles' => 'yes'
1236 ]
1237 ]
1238 );
1239
1240 $this->add_group_control(
1241 Group_Control_Typography::get_type(),
1242 [
1243 'name' => 'eael_data_table_responsive_header_typography',
1244 'selector' => '{{WRAPPER}} .eael-data-table .th-mobile-screen',
1245 'condition' => [
1246 'eael_enable_responsive_header_styles' => 'yes'
1247 ]
1248 ]
1249 );
1250
1251 $this->add_group_control(
1252 Group_Control_Border::get_type(),
1253 [
1254 'name' => 'eael_data_table_responsive_header_border',
1255 'label' => esc_html__( 'Border', 'essential-addons-for-elementor-lite'),
1256 'selector' => '{{WRAPPER}} tbody td .th-mobile-screen',
1257 'condition' => [
1258 'eael_enable_responsive_header_styles' => 'yes'
1259 ]
1260 ]
1261 );
1262
1263
1264 $this->end_controls_section();
1265
1266 }
1267
1268 public function get_style_depends() {
1269 return [
1270 'font-awesome-5-all',
1271 'font-awesome-4-shim',
1272 ];
1273 }
1274
1275 protected function render( ) {
1276
1277 $settings = $this->get_settings_for_display();
1278
1279 $table_tr = [];
1280 $table_td = [];
1281
1282 // Storing Data table content values
1283 foreach( $settings['eael_data_table_content_rows'] as $content_row ) {
1284 $row_id = uniqid();
1285 if( $content_row['eael_data_table_content_row_type'] == 'row' ) {
1286 $table_tr[] = [
1287 'id' => $row_id,
1288 'type' => $content_row['eael_data_table_content_row_type'],
1289 ];
1290
1291 }
1292 if( $content_row['eael_data_table_content_row_type'] == 'col' ) {
1293
1294 $icon_migrated = isset($settings['__fa4_migrated']['eael_data_table_icon_content_new']);
1295 $icon_is_new = empty($settings['eael_data_table_icon_content']);
1296
1297 $target = !empty($content_row['eael_data_table_content_row_title_link']['is_external']) ? 'target="_blank"' : '';
1298 $nofollow = !empty($content_row['eael_data_table_content_row_title_link']['nofollow']) ? 'rel="nofollow"' : '';
1299
1300 $table_tr_keys = array_keys( $table_tr );
1301 $last_key = end( $table_tr_keys );
1302 $tbody_content = ($content_row['eael_data_table_content_type'] == 'editor') ? $content_row['eael_data_table_content_row_content'] : Helper::eael_wp_kses($content_row['eael_data_table_content_row_title']);
1303
1304 $table_td[] = [
1305 'row_id' => !empty( $table_tr[$last_key]['id'] ) ? $table_tr[$last_key]['id'] : $row_id,
1306 'type' => $content_row['eael_data_table_content_row_type'],
1307 'content_type' => $content_row['eael_data_table_content_type'],
1308 'template' => $content_row['eael_primary_templates_for_tables'],
1309 'title' => $tbody_content,
1310 'link_url' => !empty($content_row['eael_data_table_content_row_title_link']['url'])?$content_row['eael_data_table_content_row_title_link']['url']:'',
1311 'icon_content_new' => !empty($content_row['eael_data_table_icon_content_new']) ? $content_row['eael_data_table_icon_content_new']:'',
1312 'icon_content' => !empty($content_row['eael_data_table_icon_content']) ? $content_row['eael_data_table_icon_content']:'',
1313 'icon_migrated' => $icon_migrated,
1314 'icon_is_new' => $icon_is_new,
1315 'link_target' => $target,
1316 'nofollow' => $nofollow,
1317 'colspan' => $content_row['eael_data_table_content_row_colspan'],
1318 'rowspan' => $content_row['eael_data_table_content_row_rowspan'],
1319 'tr_class' => $content_row['eael_data_table_content_row_css_class'],
1320 'tr_id' => $content_row['eael_data_table_content_row_css_id']
1321 ];
1322 }
1323 }
1324 $table_th_count = count($settings['eael_data_table_header_cols_data']);
1325 $this->add_render_attribute('eael_data_table_wrap', [
1326 'class' => 'eael-data-table-wrap',
1327 'data-table_id' => esc_attr($this->get_id()),
1328 'id' => 'eael-data-table-'.esc_attr($this->get_id()),
1329 'data-custom_responsive' => $settings['eael_enable_responsive_header_styles'] ? 'true' : 'false'
1330 ]);
1331 if(isset($settings['eael_section_data_table_enabled']) && $settings['eael_section_data_table_enabled']){
1332 $this->add_render_attribute('eael_data_table_wrap', 'data-table_enabled', 'true');
1333 }
1334 $this->add_render_attribute('eael_data_table', [
1335 'class' => [ 'tablesorter eael-data-table', esc_attr($settings['table_alignment']) ],
1336 'id' => 'eael-data-table-'.esc_attr($this->get_id())
1337 ]);
1338
1339 $this->add_render_attribute( 'td_content', [
1340 'class' => 'td-content'
1341 ]);
1342
1343 if('yes' == $settings['eael_enable_responsive_header_styles']) {
1344 $this->add_render_attribute('eael_data_table_wrap', 'class', 'custom-responsive-option-enable');
1345 $break_point = $settings['eael_data_table_responsive_breakpoint'] ? $settings['eael_data_table_responsive_breakpoint'] : 767;
1346 $section_id = $this->get_id();
1347 echo '<style>
1348 @media (max-width: ' . intval( $break_point ) . 'px) {
1349 #eael-data-table-' . esc_html( $section_id ) . '.custom-responsive-option-enable .eael-data-table thead {
1350 display: none;
1351 }
1352 #eael-data-table-' . esc_html( $section_id ) . '.custom-responsive-option-enable .eael-data-table tbody tr td {
1353 float: none;
1354 clear: left;
1355 width: 100%;
1356 text-align: left;
1357 display: flex;
1358 align-items: center;
1359 }
1360 }
1361 </style>';
1362 }
1363 ?>
1364 <div <?php echo $this->get_render_attribute_string('eael_data_table_wrap'); ?>>
1365 <table <?php echo $this->get_render_attribute_string('eael_data_table'); ?>>
1366 <thead>
1367 <tr class="table-header">
1368 <?php $i = 0; foreach( $settings['eael_data_table_header_cols_data'] as $header_title ) :
1369 $this->add_render_attribute('th_class'.$i, [
1370 'class' => [ $header_title['eael_data_table_header_css_class'] ],
1371 'id' => $header_title['eael_data_table_header_css_id'],
1372 'colspan' => $header_title['eael_data_table_header_col_span']
1373 ]);
1374
1375 if(apply_filters('eael/pro_enabled', false)) {
1376 $this->add_render_attribute('th_class'.$i, 'class', 'sorting' );
1377 }
1378 ?>
1379 <th <?php echo $this->get_render_attribute_string('th_class'.$i); ?>>
1380 <?php if( $header_title['eael_data_table_header_col_icon_enabled'] == 'true' && $header_title['eael_data_table_header_icon_type'] == 'icon' ) : ?>
1381 <?php if (empty($header_title['eael_data_table_header_col_icon']) || isset($header_title['__fa4_migrated']['eael_data_table_header_col_icon_new'])) { ?>
1382 <?php if( isset($header_title['eael_data_table_header_col_icon_new']['value']['url']) ) : ?>
1383 <img class="data-header-icon data-table-header-svg-icon" src="<?php echo $header_title['eael_data_table_header_col_icon_new']['value']['url'] ?>" alt="<?php echo esc_attr(get_post_meta($header_title['eael_data_table_header_col_icon_new']['value']['id'], '_wp_attachment_image_alt', true)); ?>" />
1384 <?php else : ?>
1385 <i class="<?php echo $header_title['eael_data_table_header_col_icon_new']['value'] ?> data-header-icon"></i>
1386 <?php endif; ?>
1387 <?php } else { ?>
1388 <i class="<?php echo $header_title['eael_data_table_header_col_icon'] ?> data-header-icon"></i>
1389 <?php } ?>
1390 <?php endif; ?>
1391 <?php
1392 if( $header_title['eael_data_table_header_col_icon_enabled'] == 'true' && $header_title['eael_data_table_header_icon_type'] == 'image' ) :
1393 $this->add_render_attribute('data_table_th_img'.$i, [
1394 'src' => esc_url( $header_title['eael_data_table_header_col_img']['url'] ),
1395 'class' => 'eael-data-table-th-img',
1396 'style' => "width:{$header_title['eael_data_table_header_col_img_size']}px;",
1397 'alt' => esc_attr(get_post_meta($header_title['eael_data_table_header_col_img']['id'], '_wp_attachment_image_alt', true))
1398 ]);
1399 ?><img <?php echo $this->get_render_attribute_string('data_table_th_img'.$i); ?>><?php endif; ?><span class="data-table-header-text"><?php echo __( Helper::eael_wp_kses($header_title['eael_data_table_header_col']), 'essential-addons-for-elementor-lite'); ?></span></th>
1400 <?php $i++; endforeach; ?>
1401 </tr>
1402 </thead>
1403 <tbody>
1404 <?php for( $i = 0; $i < count( $table_tr ); $i++ ) : ?>
1405 <tr>
1406 <?php
1407 for( $j = 0; $j < count( $table_td ); $j++ ) {
1408 if( $table_tr[$i]['id'] == $table_td[$j]['row_id'] ) {
1409
1410 $this->add_render_attribute('table_inside_td'.$i.$j,
1411 [
1412 'colspan' => $table_td[$j]['colspan'] > 1 ? $table_td[$j]['colspan'] : '',
1413 'rowspan' => $table_td[$j]['rowspan'] > 1 ? $table_td[$j]['rowspan'] : '',
1414 'class' => $table_td[$j]['tr_class'],
1415 'id' => $table_td[$j]['tr_id']
1416 ]
1417 );
1418 ?>
1419 <?php if( $table_td[$j]['content_type'] == 'icon' ) : ?>
1420 <td <?php echo $this->get_render_attribute_string('table_inside_td'.$i.$j); ?>>
1421 <div class="td-content-wrapper">
1422 <?php if ( $table_td[$j]['icon_is_new'] || $table_td[$j]['icon_migrated']) { ?>
1423 <div class="eael-datatable-icon td-content">
1424 <?php Icons_Manager::render_icon( $table_td[$j]['icon_content_new'] );?>
1425 </div>
1426 <?php } else { ?>
1427 <div class="td-content">
1428 <span class="<?php echo $table_td[ $j ]['icon_content'] ?>" aria-hidden="true"></span>
1429 </div>
1430 <?php } ?>
1431 </div>
1432 </td>
1433 <?php elseif( $table_td[$j]['content_type'] == 'textarea' && !empty($table_td[$j]['link_url']) ) : ?>
1434 <td <?php echo $this->get_render_attribute_string('table_inside_td'.$i.$j); ?>>
1435 <div class="td-content-wrapper">
1436 <a href="<?php echo esc_url( $table_td[$j]['link_url'] ); ?>" <?php echo $table_td[$j]['link_target'] ?> <?php echo $table_td[$j]['nofollow'] ?>><?php echo wp_kses_post($table_td[$j]['title']); ?></a>
1437 </div>
1438 </td>
1439
1440 <?php elseif( $table_td[$j]['content_type'] == 'template' && ! empty($table_td[$j]['template']) ) : ?>
1441 <td <?php echo $this->get_render_attribute_string('table_inside_td'.$i.$j); ?>>
1442 <div class="td-content-wrapper">
1443 <div <?php echo $this->get_render_attribute_string('td_content'); ?>>
1444 <?php
1445 // WPML Compatibility
1446 if ( ! is_array( $table_td[ $j ]['template'] ) ) {
1447 $table_td[ $j ]['template'] = apply_filters( 'wpml_object_id', $table_td[ $j ]['template'], 'wp_template', true );
1448 }
1449 echo Plugin::$instance->frontend->get_builder_content( intval( $table_td[ $j ]['template'] ), true );
1450 ?>
1451 </div>
1452 </div>
1453 </td>
1454 <?php else: ?>
1455 <td <?php echo $this->get_render_attribute_string('table_inside_td'.$i.$j); ?>>
1456 <div class="td-content-wrapper"><div <?php echo $this->get_render_attribute_string('td_content'); ?>><?php echo $table_td[$j]['title']; ?></div></div>
1457 </td>
1458 <?php endif; ?>
1459 <?php
1460 }
1461 }
1462 ?>
1463 </tr>
1464 <?php endfor; ?>
1465 </tbody>
1466 </table>
1467 </div>
1468 <?php
1469 }
1470
1471 protected function content_template() {}
1472 }
1473