PluginProbe
Hello Plus / 1.4.0
Hello Plus v1.4.0
trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.2.1 1.3.0 1.4.0 1.4.1 1.5.0 1.5.1 1.5.2 1.5.3 1.6.0 1.6.1 1.6.2 1.7.0 1.7.1 1.7.2 1.7.3 All 30 releases
hello-plus / modules / content / widgets / contact.php

contact.php in Hello Plus 1.4.0, at modules/content/widgets/contact.php

1,853 lines 45.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace HelloPlus\Modules\Content\Widgets;
4
5 use HelloPlus\Modules\Content\Classes\Choose_Img_Control;
6 use HelloPlus\Modules\Content\Classes\Render\Widget_Contact_Render;
7 use HelloPlus\Modules\Theme\Module as Theme_Module;
8 use HelloPlus\Includes\Utils;
9 use HelloPlus\Classes\{
10 Ehp_Padding,
11 Ehp_Shapes,
12 Ehp_Social_Platforms,
13 };
14 use HelloPlus\Modules\Content\Base\Traits\Shared_Content_Traits;
15
16 use Elementor\{
17 Controls_Manager,
18 Group_Control_Typography,
19 Group_Control_Background,
20 Group_Control_Box_Shadow,
21 Repeater,
22 };
23 use Elementor\Core\Kits\Documents\Tabs\{
24 Global_Typography,
25 Global_Colors,
26 };
27 use Elementor\Widget_Base;
28 use Elementor\Modules\DynamicTags\Module as TagsModule;
29 use Elementor\Settings;
30
31 class Contact extends Widget_Base {
32 use Shared_Content_Traits;
33
34 public function get_name(): string {
35 return 'contact';
36 }
37
38 public function get_title(): string {
39 return esc_html__( 'Contact', 'hello-plus' );
40 }
41
42 public function get_categories(): array {
43 return [ Theme_Module::HELLOPLUS_EDITOR_CATEGORY_SLUG ];
44 }
45
46 public function get_keywords(): array {
47 return [ 'contact' ];
48 }
49
50 public function get_icon(): string {
51 return 'eicon-email-field';
52 }
53
54 public function get_style_depends(): array {
55 return array_merge( [ 'helloplus-contact' ], Utils::get_widgets_depends() );
56 }
57
58 protected function render(): void {
59 $render_strategy = new Widget_Contact_Render( $this );
60
61 $render_strategy->render();
62 }
63
64 protected function register_controls() {
65 $this->add_content_section();
66 $this->add_style_section();
67 }
68
69 protected function add_content_section() {
70 $this->add_layout_content_section();
71 $this->add_text_content_section();
72 $this->add_contact_details_content_section();
73 $this->add_map_content_section();
74 }
75
76 protected function add_style_section() {
77 $this->add_layout_style_section();
78 $this->add_text_style_section();
79 $this->add_contact_details_style_section();
80 $this->add_map_style_section();
81 $this->add_box_style_section();
82 }
83
84 protected function add_layout_content_section() {
85 $this->start_controls_section(
86 'layout_section',
87 [
88 'label' => esc_html__( 'Layout', 'hello-plus' ),
89 'tab' => Controls_Manager::TAB_CONTENT,
90 ]
91 );
92
93 $this->add_control(
94 'layout_preset',
95 [
96 'label' => esc_html__( 'Preset', 'hello-plus' ),
97 'type' => Choose_Img_Control::CONTROL_NAME,
98 'default' => 'locate',
99 'label_block' => true,
100 'columns' => 2,
101 'toggle' => false,
102 'options' => [
103 'locate' => [
104 'title' => wp_kses_post( "Locate: Highlight your\nlocation to help your\nclients find you." ),
105 'image' => HELLOPLUS_IMAGES_URL . 'contact-locate.svg',
106 'hover_image' => true,
107 ],
108 'touchpoint' => [
109 'title' => wp_kses_post( "Touchpoint:\nEncourage direct\ncontact to help clients\nconnect with you." ),
110 'image' => HELLOPLUS_IMAGES_URL . 'contact-touchpoint.svg',
111 'hover_image' => true,
112 ],
113 'quick-info' => [
114 'title' => wp_kses_post( "Quick info: Share\nessential business\ndetails at a glance for\nfast access." ),
115 'image' => HELLOPLUS_IMAGES_URL . 'contact-quick-info.svg',
116 'hover_image' => true,
117 ],
118 ],
119 ]
120 );
121
122 $this->end_controls_section();
123 }
124
125 protected function add_text_content_section() {
126 $this->start_controls_section(
127 'text_section',
128 [
129 'label' => esc_html__( 'Text', 'hello-plus' ),
130 'tab' => Controls_Manager::TAB_CONTENT,
131 ]
132 );
133
134 $this->add_control(
135 'heading_text',
136 [
137 'label' => esc_html__( 'Heading', 'hello-plus' ),
138 'type' => Controls_Manager::TEXTAREA,
139 'rows' => 6,
140 'default' => esc_html__( 'Get in touch', 'hello-plus' ),
141 'placeholder' => esc_html__( 'Type your text here', 'hello-plus' ),
142 'dynamic' => [
143 'active' => true,
144 ],
145 ]
146 );
147
148 $this->add_control(
149 'heading_tag',
150 [
151 'label' => esc_html__( 'HTML Tag', 'hello-plus' ),
152 'type' => Controls_Manager::SELECT,
153 'options' => [
154 'h1' => 'H1',
155 'h2' => 'H2',
156 'h3' => 'H3',
157 'h4' => 'H4',
158 'h5' => 'H5',
159 'h6' => 'H6',
160 'div' => 'div',
161 'span' => 'span',
162 'p' => 'p',
163 ],
164 'default' => 'h2',
165 ]
166 );
167
168 $this->add_control(
169 'description_text',
170 [
171 'label' => esc_html__( 'Description', 'hello-plus' ),
172 'type' => Controls_Manager::TEXTAREA,
173 'rows' => 6,
174 'default' => htmlspecialchars_decode( __( 'Have questions or ready to take the next step? Reach out to us—we\'re here to help with your fitness journey. Whether you\'re looking for guidance, scheduling a session, or just want more information, we\'ve got you covered.', 'hello-plus' ) ),
175 'placeholder' => esc_html__( 'Type your text here', 'hello-plus' ),
176 'dynamic' => [
177 'active' => true,
178 ],
179 ]
180 );
181
182 $this->add_control(
183 'description_tag',
184 [
185 'label' => esc_html__( 'HTML Tag', 'hello-plus' ),
186 'type' => Controls_Manager::SELECT,
187 'options' => [
188 'h1' => 'H1',
189 'h2' => 'H2',
190 'h3' => 'H3',
191 'h4' => 'H4',
192 'h5' => 'H5',
193 'h6' => 'H6',
194 'div' => 'div',
195 'span' => 'span',
196 'p' => 'p',
197 ],
198 'default' => 'p',
199 ]
200 );
201
202 $this->end_controls_section();
203 }
204
205 protected function add_contact_details_content_section() {
206 $this->start_controls_section(
207 'contact_details_section',
208 [
209 'label' => esc_html__( 'Contact Details', 'hello-plus' ),
210 'tab' => Controls_Manager::TAB_CONTENT,
211 ]
212 );
213
214 $this->add_group_controls( '1' );
215
216 $this->add_group_controls( '2' );
217
218 $this->add_group_controls( '3' );
219
220 $this->add_group_controls( '4' );
221
222 $this->add_control(
223 'subheading_tag',
224 [
225 'label' => esc_html__( 'Subheading HTML Tag', 'hello-plus' ),
226 'type' => Controls_Manager::SELECT,
227 'options' => [
228 'h1' => 'H1',
229 'h2' => 'H2',
230 'h3' => 'H3',
231 'h4' => 'H4',
232 'h5' => 'H5',
233 'h6' => 'H6',
234 'div' => 'div',
235 'span' => 'span',
236 'p' => 'p',
237 ],
238 'default' => 'h3',
239 'separator' => 'before',
240 ]
241 );
242
243 $this->end_controls_section();
244 }
245
246 protected function add_map_content_section() {
247 $this->start_controls_section(
248 'map_section',
249 [
250 'label' => esc_html__( 'Map', 'hello-plus' ),
251 'tab' => Controls_Manager::TAB_CONTENT,
252 'condition' => [
253 'layout_preset!' => 'quick-info',
254 ],
255 ]
256 );
257
258 if ( Utils::elementor()->editor->is_edit_mode() ) {
259 $api_key = get_option( 'elementor_google_maps_api_key' );
260
261 if ( ! $api_key ) {
262 $this->add_control(
263 'api_key_notification',
264 [
265 'type' => Controls_Manager::ALERT,
266 'alert_type' => 'info',
267 'content' => sprintf(
268 /* translators: 1: Integration settings link open tag, 2: Create API key link open tag, 3: Link close tag. */
269 esc_html__( 'Set your Google Maps API Key in Elementor\'s %1$sIntegrations Settings%3$s page. Create your key %2$shere.%3$s', 'hello-plus' ),
270 '<a href="' . Settings::get_settings_tab_url( 'integrations' ) . '" target="_blank">',
271 '<a href="https://developers.google.com/maps/documentation/embed/get-api-key" target="_blank">',
272 '</a>'
273 ),
274 ]
275 );
276 }
277 }
278
279 $default_address = esc_html__( 'London Eye, London, United Kingdom', 'hello-plus' );
280 $this->add_control(
281 'map_address',
282 [
283 'label' => esc_html__( 'Location', 'hello-plus' ),
284 'type' => Controls_Manager::TEXT,
285 'dynamic' => [
286 'active' => true,
287 'categories' => [
288 TagsModule::POST_META_CATEGORY,
289 ],
290 ],
291 'ai' => [
292 'active' => false,
293 ],
294 'placeholder' => $default_address,
295 'default' => $default_address,
296 'label_block' => true,
297 ]
298 );
299
300 $this->end_controls_section();
301 }
302
303 protected function add_group_controls( $group_number ) {
304 $group_condition = '1' === $group_number ? [] : [
305 'group_' . $group_number . '_switcher' => 'yes',
306 ];
307
308 if ( '1' === $group_number ) {
309 $this->add_control(
310 'group_' . $group_number . '_heading',
311 [
312 'label' => sprintf( esc_html__( 'Group %d', 'hello-plus' ), $group_number ),
313 'type' => Controls_Manager::HEADING,
314 ]
315 );
316 } else {
317 $this->add_control(
318 'group_' . $group_number . '_switcher',
319 [
320 'label' => sprintf( esc_html__( 'Group %d', 'hello-plus' ), $group_number ),
321 'type' => Controls_Manager::SWITCHER,
322 'label_on' => esc_html__( 'Show', 'hello-plus' ),
323 'label_off' => esc_html__( 'Hide', 'hello-plus' ),
324 'return_value' => 'yes',
325 'default' => 'yes',
326 'separator' => 'before',
327 ]
328 );
329 }
330
331 $group_types = [
332 '1' => 'contact-links',
333 '3' => 'contact-links',
334 '2' => 'text',
335 '4' => 'social-icons',
336 ];
337
338 $this->add_control(
339 'group_' . $group_number . '_type',
340 [
341 'label' => esc_html__( 'Type', 'hello-plus' ),
342 'type' => Controls_Manager::SELECT,
343 'options' => [
344 'contact-links' => esc_html__( 'Contact Links', 'hello-plus' ),
345 'text' => esc_html__( 'Text', 'hello-plus' ),
346 'social-icons' => esc_html__( 'Social Icons', 'hello-plus' ),
347 ],
348 'default' => $group_types[ $group_number ] ?? '',
349 'condition' => $group_condition,
350 ]
351 );
352
353 $this->add_contact_links_controls( $group_number, $group_condition );
354
355 $this->add_text_controls( $group_number, $group_condition );
356
357 $this->add_social_controls( $group_number, $group_condition );
358 }
359
360 protected function add_contact_links_controls( $group_number, $group_condition ) {
361 $group_subheadings = [
362 '1' => htmlspecialchars_decode( __( 'Let\'s talk', 'hello-plus' ) ),
363 '2' => esc_html__( 'Hours', 'hello-plus' ),
364 '3' => esc_html__( 'Visit', 'hello-plus' ),
365 '4' => esc_html__( 'Follow', 'hello-plus' ),
366 ];
367
368 $this->add_control(
369 'group_' . $group_number . '_links_subheading',
370 [
371 'label' => esc_html__( 'Subheading', 'hello-plus' ),
372 'type' => Controls_Manager::TEXT,
373 'default' => $group_subheadings[ $group_number ] ?? '',
374 'placeholder' => esc_html__( 'Type your text here', 'hello-plus' ),
375 'dynamic' => [
376 'active' => true,
377 ],
378 'condition' => array_merge( $group_condition, [
379 'group_' . $group_number . '_type' => 'contact-links',
380 ] ),
381 ]
382 );
383
384 $defaults = [
385 'icon_default' => [
386 'value' => 'fas fa-phone-alt',
387 'library' => 'fa-solid',
388 ],
389 'label_default' => esc_html__( 'Call', 'hello-plus' ),
390 'platform_default' => 'telephone',
391 ];
392
393 $repeater = new Repeater();
394
395 $social_platforms = new Ehp_Social_Platforms( $this, [
396 'prefix_attr' => 'group_' . $group_number,
397 'repeater' => $repeater,
398 ], $defaults );
399
400 $social_platforms->add_repeater_controls();
401
402 $shared_defaults = [
403 [
404 'group_' . $group_number . '_icon' => [
405 'value' => 'fas fa-phone-alt',
406 'library' => 'fa-solid',
407 ],
408 'group_' . $group_number . '_label' => esc_html__( 'Call', 'hello-plus' ),
409 'group_' . $group_number . '_platform' => 'telephone',
410 ],
411 [
412 'group_' . $group_number . '_icon' => [
413 'value' => 'fas fa-envelope',
414 'library' => 'fa-solid',
415 ],
416 'group_' . $group_number . '_label' => esc_html__( 'Email', 'hello-plus' ),
417 'group_' . $group_number . '_platform' => 'email',
418 ],
419 ];
420
421 $repeater_defaults = [
422 '1' => $shared_defaults,
423 '2' => $shared_defaults,
424 '3' => [
425 'group_' . $group_number . '_icon' => [
426 'value' => 'fas fa-map-marker-alt',
427 'library' => 'fa-solid',
428 ],
429 'group_' . $group_number . '_label' => esc_html__( 'Visit', 'hello-plus' ),
430 'group_' . $group_number . '_platform' => 'telephone',
431 ],
432 '4' => $shared_defaults,
433 ];
434
435 $this->add_control(
436 'group_' . $group_number . '_repeater',
437 [
438 'label' => esc_html__( 'Links', 'hello-plus' ),
439 'type' => Controls_Manager::REPEATER,
440 'fields' => $repeater->get_controls(),
441 'prevent_empty' => true,
442 'button_text' => esc_html__( 'Add Item', 'hello-plus' ),
443 'title_field' => '{{{ group_' . $group_number . '_label }}}',
444 'condition' => array_merge( $group_condition, [
445 'group_' . $group_number . '_type' => 'contact-links',
446 ] ),
447 'default' => $repeater_defaults[ $group_number ] ?? [],
448 ]
449 );
450 }
451
452 protected function add_text_controls( $group_number, $group_condition ) {
453 $this->add_control(
454 'group_' . $group_number . '_text_subheading',
455 [
456 'label' => esc_html__( 'Subheading', 'hello-plus' ),
457 'type' => Controls_Manager::TEXT,
458 'default' => esc_html__( 'Hours', 'hello-plus' ),
459 'placeholder' => esc_html__( 'Type your text here', 'hello-plus' ),
460 'dynamic' => [
461 'active' => true,
462 ],
463 'condition' => array_merge( $group_condition, [
464 'group_' . $group_number . '_type' => 'text',
465 ] ),
466 ]
467 );
468
469 $this->add_control(
470 'group_' . $group_number . '_text_textarea',
471 [
472 'label' => esc_html__( 'Text', 'hello-plus' ),
473 'type' => Controls_Manager::TEXTAREA,
474 'default' => esc_html__( 'M-F 9am-6pm', 'hello-plus' ),
475 'placeholder' => esc_html__( 'Type your text here', 'hello-plus' ),
476 'dynamic' => [
477 'active' => true,
478 ],
479 'condition' => array_merge( $group_condition, [
480 'group_' . $group_number . '_type' => 'text',
481 ] ),
482 ]
483 );
484 }
485
486 protected function add_social_controls( $group_number, $group_condition ) {
487 $this->add_control(
488 'group_' . $group_number . '_social_subheading',
489 [
490 'label' => esc_html__( 'Subheading', 'hello-plus' ),
491 'type' => Controls_Manager::TEXT,
492 'default' => esc_html__( 'Follow', 'hello-plus' ),
493 'placeholder' => esc_html__( 'Type your text here', 'hello-plus' ),
494 'dynamic' => [
495 'active' => true,
496 ],
497 'condition' => array_merge( $group_condition, [
498 'group_' . $group_number . '_type' => 'social-icons',
499 ] ),
500 ]
501 );
502
503 $repeater = new Repeater();
504
505 $repeater->add_control(
506 'group_' . $group_number . '_social_label',
507 [
508 'label' => esc_html__( 'Accessible Name', 'hello-plus' ),
509 'type' => Controls_Manager::TEXT,
510 'default' => esc_html__( 'Instagram', 'hello-plus' ),
511 'placeholder' => esc_html__( 'Type your text here', 'hello-plus' ),
512 'dynamic' => [
513 'active' => true,
514 ],
515 ]
516 );
517
518 $repeater->add_control(
519 'group_' . $group_number . '_social_icon',
520 [
521 'label' => esc_html__( 'Icon', 'hello-plus' ),
522 'type' => Controls_Manager::ICONS,
523 'default' => [
524 'value' => 'fab fa-instagram',
525 'library' => 'fa-brands',
526 ],
527 ]
528 );
529
530 $repeater->add_control(
531 'group_' . $group_number . '_social_link',
532 [
533 'label' => esc_html__( 'Link', 'hello-plus' ),
534 'type' => Controls_Manager::URL,
535 'dynamic' => [
536 'active' => true,
537 ],
538 'autocomplete' => true,
539 'label_block' => true,
540 'placeholder' => esc_html__( 'Enter your URL', 'hello-plus' ),
541 ]
542 );
543
544 $this->add_control(
545 'group_' . $group_number . '_social_repeater',
546 [
547 'type' => Controls_Manager::REPEATER,
548 'fields' => $repeater->get_controls(),
549 'prevent_empty' => true,
550 'button_text' => esc_html__( 'Add Item', 'hello-plus' ),
551 'title_field' => '{{{ group_' . $group_number . '_social_label }}}',
552 'condition' => array_merge( $group_condition, [
553 'group_' . $group_number . '_type' => 'social-icons',
554 ] ),
555 'default' => [
556 [
557 'group_' . $group_number . '_social_label' => esc_html__( 'Instagram', 'hello-plus' ),
558 'group_' . $group_number . '_social_icon' => [
559 'value' => 'fab fa-instagram',
560 'library' => 'fa-brands',
561 ],
562 'group_' . $group_number . '_social_link' => [
563 'url' => 'https://www.instagram.com/',
564 ],
565 ],
566 [
567 'group_' . $group_number . '_social_label' => esc_html__( 'Tiktok', 'hello-plus' ),
568 'group_' . $group_number . '_social_icon' => [
569 'value' => 'fab fa-tiktok',
570 'library' => 'fa-brands',
571 ],
572 'group_' . $group_number . '_social_link' => [
573 'url' => 'https://www.tiktok.com/',
574 ],
575 ],
576 [
577 'group_' . $group_number . '_social_label' => esc_html__( 'X (Twitter)', 'hello-plus' ),
578 'group_' . $group_number . '_social_icon' => [
579 'value' => 'fab fa-x-twitter',
580 'library' => 'fa-brands',
581 ],
582 'group_' . $group_number . '_social_link' => [
583 'url' => 'https://www.twitter.com/',
584 ],
585 ],
586 ],
587 ]
588 );
589 }
590
591 protected function add_layout_style_section() {
592 $this->start_controls_section(
593 'layout_style_section',
594 [
595 'label' => esc_html__( 'Layout', 'hello-plus' ),
596 'tab' => Controls_Manager::TAB_STYLE,
597 ]
598 );
599
600 $this->add_responsive_control(
601 'content_alignment_locate',
602 [
603 'label' => esc_html__( 'Content Alignment', 'hello-plus' ),
604 'type' => Controls_Manager::CHOOSE,
605 'options' => [
606 'start' => [
607 'title' => esc_html__( 'Start', 'hello-plus' ),
608 'icon' => 'eicon-align-start-v',
609 ],
610 'center' => [
611 'title' => esc_html__( 'Center', 'hello-plus' ),
612 'icon' => 'eicon-align-center-v',
613 ],
614 'end' => [
615 'title' => esc_html__( 'End', 'hello-plus' ),
616 'icon' => 'eicon-align-end-v',
617 ],
618 ],
619 'toggle' => false,
620 'default' => 'start',
621 'tablet_default' => 'start',
622 'mobile_default' => 'start',
623 'selectors' => [
624 '{{WRAPPER}} .ehp-contact' => '--contact-content-position: {{VALUE}};',
625 ],
626 'condition' => [
627 'layout_preset' => 'locate',
628 ],
629 ]
630 );
631
632 $this->add_responsive_control(
633 'content_position',
634 [
635 'label' => esc_html__( 'Content Position', 'hello-plus' ),
636 'type' => Controls_Manager::CHOOSE,
637 'options' => [
638 'start' => [
639 'title' => esc_html__( 'Start', 'hello-plus' ),
640 'icon' => 'eicon-align-start-h',
641 ],
642 'center' => [
643 'title' => esc_html__( 'Center', 'hello-plus' ),
644 'icon' => 'eicon-align-center-h',
645 ],
646 ],
647 'toggle' => false,
648 'default' => 'center',
649 'tablet_default' => 'center',
650 'mobile_default' => 'center',
651 'selectors' => [
652 '{{WRAPPER}} .ehp-contact' => '--contact-content-position: {{VALUE}};',
653 ],
654 'condition' => [
655 'layout_preset' => [
656 'touchpoint',
657 'quick-info',
658 ],
659 ],
660 ]
661 );
662
663 $this->add_responsive_control(
664 'content_alignment_reduced',
665 [
666 'label' => esc_html__( 'Content Alignment', 'hello-plus' ),
667 'type' => Controls_Manager::CHOOSE,
668 'options' => [
669 'start' => [
670 'title' => esc_html__( 'Start', 'hello-plus' ),
671 'icon' => 'eicon-align-start-h',
672 ],
673 'center' => [
674 'title' => esc_html__( 'Center', 'hello-plus' ),
675 'icon' => 'eicon-align-center-h',
676 ],
677 ],
678 'toggle' => false,
679 'default' => 'start',
680 'tablet_default' => 'start',
681 'mobile_default' => 'start',
682 'selectors' => [
683 '{{WRAPPER}} .ehp-contact' => '--contact-content-alignment: {{VALUE}}; --contact-content-alignment-width: var(--contact-alignment-width-{{VALUE}}); --contact-content-alignment-margin: var(--contact-alignment-margin-{{VALUE}});',
684 ],
685 'conditions' => [
686 'relation' => 'or',
687 'terms' => [
688 [
689 'name' => 'layout_preset',
690 'operator' => '===',
691 'value' => 'quick-info',
692 ],
693 [
694 'relation' => 'and',
695 'terms' => [
696 [
697 'name' => 'layout_preset',
698 'operator' => '===',
699 'value' => 'touchpoint',
700 ],
701 [
702 'name' => 'content_position',
703 'operator' => '===',
704 'value' => 'center',
705 ],
706 ],
707 ],
708 ],
709 ],
710 ]
711 );
712
713 $this->add_responsive_control(
714 'content_width',
715 [
716 'label' => esc_html__( 'Content Width', 'hello-plus' ),
717 'type' => Controls_Manager::SLIDER,
718 'size_units' => [ 'px', 'em', 'rem', '%', 'custom' ],
719 'range' => [
720 'px' => [
721 'max' => 1200,
722 ],
723 '%' => [
724 'max' => 100,
725 ],
726 ],
727 'default' => [
728 'size' => 800,
729 'unit' => 'px',
730 ],
731 'selectors' => [
732 '{{WRAPPER}} .ehp-contact' => '--contact-content-width: {{SIZE}}{{UNIT}};',
733 ],
734 'condition' => [
735 'layout_preset' => [
736 'quick-info',
737 'touchpoint',
738 ],
739 ],
740 ]
741 );
742
743 $this->add_control(
744 'contact_details_heading',
745 [
746 'label' => esc_html__( 'Contact Details', 'hello-plus' ),
747 'type' => Controls_Manager::HEADING,
748 'separator' => 'before',
749 'condition' => [
750 'layout_preset' => [ 'locate', 'touchpoint' ],
751 ],
752 ]
753 );
754
755 $this->add_responsive_control(
756 'contact_details_columns_locate',
757 [
758 'label' => esc_html__( 'Columns', 'hello-plus' ),
759 'type' => Controls_Manager::SELECT,
760 'options' => [
761 '1' => esc_html__( '1', 'hello-plus' ),
762 '2' => esc_html__( '2', 'hello-plus' ),
763 '3' => esc_html__( '3', 'hello-plus' ),
764 '4' => esc_html__( '4', 'hello-plus' ),
765 ],
766 'default' => '1',
767 'tablet_default' => '1',
768 'mobile_default' => '1',
769 'selectors' => [
770 '{{WRAPPER}} .ehp-contact' => '--contact-layout-columns: {{VALUE}};',
771 ],
772 'condition' => [
773 'layout_preset' => 'locate',
774 ],
775 ]
776 );
777
778 $this->add_responsive_control(
779 'contact_details_columns_alt',
780 [
781 'label' => esc_html__( 'Columns', 'hello-plus' ),
782 'type' => Controls_Manager::SELECT,
783 'options' => [
784 '1' => esc_html__( '1', 'hello-plus' ),
785 '2' => esc_html__( '2', 'hello-plus' ),
786 '3' => esc_html__( '3', 'hello-plus' ),
787 '4' => esc_html__( '4', 'hello-plus' ),
788 ],
789 'default' => '2',
790 'tablet_default' => '2',
791 'mobile_default' => '1',
792 'selectors' => [
793 '{{WRAPPER}} .ehp-contact' => '--contact-layout-columns: {{VALUE}};',
794 ],
795 'condition' => [
796 'layout_preset' => [ 'touchpoint', 'quick-info' ],
797 ],
798 ]
799 );
800
801 $this->add_responsive_control(
802 'space_between_widgets',
803 [
804 'label' => esc_html__( 'Gaps', 'hello-plus' ),
805 'type' => Controls_Manager::GAPS,
806 'default' => [
807 'row' => '20',
808 'column' => '20',
809 'unit' => 'px',
810 ],
811 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
812 'selectors' => [
813 '{{WRAPPER}} .ehp-contact' => '--contact-layout-columns-row-gap: {{ROW}}{{UNIT}};--contact-layout-columns-column-gap: {{COLUMN}}{{UNIT}};',
814 ],
815 'validators' => [
816 'Number' => [
817 'min' => 0,
818 ],
819 ],
820 ]
821 );
822
823 $this->add_responsive_control(
824 'map_position_horizontal',
825 [
826 'label' => esc_html__( 'Map Position', 'hello-plus' ),
827 'type' => Controls_Manager::CHOOSE,
828 'options' => [
829 'start' => [
830 'title' => esc_html__( 'Start', 'hello-plus' ),
831 'icon' => 'eicon-h-align-' . ( is_rtl() ? 'right' : 'left' ),
832 ],
833 'end' => [
834 'title' => esc_html__( 'End', 'hello-plus' ),
835 'icon' => 'eicon-h-align-' . ( is_rtl() ? 'left' : 'right' ),
836 ],
837 ],
838 'toggle' => false,
839 'frontend_available' => true,
840 'default' => 'end',
841 'tablet_default' => 'end',
842 'mobile_default' => 'end',
843 'separator' => 'before',
844 'condition' => [
845 'layout_preset' => 'locate',
846 ],
847 ]
848 );
849
850 $this->add_responsive_control(
851 'map_position_vertical',
852 [
853 'label' => esc_html__( 'Map Position', 'hello-plus' ),
854 'type' => Controls_Manager::CHOOSE,
855 'options' => [
856 'start' => [
857 'title' => esc_html__( 'Start', 'hello-plus' ),
858 'icon' => 'eicon-align-start-v',
859 ],
860 'end' => [
861 'title' => esc_html__( 'End', 'hello-plus' ),
862 'icon' => 'eicon-align-end-v',
863 ],
864 ],
865 'toggle' => false,
866 'frontend_available' => true,
867 'default' => 'end',
868 'tablet_default' => 'end',
869 'mobile_default' => 'end',
870 'condition' => [
871 'layout_preset' => 'touchpoint',
872 ],
873 ]
874 );
875
876 $this->end_controls_section();
877 }
878
879 protected function add_text_style_section() {
880 $this->start_controls_section(
881 'text_style_section',
882 [
883 'label' => esc_html__( 'Text', 'hello-plus' ),
884 'tab' => Controls_Manager::TAB_STYLE,
885 ]
886 );
887
888 $this->add_control(
889 'heading_label',
890 [
891 'label' => esc_html__( 'Heading', 'hello-plus' ),
892 'type' => Controls_Manager::HEADING,
893 'separator' => 'before',
894 ]
895 );
896
897 $this->add_control(
898 'heading_color',
899 [
900 'label' => esc_html__( 'Text Color', 'hello-plus' ),
901 'type' => Controls_Manager::COLOR,
902 'global' => [
903 'default' => Global_Colors::COLOR_PRIMARY,
904 ],
905 'selectors' => [
906 '{{WRAPPER}} .ehp-contact' => '--contact-text-heading-color: {{VALUE}}',
907 ],
908 ]
909 );
910
911 $this->add_group_control(
912 Group_Control_Typography::get_type(),
913 [
914 'name' => 'heading_typography',
915 'selector' => '{{WRAPPER}} .ehp-contact__heading',
916 'global' => [
917 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
918 ],
919 ]
920 );
921
922 $this->add_control(
923 'description_label',
924 [
925 'label' => esc_html__( 'Description', 'hello-plus' ),
926 'type' => Controls_Manager::HEADING,
927 'separator' => 'before',
928 ]
929 );
930
931 $this->add_control(
932 'description_color',
933 [
934 'label' => esc_html__( 'Text Color', 'hello-plus' ),
935 'type' => Controls_Manager::COLOR,
936 'global' => [
937 'default' => Global_Colors::COLOR_TEXT,
938 ],
939 'selectors' => [
940 '{{WRAPPER}} .ehp-contact' => '--contact-text-description-color: {{VALUE}}',
941 ],
942 ]
943 );
944
945 $this->add_group_control(
946 Group_Control_Typography::get_type(),
947 [
948 'name' => 'description_typography',
949 'selector' => '{{WRAPPER}} .ehp-contact__description',
950 'global' => [
951 'default' => Global_Typography::TYPOGRAPHY_TEXT,
952 ],
953 ]
954 );
955
956 $this->add_responsive_control(
957 'text_spacing',
958 [
959 'label' => esc_html__( 'Spacing', 'hello-plus' ),
960 'type' => Controls_Manager::SLIDER,
961 'size_units' => [ 'px', 'em', 'rem', 'custom' ],
962 'range' => [
963 'px' => [
964 'max' => 100,
965 ],
966 '%' => [
967 'max' => 100,
968 ],
969 ],
970 'default' => [
971 'size' => 32,
972 'unit' => 'px',
973 ],
974 'selectors' => [
975 '{{WRAPPER}} .ehp-contact' => '--contact-text-spacing: {{SIZE}}{{UNIT}};',
976 ],
977 'separator' => 'before',
978 ]
979 );
980
981 $this->end_controls_section();
982 }
983
984 protected function add_contact_details_style_section() {
985 $this->start_controls_section(
986 'contact_details_style_section',
987 [
988 'label' => esc_html__( 'Contact Details', 'hello-plus' ),
989 'tab' => Controls_Manager::TAB_STYLE,
990 ]
991 );
992
993 $this->add_control(
994 'contact_details_subheading_label',
995 [
996 'label' => esc_html__( 'Subheading', 'hello-plus' ),
997 'type' => Controls_Manager::HEADING,
998 'separator' => 'before',
999 ]
1000 );
1001
1002 $this->add_control(
1003 'contact_details_subheading_color',
1004 [
1005 'label' => esc_html__( 'Text Color', 'hello-plus' ),
1006 'type' => Controls_Manager::COLOR,
1007 'global' => [
1008 'default' => Global_Colors::COLOR_SECONDARY,
1009 ],
1010 'selectors' => [
1011 '{{WRAPPER}} .ehp-contact' => '--contact-group-subheading-color: {{VALUE}}',
1012 ],
1013 ]
1014 );
1015
1016 $this->add_group_control(
1017 Group_Control_Typography::get_type(),
1018 [
1019 'name' => 'contact_details_subheading_typography',
1020 'selector' => '{{WRAPPER}} .ehp-contact__subheading',
1021 'global' => [
1022 'default' => Global_Typography::TYPOGRAPHY_SECONDARY,
1023 ],
1024 ]
1025 );
1026
1027 $this->add_responsive_control(
1028 'contact_details_text_spacing',
1029 [
1030 'label' => esc_html__( 'Spacing', 'hello-plus' ),
1031 'type' => Controls_Manager::SLIDER,
1032 'size_units' => [ 'px', 'em', 'rem', 'custom' ],
1033 'range' => [
1034 'px' => [
1035 'max' => 100,
1036 ],
1037 '%' => [
1038 'max' => 100,
1039 ],
1040 ],
1041 'default' => [
1042 'size' => 8,
1043 'unit' => 'px',
1044 ],
1045 'selectors' => [
1046 '{{WRAPPER}} .ehp-contact' => '--contact-group-spacing: {{SIZE}}{{UNIT}};',
1047 ],
1048 ]
1049 );
1050
1051 $this->add_control(
1052 'style_contact_details_heading',
1053 [
1054 'label' => esc_html__( 'Contact Links', 'hello-plus' ),
1055 'type' => Controls_Manager::HEADING,
1056 'separator' => 'before',
1057 'conditions' => $this->get_conditions_by_type_value( 'contact-links' ),
1058 ]
1059 );
1060
1061 $this->add_responsive_control(
1062 'contact_details_spacing',
1063 [
1064 'label' => esc_html__( 'Spacing', 'hello-plus' ),
1065 'type' => Controls_Manager::SLIDER,
1066 'size_units' => [ 'px', 'em', 'rem', 'custom' ],
1067 'range' => [
1068 'px' => [
1069 'max' => 100,
1070 ],
1071 '%' => [
1072 'max' => 100,
1073 ],
1074 ],
1075 'default' => [
1076 'size' => 4,
1077 'unit' => 'px',
1078 ],
1079 'selectors' => [
1080 '{{WRAPPER}} .ehp-contact' => '--contact-links-spacing: {{SIZE}}{{UNIT}};',
1081 ],
1082 'conditions' => $this->get_conditions_by_type_value( 'contact-links' ),
1083 ]
1084 );
1085
1086 $this->add_group_control(
1087 Group_Control_Typography::get_type(),
1088 [
1089 'name' => 'contact_details_typography',
1090 'selector' => '{{WRAPPER}} .ehp-contact__contact-link',
1091 'global' => [
1092 'default' => Global_Typography::TYPOGRAPHY_TEXT,
1093 ],
1094 'conditions' => $this->get_conditions_by_type_value( 'contact-links' ),
1095 ]
1096 );
1097
1098 $this->start_controls_tabs( 'contact_details_tabs' );
1099
1100 $this->start_controls_tab(
1101 'contact_details_normal_tab',
1102 [
1103 'label' => esc_html__( 'Normal', 'hello-plus' ),
1104 'conditions' => $this->get_conditions_by_type_value( 'contact-links' ),
1105 ]
1106 );
1107
1108 $this->add_control(
1109 'contact_details_icon_color',
1110 [
1111 'label' => esc_html__( 'Icon Color', 'hello-plus' ),
1112 'type' => Controls_Manager::COLOR,
1113 'global' => [
1114 'default' => Global_Colors::COLOR_PRIMARY,
1115 ],
1116 'selectors' => [
1117 '{{WRAPPER}} .ehp-contact' => '--contact-link-icon-color: {{VALUE}}',
1118 ],
1119 'conditions' => $this->get_conditions_by_type_value( 'contact-links' ),
1120 ]
1121 );
1122
1123 $this->add_control(
1124 'contact_details_text_text_color',
1125 [
1126 'label' => esc_html__( 'Text Color', 'hello-plus' ),
1127 'type' => Controls_Manager::COLOR,
1128 'global' => [
1129 'default' => Global_Colors::COLOR_TEXT,
1130 ],
1131 'selectors' => [
1132 '{{WRAPPER}} .ehp-contact' => '--contact-link-label-color: {{VALUE}}',
1133 ],
1134 'conditions' => $this->get_conditions_by_type_value( 'contact-links' ),
1135 ]
1136 );
1137
1138 $this->end_controls_tab();
1139
1140 $this->start_controls_tab(
1141 'contact_details_hover_tab',
1142 [
1143 'label' => esc_html__( 'Hover', 'hello-plus' ),
1144 'conditions' => $this->get_conditions_by_type_value( 'contact-links' ),
1145 ]
1146 );
1147
1148 $this->add_control(
1149 'contact_details_icon_hover_color',
1150 [
1151 'label' => esc_html__( 'Icon Color', 'hello-plus' ),
1152 'type' => Controls_Manager::COLOR,
1153 'global' => [
1154 'default' => Global_Colors::COLOR_PRIMARY,
1155 ],
1156 'selectors' => [
1157 '{{WRAPPER}} .ehp-contact' => '--contact-link-icon-hover-color: {{VALUE}}',
1158 ],
1159 'conditions' => $this->get_conditions_by_type_value( 'contact-links' ),
1160 ]
1161 );
1162
1163 $this->add_control(
1164 'contact_details_text_hover_color',
1165 [
1166 'label' => esc_html__( 'Text Color', 'hello-plus' ),
1167 'type' => Controls_Manager::COLOR,
1168 'global' => [
1169 'default' => Global_Colors::COLOR_TEXT,
1170 ],
1171 'selectors' => [
1172 '{{WRAPPER}} .ehp-contact' => '--contact-link-label-hover-color: {{VALUE}}',
1173 ],
1174 'conditions' => $this->get_conditions_by_type_value( 'contact-links' ),
1175 ]
1176 );
1177
1178 $this->add_control(
1179 'contact_details_text_hover_animation',
1180 [
1181 'label' => esc_html__( 'Hover Animation', 'hello-plus' ),
1182 'type' => Controls_Manager::HOVER_ANIMATION,
1183 'conditions' => $this->get_conditions_by_type_value( 'contact-links' ),
1184 ]
1185 );
1186
1187 $this->end_controls_tab();
1188
1189 $this->end_controls_tabs();
1190
1191 $this->add_responsive_control(
1192 'contact_details_icon_size',
1193 [
1194 'label' => esc_html__( 'Icon Size', 'hello-plus' ),
1195 'type' => Controls_Manager::SLIDER,
1196 'size_units' => [ 'px', 'em', 'rem', 'custom' ],
1197 'range' => [
1198 'px' => [
1199 'min' => 0,
1200 'max' => 100,
1201 ],
1202 ],
1203 'default' => [
1204 'size' => 16,
1205 'unit' => 'px',
1206 ],
1207 'selectors' => [
1208 '{{WRAPPER}} .ehp-contact' => '--contact-link-icon-size: {{SIZE}}{{UNIT}}',
1209 ],
1210 'separator' => 'before',
1211 'conditions' => $this->get_conditions_by_type_value( 'contact-links' ),
1212 ]
1213 );
1214
1215 $this->add_responsive_control(
1216 'contact_details_icon_gap',
1217 [
1218 'label' => esc_html__( 'Icon Gap', 'hello-plus' ),
1219 'type' => Controls_Manager::SLIDER,
1220 'size_units' => [ 'px', 'em', 'rem', 'custom' ],
1221 'range' => [
1222 'px' => [
1223 'min' => 0,
1224 'max' => 50,
1225 ],
1226 ],
1227 'default' => [
1228 'size' => 8,
1229 'unit' => 'px',
1230 ],
1231 'selectors' => [
1232 '{{WRAPPER}} .ehp-contact' => '--contact-link-icon-gap: {{SIZE}}{{UNIT}}',
1233 ],
1234 'conditions' => $this->get_conditions_by_type_value( 'contact-links' ),
1235 ]
1236 );
1237
1238 $this->add_control(
1239 'contact_details_text_heading',
1240 [
1241 'label' => esc_html__( 'Text', 'hello-plus' ),
1242 'type' => Controls_Manager::HEADING,
1243 'separator' => 'before',
1244 'conditions' => $this->get_conditions_by_type_value( 'text' ),
1245 ]
1246 );
1247
1248 $this->add_group_control(
1249 Group_Control_Typography::get_type(),
1250 [
1251 'name' => 'contact_details_text_typography',
1252 'selector' => '{{WRAPPER}} .ehp-contact__contact-text',
1253 'global' => [
1254 'default' => Global_Typography::TYPOGRAPHY_TEXT,
1255 ],
1256 'conditions' => $this->get_conditions_by_type_value( 'text' ),
1257 ]
1258 );
1259
1260 $this->add_control(
1261 'contact_details_text_color',
1262 [
1263 'label' => esc_html__( 'Text Color', 'hello-plus' ),
1264 'type' => Controls_Manager::COLOR,
1265 'global' => [
1266 'default' => Global_Colors::COLOR_TEXT,
1267 ],
1268 'selectors' => [
1269 '{{WRAPPER}} .ehp-contact' => '--contact-contact-text-color: {{VALUE}}',
1270 ],
1271 'conditions' => $this->get_conditions_by_type_value( 'text' ),
1272 ]
1273 );
1274
1275 $this->add_control(
1276 'contact_details_social_heading',
1277 [
1278 'label' => esc_html__( 'Social Icons', 'hello-plus' ),
1279 'type' => Controls_Manager::HEADING,
1280 'separator' => 'before',
1281 'conditions' => $this->get_conditions_by_type_value( 'social-icons' ),
1282 ]
1283 );
1284
1285 $this->start_controls_tabs( 'contact_details_social_tabs' );
1286
1287 $this->start_controls_tab(
1288 'contact_details_social_normal_tab',
1289 [
1290 'label' => esc_html__( 'Normal', 'hello-plus' ),
1291 'conditions' => $this->get_conditions_by_type_value( 'social-icons' ),
1292 ]
1293 );
1294
1295 $this->add_control(
1296 'contact_details_social_icon_color',
1297 [
1298 'label' => esc_html__( 'Icon Color', 'hello-plus' ),
1299 'type' => Controls_Manager::COLOR,
1300 'global' => [
1301 'default' => Global_Colors::COLOR_SECONDARY,
1302 ],
1303 'selectors' => [
1304 '{{WRAPPER}} .ehp-contact' => '--contact-social-icon-color: {{VALUE}}',
1305 ],
1306 'conditions' => $this->get_conditions_by_type_value( 'social-icons' ),
1307 ]
1308 );
1309
1310 $this->end_controls_tab();
1311
1312 $this->start_controls_tab(
1313 'contact_details_social_hover_tab',
1314 [
1315 'label' => esc_html__( 'Hover', 'hello-plus' ),
1316 'conditions' => $this->get_conditions_by_type_value( 'social-icons' ),
1317 ]
1318 );
1319
1320 $this->add_control(
1321 'contact_details_social_icon_hover_color',
1322 [
1323 'label' => esc_html__( 'Icon Color', 'hello-plus' ),
1324 'type' => Controls_Manager::COLOR,
1325 'global' => [
1326 'default' => Global_Colors::COLOR_SECONDARY,
1327 ],
1328 'selectors' => [
1329 '{{WRAPPER}} .ehp-contact' => '--contact-social-icon-hover-color: {{VALUE}}',
1330 ],
1331 'conditions' => $this->get_conditions_by_type_value( 'social-icons' ),
1332 ]
1333 );
1334
1335 $this->add_control(
1336 'contact_details_social_icon_hover_animation',
1337 [
1338 'label' => esc_html__( 'Hover Animation', 'hello-plus' ),
1339 'type' => Controls_Manager::HOVER_ANIMATION,
1340 'conditions' => $this->get_conditions_by_type_value( 'social-icons' ),
1341 ]
1342 );
1343
1344 $this->end_controls_tab();
1345
1346 $this->end_controls_tabs();
1347
1348 $this->add_responsive_control(
1349 'contact_details_social_icon_size',
1350 [
1351 'label' => esc_html__( 'Icon Size', 'hello-plus' ),
1352 'type' => Controls_Manager::SLIDER,
1353 'size_units' => [ 'px', 'em', 'rem', 'custom' ],
1354 'range' => [
1355 'px' => [
1356 'min' => 0,
1357 'max' => 100,
1358 ],
1359 ],
1360 'default' => [
1361 'size' => 16,
1362 'unit' => 'px',
1363 ],
1364 'selectors' => [
1365 '{{WRAPPER}} .ehp-contact' => '--contact-social-icon-size: {{SIZE}}{{UNIT}}',
1366 ],
1367 'conditions' => $this->get_conditions_by_type_value( 'social-icons' ),
1368 'separator' => 'before',
1369 ]
1370 );
1371
1372 $this->add_responsive_control(
1373 'contact_details_social_icon_gap',
1374 [
1375 'label' => esc_html__( 'Icon Gap', 'hello-plus' ),
1376 'type' => Controls_Manager::SLIDER,
1377 'size_units' => [ 'px', 'em', 'rem', 'custom' ],
1378 'range' => [
1379 'px' => [
1380 'min' => 0,
1381 'max' => 100,
1382 ],
1383 ],
1384 'default' => [
1385 'size' => 8,
1386 'unit' => 'px',
1387 ],
1388 'selectors' => [
1389 '{{WRAPPER}} .ehp-contact' => '--contact-social-icon-gap: {{SIZE}}{{UNIT}}',
1390 ],
1391 'conditions' => $this->get_conditions_by_type_value( 'social-icons' ),
1392 ]
1393 );
1394
1395 $this->end_controls_section();
1396 }
1397
1398 protected function get_conditions_by_type_value( $type_value ): array {
1399 return [
1400 'relation' => 'or',
1401 'terms' => [
1402 [
1403 'name' => 'group_1_type',
1404 'operator' => '===',
1405 'value' => $type_value,
1406 ],
1407 [
1408 'relation' => 'and',
1409 'terms' => [
1410 [
1411 'name' => 'group_2_type',
1412 'operator' => '===',
1413 'value' => $type_value,
1414 ],
1415 [
1416 'name' => 'group_2_switcher',
1417 'operator' => '===',
1418 'value' => 'yes',
1419 ],
1420 ],
1421 ],
1422 [
1423 'relation' => 'and',
1424 'terms' => [
1425 [
1426 'name' => 'group_3_type',
1427 'operator' => '===',
1428 'value' => $type_value,
1429 ],
1430 [
1431 'name' => 'group_3_switcher',
1432 'operator' => '===',
1433 'value' => 'yes',
1434 ],
1435 ],
1436 ],
1437 [
1438 'relation' => 'and',
1439 'terms' => [
1440 [
1441 'name' => 'group_4_type',
1442 'operator' => '===',
1443 'value' => $type_value,
1444 ],
1445 [
1446 'name' => 'group_4_switcher',
1447 'operator' => '===',
1448 'value' => 'yes',
1449 ],
1450 ],
1451 ],
1452 ],
1453 ];
1454 }
1455
1456 protected function add_map_style_section() {
1457 $this->start_controls_section(
1458 'map_style_section',
1459 [
1460 'label' => esc_html__( 'Map', 'hello-plus' ),
1461 'tab' => Controls_Manager::TAB_STYLE,
1462 'condition' => [
1463 'layout_preset!' => 'quick-info',
1464 ],
1465 ]
1466 );
1467
1468 $this->add_control(
1469 'map_zoom',
1470 [
1471 'label' => esc_html__( 'Zoom', 'hello-plus' ),
1472 'type' => Controls_Manager::SLIDER,
1473 'default' => [
1474 'size' => 10,
1475 ],
1476 'range' => [
1477 'px' => [
1478 'min' => 1,
1479 'max' => 20,
1480 ],
1481 ],
1482 'separator' => 'before',
1483 ]
1484 );
1485
1486 $this->add_control(
1487 'map_stretch',
1488 [
1489 'label' => esc_html__( 'Stretch', 'hello-plus' ),
1490 'type' => Controls_Manager::SWITCHER,
1491 'label_on' => esc_html__( 'Yes', 'hello-plus' ),
1492 'label_off' => esc_html__( 'No', 'hello-plus' ),
1493 'return_value' => 'yes',
1494 'default' => 'no',
1495 ]
1496 );
1497
1498 $this->add_responsive_control(
1499 'map_width',
1500 [
1501 'label' => esc_html__( 'Width', 'hello-plus' ),
1502 'type' => Controls_Manager::SLIDER,
1503 'size_units' => [ 'px', 'em', 'rem', '%', 'custom' ],
1504 'default' => [
1505 'size' => 100,
1506 'unit' => '%',
1507 ],
1508 'range' => [
1509 '%' => [
1510 'max' => 100,
1511 ],
1512 ],
1513 'selectors' => [
1514 '{{WRAPPER}} .ehp-contact' => '--contact-map-width: {{SIZE}}{{UNIT}};',
1515 ],
1516 ]
1517 );
1518
1519 $this->add_responsive_control(
1520 'map_height',
1521 [
1522 'label' => esc_html__( 'Height', 'hello-plus' ),
1523 'type' => Controls_Manager::SLIDER,
1524 'size_units' => [ 'px', 'em', 'rem', '%', 'custom' ],
1525 'default' => [
1526 'size' => 540,
1527 'unit' => 'px',
1528 ],
1529 'range' => [
1530 'px' => [
1531 'min' => 40,
1532 'max' => 1440,
1533 ],
1534 ],
1535 'selectors' => [
1536 '{{WRAPPER}} .ehp-contact' => '--contact-map-height: {{SIZE}}{{UNIT}};',
1537 ],
1538 ]
1539 );
1540
1541 $this->add_control(
1542 'show_map_border',
1543 [
1544 'label' => esc_html__( 'Border', 'hello-plus' ),
1545 'type' => Controls_Manager::SWITCHER,
1546 'label_on' => esc_html__( 'Yes', 'hello-plus' ),
1547 'label_off' => esc_html__( 'No', 'hello-plus' ),
1548 'return_value' => 'yes',
1549 'default' => 'no',
1550 'separator' => 'before',
1551 ]
1552 );
1553
1554 $this->add_control(
1555 'map_border_width',
1556 [
1557 'label' => __( 'Border Width', 'hello-plus' ),
1558 'type' => Controls_Manager::SLIDER,
1559 'size_units' => [ 'px' ],
1560 'range' => [
1561 'px' => [
1562 'min' => 0,
1563 'max' => 10,
1564 'step' => 1,
1565 ],
1566 ],
1567 'default' => [
1568 'size' => 1,
1569 'unit' => 'px',
1570 ],
1571 'selectors' => [
1572 '{{WRAPPER}} .ehp-contact' => '--contact-map-border-width: {{SIZE}}{{UNIT}};',
1573 ],
1574 'condition' => [
1575 'show_map_border' => 'yes',
1576 ],
1577 ]
1578 );
1579
1580 $this->add_control(
1581 'map_border_color',
1582 [
1583 'label' => esc_html__( 'Color', 'hello-plus' ),
1584 'type' => Controls_Manager::COLOR,
1585 'global' => [
1586 'default' => Global_Colors::COLOR_TEXT,
1587 ],
1588 'selectors' => [
1589 '{{WRAPPER}} .ehp-contact' => '--contact-map-border-color: {{VALUE}}',
1590 ],
1591 'condition' => [
1592 'show_map_border' => 'yes',
1593 ],
1594 ]
1595 );
1596
1597 $shapes = new Ehp_Shapes( $this, [
1598 'widget_name' => $this->get_name(),
1599 'container_prefix' => 'map',
1600 ] );
1601 $shapes->add_style_controls();
1602
1603 $this->add_group_control(
1604 Group_Control_Box_Shadow::get_type(),
1605 [
1606 'name' => 'map_box_shadow',
1607 'selector' => '{{WRAPPER}} .ehp-contact__map',
1608 ]
1609 );
1610
1611 $this->end_controls_section();
1612 }
1613
1614 protected function add_box_style_section() {
1615 $this->start_controls_section(
1616 'box_style_section',
1617 [
1618 'label' => esc_html__( 'Box', 'hello-plus' ),
1619 'tab' => Controls_Manager::TAB_STYLE,
1620 ]
1621 );
1622
1623 $this->add_control(
1624 'box_background_label',
1625 [
1626 'label' => esc_html__( 'Background', 'hello-plus' ),
1627 'type' => Controls_Manager::HEADING,
1628 ]
1629 );
1630
1631 $this->add_group_control(
1632 Group_Control_Background::get_type(),
1633 [
1634 'name' => 'background',
1635 'types' => [ 'classic', 'gradient' ],
1636 'selector' => '{{WRAPPER}} .ehp-contact',
1637 ]
1638 );
1639
1640 $this->add_control(
1641 'box_background_overlay_label',
1642 [
1643 'label' => esc_html__( 'Background Overlay', 'hello-plus' ),
1644 'type' => Controls_Manager::HEADING,
1645 'separator' => 'before',
1646 ]
1647 );
1648
1649 $this->add_group_control(
1650 Group_Control_Background::get_type(),
1651 [
1652 'name' => 'background_overlay',
1653 'types' => [ 'classic', 'gradient' ],
1654 'selector' => '{{WRAPPER}} .ehp-contact__overlay',
1655 ]
1656 );
1657
1658 $this->add_responsive_control(
1659 'background_overlay_opacity',
1660 [
1661 'label' => esc_html__( 'Opacity', 'hello-plus' ),
1662 'type' => Controls_Manager::SLIDER,
1663 'range' => [
1664 '%' => [
1665 'max' => 1,
1666 'min' => 0.10,
1667 'step' => 0.01,
1668 ],
1669 ],
1670 'default' => [
1671 'unit' => '%',
1672 'size' => 0.5,
1673 ],
1674 'selectors' => [
1675 '{{WRAPPER}} .ehp-contact' => '--contact-overlay-opacity: {{SIZE}};',
1676 ],
1677 ]
1678 );
1679
1680 $this->add_responsive_control(
1681 'box_element_spacing',
1682 [
1683 'label' => esc_html__( 'Element Spacing', 'hello-plus' ),
1684 'type' => Controls_Manager::SLIDER,
1685 'size_units' => [ 'px', 'em', 'rem', '%', 'custom' ],
1686 'range' => [
1687 'px' => [
1688 'max' => 150,
1689 ],
1690 '%' => [
1691 'max' => 100,
1692 ],
1693 ],
1694 'default' => [
1695 'size' => 32,
1696 'unit' => 'px',
1697 ],
1698 'selectors' => [
1699 '{{WRAPPER}} .ehp-contact' => '--contact-elements-spacing: {{SIZE}}{{UNIT}};',
1700 ],
1701 'separator' => 'before',
1702 ]
1703 );
1704
1705 $this->add_responsive_control(
1706 'box_gap',
1707 [
1708 'label' => esc_html__( 'Gap', 'hello-plus' ),
1709 'type' => Controls_Manager::SLIDER,
1710 'size_units' => [ 'px', 'em', 'rem', '%', 'custom' ],
1711 'range' => [
1712 'px' => [
1713 'max' => 100,
1714 ],
1715 '%' => [
1716 'max' => 100,
1717 ],
1718 ],
1719 'default' => [
1720 'size' => 60,
1721 'unit' => 'px',
1722 ],
1723 'selectors' => [
1724 '{{WRAPPER}} .ehp-contact' => '--contact-box-gap: {{SIZE}}{{UNIT}};',
1725 ],
1726 'separator' => 'before',
1727 ]
1728 );
1729
1730 $this->add_control(
1731 'show_box_border',
1732 [
1733 'label' => esc_html__( 'Border', 'hello-plus' ),
1734 'type' => Controls_Manager::SWITCHER,
1735 'label_on' => esc_html__( 'Yes', 'hello-plus' ),
1736 'label_off' => esc_html__( 'No', 'hello-plus' ),
1737 'return_value' => 'yes',
1738 'default' => 'no',
1739 'separator' => 'before',
1740 ]
1741 );
1742
1743 $this->add_control(
1744 'box_border_width',
1745 [
1746 'label' => __( 'Border Width', 'hello-plus' ),
1747 'type' => Controls_Manager::SLIDER,
1748 'size_units' => [ 'px' ],
1749 'range' => [
1750 'px' => [
1751 'min' => 0,
1752 'max' => 10,
1753 'step' => 1,
1754 ],
1755 ],
1756 'default' => [
1757 'size' => 1,
1758 'unit' => 'px',
1759 ],
1760 'selectors' => [
1761 '{{WRAPPER}} .ehp-contact' => '--contact-box-border-width: {{SIZE}}{{UNIT}};',
1762 ],
1763 'condition' => [
1764 'show_box_border' => 'yes',
1765 ],
1766 ]
1767 );
1768
1769 $this->add_control(
1770 'box_border_color',
1771 [
1772 'label' => esc_html__( 'Color', 'hello-plus' ),
1773 'type' => Controls_Manager::COLOR,
1774 'global' => [
1775 'default' => Global_Colors::COLOR_TEXT,
1776 ],
1777 'selectors' => [
1778 '{{WRAPPER}} .ehp-contact' => '--contact-box-border-color: {{VALUE}}',
1779 ],
1780 'condition' => [
1781 'show_box_border' => 'yes',
1782 ],
1783 ]
1784 );
1785
1786 $shapes = new Ehp_Shapes( $this, [
1787 'widget_name' => $this->get_name(),
1788 'container_prefix' => 'box',
1789 ] );
1790 $shapes->add_style_controls();
1791
1792 $this->add_group_control(
1793 Group_Control_Box_Shadow::get_type(),
1794 [
1795 'name' => 'box_box_shadow',
1796 'selector' => '{{WRAPPER}} .ehp-contact',
1797 ]
1798 );
1799
1800 $padding = new Ehp_Padding( $this, [
1801 'widget_name' => $this->get_name(),
1802 'container_prefix' => 'box',
1803 'tablet_default_padding' => [
1804 'top' => '32',
1805 'right' => '32',
1806 'bottom' => '32',
1807 'left' => '32',
1808 ],
1809 'mobile_default_padding' => [
1810 'top' => '32',
1811 'right' => '32',
1812 'bottom' => '32',
1813 'left' => '32',
1814 ],
1815 ] );
1816 $padding->add_style_controls();
1817
1818 $this->add_control(
1819 'box_full_screen_height',
1820 [
1821 'label' => esc_html__( 'Full Screen Height', 'hello-plus' ),
1822 'type' => Controls_Manager::SWITCHER,
1823 'label_on' => esc_html__( 'Yes', 'hello-plus' ),
1824 'label_off' => esc_html__( 'No', 'hello-plus' ),
1825 'return_value' => 'yes',
1826 'default' => '',
1827 'tablet_default' => '',
1828 'mobile_default' => '',
1829 'separator' => 'before',
1830 ]
1831 );
1832
1833 $configured_breakpoints = $this->get_configured_breakpoints();
1834
1835 $this->add_control(
1836 'box_full_screen_height_controls',
1837 [
1838 'label' => esc_html__( 'Apply Full Screen Height on', 'hello-plus' ),
1839 'type' => Controls_Manager::SELECT2,
1840 'label_block' => true,
1841 'multiple' => true,
1842 'options' => $configured_breakpoints['devices_options'],
1843 'default' => $configured_breakpoints['active_devices'],
1844 'condition' => [
1845 'box_full_screen_height' => 'yes',
1846 ],
1847 ]
1848 );
1849
1850 $this->end_controls_section();
1851 }
1852 }
1853