PluginProbe
WP Directory Kit / 1.5.5
WP Directory Kit v1.5.5
1.5.9 1.5.7 1.5.6 1.5.5 1.5.4 1.5.3 trunk 1.1.0 1.1.6 1.1.8 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.8 All 37 releases
wpdirectorykit / elementor-elements / classes / wdk-search.php

wdk-search.php in WP Directory Kit 1.5.5, at elementor-elements/classes/wdk-search.php

2,137 lines 89.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Wdk\Elementor\Widgets;
4
5 use Wdk\Elementor\Widgets\WdkElementorBase;
6 use Elementor\Widget_Base;
7 use Elementor\Controls_Manager;
8 use Elementor\Utils;
9 use Elementor\Typography;
10 use Elementor\Editor;
11 use Elementor\Plugin;
12 use Elementor\Repeater;
13 use Elementor\Core\Schemes;
14 use Elementor\Icons_Manager;
15 use Elementor\Group_Control_Typography;
16 use Elementor\Group_Control_Border;
17 use Elementor\Group_Control_Box_Shadow;
18
19 if (!defined('ABSPATH'))
20 exit; // Exit if accessed directly
21
22 /**
23 * @since 1.1.0
24 */
25 class WdkSearch extends WdkElementorBase {
26
27 public function __construct($data = array(), $args = null) {
28
29 \Elementor\Controls_Manager::add_tab(
30 'tab_conf',
31 esc_html__('Settings', 'wpdirectorykit')
32 );
33
34 \Elementor\Controls_Manager::add_tab(
35 'tab_layout',
36 esc_html__('Layout', 'wpdirectorykit')
37 );
38
39 \Elementor\Controls_Manager::add_tab(
40 'tab_content',
41 esc_html__('Main', 'wpdirectorykit')
42 );
43
44 if ($this->is_edit_mode_load()) {
45 $this->enqueue_styles_scripts();
46 }
47
48 parent::__construct($data, $args);
49 }
50
51 /**
52 * Retrieve the widget name.
53 *
54 * @since 1.1.0
55 *
56 * @access public
57 *
58 * @return string Widget name.
59 */
60 public function get_name() {
61 return 'wdk-search';
62 }
63
64 /**
65 * Retrieve the widget title.
66 *
67 * @since 1.1.0
68 *
69 * @access public
70 *
71 * @return string Widget title.
72 */
73 public function get_title() {
74 return esc_html__('Wdk Search', 'wpdirectorykit');
75 }
76
77 /**
78 * Retrieve the widget icon.
79 *
80 * @since 1.1.0
81 *
82 * @access public
83 *
84 * @return string Widget icon.
85 */
86 public function get_icon() {
87 return 'eicon-search';
88 }
89
90 /**
91 * Register the widget controls.
92 *
93 * Adds different input fields to allow the user to change and customize the widget settings.
94 *
95 * @since 1.1.0
96 *
97 * @access protected
98 */
99 protected function register_controls() {
100 $this->generate_controls_conf();
101 $this->generate_controls_layout();
102 $this->generate_controls_styles();
103 $this->generate_controls_content();
104
105 $this->insert_pro_message('1');
106 parent::register_controls();
107 }
108
109 /**
110 * Render the widget output on the frontend.
111 *
112 * Written in PHP and used to generate the final HTML.
113 *
114 * @since 1.1.0
115 *
116 * @access protected
117 */
118 protected function render() {
119 parent::render();
120 $this->data['id_element'] = $this->get_id();
121 $this->data['settings'] = $this->get_settings();
122 $this->data['counts'] = array();
123
124 wp_enqueue_script('select2-select2');
125 wp_enqueue_script('wdk-select2');
126 wp_enqueue_style('select2-select2');
127 global $wdk_visible_filters_limit;
128 global $wdk_enable_search_fields_toggle;
129
130 global $wdk_search_fields_toggle_reset;
131 $wdk_search_fields_toggle_reset = true;
132
133 if(isset($this->data['settings']['section_config_more'])){
134 if($this->data['settings']['section_config_more'])
135 $wdk_enable_search_fields_toggle = true;
136 }
137
138 if(!empty($this->data['settings']['section_config_more_limit'])) {
139 $wdk_visible_filters_limit = $this->data['settings']['section_config_more_limit'] + 1;
140 } else {
141 $wdk_visible_filters_limit = 0;
142 }
143
144 $this->data['tab_field'] = NULL;
145
146 if(!empty($this->data['settings']['tab_field'])) {
147 $this->data['tab_field'] = substr($this->data['settings']['tab_field'], strpos($this->data['settings']['tab_field'],'__')+2);
148 }
149
150 $qr_string = trim($this->data['settings']['conf_predefields_query'],'?');
151 $string_par = array();
152 parse_str($qr_string, $string_par);
153 $this->data['predefields_query'] = array_map('trim', $string_par);
154
155 if(!empty($this->data['settings']['custom_category_root'])) {
156
157 if(!empty($this->data['settings']['field_id']) && strpos($this->data['settings']['field_id'],'__') !== FALSE){
158 $this->data['settings']['custom_category_root'] = substr($this->data['settings']['custom_category_root'], strpos($this->data['settings']['custom_category_root'],'__')+2);
159 }
160 if(is_intval($this->data['settings']['custom_category_root'])) {
161 $this->data['predefields_query']['custom_category_root'] = $this->data['settings']['custom_category_root'];
162 }
163 }
164
165 if(!empty($this->data['settings']['custom_location_root'])) {
166 if(strpos($this->data['settings']['field_id'],'__') !== FALSE){
167 $this->data['settings']['custom_location_root'] = substr($this->data['settings']['custom_location_root'], strpos($this->data['settings']['custom_location_root'],'__')+2);
168 }
169
170 if(is_intval($this->data['settings']['custom_location_root'])) {
171 $this->data['predefields_query']['custom_location_root'] = $this->data['settings']['custom_location_root'];
172 }
173 }
174
175 $this->data['is_edit_mode'] = false;
176 if(Plugin::$instance->editor->is_edit_mode()) {
177 $this->data['is_edit_mode'] = true;
178 }
179
180 /* count */
181 if($this->data['tab_field'] && wmvc_show_data('tabs_count', $this->data['settings']) == 'yes') {
182 if(wdk_is_listing_field_exists('field_'.$this->data['tab_field'].'_'.wdk_field_option($this->data['tab_field'], 'field_type'))) {
183 $columns = array('ID', 'location_id', 'category_id', 'post_title', 'post_date', 'search', 'order_by','is_featured', 'address');
184 $external_columns = array('location_id', 'category_id', 'post_title');
185 $controller = 'listing';
186
187 wdk_prepare_search_query_GET($columns, $controller.'_m', $external_columns);
188 $this->WMVC->db->select('COUNT(DISTINCT '.$this->WMVC->db->prefix.'wdk_listings.post_id) as total_count');
189 $this->WMVC->db->group_by('field_'.$this->data['tab_field'].'_'.wdk_field_option($this->data['tab_field'], 'field_type'));
190 $total_items = $this->WMVC->listing_m->get_pagination(NULL, NULL, array('is_activated' => 1,'is_approved'=>1));
191
192 foreach ($total_items as $key => $row) {
193 $this->data['counts'][$this->data['tab_field']][wmvc_show_data('field_'.$this->data['tab_field'].'_'.wdk_field_option($this->data['tab_field'], 'field_type'),$row, 0)] = wmvc_show_data('total_count', $row, 0);
194 }
195 }
196 }
197
198
199 echo $this->view('wdk-search', $this->data);
200 }
201
202
203 private function generate_controls_conf() {
204 $this->start_controls_section(
205 'section_config',
206 [
207 'label' => __( 'Configuration', 'wpdirectorykit' ),
208 ]
209 );
210
211 if(wdk_get_option('wdk_experimental_features') && wdk_get_option('wdk_experimental_ajax_results')){
212 $this->add_control(
213 'is_ajax_enable',
214 [
215 'label' => __( 'Enable Reload content with ajax', 'wpdirectorykit' ),
216 'type' => \Elementor\Controls_Manager::SWITCHER,
217 'label_on' => __( 'True', 'wpdirectorykit' ),
218 'label_off' => __( 'False', 'wpdirectorykit' ),
219 'return_value' => 'yes',
220 'default' => '',
221
222 ]
223 );
224 }
225
226 $this->add_control(
227 'auto_search_enable',
228 [
229 'label' => __( 'Auto Search Enable', 'wpdirectorykit' ),
230 'type' => Controls_Manager::SWITCHER,
231 'label_on' => __( 'Show', 'wpdirectorykit' ),
232 'label_off' => __( 'Hide', 'wpdirectorykit' ),
233 'return_value' => 'yes',
234 'default' => '',
235 ]
236 );
237
238 $this->add_control(
239 'section_config_more',
240 [
241 'label' => __( 'Field more hide', 'wpdirectorykit' ),
242 'type' => Controls_Manager::SWITCHER,
243 'label_on' => __( 'Show', 'wpdirectorykit' ),
244 'label_off' => __( 'Hide', 'wpdirectorykit' ),
245 'return_value' => 'none',
246 'default' => '',
247 'selectors' => [
248 '{{WRAPPER}} .wdk-field-group-additional' => 'display: {{VALUE}};',
249 ],
250 ]
251 );
252
253 $this->add_control(
254 'section_more_before_buttons',
255 [
256 'label' => __( 'Show Additional Fields Before Search Buttons', 'wpdirectorykit' ),
257 'type' => Controls_Manager::SWITCHER,
258 'label_on' => __( 'Yes', 'wpdirectorykit' ),
259 'label_off' => __( 'None', 'wpdirectorykit' ),
260 'return_value' => 'yes',
261 'default' => '',
262 ]
263 );
264
265 $this->add_control(
266 'section_config_more_limit',
267 [
268 'label' => __( 'Limit Visible Fields', 'wpdirectorykit' ),
269 'type' => Controls_Manager::NUMBER,
270 'min' => 0,
271 'step' => 1,
272 'default' => 3,
273 ]
274 );
275
276 $pages = array('' => __('Not Selected', 'wpdirectorykit'));
277 foreach(get_pages(array('sort_column' => 'post_title')) as $page)
278 {
279 $pages[$page->ID] = $page->post_title.' #'.$page->ID;
280 }
281
282 $this->add_control(
283 'conf_link',
284 [
285 'label' => __( 'Open results on page', 'wpdirectorykit' ),
286 'type' => \Elementor\Controls_Manager::SELECT2,
287 'default' => '',
288 'options' => $pages
289 ]
290 );
291
292 $this->add_control(
293 'text_search_button',
294 [
295 'label' => __( 'Search button text', 'wpdirectorykit' ),
296 'type' => \Elementor\Controls_Manager::TEXT,
297 'default' => __( 'Search', 'wpdirectorykit' ),
298 ]
299 );
300
301 $this->add_control(
302 'text_reset_button',
303 [
304 'label' => __( 'Reset button text', 'wpdirectorykit' ),
305 'type' => \Elementor\Controls_Manager::TEXT,
306 'default' => __( 'Reset', 'wpdirectorykit' ),
307 ]
308 );
309
310 $this->add_responsive_control(
311 'field_button_icon_header',
312 [
313 'label' => esc_html__('Icon', 'wpdirectorykit'),
314 'type' => Controls_Manager::HEADING,
315 'separator' => 'before',
316 ]
317 );
318
319 $this->add_control(
320 'field_button_icon',
321 [
322 'label' => __( 'Icon', 'text-domain' ),
323 'type' => Controls_Manager::ICONS,
324 ]
325 );
326
327 $this->add_control(
328 'field_button_icon_position',
329 [
330 'label' => esc_html__('icon Position', 'wdk-compare-listing'),
331 'type' => Controls_Manager::SELECT,
332 'options' => [
333 'left' => esc_html__('Left', 'wdk-compare-listing'),
334 'right' => esc_html__('Right', 'wdk-compare-listing'),
335 ],
336 'default' => 'left',
337 ]
338 );
339
340 $selectors = array();
341 $selectors['normal'] = '{{WRAPPER}} .wdk-field button.wdk-search-start .icon_search';
342
343 $this->generate_renders_tabs($selectors, 'field_button_icon_dynamic', array('margin','font-size'));
344
345
346 $this->add_control(
347 'text_more_button',
348 [
349 'label' => __( 'More button text', 'wpdirectorykit' ),
350 'type' => \Elementor\Controls_Manager::TEXT,
351 'default' => __( 'More', 'wpdirectorykit' ),
352 ]
353 );
354
355
356 $WMVC = &wdk_get_instance();
357 $WMVC->model('field_m');
358 $fields = $WMVC->field_m->get_by(array('field_type' => 'DROPDOWN'));
359
360 $fields_list = array('' => esc_html__('Not Selected', 'wpdirectorykit'));
361 $order_i = 0;
362 foreach($fields as $field)
363 {
364 $fields_list[wmvc_show_data('idfield', $field)] = '#'.wmvc_show_data('idfield', $field).' '.wmvc_show_data('field_label', $field);
365 }
366
367 // build raw_options preserving order
368 $raw = [];
369 foreach ( $fields_list as $k => $v ) {
370 $raw[] = [
371 'value' => (string) $k,
372 'label' => $v,
373 ];
374 }
375
376 $this->add_control(
377 'tab_field',
378 [
379 'label' => __( 'Tab', 'wpdirectorykit' ),
380 'type' => \Wdk\Includes\Controls\Wdk_Field_Selector::INIT,
381 'options' => $fields_list,
382 'raw_options' => $raw,
383 'default' => 'results',
384 ]
385 );
386
387 $this->add_control(
388 'tabs_count',
389 [
390 'label' => __( 'Count Results in tabs', 'wpdirectorykit' ),
391 'type' => Controls_Manager::SWITCHER,
392 'label_on' => __( 'Show', 'wpdirectorykit' ),
393 'label_off' => __( 'Hide', 'wpdirectorykit' ),
394 'return_value' => 'yes',
395 'default' => '',
396 ]
397 );
398
399 $this->add_control(
400 'important_note',
401 [
402 'label' => '',
403 'type' => \Elementor\Controls_Manager::RAW_HTML,
404 'raw' => wdk_sprintf(__( 'Manage Search Form <a href="%1$s" target="_blank"> open </a>', 'wpdirectorykit' ), admin_url('admin.php?page=wdk_searchform')),
405 'content_classes' => 'wdk_elementor_hint',
406 'separator' => 'after',
407 ]
408 );
409
410 $this->add_control(
411 'conf_predefields_query',
412 [
413 'label' => __( 'Default Search Fields Values', 'wpdirectorykit' ),
414 'type' => \Elementor\Controls_Manager::TEXTAREA,
415 'rows' => 5,
416 'default' => '',
417 'placeholder' => __( 'Type your query here, example xxx', 'wpdirectorykit' ),
418 'description' => '<span style="word-break: break-all;">'.__( 'Example (same like on url):', 'wpdirectorykit' ).
419 ' field_6_min=100&field_6_max=200&field_5=rent&is_featured=on&search_category=3&search_location=4'.
420 '</span>',
421 ]
422 );
423
424 $WMVC = &wdk_get_instance();
425 $WMVC->model('category_m');
426 $WMVC->model('location_m');
427 $categories_data = $WMVC->category_m->get_by(array('(parent_id = 0 OR parent_id IS NULL)' => NULL));
428 $categories_list = array('' => esc_html__('Not Selected', 'wpdirectorykit'));
429 foreach($categories_data as $category)
430 {
431 $categories_list[wmvc_show_data('idcategory', $category)] = '#'.wmvc_show_data('idcategory', $category).' '.wmvc_show_data('category_title', $category);
432 }
433
434 $this->add_control(
435 'custom_category_root',
436 [
437 'label' => __( 'Custom Category Root', 'wpdirectorykit' ),
438 'type' => Controls_Manager::SELECT2,
439 'options' => $categories_list,
440 'default' => '',
441 ]
442 );
443
444 $locations_data = $WMVC->location_m->get_by(array('(parent_id = 0 OR parent_id IS NULL)' => NULL));
445 $locations_list = array('' => esc_html__('Not Selected', 'wpdirectorykit'));
446 foreach($locations_data as $location)
447 {
448 $locations_list[wmvc_show_data('idlocation', $location)] = '#'.wmvc_show_data('idlocation', $location).' '.wmvc_show_data('location_title', $location);
449 }
450 $this->add_control(
451 'custom_location_root',
452 [
453 'label' => __( 'Custom Location Root', 'wpdirectorykit' ),
454 'type' => Controls_Manager::SELECT2,
455 'options' => $locations_list,
456 'default' => '',
457 ]
458 );
459
460
461 if(true){
462 $this->add_control(
463 'enable_custom_fields',
464 [
465 'label' => __( 'Enable Custom Fields', 'wpdirectorykit' ),
466 'type' => \Elementor\Controls_Manager::SWITCHER,
467 'label_on' => __( 'True', 'wpdirectorykit' ),
468 'label_off' => __( 'False', 'wpdirectorykit' ),
469 'return_value' => 'yes',
470 'default' => '',
471 ]
472 );
473
474 $fields_data = wdk_cached_field_get();
475 $fields_list = array('' => esc_html__('Not Selected', 'wpdirectorykit'));
476 $fields_allow_types = array();
477 $fields_allow_tree_types = array();
478
479 $fields_list ['section'] = esc_html__('-- Section Custom fields --', 'wpdirectorykit');
480 $fields_list ['search'] = esc_html__('Smart Search', 'wpdirectorykit');
481
482 if(function_exists('run_wdk_bookings')) {
483 $fields_list ['booking_date'] = esc_html__('Booking Date', 'wpdirectorykit');
484 $fields_list ['booking_guest'] = esc_html__('Booking Guests', 'wpdirectorykit');
485 }
486
487 $fields_list ['post_title'] = esc_html__('WP Title', 'wpdirectorykit');
488 $fields_list ['post_title'] = esc_html__('WP Title', 'wpdirectorykit');
489 $fields_list ['address'] = esc_html__('Address', 'wpdirectorykit');
490 $fields_list ['category_id'] = esc_html__('Category', 'wpdirectorykit');
491 $fields_allow_tree_types[] = 'category_id';
492 $fields_list ['location_id'] = esc_html__('Location', 'wpdirectorykit');
493 $fields_allow_tree_types[] = 'location_id';
494
495 foreach($fields_data as $field)
496 {
497 if(in_array(wmvc_show_data('field_type', $field),array('TEXTAREA','TEXTAREA_WYSIWYG'))) {
498 continue;
499 } else if(in_array(wmvc_show_data('field_type', $field),array('SECTION'))) {
500 $fields_list ['section__'.wmvc_show_data('idfield', $field)] = '-- '.esc_html__('Section', 'wpdirectorykit').' '.wmvc_show_data('field_label', $field).' --';
501 } else {
502 $fields_list[wmvc_show_data('idfield', $field)] = '#'.wmvc_show_data('idfield', $field).' '.wmvc_show_data('field_label', $field).'['.wmvc_show_data('field_type', $field).']';
503 }
504
505 if(wmvc_show_data('field_type', $field) == 'NUMBER') {
506 $fields_allow_types[] = ''.wmvc_show_data('idfield', $field);
507 }
508 }
509
510 // build raw_options preserving order
511 $raw = [];
512 foreach ( $fields_list as $k => $v ) {
513 $raw[] = [
514 'value' => (string) $k,
515 'label' => $v,
516 ];
517 }
518
519 $repeater = new Repeater();
520 $repeater->start_controls_tabs( 'custom_fields_repeat' );
521
522 $repeater->add_control(
523 'field_id',
524 [
525 'label' => __( 'Field id', 'wpdirectorykit' ),
526 'type' => \Wdk\Includes\Controls\Wdk_Field_Selector::INIT,
527 'default' => '',
528 'options' => $fields_list,
529 'raw_options' => $raw,
530 'separator' => 'after',
531 ]
532 );
533
534 $repeater->add_control(
535 'field_css_class',
536 [
537 'label' => __( 'Css Class', 'wpdirectorykit' ),
538 'type' => \Elementor\Controls_Manager::TEXT,
539 'default' => '',
540 ]
541 );
542
543 $repeater->add_control(
544 'field_placeholder',
545 [
546 'label' => __( 'Placeholder', 'wpdirectorykit' ),
547 'type' => \Elementor\Controls_Manager::TEXT,
548 'default' => '',
549 ]
550 );
551
552 $repeater->add_control(
553 'field_columns_number',
554 [
555 'label' => __( 'Columns/Width', 'wpdirectorykit' ),
556 'type' => \Elementor\Controls_Manager::HIDDEN,
557 'min' => '0',
558 'max' => '12',
559 'step' => '1',
560 'default' => '',
561 ]
562 );
563
564 $repeater->add_control(
565 'search_type_tree',
566 [
567 'label' => __( 'Field Layout', 'wpdirectorykit' ),
568 'type' => \Elementor\Controls_Manager::SELECT,
569 'default' => '',
570 'options' => array(
571 '' => __( 'Default', 'wpdirectorykit' ),
572 '_checkboxes' => __( 'Checkboxes', 'wpdirectorykit' ),
573 /*'_tree' => __( 'Tree with Search', 'wpdirectorykit' ),
574 '_multi_selector' => __( 'Tree multi Select', 'wpdirectorykit' ),
575 '_multi_selects' => __( 'Multi Selects', 'wpdirectorykit' ),*/
576 ),
577 'condition' => [
578 'field_id' => $fields_allow_tree_types,
579 ],
580 ]
581 );
582
583 $repeater->add_control(
584 'search_type_tree_hide',
585 [
586 'label' => __( 'Hide by id', 'wpdirectorykit' ),
587 'description' => __( 'Hide locations/categories based on id, example 1,2,3,4,xxx', 'wpdirectorykit' ),
588 'type' => \Elementor\Controls_Manager::TEXT,
589 'default' => '',
590 'condition' => [
591 'field_id' => $fields_allow_tree_types,
592 ],
593 ]
594 );
595
596 $repeater->add_control(
597 'search_type',
598 [
599 'label' => __( 'Search Type', 'wpdirectorykit' ),
600 'type' => \Elementor\Controls_Manager::SELECT,
601 'default' => '',
602 'options' => array(
603 '' => __( 'None', 'wpdirectorykit' ),
604 'min' => __( 'Min', 'wpdirectorykit' ),
605 'max' => __( 'Max', 'wpdirectorykit' ),
606 'min_max' => __( 'Min/Max', 'wpdirectorykit' ),
607 'slider_range' => __( 'Slider Range', 'wpdirectorykit' ),
608 ),
609 'condition' => [
610 'field_id' => $fields_allow_types,
611 ],
612 ]
613 );
614
615 $repeater->add_control(
616 'value_min',
617 [
618 'label' => __( 'Value Min', 'wpdirectorykit' ),
619 'type' => \Elementor\Controls_Manager::NUMBER,
620 'default' => '',
621 'conditions' => [
622 'terms' => [
623 [
624 'name' => 'search_type',
625 'operator' => '==',
626 'value' => 'slider_range',
627 ]
628 ],
629 ],
630 ]
631 );
632
633 $repeater->add_control(
634 'value_max',
635 [
636 'label' => __( 'Value Max', 'wpdirectorykit' ),
637 'type' => \Elementor\Controls_Manager::NUMBER,
638 'default' => '',
639 'conditions' => [
640 'terms' => [
641 [
642 'name' => 'search_type',
643 'operator' => '==',
644 'value' => 'slider_range',
645 ]
646 ],
647 ],
648 ]
649 );
650
651 $repeater->end_controls_tabs();
652
653
654 $this->add_control(
655 'custom_fields',
656 [
657 'type' => Controls_Manager::REPEATER,
658 'fields' => $repeater->get_controls(),
659 'label' => __( 'Field id', 'wpdirectorykit' ),
660 'default' => [
661 ],
662 'title_field' => "<# "
663 . "let labels = ".json_encode($fields_list)."; "
664 . "let label = labels[field_id]; "
665 . "#>"
666 . "{{{ label }}}",
667
668
669 'conditions' => [
670 'terms' => [
671 [
672 'name' => 'enable_custom_fields',
673 'operator' => '==',
674 'value' => 'yes',
675 ]
676 ],
677 ],
678 ]
679 );
680
681 }
682
683 $this->end_controls_section();
684 }
685
686 private function generate_controls_layout() {
687 /* TAB_STYLE */
688 $this->start_controls_section(
689 'section_form_style',
690 [
691 'label' => __( 'Form', 'wpdirectorykit' ),
692 'tab' => Controls_Manager::TAB_STYLE,
693 ]
694 );
695
696 $this->add_responsive_control(
697 'search_scroll',
698 [
699 'label' => __( 'On search scroll to', 'wpdirectorykit' ),
700 'type' => Controls_Manager::SELECT,
701 'options' => [
702 '' => esc_html__('No scroll', 'wpdirectorykit'),
703 'results' => esc_html__('Results', 'wpdirectorykit'),
704 'wdk_map_results' => esc_html__('Map', 'wpdirectorykit'),
705 ],
706 'default' => 'results',
707 ]
708 );
709
710
711 $this->add_responsive_control(
712 'form_fields_align',
713 [
714 'label' => __( 'Align', 'wpdirectorykit' ),
715 'type' => Controls_Manager::CHOOSE,
716 'options' => [
717 'left' => [
718 'title' => esc_html__( 'Left', 'wpdirectorykit' ),
719 'icon' => 'eicon-text-align-left',
720 ],
721 'center' => [
722 'title' => esc_html__( 'Center', 'wpdirectorykit' ),
723 'icon' => 'eicon-text-align-center',
724 ],
725 'right' => [
726 'title' => esc_html__( 'Right', 'wpdirectorykit' ),
727 'icon' => 'eicon-text-align-right',
728 ],
729 ],
730 'render_type' => 'template',
731 'selectors_dictionary' => [
732 'left' => 'justify-content: flex-start;',
733 'center' => 'justify-content: center;',
734 'right' => 'justify-content: flex-end;',
735 ],
736
737 'selectors' => [
738 '{{WRAPPER}} .wdk-search .wdk-search-form > .wdk-row ' => '{{VALUE}};',
739 ],
740 ]
741 );
742
743 $this->add_responsive_control(
744 'design_layout',
745 [
746 'label' => __( 'Design Layout', 'wpdirectorykit' ),
747 'type' => Controls_Manager::SELECT,
748 'options' => [
749 '' => esc_html__('Not Selected', 'wpdirectorykit'),
750 'vertical' => esc_html__('Vertical', 'wpdirectorykit'),
751 'inline' => esc_html__('Horizontal', 'wpdirectorykit'),
752 ],
753 'default' => 'inline',
754 ]
755 );
756
757 $this->add_responsive_control(
758 'row_gap_col_inline',
759 [
760 'label' => __( 'Columns', 'wpdirectorykit' ),
761 'type' => Controls_Manager::SELECT,
762 'options' => [
763 '' => esc_html__('Default', 'wpdirectorykit'),
764 'auto' => esc_html__('Auto', 'wpdirectorykit'),
765 '100%' => '1',
766 '50%' => '2',
767 'calc(100% / 3)' => '3',
768 '25%' => '4',
769 '20%' => '5',
770 'auto_flexible' => 'auto flexible',
771 ],
772 'selectors_dictionary' => [
773 'auto' => 'width:auto;-webkit-flex:0 0 auto;flex:0 0 auto',
774 '100%' => 'width:100%;-webkit-flex:0 0 100%;flex:0 0 100%',
775 '50%' => 'width:50%;-webkit-flex:0 0 50%;flex:0 0 50%',
776 'calc(100% / 3)' => 'width:calc(100% / 3);-webkit-flex:0 0 calc(100% / 3);flex:0 0 calc(100% / 3)',
777 '25%' => 'width:25%;-webkit-flex:0 0 25%;flex:0 0 25%',
778 '20%' => 'width:20%;-webkit-flex:0 0 20%;flex:0 0 20%',
779 'auto' => 'width:auto;-webkit-flex:0 0 auto;flex:0 0 auto',
780 'auto_flexible' => 'width:auto;-webkit-flex:1 2 auto;flex:1 2 auto',
781 ],
782 'selectors' => [
783 '{{WRAPPER}} .wdk-search.layout_inline .wdk-row .wdk-col' => '{{UNIT}}',
784 ],
785 'default' => '',
786 'separator' => 'before',
787 'conditions' => [
788 'terms' => [
789 [
790 'name' => 'design_layout',
791 'operator' => '==',
792 'value' => 'inline',
793 ]
794 ],
795 ],
796 ]
797 );
798
799 $this->add_responsive_control(
800 'row_gap_col_hor',
801 [
802 'label' => __( 'Columns', 'wpdirectorykit' ),
803 'type' => Controls_Manager::SELECT,
804 'options' => [
805 '' => esc_html__('Default', 'wpdirectorykit'),
806 'auto' => esc_html__('Auto', 'wpdirectorykit'),
807 '100%' => '1',
808 '50%' => '2',
809 'calc(100% / 3)' => '3',
810 '25%' => '4',
811 '20%' => '5',
812 'auto_flexible' => 'auto flexible',
813 ],
814 'selectors_dictionary' => [
815 'auto' => 'width:auto;-webkit-flex:0 0 auto;flex:0 0 auto',
816 '100%' => 'width:100%;-webkit-flex:0 0 100%;flex:0 0 100%',
817 '50%' => 'width:50%;-webkit-flex:0 0 50%;flex:0 0 50%',
818 'calc(100% / 3)' => 'width:calc(100% / 3);-webkit-flex:0 0 calc(100% / 3);flex:0 0 calc(100% / 3)',
819 '25%' => 'width:25%;-webkit-flex:0 0 25%;flex:0 0 25%',
820 '20%' => 'width:20%;-webkit-flex:0 0 20%;flex:0 0 20%',
821 'auto' => 'width:auto;-webkit-flex:0 0 auto;flex:0 0 auto',
822 'auto_flexible' => 'width:auto;-webkit-flex:1 2 auto;flex:1 2 auto',
823 ],
824 'selectors' => [
825 '{{WRAPPER}} .wdk-search:not(.layout_inline) .wdk-row .wdk-col' => '{{UNIT}}',
826 ],
827 'default' => '100%',
828 'separator' => 'before',
829 'conditions' => [
830 'terms' => [
831 [
832 'name' => 'design_layout',
833 'operator' => '==',
834 'value' => 'vertical',
835 ]
836 ],
837 ],
838 ]
839 );
840
841 $this->add_responsive_control(
842 'column_gap',
843 [
844 'label' => esc_html__('Columns Gap', 'wpdirectorykit'),
845 'type' => Controls_Manager::SLIDER,
846 'range' => [
847 'px' => [
848 'min' => 0,
849 'max' => 60,
850 ],
851 ],
852 'selectors' => [
853 '{{WRAPPER}} .wdk-search.layout_inline .wdk-row .wdk-col' => 'padding-left: {{SIZE}}{{UNIT}};padding-right: {{SIZE}}{{UNIT}};;',
854 '{{WRAPPER}} .wdk-search.layout_inline .wdk-row' => 'margin-left: -{{SIZE}}{{UNIT}};margin-right: -{{SIZE}}{{UNIT}};',
855 ],
856 'conditions' => [
857 'terms' => [
858 [
859 'name' => 'design_layout',
860 'operator' => '==',
861 'value' => 'inline',
862 ]
863 ],
864 ],
865
866 ]
867 );
868
869 $this->add_responsive_control(
870 'column_gap_v',
871 [
872 'label' => esc_html__('Columns Gap', 'wpdirectorykit'),
873 'type' => Controls_Manager::SLIDER,
874 'range' => [
875 'px' => [
876 'min' => 0,
877 'max' => 60,
878 ],
879 ],
880 'selectors' => [
881 '{{WRAPPER}} .wdk-search:not(.layout_inline) .wdk-row .wdk-col' => 'padding-left: {{SIZE}}{{UNIT}};padding-right: {{SIZE}}{{UNIT}};;',
882 '{{WRAPPER}} .wdk-search:not(.layout_inline) .wdk-row' => 'margin-left: -{{SIZE}}{{UNIT}};margin-right: -{{SIZE}}{{UNIT}};',
883 ],
884 'conditions' => [
885 'terms' => [
886 [
887 'name' => 'design_layout',
888 'operator' => '==',
889 'value' => 'vertical',
890 ]
891 ],
892 ],
893
894 ]
895 );
896
897 $this->add_responsive_control(
898 'row_gap_inline',
899 [
900 'label' => esc_html__('Rows Gap', 'wpdirectorykit'),
901 'type' => Controls_Manager::SLIDER,
902 'range' => [
903 'px' => [
904 'min' => 0,
905 'max' => 60,
906 ],
907 ],
908
909 'selectors' => [
910 '{{WRAPPER}} .wdk-search.layout_inline .wdk-row .wdk-col' => 'margin-bottom: {{SIZE}}{{UNIT}};',
911 '{{WRAPPER}} .wdk-search.layout_inline .wdk-row' => 'margin-bottom: -{{SIZE}}{{UNIT}};',
912 ],
913
914 'conditions' => [
915 'terms' => [
916 [
917 'name' => 'design_layout',
918 'operator' => '==',
919 'value' => 'inline',
920 ]
921 ],
922 ],
923 ]
924 );
925
926 $this->add_responsive_control(
927 'row_gap_horizontal',
928 [
929 'label' => esc_html__('Rows Gap', 'wpdirectorykit'),
930 'type' => Controls_Manager::SLIDER,
931 'range' => [
932 'px' => [
933 'min' => 0,
934 'max' => 60,
935 ],
936 ],
937 'default' => [
938 'size' => 10,
939 ],
940 'selectors' => [
941 '{{WRAPPER}} .wdk-search:not(.layout_inline) .wdk-row .wdk-col' => 'margin-bottom: {{SIZE}}{{UNIT}};',
942 '{{WRAPPER}} .wdk-search:not(.layout_inline) .wdk-row' => 'margin-bottom: -{{SIZE}}{{UNIT}};',
943 ],
944 'conditions' => [
945 'terms' => [
946 [
947 'name' => 'design_layout',
948 'operator' => '==',
949 'value' => 'vertical',
950 ]
951 ],
952 ],
953 ]
954 );
955
956 $this->add_control(
957 'heading_suc_message',
958 [
959 'label' => __( 'Fields', 'wpdirectorykit' ),
960 'type' => Controls_Manager::HEADING,
961 'separator' => 'before',
962 ]
963 );
964
965 $this->add_control(
966 'fields_height',
967 [
968 'label' => __( 'Fields height', 'wpdirectorykit' ),
969 'type' => Controls_Manager::SLIDER,
970 'render_type' => 'template',
971 'range' => [
972 'px' => [
973 'min' => 20,
974 'max' => 400,
975 ],
976 ],
977 'selectors' => [
978 '{{WRAPPER}} .wdk-field label.checkbox, {{WRAPPER}} .wdk-field input[type="text"],{{WRAPPER}} .wdk-field input[type="number"], {{WRAPPER}} .wdk-field select' => 'height: {{SIZE}}{{UNIT}};',
979 '{{WRAPPER}} .wdk_dropdown_tree > .btn-group' => 'height: {{SIZE}}{{UNIT}};',
980 '{{WRAPPER}} .wdk-field.CHECKBOX' => 'height: {{SIZE}}{{UNIT}};',
981 '{{WRAPPER}} .wdk-field button.wdk-search-additional-btn, {{WRAPPER}} .wdk-field button.wdk-search-start' => 'height: {{SIZE}}{{UNIT}};',
982 ],
983 ]
984 );
985
986 $this->add_control(
987 'fields_height_mult',
988 [
989 'label' => __( 'Select Multiple', 'wpdirectorykit' ),
990 'type' => Controls_Manager::SLIDER,
991 'render_type' => 'template',
992 'range' => [
993 'px' => [
994 'min' => 20,
995 'max' => 400,
996 ],
997 ],
998 'selectors' => [
999 '{{WRAPPER}} .wdk-field select[multiple="multiple"]' => 'height: {{SIZE}}{{UNIT}};',
1000 ],
1001 ]
1002 );
1003
1004 $this->end_controls_section();
1005
1006 /* Buttons Search / Save / More */
1007 $this->start_controls_section(
1008 'section_form_wdk_field_section',
1009 [
1010 'label' => __( 'Button', 'wpdirectorykit' ),
1011 'tab' => Controls_Manager::TAB_STYLE,
1012 ]
1013 );
1014
1015 $this->add_responsive_control(
1016 'button_wrapper',
1017 [
1018 'label' => __( 'Button Wrapper Hide', 'wpdirectorykit' ),
1019 'type' => Controls_Manager::SWITCHER,
1020 'label_on' => __( 'Show', 'wpdirectorykit' ),
1021 'label_off' => __( 'Hide', 'wpdirectorykit' ),
1022 'return_value' => 'none',
1023 'default' => '',
1024 'selectors' => [
1025 '{{WRAPPER}} .wdk-search .wdk-col-btns' => 'display: {{VALUE}};',
1026 ],
1027 ]
1028 );
1029
1030 $this->add_responsive_control(
1031 'button_column_inline',
1032 [
1033 'label' => __( 'Column Buttons Cell', 'wpdirectorykit' ),
1034 'type' => Controls_Manager::SELECT,
1035 'options' => [
1036 '' => esc_html__('Default', 'wpdirectorykit'),
1037 'auto' => esc_html__('Auto', 'wpdirectorykit'),
1038 '100%' => '1',
1039 '50%' => '2',
1040 'calc(100% / 3)' => '3',
1041 '25%' => '4',
1042 '20%' => '5',
1043 'auto_flexible' => 'auto flexible',
1044 ],
1045 'selectors_dictionary' => [
1046 'auto' => 'width:auto;-webkit-flex:0 0 auto;flex:0 0 auto',
1047 '100%' => 'width:100%;-webkit-flex:0 0 100%;flex:0 0 100%',
1048 '50%' => 'width:50%;-webkit-flex:0 0 50%;flex:0 0 50%',
1049 'calc(100% / 3)' => 'width:calc(100% / 3);-webkit-flex:0 0 calc(100% / 3);flex:0 0 calc(100% / 3)',
1050 '25%' => 'width:25%;-webkit-flex:0 0 25%;flex:0 0 25%',
1051 '20%' => 'width:20%;-webkit-flex:0 0 20%;flex:0 0 20%',
1052 'auto' => 'width:auto;-webkit-flex:0 0 auto;flex:0 0 auto',
1053 'auto_flexible' => 'width:auto;-webkit-flex:1 2 auto;flex:1 2 auto',
1054 ],
1055 'selectors' => [
1056 '{{WRAPPER}} .wdk-search.layout_inline .wdk-col:not(.wdk-field)' => '{{UNIT}}',
1057 ],
1058 'default' => '',
1059 'conditions' => [
1060 'terms' => [
1061 [
1062 'name' => 'design_layout',
1063 'operator' => '==',
1064 'value' => 'inline',
1065 ]
1066 ],
1067 ],
1068 ]
1069 );
1070
1071 $this->add_responsive_control(
1072 'button_column_horizontal',
1073 [
1074 'label' => __( 'Column Buttons Cell', 'wpdirectorykit' ),
1075 'type' => Controls_Manager::SELECT,
1076 'options' => [
1077 '' => esc_html__('Default', 'wpdirectorykit'),
1078 'auto' => esc_html__('Auto', 'wpdirectorykit'),
1079 '100%' => '1',
1080 '50%' => '2',
1081 'calc(100% / 3)' => '3',
1082 '25%' => '4',
1083 '20%' => '5',
1084 'auto_flexible' => 'auto flexible',
1085 ],
1086 'selectors_dictionary' => [
1087 'auto' => 'width:auto;-webkit-flex:0 0 auto;flex:0 0 auto',
1088 '100%' => 'width:100%;-webkit-flex:0 0 100%;flex:0 0 100%',
1089 '50%' => 'width:50%;-webkit-flex:0 0 50%;flex:0 0 50%',
1090 'calc(100% / 3)' => 'width:calc(100% / 3);-webkit-flex:0 0 calc(100% / 3);flex:0 0 calc(100% / 3)',
1091 '25%' => 'width:25%;-webkit-flex:0 0 25%;flex:0 0 25%',
1092 '20%' => 'width:20%;-webkit-flex:0 0 20%;flex:0 0 20%',
1093 'auto' => 'width:auto;-webkit-flex:0 0 auto;flex:0 0 auto',
1094 'auto_flexible' => 'width:auto;-webkit-flex:1 2 auto;flex:1 2 auto',
1095 ],
1096 'selectors' => [
1097 '{{WRAPPER}} .wdk-search:not(.layout_inline) .wdk-col:not(.wdk-field)' => '{{UNIT}}',
1098 ],
1099 'default' => '',
1100 'separator' => 'before',
1101 'conditions' => [
1102 'terms' => [
1103 [
1104 'name' => 'design_layout',
1105 'operator' => '==',
1106 'value' => 'vertical',
1107 ]
1108 ],
1109 ],
1110 ]
1111 );
1112
1113 $this->add_responsive_control(
1114 'more_btn_direction',
1115 [
1116 'label' => __( 'Direction btn group', 'wpdirectorykit' ),
1117 'type' => Controls_Manager::SELECT,
1118 'options' => [
1119 '' => esc_html__('Default', 'wpdirectorykit'),
1120 'column' => esc_html__('Column', 'wpdirectorykit'),
1121 'column-reverse' => esc_html__('Column Reverse', 'wpdirectorykit'),
1122 'row' => esc_html__('Row', 'wpdirectorykit'),
1123 'row-reverse' => esc_html__('Row Reverse', 'wpdirectorykit'),
1124 ],
1125 'selectors_dictionary' => [
1126 'column' => 'display: flex; flex-direction: column;',
1127 'column-reverse' => 'display: flex; flex-direction: column-reverse;',
1128 'row' => 'display: flex; flex-direction: row-reverse;',
1129 'row-reverse' => 'display: flex; flex-direction: row;',
1130 ],
1131 'selectors' => [
1132 '{{WRAPPER}} .wdk-field-btn' => '{{UNIT}}',
1133 ],
1134 'default' => '100%',
1135 'separator' => 'before',
1136 ]
1137 );
1138
1139 $this->add_responsive_control(
1140 'more_btn_row_gap_col_inline',
1141 [
1142 'label' => __( 'Columns btn group', 'wpdirectorykit' ),
1143 'type' => Controls_Manager::SELECT,
1144 'options' => [
1145 '' => esc_html__('Default', 'wpdirectorykit'),
1146 'auto' => esc_html__('Auto', 'wpdirectorykit'),
1147 '100%' => '1',
1148 '50%' => '2',
1149 'auto_flexible' => 'auto flexible',
1150 ],
1151 'selectors_dictionary' => [
1152 'auto' => 'width:auto;-webkit-flex:0 0 auto;flex:0 0 auto',
1153 '100%' => 'width:100%;-webkit-flex:0 0 100%;flex:0 0 100%',
1154 '50%' => 'width:50%;-webkit-flex:0 0 50%;flex:0 0 50%',
1155 'calc(100% / 3)' => 'width:calc(100% / 3);-webkit-flex:0 0 calc(100% / 3);flex:0 0 calc(100% / 3)',
1156 '25%' => 'width:25%;-webkit-flex:0 0 25%;flex:0 0 25%',
1157 '20%' => 'width:20%;-webkit-flex:0 0 20%;flex:0 0 20%',
1158 'auto' => 'width:auto;-webkit-flex:0 0 auto;flex:0 0 auto',
1159 'auto_flexible' => 'width:auto;-webkit-flex:1 2 auto;flex:1 2 auto',
1160 ],
1161 'selectors' => [
1162 '{{WRAPPER}} .wdk-search .wdk-field-btn .wdk-field-group' => '{{UNIT}}',
1163 ],
1164 'default' => '',
1165 'separator' => 'before',
1166 'conditions' => [
1167 'terms' => [
1168 [
1169 'name' => 'more_btn_direction',
1170 'operator' => '!=',
1171 'value' => '',
1172 ],
1173 [
1174 'name' => 'design_layout',
1175 'operator' => '==',
1176 'value' => 'inline',
1177 ]
1178 ],
1179 ],
1180 ]
1181 );
1182 $this->add_responsive_control(
1183 'more_btn_row_gap_col_hor',
1184 [
1185 'label' => __( 'Columns btn group', 'wpdirectorykit' ),
1186 'type' => Controls_Manager::SELECT,
1187 'options' => [
1188 '' => esc_html__('Default', 'wpdirectorykit'),
1189 'auto' => esc_html__('Auto', 'wpdirectorykit'),
1190 '100%' => '1',
1191 '50%' => '2',
1192 'auto_flexible' => 'auto flexible',
1193 ],
1194 'selectors_dictionary' => [
1195 'auto' => 'width:auto;-webkit-flex:0 0 auto;flex:0 0 auto',
1196 '100%' => 'width:100%;-webkit-flex:0 0 100%;flex:0 0 100%',
1197 '50%' => 'width:50%;-webkit-flex:0 0 50%;flex:0 0 50%',
1198 'calc(100% / 3)' => 'width:calc(100% / 3);-webkit-flex:0 0 calc(100% / 3);flex:0 0 calc(100% / 3)',
1199 '25%' => 'width:25%;-webkit-flex:0 0 25%;flex:0 0 25%',
1200 '20%' => 'width:20%;-webkit-flex:0 0 20%;flex:0 0 20%',
1201 'auto' => 'width:auto;-webkit-flex:0 0 auto;flex:0 0 auto',
1202 'auto_flexible' => 'width:auto;-webkit-flex:1 2 auto;flex:1 2 auto',
1203 ],
1204 'selectors' => [
1205 '{{WRAPPER}} .wdk-search:not(.layout_inline) .wdk-field-btn .wdk-field-group' => '{{UNIT}}',
1206 ],
1207 'default' => '100%',
1208 'separator' => 'before',
1209 'conditions' => [
1210 'terms' => [
1211 [
1212 'name' => 'more_btn_direction',
1213 'operator' => '!=',
1214 'value' => '',
1215 ],
1216 [
1217 'name' => 'design_layout',
1218 'operator' => '==',
1219 'value' => 'vertical',
1220 ]
1221 ],
1222 ],
1223 ]
1224 );
1225
1226 $this->add_responsive_control(
1227 'more_btn_column_gap',
1228 [
1229 'label' => esc_html__('Columns btn group Gap', 'wpdirectorykit'),
1230 'type' => Controls_Manager::SLIDER,
1231 'range' => [
1232 'px' => [
1233 'min' => 0,
1234 'max' => 60,
1235 ],
1236 ],
1237 'selectors' => [
1238 '{{WRAPPER}} .wdk-field-btn .wdk-field-group' => 'padding-left: {{SIZE}}{{UNIT}};padding-right: {{SIZE}}{{UNIT}};;',
1239 '{{WRAPPER}} .wdk-field-btn' => 'margin-left: -{{SIZE}}{{UNIT}};margin-right: -{{SIZE}}{{UNIT}};width: calc(100% + {{SIZE}}{{UNIT}} + {{SIZE}}{{UNIT}});',
1240 ],
1241 'conditions' => [
1242 'terms' => [
1243 [
1244 'name' => 'more_btn_direction',
1245 'operator' => '!=',
1246 'value' => '',
1247 ]
1248 ],
1249 ],
1250 ]
1251 );
1252
1253
1254 $this->add_responsive_control(
1255 'more_btn_row_gap_inline',
1256 [
1257 'label' => esc_html__('Rows btn group Gap', 'wpdirectorykit'),
1258 'type' => Controls_Manager::SLIDER,
1259 'range' => [
1260 'px' => [
1261 'min' => 0,
1262 'max' => 60,
1263 ],
1264 ],
1265 'selectors' => [
1266 '{{WRAPPER}} .wdk-search.layout_inline .wdk-field-btn .wdk-field-group' => 'margin-bottom: {{SIZE}}{{UNIT}};',
1267 '{{WRAPPER}} .wdk-search.layout_inline .wdk-field-btn' => 'margin-bottom: -{{SIZE}}{{UNIT}};',
1268 ],
1269 'conditions' => [
1270 'terms' => [
1271 [
1272 'name' => 'more_btn_direction',
1273 'operator' => '!=',
1274 'value' => '',
1275 ],
1276 [
1277 'name' => 'design_layout',
1278 'operator' => '==',
1279 'value' => 'inline',
1280 ]
1281 ],
1282 ],
1283
1284 ]
1285 );
1286
1287 $this->add_responsive_control(
1288 'more_btn_row_gap_horizontal',
1289 [
1290 'label' => esc_html__('Rows btn group Gap', 'wpdirectorykit'),
1291 'type' => Controls_Manager::SLIDER,
1292 'range' => [
1293 'px' => [
1294 'min' => 0,
1295 'max' => 60,
1296 ],
1297 ],
1298 'default' => [
1299 'size' => 10,
1300 ],
1301 'selectors' => [
1302 '{{WRAPPER}} .wdk-search:not(.layout_inline) .wdk-field-btn .wdk-field-group' => 'margin-bottom: {{SIZE}}{{UNIT}};',
1303 '{{WRAPPER}} .wdk-search:not(.layout_inline) .wdk-field-btn' => 'margin-bottom: -{{SIZE}}{{UNIT}};',
1304 ],
1305 'conditions' => [
1306 'terms' => [
1307 [
1308 'name' => 'design_layout',
1309 'operator' => '==',
1310 'value' => 'vertical',
1311 ]
1312 ],
1313 ],
1314 ]
1315 );
1316
1317
1318 $this->add_control(
1319 'wdk_field_btn_style_heading',
1320 [
1321 'label' => __( 'Buttons Cell', 'wpdirectorykit' ),
1322 'type' => Controls_Manager::HEADING,
1323 'separator' => 'before',
1324 ]
1325 );
1326
1327 $selectors = array(
1328 'normal' => '{{WRAPPER}} .wdk-search .wdk-field.wdk-field-btn',
1329 );
1330
1331 $this->generate_renders_tabs($selectors, 'wdk_field_btn_style_dynamic', ['margin','background','border','border_radius','padding','shadow','transition']);
1332
1333
1334
1335 $this->end_controls_section();
1336
1337 /* TAB_STYLE */
1338 $this->start_controls_section(
1339 'section_form_more_style',
1340 [
1341 'label' => __( 'Form More', 'wpdirectorykit' ),
1342 'tab' => Controls_Manager::TAB_STYLE,
1343 ]
1344 );
1345 $this->add_responsive_control(
1346 'button_column_more',
1347 [
1348 'label' => __( 'Columns', 'wpdirectorykit' ),
1349 'type' => Controls_Manager::SELECT,
1350 'options' => [
1351 '' => esc_html__('Default', 'wpdirectorykit'),
1352 'auto' => esc_html__('Auto', 'wpdirectorykit'),
1353 '100%' => '1',
1354 '50%' => '2',
1355 'calc(100% / 3)' => '3',
1356 '25%' => '4',
1357 '20%' => '5',
1358 'auto_flexible' => 'auto flexible',
1359 ],
1360 'selectors_dictionary' => [
1361 'auto' => 'width:auto;-webkit-flex:0 0 auto;flex:0 0 auto',
1362 '100%' => 'width:100%;-webkit-flex:0 0 100%;flex:0 0 100%',
1363 '50%' => 'width:50%;-webkit-flex:0 0 50%;flex:0 0 50%',
1364 'calc(100% / 3)' => 'width:calc(100% / 3);-webkit-flex:0 0 calc(100% / 3);flex:0 0 calc(100% / 3)',
1365 '25%' => 'width:25%;-webkit-flex:0 0 25%;flex:0 0 25%',
1366 '20%' => 'width:20%;-webkit-flex:0 0 20%;flex:0 0 20%',
1367 'auto' => 'width:auto;-webkit-flex:0 0 auto;flex:0 0 auto',
1368 'auto_flexible' => 'width:auto;-webkit-flex:1 2 auto;flex:1 2 auto',
1369 ],
1370 'selectors' => [
1371 '{{WRAPPER}} #wdk-form-additional .wdk-row .wdk-col' => '{{UNIT}}',
1372 ],
1373 'separator' => 'before',
1374 ]
1375 );
1376
1377 $this->add_responsive_control(
1378 'column_gap_more',
1379 [
1380 'label' => esc_html__('Columns Gap', 'wpdirectorykit'),
1381 'type' => Controls_Manager::SLIDER,
1382 'default' => [
1383 'size' => 10,
1384 ],
1385 'range' => [
1386 'px' => [
1387 'min' => 0,
1388 'max' => 60,
1389 ],
1390 ],
1391 'selectors' => [
1392 '{{WRAPPER}} #wdk-form-additional .wdk-row .wdk-col' => 'padding-left: {{SIZE}}{{UNIT}};padding-right: {{SIZE}}{{UNIT}};;',
1393 '{{WRAPPER}} #wdk-form-additional .wdk-row' => 'margin-left: -{{SIZE}}{{UNIT}};margin-right: -{{SIZE}}{{UNIT}};',
1394 ],
1395 ]
1396 );
1397
1398 $this->add_responsive_control(
1399 'row_gap_more',
1400 [
1401 'label' => esc_html__('Rows Gap', 'wpdirectorykit'),
1402 'type' => Controls_Manager::SLIDER,
1403 'default' => [
1404 'size' => 10,
1405 ],
1406 'range' => [
1407 'px' => [
1408 'min' => 0,
1409 'max' => 60,
1410 ],
1411 ],
1412 'selectors' => [
1413 '{{WRAPPER}} #wdk-form-additional .wdk-row .wdk-col' => 'margin-bottom: {{SIZE}}{{UNIT}};',
1414 '{{WRAPPER}} #wdk-form-additional .wdk-row' => 'margin-bottom: -{{SIZE}}{{UNIT}};',
1415 ],
1416 ]
1417 );
1418 $this->end_controls_section();
1419
1420 /* TAB_STYLE */
1421 $this->start_controls_section(
1422 'section_tab_field_style',
1423 [
1424 'label' => __( 'Tabs', 'wpdirectorykit' ),
1425 'tab' => Controls_Manager::TAB_STYLE,
1426 'conditions' => [
1427 'terms' => [
1428 [
1429 'name' => 'tab_field',
1430 'operator' => '!=',
1431 'value' => '',
1432 ],
1433 ],
1434 ],
1435 ]
1436 );
1437
1438 $this->add_responsive_control(
1439 'section_tab_field_style_hide',
1440 [
1441 'label' => __( 'Hide', 'wpdirectorykit' ),
1442 'type' => Controls_Manager::SWITCHER,
1443 'label_on' => __( 'Show', 'wpdirectorykit' ),
1444 'label_off' => __( 'Hide', 'wpdirectorykit' ),
1445 'return_value' => 'none',
1446 'default' => '',
1447 'selectors' => [
1448 '{{WRAPPER}} .wdk-search .wdk-search-tabs' => 'display: {{VALUE}};',
1449 ],
1450 ]
1451 );
1452
1453 $this->add_responsive_control (
1454 'section_tab_field_style_align',
1455 [
1456 'label' => __( 'Position', 'wpdirectorykit' ),
1457 'type' => Controls_Manager::CHOOSE,
1458 'options' => [
1459 'left' => [
1460 'title' => esc_html__( 'Left', 'wpdirectorykit' ),
1461 'icon' => 'eicon-text-align-left',
1462 ],
1463 'center' => [
1464 'title' => esc_html__( 'Center', 'wpdirectorykit' ),
1465 'icon' => 'eicon-text-align-center',
1466 ],
1467 'right' => [
1468 'title' => esc_html__( 'Right', 'wpdirectorykit' ),
1469 'icon' => 'eicon-text-align-right',
1470 ],
1471 ],
1472 'render_type' => 'ui',
1473 'selectors_dictionary' => [
1474 'left' => 'left:0;transform:initial',
1475 'center' => 'left:50%;transform:translateX(-50%)',
1476 'right' => 'right:0;left:initial;transform:initial',
1477 ],
1478 'selectors' => [
1479 '{{WRAPPER}} .wdk-search .wdk-search-tabs' => '{{VALUE}};',
1480 ],
1481 ]
1482 );
1483
1484 $selectors = array(
1485 'normal' => '{{WRAPPER}} .wdk-search .wdk-search-tabs label',
1486 'hover'=>'{{WRAPPER}} .wdk-search .wdk-search-tabs label:hover',
1487 'active'=>'{{WRAPPER}} .wdk-search .wdk-search-tabs input:checked + label '
1488 );
1489
1490 $this->generate_renders_tabs($selectors, 'section_tab_field_style_dynamic', ['margin','typo','color','background','border','border_radius','padding','shadow','transition']);
1491
1492
1493 $this->add_control(
1494 'section_tab_field_arrows_style_header',
1495 [
1496 'label' => __( 'Arrows', 'wpdirectorykit' ),
1497 'type' => Controls_Manager::HEADING,
1498 'separator' => 'before',
1499 ]
1500 );
1501
1502 $this->add_responsive_control(
1503 'section_tab_field_arrows_style_hide',
1504 [
1505 'label' => __( 'Hide', 'wpdirectorykit' ),
1506 'type' => Controls_Manager::SWITCHER,
1507 'label_on' => __( 'Show', 'wpdirectorykit' ),
1508 'label_off' => __( 'Hide', 'wpdirectorykit' ),
1509 'return_value' => 'none',
1510 'default' => '',
1511 'selectors' => [
1512 '{{WRAPPER}} .wdk-search .wdk-search-tabs label::after' => 'display: {{VALUE}};',
1513 ],
1514 ]
1515 );
1516
1517 $this->add_responsive_control(
1518 'section_tab_field_arrows_style_normal',
1519 [
1520 'label' => esc_html__( 'Color', 'wpdirectorykit' ),
1521 'type' => Controls_Manager::COLOR,
1522 'selectors' => [
1523 '{{WRAPPER}} .wdk-search .wdk-search-tabs label::after' => 'border-top-color: {{VALUE}};',
1524 ],
1525 ]
1526 );
1527
1528 $this->add_responsive_control(
1529 'section_tab_field_arrows_style_hover',
1530 [
1531 'label' => esc_html__( 'Color Hover', 'wpdirectorykit' ),
1532 'type' => Controls_Manager::COLOR,
1533 'selectors' => [
1534 '{{WRAPPER}} .wdk-search .wdk-search-tabs label:hover::after' => 'border-top-color: {{VALUE}};',
1535 ],
1536 ]
1537 );
1538
1539 $this->add_responsive_control(
1540 'section_tab_field_arrows_style_active',
1541 [
1542 'label' => esc_html__( 'Color Active', 'wpdirectorykit' ),
1543 'type' => Controls_Manager::COLOR,
1544 'selectors' => [
1545 '{{WRAPPER}} .wdk-search .wdk-search-tabs input:checked + label::after' => 'border-top-color: {{VALUE}};',
1546 ],
1547 ]
1548 );
1549
1550 $this->end_controls_section();
1551 }
1552
1553 private function generate_controls_styles() {
1554 $items = [
1555 [
1556 'key'=>'field_label',
1557 'label'=> esc_html__('Field Label', 'wpdirectorykit'),
1558 //'selector_hide'=>'{{WRAPPER}} .wdk-field:not(.CHECKBOX) .wdk-field-label',
1559 'selector'=>'{{WRAPPER}} .wdk-field:not(.CHECKBOX) .wdk-field-label',
1560 'selector_hover'=>'{{WRAPPER}} .wdk-field:not(.CHECKBOX) .wdk-field-label%1$s',
1561 'options'=>'full',
1562 ],
1563 [
1564 'key'=>'field_text',
1565 'label'=> esc_html__('Field Text/Integer', 'wpdirectorykit'),
1566 'selector_hide'=>'{{WRAPPER}} .wdk-field.INPUTBOX,{{WRAPPER}} .wdk-field.NUMBER,{{WRAPPER}} .wdk-field.TEXTAREA',
1567 'selector'=>'{{WRAPPER}} .wdk-field input[type="text"],{{WRAPPER}} .wdk-field input[type="number"]',
1568 'selector_hover'=>'{{WRAPPER}} .wdk-field input[type="text"]%1$s,{{WRAPPER}} .wdk-field input[type="number"]%1$s',
1569 'selector_focus'=>'{{WRAPPER}} .wdk-field input[type="text"]:focus,{{WRAPPER}} .wdk-field input[type="number"]:focus',
1570 'options'=>'full',
1571 ],
1572 [
1573 'key'=>'field_select',
1574 'label'=> esc_html__('Field Select', 'wpdirectorykit'),
1575 'selector_hide'=>'{{WRAPPER}} .wdk-field.DROPDOWN',
1576 'selector'=>'{{WRAPPER}} .wdk-field.DROPDOWN select',
1577 'selector_hover'=>'{{WRAPPER}} .wdk-field.DROPDOWN select%1$s',
1578 'options'=>'full',
1579 ],
1580 [
1581 'key'=>'field_checkbox',
1582 'label'=> esc_html__('Field Checkbox', 'wpdirectorykit'),
1583 'selector_hide'=>'{{WRAPPER}} .wdk-field.CHECKBOX',
1584 'selector'=>'{{WRAPPER}} .wdk-field.CHECKBOX .wdk-field-label',
1585 'selector_hover'=>'{{WRAPPER}} .wdk-field.CHECKBOX .wdk-field-label%1$s',
1586 'options'=>'full',
1587 ],
1588 [
1589 'key'=>'field_tree',
1590 'label'=> esc_html__('Field Category / Location', 'wpdirectorykit'),
1591 'selector_hide'=>'{{WRAPPER}} .wdk-field.CATEGORY,{{WRAPPER}} .wdk-field.LOCATION',
1592 'selector'=>'{{WRAPPER}} .wdk_dropdown_tree .btn-group, {{WRAPPER}} .wdk-field.CATEGORY .select2, {{WRAPPER}} .wdk-field.LOCATION .select2',
1593 'selector_hover'=>'{{WRAPPER}} .wdk_dropdown_tree .btn-group%1$s, {{WRAPPER}} .wdk-field.CATEGORY .select2%1$s, {{WRAPPER}} .wdk-field.LOCATION .select2%1$s',
1594 'options'=> ['margin','background','border','border_radius','padding','shadow','transition'],
1595 ],
1596 [
1597 'key'=>'field_select2',
1598 'label'=> esc_html__('Dropdown Multi-Select', 'wpdirectorykit'),
1599 'selector_hide'=>'{{WRAPPER}} .wdk-field.DROPDOWNMULTIPLE',
1600 'selector'=>'{{WRAPPER}} .wdk-field.DROPDOWNMULTIPLE .select2',
1601 'selector_hover'=>'{{WRAPPER}} .wdk-field.DROPDOWNMULTIPLE .select2%1$s',
1602 'options'=>['margin','background','border','border_radius','padding','shadow','transition'],
1603 ],
1604 [
1605 'key'=>'field_slider_range',
1606 'label'=> esc_html__('Field Slider Range', 'wpdirectorykit'),
1607 'selector_hide'=>'{{WRAPPER}} .wdk-field.SLIDER_RANGE',
1608 'selector'=>'',
1609 'selector_hover'=>'',
1610 'options'=>'',
1611 ],
1612 [
1613 'key'=>'field_button',
1614 'label'=> esc_html__('Search Button', 'wpdirectorykit'),
1615 'selector_hide'=>'{{WRAPPER}} .wdk-field .wdk-field-group-search button.wdk-search-start',
1616 'selector'=>'{{WRAPPER}} .wdk-field button.wdk-search-start',
1617 'selector_hover'=>'{{WRAPPER}} .wdk-field button.wdk-search-start%1$s',
1618 'options'=>'full',
1619 ],
1620 [
1621 'key'=>'field_button_reset',
1622 'label'=> esc_html__('Reset Button', 'wpdirectorykit'),
1623 'selector_hide'=>'{{WRAPPER}} .wdk-field-group.wdk-field-group-reset',
1624 'selector'=>'{{WRAPPER}} .wdk-field button.wdk-search-start.wdk-search-reset',
1625 'selector_hover'=>'{{WRAPPER}} .wdk-field button.wdk-search-start.wdk-search-reset%1$s',
1626 'options'=>['typo','color','border','border_radius','shadow','transition','background_group'],
1627 ],
1628 [
1629 'key'=>'field_button_more',
1630 'label'=> esc_html__('Button More', 'wpdirectorykit'),
1631 'selector_hide'=>'{{WRAPPER}} .wdk-field .wdk-field-group-additional',
1632 'selector'=>'{{WRAPPER}} .wdk-field button.wdk-search-additional-btn',
1633 'selector_hover'=>'{{WRAPPER}} .wdk-field button.wdk-search-additional-btn%1$s',
1634 'options'=>['typo','color','border','border_radius','shadow','transition','background_group'],
1635 ],
1636 /* additon box fields */
1637 [
1638 'key'=>'fields_addition_box',
1639 'label'=> esc_html__('Fields box (Inside More)', 'wpdirectorykit'),
1640 'selector'=>'{{WRAPPER}} #wdk-form-additional',
1641 'selector_hover'=>'{{WRAPPER}} #wdk-form-additional%1$s',
1642 'options'=>['background','padding','border'],
1643 ],
1644 [
1645 'key'=>'addition_box_field_label',
1646 'label'=> esc_html__('Field Label (Inside More)', 'wpdirectorykit'),
1647 //'selector_hide'=>'{{WRAPPER}} #wdk-form-additional .wdk-field:not(.CHECKBOX) .wdk-field-label',
1648 'selector'=>'{{WRAPPER}} #wdk-form-additional .wdk-field:not(.CHECKBOX) .wdk-field-label',
1649 'selector_hover'=>'{{WRAPPER}} #wdk-form-additional .wdk-field:not(.CHECKBOX) .wdk-field-label%1$s',
1650 'options'=>'full',
1651 ],
1652 [
1653 'key'=>'addition_box_field_text',
1654 'label'=> esc_html__('Field Text/Integer (Inside More)', 'wpdirectorykit'),
1655 'selector_hide'=>'{{WRAPPER}} #wdk-form-additional .wdk-field.INPUTBOX,{{WRAPPER}} #wdk-form-additional .wdk-field.NUMBER,{{WRAPPER}} #wdk-form-additional .wdk-field.TEXTAREA',
1656 'selector'=>'{{WRAPPER}} #wdk-form-additional .wdk-field input[type="text"]',
1657 'selector_hover'=>'{{WRAPPER}} #wdk-form-additional .wdk-field input[type="text"]%1$s',
1658 'selector_focus'=>'{{WRAPPER}} #wdk-form-additional .wdk-field input[type="text"]:focus',
1659 'options'=>'full',
1660 ],
1661 [
1662 'key'=>'addition_box_field_select',
1663 'label'=> esc_html__('Field Select (Inside More)', 'wpdirectorykit'),
1664 'selector_hide'=>'{{WRAPPER}} #wdk-form-additional .wdk-field.DROPDOWN,{{WRAPPER}} #wdk-form-additional .wdk-field.DROPDOWNMULTIPLE',
1665 'selector'=>'{{WRAPPER}} #wdk-form-additional .wdk-field select',
1666 'selector_hover'=>'{{WRAPPER}} #wdk-form-additional .wdk-field select%1$s',
1667 'options'=>'full',
1668 ],
1669 [
1670 'key'=>'addition_box_field_checkbox',
1671 'label'=> esc_html__('Field Checkbox (Inside More)', 'wpdirectorykit'),
1672 'selector_hide'=>'{{WRAPPER}} #wdk-form-additional .wdk-field.CHECKBOX',
1673 'selector'=>'{{WRAPPER}} #wdk-form-additional .wdk-field.CHECKBOX .wdk-field-label',
1674 'selector_hover'=>'{{WRAPPER}} #wdk-form-additional .wdk-field.CHECKBOX .wdk-field-label%1$s',
1675 'options'=>'full',
1676 ],
1677 ];
1678
1679 foreach ($items as $item) {
1680 $this->start_controls_section(
1681 $item['key'].'_section',
1682 [
1683 'label' => $item['label'],
1684 'tab' => 'tab_layout'
1685 ]
1686 );
1687
1688 if($item['key'] == 'field_label') {
1689 $this->add_responsive_control (
1690 'f_label_hide',
1691 [
1692 'label' => esc_html__( 'Field Label Hide', 'wpdirectorykit' ),
1693
1694 'type' => Controls_Manager::SWITCHER,
1695 'none' => esc_html__( 'Hide', 'wpdirectorykit' ),
1696 'block' => esc_html__( 'Show', 'wpdirectorykit' ),
1697 'return_value' => 'none',
1698 'default' => 'none',
1699 'selectors' => [
1700 '{{WRAPPER}} .wdk-field:not(.CHECKBOX) .wdk-field-label' => 'display: {{VALUE}};',
1701 ],
1702 'separator' => 'before',
1703 ]
1704 );
1705 }
1706
1707 if($item['key'] == 'addition_box_field_label') {
1708 $this->add_responsive_control(
1709 'addition_box_field_label_show',
1710 [
1711 'label' => esc_html__( 'Field Label Show', 'wpdirectorykit' ),
1712
1713 'type' => Controls_Manager::SWITCHER,
1714 'none' => esc_html__( 'Hide', 'wpdirectorykit' ),
1715 'block' => esc_html__( 'Show', 'wpdirectorykit' ),
1716 'return_value' => 'block',
1717 'default' => '',
1718 'selectors' => [
1719 '{{WRAPPER}} #wdk-form-additional .wdk-field:not(.CHECKBOX) .wdk-field-label' => 'display: {{VALUE}} !important;',
1720 ],
1721 'separator' => 'before',
1722 'conditions' => [
1723 'terms' => [
1724 [
1725 'name' => 'f_label_hide',
1726 'operator' => '==',
1727 'value' => 'none',
1728 ],
1729 ],
1730 ],
1731 ]
1732 );
1733
1734 $this->add_responsive_control(
1735 'addition_box_field_label_hide',
1736 [
1737 'label' => esc_html__( 'Field Label Hide', 'wpdirectorykit' ),
1738
1739 'type' => Controls_Manager::SWITCHER,
1740 'none' => esc_html__( 'Hide', 'wpdirectorykit' ),
1741 'block' => esc_html__( 'Show', 'wpdirectorykit' ),
1742 'return_value' => 'none',
1743 'default' => '',
1744 'selectors' => [
1745 '{{WRAPPER}} #wdk-form-additional .wdk-field:not(.CHECKBOX) .wdk-field-label' => 'display: {{VALUE}} !important;',
1746 ],
1747 'separator' => 'before',
1748 ]
1749 );
1750 }
1751
1752 if(!empty($item['selector_hide'])) {
1753 $this->add_responsive_control(
1754 $item['key'].'_hide',
1755 [
1756 'label' => esc_html__( 'Hide Element', 'wdk-svg-map' ),
1757 'type' => Controls_Manager::SWITCHER,
1758 'none' => esc_html__( 'Hide', 'wdk-svg-map' ),
1759 'block' => esc_html__( 'Show', 'wdk-svg-map' ),
1760 'return_value' => 'none',
1761 'default' => ($item['key'] == 'field_button_reset' ) ? 'none':'',
1762 'selectors' => [
1763 $item['selector_hide'] => 'display: {{VALUE}};',
1764 ],
1765 ]
1766 );
1767 }
1768
1769 if($item['key'] == 'addition_box_field_label') {
1770 $this->add_control(
1771 'important_note_addition_box_field_label',
1772 [
1773 'type' => \Elementor\Controls_Manager::RAW_HTML,
1774 'raw' => esc_html__( 'Visible only if not hidden in Field Label', 'wpdirectorykit' ),
1775 'content_classes' => 'hint-italic',
1776 ]
1777 );
1778 }
1779
1780 if($item['key'] !='field_slider_range'){
1781 $selectors = array();
1782
1783 if(!empty($item['selector']))
1784 $selectors['normal'] = $item['selector'];
1785
1786 if(!empty($item['selector_hover']))
1787 $selectors['hover'] = $item['selector_hover'];
1788
1789 if(!empty($item['selector_focus']))
1790 $selectors['focus'] = $item['selector_hover'];
1791
1792 $this->generate_renders_tabs($selectors, $item['key'].'_dynamic', $item['options']);
1793 }
1794
1795 if($item['key'] =='field_text'){
1796 $this->add_control(
1797 'field_text_pl_header',
1798 [
1799 'label' => __( 'Placeholder', 'wpdirectorykit' ),
1800 'type' => Controls_Manager::HEADING,
1801 ]
1802 );
1803
1804 $selectors = array(
1805 'normal' => '{{WRAPPER}} .wdk-field input[type="text"]::placeholder,{{WRAPPER}} .wdk-field input[type="number"]::placeholder',
1806 );
1807
1808 $this->generate_renders_tabs($selectors, 'field_text_pl_dynamic', ['align','typo','color']);
1809 }
1810
1811 if($item['key'] =='field_slider_range') {
1812
1813 $this->add_responsive_control(
1814 'field_slider_range_color_circle',
1815 [
1816 'label' => esc_html__( 'Circle Color', 'wpdirectorykit' ),
1817 'type' => Controls_Manager::COLOR,
1818 'selectors' => [
1819 '{{WRAPPER}} .irs--round .irs-handle' => 'border-color: {{VALUE}};',
1820 ],
1821 ]
1822 );
1823
1824 $this->add_responsive_control(
1825 'field_slider_range_color_line',
1826 [
1827 'label' => esc_html__( 'Line Color', 'wpdirectorykit' ),
1828 'type' => Controls_Manager::COLOR,
1829 'selectors' => [
1830 '{{WRAPPER}} .irs--round .irs-bar' => 'background-color: {{VALUE}};',
1831 ],
1832 ]
1833 );
1834
1835 $this->add_responsive_control(
1836 'field_slider_range_color_label',
1837 [
1838 'label' => esc_html__( 'Label Color', 'wpdirectorykit' ),
1839 'type' => Controls_Manager::COLOR,
1840 'selectors' => [
1841 '{{WRAPPER}} .irs--round .irs-from, {{WRAPPER}} .irs--round .irs-to, {{WRAPPER}} .irs--round .irs-single' => 'background-color: {{VALUE}};',
1842 '{{WRAPPER}} .irs--round .irs-from::before,{{WRAPPER}} .irs--round .irs-to::before,{{WRAPPER}} .irs--round .irs-single::before' => 'border-top-color: {{VALUE}};',
1843 ],
1844 ]
1845 );
1846
1847 $this->add_responsive_control(
1848 'field_slider_range_color_text_label',
1849 [
1850 'label' => esc_html__( 'Label Text Color', 'wpdirectorykit' ),
1851 'type' => Controls_Manager::COLOR,
1852 'selectors' => [
1853 '{{WRAPPER}} .irs--round .irs-from, {{WRAPPER}} .irs--round .irs-to, {{WRAPPER}} .irs--round .irs-single' => 'color: {{VALUE}};',
1854 ],
1855 ]
1856 );
1857
1858 $this->add_group_control(
1859 Group_Control_Typography::get_type(),
1860 [
1861 'name' => 'field_slider_range_color_typo',
1862 'selector' => '{{WRAPPER}} .irs--round .irs-from, {{WRAPPER}} .irs--round .irs-to, {{WRAPPER}} .irs--round .irs-single',
1863 ]
1864 );
1865
1866 $this->add_responsive_control(
1867 'field_slider_range_color_text_line',
1868 [
1869 'label' => esc_html__( 'Line Text Color', 'wpdirectorykit' ),
1870 'type' => Controls_Manager::COLOR,
1871 'selectors' => [
1872 '{{WRAPPER}} .wdk-slider-range-field .irs--round .irs-grid-text' => 'color: {{VALUE}};',
1873 ],
1874 ]
1875 );
1876
1877 }
1878
1879 if($item['key'] =='field_tree') {
1880
1881 $this->add_control(
1882 'styles_field_tree_pl_hr',
1883 [
1884 'type' => \Elementor\Controls_Manager::DIVIDER,
1885 ]
1886 );
1887
1888 $this->add_control(
1889 'styles_field_tree_pl_header',
1890 [
1891 'label' => __( 'Placeholder', 'wpdirectorykit' ),
1892 'type' => Controls_Manager::HEADING,
1893 ]
1894 );
1895
1896
1897 $this->add_control(
1898 'styles_field_tree_pl_hr2',
1899 [
1900 'type' => \Elementor\Controls_Manager::DIVIDER,
1901 ]
1902 );
1903
1904 $selectors = array(
1905 'normal' => '{{WRAPPER}} .wdk_dropdown_tree .btn-group:not(.sel_class) button:first-child, {{WRAPPER}} .wdk-field.CATEGORY .select2 .select2-search__field::placeholder,{{WRAPPER}} .wdk-field.LOCATION .select2 .select2-search__field::placeholder',
1906 'hover'=>'{{WRAPPER}} .wdk_dropdown_tree .btn-group:not(.sel_class) button:first-child%1$s,{{WRAPPER}} .wdk-field.CATEGORY .select2 .select2-search__field%1$s::placeholder,{{WRAPPER}} .wdk-field.LOCATION .select2 .select2-search__field%1$s::placeholder',
1907 );
1908
1909 $this->generate_renders_tabs($selectors, 'styles_field_tree_pl_list_dynamic', ['align','typo','color']);
1910
1911 $this->add_control(
1912 'styles_field_text_tree_pl_hr',
1913 [
1914 'type' => \Elementor\Controls_Manager::DIVIDER,
1915 ]
1916 );
1917
1918 $this->add_control(
1919 'styles_field_text_tree_pl_header',
1920 [
1921 'label' => __( 'Text field', 'wpdirectorykit' ),
1922 'type' => Controls_Manager::HEADING,
1923 ]
1924 );
1925
1926
1927 $this->add_control(
1928 'styles_field_text_tree_pl_hr2',
1929 [
1930 'type' => \Elementor\Controls_Manager::DIVIDER,
1931 ]
1932 );
1933
1934 $selectors = array(
1935 'normal' => '{{WRAPPER}} .wdk_dropdown_tree .btn-group button, {{WRAPPER}} .wdk-field.CATEGORY .select2 .select2-search__field,{{WRAPPER}} .wdk-field.LOCATION .select2 .select2-search__field',
1936 'hover'=>'{{WRAPPER}} .wdk_dropdown_tree .btn-group%1$s button,{{WRAPPER}} .wdk-field.CATEGORY .select2 .select2-search__field%1$s,{{WRAPPER}} .wdk-field.LOCATION .select2 .select2-search__field%1$s',
1937 );
1938
1939 $this->generate_renders_tabs($selectors, 'styles_field_text_tree_pl_list_dynamic', ['typo','color']);
1940
1941
1942 $this->add_control(
1943 'styles_field_tree_hr',
1944 [
1945 'type' => \Elementor\Controls_Manager::DIVIDER,
1946 ]
1947 );
1948
1949 $this->add_control(
1950 'styles_field_tree_header',
1951 [
1952 'label' => __( 'List Items', 'wpdirectorykit' ),
1953 'type' => Controls_Manager::HEADING,
1954 ]
1955 );
1956
1957
1958 $this->add_control(
1959 'styles_field_tree_hr2',
1960 [
1961 'type' => \Elementor\Controls_Manager::DIVIDER,
1962 ]
1963 );
1964
1965 $selectors = array(
1966 'normal' => '{{WRAPPER}} .wdk_dropdown_tree .list_scroll ul li, .select_multi_dropdown_tree .select2-dropdown .select2-results__options .select2-results__option',
1967 'hover'=>'{{WRAPPER}} .wdk_dropdown_tree .list_scroll ul li, .select_multi_dropdown_tree .select2-dropdown .select2-results__options .select2-results__option%1$s',
1968 );
1969
1970 $this->generate_renders_tabs($selectors, 'styles_field_tree_list_dynamic', ['margin','align','typo','color','background','border','padding','transition']);
1971
1972 if(wdk_get_option('wdk_multi_categories_search_field_type')=='select2' || wdk_get_option('wdk_multi_locations_search_field_type')=='select2' ) {
1973 $this->add_control(
1974 'styles_field_tree_items_hr',
1975 [
1976 'type' => \Elementor\Controls_Manager::DIVIDER,
1977 ]
1978 );
1979
1980 $this->add_control(
1981 'styles_field_tree_items_header',
1982 [
1983 'label' => __( 'Multi Items for Multiple Dropdowns', 'wpdirectorykit' ),
1984 'type' => Controls_Manager::HEADING,
1985 ]
1986 );
1987
1988
1989 $this->add_control(
1990 'styles_field_tree_items_hr2',
1991 [
1992 'type' => \Elementor\Controls_Manager::DIVIDER,
1993 ]
1994 );
1995
1996 $selectors = array(
1997 'normal' => '{{WRAPPER}} .wdk-field.CATEGORY .select2 .select2-selection__choice, {{WRAPPER}} .wdk-field.LOCATION .select2 .select2-selection__choice',
1998 'hover'=>'{{WRAPPER}} .wdk-field.CATEGORY .select2 .select2-selection__choice%1$s, {{WRAPPER}} .wdk-field.LOCATION .select2 .select2-selection__choice%1$s',
1999 );
2000
2001 $this->generate_renders_tabs($selectors, 'styles_field_tree_list_items_dynamic', ['margin','typo','color','background','border','border_radius','padding','transition']);
2002 }
2003 }
2004
2005 if($item['key'] =='field_select2') {
2006
2007 $this->add_control(
2008 'styles_field_select2_pl_hr',
2009 [
2010 'type' => \Elementor\Controls_Manager::DIVIDER,
2011 ]
2012 );
2013
2014 $this->add_control(
2015 'styles_field_select2_pl_header',
2016 [
2017 'label' => __( 'Placeholder', 'wpdirectorykit' ),
2018 'type' => Controls_Manager::HEADING,
2019 ]
2020 );
2021
2022
2023 $this->add_control(
2024 'styles_field_select2_pl_hr2',
2025 [
2026 'type' => \Elementor\Controls_Manager::DIVIDER,
2027 ]
2028 );
2029
2030 $selectors = array(
2031 'normal' => '{{WRAPPER}} .wdk-field.DROPDOWNMULTIPLE .select2 .select2-search__field::placeholder',
2032 'hover'=>'{{WRAPPER}} .wdk-field.DROPDOWNMULTIPLE .select2 .select2-search__field%1$s::placeholder',
2033 );
2034
2035 $this->generate_renders_tabs($selectors, 'styles_field_select2_pl_list_dynamic', ['align','typo','color']);
2036
2037 $this->add_control(
2038 'styles_field_select2_hr',
2039 [
2040 'type' => \Elementor\Controls_Manager::DIVIDER,
2041 ]
2042 );
2043
2044 $this->add_control(
2045 'styles_field_select2_header',
2046 [
2047 'label' => __( 'List Items', 'wpdirectorykit' ),
2048 'type' => Controls_Manager::HEADING,
2049 ]
2050 );
2051
2052
2053 $this->add_control(
2054 'styles_field_select2_hr2',
2055 [
2056 'type' => \Elementor\Controls_Manager::DIVIDER,
2057 ]
2058 );
2059
2060
2061 $selectors = array(
2062 'normal' => '.select_multi_dropdown .select2-dropdown .select2-results__options .select2-results__option',
2063 'hover'=>'.select_multi_dropdown .select2-dropdown .select2-results__options .select2-results__option%1$s',
2064 );
2065
2066 $this->generate_renders_tabs($selectors, 'styles_field_select2_list_dynamic', ['margin','align','typo','color','background','border','padding','transition']);
2067
2068 $this->add_control(
2069 'styles_field_select2_items_hr',
2070 [
2071 'type' => \Elementor\Controls_Manager::DIVIDER,
2072 ]
2073 );
2074
2075 $this->add_control(
2076 'styles_field_select2_items_header',
2077 [
2078 'label' => __( 'Multi Items', 'wpdirectorykit' ),
2079 'type' => Controls_Manager::HEADING,
2080 ]
2081 );
2082
2083
2084 $this->add_control(
2085 'styles_field_select2_items_hr2',
2086 [
2087 'type' => \Elementor\Controls_Manager::DIVIDER,
2088 ]
2089 );
2090
2091 $selectors = array(
2092 'normal' => '{{WRAPPER}} .wdk-field.DROPDOWNMULTIPLE .select2 .select2-selection__choice',
2093 'hover'=>'{{WRAPPER}} .wdk-field.DROPDOWNMULTIPLE .select2 .select2-selection__choice%1$s',
2094 );
2095
2096 $this->generate_renders_tabs($selectors, 'styles_field_select2_list_items_dynamic', ['margin','typo','color','background','border','border_radius','padding','transition']);
2097
2098 }
2099
2100 $this->end_controls_section();
2101 /* END special for some elements */
2102
2103 }
2104 }
2105
2106 private function generate_controls_content() {
2107
2108 }
2109
2110 public function enqueue_styles_scripts() {
2111 wp_enqueue_style('slick');
2112 wp_enqueue_style('wdk-suggestion');
2113 wp_enqueue_style('slick-theme');
2114 wp_enqueue_script('slick');
2115 wp_enqueue_script('wdk-treefield');
2116 wp_enqueue_script('wdk-suggestion');
2117 wp_enqueue_style('wdk-treefield');
2118
2119
2120 wp_enqueue_script('select2-select2');
2121 wp_enqueue_script('wdk-select2');
2122 wp_enqueue_style('select2-select2');
2123
2124 wp_enqueue_script( 'ion.range-slider' );
2125 wp_enqueue_style('ion.range-slider');
2126 wp_enqueue_style('wdk-slider-range');
2127 wp_enqueue_script('wdk-slider-range');
2128
2129 wp_enqueue_style( 'wdk-treefield-checkboxes');
2130 wp_enqueue_script( 'wdk-treefield-checkboxes');
2131
2132 if( wdk_get_option('wdk_experimental_features') && wdk_get_option('wdk_experimental_ajax_results')) {
2133 wp_enqueue_script( 'wdk-ajax-loading-listings');
2134 }
2135 }
2136 }
2137