Custom_JS.php
5 years ago
Post_Duplicator.php
5 years ago
Promotion.php
5 years ago
Reading_Progress.php
5 years ago
Table_of_Content.php
5 years ago
Table_of_Content.php
1058 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\Scheme_Typography as Scheme_Typography; |
| 13 | use Essential_Addons_Elementor\Traits\Shared; |
| 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(Shared::is_prevent_load_extension(get_the_ID())){ |
| 26 | return false; |
| 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 | 'default' => __('Table of Contents', 'essential-addons-for-elementor-lite'), |
| 113 | 'label_block' => false, |
| 114 | 'condition' => [ |
| 115 | 'eael_ext_table_of_content' => 'yes', |
| 116 | ], |
| 117 | ] |
| 118 | ); |
| 119 | |
| 120 | $element->start_controls_tabs( 'eael_toc_include_exclude', [ 'separator' => 'before' ] ); |
| 121 | |
| 122 | $element->start_controls_tab( 'eael_toc_include', |
| 123 | [ |
| 124 | 'label' => __( 'Include', 'essential-addons-for-elementor-lite' ), |
| 125 | 'condition' => [ |
| 126 | 'eael_ext_table_of_content' => 'yes', |
| 127 | ] |
| 128 | ] |
| 129 | ); |
| 130 | |
| 131 | $element->add_control( |
| 132 | 'eael_ext_toc_supported_heading_tag', |
| 133 | [ |
| 134 | 'label' => __('Supported Heading Tag', 'essential-addons-for-elementor-lite'), |
| 135 | 'type' => Controls_Manager::SELECT2, |
| 136 | 'multiple' => true, |
| 137 | 'label_block' => true, |
| 138 | 'default' => [ |
| 139 | 'h2', |
| 140 | 'h3', |
| 141 | 'h4', |
| 142 | 'h5', |
| 143 | 'h6', |
| 144 | ], |
| 145 | 'options' => [ |
| 146 | 'h1' => __('H1', 'essential-addons-for-elementor-lite'), |
| 147 | 'h2' => __('H2', 'essential-addons-for-elementor-lite'), |
| 148 | 'h3' => __('H3', 'essential-addons-for-elementor-lite'), |
| 149 | 'h4' => __('H4', 'essential-addons-for-elementor-lite'), |
| 150 | 'h5' => __('H5', 'essential-addons-for-elementor-lite'), |
| 151 | 'h6' => __('H6', 'essential-addons-for-elementor-lite'), |
| 152 | ], |
| 153 | 'render_type' => 'none', |
| 154 | 'condition' => [ |
| 155 | 'eael_ext_table_of_content' => 'yes', |
| 156 | ], |
| 157 | ] |
| 158 | ); |
| 159 | |
| 160 | $element->add_control( |
| 161 | 'eael_ext_toc_content_selector', |
| 162 | [ |
| 163 | 'label' => __('Content Selector', 'essential-addons-for-elementor-lite'), |
| 164 | 'type' => Controls_Manager::TEXT, |
| 165 | 'description' => __('Which content are searched for heading tag, Provide unique selector to replace default selector', 'essential-addons-for-elementor-lite'), |
| 166 | 'label_block' => false, |
| 167 | 'condition' => [ |
| 168 | 'eael_ext_table_of_content' => 'yes', |
| 169 | ], |
| 170 | ] |
| 171 | ); |
| 172 | |
| 173 | $element->end_controls_tab(); // include |
| 174 | |
| 175 | $element->start_controls_tab( 'eael_toc_exclude', |
| 176 | [ |
| 177 | 'label' => __( 'Exclude', 'essential-addons-for-elementor-lite' ), |
| 178 | 'condition' => [ |
| 179 | 'eael_ext_table_of_content' => 'yes', |
| 180 | ] |
| 181 | ] |
| 182 | ); |
| 183 | |
| 184 | $element->add_control( |
| 185 | 'eael_toc_exclude_selector', |
| 186 | [ |
| 187 | 'label' => __( 'Exclude By Selector', 'essential-addons-for-elementor-lite' ), |
| 188 | 'type' => Controls_Manager::TEXT, |
| 189 | 'description' => __( 'CSS selectors, in a comma-separated list', 'essential-addons-for-elementor-lite' ), |
| 190 | 'default' => '', |
| 191 | 'label_block' => true, |
| 192 | 'condition' => [ |
| 193 | 'eael_ext_table_of_content' => 'yes', |
| 194 | ] |
| 195 | ] |
| 196 | ); |
| 197 | |
| 198 | $element->end_controls_tab(); // exclude |
| 199 | |
| 200 | $element->end_controls_tabs(); // include_exclude_tags |
| 201 | |
| 202 | $element->add_control( |
| 203 | 'eael_ext_toc_collapse_sub_heading', |
| 204 | [ |
| 205 | 'label' => __('Keep Sub Heading Collapsed', 'essential-addons-for-elementor-lite'), |
| 206 | 'type' => Controls_Manager::SWITCHER, |
| 207 | 'default' => 'yes', |
| 208 | 'label_on' => __('Yes', 'essential-addons-for-elementor-lite'), |
| 209 | 'label_off' => __('No', 'essential-addons-for-elementor-lite'), |
| 210 | 'return_value' => 'yes', |
| 211 | 'condition' => [ |
| 212 | 'eael_ext_table_of_content' => 'yes', |
| 213 | ], |
| 214 | ] |
| 215 | ); |
| 216 | |
| 217 | $element->add_control( |
| 218 | 'eael_ext_toc_use_title_in_url', |
| 219 | [ |
| 220 | 'label' => __('Heading Text in URL', 'essential-addons-for-elementor-lite'), |
| 221 | 'type' => Controls_Manager::SWITCHER, |
| 222 | 'default' => 'no', |
| 223 | 'label_on' => __('Yes', 'essential-addons-for-elementor-lite'), |
| 224 | 'label_off' => __('No', 'essential-addons-for-elementor-lite'), |
| 225 | 'return_value' => 'yes', |
| 226 | 'condition' => [ |
| 227 | 'eael_ext_table_of_content' => 'yes', |
| 228 | ], |
| 229 | ] |
| 230 | ); |
| 231 | |
| 232 | $element->add_control( |
| 233 | 'eael_ext_toc_word_wrap', |
| 234 | [ |
| 235 | 'label' => __('Stop Word Wrap', 'essential-addons-for-elementor-lite'), |
| 236 | 'type' => Controls_Manager::SWITCHER, |
| 237 | 'default' => 'no', |
| 238 | 'label_on' => __('Yes', 'essential-addons-for-elementor-lite'), |
| 239 | 'label_off' => __('No', 'essential-addons-for-elementor-lite'), |
| 240 | 'return_value' => 'yes', |
| 241 | 'condition' => [ |
| 242 | 'eael_ext_table_of_content' => 'yes', |
| 243 | ], |
| 244 | ] |
| 245 | ); |
| 246 | |
| 247 | $element->add_control( |
| 248 | 'eael_ext_toc_auto_collapse', |
| 249 | [ |
| 250 | 'label' => __('TOC Auto Collapse', 'essential-addons-for-elementor-lite'), |
| 251 | 'type' => Controls_Manager::SWITCHER, |
| 252 | 'default' => 'yes', |
| 253 | 'label_on' => __('Yes', 'essential-addons-for-elementor-lite'), |
| 254 | 'label_off' => __('No', 'essential-addons-for-elementor-lite'), |
| 255 | 'return_value' => 'yes', |
| 256 | 'condition' => [ |
| 257 | 'eael_ext_table_of_content' => 'yes', |
| 258 | ], |
| 259 | ] |
| 260 | ); |
| 261 | |
| 262 | $element->add_control( |
| 263 | 'eael_ext_toc_hide_in_mobile', |
| 264 | [ |
| 265 | 'label' => __('Hide TOC in mobile', 'essential-addons-for-elementor-lite'), |
| 266 | 'type' => Controls_Manager::SWITCHER, |
| 267 | 'default' => 'no', |
| 268 | 'label_on' => __('Yes', 'essential-addons-for-elementor-lite'), |
| 269 | 'label_off' => __('No', 'essential-addons-for-elementor-lite'), |
| 270 | 'return_value' => 'yes', |
| 271 | 'condition' => [ |
| 272 | 'eael_ext_table_of_content' => 'yes', |
| 273 | ], |
| 274 | ] |
| 275 | ); |
| 276 | |
| 277 | $element->add_control( |
| 278 | 'eael_ext_toc_sticky_scroll', |
| 279 | [ |
| 280 | 'label' => __('Sticky Scroll Effect', 'essential-addons-for-elementor-lite'), |
| 281 | 'type' => Controls_Manager::SLIDER, |
| 282 | 'size_units' => ['px'], |
| 283 | 'range' => [ |
| 284 | 'px' => [ |
| 285 | 'min' => 5, |
| 286 | 'max' => 2000, |
| 287 | 'step' => 10, |
| 288 | ], |
| 289 | ], |
| 290 | 'default' => [ |
| 291 | 'unit' => 'px', |
| 292 | 'size' => 200, |
| 293 | ], |
| 294 | 'condition' => [ |
| 295 | 'eael_ext_table_of_content' => 'yes', |
| 296 | ], |
| 297 | ] |
| 298 | ); |
| 299 | |
| 300 | $element->add_control( |
| 301 | 'eael_ext_toc_sticky_offset', |
| 302 | [ |
| 303 | 'label' => __('Sticky Top Offset', 'essential-addons-for-elementor-lite'), |
| 304 | 'type' => Controls_Manager::SLIDER, |
| 305 | 'size_units' => ['px'], |
| 306 | 'range' => [ |
| 307 | 'px' => [ |
| 308 | 'min' => 5, |
| 309 | 'max' => 2000, |
| 310 | 'step' => 10, |
| 311 | ], |
| 312 | ], |
| 313 | 'default' => [ |
| 314 | 'unit' => 'px', |
| 315 | 'size' => 200, |
| 316 | ], |
| 317 | 'selectors' => [ |
| 318 | '{{WRAPPER}} .eael-toc.eael-sticky' => 'top: {{SIZE}}{{UNIT}} !important;', |
| 319 | ], |
| 320 | 'condition' => [ |
| 321 | 'eael_ext_table_of_content' => 'yes', |
| 322 | ], |
| 323 | ] |
| 324 | ); |
| 325 | |
| 326 | $element->add_control( |
| 327 | 'eael_ext_toc_sticky_z_index', |
| 328 | [ |
| 329 | 'label' => __('Z Index', 'essential-addons-for-elementor-lite'), |
| 330 | 'type' => Controls_Manager::SLIDER, |
| 331 | 'size_units' => ['px'], |
| 332 | 'range' => [ |
| 333 | 'px' => [ |
| 334 | 'min' => 0, |
| 335 | 'max' => 9999, |
| 336 | 'step' => 10, |
| 337 | ], |
| 338 | ], |
| 339 | 'default' => [ |
| 340 | 'unit' => 'px', |
| 341 | 'size' => 9999, |
| 342 | ], |
| 343 | 'selectors' => [ |
| 344 | '{{WRAPPER}} .eael-toc' => 'z-index: {{SIZE}}', |
| 345 | ], |
| 346 | 'condition' => [ |
| 347 | 'eael_ext_table_of_content' => 'yes', |
| 348 | ], |
| 349 | ] |
| 350 | ); |
| 351 | |
| 352 | $element->add_control( |
| 353 | 'eael_ext_toc_ad_warning_text', |
| 354 | [ |
| 355 | 'type' => Controls_Manager::RAW_HTML, |
| 356 | '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'), |
| 357 | 'content_classes' => 'eael-warning', |
| 358 | 'separator' => 'before', |
| 359 | 'condition' => [ |
| 360 | 'eael_ext_table_of_content' => 'yes', |
| 361 | ], |
| 362 | ] |
| 363 | ); |
| 364 | |
| 365 | $element->end_controls_section(); |
| 366 | |
| 367 | $element->start_controls_section( |
| 368 | 'eael_ext_toc_main', |
| 369 | [ |
| 370 | 'label' => esc_html__('EA TOC', 'essential-addons-for-elementor-lite'), |
| 371 | 'tab' => Controls_Manager::TAB_STYLE, |
| 372 | 'condition' => [ |
| 373 | 'eael_ext_table_of_content' => 'yes', |
| 374 | ], |
| 375 | ] |
| 376 | ); |
| 377 | |
| 378 | $element->add_control( |
| 379 | 'eael_ext_toc_width', |
| 380 | [ |
| 381 | 'label' => __('Width', 'essential-addons-for-elementor-lite'), |
| 382 | 'type' => Controls_Manager::SLIDER, |
| 383 | 'size_units' => ['px'], |
| 384 | 'range' => [ |
| 385 | 'px' => [ |
| 386 | 'min' => 0, |
| 387 | 'max' => 1000, |
| 388 | 'step' => 1, |
| 389 | ], |
| 390 | ], |
| 391 | 'default' => [ |
| 392 | 'unit' => 'px', |
| 393 | 'size' => 300, |
| 394 | ], |
| 395 | 'selectors' => [ |
| 396 | '{{WRAPPER}} .eael-toc' => 'width: {{SIZE}}{{UNIT}};', |
| 397 | ], |
| 398 | 'condition' => [ |
| 399 | 'eael_ext_table_of_content' => 'yes', |
| 400 | ], |
| 401 | ] |
| 402 | ); |
| 403 | |
| 404 | $element->add_control( |
| 405 | 'eael_ext_toc_position', |
| 406 | [ |
| 407 | 'label' => __('Position', 'essential-addons-for-elementor-lite'), |
| 408 | 'type' => Controls_Manager::SELECT, |
| 409 | 'default' => 'left', |
| 410 | 'label_block' => false, |
| 411 | 'options' => [ |
| 412 | 'left' => __('Left', 'essential-addons-for-elementor-lite'), |
| 413 | 'right' => __('Right', 'essential-addons-for-elementor-lite'), |
| 414 | ], |
| 415 | 'separator' => 'before', |
| 416 | 'condition' => [ |
| 417 | 'eael_ext_table_of_content' => 'yes', |
| 418 | ], |
| 419 | ] |
| 420 | ); |
| 421 | |
| 422 | $element->add_control( |
| 423 | 'eael_ext_toc_list_icon', |
| 424 | [ |
| 425 | 'label' => __('List Icon', 'essential-addons-for-elementor-lite'), |
| 426 | 'type' => Controls_Manager::SELECT, |
| 427 | 'default' => 'bullet', |
| 428 | 'label_block' => false, |
| 429 | 'options' => [ |
| 430 | 'bullet' => __('Bullet', 'essential-addons-for-elementor-lite'), |
| 431 | 'number' => __('Number', 'essential-addons-for-elementor-lite'), |
| 432 | ], |
| 433 | 'condition' => [ |
| 434 | 'eael_ext_table_of_content' => 'yes', |
| 435 | ], |
| 436 | ] |
| 437 | ); |
| 438 | |
| 439 | $element->add_control( |
| 440 | 'eael_ext_toc_box_list_bullet_size', |
| 441 | [ |
| 442 | 'label' => __('Bullet Size', 'essential-addons-for-elementor-lite'), |
| 443 | 'type' => Controls_Manager::SLIDER, |
| 444 | 'size_units' => ['px'], |
| 445 | 'range' => [ |
| 446 | 'px' => [ |
| 447 | 'min' => 0, |
| 448 | 'max' => 50, |
| 449 | 'step' => 1, |
| 450 | ], |
| 451 | ], |
| 452 | 'default' => [ |
| 453 | 'unit' => 'px', |
| 454 | 'size' => 8, |
| 455 | ], |
| 456 | 'selectors' => [ |
| 457 | '{{WRAPPER}} .eael-toc .eael-toc-body ul.eael-toc-list.eael-toc-bullet li:before' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};', |
| 458 | ], |
| 459 | 'condition' => [ |
| 460 | 'eael_ext_toc_list_icon' => 'bullet', |
| 461 | ], |
| 462 | ] |
| 463 | ); |
| 464 | |
| 465 | $element->add_control( |
| 466 | 'eael_ext_toc_box_list_top_position', |
| 467 | [ |
| 468 | 'label' => __('Top Position', 'essential-addons-for-elementor-lite'), |
| 469 | 'type' => Controls_Manager::SLIDER, |
| 470 | 'size_units' => ['px'], |
| 471 | 'range' => [ |
| 472 | 'px' => [ |
| 473 | 'min' => -50, |
| 474 | 'max' => 50, |
| 475 | 'step' => 1, |
| 476 | ], |
| 477 | ], |
| 478 | 'default' => [ |
| 479 | 'unit' => 'px', |
| 480 | 'size' => -2, |
| 481 | ], |
| 482 | 'selectors' => [ |
| 483 | '{{WRAPPER}} .eael-toc .eael-toc-body ul.eael-toc-list.eael-toc-bullet li:before' => 'top: {{SIZE}}{{UNIT}};', |
| 484 | ], |
| 485 | 'condition' => [ |
| 486 | 'eael_ext_toc_list_icon' => 'bullet', |
| 487 | ], |
| 488 | ] |
| 489 | ); |
| 490 | |
| 491 | $element->add_group_control( |
| 492 | Group_Control_Border::get_type(), |
| 493 | [ |
| 494 | 'name' => 'eael_ext_toc_border', |
| 495 | 'label' => __('Border', 'essential-addons-for-elementor-lite'), |
| 496 | 'selector' => '{{WRAPPER}} .eael-toc,{{WRAPPER}} button.eael-toc-button', |
| 497 | 'condition' => [ |
| 498 | 'eael_ext_table_of_content' => 'yes', |
| 499 | ], |
| 500 | ] |
| 501 | ); |
| 502 | |
| 503 | $element->add_group_control( |
| 504 | Group_Control_Box_Shadow::get_type(), |
| 505 | [ |
| 506 | 'name' => 'eael_ext_toc_table_box_shadow', |
| 507 | 'label' => __('Box Shadow', 'essential-addons-for-elementor-lite'), |
| 508 | 'selector' => '{{WRAPPER}} .eael-toc:not(.collapsed)', |
| 509 | 'condition' => [ |
| 510 | 'eael_ext_table_of_content' => 'yes', |
| 511 | ], |
| 512 | ] |
| 513 | ); |
| 514 | |
| 515 | $element->add_control( |
| 516 | 'eael_ext_toc_box_border_radius', |
| 517 | [ |
| 518 | 'label' => __('Border Radius', 'essential-addons-for-elementor-lite'), |
| 519 | 'type' => Controls_Manager::SLIDER, |
| 520 | 'size_units' => ['px'], |
| 521 | 'range' => [ |
| 522 | 'px' => [ |
| 523 | 'min' => 0, |
| 524 | 'max' => 50, |
| 525 | 'step' => 1, |
| 526 | ], |
| 527 | ], |
| 528 | 'default' => [ |
| 529 | 'unit' => 'px', |
| 530 | 'size' => 5, |
| 531 | ], |
| 532 | 'selectors' => [ |
| 533 | '{{WRAPPER}} .eael-toc:not(.eael-toc-right)' => 'border-top-right-radius: {{SIZE}}{{UNIT}}; border-bottom-right-radius: {{SIZE}}{{UNIT}};', |
| 534 | '{{WRAPPER}} .eael-toc:not(.eael-toc-right) .eael-toc-header' => 'border-top-right-radius: {{SIZE}}{{UNIT}};', |
| 535 | '{{WRAPPER}} .eael-toc:not(.eael-toc-right) .eael-toc-body' => 'border-bottom-right-radius: {{SIZE}}{{UNIT}};', |
| 536 | |
| 537 | '{{WRAPPER}} .eael-toc.eael-toc-right' => 'border-top-left-radius: {{SIZE}}{{UNIT}}; border-bottom-left-radius: {{SIZE}}{{UNIT}};', |
| 538 | '{{WRAPPER}} .eael-toc.eael-toc-right .eael-toc-header' => 'border-top-left-radius: {{SIZE}}{{UNIT}};', |
| 539 | '{{WRAPPER}} .eael-toc.eael-toc-right .eael-toc-body' => 'border-bottom-left-radius: {{SIZE}}{{UNIT}};', |
| 540 | ], |
| 541 | 'condition' => [ |
| 542 | 'eael_ext_table_of_content' => 'yes', |
| 543 | ], |
| 544 | ] |
| 545 | ); |
| 546 | |
| 547 | $element->end_controls_section(); |
| 548 | |
| 549 | $element->start_controls_section( |
| 550 | 'eael_ext_table_of_content_header_style', |
| 551 | [ |
| 552 | 'label' => esc_html__('EA TOC Header', 'essential-addons-for-elementor-lite'), |
| 553 | 'tab' => Controls_Manager::TAB_STYLE, |
| 554 | 'condition' => [ |
| 555 | 'eael_ext_table_of_content' => 'yes', |
| 556 | ], |
| 557 | ] |
| 558 | ); |
| 559 | |
| 560 | $element->add_control( |
| 561 | 'eael_ext_table_of_content_header_bg', |
| 562 | [ |
| 563 | 'label' => __('Background Color', 'essential-addons-for-elementor-lite'), |
| 564 | 'type' => Controls_Manager::COLOR, |
| 565 | 'default' => '#ff7d50', |
| 566 | 'selectors' => [ |
| 567 | '{{WRAPPER}} .eael-toc .eael-toc-header' => 'background-color: {{VALUE}}', |
| 568 | '{{WRAPPER}} .eael-toc.collapsed .eael-toc-button' => 'background-color: {{VALUE}}', |
| 569 | ], |
| 570 | ] |
| 571 | ); |
| 572 | |
| 573 | $element->add_control( |
| 574 | 'eael_ext_table_of_content_header_text_color', |
| 575 | [ |
| 576 | 'label' => __('Text Color', 'essential-addons-for-elementor-lite'), |
| 577 | 'type' => Controls_Manager::COLOR, |
| 578 | 'default' => '#ffffff', |
| 579 | 'selectors' => [ |
| 580 | '{{WRAPPER}} .eael-toc .eael-toc-header .eael-toc-title' => 'color: {{VALUE}}', |
| 581 | '{{WRAPPER}} .eael-toc.collapsed .eael-toc-button' => 'color: {{VALUE}}', |
| 582 | ], |
| 583 | ] |
| 584 | ); |
| 585 | |
| 586 | $element->add_group_control( |
| 587 | Group_Control_Typography::get_type(), |
| 588 | [ |
| 589 | 'name' => 'eael_ext_table_of_content_header_typography', |
| 590 | 'selector' => '{{WRAPPER}} .eael-toc-header .eael-toc-title,{{WRAPPER}} .eael-toc.collapsed .eael-toc-button', |
| 591 | 'scheme' => Scheme_Typography::TYPOGRAPHY_2, |
| 592 | ] |
| 593 | ); |
| 594 | |
| 595 | $element->add_control( |
| 596 | 'eael_ext_toc_header_padding', |
| 597 | [ |
| 598 | 'label' => esc_html__('Padding', 'essential-addons-for-elementor-lite'), |
| 599 | 'type' => Controls_Manager::DIMENSIONS, |
| 600 | 'size_units' => ['px'], |
| 601 | 'selectors' => [ |
| 602 | '{{WRAPPER}} .eael-toc .eael-toc-header' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 603 | ], |
| 604 | ] |
| 605 | ); |
| 606 | |
| 607 | $element->add_control( |
| 608 | 'eael_ext_toc_header_collapse_close_button', |
| 609 | [ |
| 610 | 'label' => __('Collapse', 'essential-addons-for-elementor-lite'), |
| 611 | 'type' => Controls_Manager::HEADING, |
| 612 | 'separator' => 'before', |
| 613 | ] |
| 614 | ); |
| 615 | |
| 616 | $element->add_control( |
| 617 | 'eael_ext_table_of_content_header_icon', |
| 618 | [ |
| 619 | 'label' => __('Icon', 'essential-addons-for-elementor-lite'), |
| 620 | 'type' => Controls_Manager::ICONS, |
| 621 | 'label_block' => true, |
| 622 | 'default' => [ |
| 623 | 'value' => 'fas fa-list', |
| 624 | 'library' => 'fa-solid', |
| 625 | ], |
| 626 | 'fa4compatibility' => 'icon', |
| 627 | ] |
| 628 | ); |
| 629 | |
| 630 | $element->add_control( |
| 631 | 'eael_ext_toc_close_button_text_style', |
| 632 | [ |
| 633 | 'label' => __('Text Orientation', 'essential-addons-for-elementor-lite'), |
| 634 | 'type' => Controls_Manager::SELECT, |
| 635 | 'default' => 'top_to_bottom', |
| 636 | 'options' => [ |
| 637 | 'top_to_bottom' => __('Top to Bottom', 'essential-addons-for-elementor-lite'), |
| 638 | 'bottom_to_top' => __('Bottom to Top', 'essential-addons-for-elementor-lite'), |
| 639 | ], |
| 640 | ] |
| 641 | ); |
| 642 | |
| 643 | $element->add_control( |
| 644 | 'eael_ext_table_of_content_close_button', |
| 645 | [ |
| 646 | 'label' => __('Close Button', 'essential-addons-for-elementor-lite'), |
| 647 | 'type' => Controls_Manager::HEADING, |
| 648 | 'separator' => 'before', |
| 649 | ] |
| 650 | ); |
| 651 | |
| 652 | $element->add_control( |
| 653 | 'eael_ext_table_of_content_close_button_icon_size', |
| 654 | [ |
| 655 | 'label' => __('Icon Size', 'essential-addons-for-elementor-lite'), |
| 656 | 'type' => Controls_Manager::SLIDER, |
| 657 | 'size_units' => ['px'], |
| 658 | 'range' => [ |
| 659 | 'px' => [ |
| 660 | 'min' => 0, |
| 661 | 'max' => 100, |
| 662 | ] |
| 663 | ], |
| 664 | 'selectors' => [ |
| 665 | '{{WRAPPER}} .eael-toc .eael-toc-close' => 'font-size: {{SIZE}}{{UNIT}};', |
| 666 | ], |
| 667 | ] |
| 668 | ); |
| 669 | |
| 670 | $element->add_control( |
| 671 | 'eael_ext_table_of_content_close_button_size', |
| 672 | [ |
| 673 | 'label' => __('Button Size', 'essential-addons-for-elementor-lite'), |
| 674 | 'type' => Controls_Manager::SLIDER, |
| 675 | 'size_units' => ['px'], |
| 676 | 'range' => [ |
| 677 | 'px' => [ |
| 678 | 'min' => 0, |
| 679 | 'max' => 100, |
| 680 | ] |
| 681 | ], |
| 682 | 'selectors' => [ |
| 683 | '{{WRAPPER}} .eael-toc .eael-toc-close' => 'height: {{SIZE}}{{UNIT}};width: {{SIZE}}{{UNIT}};', |
| 684 | ], |
| 685 | ] |
| 686 | ); |
| 687 | |
| 688 | $element->add_control( |
| 689 | 'eael_ext_table_of_content_close_button_line_height', |
| 690 | [ |
| 691 | 'label' => __('Line Height', 'essential-addons-for-elementor-lite'), |
| 692 | 'type' => Controls_Manager::SLIDER, |
| 693 | 'size_units' => ['px'], |
| 694 | 'range' => [ |
| 695 | 'px' => [ |
| 696 | 'min' => 0, |
| 697 | 'max' => 100, |
| 698 | ] |
| 699 | ], |
| 700 | 'selectors' => [ |
| 701 | '{{WRAPPER}} .eael-toc .eael-toc-close' => 'line-height: {{SIZE}}{{UNIT}};', |
| 702 | ], |
| 703 | ] |
| 704 | ); |
| 705 | |
| 706 | $element->add_control( |
| 707 | 'eael_ext_table_of_content_close_button_bg', |
| 708 | [ |
| 709 | 'label' => __('Background Color', 'essential-addons-for-elementor-lite'), |
| 710 | 'type' => Controls_Manager::COLOR, |
| 711 | 'default' => '#ffffff', |
| 712 | 'selectors' => [ |
| 713 | '{{WRAPPER}} .eael-toc .eael-toc-close' => 'background-color: {{VALUE}}', |
| 714 | ], |
| 715 | ] |
| 716 | ); |
| 717 | |
| 718 | $element->add_control( |
| 719 | 'eael_ext_table_of_content_close_button_text_color', |
| 720 | [ |
| 721 | 'label' => __('Close Button Color', 'essential-addons-for-elementor-lite'), |
| 722 | 'type' => Controls_Manager::COLOR, |
| 723 | 'default' => '#ff7d50', |
| 724 | 'selectors' => [ |
| 725 | '{{WRAPPER}} .eael-toc .eael-toc-close' => 'color: {{VALUE}}', |
| 726 | ], |
| 727 | ] |
| 728 | ); |
| 729 | |
| 730 | $element->add_control( |
| 731 | 'eael_ext_table_of_content_close_button_border_radius', |
| 732 | [ |
| 733 | 'label' => __('Border Radius', 'essential-addons-for-elementor-lite'), |
| 734 | 'type' => Controls_Manager::SLIDER, |
| 735 | 'size_units' => ['px'], |
| 736 | 'range' => [ |
| 737 | 'px' => [ |
| 738 | 'min' => 0, |
| 739 | 'max' => 100, |
| 740 | ] |
| 741 | ], |
| 742 | 'selectors' => [ |
| 743 | '{{WRAPPER}} .eael-toc .eael-toc-close' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 744 | ], |
| 745 | ] |
| 746 | ); |
| 747 | |
| 748 | $element->add_group_control( |
| 749 | Group_Control_Box_Shadow::get_type(), |
| 750 | [ |
| 751 | 'name' => 'eael_ext_table_of_content_close_button_box_shadow', |
| 752 | 'label' => __('Box Shadow', 'essential-addons-for-elementor-lite'), |
| 753 | 'selector' => '{{WRAPPER}} .eael-toc .eael-toc-close', |
| 754 | ] |
| 755 | ); |
| 756 | |
| 757 | $element->end_controls_section(); |
| 758 | |
| 759 | $element->start_controls_section( |
| 760 | 'eael_ext_table_of_content_list_style_section', |
| 761 | [ |
| 762 | 'label' => esc_html__('EA TOC Body', 'essential-addons-for-elementor-lite'), |
| 763 | 'tab' => Controls_Manager::TAB_STYLE, |
| 764 | 'condition' => [ |
| 765 | 'eael_ext_table_of_content' => 'yes', |
| 766 | ], |
| 767 | ] |
| 768 | ); |
| 769 | |
| 770 | $element->add_control( |
| 771 | 'eael_ext_table_of_content_body_bg', |
| 772 | [ |
| 773 | 'label' => __('Background Color', 'essential-addons-for-elementor-lite'), |
| 774 | 'type' => Controls_Manager::COLOR, |
| 775 | 'default' => '#fff6f3', |
| 776 | 'selectors' => [ |
| 777 | '{{WRAPPER}} .eael-toc .eael-toc-body' => 'background-color: {{VALUE}}', |
| 778 | ], |
| 779 | |
| 780 | ] |
| 781 | ); |
| 782 | |
| 783 | $element->add_control( |
| 784 | 'eael_ext_toc_body_padding', |
| 785 | [ |
| 786 | 'label' => esc_html__('Padding', 'essential-addons-for-elementor-lite'), |
| 787 | 'type' => Controls_Manager::DIMENSIONS, |
| 788 | 'size_units' => ['px'], |
| 789 | 'selectors' => [ |
| 790 | '{{WRAPPER}} .eael-toc .eael-toc-body' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 791 | ], |
| 792 | ] |
| 793 | ); |
| 794 | |
| 795 | $element->add_control( |
| 796 | 'eael_ext_table_of_content_list_style_separator', |
| 797 | [ |
| 798 | 'label' => __('List', 'essential-addons-for-elementor-lite'), |
| 799 | 'type' => Controls_Manager::HEADING, |
| 800 | 'separator' => 'before', |
| 801 | ] |
| 802 | ); |
| 803 | |
| 804 | $element->add_control( |
| 805 | 'eael_ext_table_of_content_list_style', |
| 806 | [ |
| 807 | 'label' => __('Indicator Style', 'essential-addons-for-elementor-lite'), |
| 808 | 'type' => Controls_Manager::SELECT, |
| 809 | 'default' => 'none', |
| 810 | 'options' => [ |
| 811 | 'none' => __('None', 'essential-addons-for-elementor-lite'), |
| 812 | 'arrow' => __('Arrow', 'essential-addons-for-elementor-lite'), |
| 813 | 'bar' => __('Bar', 'essential-addons-for-elementor-lite'), |
| 814 | ], |
| 815 | ] |
| 816 | ); |
| 817 | |
| 818 | $element->add_control( |
| 819 | 'eael_ext_toc_indicator_size', |
| 820 | [ |
| 821 | 'label' => __('Indicator Size', 'essential-addons-for-elementor-lite'), |
| 822 | 'type' => Controls_Manager::SLIDER, |
| 823 | 'size_units' => ['px'], |
| 824 | 'range' => [ |
| 825 | 'px' => [ |
| 826 | 'min' => 0, |
| 827 | 'max' => 100, |
| 828 | 'step' => 1, |
| 829 | ], |
| 830 | ], |
| 831 | 'default' => [ |
| 832 | 'unit' => 'px', |
| 833 | 'size' => 20, |
| 834 | ], |
| 835 | 'selectors' => [ |
| 836 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list.eael-toc-list-bar li.eael-highlight-active > a:after' => 'height: {{SIZE}}{{UNIT}};', |
| 837 | ], |
| 838 | 'condition' => [ |
| 839 | 'eael_ext_table_of_content_list_style' => 'bar', |
| 840 | ], |
| 841 | ] |
| 842 | ); |
| 843 | |
| 844 | $element->add_control( |
| 845 | 'eael_ext_toc_indicator_position', |
| 846 | [ |
| 847 | 'label' => __('Indicator Position', 'essential-addons-for-elementor-lite'), |
| 848 | 'type' => Controls_Manager::SLIDER, |
| 849 | 'size_units' => ['px'], |
| 850 | 'range' => [ |
| 851 | 'px' => [ |
| 852 | 'min' => -100, |
| 853 | 'max' => 100, |
| 854 | 'step' => 1, |
| 855 | ], |
| 856 | ], |
| 857 | 'default' => [ |
| 858 | 'unit' => 'px', |
| 859 | 'size' => 0, |
| 860 | ], |
| 861 | 'selectors' => [ |
| 862 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list.eael-toc-list-arrow li.eael-highlight-active > a:before' => 'margin-top: {{SIZE}}{{UNIT}};', |
| 863 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list.eael-toc-list-bar li.eael-highlight-active > a:after' => 'margin-top: {{SIZE}}{{UNIT}};', |
| 864 | ], |
| 865 | 'condition' => [ |
| 866 | 'eael_ext_table_of_content_list_style!' => 'none', |
| 867 | ], |
| 868 | ] |
| 869 | ); |
| 870 | |
| 871 | $element->add_group_control( |
| 872 | Group_Control_Typography::get_type(), |
| 873 | [ |
| 874 | 'name' => 'eael_ext_table_of_content_list_typography_normal', |
| 875 | 'selector' => '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list', |
| 876 | 'scheme' => Scheme_Typography::TYPOGRAPHY_2, |
| 877 | ] |
| 878 | ); |
| 879 | |
| 880 | $element->start_controls_tabs('ea_toc_list_style'); |
| 881 | |
| 882 | $element->start_controls_tab('normal', |
| 883 | [ |
| 884 | 'label' => __('Normal', 'essential-addons-for-elementor-lite'), |
| 885 | ] |
| 886 | ); |
| 887 | |
| 888 | $element->add_control( |
| 889 | 'eael_ext_table_of_content_list_text_color', |
| 890 | [ |
| 891 | 'label' => __('Text Color', 'essential-addons-for-elementor-lite'), |
| 892 | 'type' => Controls_Manager::COLOR, |
| 893 | 'default' => '#707070', |
| 894 | 'selectors' => [ |
| 895 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list li' => 'color: {{VALUE}}', |
| 896 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list.eael-toc-number li:before' => 'color: {{VALUE}}', |
| 897 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list.eael-toc-bullet li:before' => 'background-color: {{VALUE}}', |
| 898 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list li a' => 'color: {{VALUE}}', |
| 899 | ], |
| 900 | ] |
| 901 | ); |
| 902 | |
| 903 | $element->end_controls_tab(); |
| 904 | |
| 905 | $element->start_controls_tab('hover', |
| 906 | [ |
| 907 | 'label' => __('Hover', 'essential-addons-for-elementor-lite'), |
| 908 | ] |
| 909 | ); |
| 910 | |
| 911 | $element->add_control( |
| 912 | 'eael_ext_table_of_list_hover_color', |
| 913 | [ |
| 914 | 'label' => __('Text Color', 'essential-addons-for-elementor-lite'), |
| 915 | 'type' => Controls_Manager::COLOR, |
| 916 | 'default' => '#ff7d50', |
| 917 | 'selectors' => [ |
| 918 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list li:hover' => 'color: {{VALUE}}', |
| 919 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list.eael-toc-number li:hover:before' => 'color: {{VALUE}}', |
| 920 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list.eael-toc-bullet li:hover:before' => 'background-color: {{VALUE}}', |
| 921 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list li:hover > a' => 'color: {{VALUE}}', |
| 922 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list li:hover > a:before' => 'border-bottom-color: {{VALUE}}', |
| 923 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list li:hover > a:after' => 'background-color: {{VALUE}}', |
| 924 | ], |
| 925 | |
| 926 | ] |
| 927 | ); |
| 928 | |
| 929 | $element->end_controls_tab(); // hover |
| 930 | |
| 931 | $element->start_controls_tab('active', |
| 932 | [ |
| 933 | 'label' => __('Active', 'essential-addons-for-elementor-lite'), |
| 934 | ] |
| 935 | ); |
| 936 | |
| 937 | $element->add_control( |
| 938 | 'eael_ext_table_of_content_list_text_color_active', |
| 939 | [ |
| 940 | 'label' => __('Text Color', 'essential-addons-for-elementor-lite'), |
| 941 | 'type' => Controls_Manager::COLOR, |
| 942 | 'default' => '#ff7d50', |
| 943 | 'selectors' => [ |
| 944 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list li.eael-highlight-active' => 'color: {{VALUE}}', |
| 945 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list.eael-toc-number li.eael-highlight-active:before' => 'color: {{VALUE}}', |
| 946 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list.eael-toc-bullet li.eael-highlight-active:before' => 'background-color: {{VALUE}}', |
| 947 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list li.eael-highlight-active > a' => 'color: {{VALUE}}', |
| 948 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list li.eael-highlight-active > a:before' => 'border-bottom-color: {{VALUE}}', |
| 949 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list li.eael-highlight-active > a:after' => 'background-color: {{VALUE}}', |
| 950 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list li.eael-highlight-parent' => 'color: {{VALUE}}', |
| 951 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list.eael-toc-number li.eael-highlight-parent:before' => 'color: {{VALUE}}', |
| 952 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list.eael-toc-bullet li.eael-highlight-parent:before' => 'background-color: {{VALUE}}', |
| 953 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list li.eael-highlight-parent > a' => 'color: {{VALUE}}', |
| 954 | ], |
| 955 | ] |
| 956 | ); |
| 957 | |
| 958 | $element->end_controls_tab(); // active |
| 959 | $element->end_controls_tabs(); |
| 960 | |
| 961 | $element->add_control( |
| 962 | 'eael_ext_toc_top_level_space', |
| 963 | [ |
| 964 | 'label' => __('Top Level Space', 'essential-addons-for-elementor-lite'), |
| 965 | 'type' => Controls_Manager::SLIDER, |
| 966 | 'size_units' => ['px'], |
| 967 | 'range' => [ |
| 968 | 'px' => [ |
| 969 | 'min' => 0, |
| 970 | 'max' => 50, |
| 971 | 'step' => 1, |
| 972 | ], |
| 973 | ], |
| 974 | 'default' => [ |
| 975 | 'unit' => 'px', |
| 976 | 'size' => 8, |
| 977 | ], |
| 978 | 'selectors' => [ |
| 979 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list li' => 'padding-top: {{SIZE}}{{UNIT}}; padding-bottom: {{SIZE}}{{UNIT}};', |
| 980 | ], |
| 981 | 'condition' => [ |
| 982 | 'eael_ext_table_of_content' => 'yes', |
| 983 | ], |
| 984 | ] |
| 985 | ); |
| 986 | |
| 987 | $element->add_control( |
| 988 | 'eael_ext_toc_subitem_level_space', |
| 989 | [ |
| 990 | 'label' => __('Sub Item Space', 'essential-addons-for-elementor-lite'), |
| 991 | 'type' => Controls_Manager::SLIDER, |
| 992 | 'size_units' => ['px'], |
| 993 | 'range' => [ |
| 994 | 'px' => [ |
| 995 | 'min' => 0, |
| 996 | 'max' => 20, |
| 997 | 'step' => 1, |
| 998 | ], |
| 999 | ], |
| 1000 | 'default' => [ |
| 1001 | 'unit' => 'px', |
| 1002 | 'size' => 1, |
| 1003 | ], |
| 1004 | 'selectors' => [ |
| 1005 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list li ul li' => 'padding-top: {{SIZE}}{{UNIT}}; padding-bottom: {{SIZE}}{{UNIT}};', |
| 1006 | ], |
| 1007 | 'condition' => [ |
| 1008 | 'eael_ext_table_of_content' => 'yes', |
| 1009 | ], |
| 1010 | ] |
| 1011 | ); |
| 1012 | |
| 1013 | $element->add_control( |
| 1014 | 'eael_ext_table_of_content_list_separator', |
| 1015 | [ |
| 1016 | 'label' => __('Separator', 'essential-addons-for-elementor-lite'), |
| 1017 | 'type' => Controls_Manager::HEADING, |
| 1018 | 'separator' => 'before', |
| 1019 | ] |
| 1020 | ); |
| 1021 | |
| 1022 | $element->add_control( |
| 1023 | 'eael_ext_table_of_content_list_separator_style', |
| 1024 | [ |
| 1025 | 'label' => __('Style', 'essential-addons-for-elementor-lite'), |
| 1026 | 'type' => Controls_Manager::SELECT, |
| 1027 | 'default' => 'dashed', |
| 1028 | 'options' => [ |
| 1029 | 'solid' => __('Solid', 'essential-addons-for-elementor-lite'), |
| 1030 | 'dashed' => __('Dashed', 'essential-addons-for-elementor-lite'), |
| 1031 | 'dotted' => __('Dotted', 'essential-addons-for-elementor-lite'), |
| 1032 | 'none' => __('None', 'essential-addons-for-elementor-lite'), |
| 1033 | ], |
| 1034 | 'selectors' => [ |
| 1035 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list > li:not(:last-child)' => 'border-bottom: 0.5px {{VALUE}}', |
| 1036 | ], |
| 1037 | ] |
| 1038 | ); |
| 1039 | |
| 1040 | $element->add_control( |
| 1041 | 'eael_ext_table_of_content_list_separator_color', |
| 1042 | [ |
| 1043 | 'label' => __('Color', 'essential-addons-for-elementor-lite'), |
| 1044 | 'type' => Controls_Manager::COLOR, |
| 1045 | 'selectors' => [ |
| 1046 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list > li:not(:last-child)' => 'border-bottom-color: {{VALUE}}', |
| 1047 | ], |
| 1048 | 'default' => '#c6c4cf', |
| 1049 | 'condition' => [ |
| 1050 | 'eael_ext_table_of_content_list_separator_style!' => 'none', |
| 1051 | ], |
| 1052 | ] |
| 1053 | ); |
| 1054 | |
| 1055 | $element->end_controls_section(); |
| 1056 | } |
| 1057 | } |
| 1058 |