PluginProbe ʕ •ᴥ•ʔ
Premium Addons for Elementor – Powerful Elementor Templates & Widgets / 4.11.84
Premium Addons for Elementor – Powerful Elementor Templates & Widgets v4.11.84
4.11.84 4.11.83 4.11.82 4.11.80 4.11.81 4.11.79 4.11.78 4.11.77 4.11.76 4.11.75 3.20.5 4.11.69 3.20.6 4.11.7 3.20.7 4.11.70 3.20.8 4.11.71 3.20.9 4.11.72 3.21.1 4.11.73 3.21.2 4.11.74 3.21.3 4.11.8 3.21.4 4.11.9 3.21.5 4.2.0 3.21.6 4.2.1 3.3.0 4.2.2 3.3.1 4.2.3 3.3.2 4.2.4 3.3.3 4.2.5 3.3.4 4.2.6 3.3.5 4.2.7 3.3.6 4.2.8 3.3.7 4.2.9 3.3.8 4.3.0 3.3.9 4.3.1 3.4.0 4.3.2 3.4.1 4.3.3 3.4.2 4.3.4 3.4.3 4.3.5 3.4.4 4.3.6 3.4.5 4.3.7 3.4.6 4.3.8 3.4.7 4.3.9 3.4.8 4.4.0 3.4.9 4.4.1 3.5.0 4.4.2 3.5.1 4.4.3 3.5.2 4.4.4 3.5.3 4.4.5 3.5.4 4.4.6 3.5.5 4.4.7 3.5.6 4.4.8 3.5.7 4.4.9 3.5.8 4.5.0 3.5.9 4.5.1 3.6.0 4.5.2 3.6.1 4.5.3 3.6.2 4.5.4 3.6.3 4.5.5 3.6.4 4.5.6 3.6.5 4.5.7 3.6.6 4.5.8 3.6.7 4.5.9 3.6.8 4.6.0 3.6.9 4.6.1 3.7.0 4.7.0 3.7.1 4.7.1 3.7.2 4.7.2 3.7.3 4.7.3 3.7.4 4.7.4 3.7.5 4.7.5 3.7.6 4.7.6 3.7.7 4.7.7 3.7.8 4.7.8 3.7.9 4.7.9 3.8.0 4.8.0 3.8.1 4.8.1 3.8.2 4.8.10 3.8.3 4.8.11 3.8.4 4.8.2 3.8.5 4.8.3 3.8.6 4.8.4 3.8.7 4.8.5 3.8.8 4.8.6 3.8.9 4.8.7 3.9.0 4.8.8 3.9.1 4.8.9 3.9.2 4.9.0 3.9.3 4.9.0-beta1 3.9.4 4.9.0-beta2 3.9.5 4.9.1 3.9.6 4.9.10 3.9.7 4.9.11 3.9.8 4.9.12 3.9.9 4.9.13 4.0.1 4.9.14 4.0.3 4.9.15 4.0.4 4.9.16 4.0.5 4.9.17 4.0.6 4.9.18 4.0.7 4.9.19 4.0.8 4.9.2 4.0.9 4.9.20 4.1.0 4.9.21 4.1.1 4.9.22 4.1.2 4.9.23 4.1.3 4.9.24 trunk 4.1.4 4.9.25 1.0 4.1.5 4.9.26 1.01 4.1.6 4.9.27 1.02 4.1.7 4.9.28 1.03 4.1.8 4.9.29 1.04 4.1.9 4.9.3 1.05 4.10.0 4.9.30 1.06 4.10.1 4.9.31 1.07 4.10.10 4.9.32 1.08 4.10.11 4.9.33 1.09 4.10.12 4.9.34 2.0 4.10.13 4.9.35 2.0.1 4.10.14 4.9.36 2.0.2 4.10.15 4.9.37 2.0.3 4.10.16 4.9.38 2.0.4 4.10.17 4.9.39 2.0.5 4.10.18 4.9.4 2.0.6 4.10.19 4.9.40 2.0.7 4.10.2 4.9.41 2.0.8 4.10.20 4.9.42 2.0.9 4.10.21 4.9.43 2.1.0 4.10.22 4.9.45 2.1.1 4.10.23 4.9.46 2.1.2 4.10.24 4.9.47 2.1.3 4.10.25 4.9.48 2.1.4 4.10.26 4.9.49 2.1.5 4.10.27 4.9.5 2.1.5-beta1 4.10.28 4.9.50 2.1.6 4.10.29 4.9.51 2.1.7 4.10.3 4.9.52 2.1.8 4.10.30 4.9.53 2.1.9 4.10.31 4.9.54 2.2.0 4.10.32 4.9.55 2.2.1 4.10.33 4.9.56 2.2.2 4.10.34 4.9.57 2.2.3 4.10.35 4.9.6 2.2.4 4.10.36 4.9.7 2.2.5 4.10.37 4.9.8 2.2.6 4.10.38 4.9.9 2.2.7 4.10.39 2.2.8 4.10.4 2.2.9 4.10.40 2.3.0 4.10.41 2.3.1 4.10.42 2.3.2 4.10.43 2.3.3 4.10.44 2.3.4 4.10.45 2.3.5 4.10.46 2.3.6 4.10.47 2.3.7 4.10.48 2.3.8 4.10.49 2.3.9 4.10.5 2.4.0 4.10.50 2.4.1 4.10.51 2.5.0 4.10.52 2.5.1 4.10.53 2.5.2 4.10.54 2.5.3 4.10.55 2.5.4 4.10.56 2.5.5 4.10.57 2.5.6 4.10.58 2.5.7 4.10.59 2.5.8 4.10.6 2.5.9 4.10.60 2.6.0 4.10.61 2.6.1 4.10.62 2.6.2 4.10.63 2.6.3 4.10.64 2.6.4 4.10.65 2.6.5 4.10.66 2.6.6 4.10.67 2.6.7 4.10.68 2.6.8 4.10.69 2.6.9 4.10.7 2.7.0 4.10.70 2.7.1 4.10.71 2.7.2 4.10.72 2.7.3 4.10.73 2.7.4 4.10.74 2.7.5 4.10.75 2.7.6 4.10.76 2.7.7 4.10.77 2.7.8 4.10.78 2.7.9 4.10.79 2.8.0 4.10.8 2.8.1 4.10.80 2.8.2 4.10.81 2.8.3 4.10.82 2.8.4 4.10.83 2.8.5 4.10.84 2.8.6 4.10.85 2.8.7 4.10.86 2.8.8 4.10.87 2.8.9 4.10.88 2.9.0 4.10.89 2.9.1 4.10.9 2.9.2 4.10.90 2.9.3 4.11.0 2.9.4 4.11.1 2.9.5 4.11.10 2.9.6 4.11.11 2.9.7 4.11.12 2.9.8 4.11.13 2.9.9 4.11.14 3.0.0 4.11.15 3.0.1 4.11.16 3.0.2 4.11.17 3.0.3 4.11.18 3.0.4 4.11.19 3.0.5 4.11.2 3.0.6 4.11.20 3.0.7 4.11.21 3.0.8 4.11.22 3.0.9 4.11.23 3.1.0 4.11.24 3.1.1 4.11.25 3.1.2 4.11.26 3.1.3 4.11.27 3.1.4 4.11.28 3.1.5 4.11.29 3.1.6 4.11.3 3.1.7 4.11.30 3.1.8 4.11.31 3.1.9 4.11.32 3.10.0 4.11.33 3.10.1 4.11.34 3.10.2 4.11.35 3.10.3 4.11.36 3.10.4 4.11.37 3.10.5 4.11.38 3.10.6 4.11.39 3.10.7 4.11.4 3.10.8 4.11.40 3.10.9 4.11.41 3.11.0 4.11.42 3.11.1 4.11.43 3.11.2 4.11.44 3.11.3 4.11.45 3.11.4 4.11.46 3.11.5 4.11.47 3.11.6 4.11.48 3.11.7 4.11.49 3.11.8 4.11.5 3.11.9 4.11.50 3.12.0 4.11.51 3.12.1 4.11.52 3.12.2 4.11.53 3.12.3 4.11.54 3.2.0 4.11.55 3.2.1 4.11.56 3.2.2 4.11.57 3.2.3 4.11.58 3.2.4 4.11.59 3.2.5 4.11.6 3.2.6 4.11.60 3.2.7 4.11.61 3.2.8 4.11.62 3.2.9 4.11.63 3.20.0 4.11.64 3.20.1 4.11.65 3.20.2 4.11.66 3.20.3 4.11.67 3.20.4 4.11.68
premium-addons-for-elementor / widgets / premium-nav-menu.php
premium-addons-for-elementor / widgets Last commit date
dep 3 weeks ago premium-banner.php 1 day ago premium-blog.php 2 weeks ago premium-button.php 2 weeks ago premium-carousel.php 2 weeks ago premium-contactform.php 2 weeks ago premium-countdown.php 2 weeks ago premium-counter.php 2 weeks ago premium-dual-header.php 2 weeks ago premium-fancytext.php 2 weeks ago premium-grid.php 2 weeks ago premium-icon-list.php 2 weeks ago premium-image-button.php 2 weeks ago premium-image-scroll.php 2 weeks ago premium-image-separator.php 2 weeks ago premium-lottie.php 2 weeks ago premium-maps.php 2 days ago premium-media-wheel.php 2 weeks ago premium-mobile-menu.php 2 weeks ago premium-modalbox.php 2 days ago premium-nav-menu.php 2 weeks ago premium-notifications.php 2 weeks ago premium-person.php 2 weeks ago premium-pinterest-feed.php 2 weeks ago premium-post-ticker.php 2 weeks ago premium-pricing-table.php 2 days ago premium-progressbar.php 2 weeks ago premium-search-form.php 2 days ago premium-svg-drawer.php 2 weeks ago premium-tcloud.php 2 weeks ago premium-testimonials.php 2 weeks ago premium-textual-showcase.php 2 weeks ago premium-tiktok-feed.php 2 weeks ago premium-title.php 2 days ago premium-videobox.php 2 weeks ago premium-vscroll.php 2 weeks ago premium-weather.php 2 weeks ago premium-world-clock.php 2 weeks ago
premium-nav-menu.php
5406 lines
1 <?php
2 /**
3 * Premium Nav Menu.
4 */
5
6 namespace PremiumAddons\Widgets;
7
8 // Elementor Classes.
9 use Elementor\Widget_Base;
10 use Elementor\Utils;
11 use Elementor\Control_Media;
12 use Elementor\Icons_Manager;
13 use Elementor\Repeater;
14 use Elementor\Controls_Manager;
15 use Elementor\Group_Control_Border;
16 use Elementor\Group_Control_Background;
17 use Elementor\Group_Control_Typography;
18 use Elementor\Group_Control_Box_Shadow;
19 use Elementor\Group_Control_Text_Shadow;
20 use Elementor\Core\Kits\Documents\Tabs\Global_Colors;
21 use Elementor\Core\Kits\Documents\Tabs\Global_Typography;
22
23 // PremiumAddons Classes.
24 use PremiumAddons\Includes\Helper_Functions;
25 use PremiumAddons\Includes\Helpers\Pa_Nav_Menu_Walker;
26 use PremiumAddons\Includes\Controls\Premium_Post_Filter;
27 use PremiumAddons\Includes\Controls\Premium_Background;
28
29 if ( ! defined( 'ABSPATH' ) ) {
30 exit; // If this file is called directly, abort.
31 }
32
33 /**
34 * Class Premium_Person.
35 */
36 class Premium_Nav_Menu extends Widget_Base {
37
38 /**
39 * Retrieve Widget Name.
40 *
41 * @since 1.0.0
42 * @access public
43 */
44 public function get_name() {
45 return 'premium-nav-menu';
46 }
47
48 /**
49 * Retrieve Widget Title.
50 *
51 * @since 1.0.0
52 * @access public
53 */
54 public function get_title() {
55 return __( 'Mega Menu', 'premium-addons-for-elementor' );
56 }
57
58 /**
59 * Retrieve Widget Icon.
60 *
61 * @since 1.0.0
62 * @access public
63 *
64 * @return string widget icon.
65 */
66 public function get_icon() {
67 return 'pa-mega-menu';
68 }
69
70 /**
71 * Retrieve Widget Dependent CSS.
72 *
73 * @since 1.0.0
74 * @access public
75 *
76 * @return array CSS style handles.
77 */
78 public function get_style_depends() {
79 return array(
80 'pa-glass',
81 'dashicons',
82 'font-awesome-5-all',
83 'premium-addons',
84 );
85 }
86
87 /**
88 * Retrieve Widget Dependent JS.
89 *
90 * @since 1.0.0
91 * @access public
92 *
93 * @return array JS script handles.
94 */
95 public function get_script_depends() {
96
97 $is_edit = Helper_Functions::is_edit_mode();
98
99 $scripts = array();
100
101 if ( $is_edit ) {
102
103 $scripts = array( 'lottie-js', 'pa-glass', 'pa-headroom' );
104
105 } else {
106 $settings = $this->get_settings();
107
108 if ( 'wordpress_menu' === $settings['menu_type'] ) {
109 $scripts[] = 'lottie-js';
110 } elseif ( ! empty( $settings['menu_items'] ) ) {
111
112 foreach ( $settings['menu_items'] as $item ) {
113
114 if ( 'animation' === $item['icon_type'] ) {
115 $scripts[] = 'lottie-js';
116 break;
117 }
118 }
119 }
120
121 if ( 'yes' === $settings['pa_sticky_on_scroll'] ) {
122 $scripts[] = 'pa-headroom';
123 }
124
125 if ( 'none' !== $settings['item_lq_effect'] || 'none' !== $settings['submenu_lq_effect'] || 'none' !== $settings['mega_lq_effect'] ) {
126 $scripts[] = 'pa-glass';
127 }
128 }
129
130 $scripts[] = 'pa-menu';
131
132 return $scripts;
133 }
134
135 /**
136 * Retrieve Widget Categories.
137 *
138 * @since 1.5.1
139 * @access public
140 *
141 * @return array Widget categories.
142 */
143 public function get_categories() {
144 return array( 'premium-elements' );
145 }
146
147 /**
148 * Retrieve Widget Keywords.
149 *
150 * @since 1.0.0
151 * @access public
152 *
153 * @return array Widget keywords.
154 */
155 public function get_keywords() {
156 return array( 'pa', 'premium', 'premium mega menu', 'menu', 'nav', 'navigation', 'mega menu', 'header' );
157 }
158
159 /**
160 * Dynamic Content.
161 *
162 * @since 1.0.0
163 * @access protected
164 *
165 * @return bool
166 */
167 protected function is_dynamic_content(): bool {
168 return true;
169 }
170
171 /**
172 * Retrieve Widget Support URL.
173 *
174 * @access public
175 *
176 * @return string support URL.
177 */
178 public function get_custom_help_url() {
179 return 'https://premiumaddons.com/support/';
180 }
181
182 /**
183 * Ha Widget Inner Wrapper.
184 *
185 * @since 1.0.0
186 * @access public
187 *
188 * @return bool
189 */
190 public function has_widget_inner_wrapper(): bool {
191 return true;
192 }
193
194 /**
195 * Get Menu List.
196 *
197 * @access private
198 * @since 4.9.3
199 *
200 * @return array
201 */
202 private function get_menu_list() {
203
204 $menus = wp_list_pluck( wp_get_nav_menus(), 'name', 'term_id' ); // term_id >> index key , name >> value of that index.
205
206 return $menus;
207 }
208
209 /**
210 * Register Nav Menu Controls.
211 *
212 * @since 1.0.0
213 * @access protected
214 */
215 protected function register_controls() {
216
217 $this->get_menu_settings_controls();
218
219 $this->get_menu_content_controls();
220
221 $this->add_random_badges_section();
222
223 $this->add_helpful_docs_section();
224
225 $this->get_menu_style_controls();
226
227 Helper_Functions::register_papro_promotion_controls( $this, 'menu' );
228 }
229
230 /**
231 * Get menu style controls.
232 *
233 * @access private
234 * @since 4.9.3
235 */
236 private function get_menu_style_controls() {
237 $this->get_sticky_style();
238 $this->get_ver_toggler_style();
239 $this->get_menu_container_style();
240 $this->get_menu_item_style();
241 $this->get_menu_item_extras();
242 $this->get_submenu_container_style();
243 $this->get_submenu_item_style();
244 $this->get_sub_menu_item_extras();
245 $this->get_toggle_menu_sytle();
246 }
247
248 /**
249 * Get menu content controls.
250 *
251 * @access private
252 * @since 4.9.3
253 */
254 private function get_menu_settings_controls() {
255
256 $this->start_controls_section(
257 'premium_nav_section',
258 array(
259 'label' => __( 'Menu Settings', 'premium-addons-for-elementor' ),
260 )
261 );
262
263 $demo = Helper_Functions::get_campaign_link( 'https://premiumaddons.com/elementor-mega-menu-widget/', 'menu', 'wp-editor', 'demo' );
264 Helper_Functions::add_templates_controls( $this, 'nav-mega-menu', $demo );
265
266 $this->add_control(
267 'menu_type',
268 array(
269 'label' => __( 'Menu Type', 'premium-addons-for-elementor' ),
270 'type' => Controls_Manager::SELECT,
271 'default' => 'wordpress_menu',
272 'options' => array(
273 'wordpress_menu' => __( 'WordPress Menu', 'premium-addons-for-elementor' ),
274 'custom' => __( 'Custom Menu', 'premium-addons-for-elementor' ),
275 ),
276 )
277 );
278
279 $get_pro = Helper_Functions::get_campaign_link( 'https://premiumaddons.com/pro', 'menu-widget', 'wp-editor', 'get-pro' );
280
281 $papro_activated = Helper_Functions::check_papro_version();
282
283 if ( ! $papro_activated ) {
284 $this->add_control(
285 'custom_menu_notice',
286 array(
287 'type' => Controls_Manager::RAW_HTML,
288 'raw' => __( 'Custom Menu can be used in Premium Addons Pro.', 'premium-addons-for-elementor' ) . '<a href="' . esc_url( $get_pro ) . '" target="_blank">' . __( ' Upgrade now!', 'premium-addons-for-elementor' ) . '</a>',
289 'content_classes' => 'papro-upgrade-notice',
290 'condition' => array(
291 'menu_type' => 'custom',
292 ),
293 )
294 );
295 }
296
297 $menu_list = $this->get_menu_list();
298
299 if ( ! empty( $menu_list ) ) {
300
301 $this->add_control(
302 'pa_nav_menus',
303 array(
304 'label' => __( 'Menu', 'premium-addons-for-elementor' ),
305 'type' => Controls_Manager::SELECT,
306 'options' => $menu_list,
307 'condition' => array(
308 'menu_type' => 'wordpress_menu',
309 ),
310 )
311 );
312
313 } else {
314 $this->add_control(
315 'empty_nav_menu_notice',
316 array(
317 'raw' => '<strong>' . __( 'There are no menus in your site.', 'premium-addons-for-elementor' ) . '</strong><br>' .
318 /* translators: %s is the URL to the Menus screen in the WordPress admin. */
319 sprintf( __( 'Go to the <a href="%s" target="_blank">Menus screen</a> to create one.', 'premium-addons-for-elementor' ), admin_url( 'nav-menus.php?action=edit&menu=0' ) ),
320 'type' => Controls_Manager::RAW_HTML,
321 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
322 'condition' => array(
323 'menu_type' => 'wordpress_menu',
324 ),
325 )
326 );
327 }
328
329 if ( $papro_activated ) {
330 $this->add_control(
331 'custom_nav_notice',
332 array(
333 'raw' => __( 'It\'s not recommended to use Elementor Template and Link Submenu Items together under the same menu item', 'premium-addons-for-elementor' ),
334 'type' => Controls_Manager::RAW_HTML,
335 'content_classes' => 'elementor-panel-alert elementor-panel-alert-warning',
336 'condition' => array(
337 'menu_type' => 'custom',
338 ),
339 )
340 );
341 }
342
343 $repeater = new Repeater();
344
345 $repeater->add_control(
346 'item_type',
347 array(
348 'label' => __( 'Item Type', 'premium-addons-for-elementor' ),
349 'type' => Controls_Manager::SELECT,
350 'default' => 'menu',
351 'options' => array(
352 'menu' => __( 'Menu', 'premium-addons-for-elementor' ),
353 'submenu' => __( 'Submenu', 'premium-addons-for-elementor' ),
354 ),
355 )
356 );
357
358 $repeater->add_control(
359 'menu_content_type',
360 array(
361 'label' => __( 'Content Type', 'premium-addons-for-elementor' ),
362 'type' => Controls_Manager::SELECT,
363 'options' => array(
364 'link' => __( 'Link', 'premium-addons-for-elementor' ),
365 'custom_content' => __( 'Elementor Template', 'premium-addons-for-elementor' ),
366 'element' => __( 'Element On Page', 'premium-addons-for-elementor' ),
367 ),
368 'default' => 'link',
369 'condition' => array(
370 'item_type' => 'submenu',
371 ),
372 )
373 );
374
375 $repeater->add_control(
376 'text',
377 array(
378 'label' => __( 'Text', 'premium-addons-for-elementor' ),
379 'type' => Controls_Manager::TEXT,
380 'default' => __( 'Item', 'premium-addons-for-elementor' ),
381 'dynamic' => array(
382 'active' => true,
383 ),
384 'conditions' => array(
385 'relation' => 'or',
386 'terms' => array(
387 array(
388 'name' => 'item_type',
389 'operator' => '==',
390 'value' => 'menu',
391 ),
392 array(
393 'name' => 'menu_content_type',
394 'operator' => '==',
395 'value' => 'link',
396 ),
397 ),
398 ),
399 )
400 );
401
402 $repeater->add_control(
403 'link',
404 array(
405 'label' => __( 'Link', 'premium-addons-for-elementor' ),
406 'type' => Controls_Manager::URL,
407 'default' => array(
408 'url' => '#',
409 'is_external' => '',
410 ),
411 'dynamic' => array(
412 'active' => true,
413 ),
414 'conditions' => array(
415 'relation' => 'or',
416 'terms' => array(
417 array(
418 'name' => 'item_type',
419 'operator' => '==',
420 'value' => 'menu',
421 ),
422 array(
423 'name' => 'menu_content_type',
424 'operator' => '==',
425 'value' => 'link',
426 ),
427 ),
428 ),
429 )
430 );
431
432 $repeater->add_control(
433 'element_selector',
434 array(
435 'label' => __( 'Element CSS Selector', 'premium-addons-for-elementor' ),
436 'type' => Controls_Manager::TEXT,
437 'condition' => array(
438 'item_type' => 'submenu',
439 'menu_content_type' => 'element',
440 ),
441 )
442 );
443
444 $repeater->add_control(
445 'live_temp_content',
446 array(
447 'label' => __( 'Template Title', 'premium-addons-for-elementor' ),
448 'type' => Controls_Manager::TEXT,
449 'classes' => 'premium-live-temp-title control-hidden',
450 'label_block' => true,
451 'condition' => array(
452 'item_type' => 'submenu',
453 'menu_content_type' => 'custom_content',
454 ),
455 )
456 );
457
458 $repeater->add_control(
459 'submenu_item_live',
460 array(
461 'type' => Controls_Manager::BUTTON,
462 'label_block' => true,
463 'button_type' => 'default papro-btn-block',
464 'text' => __( 'Create / Edit Template', 'premium-addons-for-elementor' ),
465 'event' => 'createLiveTemp',
466 'condition' => array(
467 'item_type' => 'submenu',
468 'menu_content_type' => 'custom_content',
469 ),
470 )
471 );
472
473 $repeater->add_control(
474 'submenu_item',
475 array(
476 'label' => __( 'OR Select Existing Template', 'premium-addons-for-elementor' ),
477 'type' => Premium_Post_Filter::TYPE,
478 'classes' => 'premium-live-temp-label',
479 'label_block' => true,
480 'multiple' => false,
481 'source' => 'elementor_library',
482 'condition' => array(
483 'item_type' => 'submenu',
484 'menu_content_type' => 'custom_content',
485 ),
486 )
487 );
488
489 $repeater->add_control(
490 'section_full_width',
491 array(
492 'label' => __( 'Full Width Dropdown', 'premium-addons-for-elementor' ),
493 'type' => Controls_Manager::SWITCHER,
494 'description' => __( 'Enable this option to set the dropdown width to the same width of the parent container', 'premium-addons-for-elementor' ),
495 'condition' => array(
496 'item_type' => 'menu',
497 ),
498 )
499 );
500
501 $repeater->add_control(
502 'full_width_selector',
503 array(
504 'label' => __( 'Element CSS ID', 'premium-addons-for-elementor' ),
505 'description' => __( 'Enter the section ID you want to get the full width of. EX: #my-custom-cont', 'premium-addons-for-elementor' ),
506 'type' => Controls_Manager::TEXT,
507 'render_type' => 'template',
508 'condition' => array(
509 'item_type' => 'menu',
510 'section_full_width' => 'yes',
511 ),
512 )
513 );
514
515 $repeater->add_responsive_control(
516 'section_width',
517 array(
518 'label' => __( 'Dropdown Minimum Width (px)', 'premium-addons-for-elementor' ),
519 'type' => Controls_Manager::SLIDER,
520 'range' => array(
521 'px' => array(
522 'min' => 0,
523 'max' => 1500,
524 ),
525 ),
526 'selectors' => array(
527 '{{WRAPPER}} {{CURRENT_ITEM}} ul.premium-sub-menu, {{WRAPPER}} {{CURRENT_ITEM}} .premium-mega-content-container' => 'min-width: {{SIZE}}{{UNIT}}',
528 ),
529 'condition' => array(
530 'item_type' => 'menu',
531 'section_full_width!' => 'yes',
532 ),
533 )
534 );
535
536 $repeater->add_responsive_control(
537 'section_position',
538 array(
539 'label' => __( 'Align to Widget Center', 'premium-addons-for-elementor' ),
540 'type' => Controls_Manager::SWITCHER,
541 'description' => __( 'This option centers the mega content to the center of the widget container. <b> Only works when Full Width Dropdown option is disabled </b>', 'premium-addons-for-elementor' ),
542 'condition' => array(
543 'item_type' => 'submenu',
544 'menu_content_type' => array( 'custom_content', 'element' ),
545 ),
546 )
547 );
548
549 $repeater->add_control(
550 'icon_type',
551 array(
552 'label' => __( 'Icon Type', 'premium-addons-for-elementor' ),
553 'type' => Controls_Manager::CHOOSE,
554 'options' => array(
555 'none' => array(
556 'title' => __( 'None', 'premium-addons-for-elementor' ),
557 'icon' => 'eicon-ban',
558 ),
559 'icon' => array(
560 'title' => __( 'Icon', 'premium-addons-for-elementor' ),
561 'icon' => 'divider-type-icon',
562 ),
563 'image' => array(
564 'title' => __( 'Image', 'premium-addons-for-elementor' ),
565 'icon' => 'divider-type-image',
566 ),
567 'animation' => array(
568 'title' => __( 'Lottie Animation', 'premium-addons-for-elementor' ),
569 'icon' => 'divider-type-lottie',
570 ),
571 'svg' => array(
572 'title' => __( 'SVG Code', 'premium-addons-for-elementor' ),
573 'icon' => 'divider-type-code',
574 ),
575 ),
576 'default' => 'none',
577 'conditions' => array(
578 'relation' => 'or',
579 'terms' => array(
580 array(
581 'name' => 'item_type',
582 'operator' => '==',
583 'value' => 'menu',
584 ),
585 array(
586 'name' => 'menu_content_type',
587 'operator' => '==',
588 'value' => 'link',
589 ),
590
591 ),
592 ),
593 )
594 );
595
596 $repeater->add_control(
597 'item_icon',
598 array(
599 'label' => __( 'Select an Icon', 'premium-addons-for-elementor' ),
600 'type' => Controls_Manager::ICONS,
601 'label_block' => false,
602 'skin' => 'inline',
603 'conditions' => array(
604 'relation' => 'and',
605 'terms' => array(
606 array(
607 'name' => 'icon_type',
608 'value' => 'icon',
609 ),
610 array(
611 'relation' => 'or',
612 'terms' => array(
613 array(
614 'name' => 'item_type',
615 'operator' => '==',
616 'value' => 'menu',
617 ),
618 array(
619 'name' => 'menu_content_type',
620 'operator' => '==',
621 'value' => 'link',
622 ),
623 ),
624 ),
625
626 ),
627 ),
628 )
629 );
630
631 $repeater->add_control(
632 'item_image',
633 array(
634 'label' => __( 'Upload Image', 'premium-addons-for-elementor' ),
635 'type' => Controls_Manager::MEDIA,
636 'default' => array(
637 'url' => Utils::get_placeholder_image_src(),
638 ),
639 'conditions' => array(
640 'relation' => 'and',
641 'terms' => array(
642 array(
643 'name' => 'icon_type',
644 'value' => 'image',
645 ),
646 array(
647 'relation' => 'or',
648 'terms' => array(
649 array(
650 'name' => 'item_type',
651 'operator' => '==',
652 'value' => 'menu',
653 ),
654 array(
655 'name' => 'menu_content_type',
656 'operator' => '==',
657 'value' => 'link',
658 ),
659 ),
660 ),
661
662 ),
663 ),
664 )
665 );
666
667 $repeater->add_control(
668 'custom_svg',
669 array(
670 'label' => __( 'SVG Code', 'premium-addons-for-elementor' ),
671 'type' => Controls_Manager::TEXTAREA,
672 'description' => 'You can use these sites to create SVGs: <a href="https://danmarshall.github.io/google-font-to-svg-path/" target="_blank">Google Fonts</a> and <a href="https://boxy-svg.com/" target="_blank">Boxy SVG</a>',
673 'condition' =>
674 array(
675 'icon_type' => 'svg',
676 ),
677 'ai' => array(
678 'active' => false,
679 ),
680 )
681 );
682
683 $repeater->add_control(
684 'lottie_url',
685 array(
686 'label' => __( 'Animation JSON URL', 'premium-addons-for-elementor' ),
687 'type' => Controls_Manager::TEXT,
688 'description' => 'Get JSON code URL from <a href="https://lottiefiles.com/" target="_blank">here</a>',
689 'label_block' => true,
690 'conditions' => array(
691 'relation' => 'and',
692 'terms' => array(
693 array(
694 'name' => 'icon_type',
695 'value' => 'animation',
696 ),
697 array(
698 'relation' => 'or',
699 'terms' => array(
700 array(
701 'name' => 'item_type',
702 'operator' => '==',
703 'value' => 'menu',
704 ),
705 array(
706 'name' => 'menu_content_type',
707 'operator' => '==',
708 'value' => 'link',
709 ),
710 ),
711 ),
712
713 ),
714 ),
715 )
716 );
717
718 $repeater->add_control(
719 'badge_text',
720 array(
721 'label' => __( 'Badge Text', 'premium-addons-for-elementor' ),
722 'type' => Controls_Manager::TEXT,
723 'conditions' => array(
724 'relation' => 'or',
725 'terms' => array(
726 array(
727 'name' => 'item_type',
728 'operator' => '==',
729 'value' => 'menu',
730 ),
731 array(
732 'name' => 'menu_content_type',
733 'operator' => '==',
734 'value' => 'link',
735 ),
736 ),
737 ),
738 )
739 );
740
741 if ( $papro_activated ) {
742
743 do_action( 'pa_custom_menu_controls', $this, $repeater );
744
745 }
746
747 $this->end_controls_section();
748 }
749
750 /**
751 * Get menu content controls.
752 *
753 * @access private
754 * @since 4.9.3
755 */
756 private function get_menu_content_controls() {
757
758 $this->start_controls_section(
759 'display_options_section',
760 array(
761 'label' => __( 'Display Options', 'premium-addons-for-elementor' ),
762 )
763 );
764
765 $this->add_control(
766 'load_hidden',
767 array(
768 'label' => __( 'Hide Menu Until Content Loaded', 'premium-addons-for-elementor' ),
769 'type' => Controls_Manager::SWITCHER,
770 'description' => __( 'This option hides the menu by default until all the content inside it is loaded.', 'premium-addons-for-elementor' ),
771 'default' => 'yes',
772 )
773 );
774
775 $this->add_control(
776 'menu_heading',
777 array(
778 'label' => __( 'Menu Settings', 'premium-addons-for-elementor' ),
779 'type' => Controls_Manager::HEADING,
780 )
781 );
782
783 $this->add_control(
784 'pa_nav_menu_layout',
785 array(
786 'label' => __( 'Layout', 'premium-addons-for-elementor' ),
787 'type' => Controls_Manager::SELECT,
788 'prefix_class' => 'premium-nav-',
789 'options' => array(
790 'hor' => 'Horizontal',
791 'ver' => 'Vertical',
792 'dropdown' => 'Expand',
793 'slide' => 'Slide',
794 ),
795 'render_type' => 'template',
796 'default' => 'hor',
797 )
798 );
799
800 $align_left = is_rtl() ? 'flex-end' : 'flex-start';
801 $align_right = is_rtl() ? 'flex-start' : 'flex-end';
802 $align_def = is_rtl() ? 'flex-end' : 'flex-start';
803
804 $this->add_responsive_control(
805 'pa_nav_menu_align',
806 array(
807 'label' => __( 'Menu Alignment', 'premium-addons-for-elementor' ),
808 'type' => Controls_Manager::CHOOSE,
809 'options' => array(
810 $align_left => array(
811 'title' => __( 'Left', 'premium-addons-for-elementor' ),
812 'icon' => 'eicon-h-align-left',
813 ),
814 'center' => array(
815 'title' => __( 'Center', 'premium-addons-for-elementor' ),
816 'icon' => 'eicon-h-align-center',
817 ),
818 $align_right => array(
819 'title' => __( 'Right', 'premium-addons-for-elementor' ),
820 'icon' => 'eicon-h-align-right',
821 ),
822 'space-between' => array(
823 'title' => __( 'Strech', 'premium-addons-for-elementor' ),
824 'icon' => 'eicon-h-align-stretch',
825 ),
826 ),
827 'default' => 'center',
828 'toggle' => false,
829 'selectors' => array(
830 '{{WRAPPER}} .premium-main-nav-menu' => 'justify-content: {{VALUE}}',
831 ),
832 'condition' => array(
833 'pa_nav_menu_layout' => 'hor',
834 ),
835 )
836 );
837
838 $this->add_responsive_control(
839 'pa_nav_menu_align_ver',
840 array(
841 'label' => __( 'Menu Alignment', 'premium-addons-for-elementor' ),
842 'type' => Controls_Manager::CHOOSE,
843 'options' => array(
844 $align_left => array(
845 'title' => __( 'Left', 'premium-addons-for-elementor' ),
846 'icon' => 'eicon-text-align-left',
847 ),
848 'center' => array(
849 'title' => __( 'Center', 'premium-addons-for-elementor' ),
850 'icon' => 'eicon-text-align-center',
851 ),
852 $align_right => array(
853 'title' => __( 'Right', 'premium-addons-for-elementor' ),
854 'icon' => 'eicon-text-align-right',
855 ),
856 ),
857 'default' => $align_def,
858 'toggle' => false,
859 'selectors' => array(
860 '{{WRAPPER}} .premium-main-nav-menu > .premium-nav-menu-item > .premium-menu-link' => 'justify-content: {{VALUE}}',
861 ),
862 'condition' => array(
863 'pa_nav_menu_layout' => 'ver',
864 ),
865 )
866 );
867
868 $this->add_control(
869 'pointer',
870 array(
871 'label' => __( 'Item Hover Effect', 'premium-addons-for-elementor' ),
872 'type' => Controls_Manager::SELECT,
873 'default' => 'none',
874 'options' => array(
875 'none' => __( 'None', 'premium-addons-for-elementor' ),
876 'underline' => __( 'Underline', 'premium-addons-for-elementor' ),
877 'overline' => __( 'Overline', 'premium-addons-for-elementor' ),
878 'double-line' => __( 'Double Line', 'premium-addons-for-elementor' ),
879 'framed' => __( 'Framed', 'premium-addons-for-elementor' ),
880 'background' => __( 'Background', 'premium-addons-for-elementor' ),
881 'text' => __( 'Text', 'premium-addons-for-elementor' ),
882 ),
883 'style_transfer' => true,
884 )
885 );
886
887 $this->add_control(
888 'animation_line',
889 array(
890 'label' => __( 'Animation', 'premium-addons-for-elementor' ),
891 'type' => Controls_Manager::SELECT,
892 'default' => 'fade',
893 'options' => array(
894 'fade' => 'Fade',
895 'slide' => 'Slide',
896 'grow' => 'Grow',
897 'drop-in' => 'Drop In',
898 'drop-out' => 'Drop Out',
899 'none' => 'None',
900 ),
901 'condition' => array(
902 'pointer' => array( 'underline', 'overline', 'double-line' ),
903 ),
904 )
905 );
906
907 $this->add_control(
908 'animation_framed',
909 array(
910 'label' => __( 'Animation', 'premium-addons-for-elementor' ),
911 'type' => Controls_Manager::SELECT,
912 'default' => 'fade',
913 'options' => array(
914 'fade' => 'Fade',
915 'grow' => 'Grow',
916 'shrink' => 'Shrink',
917 'draw' => 'Draw',
918 'corners' => 'Corners',
919 'none' => 'None',
920 ),
921 'condition' => array(
922 'pointer' => 'framed',
923 ),
924 )
925 );
926
927 $this->add_control(
928 'animation_background',
929 array(
930 'label' => __( 'Animation', 'premium-addons-for-elementor' ),
931 'type' => Controls_Manager::SELECT,
932 'default' => 'fade',
933 'options' => array(
934 'fade' => 'Fade',
935 'grow' => 'Grow',
936 'shrink' => 'Shrink',
937 'sweep-left' => 'Sweep Left',
938 'sweep-right' => 'Sweep Right',
939 'sweep-up' => 'Sweep Up',
940 'sweep-down' => 'Sweep Down',
941 'shutter-in-vertical' => 'Shutter In Vertical',
942 'shutter-out-vertical' => 'Shutter Out Vertical',
943 'shutter-in-horizontal' => 'Shutter In Horizontal',
944 'shutter-out-horizontal' => 'Shutter Out Horizontal',
945 'none' => 'None',
946 ),
947 'condition' => array(
948 'pointer' => 'background',
949 ),
950 )
951 );
952
953 $this->add_control(
954 'animation_text',
955 array(
956 'label' => __( 'Animation', 'premium-addons-for-elementor' ),
957 'type' => Controls_Manager::SELECT,
958 'default' => 'grow',
959 'options' => array(
960 'grow' => 'Grow',
961 'shrink' => 'Shrink',
962 'sink' => 'Sink',
963 'float' => 'Float',
964 'skew' => 'Skew',
965 'rotate' => 'Rotate',
966 'none' => 'None',
967 ),
968 'condition' => array(
969 'pointer' => 'text',
970 ),
971 )
972 );
973
974 $this->get_vertical_toggle_settings();
975
976 $this->get_sticky_option_settings();
977
978 $this->add_control(
979 'slide_direction',
980 array(
981 'label' => __( 'Slide Direction', 'premium-addons-for-elementor' ),
982 'type' => Controls_Manager::CHOOSE,
983 'options' => array(
984 'left' => array(
985 'title' => __( 'Left', 'premium-addons-for-elementor' ),
986 'icon' => 'eicon-arrow-left',
987 ),
988 'auto' => array(
989 'title' => __( 'Auto (Site direction)', 'premium-addons-for-elementor' ),
990 'icon' => 'fas fa-exchange-alt',
991 ),
992 'right' => array(
993 'title' => __( 'Right', 'premium-addons-for-elementor' ),
994 'icon' => 'eicon-arrow-right',
995 ),
996 ),
997 'default' => 'auto',
998 'toggle' => false,
999 'separator' => 'before',
1000 'prefix_class' => 'premium-slide-',
1001 'conditions' => array(
1002 'relation' => 'or',
1003 'terms' => array(
1004 array(
1005 'name' => 'pa_nav_menu_layout',
1006 'value' => 'slide',
1007 ),
1008 array(
1009 'relation' => 'and',
1010 'terms' => array(
1011 array(
1012 'name' => 'pa_nav_menu_layout',
1013 'operator' => 'in',
1014 'value' => array( 'hor', 'ver' ),
1015 ),
1016 array(
1017 'name' => 'pa_mobile_menu_layout',
1018 'value' => 'slide',
1019 ),
1020 array(
1021 'name' => 'render_mobile_menu',
1022 'value' => 'yes',
1023 ),
1024 ),
1025 ),
1026 ),
1027 ),
1028 ),
1029 );
1030
1031 $this->add_control(
1032 'submenu_heading',
1033 array(
1034 'label' => __( 'Submenu Settings', 'premium-addons-for-elementor' ),
1035 'type' => Controls_Manager::HEADING,
1036 'separator' => 'before',
1037 )
1038 );
1039
1040 $this->add_control(
1041 'submenu_icon',
1042 array(
1043 'label' => __( 'Submenu Indicator Icon', 'premium-addons-for-elementor' ),
1044 'type' => Controls_Manager::ICONS,
1045 'default' => array(
1046 'value' => 'fas fa-angle-down',
1047 'library' => 'fa-solid',
1048 ),
1049 'recommended' => array(
1050 'fa-solid' => array(
1051 'chevron-down',
1052 'angle-down',
1053 'caret-down',
1054 'plus',
1055 ),
1056 ),
1057 'label_block' => false,
1058 'skin' => 'inline',
1059 'exclude_inline_options' => array( 'svg' ),
1060 'frontend_available' => true,
1061 )
1062 );
1063
1064 $this->add_control(
1065 'submenu_item_icon',
1066 array(
1067 'label' => __( 'Submenu Item Icon', 'premium-addons-for-elementor' ),
1068 'type' => Controls_Manager::ICONS,
1069 'recommended' => array(
1070 'fa-solid' => array(
1071 'chevron-down',
1072 'angle-down',
1073 'caret-down',
1074 'plus',
1075 ),
1076 ),
1077 'label_block' => false,
1078 'skin' => 'inline',
1079 'exclude_inline_options' => array( 'svg' ),
1080 'frontend_available' => true,
1081 'condition' => array(
1082 'menu_type' => 'wordpress_menu',
1083 ),
1084 )
1085 );
1086
1087 $default_pos = is_rtl() ? 'left' : 'right';
1088 $default_align = is_rtl() ? 'flex-end' : 'flex-start';
1089
1090 $this->add_responsive_control(
1091 'pa_nav_ver_submenu',
1092 array(
1093 'label' => __( 'Submenu Position', 'premium-addons-for-elementor' ),
1094 'type' => Controls_Manager::CHOOSE,
1095 'render_type' => 'template',
1096 'prefix_class' => 'premium-vertical-',
1097 'options' => array(
1098 'left' => array(
1099 'title' => __( 'Left', 'premium-addons-for-elementor' ),
1100 'icon' => 'eicon-h-align-left',
1101 ),
1102 'right' => array(
1103 'title' => __( 'Right', 'premium-addons-for-elementor' ),
1104 'icon' => 'eicon-h-align-right',
1105 ),
1106 ),
1107 'default' => $default_pos,
1108 'toggle' => false,
1109 'condition' => array(
1110 'pa_nav_menu_layout' => 'ver',
1111 ),
1112 )
1113 );
1114
1115 $this->add_responsive_control(
1116 'pa_sub_menu_align',
1117 array(
1118 'label' => __( 'Content Alignment', 'premium-addons-for-elementor' ),
1119 'type' => Controls_Manager::CHOOSE,
1120 'options' => array(
1121 'flex-start' => array(
1122 'title' => __( 'Left', 'premium-addons-for-elementor' ),
1123 'icon' => 'eicon-text-align-left',
1124 ),
1125 'center' => array(
1126 'title' => __( 'Center', 'premium-addons-for-elementor' ),
1127 'icon' => 'eicon-text-align-center',
1128 ),
1129 'flex-end' => array(
1130 'title' => __( 'Right', 'premium-addons-for-elementor' ),
1131 'icon' => 'eicon-text-align-right',
1132 ),
1133 ),
1134 'default' => $default_align,
1135 'toggle' => false,
1136 'selectors' => array(
1137 '{{WRAPPER}} .premium-sub-menu .premium-sub-menu-link' => 'justify-content: {{VALUE}}',
1138 ),
1139 )
1140 );
1141
1142 $this->add_control(
1143 'pa_submenu_alignment',
1144 array(
1145 'label' => __( 'Align Submenu to Top', 'premium-addons-for-elementor' ),
1146 'type' => Controls_Manager::SWITCHER,
1147 'prefix_class' => 'pa-align-',
1148 'return_value' => 'top',
1149 'condition' => array(
1150 'pa_nav_menu_layout' => 'ver',
1151 ),
1152 ),
1153 );
1154
1155 $this->add_control(
1156 'submenu_height',
1157 array(
1158 'label' => __( 'Full Height Submenu', 'premium-addons-for-elementor' ),
1159 'type' => Controls_Manager::SWITCHER,
1160 'default' => 'yes',
1161 'selectors' => array(
1162 '{{WRAPPER}}.pa-align-top .premium-sub-menu, {{WRAPPER}}.pa-align-top .premium-mega-content-container' => 'height: 100%; overflow-y: hidden;',
1163 ),
1164 'condition' => array(
1165 'pa_nav_menu_layout' => 'ver',
1166 'pa_submenu_alignment' => 'top',
1167 ),
1168 ),
1169 );
1170
1171 $this->add_control(
1172 'submenu_event',
1173 array(
1174 'label' => __( 'Open Submenu On', 'premium-addons-for-elementor' ),
1175 'type' => Controls_Manager::SELECT,
1176 'default' => 'hover',
1177 'render_type' => 'template',
1178 'options' => array(
1179 'hover' => __( 'Hover', 'premium-addons-for-elementor' ),
1180 'click' => __( 'Click', 'premium-addons-for-elementor' ),
1181 ),
1182 'condition' => array(
1183 'pa_nav_menu_layout' => array( 'hor', 'ver' ),
1184 ),
1185 )
1186 );
1187
1188 $this->add_control(
1189 'submenu_trigger',
1190 array(
1191 'label' => __( 'Submenu Trigger', 'premium-addons-for-elementor' ),
1192 'type' => Controls_Manager::SELECT,
1193 'description' => __( 'This option affects both the desktop and mobile submenus.', 'premium-addons-for-elementor' ),
1194 'options' => array(
1195 'item' => __( 'Submenu Item', 'premium-addons-for-elementor' ),
1196 'icon' => __( 'Submenu Dropdwon Icon', 'premium-addons-for-elementor' ),
1197 ),
1198 'default' => 'item',
1199 'render_type' => 'template',
1200 'separator' => 'before',
1201 'label_block' => true,
1202 'conditions' => array(
1203 'relation' => 'or',
1204 'terms' => array(
1205 array(
1206 'name' => 'pa_nav_menu_layout',
1207 'operator' => 'in',
1208 'value' => array( 'dropdown', 'slide' ),
1209 ),
1210 array(
1211 'relation' => 'and',
1212 'terms' => array(
1213 array(
1214 'name' => 'pa_nav_menu_layout',
1215 'operator' => 'in',
1216 'value' => array( 'hor', 'ver' ),
1217 ),
1218 array(
1219 'relation' => 'or',
1220 'terms' => array(
1221 array(
1222 'name' => 'submenu_event',
1223 'value' => 'click',
1224 ),
1225 array(
1226 'name' => 'render_mobile_menu',
1227 'value' => 'yes',
1228 ),
1229 ),
1230 ),
1231 ),
1232 ),
1233 ),
1234 ),
1235 )
1236 );
1237
1238 $this->add_control(
1239 'submenu_slide',
1240 array(
1241 'label' => __( 'Submenu Animation', 'premium-addons-for-elementor' ),
1242 'type' => Controls_Manager::SELECT,
1243 'prefix_class' => 'premium-nav-',
1244 'default' => 'none',
1245 'separator' => 'before',
1246 'options' => array(
1247 'none' => __( 'None', 'premium-addons-for-elementor' ),
1248 'slide-up' => __( 'Slide Up', 'premium-addons-for-elementor' ),
1249 'slide-down' => __( 'Slide Down', 'premium-addons-for-elementor' ),
1250 'slide-left' => __( 'Slide Left', 'premium-addons-for-elementor' ),
1251 'slide-right' => __( 'Slide Right', 'premium-addons-for-elementor' ),
1252 ),
1253 'condition' => array(
1254 'pa_nav_menu_layout' => array( 'hor', 'ver' ),
1255 ),
1256 )
1257 );
1258
1259 // sub-items badge hover.
1260 $this->add_control(
1261 'sub_badge_hv_effects',
1262 array(
1263 'label' => __( 'Badge Effects', 'premium-addons-for-elementor' ),
1264 'type' => Controls_Manager::SELECT,
1265 'render_type' => 'template',
1266 'default' => '',
1267 'options' => array(
1268 '' => __( 'None', 'premium-addons-for-elementor' ),
1269 'dot' => __( 'Grow', 'premium-addons-for-elementor' ),
1270 'expand' => __( 'Expand', 'premium-addons-for-elementor' ),
1271 'pulse' => __( 'Pulse', 'premium-addons-for-elementor' ),
1272 'buzz' => __( 'Buzz', 'premium-addons-for-elementor' ),
1273 'slide-right' => __( 'Slide Right', 'premium-addons-for-elementor' ),
1274 'slide-left' => __( 'Slide Left', 'premium-addons-for-elementor' ),
1275 ),
1276 )
1277 );
1278
1279 $this->add_responsive_control(
1280 'dot_size',
1281 array(
1282 'label' => __( 'Dot Size', 'premium-addons-for-elementor' ),
1283 'type' => Controls_Manager::SLIDER,
1284 'label_block' => true,
1285 'size_units' => array( 'px' ),
1286 'range' => array(
1287 'px' => array(
1288 'min' => 0,
1289 'max' => 10,
1290 ),
1291 ),
1292 'selectors' => array(
1293 '{{WRAPPER}} .premium-badge-dot .premium-sub-item-badge' => 'padding: {{SIZE}}{{UNIT}};',
1294 ),
1295 'condition' => array(
1296 'sub_badge_hv_effects' => 'dot',
1297 ),
1298 )
1299 );
1300
1301 // toggle menu settings.
1302 $this->add_control(
1303 'pa_toggle_heading',
1304 array(
1305 'label' => __( 'Mobile Menu Settings', 'premium-addons-for-elementor' ),
1306 'type' => Controls_Manager::HEADING,
1307 'separator' => 'before',
1308 'condition' => array(
1309 'pa_nav_menu_layout' => array( 'hor', 'ver' ),
1310 ),
1311 )
1312 );
1313
1314 $this->add_control(
1315 'render_mobile_menu',
1316 array(
1317 'label' => __( 'Render Mobile Menu', 'premium-addons-for-elementor' ),
1318 'type' => Controls_Manager::SWITCHER,
1319 'description' => __( 'Enable to render the mobile menu. This can be disabled if menu type will not be changed on different devices.', 'premium-addons-for-elementor' ),
1320 'default' => 'yes',
1321 'render_type' => 'template',
1322 'condition' => array(
1323 'pa_nav_menu_layout' => array( 'hor', 'ver' ),
1324 ),
1325 )
1326 );
1327
1328 $this->add_control(
1329 'pa_mobile_menu_layout',
1330 array(
1331 'label' => __( 'Layout', 'premium-addons-for-elementor' ),
1332 'type' => Controls_Manager::SELECT,
1333 'render_type' => 'template',
1334 'prefix_class' => 'premium-ham-',
1335 'options' => array(
1336 'dropdown' => 'Expand',
1337 'slide' => 'Slide',
1338 ),
1339 'default' => 'dropdown',
1340 'condition' => array(
1341 'render_mobile_menu' => 'yes',
1342 'pa_nav_menu_layout' => array( 'hor', 'ver' ),
1343 ),
1344 )
1345 );
1346
1347 $this->add_control(
1348 'pa_mobile_menu_breakpoint',
1349 array(
1350 'label' => __( 'Breakpoint', 'premium-addons-for-elementor' ),
1351 'type' => Controls_Manager::SELECT,
1352 'options' => array(
1353 '767' => __( 'Mobile (<768)', 'premium-addons-for-elementor' ),
1354 '1024' => __( 'Tablet (<1025)', 'premium-addons-for-elementor' ),
1355 'custom' => __( 'Custom', 'premium-addons-for-elementor' ),
1356 ),
1357 'default' => '1024',
1358 'condition' => array(
1359 'render_mobile_menu' => 'yes',
1360 'pa_nav_menu_layout' => array( 'hor', 'ver' ),
1361 ),
1362 )
1363 );
1364
1365 $this->add_control(
1366 'pa_custom_breakpoint',
1367 array(
1368 'label' => __( 'Custom Breakpoint (px)', 'premium-addons-for-elementor' ),
1369 'type' => Controls_Manager::NUMBER,
1370 'min' => 0,
1371 'max' => 2000,
1372 'step' => 5,
1373 'description' => 'Use this option to control when to turn your menu into a toggle menu, Default is 1025',
1374 'condition' => array(
1375 'pa_nav_menu_layout' => array( 'hor', 'ver' ),
1376 'pa_mobile_menu_breakpoint' => 'custom',
1377 ),
1378 )
1379 );
1380
1381 $this->end_controls_section();
1382
1383 $this->get_dropdown_content_settings( $align_left, $align_right );
1384 }
1385
1386 /**
1387 * Add random badges control controls.
1388 *
1389 * @access private
1390 * @since 4.9.34
1391 */
1392 private function add_random_badges_section() {
1393
1394 $this->start_controls_section(
1395 'premium_rn_badge_section',
1396 array(
1397 'label' => __( 'Random Badges', 'premium-addons-for-elementor' ),
1398 )
1399 );
1400
1401 $papro_activated = Helper_Functions::check_papro_version();
1402
1403 if ( $papro_activated ) {
1404 if ( version_compare( PREMIUM_PRO_ADDONS_VERSION, '2.8.9', '>' ) ) {
1405 do_action( 'pa_rn_badges_controls', $this );
1406
1407 } else {
1408 $this->add_control(
1409 'rn_badges_ver_notice',
1410 array(
1411 'type' => Controls_Manager::RAW_HTML,
1412 'raw' => __( 'Please update Premium Addons Pro version to 2.8.10 to use this option.', 'premium-addons-for-elementor' ),
1413 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
1414 )
1415 );
1416 }
1417 } else {
1418
1419 $get_pro = Helper_Functions::get_campaign_link( 'https://premiumaddons.com/pro', 'menu-widget', 'wp-editor', 'get-pro' );
1420
1421 $this->add_control(
1422 'rn_badges_notice',
1423 array(
1424 'type' => Controls_Manager::RAW_HTML,
1425 'raw' => __( 'Random Badges can be used in Premium Addons Pro.', 'premium-addons-for-elementor' ) . '<a href="' . esc_url( $get_pro ) . '" target="_blank">' . __( ' Upgrade now!', 'premium-addons-for-elementor' ) . '</a>',
1426 'content_classes' => 'papro-upgrade-notice',
1427 )
1428 );
1429 }
1430
1431 $this->end_controls_section();
1432 }
1433
1434 /**
1435 * Add Help & Docs Section
1436 *
1437 * @access private
1438 * @since 4.9.35
1439 */
1440 private function add_helpful_docs_section() {
1441
1442 $this->start_controls_section(
1443 'section_pa_docs',
1444 array(
1445 'label' => __( 'Help & Docs', 'premium-addons-for-elementor' ),
1446 )
1447 );
1448
1449 $docs = array(
1450 'https://premiumaddons.com/docs/elementor-mega-menu-widget-tutorial' => __( 'Getting started »', 'premium-addons-for-elementor' ),
1451 'https://premiumaddons.com/docs/elementor-mega-menu-widget-tutorial/#random-badges' => __( 'How to add random badges in Mega Menu widget »', 'premium-addons-for-elementor' ),
1452 );
1453
1454 $doc_index = 1;
1455 foreach ( $docs as $url => $title ) {
1456
1457 $doc_url = Helper_Functions::get_campaign_link( $url, 'menu-widget', 'wp-editor', 'get-support' );
1458
1459 $this->add_control(
1460 'doc_' . $doc_index,
1461 array(
1462 'type' => Controls_Manager::RAW_HTML,
1463 'raw' => sprintf( '<a href="%s" target="_blank">%s</a>', $doc_url, $title ),
1464 'content_classes' => 'editor-pa-doc',
1465 )
1466 );
1467
1468 ++$doc_index;
1469
1470 }
1471
1472 Helper_Functions::register_element_feedback_controls( $this );
1473
1474 $this->end_controls_section();
1475 }
1476
1477 /**
1478 * Get sticky style options.
1479 *
1480 * @access private
1481 * @since 4.9.15
1482 */
1483 private function get_sticky_style() {
1484
1485 $this->start_controls_section(
1486 'pa_sticky_style_sec',
1487 array(
1488 'label' => __( 'Sticky Menu Style', 'premium-addons-for-elementor' ),
1489 'tab' => Controls_Manager::TAB_STYLE,
1490 'condition' => array(
1491 'pa_sticky_switcher' => 'yes',
1492 'pa_nav_menu_layout' => 'hor',
1493 ),
1494 )
1495 );
1496
1497 $this->add_group_control(
1498 Group_Control_Box_Shadow::get_type(),
1499 array(
1500 'name' => 'pa_sticky_shadow',
1501 'label' => __( 'Shadow', 'premium-addons-for-elementor' ),
1502 'fields_options' => array(
1503 'box_shadow' => array(
1504 'selectors' => array(
1505 '.premium-sticky-parent-{{ID}}' => 'box-shadow: {{HORIZONTAL}}px {{VERTICAL}}px {{BLUR}}px {{SPREAD}}px {{COLOR}} {{box_shadow_position.VALUE}} !important;',
1506 ),
1507 ),
1508 ),
1509 )
1510 );
1511
1512 $this->add_group_control(
1513 Premium_Background::get_type(),
1514 array(
1515 'name' => 'pa_sticky_bg',
1516 'types' => array( 'classic', 'gradient' ),
1517 'selector' => '.premium-sticky-parent-{{ID}}',
1518 )
1519 );
1520
1521 $this->add_group_control(
1522 Group_Control_Border::get_type(),
1523 array(
1524 'name' => 'pa_sticky_border',
1525 'selector' => '.premium-sticky-parent-{{ID}}',
1526 )
1527 );
1528
1529 $this->add_responsive_control(
1530 'pa_sticky_padding',
1531 array(
1532 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
1533 'type' => Controls_Manager::DIMENSIONS,
1534 'size_units' => array( 'px', 'em', '%' ),
1535 'selectors' => array(
1536 '.premium-sticky-parent-{{ID}}' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1537 ),
1538 )
1539 );
1540
1541 $this->end_controls_section();
1542 }
1543
1544 /**
1545 * Get sticky option settings.
1546 *
1547 * @access private
1548 * @since 4.9.15
1549 */
1550 private function get_sticky_option_settings() {
1551
1552 $this->add_control(
1553 'pa_sticky_switcher',
1554 array(
1555 'label' => __( 'Enable Sticky Menu', 'premium-addons-for-elementor' ),
1556 'type' => Controls_Manager::SWITCHER,
1557 'frontend_available' => true,
1558 'separator' => 'before',
1559 'render_type' => 'template',
1560 'prefix_class' => 'premium-nav-sticky-',
1561 'condition' => array(
1562 'pa_nav_menu_layout' => 'hor',
1563 ),
1564 )
1565 );
1566
1567 $this->add_control(
1568 'pa_sticky_target',
1569 array(
1570 'label' => __( 'Sticky Target ID', 'premium-addons-for-elementor' ),
1571 'type' => Controls_Manager::TEXT,
1572 'frontend_available' => true,
1573 'render_type' => 'template',
1574 'placeholder' => 'sticky-target',
1575 'description' => __( 'The target id to apply sticky effect on ( without the "#" ).', 'premium-addons-for-elementor' ),
1576 'condition' => array(
1577 'pa_nav_menu_layout' => 'hor',
1578 'pa_sticky_switcher' => 'yes',
1579 ),
1580 'ai' => array(
1581 'active' => false,
1582 ),
1583 )
1584 );
1585
1586 $this->add_control(
1587 'pa_sticky_on_scroll',
1588 array(
1589 'label' => __( 'Sticky on Scroll Up', 'premium-addons-for-elementor' ),
1590 'type' => Controls_Manager::SWITCHER,
1591 'frontend_available' => true,
1592 'render_type' => 'template',
1593 'condition' => array(
1594 'pa_nav_menu_layout' => 'hor',
1595 'pa_sticky_switcher' => 'yes',
1596 ),
1597 )
1598 );
1599
1600 $this->add_control(
1601 'pa_sticky_disabled_on',
1602 array(
1603 'label' => __( 'Disable On', 'premium-addons-for-elementor' ),
1604 'type' => Controls_Manager::SELECT2,
1605 'frontend_available' => true,
1606 'options' => Helper_Functions::get_all_breakpoints(),
1607 'multiple' => true,
1608 'label_block' => true,
1609 'render_type' => 'template',
1610 'default' => array( 'tablet', 'mobile' ),
1611 'condition' => array(
1612 'pa_nav_menu_layout' => 'hor',
1613 'pa_sticky_switcher' => 'yes',
1614 ),
1615 )
1616 );
1617 }
1618
1619 /**
1620 * Get vertical toggle settings.
1621 *
1622 * @access private
1623 * @since 4.9.15
1624 */
1625 private function get_vertical_toggle_settings() {
1626
1627 $this->add_control(
1628 'pa_ver_toggle_switcher',
1629 array(
1630 'label' => __( 'Enable Collapsed Menu', 'premium-addons-for-elementor' ),
1631 'type' => Controls_Manager::SWITCHER,
1632 'separator' => 'before',
1633 'render_type' => 'template',
1634 'prefix_class' => 'premium-ver-toggle-',
1635 'condition' => array(
1636 'pa_nav_menu_layout' => 'ver',
1637 ),
1638 )
1639 );
1640
1641 $this->add_control(
1642 'pa_ver_toggle_txt',
1643 array(
1644 'label' => __( 'Title', 'premium-addons-for-elementor' ),
1645 'type' => Controls_Manager::TEXT,
1646 'default' => __( 'Premium Menu', 'premium-addons-for-elementor' ),
1647 'condition' => array(
1648 'pa_nav_menu_layout' => 'ver',
1649 'pa_ver_toggle_switcher' => 'yes',
1650 ),
1651 )
1652 );
1653
1654 $this->add_control(
1655 'pa_ver_toggle_event',
1656 array(
1657 'label' => __( 'Open On', 'premium-addons-for-elementor' ),
1658 'type' => Controls_Manager::SELECT,
1659 'default' => 'click',
1660 'render_type' => 'template',
1661 'prefix_class' => 'premium-ver-',
1662 'options' => array(
1663 'hover' => __( 'Hover', 'premium-addons-for-elementor' ),
1664 'click' => __( 'Click', 'premium-addons-for-elementor' ),
1665 'always' => __( 'Always', 'premium-addons-for-elementor' ),
1666 ),
1667 'condition' => array(
1668 'pa_nav_menu_layout' => 'ver',
1669 'pa_ver_toggle_switcher' => 'yes',
1670 ),
1671 )
1672 );
1673
1674 $this->add_control(
1675 'pa_ver_toggle_open',
1676 array(
1677 'label' => __( 'Opened By Default', 'premium-addons-for-elementor' ),
1678 'type' => Controls_Manager::SWITCHER,
1679 'render_type' => 'template',
1680 'condition' => array(
1681 'pa_nav_menu_layout' => 'ver',
1682 'pa_ver_toggle_switcher' => 'yes',
1683 'pa_ver_toggle_event' => 'click',
1684 ),
1685 )
1686 );
1687
1688 $this->add_control(
1689 'pa_ver_toggle_main_icon',
1690 array(
1691 'label' => __( 'Title Icon', 'premium-addons-for-elementor' ),
1692 'type' => Controls_Manager::ICONS,
1693 'label_block' => false,
1694 'skin' => 'inline',
1695 'default' => array(
1696 'value' => 'fas fa-bars',
1697 'library' => 'solid',
1698 ),
1699 'condition' => array(
1700 'pa_nav_menu_layout' => 'ver',
1701 'pa_ver_toggle_switcher' => 'yes',
1702 ),
1703 )
1704 );
1705
1706 $this->add_control(
1707 'pa_ver_toggle_toggle_icon',
1708 array(
1709 'label' => __( 'Toggle Icon', 'premium-addons-for-elementor' ),
1710 'type' => Controls_Manager::ICONS,
1711 'label_block' => false,
1712 'skin' => 'inline',
1713 'default' => array(
1714 'value' => 'fas fa-angle-down',
1715 'library' => 'solid',
1716 ),
1717 'condition' => array(
1718 'pa_nav_menu_layout' => 'ver',
1719 'pa_ver_toggle_switcher' => 'yes',
1720 ),
1721 )
1722 );
1723
1724 $this->add_control(
1725 'pa_ver_toggle_close_icon',
1726 array(
1727 'label' => __( 'Close Icon', 'premium-addons-for-elementor' ),
1728 'type' => Controls_Manager::ICONS,
1729 'label_block' => false,
1730 'skin' => 'inline',
1731 'default' => array(
1732 'value' => 'fas fa-angle-up',
1733 'library' => 'solid',
1734 ),
1735 'condition' => array(
1736 'pa_nav_menu_layout' => 'ver',
1737 'pa_ver_toggle_switcher' => 'yes',
1738 'pa_ver_toggle_event!' => 'always',
1739 ),
1740 )
1741 );
1742
1743 $this->add_control(
1744 'premium_ver_spacing',
1745 array(
1746 'label' => __( 'Title Spacing', 'premium-addons-for-elementor' ),
1747 'type' => Controls_Manager::SLIDER,
1748 'label_block' => true,
1749 'size_units' => array( 'px', 'em' ),
1750 'description' => __( 'Use this option to control the spacing between the title icon and the title.', 'premium-addons-for-elementor' ),
1751 'selectors' => array(
1752 '{{WRAPPER}} .premium-ver-toggler-txt' => 'text-indent: {{SIZE}}{{UNIT}};',
1753 ),
1754 'condition' => array(
1755 'pa_nav_menu_layout' => 'ver',
1756 'pa_ver_toggle_switcher' => 'yes',
1757 ),
1758 )
1759 );
1760 }
1761
1762 /**
1763 * Get dropdown content settings.
1764 *
1765 * @access private
1766 * @since 4.9.15
1767 *
1768 * @param string $align_left align-left val.
1769 * @param string $align_right align-right val.
1770 */
1771 private function get_dropdown_content_settings( $align_left, $align_right ) {
1772
1773 $this->start_controls_section(
1774 'premium_dropdown_section',
1775 array(
1776 'label' => __( 'Expand/Slide Menu Settings', 'premium-addons-for-elementor' ),
1777 'conditions' => array(
1778 'relation' => 'or',
1779 'terms' => array(
1780 array(
1781 'name' => 'pa_nav_menu_layout',
1782 'operator' => 'in',
1783 'value' => array( 'dropdown', 'slide' ),
1784 ),
1785 array(
1786 'relation' => 'and',
1787 'terms' => array(
1788 array(
1789 'name' => 'pa_nav_menu_layout',
1790 'operator' => 'in',
1791 'value' => array( 'hor', 'ver' ),
1792 ),
1793 array(
1794 'name' => 'render_mobile_menu',
1795 'value' => 'yes',
1796 ),
1797 ),
1798 ),
1799 ),
1800 ),
1801 ),
1802 );
1803
1804 $this->add_control(
1805 'btn_toggle_heading',
1806 array(
1807 'label' => __( 'Toggle Button', 'premium-addons-for-elementor' ),
1808 'type' => Controls_Manager::HEADING,
1809 )
1810 );
1811
1812 $this->add_control(
1813 'pa_mobile_toggle_text',
1814 array(
1815 'label' => __( 'Text', 'premium-addons-for-elementor' ),
1816 'type' => Controls_Manager::TEXT,
1817 'default' => __( 'Menu', 'premium-addons-for-elementor' ),
1818 )
1819 );
1820
1821 $this->add_control(
1822 'pa_mobile_toggle_close',
1823 array(
1824 'label' => __( 'Close Text', 'premium-addons-for-elementor' ),
1825 'type' => Controls_Manager::TEXT,
1826 'default' => __( 'Close', 'premium-addons-for-elementor' ),
1827 )
1828 );
1829
1830 $this->add_control(
1831 'pa_mobile_toggle_icon',
1832 array(
1833 'label' => __( 'Icon', 'premium-addons-for-elementor' ),
1834 'type' => Controls_Manager::ICONS,
1835 'label_block' => false,
1836 'skin' => 'inline',
1837 'default' => array(
1838 'value' => 'fas fa-bars',
1839 'library' => 'solid',
1840 ),
1841 )
1842 );
1843
1844 $this->add_control(
1845 'pa_mobile_close_icon',
1846 array(
1847 'label' => __( 'Close Icon', 'premium-addons-for-elementor' ),
1848 'type' => Controls_Manager::ICONS,
1849 'label_block' => false,
1850 'skin' => 'inline',
1851 'default' => array(
1852 'value' => 'fas fa-times',
1853 'library' => 'solid',
1854 ),
1855 )
1856 );
1857
1858 $this->add_responsive_control(
1859 'pa_mobile_toggle_pos',
1860 array(
1861 'label' => __( 'Button Position', 'premium-addons-for-elementor' ),
1862 'type' => Controls_Manager::CHOOSE,
1863 'options' => array(
1864 $align_left => array(
1865 'title' => __( 'Left', 'premium-addons-for-elementor' ),
1866 'icon' => 'eicon-h-align-left',
1867 ),
1868 'center' => array(
1869 'title' => __( 'Center', 'premium-addons-for-elementor' ),
1870 'icon' => 'eicon-h-align-center',
1871 ),
1872 $align_right => array(
1873 'title' => __( 'Right', 'premium-addons-for-elementor' ),
1874 'icon' => 'eicon-h-align-right',
1875 ),
1876 ),
1877 'default' => 'center',
1878 'toggle' => false,
1879 'selectors' => array(
1880 '{{WRAPPER}} .premium-hamburger-toggle' => 'justify-content: {{VALUE}}',
1881 ),
1882 )
1883 );
1884
1885 $this->add_control(
1886 'pa_mobile_menu_pos',
1887 array(
1888 'label' => __( 'Menu Position', 'premium-addons-for-elementor' ),
1889 'type' => Controls_Manager::CHOOSE,
1890 'separator' => 'before',
1891 'options' => array(
1892 'left' => array(
1893 'title' => __( 'Left', 'premium-addons-for-elementor' ),
1894 'icon' => 'eicon-h-align-left',
1895 ),
1896 'center' => array(
1897 'title' => __( 'Center', 'premium-addons-for-elementor' ),
1898 'icon' => 'eicon-h-align-center',
1899 ),
1900 'right' => array(
1901 'title' => __( 'Right', 'premium-addons-for-elementor' ),
1902 'icon' => 'eicon-h-align-right',
1903 ),
1904 ),
1905 'default' => 'right',
1906 'toggle' => false,
1907 'selectors' => array(
1908 '{{WRAPPER}}.premium-ham-dropdown .premium-mobile-menu-container, {{WRAPPER}}.premium-nav-dropdown .premium-mobile-menu-container' => 'justify-content: {{VALUE}}',
1909 ),
1910 'conditions' => array(
1911 'relation' => 'or',
1912 'terms' => array(
1913 array(
1914 'name' => 'pa_nav_menu_layout',
1915 'value' => 'dropdown',
1916 ),
1917 array(
1918 'relation' => 'and',
1919 'terms' => array(
1920 array(
1921 'name' => 'pa_mobile_menu_layout',
1922 'value' => 'dropdown',
1923 ),
1924 array(
1925 'name' => 'pa_nav_menu_layout',
1926 'operator' => 'in',
1927 'value' => array( 'hor', 'ver' ),
1928 ),
1929 ),
1930 ),
1931 ),
1932 ),
1933 )
1934 );
1935
1936 $this->add_control(
1937 'pa_mobile_menu_align',
1938 array(
1939 'label' => __( 'Menu Alignment', 'premium-addons-for-elementor' ),
1940 'type' => Controls_Manager::CHOOSE,
1941 'options' => array(
1942 $align_left => array(
1943 'title' => __( 'Left', 'premium-addons-for-elementor' ),
1944 'icon' => 'eicon-text-align-left',
1945 ),
1946 'center' => array(
1947 'title' => __( 'Center', 'premium-addons-for-elementor' ),
1948 'icon' => 'eicon-text-align-center',
1949 ),
1950 $align_right => array(
1951 'title' => __( 'Right', 'premium-addons-for-elementor' ),
1952 'icon' => 'eicon-text-align-right',
1953 ),
1954 ),
1955 'default' => 'flex-start',
1956 'toggle' => false,
1957 'selectors' => array(
1958 '{{WRAPPER}}.premium-hamburger-menu .premium-main-mobile-menu > .premium-nav-menu-item > .premium-menu-link, {{WRAPPER}}.premium-nav-dropdown .premium-main-mobile-menu > .premium-nav-menu-item > .premium-menu-link, {{WRAPPER}}.premium-nav-slide .premium-main-mobile-menu > .premium-nav-menu-item > .premium-menu-link' => 'justify-content: {{VALUE}}',
1959 ),
1960 )
1961 );
1962
1963 $transform_sign = is_rtl() ? '' : '-';
1964
1965 $this->add_responsive_control(
1966 'pa_ham_menu_width',
1967 array(
1968 'label' => __( 'Menu Width', 'premium-addons-for-elementor' ),
1969 'type' => Controls_Manager::SLIDER,
1970 'separator' => 'before',
1971 'label_block' => true,
1972 'size_units' => array( 'px', 'vw' ),
1973 'range' => array(
1974 'px' => array(
1975 'min' => 0,
1976 'max' => 1000,
1977 ),
1978 ),
1979 'selectors' => array(
1980 '{{WRAPPER}} .premium-nav-widget-container ' => '--pa-menu-width: {{SIZE}}{{UNIT}};',
1981 '{{WRAPPER}}.premium-ham-dropdown .premium-main-mobile-menu, {{WRAPPER}}.premium-nav-dropdown .premium-main-mobile-menu' => 'width: {{SIZE}}{{UNIT}};',
1982 ),
1983 'condition' => array(
1984 'pa_toggle_full!' => 'yes',
1985 ),
1986 )
1987 );
1988
1989 $this->add_responsive_control(
1990 'pa_toggle_menu_height',
1991 array(
1992 'label' => __( 'Menu Max Height', 'premium-addons-for-elementor' ),
1993 'type' => Controls_Manager::SLIDER,
1994 'separator' => 'before',
1995 'label_block' => true,
1996 'size_units' => array( 'px', 'vh', 'custom' ),
1997 'range' => array(
1998 'px' => array(
1999 'min' => 0,
2000 'max' => 1000,
2001 ),
2002 ),
2003 'selectors' => array(
2004 '{{WRAPPER}}.premium-nav-sticky-yes.premium-sticky-active.premium-ham-dropdown .premium-mobile-menu-container,
2005 {{WRAPPER}}.premium-ham-dropdown .premium-stretch-dropdown .premium-mobile-menu-container' => 'max-height: {{SIZE}}{{UNIT}};',
2006 ),
2007 'conditions' => array(
2008 'terms' => array(
2009 array(
2010 'name' => 'pa_toggle_full',
2011 'operator' => '===',
2012 'value' => 'yes',
2013 ),
2014 array(
2015 'relation' => 'or',
2016 'terms' => array(
2017 array(
2018 'name' => 'pa_nav_menu_layout',
2019 'value' => 'dropdown',
2020 ),
2021 array(
2022 'relation' => 'and',
2023 'terms' => array(
2024 array(
2025 'name' => 'pa_mobile_menu_layout',
2026 'value' => 'dropdown',
2027 ),
2028 array(
2029 'name' => 'pa_nav_menu_layout',
2030 'operator' => 'in',
2031 'value' => array( 'hor', 'ver' ),
2032 ),
2033 ),
2034 ),
2035 ),
2036 ),
2037 ),
2038 ),
2039 )
2040 );
2041
2042 $this->add_control(
2043 'pa_toggle_full',
2044 array(
2045 'label' => __( 'Full Width', 'premium-addons-for-elementor' ),
2046 'type' => Controls_Manager::SWITCHER,
2047 'render_type' => 'template',
2048 'conditions' => array(
2049 'relation' => 'or',
2050 'terms' => array(
2051 array(
2052 'name' => 'pa_nav_menu_layout',
2053 'value' => 'dropdown',
2054 ),
2055 array(
2056 'relation' => 'and',
2057 'terms' => array(
2058 array(
2059 'name' => 'pa_mobile_menu_layout',
2060 'value' => 'dropdown',
2061 ),
2062 array(
2063 'name' => 'pa_nav_menu_layout',
2064 'operator' => 'in',
2065 'value' => array( 'hor', 'ver' ),
2066 ),
2067 ),
2068 ),
2069 ),
2070 ),
2071 )
2072 );
2073
2074 $this->add_control(
2075 'pa_mobile_hide_icon',
2076 array(
2077 'label' => __( 'Hide Items Icon', 'premium-addons-for-elementor' ),
2078 'type' => Controls_Manager::SWITCHER,
2079 'prefix_class' => 'premium-hidden-icon-',
2080 )
2081 );
2082
2083 $this->add_control(
2084 'pa_mobile_hide_badge',
2085 array(
2086 'label' => __( 'Hide Items Badge', 'premium-addons-for-elementor' ),
2087 'type' => Controls_Manager::SWITCHER,
2088 'prefix_class' => 'premium-hidden-badge-',
2089 )
2090 );
2091
2092 $this->add_control(
2093 'close_after_click',
2094 array(
2095 'label' => __( 'Close Menu After Click', 'premium-addons-for-elementor' ),
2096 'type' => Controls_Manager::SWITCHER,
2097 'render_type' => 'template',
2098 )
2099 );
2100
2101 $this->add_control(
2102 'pa_disable_page_scroll',
2103 array(
2104 'label' => __( 'Disable Page Scroll', 'premium-addons-for-elementor' ),
2105 'type' => Controls_Manager::SWITCHER,
2106 'prefix_class' => 'premium-disable-scroll-',
2107 'description' => __( 'Enable this option to disable page scroll when the slide menu is opened', 'premium-addons-for-elementor' ),
2108 'render_type' => 'template',
2109 'conditions' => array(
2110 'relation' => 'or',
2111 'terms' => array(
2112 array(
2113 'name' => 'pa_nav_menu_layout',
2114 'operator' => '===',
2115 'value' => 'slide',
2116 ),
2117 array(
2118 'name' => 'pa_mobile_menu_layout',
2119 'operator' => '===',
2120 'value' => 'slide',
2121 ),
2122 ),
2123 ),
2124 )
2125 );
2126
2127 $this->end_controls_section();
2128 }
2129
2130 /**
2131 * Get Vertical toggler style.
2132 *
2133 * @access private
2134 * @since 4.9.15
2135 */
2136 private function get_ver_toggler_style() {
2137
2138 $this->start_controls_section(
2139 'pa_ver_toggler_style_section',
2140 array(
2141 'label' => __( 'Collapsed Menu Style', 'premium-addons-for-elementor' ),
2142 'tab' => Controls_Manager::TAB_STYLE,
2143 'condition' => array(
2144 'pa_ver_toggle_switcher' => 'yes',
2145 'pa_nav_menu_layout' => 'ver',
2146 ),
2147 )
2148 );
2149
2150 $this->add_control(
2151 'pa_ver_title_heading',
2152 array(
2153 'label' => __( 'Title', 'premium-addons-for-elementor' ),
2154 'type' => Controls_Manager::HEADING,
2155 )
2156 );
2157
2158 $this->add_group_control(
2159 Group_Control_Typography::get_type(),
2160 array(
2161 'name' => 'pa_ver_title_typo',
2162 'selector' => '{{WRAPPER}} .premium-ver-toggler-txt',
2163 )
2164 );
2165
2166 $this->add_control(
2167 'pa_ver_title_icon_size',
2168 array(
2169 'label' => __( 'Icon Size', 'premium-addons-for-elementor' ),
2170 'type' => Controls_Manager::SLIDER,
2171 'size_units' => array( 'px' ),
2172 'selectors' => array(
2173 '{{WRAPPER}} .premium-ver-title-icon i' => 'font-size: {{SIZE}}{{UNIT}};',
2174 '{{WRAPPER}} .premium-ver-title-icon svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}',
2175 ),
2176 'condition' => array(
2177 'pa_ver_toggle_main_icon[value]!' => '',
2178 ),
2179 )
2180 );
2181
2182 $this->start_controls_tabs( 'pa_ver_title_tabs' );
2183
2184 $this->start_controls_tab(
2185 'pa_ver_title_tab_normal',
2186 array(
2187 'label' => __( 'Normal', 'premium-addons-for-elementor' ),
2188 )
2189 );
2190
2191 $this->add_control(
2192 'pa_ver_title_color',
2193 array(
2194 'label' => __( 'Color', 'premium-addons-for-elementor' ),
2195 'type' => Controls_Manager::COLOR,
2196 'selectors' => array(
2197 '{{WRAPPER}} .premium-ver-toggler-txt' => 'color: {{VALUE}};',
2198 ),
2199 )
2200 );
2201
2202 $this->add_control(
2203 'pa_ver_title_icon_color',
2204 array(
2205 'label' => __( 'Icon Color', 'premium-addons-for-elementor' ),
2206 'type' => Controls_Manager::COLOR,
2207 'selectors' => array(
2208 '{{WRAPPER}} .premium-ver-title-icon i' => 'color: {{VALUE}};',
2209 '{{WRAPPER}} .premium-ver-title-icon svg, {{WRAPPER}} .premium-ver-title-icon svg path' => 'fill: {{VALUE}};',
2210 ),
2211 'condition' => array(
2212 'pa_ver_toggle_main_icon[value]!' => '',
2213 ),
2214 )
2215 );
2216
2217 $this->end_controls_tab();
2218
2219 $this->start_controls_tab(
2220 'pa_ver_title_tab_hov',
2221 array(
2222 'label' => __( 'Hover', 'premium-addons-for-elementor' ),
2223 )
2224 );
2225
2226 $this->add_control(
2227 'pa_ver_title_color_hov',
2228 array(
2229 'label' => __( 'Color', 'premium-addons-for-elementor' ),
2230 'type' => Controls_Manager::COLOR,
2231 'selectors' => array(
2232 '{{WRAPPER}} .premium-ver-toggler:hover .premium-ver-toggler-txt' => 'color: {{VALUE}};',
2233 ),
2234 )
2235 );
2236
2237 $this->add_control(
2238 'pa_ver_title_icon_color_hov',
2239 array(
2240 'label' => __( 'Icon Color', 'premium-addons-for-elementor' ),
2241 'type' => Controls_Manager::COLOR,
2242 'selectors' => array(
2243 '{{WRAPPER}} .premium-ver-toggler:hover .premium-ver-title-icon i' => 'color: {{VALUE}};',
2244 '{{WRAPPER}} .premium-ver-toggler:hover .premium-ver-title-icon svg, {{WRAPPER}} .premium-ver-toggler:hover .premium-ver-title-icon svg path' => 'fill: {{VALUE}};',
2245 ),
2246 'condition' => array(
2247 'pa_ver_toggle_main_icon[value]!' => '',
2248 ),
2249 )
2250 );
2251
2252 $this->end_controls_tab();
2253
2254 $this->end_controls_tabs();
2255
2256 $this->add_control(
2257 'pa_ver_toggle_heading',
2258 array(
2259 'label' => __( 'Toggle Icon', 'premium-addons-for-elementor' ),
2260 'type' => Controls_Manager::HEADING,
2261 'separator' => 'before',
2262 'conditions' => array(
2263 'relation' => 'or',
2264 'terms' => array(
2265 array(
2266 'name' => 'pa_ver_toggle_toggle_icon[value]',
2267 'operator' => '!==',
2268 'value' => '',
2269 ),
2270 array(
2271 'name' => 'pa_ver_toggle_close_icon[value]',
2272 'operator' => '!==',
2273 'value' => '',
2274 ),
2275 ),
2276 ),
2277 )
2278 );
2279
2280 $this->add_control(
2281 'pa_ver_toggle_icon_size',
2282 array(
2283 'label' => __( 'Size', 'premium-addons-for-elementor' ),
2284 'type' => Controls_Manager::SLIDER,
2285 'size_units' => array( 'px' ),
2286 'selectors' => array(
2287 '{{WRAPPER}} .premium-ver-toggler-btn i' => 'font-size: {{SIZE}}{{UNIT}};',
2288 '{{WRAPPER}} .premium-ver-toggler-btn svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}',
2289 ),
2290 'conditions' => array(
2291 'relation' => 'or',
2292 'terms' => array(
2293 array(
2294 'name' => 'pa_ver_toggle_toggle_icon[value]',
2295 'operator' => '!==',
2296 'value' => '',
2297 ),
2298 array(
2299 'name' => 'pa_ver_toggle_close_icon[value]',
2300 'operator' => '!==',
2301 'value' => '',
2302 ),
2303 ),
2304 ),
2305 )
2306 );
2307
2308 $this->start_controls_tabs( 'pa_ver_toggle_icon_tabs' );
2309
2310 $this->start_controls_tab(
2311 'pa_ver_toggle_tab_normal',
2312 array(
2313 'label' => __( 'Normal', 'premium-addons-for-elementor' ),
2314 'conditions' => array(
2315 'relation' => 'or',
2316 'terms' => array(
2317 array(
2318 'name' => 'pa_ver_toggle_toggle_icon[value]',
2319 'operator' => '!==',
2320 'value' => '',
2321 ),
2322 array(
2323 'name' => 'pa_ver_toggle_close_icon[value]',
2324 'operator' => '!==',
2325 'value' => '',
2326 ),
2327 ),
2328 ),
2329 )
2330 );
2331
2332 $this->add_control(
2333 'pa_ver_toggle_icon_color',
2334 array(
2335 'label' => __( 'Color', 'premium-addons-for-elementor' ),
2336 'type' => Controls_Manager::COLOR,
2337 'selectors' => array(
2338 '{{WRAPPER}} .premium-ver-toggler-btn i' => 'color: {{VALUE}};',
2339 '{{WRAPPER}} .premium-ver-toggler-btn svg, {{WRAPPER}} .premium-ver-toggler-btn svg path' => 'fill: {{VALUE}};',
2340 ),
2341 )
2342 );
2343
2344 $this->end_controls_tab();
2345
2346 $this->start_controls_tab(
2347 'pa_ver_toggle_tab_hov',
2348 array(
2349 'label' => __( 'Hover', 'premium-addons-for-elementor' ),
2350 'conditions' => array(
2351 'relation' => 'or',
2352 'terms' => array(
2353 array(
2354 'name' => 'pa_ver_toggle_toggle_icon[value]',
2355 'operator' => '!==',
2356 'value' => '',
2357 ),
2358 array(
2359 'name' => 'pa_ver_toggle_close_icon[value]',
2360 'operator' => '!==',
2361 'value' => '',
2362 ),
2363 ),
2364 ),
2365 )
2366 );
2367
2368 $this->add_control(
2369 'pa_ver_toggle_icon_color_hov',
2370 array(
2371 'label' => __( 'Color', 'premium-addons-for-elementor' ),
2372 'type' => Controls_Manager::COLOR,
2373 'selectors' => array(
2374 '{{WRAPPER}} .premium-ver-toggler:hover .premium-ver-toggler-btn i' => 'color: {{VALUE}};',
2375 '{{WRAPPER}} .premium-ver-toggler:hover .premium-ver-toggler-btn svg,
2376 {{WRAPPER}} .premium-ver-toggler:hover .premium-ver-toggler-btn svg path' => 'fill: {{VALUE}};',
2377 ),
2378 )
2379 );
2380
2381 $this->end_controls_tab();
2382
2383 $this->end_controls_tabs();
2384
2385 $this->add_control(
2386 'pa_ver_container_heading',
2387 array(
2388 'label' => __( 'Container', 'premium-addons-for-elementor' ),
2389 'type' => Controls_Manager::HEADING,
2390 'separator' => 'before',
2391 )
2392 );
2393
2394 $this->start_controls_tabs( 'pa_ver_toggler_tabs' );
2395
2396 $this->start_controls_tab(
2397 'pa_ver_toggler_tab_normal',
2398 array(
2399 'label' => __( 'Normal', 'premium-addons-for-elementor' ),
2400 )
2401 );
2402
2403 $this->add_group_control(
2404 Premium_Background::get_type(),
2405 array(
2406 'name' => 'pa_ver_toggler_bg',
2407 'types' => array( 'classic', 'gradient' ),
2408 'selector' => '{{WRAPPER}} .premium-ver-toggler',
2409 )
2410 );
2411
2412 $this->add_group_control(
2413 Group_Control_Box_Shadow::get_type(),
2414 array(
2415 'name' => 'pa_ver_toggler_shadow',
2416 'selector' => '{{WRAPPER}} .premium-ver-toggler',
2417 )
2418 );
2419
2420 $this->end_controls_tab();
2421
2422 $this->start_controls_tab(
2423 'pa_ver_toggler_tab_hov',
2424 array(
2425 'label' => __( 'Hover', 'premium-addons-for-elementor' ),
2426 )
2427 );
2428
2429 $this->add_group_control(
2430 Premium_Background::get_type(),
2431 array(
2432 'name' => 'pa_ver_toggler_bg_hov',
2433 'types' => array( 'classic', 'gradient' ),
2434 'selector' => '{{WRAPPER}} .premium-ver-toggler:hover',
2435 )
2436 );
2437
2438 $this->add_group_control(
2439 Group_Control_Box_Shadow::get_type(),
2440 array(
2441 'name' => 'pa_ver_toggler_shadow_hov',
2442 'selector' => '{{WRAPPER}} .premium-ver-toggler:hover',
2443 )
2444 );
2445
2446 $this->end_controls_tab();
2447
2448 $this->end_controls_tabs();
2449
2450 $this->add_group_control(
2451 Group_Control_Border::get_type(),
2452 array(
2453 'name' => 'pa_ver_toggler_border',
2454 'selector' => '{{WRAPPER}} .premium-ver-toggler',
2455 'separator' => 'before',
2456 )
2457 );
2458
2459 $this->add_control(
2460 'pa_ver_toggler_rad',
2461 array(
2462 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
2463 'type' => Controls_Manager::DIMENSIONS,
2464 'size_units' => array( 'px', 'em', '%' ),
2465 'selectors' => array(
2466 '{{WRAPPER}} .premium-ver-toggler' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
2467 ),
2468 )
2469 );
2470
2471 $this->add_responsive_control(
2472 'pa_ver_toggler_padding',
2473 array(
2474 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
2475 'type' => Controls_Manager::DIMENSIONS,
2476 'size_units' => array( 'px', 'em', '%' ),
2477 'selectors' => array(
2478 '{{WRAPPER}} .premium-ver-toggler' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2479 ),
2480 )
2481 );
2482
2483 $this->end_controls_section();
2484 }
2485
2486 /**
2487 * Get menu container style.
2488 *
2489 * @access private
2490 * @since 4.9.3
2491 */
2492 private function get_menu_container_style() {
2493
2494 $this->start_controls_section(
2495 'premium_nav_style_section',
2496 array(
2497 'label' => __( 'Desktop Menu Style', 'premium-addons-for-elementor' ),
2498 'tab' => Controls_Manager::TAB_STYLE,
2499 'condition' => array(
2500 'pa_nav_menu_layout' => array( 'hor', 'ver' ),
2501 ),
2502 )
2503 );
2504
2505 $this->add_responsive_control(
2506 'pa_nav_menu_height',
2507 array(
2508 'label' => __( 'Height', 'premium-addons-for-elementor' ),
2509 'type' => Controls_Manager::SLIDER,
2510 'size_units' => array( 'px', 'em', '%', 'custom' ),
2511 'label_block' => true,
2512 'selectors' => array(
2513 '{{WRAPPER}}.premium-nav-hor > .elementor-widget-container > .premium-nav-widget-container > .premium-ver-inner-container > .premium-nav-menu-container' => 'height: {{SIZE}}{{UNIT}};',
2514 ),
2515 'condition' => array(
2516 'pa_nav_menu_layout' => 'hor',
2517 ),
2518 )
2519 );
2520
2521 $this->add_responsive_control(
2522 'pa_nav_menu_width',
2523 array(
2524 'label' => __( 'Width', 'premium-addons-for-elementor' ),
2525 'type' => Controls_Manager::SLIDER,
2526 'size_units' => array( 'px', '%', 'custom' ),
2527 'range' => array(
2528 'px' => array(
2529 'min' => 0,
2530 'max' => 1000,
2531 ),
2532 ),
2533 'label_block' => true,
2534 'selectors' => array(
2535 '{{WRAPPER}}.premium-nav-ver .premium-ver-inner-container' => 'width: {{SIZE}}{{UNIT}};',
2536 ),
2537 'condition' => array(
2538 'pa_nav_menu_layout' => 'ver',
2539 ),
2540 )
2541 );
2542
2543 $this->add_group_control(
2544 Group_Control_Box_Shadow::get_type(),
2545 array(
2546 'name' => 'pa_nav_menu_shadow',
2547 'selector' => '{{WRAPPER}} .premium-nav-menu-container',
2548 )
2549 );
2550
2551 $this->add_group_control(
2552 Premium_Background::get_type(),
2553 array(
2554 'name' => 'pa_nav_menu_background',
2555 'types' => array( 'classic', 'gradient' ),
2556 'selector' => '{{WRAPPER}} .premium-nav-menu-container',
2557 )
2558 );
2559
2560 $this->add_group_control(
2561 Group_Control_Border::get_type(),
2562 array(
2563 'name' => 'pa_nav_menu_border',
2564 'selector' => '{{WRAPPER}} .premium-nav-menu-container',
2565 )
2566 );
2567
2568 $this->add_control(
2569 'pa_nav_menu_rad',
2570 array(
2571 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
2572 'type' => Controls_Manager::DIMENSIONS,
2573 'size_units' => array( 'px', 'em', '%' ),
2574 'selectors' => array(
2575 '{{WRAPPER}} .premium-nav-menu-container' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
2576 ),
2577 )
2578 );
2579
2580 $this->add_responsive_control(
2581 'pa_nav_menu_padding',
2582 array(
2583 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
2584 'type' => Controls_Manager::DIMENSIONS,
2585 'size_units' => array( 'px', 'em', '%' ),
2586 'selectors' => array(
2587 '{{WRAPPER}} .premium-nav-menu-container' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2588 ),
2589 )
2590 );
2591
2592 $this->end_controls_section();
2593 }
2594
2595 /**
2596 * Get toggle menu container style.
2597 *
2598 * @access private
2599 * @since 4.9.3
2600 */
2601 private function get_toggle_menu_sytle() {
2602
2603 $this->start_controls_section(
2604 'premium_toggle_mene_style_section',
2605 array(
2606 'label' => __( 'Expand/Slide Menu Style', 'premium-addons-for-elementor' ),
2607 'tab' => Controls_Manager::TAB_STYLE,
2608 'conditions' => array(
2609 'relation' => 'or',
2610 'terms' => array(
2611 array(
2612 'name' => 'pa_nav_menu_layout',
2613 'operator' => 'in',
2614 'value' => array( 'dropdown', 'slide' ),
2615 ),
2616 array(
2617 'relation' => 'and',
2618 'terms' => array(
2619 array(
2620 'name' => 'pa_nav_menu_layout',
2621 'operator' => 'in',
2622 'value' => array( 'hor', 'ver' ),
2623 ),
2624 array(
2625 'name' => 'render_mobile_menu',
2626 'value' => 'yes',
2627 ),
2628 ),
2629 ),
2630 ),
2631 ),
2632 )
2633 );
2634
2635 $this->add_control(
2636 'pa_ham_toggle_style',
2637 array(
2638 'label' => __( 'Toggle Button', 'premium-addons-for-elementor' ),
2639 'type' => Controls_Manager::HEADING,
2640 )
2641 );
2642
2643 $this->start_controls_tabs( 'pa_ham_toggle_style_tabs' );
2644
2645 $this->start_controls_tab(
2646 'pa_ham_toggle_icon_tab',
2647 array(
2648 'label' => __( 'Icon', 'premium-addons-for-elementor' ),
2649 )
2650 );
2651
2652 $this->add_responsive_control(
2653 'pa_ham_toggle_icon_size',
2654 array(
2655 'label' => __( 'Size', 'premium-addons-for-elementor' ),
2656 'type' => Controls_Manager::SLIDER,
2657 'size_units' => array( 'px', 'em', '%' ),
2658 'label_block' => true,
2659 'selectors' => array(
2660 '{{WRAPPER}} .premium-hamburger-toggle i' => 'font-size: {{SIZE}}{{UNIT}};',
2661 '{{WRAPPER}} .premium-hamburger-toggle svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
2662 ),
2663 )
2664 );
2665
2666 $this->add_control(
2667 'pa_ham_toggle_color',
2668 array(
2669 'label' => __( 'Color', 'premium-addons-for-elementor' ),
2670 'type' => Controls_Manager::COLOR,
2671 'selectors' => array(
2672 '{{WRAPPER}} .premium-hamburger-toggle i' => 'color: {{VALUE}};',
2673 '{{WRAPPER}} .premium-hamburger-toggle svg, {{WRAPPER}} .premium-hamburger-toggle svg path' => 'fill: {{VALUE}};',
2674 ),
2675 )
2676 );
2677
2678 $this->add_control(
2679 'pa_ham_toggle_color_hover',
2680 array(
2681 'label' => __( 'Hover Color', 'premium-addons-for-elementor' ),
2682 'type' => Controls_Manager::COLOR,
2683 'selectors' => array(
2684 '{{WRAPPER}} .premium-hamburger-toggle:hover i' => 'color: {{VALUE}};',
2685 '{{WRAPPER}} .premium-hamburger-toggle:hover svg, {{WRAPPER}} .premium-hamburger-toggle:hover svg path' => 'fill: {{VALUE}};',
2686 ),
2687 )
2688 );
2689
2690 $this->end_controls_tab();
2691
2692 $this->start_controls_tab(
2693 'pa_ham_toggle_label_tab',
2694 array(
2695 'label' => __( 'Text', 'premium-addons-for-elementor' ),
2696 )
2697 );
2698
2699 $this->add_group_control(
2700 Group_Control_Typography::get_type(),
2701 array(
2702 'name' => 'pa_ham_toggle_txt_typo',
2703 'selector' => '{{WRAPPER}} .premium-hamburger-toggle .premium-toggle-text, {{WRAPPER}}.premium-ham-dropdown .premium-hamburger-toggle .premium-toggle-close',
2704 )
2705 );
2706
2707 $this->add_control(
2708 'pa_ham_toggle_txt_color',
2709 array(
2710 'label' => __( 'Color', 'premium-addons-for-elementor' ),
2711 'type' => Controls_Manager::COLOR,
2712 'selectors' => array(
2713 '{{WRAPPER}} .premium-hamburger-toggle .premium-toggle-text, {{WRAPPER}}.premium-ham-dropdown .premium-hamburger-toggle .premium-toggle-close' => 'color: {{VALUE}};',
2714 ),
2715 )
2716 );
2717
2718 $this->add_control(
2719 'pa_ham_toggle_txt_color_hover',
2720 array(
2721 'label' => __( 'Hover Color', 'premium-addons-for-elementor' ),
2722 'type' => Controls_Manager::COLOR,
2723 'selectors' => array(
2724 '{{WRAPPER}} .premium-hamburger-toggle:hover .premium-toggle-text, {{WRAPPER}}.premium-ham-dropdown .premium-hamburger-toggle:hover .premium-toggle-close' => 'color: {{VALUE}};',
2725 ),
2726 )
2727 );
2728
2729 $this->add_responsive_control(
2730 'pa_ham_toggle_txt_margin',
2731 array(
2732 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
2733 'type' => Controls_Manager::DIMENSIONS,
2734 'size_units' => array( 'px', 'em', '%', 'custom' ),
2735 'selectors' => array(
2736 '{{WRAPPER}} .premium-hamburger-toggle .premium-toggle-text, {{WRAPPER}}.premium-ham-dropdown .premium-hamburger-toggle .premium-toggle-close' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2737 ),
2738 )
2739 );
2740
2741 $this->end_controls_tab();
2742
2743 $this->end_controls_tabs();
2744
2745 $this->add_control(
2746 'pa_ham_toggle_bg',
2747 array(
2748 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
2749 'separator' => 'before',
2750 'type' => Controls_Manager::COLOR,
2751 'selectors' => array(
2752 '{{WRAPPER}} .premium-hamburger-toggle' => 'background-color: {{VALUE}};',
2753 ),
2754 )
2755 );
2756
2757 $this->add_control(
2758 'pa_ham_toggle_bg_hover',
2759 array(
2760 'label' => __( 'Hover Background Color', 'premium-addons-for-elementor' ),
2761 'type' => Controls_Manager::COLOR,
2762 'selectors' => array(
2763 '{{WRAPPER}} .premium-hamburger-toggle:hover' => 'background-color: {{VALUE}};',
2764 ),
2765 )
2766 );
2767
2768 $this->add_group_control(
2769 Group_Control_Box_Shadow::get_type(),
2770 array(
2771 'name' => 'pa_ham_toggle_shadow',
2772 'selector' => '{{WRAPPER}} .premium-hamburger-toggle',
2773 )
2774 );
2775
2776 $this->add_group_control(
2777 Group_Control_Border::get_type(),
2778 array(
2779 'name' => 'pa_ham_toggle_border',
2780 'selector' => '{{WRAPPER}} .premium-hamburger-toggle',
2781 )
2782 );
2783
2784 $this->add_control(
2785 'pa_ham_toggle_rad',
2786 array(
2787 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
2788 'type' => Controls_Manager::DIMENSIONS,
2789 'size_units' => array( 'px', 'em', '%' ),
2790 'selectors' => array(
2791 '{{WRAPPER}} .premium-hamburger-toggle' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
2792 ),
2793 )
2794 );
2795
2796 $this->add_responsive_control(
2797 'pa_ham_toggle_padding',
2798 array(
2799 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
2800 'type' => Controls_Manager::DIMENSIONS,
2801 'size_units' => array( 'px', 'em', '%' ),
2802 'selectors' => array(
2803 '{{WRAPPER}} .premium-hamburger-toggle' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2804 ),
2805 )
2806 );
2807
2808 $this->add_responsive_control(
2809 'pa_ham_toggle_margin',
2810 array(
2811 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
2812 'type' => Controls_Manager::DIMENSIONS,
2813 'size_units' => array( 'px', 'em', '%', 'custom' ),
2814 'selectors' => array(
2815 '{{WRAPPER}} .premium-hamburger-toggle' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2816 ),
2817 )
2818 );
2819
2820 $this->add_control(
2821 'pa_ham_menu_style',
2822 array(
2823 'label' => __( 'Toggle Menu', 'premium-addons-for-elementor' ),
2824 'type' => Controls_Manager::HEADING,
2825 'separator' => 'before',
2826 )
2827 );
2828
2829 $this->add_control(
2830 'pa_ham_menu_item_color',
2831 array(
2832 'label' => __( 'Menu Item Color', 'premium-addons-for-elementor' ),
2833 'type' => Controls_Manager::COLOR,
2834 'selectors' => array(
2835 '{{WRAPPER}} .premium-main-mobile-menu.premium-main-nav-menu > .premium-nav-menu-item > .premium-menu-link' => 'color: {{VALUE}};',
2836 ),
2837 )
2838 );
2839
2840 $this->add_control(
2841 'pa_ham_menu_overlay',
2842 array(
2843 'label' => __( 'Overlay Color', 'premium-addons-for-elementor' ),
2844 'type' => Controls_Manager::COLOR,
2845 'selectors' => array(
2846 '{{WRAPPER}} .premium-nav-slide-overlay' => 'background: {{VALUE}};',
2847 ),
2848 'conditions' => array(
2849 'relation' => 'or',
2850 'terms' => array(
2851 array(
2852 'name' => 'pa_nav_menu_layout',
2853 'value' => 'slide',
2854 ),
2855 array(
2856 'relation' => 'and',
2857 'terms' => array(
2858 array(
2859 'name' => 'pa_mobile_menu_layout',
2860 'value' => 'slide',
2861 ),
2862 array(
2863 'name' => 'pa_nav_menu_layout',
2864 'operator' => 'in',
2865 'value' => array( 'hor', 'ver' ),
2866 ),
2867 ),
2868 ),
2869 ),
2870 ),
2871 )
2872 );
2873
2874 $this->add_group_control(
2875 Group_Control_Box_Shadow::get_type(),
2876 array(
2877 'name' => 'pa_ham_menu_shadow',
2878 'selector' => '{{WRAPPER}}.premium-ham-dropdown .premium-mobile-menu,
2879 {{WRAPPER}}.premium-nav-dropdown .premium-mobile-menu,
2880 {{WRAPPER}} .premium-mobile-menu-outer-container',
2881 )
2882 );
2883
2884 $this->add_group_control(
2885 Group_Control_Background::get_type(),
2886 array(
2887 'name' => 'pa_ham_menu_background',
2888 'types' => array( 'classic', 'gradient' ),
2889 'selector' => '{{WRAPPER}}.premium-ham-dropdown .premium-mobile-menu,
2890 {{WRAPPER}}.premium-nav-dropdown .premium-mobile-menu,
2891 {{WRAPPER}} .premium-mobile-menu-outer-container,
2892 {{WRAPPER}}:not(.premium-nav-slide):not(.premium-ham-slide) .premium-mobile-menu-container',
2893
2894 )
2895 );
2896
2897 $this->add_group_control(
2898 Group_Control_Border::get_type(),
2899 array(
2900 'name' => 'pa_ham_menu_border',
2901 'selector' => '{{WRAPPER}}.premium-ham-dropdown .premium-mobile-menu,
2902 {{WRAPPER}}.premium-nav-dropdown .premium-mobile-menu,
2903 {{WRAPPER}} .premium-mobile-menu-outer-container',
2904 )
2905 );
2906
2907 $this->add_control(
2908 'pa_ham_menu_rad',
2909 array(
2910 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
2911 'type' => Controls_Manager::DIMENSIONS,
2912 'size_units' => array( 'px', 'em', '%' ),
2913 'selectors' => array(
2914 '{{WRAPPER}}.premium-ham-dropdown .premium-mobile-menu,
2915 {{WRAPPER}}.premium-nav-dropdown .premium-mobile-menu' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
2916 ),
2917 'condition' => array(
2918 'pa_mobile_menu_layout' => 'dropdown',
2919 ),
2920 )
2921 );
2922
2923 $this->add_responsive_control(
2924 'pa_ham_menu_padding',
2925 array(
2926 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
2927 'type' => Controls_Manager::DIMENSIONS,
2928 'size_units' => array( 'px', 'em', '%' ),
2929 'selectors' => array(
2930 '{{WRAPPER}}.premium-ham-dropdown .premium-mobile-menu,
2931 {{WRAPPER}}.premium-nav-dropdown .premium-mobile-menu,
2932 {{WRAPPER}} .premium-mobile-menu-outer-container' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2933 ),
2934 )
2935 );
2936
2937 $this->end_controls_section();
2938
2939 // Show close button style if desktop or mobile menu is set to slide.
2940 $close_btn_conditions = array(
2941 'relation' => 'or',
2942 'terms' => array(
2943 array(
2944 'name' => 'pa_nav_menu_layout',
2945 'value' => 'slide',
2946 ),
2947 array(
2948 'name' => 'pa_mobile_menu_layout',
2949 'value' => 'slide',
2950 ),
2951 ),
2952
2953 );
2954
2955 $this->start_controls_section(
2956 'ham_close_style_section',
2957 array(
2958 'label' => __( 'Close Button Style', 'premium-addons-for-elementor' ),
2959 'tab' => Controls_Manager::TAB_STYLE,
2960 'conditions' => array_merge(
2961 $close_btn_conditions,
2962 array(
2963 'relation' => 'or',
2964 'terms' => array(
2965 array(
2966 'name' => 'pa_nav_menu_layout',
2967 'operator' => 'in',
2968 'value' => array( 'dropdown', 'slide' ),
2969 ),
2970 array(
2971 'relation' => 'and',
2972 'terms' => array(
2973 array(
2974 'name' => 'pa_nav_menu_layout',
2975 'operator' => 'in',
2976 'value' => array( 'hor', 'ver' ),
2977 ),
2978 array(
2979 'name' => 'render_mobile_menu',
2980 'value' => 'yes',
2981 ),
2982 ),
2983 ),
2984 ),
2985 )
2986 ),
2987 )
2988 );
2989
2990 $this->start_controls_tabs( 'pa_ham_close_style_tabs' );
2991
2992 $this->start_controls_tab(
2993 'pa_ham_close_icon_tab',
2994 array(
2995 'label' => __( 'Icon', 'premium-addons-for-elementor' ),
2996 )
2997 );
2998
2999 $this->add_responsive_control(
3000 'pa_ham_close_size',
3001 array(
3002 'label' => __( 'Size', 'premium-addons-for-elementor' ),
3003 'type' => Controls_Manager::SLIDER,
3004 'size_units' => array( 'px', 'em', '%' ),
3005 'label_block' => true,
3006 'selectors' => array(
3007 '{{WRAPPER}} .premium-mobile-menu-outer-container .premium-mobile-menu-close i' => 'font-size: {{SIZE}}{{UNIT}};',
3008 '{{WRAPPER}} .premium-mobile-menu-outer-container .premium-mobile-menu-close svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
3009 ),
3010 )
3011 );
3012
3013 $this->add_control(
3014 'pa_ham_close_color',
3015 array(
3016 'label' => __( 'Color', 'premium-addons-for-elementor' ),
3017 'type' => Controls_Manager::COLOR,
3018 'selectors' => array(
3019 '{{WRAPPER}} .premium-mobile-menu-outer-container .premium-mobile-menu-close i' => 'color: {{VALUE}};',
3020 '{{WRAPPER}} .premium-mobile-menu-outer-container .premium-mobile-menu-close svg, {{WRAPPER}} .premium-mobile-menu-outer-container .premium-mobile-menu-close svg path' => 'fill: {{VALUE}};',
3021 ),
3022 )
3023 );
3024
3025 $this->add_control(
3026 'pa_ham_close_color_hover',
3027 array(
3028 'label' => __( 'Hover Color', 'premium-addons-for-elementor' ),
3029 'type' => Controls_Manager::COLOR,
3030 'selectors' => array(
3031 '{{WRAPPER}} .premium-mobile-menu-outer-container .premium-mobile-menu-close:hover i' => 'color: {{VALUE}};',
3032 '{{WRAPPER}} .premium-mobile-menu-outer-container .premium-mobile-menu-close:hover svg, {{WRAPPER}} .premium-mobile-menu-outer-container .premium-mobile-menu-close:hover svg path' => 'fill: {{VALUE}};',
3033 ),
3034 )
3035 );
3036
3037 $this->end_controls_tab();
3038
3039 $this->start_controls_tab(
3040 'pa_ham_close_txt_tab',
3041 array(
3042 'label' => __( 'Text', 'premium-addons-for-elementor' ),
3043 )
3044 );
3045
3046 $this->add_group_control(
3047 Group_Control_Typography::get_type(),
3048 array(
3049 'name' => 'pa_ham_close_txt_typo',
3050 'selector' => '{{WRAPPER}} .premium-mobile-menu-outer-container .premium-mobile-menu-close .premium-toggle-close',
3051 )
3052 );
3053
3054 $this->add_control(
3055 'pa_ham_close_txt_color',
3056 array(
3057 'label' => __( 'Color', 'premium-addons-for-elementor' ),
3058 'type' => Controls_Manager::COLOR,
3059 'selectors' => array(
3060 '{{WRAPPER}} .premium-mobile-menu-outer-container .premium-mobile-menu-close .premium-toggle-close' => 'color: {{VALUE}};',
3061 ),
3062 )
3063 );
3064
3065 $this->add_control(
3066 'pa_ham_close_txt_color_hover',
3067 array(
3068 'label' => __( 'Hover Color', 'premium-addons-for-elementor' ),
3069 'type' => Controls_Manager::COLOR,
3070 'selectors' => array(
3071 '{{WRAPPER}} .premium-mobile-menu-outer-container .premium-mobile-menu-close:hover .premium-toggle-close' => 'color: {{VALUE}};',
3072 ),
3073 )
3074 );
3075
3076 $this->add_responsive_control(
3077 'pa_ham_close_txt_margin',
3078 array(
3079 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
3080 'type' => Controls_Manager::DIMENSIONS,
3081 'size_units' => array( 'px', 'em', '%', 'custom' ),
3082 'selectors' => array(
3083 '{{WRAPPER}} .premium-mobile-menu-outer-container .premium-mobile-menu-close .premium-toggle-close' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3084 ),
3085 )
3086 );
3087
3088 $this->end_controls_tab();
3089
3090 $this->end_controls_tabs();
3091
3092 $this->add_control(
3093 'pa_ham_close_bg',
3094 array(
3095 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
3096 'type' => Controls_Manager::COLOR,
3097 'separator' => 'before',
3098 'selectors' => array(
3099 '{{WRAPPER}} .premium-mobile-menu-outer-container .premium-mobile-menu-close' => 'background-color: {{VALUE}};',
3100 ),
3101 )
3102 );
3103
3104 $this->add_control(
3105 'pa_ham_close_bg_hover',
3106 array(
3107 'label' => __( 'Hover Background Color', 'premium-addons-for-elementor' ),
3108 'type' => Controls_Manager::COLOR,
3109 'selectors' => array(
3110 '{{WRAPPER}} .premium-mobile-menu-outer-container .premium-mobile-menu-close:hover' => 'background-color: {{VALUE}};',
3111 ),
3112 )
3113 );
3114
3115 $this->add_group_control(
3116 Group_Control_Box_Shadow::get_type(),
3117 array(
3118 'name' => 'pa_ham_close_shadow',
3119 'selector' => '{{WRAPPER}} .premium-mobile-menu-outer-container .premium-mobile-menu-close',
3120 )
3121 );
3122
3123 $this->add_group_control(
3124 Group_Control_Border::get_type(),
3125 array(
3126 'name' => 'pa_ham_close_border',
3127 'selector' => '{{WRAPPER}} .premium-mobile-menu-outer-container .premium-mobile-menu-close',
3128 )
3129 );
3130
3131 $this->add_control(
3132 'pa_ham_close_rad',
3133 array(
3134 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
3135 'type' => Controls_Manager::DIMENSIONS,
3136 'size_units' => array( 'px', 'em', '%' ),
3137 'selectors' => array(
3138 '{{WRAPPER}} .premium-mobile-menu-outer-container .premium-mobile-menu-close' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
3139 ),
3140 )
3141 );
3142
3143 $this->add_responsive_control(
3144 'pa_ham_close_padding',
3145 array(
3146 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
3147 'type' => Controls_Manager::DIMENSIONS,
3148 'size_units' => array( 'px', 'em', '%' ),
3149 'selectors' => array(
3150 '{{WRAPPER}} .premium-mobile-menu-outer-container .premium-mobile-menu-close' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3151 ),
3152 )
3153 );
3154
3155 $this->add_responsive_control(
3156 'pa_ham_close_margin',
3157 array(
3158 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
3159 'type' => Controls_Manager::DIMENSIONS,
3160 'size_units' => array( 'px', 'em', '%', 'custom' ),
3161 'selectors' => array(
3162 '{{WRAPPER}} .premium-mobile-menu-outer-container .premium-mobile-menu-close' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3163 ),
3164 )
3165 );
3166
3167 $this->end_controls_section();
3168 }
3169
3170 /**
3171 * Get Menu Item Extras.
3172 * Adds Menu Items' Icon & Badge Style.
3173 *
3174 * @access private
3175 * @since 4.9.4
3176 */
3177 private function get_menu_item_extras() {
3178
3179 $this->start_controls_section(
3180 'premium_nav_item_extra_style',
3181 array(
3182 'label' => __( 'Menu Item Icon & Badge', 'premium-addons-for-elementor' ),
3183 'tab' => Controls_Manager::TAB_STYLE,
3184 )
3185 );
3186
3187 $this->start_controls_tabs( 'pa_nav_items_extras' );
3188
3189 $this->start_controls_tab(
3190 'pa_nav_item_icon_style',
3191 array(
3192 'label' => __( 'Icon', 'premium-addons-for-elementor' ),
3193 )
3194 );
3195
3196 $left_order = is_rtl() ? '1' : '0';
3197 $right_order = is_rtl() ? '0' : '1';
3198 $default = is_rtl() ? $right_order : $left_order;
3199
3200 $this->add_responsive_control(
3201 'pa_nav_item_icon_pos',
3202 array(
3203 'label' => __( 'Position', 'premium-addons-for-elementor' ),
3204 'type' => Controls_Manager::CHOOSE,
3205 'options' => array(
3206 $left_order => array(
3207 'title' => __( 'Left', 'premium-addons-for-elementor' ),
3208 'icon' => 'eicon-h-align-left',
3209 ),
3210 $right_order => array(
3211 'title' => __( 'Right', 'premium-addons-for-elementor' ),
3212 'icon' => 'eicon-h-align-right',
3213 ),
3214 ),
3215 'default' => $default,
3216 'toggle' => false,
3217 'selectors' => array(
3218 '{{WRAPPER}} .premium-nav-menu-item > .premium-menu-link > .premium-item-icon' => 'order: {{VALUE}}',
3219 ),
3220 )
3221 );
3222
3223 $this->add_control(
3224 'menu_item_icon_color',
3225 array(
3226 'label' => __( 'Color', 'premium-addons-for-elementor' ),
3227 'type' => Controls_Manager::COLOR,
3228 'global' => array(
3229 'default' => Global_Colors::COLOR_PRIMARY,
3230 ),
3231 'selectors' => array(
3232 '{{WRAPPER}} .premium-nav-menu-item > .premium-menu-link > .premium-item-icon' => 'color: {{VALUE}};',
3233 '{{WRAPPER}} .premium-nav-menu-item > .premium-menu-link > .premium-item-icon:not(.premium-lottie-animation) svg * ,
3234 {{WRAPPER}} .premium-nav-menu-item > .premium-menu-link > svg.premium-item-icon *' => 'fill: {{VALUE}}',
3235 ),
3236 'condition' => array(
3237 'menu_type' => 'custom',
3238 ),
3239 )
3240 );
3241
3242 $this->add_responsive_control(
3243 'pa_nav_item_icon_size',
3244 array(
3245 'label' => __( 'Size', 'premium-addons-for-elementor' ),
3246 'type' => Controls_Manager::SLIDER,
3247 'label_block' => true,
3248 'size_units' => array( 'px' ),
3249 'range' => array(
3250 'px' => array(
3251 'min' => 0,
3252 'max' => 300,
3253 ),
3254 ),
3255 'selectors' => array(
3256 '{{WRAPPER}} .premium-nav-menu-item > .premium-menu-link > i.premium-item-icon' => 'font-size: {{SIZE}}{{UNIT}};',
3257 '{{WRAPPER}} .premium-nav-menu-item > .premium-menu-link > .premium-item-icon.dashicons, {{WRAPPER}} .premium-nav-menu-item > .premium-menu-link > img.premium-item-icon, {{WRAPPER}} .premium-nav-menu-item > .premium-menu-link > .premium-item-icon svg, {{WRAPPER}} .premium-nav-menu-item > .premium-menu-link > svg.premium-item-icon, {{WRAPPER}} .premium-nav-menu-item > .premium-menu-link > .premium-item-icon.premium-lottie-animation' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
3258 ),
3259 )
3260 );
3261
3262 $this->add_control(
3263 'menu_item_icon_back_color',
3264 array(
3265 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
3266 'type' => Controls_Manager::COLOR,
3267 'selectors' => array(
3268 '{{WRAPPER}} .premium-nav-menu-item > .premium-menu-link > .premium-item-icon' => 'background-color: {{VALUE}};',
3269 ),
3270 )
3271 );
3272
3273 $this->add_control(
3274 'menu_item_icon_radius',
3275 array(
3276 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
3277 'type' => Controls_Manager::DIMENSIONS,
3278 'size_units' => array( 'px', 'em', '%' ),
3279 'selectors' => array(
3280 '{{WRAPPER}} .premium-nav-menu-item > .premium-menu-link > .premium-item-icon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
3281 ),
3282 )
3283 );
3284
3285 $this->add_responsive_control(
3286 'pa_nav_item_icon_margin',
3287 array(
3288 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
3289 'type' => Controls_Manager::DIMENSIONS,
3290 'size_units' => array( 'px', 'em', '%', 'custom' ),
3291 'selectors' => array(
3292 '{{WRAPPER}} .premium-nav-menu-item > .premium-menu-link > .premium-item-icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3293 ),
3294 )
3295 );
3296
3297 $this->add_responsive_control(
3298 'pa_nav_item_icon_padding',
3299 array(
3300 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
3301 'type' => Controls_Manager::DIMENSIONS,
3302 'size_units' => array( 'px', 'em', '%', 'custom' ),
3303 'selectors' => array(
3304 '{{WRAPPER}} .premium-nav-menu-item > .premium-menu-link > .premium-item-icon' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3305 ),
3306 )
3307 );
3308
3309 $this->end_controls_tab();
3310
3311 $this->start_controls_tab(
3312 'pa_nav_item_badge_style',
3313 array(
3314 'label' => __( 'Badge', 'premium-addons-for-elementor' ),
3315 )
3316 );
3317
3318 $this->add_group_control(
3319 Group_Control_Typography::get_type(),
3320 array(
3321 'name' => 'pa_nav_item_badge_typo',
3322 'selector' => '{{WRAPPER}} .premium-nav-menu-item > .premium-menu-link > .premium-item-badge,
3323 {{WRAPPER}} .premium-ver-inner-container > div .premium-main-nav-menu > .premium-nav-menu-item > .premium-rn-badge,
3324 {{WRAPPER}} .premium-ver-inner-container > div .premium-main-nav-menu > .premium-nav-menu-item > .premium-menu-link > .premium-rn-badge',
3325 )
3326 );
3327
3328 $this->add_control(
3329 'item_badge_color',
3330 array(
3331 'label' => __( 'Color', 'premium-addons-for-elementor' ),
3332 'type' => Controls_Manager::COLOR,
3333 'selectors' => array(
3334 '{{WRAPPER}} .premium-nav-menu-item > .premium-menu-link > .premium-item-badge,
3335 {{WRAPPER}} .premium-ver-inner-container > div .premium-main-nav-menu > .premium-nav-menu-item > .premium-rn-badge,
3336 {{WRAPPER}} .premium-ver-inner-container > div .premium-main-nav-menu > .premium-nav-menu-item > .premium-menu-link > .premium-rn-badge' => 'color: {{VALUE}};',
3337 ),
3338 'condition' => array(
3339 'menu_type' => 'custom',
3340 ),
3341 )
3342 );
3343
3344 $this->add_control(
3345 'item_badge_back_color',
3346 array(
3347 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
3348 'type' => Controls_Manager::COLOR,
3349 'selectors' => array(
3350 '{{WRAPPER}} .premium-nav-menu-item > .premium-menu-link > .premium-item-badge,
3351 {{WRAPPER}} .premium-ver-inner-container > div .premium-main-nav-menu > .premium-nav-menu-item > .premium-rn-badge,
3352 {{WRAPPER}} .premium-ver-inner-container > div .premium-main-nav-menu > .premium-nav-menu-item > .premium-menu-link > .premium-rn-badge' => 'background-color: {{VALUE}};',
3353 ),
3354 'condition' => array(
3355 'menu_type' => 'custom',
3356 ),
3357 )
3358 );
3359
3360 $this->add_group_control(
3361 Group_Control_Border::get_type(),
3362 array(
3363 'name' => 'pa_nav_item_badge_border',
3364 'selector' => '{{WRAPPER}} .premium-nav-menu-item > .premium-menu-link > .premium-item-badge,
3365 {{WRAPPER}} .premium-ver-inner-container > div .premium-main-nav-menu > .premium-nav-menu-item > .premium-rn-badge,
3366 {{WRAPPER}} .premium-ver-inner-container > div .premium-main-nav-menu > .premium-nav-menu-item > .premium-menu-link > .premium-rn-badge',
3367 )
3368 );
3369
3370 $this->add_control(
3371 'pa_nav_item_badge_rad',
3372 array(
3373 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
3374 'type' => Controls_Manager::DIMENSIONS,
3375 'size_units' => array( 'px', 'em', '%' ),
3376 'selectors' => array(
3377 '{{WRAPPER}} .premium-nav-menu-item > .premium-menu-link > .premium-item-badge,
3378 {{WRAPPER}} .premium-ver-inner-container > div .premium-main-nav-menu > .premium-nav-menu-item > .premium-rn-badge,
3379 {{WRAPPER}} .premium-ver-inner-container > div .premium-main-nav-menu > .premium-nav-menu-item > .premium-menu-link > .premium-rn-badge' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
3380 ),
3381 )
3382 );
3383
3384 $this->add_responsive_control(
3385 'pa_nav_item_badge_padding',
3386 array(
3387 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
3388 'type' => Controls_Manager::DIMENSIONS,
3389 'size_units' => array( 'px', 'em', '%', 'custom' ),
3390 'selectors' => array(
3391 '{{WRAPPER}} .premium-nav-menu-item > .premium-menu-link > .premium-item-badge,
3392 {{WRAPPER}} .premium-ver-inner-container > div .premium-main-nav-menu > .premium-nav-menu-item > .premium-rn-badge,
3393 {{WRAPPER}} .premium-ver-inner-container > div .premium-main-nav-menu > .premium-nav-menu-item > .premium-menu-link > .premium-rn-badge' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3394 ),
3395 )
3396 );
3397
3398 $this->add_responsive_control(
3399 'pa_nav_item_badge_margin',
3400 array(
3401 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
3402 'type' => Controls_Manager::DIMENSIONS,
3403 'size_units' => array( 'px', 'em', '%', 'custom' ),
3404 'selectors' => array(
3405 '{{WRAPPER}} .premium-nav-menu-item > .premium-menu-link > .premium-item-badge,
3406 {{WRAPPER}} .premium-ver-inner-container > div .premium-main-nav-menu > .premium-nav-menu-item > .premium-rn-badge,
3407 {{WRAPPER}} .premium-ver-inner-container > div .premium-main-nav-menu > .premium-nav-menu-item > .premium-menu-link > .premium-rn-badge' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3408 ),
3409 )
3410 );
3411
3412 $this->end_controls_tab();
3413 $this->end_controls_tabs();
3414
3415 $this->end_controls_section();
3416 }
3417
3418 /**
3419 * Get menu item style.
3420 *
3421 * @access private
3422 * @since 4.9.3
3423 */
3424 private function get_menu_item_style() {
3425
3426 $this->start_controls_section(
3427 'premium_nav_item_style_section',
3428 array(
3429 'label' => __( 'Menu Item Style', 'premium-addons-for-elementor' ),
3430 'tab' => Controls_Manager::TAB_STYLE,
3431 )
3432 );
3433
3434 $this->add_group_control(
3435 Group_Control_Typography::get_type(),
3436 array(
3437 'name' => 'pa_nav_item_typo',
3438 'global' => array(
3439 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
3440 ),
3441 'selector' => '{{WRAPPER}} .premium-main-nav-menu > .premium-nav-menu-item > .premium-menu-link',
3442 )
3443 );
3444
3445 $this->add_responsive_control(
3446 'pa_nav_item_drop_icon_size',
3447 array(
3448 'label' => __( 'Dropdown Icon Size', 'premium-addons-for-elementor' ),
3449 'type' => Controls_Manager::SLIDER,
3450 'size_units' => array( 'px', 'em' ),
3451 'selectors' => array(
3452 '{{WRAPPER}} .premium-main-nav-menu > .premium-nav-menu-item > .premium-menu-link .premium-dropdown-icon' => 'font-size: {{SIZE}}{{UNIT}};',
3453 ),
3454 )
3455 );
3456
3457 $this->add_responsive_control(
3458 'pa_pointer_thinkness',
3459 array(
3460 'label' => __( 'Pointer Thickness', 'premium-addons-for-elementor' ),
3461 'type' => Controls_Manager::SLIDER,
3462 'size_units' => array( 'px' ),
3463 'range' => array(
3464 'px' => array(
3465 'min' => 0,
3466 'max' => 50,
3467 ),
3468 ),
3469 'selectors' => array(
3470 '{{WRAPPER}} .premium-nav-pointer-underline .premium-menu-link-parent::after,
3471 {{WRAPPER}} .premium-nav-pointer-overline .premium-menu-link-parent::before,
3472 {{WRAPPER}} .premium-nav-pointer-double-line .premium-menu-link-parent::before,
3473 {{WRAPPER}} .premium-nav-pointer-double-line .premium-menu-link-parent::after' => 'height: {{SIZE}}px;',
3474 '{{WRAPPER}} .premium-nav-pointer-framed:not(.premium-nav-animation-draw):not(.premium-nav-animation-corners) .premium-menu-link-parent::before' => 'border-width: {{SIZE}}px;',
3475 '{{WRAPPER}} .premium-nav-pointer-framed.premium-nav-animation-draw .premium-menu-link-parent::before' => 'border-width: 0 0 {{SIZE}}px {{SIZE}}px;',
3476 '{{WRAPPER}} .premium-nav-pointer-framed.premium-nav-animation-draw .premium-menu-link-parent::after' => 'border-width: {{SIZE}}px {{SIZE}}px 0 0;',
3477 '{{WRAPPER}} .premium-nav-pointer-framed.premium-nav-animation-corners .premium-menu-link-parent::before' => 'border-width: {{SIZE}}px 0 0 {{SIZE}}px',
3478 '{{WRAPPER}} .premium-nav-pointer-framed.premium-nav-animation-corners .premium-menu-link-parent::after' => 'border-width: 0 {{SIZE}}px {{SIZE}}px 0',
3479 ),
3480 'condition' => array(
3481 'pointer!' => array( 'none', 'text', 'background' ),
3482 ),
3483
3484 )
3485 );
3486
3487 $this->add_responsive_control(
3488 'pa_nav_item_drop_icon_margin',
3489 array(
3490 'label' => __( 'Dropdown Icon Margin', 'premium-addons-for-elementor' ),
3491 'type' => Controls_Manager::DIMENSIONS,
3492 'size_units' => array( 'px', 'em', '%', 'custom' ),
3493 'selectors' => array(
3494 '{{WRAPPER}} .premium-main-nav-menu > .premium-nav-menu-item > .premium-menu-link .premium-dropdown-icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3495 ),
3496 )
3497 );
3498
3499 $this->start_controls_tabs( 'pa_nav_items_styles' );
3500
3501 $this->start_controls_tab(
3502 'pa_nav_item_normal',
3503 array(
3504 'label' => __( 'Normal', 'premium-addons-for-elementor' ),
3505 )
3506 );
3507
3508 $this->add_control(
3509 'pa_nav_item_color',
3510 array(
3511 'label' => __( 'Color', 'premium-addons-for-elementor' ),
3512 'type' => Controls_Manager::COLOR,
3513 'global' => array(
3514 'default' => Global_Colors::COLOR_TEXT,
3515 ),
3516 'selectors' => array(
3517 '{{WRAPPER}} .premium-main-nav-menu > .premium-nav-menu-item > .premium-menu-link' => 'color: {{VALUE}};',
3518 ),
3519 )
3520 );
3521
3522 $this->add_responsive_control(
3523 'pa_nav_item_drop_icon_color',
3524 array(
3525 'label' => __( 'Dropdown Icon Color', 'premium-addons-for-elementor' ),
3526 'type' => Controls_Manager::COLOR,
3527 'global' => array(
3528 'default' => Global_Colors::COLOR_TEXT,
3529 ),
3530 'selectors' => array(
3531 '{{WRAPPER}} .premium-main-nav-menu > .premium-nav-menu-item > .premium-menu-link .premium-dropdown-icon' => 'color: {{VALUE}};',
3532 ),
3533 )
3534 );
3535
3536 $this->add_group_control(
3537 Premium_Background::get_type(),
3538 array(
3539 'name' => 'pa_nav_item_bg',
3540 'types' => array( 'classic', 'gradient' ),
3541 'selector' => '{{WRAPPER}} .premium-main-nav-menu > .premium-nav-menu-item > .premium-menu-link',
3542 )
3543 );
3544
3545 $this->add_control(
3546 'item_lq_effect',
3547 array(
3548 'label' => __( 'Liquid Glass Effect', 'premium-addons-for-elementor' ),
3549 'type' => Controls_Manager::SELECT,
3550 'description' => sprintf(
3551 /* translators: 1: `<a>` opening tag, 2: `</a>` closing tag. */
3552 esc_html__( 'Important: Make sure this element has a semi-transparent background color to see the effect. See all presets from %1$shere%2$s.', 'premium-addons-for-elementor' ),
3553 '<a href="https://premiumaddons.com/liquid-glass/" target="_blank">',
3554 '</a>'
3555 ),
3556 'options' => array(
3557 'none' => __( 'None', 'premium-addons-for-elementor' ),
3558 'glass1' => __( 'Preset 01', 'premium-addons-for-elementor' ),
3559 'glass2' => __( 'Preset 02', 'premium-addons-for-elementor' ),
3560 'glass3' => apply_filters( 'pa_pro_label', __( 'Preset 03 (Pro)', 'premium-addons-for-elementor' ) ),
3561 'glass4' => apply_filters( 'pa_pro_label', __( 'Preset 04 (Pro)', 'premium-addons-for-elementor' ) ),
3562 'glass5' => apply_filters( 'pa_pro_label', __( 'Preset 05 (Pro)', 'premium-addons-for-elementor' ) ),
3563 'glass6' => apply_filters( 'pa_pro_label', __( 'Preset 06 (Pro)', 'premium-addons-for-elementor' ) ),
3564 ),
3565 'default' => 'none',
3566 'label_block' => true,
3567 )
3568 );
3569
3570 $this->add_group_control(
3571 Group_Control_Text_Shadow::get_type(),
3572 array(
3573 'name' => 'pa_nav_item_shadow',
3574 'selector' => '{{WRAPPER}} .premium-main-nav-menu > .premium-nav-menu-item > .premium-menu-link',
3575 )
3576 );
3577
3578 $this->add_group_control(
3579 Group_Control_Border::get_type(),
3580 array(
3581 'name' => 'pa_nav_item_border',
3582 'selector' => '{{WRAPPER}} .premium-main-nav-menu > .premium-nav-menu-item > .premium-menu-link',
3583 )
3584 );
3585
3586 $this->add_control(
3587 'pa_nav_item_rad',
3588 array(
3589 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
3590 'type' => Controls_Manager::DIMENSIONS,
3591 'size_units' => array( 'px', 'em', '%' ),
3592 'selectors' => array(
3593 '{{WRAPPER}} .premium-main-nav-menu > .premium-nav-menu-item > .premium-menu-link' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
3594 ),
3595 )
3596 );
3597
3598 $this->add_responsive_control(
3599 'pa_nav_item_padding',
3600 array(
3601 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
3602 'type' => Controls_Manager::DIMENSIONS,
3603 'size_units' => array( 'px', 'em', '%' ),
3604 'selectors' => array(
3605 '{{WRAPPER}} .premium-main-nav-menu > .premium-nav-menu-item > .premium-menu-link' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3606 ),
3607 )
3608 );
3609
3610 $this->add_responsive_control(
3611 'pa_nav_item_margin',
3612 array(
3613 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
3614 'type' => Controls_Manager::DIMENSIONS,
3615 'size_units' => array( 'px', 'em', '%', 'custom' ),
3616 'selectors' => array(
3617 '{{WRAPPER}} .premium-main-nav-menu > .premium-nav-menu-item' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3618 ),
3619 )
3620 );
3621
3622 $this->end_controls_tab();
3623
3624 $this->start_controls_tab(
3625 'pa_nav_item_hover',
3626 array(
3627 'label' => __( 'Hover', 'premium-addons-for-elementor' ),
3628 )
3629 );
3630
3631 $this->add_control(
3632 'pa_nav_item_color_hover',
3633 array(
3634 'label' => __( 'Color', 'premium-addons-for-elementor' ),
3635 'type' => Controls_Manager::COLOR,
3636 'global' => array(
3637 'default' => Global_Colors::COLOR_SECONDARY,
3638 ),
3639 'selectors' => array(
3640 '{{WRAPPER}} .premium-main-nav-menu > .premium-nav-menu-item:hover > .premium-menu-link' => 'color: {{VALUE}};',
3641 ),
3642 )
3643 );
3644
3645 $this->add_responsive_control(
3646 'pa_nav_item_drop_icon_hover',
3647 array(
3648 'label' => __( 'Dropdown Icon Color', 'premium-addons-for-elementor' ),
3649 'type' => Controls_Manager::COLOR,
3650 'global' => array(
3651 'default' => Global_Colors::COLOR_SECONDARY,
3652 ),
3653 'selectors' => array(
3654 '{{WRAPPER}} .premium-main-nav-menu > .premium-nav-menu-item:hover > .premium-menu-link .premium-dropdown-icon' => 'color: {{VALUE}};',
3655 ),
3656 )
3657 );
3658
3659 $this->add_group_control(
3660 Premium_Background::get_type(),
3661 array(
3662 'name' => 'pa_nav_item_bg_hover',
3663 'types' => array( 'classic', 'gradient' ),
3664 'selector' => '{{WRAPPER}} .premium-main-nav-menu > .premium-nav-menu-item:hover > .premium-menu-link',
3665 )
3666 );
3667
3668 $this->add_control(
3669 'menu_item_pointer_color_hover',
3670 array(
3671 'label' => __( 'Item Hover Effect Color', 'premium-addons-for-elementor' ),
3672 'type' => Controls_Manager::COLOR,
3673 'global' => array(
3674 'default' => Global_Colors::COLOR_SECONDARY,
3675 ),
3676 'selectors' => array(
3677 '{{WRAPPER}} .premium-nav-widget-container:not(.premium-nav-pointer-framed) .premium-menu-link-parent:before,
3678 {{WRAPPER}} .premium-nav-widget-container:not(.premium-nav-pointer-framed) .premium-menu-link-parent:after' => 'background-color: {{VALUE}}',
3679 '{{WRAPPER}} .premium-nav-pointer-framed .premium-menu-link-parent:before,
3680 {{WRAPPER}} .premium-nav-pointer-framed .premium-menu-link-parent:after' => 'border-color: {{VALUE}}',
3681 ),
3682 'condition' => array(
3683 'pointer!' => array( 'none', 'text' ),
3684 ),
3685 )
3686 );
3687
3688 $this->add_group_control(
3689 Group_Control_Text_Shadow::get_type(),
3690 array(
3691 'name' => 'pa_nav_item_shadow_hover',
3692 'selector' => '{{WRAPPER}} .premium-main-nav-menu > .premium-nav-menu-item:hover > .premium-menu-link',
3693 )
3694 );
3695
3696 $this->add_group_control(
3697 Group_Control_Border::get_type(),
3698 array(
3699 'name' => 'pa_nav_item_border_hover',
3700 'selector' => '{{WRAPPER}} .premium-main-nav-menu > .premium-nav-menu-item:hover > .premium-menu-link',
3701 )
3702 );
3703
3704 $this->add_control(
3705 'pa_nav_item_rad_hover',
3706 array(
3707 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
3708 'type' => Controls_Manager::DIMENSIONS,
3709 'size_units' => array( 'px', 'em', '%' ),
3710 'selectors' => array(
3711 '{{WRAPPER}} .premium-main-nav-menu > .premium-nav-menu-item:hover > .premium-menu-link' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
3712 ),
3713 )
3714 );
3715
3716 $this->add_responsive_control(
3717 'pa_nav_item_padding_hover',
3718 array(
3719 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
3720 'type' => Controls_Manager::DIMENSIONS,
3721 'size_units' => array( 'px', 'em', '%' ),
3722 'selectors' => array(
3723 '{{WRAPPER}} .premium-main-nav-menu > .premium-nav-menu-item:hover > .premium-menu-link' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3724 ),
3725 )
3726 );
3727
3728 $this->add_responsive_control(
3729 'pa_nav_item_margin_hover',
3730 array(
3731 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
3732 'type' => Controls_Manager::DIMENSIONS,
3733 'size_units' => array( 'px', 'em', '%', 'custom' ),
3734 'selectors' => array(
3735 '{{WRAPPER}} .premium-main-nav-menu > .premium-nav-menu-item:hover' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3736 ),
3737 )
3738 );
3739
3740 $this->end_controls_tab();
3741
3742 $this->start_controls_tab(
3743 'pa_nav_item_active',
3744 array(
3745 'label' => __( 'Active', 'premium-addons-for-elementor' ),
3746 )
3747 );
3748
3749 $this->add_control(
3750 'pa_nav_item_color_active',
3751 array(
3752 'label' => __( 'Color', 'premium-addons-for-elementor' ),
3753 'type' => Controls_Manager::COLOR,
3754 'global' => array(
3755 'default' => Global_Colors::COLOR_ACCENT,
3756 ),
3757 'selectors' => array(
3758 '{{WRAPPER}} .premium-main-nav-menu > .premium-active-item > .premium-menu-link' => 'color: {{VALUE}};',
3759 ),
3760 )
3761 );
3762
3763 $this->add_responsive_control(
3764 'pa_nav_item_drop_icon_active',
3765 array(
3766 'label' => __( 'Dropdown Icon Color', 'premium-addons-for-elementor' ),
3767 'type' => Controls_Manager::COLOR,
3768 'global' => array(
3769 'default' => Global_Colors::COLOR_ACCENT,
3770 ),
3771 'selectors' => array(
3772 '{{WRAPPER}} .premium-main-nav-menu > .premium-active-item > .premium-menu-link .premium-dropdown-icon' => 'color: {{VALUE}};',
3773 ),
3774 )
3775 );
3776
3777 $this->add_group_control(
3778 Premium_Background::get_type(),
3779 array(
3780 'name' => 'pa_nav_item_bg_active',
3781 'types' => array( 'classic', 'gradient' ),
3782 'selector' => '{{WRAPPER}} .premium-main-nav-menu > .premium-active-item > .premium-menu-link',
3783 )
3784 );
3785
3786 $this->add_control(
3787 'menu_item_pointer_color_active',
3788 array(
3789 'label' => __( 'Item Hover Effect Color', 'premium-addons-for-elementor' ),
3790 'type' => Controls_Manager::COLOR,
3791 'selectors' => array(
3792 '{{WRAPPER}} .premium-nav-widget-container:not(.premium-nav-pointer-framed) .premium-active-item .premium-menu-link-parent:before,
3793 {{WRAPPER}} .premium-nav-widget-container:not(.premium-nav-pointer-framed) .premium-active-item .premium-menu-link-parent:after' => 'background-color: {{VALUE}}',
3794 '{{WRAPPER}} .premium-nav-pointer-framed .premium-active-item .premium-menu-link-parent:before,
3795 {{WRAPPER}} .premium-nav-pointer-framed .premium-active-item .premium-menu-link-parent:after' => 'border-color: {{VALUE}}',
3796 ),
3797 'condition' => array(
3798 'pointer!' => array( 'none', 'text' ),
3799 ),
3800 )
3801 );
3802
3803 $this->add_group_control(
3804 Group_Control_Text_Shadow::get_type(),
3805 array(
3806 'name' => 'pa_nav_item_shadow_active',
3807 'selector' => '{{WRAPPER}} .premium-main-nav-menu > .premium-active-item',
3808 )
3809 );
3810
3811 $this->add_group_control(
3812 Group_Control_Border::get_type(),
3813 array(
3814 'name' => 'pa_nav_item_border_active',
3815 'selector' => '{{WRAPPER}} .premium-main-nav-menu > .premium-active-item',
3816 )
3817 );
3818
3819 $this->add_control(
3820 'pa_nav_item_rad_active',
3821 array(
3822 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
3823 'type' => Controls_Manager::DIMENSIONS,
3824 'size_units' => array( 'px', 'em', '%' ),
3825 'selectors' => array(
3826 '{{WRAPPER}} .premium-main-nav-menu > .premium-active-item' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
3827 '{{WRAPPER}} .premium-main-nav-menu > .premium-active-item > .premium-menu-link' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
3828 ),
3829 )
3830 );
3831
3832 $this->add_responsive_control(
3833 'pa_nav_item_padding_active',
3834 array(
3835 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
3836 'type' => Controls_Manager::DIMENSIONS,
3837 'size_units' => array( 'px', 'em', '%' ),
3838 'selectors' => array(
3839 '{{WRAPPER}} .premium-main-nav-menu > .premium-active-item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3840 ),
3841 )
3842 );
3843
3844 $this->add_responsive_control(
3845 'pa_nav_item_margin_active',
3846 array(
3847 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
3848 'type' => Controls_Manager::DIMENSIONS,
3849 'size_units' => array( 'px', 'em', '%', 'custom' ),
3850 'selectors' => array(
3851 '{{WRAPPER}} .premium-main-nav-menu > .premium-active-item' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3852 ),
3853 )
3854 );
3855
3856 $this->end_controls_tab();
3857 $this->end_controls_tabs();
3858
3859 $this->end_controls_section();
3860 }
3861
3862 /**
3863 * Get submenu container style.
3864 *
3865 * @access private
3866 * @since 4.9.3
3867 */
3868 private function get_submenu_container_style() {
3869
3870 $this->start_controls_section(
3871 'premium_submenu_style_section',
3872 array(
3873 'label' => __( 'Submenu Style', 'premium-addons-for-elementor' ),
3874 'tab' => Controls_Manager::TAB_STYLE,
3875 )
3876 );
3877
3878 $this->start_controls_tabs( 'pa_sub_menus_style' );
3879
3880 $this->start_controls_tab(
3881 'pa_sub_simple',
3882 array(
3883 'label' => __( 'Simple Panel', 'premium-addons-for-elementor' ),
3884 )
3885 );
3886
3887 $this->add_responsive_control(
3888 'pa_sub_minwidth',
3889 array(
3890 'label' => __( 'Minimum Width', 'premium-addons-for-elementor' ),
3891 'type' => Controls_Manager::SLIDER,
3892 'label_block' => true,
3893 'size_units' => array( 'px', 'em', '%', 'custom' ),
3894 'range' => array(
3895 'px' => array(
3896 'min' => 0,
3897 'max' => 1000,
3898 ),
3899 ),
3900 'selectors' => array(
3901 '{{WRAPPER}} .premium-mobile-menu-container .premium-sub-menu,
3902 {{WRAPPER}}.premium-nav-ver .premium-nav-menu-item.menu-item-has-children .premium-sub-menu,
3903 {{WRAPPER}}.premium-nav-hor .premium-nav-menu-item.menu-item-has-children .premium-sub-menu' => 'min-width: {{SIZE}}{{UNIT}};',
3904 ),
3905 'condition' => array(
3906 'menu_type!' => 'custom',
3907 ),
3908 )
3909 );
3910
3911 $this->add_group_control(
3912 Group_Control_Box_Shadow::get_type(),
3913 array(
3914 'name' => 'pa_sub_shadow',
3915 'selector' => '{{WRAPPER}} .premium-nav-menu-container .premium-sub-menu, {{WRAPPER}} .premium-mobile-menu-container .premium-sub-menu',
3916 )
3917 );
3918
3919 $this->add_group_control(
3920 Premium_Background::get_type(),
3921 array(
3922 'name' => 'pa_sub_bg',
3923 'types' => array( 'classic', 'gradient' ),
3924 'selector' => '{{WRAPPER}} .premium-nav-menu-container .premium-sub-menu, {{WRAPPER}} .premium-mobile-menu-container .premium-sub-menu',
3925 )
3926 );
3927
3928 $this->add_control(
3929 'submenu_lq_effect',
3930 array(
3931 'label' => __( 'Liquid Glass Effect', 'premium-addons-for-elementor' ),
3932 'type' => Controls_Manager::SELECT,
3933 'description' => sprintf(
3934 /* translators: 1: `<a>` opening tag, 2: `</a>` closing tag. */
3935 esc_html__( 'Important: Make sure this element has a semi-transparent background color to see the effect. See all presets from %1$shere%2$s.', 'premium-addons-for-elementor' ),
3936 '<a href="https://premiumaddons.com/liquid-glass/" target="_blank">',
3937 '</a>'
3938 ),
3939 'options' => array(
3940 'none' => __( 'None', 'premium-addons-for-elementor' ),
3941 'glass1' => __( 'Preset 01', 'premium-addons-for-elementor' ),
3942 'glass2' => __( 'Preset 02', 'premium-addons-for-elementor' ),
3943 'glass3' => apply_filters( 'pa_pro_label', __( 'Preset 03 (Pro)', 'premium-addons-for-elementor' ) ),
3944 'glass4' => apply_filters( 'pa_pro_label', __( 'Preset 04 (Pro)', 'premium-addons-for-elementor' ) ),
3945 'glass5' => apply_filters( 'pa_pro_label', __( 'Preset 05 (Pro)', 'premium-addons-for-elementor' ) ),
3946 'glass6' => apply_filters( 'pa_pro_label', __( 'Preset 06 (Pro)', 'premium-addons-for-elementor' ) ),
3947 ),
3948 'default' => 'none',
3949 'label_block' => true,
3950 )
3951 );
3952
3953 $this->add_group_control(
3954 Group_Control_Border::get_type(),
3955 array(
3956 'name' => 'pa_sub_border',
3957 'selector' => '{{WRAPPER}} .premium-nav-menu-container .premium-sub-menu, {{WRAPPER}} .premium-mobile-menu-container .premium-sub-menu',
3958 )
3959 );
3960
3961 $this->add_control(
3962 'pa_sub_rad',
3963 array(
3964 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
3965 'type' => Controls_Manager::DIMENSIONS,
3966 'size_units' => array( 'px', 'em', '%' ),
3967 'selectors' => array(
3968 '{{WRAPPER}} .premium-nav-menu-container .premium-sub-menu, {{WRAPPER}} .premium-mobile-menu-container .premium-sub-menu' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
3969 ),
3970 )
3971 );
3972
3973 $this->add_responsive_control(
3974 'pa_sub_padding',
3975 array(
3976 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
3977 'type' => Controls_Manager::DIMENSIONS,
3978 'size_units' => array( 'px', 'em', '%' ),
3979 'selectors' => array(
3980 '{{WRAPPER}} .premium-nav-menu-container .premium-sub-menu, {{WRAPPER}} .premium-mobile-menu-container .premium-sub-menu' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3981 ),
3982 )
3983 );
3984
3985 $this->add_responsive_control(
3986 'pa_sub_margin',
3987 array(
3988 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
3989 'type' => Controls_Manager::DIMENSIONS,
3990 'size_units' => array( 'px', 'em', '%', 'custom' ),
3991 'selectors' => array(
3992 '{{WRAPPER}} .premium-nav-menu-container .premium-sub-menu, {{WRAPPER}} .premium-mobile-menu-container .premium-sub-menu' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3993 ),
3994 )
3995 );
3996
3997 $this->end_controls_tab();
3998
3999 $this->start_controls_tab(
4000 'pa_sub_mega',
4001 array(
4002 'label' => __( 'Mega Panel', 'premium-addons-for-elementor' ),
4003 )
4004 );
4005
4006 $mega_pos = is_rtl() ? 'right' : 'left';
4007
4008 $this->add_responsive_control(
4009 'pa_sub_mega_offset',
4010 array(
4011 'label' => __( 'Offset', 'premium-addons-for-elementor' ),
4012 'type' => Controls_Manager::SLIDER,
4013 'label_block' => true,
4014 'size_units' => array( 'px', '%' ),
4015 'range' => array(
4016 'px' => array(
4017 'min' => -1000,
4018 'max' => 2000,
4019 ),
4020 '%' => array(
4021 'min' => -100,
4022 'max' => 100,
4023 ),
4024 ),
4025 'selectors' => array(
4026 '{{WRAPPER}}.premium-nav-hor .premium-nav-menu-container .premium-mega-content-container' => $mega_pos . ': {{SIZE}}{{UNIT}};',
4027 '{{WRAPPER}}.premium-nav-ver .premium-nav-menu-container .premium-mega-content-container' => 'top: {{SIZE}}{{UNIT}};',
4028 ),
4029 'condition' => array(
4030 'menu_type!' => 'custom',
4031 ),
4032 )
4033 );
4034
4035 $this->add_group_control(
4036 Group_Control_Box_Shadow::get_type(),
4037 array(
4038 'name' => 'pa_sub_mega_shadow',
4039 'selector' => '{{WRAPPER}} .premium-nav-menu-container .premium-mega-content-container, {{WRAPPER}} .premium-mobile-menu-container .premium-mega-content-container',
4040 )
4041 );
4042
4043 $this->add_group_control(
4044 Premium_Background::get_type(),
4045 array(
4046 'name' => 'pa_sub_mega_bg',
4047 'types' => array( 'classic', 'gradient' ),
4048 'selector' => '{{WRAPPER}} .premium-nav-menu-container .premium-mega-content-container, {{WRAPPER}} .premium-mobile-menu-container .premium-mega-content-container',
4049 )
4050 );
4051
4052 $this->add_control(
4053 'mega_lq_effect',
4054 array(
4055 'label' => __( 'Liquid Glass Effect', 'premium-addons-for-elementor' ),
4056 'type' => Controls_Manager::SELECT,
4057 'description' => sprintf(
4058 /* translators: 1: `<a>` opening tag, 2: `</a>` closing tag. */
4059 esc_html__( 'Important: Make sure this element has a semi-transparent background color to see the effect. See all presets from %1$shere%2$s.', 'premium-addons-for-elementor' ),
4060 '<a href="https://premiumaddons.com/liquid-glass/" target="_blank">',
4061 '</a>'
4062 ),
4063 'options' => array(
4064 'none' => __( 'None', 'premium-addons-for-elementor' ),
4065 'glass1' => __( 'Preset 01', 'premium-addons-for-elementor' ),
4066 'glass2' => __( 'Preset 02', 'premium-addons-for-elementor' ),
4067 'glass3' => apply_filters( 'pa_pro_label', __( 'Preset 03 (Pro)', 'premium-addons-for-elementor' ) ),
4068 'glass4' => apply_filters( 'pa_pro_label', __( 'Preset 04 (Pro)', 'premium-addons-for-elementor' ) ),
4069 'glass5' => apply_filters( 'pa_pro_label', __( 'Preset 05 (Pro)', 'premium-addons-for-elementor' ) ),
4070 'glass6' => apply_filters( 'pa_pro_label', __( 'Preset 06 (Pro)', 'premium-addons-for-elementor' ) ),
4071 ),
4072 'default' => 'none',
4073 'label_block' => true,
4074 'condition' => array(
4075 'menu_type' => 'custom',
4076 ),
4077 )
4078 );
4079
4080 $this->add_group_control(
4081 Group_Control_Border::get_type(),
4082 array(
4083 'name' => 'pa_sub_mega_border',
4084 'selector' => '{{WRAPPER}} .premium-nav-menu-container .premium-mega-content-container, {{WRAPPER}} .premium-mobile-menu-container .premium-mega-content-container',
4085 )
4086 );
4087
4088 $this->add_control(
4089 'pa_sub_mega_rad',
4090 array(
4091 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
4092 'type' => Controls_Manager::DIMENSIONS,
4093 'size_units' => array( 'px', 'em', '%' ),
4094 'selectors' => array(
4095 '{{WRAPPER}} .premium-nav-menu-container .premium-mega-content-container, {{WRAPPER}} .premium-mobile-menu-container .premium-mega-content-container' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
4096 ),
4097 )
4098 );
4099
4100 $this->add_responsive_control(
4101 'pa_sub_mega_padding',
4102 array(
4103 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
4104 'type' => Controls_Manager::DIMENSIONS,
4105 'size_units' => array( 'px', 'em', '%' ),
4106 'selectors' => array(
4107 '{{WRAPPER}} .premium-nav-menu-container .premium-mega-content-container, {{WRAPPER}} .premium-mobile-menu-container .premium-mega-content-container' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4108 ),
4109 )
4110 );
4111
4112 $this->add_responsive_control(
4113 'pa_sub_mega_margin',
4114 array(
4115 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
4116 'type' => Controls_Manager::DIMENSIONS,
4117 'size_units' => array( 'px', 'em', '%', 'custom' ),
4118 'selectors' => array(
4119 '{{WRAPPER}} .premium-nav-menu-container .premium-mega-content-container, {{WRAPPER}} .premium-mobile-menu-container .premium-mega-content-container' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4120 ),
4121 )
4122 );
4123
4124 $this->end_controls_tab();
4125 $this->end_controls_tabs();
4126
4127 $this->end_controls_section();
4128 }
4129
4130 /**
4131 * Get submenu item style.
4132 *
4133 * @access private
4134 * @since 4.9.3
4135 */
4136 private function get_submenu_item_style() {
4137
4138 $this->start_controls_section(
4139 'premium_submenu_item_style_section',
4140 array(
4141 'label' => __( 'Submenu Item Style', 'premium-addons-for-elementor' ),
4142 'tab' => Controls_Manager::TAB_STYLE,
4143 )
4144 );
4145
4146 $this->add_group_control(
4147 Group_Control_Typography::get_type(),
4148 array(
4149 'name' => 'pa_sub_item_typo',
4150 'global' => array(
4151 'default' => Global_Typography::TYPOGRAPHY_TEXT,
4152 ),
4153 'selector' => '{{WRAPPER}} .premium-main-nav-menu .premium-sub-menu .premium-sub-menu-link',
4154 )
4155 );
4156
4157 $this->add_responsive_control(
4158 'pa_sub_item_drop_icon_size',
4159 array(
4160 'label' => __( 'Dropdown Icon Size', 'premium-addons-for-elementor' ),
4161 'type' => Controls_Manager::SLIDER,
4162 'size_units' => array( 'px', 'em' ),
4163 'selectors' => array(
4164 '{{WRAPPER}} .premium-main-nav-menu .premium-sub-menu .premium-sub-menu-link .premium-dropdown-icon' => 'font-size: {{SIZE}}{{UNIT}};',
4165 ),
4166 'condition' => array(
4167 'menu_type!' => 'custom',
4168 ),
4169 )
4170 );
4171
4172 $this->add_responsive_control(
4173 'pa_sub_item_drop_icon_margin',
4174 array(
4175 'label' => __( 'Dropdown Icon Margin', 'premium-addons-for-elementor' ),
4176 'type' => Controls_Manager::DIMENSIONS,
4177 'size_units' => array( 'px', 'em', '%', 'custom' ),
4178 'selectors' => array(
4179 '{{WRAPPER}} .premium-main-nav-menu .premium-sub-menu .premium-sub-menu-link .premium-dropdown-icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4180 ),
4181 'condition' => array(
4182 'menu_type!' => 'custom',
4183 ),
4184 )
4185 );
4186
4187 $this->start_controls_tabs( 'pa_sub_items_styles' );
4188
4189 $this->start_controls_tab(
4190 'pa_sub_item_normal',
4191 array(
4192 'label' => __( 'Normal', 'premium-addons-for-elementor' ),
4193 )
4194 );
4195
4196 $this->add_control(
4197 'pa_sub_item_color',
4198 array(
4199 'label' => __( 'Color', 'premium-addons-for-elementor' ),
4200 'type' => Controls_Manager::COLOR,
4201 'global' => array(
4202 'default' => Global_Colors::COLOR_SECONDARY,
4203 ),
4204 'selectors' => array(
4205 '{{WRAPPER}} .premium-main-nav-menu .premium-sub-menu .premium-sub-menu-link' => 'color: {{VALUE}};',
4206 ),
4207 )
4208 );
4209
4210 $this->add_responsive_control(
4211 'pa_sub_item_drop_icon_color',
4212 array(
4213 'label' => __( 'Dropdown Icon Color', 'premium-addons-for-elementor' ),
4214 'type' => Controls_Manager::COLOR,
4215 'global' => array(
4216 'default' => Global_Colors::COLOR_SECONDARY,
4217 ),
4218 'selectors' => array(
4219 '{{WRAPPER}} .premium-main-nav-menu .premium-sub-menu .premium-sub-menu-link .premium-dropdown-icon' => 'color: {{VALUE}};',
4220 ),
4221 'condition' => array(
4222 'menu_type!' => 'custom',
4223 ),
4224 )
4225 );
4226
4227 $this->add_group_control(
4228 Premium_Background::get_type(),
4229 array(
4230 'name' => 'pa_sub_item_bg',
4231 'types' => array( 'classic', 'gradient' ),
4232 'selector' => '{{WRAPPER}} .premium-main-nav-menu .premium-sub-menu .premium-sub-menu-item',
4233 )
4234 );
4235
4236 $this->add_group_control(
4237 Group_Control_Text_Shadow::get_type(),
4238 array(
4239 'name' => 'pa_sub_item_shadow',
4240 'selector' => '{{WRAPPER}} .premium-main-nav-menu .premium-sub-menu .premium-sub-menu-item',
4241 )
4242 );
4243
4244 $this->add_group_control(
4245 Group_Control_Border::get_type(),
4246 array(
4247 'name' => 'pa_sub_item_border',
4248 'selector' => '{{WRAPPER}} .premium-main-nav-menu .premium-sub-menu .premium-sub-menu-item',
4249 )
4250 );
4251
4252 $this->add_control(
4253 'pa_sub_item_rad',
4254 array(
4255 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
4256 'type' => Controls_Manager::DIMENSIONS,
4257 'size_units' => array( 'px', 'em', '%' ),
4258 'selectors' => array(
4259 '{{WRAPPER}} .premium-main-nav-menu .premium-sub-menu .premium-sub-menu-item' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
4260 ),
4261 )
4262 );
4263
4264 $this->add_responsive_control(
4265 'pa_sub_item_padding',
4266 array(
4267 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
4268 'type' => Controls_Manager::DIMENSIONS,
4269 'size_units' => array( 'px', 'em', '%' ),
4270 'selectors' => array(
4271 '{{WRAPPER}} .premium-main-nav-menu .premium-sub-menu .premium-sub-menu-item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4272 ),
4273 )
4274 );
4275
4276 $this->add_responsive_control(
4277 'pa_sub_item_margin',
4278 array(
4279 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
4280 'type' => Controls_Manager::DIMENSIONS,
4281 'size_units' => array( 'px', 'em', '%', 'custom' ),
4282 'selectors' => array(
4283 '{{WRAPPER}} .premium-main-nav-menu .premium-sub-menu .premium-sub-menu-item' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4284 ),
4285 )
4286 );
4287
4288 $this->end_controls_tab();
4289
4290 $this->start_controls_tab(
4291 'pa_sub_item_hover',
4292 array(
4293 'label' => __( 'Hover', 'premium-addons-for-elementor' ),
4294 )
4295 );
4296
4297 $this->add_control(
4298 'pa_sub_item_color_hover',
4299 array(
4300 'label' => __( 'Color', 'premium-addons-for-elementor' ),
4301 'type' => Controls_Manager::COLOR,
4302 'default' => '#fff',
4303 'selectors' => array(
4304 '{{WRAPPER}} .premium-main-nav-menu .premium-sub-menu-item:hover > .premium-sub-menu-link' => 'color: {{VALUE}};',
4305 ),
4306 )
4307 );
4308
4309 $this->add_responsive_control(
4310 'pa_sub_item_drop_icon_hover',
4311 array(
4312 'label' => __( 'Dropdown Icon Color', 'premium-addons-for-elementor' ),
4313 'type' => Controls_Manager::COLOR,
4314 'default' => '#fff',
4315 'selectors' => array(
4316 '{{WRAPPER}} .premium-main-nav-menu .premium-sub-menu-item:hover > .premium-sub-menu-link .premium-dropdown-icon' => 'color: {{VALUE}};',
4317 ),
4318 'condition' => array(
4319 'menu_type!' => 'custom',
4320 ),
4321 )
4322 );
4323
4324 $this->add_group_control(
4325 Premium_Background::get_type(),
4326 array(
4327 'name' => 'pa_sub_item_bg_hover',
4328 'types' => array( 'classic', 'gradient' ),
4329 'selector' => '{{WRAPPER}}:not(.premium-hamburger-menu):not(.premium-nav-slide):not(.premium-nav-dropdown) .premium-main-nav-menu .premium-sub-menu .premium-sub-menu-item:hover,
4330 {{WRAPPER}}.premium-hamburger-menu .premium-main-nav-menu .premium-sub-menu > .premium-sub-menu-item:hover > .premium-sub-menu-link,
4331 {{WRAPPER}}.premium-nav-slide .premium-main-nav-menu .premium-sub-menu > .premium-sub-menu-item:hover > .premium-sub-menu-link,
4332 {{WRAPPER}}.premium-nav-dropdown .premium-main-nav-menu .premium-sub-menu > .premium-sub-menu-item:hover > .premium-sub-menu-link',
4333 'fields_options' => array(
4334 'background' => array(
4335 'default' => 'classic',
4336 ),
4337 'color' => array(
4338 'global' => array(
4339 'default' => Global_Colors::COLOR_SECONDARY,
4340 ),
4341 ),
4342 ),
4343 )
4344 );
4345
4346 $this->add_group_control(
4347 Group_Control_Text_Shadow::get_type(),
4348 array(
4349 'name' => 'pa_sub_item_shadow_hover',
4350 'selector' => '{{WRAPPER}} .premium-main-nav-menu .premium-sub-menu .premium-sub-menu-item:hover',
4351 )
4352 );
4353
4354 $this->add_group_control(
4355 Group_Control_Border::get_type(),
4356 array(
4357 'name' => 'pa_sub_item_border_hover',
4358 'selector' => '{{WRAPPER}} .premium-main-nav-menu .premium-sub-menu .premium-sub-menu-item:hover',
4359 )
4360 );
4361
4362 $this->add_control(
4363 'pa_sub_item_rad_hover',
4364 array(
4365 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
4366 'type' => Controls_Manager::DIMENSIONS,
4367 'size_units' => array( 'px', 'em', '%' ),
4368 'selectors' => array(
4369 '{{WRAPPER}} .premium-main-nav-menu .premium-sub-menu .premium-sub-menu-item:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
4370 ),
4371 )
4372 );
4373
4374 $this->add_responsive_control(
4375 'pa_sub_item_padding_hover',
4376 array(
4377 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
4378 'type' => Controls_Manager::DIMENSIONS,
4379 'size_units' => array( 'px', 'em', '%' ),
4380 'selectors' => array(
4381 '{{WRAPPER}} .premium-main-nav-menu .premium-sub-menu .premium-sub-menu-item:hover' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4382 ),
4383 )
4384 );
4385
4386 $this->add_responsive_control(
4387 'pa_sub_item_margin_hover',
4388 array(
4389 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
4390 'type' => Controls_Manager::DIMENSIONS,
4391 'size_units' => array( 'px', 'em', '%', 'custom' ),
4392 'selectors' => array(
4393 '{{WRAPPER}} .premium-main-nav-menu .premium-sub-menu .premium-sub-menu-item:hover' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4394 ),
4395 )
4396 );
4397
4398 $this->end_controls_tab();
4399
4400 $this->start_controls_tab(
4401 'pa_sub_item_active',
4402 array(
4403 'label' => __( 'Active', 'premium-addons-for-elementor' ),
4404 )
4405 );
4406
4407 $this->add_control(
4408 'pa_sub_item_color_active',
4409 array(
4410 'label' => __( 'Color', 'premium-addons-for-elementor' ),
4411 'type' => Controls_Manager::COLOR,
4412 'selectors' => array(
4413 '{{WRAPPER}} .premium-main-nav-menu .premium-sub-menu .premium-active-item .premium-sub-menu-link' => 'color: {{VALUE}};',
4414 ),
4415 )
4416 );
4417
4418 $this->add_responsive_control(
4419 'pa_sub_item_drop_icon_active',
4420 array(
4421 'label' => __( 'Dropdown Icon Color', 'premium-addons-for-elementor' ),
4422 'type' => Controls_Manager::COLOR,
4423 'global' => array(
4424 'default' => Global_Colors::COLOR_PRIMARY,
4425 ),
4426 'selectors' => array(
4427 '{{WRAPPER}} .premium-main-nav-menu .premium-sub-menu .premium-active-item .premium-sub-menu-link .premium-dropdown-icon' => 'color: {{VALUE}};',
4428 ),
4429 'condition' => array(
4430 'menu_type!' => 'custom',
4431 ),
4432 )
4433 );
4434
4435 $this->add_group_control(
4436 Premium_Background::get_type(),
4437 array(
4438 'name' => 'pa_sub_item_bg_active',
4439 'types' => array( 'classic', 'gradient' ),
4440 'selector' => '{{WRAPPER}} .premium-main-nav-menu .premium-sub-menu .premium-active-item',
4441 )
4442 );
4443
4444 $this->add_group_control(
4445 Group_Control_Text_Shadow::get_type(),
4446 array(
4447 'name' => 'pa_sub_item_shadow_active',
4448 'selector' => '{{WRAPPER}} .premium-main-nav-menu .premium-sub-menu .premium-active-item',
4449 )
4450 );
4451
4452 $this->add_group_control(
4453 Group_Control_Border::get_type(),
4454 array(
4455 'name' => 'pa_sub_item_border_active',
4456 'selector' => '{{WRAPPER}} .premium-main-nav-menu .premium-sub-menu .premium-active-item',
4457 )
4458 );
4459
4460 $this->add_control(
4461 'pa_sub_item_rad_active',
4462 array(
4463 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
4464 'type' => Controls_Manager::DIMENSIONS,
4465 'size_units' => array( 'px', 'em', '%' ),
4466 'selectors' => array(
4467 '{{WRAPPER}} .premium-main-nav-menu .premium-sub-menu .premium-active-item' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
4468 ),
4469 )
4470 );
4471
4472 $this->add_responsive_control(
4473 'pa_sub_item_padding_active',
4474 array(
4475 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
4476 'type' => Controls_Manager::DIMENSIONS,
4477 'size_units' => array( 'px', 'em', '%' ),
4478 'selectors' => array(
4479 '{{WRAPPER}} .premium-main-nav-menu .premium-sub-menu .premium-active-item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4480 ),
4481 )
4482 );
4483
4484 $this->add_responsive_control(
4485 'pa_sub_item_margin_active',
4486 array(
4487 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
4488 'type' => Controls_Manager::DIMENSIONS,
4489 'size_units' => array( 'px', 'em', '%', 'custom' ),
4490 'selectors' => array(
4491 '{{WRAPPER}} .premium-main-nav-menu .premium-sub-menu .premium-active-item' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4492 ),
4493 )
4494 );
4495
4496 $this->end_controls_tab();
4497
4498 $this->end_controls_tabs();
4499
4500 $this->end_controls_section();
4501 }
4502
4503 /**
4504 * Get Submenu Item Extras.
4505 * Adds Submenu Items' Icon & Badge Style.
4506 *
4507 * @access private
4508 * @since 4.9.4
4509 */
4510 private function get_sub_menu_item_extras() {
4511
4512 $this->start_controls_section(
4513 'premium_sub_extra_style',
4514 array(
4515 'label' => __( 'Submenu Item Icon & Badge', 'premium-addons-for-elementor' ),
4516 'tab' => Controls_Manager::TAB_STYLE,
4517 )
4518 );
4519
4520 $this->start_controls_tabs( 'pa_sub_items_extras' );
4521
4522 $this->start_controls_tab(
4523 'pa_sub_icon_style',
4524 array(
4525 'label' => __( 'Icon', 'premium-addons-for-elementor' ),
4526 )
4527 );
4528
4529 $left_order = is_rtl() ? '1' : '0';
4530 $right_order = is_rtl() ? '0' : '1';
4531 $default = is_rtl() ? $right_order : $left_order;
4532
4533 $this->add_responsive_control(
4534 'pa_sub_icon_pos',
4535 array(
4536 'label' => __( 'Position', 'premium-addons-for-elementor' ),
4537 'type' => Controls_Manager::CHOOSE,
4538 'options' => array(
4539 $left_order => array(
4540 'title' => __( 'Left', 'premium-addons-for-elementor' ),
4541 'icon' => 'eicon-h-align-left',
4542 ),
4543 $right_order => array(
4544 'title' => __( 'Right', 'premium-addons-for-elementor' ),
4545 'icon' => 'eicon-h-align-right',
4546 ),
4547 ),
4548 'default' => $default,
4549 'toggle' => false,
4550 'selectors' => array(
4551 '{{WRAPPER}} .premium-sub-menu-item .premium-sub-menu-link .premium-sub-item-icon' => 'order: {{VALUE}}',
4552 ),
4553 )
4554 );
4555
4556 $this->add_control(
4557 'sub_item_icon_color',
4558 array(
4559 'label' => __( 'Color', 'premium-addons-for-elementor' ),
4560 'type' => Controls_Manager::COLOR,
4561 'global' => array(
4562 'default' => Global_Colors::COLOR_PRIMARY,
4563 ),
4564 'selectors' => array(
4565 '{{WRAPPER}} .premium-sub-menu-item .premium-sub-menu-link i.premium-sub-item-icon ' => 'color: {{VALUE}};',
4566 '{{WRAPPER}} .premium-sub-menu-item .premium-sub-menu-link .premium-sub-item-icon:not(.premium-lottie-animation) svg *,
4567 {{WRAPPER}} .premium-sub-menu-item .premium-sub-menu-link svg.premium-sub-item-icon * ' => 'fill: {{VALUE}};',
4568 ),
4569 'condition' => array(
4570 'menu_type' => 'custom',
4571 ),
4572 )
4573 );
4574
4575 $this->add_responsive_control(
4576 'pa_sub_icon_size',
4577 array(
4578 'label' => __( 'Size', 'premium-addons-for-elementor' ),
4579 'type' => Controls_Manager::SLIDER,
4580 'label_block' => true,
4581 'size_units' => array( 'px' ),
4582 'range' => array(
4583 'px' => array(
4584 'min' => 0,
4585 'max' => 300,
4586 ),
4587 ),
4588 'selectors' => array(
4589 '{{WRAPPER}} .premium-sub-menu-item .premium-sub-menu-link i.premium-sub-item-icon ' => 'font-size: {{SIZE}}{{UNIT}};',
4590 '{{WRAPPER}} .premium-sub-menu-item .premium-sub-menu-link .premium-sub-item-icon.dashicons, {{WRAPPER}} .premium-sub-menu-item .premium-sub-menu-link img.premium-sub-item-icon, {{WRAPPER}} .premium-sub-menu-item .premium-sub-menu-link .premium-sub-item-icon svg, {{WRAPPER}} .premium-sub-menu-item .premium-sub-menu-link svg.premium-sub-item-icon, {{WRAPPER}} .premium-sub-menu-item .premium-sub-menu-link .premium-sub-item-icon.premium-lottie-animation' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
4591 ),
4592 )
4593 );
4594
4595 $this->add_control(
4596 'sub_item_icon_back_color',
4597 array(
4598 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
4599 'type' => Controls_Manager::COLOR,
4600 'selectors' => array(
4601 '{{WRAPPER}} .premium-sub-menu-item .premium-sub-menu-link .premium-sub-item-icon' => 'background-color: {{VALUE}};',
4602 ),
4603 )
4604 );
4605
4606 $this->add_control(
4607 'sub_item_icon_radius',
4608 array(
4609 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
4610 'type' => Controls_Manager::DIMENSIONS,
4611 'size_units' => array( 'px', 'em', '%' ),
4612 'selectors' => array(
4613 '{{WRAPPER}} .premium-sub-menu-item .premium-sub-menu-link .premium-sub-item-icon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
4614 ),
4615 )
4616 );
4617
4618 $this->add_responsive_control(
4619 'pa_sub_icon_margin',
4620 array(
4621 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
4622 'type' => Controls_Manager::DIMENSIONS,
4623 'size_units' => array( 'px', 'em', '%', 'custom' ),
4624 'selectors' => array(
4625 '{{WRAPPER}} .premium-sub-menu-item .premium-sub-menu-link .premium-sub-item-icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4626 ),
4627 )
4628 );
4629
4630 $this->add_responsive_control(
4631 'pa_sub_icon_padding',
4632 array(
4633 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
4634 'type' => Controls_Manager::DIMENSIONS,
4635 'size_units' => array( 'px', 'em', '%' ),
4636 'selectors' => array(
4637 '{{WRAPPER}} .premium-sub-menu-item .premium-sub-menu-link .premium-sub-item-icon' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4638 ),
4639 )
4640 );
4641
4642 $this->end_controls_tab();
4643
4644 $this->start_controls_tab(
4645 'pa_sub_badge_style',
4646 array(
4647 'label' => __( 'Badge', 'premium-addons-for-elementor' ),
4648 )
4649 );
4650
4651 $this->add_group_control(
4652 Group_Control_Typography::get_type(),
4653 array(
4654 'name' => 'pa_sub_badge_typo',
4655 'selector' => '{{WRAPPER}} .premium-sub-menu-item .premium-sub-menu-link .premium-sub-item-badge, {{WRAPPER}} .premium-sub-menu-item .premium-rn-badge, {{WRAPPER}} .premium-mega-content-container .premium-rn-badge',
4656 )
4657 );
4658
4659 $this->add_control(
4660 'sub_item_badge_color',
4661 array(
4662 'label' => __( 'Color', 'premium-addons-for-elementor' ),
4663 'type' => Controls_Manager::COLOR,
4664 'selectors' => array(
4665 '{{WRAPPER}} .premium-sub-menu-item .premium-sub-menu-link .premium-sub-item-badge, {{WRAPPER}} .premium-sub-menu-item .premium-rn-badge, {{WRAPPER}} .premium-mega-content-container .premium-rn-badge' => 'color: {{VALUE}};',
4666 ),
4667 'condition' => array(
4668 'menu_type' => 'custom',
4669 ),
4670 )
4671 );
4672
4673 $this->add_control(
4674 'sub_item_badge_back_color',
4675 array(
4676 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
4677 'type' => Controls_Manager::COLOR,
4678 'selectors' => array(
4679 '{{WRAPPER}} .premium-sub-menu-item .premium-sub-menu-link .premium-sub-item-badge, {{WRAPPER}} .premium-sub-menu-item .premium-rn-badge, {{WRAPPER}} .premium-mega-content-container .premium-rn-badge' => 'background-color: {{VALUE}};',
4680 ),
4681 'condition' => array(
4682 'menu_type' => 'custom',
4683 ),
4684 )
4685 );
4686
4687 // TODO: check the all the badges CSS.
4688 $badge_pos = is_rtl() ? 'left' : 'right';
4689
4690 $this->add_responsive_control(
4691 'pa_sub_badge_hor',
4692 array(
4693 'label' => __( 'Horizontal Offset', 'premium-addons-for-elementor' ),
4694 'type' => Controls_Manager::SLIDER,
4695 'label_block' => true,
4696 'size_units' => array( 'px', '%' ),
4697 'range' => array(
4698 'px' => array(
4699 'min' => 0,
4700 'max' => 1000,
4701 ),
4702 ),
4703 'selectors' => array(
4704 '{{WRAPPER}}:not(.premium-nav-ver) .premium-sub-menu-item .premium-sub-menu-link .premium-sub-item-badge, {{WRAPPER}}:not(.premium-nav-ver) .premium-sub-menu-item .premium-rn-badge, {{WRAPPER}} .premium-mega-content-container .premium-rn-badge' => $badge_pos . ' : {{SIZE}}{{UNIT}};',
4705 '{{WRAPPER}}.premium-nav-ver.premium-vertical-right .premium-sub-menu-item .premium-sub-menu-link .premium-sub-item-badge, {{WRAPPER}}.premium-nav-ver.premium-vertical-right .premium-sub-menu-item .premium-rn-badge' => 'right: {{SIZE}}{{UNIT}};',
4706 '{{WRAPPER}}.premium-nav-ver.premium-vertical-left .premium-sub-menu-item .premium-sub-menu-link .premium-sub-item-badge, {{WRAPPER}}.premium-nav-ver.premium-vertical-left .premium-sub-menu-item .premium-rn-badge' => 'left: {{SIZE}}{{UNIT}};',
4707 ),
4708 )
4709 );
4710
4711 $this->add_responsive_control(
4712 'pa_sub_badge_ver',
4713 array(
4714 'label' => __( 'Vertical Offset', 'premium-addons-for-elementor' ),
4715 'type' => Controls_Manager::SLIDER,
4716 'label_block' => true,
4717 'size_units' => array( 'px', '%' ),
4718 'range' => array(
4719 'px' => array(
4720 'min' => 0,
4721 'max' => 1000,
4722 ),
4723 ),
4724 'selectors' => array(
4725 '{{WRAPPER}} .premium-sub-menu-item .premium-sub-menu-link .premium-sub-item-badge, {{WRAPPER}} .premium-sub-menu-item .premium-rn-badge, {{WRAPPER}} .premium-mega-content-container .premium-rn-badge' => 'top: {{SIZE}}{{UNIT}};',
4726 ),
4727 )
4728 );
4729
4730 $this->add_group_control(
4731 Group_Control_Border::get_type(),
4732 array(
4733 'name' => 'pa_sub_badge_border',
4734 'selector' => '{{WRAPPER}} .premium-sub-menu-item .premium-sub-menu-link .premium-sub-item-badge, {{WRAPPER}} .premium-sub-menu-item .premium-rn-badge, {{WRAPPER}} .premium-mega-content-container .premium-rn-badge',
4735 )
4736 );
4737
4738 $this->add_control(
4739 'pa_sub_badge_rad',
4740 array(
4741 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
4742 'type' => Controls_Manager::DIMENSIONS,
4743 'size_units' => array( 'px', 'em', '%' ),
4744 'selectors' => array(
4745 '{{WRAPPER}} .premium-sub-menu-item .premium-sub-menu-link .premium-sub-item-badge, {{WRAPPER}} .premium-sub-menu-item .premium-rn-badge, {{WRAPPER}} .premium-mega-content-container .premium-rn-badge' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
4746 ),
4747 )
4748 );
4749
4750 $this->add_responsive_control(
4751 'pa_sub_badge_padding',
4752 array(
4753 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
4754 'type' => Controls_Manager::DIMENSIONS,
4755 'size_units' => array( 'px', 'em', '%' ),
4756 'selectors' => array(
4757 '{{WRAPPER}} .premium-sub-menu-item .premium-sub-menu-link .premium-sub-item-badge,
4758 {{WRAPPER}} .premium-sub-menu-item .premium-rn-badge,
4759 {{WRAPPER}} .premium-mega-content-container .premium-rn-badge' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4760 ),
4761 )
4762 );
4763
4764 $this->end_controls_tab();
4765 $this->end_controls_tabs();
4766
4767 $this->end_controls_section();
4768 }
4769
4770 /**
4771 * Render Nav Menu widget output on the frontend.
4772 *
4773 * Written in PHP and used to generate the final HTML.
4774 *
4775 * @since 1.0.0
4776 * @access protected
4777 */
4778 protected function render() {
4779
4780 $settings = $this->get_settings_for_display();
4781
4782 $menu_type = $settings['menu_type'];
4783
4784 $menu_id = ( 'wordpress_menu' === $menu_type && isset( $settings['pa_nav_menus'] ) ) ? $settings['pa_nav_menus'] : false;
4785
4786 $render_mobile_menu = 'yes' === $settings['render_mobile_menu'] || in_array( $settings['pa_nav_menu_layout'], array( 'slide', 'dropdown' ), true );
4787
4788 $papro_activated = Helper_Functions::check_papro_version() && version_compare( PREMIUM_PRO_ADDONS_VERSION, '2.8.9', '>' );
4789
4790 $rn_badges_enabled = ( $papro_activated && 'yes' === $settings['rn_badge_enabled'] ) ? true : false;
4791
4792 if ( 'wordpress_menu' === $menu_type ) {
4793
4794 if ( ! $this->is_valid_menu( $menu_id ) ) {
4795 ?>
4796 <div class="premium-error-notice">
4797 <?php echo esc_html( __( 'This is an empty menu. Please make sure your menu has items.', 'premium-addons-for-elementor' ) ); ?>
4798 </div>
4799 <?php
4800
4801 return;
4802 }
4803 }
4804
4805 $break_point = 'custom' === $settings['pa_mobile_menu_breakpoint'] ? $settings['pa_custom_breakpoint'] : $settings['pa_mobile_menu_breakpoint'];
4806
4807 $break_point = '' === $break_point ? '1025' : $break_point;
4808
4809 $stretch_dropdown = 'yes' === $settings['pa_toggle_full'];
4810
4811 $close_after_click = 'yes' === $settings['close_after_click'];
4812
4813 $is_click = 'click' === $settings['pa_ver_toggle_event'] && 'yes' !== $settings['pa_ver_toggle_open'];
4814
4815 $is_hover = 'hover' === $settings['pa_ver_toggle_event'];
4816
4817 if ( 'wordpress_menu' === $menu_type ) {
4818
4819 $menu_list = $this->get_menu_list();
4820
4821 if ( ! $menu_list ) {
4822 return;
4823 }
4824 }
4825
4826 $div_end = '';
4827
4828 $menu_settings = array(
4829 'breakpoint' => (int) $break_point,
4830 'mobileLayout' => $settings['pa_mobile_menu_layout'],
4831 'mainLayout' => $settings['pa_nav_menu_layout'],
4832 'stretchDropdown' => $stretch_dropdown,
4833 'hoverEffect' => $settings['sub_badge_hv_effects'],
4834 'submenuEvent' => $settings['submenu_event'],
4835 'submenuTrigger' => $settings['submenu_trigger'],
4836 'closeAfterClick' => $close_after_click,
4837 'renderMobileMenu' => $render_mobile_menu,
4838 );
4839
4840 if ( 'yes' === $settings['pa_sticky_switcher'] ) {
4841
4842 $sticky_options = array(
4843 'targetId' => $settings['pa_sticky_target'],
4844 'onScroll' => 'yes' === $settings['pa_sticky_on_scroll'] ? true : false,
4845 'disableOn' => $settings['pa_sticky_disabled_on'],
4846 );
4847
4848 $menu_settings['stickyOptions'] = $sticky_options;
4849 }
4850
4851 if ( $rn_badges_enabled ) {
4852
4853 $rn_badges_settings = apply_filters( 'pa_get_random_badges_settings', $settings );
4854
4855 $menu_settings['rn_badges'] = $rn_badges_settings;
4856 }
4857
4858 $is_edit_mode = \Elementor\Plugin::$instance->editor->is_edit_mode();
4859
4860 $this->add_render_attribute(
4861 'wrapper',
4862 array(
4863 'data-settings' => wp_json_encode( $menu_settings ),
4864 'class' => array(
4865 'premium-nav-widget-container',
4866 'premium-nav-pointer-' . $settings['pointer'],
4867 ),
4868 )
4869 );
4870
4871 if ( 'yes' === $settings['load_hidden'] ) {
4872 $hidden_style = $is_edit_mode ? '' : 'visibility:hidden; opacity:0;';
4873
4874 $this->add_render_attribute( 'wrapper', 'style', $hidden_style );
4875 }
4876
4877 if ( $stretch_dropdown ) {
4878 $this->add_render_attribute( 'wrapper', 'class', 'premium-stretch-dropdown' );
4879 }
4880
4881 if ( 'yes' === $settings['pa_ver_toggle_switcher'] && ( $is_click || $is_hover ) ) {
4882 $this->add_render_attribute( 'wrapper', 'class', 'premium-ver-collapsed' );
4883 }
4884
4885 switch ( $settings['pointer'] ) {
4886 case 'underline':
4887 case 'overline':
4888 case 'double-line':
4889 $this->add_render_attribute( 'wrapper', 'class', 'premium-nav-animation-' . $settings['animation_line'] );
4890 break;
4891 case 'framed':
4892 $this->add_render_attribute( 'wrapper', 'class', 'premium-nav-animation-' . $settings['animation_framed'] );
4893 break;
4894 case 'text':
4895 $this->add_render_attribute( 'wrapper', 'class', 'premium-nav-animation-' . $settings['animation_text'] );
4896 break;
4897 case 'background':
4898 $this->add_render_attribute( 'wrapper', 'class', 'premium-nav-animation-' . $settings['animation_background'] );
4899 break;
4900 }
4901
4902 /**
4903 * Hamburger Menu Button.
4904 */
4905 ?>
4906 <div <?php $this->print_render_attribute_string( 'wrapper' ); ?>>
4907 <div class="premium-ver-inner-container">
4908 <?php if ( $render_mobile_menu ) { ?>
4909 <div class="premium-hamburger-toggle premium-mobile-menu-icon" role="button" aria-label="Toggle Menu">
4910 <span class="premium-toggle-text">
4911 <?php
4912 Icons_Manager::render_icon( $settings['pa_mobile_toggle_icon'], array( 'aria-hidden' => 'true' ) );
4913 echo esc_html( $settings['pa_mobile_toggle_text'] );
4914 ?>
4915 </span>
4916 <span class="premium-toggle-close">
4917 <?php
4918 Icons_Manager::render_icon( $settings['pa_mobile_close_icon'], array( 'aria-hidden' => 'true' ) );
4919 echo esc_html( $settings['pa_mobile_toggle_close'] );
4920 ?>
4921 </span>
4922 </div>
4923 <?php
4924 }
4925
4926 if ( 'yes' === $settings['pa_ver_toggle_switcher'] ) {
4927 $this->add_vertical_toggler();
4928 }
4929
4930 if ( 'wordpress_menu' === $menu_type ) {
4931 $args = array(
4932 'container' => '',
4933 'menu' => $menu_id,
4934 'menu_class' => 'premium-nav-menu premium-main-nav-menu',
4935 'echo' => false,
4936 'fallback_cb' => 'wp_page_menu',
4937 'walker' => new Pa_Nav_Menu_Walker( $settings ),
4938 );
4939
4940 $menu_html = wp_nav_menu( $args );
4941
4942 if ( in_array( $settings['pa_nav_menu_layout'], array( 'hor', 'ver' ), true ) ) {
4943 ?>
4944 <div class="premium-nav-menu-container premium-nav-default">
4945 <?php echo $menu_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
4946 </div>
4947 <?php
4948 }
4949 } else {
4950 ?>
4951 <div class="premium-nav-menu-container">
4952 <ul class="premium-nav-menu premium-main-nav-menu">
4953 <?php
4954 $menu_html = $this->get_custom_menu();
4955 echo $menu_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
4956 ?>
4957 </ul>
4958 </div>
4959 <?php
4960 }
4961
4962 if ( 'slide' === $settings['pa_mobile_menu_layout'] || 'slide' === $settings['pa_nav_menu_layout'] ) {
4963 $div_end = '</div>';
4964 ?>
4965 <div class="premium-nav-slide-overlay"></div>
4966 <div class="premium-mobile-menu-outer-container">
4967 <div class="premium-mobile-menu-close" role="button" aria-label="Close Menu">
4968 <?php Icons_Manager::render_icon( $settings['pa_mobile_close_icon'], array( 'aria-hidden' => 'true' ) ); ?>
4969 <span class="premium-toggle-close"><?php echo esc_html( $settings['pa_mobile_toggle_close'] ); ?></span>
4970 </div>
4971 <?php
4972 /**
4973 * Menu.
4974 *
4975 * @param int|bool $menu_id WordPress menu id | false if it's a custom menu.
4976 * @param array $settings menu settings.
4977 */
4978 do_action( 'pa_slide_menu_top_template', $menu_id, $settings );
4979 }
4980
4981 if ( $render_mobile_menu ) {
4982 ?>
4983 <div class="premium-mobile-menu-container">
4984 <?php
4985 if ( 'wordpress_menu' === $menu_type ) {
4986 ?>
4987 <?php echo $this->mobile_menu_filter( $menu_html, $menu_id ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
4988 <?php
4989 } else {
4990 ?>
4991 <ul class="premium-mobile-menu premium-main-mobile-menu premium-main-nav-menu">
4992 <?php
4993 echo $menu_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
4994 ?>
4995 </ul>
4996 <?php
4997 }
4998 ?>
4999 </div>
5000 <?php
5001 }
5002
5003 if ( 'slide' === $settings['pa_mobile_menu_layout'] || 'slide' === $settings['pa_nav_menu_layout'] ) {
5004 do_action( 'pa_slide_menu_bottom_template', $menu_id, $settings );
5005 }
5006
5007 echo wp_kses_post( $div_end );
5008 ?>
5009 </div>
5010 </div>
5011 <?php
5012 }
5013
5014 /**
5015 * Add Collapsed Menu.
5016 *
5017 * @access private
5018 * @since 4.9.15
5019 */
5020 private function add_vertical_toggler() {
5021
5022 $settings = $this->get_settings_for_display();
5023 $id = $this->get_id();
5024
5025 ?>
5026 <div class="premium-ver-toggler premium-ver-toggler-<?php echo esc_attr( $id ); ?>">
5027 <div class="premium-ver-toggler-title">
5028 <span class="premium-ver-title-icon">
5029 <?php Icons_Manager::render_icon( $settings['pa_ver_toggle_main_icon'], array( 'aria-hidden' => 'true' ) ); ?>
5030 </span>
5031 <span class="premium-ver-toggler-txt">
5032 <?php echo esc_html( $settings['pa_ver_toggle_txt'] ); ?>
5033 </span>
5034 </div>
5035 <div class="premium-ver-toggler-btn">
5036 <span class="premium-ver-open">
5037 <?php Icons_Manager::render_icon( $settings['pa_ver_toggle_toggle_icon'], array( 'aria-hidden' => 'true' ) ); ?>
5038 </span>
5039 <?php if ( 'always' !== $settings['pa_ver_toggle_event'] ) : ?>
5040 <span class="premium-ver-close">
5041 <?php Icons_Manager::render_icon( $settings['pa_ver_toggle_close_icon'], array( 'aria-hidden' => 'true' ) ); ?>
5042 </span>
5043 <?php endif; ?>
5044 </div>
5045 </div>
5046 <?php
5047 }
5048
5049 /**
5050 * Is Valid Menu.
5051 *
5052 * @access private
5053 * @since 4.9.10
5054 *
5055 * @param string|int $id menu id.
5056 *
5057 * @return bool true if the menu has items.
5058 */
5059 private function is_valid_menu( $id ) {
5060
5061 if ( ! $id ) {
5062 return false;
5063 }
5064
5065 $is_valid = false;
5066
5067 $item_count = wp_get_nav_menu_object( $id )->count;
5068
5069 if ( 0 < $item_count ) {
5070 $is_valid = true;
5071 }
5072
5073 return $is_valid;
5074 }
5075
5076 /**
5077 * Filters mobile menus.
5078 * Changes the menu id to prevent duplicated ids in the DOM.
5079 *
5080 * @access private.
5081 *
5082 * @param string $menu_html desktop menu html.
5083 * @param string|int $menu_id menu id.
5084 *
5085 * @return string
5086 */
5087 private function mobile_menu_filter( $menu_html, $menu_id ) {
5088
5089 // Increment the mobile menu id & change its classes to mobile menu classes.
5090 $slug = 'menu-' . wp_get_nav_menu_object( $menu_id )->slug;
5091 $search = array( 'id="' . $slug . '"', 'class="premium-nav-menu premium-main-nav-menu"' );
5092 $replace = array( 'id="' . $slug . '-1"', 'class="premium-mobile-menu premium-main-mobile-menu premium-main-nav-menu"' );
5093
5094 $menu_html = $this->fix_duplicated_ids( $menu_html, 'premium-nav-menu-item-' ); // fixes's the items duplicated ids.
5095 $menu_html = $this->fix_duplicated_ids( $menu_html, 'premium-mega-content-' ); // fixes's the items duplicated ids.
5096 return str_replace( $search, $replace, $menu_html );
5097 }
5098
5099 /**
5100 * Filters mobile menus.
5101 * Changes the menu id to prevent duplicated ids in the DOM.
5102 *
5103 * @access private
5104 *
5105 * @param string $html desktop menu html.
5106 * @param string $slug menu item id.
5107 *
5108 * @return string
5109 */
5110 private function fix_duplicated_ids( $html, $slug ) {
5111 $pattern = '/id="' . $slug . '(\d+)"/';
5112 $id_counter = 1;
5113
5114 // Replace duplicated IDs.
5115 return preg_replace_callback(
5116 $pattern,
5117 function ( $matches ) use ( &$id_counter, &$slug ) {
5118 $id = $matches[1];
5119 $new_id = $slug . $id . ( $id_counter++ );
5120 return 'id="' . $new_id . '"';
5121 },
5122 $html
5123 );
5124 }
5125
5126
5127 /**
5128 * Get Custom Menu.
5129 *
5130 * @access private
5131 * @since 4.9.4
5132 */
5133 private function get_custom_menu() {
5134
5135 $settings = $this->get_settings_for_display();
5136
5137 $papro_activated = Helper_Functions::check_papro_version();
5138
5139 $badge_effect = $settings['sub_badge_hv_effects'];
5140
5141 if ( ! $papro_activated ) {
5142 return;
5143 }
5144
5145 $menu_items = $settings['menu_items'];
5146
5147 $is_sub_menu = false;
5148 $i = 0;
5149 $is_child = false;
5150 $is_link = false;
5151 $html_output = '';
5152
5153 foreach ( $menu_items as $index => $item ) {
5154
5155 $item_link = $this->get_repeater_setting_key( 'link', 'menu_items', $index );
5156
5157 if ( ! empty( $item['link']['url'] ) ) {
5158
5159 $this->add_link_attributes( $item_link, $item['link'] );
5160
5161 $current_link = get_permalink();
5162
5163 $is_active_item = $item['link']['url'] === $current_link;
5164
5165 /** Handling active anchor links which redirects to an id in a page */
5166 $is_anchor = false !== strpos( $item['link']['url'], '#' ) && false === strpos( $item['link']['url'], '#/' );
5167
5168 // we can later add other classes here based on the user settings.
5169 if ( ! $is_anchor && $is_active_item ) {
5170 $this->add_render_attribute( 'menu-item-' . $index, 'class', 'premium-active-item' );
5171 }
5172
5173 if ( $is_anchor ) { // the active class will be added via js.
5174 $this->add_render_attribute( 'menu-item-' . $index, 'class', 'premium-item-anchor' );
5175 }
5176 }
5177
5178 $this->add_render_attribute(
5179 'menu-item-' . $index,
5180 array(
5181 'class' => array(
5182 'menu-item',
5183 'premium-nav-menu-item',
5184 'elementor-repeater',
5185 'elementor-repeater-item-' . $item['_id'],
5186 ),
5187 )
5188 );
5189
5190 if ( 'submenu' === $item['item_type'] ) {
5191
5192 if ( 'link' === $item['menu_content_type'] ) {
5193
5194 // If no submenu items was rendered before.
5195 if ( false === $is_child ) {
5196 $html_output .= '<ul class="premium-sub-menu premium-lq__' . $settings['submenu_lq_effect'] . '">';
5197 $is_link = true;
5198 }
5199
5200 $this->add_render_attribute( 'menu-item-' . $index, 'class', 'premium-sub-menu-item' );
5201
5202 if ( ! empty( $item['badge_text'] ) ) {
5203 $this->add_render_attribute( 'menu-item-' . $index, 'class', 'has-pa-badge' );
5204
5205 if ( '' !== $badge_effect ) {
5206 $this->add_render_attribute( 'menu-item-' . $index, 'class', 'premium-badge-' . $badge_effect );
5207 }
5208 }
5209
5210 $html_output .= '<li ' . $this->get_render_attribute_string( 'menu-item-' . $index ) . '>';
5211
5212 $html_output .= '<a ' . $this->get_render_attribute_string( $item_link ) . " class='premium-menu-link premium-sub-menu-link'>";
5213
5214 $html_output .= $this->get_icon_html( $item, 'sub-' );
5215
5216 $html_output .= esc_html( $item['text'] );
5217
5218 $html_output .= $this->get_badge_html( $item, 'sub-' );
5219
5220 $html_output .= '</a>';
5221 $html_output .= '</li>';
5222 } else {
5223
5224 $this->add_render_attribute(
5225 'menu-content-item-' . $item['_id'],
5226 array(
5227 'class' => array(
5228 'premium-mega-content-container',
5229 'premium-lq__' . $settings['mega_lq_effect'],
5230 ),
5231 )
5232 );
5233
5234 if ( 'yes' === $item['section_position'] ) {
5235 $this->add_render_attribute( 'menu-content-item-' . $item['_id'], 'class', 'premium-mega-content-centered' );
5236 }
5237
5238 if ( 'element' === $item['menu_content_type'] ) {
5239 $this->add_render_attribute( 'menu-content-item-' . $item['_id'], 'data-mega-content', $item['element_selector'] );
5240 }
5241
5242 $html_output .= '<div ' . $this->get_render_attribute_string( 'menu-content-item-' . $item['_id'] ) . '>';
5243
5244 if ( 'custom_content' === $item['menu_content_type'] ) {
5245
5246 $temp_id = empty( $item['submenu_item'] ) ? $item['live_temp_content'] : $item['submenu_item'];
5247 $html_output .= Helper_Functions::render_elementor_template( $temp_id ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
5248
5249 }
5250
5251 $html_output .= '</div>';
5252
5253 }
5254
5255 $is_child = true;
5256 $is_sub_menu = true;
5257
5258 } else {
5259
5260 $next_item_exists = array_key_exists( $index + 1, $menu_items );
5261 $next_item_is_child = $next_item_exists && 'submenu' === $menu_items[ $index + 1 ]['item_type'];
5262
5263 if ( $next_item_is_child ) {
5264 $this->add_render_attribute( 'menu-item-' . $index, 'class', 'menu-item-has-children' );
5265 }
5266
5267 if ( ! empty( $item['badge_text'] ) ) {
5268 $this->add_render_attribute( 'menu-item-' . $index, 'class', 'has-pa-badge' );
5269 }
5270
5271 if ( 'yes' === $item['section_full_width'] ) {
5272 $this->add_render_attribute( 'menu-item-' . $index, 'data-full-width', 'true' );
5273
5274 if ( ! empty( $item['full_width_selector'] ) ) {
5275 $this->add_render_attribute( 'menu-item-' . $index, 'data-full-width-selector', $item['full_width_selector'] );
5276 }
5277 }
5278
5279 if ( $next_item_exists ) {
5280 if ( 'submenu' === $menu_items[ $index + 1 ]['item_type'] && 'link' !== $menu_items[ $index + 1 ]['menu_content_type'] ) {
5281 $this->add_render_attribute( 'menu-item-' . $index, 'class', 'premium-mega-nav-item' );
5282 }
5283 }
5284
5285 $is_child = false;
5286
5287 // If we need to create a new main item.
5288 if ( true === $is_sub_menu ) {
5289 $is_sub_menu = false;
5290
5291 if ( $is_link ) {
5292 $html_output .= '</ul>';
5293 $is_link = false;
5294 }
5295
5296 $html_output .= '</li>';
5297 }
5298
5299 $html_output .= '<li ' . $this->get_render_attribute_string( 'menu-item-' . $index ) . '>';
5300
5301 $html_output .= '<a ' . $this->get_render_attribute_string( $item_link ) . ' class="premium-menu-link premium-menu-link-parent premium-lq__' . $settings['item_lq_effect'] . '">';
5302
5303 $html_output .= $this->get_icon_html( $item );
5304
5305 $html_output .= esc_html( $item['text'] );
5306
5307 if ( array_key_exists( $index + 1, $menu_items ) ) {
5308 $has_icon = ! empty( $settings['submenu_icon']['value'] );
5309
5310 if ( 'submenu' === $menu_items[ $index + 1 ]['item_type'] && $has_icon ) {
5311 $icon_class = 'premium-dropdown-icon ' . esc_attr( $settings['submenu_icon']['value'] );
5312 $html_output .= sprintf( '<i class="%1$s" aria-hidden="true"></i>', $icon_class );
5313 }
5314 }
5315
5316 $html_output .= $this->get_badge_html( $item );
5317
5318 $html_output .= '</a>';
5319
5320 }
5321
5322 ?>
5323
5324 <?php
5325
5326 }
5327
5328 return $html_output; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
5329 }
5330
5331 /**
5332 * Get Icon HTML.
5333 *
5334 * @access private
5335 * @since 4.9.4
5336 *
5337 * @param array $item repeater item.
5338 * @param string $type type.
5339 *
5340 * @return string
5341 */
5342 private function get_icon_html( $item, $type = '' ) {
5343
5344 $html = '';
5345
5346 if ( 'none' === $item['icon_type'] ) {
5347 return '';
5348 }
5349
5350 $class = 'premium-' . $type . 'item-icon ';
5351 $icon_type = $item['icon_type'];
5352
5353 if ( in_array( $icon_type, array( 'icon', 'svg' ), true ) ) {
5354
5355 // We should add the icon's class here.
5356 $icon_html = 'svg' === $icon_type ? $item['custom_svg'] :
5357 Helper_Functions::get_svg_by_icon(
5358 $item['item_icon'],
5359 array(
5360 'aria-hidden' => 'true',
5361 'class' => $class,
5362 )
5363 );
5364
5365 if ( 'icon' === $icon_type && 'svg' !== $item['item_icon']['library'] ) { // This means it's a fontawesome icon.
5366 $html .= $icon_html;
5367 } else { // This mean it's an svg icon || svg code. => we want to wrap the svg icon with a span.
5368 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
5369 $html .= '<span class="' . esc_attr( $class ) . '">' . $icon_html . '</span>';
5370 }
5371 } elseif ( 'image' === $icon_type ) {
5372
5373 $html .= '<img class="' . esc_attr( $class ) . '" src="' . esc_url( $item['item_image']['url'] ) . '" alt="' . esc_attr( Control_Media::get_image_alt( $item['item_image'] ) ) . '">';
5374 } else {
5375
5376 $html .= '<div class="premium-lottie-animation ' . esc_attr( $class ) . '" data-lottie-url="' . esc_url( $item['lottie_url'] ) . '" data-lottie-loop="true"></div>';
5377 }
5378
5379 return $html;
5380 }
5381
5382 /**
5383 * Get Badge HTML.
5384 *
5385 * @access private
5386 * @since 4.9.4
5387 *
5388 * @param array $item repeater item.
5389 * @param string $type type.
5390 *
5391 * @return string
5392 */
5393 private function get_badge_html( $item, $type = '' ) {
5394
5395 if ( empty( $item['badge_text'] ) ) {
5396 return '';
5397 }
5398
5399 $class = 'premium-' . $type . 'item-badge';
5400
5401 $html = '<span class="' . esc_attr( $class ) . '">' . wp_kses_post( $item['badge_text'] ) . '</span>';
5402
5403 return $html;
5404 }
5405 }
5406