PluginProbe
WP Directory Kit / 1.3.1
WP Directory Kit v1.3.1
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 1.4.0 1.4.1 All 35 releases
wpdirectorykit / elementor-elements / classes / wdk-search.php

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

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