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

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

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