PluginProbe
WP Directory Kit / 1.5.9
WP Directory Kit v1.5.9
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.9, at elementor-elements/classes/wdk-search.php

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