PluginProbe
Easy Elements for Elementor – Addons & Website Templates / 1.2.1
Easy Elements for Elementor – Addons & Website Templates v1.2.1
1.5.3 1.5.2 1.5.1 1.5.0 1.4.9 1.4.6 1.4.7 1.4.8 1.4.5 1.4.4 1.4.3 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 All 47 releases
easy-elements / widgets / table / table-normal.php

table-normal.php in Easy Elements for Elementor – Addons & Website Templates 1.2.1, at widgets/table/table-normal.php

1,764 lines 53.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 use \Elementor\Controls_Manager;
3 use \Elementor\Repeater;
4 use \Elementor\Group_Control_Border;
5 use \Elementor\Group_Control_Typography;
6
7 if ( ! defined( 'ABSPATH' ) ) {
8 exit;
9 }
10 /**
11 * Elementor Table Widget.
12 *
13 * @since 1.0.0
14 */
15 if( !class_exists("Easyel_Table_Elementor_Widget") ) {
16 class Easyel_Table_Elementor_Widget extends \Elementor\Widget_Base {
17
18 public function get_style_depends() {
19 $handle = 'eel-table-style';
20 $css_path = plugin_dir_path( __FILE__ ) . 'css/table.min.css';
21 if ( ! wp_style_is( $handle, 'registered' ) && file_exists( $css_path ) ) {
22 wp_register_style( $handle, plugins_url( 'css/table.min.css', __FILE__ ), [], defined( 'WP_DEBUG' ) && WP_DEBUG ? filemtime( $css_path ) : EASYELEMENTS_VER );
23 }
24 return [ $handle ];
25 }
26
27 public function get_script_depends() {
28 $handle = 'eel-table-script';
29 $js_path = plugin_dir_path( __FILE__ ) . 'js/table.js';
30
31 if ( ! wp_script_is( $handle, 'registered' ) && file_exists( $js_path ) ) {
32 wp_register_script( $handle, plugins_url( 'js/table.js', __FILE__ ), [ 'jquery' ], filemtime( $js_path ), true );
33 }
34
35 return [ $handle ];
36 }
37
38 public function get_name() {
39 return 'eel-table';
40 }
41
42 /**
43 * Get widget title.
44 *
45 * Retrieve oEmbed widget title.
46 *
47 * @since 1.0.0
48 * @access public
49 *
50 * @return string Widget title.
51 */
52 public function get_title() {
53 return esc_html__( 'Table', 'easy-elements' );
54 }
55
56 /**
57 * Get widget icon.
58 *
59 * Retrieve oEmbed widget icon.
60 *
61 * @since 1.0.0
62 * @access public
63 *
64 * @return string Widget icon.
65 */
66 public function get_icon() {
67 return 'easyicon easyelIcon-clients-logo-grid';
68 }
69
70 /**
71 * Get widget categories.
72 *
73 * Retrieve the list of categories the oEmbed widget belongs to.
74 *
75 * @since 1.0.0
76 * @access public
77 *
78 * @return array Widget categories.
79 */
80 public function get_categories() {
81 return [ 'easyelements_category' ];
82 }
83
84 /**
85 * Register oEmbed widget controls.
86 *
87 * Adds different input fields to allow the user to change and customize the widget settings.
88 *
89 * @since 1.0.0
90 * @access protected
91 */
92
93 public function get_keywords() {
94 return [ 'table', 'simple', 'data', 'click', 'text' ];
95 }
96
97 protected function register_controls() {
98
99 $this->start_controls_section(
100 'content_table_header',
101 [
102 'label' => esc_html__( 'Table Header', 'easy-elements' ),
103 'tab' => Controls_Manager::TAB_CONTENT,
104 ]
105 );
106
107 $this->add_control(
108 'table_header',
109 [
110 'label' => esc_html__( 'Table Header Cell', 'easy-elements' ),
111 'type' => Controls_Manager::REPEATER,
112 'prevent_empty' => false,
113 'fields' => [
114 [
115 'name' => 'text',
116 'label' => esc_html__( 'Text', 'easy-elements' ),
117 'type' => Controls_Manager::TEXT,
118 'label_block' => true,
119 'placeholder' => esc_html__( 'Table Header', 'easy-elements' ),
120 'default' => esc_html__( 'Table Header', 'easy-elements' ),
121 'dynamic' => [
122 'active' => true,
123 ]
124 ],
125 [
126 'name' => 'header_icon',
127 'label' => esc_html__( 'Icon', 'easy-elements' ),
128 'type' => Controls_Manager::SWITCHER,
129 'label_off' => esc_html__( 'No', 'easy-elements' ),
130 'label_on' => esc_html__( 'Yes', 'easy-elements' ),
131 ],
132 [
133 'name' => 'table_head_icon',
134 'label' => esc_html__( 'Icon', 'easy-elements' ),
135 'type' => \Elementor\Controls_Manager::ICONS,
136 'default' => [
137 'value' => 'far fa-user-circle',
138 'library' => 'fa-solid',
139 ],
140 'condition' => [
141 'header_icon' => 'yes',
142 ],
143 ],
144 [
145 'name' => 'advance',
146 'label' => esc_html__( 'Advance Settings', 'easy-elements' ),
147 'type' => Controls_Manager::SWITCHER,
148 'label_off' => esc_html__( 'No', 'easy-elements' ),
149 'label_on' => esc_html__( 'Yes', 'easy-elements' ),
150 ],
151 [
152 'name' => 'colspan',
153 'label' => esc_html__( 'colSpan', 'easy-elements' ),
154 'type' => Controls_Manager::SWITCHER,
155 'condition' => [
156 'advance' => 'yes',
157 ],
158 'label_off' => esc_html__( 'No', 'easy-elements' ),
159 'label_on' => esc_html__( 'Yes', 'easy-elements' ),
160 ],
161 [
162 'name' => 'colspannumber',
163 'label' => esc_html__( 'colSpan Number', 'easy-elements' ),
164 'type' => Controls_Manager::TEXT,
165 'condition' => [
166 'advance' => 'yes',
167 'colspan' => 'yes',
168 ],
169 'placeholder' => esc_html__( '1', 'easy-elements' ),
170 'default' => esc_html__( '1', 'easy-elements' ),
171 ],
172 [
173 'name' => 'customwidth',
174 'label' => esc_html__( 'Custom Width', 'easy-elements' ),
175 'type' => Controls_Manager::SWITCHER,
176 'condition' => [
177 'advance' => 'yes',
178 ],
179 'label_off' => esc_html__( 'No', 'easy-elements' ),
180 'label_on' => esc_html__( 'Yes', 'easy-elements' ),
181 ],
182 [
183 'name' => 'width',
184 'label' => esc_html__( 'Width', 'easy-elements' ),
185 'type' => Controls_Manager::SLIDER,
186 'condition' => [
187 'advance' => 'yes',
188 'customwidth' => 'yes',
189 ],
190 'range' => [
191 '%' => [
192 'min' => 0,
193 'max' => 100,
194 ],
195 'px' => [
196 'min' => 1,
197 'max' => 1000,
198 ],
199 ],
200 'default' => [
201 'size' => 30,
202 'unit' => '%',
203 ],
204 'size_units' => [ '%', 'px' ],
205 'selectors' => [ '{{WRAPPER}} table.easyel-table .easyel-table-header {{CURRENT_ITEM}}' => 'width: {{SIZE}}{{UNIT}};',
206 ]
207 ],
208 [
209 'name' => 'align',
210 'label' => esc_html__( 'Alignment', 'easy-elements' ),
211 'type' => Controls_Manager::CHOOSE,
212 'condition' => [
213 'advance' => 'yes',
214 ],
215 'options' => [
216 'left' => [
217 'title' => esc_html__( 'Left', 'easy-elements' ),
218 'icon' => 'eicon-text-align-left',
219 ],
220 'center' => [
221 'title' => esc_html__( 'Center', 'easy-elements' ),
222 'icon' => 'eicon-text-align-center',
223 ],
224 'right' => [
225 'title' => esc_html__( 'Right', 'easy-elements' ),
226 'icon' => 'eicon-text-align-right',
227 ],
228 'justify' => [
229 'title' => esc_html__( 'Justified', 'easy-elements' ),
230 'icon' => 'eicon-text-align-justify',
231 ],
232 ],
233 'default' => '',
234 'selectors' => [
235 '{{WRAPPER}} table.easyel-table .easyel-table-header {{CURRENT_ITEM}}' => 'text-align: {{VALUE}};',
236 ]
237 ],
238 [
239 'name' => 'vertical_align',
240 'label' => esc_html__( 'Vertical Alignment', 'easy-elements' ),
241 'type' => Controls_Manager::CHOOSE,
242 'condition' => [
243 'advance' => 'yes',
244 ],
245 'options' => [
246 'top' => [
247 'title' => esc_html__( 'Top', 'easy-elements' ),
248 'icon' => 'fa fa-arrow-up',
249 ],
250 'middle' => [
251 'title' => esc_html__( 'Middle', 'easy-elements' ),
252 'icon' => 'fa fa-arrows-v',
253 ],
254 'bottom' => [
255 'title' => esc_html__( 'Bottom', 'easy-elements' ),
256 'icon' => 'fa fa-arrow-down',
257 ],
258 ],
259 'default' => 'top',
260 'toggle' => true,
261 'selectors' => [
262 '{{WRAPPER}} table.easyel-table .easyel-table-header {{CURRENT_ITEM}}' => 'vertical-align: {{VALUE}};',
263 ]
264 ],
265
266 [
267 'name' => 'decoration',
268 'label' => esc_html__( 'Decoration', 'easy-elements' ),
269 'type' => Controls_Manager::SELECT,
270 'condition' => [
271 'advance' => 'yes',
272 ],
273 'options' => [
274 '' => esc_html__( 'Default', 'easy-elements' ),
275 'underline' => esc_html__( 'Underline', 'easy-elements' ),
276 'overline' => esc_html__( 'Overline', 'easy-elements' ),
277 'line-through' => esc_html__( 'Line Through', 'easy-elements' ),
278 'none' => esc_html__( 'None', 'easy-elements' ),
279 ],
280 'default' => '',
281 'selectors' => [
282 '{{WRAPPER}} table.easyel-table .easyel-table-header {{CURRENT_ITEM}}' => 'text-decoration: {{VALUE}};',
283 ],
284 ],
285 [
286 'name' => 'table_head_tooltip',
287 'label' => esc_html__( 'Tooltip Settings', 'easy-elements' ),
288 'type' => Controls_Manager::SWITCHER,
289 'label_off' => esc_html__( 'No', 'easy-elements' ),
290 'label_on' => esc_html__( 'Yes', 'easy-elements' ),
291 ],
292 [
293 'name' => 'table_head_tooltip_icon',
294 'label' => esc_html__( 'Tooltip Icon', 'easy-elements' ),
295 'type' => \Elementor\Controls_Manager::ICONS,
296 'default' => [
297 'value' => 'fas fa-question-circle',
298 'library' => 'fa-solid',
299 ],
300 'condition' => [
301 'table_head_tooltip' => 'yes',
302 ],
303 ],
304 [
305 'name' => 'table_head_tooltip_description',
306 'label' => esc_html__('Tooltip Description', 'easy-elements' ),
307 'type' => \Elementor\Controls_Manager::TEXTAREA,
308 'rows' => 10,
309 'placeholder' => esc_html__( 'Type your tooltip description here', 'easy-elements' ),
310 'condition' => [
311 'table_head_tooltip' => 'yes',
312 ],
313 ],
314 ],
315 'default' => [
316 [ 'text' => esc_html__( 'Table Header', 'easy-elements' ) ],
317 [ 'text' => esc_html__( 'Table Header', 'easy-elements' ) ],
318 [ 'text' => esc_html__( 'Table Header', 'easy-elements' ) ],
319 [ 'text' => esc_html__( 'Table Header', 'easy-elements' ) ],
320 [ 'text' => esc_html__( 'Table Header', 'easy-elements' ) ],
321 [ 'text' => esc_html__( 'Table Header', 'easy-elements' ) ],
322 ],
323 'title_field' => '{{{ text }}}',
324 ]
325 );
326
327 $this->end_controls_section();
328
329 $this->start_controls_section(
330 'content_table_body',
331 [
332 'label' => esc_html__( 'Table Body', 'easy-elements' ),
333 'tab' => Controls_Manager::TAB_CONTENT,
334 ]
335 );
336
337 $repeater = new Repeater();
338
339
340 $repeater->add_control(
341 'row', [
342 'label' => esc_html__( 'New Row', 'easy-elements' ),
343 'type' => Controls_Manager::SWITCHER,
344 'label_off' => esc_html__( 'No', 'easy-elements' ),
345 'label_on' => esc_html__( 'Yes', 'easy-elements' ),
346 ]
347 );
348
349 $repeater->add_control(
350 'table_body_choose_img_icon',
351 [
352 'label' => esc_html__( 'Select Type', 'easy-elements' ),
353 'type' => \Elementor\Controls_Manager::SELECT,
354 'default' => 'icon',
355 'options' => [
356 'icon' => esc_html__( 'Icon', 'easy-elements' ),
357 'image' => esc_html__( 'Image', 'easy-elements' ),
358 ],
359 ]
360 );
361
362 $repeater->add_control(
363 'table_icon',
364 [
365 'label' => esc_html__( 'Icon', 'easy-elements' ),
366 'type' => \Elementor\Controls_Manager::ICONS,
367 'condition' => [
368 'table_body_choose_img_icon' => ['icon']
369 ]
370 ]
371 );
372
373 $repeater->add_control(
374 'table_image',
375 [
376 'label' => esc_html__( 'Image', 'easy-elements' ),
377 'type' => \Elementor\Controls_Manager::MEDIA,
378 'default' => [
379 'url' => \Elementor\Utils::get_placeholder_image_src(),
380 ],
381 'condition' => [
382 'table_body_choose_img_icon' => ['image']
383 ]
384 ]
385 );
386
387 $repeater->add_control(
388 'text', [
389 'label' => esc_html__( 'Text', 'easy-elements' ),
390 'type' => Controls_Manager::WYSIWYG,
391 'label_block' => true,
392 'placeholder' => esc_html__( 'Table Data', 'easy-elements' ),
393 'default' => esc_html__( 'Table Data', 'easy-elements' ),
394 'dynamic' => [
395 'active' => true,
396 ]
397 ]
398 );
399
400 $repeater->add_control(
401 'advance', [
402 'label' => esc_html__( 'Advance Settings', 'easy-elements' ),
403 'type' => Controls_Manager::SWITCHER,
404 'label_off' => esc_html__( 'No', 'easy-elements' ),
405 'label_on' => esc_html__( 'Yes', 'easy-elements' ),
406 ]
407 );
408
409 $repeater->add_control(
410 'colspan', [
411 'label' => esc_html__( 'colSpan', 'easy-elements' ),
412 'type' => Controls_Manager::SWITCHER,
413 'condition' => [
414 'advance' => 'yes',
415 ],
416 'label_off' => esc_html__( 'No', 'easy-elements' ),
417 'label_on' => esc_html__( 'Yes', 'easy-elements' ),
418 ]
419 );
420
421 $repeater->add_control(
422 'colspannumber', [
423 'label' => esc_html__( 'colSpan Number', 'easy-elements' ),
424 'type' => Controls_Manager::TEXT,
425 'condition' => [
426 'advance' => 'yes',
427 'colspan' => 'yes',
428 ],
429 'placeholder' => esc_html__( '1', 'easy-elements' ),
430 'default' => esc_html__( '1', 'easy-elements' ),
431 ]
432 );
433
434 $repeater->add_control(
435 'rowspan', [
436 'label' => esc_html__( 'rowSpan', 'easy-elements' ),
437 'type' => Controls_Manager::SWITCHER,
438 'condition' => [
439 'advance' => 'yes',
440 ],
441 'label_off' => esc_html__( 'No', 'easy-elements' ),
442 'label_on' => esc_html__( 'Yes', 'easy-elements' ),
443 ]
444 );
445
446 $repeater->add_control(
447 'rowspannumber', [
448 'label' => esc_html__( 'rowSpan Number', 'easy-elements' ),
449 'type' => Controls_Manager::TEXT,
450 'condition' => [
451 'advance' => 'yes',
452 'rowspan' => 'yes',
453 ],
454 'placeholder' => esc_html__( '1', 'easy-elements' ),
455 'default' => esc_html__( '1', 'easy-elements' ),
456 ]
457 );
458
459 $repeater->add_control(
460 'table_body_data_flex',
461 [
462 'label' => esc_html__( 'Data Flex', 'easy-elements' ),
463 'type' => Controls_Manager::SWITCHER,
464 'label_off' => esc_html__( 'No', 'easy-elements' ),
465 'label_on' => esc_html__( 'Yes', 'easy-elements' ),
466 'condition' => [
467 'advance' => 'yes',
468 ]
469 ]
470 );
471
472 $repeater->add_control(
473 'data-flex-align', [
474 'label' => esc_html__( 'Alignment', 'easy-elements' ),
475 'type' => Controls_Manager::CHOOSE,
476 'condition' => [
477 'advance' => 'yes',
478 'table_body_data_flex' => 'yes',
479 ],
480 'options' => [
481 'start' => [
482 'title' => esc_html__( 'Left', 'easy-elements' ),
483 'icon' => 'eicon-text-align-left',
484 ],
485 'center' => [
486 'title' => esc_html__( 'Center', 'easy-elements' ),
487 'icon' => 'eicon-text-align-center',
488 ],
489 'end' => [
490 'title' => esc_html__( 'Right', 'easy-elements' ),
491 'icon' => 'eicon-text-align-right',
492 ],
493 'space-between' => [
494 'title' => esc_html__( 'Justified', 'easy-elements' ),
495 'icon' => 'eicon-text-align-justify',
496 ],
497 ],
498 'selectors' => [
499 '{{WRAPPER}} table.easyel-table .easyel-table-body .data-flex' => 'justify-content: {{VALUE}};',
500 ],
501 ]
502 );
503
504 $repeater->add_responsive_control(
505 'flex-data-mid-gap',
506 [
507 'label' => esc_html__( 'Middle Gap', 'easy-elements' ),
508 'type' => Controls_Manager::SLIDER,
509 'size_units' => [ '%', 'px' ],
510 'condition' => [
511 'advance' => 'yes',
512 'table_body_data_flex' => 'yes',
513 ],
514 'selectors' => [ '{{WRAPPER}} table.easyel-table .easyel-table-body .data-flex' => 'gap: {{SIZE}}{{UNIT}};',
515 ]
516 ],
517 );
518
519 $repeater->add_control(
520 'align', [
521 'label' => esc_html__( 'Alignment', 'easy-elements' ),
522 'type' => Controls_Manager::CHOOSE,
523 'condition' => [
524 'advance' => 'yes',
525 'table_body_data_flex!' => 'yes',
526 ],
527 'options' => [
528 'left' => [
529 'title' => esc_html__( 'Left', 'easy-elements' ),
530 'icon' => 'eicon-text-align-left',
531 ],
532 'center' => [
533 'title' => esc_html__( 'Center', 'easy-elements' ),
534 'icon' => 'eicon-text-align-center',
535 ],
536 'right' => [
537 'title' => esc_html__( 'Right', 'easy-elements' ),
538 'icon' => 'eicon-text-align-right',
539 ],
540 'justify' => [
541 'title' => esc_html__( 'Justified', 'easy-elements' ),
542 'icon' => 'eicon-text-align-justify',
543 ],
544 ],
545 'default' => '',
546 'selectors' => [
547 '{{WRAPPER}} table.easyel-table .easyel-table-body {{CURRENT_ITEM}}' => 'text-align: {{VALUE}};',
548 ],
549 ]
550 );
551
552 $repeater->add_control(
553 'vertical_align', [
554 'label' => esc_html__( 'Vetical Alignment', 'easy-elements' ),
555 'type' => Controls_Manager::CHOOSE,
556 'condition' => [
557 'advance' => 'yes',
558 ],
559 'options' => [
560 'top' => [
561 'title' => esc_html__( 'Top', 'easy-elements' ),
562 'icon' => 'eicon-v-align-top',
563 ],
564 'middle' => [
565 'title' => esc_html__( 'Middle', 'easy-elements' ),
566 'icon' => 'eicon-v-align-middle',
567 ],
568 'bottom' => [
569 'title' => esc_html__( 'Bottom', 'easy-elements' ),
570 'icon' => 'eicon-v-align-bottom',
571 ],
572 ],
573 'default' => '',
574 'selectors' => [
575 '{{WRAPPER}} table.easyel-table .easyel-table-body {{CURRENT_ITEM}}' => 'vertical-align: {{VALUE}};',
576 ],
577 ]
578 );
579 $repeater->add_control(
580 'advanced_item_bg_color',
581 [
582 'label' => esc_html__( 'Background Color', 'easy-elements' ),
583 'type' => Controls_Manager::COLOR,
584 'selectors' => [
585 '{{WRAPPER}} table.easyel-table .easyel-table-body {{CURRENT_ITEM}}' => 'background-color: {{VALUE}};',
586 ]
587 ]
588 );
589 $repeater->add_control(
590 'advanced_item_text_color',
591 [
592 'label' => esc_html__( 'Color', 'easy-elements' ),
593 'type' => Controls_Manager::COLOR,
594 'selectors' => [
595 '{{WRAPPER}} table.easyel-table .easyel-table-body {{CURRENT_ITEM}}' => 'color: {{VALUE}};',
596 ]
597 ]
598 );
599 $repeater->add_control(
600 'advanced_item_icon_color',
601 [
602 'label' => esc_html__( 'Icon Color', 'easy-elements' ),
603 'type' => Controls_Manager::COLOR,
604 'selectors' => [
605 '{{WRAPPER}} table.easyel-table .easyel-table-body {{CURRENT_ITEM}} i' => 'color: {{VALUE}};',
606 '{{WRAPPER}} table.easyel-table .easyel-table-body {{CURRENT_ITEM}} svg' => 'fill: {{VALUE}};',
607 ]
608 ]
609 );
610 $repeater->add_control(
611 'tb_cswidthS',
612 [
613 'label' => esc_html__( 'Custom Width', 'easy-elements' ),
614 'type' => Controls_Manager::SELECT,
615 'type' => Controls_Manager::SWITCHER,
616 'condition' => [
617 'advance' => 'yes',
618 ],
619 'label_off' => esc_html__( 'No', 'easy-elements' ),
620 'label_on' => esc_html__( 'Yes', 'easy-elements' ),
621 ]
622 );
623 $repeater->add_responsive_control(
624 'tb_cswidth',
625 [
626 'label' => esc_html__( 'Width', 'easy-elements' ),
627 'type' => Controls_Manager::SLIDER,
628 'size_units' => [ '%', 'px' ],
629 'condition' => [
630 'advance' => 'yes',
631 'tb_cswidthS' => 'yes',
632 ],
633 'range' => [
634 '%' => [
635 'min' => 0,
636 'max' => 100,
637 ],
638 'px' => [
639 'min' => 1,
640 'max' => 1000,
641 ],
642 ],
643
644 'selectors' => [ '{{WRAPPER}} table.easyel-table .easyel-table-body {{CURRENT_ITEM}}' => 'width: {{SIZE}}{{UNIT}};',
645 ]
646 ],
647 );
648
649 $repeater->add_control(
650 'decoration',
651 [
652 'label' => esc_html__( 'Decoration', 'easy-elements' ),
653 'type' => Controls_Manager::SELECT,
654 'condition' => [
655 'advance' => 'yes',
656 ],
657 'options' => [
658 '' => esc_html__( 'Default', 'easy-elements' ),
659 'underline' => esc_html__( 'Underline', 'easy-elements' ),
660 'overline' => esc_html__( 'Overline', 'easy-elements' ),
661 'line-through' => esc_html__( 'Line Through', 'easy-elements' ),
662 'none' => esc_html__( 'None', 'easy-elements' ),
663 ],
664 'default' => '',
665 'selectors' => [
666 '{{WRAPPER}} table.easyel-table {{CURRENT_ITEM}}' => 'text-decoration:{{VALUE}};',
667 ],
668 ]
669 );
670 $repeater->add_control(
671 'table_body_tooltip',
672 [
673 'label' => esc_html__( 'Tooltip Settings', 'easy-elements' ),
674 'type' => Controls_Manager::SWITCHER,
675 'label_off' => esc_html__( 'No', 'easy-elements' ),
676 'label_on' => esc_html__( 'Yes', 'easy-elements' ),
677 ]
678 );
679 $repeater->add_control(
680 'table_body_tooltip_icon',
681 [
682 'label' => esc_html__( 'Tooltip Icon', 'easy-elements' ),
683 'type' => \Elementor\Controls_Manager::ICONS,
684 'default' => [
685 'value' => 'fas fa-question-circle',
686 'library' => 'fa-solid',
687 ],
688 'condition' => [
689 'table_body_tooltip' => 'yes',
690 ],
691 ]
692 );
693 $repeater->add_control(
694 'table_body_tooltip_description',
695 [
696 'label' => esc_html__('Tooltip Description', 'easy-elements' ),
697 'type' => \Elementor\Controls_Manager::TEXTAREA,
698 'rows' => 10,
699 'placeholder' => esc_html__( 'Type your tooltip description here', 'easy-elements' ),
700 'condition' => [
701 'table_body_tooltip' => 'yes',
702 ],
703 ]
704 );
705
706 $this->add_control(
707 'table_body',
708 [
709 'label' => esc_html__( 'Table Body Cell', 'easy-elements' ),
710 'type' => Controls_Manager::REPEATER,
711 'fields' => $repeater->get_controls(),
712
713 'default' => [
714 [ 'text' => esc_html__( 'Table Data', 'easy-elements' ) ],
715 [ 'text' => esc_html__( 'Table Data', 'easy-elements' ) ],
716 [ 'text' => esc_html__( 'Table Data', 'easy-elements' ) ],
717 [ 'text' => esc_html__( 'Table Data', 'easy-elements' ) ],
718 [ 'text' => esc_html__( 'Table Data', 'easy-elements' ) ],
719 [ 'text' => esc_html__( 'Table Data', 'easy-elements' ) ],
720 ],
721
722 'title_field' => '{{{ text }}}',
723 ]
724 );
725
726
727 $this->end_controls_section();
728
729 $this->start_controls_section(
730 'content_table_footer',
731 [
732 'label' => esc_html__( 'Table footer', 'easy-elements' ),
733 'tab' => Controls_Manager::TAB_CONTENT,
734 ]
735 );
736 $this->add_control(
737 'table_footer',
738 [
739 'label' => esc_html__( 'Table footer Cell', 'easy-elements' ),
740 'type' => Controls_Manager::REPEATER,
741 'prevent_empty' => false,
742 'default' => [
743 [ 'text' => esc_html__( 'Table footer', 'easy-elements' ) ],
744 [ 'text' => esc_html__( 'Table footer', 'easy-elements' ) ],
745 [ 'text' => esc_html__( 'Table footer', 'easy-elements' ) ],
746 [ 'text' => esc_html__( 'Table footer', 'easy-elements' ) ],
747 [ 'text' => esc_html__( 'Table footer', 'easy-elements' ) ],
748 [ 'text' => esc_html__( 'Table footer', 'easy-elements' ) ],
749 ],
750
751 'fields' => [
752 [
753 'name' => 'text',
754 'label' => esc_html__( 'Text', 'easy-elements' ),
755 'type' => Controls_Manager::TEXT,
756 'label_block' => true,
757 'placeholder' => esc_html__( 'Table footer', 'easy-elements' ),
758 'default' => esc_html__( 'Table footer', 'easy-elements' ),
759 'dynamic' => [
760 'active' => true,
761 ]
762 ],
763 [
764 'name' => 'advance',
765 'label' => esc_html__( 'Advance Settings', 'easy-elements' ),
766 'type' => Controls_Manager::SWITCHER,
767 'label_off' => esc_html__( 'No', 'easy-elements' ),
768 'label_on' => esc_html__( 'Yes', 'easy-elements' ),
769 ],
770 [
771 'name' => 'colspan',
772 'label' => esc_html__( 'colSpan', 'easy-elements' ),
773 'type' => Controls_Manager::SWITCHER,
774 'condition' => [
775 'advance' => 'yes',
776 ],
777 'label_off' => esc_html__( 'No', 'easy-elements' ),
778 'label_on' => esc_html__( 'Yes', 'easy-elements' ),
779 ],
780 [
781 'name' => 'colspannumber',
782 'label' => esc_html__( 'colSpan Number', 'easy-elements' ),
783 'type' => Controls_Manager::TEXT,
784 'condition' => [
785 'advance' => 'yes',
786 'colspan' => 'yes',
787 ],
788 'placeholder' => esc_html__( '1', 'easy-elements' ),
789 'default' => esc_html__( '1', 'easy-elements' ),
790 ],
791 [
792 'name' => 'customwidth',
793 'label' => esc_html__( 'Custom Width', 'easy-elements' ),
794 'type' => Controls_Manager::SWITCHER,
795 'condition' => [
796 'advance' => 'yes',
797 ],
798 'label_off' => esc_html__( 'No', 'easy-elements' ),
799 'label_on' => esc_html__( 'Yes', 'easy-elements' ),
800 ],
801 [
802 'name' => 'width',
803 'label' => esc_html__( 'Width', 'easy-elements' ),
804 'type' => Controls_Manager::SLIDER,
805 'condition' => [
806 'advance' => 'yes',
807 'customwidth' => 'yes',
808 ],
809 'range' => [
810 '%' => [
811 'min' => 0,
812 'max' => 100,
813 ],
814 'px' => [
815 'min' => 1,
816 'max' => 1000,
817 ],
818 ],
819 'default' => [
820 'size' => 30,
821 'unit' => '%',
822 ],
823 'size_units' => [ '%', 'px' ],
824 'selectors' => [ '{{WRAPPER}} table.easyel-table .easyel-table-footer {{CURRENT_ITEM}}' => 'width: {{SIZE}}{{UNIT}};',
825 ]
826 ],
827 [
828 'name' => 'align',
829 'label' => esc_html__( 'Alignment', 'easy-elements' ),
830 'type' => Controls_Manager::CHOOSE,
831 'condition' => [
832 'advance' => 'yes',
833 ],
834 'options' => [
835 'left' => [
836 'title' => esc_html__( 'Left', 'easy-elements' ),
837 'icon' => 'eicon-text-align-left',
838 ],
839 'center' => [
840 'title' => esc_html__( 'Center', 'easy-elements' ),
841 'icon' => 'eicon-text-align-center',
842 ],
843 'right' => [
844 'title' => esc_html__( 'Right', 'easy-elements' ),
845 'icon' => 'eicon-text-align-right',
846 ],
847 'justify' => [
848 'title' => esc_html__( 'Justified', 'easy-elements' ),
849 'icon' => 'eicon-text-align-justify',
850 ],
851 ],
852 'default' => '',
853 'selectors' => [
854 '{{WRAPPER}} table.easyel-table .easyel-table-footer {{CURRENT_ITEM}}' => 'text-align: {{VALUE}};',
855 ]
856 ],
857 [
858 'name' => 'vertical_align',
859 'label' => esc_html__( 'Vertical Alignment', 'easy-elements' ),
860 'type' => Controls_Manager::CHOOSE,
861 'condition' => [
862 'advance' => 'yes',
863 ],
864 'options' => [
865 'top' => [
866 'title' => esc_html__( 'Top', 'easy-elements' ),
867 'icon' => 'eicon-v-align-up',
868 ],
869 'middle' => [
870 'title' => esc_html__( 'Middle', 'easy-elements' ),
871 'icon' => 'eicon-v-align-middle',
872 ],
873 'bottom' => [
874 'title' => esc_html__( 'Bottom', 'easy-elements' ),
875 'icon' => 'eicon-v-align-bottom',
876 ],
877 ],
878 'default' => '',
879 'selectors' => [
880 '{{WRAPPER}} table.easyel-table .easyel-table-footer {{CURRENT_ITEM}}' => 'text-align: {{VALUE}};',
881 ]
882 ],
883
884 [
885 'name' => 'decoration',
886 'label' => esc_html__( 'Decoration', 'easy-elements' ),
887 'type' => Controls_Manager::SELECT,
888 'condition' => [
889 'advance' => 'yes',
890 ],
891 'options' => [
892 '' => esc_html__( 'Default', 'easy-elements' ),
893 'underline' => esc_html__( 'Underline', 'easy-elements' ),
894 'overline' => esc_html__( 'Overline', 'easy-elements' ),
895 'line-through' => esc_html__( 'Line Through', 'easy-elements' ),
896 'none' => esc_html__( 'None', 'easy-elements' ),
897 ],
898 'default' => '',
899 'selectors' => [
900 '{{WRAPPER}} table.easyel-table .easyel-table-footer {{CURRENT_ITEM}}' => 'text-decoration: {{VALUE}};',
901 ],
902 ],
903 [
904 'name' => 'table_foot_tooltip',
905 'label' => esc_html__( 'Tooltip Settings', 'easy-elements' ),
906 'type' => Controls_Manager::SWITCHER,
907 'label_off' => esc_html__( 'No', 'easy-elements' ),
908 'label_on' => esc_html__( 'Yes', 'easy-elements' ),
909 ],
910 [
911 'name' => 'table_foot_tooltip_icon',
912 'label' => esc_html__( 'Tooltip Icon', 'easy-elements' ),
913 'type' => \Elementor\Controls_Manager::ICONS,
914 'default' => [
915 'value' => 'fas fa-question-circle',
916 'library' => 'fa-solid',
917 ],
918 'condition' => [
919 'table_foot_tooltip' => 'yes',
920 ],
921 ],
922 [
923 'name' => 'table_foot_tooltip_description',
924 'label' => esc_html__('Tooltip Description', 'easy-elements' ),
925 'type' => \Elementor\Controls_Manager::TEXTAREA,
926 'rows' => 10,
927 'placeholder' => esc_html__( 'Type your tooltip description here', 'easy-elements' ),
928 'condition' => [
929 'table_foot_tooltip' => 'yes',
930 ],
931 ],
932 ],
933 'title_field' => '{{{ text }}}',
934 ]
935 );
936 $this->end_controls_section();
937
938 $this->start_controls_section(
939 'section_style',
940 [
941 'label' => esc_html__( 'General Style', 'easy-elements' ),
942 'tab' => Controls_Manager::TAB_STYLE,
943 ]
944 );
945
946 $this->add_control(
947 'vertical_align_table', [
948 'label' => esc_html__( 'Vetical Alignment', 'easy-elements' ),
949 'type' => Controls_Manager::CHOOSE,
950 'options' => [
951 'top' => [
952 'title' => esc_html__( 'Top', 'easy-elements' ),
953 'icon' => 'eicon-v-align-top',
954 ],
955 'middle' => [
956 'title' => esc_html__( 'Middle', 'easy-elements' ),
957 'icon' => 'eicon-v-align-middle',
958 ],
959 'bottom' => [
960 'title' => esc_html__( 'Bottom', 'easy-elements' ),
961 'icon' => 'eicon-v-align-bottom',
962 ],
963 ],
964 'default' => '',
965 'selectors' => [
966 '{{WRAPPER}} table.easyel-table .easyel-table-body td' => 'vertical-align: {{VALUE}};',
967 '{{WRAPPER}} table.easyel-table .easyel-table-body th' => 'vertical-align: {{VALUE}};',
968 ],
969 ]
970 );
971 $this->add_responsive_control(
972 'table_margin',
973 [
974 'label' => esc_html__( 'Table Margin', 'easy-elements' ),
975 'type' => Controls_Manager::DIMENSIONS,
976 'size_units' => [ 'px', '%', 'em' ],
977 'selectors' => [
978 '{{WRAPPER}} table.easyel-table' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
979 ],
980 ]
981 );
982 $this->add_responsive_control(
983 'table_padding',
984 [
985 'label' => esc_html__( 'Table Padding', 'easy-elements' ),
986 'type' => Controls_Manager::DIMENSIONS,
987 'size_units' => [ 'px', '%', 'em' ],
988 'selectors' => [
989 '{{WRAPPER}} table.easyel-table thead th' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
990 '{{WRAPPER}} table.easyel-table tbody td' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
991 ],
992 ]
993 );
994
995 $this->add_group_control(
996 Group_Control_Border::get_type(),
997 [
998 'name' => 'table_border',
999 'label' => esc_html__( 'Border', 'easy-elements' ),
1000 'selector' => '{{WRAPPER}} table.easyel-table tbody',
1001 ]
1002 );
1003 $this->add_responsive_control(
1004 'table_radius',
1005 [
1006 'label' => esc_html__( 'Table Border Radius', 'easy-elements' ),
1007 'type' => Controls_Manager::DIMENSIONS,
1008 'size_units' => [ 'px', '%', 'em' ],
1009 'selectors' => [
1010 '{{WRAPPER}} table.easyel-table' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1011 ],
1012 ]
1013 );
1014 $this->end_controls_section();
1015
1016 $this->start_controls_section(
1017 'table_header_style',
1018 [
1019 'label' => esc_html__( 'Table Header Style', 'easy-elements' ),
1020 'tab' => Controls_Manager::TAB_STYLE,
1021 ]
1022 );
1023
1024 $this->add_responsive_control(
1025 'header_align',
1026 [
1027 'label' => esc_html__( 'Alignment', 'easy-elements' ),
1028 'type' => Controls_Manager::CHOOSE,
1029 'options' => [
1030 'left' => [
1031 'title' => esc_html__( 'Left', 'easy-elements' ),
1032 'icon' => 'eicon-text-align-left',
1033 ],
1034 'center' => [
1035 'title' => esc_html__( 'Center', 'easy-elements' ),
1036 'icon' => 'eicon-text-align-center',
1037 ],
1038 'right' => [
1039 'title' => esc_html__( 'Right', 'easy-elements' ),
1040 'icon' => 'eicon-text-align-right',
1041 ],
1042 'justify' => [
1043 'title' => esc_html__( 'Justified', 'easy-elements' ),
1044 'icon' => 'eicon-text-align-justify',
1045 ],
1046 ],
1047 'selectors' => [
1048 '{{WRAPPER}} table.easyel-table .easyel-table-header' => 'text-align: {{VALUE}};',
1049 ],
1050 ]
1051 );
1052
1053 $this->add_control(
1054 'header_text_color',
1055 [
1056 'label' => esc_html__( 'Text Color', 'easy-elements' ),
1057 'type' => Controls_Manager::COLOR,
1058 'selectors' => [
1059 '{{WRAPPER}} table.easyel-table .easyel-table-header' => 'color: {{VALUE}};',
1060 ]
1061 ]
1062 );
1063
1064 $this->add_group_control(
1065 Group_Control_Typography::get_type(),
1066 [
1067 'name' => 'header_typography',
1068 'selector' => '{{WRAPPER}} table.easyel-table .easyel-table-header',
1069
1070 ]
1071 );
1072
1073 $this->add_control(
1074 'header_bg_color',
1075 [
1076 'label' => esc_html__( 'Background Color', 'easy-elements' ),
1077 'type' => Controls_Manager::COLOR,
1078 'selectors' => [
1079 '{{WRAPPER}} table.easyel-table .easyel-table-header' => 'background-color: {{VALUE}};',
1080 ]
1081 ]
1082 );
1083 $this->add_group_control(
1084 \Elementor\Group_Control_Border::get_type(),
1085 [
1086 'name' => 'body_head_border',
1087 'selector' => '{{WRAPPER}} .table.easyel-table .easyel-table-header th',
1088 ]
1089 );
1090 $this->add_responsive_control(
1091 'table_thead_radius',
1092 [
1093 'label' => esc_html__( 'Border Radius', 'easy-elements' ),
1094 'type' => Controls_Manager::DIMENSIONS,
1095 'size_units' => [ 'px', '%', 'em' ],
1096 'selectors' => [
1097 '{{WRAPPER}} table.easyel-table .easyel-table-header th' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1098 ],
1099 ]
1100 );
1101 $this->add_responsive_control(
1102 'table_thead_padding',
1103 [
1104 'label' => esc_html__( 'Padding', 'easy-elements' ),
1105 'type' => Controls_Manager::DIMENSIONS,
1106 'size_units' => [ 'px', '%', 'em' ],
1107 'selectors' => [
1108 '{{WRAPPER}} table.easyel-table .easyel-table-header th' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1109 ],
1110 ]
1111 );
1112
1113 // header icon settings
1114 $this->add_control(
1115 'header_icon_styles',
1116 [
1117 'label' => esc_html__( 'Icon Style', 'easy-elements' ),
1118 'type' => \Elementor\Controls_Manager::HEADING,
1119 'separator' => 'before',
1120 ]
1121 );
1122
1123 $this->add_control(
1124 'header_icon_color',
1125 [
1126 'label' => esc_html__( 'Color', 'easy-elements' ),
1127 'type' => Controls_Manager::COLOR,
1128 'selectors' => [
1129 '{{WRAPPER}} table.easyel-table .easyel-header-icon i' => 'color: {{VALUE}} !important;',
1130 '{{WRAPPER}} table.easyel-table .easyel-header-icon svg path' => 'fill: {{VALUE}} !important;',
1131 ],
1132 ]
1133 );
1134
1135 $this->add_responsive_control(
1136 'header_icon_size',
1137 [
1138 'label' => esc_html__( 'Size', 'easy-elements' ),
1139 'type' => \Elementor\Controls_Manager::SLIDER,
1140 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ],
1141 'selectors' => [
1142 '{{WRAPPER}} table.easyel-table .easyel-header-icon i' => 'font-size: {{SIZE}}{{UNIT}} !important;',
1143 '{{WRAPPER}} table.easyel-table .easyel-header-icon svg' => 'width: {{SIZE}}{{UNIT}} !important; height: {{SIZE}}{{UNIT}} !important;',
1144 ],
1145 ]
1146 );
1147
1148 $this->add_responsive_control(
1149 'header_icon_y_position',
1150 [
1151 'label' => esc_html__( 'Pisition ( Vertical )', 'easy-elements' ),
1152 'type' => \Elementor\Controls_Manager::SLIDER,
1153 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ],
1154 'selectors' => [
1155 '{{WRAPPER}} table.easyel-table .easyel-header-icon' => 'top: {{SIZE}}{{UNIT}} !important;',
1156 ],
1157 ]
1158 );
1159
1160 $this->add_responsive_control(
1161 'header_icon_margin',
1162 [
1163 'label' => esc_html__( 'Margin', 'easy-elements' ),
1164 'type' => Controls_Manager::DIMENSIONS,
1165 'size_units' => [ 'px', '%', 'em' ],
1166 'selectors' => [
1167 '{{WRAPPER}} table.easyel-table .easyel-header-icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1168 '{{WRAPPER}} table.easyel-table .easyel-header-icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1169 ],
1170 ]
1171 );
1172 $this->end_controls_section();
1173
1174
1175 $this->start_controls_section(
1176 'table_body_style',
1177 [
1178 'label' => esc_html__( 'Table Body Style', 'easy-elements' ),
1179 'tab' => Controls_Manager::TAB_STYLE,
1180 ]
1181 );
1182
1183 $this->add_responsive_control(
1184 'body_align',
1185 [
1186 'label' => esc_html__( 'Alignment', 'easy-elements' ),
1187 'type' => Controls_Manager::CHOOSE,
1188 'options' => [
1189 'left' => [
1190 'title' => esc_html__( 'Left', 'easy-elements' ),
1191 'icon' => 'eicon-text-align-left',
1192 ],
1193 'center' => [
1194 'title' => esc_html__( 'Center', 'easy-elements' ),
1195 'icon' => 'eicon-text-align-center',
1196 ],
1197 'right' => [
1198 'title' => esc_html__( 'Right', 'easy-elements' ),
1199 'icon' => 'eicon-text-align-right',
1200 ],
1201 'justify' => [
1202 'title' => esc_html__( 'Justified', 'easy-elements' ),
1203 'icon' => 'eicon-text-align-justify',
1204 ],
1205 ],
1206 'selectors' => [
1207 '{{WRAPPER}} table.easyel-table .easyel-table-body' => 'text-align: {{VALUE}};',
1208 ],
1209 ]
1210 );
1211
1212 $this->add_control(
1213 'body_text_color',
1214 [
1215 'label' => esc_html__( 'Text Color', 'easy-elements' ),
1216 'type' => Controls_Manager::COLOR,
1217 'selectors' => [
1218 '{{WRAPPER}} table.easyel-table .easyel-table-body' => 'color: {{VALUE}};',
1219 ]
1220 ]
1221 );
1222
1223
1224 $this->add_group_control(
1225 Group_Control_Typography::get_type(),
1226 [
1227 'name' => 'body_typography',
1228 'selector' => '{{WRAPPER}} table.easyel-table .easyel-table-body',
1229
1230 ]
1231 );
1232
1233 $this->add_control(
1234 'body_bg_color',
1235 [
1236 'label' => esc_html__( 'Background Color', 'easy-elements' ),
1237 'type' => Controls_Manager::COLOR,
1238 'selectors' => [
1239 '{{WRAPPER}} table.easyel-table .easyel-table-body' => 'background-color: {{VALUE}};',
1240 ]
1241 ]
1242 );
1243
1244 $this->add_control(
1245 'striped_bg',
1246 [
1247 'label' => esc_html__( 'Striped Background', 'easy-elements' ),
1248 'type' => Controls_Manager::SWITCHER,
1249 'label_off' => esc_html__( 'No', 'easy-elements' ),
1250 'label_on' => esc_html__( 'Yes', 'easy-elements' ),
1251 ]
1252 );
1253 $this->add_control(
1254 'striped_bg_color',
1255 [
1256 'label' => esc_html__( 'Secondary Background Color', 'easy-elements' ),
1257 'type' => Controls_Manager::COLOR,
1258 'condition' => [
1259 'striped_bg' => 'yes',
1260 ],
1261 'selectors' => [
1262 '{{WRAPPER}} table.easyel-table .easyel-table-body tr:nth-of-type(2n)' => 'background-color: {{VALUE}};',
1263 ]
1264 ]
1265 );
1266 $this->add_control(
1267 'body_icon_color',
1268 [
1269 'label' => esc_html__( 'Icon Color', 'easy-elements' ),
1270 'type' => Controls_Manager::COLOR,
1271 'selectors' => [
1272 '{{WRAPPER}} table.easyel-table .easyel-table-body td i' => 'color: {{VALUE}};',
1273 '{{WRAPPER}} table.easyel-table .easyel-table-body td svg path' => 'fill: {{VALUE}};',
1274 ]
1275 ]
1276 );
1277 $this->add_control(
1278 'body_icon_size',
1279 [
1280 'label' => esc_html__( 'Icon Size', 'easy-elements' ),
1281 'type' => \Elementor\Controls_Manager::SLIDER,
1282 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ],
1283 'range' => [
1284 'px' => [
1285 'min' => 0,
1286 'max' => 1000,
1287 ],
1288 ],
1289 'default' => [
1290 'unit' => 'px',
1291 'size' => 16,
1292 ],
1293 'selectors' => [
1294 '{{WRAPPER}} .table.easyel-table .easyel-table-body td i' => 'font-size: {{SIZE}}{{UNIT}};',
1295 '{{WRAPPER}} .table.easyel-table .easyel-table-body td svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
1296 ],
1297 ]
1298 );
1299 $this->add_responsive_control(
1300 'body_icon_gap',
1301 [
1302 'label' => esc_html__( 'Icon Margin', 'easy-elements' ),
1303 'type' => Controls_Manager::DIMENSIONS,
1304 'size_units' => [ 'px', '%', 'em' ],
1305 'selectors' => [
1306 '{{WRAPPER}} table.easyel-table .easyel-table-body td i' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1307 '{{WRAPPER}} table.easyel-table .easyel-table-body td svg' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1308 ],
1309 ]
1310 );
1311 $this->add_responsive_control(
1312 'table_tbody_radius',
1313 [
1314 'label' => esc_html__( 'Border Radius', 'easy-elements' ),
1315 'type' => Controls_Manager::DIMENSIONS,
1316 'size_units' => [ 'px', '%', 'em' ],
1317 'selectors' => [
1318 '{{WRAPPER}} table.easyel-table .easyel-table-body td' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1319 ],
1320 ]
1321 );
1322 $this->add_responsive_control(
1323 'table_tbody_padding',
1324 [
1325 'label' => esc_html__( 'Padding', 'easy-elements' ),
1326 'type' => Controls_Manager::DIMENSIONS,
1327 'size_units' => [ 'px', '%', 'em' ],
1328 'selectors' => [
1329 '{{WRAPPER}} table.easyel-table .easyel-table-body td' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1330 ],
1331 ]
1332 );
1333 $this->add_responsive_control(
1334 'table_tbody_margin',
1335 [
1336 'label' => esc_html__( 'Margin', 'easy-elements' ),
1337 'type' => Controls_Manager::DIMENSIONS,
1338 'size_units' => [ 'px', '%', 'em' ],
1339 'selectors' => [
1340 '{{WRAPPER}} table.easyel-table .easyel-table-body td' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1341 '{{WRAPPER}} table.easyel-table .easyel-table-body td p' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1342 ],
1343 ]
1344 );
1345 $this->add_group_control(
1346 \Elementor\Group_Control_Border::get_type(),
1347 [
1348 'name' => 'body_border',
1349 'selector' => '{{WRAPPER}} .table.easyel-table .easyel-table-body td',
1350 ]
1351 );
1352 $this->add_control(
1353 'tooltip_heading',
1354 [
1355 'label' => esc_html__( 'Tooltip Options', 'easy-elements' ),
1356 'type' => \Elementor\Controls_Manager::HEADING,
1357 'separator' => 'before',
1358 ]
1359 );
1360 $this->add_control(
1361 'tooltip_icon_color',
1362 [
1363 'label' => esc_html__( 'Tooltip Icon Color', 'easy-elements' ),
1364 'type' => Controls_Manager::COLOR,
1365 'selectors' => [
1366 '{{WRAPPER}} table.easyel-table .easyel-tooltip i' => 'color: {{VALUE}} !important;',
1367 '{{WRAPPER}} table.easyel-table .easyel-tooltip svg path' => 'fill: {{VALUE}} !important;',
1368 ]
1369 ]
1370 );
1371 $this->add_control(
1372 'tooltip_icon_size',
1373 [
1374 'label' => esc_html__( 'Tooltip Icon Size', 'easy-elements' ),
1375 'type' => \Elementor\Controls_Manager::SLIDER,
1376 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ],
1377 'range' => [
1378 'px' => [
1379 'min' => 0,
1380 'max' => 1000,
1381 ],
1382 ],
1383 'default' => [
1384 'unit' => 'px',
1385 'size' => 16,
1386 ],
1387 'selectors' => [
1388 '{{WRAPPER}} .table.easyel-table .easyel-tooltip i' => 'font-size: {{SIZE}}{{UNIT}} !important;',
1389 '{{WRAPPER}} .table.easyel-table .easyel-tooltip svg' => 'width: {{SIZE}}{{UNIT}} !important; height: {{SIZE}}{{UNIT}} !important;',
1390 ],
1391 ]
1392 );
1393 $this->add_responsive_control(
1394 'tooltip_icon_margin',
1395 [
1396 'label' => esc_html__( 'Tooltip Icon Margin', 'easy-elements' ),
1397 'type' => Controls_Manager::DIMENSIONS,
1398 'size_units' => [ 'px', '%', 'em' ],
1399 'selectors' => [
1400 '{{WRAPPER}} .table.easyel-table .easyel-tooltip i' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1401 '{{WRAPPER}} .table.easyel-table .easyel-tooltip svg' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1402 ],
1403 ]
1404 );
1405 $this->add_responsive_control(
1406 'tooltip_align',
1407 [
1408 'label' => esc_html__( 'Tooltip Align', 'easy-elements' ),
1409 'type' => Controls_Manager::CHOOSE,
1410 'options' => [
1411 'left' => [
1412 'title' => esc_html__( 'Left', 'easy-elements' ),
1413 'icon' => 'eicon-h-align-left',
1414 ],
1415 'top' => [
1416 'title' => esc_html__( 'Top', 'easy-elements' ),
1417 'icon' => 'eicon-v-align-top',
1418 ],
1419 'right' => [
1420 'title' => esc_html__( 'Right', 'easy-elements' ),
1421 'icon' => 'eicon-h-align-right',
1422 ],
1423 'bottom' => [
1424 'title' => esc_html__( 'Bottom', 'easy-elements' ),
1425 'icon' => 'eicon-v-align-bottom',
1426 ],
1427 ],
1428 'default' => 'left',
1429 'toggle' => true,
1430 ]
1431 );
1432
1433 // image style
1434 $this->add_control(
1435 'table_img_heading',
1436 [
1437 'label' => esc_html__( 'Image Options', 'easy-elements' ),
1438 'type' => \Elementor\Controls_Manager::HEADING,
1439 'separator' => 'before',
1440 ]
1441 );
1442
1443 $this->add_control(
1444 'table_img_size',
1445 [
1446 'label' => esc_html__( 'Size', 'easy-elements' ),
1447 'type' => \Elementor\Controls_Manager::SLIDER,
1448 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ],
1449 'selectors' => [
1450 '{{WRAPPER}} .easyel-table-body .easyel-table-image' => 'max-width: {{SIZE}}{{UNIT}} !important;height: {{SIZE}}{{UNIT}} !important;',
1451 ],
1452 ]
1453 );
1454
1455 $this->add_responsive_control(
1456 'table_img_radius',
1457 [
1458 'label' => esc_html__( 'Border Radius', 'easy-elements' ),
1459 'type' => Controls_Manager::DIMENSIONS,
1460 'size_units' => [ 'px', '%', 'em' ],
1461 'selectors' => [
1462 '{{WRAPPER}} .easyel-table-body .easyel-table-image' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1463 ],
1464 ]
1465 );
1466
1467 $this->end_controls_section();
1468
1469 $this->start_controls_section(
1470 'table_footer_style',
1471 [
1472 'label' => esc_html__( 'Table footer Style', 'easy-elements' ),
1473 'tab' => Controls_Manager::TAB_STYLE,
1474 ]
1475 );
1476
1477 $this->add_responsive_control(
1478 'footer_align',
1479 [
1480 'label' => esc_html__( 'Alignment', 'easy-elements' ),
1481 'type' => Controls_Manager::CHOOSE,
1482 'options' => [
1483 'left' => [
1484 'title' => esc_html__( 'Left', 'easy-elements' ),
1485 'icon' => 'eicon-text-align-left',
1486 ],
1487 'center' => [
1488 'title' => esc_html__( 'Center', 'easy-elements' ),
1489 'icon' => 'eicon-text-align-center',
1490 ],
1491 'right' => [
1492 'title' => esc_html__( 'Right', 'easy-elements' ),
1493 'icon' => 'eicon-text-align-right',
1494 ],
1495 'justify' => [
1496 'title' => esc_html__( 'Justified', 'easy-elements' ),
1497 'icon' => 'eicon-text-align-justify',
1498 ],
1499 ],
1500 'selectors' => [
1501 '{{WRAPPER}} table.easyel-table .easyel-table-footer' => 'text-align: {{VALUE}};',
1502 ],
1503 ]
1504 );
1505
1506
1507 $this->add_control(
1508 'footer_text_color',
1509 [
1510 'label' => esc_html__( 'Text Color', 'easy-elements' ),
1511 'type' => Controls_Manager::COLOR,
1512 'selectors' => [
1513 '{{WRAPPER}} table.easyel-table .easyel-table-footer' => 'color: {{VALUE}};',
1514 ]
1515 ]
1516 );
1517
1518 $this->add_group_control(
1519 Group_Control_Typography::get_type(),
1520 [
1521 'name' => 'footer_typography',
1522 'selector' => '{{WRAPPER}} table.easyel-table .easyel-table-footer',
1523
1524 ]
1525 );
1526
1527 $this->add_control(
1528 'footer_bg_color',
1529 [
1530 'label' => esc_html__( 'Background Color', 'easy-elements' ),
1531 'type' => Controls_Manager::COLOR,
1532 'selectors' => [
1533 '{{WRAPPER}} table.easyel-table .easyel-table-footer' => 'background-color: {{VALUE}};',
1534 ]
1535 ]
1536 );
1537 $this->add_responsive_control(
1538 'table_tfoot_radius',
1539 [
1540 'label' => esc_html__( 'Border Radius', 'easy-elements' ),
1541 'type' => Controls_Manager::DIMENSIONS,
1542 'size_units' => [ 'px', '%', 'em' ],
1543 'selectors' => [
1544 '{{WRAPPER}} table.easyel-table .easyel-table-footer th' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1545 ],
1546 ]
1547 );
1548 $this->add_responsive_control(
1549 'table_tfoot_padding',
1550 [
1551 'label' => esc_html__( 'Padding', 'easy-elements' ),
1552 'type' => Controls_Manager::DIMENSIONS,
1553 'size_units' => [ 'px', '%', 'em' ],
1554 'selectors' => [
1555 '{{WRAPPER}} table.easyel-table .easyel-table-footer th' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1556 ],
1557 ]
1558 );
1559 $this->add_group_control(
1560 \Elementor\Group_Control_Border::get_type(),
1561 [
1562 'name' => 'body_foot_border',
1563 'selector' => '{{WRAPPER}} .table.easyel-table .easyel-table-footer th',
1564 ]
1565 );
1566
1567 $this->end_controls_section();
1568
1569 }
1570 /**
1571 * Render oEmbed widget output on the frontend.
1572 *
1573 * Written in PHP and used to generate the final HTML.
1574 *
1575 * @since 1.0.0
1576 * @access protected
1577 */
1578 protected function render() {
1579 $settings = $this->get_settings_for_display();
1580 $unique = wp_rand(10,6554120);
1581 $tooltip_align = $settings['tooltip_align'];
1582 ?>
1583 <!-- Tooltip element -->
1584 <table class="easyel-table table single-plan" id="table-<?php echo esc_attr($unique);?>">
1585 <?php if ($settings['table_header']):?>
1586 <thead class="easyel-table-header">
1587 <tr class="single-plan__header">
1588 <?php
1589 foreach ( $settings['table_header'] as $index => $headeritem ) {
1590
1591 $repeater_setting_key = $this->get_repeater_setting_key( 'text', 'table_header', $index );
1592 $this->add_inline_editing_attributes( $repeater_setting_key );
1593
1594 $colspan = ( isset( $headeritem['colspan'], $headeritem['advance'] ) && $headeritem['colspan'] === 'yes' && $headeritem['advance'] === 'yes' ) ? 'colspan="' . esc_attr( $headeritem['colspannumber'] ) . '"' : '';
1595
1596 echo '<th class="header-title elementor-inline-editing elementor-repeater-item-' . esc_attr( $headeritem['_id'] ) . '" '
1597 . esc_attr( $colspan ) . ' '
1598 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1599 . $this->get_render_attribute_string( $repeater_setting_key ) . '>';
1600
1601 // Header Icon
1602 if ( isset( $headeritem['header_icon'] ) && $headeritem['header_icon'] === 'yes' && ! empty( $headeritem['table_head_icon']['value'] ) ) {
1603 echo '<span class="easyel-header-icon">';
1604
1605 // Render icon safely
1606 \Elementor\Icons_Manager::render_icon(
1607 $headeritem['table_head_icon'],
1608 [ 'aria-hidden' => 'true' ]
1609 );
1610
1611 echo '</span>';
1612 }
1613
1614 echo wp_kses_post( $headeritem['text'] );
1615
1616 if ( isset( $headeritem['table_head_tooltip'] ) && $headeritem['table_head_tooltip'] === 'yes' ) {
1617 echo '<span class="easyel-tooltip" '
1618 . 'data-bs-custom-class="tooltip-table-title" '
1619 . 'data-bs-toggle="tooltip" '
1620 . 'data-bs-placement="' . esc_attr( $tooltip_align ) . '" '
1621 . 'title="' . esc_attr( $headeritem['table_head_tooltip_description'] ) . '">';
1622
1623 \Elementor\Icons_Manager::render_icon(
1624 $headeritem['table_head_tooltip_icon'],
1625 [ 'aria-hidden' => 'true' ]
1626 );
1627
1628 echo '</span>';
1629 }
1630
1631 echo '</th>';
1632 }
1633 ?>
1634 </tr>
1635 </thead>
1636 <?php endif;?>
1637 <?php if ($settings['table_body']):?>
1638 <tbody class="easyel-table-body">
1639 <tr class="single-plan__content">
1640 <?php
1641 foreach ( $settings['table_body'] as $index => $item ) {
1642
1643 // Flex data condition
1644 $flex_data = ( !empty( $item['table_body_data_flex'] ) && $item['table_body_data_flex'] === 'yes' ) ? 'data-flex' : '';
1645
1646 $table_icon = ! empty( $item['table_icon'] ) ? $item['table_icon'] : '';
1647
1648
1649 $table_body_key = $this->get_repeater_setting_key( 'text', 'table_body', $index );
1650
1651 $this->add_render_attribute( $table_body_key, 'class', 'plan-title ' . $flex_data . ' elementor-repeater-item-' . esc_attr( $item['_id'] ) );
1652
1653 $this->add_inline_editing_attributes( $table_body_key );
1654
1655 if ( isset( $item['row'] ) && $item['row'] === 'yes' ) {
1656 echo '</tr><tr class="single-plan__content">';
1657 }
1658
1659 $colspan = ( isset( $item['colspan'], $item['advance'] ) && $item['colspan'] === 'yes' && $item['advance'] === 'yes' )
1660 ? 'colspan="' . esc_attr( $item['colspannumber'] ) . '"'
1661 : '';
1662
1663 $rowspan = ( isset( $item['rowspan'], $item['advance'] ) && $item['rowspan'] === 'yes' && $item['advance'] === 'yes' )
1664 ? 'rowspan="' . esc_attr( $item['rowspannumber'] ) . '"'
1665 : '';
1666
1667 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1668 echo '<td ' . $colspan . ' ' . $rowspan . ' ' . $this->get_render_attribute_string( $table_body_key ) . '>';
1669
1670 // table icon
1671 if ( ! empty( $table_icon ) ) {
1672 \Elementor\Icons_Manager::render_icon( $table_icon, [ 'aria-hidden' => 'true' ] );
1673 }
1674
1675 // table image
1676 $image_id = ! empty( $item['table_image']['id'] ) ? absint( $item['table_image']['id'] ) : '';
1677 $image_url = ! empty( $item['table_image']['url'] ) ? esc_url( $item['table_image']['url'] ) : '';
1678 // Case 1: Attachment ID exists and is an image
1679 if ( $image_id && wp_attachment_is_image( $image_id ) ) {
1680 echo wp_get_attachment_image(
1681 $image_id,
1682 'thumbnail',
1683 false,
1684 [
1685 'class' => 'easyel-table-image',
1686 'alt' => esc_attr( get_post_meta( $image_id, '_wp_attachment_image_alt', true ) ),
1687 ]
1688 );
1689 }
1690
1691 // Case 2: Fallback to URL
1692 elseif ( $image_url ) {
1693 echo '<img src="' . esc_url( $image_url ) . '" class="easyel-table-image" alt="">';
1694 }
1695
1696 echo wp_kses_post( $item['text'] );
1697
1698 if ( isset( $item['table_body_tooltip'] ) && $item['table_body_tooltip'] === 'yes' ) {
1699 echo '<span class="easyel-tooltip" '
1700 . 'data-bs-custom-class="tooltip-table-title" '
1701 . 'data-bs-toggle="tooltip" '
1702 . 'data-bs-placement="' . esc_attr( $tooltip_align ) . '" '
1703 . 'title="' . esc_attr( $item['table_body_tooltip_description'] ) . '">';
1704
1705 \Elementor\Icons_Manager::render_icon(
1706 $item['table_body_tooltip_icon'],
1707 [ 'aria-hidden' => 'true' ]
1708 );
1709 echo '</span>';
1710 }
1711
1712 echo '</td>';
1713 }
1714 ?>
1715 </tr>
1716 </tbody>
1717 <?php endif;?>
1718 <?php if ($settings['table_footer']):?>
1719 <tfoot class="easyel-table-footer">
1720 <tr class="easyel-single-plane-footer">
1721 <?php
1722 foreach ( $settings['table_footer'] as $index => $footeritem ) {
1723
1724 $repeater_setting_key = $this->get_repeater_setting_key( 'text', 'table_footer', $index );
1725 $this->add_inline_editing_attributes( $repeater_setting_key );
1726
1727 $colspan = ( $footeritem['colspan'] === 'yes' && $footeritem['advance'] === 'yes' )
1728 ? 'colspan="' . esc_attr( $footeritem['colspannumber'] ) . '"'
1729 : '';
1730
1731 echo '<th class="footer-title elementor-inline-editing elementor-repeater-item-' . esc_attr( $footeritem['_id'] ) . '" '
1732 . esc_attr( $colspan ) . ' '
1733 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1734 . $this->get_render_attribute_string( $repeater_setting_key )
1735 . '>'
1736 . wp_kses_post( $footeritem['text'] );
1737
1738 if ( isset( $footeritem['table_foot_tooltip'] ) && $footeritem['table_foot_tooltip'] === 'yes' ) {
1739 echo '<span class="easyel-tooltip" '
1740 . 'data-bs-custom-class="tooltip-table-title" '
1741 . 'data-bs-toggle="tooltip" '
1742 . 'data-bs-placement="' . esc_attr( $tooltip_align ) . '" '
1743 . 'title="' . esc_attr( $footeritem['table_foot_tooltip_description'] ) . '">';
1744
1745 \Elementor\Icons_Manager::render_icon(
1746 $footeritem['table_foot_tooltip_icon'],
1747 [ 'aria-hidden' => 'true' ]
1748 );
1749
1750 echo '</span>';
1751 }
1752
1753 echo '</th>';
1754 }
1755 ?>
1756 </tr>
1757 </tfoot>
1758 <?php endif;?>
1759 </table>
1760
1761 <?php
1762 }
1763 }
1764 }