PluginProbe
WP Directory Kit / 1.5.9
WP Directory Kit v1.5.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
← All changes | elementor-elements/classes/wdk-search.php +1243 -201 1.1.0 → 1.5.9 View file →
@@ -29,8 +29,9 @@
29 29 \Elementor\Controls_Manager::add_tab(
30 30 'tab_conf',
31 31 esc_html__('Settings', 'wpdirectorykit')
32 32 );
33 +
33 34
34 35 \Elementor\Controls_Manager::add_tab(
35 36 'tab_layout',
36 37 esc_html__('Layout', 'wpdirectorykit')
@@ -118,16 +119,35 @@
118 119 protected function render() {
119 120 parent::render();
120 121 $this->data['id_element'] = $this->get_id();
121 122 $this->data['settings'] = $this->get_settings();
123 + $this->data['counts'] = array();
122 124
125 + wp_enqueue_script('select2-select2');
126 + wp_enqueue_script('wdk-select2');
127 + wp_enqueue_style('select2-select2');
123 128 global $wdk_visible_filters_limit;
124 129 global $wdk_enable_search_fields_toggle;
125 130
126 - if($this->data['settings']['section_config_more'])
127 - $wdk_enable_search_fields_toggle = true;
131 + global $wdk_search_fields_toggle_reset;
132 + $wdk_search_fields_toggle_reset = true;
133 +
134 + if(isset($this->data['settings']['section_config_more'])){
135 + if($this->data['settings']['section_config_more'])
136 + $wdk_enable_search_fields_toggle = true;
137 + }
128 138
129 - $wdk_visible_filters_limit = $this->data['settings']['section_config_more_limit'] + 1;
139 + if(!empty($this->data['settings']['section_config_more_limit'])) {
140 + $wdk_visible_filters_limit = $this->data['settings']['section_config_more_limit'] + 1;
141 + } else {
142 + $wdk_visible_filters_limit = 0;
143 + }
144 +
145 + $this->data['tab_field'] = NULL;
146 +
147 + if(!empty($this->data['settings']['tab_field'])) {
148 + $this->data['tab_field'] = substr($this->data['settings']['tab_field'], strpos($this->data['settings']['tab_field'],'__')+2);
149 + }
130 150
131 151 $qr_string = trim($this->data['settings']['conf_predefields_query'],'?');
132 152 $string_par = array();
133 153 parse_str($qr_string, $string_par);
@@ -133,22 +153,52 @@
133 153 parse_str($qr_string, $string_par);
134 154 $this->data['predefields_query'] = array_map('trim', $string_par);
135 155
136 156 if(!empty($this->data['settings']['custom_category_root'])) {
137 - $this->data['predefields_query']['custom_category_root'] =
138 - substr($this->data['settings']['custom_category_root'], strpos($this->data['settings']['custom_category_root'],'__')+2);
157 +
158 + if(!empty($this->data['settings']['field_id']) && strpos($this->data['settings']['field_id'],'__') !== FALSE){
159 + $this->data['settings']['custom_category_root'] = substr($this->data['settings']['custom_category_root'], strpos($this->data['settings']['custom_category_root'],'__')+2);
160 + }
161 + if(is_intval($this->data['settings']['custom_category_root'])) {
162 + $this->data['predefields_query']['custom_category_root'] = $this->data['settings']['custom_category_root'];
163 + }
139 164 }
140 165
141 166 if(!empty($this->data['settings']['custom_location_root'])) {
142 - $this->data['predefields_query']['custom_location_root'] =
143 - substr($this->data['settings']['custom_location_root'], strpos($this->data['settings']['custom_location_root'],'__')+2);
167 + if(strpos($this->data['settings']['field_id'],'__') !== FALSE){
168 + $this->data['settings']['custom_location_root'] = substr($this->data['settings']['custom_location_root'], strpos($this->data['settings']['custom_location_root'],'__')+2);
169 + }
170 +
171 + if(is_intval($this->data['settings']['custom_location_root'])) {
172 + $this->data['predefields_query']['custom_location_root'] = $this->data['settings']['custom_location_root'];
173 + }
144 174 }
145 175
146 176 $this->data['is_edit_mode'] = false;
147 - if(Plugin::$instance->editor->is_edit_mode())
177 + if(Plugin::$instance->editor->is_edit_mode()) {
148 178 $this->data['is_edit_mode'] = true;
179 + }
149 180
150 - echo $this->view('wdk-search', $this->data);
181 + /* count */
182 + if($this->data['tab_field'] && wmvc_show_data('tabs_count', $this->data['settings']) == 'yes') {
183 + if(wdk_is_listing_field_exists('field_'.$this->data['tab_field'].'_'.wdk_field_option($this->data['tab_field'], 'field_type'))) {
184 + $columns = array('ID', 'location_id', 'category_id', 'post_title', 'post_date', 'search', 'order_by','is_featured', 'address');
185 + $external_columns = array('location_id', 'category_id', 'post_title');
186 + $controller = 'listing';
187 +
188 + wdk_prepare_search_query_GET($columns, $controller.'_m', $external_columns);
189 + $this->WMVC->db->select('COUNT(DISTINCT '.$this->WMVC->db->prefix.'wdk_listings.post_id) as total_count');
190 + $this->WMVC->db->group_by('field_'.$this->data['tab_field'].'_'.wdk_field_option($this->data['tab_field'], 'field_type'));
191 + $total_items = $this->WMVC->listing_m->get_pagination(NULL, NULL, array('is_activated' => 1,'is_approved'=>1));
192 +
193 + foreach ($total_items as $key => $row) {
194 + $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);
195 + }
196 + }
197 + }
198 +
199 +
200 + $this->view('wdk-search', $this->data, true);
151 201 }
152 202
153 203
154 204 private function generate_controls_conf() {
@@ -157,13 +207,53 @@
157 207 [
158 208 'label' => __( 'Configuration', 'wpdirectorykit' ),
159 209 ]
160 210 );
211 +
212 + if(wdk_get_option('wdk_experimental_features') && wdk_get_option('wdk_experimental_ajax_results')){
213 + $this->add_control(
214 + 'is_ajax_enable',
215 + [
216 + 'label' => __( 'Enable Reload content with ajax', 'wpdirectorykit' ),
217 + 'type' => \Elementor\Controls_Manager::SWITCHER,
218 + 'label_on' => __( 'True', 'wpdirectorykit' ),
219 + 'label_off' => __( 'False', 'wpdirectorykit' ),
220 + 'return_value' => 'yes',
221 + 'default' => '',
222 +
223 + ]
224 + );
225 + }
161 226
162 227 $this->add_control(
228 + 'auto_search_enable',
229 + [
230 + 'label' => __( 'Auto Search Enable', 'wpdirectorykit' ),
231 + 'type' => Controls_Manager::SWITCHER,
232 + 'label_on' => __( 'Show', 'wpdirectorykit' ),
233 + 'label_off' => __( 'Hide', 'wpdirectorykit' ),
234 + 'return_value' => 'yes',
235 + 'default' => '',
236 + ]
237 + );
238 +
239 +
240 + $this->add_control(
241 + 'ai_search_enable',
242 + [
243 + 'label' => __( 'AI Search Enable', 'wpdirectorykit' ),
244 + 'type' => Controls_Manager::SWITCHER,
245 + 'label_on' => __( 'Show', 'wpdirectorykit' ),
246 + 'label_off' => __( 'Hide', 'wpdirectorykit' ),
247 + 'return_value' => 'yes',
248 + 'default' => '',
249 + ]
250 + );
251 +
252 + $this->add_control(
163 253 'section_config_more',
164 254 [
165 - 'label' => __( 'Calllaps filters and add "more" button', 'wpdirectorykit' ),
255 + 'label' => __( 'Field more hide', 'wpdirectorykit' ),
166 256 'type' => Controls_Manager::SWITCHER,
167 257 'label_on' => __( 'Show', 'wpdirectorykit' ),
168 258 'label_off' => __( 'Hide', 'wpdirectorykit' ),
169 259 'return_value' => 'none',
@@ -168,12 +258,24 @@
168 258 'label_off' => __( 'Hide', 'wpdirectorykit' ),
169 259 'return_value' => 'none',
170 260 'default' => '',
171 261 'selectors' => [
172 - '{{WRAPPER}} .wdk-search-additional-btn' => 'display: {{VALUE}};',
262 + '{{WRAPPER}} .wdk-field-group-additional' => 'display: {{VALUE}};',
173 263 ],
174 264 ]
175 265 );
266 +
267 + $this->add_control(
268 + 'section_more_before_buttons',
269 + [
270 + 'label' => __( 'Show Additional Fields Before Search Buttons', 'wpdirectorykit' ),
271 + 'type' => Controls_Manager::SWITCHER,
272 + 'label_on' => __( 'Yes', 'wpdirectorykit' ),
273 + 'label_off' => __( 'None', 'wpdirectorykit' ),
274 + 'return_value' => 'yes',
275 + 'default' => '',
276 + ]
277 + );
176 278
177 279 $this->add_control(
178 280 'section_config_more_limit',
179 281 [
@@ -178,20 +280,11 @@
178 280 'section_config_more_limit',
179 281 [
180 282 'label' => __( 'Limit Visible Fields', 'wpdirectorykit' ),
181 283 'type' => Controls_Manager::NUMBER,
182 - 'min' => 3,
284 + 'min' => 0,
183 285 'step' => 1,
184 286 'default' => 3,
185 - 'conditions' => [
186 - 'terms' => [
187 - [
188 - 'name' => 'section_config_more',
189 - 'operator' => '==',
190 - 'value' => '',
191 - ],
192 - ],
193 - ],
194 287 ]
195 288 );
196 289
197 290 $pages = array('' => __('Not Selected', 'wpdirectorykit'));
@@ -203,9 +296,9 @@
203 296 $this->add_control(
204 297 'conf_link',
205 298 [
206 299 'label' => __( 'Open results on page', 'wpdirectorykit' ),
207 - 'type' => \Elementor\Controls_Manager::SELECT,
300 + 'type' => \Elementor\Controls_Manager::SELECT2,
208 301 'default' => '',
209 302 'options' => $pages
210 303 ]
211 304 );
@@ -217,9 +310,54 @@
217 310 'type' => \Elementor\Controls_Manager::TEXT,
218 311 'default' => __( 'Search', 'wpdirectorykit' ),
219 312 ]
220 313 );
314 +
315 + $this->add_control(
316 + 'text_reset_button',
317 + [
318 + 'label' => __( 'Reset button text', 'wpdirectorykit' ),
319 + 'type' => \Elementor\Controls_Manager::TEXT,
320 + 'default' => __( 'Reset', 'wpdirectorykit' ),
321 + ]
322 + );
221 323
324 + $this->add_responsive_control(
325 + 'field_button_icon_header',
326 + [
327 + 'label' => esc_html__('Icon', 'wpdirectorykit'),
328 + 'type' => Controls_Manager::HEADING,
329 + 'separator' => 'before',
330 + ]
331 + );
332 +
333 + $this->add_control(
334 + 'field_button_icon',
335 + [
336 + 'label' => __( 'Icon', 'wpdirectorykit' ),
337 + 'type' => Controls_Manager::ICONS,
338 + ]
339 + );
340 +
341 + $this->add_control(
342 + 'field_button_icon_position',
343 + [
344 + 'label' => esc_html__('icon Position', 'wpdirectorykit'),
345 + 'type' => Controls_Manager::SELECT,
346 + 'options' => [
347 + 'left' => esc_html__('Left', 'wpdirectorykit'),
348 + 'right' => esc_html__('Right', 'wpdirectorykit'),
349 + ],
350 + 'default' => 'left',
351 + ]
352 + );
353 +
354 + $selectors = array();
355 + $selectors['normal'] = '{{WRAPPER}} .wdk-field button.wdk-search-start .icon_search';
356 +
357 + $this->generate_renders_tabs($selectors, 'field_button_icon_dynamic', array('margin','font-size'));
358 +
359 +
222 360 $this->add_control(
223 361 'text_more_button',
224 362 [
225 363 'label' => __( 'More button text', 'wpdirectorykit' ),
@@ -226,15 +364,60 @@
226 364 'type' => \Elementor\Controls_Manager::TEXT,
227 365 'default' => __( 'More', 'wpdirectorykit' ),
228 366 ]
229 367 );
368 +
230 369
370 + $WMVC = &wdk_get_instance();
371 + $WMVC->model('field_m');
372 + $fields = $WMVC->field_m->get_by(array('field_type' => 'DROPDOWN'));
373 +
374 + $fields_list = array('' => esc_html__('Not Selected', 'wpdirectorykit'));
375 + $order_i = 0;
376 + foreach($fields as $field)
377 + {
378 + $fields_list[wmvc_show_data('idfield', $field)] = '#'.wmvc_show_data('idfield', $field).' '.wmvc_show_data('field_label', $field);
379 + }
380 +
381 + // build raw_options preserving order
382 + $raw = [];
383 + foreach ( $fields_list as $k => $v ) {
384 + $raw[] = [
385 + 'value' => (string) $k,
386 + 'label' => $v,
387 + ];
388 + }
389 +
231 390 $this->add_control(
391 + 'tab_field',
392 + [
393 + 'label' => __( 'Tab', 'wpdirectorykit' ),
394 + 'type' => \Wdk\Includes\Controls\Wdk_Field_Selector::INIT,
395 + 'options' => $fields_list,
396 + 'raw_options' => $raw,
397 + 'default' => 'results',
398 + ]
399 + );
400 +
401 + $this->add_control(
402 + 'tabs_count',
403 + [
404 + 'label' => __( 'Count Results in tabs', 'wpdirectorykit' ),
405 + 'type' => Controls_Manager::SWITCHER,
406 + 'label_on' => __( 'Show', 'wpdirectorykit' ),
407 + 'label_off' => __( 'Hide', 'wpdirectorykit' ),
408 + 'return_value' => 'yes',
409 + 'default' => '',
410 + ]
411 + );
412 +
413 + $this->add_control(
232 414 'important_note',
233 415 [
234 416 'label' => '',
235 417 'type' => \Elementor\Controls_Manager::RAW_HTML,
236 - 'raw' => sprintf(__( 'Manage Search Form <a href="%1$s" target="_blank"> open </a>', 'wpdirectorykit' ), admin_url('admin.php?page=wdk_searchform')),
418 + /* translators: 1: URL. */
419 + 'raw' => wdk_sprintf(__( 'Manage Search Form <a href="%1$s" target="_blank"> open </a>', 'wpdirectorykit' ), admin_url('admin.php?page=wdk_searchform')),
237 420 'content_classes' => 'wdk_elementor_hint',
238 421 'separator' => 'after',
239 422 ]
240 423 );
@@ -246,10 +429,10 @@
246 429 'type' => \Elementor\Controls_Manager::TEXTAREA,
247 430 'rows' => 5,
248 431 'default' => '',
249 432 'placeholder' => __( 'Type your query here, example xxx', 'wpdirectorykit' ),
250 - 'description' => '<span style="word-break: break-all;">'.__( 'Example (same like on url): ', 'wpdirectorykit' ).
251 - 'field_6_min=100&field_6_max=200&field_5=rent&is_featured=on&search_category=3&search_location=4'.
433 + 'description' => '<span style="word-break: break-all;">'.__( 'Example (same like on url):', 'wpdirectorykit' ).
434 + ' field_6_min=100&field_6_max=200&field_5=rent&is_featured=on&search_category=3&search_location=4'.
252 435 '</span>',
253 436 ]
254 437 );
255 438
@@ -257,42 +440,262 @@
257 440 $WMVC->model('category_m');
258 441 $WMVC->model('location_m');
259 442 $categories_data = $WMVC->category_m->get_by(array('(parent_id = 0 OR parent_id IS NULL)' => NULL));
260 443 $categories_list = array('' => esc_html__('Not Selected', 'wpdirectorykit'));
261 - $order_i = 0;
262 -
263 444 foreach($categories_data as $category)
264 445 {
265 - $categories_list[(++$order_i).'__'.wmvc_show_data('idcategory', $category)] = '#'.wmvc_show_data('idcategory', $category).' '.wmvc_show_data('category_title', $category);
446 + $categories_list[wmvc_show_data('idcategory', $category)] = '#'.wmvc_show_data('idcategory', $category).' '.wmvc_show_data('category_title', $category);
266 447 }
448 +
267 449 $this->add_control(
268 450 'custom_category_root',
269 451 [
270 452 'label' => __( 'Custom Category Root', 'wpdirectorykit' ),
271 - 'type' => Controls_Manager::SELECT,
453 + 'type' => Controls_Manager::SELECT2,
272 454 'options' => $categories_list,
273 - 'default' => 'results',
455 + 'default' => '',
274 456 ]
275 457 );
276 458
277 459 $locations_data = $WMVC->location_m->get_by(array('(parent_id = 0 OR parent_id IS NULL)' => NULL));
278 460 $locations_list = array('' => esc_html__('Not Selected', 'wpdirectorykit'));
279 - $order_i = 0;
280 -
281 461 foreach($locations_data as $location)
282 462 {
283 - $locations_list[(++$order_i).'__'.wmvc_show_data('idlocation', $location)] = '#'.wmvc_show_data('idlocation', $location).' '.wmvc_show_data('location_title', $location);
463 + $locations_list[wmvc_show_data('idlocation', $location)] = '#'.wmvc_show_data('idlocation', $location).' '.wmvc_show_data('location_title', $location);
284 464 }
285 465 $this->add_control(
286 466 'custom_location_root',
287 467 [
288 468 'label' => __( 'Custom Location Root', 'wpdirectorykit' ),
289 - 'type' => Controls_Manager::SELECT,
469 + 'type' => Controls_Manager::SELECT2,
290 470 'options' => $locations_list,
291 - 'default' => 'results',
471 + 'default' => '',
292 472 ]
293 473 );
294 474
475 +
476 + if(true){
477 + $this->add_control(
478 + 'enable_custom_fields',
479 + [
480 + 'label' => __( 'Enable Custom Fields', 'wpdirectorykit' ),
481 + 'type' => \Elementor\Controls_Manager::SWITCHER,
482 + 'label_on' => __( 'True', 'wpdirectorykit' ),
483 + 'label_off' => __( 'False', 'wpdirectorykit' ),
484 + 'return_value' => 'yes',
485 + 'default' => '',
486 + ]
487 + );
488 +
489 + $fields_data = wdk_cached_field_get();
490 + $fields_list = array('' => esc_html__('Not Selected', 'wpdirectorykit'));
491 + $fields_allow_types = array();
492 + $fields_allow_tree_types = array();
493 +
494 + $fields_list ['section'] = esc_html__('-- Section Custom fields --', 'wpdirectorykit');
495 + $fields_list ['search'] = esc_html__('Smart Search', 'wpdirectorykit');
496 +
497 + if(function_exists('run_wdk_bookings')) {
498 + $fields_list ['booking_date'] = esc_html__('Booking Date', 'wpdirectorykit');
499 + $fields_list ['booking_guest'] = esc_html__('Booking Guests', 'wpdirectorykit');
500 + }
501 +
502 + $fields_list ['post_title'] = esc_html__('WP Title', 'wpdirectorykit');
503 + $fields_list ['post_title'] = esc_html__('WP Title', 'wpdirectorykit');
504 + $fields_list ['address'] = esc_html__('Address', 'wpdirectorykit');
505 + $fields_list ['category_id'] = esc_html__('Category', 'wpdirectorykit');
506 + $fields_allow_tree_types[] = 'category_id';
507 + $fields_list ['location_id'] = esc_html__('Location', 'wpdirectorykit');
508 + $fields_allow_tree_types[] = 'location_id';
509 +
510 + foreach($fields_data as $field)
511 + {
512 + if(in_array(wmvc_show_data('field_type', $field),array('TEXTAREA','TEXTAREA_WYSIWYG'))) {
513 + continue;
514 + } else if(in_array(wmvc_show_data('field_type', $field),array('SECTION'))) {
515 + $fields_list ['section__'.wmvc_show_data('idfield', $field)] = '-- '.esc_html__('Section', 'wpdirectorykit').' '.wmvc_show_data('field_label', $field).' --';
516 + } else {
517 + $fields_list[wmvc_show_data('idfield', $field)] = '#'.wmvc_show_data('idfield', $field).' '.wmvc_show_data('field_label', $field).'['.wmvc_show_data('field_type', $field).']';
518 + }
519 +
520 + if(wmvc_show_data('field_type', $field) == 'NUMBER') {
521 + $fields_allow_types[] = ''.wmvc_show_data('idfield', $field);
522 + }
523 + }
524 +
525 + // build raw_options preserving order
526 + $raw = [];
527 + foreach ( $fields_list as $k => $v ) {
528 + $raw[] = [
529 + 'value' => (string) $k,
530 + 'label' => $v,
531 + ];
532 + }
533 +
534 + $repeater = new Repeater();
535 + $repeater->start_controls_tabs( 'custom_fields_repeat' );
536 +
537 + $repeater->add_control(
538 + 'field_id',
539 + [
540 + 'label' => __( 'Field id', 'wpdirectorykit' ),
541 + 'type' => \Wdk\Includes\Controls\Wdk_Field_Selector::INIT,
542 + 'default' => '',
543 + 'options' => $fields_list,
544 + 'raw_options' => $raw,
545 + 'separator' => 'after',
546 + ]
547 + );
548 +
549 + $repeater->add_control(
550 + 'field_css_class',
551 + [
552 + 'label' => __( 'Css Class', 'wpdirectorykit' ),
553 + 'type' => \Elementor\Controls_Manager::TEXT,
554 + 'default' => '',
555 + ]
556 + );
557 +
558 + $repeater->add_control(
559 + 'field_placeholder',
560 + [
561 + 'label' => __( 'Placeholder', 'wpdirectorykit' ),
562 + 'type' => \Elementor\Controls_Manager::TEXT,
563 + 'default' => '',
564 + ]
565 + );
566 +
567 + $repeater->add_control(
568 + 'field_columns_number',
569 + [
570 + 'label' => __( 'Columns/Width', 'wpdirectorykit' ),
571 + 'type' => \Elementor\Controls_Manager::HIDDEN,
572 + 'min' => '0',
573 + 'max' => '12',
574 + 'step' => '1',
575 + 'default' => '',
576 + ]
577 + );
578 +
579 + $repeater->add_control(
580 + 'search_type_tree',
581 + [
582 + 'label' => __( 'Field Layout', 'wpdirectorykit' ),
583 + 'type' => \Elementor\Controls_Manager::SELECT,
584 + 'default' => '',
585 + 'options' => array(
586 + '' => __( 'Default', 'wpdirectorykit' ),
587 + '_checkboxes' => __( 'Checkboxes', 'wpdirectorykit' ),
588 + /*'_tree' => __( 'Tree with Search', 'wpdirectorykit' ),
589 + '_multi_selector' => __( 'Tree multi Select', 'wpdirectorykit' ),
590 + '_multi_selects' => __( 'Multi Selects', 'wpdirectorykit' ),*/
591 + ),
592 + 'condition' => [
593 + 'field_id' => $fields_allow_tree_types,
594 + ],
595 + ]
596 + );
597 +
598 + $repeater->add_control(
599 + 'search_type_tree_hide',
600 + [
601 + 'label' => __( 'Hide by id', 'wpdirectorykit' ),
602 + 'description' => __( 'Hide locations/categories based on id, example 1,2,3,4,xxx', 'wpdirectorykit' ),
603 + 'type' => \Elementor\Controls_Manager::TEXT,
604 + 'default' => '',
605 + 'condition' => [
606 + 'field_id' => $fields_allow_tree_types,
607 + ],
608 + ]
609 + );
610 +
611 + $repeater->add_control(
612 + 'search_type',
613 + [
614 + 'label' => __( 'Search Type', 'wpdirectorykit' ),
615 + 'type' => \Elementor\Controls_Manager::SELECT,
616 + 'default' => '',
617 + 'options' => array(
618 + '' => __( 'None', 'wpdirectorykit' ),
619 + 'min' => __( 'Min', 'wpdirectorykit' ),
620 + 'max' => __( 'Max', 'wpdirectorykit' ),
621 + 'min_max' => __( 'Min/Max', 'wpdirectorykit' ),
622 + 'slider_range' => __( 'Slider Range', 'wpdirectorykit' ),
623 + ),
624 + 'condition' => [
625 + 'field_id' => $fields_allow_types,
626 + ],
627 + ]
628 + );
629 +
630 + $repeater->add_control(
631 + 'value_min',
632 + [
633 + 'label' => __( 'Value Min', 'wpdirectorykit' ),
634 + 'type' => \Elementor\Controls_Manager::NUMBER,
635 + 'default' => '',
636 + 'conditions' => [
637 + 'terms' => [
638 + [
639 + 'name' => 'search_type',
640 + 'operator' => '==',
641 + 'value' => 'slider_range',
642 + ]
643 + ],
644 + ],
645 + ]
646 + );
647 +
648 + $repeater->add_control(
649 + 'value_max',
650 + [
651 + 'label' => __( 'Value Max', 'wpdirectorykit' ),
652 + 'type' => \Elementor\Controls_Manager::NUMBER,
653 + 'default' => '',
654 + 'conditions' => [
655 + 'terms' => [
656 + [
657 + 'name' => 'search_type',
658 + 'operator' => '==',
659 + 'value' => 'slider_range',
660 + ]
661 + ],
662 + ],
663 + ]
664 + );
665 +
666 + $repeater->end_controls_tabs();
667 +
668 +
669 + $this->add_control(
670 + 'custom_fields',
671 + [
672 + 'type' => Controls_Manager::REPEATER,
673 + 'fields' => $repeater->get_controls(),
674 + 'label' => __( 'Field id', 'wpdirectorykit' ),
675 + 'default' => [
676 + ],
677 + 'title_field' => "<# "
678 + . "let labels = ".json_encode($fields_list)."; "
679 + . "let label = labels[field_id]; "
680 + . "#>"
681 + . "{{{ label }}}",
682 +
683 +
684 + 'conditions' => [
685 + 'terms' => [
686 + [
687 + 'name' => 'enable_custom_fields',
688 + 'operator' => '==',
689 + 'value' => 'yes',
690 + ]
691 + ],
692 + ],
693 + ]
694 + );
695 +
696 + }
697 +
295 698 $this->end_controls_section();
296 699 }
297 700
298 701 private function generate_controls_layout() {
@@ -318,9 +721,42 @@
318 721 'default' => 'results',
319 722 ]
320 723 );
321 724
725 +
322 726 $this->add_responsive_control(
727 + 'form_fields_align',
728 + [
729 + 'label' => __( 'Align', 'wpdirectorykit' ),
730 + 'type' => Controls_Manager::CHOOSE,
731 + 'options' => [
732 + 'left' => [
733 + 'title' => esc_html__( 'Left', 'wpdirectorykit' ),
734 + 'icon' => 'eicon-text-align-left',
735 + ],
736 + 'center' => [
737 + 'title' => esc_html__( 'Center', 'wpdirectorykit' ),
738 + 'icon' => 'eicon-text-align-center',
739 + ],
740 + 'right' => [
741 + 'title' => esc_html__( 'Right', 'wpdirectorykit' ),
742 + 'icon' => 'eicon-text-align-right',
743 + ],
744 + ],
745 + 'render_type' => 'template',
746 + 'selectors_dictionary' => [
747 + 'left' => 'justify-content: flex-start;',
748 + 'center' => 'justify-content: center;',
749 + 'right' => 'justify-content: flex-end;',
750 + ],
751 +
752 + 'selectors' => [
753 + '{{WRAPPER}} .wdk-search .wdk-search-form > .wdk-row ' => '{{VALUE}};',
754 + ],
755 + ]
756 + );
757 +
758 + $this->add_responsive_control(
323 759 'design_layout',
324 760 [
325 761 'label' => __( 'Design Layout', 'wpdirectorykit' ),
326 762 'type' => Controls_Manager::SELECT,
@@ -331,24 +767,8 @@
331 767 ],
332 768 'default' => 'inline',
333 769 ]
334 770 );
335 -
336 - $this->add_responsive_control(
337 - 'f_label_hide',
338 - [
339 - 'label' => esc_html__( 'Field Label Hide', 'wpdirectorykit' ),
340 - 'type' => Controls_Manager::SWITCHER,
341 - 'none' => esc_html__( 'Hide', 'wpdirectorykit' ),
342 - 'block' => esc_html__( 'Show', 'wpdirectorykit' ),
343 - 'return_value' => 'none',
344 - 'default' => 'none',
345 - 'selectors' => [
346 - '{{WRAPPER}} .wdk-field:not(.CHECKBOX) .wdk-field-label' => 'display: {{VALUE}};',
347 - ],
348 - 'separator' => 'before',
349 - ]
350 - );
351 771
352 772 $this->add_responsive_control(
353 773 'row_gap_col_inline',
354 774 [
@@ -433,92 +853,8 @@
433 853 ]
434 854 );
435 855
436 856 $this->add_responsive_control(
437 - 'button_column_inline',
438 - [
439 - 'label' => __( 'Button Columns', 'wpdirectorykit' ),
440 - 'type' => Controls_Manager::SELECT,
441 - 'options' => [
442 - '' => esc_html__('Default', 'wpdirectorykit'),
443 - 'auto' => esc_html__('Auto', 'wpdirectorykit'),
444 - '100%' => '1',
445 - '50%' => '2',
446 - 'calc(100% / 3)' => '3',
447 - '25%' => '4',
448 - '20%' => '5',
449 - 'auto_flexible' => 'auto flexible',
450 - ],
451 - 'selectors_dictionary' => [
452 - 'auto' => 'width:auto;-webkit-flex:0 0 auto;flex:0 0 auto',
453 - '100%' => 'width:100%;-webkit-flex:0 0 100%;flex:0 0 100%',
454 - '50%' => 'width:50%;-webkit-flex:0 0 50%;flex:0 0 50%',
455 - 'calc(100% / 3)' => 'width:calc(100% / 3);-webkit-flex:0 0 calc(100% / 3);flex:0 0 calc(100% / 3)',
456 - '25%' => 'width:25%;-webkit-flex:0 0 25%;flex:0 0 25%',
457 - '20%' => 'width:20%;-webkit-flex:0 0 20%;flex:0 0 20%',
458 - 'auto' => 'width:auto;-webkit-flex:0 0 auto;flex:0 0 auto',
459 - 'auto_flexible' => 'width:auto;-webkit-flex:1 2 auto;flex:1 2 auto',
460 - ],
461 - 'selectors' => [
462 - '{{WRAPPER}} .wdk-search.layout_inline .wdk-col:not(.wdk-field)' => '{{UNIT}}',
463 - ],
464 - 'default' => '',
465 - 'separator' => 'before',
466 - 'conditions' => [
467 - 'terms' => [
468 - [
469 - 'name' => 'design_layout',
470 - 'operator' => '==',
471 - 'value' => 'inline',
472 - ]
473 - ],
474 - ],
475 - ]
476 - );
477 - $this->add_responsive_control(
478 - 'button_column_horizontal',
479 - [
480 - 'label' => __( 'Button Columns', 'wpdirectorykit' ),
481 - 'type' => Controls_Manager::SELECT,
482 - 'options' => [
483 - '' => esc_html__('Default', 'wpdirectorykit'),
484 - 'auto' => esc_html__('Auto', 'wpdirectorykit'),
485 - '100%' => '1',
486 - '50%' => '2',
487 - 'calc(100% / 3)' => '3',
488 - '25%' => '4',
489 - '20%' => '5',
490 - 'auto_flexible' => 'auto flexible',
491 - ],
492 - 'selectors_dictionary' => [
493 - 'auto' => 'width:auto;-webkit-flex:0 0 auto;flex:0 0 auto',
494 - '100%' => 'width:100%;-webkit-flex:0 0 100%;flex:0 0 100%',
495 - '50%' => 'width:50%;-webkit-flex:0 0 50%;flex:0 0 50%',
496 - 'calc(100% / 3)' => 'width:calc(100% / 3);-webkit-flex:0 0 calc(100% / 3);flex:0 0 calc(100% / 3)',
497 - '25%' => 'width:25%;-webkit-flex:0 0 25%;flex:0 0 25%',
498 - '20%' => 'width:20%;-webkit-flex:0 0 20%;flex:0 0 20%',
499 - 'auto' => 'width:auto;-webkit-flex:0 0 auto;flex:0 0 auto',
500 - 'auto_flexible' => 'width:auto;-webkit-flex:1 2 auto;flex:1 2 auto',
501 - ],
502 - 'selectors' => [
503 - '{{WRAPPER}} .wdk-search:not(.layout_inline) .wdk-col:not(.wdk-field)' => '{{UNIT}}',
504 - ],
505 - 'default' => '',
506 - 'separator' => 'before',
507 - 'conditions' => [
508 - 'terms' => [
509 - [
510 - 'name' => 'design_layout',
511 - 'operator' => '==',
512 - 'value' => 'vertical',
513 - ]
514 - ],
515 - ],
516 - ]
517 - );
518 -
519 -
520 - $this->add_responsive_control(
521 857 'column_gap',
522 858 [
523 859 'label' => esc_html__('Columns Gap', 'wpdirectorykit'),
524 860 'type' => Controls_Manager::SLIDER,
@@ -679,16 +1015,116 @@
679 1015 ],
680 1016 ]
681 1017 );
682 1018
683 - $this->add_control(
684 - 'heading_button',
1019 + $this->end_controls_section();
1020 +
1021 + /* Buttons Search / Save / More */
1022 + $this->start_controls_section(
1023 + 'section_form_wdk_field_section',
1024 + [
1025 + 'label' => __( 'Button', 'wpdirectorykit' ),
1026 + 'tab' => Controls_Manager::TAB_STYLE,
1027 + ]
1028 + );
1029 +
1030 + $this->add_responsive_control(
1031 + 'button_wrapper',
685 1032 [
686 - 'label' => __( 'Button', 'wpdirectorykit' ),
687 - 'type' => Controls_Manager::HEADING,
688 - 'separator' => 'before',
1033 + 'label' => __( 'Button Wrapper Hide', 'wpdirectorykit' ),
1034 + 'type' => Controls_Manager::SWITCHER,
1035 + 'label_on' => __( 'Show', 'wpdirectorykit' ),
1036 + 'label_off' => __( 'Hide', 'wpdirectorykit' ),
1037 + 'return_value' => 'none',
1038 + 'default' => '',
1039 + 'selectors' => [
1040 + '{{WRAPPER}} .wdk-search .wdk-col-btns' => 'display: {{VALUE}};',
1041 + ],
689 1042 ]
690 1043 );
1044 +
1045 + $this->add_responsive_control(
1046 + 'button_column_inline',
1047 + [
1048 + 'label' => __( 'Column Buttons Cell', 'wpdirectorykit' ),
1049 + 'type' => Controls_Manager::SELECT,
1050 + 'options' => [
1051 + '' => esc_html__('Default', 'wpdirectorykit'),
1052 + 'auto' => esc_html__('Auto', 'wpdirectorykit'),
1053 + '100%' => '1',
1054 + '50%' => '2',
1055 + 'calc(100% / 3)' => '3',
1056 + '25%' => '4',
1057 + '20%' => '5',
1058 + 'auto_flexible' => 'auto flexible',
1059 + ],
1060 + 'selectors_dictionary' => [
1061 + 'auto' => 'width:auto;-webkit-flex:0 0 auto;flex:0 0 auto',
1062 + '100%' => 'width:100%;-webkit-flex:0 0 100%;flex:0 0 100%',
1063 + '50%' => 'width:50%;-webkit-flex:0 0 50%;flex:0 0 50%',
1064 + 'calc(100% / 3)' => 'width:calc(100% / 3);-webkit-flex:0 0 calc(100% / 3);flex:0 0 calc(100% / 3)',
1065 + '25%' => 'width:25%;-webkit-flex:0 0 25%;flex:0 0 25%',
1066 + '20%' => 'width:20%;-webkit-flex:0 0 20%;flex:0 0 20%',
1067 + 'auto' => 'width:auto;-webkit-flex:0 0 auto;flex:0 0 auto',
1068 + 'auto_flexible' => 'width:auto;-webkit-flex:1 2 auto;flex:1 2 auto',
1069 + ],
1070 + 'selectors' => [
1071 + '{{WRAPPER}} .wdk-search.layout_inline .wdk-col:not(.wdk-field)' => '{{UNIT}}',
1072 + ],
1073 + 'default' => '',
1074 + 'conditions' => [
1075 + 'terms' => [
1076 + [
1077 + 'name' => 'design_layout',
1078 + 'operator' => '==',
1079 + 'value' => 'inline',
1080 + ]
1081 + ],
1082 + ],
1083 + ]
1084 + );
1085 +
1086 + $this->add_responsive_control(
1087 + 'button_column_horizontal',
1088 + [
1089 + 'label' => __( 'Column Buttons Cell', 'wpdirectorykit' ),
1090 + 'type' => Controls_Manager::SELECT,
1091 + 'options' => [
1092 + '' => esc_html__('Default', 'wpdirectorykit'),
1093 + 'auto' => esc_html__('Auto', 'wpdirectorykit'),
1094 + '100%' => '1',
1095 + '50%' => '2',
1096 + 'calc(100% / 3)' => '3',
1097 + '25%' => '4',
1098 + '20%' => '5',
1099 + 'auto_flexible' => 'auto flexible',
1100 + ],
1101 + 'selectors_dictionary' => [
1102 + 'auto' => 'width:auto;-webkit-flex:0 0 auto;flex:0 0 auto',
1103 + '100%' => 'width:100%;-webkit-flex:0 0 100%;flex:0 0 100%',
1104 + '50%' => 'width:50%;-webkit-flex:0 0 50%;flex:0 0 50%',
1105 + 'calc(100% / 3)' => 'width:calc(100% / 3);-webkit-flex:0 0 calc(100% / 3);flex:0 0 calc(100% / 3)',
1106 + '25%' => 'width:25%;-webkit-flex:0 0 25%;flex:0 0 25%',
1107 + '20%' => 'width:20%;-webkit-flex:0 0 20%;flex:0 0 20%',
1108 + 'auto' => 'width:auto;-webkit-flex:0 0 auto;flex:0 0 auto',
1109 + 'auto_flexible' => 'width:auto;-webkit-flex:1 2 auto;flex:1 2 auto',
1110 + ],
1111 + 'selectors' => [
1112 + '{{WRAPPER}} .wdk-search:not(.layout_inline) .wdk-col:not(.wdk-field)' => '{{UNIT}}',
1113 + ],
1114 + 'default' => '',
1115 + 'separator' => 'before',
1116 + 'conditions' => [
1117 + 'terms' => [
1118 + [
1119 + 'name' => 'design_layout',
1120 + 'operator' => '==',
1121 + 'value' => 'vertical',
1122 + ]
1123 + ],
1124 + ],
1125 + ]
1126 + );
691 1127
692 1128 $this->add_responsive_control(
693 1129 'more_btn_direction',
694 1130 [
@@ -724,11 +1160,8 @@
724 1160 '' => esc_html__('Default', 'wpdirectorykit'),
725 1161 'auto' => esc_html__('Auto', 'wpdirectorykit'),
726 1162 '100%' => '1',
727 1163 '50%' => '2',
728 - 'calc(100% / 3)' => '3',
729 - '25%' => '4',
730 - '20%' => '5',
731 1164 'auto_flexible' => 'auto flexible',
732 1165 ],
733 1166 'selectors_dictionary' => [
734 1167 'auto' => 'width:auto;-webkit-flex:0 0 auto;flex:0 0 auto',
@@ -740,9 +1173,9 @@
740 1173 'auto' => 'width:auto;-webkit-flex:0 0 auto;flex:0 0 auto',
741 1174 'auto_flexible' => 'width:auto;-webkit-flex:1 2 auto;flex:1 2 auto',
742 1175 ],
743 1176 'selectors' => [
744 - '{{WRAPPER}} .wdk-search:not(.layout_inline) .wdk-field-btn .wdk-field-group' => '{{UNIT}}',
1177 + '{{WRAPPER}} .wdk-search .wdk-field-btn .wdk-field-group' => '{{UNIT}}',
745 1178 ],
746 1179 'default' => '',
747 1180 'separator' => 'before',
748 1181 'conditions' => [
@@ -770,11 +1203,8 @@
770 1203 '' => esc_html__('Default', 'wpdirectorykit'),
771 1204 'auto' => esc_html__('Auto', 'wpdirectorykit'),
772 1205 '100%' => '1',
773 1206 '50%' => '2',
774 - 'calc(100% / 3)' => '3',
775 - '25%' => '4',
776 - '20%' => '5',
777 1207 'auto_flexible' => 'auto flexible',
778 1208 ],
779 1209 'selectors_dictionary' => [
780 1210 'auto' => 'width:auto;-webkit-flex:0 0 auto;flex:0 0 auto',
@@ -820,9 +1250,9 @@
820 1250 ],
821 1251 ],
822 1252 'selectors' => [
823 1253 '{{WRAPPER}} .wdk-field-btn .wdk-field-group' => 'padding-left: {{SIZE}}{{UNIT}};padding-right: {{SIZE}}{{UNIT}};;',
824 - '{{WRAPPER}} .wdk-field-btn' => 'margin-left: -{{SIZE}}{{UNIT}};margin-right: -{{SIZE}}{{UNIT}};',
1254 + '{{WRAPPER}} .wdk-field-btn' => 'margin-left: -{{SIZE}}{{UNIT}};margin-right: -{{SIZE}}{{UNIT}};width: calc(100% + {{SIZE}}{{UNIT}} + {{SIZE}}{{UNIT}});',
825 1255 ],
826 1256 'conditions' => [
827 1257 'terms' => [
828 1258 [
@@ -898,8 +1328,36 @@
898 1328 ],
899 1329 ]
900 1330 );
901 1331
1332 +
1333 + $this->add_control(
1334 + 'wdk_field_btn_style_heading',
1335 + [
1336 + 'label' => __( 'Buttons Cell', 'wpdirectorykit' ),
1337 + 'type' => Controls_Manager::HEADING,
1338 + 'separator' => 'before',
1339 + ]
1340 + );
1341 +
1342 + $selectors = array(
1343 + 'normal' => '{{WRAPPER}} .wdk-search .wdk-field.wdk-field-btn',
1344 + );
1345 +
1346 + $this->generate_renders_tabs($selectors, 'wdk_field_btn_style_dynamic', ['margin','background','border','border_radius','padding','shadow','transition']);
1347 +
1348 +
1349 +
1350 + $this->end_controls_section();
1351 +
1352 + /* TAB_STYLE */
1353 + $this->start_controls_section(
1354 + 'section_form_more_style',
1355 + [
1356 + 'label' => __( 'Form More', 'wpdirectorykit' ),
1357 + 'tab' => Controls_Manager::TAB_STYLE,
1358 + ]
1359 + );
902 1360 $this->add_responsive_control(
903 1361 'button_column_more',
904 1362 [
905 1363 'label' => __( 'Columns', 'wpdirectorykit' ),
@@ -929,20 +1387,9 @@
929 1387 ],
930 1388 'separator' => 'before',
931 1389 ]
932 1390 );
933 - $this->end_controls_section();
934 1391
935 - /* TAB_STYLE */
936 - $this->start_controls_section(
937 - 'section_form_more_style',
938 - [
939 - 'label' => __( 'Form More', 'wpdirectorykit' ),
940 - 'tab' => Controls_Manager::TAB_STYLE,
941 - ]
942 - );
943 -
944 -
945 1392 $this->add_responsive_control(
946 1393 'column_gap_more',
947 1394 [
948 1395 'label' => esc_html__('Columns Gap', 'wpdirectorykit'),
@@ -977,14 +1424,146 @@
977 1424 'max' => 60,
978 1425 ],
979 1426 ],
980 1427 'selectors' => [
981 - '{{WRAPPER}} #wdk-form-additional .wdk-row .wdk-col' => 'margin-bottom: {{SIZE}}{{UNIT}};',
1428 + '{{WRAPPER}} #wdk-form-additional .wdk-row .wdk-col' => 'margin-bottom: {{SIZE}}{{UNIT}};',
982 1429 '{{WRAPPER}} #wdk-form-additional .wdk-row' => 'margin-bottom: -{{SIZE}}{{UNIT}};',
983 1430 ],
984 1431 ]
985 1432 );
986 1433 $this->end_controls_section();
1434 +
1435 + /* TAB_STYLE */
1436 + $this->start_controls_section(
1437 + 'section_tab_field_style',
1438 + [
1439 + 'label' => __( 'Tabs', 'wpdirectorykit' ),
1440 + 'tab' => Controls_Manager::TAB_STYLE,
1441 + 'conditions' => [
1442 + 'terms' => [
1443 + [
1444 + 'name' => 'tab_field',
1445 + 'operator' => '!=',
1446 + 'value' => '',
1447 + ],
1448 + ],
1449 + ],
1450 + ]
1451 + );
1452 +
1453 + $this->add_responsive_control(
1454 + 'section_tab_field_style_hide',
1455 + [
1456 + 'label' => __( 'Hide', 'wpdirectorykit' ),
1457 + 'type' => Controls_Manager::SWITCHER,
1458 + 'label_on' => __( 'Show', 'wpdirectorykit' ),
1459 + 'label_off' => __( 'Hide', 'wpdirectorykit' ),
1460 + 'return_value' => 'none',
1461 + 'default' => '',
1462 + 'selectors' => [
1463 + '{{WRAPPER}} .wdk-search .wdk-search-tabs' => 'display: {{VALUE}};',
1464 + ],
1465 + ]
1466 + );
1467 +
1468 + $this->add_responsive_control (
1469 + 'section_tab_field_style_align',
1470 + [
1471 + 'label' => __( 'Position', 'wpdirectorykit' ),
1472 + 'type' => Controls_Manager::CHOOSE,
1473 + 'options' => [
1474 + 'left' => [
1475 + 'title' => esc_html__( 'Left', 'wpdirectorykit' ),
1476 + 'icon' => 'eicon-text-align-left',
1477 + ],
1478 + 'center' => [
1479 + 'title' => esc_html__( 'Center', 'wpdirectorykit' ),
1480 + 'icon' => 'eicon-text-align-center',
1481 + ],
1482 + 'right' => [
1483 + 'title' => esc_html__( 'Right', 'wpdirectorykit' ),
1484 + 'icon' => 'eicon-text-align-right',
1485 + ],
1486 + ],
1487 + 'render_type' => 'ui',
1488 + 'selectors_dictionary' => [
1489 + 'left' => 'left:0;transform:initial',
1490 + 'center' => 'left:50%;transform:translateX(-50%)',
1491 + 'right' => 'right:0;left:initial;transform:initial',
1492 + ],
1493 + 'selectors' => [
1494 + '{{WRAPPER}} .wdk-search .wdk-search-tabs' => '{{VALUE}};',
1495 + ],
1496 + ]
1497 + );
1498 +
1499 + $selectors = array(
1500 + 'normal' => '{{WRAPPER}} .wdk-search .wdk-search-tabs label',
1501 + 'hover'=>'{{WRAPPER}} .wdk-search .wdk-search-tabs label:hover',
1502 + 'active'=>'{{WRAPPER}} .wdk-search .wdk-search-tabs input:checked + label '
1503 + );
1504 +
1505 + $this->generate_renders_tabs($selectors, 'section_tab_field_style_dynamic', ['margin','typo','color','background','border','border_radius','padding','shadow','transition']);
1506 +
1507 +
1508 + $this->add_control(
1509 + 'section_tab_field_arrows_style_header',
1510 + [
1511 + 'label' => __( 'Arrows', 'wpdirectorykit' ),
1512 + 'type' => Controls_Manager::HEADING,
1513 + 'separator' => 'before',
1514 + ]
1515 + );
1516 +
1517 + $this->add_responsive_control(
1518 + 'section_tab_field_arrows_style_hide',
1519 + [
1520 + 'label' => __( 'Hide', 'wpdirectorykit' ),
1521 + 'type' => Controls_Manager::SWITCHER,
1522 + 'label_on' => __( 'Show', 'wpdirectorykit' ),
1523 + 'label_off' => __( 'Hide', 'wpdirectorykit' ),
1524 + 'return_value' => 'none',
1525 + 'default' => '',
1526 + 'selectors' => [
1527 + '{{WRAPPER}} .wdk-search .wdk-search-tabs label::after' => 'display: {{VALUE}};',
1528 + ],
1529 + ]
1530 + );
1531 +
1532 + $this->add_responsive_control(
1533 + 'section_tab_field_arrows_style_normal',
1534 + [
1535 + 'label' => esc_html__( 'Color', 'wpdirectorykit' ),
1536 + 'type' => Controls_Manager::COLOR,
1537 + 'selectors' => [
1538 + '{{WRAPPER}} .wdk-search .wdk-search-tabs label::after' => 'border-top-color: {{VALUE}};',
1539 + ],
1540 + ]
1541 + );
1542 +
1543 + $this->add_responsive_control(
1544 + 'section_tab_field_arrows_style_hover',
1545 + [
1546 + 'label' => esc_html__( 'Color Hover', 'wpdirectorykit' ),
1547 + 'type' => Controls_Manager::COLOR,
1548 + 'selectors' => [
1549 + '{{WRAPPER}} .wdk-search .wdk-search-tabs label:hover::after' => 'border-top-color: {{VALUE}};',
1550 + ],
1551 + ]
1552 + );
1553 +
1554 + $this->add_responsive_control(
1555 + 'section_tab_field_arrows_style_active',
1556 + [
1557 + 'label' => esc_html__( 'Color Active', 'wpdirectorykit' ),
1558 + 'type' => Controls_Manager::COLOR,
1559 + 'selectors' => [
1560 + '{{WRAPPER}} .wdk-search .wdk-search-tabs input:checked + label::after' => 'border-top-color: {{VALUE}};',
1561 + ],
1562 + ]
1563 + );
1564 +
1565 + $this->end_controls_section();
987 1566 }
988 1567
989 1568 private function generate_controls_styles() {
990 1569 $items = [
@@ -990,78 +1569,133 @@
990 1569 $items = [
991 1570 [
992 1571 'key'=>'field_label',
993 1572 'label'=> esc_html__('Field Label', 'wpdirectorykit'),
994 - 'selector'=>'.wdk-field:not(.CHECKBOX) .wdk-field-label',
1573 + //'selector_hide'=>'{{WRAPPER}} .wdk-field:not(.CHECKBOX) .wdk-field-label',
1574 + 'selector'=>'{{WRAPPER}} .wdk-field:not(.CHECKBOX) .wdk-field-label',
1575 + 'selector_hover'=>'{{WRAPPER}} .wdk-field:not(.CHECKBOX) .wdk-field-label%1$s',
995 1576 'options'=>'full',
996 1577 ],
997 1578 [
998 1579 'key'=>'field_text',
999 1580 'label'=> esc_html__('Field Text/Integer', 'wpdirectorykit'),
1000 - 'selector'=>'.wdk-field input[type="text"],{{WRAPPER}} .wdk-field input[type="number"]',
1001 - 'focus'=>'.wdk-field input[type="text"]:focus,{{WRAPPER}} .wdk-field input[type="number"]:focus',
1581 + 'selector_hide'=>'{{WRAPPER}} .wdk-field.INPUTBOX,{{WRAPPER}} .wdk-field.NUMBER,{{WRAPPER}} .wdk-field.TEXTAREA',
1582 + 'selector'=>'{{WRAPPER}} .wdk-field input[type="text"],{{WRAPPER}} .wdk-field input[type="number"]',
1583 + 'selector_hover'=>'{{WRAPPER}} .wdk-field input[type="text"]%1$s,{{WRAPPER}} .wdk-field input[type="number"]%1$s',
1584 + 'selector_focus'=>'{{WRAPPER}} .wdk-field input[type="text"]:focus,{{WRAPPER}} .wdk-field input[type="number"]:focus',
1002 1585 'options'=>'full',
1003 1586 ],
1004 1587 [
1005 1588 'key'=>'field_select',
1006 1589 'label'=> esc_html__('Field Select', 'wpdirectorykit'),
1007 - 'selector'=>'.wdk-field select',
1590 + 'selector_hide'=>'{{WRAPPER}} .wdk-field.DROPDOWN',
1591 + 'selector'=>'{{WRAPPER}} .wdk-field.DROPDOWN select',
1592 + 'selector_hover'=>'{{WRAPPER}} .wdk-field.DROPDOWN select%1$s',
1008 1593 'options'=>'full',
1009 - ],
1594 + ],
1010 1595 [
1011 1596 'key'=>'field_checkbox',
1012 1597 'label'=> esc_html__('Field Checkbox', 'wpdirectorykit'),
1013 - 'selector'=>'.wdk-field.CHECKBOX .wdk-field-label ',
1598 + 'selector_hide'=>'{{WRAPPER}} .wdk-field.CHECKBOX',
1599 + 'selector'=>'{{WRAPPER}} .wdk-field.CHECKBOX .wdk-field-label',
1600 + 'selector_hover'=>'{{WRAPPER}} .wdk-field.CHECKBOX .wdk-field-label%1$s',
1014 1601 'options'=>'full',
1015 1602 ],
1016 1603 [
1017 1604 'key'=>'field_tree',
1018 1605 'label'=> esc_html__('Field Category / Location', 'wpdirectorykit'),
1019 - 'selector'=>'.wdk_dropdown_tree button',
1020 - 'options'=>'full',
1606 + 'selector_hide'=>'{{WRAPPER}} .wdk-field.CATEGORY,{{WRAPPER}} .wdk-field.LOCATION',
1607 + 'selector'=>'{{WRAPPER}} .wdk_dropdown_tree .btn-group, {{WRAPPER}} .wdk-field.CATEGORY .select2, {{WRAPPER}} .wdk-field.LOCATION .select2',
1608 + 'selector_hover'=>'{{WRAPPER}} .wdk_dropdown_tree .btn-group%1$s, {{WRAPPER}} .wdk-field.CATEGORY .select2%1$s, {{WRAPPER}} .wdk-field.LOCATION .select2%1$s',
1609 + 'options'=> ['margin','background','border','border_radius','padding','shadow','transition'],
1021 1610 ],
1022 1611 [
1612 + 'key'=>'field_select2',
1613 + 'label'=> esc_html__('Dropdown Multi-Select', 'wpdirectorykit'),
1614 + 'selector_hide'=>'{{WRAPPER}} .wdk-field.DROPDOWNMULTIPLE',
1615 + 'selector'=>'{{WRAPPER}} .wdk-field.DROPDOWNMULTIPLE .select2',
1616 + 'selector_hover'=>'{{WRAPPER}} .wdk-field.DROPDOWNMULTIPLE .select2%1$s',
1617 + 'options'=>['margin','background','border','border_radius','padding','shadow','transition'],
1618 + ],
1619 + [
1620 + 'key'=>'field_slider_range',
1621 + 'label'=> esc_html__('Field Slider Range', 'wpdirectorykit'),
1622 + 'selector_hide'=>'{{WRAPPER}} .wdk-field.SLIDER_RANGE',
1623 + 'selector'=>'',
1624 + 'selector_hover'=>'',
1625 + 'options'=>'',
1626 + ],
1627 + [
1023 1628 'key'=>'field_button',
1024 1629 'label'=> esc_html__('Search Button', 'wpdirectorykit'),
1025 - 'selector'=>'.wdk-field button.wdk-search-start',
1630 + 'selector_hide'=>'{{WRAPPER}} .wdk-field .wdk-field-group-search button.wdk-search-start',
1631 + 'selector'=>'{{WRAPPER}} .wdk-field button.wdk-search-start',
1632 + 'selector_hover'=>'{{WRAPPER}} .wdk-field button.wdk-search-start%1$s',
1026 1633 'options'=>'full',
1027 1634 ],
1028 1635 [
1636 + 'key'=>'field_button_reset',
1637 + 'label'=> esc_html__('Reset Button', 'wpdirectorykit'),
1638 + 'selector_hide'=>'{{WRAPPER}} .wdk-field-group.wdk-field-group-reset',
1639 + 'selector'=>'{{WRAPPER}} .wdk-field button.wdk-search-start.wdk-search-reset',
1640 + 'selector_hover'=>'{{WRAPPER}} .wdk-field button.wdk-search-start.wdk-search-reset%1$s',
1641 + 'options'=>['typo','color','border','border_radius','shadow','transition','background_group'],
1642 + ],
1643 + [
1644 + 'key'=>'field_button_ai_search',
1645 + 'label'=> esc_html__('Ai Search Button', 'wpdirectorykit'),
1646 + 'selector_hide'=>'{{WRAPPER}} .wdk-field-group.wdk-field-group-ai-search',
1647 + 'selector'=>'{{WRAPPER}} .wdk-field .wdk-ai-search',
1648 + 'selector_hover'=>'{{WRAPPER}} .wdk-field .wdk-ai-search%1$s',
1649 + 'options'=>['typo','color','border','border_radius','shadow','transition','background_group'],
1650 + ],
1651 + [
1029 1652 'key'=>'field_button_more',
1030 1653 'label'=> esc_html__('Button More', 'wpdirectorykit'),
1031 - 'selector'=>'.wdk-field button.wdk-search-additional-btn',
1032 - 'options'=>'full',
1654 + 'selector_hide'=>'{{WRAPPER}} .wdk-field .wdk-field-group-additional',
1655 + 'selector'=>'{{WRAPPER}} .wdk-field button.wdk-search-additional-btn',
1656 + 'selector_hover'=>'{{WRAPPER}} .wdk-field button.wdk-search-additional-btn%1$s',
1657 + 'options'=>['typo','color','border','border_radius','shadow','transition','background_group'],
1033 1658 ],
1034 1659 /* additon box fields */
1035 1660 [
1036 1661 'key'=>'fields_addition_box',
1037 - 'label'=> esc_html__('Additional fields box', 'wpdirectorykit'),
1038 - 'selector'=>'#wdk-form-additional',
1662 + 'label'=> esc_html__('Fields box (Inside More)', 'wpdirectorykit'),
1663 + 'selector'=>'{{WRAPPER}} #wdk-form-additional',
1664 + 'selector_hover'=>'{{WRAPPER}} #wdk-form-additional%1$s',
1039 1665 'options'=>['background','padding','border'],
1040 1666 ],
1041 1667 [
1042 1668 'key'=>'addition_box_field_label',
1043 - 'label'=> esc_html__('Additional box Field Label', 'wpdirectorykit'),
1044 - 'selector'=>'#wdk-form-additional .wdk-field:not(.CHECKBOX) .wdk-field-label',
1669 + 'label'=> esc_html__('Field Label (Inside More)', 'wpdirectorykit'),
1670 + //'selector_hide'=>'{{WRAPPER}} #wdk-form-additional .wdk-field:not(.CHECKBOX) .wdk-field-label',
1671 + 'selector'=>'{{WRAPPER}} #wdk-form-additional .wdk-field:not(.CHECKBOX) .wdk-field-label',
1672 + 'selector_hover'=>'{{WRAPPER}} #wdk-form-additional .wdk-field:not(.CHECKBOX) .wdk-field-label%1$s',
1045 1673 'options'=>'full',
1046 1674 ],
1047 1675 [
1048 1676 'key'=>'addition_box_field_text',
1049 - 'label'=> esc_html__('Additional box Field Text/Integer', 'wpdirectorykit'),
1050 - 'selector'=>'#wdk-form-additional .wdk-field input[type="text"]',
1051 - 'focus'=>'#wdk-form-additional .wdk-field input[type="text"]:focus',
1677 + 'label'=> esc_html__('Field Text/Integer (Inside More)', 'wpdirectorykit'),
1678 + 'selector_hide'=>'{{WRAPPER}} #wdk-form-additional .wdk-field.INPUTBOX,{{WRAPPER}} #wdk-form-additional .wdk-field.NUMBER,{{WRAPPER}} #wdk-form-additional .wdk-field.TEXTAREA',
1679 + 'selector'=>'{{WRAPPER}} #wdk-form-additional .wdk-field input[type="text"]',
1680 + 'selector_hover'=>'{{WRAPPER}} #wdk-form-additional .wdk-field input[type="text"]%1$s',
1681 + 'selector_focus'=>'{{WRAPPER}} #wdk-form-additional .wdk-field input[type="text"]:focus',
1052 1682 'options'=>'full',
1053 1683 ],
1054 1684 [
1055 1685 'key'=>'addition_box_field_select',
1056 - 'label'=> esc_html__('Additional box Field Select', 'wpdirectorykit'),
1057 - 'selector'=>'#wdk-form-additional .wdk-field select',
1686 + 'label'=> esc_html__('Field Select (Inside More)', 'wpdirectorykit'),
1687 + 'selector_hide'=>'{{WRAPPER}} #wdk-form-additional .wdk-field.DROPDOWN,{{WRAPPER}} #wdk-form-additional .wdk-field.DROPDOWNMULTIPLE',
1688 + 'selector'=>'{{WRAPPER}} #wdk-form-additional .wdk-field select',
1689 + 'selector_hover'=>'{{WRAPPER}} #wdk-form-additional .wdk-field select%1$s',
1058 1690 'options'=>'full',
1059 1691 ],
1060 1692 [
1061 1693 'key'=>'addition_box_field_checkbox',
1062 - 'label'=> esc_html__('Additional box Field Checkbox', 'wpdirectorykit'),
1063 - 'selector'=>'#wdk-form-additional .wdk-field.CHECKBOX .wdk-field-label ',
1694 + 'label'=> esc_html__('Field Checkbox (Inside More)', 'wpdirectorykit'),
1695 + 'selector_hide'=>'{{WRAPPER}} #wdk-form-additional .wdk-field.CHECKBOX',
1696 + 'selector'=>'{{WRAPPER}} #wdk-form-additional .wdk-field.CHECKBOX .wdk-field-label',
1697 + 'selector_hover'=>'{{WRAPPER}} #wdk-form-additional .wdk-field.CHECKBOX .wdk-field-label%1$s',
1064 1698 'options'=>'full',
1065 1699 ],
1066 1700 ];
1067 1701
@@ -1073,34 +1707,420 @@
1073 1707 'tab' => 'tab_layout'
1074 1708 ]
1075 1709 );
1076 1710
1077 - if($item['key'] !='field_label')
1711 + if($item['key'] == 'field_label') {
1712 + $this->add_responsive_control (
1713 + 'f_label_hide',
1714 + [
1715 + 'label' => esc_html__( 'Field Label Hide', 'wpdirectorykit' ),
1716 +
1717 + 'type' => Controls_Manager::SWITCHER,
1718 + 'none' => esc_html__( 'Hide', 'wpdirectorykit' ),
1719 + 'block' => esc_html__( 'Show', 'wpdirectorykit' ),
1720 + 'return_value' => 'none',
1721 + 'default' => 'none',
1722 + 'selectors' => [
1723 + '{{WRAPPER}} .wdk-field:not(.CHECKBOX) .wdk-field-label' => 'display: {{VALUE}};',
1724 + ],
1725 + 'separator' => 'before',
1726 + ]
1727 + );
1728 + }
1729 +
1730 + if($item['key'] == 'addition_box_field_label') {
1731 + $this->add_responsive_control(
1732 + 'addition_box_field_label_show',
1733 + [
1734 + 'label' => esc_html__( 'Field Label Show', 'wpdirectorykit' ),
1735 +
1736 + 'type' => Controls_Manager::SWITCHER,
1737 + 'none' => esc_html__( 'Hide', 'wpdirectorykit' ),
1738 + 'block' => esc_html__( 'Show', 'wpdirectorykit' ),
1739 + 'return_value' => 'block',
1740 + 'default' => '',
1741 + 'selectors' => [
1742 + '{{WRAPPER}} #wdk-form-additional .wdk-field:not(.CHECKBOX) .wdk-field-label' => 'display: {{VALUE}} !important;',
1743 + ],
1744 + 'separator' => 'before',
1745 + 'conditions' => [
1746 + 'terms' => [
1747 + [
1748 + 'name' => 'f_label_hide',
1749 + 'operator' => '==',
1750 + 'value' => 'none',
1751 + ],
1752 + ],
1753 + ],
1754 + ]
1755 + );
1756 +
1757 + $this->add_responsive_control(
1758 + 'addition_box_field_label_hide',
1759 + [
1760 + 'label' => esc_html__( 'Field Label Hide', 'wpdirectorykit' ),
1761 +
1762 + 'type' => Controls_Manager::SWITCHER,
1763 + 'none' => esc_html__( 'Hide', 'wpdirectorykit' ),
1764 + 'block' => esc_html__( 'Show', 'wpdirectorykit' ),
1765 + 'return_value' => 'none',
1766 + 'default' => '',
1767 + 'selectors' => [
1768 + '{{WRAPPER}} #wdk-form-additional .wdk-field:not(.CHECKBOX) .wdk-field-label' => 'display: {{VALUE}} !important;',
1769 + ],
1770 + 'separator' => 'before',
1771 + ]
1772 + );
1773 + }
1774 +
1775 + if(!empty($item['selector_hide'])) {
1776 + $this->add_responsive_control(
1777 + $item['key'].'_hide',
1778 + [
1779 + 'label' => esc_html__( 'Hide Element', 'wpdirectorykit' ),
1780 + 'type' => Controls_Manager::SWITCHER,
1781 + 'none' => esc_html__( 'Hide', 'wpdirectorykit' ),
1782 + 'block' => esc_html__( 'Show', 'wpdirectorykit' ),
1783 + 'return_value' => 'none',
1784 + 'default' => ($item['key'] == 'field_button_reset' ) ? 'none':'',
1785 + 'selectors' => [
1786 + $item['selector_hide'] => 'display: {{VALUE}};',
1787 + ],
1788 + ]
1789 + );
1790 + }
1791 +
1792 + if($item['key'] == 'addition_box_field_label') {
1793 + $this->add_control(
1794 + 'important_note_addition_box_field_label',
1795 + [
1796 + 'type' => \Elementor\Controls_Manager::RAW_HTML,
1797 + 'raw' => esc_html__( 'Visible only if not hidden in Field Label', 'wpdirectorykit' ),
1798 + 'content_classes' => 'hint-italic',
1799 + ]
1800 + );
1801 + }
1802 +
1803 + if($item['key'] !='field_slider_range'){
1804 + $selectors = array();
1805 +
1806 + if(!empty($item['selector']))
1807 + $selectors['normal'] = $item['selector'];
1808 +
1809 + if(!empty($item['selector_hover']))
1810 + $selectors['hover'] = $item['selector_hover'];
1811 +
1812 + if(!empty($item['selector_focus']))
1813 + $selectors['focus'] = $item['selector_hover'];
1814 +
1815 + $this->generate_renders_tabs($selectors, $item['key'].'_dynamic', $item['options']);
1816 + }
1817 +
1818 + if($item['key'] =='field_text'){
1819 + $this->add_control(
1820 + 'field_text_pl_header',
1821 + [
1822 + 'label' => __( 'Placeholder', 'wpdirectorykit' ),
1823 + 'type' => Controls_Manager::HEADING,
1824 + ]
1825 + );
1826 +
1827 + $selectors = array(
1828 + 'normal' => '{{WRAPPER}} .wdk-field input[type="text"]::placeholder,{{WRAPPER}} .wdk-field input[type="number"]::placeholder',
1829 + );
1830 +
1831 + $this->generate_renders_tabs($selectors, 'field_text_pl_dynamic', ['align','typo','color']);
1832 + }
1833 +
1834 + if($item['key'] =='field_slider_range') {
1835 +
1078 1836 $this->add_responsive_control(
1079 - $item['key'].'_hide',
1837 + 'field_slider_range_color_circle',
1838 + [
1839 + 'label' => esc_html__( 'Circle Color', 'wpdirectorykit' ),
1840 + 'type' => Controls_Manager::COLOR,
1841 + 'selectors' => [
1842 + '{{WRAPPER}} .irs--round .irs-handle' => 'border-color: {{VALUE}};',
1843 + ],
1844 + ]
1845 + );
1846 +
1847 + $this->add_responsive_control(
1848 + 'field_slider_range_color_line',
1849 + [
1850 + 'label' => esc_html__( 'Line Color', 'wpdirectorykit' ),
1851 + 'type' => Controls_Manager::COLOR,
1852 + 'selectors' => [
1853 + '{{WRAPPER}} .irs--round .irs-bar' => 'background-color: {{VALUE}};',
1854 + ],
1855 + ]
1856 + );
1857 +
1858 + $this->add_responsive_control(
1859 + 'field_slider_range_color_label',
1860 + [
1861 + 'label' => esc_html__( 'Label Color', 'wpdirectorykit' ),
1862 + 'type' => Controls_Manager::COLOR,
1863 + 'selectors' => [
1864 + '{{WRAPPER}} .irs--round .irs-from, {{WRAPPER}} .irs--round .irs-to, {{WRAPPER}} .irs--round .irs-single' => 'background-color: {{VALUE}};',
1865 + '{{WRAPPER}} .irs--round .irs-from::before,{{WRAPPER}} .irs--round .irs-to::before,{{WRAPPER}} .irs--round .irs-single::before' => 'border-top-color: {{VALUE}};',
1866 + ],
1867 + ]
1868 + );
1869 +
1870 + $this->add_responsive_control(
1871 + 'field_slider_range_color_text_label',
1872 + [
1873 + 'label' => esc_html__( 'Label Text Color', 'wpdirectorykit' ),
1874 + 'type' => Controls_Manager::COLOR,
1875 + 'selectors' => [
1876 + '{{WRAPPER}} .irs--round .irs-from, {{WRAPPER}} .irs--round .irs-to, {{WRAPPER}} .irs--round .irs-single' => 'color: {{VALUE}};',
1877 + ],
1878 + ]
1879 + );
1880 +
1881 + $this->add_group_control(
1882 + Group_Control_Typography::get_type(),
1883 + [
1884 + 'name' => 'field_slider_range_color_typo',
1885 + 'selector' => '{{WRAPPER}} .irs--round .irs-from, {{WRAPPER}} .irs--round .irs-to, {{WRAPPER}} .irs--round .irs-single',
1886 + ]
1887 + );
1888 +
1889 + $this->add_responsive_control(
1890 + 'field_slider_range_color_text_line',
1891 + [
1892 + 'label' => esc_html__( 'Line Text Color', 'wpdirectorykit' ),
1893 + 'type' => Controls_Manager::COLOR,
1894 + 'selectors' => [
1895 + '{{WRAPPER}} .wdk-slider-range-field .irs--round .irs-grid-text' => 'color: {{VALUE}};',
1896 + ],
1897 + ]
1898 + );
1899 +
1900 + }
1901 +
1902 + if($item['key'] =='field_tree') {
1903 +
1904 + $this->add_control(
1905 + 'styles_field_tree_pl_hr',
1906 + [
1907 + 'type' => \Elementor\Controls_Manager::DIVIDER,
1908 + ]
1909 + );
1910 +
1911 + $this->add_control(
1912 + 'styles_field_tree_pl_header',
1913 + [
1914 + 'label' => __( 'Placeholder', 'wpdirectorykit' ),
1915 + 'type' => Controls_Manager::HEADING,
1916 + ]
1917 + );
1918 +
1919 +
1920 + $this->add_control(
1921 + 'styles_field_tree_pl_hr2',
1922 + [
1923 + 'type' => \Elementor\Controls_Manager::DIVIDER,
1924 + ]
1925 + );
1926 +
1927 + $selectors = array(
1928 + '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',
1929 + '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',
1930 + );
1931 +
1932 + $this->generate_renders_tabs($selectors, 'styles_field_tree_pl_list_dynamic', ['align','typo','color']);
1933 +
1934 + $this->add_control(
1935 + 'styles_field_text_tree_pl_hr',
1936 + [
1937 + 'type' => \Elementor\Controls_Manager::DIVIDER,
1938 + ]
1939 + );
1940 +
1941 + $this->add_control(
1942 + 'styles_field_text_tree_pl_header',
1943 + [
1944 + 'label' => __( 'Text field', 'wpdirectorykit' ),
1945 + 'type' => Controls_Manager::HEADING,
1946 + ]
1947 + );
1948 +
1949 +
1950 + $this->add_control(
1951 + 'styles_field_text_tree_pl_hr2',
1952 + [
1953 + 'type' => \Elementor\Controls_Manager::DIVIDER,
1954 + ]
1955 + );
1956 +
1957 + $selectors = array(
1958 + 'normal' => '{{WRAPPER}} .wdk_dropdown_tree .btn-group button, {{WRAPPER}} .wdk-field.CATEGORY .select2 .select2-search__field,{{WRAPPER}} .wdk-field.LOCATION .select2 .select2-search__field',
1959 + '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',
1960 + );
1961 +
1962 + $this->generate_renders_tabs($selectors, 'styles_field_text_tree_pl_list_dynamic', ['typo','color']);
1963 +
1964 +
1965 + $this->add_control(
1966 + 'styles_field_tree_hr',
1967 + [
1968 + 'type' => \Elementor\Controls_Manager::DIVIDER,
1969 + ]
1970 + );
1971 +
1972 + $this->add_control(
1973 + 'styles_field_tree_header',
1974 + [
1975 + 'label' => __( 'List Items', 'wpdirectorykit' ),
1976 + 'type' => Controls_Manager::HEADING,
1977 + ]
1978 + );
1979 +
1980 +
1981 + $this->add_control(
1982 + 'styles_field_tree_hr2',
1983 + [
1984 + 'type' => \Elementor\Controls_Manager::DIVIDER,
1985 + ]
1986 + );
1987 +
1988 + $selectors = array(
1989 + 'normal' => '{{WRAPPER}} .wdk_dropdown_tree .list_scroll ul li, .select_multi_dropdown_tree .select2-dropdown .select2-results__options .select2-results__option',
1990 + 'hover'=>'{{WRAPPER}} .wdk_dropdown_tree .list_scroll ul li, .select_multi_dropdown_tree .select2-dropdown .select2-results__options .select2-results__option%1$s',
1991 + );
1992 +
1993 + $this->generate_renders_tabs($selectors, 'styles_field_tree_list_dynamic', ['margin','align','typo','color','background','border','padding','transition']);
1994 +
1995 + if(wdk_get_option('wdk_multi_categories_search_field_type')=='select2' || wdk_get_option('wdk_multi_locations_search_field_type')=='select2' ) {
1996 + $this->add_control(
1997 + 'styles_field_tree_items_hr',
1080 1998 [
1081 - 'label' => esc_html__( 'Hide Element', 'wpdirectorykit' ),
1082 - 'type' => Controls_Manager::SWITCHER,
1083 - 'none' => esc_html__( 'Hide', 'wpdirectorykit' ),
1084 - 'block' => esc_html__( 'Show', 'wpdirectorykit' ),
1085 - 'return_value' => 'none',
1086 - 'default' => '',
1087 - 'selectors' => [
1088 - '{{WRAPPER}} '.$item['selector'] => 'display: {{VALUE}};',
1089 - ],
1999 + 'type' => \Elementor\Controls_Manager::DIVIDER,
1090 2000 ]
2001 + );
2002 +
2003 + $this->add_control(
2004 + 'styles_field_tree_items_header',
2005 + [
2006 + 'label' => __( 'Multi Items for Multiple Dropdowns', 'wpdirectorykit' ),
2007 + 'type' => Controls_Manager::HEADING,
2008 + ]
2009 + );
2010 +
2011 +
2012 + $this->add_control(
2013 + 'styles_field_tree_items_hr2',
2014 + [
2015 + 'type' => \Elementor\Controls_Manager::DIVIDER,
2016 + ]
2017 + );
2018 +
2019 + $selectors = array(
2020 + 'normal' => '{{WRAPPER}} .wdk-field.CATEGORY .select2 .select2-selection__choice, {{WRAPPER}} .wdk-field.LOCATION .select2 .select2-selection__choice',
2021 + 'hover'=>'{{WRAPPER}} .wdk-field.CATEGORY .select2 .select2-selection__choice%1$s, {{WRAPPER}} .wdk-field.LOCATION .select2 .select2-selection__choice%1$s',
2022 + );
2023 +
2024 + $this->generate_renders_tabs($selectors, 'styles_field_tree_list_items_dynamic', ['margin','typo','color','background','border','border_radius','padding','transition']);
2025 + }
2026 + }
2027 +
2028 + if($item['key'] =='field_select2') {
2029 +
2030 + $this->add_control(
2031 + 'styles_field_select2_pl_hr',
2032 + [
2033 + 'type' => \Elementor\Controls_Manager::DIVIDER,
2034 + ]
1091 2035 );
1092 - $selectors = array(
1093 - 'normal' => '{{WRAPPER}} '.$item['selector'],
1094 - 'hover'=>'{{WRAPPER}} '.$item['selector'].'%1$s'
1095 - );
2036 +
2037 + $this->add_control(
2038 + 'styles_field_select2_pl_header',
2039 + [
2040 + 'label' => __( 'Placeholder', 'wpdirectorykit' ),
2041 + 'type' => Controls_Manager::HEADING,
2042 + ]
2043 + );
2044 +
2045 +
2046 + $this->add_control(
2047 + 'styles_field_select2_pl_hr2',
2048 + [
2049 + 'type' => \Elementor\Controls_Manager::DIVIDER,
2050 + ]
2051 + );
2052 +
2053 + $selectors = array(
2054 + 'normal' => '{{WRAPPER}} .wdk-field.DROPDOWNMULTIPLE .select2 .select2-search__field::placeholder',
2055 + 'hover'=>'{{WRAPPER}} .wdk-field.DROPDOWNMULTIPLE .select2 .select2-search__field%1$s::placeholder',
2056 + );
2057 +
2058 + $this->generate_renders_tabs($selectors, 'styles_field_select2_pl_list_dynamic', ['align','typo','color']);
2059 +
2060 + $this->add_control(
2061 + 'styles_field_select2_hr',
2062 + [
2063 + 'type' => \Elementor\Controls_Manager::DIVIDER,
2064 + ]
2065 + );
2066 +
2067 + $this->add_control(
2068 + 'styles_field_select2_header',
2069 + [
2070 + 'label' => __( 'List Items', 'wpdirectorykit' ),
2071 + 'type' => Controls_Manager::HEADING,
2072 + ]
2073 + );
2074 +
2075 +
2076 + $this->add_control(
2077 + 'styles_field_select2_hr2',
2078 + [
2079 + 'type' => \Elementor\Controls_Manager::DIVIDER,
2080 + ]
2081 + );
2082 +
2083 +
2084 + $selectors = array(
2085 + 'normal' => '.select_multi_dropdown .select2-dropdown .select2-results__options .select2-results__option',
2086 + 'hover'=>'.select_multi_dropdown .select2-dropdown .select2-results__options .select2-results__option%1$s',
2087 + );
2088 +
2089 + $this->generate_renders_tabs($selectors, 'styles_field_select2_list_dynamic', ['margin','align','typo','color','background','border','padding','transition']);
2090 +
2091 + $this->add_control(
2092 + 'styles_field_select2_items_hr',
2093 + [
2094 + 'type' => \Elementor\Controls_Manager::DIVIDER,
2095 + ]
2096 + );
2097 +
2098 + $this->add_control(
2099 + 'styles_field_select2_items_header',
2100 + [
2101 + 'label' => __( 'Multi Items', 'wpdirectorykit' ),
2102 + 'type' => Controls_Manager::HEADING,
2103 + ]
2104 + );
2105 +
2106 +
2107 + $this->add_control(
2108 + 'styles_field_select2_items_hr2',
2109 + [
2110 + 'type' => \Elementor\Controls_Manager::DIVIDER,
2111 + ]
2112 + );
1096 2113
1097 - if(isset($item['focus'])) {
1098 - $selectors['focus'] = '{{WRAPPER}} '.$item['focus'];
2114 + $selectors = array(
2115 + 'normal' => '{{WRAPPER}} .wdk-field.DROPDOWNMULTIPLE .select2 .select2-selection__choice',
2116 + 'hover'=>'{{WRAPPER}} .wdk-field.DROPDOWNMULTIPLE .select2 .select2-selection__choice%1$s',
2117 + );
2118 +
2119 + $this->generate_renders_tabs($selectors, 'styles_field_select2_list_items_dynamic', ['margin','typo','color','background','border','border_radius','padding','transition']);
2120 +
1099 2121 }
1100 2122
1101 - $this->generate_renders_tabs($selectors, $item['key'].'_dynamic', $item['options']);
1102 -
1103 2123 $this->end_controls_section();
1104 2124 /* END special for some elements */
1105 2125
1106 2126 }
@@ -1111,10 +2131,32 @@
1111 2131 }
1112 2132
1113 2133 public function enqueue_styles_scripts() {
1114 2134 wp_enqueue_style('slick');
2135 + wp_enqueue_style('wdk-suggestion');
1115 2136 wp_enqueue_style('slick-theme');
1116 2137 wp_enqueue_script('slick');
1117 2138 wp_enqueue_script('wdk-treefield');
2139 + wp_enqueue_script('wdk-suggestion');
1118 2140 wp_enqueue_style('wdk-treefield');
2141 +
2142 +
2143 + wp_enqueue_script('select2-select2');
2144 + wp_enqueue_script('wdk-select2');
2145 + wp_enqueue_style('select2-select2');
2146 +
2147 + wp_enqueue_script( 'ion.range-slider' );
2148 + wp_enqueue_style('ion.range-slider');
2149 + wp_enqueue_style('wdk-slider-range');
2150 + wp_enqueue_script('wdk-slider-range');
2151 +
2152 + wp_enqueue_style('jquery-confirm');
2153 + wp_enqueue_script('jquery-confirm');
2154 +
2155 + wp_enqueue_style( 'wdk-treefield-checkboxes');
2156 + wp_enqueue_script( 'wdk-treefield-checkboxes');
2157 +
2158 + if( wdk_get_option('wdk_experimental_features') && wdk_get_option('wdk_experimental_ajax_results')) {
2159 + wp_enqueue_script( 'wdk-ajax-loading-listings');
2160 + }
1119 2161 }
1120 2162 }