PluginProbe
WP Directory Kit / 1.5.4
WP Directory Kit v1.5.4
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.4, at elementor-elements/classes/wdk-search.php

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