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

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