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

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

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