Custom_JS.php
1 year ago
Hover_Effect.php
1 year ago
Post_Duplicator.php
1 year ago
Promotion.php
1 year ago
Reading_Progress.php
3 years ago
Scroll_to_Top.php
1 year ago
Table_of_Content.php
1 year ago
Wrapper_Link.php
1 year ago
index.php
3 years ago
Table_of_Content.php
1306 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 | $supported_posts = get_option( 'elementor_cpt_support' ); |
| 88 | $display_on = [ |
| 89 | 'all' => __( 'All', 'essential-addons-for-elementor-lite' ), |
| 90 | 'post' => __( 'All Posts', 'essential-addons-for-elementor-lite' ), |
| 91 | 'page' => __( 'All Pages', 'essential-addons-for-elementor-lite' ), |
| 92 | ]; |
| 93 | |
| 94 | if ( ! empty( $supported_posts ) ) { |
| 95 | foreach ( $supported_posts as $post_type ) { |
| 96 | $post_obj = get_post_type_object( $post_type ); |
| 97 | |
| 98 | if ( ! in_array( $post_type, [ 'post', 'page' ] ) && is_a( $post_obj, 'WP_Post_Type' ) && $post_obj->labels ) { |
| 99 | $post_type_labels = get_post_type_labels( $post_obj ); |
| 100 | $plural_name = $post_type_labels->name; |
| 101 | $display_on[ $post_type ] = sprintf( __( 'All %s', 'essential-addons-for-elementor-lite' ), $plural_name ); |
| 102 | } |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | $element->add_control( |
| 107 | 'eael_ext_toc_global_display_condition', |
| 108 | [ |
| 109 | 'label' => __('Display On', 'essential-addons-for-elementor-lite'), |
| 110 | 'type' => Controls_Manager::SELECT, |
| 111 | 'default' => 'all', |
| 112 | 'options' => $display_on, |
| 113 | 'condition' => [ |
| 114 | 'eael_ext_table_of_content' => 'yes', |
| 115 | 'eael_ext_toc_global' => 'yes', |
| 116 | ], |
| 117 | ] |
| 118 | ); |
| 119 | } |
| 120 | |
| 121 | $element->add_control( |
| 122 | 'eael_ext_toc_title', |
| 123 | [ |
| 124 | 'label' => __('Title', 'essential-addons-for-elementor-lite'), |
| 125 | 'type' => Controls_Manager::TEXT, |
| 126 | 'dynamic' => [ 'active' => true ], |
| 127 | 'default' => __('Table of Contents', 'essential-addons-for-elementor-lite'), |
| 128 | 'label_block' => false, |
| 129 | 'condition' => [ |
| 130 | 'eael_ext_table_of_content' => 'yes', |
| 131 | ], |
| 132 | 'ai' => [ |
| 133 | 'active' => false, |
| 134 | ], |
| 135 | ] |
| 136 | ); |
| 137 | |
| 138 | $element->add_control( |
| 139 | 'eael_ext_toc_title_tag', |
| 140 | [ |
| 141 | 'label' => esc_html__( 'HTML Tag', 'essential-addons-for-elementor-lite' ), |
| 142 | 'type' => Controls_Manager::CHOOSE, |
| 143 | 'options' => [ |
| 144 | 'h1' => [ |
| 145 | 'title' => esc_html__( 'H1', 'essential-addons-for-elementor-lite' ), |
| 146 | 'icon' => 'eicon-editor-h1', |
| 147 | ], |
| 148 | 'h2' => [ |
| 149 | 'title' => esc_html__( 'H2', 'essential-addons-for-elementor-lite' ), |
| 150 | 'icon' => 'eicon-editor-h2', |
| 151 | ], |
| 152 | 'h3' => [ |
| 153 | 'title' => esc_html__( 'H3', 'essential-addons-for-elementor-lite' ), |
| 154 | 'icon' => 'eicon-editor-h3', |
| 155 | ], |
| 156 | 'h4' => [ |
| 157 | 'title' => esc_html__( 'H4', 'essential-addons-for-elementor-lite' ), |
| 158 | 'icon' => 'eicon-editor-h4', |
| 159 | ], |
| 160 | 'h5' => [ |
| 161 | 'title' => esc_html__( 'H5', 'essential-addons-for-elementor-lite' ), |
| 162 | 'icon' => 'eicon-editor-h5', |
| 163 | ], |
| 164 | 'h6' => [ |
| 165 | 'title' => esc_html__( 'H6', 'essential-addons-for-elementor-lite' ), |
| 166 | 'icon' => 'eicon-editor-h6', |
| 167 | ], |
| 168 | ], |
| 169 | 'condition' => [ |
| 170 | 'eael_ext_table_of_content' => 'yes', |
| 171 | ], |
| 172 | 'default' => 'h2', |
| 173 | ] |
| 174 | ); |
| 175 | |
| 176 | $element->start_controls_tabs('eael_toc_include_exclude', ['separator' => 'before']); |
| 177 | |
| 178 | $element->start_controls_tab('eael_toc_include', |
| 179 | [ |
| 180 | 'label' => __('Include', 'essential-addons-for-elementor-lite'), |
| 181 | 'condition' => [ |
| 182 | 'eael_ext_table_of_content' => 'yes', |
| 183 | ], |
| 184 | ] |
| 185 | ); |
| 186 | |
| 187 | $element->add_control( |
| 188 | 'eael_ext_toc_supported_heading_tag', |
| 189 | [ |
| 190 | 'label' => __('Supported Heading Tag', 'essential-addons-for-elementor-lite'), |
| 191 | 'type' => Controls_Manager::SELECT2, |
| 192 | 'multiple' => true, |
| 193 | 'label_block' => true, |
| 194 | 'default' => [ |
| 195 | 'h2', |
| 196 | 'h3', |
| 197 | 'h4', |
| 198 | 'h5', |
| 199 | 'h6', |
| 200 | ], |
| 201 | 'options' => [ |
| 202 | 'h1' => __('H1', 'essential-addons-for-elementor-lite'), |
| 203 | 'h2' => __('H2', 'essential-addons-for-elementor-lite'), |
| 204 | 'h3' => __('H3', 'essential-addons-for-elementor-lite'), |
| 205 | 'h4' => __('H4', 'essential-addons-for-elementor-lite'), |
| 206 | 'h5' => __('H5', 'essential-addons-for-elementor-lite'), |
| 207 | 'h6' => __('H6', 'essential-addons-for-elementor-lite'), |
| 208 | ], |
| 209 | 'render_type' => 'none', |
| 210 | 'condition' => [ |
| 211 | 'eael_ext_table_of_content' => 'yes', |
| 212 | ], |
| 213 | ] |
| 214 | ); |
| 215 | |
| 216 | $element->add_control( |
| 217 | 'eael_ext_toc_content_selector', |
| 218 | [ |
| 219 | 'label' => __('Content Selector', 'essential-addons-for-elementor-lite'), |
| 220 | 'type' => Controls_Manager::TEXT, |
| 221 | 'dynamic' => [ 'active' => true ], |
| 222 | 'description' => __('Which content are searched for heading tag, Provide unique selector to replace default selector', 'essential-addons-for-elementor-lite'), |
| 223 | 'label_block' => false, |
| 224 | 'condition' => [ |
| 225 | 'eael_ext_table_of_content' => 'yes', |
| 226 | ], |
| 227 | 'ai' => [ |
| 228 | 'active' => false, |
| 229 | ], |
| 230 | ] |
| 231 | ); |
| 232 | |
| 233 | $element->end_controls_tab(); // include |
| 234 | |
| 235 | $element->start_controls_tab('eael_toc_exclude', |
| 236 | [ |
| 237 | 'label' => __('Exclude', 'essential-addons-for-elementor-lite'), |
| 238 | 'condition' => [ |
| 239 | 'eael_ext_table_of_content' => 'yes', |
| 240 | ], |
| 241 | ] |
| 242 | ); |
| 243 | |
| 244 | $element->add_control( |
| 245 | 'eael_toc_exclude_selector', |
| 246 | [ |
| 247 | 'label' => __('Exclude By Selector', 'essential-addons-for-elementor-lite'), |
| 248 | 'type' => Controls_Manager::TEXT, |
| 249 | 'dynamic' => [ 'active' => true ], |
| 250 | 'description' => __('CSS selectors, in a comma-separated list', 'essential-addons-for-elementor-lite'), |
| 251 | 'default' => '', |
| 252 | 'label_block' => true, |
| 253 | 'condition' => [ |
| 254 | 'eael_ext_table_of_content' => 'yes', |
| 255 | ], |
| 256 | 'ai' => [ |
| 257 | 'active' => false, |
| 258 | ], |
| 259 | ] |
| 260 | ); |
| 261 | |
| 262 | $element->end_controls_tab(); // exclude |
| 263 | |
| 264 | $element->end_controls_tabs(); // include_exclude_tags |
| 265 | |
| 266 | $element->add_control( |
| 267 | 'eael_ext_toc_collapse_sub_heading', |
| 268 | [ |
| 269 | 'label' => __('Keep Sub Heading Collapsed', 'essential-addons-for-elementor-lite'), |
| 270 | 'type' => Controls_Manager::SWITCHER, |
| 271 | 'default' => 'yes', |
| 272 | 'label_on' => __('Yes', 'essential-addons-for-elementor-lite'), |
| 273 | 'label_off' => __('No', 'essential-addons-for-elementor-lite'), |
| 274 | 'return_value' => 'yes', |
| 275 | 'condition' => [ |
| 276 | 'eael_ext_table_of_content' => 'yes', |
| 277 | ], |
| 278 | ] |
| 279 | ); |
| 280 | |
| 281 | $element->add_control( |
| 282 | 'eael_ext_toc_use_title_in_url', |
| 283 | [ |
| 284 | 'label' => __('Heading Text in URL', 'essential-addons-for-elementor-lite'), |
| 285 | 'type' => Controls_Manager::SWITCHER, |
| 286 | 'default' => 'no', |
| 287 | 'label_on' => __('Yes', 'essential-addons-for-elementor-lite'), |
| 288 | 'label_off' => __('No', 'essential-addons-for-elementor-lite'), |
| 289 | 'return_value' => 'yes', |
| 290 | 'condition' => [ |
| 291 | 'eael_ext_table_of_content' => 'yes', |
| 292 | ], |
| 293 | ] |
| 294 | ); |
| 295 | |
| 296 | $element->add_control( |
| 297 | 'eael_ext_toc_word_wrap', |
| 298 | [ |
| 299 | 'label' => __('Stop Word Wrap', 'essential-addons-for-elementor-lite'), |
| 300 | 'type' => Controls_Manager::SWITCHER, |
| 301 | 'default' => 'no', |
| 302 | 'label_on' => __('Yes', 'essential-addons-for-elementor-lite'), |
| 303 | 'label_off' => __('No', 'essential-addons-for-elementor-lite'), |
| 304 | 'return_value' => 'yes', |
| 305 | 'condition' => [ |
| 306 | 'eael_ext_table_of_content' => 'yes', |
| 307 | ], |
| 308 | ] |
| 309 | ); |
| 310 | |
| 311 | $element->add_control( |
| 312 | 'eael_ext_toc_auto_collapse', |
| 313 | [ |
| 314 | 'label' => __('TOC Auto Collapse', 'essential-addons-for-elementor-lite'), |
| 315 | 'type' => Controls_Manager::SWITCHER, |
| 316 | 'default' => 'yes', |
| 317 | 'label_on' => __('Yes', 'essential-addons-for-elementor-lite'), |
| 318 | 'label_off' => __('No', 'essential-addons-for-elementor-lite'), |
| 319 | 'return_value' => 'yes', |
| 320 | 'condition' => [ |
| 321 | 'eael_ext_table_of_content' => 'yes', |
| 322 | ], |
| 323 | ] |
| 324 | ); |
| 325 | |
| 326 | $element->add_control( |
| 327 | 'eael_ext_toc_auto_highlight', |
| 328 | [ |
| 329 | 'label' => __('TOC Auto Highlight', 'essential-addons-for-elementor-lite'), |
| 330 | 'type' => Controls_Manager::SWITCHER, |
| 331 | 'default' => 'no', |
| 332 | 'label_on' => __('Yes', 'essential-addons-for-elementor-lite'), |
| 333 | 'label_off' => __('No', 'essential-addons-for-elementor-lite'), |
| 334 | 'return_value' => 'yes', |
| 335 | 'condition' => [ |
| 336 | 'eael_ext_table_of_content' => 'yes', |
| 337 | ], |
| 338 | ] |
| 339 | ); |
| 340 | |
| 341 | $element->add_control( |
| 342 | 'eael_ext_toc_auto_highlight_single_item_only', |
| 343 | [ |
| 344 | 'label' => __('Single or All Visible Headings?', 'essential-addons-for-elementor-lite'), |
| 345 | 'type' => Controls_Manager::SWITCHER, |
| 346 | 'default' => 'yes', |
| 347 | 'label_on' => __('Single', 'essential-addons-for-elementor-lite'), |
| 348 | 'label_off' => __('All', 'essential-addons-for-elementor-lite'), |
| 349 | 'return_value' => 'yes', |
| 350 | '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'), |
| 351 | 'condition' => [ |
| 352 | 'eael_ext_table_of_content' => 'yes', |
| 353 | 'eael_ext_toc_auto_highlight' => 'yes', |
| 354 | ], |
| 355 | ] |
| 356 | ); |
| 357 | |
| 358 | $element->add_control( |
| 359 | 'eael_ext_toc_hide_in_mobile', |
| 360 | [ |
| 361 | 'label' => __('Hide TOC in mobile', 'essential-addons-for-elementor-lite'), |
| 362 | 'type' => Controls_Manager::SWITCHER, |
| 363 | 'default' => 'no', |
| 364 | 'label_on' => __('Yes', 'essential-addons-for-elementor-lite'), |
| 365 | 'label_off' => __('No', 'essential-addons-for-elementor-lite'), |
| 366 | 'return_value' => 'yes', |
| 367 | 'condition' => [ |
| 368 | 'eael_ext_table_of_content' => 'yes', |
| 369 | ], |
| 370 | ] |
| 371 | ); |
| 372 | |
| 373 | $element->add_responsive_control( |
| 374 | 'eael_ext_toc_max_height', |
| 375 | [ |
| 376 | 'label' => __( 'Height', 'essential-addons-for-elementor-lite' ), |
| 377 | 'type' => Controls_Manager::SLIDER, |
| 378 | 'range' => [ |
| 379 | 'vh' => [ |
| 380 | 'min' => 10, |
| 381 | 'max' => 100, |
| 382 | ], |
| 383 | ], |
| 384 | 'default' => [ |
| 385 | 'size' => 50, |
| 386 | ], |
| 387 | 'size_units' => [ 'vh' ], |
| 388 | 'selectors' => [ |
| 389 | '{{WRAPPER}} .eael-toc.eael-sticky .eael-toc-body' => 'max-height: {{SIZE}}vh; height: {{SIZE}}vh;', |
| 390 | ], |
| 391 | 'condition' => [ |
| 392 | 'eael_ext_table_of_content' => 'yes', |
| 393 | ], |
| 394 | ] |
| 395 | ); |
| 396 | |
| 397 | $element->add_control( |
| 398 | 'eael_ext_toc_sticky_scroll', |
| 399 | [ |
| 400 | 'label' => __('Sticky Scroll Effect', 'essential-addons-for-elementor-lite'), |
| 401 | 'type' => Controls_Manager::SLIDER, |
| 402 | 'size_units' => ['px'], |
| 403 | 'range' => [ |
| 404 | 'px' => [ |
| 405 | 'min' => 5, |
| 406 | 'max' => 2000, |
| 407 | 'step' => 10, |
| 408 | ], |
| 409 | ], |
| 410 | 'default' => [ |
| 411 | 'unit' => 'px', |
| 412 | 'size' => 200, |
| 413 | ], |
| 414 | 'condition' => [ |
| 415 | 'eael_ext_table_of_content' => 'yes', |
| 416 | ], |
| 417 | ] |
| 418 | ); |
| 419 | |
| 420 | $element->add_control( |
| 421 | 'eael_ext_toc_sticky_offset', |
| 422 | [ |
| 423 | 'label' => __('Sticky Top Offset', 'essential-addons-for-elementor-lite'), |
| 424 | 'type' => Controls_Manager::SLIDER, |
| 425 | 'size_units' => ['px'], |
| 426 | 'range' => [ |
| 427 | 'px' => [ |
| 428 | 'min' => 5, |
| 429 | 'max' => 2000, |
| 430 | 'step' => 10, |
| 431 | ], |
| 432 | ], |
| 433 | 'default' => [ |
| 434 | 'unit' => 'px', |
| 435 | 'size' => 200, |
| 436 | ], |
| 437 | 'selectors' => [ |
| 438 | '{{WRAPPER}} .eael-toc.eael-sticky' => 'top: {{SIZE}}{{UNIT}} !important;', |
| 439 | ], |
| 440 | 'condition' => [ |
| 441 | 'eael_ext_table_of_content' => 'yes', |
| 442 | ], |
| 443 | ] |
| 444 | ); |
| 445 | |
| 446 | $element->add_control( |
| 447 | 'eael_ext_toc_main_page_offset', |
| 448 | [ |
| 449 | 'label' => __('Main Page Offset', 'essential-addons-for-elementor-lite'), |
| 450 | 'type' => Controls_Manager::SLIDER, |
| 451 | 'size_units' => ['px'], |
| 452 | 'range' => [ |
| 453 | 'px' => [ |
| 454 | 'min' => 5, |
| 455 | 'max' => 2000, |
| 456 | 'step' => 10, |
| 457 | ], |
| 458 | ], |
| 459 | 'default' => [ |
| 460 | 'unit' => 'px', |
| 461 | 'size' => 120, |
| 462 | ], |
| 463 | 'condition' => [ |
| 464 | 'eael_ext_table_of_content' => 'yes', |
| 465 | ], |
| 466 | ] |
| 467 | ); |
| 468 | |
| 469 | $element->add_control( |
| 470 | 'eael_ext_toc_sticky_z_index', |
| 471 | [ |
| 472 | 'label' => __('Z Index', 'essential-addons-for-elementor-lite'), |
| 473 | 'type' => Controls_Manager::SLIDER, |
| 474 | 'size_units' => ['px'], |
| 475 | 'range' => [ |
| 476 | 'px' => [ |
| 477 | 'min' => 0, |
| 478 | 'max' => 9999, |
| 479 | 'step' => 10, |
| 480 | ], |
| 481 | ], |
| 482 | 'default' => [ |
| 483 | 'unit' => 'px', |
| 484 | 'size' => 9999, |
| 485 | ], |
| 486 | 'selectors' => [ |
| 487 | '{{WRAPPER}} .eael-toc' => 'z-index: {{SIZE}}', |
| 488 | ], |
| 489 | 'condition' => [ |
| 490 | 'eael_ext_table_of_content' => 'yes', |
| 491 | ], |
| 492 | ] |
| 493 | ); |
| 494 | |
| 495 | $element->add_control( |
| 496 | 'eael_ext_toc_ad_warning_text', |
| 497 | [ |
| 498 | 'type' => Controls_Manager::RAW_HTML, |
| 499 | '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'), |
| 500 | 'content_classes' => 'eael-warning', |
| 501 | 'separator' => 'before', |
| 502 | 'condition' => [ |
| 503 | 'eael_ext_table_of_content' => 'yes', |
| 504 | ], |
| 505 | ] |
| 506 | ); |
| 507 | |
| 508 | $element->end_controls_section(); |
| 509 | |
| 510 | $element->start_controls_section( |
| 511 | 'eael_ext_toc_main', |
| 512 | [ |
| 513 | 'label' => esc_html__('EA TOC', 'essential-addons-for-elementor-lite'), |
| 514 | 'tab' => Controls_Manager::TAB_STYLE, |
| 515 | 'condition' => [ |
| 516 | 'eael_ext_table_of_content' => 'yes', |
| 517 | ], |
| 518 | ] |
| 519 | ); |
| 520 | |
| 521 | $element->add_responsive_control( |
| 522 | 'eael_ext_toc_width', |
| 523 | [ |
| 524 | 'label' => __('Width', 'essential-addons-for-elementor-lite'), |
| 525 | 'type' => Controls_Manager::SLIDER, |
| 526 | 'size_units' => ['px'], |
| 527 | 'range' => [ |
| 528 | 'px' => [ |
| 529 | 'min' => 0, |
| 530 | 'max' => 1000, |
| 531 | 'step' => 1, |
| 532 | ], |
| 533 | ], |
| 534 | 'default' => [ |
| 535 | 'unit' => 'px', |
| 536 | 'size' => 300, |
| 537 | ], |
| 538 | 'selectors' => [ |
| 539 | '{{WRAPPER}} .eael-toc' => 'width: {{SIZE}}{{UNIT}};', |
| 540 | ], |
| 541 | 'condition' => [ |
| 542 | 'eael_ext_table_of_content' => 'yes', |
| 543 | ], |
| 544 | ] |
| 545 | ); |
| 546 | |
| 547 | $element->add_control( |
| 548 | 'eael_ext_toc_position', |
| 549 | [ |
| 550 | 'label' => __('Position', 'essential-addons-for-elementor-lite'), |
| 551 | 'type' => Controls_Manager::SELECT, |
| 552 | 'default' => 'left', |
| 553 | 'label_block' => false, |
| 554 | 'options' => [ |
| 555 | 'left' => __('Left', 'essential-addons-for-elementor-lite'), |
| 556 | 'right' => __('Right', 'essential-addons-for-elementor-lite'), |
| 557 | ], |
| 558 | 'separator' => 'before', |
| 559 | 'condition' => [ |
| 560 | 'eael_ext_table_of_content' => 'yes', |
| 561 | ], |
| 562 | ] |
| 563 | ); |
| 564 | |
| 565 | $element->add_control( |
| 566 | 'eael_ext_toc_position_mobile', |
| 567 | [ |
| 568 | 'label' => esc_html__( 'Position For Mobile Device', 'essential-addons-for-elementor-lite' ), |
| 569 | 'type' => \Elementor\Controls_Manager::SWITCHER, |
| 570 | 'label_on' => esc_html__( 'Show', 'essential-addons-for-elementor-lite' ), |
| 571 | 'label_off' => esc_html__( 'Hide', 'essential-addons-for-elementor-lite' ), |
| 572 | 'return_value' => 'yes', |
| 573 | ] |
| 574 | ); |
| 575 | |
| 576 | $element->add_control( |
| 577 | 'eael_ext_toc_position_mobile_top_bottom', |
| 578 | [ |
| 579 | 'label' => __('Position', 'essential-addons-for-elementor-lite'), |
| 580 | 'type' => Controls_Manager::SELECT, |
| 581 | 'default' => 'top', |
| 582 | 'label_block' => false, |
| 583 | 'options' => [ |
| 584 | 'top' => __('Top', 'essential-addons-for-elementor-lite'), |
| 585 | 'bottom' => __('Bottom', 'essential-addons-for-elementor-lite'), |
| 586 | ], |
| 587 | 'condition' => [ |
| 588 | 'eael_ext_table_of_content' => 'yes', |
| 589 | 'eael_ext_toc_position_mobile' => 'yes', |
| 590 | ], |
| 591 | ] |
| 592 | ); |
| 593 | |
| 594 | $element->add_control( |
| 595 | 'eael_ext_toc_position_mobile_top_offset', |
| 596 | [ |
| 597 | 'label' => __('Top Offset', 'essential-addons-for-elementor-lite'), |
| 598 | 'type' => Controls_Manager::SLIDER, |
| 599 | 'size_units' => ['px'], |
| 600 | 'range' => [ |
| 601 | 'px' => [ |
| 602 | 'min' => 5, |
| 603 | 'max' => 2000, |
| 604 | 'step' => 10, |
| 605 | ], |
| 606 | ], |
| 607 | 'default' => [ |
| 608 | 'unit' => 'px', |
| 609 | 'size' => 50, |
| 610 | ], |
| 611 | 'selectors' => [ |
| 612 | '{{WRAPPER}} .eael-toc.eael-toc-top.eael-sticky' => 'top: {{SIZE}}{{UNIT}} !important;', |
| 613 | ], |
| 614 | 'condition' => [ |
| 615 | 'eael_ext_table_of_content' => 'yes', |
| 616 | 'eael_ext_toc_position_mobile_top_bottom' => 'top', |
| 617 | 'eael_ext_toc_position_mobile' => 'yes', |
| 618 | ], |
| 619 | ] |
| 620 | ); |
| 621 | |
| 622 | $element->add_control( |
| 623 | 'eael_ext_toc_position_mobile_bottom_offset', |
| 624 | [ |
| 625 | 'label' => __('Bottom Offset', 'essential-addons-for-elementor-lite'), |
| 626 | 'type' => Controls_Manager::SLIDER, |
| 627 | 'size_units' => ['px'], |
| 628 | 'range' => [ |
| 629 | 'px' => [ |
| 630 | 'min' => 5, |
| 631 | 'max' => 2000, |
| 632 | 'step' => 10, |
| 633 | ], |
| 634 | ], |
| 635 | 'default' => [ |
| 636 | 'unit' => 'px', |
| 637 | 'size' => 50, |
| 638 | ], |
| 639 | 'selectors' => [ |
| 640 | '{{WRAPPER}} .eael-toc.eael-toc-bottom.eael-sticky' => 'bottom: {{SIZE}}{{UNIT}};', |
| 641 | ], |
| 642 | 'condition' => [ |
| 643 | 'eael_ext_table_of_content' => 'yes', |
| 644 | 'eael_ext_toc_position_mobile_top_bottom' => 'bottom', |
| 645 | 'eael_ext_toc_position_mobile' => 'yes', |
| 646 | ], |
| 647 | ] |
| 648 | ); |
| 649 | |
| 650 | $element->add_control( |
| 651 | 'eael_ext_toc_list_icon', |
| 652 | [ |
| 653 | 'label' => __('List Icon', 'essential-addons-for-elementor-lite'), |
| 654 | 'type' => Controls_Manager::SELECT, |
| 655 | 'default' => 'bullet', |
| 656 | 'label_block' => false, |
| 657 | 'options' => [ |
| 658 | 'bullet' => __('Bullet', 'essential-addons-for-elementor-lite'), |
| 659 | 'number' => __('Number', 'essential-addons-for-elementor-lite'), |
| 660 | ], |
| 661 | 'condition' => [ |
| 662 | 'eael_ext_table_of_content' => 'yes', |
| 663 | ], |
| 664 | ] |
| 665 | ); |
| 666 | |
| 667 | $element->add_control( |
| 668 | 'eael_ext_toc_box_list_bullet_size', |
| 669 | [ |
| 670 | 'label' => __('Bullet Size', 'essential-addons-for-elementor-lite'), |
| 671 | 'type' => Controls_Manager::SLIDER, |
| 672 | 'size_units' => ['px'], |
| 673 | 'range' => [ |
| 674 | 'px' => [ |
| 675 | 'min' => 0, |
| 676 | 'max' => 50, |
| 677 | 'step' => 1, |
| 678 | ], |
| 679 | ], |
| 680 | 'default' => [ |
| 681 | 'unit' => 'px', |
| 682 | 'size' => 8, |
| 683 | ], |
| 684 | 'selectors' => [ |
| 685 | '{{WRAPPER}} .eael-toc .eael-toc-body ul.eael-toc-list.eael-toc-bullet li:before' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};', |
| 686 | ], |
| 687 | 'condition' => [ |
| 688 | 'eael_ext_toc_list_icon' => 'bullet', |
| 689 | ], |
| 690 | ] |
| 691 | ); |
| 692 | |
| 693 | $element->add_control( |
| 694 | 'eael_ext_toc_box_list_top_position', |
| 695 | [ |
| 696 | 'label' => __('Top Position', 'essential-addons-for-elementor-lite'), |
| 697 | 'type' => Controls_Manager::SLIDER, |
| 698 | 'size_units' => ['px'], |
| 699 | 'range' => [ |
| 700 | 'px' => [ |
| 701 | 'min' => -50, |
| 702 | 'max' => 50, |
| 703 | 'step' => 1, |
| 704 | ], |
| 705 | ], |
| 706 | 'default' => [ |
| 707 | 'unit' => 'px', |
| 708 | 'size' => -2, |
| 709 | ], |
| 710 | 'selectors' => [ |
| 711 | '{{WRAPPER}} .eael-toc .eael-toc-body ul.eael-toc-list.eael-toc-bullet li:before' => 'top: {{SIZE}}{{UNIT}};', |
| 712 | ], |
| 713 | 'condition' => [ |
| 714 | 'eael_ext_toc_list_icon' => 'bullet', |
| 715 | ], |
| 716 | ] |
| 717 | ); |
| 718 | |
| 719 | $element->add_group_control( |
| 720 | Group_Control_Border::get_type(), |
| 721 | [ |
| 722 | 'name' => 'eael_ext_toc_border', |
| 723 | 'label' => __('Border', 'essential-addons-for-elementor-lite'), |
| 724 | 'selector' => '{{WRAPPER}} .eael-toc,{{WRAPPER}} button.eael-toc-button', |
| 725 | 'condition' => [ |
| 726 | 'eael_ext_table_of_content' => 'yes', |
| 727 | ], |
| 728 | ] |
| 729 | ); |
| 730 | |
| 731 | $element->add_group_control( |
| 732 | Group_Control_Box_Shadow::get_type(), |
| 733 | [ |
| 734 | 'name' => 'eael_ext_toc_table_box_shadow', |
| 735 | 'label' => __('Box Shadow', 'essential-addons-for-elementor-lite'), |
| 736 | 'selector' => '{{WRAPPER}} .eael-toc:not(.collapsed)', |
| 737 | 'condition' => [ |
| 738 | 'eael_ext_table_of_content' => 'yes', |
| 739 | ], |
| 740 | ] |
| 741 | ); |
| 742 | |
| 743 | $element->add_control( |
| 744 | 'eael_ext_toc_box_border_radius', |
| 745 | [ |
| 746 | 'label' => __('Border Radius', 'essential-addons-for-elementor-lite'), |
| 747 | 'type' => Controls_Manager::SLIDER, |
| 748 | 'size_units' => ['px'], |
| 749 | 'range' => [ |
| 750 | 'px' => [ |
| 751 | 'min' => 0, |
| 752 | 'max' => 50, |
| 753 | 'step' => 1, |
| 754 | ], |
| 755 | ], |
| 756 | 'default' => [ |
| 757 | 'unit' => 'px', |
| 758 | 'size' => 5, |
| 759 | ], |
| 760 | 'selectors' => [ |
| 761 | '{{WRAPPER}} .eael-toc:not(.eael-toc-right)' => 'border-top-right-radius: {{SIZE}}{{UNIT}}; border-bottom-right-radius: {{SIZE}}{{UNIT}};', |
| 762 | '{{WRAPPER}} .eael-toc:not(.eael-toc-right) .eael-toc-header' => 'border-top-right-radius: {{SIZE}}{{UNIT}};', |
| 763 | '{{WRAPPER}} .eael-toc:not(.eael-toc-right) .eael-toc-body' => 'border-bottom-right-radius: {{SIZE}}{{UNIT}};', |
| 764 | |
| 765 | '{{WRAPPER}} .eael-toc.eael-toc-right' => 'border-top-left-radius: {{SIZE}}{{UNIT}}; border-bottom-left-radius: {{SIZE}}{{UNIT}};', |
| 766 | '{{WRAPPER}} .eael-toc.eael-toc-right .eael-toc-header' => 'border-top-left-radius: {{SIZE}}{{UNIT}};', |
| 767 | '{{WRAPPER}} .eael-toc.eael-toc-right .eael-toc-body' => 'border-bottom-left-radius: {{SIZE}}{{UNIT}};', |
| 768 | ], |
| 769 | 'condition' => [ |
| 770 | 'eael_ext_table_of_content' => 'yes', |
| 771 | ], |
| 772 | ] |
| 773 | ); |
| 774 | |
| 775 | $element->end_controls_section(); |
| 776 | |
| 777 | $element->start_controls_section( |
| 778 | 'eael_ext_table_of_content_header_style', |
| 779 | [ |
| 780 | 'label' => esc_html__('EA TOC Header', 'essential-addons-for-elementor-lite'), |
| 781 | 'tab' => Controls_Manager::TAB_STYLE, |
| 782 | 'condition' => [ |
| 783 | 'eael_ext_table_of_content' => 'yes', |
| 784 | ], |
| 785 | ] |
| 786 | ); |
| 787 | |
| 788 | $element->add_control( |
| 789 | 'eael_ext_table_of_content_header_bg', |
| 790 | [ |
| 791 | 'label' => __('Background Color', 'essential-addons-for-elementor-lite'), |
| 792 | 'type' => Controls_Manager::COLOR, |
| 793 | 'default' => '#ff7d50', |
| 794 | 'selectors' => [ |
| 795 | '{{WRAPPER}} .eael-toc .eael-toc-header' => 'background-color: {{VALUE}}', |
| 796 | '{{WRAPPER}} .eael-toc.collapsed .eael-toc-button' => 'background-color: {{VALUE}}', |
| 797 | ], |
| 798 | ] |
| 799 | ); |
| 800 | |
| 801 | $element->add_control( |
| 802 | 'eael_ext_table_of_content_header_text_color', |
| 803 | [ |
| 804 | 'label' => __('Text Color', 'essential-addons-for-elementor-lite'), |
| 805 | 'type' => Controls_Manager::COLOR, |
| 806 | 'default' => '#ffffff', |
| 807 | 'selectors' => [ |
| 808 | '{{WRAPPER}} .eael-toc .eael-toc-header .eael-toc-title' => 'color: {{VALUE}}', |
| 809 | '{{WRAPPER}} .eael-toc.collapsed .eael-toc-button' => 'color: {{VALUE}}', |
| 810 | ], |
| 811 | ] |
| 812 | ); |
| 813 | |
| 814 | $element->add_group_control( |
| 815 | Group_Control_Typography::get_type(), |
| 816 | [ |
| 817 | 'name' => 'eael_ext_table_of_content_header_typography', |
| 818 | 'selector' => '{{WRAPPER}} .eael-toc-header .eael-toc-title,{{WRAPPER}} .eael-toc.collapsed .eael-toc-button', |
| 819 | 'global' => [ |
| 820 | 'default' => Global_Typography::TYPOGRAPHY_SECONDARY |
| 821 | ], |
| 822 | ] |
| 823 | ); |
| 824 | |
| 825 | $element->add_control( |
| 826 | 'eael_ext_toc_header_padding', |
| 827 | [ |
| 828 | 'label' => esc_html__('Padding', 'essential-addons-for-elementor-lite'), |
| 829 | 'type' => Controls_Manager::DIMENSIONS, |
| 830 | 'size_units' => ['px'], |
| 831 | 'selectors' => [ |
| 832 | '{{WRAPPER}} .eael-toc .eael-toc-header' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 833 | ], |
| 834 | ] |
| 835 | ); |
| 836 | |
| 837 | $element->add_control( |
| 838 | 'eael_ext_toc_header_collapse_close_button', |
| 839 | [ |
| 840 | 'label' => __('Collapse', 'essential-addons-for-elementor-lite'), |
| 841 | 'type' => Controls_Manager::HEADING, |
| 842 | 'separator' => 'before', |
| 843 | ] |
| 844 | ); |
| 845 | |
| 846 | $element->add_control( |
| 847 | 'eael_ext_table_of_content_header_icon', |
| 848 | [ |
| 849 | 'label' => __('Icon', 'essential-addons-for-elementor-lite'), |
| 850 | 'type' => Controls_Manager::ICONS, |
| 851 | 'label_block' => true, |
| 852 | 'default' => [ |
| 853 | 'value' => 'fas fa-list', |
| 854 | 'library' => 'fa-solid', |
| 855 | ], |
| 856 | 'fa4compatibility' => 'icon', |
| 857 | ] |
| 858 | ); |
| 859 | |
| 860 | $element->add_control( |
| 861 | 'eael_ext_toc_close_button_text_style', |
| 862 | [ |
| 863 | 'label' => __('Text Orientation', 'essential-addons-for-elementor-lite'), |
| 864 | 'type' => Controls_Manager::SELECT, |
| 865 | 'default' => 'top_to_bottom', |
| 866 | 'options' => [ |
| 867 | 'top_to_bottom' => __('Top to Bottom', 'essential-addons-for-elementor-lite'), |
| 868 | 'bottom_to_top' => __('Bottom to Top', 'essential-addons-for-elementor-lite'), |
| 869 | ], |
| 870 | ] |
| 871 | ); |
| 872 | |
| 873 | $element->add_control( |
| 874 | 'eael_ext_table_of_content_close_button', |
| 875 | [ |
| 876 | 'label' => __('Close Button', 'essential-addons-for-elementor-lite'), |
| 877 | 'type' => Controls_Manager::HEADING, |
| 878 | 'separator' => 'before', |
| 879 | ] |
| 880 | ); |
| 881 | |
| 882 | $element->add_control( |
| 883 | 'eael_ext_table_of_content_close_button_icon_size', |
| 884 | [ |
| 885 | 'label' => __('Icon Size', 'essential-addons-for-elementor-lite'), |
| 886 | 'type' => Controls_Manager::SLIDER, |
| 887 | 'size_units' => ['px'], |
| 888 | 'range' => [ |
| 889 | 'px' => [ |
| 890 | 'min' => 0, |
| 891 | 'max' => 100, |
| 892 | ], |
| 893 | ], |
| 894 | 'selectors' => [ |
| 895 | '{{WRAPPER}} .eael-toc .eael-toc-close' => 'font-size: {{SIZE}}{{UNIT}};', |
| 896 | ], |
| 897 | ] |
| 898 | ); |
| 899 | |
| 900 | $element->add_control( |
| 901 | 'eael_ext_table_of_content_close_button_size', |
| 902 | [ |
| 903 | 'label' => __('Button Size', 'essential-addons-for-elementor-lite'), |
| 904 | 'type' => Controls_Manager::SLIDER, |
| 905 | 'size_units' => ['px'], |
| 906 | 'range' => [ |
| 907 | 'px' => [ |
| 908 | 'min' => 0, |
| 909 | 'max' => 100, |
| 910 | ], |
| 911 | ], |
| 912 | 'selectors' => [ |
| 913 | '{{WRAPPER}} .eael-toc .eael-toc-close' => 'height: {{SIZE}}{{UNIT}};width: {{SIZE}}{{UNIT}};', |
| 914 | ], |
| 915 | ] |
| 916 | ); |
| 917 | |
| 918 | $element->add_control( |
| 919 | 'eael_ext_table_of_content_close_button_line_height', |
| 920 | [ |
| 921 | 'label' => __('Line Height', 'essential-addons-for-elementor-lite'), |
| 922 | 'type' => Controls_Manager::SLIDER, |
| 923 | 'size_units' => ['px'], |
| 924 | 'range' => [ |
| 925 | 'px' => [ |
| 926 | 'min' => 0, |
| 927 | 'max' => 100, |
| 928 | ], |
| 929 | ], |
| 930 | 'selectors' => [ |
| 931 | '{{WRAPPER}} .eael-toc .eael-toc-close' => 'line-height: {{SIZE}}{{UNIT}};', |
| 932 | ], |
| 933 | ] |
| 934 | ); |
| 935 | |
| 936 | $element->add_control( |
| 937 | 'eael_ext_table_of_content_close_button_bg', |
| 938 | [ |
| 939 | 'label' => __('Background Color', 'essential-addons-for-elementor-lite'), |
| 940 | 'type' => Controls_Manager::COLOR, |
| 941 | 'default' => '#ffffff', |
| 942 | 'selectors' => [ |
| 943 | '{{WRAPPER}} .eael-toc .eael-toc-close' => 'background-color: {{VALUE}}', |
| 944 | ], |
| 945 | ] |
| 946 | ); |
| 947 | |
| 948 | $element->add_control( |
| 949 | 'eael_ext_table_of_content_close_button_text_color', |
| 950 | [ |
| 951 | 'label' => __('Close Button Color', 'essential-addons-for-elementor-lite'), |
| 952 | 'type' => Controls_Manager::COLOR, |
| 953 | 'default' => '#ff7d50', |
| 954 | 'selectors' => [ |
| 955 | '{{WRAPPER}} .eael-toc .eael-toc-close' => 'color: {{VALUE}}', |
| 956 | ], |
| 957 | ] |
| 958 | ); |
| 959 | |
| 960 | $element->add_control( |
| 961 | 'eael_ext_table_of_content_close_button_border_radius', |
| 962 | [ |
| 963 | 'label' => __('Border Radius', 'essential-addons-for-elementor-lite'), |
| 964 | 'type' => Controls_Manager::SLIDER, |
| 965 | 'size_units' => ['px'], |
| 966 | 'range' => [ |
| 967 | 'px' => [ |
| 968 | 'min' => 0, |
| 969 | 'max' => 100, |
| 970 | ], |
| 971 | ], |
| 972 | 'selectors' => [ |
| 973 | '{{WRAPPER}} .eael-toc .eael-toc-close' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 974 | ], |
| 975 | ] |
| 976 | ); |
| 977 | |
| 978 | $element->add_group_control( |
| 979 | Group_Control_Box_Shadow::get_type(), |
| 980 | [ |
| 981 | 'name' => 'eael_ext_table_of_content_close_button_box_shadow', |
| 982 | 'label' => __('Box Shadow', 'essential-addons-for-elementor-lite'), |
| 983 | 'selector' => '{{WRAPPER}} .eael-toc .eael-toc-close', |
| 984 | ] |
| 985 | ); |
| 986 | |
| 987 | $element->end_controls_section(); |
| 988 | |
| 989 | $element->start_controls_section( |
| 990 | 'eael_ext_table_of_content_list_style_section', |
| 991 | [ |
| 992 | 'label' => esc_html__('EA TOC Body', 'essential-addons-for-elementor-lite'), |
| 993 | 'tab' => Controls_Manager::TAB_STYLE, |
| 994 | 'condition' => [ |
| 995 | 'eael_ext_table_of_content' => 'yes', |
| 996 | ], |
| 997 | ] |
| 998 | ); |
| 999 | |
| 1000 | $element->add_control( |
| 1001 | 'eael_ext_table_of_content_body_bg', |
| 1002 | [ |
| 1003 | 'label' => __('Background Color', 'essential-addons-for-elementor-lite'), |
| 1004 | 'type' => Controls_Manager::COLOR, |
| 1005 | 'default' => '#fff6f3', |
| 1006 | 'selectors' => [ |
| 1007 | '{{WRAPPER}} .eael-toc .eael-toc-body' => 'background-color: {{VALUE}}', |
| 1008 | ], |
| 1009 | |
| 1010 | ] |
| 1011 | ); |
| 1012 | |
| 1013 | $element->add_control( |
| 1014 | 'eael_ext_toc_body_padding', |
| 1015 | [ |
| 1016 | 'label' => esc_html__('Padding', 'essential-addons-for-elementor-lite'), |
| 1017 | 'type' => Controls_Manager::DIMENSIONS, |
| 1018 | 'size_units' => ['px'], |
| 1019 | 'selectors' => [ |
| 1020 | '{{WRAPPER}} .eael-toc .eael-toc-body' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1021 | ], |
| 1022 | ] |
| 1023 | ); |
| 1024 | |
| 1025 | $element->add_control( |
| 1026 | 'eael_ext_table_of_content_list_style_separator', |
| 1027 | [ |
| 1028 | 'label' => __('List', 'essential-addons-for-elementor-lite'), |
| 1029 | 'type' => Controls_Manager::HEADING, |
| 1030 | 'separator' => 'before', |
| 1031 | ] |
| 1032 | ); |
| 1033 | |
| 1034 | $element->add_control( |
| 1035 | 'eael_ext_table_of_content_list_style', |
| 1036 | [ |
| 1037 | 'label' => __('Indicator Style', 'essential-addons-for-elementor-lite'), |
| 1038 | 'type' => Controls_Manager::SELECT, |
| 1039 | 'default' => 'none', |
| 1040 | 'options' => [ |
| 1041 | 'none' => __('None', 'essential-addons-for-elementor-lite'), |
| 1042 | 'arrow' => __('Arrow', 'essential-addons-for-elementor-lite'), |
| 1043 | 'bar' => __('Bar', 'essential-addons-for-elementor-lite'), |
| 1044 | ], |
| 1045 | ] |
| 1046 | ); |
| 1047 | |
| 1048 | $element->add_control( |
| 1049 | 'eael_ext_toc_indicator_color', |
| 1050 | [ |
| 1051 | 'label' => __('Indicator Color', 'essential-addons-for-elementor-lite'), |
| 1052 | 'type' => Controls_Manager::COLOR, |
| 1053 | 'default' => '#ff7d50', |
| 1054 | 'selectors' => [ |
| 1055 | '{{WRAPPER}} .eael-toc .eael-toc-body ul.eael-toc-list.eael-toc-list-bar li.eael-highlight-active > a:after' => 'background-color: {{VALUE}}', |
| 1056 | '{{WRAPPER}} .eael-toc .eael-toc-body ul.eael-toc-list.eael-toc-list-arrow li.eael-highlight-active > a:before' => 'border-bottom: 10px solid {{VALUE}}', |
| 1057 | ], |
| 1058 | 'condition' => [ |
| 1059 | 'eael_ext_table_of_content_list_style' => [ 'arrow', 'bar' ] |
| 1060 | ], |
| 1061 | ] |
| 1062 | ); |
| 1063 | |
| 1064 | $element->add_control( |
| 1065 | 'eael_ext_toc_indicator_size', |
| 1066 | [ |
| 1067 | 'label' => __('Indicator Size', 'essential-addons-for-elementor-lite'), |
| 1068 | 'type' => Controls_Manager::SLIDER, |
| 1069 | 'size_units' => ['px'], |
| 1070 | 'range' => [ |
| 1071 | 'px' => [ |
| 1072 | 'min' => 0, |
| 1073 | 'max' => 100, |
| 1074 | 'step' => 1, |
| 1075 | ], |
| 1076 | ], |
| 1077 | 'default' => [ |
| 1078 | 'unit' => 'px', |
| 1079 | 'size' => 20, |
| 1080 | ], |
| 1081 | 'selectors' => [ |
| 1082 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list.eael-toc-list-bar li.eael-highlight-active > a:after' => 'height: {{SIZE}}{{UNIT}};', |
| 1083 | ], |
| 1084 | 'condition' => [ |
| 1085 | 'eael_ext_table_of_content_list_style' => 'bar', |
| 1086 | ], |
| 1087 | ] |
| 1088 | ); |
| 1089 | |
| 1090 | $element->add_control( |
| 1091 | 'eael_ext_toc_indicator_position', |
| 1092 | [ |
| 1093 | 'label' => __('Indicator Position', 'essential-addons-for-elementor-lite'), |
| 1094 | 'type' => Controls_Manager::SLIDER, |
| 1095 | 'size_units' => ['px'], |
| 1096 | 'range' => [ |
| 1097 | 'px' => [ |
| 1098 | 'min' => -100, |
| 1099 | 'max' => 100, |
| 1100 | 'step' => 1, |
| 1101 | ], |
| 1102 | ], |
| 1103 | 'default' => [ |
| 1104 | 'unit' => 'px', |
| 1105 | 'size' => 0, |
| 1106 | ], |
| 1107 | 'selectors' => [ |
| 1108 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list.eael-toc-list-arrow li.eael-highlight-active > a:before' => 'margin-top: {{SIZE}}{{UNIT}};', |
| 1109 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list.eael-toc-list-bar li.eael-highlight-active > a:after' => 'margin-top: {{SIZE}}{{UNIT}};', |
| 1110 | ], |
| 1111 | 'condition' => [ |
| 1112 | 'eael_ext_table_of_content_list_style!' => 'none', |
| 1113 | ], |
| 1114 | ] |
| 1115 | ); |
| 1116 | |
| 1117 | $element->add_group_control( |
| 1118 | Group_Control_Typography::get_type(), |
| 1119 | [ |
| 1120 | 'name' => 'eael_ext_table_of_content_list_typography_normal', |
| 1121 | 'selector' => '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list', |
| 1122 | 'global' => [ |
| 1123 | 'default' => Global_Typography::TYPOGRAPHY_SECONDARY |
| 1124 | ], |
| 1125 | ] |
| 1126 | ); |
| 1127 | |
| 1128 | $element->start_controls_tabs('ea_toc_list_style'); |
| 1129 | |
| 1130 | $element->start_controls_tab('normal', |
| 1131 | [ |
| 1132 | 'label' => __('Normal', 'essential-addons-for-elementor-lite'), |
| 1133 | ] |
| 1134 | ); |
| 1135 | |
| 1136 | $element->add_control( |
| 1137 | 'eael_ext_table_of_content_list_text_color', |
| 1138 | [ |
| 1139 | 'label' => __('Text Color', 'essential-addons-for-elementor-lite'), |
| 1140 | 'type' => Controls_Manager::COLOR, |
| 1141 | 'default' => '#707070', |
| 1142 | 'selectors' => [ |
| 1143 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list li' => 'color: {{VALUE}}', |
| 1144 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list.eael-toc-number li:before' => 'color: {{VALUE}}', |
| 1145 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list.eael-toc-bullet li:before' => 'background-color: {{VALUE}}', |
| 1146 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list li a' => 'color: {{VALUE}}', |
| 1147 | ], |
| 1148 | ] |
| 1149 | ); |
| 1150 | |
| 1151 | $element->end_controls_tab(); |
| 1152 | |
| 1153 | $element->start_controls_tab('hover', |
| 1154 | [ |
| 1155 | 'label' => __('Hover', 'essential-addons-for-elementor-lite'), |
| 1156 | ] |
| 1157 | ); |
| 1158 | |
| 1159 | $element->add_control( |
| 1160 | 'eael_ext_table_of_list_hover_color', |
| 1161 | [ |
| 1162 | 'label' => __('Text Color', 'essential-addons-for-elementor-lite'), |
| 1163 | 'type' => Controls_Manager::COLOR, |
| 1164 | 'default' => '#ff7d50', |
| 1165 | 'selectors' => [ |
| 1166 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list li:hover' => 'color: {{VALUE}}', |
| 1167 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list.eael-toc-number li:hover:before' => 'color: {{VALUE}}', |
| 1168 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list.eael-toc-bullet li:hover:before' => 'background-color: {{VALUE}}', |
| 1169 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list li:hover > a' => 'color: {{VALUE}}', |
| 1170 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list li:hover > a:before' => 'border-bottom-color: {{VALUE}}', |
| 1171 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list li:hover > a:after' => 'background-color: {{VALUE}}', |
| 1172 | ], |
| 1173 | |
| 1174 | ] |
| 1175 | ); |
| 1176 | |
| 1177 | $element->end_controls_tab(); // hover |
| 1178 | |
| 1179 | $element->start_controls_tab('active', |
| 1180 | [ |
| 1181 | 'label' => __('Active', 'essential-addons-for-elementor-lite'), |
| 1182 | ] |
| 1183 | ); |
| 1184 | |
| 1185 | $element->add_control( |
| 1186 | 'eael_ext_table_of_content_list_text_color_active', |
| 1187 | [ |
| 1188 | 'label' => __('Text Color', 'essential-addons-for-elementor-lite'), |
| 1189 | 'type' => Controls_Manager::COLOR, |
| 1190 | 'default' => '#ff7d50', |
| 1191 | 'selectors' => [ |
| 1192 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list li.eael-highlight-active' => 'color: {{VALUE}}', |
| 1193 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list.eael-toc-number li.eael-highlight-active:before' => 'color: {{VALUE}}', |
| 1194 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list.eael-toc-bullet li.eael-highlight-active:before' => 'background-color: {{VALUE}}', |
| 1195 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list li.eael-highlight-active > a' => 'color: {{VALUE}}', |
| 1196 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list li.eael-highlight-active > a:before' => 'border-bottom-color: {{VALUE}}', |
| 1197 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list li.eael-highlight-active > a:after' => 'background-color: {{VALUE}}', |
| 1198 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list li.eael-highlight-parent' => 'color: {{VALUE}}', |
| 1199 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list.eael-toc-number li.eael-highlight-parent:before' => 'color: {{VALUE}}', |
| 1200 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list.eael-toc-bullet li.eael-highlight-parent:before' => 'background-color: {{VALUE}}', |
| 1201 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list li.eael-highlight-parent > a' => 'color: {{VALUE}}', |
| 1202 | ], |
| 1203 | ] |
| 1204 | ); |
| 1205 | |
| 1206 | $element->end_controls_tab(); // active |
| 1207 | $element->end_controls_tabs(); |
| 1208 | |
| 1209 | $element->add_control( |
| 1210 | 'eael_ext_toc_top_level_space', |
| 1211 | [ |
| 1212 | 'label' => __('Top Level Space', 'essential-addons-for-elementor-lite'), |
| 1213 | 'type' => Controls_Manager::SLIDER, |
| 1214 | 'size_units' => ['px'], |
| 1215 | 'range' => [ |
| 1216 | 'px' => [ |
| 1217 | 'min' => 0, |
| 1218 | 'max' => 50, |
| 1219 | 'step' => 1, |
| 1220 | ], |
| 1221 | ], |
| 1222 | 'default' => [ |
| 1223 | 'unit' => 'px', |
| 1224 | 'size' => 8, |
| 1225 | ], |
| 1226 | 'selectors' => [ |
| 1227 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list li' => 'padding-top: {{SIZE}}{{UNIT}}; padding-bottom: {{SIZE}}{{UNIT}};', |
| 1228 | ], |
| 1229 | 'condition' => [ |
| 1230 | 'eael_ext_table_of_content' => 'yes', |
| 1231 | ], |
| 1232 | ] |
| 1233 | ); |
| 1234 | |
| 1235 | $element->add_control( |
| 1236 | 'eael_ext_toc_subitem_level_space', |
| 1237 | [ |
| 1238 | 'label' => __('Sub Item Space', 'essential-addons-for-elementor-lite'), |
| 1239 | 'type' => Controls_Manager::SLIDER, |
| 1240 | 'size_units' => ['px'], |
| 1241 | 'range' => [ |
| 1242 | 'px' => [ |
| 1243 | 'min' => 0, |
| 1244 | 'max' => 20, |
| 1245 | 'step' => 1, |
| 1246 | ], |
| 1247 | ], |
| 1248 | 'default' => [ |
| 1249 | 'unit' => 'px', |
| 1250 | 'size' => 1, |
| 1251 | ], |
| 1252 | 'selectors' => [ |
| 1253 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list li ul li' => 'padding-top: {{SIZE}}{{UNIT}}; padding-bottom: {{SIZE}}{{UNIT}};', |
| 1254 | ], |
| 1255 | 'condition' => [ |
| 1256 | 'eael_ext_table_of_content' => 'yes', |
| 1257 | ], |
| 1258 | ] |
| 1259 | ); |
| 1260 | |
| 1261 | $element->add_control( |
| 1262 | 'eael_ext_table_of_content_list_separator', |
| 1263 | [ |
| 1264 | 'label' => __('Separator', 'essential-addons-for-elementor-lite'), |
| 1265 | 'type' => Controls_Manager::HEADING, |
| 1266 | 'separator' => 'before', |
| 1267 | ] |
| 1268 | ); |
| 1269 | |
| 1270 | $element->add_control( |
| 1271 | 'eael_ext_table_of_content_list_separator_style', |
| 1272 | [ |
| 1273 | 'label' => __('Style', 'essential-addons-for-elementor-lite'), |
| 1274 | 'type' => Controls_Manager::SELECT, |
| 1275 | 'default' => 'dashed', |
| 1276 | 'options' => [ |
| 1277 | 'solid' => __('Solid', 'essential-addons-for-elementor-lite'), |
| 1278 | 'dashed' => __('Dashed', 'essential-addons-for-elementor-lite'), |
| 1279 | 'dotted' => __('Dotted', 'essential-addons-for-elementor-lite'), |
| 1280 | 'none' => __('None', 'essential-addons-for-elementor-lite'), |
| 1281 | ], |
| 1282 | 'selectors' => [ |
| 1283 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list > li:not(:last-child)' => 'border-bottom: 0.5px {{VALUE}}', |
| 1284 | ], |
| 1285 | ] |
| 1286 | ); |
| 1287 | |
| 1288 | $element->add_control( |
| 1289 | 'eael_ext_table_of_content_list_separator_color', |
| 1290 | [ |
| 1291 | 'label' => __('Color', 'essential-addons-for-elementor-lite'), |
| 1292 | 'type' => Controls_Manager::COLOR, |
| 1293 | 'selectors' => [ |
| 1294 | '{{WRAPPER}} .eael-toc .eael-toc-body .eael-toc-list > li:not(:last-child)' => 'border-bottom-color: {{VALUE}}', |
| 1295 | ], |
| 1296 | 'default' => '#c6c4cf', |
| 1297 | 'condition' => [ |
| 1298 | 'eael_ext_table_of_content_list_separator_style!' => 'none', |
| 1299 | ], |
| 1300 | ] |
| 1301 | ); |
| 1302 | |
| 1303 | $element->end_controls_section(); |
| 1304 | } |
| 1305 | } |
| 1306 |