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