PluginProbe ʕ •ᴥ•ʔ
Essential Addons for Elementor – Popular Elementor Templates & Widgets / 5.1.4
Essential Addons for Elementor – Popular Elementor Templates & Widgets v5.1.4
6.6.5 6.6.4 6.6.3 5.7.3 5.7.4 5.8.0 5.8.1 5.8.10 5.8.11 5.8.12 5.8.13 5.8.14 5.8.15 5.8.16 5.8.18 5.8.2 5.8.3 5.8.4 5.8.5 5.8.6 5.8.7 5.8.8 5.8.9 5.9.0 5.9.1 5.9.10 5.9.11 5.9.12 5.9.13 5.9.14 5.9.15 5.9.16 5.9.17 5.9.18 5.9.19 5.9.2 5.9.20 5.9.21 5.9.22 5.9.23 5.9.24 5.9.25 5.9.26 5.9.27 5.9.3 5.9.4 5.9.5 5.9.6 5.9.7 5.9.8 5.9.9 6.0.0 6.0.1 6.0.10 6.0.11 6.0.12 6.0.13 6.0.14 6.0.15 6.0.2 6.0.3 6.0.4 6.0.5 6.0.6 6.0.7 6.0.8 6.0.9 6.1.0 6.1.1 6.1.10 6.1.11 trunk 6.1.12 1.0.0 6.1.13 1.0.1 6.1.14 1.1.0 6.1.15 2.0 6.1.17 2.1 6.1.18 2.10.0 6.1.19 2.10.1 6.1.2 2.10.2 6.1.20 2.10.3 6.1.3 2.10.4 6.1.4 2.10.5 6.1.5 2.2.0 6.1.6 2.2.1 6.1.7 2.2.2 6.1.8 2.2.3 6.1.9 2.2.4 6.2.0 2.2.5 6.2.1 2.3.0 6.2.2 2.3.1 6.2.3 2.4.0 6.2.4 2.4.1 6.3.0 2.4.2 6.3.1 2.4.3 6.3.2 2.5.0 6.3.3 2.6.0 6.4.0 2.7.0 6.5.0 2.7.1 6.5.1 2.7.10 6.5.10 2.7.11 6.5.11 2.7.2 6.5.12 2.7.3 6.5.13 2.7.4 6.5.2 2.7.5 6.5.3 2.7.6 6.5.4 2.7.7 6.5.5 2.7.8 6.5.6 2.7.9 6.5.7 2.8.0 6.5.8 2.8.1 6.5.9 2.8.2 6.6.0 2.8.3 6.6.1 2.8.4 6.6.2 2.8.5 2.8.6 2.8.7 2.9.0 2.9.1 2.9.2 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8 2.9.9 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.4.1 3.1.5 3.2.0 3.3.0 3.3.1 3.3.2 3.3.3 3.4.0 3.5.0 3.5.1 3.5.2 3.6.0 3.6.1 3.6.2 3.7.0 3.7.1 3.7.2 3.8.0 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.9.0 3.9.1 3.9.2 3.9.3 3.9.4 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.1.0 4.1.1 4.1.2 4.2.0 4.2.1 4.2.2 4.2.3 4.2.4 4.3.0 4.3.1 4.3.2 4.3.3 4.3.4 4.3.5 4.3.6 4.3.7 4.3.8 4.3.9 4.4.0 4.4.1 4.5.0 4.5.1 4.5.2 4.5.3 4.5.4 4.5.5 4.6.0 4.6.1 4.6.2 4.6.3 4.6.4 4.6.5 4.6.6 4.7.0 4.7.1 4.7.2 4.7.3 4.7.4 4.7.5 4.8.0 4.8.1 4.8.2 4.8.3 4.8.4 4.9.0 4.9.1 4.9.2 4.9.3 4.9.4 4.9.5 4.9.6 4.9.7 5.0.0 5.0.1 5.0.10 5.0.11 5.0.12 5.0.13 5.0.2 5.0.3 5.0.4 5.0.5 5.0.6 5.0.7 5.0.8 5.0.9 5.1.0 5.1.1 5.1.2 5.1.3 5.1.4 5.1.5 5.1.6 5.1.7 5.1.8 5.1.9 5.2.0 5.2.1 5.2.2 5.2.3 5.2.4 5.3.0 5.3.1 5.3.2 5.4.6 5.5.5 5.6.5 5.7.2
essential-addons-for-elementor-lite / includes / Extensions / Table_of_Content.php
essential-addons-for-elementor-lite / includes / Extensions Last commit date
Custom_JS.php 5 years ago Post_Duplicator.php 4 years ago Promotion.php 4 years ago Reading_Progress.php 4 years ago Scroll_to_Top.php 4 years ago Table_of_Content.php 4 years ago
Table_of_Content.php
1108 lines
1 <?php
2 namespace Essential_Addons_Elementor\Extensions;
3
4 if (!defined('ABSPATH')) {
5 exit;
6 }
7
8 use \Elementor\Controls_Manager;
9 use \Elementor\Group_Control_Border;
10 use \Elementor\Group_Control_Box_Shadow;
11 use \Elementor\Group_Control_Typography;
12 use \Elementor\Core\Schemes\Typography;
13 use \Essential_Addons_Elementor\Classes\Helper;
14
15 class Table_of_Content
16 {
17
18 public function __construct()
19 {
20 add_action('elementor/documents/register_controls', [$this, 'register_controls'], 10);
21 }
22
23 public function register_controls($element)
24 {
25 if (Helper::prevent_extension_loading(get_the_ID())) {
26 return;
27 }
28
29 $global_settings = get_option('eael_global_settings');
30
31 $element->start_controls_section(
32 'eael_ext_table_of_content_section',
33 [
34 'label' => __('<i class="eaicon-logo"></i> Table of Contents', 'essential-addons-for-elementor-lite'),
35 'tab' => Controls_Manager::TAB_SETTINGS,
36 ]
37 );
38
39 $element->add_control(
40 'eael_ext_table_of_content',
41 [
42 'label' => __('Enable Table of Contents', 'essential-addons-for-elementor-lite'),
43 'type' => Controls_Manager::SWITCHER,
44 'default' => 'no',
45 'label_on' => __('Yes', 'essential-addons-for-elementor-lite'),
46 'label_off' => __('No', 'essential-addons-for-elementor-lite'),
47 'return_value' => 'yes',
48 ]
49 );
50
51 $element->add_control(
52 'eael_ext_toc_has_global',
53 [
54 'type' => Controls_Manager::HIDDEN,
55 'default' => isset($global_settings['eael_ext_table_of_content']['enabled']) ? true : false,
56 ]
57 );
58
59 if (isset($global_settings['eael_ext_table_of_content']['enabled']) && ($global_settings['eael_ext_table_of_content']['enabled'] == true) && get_the_ID() != $global_settings['eael_ext_table_of_content']['post_id'] && get_post_status($global_settings['eael_ext_table_of_content']['post_id']) == 'publish') {
60 $element->add_control(
61 'eael_ext_toc_global_warning_text',
62 [
63 'type' => Controls_Manager::RAW_HTML,
64 'raw' => __('You can modify the Global Table of Contents by <strong><a href="' . get_bloginfo('url') . '/wp-admin/post.php?post=' . $global_settings['eael_ext_table_of_content']['post_id'] . '&action=elementor">Clicking Here</a></strong>', 'essential-addons-for-elementor-lite'),
65 'content_classes' => 'eael-warning',
66 'condition' => [
67 'eael_ext_table_of_content' => 'yes',
68 ],
69 ]
70 );
71 } else {
72 $element->add_control(
73 'eael_ext_toc_global',
74 [
75 'label' => __('Enable Table of Contents Globally', 'essential-addons-for-elementor-lite'),
76 'description' => __('Enabling this option will effect on entire site.', 'essential-addons-for-elementor-lite'),
77 'type' => Controls_Manager::SWITCHER,
78 'default' => 'no',
79 'label_on' => __('Yes', 'essential-addons-for-elementor-lite'),
80 'label_off' => __('No', 'essential-addons-for-elementor-lite'),
81 'return_value' => 'yes',
82 'condition' => [
83 'eael_ext_table_of_content' => 'yes',
84 ],
85 ]
86 );
87
88 $element->add_control(
89 'eael_ext_toc_global_display_condition',
90 [
91 'label' => __('Display On', 'essential-addons-for-elementor-lite'),
92 'type' => Controls_Manager::SELECT,
93 'default' => 'all',
94 'options' => [
95 'posts' => __('All Posts', 'essential-addons-for-elementor-lite'),
96 'pages' => __('All Pages', 'essential-addons-for-elementor-lite'),
97 'all' => __('All Posts & Pages', 'essential-addons-for-elementor-lite'),
98 ],
99 'condition' => [
100 'eael_ext_table_of_content' => 'yes',
101 'eael_ext_toc_global' => 'yes',
102 ],
103 ]
104 );
105 }
106
107 $element->add_control(
108 'eael_ext_toc_title',
109 [
110 'label' => __('Title', 'essential-addons-for-elementor-lite'),
111 'type' => Controls_Manager::TEXT,
112 'dynamic' => [ 'active' => true ],
113 'default' => __('Table of Contents', 'essential-addons-for-elementor-lite'),
114 'label_block' => false,
115 'condition' => [
116 'eael_ext_table_of_content' => 'yes',
117 ],
118 ]
119 );
120
121 $element->start_controls_tabs('eael_toc_include_exclude', ['separator' => 'before']);
122
123 $element->start_controls_tab('eael_toc_include',
124 [
125 'label' => __('Include', 'essential-addons-for-elementor-lite'),
126 'condition' => [
127 'eael_ext_table_of_content' => 'yes',
128 ],
129 ]
130 );
131
132 $element->add_control(
133 'eael_ext_toc_supported_heading_tag',
134 [
135 'label' => __('Supported Heading Tag', 'essential-addons-for-elementor-lite'),
136 'type' => Controls_Manager::SELECT2,
137 'multiple' => true,
138 'label_block' => true,
139 'default' => [
140 'h2',
141 'h3',
142 'h4',
143 'h5',
144 'h6',
145 ],
146 'options' => [
147 'h1' => __('H1', 'essential-addons-for-elementor-lite'),
148 'h2' => __('H2', 'essential-addons-for-elementor-lite'),
149 'h3' => __('H3', 'essential-addons-for-elementor-lite'),
150 'h4' => __('H4', 'essential-addons-for-elementor-lite'),
151 'h5' => __('H5', 'essential-addons-for-elementor-lite'),
152 'h6' => __('H6', 'essential-addons-for-elementor-lite'),
153 ],
154 'render_type' => 'none',
155 'condition' => [
156 'eael_ext_table_of_content' => 'yes',
157 ],
158 ]
159 );
160
161 $element->add_control(
162 'eael_ext_toc_content_selector',
163 [
164 'label' => __('Content Selector', 'essential-addons-for-elementor-lite'),
165 'type' => Controls_Manager::TEXT,
166 'dynamic' => [ 'active' => true ],
167 'description' => __('Which content are searched for heading tag, Provide unique selector to replace default selector', 'essential-addons-for-elementor-lite'),
168 'label_block' => false,
169 'condition' => [
170 'eael_ext_table_of_content' => 'yes',
171 ],
172 ]
173 );
174
175 $element->end_controls_tab(); // include
176
177 $element->start_controls_tab('eael_toc_exclude',
178 [
179 'label' => __('Exclude', 'essential-addons-for-elementor-lite'),
180 'condition' => [
181 'eael_ext_table_of_content' => 'yes',
182 ],
183 ]
184 );
185
186 $element->add_control(
187 'eael_toc_exclude_selector',
188 [
189 'label' => __('Exclude By Selector', 'essential-addons-for-elementor-lite'),
190 'type' => Controls_Manager::TEXT,
191 'dynamic' => [ 'active' => true ],
192 'description' => __('CSS selectors, in a comma-separated list', 'essential-addons-for-elementor-lite'),
193 'default' => '',
194 'label_block' => true,
195 'condition' => [
196 'eael_ext_table_of_content' => 'yes',
197 ],
198 ]
199 );
200
201 $element->end_controls_tab(); // exclude
202
203 $element->end_controls_tabs(); // include_exclude_tags
204
205 $element->add_control(
206 'eael_ext_toc_collapse_sub_heading',
207 [
208 'label' => __('Keep Sub Heading Collapsed', 'essential-addons-for-elementor-lite'),
209 'type' => Controls_Manager::SWITCHER,
210 'default' => 'yes',
211 'label_on' => __('Yes', 'essential-addons-for-elementor-lite'),
212 'label_off' => __('No', 'essential-addons-for-elementor-lite'),
213 'return_value' => 'yes',
214 'condition' => [
215 'eael_ext_table_of_content' => 'yes',
216 ],
217 ]
218 );
219
220 $element->add_control(
221 'eael_ext_toc_use_title_in_url',
222 [
223 'label' => __('Heading Text in URL', 'essential-addons-for-elementor-lite'),
224 'type' => Controls_Manager::SWITCHER,
225 'default' => 'no',
226 'label_on' => __('Yes', 'essential-addons-for-elementor-lite'),
227 'label_off' => __('No', 'essential-addons-for-elementor-lite'),
228 'return_value' => 'yes',
229 'condition' => [
230 'eael_ext_table_of_content' => 'yes',
231 ],
232 ]
233 );
234
235 $element->add_control(
236 'eael_ext_toc_word_wrap',
237 [
238 'label' => __('Stop Word Wrap', 'essential-addons-for-elementor-lite'),
239 'type' => Controls_Manager::SWITCHER,
240 'default' => 'no',
241 'label_on' => __('Yes', 'essential-addons-for-elementor-lite'),
242 'label_off' => __('No', 'essential-addons-for-elementor-lite'),
243 'return_value' => 'yes',
244 'condition' => [
245 'eael_ext_table_of_content' => 'yes',
246 ],
247 ]
248 );
249
250 $element->add_control(
251 'eael_ext_toc_auto_collapse',
252 [
253 'label' => __('TOC Auto Collapse', 'essential-addons-for-elementor-lite'),
254 'type' => Controls_Manager::SWITCHER,
255 'default' => 'yes',
256 'label_on' => __('Yes', 'essential-addons-for-elementor-lite'),
257 'label_off' => __('No', 'essential-addons-for-elementor-lite'),
258 'return_value' => 'yes',
259 'condition' => [
260 'eael_ext_table_of_content' => 'yes',
261 ],
262 ]
263 );
264
265 $element->add_control(
266 'eael_ext_toc_hide_in_mobile',
267 [
268 'label' => __('Hide TOC in mobile', 'essential-addons-for-elementor-lite'),
269 'type' => Controls_Manager::SWITCHER,
270 'default' => 'no',
271 'label_on' => __('Yes', 'essential-addons-for-elementor-lite'),
272 'label_off' => __('No', 'essential-addons-for-elementor-lite'),
273 'return_value' => 'yes',
274 'condition' => [
275 'eael_ext_table_of_content' => 'yes',
276 ],
277 ]
278 );
279
280 $element->add_responsive_control(
281 'eael_ext_toc_max_height',
282 [
283 'label' => __( 'Height', 'essential-addons-for-elementor-lite' ),
284 'type' => Controls_Manager::SLIDER,
285 'range' => [
286 'vh' => [
287 'min' => 10,
288 'max' => 100,
289 ],
290 ],
291 'default' => [
292 'size' => 50,
293 ],
294 'size_units' => [ 'vh' ],
295 'selectors' => [
296 '{{WRAPPER}} .eael-toc.eael-sticky .eael-toc-body' => 'max-height: {{SIZE}}vh; height: {{SIZE}}vh;',
297 ],
298 'condition' => [
299 'eael_ext_table_of_content' => 'yes',
300 ],
301 ]
302 );
303
304 $element->add_control(
305 'eael_ext_toc_sticky_scroll',
306 [
307 'label' => __('Sticky Scroll Effect', 'essential-addons-for-elementor-lite'),
308 'type' => Controls_Manager::SLIDER,
309 'size_units' => ['px'],
310 'range' => [
311 'px' => [
312 'min' => 5,
313 'max' => 2000,
314 'step' => 10,
315 ],
316 ],
317 'default' => [
318 'unit' => 'px',
319 'size' => 200,
320 ],
321 'condition' => [
322 'eael_ext_table_of_content' => 'yes',
323 ],
324 ]
325 );
326
327 $element->add_control(
328 'eael_ext_toc_sticky_offset',
329 [
330 'label' => __('Sticky Top Offset', 'essential-addons-for-elementor-lite'),
331 'type' => Controls_Manager::SLIDER,
332 'size_units' => ['px'],
333 'range' => [
334 'px' => [
335 'min' => 5,
336 'max' => 2000,
337 'step' => 10,
338 ],
339 ],
340 'default' => [
341 'unit' => 'px',
342 'size' => 200,
343 ],
344 'selectors' => [
345 '{{WRAPPER}} .eael-toc.eael-sticky' => 'top: {{SIZE}}{{UNIT}} !important;',
346 ],
347 'condition' => [
348 'eael_ext_table_of_content' => 'yes',
349 ],
350 ]
351 );
352
353 $element->add_control(
354 'eael_ext_toc_main_page_offset',
355 [
356 'label' => __('Main Page Offset', 'essential-addons-for-elementor-lite'),
357 'type' => Controls_Manager::SLIDER,
358 'size_units' => ['px'],
359 'range' => [
360 'px' => [
361 'min' => 5,
362 'max' => 2000,
363 'step' => 10,
364 ],
365 ],
366 'default' => [
367 'unit' => 'px',
368 'size' => 120,
369 ],
370 'condition' => [
371 'eael_ext_table_of_content' => 'yes',
372 ],
373 ]
374 );
375
376 $element->add_control(
377 'eael_ext_toc_sticky_z_index',
378 [
379 'label' => __('Z Index', 'essential-addons-for-elementor-lite'),
380 'type' => Controls_Manager::SLIDER,
381 'size_units' => ['px'],
382 'range' => [
383 'px' => [
384 'min' => 0,
385 'max' => 9999,
386 'step' => 10,
387 ],
388 ],
389 'default' => [
390 'unit' => 'px',
391 'size' => 9999,
392 ],
393 'selectors' => [
394 '{{WRAPPER}} .eael-toc' => 'z-index: {{SIZE}}',
395 ],
396 'condition' => [
397 'eael_ext_table_of_content' => 'yes',
398 ],
399 ]
400 );
401
402 $element->add_control(
403 'eael_ext_toc_ad_warning_text',
404 [
405 'type' => Controls_Manager::RAW_HTML,
406 'raw' => __('Need more information about TOC <strong><a href="https://essential-addons.com/elementor/docs/table-of-content/" class="eael-btn" target="_blank">Visit documentation</a></strong>', 'essential-addons-for-elementor-lite'),
407 'content_classes' => 'eael-warning',
408 'separator' => 'before',
409 'condition' => [
410 'eael_ext_table_of_content' => 'yes',
411 ],
412 ]
413 );
414
415 $element->end_controls_section();
416
417 $element->start_controls_section(
418 'eael_ext_toc_main',
419 [
420 'label' => esc_html__('EA TOC', 'essential-addons-for-elementor-lite'),
421 'tab' => Controls_Manager::TAB_STYLE,
422 'condition' => [
423 'eael_ext_table_of_content' => 'yes',
424 ],
425 ]
426 );
427
428 $element->add_control(
429 'eael_ext_toc_width',
430 [
431 'label' => __('Width', 'essential-addons-for-elementor-lite'),
432 'type' => Controls_Manager::SLIDER,
433 'size_units' => ['px'],
434 'range' => [
435 'px' => [
436 'min' => 0,
437 'max' => 1000,
438 'step' => 1,
439 ],
440 ],
441 'default' => [
442 'unit' => 'px',
443 'size' => 300,
444 ],
445 'selectors' => [
446 '{{WRAPPER}} .eael-toc' => 'width: {{SIZE}}{{UNIT}};',
447 ],
448 'condition' => [
449 'eael_ext_table_of_content' => 'yes',
450 ],
451 ]
452 );
453
454 $element->add_control(
455 'eael_ext_toc_position',
456 [
457 'label' => __('Position', 'essential-addons-for-elementor-lite'),
458 'type' => Controls_Manager::SELECT,
459 'default' => 'left',
460 'label_block' => false,
461 'options' => [
462 'left' => __('Left', 'essential-addons-for-elementor-lite'),
463 'right' => __('Right', 'essential-addons-for-elementor-lite'),
464 ],
465 'separator' => 'before',
466 'condition' => [
467 'eael_ext_table_of_content' => 'yes',
468 ],
469 ]
470 );
471
472 $element->add_control(
473 'eael_ext_toc_list_icon',
474 [
475 'label' => __('List Icon', 'essential-addons-for-elementor-lite'),
476 'type' => Controls_Manager::SELECT,
477 'default' => 'bullet',
478 'label_block' => false,
479 'options' => [
480 'bullet' => __('Bullet', 'essential-addons-for-elementor-lite'),
481 'number' => __('Number', 'essential-addons-for-elementor-lite'),
482 ],
483 'condition' => [
484 'eael_ext_table_of_content' => 'yes',
485 ],
486 ]
487 );
488
489 $element->add_control(
490 'eael_ext_toc_box_list_bullet_size',
491 [
492 'label' => __('Bullet Size', 'essential-addons-for-elementor-lite'),
493 'type' => Controls_Manager::SLIDER,
494 'size_units' => ['px'],
495 'range' => [
496 'px' => [
497 'min' => 0,
498 'max' => 50,
499 'step' => 1,
500 ],
501 ],
502 'default' => [
503 'unit' => 'px',
504 'size' => 8,
505 ],
506 'selectors' => [
507 '{{WRAPPER}} .eael-toc .eael-toc-body ul.eael-toc-list.eael-toc-bullet li:before' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
508 ],
509 'condition' => [
510 'eael_ext_toc_list_icon' => 'bullet',
511 ],
512 ]
513 );
514
515 $element->add_control(
516 'eael_ext_toc_box_list_top_position',
517 [
518 'label' => __('Top Position', 'essential-addons-for-elementor-lite'),
519 'type' => Controls_Manager::SLIDER,
520 'size_units' => ['px'],
521 'range' => [
522 'px' => [
523 'min' => -50,
524 'max' => 50,
525 'step' => 1,
526 ],
527 ],
528 'default' => [
529 'unit' => 'px',
530 'size' => -2,
531 ],
532 'selectors' => [
533 '{{WRAPPER}} .eael-toc .eael-toc-body ul.eael-toc-list.eael-toc-bullet li:before' => 'top: {{SIZE}}{{UNIT}};',
534 ],
535 'condition' => [
536 'eael_ext_toc_list_icon' => 'bullet',
537 ],
538 ]
539 );
540
541 $element->add_group_control(
542 Group_Control_Border::get_type(),
543 [
544 'name' => 'eael_ext_toc_border',
545 'label' => __('Border', 'essential-addons-for-elementor-lite'),
546 'selector' => '{{WRAPPER}} .eael-toc,{{WRAPPER}} button.eael-toc-button',
547 'condition' => [
548 'eael_ext_table_of_content' => 'yes',
549 ],
550 ]
551 );
552
553 $element->add_group_control(
554 Group_Control_Box_Shadow::get_type(),
555 [
556 'name' => 'eael_ext_toc_table_box_shadow',
557 'label' => __('Box Shadow', 'essential-addons-for-elementor-lite'),
558 'selector' => '{{WRAPPER}} .eael-toc:not(.collapsed)',
559 'condition' => [
560 'eael_ext_table_of_content' => 'yes',
561 ],
562 ]
563 );
564
565 $element->add_control(
566 'eael_ext_toc_box_border_radius',
567 [
568 'label' => __('Border Radius', 'essential-addons-for-elementor-lite'),
569 'type' => Controls_Manager::SLIDER,
570 'size_units' => ['px'],
571 'range' => [
572 'px' => [
573 'min' => 0,
574 'max' => 50,
575 'step' => 1,
576 ],
577 ],
578 'default' => [
579 'unit' => 'px',
580 'size' => 5,
581 ],
582 'selectors' => [
583 '{{WRAPPER}} .eael-toc:not(.eael-toc-right)' => 'border-top-right-radius: {{SIZE}}{{UNIT}}; border-bottom-right-radius: {{SIZE}}{{UNIT}};',
584 '{{WRAPPER}} .eael-toc:not(.eael-toc-right) .eael-toc-header' => 'border-top-right-radius: {{SIZE}}{{UNIT}};',
585 '{{WRAPPER}} .eael-toc:not(.eael-toc-right) .eael-toc-body' => 'border-bottom-right-radius: {{SIZE}}{{UNIT}};',
586
587 '{{WRAPPER}} .eael-toc.eael-toc-right' => 'border-top-left-radius: {{SIZE}}{{UNIT}}; border-bottom-left-radius: {{SIZE}}{{UNIT}};',
588 '{{WRAPPER}} .eael-toc.eael-toc-right .eael-toc-header' => 'border-top-left-radius: {{SIZE}}{{UNIT}};',
589 '{{WRAPPER}} .eael-toc.eael-toc-right .eael-toc-body' => 'border-bottom-left-radius: {{SIZE}}{{UNIT}};',
590 ],
591 'condition' => [
592 'eael_ext_table_of_content' => 'yes',
593 ],
594 ]
595 );
596
597 $element->end_controls_section();
598
599 $element->start_controls_section(
600 'eael_ext_table_of_content_header_style',
601 [
602 'label' => esc_html__('EA TOC Header', 'essential-addons-for-elementor-lite'),
603 'tab' => Controls_Manager::TAB_STYLE,
604 'condition' => [
605 'eael_ext_table_of_content' => 'yes',
606 ],
607 ]
608 );
609
610 $element->add_control(
611 'eael_ext_table_of_content_header_bg',
612 [
613 'label' => __('Background Color', 'essential-addons-for-elementor-lite'),
614 'type' => Controls_Manager::COLOR,
615 'default' => '#ff7d50',
616 'selectors' => [
617 '{{WRAPPER}} .eael-toc .eael-toc-header' => 'background-color: {{VALUE}}',
618 '{{WRAPPER}} .eael-toc.collapsed .eael-toc-button' => 'background-color: {{VALUE}}',
619 ],
620 ]
621 );
622
623 $element->add_control(
624 'eael_ext_table_of_content_header_text_color',
625 [
626 'label' => __('Text Color', 'essential-addons-for-elementor-lite'),
627 'type' => Controls_Manager::COLOR,
628 'default' => '#ffffff',
629 'selectors' => [
630 '{{WRAPPER}} .eael-toc .eael-toc-header .eael-toc-title' => 'color: {{VALUE}}',
631 '{{WRAPPER}} .eael-toc.collapsed .eael-toc-button' => 'color: {{VALUE}}',
632 ],
633 ]
634 );
635
636 $element->add_group_control(
637 Group_Control_Typography::get_type(),
638 [
639 'name' => 'eael_ext_table_of_content_header_typography',
640 'selector' => '{{WRAPPER}} .eael-toc-header .eael-toc-title,{{WRAPPER}} .eael-toc.collapsed .eael-toc-button',
641 'scheme' => Typography::TYPOGRAPHY_2,
642 ]
643 );
644
645 $element->add_control(
646 'eael_ext_toc_header_padding',
647 [
648 'label' => esc_html__('Padding', 'essential-addons-for-elementor-lite'),
649 'type' => Controls_Manager::DIMENSIONS,
650 'size_units' => ['px'],
651 'selectors' => [
652 '{{WRAPPER}} .eael-toc .eael-toc-header' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
653 ],
654 ]
655 );
656
657 $element->add_control(
658 'eael_ext_toc_header_collapse_close_button',
659 [
660 'label' => __('Collapse', 'essential-addons-for-elementor-lite'),
661 'type' => Controls_Manager::HEADING,
662 'separator' => 'before',
663 ]
664 );
665
666 $element->add_control(
667 'eael_ext_table_of_content_header_icon',
668 [
669 'label' => __('Icon', 'essential-addons-for-elementor-lite'),
670 'type' => Controls_Manager::ICONS,
671 'label_block' => true,
672 'default' => [
673 'value' => 'fas fa-list',
674 'library' => 'fa-solid',
675 ],
676 'fa4compatibility' => 'icon',
677 ]
678 );
679
680 $element->add_control(
681 'eael_ext_toc_close_button_text_style',
682 [
683 'label' => __('Text Orientation', 'essential-addons-for-elementor-lite'),
684 'type' => Controls_Manager::SELECT,
685 'default' => 'top_to_bottom',
686 'options' => [
687 'top_to_bottom' => __('Top to Bottom', 'essential-addons-for-elementor-lite'),
688 'bottom_to_top' => __('Bottom to Top', 'essential-addons-for-elementor-lite'),
689 ],
690 ]
691 );
692
693 $element->add_control(
694 'eael_ext_table_of_content_close_button',
695 [
696 'label' => __('Close Button', 'essential-addons-for-elementor-lite'),
697 'type' => Controls_Manager::HEADING,
698 'separator' => 'before',
699 ]
700 );
701
702 $element->add_control(
703 'eael_ext_table_of_content_close_button_icon_size',
704 [
705 'label' => __('Icon Size', 'essential-addons-for-elementor-lite'),
706 'type' => Controls_Manager::SLIDER,
707 'size_units' => ['px'],
708 'range' => [
709 'px' => [
710 'min' => 0,
711 'max' => 100,
712 ],
713 ],
714 'selectors' => [
715 '{{WRAPPER}} .eael-toc .eael-toc-close' => 'font-size: {{SIZE}}{{UNIT}};',
716 ],
717 ]
718 );
719
720 $element->add_control(
721 'eael_ext_table_of_content_close_button_size',
722 [
723 'label' => __('Button Size', 'essential-addons-for-elementor-lite'),
724 'type' => Controls_Manager::SLIDER,
725 'size_units' => ['px'],
726 'range' => [
727 'px' => [
728 'min' => 0,
729 'max' => 100,
730 ],
731 ],
732 'selectors' => [
733 '{{WRAPPER}} .eael-toc .eael-toc-close' => 'height: {{SIZE}}{{UNIT}};width: {{SIZE}}{{UNIT}};',
734 ],
735 ]
736 );
737
738 $element->add_control(
739 'eael_ext_table_of_content_close_button_line_height',
740 [
741 'label' => __('Line Height', 'essential-addons-for-elementor-lite'),
742 'type' => Controls_Manager::SLIDER,
743 'size_units' => ['px'],
744 'range' => [
745 'px' => [
746 'min' => 0,
747 'max' => 100,
748 ],
749 ],
750 'selectors' => [
751 '{{WRAPPER}} .eael-toc .eael-toc-close' => 'line-height: {{SIZE}}{{UNIT}};',
752 ],
753 ]
754 );
755
756 $element->add_control(
757 'eael_ext_table_of_content_close_button_bg',
758 [
759 'label' => __('Background Color', 'essential-addons-for-elementor-lite'),
760 'type' => Controls_Manager::COLOR,
761 'default' => '#ffffff',
762 'selectors' => [
763 '{{WRAPPER}} .eael-toc .eael-toc-close' => 'background-color: {{VALUE}}',
764 ],
765 ]
766 );
767
768 $element->add_control(
769 'eael_ext_table_of_content_close_button_text_color',
770 [
771 'label' => __('Close Button Color', 'essential-addons-for-elementor-lite'),
772 'type' => Controls_Manager::COLOR,
773 'default' => '#ff7d50',
774 'selectors' => [
775 '{{WRAPPER}} .eael-toc .eael-toc-close' => 'color: {{VALUE}}',
776 ],
777 ]
778 );
779
780 $element->add_control(
781 'eael_ext_table_of_content_close_button_border_radius',
782 [
783 'label' => __('Border Radius', 'essential-addons-for-elementor-lite'),
784 'type' => Controls_Manager::SLIDER,
785 'size_units' => ['px'],
786 'range' => [
787 'px' => [
788 'min' => 0,
789 'max' => 100,
790 ],
791 ],
792 'selectors' => [
793 '{{WRAPPER}} .eael-toc .eael-toc-close' => 'border-radius: {{SIZE}}{{UNIT}};',
794 ],
795 ]
796 );
797
798 $element->add_group_control(
799 Group_Control_Box_Shadow::get_type(),
800 [
801 'name' => 'eael_ext_table_of_content_close_button_box_shadow',
802 'label' => __('Box Shadow', 'essential-addons-for-elementor-lite'),
803 'selector' => '{{WRAPPER}} .eael-toc .eael-toc-close',
804 ]
805 );
806
807 $element->end_controls_section();
808
809 $element->start_controls_section(
810 'eael_ext_table_of_content_list_style_section',
811 [
812 'label' => esc_html__('EA TOC Body', 'essential-addons-for-elementor-lite'),
813 'tab' => Controls_Manager::TAB_STYLE,
814 'condition' => [
815 'eael_ext_table_of_content' => 'yes',
816 ],
817 ]
818 );
819
820 $element->add_control(
821 'eael_ext_table_of_content_body_bg',
822 [
823 'label' => __('Background Color', 'essential-addons-for-elementor-lite'),
824 'type' => Controls_Manager::COLOR,
825 'default' => '#fff6f3',
826 'selectors' => [
827 '{{WRAPPER}} .eael-toc .eael-toc-body' => 'background-color: {{VALUE}}',
828 ],
829
830 ]
831 );
832
833 $element->add_control(
834 'eael_ext_toc_body_padding',
835 [
836 'label' => esc_html__('Padding', 'essential-addons-for-elementor-lite'),
837 'type' => Controls_Manager::DIMENSIONS,
838 'size_units' => ['px'],
839 'selectors' => [
840 '{{WRAPPER}} .eael-toc .eael-toc-body' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
841 ],
842 ]
843 );
844
845 $element->add_control(
846 'eael_ext_table_of_content_list_style_separator',
847 [
848 'label' => __('List', 'essential-addons-for-elementor-lite'),
849 'type' => Controls_Manager::HEADING,
850 'separator' => 'before',
851 ]
852 );
853
854 $element->add_control(
855 'eael_ext_table_of_content_list_style',
856 [
857 'label' => __('Indicator Style', 'essential-addons-for-elementor-lite'),
858 'type' => Controls_Manager::SELECT,
859 'default' => 'none',
860 'options' => [
861 'none' => __('None', 'essential-addons-for-elementor-lite'),
862 'arrow' => __('Arrow', 'essential-addons-for-elementor-lite'),
863 'bar' => __('Bar', 'essential-addons-for-elementor-lite'),
864 ],
865 ]
866 );
867
868 $element->add_control(
869 'eael_ext_toc_indicator_size',
870 [
871 'label' => __('Indicator Size', 'essential-addons-for-elementor-lite'),
872 'type' => Controls_Manager::SLIDER,
873 'size_units' => ['px'],
874 'range' => [
875 'px' => [
876 'min' => 0,
877 'max' => 100,
878 'step' => 1,
879 ],
880 ],
881 'default' => [
882 'unit' => 'px',
883 'size' => 20,
884 ],
885 'selectors' => [
886 '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list.eael-toc-list-bar li.eael-highlight-active > a:after' => 'height: {{SIZE}}{{UNIT}};',
887 ],
888 'condition' => [
889 'eael_ext_table_of_content_list_style' => 'bar',
890 ],
891 ]
892 );
893
894 $element->add_control(
895 'eael_ext_toc_indicator_position',
896 [
897 'label' => __('Indicator Position', 'essential-addons-for-elementor-lite'),
898 'type' => Controls_Manager::SLIDER,
899 'size_units' => ['px'],
900 'range' => [
901 'px' => [
902 'min' => -100,
903 'max' => 100,
904 'step' => 1,
905 ],
906 ],
907 'default' => [
908 'unit' => 'px',
909 'size' => 0,
910 ],
911 'selectors' => [
912 '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list.eael-toc-list-arrow li.eael-highlight-active > a:before' => 'margin-top: {{SIZE}}{{UNIT}};',
913 '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list.eael-toc-list-bar li.eael-highlight-active > a:after' => 'margin-top: {{SIZE}}{{UNIT}};',
914 ],
915 'condition' => [
916 'eael_ext_table_of_content_list_style!' => 'none',
917 ],
918 ]
919 );
920
921 $element->add_group_control(
922 Group_Control_Typography::get_type(),
923 [
924 'name' => 'eael_ext_table_of_content_list_typography_normal',
925 'selector' => '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list',
926 'scheme' => Typography::TYPOGRAPHY_2,
927 ]
928 );
929
930 $element->start_controls_tabs('ea_toc_list_style');
931
932 $element->start_controls_tab('normal',
933 [
934 'label' => __('Normal', 'essential-addons-for-elementor-lite'),
935 ]
936 );
937
938 $element->add_control(
939 'eael_ext_table_of_content_list_text_color',
940 [
941 'label' => __('Text Color', 'essential-addons-for-elementor-lite'),
942 'type' => Controls_Manager::COLOR,
943 'default' => '#707070',
944 'selectors' => [
945 '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list li' => 'color: {{VALUE}}',
946 '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list.eael-toc-number li:before' => 'color: {{VALUE}}',
947 '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list.eael-toc-bullet li:before' => 'background-color: {{VALUE}}',
948 '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list li a' => 'color: {{VALUE}}',
949 ],
950 ]
951 );
952
953 $element->end_controls_tab();
954
955 $element->start_controls_tab('hover',
956 [
957 'label' => __('Hover', 'essential-addons-for-elementor-lite'),
958 ]
959 );
960
961 $element->add_control(
962 'eael_ext_table_of_list_hover_color',
963 [
964 'label' => __('Text Color', 'essential-addons-for-elementor-lite'),
965 'type' => Controls_Manager::COLOR,
966 'default' => '#ff7d50',
967 'selectors' => [
968 '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list li:hover' => 'color: {{VALUE}}',
969 '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list.eael-toc-number li:hover:before' => 'color: {{VALUE}}',
970 '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list.eael-toc-bullet li:hover:before' => 'background-color: {{VALUE}}',
971 '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list li:hover > a' => 'color: {{VALUE}}',
972 '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list li:hover > a:before' => 'border-bottom-color: {{VALUE}}',
973 '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list li:hover > a:after' => 'background-color: {{VALUE}}',
974 ],
975
976 ]
977 );
978
979 $element->end_controls_tab(); // hover
980
981 $element->start_controls_tab('active',
982 [
983 'label' => __('Active', 'essential-addons-for-elementor-lite'),
984 ]
985 );
986
987 $element->add_control(
988 'eael_ext_table_of_content_list_text_color_active',
989 [
990 'label' => __('Text Color', 'essential-addons-for-elementor-lite'),
991 'type' => Controls_Manager::COLOR,
992 'default' => '#ff7d50',
993 'selectors' => [
994 '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list li.eael-highlight-active' => 'color: {{VALUE}}',
995 '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list.eael-toc-number li.eael-highlight-active:before' => 'color: {{VALUE}}',
996 '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list.eael-toc-bullet li.eael-highlight-active:before' => 'background-color: {{VALUE}}',
997 '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list li.eael-highlight-active > a' => 'color: {{VALUE}}',
998 '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list li.eael-highlight-active > a:before' => 'border-bottom-color: {{VALUE}}',
999 '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list li.eael-highlight-active > a:after' => 'background-color: {{VALUE}}',
1000 '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list li.eael-highlight-parent' => 'color: {{VALUE}}',
1001 '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list.eael-toc-number li.eael-highlight-parent:before' => 'color: {{VALUE}}',
1002 '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list.eael-toc-bullet li.eael-highlight-parent:before' => 'background-color: {{VALUE}}',
1003 '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list li.eael-highlight-parent > a' => 'color: {{VALUE}}',
1004 ],
1005 ]
1006 );
1007
1008 $element->end_controls_tab(); // active
1009 $element->end_controls_tabs();
1010
1011 $element->add_control(
1012 'eael_ext_toc_top_level_space',
1013 [
1014 'label' => __('Top Level Space', 'essential-addons-for-elementor-lite'),
1015 'type' => Controls_Manager::SLIDER,
1016 'size_units' => ['px'],
1017 'range' => [
1018 'px' => [
1019 'min' => 0,
1020 'max' => 50,
1021 'step' => 1,
1022 ],
1023 ],
1024 'default' => [
1025 'unit' => 'px',
1026 'size' => 8,
1027 ],
1028 'selectors' => [
1029 '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list li' => 'padding-top: {{SIZE}}{{UNIT}}; padding-bottom: {{SIZE}}{{UNIT}};',
1030 ],
1031 'condition' => [
1032 'eael_ext_table_of_content' => 'yes',
1033 ],
1034 ]
1035 );
1036
1037 $element->add_control(
1038 'eael_ext_toc_subitem_level_space',
1039 [
1040 'label' => __('Sub Item Space', 'essential-addons-for-elementor-lite'),
1041 'type' => Controls_Manager::SLIDER,
1042 'size_units' => ['px'],
1043 'range' => [
1044 'px' => [
1045 'min' => 0,
1046 'max' => 20,
1047 'step' => 1,
1048 ],
1049 ],
1050 'default' => [
1051 'unit' => 'px',
1052 'size' => 1,
1053 ],
1054 'selectors' => [
1055 '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list li ul li' => 'padding-top: {{SIZE}}{{UNIT}}; padding-bottom: {{SIZE}}{{UNIT}};',
1056 ],
1057 'condition' => [
1058 'eael_ext_table_of_content' => 'yes',
1059 ],
1060 ]
1061 );
1062
1063 $element->add_control(
1064 'eael_ext_table_of_content_list_separator',
1065 [
1066 'label' => __('Separator', 'essential-addons-for-elementor-lite'),
1067 'type' => Controls_Manager::HEADING,
1068 'separator' => 'before',
1069 ]
1070 );
1071
1072 $element->add_control(
1073 'eael_ext_table_of_content_list_separator_style',
1074 [
1075 'label' => __('Style', 'essential-addons-for-elementor-lite'),
1076 'type' => Controls_Manager::SELECT,
1077 'default' => 'dashed',
1078 'options' => [
1079 'solid' => __('Solid', 'essential-addons-for-elementor-lite'),
1080 'dashed' => __('Dashed', 'essential-addons-for-elementor-lite'),
1081 'dotted' => __('Dotted', 'essential-addons-for-elementor-lite'),
1082 'none' => __('None', 'essential-addons-for-elementor-lite'),
1083 ],
1084 'selectors' => [
1085 '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list > li:not(:last-child)' => 'border-bottom: 0.5px {{VALUE}}',
1086 ],
1087 ]
1088 );
1089
1090 $element->add_control(
1091 'eael_ext_table_of_content_list_separator_color',
1092 [
1093 'label' => __('Color', 'essential-addons-for-elementor-lite'),
1094 'type' => Controls_Manager::COLOR,
1095 'selectors' => [
1096 '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list > li:not(:last-child)' => 'border-bottom-color: {{VALUE}}',
1097 ],
1098 'default' => '#c6c4cf',
1099 'condition' => [
1100 'eael_ext_table_of_content_list_separator_style!' => 'none',
1101 ],
1102 ]
1103 );
1104
1105 $element->end_controls_section();
1106 }
1107 }
1108