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

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