PluginProbe
Easy Elements for Elementor – Addons & Website Templates / 1.5.0
Easy Elements for Elementor – Addons & Website Templates v1.5.0
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.5.0, at widgets/table/table-normal.php

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