form.php
3851 lines
| 1 | <?php |
| 2 | |
| 3 | |
| 4 | namespace JFB_Compatibility\Elementor\Widgets; |
| 5 | |
| 6 | use Elementor\Controls_Manager; |
| 7 | use Elementor\Group_Control_Border; |
| 8 | use Elementor\Group_Control_Box_Shadow; |
| 9 | use Elementor\Group_Control_Typography; |
| 10 | use Elementor\Widget_Base; |
| 11 | use Jet_Form_Builder\Admin\Tabs_Handlers\Tab_Handler_Manager; |
| 12 | use Jet_Form_Builder\Blocks\Modules\General_Style_Functions; |
| 13 | use Jet_Form_Builder\Classes\Arguments\Form_Arguments; |
| 14 | use Jet_Form_Builder\Classes\Tools; |
| 15 | |
| 16 | // If this file is called directly, abort. |
| 17 | if ( ! defined( 'WPINC' ) ) { |
| 18 | die; |
| 19 | } |
| 20 | |
| 21 | class Form extends Widget_Base implements Widget_Base_It { |
| 22 | |
| 23 | use General_Style_Functions; |
| 24 | |
| 25 | public function init_hooks() { |
| 26 | add_filter( |
| 27 | 'jet-engine/booking-form/combine-selector', |
| 28 | array( $this, 'combine_selector' ), |
| 29 | 10, |
| 30 | 3 |
| 31 | ); |
| 32 | |
| 33 | add_filter( |
| 34 | 'jet-engine/forms/pre-render-form', |
| 35 | array( $this, 'booking_form_render' ), |
| 36 | 10, |
| 37 | 2 |
| 38 | ); |
| 39 | |
| 40 | add_action( |
| 41 | 'elementor/element/jet-engine-booking-form/section_general/after_section_start', |
| 42 | array( $this, 'after_general_section_start' ), |
| 43 | 10, |
| 44 | 2 |
| 45 | ); |
| 46 | |
| 47 | add_action( |
| 48 | 'elementor/element/jet-engine-booking-form/section_general/before_section_end', |
| 49 | array( $this, 'update_general_form_controls' ), |
| 50 | 10, |
| 51 | 2 |
| 52 | ); |
| 53 | |
| 54 | add_action( |
| 55 | 'elementor/element/jet-engine-booking-form/section_range_fields_style/before_section_end', |
| 56 | array( $this, 'update_section_range_fields_style' ), |
| 57 | 10, |
| 58 | 2 |
| 59 | ); |
| 60 | |
| 61 | add_action( |
| 62 | 'elementor/element/jet-engine-booking-form/form_submit_style/before_section_end', |
| 63 | array( $this, 'update_form_submit_style' ), |
| 64 | 10, |
| 65 | 2 |
| 66 | ); |
| 67 | |
| 68 | add_action( |
| 69 | 'elementor/element/jet-engine-booking-form/section_rows_style/before_section_end', |
| 70 | array( $this, 'update_section_rows_style' ), |
| 71 | 10, |
| 72 | 2 |
| 73 | ); |
| 74 | |
| 75 | add_action( |
| 76 | 'elementor/element/jet-engine-booking-form/section_fields_style/before_section_end', |
| 77 | array( $this, 'update_section_fields_style' ), |
| 78 | 10, |
| 79 | 2 |
| 80 | ); |
| 81 | |
| 82 | add_action( |
| 83 | 'elementor/element/jet-engine-booking-form/section_checkradio_fields_style/before_section_end', |
| 84 | array( $this, 'update_section_checkradio_fields_style' ), |
| 85 | 10, |
| 86 | 2 |
| 87 | ); |
| 88 | add_action( |
| 89 | 'elementor/element/jet-engine-booking-form/section_checkradio_fields_style/after_section_end', |
| 90 | array( $this, 'after_section_checkradio_fields_style' ), |
| 91 | 10, |
| 92 | 2 |
| 93 | ); |
| 94 | // form_prev_page_style |
| 95 | add_action( |
| 96 | 'elementor/element/jet-engine-booking-form/form_prev_page_style/after_section_end', |
| 97 | array( $this, 'after_form_prev_page_style' ), |
| 98 | 10, |
| 99 | 2 |
| 100 | ); |
| 101 | } |
| 102 | |
| 103 | |
| 104 | /** |
| 105 | * @return string |
| 106 | */ |
| 107 | public function get_name() { |
| 108 | return 'jet-form-builder-form'; |
| 109 | } |
| 110 | |
| 111 | public function get_title() { |
| 112 | return __( 'JetForm', 'jet-form-builder' ); |
| 113 | } |
| 114 | |
| 115 | public function get_icon() { |
| 116 | return 'jet-form-builder-icon--form'; |
| 117 | } |
| 118 | |
| 119 | public function get_categories() { |
| 120 | return array( 'jet-form-builder' ); |
| 121 | } |
| 122 | |
| 123 | public function get_style_depends() { |
| 124 | return array( 'jet-form-builder-frontend' ); |
| 125 | } |
| 126 | |
| 127 | private function jet_form_builder_slug() { |
| 128 | return jet_form_builder()->post_type->slug(); |
| 129 | } |
| 130 | |
| 131 | private function jet_engine_form_slug() { |
| 132 | return jet_engine()->forms->slug(); |
| 133 | } |
| 134 | |
| 135 | public function combine_selector( $additional, $engine_selector, $control_id ) { |
| 136 | if ( ! $control_id ) { |
| 137 | return $this->selector( $engine_selector ); |
| 138 | } |
| 139 | |
| 140 | switch ( $control_id ) { |
| 141 | case 'labels_v_alignment': |
| 142 | return $this->selector( '-row' ); |
| 143 | case 'fields_background_color': |
| 144 | return $this->selector( '__field:not(.checkradio-field):not(.range-field):not(.%s-repeater)' ); |
| 145 | case 'field_messages_font_size': |
| 146 | case 'field_messages_color': |
| 147 | case 'field_messages_margin': |
| 148 | case 'field_messages_alignment': |
| 149 | return $this->selector( '-file-upload__errors' ); |
| 150 | } |
| 151 | |
| 152 | return ''; |
| 153 | } |
| 154 | |
| 155 | |
| 156 | public function after_general_section_start( $element, $args ) { |
| 157 | $element->add_control( |
| 158 | 'form_provider', |
| 159 | array( |
| 160 | 'label' => __( 'Choose Provider', 'jet-form-builder' ), |
| 161 | 'type' => Controls_Manager::SELECT, |
| 162 | 'options' => array( |
| 163 | $this->jet_form_builder_slug() => __( 'JetFormBuilder', 'jet-form-builder' ), |
| 164 | $this->jet_engine_form_slug() => __( 'JetEngine', 'jet-form-builder' ), |
| 165 | ), |
| 166 | 'default' => $this->jet_engine_form_slug(), |
| 167 | ) |
| 168 | ); |
| 169 | |
| 170 | $element->add_control( |
| 171 | 'form_id', |
| 172 | array( |
| 173 | 'label' => __( 'Select JetForm', 'jet-form-builder' ), |
| 174 | 'type' => 'jet-query', |
| 175 | 'query_type' => 'post', |
| 176 | 'query' => array( |
| 177 | 'post_type' => $this->jet_form_builder_slug(), |
| 178 | ), |
| 179 | 'condition' => array( 'form_provider' => $this->jet_form_builder_slug() ), |
| 180 | ) |
| 181 | ); |
| 182 | } |
| 183 | |
| 184 | public function update_general_form_controls( $element, $args ) { |
| 185 | $element->update_control( |
| 186 | '_form_id', |
| 187 | array( |
| 188 | 'condition' => array( 'form_provider' => $this->jet_engine_form_slug() ), |
| 189 | ) |
| 190 | ); |
| 191 | $element->update_control( |
| 192 | 'fields_label_tag', |
| 193 | array( |
| 194 | 'condition' => array( 'form_provider' => $this->jet_engine_form_slug() ), |
| 195 | ) |
| 196 | ); |
| 197 | $element->update_control( |
| 198 | 'cache_form', |
| 199 | array( |
| 200 | 'condition' => array( 'form_provider' => $this->jet_engine_form_slug() ), |
| 201 | ) |
| 202 | ); |
| 203 | $element->add_control( |
| 204 | 'enable_progress', |
| 205 | array( |
| 206 | 'label' => __( 'Enable form pages progress', 'jet-form-builder' ), |
| 207 | 'type' => Controls_Manager::SWITCHER, |
| 208 | 'condition' => array( 'form_provider' => $this->jet_form_builder_slug() ), |
| 209 | ) |
| 210 | ); |
| 211 | } |
| 212 | |
| 213 | public function update_section_rows_style( $element, $args ) { |
| 214 | $element->update_control( |
| 215 | 'rows_divider', |
| 216 | array( |
| 217 | 'condition' => array( 'form_provider' => $this->jet_engine_form_slug() ), |
| 218 | ) |
| 219 | ); |
| 220 | $element->update_control( |
| 221 | 'rows_divider_height', |
| 222 | array( |
| 223 | 'condition' => array( 'form_provider' => $this->jet_engine_form_slug() ), |
| 224 | ), |
| 225 | array( 'recursive' => true ) |
| 226 | ); |
| 227 | $element->update_control( |
| 228 | 'rows_divider_color', |
| 229 | array( |
| 230 | 'condition' => array( 'form_provider' => $this->jet_engine_form_slug() ), |
| 231 | ), |
| 232 | array( 'recursive' => true ) |
| 233 | ); |
| 234 | $element->update_control( |
| 235 | 'cols_gap', |
| 236 | array( |
| 237 | 'selectors' => array( |
| 238 | $this->selector( ' .wp-block-column:not(:first-child)' ) => 'margin-left: {{SIZE}}{{UNIT}};', |
| 239 | ), |
| 240 | ), |
| 241 | array( 'recursive' => true ) |
| 242 | ); |
| 243 | } |
| 244 | |
| 245 | public function update_section_fields_style( $element, $args ) { |
| 246 | $element->update_control( |
| 247 | 'fields_placeholder_color', |
| 248 | array( |
| 249 | 'selectors' => array( |
| 250 | $this->selector( ' ::-webkit-input-placeholder' ) => 'color: {{VALUE}};', |
| 251 | $this->selector( ' ::-ms-input-placeholder' ) => 'color: {{VALUE}};', |
| 252 | $this->selector( ' ::-moz-placeholder' ) => 'color: {{VALUE}};', |
| 253 | $this->selector( ' :-moz-placeholder' ) => 'color: {{VALUE}};', |
| 254 | ), |
| 255 | ), |
| 256 | array( 'recursive' => true ) |
| 257 | ); |
| 258 | } |
| 259 | |
| 260 | public function update_section_checkradio_fields_style( $element, $args ) { |
| 261 | $element->update_control( |
| 262 | 'checkradio_fields_gap', |
| 263 | array( |
| 264 | 'selectors' => array( |
| 265 | 'body:not(.rtl) ' . $this->selector( '__field-wrap.checkradio-wrap span::before' ) => 'margin-right: {{SIZE}}{{UNIT}};', |
| 266 | 'body.rtl ' . $this->selector( '__field-wrap.checkradio-wrap span::before' ) => 'margin-left: {{SIZE}}{{UNIT}};', |
| 267 | ), |
| 268 | ), |
| 269 | array( 'recursive' => true ) |
| 270 | ); |
| 271 | } |
| 272 | |
| 273 | public function after_section_checkradio_fields_style( $booking_form, $args ) { |
| 274 | $booking_form->start_controls_section( |
| 275 | 'builder__checkbox_field_style_section', |
| 276 | $this->on_fb( |
| 277 | array( |
| 278 | 'label' => __( 'JetForm Checkbox', 'jet-form-builder' ), |
| 279 | 'tab' => Controls_Manager::TAB_STYLE, |
| 280 | ) |
| 281 | ) |
| 282 | ); |
| 283 | |
| 284 | $booking_form->add_control( |
| 285 | 'builder__checkbox_show_decorator', |
| 286 | array( |
| 287 | 'label' => __( 'Show Checkbox', 'jet-form-builder' ), |
| 288 | 'type' => Controls_Manager::CHOOSE, |
| 289 | 'options' => array( |
| 290 | 'inline-block' => array( |
| 291 | 'title' => __( 'Yes', 'jet-form-builder' ), |
| 292 | 'icon' => 'fa fa-check', |
| 293 | ), |
| 294 | 'none' => array( |
| 295 | 'title' => __( 'No', 'jet-form-builder' ), |
| 296 | 'icon' => 'fa fa-times', |
| 297 | ), |
| 298 | ), |
| 299 | 'default' => 'inline-block', |
| 300 | 'selectors' => array( |
| 301 | $this->selector( '__field-wrap .for-checkbox span::before' ) => 'display:{{VALUE}};', |
| 302 | ), |
| 303 | ) |
| 304 | ); |
| 305 | |
| 306 | $booking_form->add_responsive_control( |
| 307 | 'builder__checkbox_size', |
| 308 | array( |
| 309 | 'label' => __( 'Checkbox Size', 'jet-form-builder' ), |
| 310 | 'type' => Controls_Manager::SLIDER, |
| 311 | 'size_units' => array( 'px', 'em', 'rem', 'custom' ), |
| 312 | 'range' => array( |
| 313 | 'px' => array( |
| 314 | 'min' => 0, |
| 315 | 'max' => 50, |
| 316 | ), |
| 317 | ), |
| 318 | 'selectors' => array( |
| 319 | $this->selector( '__field-wrap .for-checkbox span::before' ) => 'font-size: {{SIZE}}{{UNIT}};', |
| 320 | ), |
| 321 | 'condition' => array( |
| 322 | 'builder__checkbox_show_decorator' => 'inline-block', |
| 323 | ), |
| 324 | ) |
| 325 | ); |
| 326 | |
| 327 | $booking_form->start_controls_tabs( 'builder__checkbox_state_styles' ); |
| 328 | |
| 329 | $booking_form->start_controls_tab( |
| 330 | 'builder__checkbox_state--normal', |
| 331 | array( |
| 332 | 'label' => esc_html__( 'Normal', 'jet-form-builder' ), |
| 333 | ) |
| 334 | ); |
| 335 | $this->add_border( |
| 336 | $booking_form, |
| 337 | 'builder__checkbox_state--normal__border', |
| 338 | $this->selector( '__field-wrap .for-checkbox span::before' ) |
| 339 | ); |
| 340 | |
| 341 | $booking_form->add_control( |
| 342 | 'builder__checkbox_state--normal__bg_color', |
| 343 | array( |
| 344 | 'label' => __( 'Background Color', 'jet-form-builder' ), |
| 345 | 'type' => Controls_Manager::COLOR, |
| 346 | 'selectors' => array( |
| 347 | $this->selector( '__field-wrap .for-checkbox span::before' ) => 'background-color: {{VALUE}}', |
| 348 | ), |
| 349 | ) |
| 350 | ); |
| 351 | |
| 352 | $booking_form->end_controls_tab(); |
| 353 | |
| 354 | $booking_form->start_controls_tab( |
| 355 | 'builder__checkbox_state--checked', |
| 356 | array( |
| 357 | 'label' => esc_html__( 'Checked', 'jet-form-builder' ), |
| 358 | ) |
| 359 | ); |
| 360 | |
| 361 | $this->add_border( |
| 362 | $booking_form, |
| 363 | 'builder__checkbox_state--checked__border', |
| 364 | $this->selector( '__field-wrap label.for-checkbox :checked + span::before' ) |
| 365 | ); |
| 366 | $booking_form->add_control( |
| 367 | 'builder__checkbox_state--checked__bg_color', |
| 368 | array( |
| 369 | 'label' => __( 'Background Color', 'jet-form-builder' ), |
| 370 | 'type' => Controls_Manager::COLOR, |
| 371 | 'selectors' => array( |
| 372 | $this->selector( '__field-wrap label.for-checkbox :checked + span::before' ) => 'background-color: {{VALUE}}', |
| 373 | ), |
| 374 | ) |
| 375 | ); |
| 376 | |
| 377 | $booking_form->end_controls_tab(); |
| 378 | $booking_form->end_controls_tabs(); |
| 379 | $booking_form->end_controls_section(); |
| 380 | |
| 381 | $booking_form->start_controls_section( |
| 382 | 'builder__radio_field_style_section', |
| 383 | $this->on_fb( |
| 384 | array( |
| 385 | 'label' => __( 'JetForm Radio', 'jet-form-builder' ), |
| 386 | 'tab' => Controls_Manager::TAB_STYLE, |
| 387 | ) |
| 388 | ) |
| 389 | ); |
| 390 | $booking_form->add_control( |
| 391 | 'builder__radio_show_decorator', |
| 392 | array( |
| 393 | 'label' => __( 'Show Radio', 'jet-form-builder' ), |
| 394 | 'type' => Controls_Manager::CHOOSE, |
| 395 | 'default' => 'inline-block', |
| 396 | 'options' => array( |
| 397 | 'inline-block' => array( |
| 398 | 'title' => __( 'Yes', 'jet-form-builder' ), |
| 399 | 'icon' => 'fa fa-check', |
| 400 | ), |
| 401 | 'none' => array( |
| 402 | 'title' => __( 'No', 'jet-form-builder' ), |
| 403 | 'icon' => 'fa fa-times', |
| 404 | ), |
| 405 | ), |
| 406 | 'selectors' => array( |
| 407 | $this->selector( '__field-wrap .for-radio span::before' ) => 'display:{{VALUE}};', |
| 408 | ), |
| 409 | ) |
| 410 | ); |
| 411 | |
| 412 | $booking_form->add_responsive_control( |
| 413 | 'builder__radio_size', |
| 414 | array( |
| 415 | 'label' => __( 'Radio Size', 'jet-form-builder' ), |
| 416 | 'type' => Controls_Manager::SLIDER, |
| 417 | 'size_units' => array( 'px', 'em', 'rem', 'custom' ), |
| 418 | 'range' => array( |
| 419 | 'px' => array( |
| 420 | 'min' => 0, |
| 421 | 'max' => 50, |
| 422 | ), |
| 423 | ), |
| 424 | 'selectors' => array( |
| 425 | $this->selector( '__field-wrap .for-radio span::before' ) => 'font-size: {{SIZE}}{{UNIT}};', |
| 426 | ), |
| 427 | 'condition' => array( |
| 428 | 'builder__radio_show_decorator' => 'inline-block', |
| 429 | ), |
| 430 | ) |
| 431 | ); |
| 432 | |
| 433 | $booking_form->start_controls_tabs( 'builder__radio_state_styles' ); |
| 434 | |
| 435 | $booking_form->start_controls_tab( |
| 436 | 'builder__radio_state--normal', |
| 437 | array( |
| 438 | 'label' => esc_html__( 'Normal', 'jet-form-builder' ), |
| 439 | ) |
| 440 | ); |
| 441 | $this->add_border( |
| 442 | $booking_form, |
| 443 | 'builder__radio_state--normal__border', |
| 444 | $this->selector( '__field-wrap .for-radio span::before' ) |
| 445 | ); |
| 446 | $booking_form->add_control( |
| 447 | 'builder__radio_state--normal__bg_color', |
| 448 | array( |
| 449 | 'label' => __( 'Background Color', 'jet-form-builder' ), |
| 450 | 'type' => Controls_Manager::COLOR, |
| 451 | 'selectors' => array( |
| 452 | $this->selector( '__field-wrap .for-radio span::before' ) => 'background-color: {{VALUE}}', |
| 453 | ), |
| 454 | ) |
| 455 | ); |
| 456 | |
| 457 | $booking_form->end_controls_tab(); |
| 458 | |
| 459 | $booking_form->start_controls_tab( |
| 460 | 'builder__radio_state--checked', |
| 461 | array( |
| 462 | 'label' => esc_html__( 'Checked', 'jet-form-builder' ), |
| 463 | ) |
| 464 | ); |
| 465 | $this->add_border( |
| 466 | $booking_form, |
| 467 | 'builder__radio_state--checked__border', |
| 468 | $this->selector( '__field-wrap label.for-radio :checked + span::before' ) |
| 469 | ); |
| 470 | $booking_form->add_control( |
| 471 | 'builder__radio_state--checked__bg_color', |
| 472 | array( |
| 473 | 'label' => __( 'Background Color', 'jet-form-builder' ), |
| 474 | 'type' => Controls_Manager::COLOR, |
| 475 | 'selectors' => array( |
| 476 | $this->selector( '__field-wrap label.for-radio :checked + span::before' ) => 'background-color: {{VALUE}}', |
| 477 | ), |
| 478 | ) |
| 479 | ); |
| 480 | |
| 481 | $booking_form->end_controls_tab(); |
| 482 | $booking_form->end_controls_tabs(); |
| 483 | $booking_form->end_controls_section(); |
| 484 | } |
| 485 | |
| 486 | public function after_form_prev_page_style( $element, $args ) { |
| 487 | $this->run_form_progress_controls( |
| 488 | $element, |
| 489 | array( $this, 'selector' ), |
| 490 | array( $this, 'on_fb' ) |
| 491 | ); |
| 492 | } |
| 493 | |
| 494 | public function update_section_range_fields_style( $element, $args ) { |
| 495 | $range_obj = jet_form_builder()->blocks->get_field_by_name( 'range-field' ); |
| 496 | |
| 497 | $element->update_control( |
| 498 | 'track_height', |
| 499 | array( |
| 500 | 'selectors' => array( |
| 501 | $this->selector() => $range_obj::CSS_VAR_RANGE_HEIGHT . ': {{SIZE}}{{UNIT}};', |
| 502 | ), |
| 503 | ), |
| 504 | array( 'recursive' => true ) |
| 505 | ); |
| 506 | $element->update_control( |
| 507 | 'thumb_size', |
| 508 | array( |
| 509 | 'selectors' => array( |
| 510 | $this->selector() => $range_obj::CSS_VAR_SLIDER_SIZE . ': {{SIZE}}{{UNIT}};', |
| 511 | ), |
| 512 | ), |
| 513 | array( 'recursive' => true ) |
| 514 | ); |
| 515 | |
| 516 | $element->update_control( |
| 517 | 'track_border_radius', |
| 518 | array( |
| 519 | 'selectors' => array( |
| 520 | $this->selector( '__field.range-field::-webkit-slider-runnable-track' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 521 | $this->selector( '__field.range-field::-moz-range-track' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 522 | $this->selector( '__field.range-field::-ms-track' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 523 | ), |
| 524 | ), |
| 525 | array( 'recursive' => true ) |
| 526 | ); |
| 527 | $element->update_control( |
| 528 | 'thumb_border_radius', |
| 529 | array( |
| 530 | 'selectors' => array( |
| 531 | $this->selector( '__field.range-field::-webkit-slider-thumb' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 532 | $this->selector( '__field.range-field::-moz-range-thumb' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 533 | $this->selector( '__field.range-field::-ms-thumb' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 534 | ), |
| 535 | ), |
| 536 | array( 'recursive' => true ) |
| 537 | ); |
| 538 | |
| 539 | $element->update_control( |
| 540 | 'track_bg_color', |
| 541 | array( |
| 542 | 'selectors' => array( |
| 543 | $this->selector( '__field.range-field::-webkit-slider-runnable-track' ) => 'background-color: {{VALUE}};', |
| 544 | $this->selector( '__field.range-field::-moz-range-track' ) => 'background-color: {{VALUE}};', |
| 545 | $this->selector( '__field.range-field::-ms-track' ) => 'background-color: {{VALUE}};', |
| 546 | ), |
| 547 | ), |
| 548 | array( 'recursive' => true ) |
| 549 | ); |
| 550 | $element->update_control( |
| 551 | 'thumb_bg_color', |
| 552 | array( |
| 553 | 'selectors' => array( |
| 554 | $this->selector( '__field.range-field::-webkit-slider-thumb' ) => 'background-color: {{VALUE}};', |
| 555 | $this->selector( '__field.range-field::-moz-range-thumb' ) => 'background-color: {{VALUE}};', |
| 556 | $this->selector( '__field.range-field::-ms-thumb' ) => 'background-color: {{VALUE}};', |
| 557 | ), |
| 558 | ), |
| 559 | array( 'recursive' => true ) |
| 560 | ); |
| 561 | } |
| 562 | |
| 563 | public function update_form_submit_style( $element, $args ) { |
| 564 | $element->update_control( |
| 565 | 'booking_form_submit_alignment', |
| 566 | array( |
| 567 | 'selectors' => array( |
| 568 | $this->selector( '__submit' ) => 'justify-content: center;', |
| 569 | ), |
| 570 | ), |
| 571 | array( 'recursive' => true ) |
| 572 | ); |
| 573 | } |
| 574 | |
| 575 | |
| 576 | private function on_fb( $args ) { |
| 577 | return array_merge( |
| 578 | $args, |
| 579 | array( |
| 580 | 'condition' => array( |
| 581 | 'form_provider' => jet_form_builder()->post_type->slug(), |
| 582 | ), |
| 583 | ) |
| 584 | ); |
| 585 | } |
| 586 | |
| 587 | public function on_jet_engine( $args ) { |
| 588 | return array_merge_recursive( |
| 589 | $args, |
| 590 | array( |
| 591 | 'condition' => array( |
| 592 | 'form_provider' => jet_engine()->forms->slug(), |
| 593 | ), |
| 594 | ) |
| 595 | ); |
| 596 | } |
| 597 | |
| 598 | |
| 599 | public function run_form_progress_controls( $instance, $selector_callable, $add_section_condition ) { |
| 600 | $instance->start_controls_section( |
| 601 | 'jet_fb_progress_wrapper_section', |
| 602 | $add_section_condition( |
| 603 | array( |
| 604 | 'label' => __( 'Form Progress - Wrapper', 'jet-form-builder' ), |
| 605 | 'tab' => Controls_Manager::TAB_STYLE, |
| 606 | ) |
| 607 | ) |
| 608 | ); |
| 609 | $instance->add_responsive_control( |
| 610 | 'jet_fb_progress_wrapper_margin', |
| 611 | array( |
| 612 | 'label' => __( 'Margin', 'jet-form-builder' ), |
| 613 | 'type' => Controls_Manager::DIMENSIONS, |
| 614 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 615 | 'selectors' => array( |
| 616 | $selector_callable( '-progress-pages' ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 617 | ), |
| 618 | ) |
| 619 | ); |
| 620 | $instance->add_responsive_control( |
| 621 | 'jet_fb_progress_wrapper_padding', |
| 622 | array( |
| 623 | 'label' => __( 'Padding', 'jet-form-builder' ), |
| 624 | 'type' => Controls_Manager::DIMENSIONS, |
| 625 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 626 | 'selectors' => array( |
| 627 | $selector_callable( '-progress-pages' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 628 | ), |
| 629 | ) |
| 630 | ); |
| 631 | $instance->add_group_control( |
| 632 | Group_Control_Typography::get_type(), |
| 633 | array( |
| 634 | 'name' => 'jet_fb_progress_wrapper_typography', |
| 635 | 'selector' => $selector_callable( '-progress-pages' ), |
| 636 | ) |
| 637 | ); |
| 638 | $this->add_border( |
| 639 | $instance, |
| 640 | 'jet_fb_progress_wrapper_border', |
| 641 | $selector_callable( '-progress-pages' ) |
| 642 | ); |
| 643 | $instance->add_control( |
| 644 | 'jet_fb_progress_wrapper_color', |
| 645 | array( |
| 646 | 'label' => __( 'Text Color', 'jet-form-builder' ), |
| 647 | 'type' => Controls_Manager::COLOR, |
| 648 | 'selectors' => array( |
| 649 | $selector_callable( '-progress-pages' ) => 'color: {{VALUE}}', |
| 650 | ), |
| 651 | ) |
| 652 | ); |
| 653 | $instance->add_control( |
| 654 | 'jet_fb_progress_wrapper_bg_color', |
| 655 | array( |
| 656 | 'label' => __( 'Background Color', 'jet-form-builder' ), |
| 657 | 'type' => Controls_Manager::COLOR, |
| 658 | 'selectors' => array( |
| 659 | $selector_callable( '-progress-pages' ) => 'background-color: {{VALUE}}', |
| 660 | ), |
| 661 | ) |
| 662 | ); |
| 663 | $instance->end_controls_section(); |
| 664 | |
| 665 | $instance->start_controls_section( |
| 666 | 'jet_fb_progress_pages_section', |
| 667 | $add_section_condition( |
| 668 | array( |
| 669 | 'label' => __( 'Form Progress - Pages', 'jet-form-builder' ), |
| 670 | 'tab' => Controls_Manager::TAB_STYLE, |
| 671 | ) |
| 672 | ) |
| 673 | ); |
| 674 | $instance->start_controls_tabs( 'jet_fb_progress_pages_tabs' ); |
| 675 | |
| 676 | $wrapper = '-progress-pages__item--wrapper'; |
| 677 | $item = '-progress-pages__item'; |
| 678 | |
| 679 | $scheme = array( |
| 680 | 'active-wrapper' => "$wrapper.active-page", |
| 681 | 'active-item' => "$wrapper.active-page .%s$item", |
| 682 | 'active-separator' => "$wrapper.active-page .%s-progress-pages__separator", |
| 683 | 'active-circle' => "$wrapper.active-page .%s$item--circle", |
| 684 | |
| 685 | 'next-wrapper' => "$wrapper:not(.passed-page):not(.active-page)", |
| 686 | 'next-item' => "$wrapper:not(.passed-page):not(.active-page) .%s$item", |
| 687 | 'next-separator' => "$wrapper:not(.passed-page):not(.active-page) .%s-progress-pages__separator", |
| 688 | 'next-circle' => "$wrapper:not(.passed-page):not(.active-page) .%s$item--circle", |
| 689 | |
| 690 | 'prev-wrapper' => "$wrapper.passed-page", |
| 691 | 'prev-item' => "$wrapper.passed-page .%s$item", |
| 692 | 'prev-separator' => "$wrapper.passed-page .%s-progress-pages__separator", |
| 693 | 'prev-circle' => "$wrapper.passed-page .%s$item--circle", |
| 694 | ); |
| 695 | |
| 696 | $instance->start_controls_tab( |
| 697 | 'jet_fb_progress_pages_tab--current', |
| 698 | array( |
| 699 | 'label' => esc_html__( 'Current', 'jet-form-builder' ), |
| 700 | ) |
| 701 | ); |
| 702 | $instance->add_responsive_control( |
| 703 | 'jet_fb_progress_pages_tab--current_padding', |
| 704 | array( |
| 705 | 'label' => __( 'Padding', 'jet-form-builder' ), |
| 706 | 'type' => Controls_Manager::DIMENSIONS, |
| 707 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 708 | 'selectors' => array( |
| 709 | $selector_callable( $scheme['active-item'] ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 710 | ), |
| 711 | ) |
| 712 | ); |
| 713 | $instance->add_responsive_control( |
| 714 | 'jet_fb_progress_pages_tab--current_margin', |
| 715 | array( |
| 716 | 'label' => __( 'Margin', 'jet-form-builder' ), |
| 717 | 'type' => Controls_Manager::DIMENSIONS, |
| 718 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 719 | 'selectors' => array( |
| 720 | $selector_callable( $scheme['active-item'] ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 721 | ), |
| 722 | ) |
| 723 | ); |
| 724 | $instance->add_group_control( |
| 725 | Group_Control_Typography::get_type(), |
| 726 | array( |
| 727 | 'name' => 'jet_fb_progress_pages_tab--current_typography', |
| 728 | 'selector' => $selector_callable( $scheme['active-item'] ), |
| 729 | ) |
| 730 | ); |
| 731 | $this->add_border( |
| 732 | $instance, |
| 733 | 'jet_fb_progress_pages_tab--current_item_border', |
| 734 | $selector_callable( $scheme['active-item'] ) |
| 735 | ); |
| 736 | $instance->add_control( |
| 737 | 'jet_fb_progress_pages_tab--current_color', |
| 738 | array( |
| 739 | 'label' => __( 'Text Color', 'jet-form-builder' ), |
| 740 | 'type' => Controls_Manager::COLOR, |
| 741 | 'selectors' => array( |
| 742 | $selector_callable( $scheme['active-item'] ) => 'color: {{VALUE}}', |
| 743 | ), |
| 744 | ) |
| 745 | ); |
| 746 | $instance->add_control( |
| 747 | 'jet_fb_progress_pages_tab--current_bg_color', |
| 748 | array( |
| 749 | 'label' => __( 'Background Color', 'jet-form-builder' ), |
| 750 | 'type' => Controls_Manager::COLOR, |
| 751 | 'selectors' => array( |
| 752 | $selector_callable( $scheme['active-item'] ) => 'background-color: {{VALUE}}', |
| 753 | ), |
| 754 | ) |
| 755 | ); |
| 756 | $instance->add_control( |
| 757 | 'jet_fb_separator_active_separator', |
| 758 | array( |
| 759 | 'label' => esc_html__( 'Separator', 'jet-form-builder' ), |
| 760 | 'type' => Controls_Manager::HEADING, |
| 761 | 'separator' => 'before', |
| 762 | ) |
| 763 | ); |
| 764 | $instance->add_responsive_control( |
| 765 | 'jet_fb_progress_pages_tab--current_separator_height', |
| 766 | array( |
| 767 | 'label' => __( 'Height', 'jet-form-builder' ), |
| 768 | 'type' => Controls_Manager::SLIDER, |
| 769 | 'size_units' => array( 'px', 'em', 'rem', 'custom' ), |
| 770 | 'range' => array( |
| 771 | 'px' => array( |
| 772 | 'min' => 1, |
| 773 | 'max' => 100, |
| 774 | ), |
| 775 | ), |
| 776 | 'selectors' => array( |
| 777 | $selector_callable( $scheme['active-separator'] ) => 'height: {{SIZE}}{{UNIT}}; min-height: {{SIZE}}{{UNIT}};', |
| 778 | ), |
| 779 | ) |
| 780 | ); |
| 781 | $instance->add_control( |
| 782 | 'jet_fb_progress_pages_tab--current_separator_color', |
| 783 | array( |
| 784 | 'label' => __( 'Color', 'jet-form-builder' ), |
| 785 | 'type' => Controls_Manager::COLOR, |
| 786 | 'selectors' => array( |
| 787 | $selector_callable( $scheme['active-separator'] ) => 'background-color: {{VALUE}}', |
| 788 | ), |
| 789 | ) |
| 790 | ); |
| 791 | $instance->add_control( |
| 792 | 'jet_fb_separator_active_circle', |
| 793 | array( |
| 794 | 'label' => esc_html__( 'Circle', 'jet-form-builder' ), |
| 795 | 'type' => Controls_Manager::HEADING, |
| 796 | 'separator' => 'before', |
| 797 | ) |
| 798 | ); |
| 799 | $this->add_border( |
| 800 | $instance, |
| 801 | 'jet_fb_progress_pages_tab--current_separator_border', |
| 802 | $selector_callable( $scheme['active-circle'] ) |
| 803 | ); |
| 804 | $instance->end_controls_tab(); |
| 805 | |
| 806 | $instance->start_controls_tab( |
| 807 | 'jet_fb_progress_pages_tab--next', |
| 808 | array( |
| 809 | 'label' => esc_html__( 'Next', 'jet-form-builder' ), |
| 810 | ) |
| 811 | ); |
| 812 | $instance->add_responsive_control( |
| 813 | 'jet_fb_progress_pages_tab--next_padding', |
| 814 | array( |
| 815 | 'label' => __( 'Padding', 'jet-form-builder' ), |
| 816 | 'type' => Controls_Manager::DIMENSIONS, |
| 817 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 818 | 'selectors' => array( |
| 819 | $selector_callable( $scheme['next-item'] ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 820 | ), |
| 821 | ) |
| 822 | ); |
| 823 | $instance->add_responsive_control( |
| 824 | 'jet_fb_progress_pages_tab--next_margin', |
| 825 | array( |
| 826 | 'label' => __( 'Margin', 'jet-form-builder' ), |
| 827 | 'type' => Controls_Manager::DIMENSIONS, |
| 828 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 829 | 'selectors' => array( |
| 830 | $selector_callable( $scheme['next-item'] ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 831 | ), |
| 832 | ) |
| 833 | ); |
| 834 | $instance->add_group_control( |
| 835 | Group_Control_Typography::get_type(), |
| 836 | array( |
| 837 | 'name' => 'jet_fb_progress_pages_tab--next_typography', |
| 838 | 'selector' => $selector_callable( $scheme['next-item'] ), |
| 839 | ) |
| 840 | ); |
| 841 | $this->add_border( |
| 842 | $instance, |
| 843 | 'jet_fb_progress_pages_tab--next_item_border', |
| 844 | $selector_callable( $scheme['next-item'] ) |
| 845 | ); |
| 846 | $instance->add_control( |
| 847 | 'jet_fb_progress_pages_tab--next_color', |
| 848 | array( |
| 849 | 'label' => __( 'Text Color', 'jet-form-builder' ), |
| 850 | 'type' => Controls_Manager::COLOR, |
| 851 | 'selectors' => array( |
| 852 | $selector_callable( $scheme['next-item'] ) => 'color: {{VALUE}}', |
| 853 | ), |
| 854 | ) |
| 855 | ); |
| 856 | $instance->add_control( |
| 857 | 'jet_fb_progress_pages_tab--next_bg_color', |
| 858 | array( |
| 859 | 'label' => __( 'Background Color', 'jet-form-builder' ), |
| 860 | 'type' => Controls_Manager::COLOR, |
| 861 | 'selectors' => array( |
| 862 | $selector_callable( $scheme['next-item'] ) => 'background-color: {{VALUE}}', |
| 863 | ), |
| 864 | ) |
| 865 | ); |
| 866 | $instance->add_control( |
| 867 | 'jet_fb_separator_next_separator', |
| 868 | array( |
| 869 | 'label' => esc_html__( 'Separator', 'jet-form-builder' ), |
| 870 | 'type' => Controls_Manager::HEADING, |
| 871 | 'separator' => 'before', |
| 872 | ) |
| 873 | ); |
| 874 | $instance->add_responsive_control( |
| 875 | 'jet_fb_progress_pages_tab--next_separator_height', |
| 876 | array( |
| 877 | 'label' => __( 'Height', 'jet-form-builder' ), |
| 878 | 'type' => Controls_Manager::SLIDER, |
| 879 | 'size_units' => array( 'px', 'em', 'rem', 'custom' ), |
| 880 | 'range' => array( |
| 881 | 'px' => array( |
| 882 | 'min' => 1, |
| 883 | 'max' => 100, |
| 884 | ), |
| 885 | ), |
| 886 | 'selectors' => array( |
| 887 | $selector_callable( $scheme['next-separator'] ) => 'height: {{SIZE}}{{UNIT}}; min-height: {{SIZE}}{{UNIT}};', |
| 888 | ), |
| 889 | ) |
| 890 | ); |
| 891 | $instance->add_control( |
| 892 | 'jet_fb_progress_pages_tab--next_separator_color', |
| 893 | array( |
| 894 | 'label' => __( 'Color', 'jet-form-builder' ), |
| 895 | 'type' => Controls_Manager::COLOR, |
| 896 | 'selectors' => array( |
| 897 | $selector_callable( $scheme['next-separator'] ) => 'background-color: {{VALUE}}', |
| 898 | ), |
| 899 | ) |
| 900 | ); |
| 901 | $instance->add_control( |
| 902 | 'jet_fb_separator_next_circle', |
| 903 | array( |
| 904 | 'label' => esc_html__( 'Circle', 'jet-form-builder' ), |
| 905 | 'type' => Controls_Manager::HEADING, |
| 906 | 'separator' => 'before', |
| 907 | ) |
| 908 | ); |
| 909 | $this->add_border( |
| 910 | $instance, |
| 911 | 'jet_fb_progress_pages_tab--next_separator_border', |
| 912 | $selector_callable( $scheme['next-circle'] ) |
| 913 | ); |
| 914 | $instance->end_controls_tab(); |
| 915 | |
| 916 | $instance->start_controls_tab( |
| 917 | 'jet_fb_progress_pages_tab--prev', |
| 918 | array( |
| 919 | 'label' => esc_html__( 'Prev', 'jet-form-builder' ), |
| 920 | ) |
| 921 | ); |
| 922 | $instance->add_responsive_control( |
| 923 | 'jet_fb_progress_pages_tab--prev_padding', |
| 924 | array( |
| 925 | 'label' => __( 'Padding', 'jet-form-builder' ), |
| 926 | 'type' => Controls_Manager::DIMENSIONS, |
| 927 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 928 | 'selectors' => array( |
| 929 | $selector_callable( $scheme['prev-item'] ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 930 | ), |
| 931 | ) |
| 932 | ); |
| 933 | $instance->add_responsive_control( |
| 934 | 'jet_fb_progress_pages_tab--prev_margin', |
| 935 | array( |
| 936 | 'label' => __( 'Margin', 'jet-form-builder' ), |
| 937 | 'type' => Controls_Manager::DIMENSIONS, |
| 938 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 939 | 'selectors' => array( |
| 940 | $selector_callable( $scheme['prev-item'] ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 941 | ), |
| 942 | ) |
| 943 | ); |
| 944 | $instance->add_group_control( |
| 945 | Group_Control_Typography::get_type(), |
| 946 | array( |
| 947 | 'name' => 'jet_fb_progress_pages_tab--prev_typography', |
| 948 | 'selector' => $selector_callable( $scheme['prev-item'] ), |
| 949 | ) |
| 950 | ); |
| 951 | $this->add_border( |
| 952 | $instance, |
| 953 | 'jet_fb_progress_pages_tab--prev_item_border', |
| 954 | $selector_callable( $scheme['prev-item'] ) |
| 955 | ); |
| 956 | $instance->add_control( |
| 957 | 'jet_fb_progress_pages_tab--prev_color', |
| 958 | array( |
| 959 | 'label' => __( 'Text Color', 'jet-form-builder' ), |
| 960 | 'type' => Controls_Manager::COLOR, |
| 961 | 'selectors' => array( |
| 962 | $selector_callable( $scheme['prev-item'] ) => 'color: {{VALUE}}', |
| 963 | ), |
| 964 | ) |
| 965 | ); |
| 966 | $instance->add_control( |
| 967 | 'jet_fb_progress_pages_tab--prev_bg_color', |
| 968 | array( |
| 969 | 'label' => __( 'Background Color', 'jet-form-builder' ), |
| 970 | 'type' => Controls_Manager::COLOR, |
| 971 | 'selectors' => array( |
| 972 | $selector_callable( $scheme['prev-item'] ) => 'background-color: {{VALUE}}', |
| 973 | ), |
| 974 | ) |
| 975 | ); |
| 976 | $instance->add_control( |
| 977 | 'jet_fb_separator_prev_separator', |
| 978 | array( |
| 979 | 'label' => esc_html__( 'Separator', 'jet-form-builder' ), |
| 980 | 'type' => Controls_Manager::HEADING, |
| 981 | 'separator' => 'before', |
| 982 | ) |
| 983 | ); |
| 984 | $instance->add_responsive_control( |
| 985 | 'jet_fb_progress_pages_tab--prev_separator_height', |
| 986 | array( |
| 987 | 'label' => __( 'Height', 'jet-form-builder' ), |
| 988 | 'type' => Controls_Manager::SLIDER, |
| 989 | 'size_units' => array( 'px', 'em', 'rem', 'custom' ), |
| 990 | 'range' => array( |
| 991 | 'px' => array( |
| 992 | 'min' => 1, |
| 993 | 'max' => 100, |
| 994 | ), |
| 995 | ), |
| 996 | 'selectors' => array( |
| 997 | $selector_callable( $scheme['prev-separator'] ) => 'height: {{SIZE}}{{UNIT}}; min-height: {{SIZE}}{{UNIT}};', |
| 998 | ), |
| 999 | ) |
| 1000 | ); |
| 1001 | $instance->add_control( |
| 1002 | 'jet_fb_progress_pages_tab--prev_separator_color', |
| 1003 | array( |
| 1004 | 'label' => __( 'Color', 'jet-form-builder' ), |
| 1005 | 'type' => Controls_Manager::COLOR, |
| 1006 | 'selectors' => array( |
| 1007 | $selector_callable( $scheme['prev-separator'] ) => 'background-color: {{VALUE}}', |
| 1008 | ), |
| 1009 | ) |
| 1010 | ); |
| 1011 | $instance->add_control( |
| 1012 | 'jet_fb_separator_prev_circle', |
| 1013 | array( |
| 1014 | 'label' => esc_html__( 'Circle', 'jet-form-builder' ), |
| 1015 | 'type' => Controls_Manager::HEADING, |
| 1016 | 'separator' => 'before', |
| 1017 | ) |
| 1018 | ); |
| 1019 | $this->add_border( |
| 1020 | $instance, |
| 1021 | 'jet_fb_progress_pages_tab--prev_separator_border', |
| 1022 | $selector_callable( $scheme['prev-circle'] ) |
| 1023 | ); |
| 1024 | $instance->end_controls_tab(); |
| 1025 | $instance->end_controls_tabs(); |
| 1026 | $instance->end_controls_section(); |
| 1027 | } |
| 1028 | |
| 1029 | public function booking_form_render( $result, $settings ) { |
| 1030 | $slug = $this->jet_form_builder_slug(); |
| 1031 | |
| 1032 | if ( empty( $settings['form_provider'] ) || $slug !== $settings['form_provider'] ) { |
| 1033 | return false; |
| 1034 | } |
| 1035 | if ( empty( $settings['form_id'] ) ) { |
| 1036 | return __( 'Please, select JetForm to show', 'jet-form-builder' ); |
| 1037 | } |
| 1038 | |
| 1039 | return jet_fb_render_form( $settings ); |
| 1040 | } |
| 1041 | |
| 1042 | /** |
| 1043 | * Register the widget controls. |
| 1044 | * |
| 1045 | * Adds different input fields to allow the user to change and customize the widget settings. |
| 1046 | * |
| 1047 | * @since 1.1.0 |
| 1048 | * |
| 1049 | * @access protected |
| 1050 | */ |
| 1051 | protected function register_controls() { |
| 1052 | |
| 1053 | $this->section_form_settings(); |
| 1054 | |
| 1055 | /** Form Row */ |
| 1056 | $this->section_form_style(); |
| 1057 | |
| 1058 | /** Label */ |
| 1059 | $this->section_label_style(); |
| 1060 | |
| 1061 | /** Description */ |
| 1062 | $this->section_description_style(); |
| 1063 | |
| 1064 | /** Checkbox & Radio Fields */ |
| 1065 | $this->section_checkradio_fields_style(); |
| 1066 | |
| 1067 | /** Input Fields */ |
| 1068 | $this->section_form_input_fields(); |
| 1069 | |
| 1070 | /** Calculated Fields */ |
| 1071 | $this->section_calc_fields_style(); |
| 1072 | |
| 1073 | /** Range Fields */ |
| 1074 | $this->section_range_fields_style(); |
| 1075 | |
| 1076 | /** Heading Fields */ |
| 1077 | $this->section_headings_style(); |
| 1078 | |
| 1079 | /** Repeater */ |
| 1080 | $this->section_repeater_style(); |
| 1081 | |
| 1082 | /** Conditional block */ |
| 1083 | $this->conditional_style(); |
| 1084 | |
| 1085 | /** Submit */ |
| 1086 | $this->form_submit_style(); |
| 1087 | |
| 1088 | /** Form Break Row */ |
| 1089 | $this->section_form_break_style(); |
| 1090 | |
| 1091 | /** Form Break Buttons */ |
| 1092 | $this->section_form_break_next_style(); |
| 1093 | |
| 1094 | /** Form Break Disabled Message */ |
| 1095 | $this->section_form_break_disabled_style(); |
| 1096 | |
| 1097 | $this->run_form_progress_controls( |
| 1098 | $this, |
| 1099 | array( $this, 'selector' ), |
| 1100 | function ( $args ) { |
| 1101 | return $args; |
| 1102 | } |
| 1103 | ); |
| 1104 | |
| 1105 | /** Messages */ |
| 1106 | $this->section_message_error_style(); |
| 1107 | } |
| 1108 | |
| 1109 | private function section_form_settings() { |
| 1110 | $options = Form_Arguments::get_options( true ); |
| 1111 | |
| 1112 | $this->start_controls_section( |
| 1113 | 'section_ form_settings', |
| 1114 | array( |
| 1115 | 'label' => __( 'Form Settings', 'jet-form-builder' ), |
| 1116 | ) |
| 1117 | ); |
| 1118 | |
| 1119 | $this->add_control( |
| 1120 | 'form_id', |
| 1121 | array( |
| 1122 | 'label' => __( 'Choose Form', 'jet-form-builder' ), |
| 1123 | 'type' => Controls_Manager::SELECT, |
| 1124 | 'default' => '', |
| 1125 | 'label_block' => false, |
| 1126 | 'options' => Tools::get_forms_list_for_js( true ), |
| 1127 | ) |
| 1128 | ); |
| 1129 | |
| 1130 | $this->add_control( |
| 1131 | 'form_id_custom', |
| 1132 | array( |
| 1133 | 'label' => __( 'Form ID', 'jet-form-builder' ), |
| 1134 | 'type' => Controls_Manager::TEXT, |
| 1135 | 'default' => '', |
| 1136 | 'label_block' => false, |
| 1137 | 'dynamic' => array( 'active' => true ), |
| 1138 | 'condition' => array( |
| 1139 | 'form_id' => 'manual_form_id', |
| 1140 | ), |
| 1141 | ) |
| 1142 | ); |
| 1143 | |
| 1144 | $this->add_control( |
| 1145 | 'fields_layout', |
| 1146 | array( |
| 1147 | 'label' => __( 'Fields Layout', 'jet-form-builder' ), |
| 1148 | 'type' => Controls_Manager::SELECT, |
| 1149 | 'default' => '', |
| 1150 | 'options' => $options['fields_layout'], |
| 1151 | ) |
| 1152 | ); |
| 1153 | |
| 1154 | $this->add_control( |
| 1155 | 'required_mark', |
| 1156 | array( |
| 1157 | 'label' => __( 'Required Mark', 'jet-form-builder' ), |
| 1158 | 'type' => Controls_Manager::TEXT, |
| 1159 | 'default' => '', |
| 1160 | ) |
| 1161 | ); |
| 1162 | |
| 1163 | $this->add_control( |
| 1164 | 'fields_label_tag', |
| 1165 | array( |
| 1166 | 'label' => __( 'Fields label HTML tag', 'jet-form-builder' ), |
| 1167 | 'type' => Controls_Manager::SELECT, |
| 1168 | 'default' => '', |
| 1169 | 'options' => $options['fields_label_tag'], |
| 1170 | ) |
| 1171 | ); |
| 1172 | |
| 1173 | $this->add_control( |
| 1174 | 'submit_type', |
| 1175 | array( |
| 1176 | 'label' => __( 'Submit Type', 'jet-form-builder' ), |
| 1177 | 'type' => Controls_Manager::SELECT, |
| 1178 | 'default' => '', |
| 1179 | 'options' => $options['submit_type'], |
| 1180 | ) |
| 1181 | ); |
| 1182 | |
| 1183 | $this->add_control( |
| 1184 | 'enable_progress', |
| 1185 | array( |
| 1186 | 'label' => __( 'Enable form pages progress', 'jet-form-builder' ), |
| 1187 | 'type' => Controls_Manager::SWITCHER, |
| 1188 | 'label_on' => __( 'Yes', 'jet-form-builder' ), |
| 1189 | 'label_off' => __( 'No', 'jet-form-builder' ), |
| 1190 | 'return_value' => 'yes', |
| 1191 | 'default' => '', |
| 1192 | ) |
| 1193 | ); |
| 1194 | |
| 1195 | $this->add_control( |
| 1196 | 'clear', |
| 1197 | array( |
| 1198 | 'label' => __( 'Clear data on success submit', 'jet-form-builder' ), |
| 1199 | 'type' => Controls_Manager::SWITCHER, |
| 1200 | 'label_on' => __( 'Yes', 'jet-form-builder' ), |
| 1201 | 'label_off' => __( 'No', 'jet-form-builder' ), |
| 1202 | 'return_value' => 'yes', |
| 1203 | 'default' => '', |
| 1204 | ) |
| 1205 | ); |
| 1206 | |
| 1207 | $this->end_controls_section(); |
| 1208 | } |
| 1209 | |
| 1210 | private function section_form_style() { |
| 1211 | $this->start_controls_section( |
| 1212 | 'section_form_style', |
| 1213 | array( |
| 1214 | 'label' => __( 'Form Row', 'jet-form-builder' ), |
| 1215 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1216 | ) |
| 1217 | ); |
| 1218 | |
| 1219 | $this->add_responsive_control( |
| 1220 | 'form_row_gap_before', |
| 1221 | array( |
| 1222 | |
| 1223 | 'type' => Controls_Manager::SLIDER, |
| 1224 | 'label' => __( 'Gap Before', 'jet-form-builder' ), |
| 1225 | 'size_units' => array( 'px', 'em', 'rem', 'custom' ), |
| 1226 | 'range' => array( |
| 1227 | 'px' => array( |
| 1228 | 'min' => 0, |
| 1229 | 'max' => 100, |
| 1230 | ), |
| 1231 | ), |
| 1232 | 'selectors' => array( |
| 1233 | $this->selector( '-row' ) => 'margin-top: {{SIZE}}{{UNIT}};', |
| 1234 | ), |
| 1235 | ) |
| 1236 | ); |
| 1237 | |
| 1238 | $this->add_responsive_control( |
| 1239 | 'form_row_gap_after', |
| 1240 | array( |
| 1241 | |
| 1242 | 'type' => Controls_Manager::SLIDER, |
| 1243 | 'label' => __( 'Gap After', 'jet-form-builder' ), |
| 1244 | 'size_units' => array( 'px', 'em', 'rem', 'custom' ), |
| 1245 | 'range' => array( |
| 1246 | 'px' => array( |
| 1247 | 'min' => 0, |
| 1248 | 'max' => 100, |
| 1249 | ), |
| 1250 | ), |
| 1251 | 'selectors' => array( |
| 1252 | $this->selector( '-row' ) => 'margin-bottom: {{SIZE}}{{UNIT}};', |
| 1253 | ), |
| 1254 | ) |
| 1255 | ); |
| 1256 | |
| 1257 | $this->end_controls_section(); |
| 1258 | } |
| 1259 | |
| 1260 | private function section_label_style() { |
| 1261 | $this->start_controls_section( |
| 1262 | 'section_label_style', |
| 1263 | array( |
| 1264 | 'label' => __( 'Label', 'jet-form-builder' ), |
| 1265 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1266 | ) |
| 1267 | ); |
| 1268 | |
| 1269 | $this->add_responsive_control( |
| 1270 | 'form_label_margin', |
| 1271 | array( |
| 1272 | 'label' => __( 'Margin', 'jet-form-builder' ), |
| 1273 | 'type' => Controls_Manager::DIMENSIONS, |
| 1274 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 1275 | 'selectors' => array( |
| 1276 | $this->selector( '__label' ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1277 | ), |
| 1278 | ) |
| 1279 | ); |
| 1280 | |
| 1281 | $this->add_responsive_control( |
| 1282 | 'form_label_padding', |
| 1283 | array( |
| 1284 | 'label' => __( 'Padding', 'jet-form-builder' ), |
| 1285 | 'type' => Controls_Manager::DIMENSIONS, |
| 1286 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 1287 | 'selectors' => array( |
| 1288 | $this->selector( '__label' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1289 | ), |
| 1290 | ) |
| 1291 | ); |
| 1292 | |
| 1293 | $this->add_responsive_control( |
| 1294 | 'form_label_alignment', |
| 1295 | array( |
| 1296 | 'label' => __( 'Alignment', 'jet-form-builder' ), |
| 1297 | 'type' => Controls_Manager::CHOOSE, |
| 1298 | 'label_block' => false, |
| 1299 | 'default' => 'left', |
| 1300 | 'separator' => 'before', |
| 1301 | 'options' => array( |
| 1302 | 'left' => array( |
| 1303 | 'title' => __( 'Left', 'jet-form-builder' ), |
| 1304 | 'icon' => 'eicon-h-align-left', |
| 1305 | ), |
| 1306 | 'center' => array( |
| 1307 | 'title' => __( 'Center', 'jet-form-builder' ), |
| 1308 | 'icon' => 'eicon-h-align-center', |
| 1309 | ), |
| 1310 | 'right' => array( |
| 1311 | 'title' => __( 'Right', 'jet-form-builder' ), |
| 1312 | 'icon' => 'eicon-h-align-right', |
| 1313 | ), |
| 1314 | ), |
| 1315 | 'selectors' => array( |
| 1316 | $this->selector( '__label' ) => 'text-align: {{VALUE}};', |
| 1317 | ), |
| 1318 | ) |
| 1319 | ); |
| 1320 | |
| 1321 | $this->add_group_control( |
| 1322 | Group_Control_Typography::get_type(), |
| 1323 | array( |
| 1324 | 'name' => 'form_label_typography', |
| 1325 | 'selector' => $this->selector( '__label' ), |
| 1326 | ) |
| 1327 | ); |
| 1328 | |
| 1329 | $this->add_control( |
| 1330 | 'form_label_color', |
| 1331 | array( |
| 1332 | 'label' => __( 'Color', 'jet-form-builder' ), |
| 1333 | 'type' => Controls_Manager::COLOR, |
| 1334 | 'selectors' => array( |
| 1335 | $this->selector( '__label' ) => 'color: {{VALUE}};', |
| 1336 | ), |
| 1337 | ) |
| 1338 | ); |
| 1339 | $this->add_control( |
| 1340 | 'form_label_bg_color', |
| 1341 | array( |
| 1342 | 'label' => __( 'Background Color', 'jet-form-builder' ), |
| 1343 | 'type' => Controls_Manager::COLOR, |
| 1344 | 'selectors' => array( |
| 1345 | $this->selector( '__label' ) => 'background-color: {{VALUE}};', |
| 1346 | ), |
| 1347 | ) |
| 1348 | ); |
| 1349 | $this->add_border( |
| 1350 | $this, |
| 1351 | 'form_label_border', |
| 1352 | $this->selector( '__label' ) |
| 1353 | ); |
| 1354 | |
| 1355 | $this->add_control( |
| 1356 | 'divider__label__required_mark', |
| 1357 | array( |
| 1358 | 'label' => __( 'Required Mark', 'jet-form-builder' ), |
| 1359 | 'type' => Controls_Manager::HEADING, |
| 1360 | 'separator' => 'before', |
| 1361 | ) |
| 1362 | ); |
| 1363 | |
| 1364 | $this->add_group_control( |
| 1365 | Group_Control_Typography::get_type(), |
| 1366 | array( |
| 1367 | 'name' => 'form_required_typography', |
| 1368 | 'selector' => $this->selector( '__label .%s__required' ), |
| 1369 | ) |
| 1370 | ); |
| 1371 | $this->add_control( |
| 1372 | 'form_required_color', |
| 1373 | array( |
| 1374 | 'label' => __( 'Color', 'jet-form-builder' ), |
| 1375 | 'type' => Controls_Manager::COLOR, |
| 1376 | 'selectors' => array( |
| 1377 | $this->selector( '__label .%s__required' ) => 'color: {{VALUE}};', |
| 1378 | ), |
| 1379 | ) |
| 1380 | ); |
| 1381 | $this->end_controls_section(); |
| 1382 | } |
| 1383 | |
| 1384 | private function section_description_style() { |
| 1385 | $this->start_controls_section( |
| 1386 | 'section_description_style', |
| 1387 | array( |
| 1388 | 'label' => __( 'Description', 'jet-form-builder' ), |
| 1389 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1390 | ) |
| 1391 | ); |
| 1392 | $this->add_responsive_control( |
| 1393 | 'form_description_margin', |
| 1394 | array( |
| 1395 | 'label' => __( 'Margin', 'jet-form-builder' ), |
| 1396 | 'type' => Controls_Manager::DIMENSIONS, |
| 1397 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 1398 | 'selectors' => array( |
| 1399 | $this->selector( '__desc' ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1400 | ), |
| 1401 | ) |
| 1402 | ); |
| 1403 | |
| 1404 | $this->add_responsive_control( |
| 1405 | 'form_description_padding', |
| 1406 | array( |
| 1407 | 'label' => __( 'Padding', 'jet-form-builder' ), |
| 1408 | 'type' => Controls_Manager::DIMENSIONS, |
| 1409 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 1410 | 'selectors' => array( |
| 1411 | $this->selector( '__desc' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1412 | ), |
| 1413 | ) |
| 1414 | ); |
| 1415 | |
| 1416 | $this->add_responsive_control( |
| 1417 | 'form_description_alignment', |
| 1418 | array( |
| 1419 | 'label' => __( 'Alignment', 'jet-form-builder' ), |
| 1420 | 'type' => Controls_Manager::CHOOSE, |
| 1421 | 'label_block' => false, |
| 1422 | 'default' => 'left', |
| 1423 | 'separator' => 'before', |
| 1424 | 'options' => array( |
| 1425 | 'left' => array( |
| 1426 | 'title' => __( 'Left', 'jet-form-builder' ), |
| 1427 | 'icon' => 'eicon-h-align-left', |
| 1428 | ), |
| 1429 | 'center' => array( |
| 1430 | 'title' => __( 'Center', 'jet-form-builder' ), |
| 1431 | 'icon' => 'eicon-h-align-center', |
| 1432 | ), |
| 1433 | 'right' => array( |
| 1434 | 'title' => __( 'Right', 'jet-form-builder' ), |
| 1435 | 'icon' => 'eicon-h-align-right', |
| 1436 | ), |
| 1437 | ), |
| 1438 | 'selectors' => array( |
| 1439 | $this->selector( '__desc' ) => 'text-align: {{VALUE}};', |
| 1440 | ), |
| 1441 | ) |
| 1442 | ); |
| 1443 | |
| 1444 | $this->add_group_control( |
| 1445 | Group_Control_Typography::get_type(), |
| 1446 | array( |
| 1447 | 'name' => 'form_description_typography', |
| 1448 | 'selector' => $this->selector( '__desc' ), |
| 1449 | ) |
| 1450 | ); |
| 1451 | |
| 1452 | $this->add_control( |
| 1453 | 'form_description_color', |
| 1454 | array( |
| 1455 | 'label' => __( 'Color', 'jet-form-builder' ), |
| 1456 | 'type' => Controls_Manager::COLOR, |
| 1457 | 'selectors' => array( |
| 1458 | $this->selector( '__desc' ) => 'color: {{VALUE}};', |
| 1459 | ), |
| 1460 | ) |
| 1461 | ); |
| 1462 | $this->add_control( |
| 1463 | 'form_description_bg_color', |
| 1464 | array( |
| 1465 | 'label' => __( 'Background Color', 'jet-form-builder' ), |
| 1466 | 'type' => Controls_Manager::COLOR, |
| 1467 | 'selectors' => array( |
| 1468 | $this->selector( '__desc' ) => 'background-color: {{VALUE}};', |
| 1469 | ), |
| 1470 | ) |
| 1471 | ); |
| 1472 | $this->add_border( |
| 1473 | $this, |
| 1474 | 'form_description_border', |
| 1475 | $this->selector( '__desc' ) |
| 1476 | ); |
| 1477 | $this->end_controls_section(); |
| 1478 | } |
| 1479 | |
| 1480 | private function section_checkradio_fields_style() { |
| 1481 | $this->start_controls_section( |
| 1482 | 'section_checkradio_fields_style', |
| 1483 | array( |
| 1484 | 'label' => __( 'Checkbox & Radio Fields', 'jet-form-builder' ), |
| 1485 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1486 | 'show_label' => false, |
| 1487 | ) |
| 1488 | ); |
| 1489 | |
| 1490 | $this->add_responsive_control( |
| 1491 | 'checkradio_fields_layout', |
| 1492 | array( |
| 1493 | 'label' => __( 'Layout', 'jet-form-builder' ), |
| 1494 | 'type' => Controls_Manager::CHOOSE, |
| 1495 | 'label_block' => false, |
| 1496 | 'options' => array( |
| 1497 | 'inline-block' => array( |
| 1498 | 'title' => __( 'Horizontal', 'jet-form-builder' ), |
| 1499 | 'icon' => 'eicon-ellipsis-h', |
| 1500 | ), |
| 1501 | 'block' => array( |
| 1502 | 'title' => __( 'Vertical', 'jet-form-builder' ), |
| 1503 | 'icon' => 'eicon-editor-list-ul', |
| 1504 | ), |
| 1505 | ), |
| 1506 | 'selectors_dictionary' => array( |
| 1507 | 'inline-block' => 'row', |
| 1508 | 'block' => 'column', |
| 1509 | ), |
| 1510 | 'selectors' => array( |
| 1511 | $this->selector( '__fields-group' ) => 'flex-direction: {{VALUE}};', |
| 1512 | ), |
| 1513 | ) |
| 1514 | ); |
| 1515 | |
| 1516 | $this->add_responsive_control( |
| 1517 | 'checkradio_fields_gaps', |
| 1518 | array( |
| 1519 | 'label' => __( 'Gaps', 'jet-form-builder' ), |
| 1520 | 'type' => Controls_Manager::GAPS, |
| 1521 | 'size_units' => array( 'px', 'em', 'rem', 'custom' ), |
| 1522 | 'default' => array( |
| 1523 | 'row' => '0.7', |
| 1524 | 'column' => '0.7', |
| 1525 | 'unit' => 'em', |
| 1526 | ), |
| 1527 | 'validators' => array( |
| 1528 | 'Number' => array( |
| 1529 | 'min' => 0, |
| 1530 | ), |
| 1531 | ), |
| 1532 | 'selectors' => array( |
| 1533 | $this->selector( '__fields-group' ) => 'gap: {{ROW}}{{UNIT}} {{COLUMN}}{{UNIT}};', |
| 1534 | ), |
| 1535 | ) |
| 1536 | ); |
| 1537 | |
| 1538 | $this->add_group_control( |
| 1539 | Group_Control_Typography::get_type(), |
| 1540 | array( |
| 1541 | 'name' => 'checkradio_fields_typography', |
| 1542 | 'selector' => $this->selector( '__field-wrap label' ), |
| 1543 | ) |
| 1544 | ); |
| 1545 | |
| 1546 | $this->add_responsive_control( |
| 1547 | 'checkradio_fields_gap', |
| 1548 | array( |
| 1549 | 'label' => __( 'Gap between control and label', 'jet-form-builder' ), |
| 1550 | 'type' => Controls_Manager::SLIDER, |
| 1551 | 'size_units' => array( 'px', 'em', 'rem', 'custom' ), |
| 1552 | 'default' => array( |
| 1553 | 'size' => 8, |
| 1554 | ), |
| 1555 | 'range' => array( |
| 1556 | 'px' => array( |
| 1557 | 'min' => 0, |
| 1558 | 'max' => 50, |
| 1559 | ), |
| 1560 | ), |
| 1561 | 'selectors' => array( |
| 1562 | $this->selector( '__field-wrap.checkradio-wrap span' ) => 'gap: {{SIZE}}{{UNIT}};', |
| 1563 | ), |
| 1564 | ) |
| 1565 | ); |
| 1566 | $this->add_responsive_control( |
| 1567 | 'checkradio_fields_control_size', |
| 1568 | array( |
| 1569 | 'label' => __( 'Control Size', 'jet-form-builder' ), |
| 1570 | 'type' => Controls_Manager::SLIDER, |
| 1571 | 'size_units' => array( 'px', 'em', 'rem', 'custom' ), |
| 1572 | 'range' => array( |
| 1573 | 'px' => array( |
| 1574 | 'min' => 0, |
| 1575 | 'max' => 50, |
| 1576 | ), |
| 1577 | ), |
| 1578 | 'selectors' => array( |
| 1579 | $this->selector( '__field-wrap span::before' ) => 'font-size: {{SIZE}}{{UNIT}};', |
| 1580 | ), |
| 1581 | ) |
| 1582 | ); |
| 1583 | |
| 1584 | $this->add_control( |
| 1585 | 'checkradio_fields_option_label_heading', |
| 1586 | array( |
| 1587 | 'label' => __( 'Option label', 'jet-form-builder' ), |
| 1588 | 'type' => Controls_Manager::HEADING, |
| 1589 | 'separator' => 'before', |
| 1590 | ) |
| 1591 | ); |
| 1592 | |
| 1593 | $this->add_control( |
| 1594 | 'checkradio_fields_color', |
| 1595 | array( |
| 1596 | 'label' => __( 'Color', 'jet-form-builder' ), |
| 1597 | 'type' => Controls_Manager::COLOR, |
| 1598 | 'selectors' => array( |
| 1599 | $this->selector( '__field-wrap label' ) => 'color: {{VALUE}}', |
| 1600 | ), |
| 1601 | ) |
| 1602 | ); |
| 1603 | |
| 1604 | $this->add_control( |
| 1605 | 'checkradio_fields_background_color', |
| 1606 | array( |
| 1607 | 'label' => __( 'Background color', 'jet-form-builder' ), |
| 1608 | 'type' => Controls_Manager::COLOR, |
| 1609 | 'selectors' => array( |
| 1610 | $this->selector( '__field-wrap label' ) => 'background-color: {{VALUE}}', |
| 1611 | ), |
| 1612 | ) |
| 1613 | ); |
| 1614 | |
| 1615 | $this->start_controls_tabs( |
| 1616 | 'tab__checkradio_tabs_items', |
| 1617 | array( |
| 1618 | 'separator' => 'before', |
| 1619 | ) |
| 1620 | ); |
| 1621 | |
| 1622 | $this->start_controls_tab( |
| 1623 | 'tab__checkradio_control_color__normal', |
| 1624 | array( |
| 1625 | 'label' => __( 'Normal', 'jet-form-builder' ), |
| 1626 | ) |
| 1627 | ); |
| 1628 | |
| 1629 | $this->add_border( |
| 1630 | $this, |
| 1631 | 'tab__checkradio_control_border__normal', |
| 1632 | $this->selector( '__field-wrap span::before' ) |
| 1633 | ); |
| 1634 | |
| 1635 | $this->add_control( |
| 1636 | 'tab__checkradio_control_bg_color__normal', |
| 1637 | array( |
| 1638 | 'label' => esc_html__( 'Background Color', 'jet-form-builder' ), |
| 1639 | 'type' => Controls_Manager::COLOR, |
| 1640 | 'selectors' => array( |
| 1641 | $this->selector( '__field-wrap label > span::before' ) => 'background-color: {{VALUE}};', |
| 1642 | ), |
| 1643 | ) |
| 1644 | ); |
| 1645 | |
| 1646 | $this->end_controls_tab(); |
| 1647 | |
| 1648 | $this->start_controls_tab( |
| 1649 | 'tab__checkradio_control_border__hover', |
| 1650 | array( |
| 1651 | 'label' => __( 'Hover', 'jet-form-builder' ), |
| 1652 | ) |
| 1653 | ); |
| 1654 | |
| 1655 | $this->add_border( |
| 1656 | $this, |
| 1657 | 'tab__checkradio_control_border__hover', |
| 1658 | $this->selector( '__field-wrap label :not(:disabled):not(:checked):hover + span::before' ) |
| 1659 | ); |
| 1660 | |
| 1661 | $this->add_control( |
| 1662 | 'tab__checkradio_control_bg_color__hover', |
| 1663 | array( |
| 1664 | 'label' => esc_html__( 'Background Color', 'jet-form-builder' ), |
| 1665 | 'type' => Controls_Manager::COLOR, |
| 1666 | 'selectors' => array( |
| 1667 | $this->selector( '__field-wrap label :not(:disabled):not(:checked):hover + span::before' ) => 'background-color: {{VALUE}};', |
| 1668 | ), |
| 1669 | ) |
| 1670 | ); |
| 1671 | |
| 1672 | $this->end_controls_tab(); |
| 1673 | |
| 1674 | $this->start_controls_tab( |
| 1675 | 'tab__checkradio_control_border__focus', |
| 1676 | array( |
| 1677 | 'label' => __( 'Focus', 'jet-form-builder' ), |
| 1678 | ) |
| 1679 | ); |
| 1680 | |
| 1681 | $this->add_border( |
| 1682 | $this, |
| 1683 | 'tab__checkradio_control_border__focus', |
| 1684 | $this->selector( '__field-wrap label :focus:not(:checked) + span::before' ) |
| 1685 | ); |
| 1686 | |
| 1687 | $this->add_control( |
| 1688 | 'tab__checkradio_control_bg_color__focus', |
| 1689 | array( |
| 1690 | 'label' => esc_html__( 'Background Color', 'jet-form-builder' ), |
| 1691 | 'type' => Controls_Manager::COLOR, |
| 1692 | 'selectors' => array( |
| 1693 | $this->selector( '__field-wrap label :focus:not(:checked) + span::before' ) => 'background-color: {{VALUE}};', |
| 1694 | ), |
| 1695 | ) |
| 1696 | ); |
| 1697 | |
| 1698 | $this->end_controls_tab(); |
| 1699 | |
| 1700 | $this->start_controls_tab( |
| 1701 | 'tab__checkradio_control_border__checked', |
| 1702 | array( |
| 1703 | 'label' => __( 'Checked', 'jet-form-builder' ), |
| 1704 | ) |
| 1705 | ); |
| 1706 | |
| 1707 | $this->add_border( |
| 1708 | $this, |
| 1709 | 'tab__checkradio_control_border__checked', |
| 1710 | $this->selector( '__field-wrap label :checked + span::before' ) |
| 1711 | ); |
| 1712 | |
| 1713 | $this->add_control( |
| 1714 | 'tab__checkradio_control_bg_color__checked', |
| 1715 | array( |
| 1716 | 'label' => esc_html__( 'Background Color', 'jet-form-builder' ), |
| 1717 | 'type' => Controls_Manager::COLOR, |
| 1718 | 'selectors' => array( |
| 1719 | $this->selector( '__field-wrap label :checked + span::before' ) => 'background-color: {{VALUE}};', |
| 1720 | ), |
| 1721 | ) |
| 1722 | ); |
| 1723 | |
| 1724 | $this->end_controls_tab(); |
| 1725 | $this->end_controls_tabs(); |
| 1726 | $this->end_controls_section(); |
| 1727 | } |
| 1728 | |
| 1729 | private function section_form_input_fields() { |
| 1730 | $simple_input = '__field:not(.checkradio-field):not(.range-field):not(.%s-repeater):not(.wysiwyg-field)'; |
| 1731 | |
| 1732 | $this->start_controls_section( |
| 1733 | 'section_form_input_fields', |
| 1734 | array( |
| 1735 | 'label' => __( 'Input Fields', 'jet-form-builder' ), |
| 1736 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1737 | ) |
| 1738 | ); |
| 1739 | |
| 1740 | $this->add_group_control( |
| 1741 | Group_Control_Typography::get_type(), |
| 1742 | array( |
| 1743 | 'name' => 'fields_typography', |
| 1744 | 'selector' => $this->selector( $simple_input ), |
| 1745 | ) |
| 1746 | ); |
| 1747 | |
| 1748 | $this->add_control( |
| 1749 | 'fields_color', |
| 1750 | array( |
| 1751 | 'label' => __( 'Color', 'jet-form-builder' ), |
| 1752 | 'type' => Controls_Manager::COLOR, |
| 1753 | 'selectors' => array( |
| 1754 | $this->selector( $simple_input ) => 'color: {{VALUE}};', |
| 1755 | ), |
| 1756 | ) |
| 1757 | ); |
| 1758 | |
| 1759 | $this->add_control( |
| 1760 | 'fields_placeholder_color', |
| 1761 | array( |
| 1762 | 'label' => __( 'Placeholder Color', 'jet-form-builder' ), |
| 1763 | 'type' => Controls_Manager::COLOR, |
| 1764 | 'selectors' => array( |
| 1765 | $this->selector( ' ::-webkit-input-placeholder' ) => 'color: {{VALUE}};', |
| 1766 | $this->selector( ' ::-ms-input-placeholder' ) => 'color: {{VALUE}};', |
| 1767 | $this->selector( ' ::-moz-placeholder' ) => 'color: {{VALUE}};', |
| 1768 | $this->selector( ' :-moz-placeholder' ) => 'color: {{VALUE}};', |
| 1769 | ), |
| 1770 | ) |
| 1771 | ); |
| 1772 | |
| 1773 | $this->add_control( |
| 1774 | 'fields_background_color', |
| 1775 | array( |
| 1776 | 'label' => __( 'Background Color', 'jet-form-builder' ), |
| 1777 | 'type' => Controls_Manager::COLOR, |
| 1778 | 'selectors' => array( |
| 1779 | $this->selector( $simple_input ) => 'background-color: {{VALUE}};', |
| 1780 | ), |
| 1781 | ) |
| 1782 | ); |
| 1783 | |
| 1784 | $this->add_responsive_control( |
| 1785 | 'fields_padding', |
| 1786 | array( |
| 1787 | 'label' => __( 'Padding', 'jet-form-builder' ), |
| 1788 | 'type' => Controls_Manager::DIMENSIONS, |
| 1789 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 1790 | 'selectors' => array( |
| 1791 | $this->selector( $simple_input ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1792 | ), |
| 1793 | ) |
| 1794 | ); |
| 1795 | |
| 1796 | $this->add_responsive_control( |
| 1797 | 'fields_margin', |
| 1798 | array( |
| 1799 | 'label' => __( 'Margin', 'jet-form-builder' ), |
| 1800 | 'type' => Controls_Manager::DIMENSIONS, |
| 1801 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 1802 | 'selectors' => array( |
| 1803 | $this->selector( $simple_input ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1804 | ), |
| 1805 | ) |
| 1806 | ); |
| 1807 | |
| 1808 | $this->add_group_control( |
| 1809 | Group_Control_Border::get_type(), |
| 1810 | array( |
| 1811 | 'name' => 'fields_border', |
| 1812 | 'label' => __( 'Border', 'jet-form-builder' ), |
| 1813 | 'placeholder' => '1px', |
| 1814 | 'selector' => $this->selector( $simple_input ), |
| 1815 | ) |
| 1816 | ); |
| 1817 | |
| 1818 | $this->add_responsive_control( |
| 1819 | 'fields_border_radius', |
| 1820 | array( |
| 1821 | 'label' => __( 'Border Radius', 'jet-form-builder' ), |
| 1822 | 'type' => Controls_Manager::DIMENSIONS, |
| 1823 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 1824 | 'selectors' => array( |
| 1825 | $this->selector( $simple_input ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1826 | ), |
| 1827 | ) |
| 1828 | ); |
| 1829 | |
| 1830 | $this->add_group_control( |
| 1831 | Group_Control_Box_Shadow::get_type(), |
| 1832 | array( |
| 1833 | 'name' => 'fields_box_shadow', |
| 1834 | 'selector' => $this->selector( $simple_input ), |
| 1835 | ) |
| 1836 | ); |
| 1837 | |
| 1838 | $this->add_responsive_control( |
| 1839 | 'fields_width', |
| 1840 | array( |
| 1841 | 'label' => __( 'Fields width', 'jet-form-builder' ), |
| 1842 | 'type' => Controls_Manager::SLIDER, |
| 1843 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 1844 | 'range' => array( |
| 1845 | 'px' => array( |
| 1846 | 'min' => 50, |
| 1847 | 'max' => 1000, |
| 1848 | ), |
| 1849 | ), |
| 1850 | 'selectors' => array( |
| 1851 | $this->selector( $simple_input ) => 'max-width: {{SIZE}}{{UNIT}};', |
| 1852 | ), |
| 1853 | ) |
| 1854 | ); |
| 1855 | |
| 1856 | $this->add_responsive_control( |
| 1857 | 'fields_textarea_height', |
| 1858 | array( |
| 1859 | 'label' => __( 'Textarea Height', 'jet-form-builder' ), |
| 1860 | 'type' => Controls_Manager::SLIDER, |
| 1861 | 'size_units' => array( 'px', 'em', 'rem', 'custom' ), |
| 1862 | 'range' => array( |
| 1863 | 'px' => array( |
| 1864 | 'min' => 10, |
| 1865 | 'max' => 500, |
| 1866 | ), |
| 1867 | ), |
| 1868 | 'selectors' => array( |
| 1869 | $this->selector( '__field.textarea-field' ) => 'height:{{SIZE}}{{UNIT}}; min-height:{{SIZE}}{{UNIT}};', |
| 1870 | ), |
| 1871 | ) |
| 1872 | ); |
| 1873 | |
| 1874 | $this->add_control( |
| 1875 | 'fields_color_scheme', |
| 1876 | array( |
| 1877 | 'label' => __( 'Color Scheme', 'jet-form-builder' ), |
| 1878 | 'type' => Controls_Manager::SELECT, |
| 1879 | 'description' => __( 'Affects default browser UI elements like date and time icons, UI etc.', 'jet-form-builder' ), |
| 1880 | 'default' => 'normal', |
| 1881 | 'options' => array( |
| 1882 | 'normal' => __( 'Normal', 'jet-form-builder' ), |
| 1883 | 'light' => __( 'Light', 'jet-form-builder' ), |
| 1884 | 'dark' => __( 'Dark', 'jet-form-builder' ), |
| 1885 | ), |
| 1886 | 'selectors' => array( |
| 1887 | $this->selector( ' input' ) => 'color-scheme: {{VALUE}};', |
| 1888 | ), |
| 1889 | ) |
| 1890 | ); |
| 1891 | |
| 1892 | $this->end_controls_section(); |
| 1893 | } |
| 1894 | |
| 1895 | private function section_calc_fields_style() { |
| 1896 | $this->start_controls_section( |
| 1897 | 'section_calc_fields_style', |
| 1898 | array( |
| 1899 | 'label' => __( 'Calculated Fields', 'jet-form-builder' ), |
| 1900 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1901 | 'show_label' => false, |
| 1902 | ) |
| 1903 | ); |
| 1904 | |
| 1905 | $this->add_group_control( |
| 1906 | Group_Control_Typography::get_type(), |
| 1907 | array( |
| 1908 | 'name' => 'calc_fields_typography', |
| 1909 | 'selector' => $this->selector( '__calculated-field' ), |
| 1910 | ) |
| 1911 | ); |
| 1912 | |
| 1913 | $this->add_control( |
| 1914 | 'calc_fields_color', |
| 1915 | array( |
| 1916 | 'label' => __( 'Color', 'jet-form-builder' ), |
| 1917 | 'type' => Controls_Manager::COLOR, |
| 1918 | 'selectors' => array( |
| 1919 | $this->selector( '__calculated-field' ) => 'color: {{VALUE}}', |
| 1920 | ), |
| 1921 | ) |
| 1922 | ); |
| 1923 | |
| 1924 | $this->add_control( |
| 1925 | 'calc_fields_prefix_color', |
| 1926 | array( |
| 1927 | 'label' => __( 'Prefix Color', 'jet-form-builder' ), |
| 1928 | 'type' => Controls_Manager::COLOR, |
| 1929 | 'selectors' => array( |
| 1930 | $this->selector( '__calculated-field-prefix' ) => 'color: {{VALUE}}', |
| 1931 | ), |
| 1932 | ) |
| 1933 | ); |
| 1934 | |
| 1935 | $this->add_responsive_control( |
| 1936 | 'calc_fields_prefix_size', |
| 1937 | array( |
| 1938 | 'label' => __( 'Prefix size', 'jet-form-builder' ), |
| 1939 | 'type' => Controls_Manager::SLIDER, |
| 1940 | 'size_units' => array( 'px', 'em', 'rem', 'custom' ), |
| 1941 | 'range' => array( |
| 1942 | 'px' => array( |
| 1943 | 'min' => 10, |
| 1944 | 'max' => 50, |
| 1945 | ), |
| 1946 | ), |
| 1947 | 'selectors' => array( |
| 1948 | $this->selector( '__calculated-field-prefix' ) => 'font-size: {{SIZE}}{{UNIT}};', |
| 1949 | ), |
| 1950 | ) |
| 1951 | ); |
| 1952 | |
| 1953 | $this->add_control( |
| 1954 | 'calc_fields_suffix_color', |
| 1955 | array( |
| 1956 | 'label' => __( 'Suffix Color', 'jet-form-builder' ), |
| 1957 | 'type' => Controls_Manager::COLOR, |
| 1958 | 'selectors' => array( |
| 1959 | $this->selector( '__calculated-field-suffix' ) => 'color: {{VALUE}}', |
| 1960 | ), |
| 1961 | ) |
| 1962 | ); |
| 1963 | |
| 1964 | $this->add_responsive_control( |
| 1965 | 'calc_fields_suffix_size', |
| 1966 | array( |
| 1967 | 'label' => __( 'Suffix size', 'jet-form-builder' ), |
| 1968 | 'type' => Controls_Manager::SLIDER, |
| 1969 | 'size_units' => array( 'px', 'em', 'rem', 'custom' ), |
| 1970 | 'range' => array( |
| 1971 | 'px' => array( |
| 1972 | 'min' => 10, |
| 1973 | 'max' => 50, |
| 1974 | ), |
| 1975 | ), |
| 1976 | 'selectors' => array( |
| 1977 | $this->selector( '__calculated-field-suffix' ) => 'font-size: {{SIZE}}{{UNIT}};', |
| 1978 | ), |
| 1979 | ) |
| 1980 | ); |
| 1981 | |
| 1982 | $this->add_control( |
| 1983 | 'calc_fields_background_color', |
| 1984 | array( |
| 1985 | 'label' => __( 'Background Color', 'jet-form-builder' ), |
| 1986 | 'type' => Controls_Manager::COLOR, |
| 1987 | 'selectors' => array( |
| 1988 | $this->selector( '__calculated-field' ) => 'background-color: {{VALUE}}', |
| 1989 | ), |
| 1990 | ) |
| 1991 | ); |
| 1992 | |
| 1993 | $this->add_responsive_control( |
| 1994 | 'calc_fields_padding', |
| 1995 | array( |
| 1996 | 'label' => __( 'Padding', 'jet-form-builder' ), |
| 1997 | 'type' => Controls_Manager::DIMENSIONS, |
| 1998 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 1999 | 'selectors' => array( |
| 2000 | $this->selector( '__calculated-field' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2001 | ), |
| 2002 | ) |
| 2003 | ); |
| 2004 | |
| 2005 | $this->add_responsive_control( |
| 2006 | 'calc_fields_margin', |
| 2007 | array( |
| 2008 | 'label' => __( 'Margin', 'jet-form-builder' ), |
| 2009 | 'type' => Controls_Manager::DIMENSIONS, |
| 2010 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 2011 | 'selectors' => array( |
| 2012 | $this->selector( '__calculated-field' ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2013 | ), |
| 2014 | ) |
| 2015 | ); |
| 2016 | |
| 2017 | $this->add_group_control( |
| 2018 | Group_Control_Border::get_type(), |
| 2019 | array( |
| 2020 | 'name' => 'calc_fields_border', |
| 2021 | 'label' => __( 'Border', 'jet-form-builder' ), |
| 2022 | 'placeholder' => '1px', |
| 2023 | 'selector' => $this->selector( '__calculated-field' ), |
| 2024 | ) |
| 2025 | ); |
| 2026 | |
| 2027 | $this->add_responsive_control( |
| 2028 | 'calc_fields_border_radius', |
| 2029 | array( |
| 2030 | 'label' => __( 'Border Radius', 'jet-form-builder' ), |
| 2031 | 'type' => Controls_Manager::DIMENSIONS, |
| 2032 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 2033 | 'selectors' => array( |
| 2034 | $this->selector( '__calculated-field' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2035 | ), |
| 2036 | ) |
| 2037 | ); |
| 2038 | |
| 2039 | $this->add_responsive_control( |
| 2040 | 'calc_fields_flex_align', |
| 2041 | array( |
| 2042 | 'label' => __( 'Content Align', 'jet-form-builder' ), |
| 2043 | 'type' => Controls_Manager::SELECT, |
| 2044 | 'options' => array( |
| 2045 | '' => __( 'Default', 'jet-form-builder' ), |
| 2046 | 'start' => __( 'Left', 'jet-form-builder' ), |
| 2047 | 'center' => __( 'Center', 'jet-form-builder' ), |
| 2048 | 'end' => __( 'Right', 'jet-form-builder' ), |
| 2049 | 'space-between' => __( 'Space Between', 'jet-form-builder' ), |
| 2050 | 'space-evenly' => __( 'Space Evenly', 'jet-form-builder' ), |
| 2051 | 'space-around' => __( 'Space Around', 'jet-form-builder' ), |
| 2052 | ), |
| 2053 | 'selectors' => array( |
| 2054 | $this->selector( '__calculated-field' ) => 'justify-content: {{VALUE}};', |
| 2055 | ), |
| 2056 | ) |
| 2057 | ); |
| 2058 | |
| 2059 | $this->end_controls_section(); |
| 2060 | } |
| 2061 | |
| 2062 | private function section_range_fields_style() { |
| 2063 | $this->start_controls_section( |
| 2064 | 'section_range_fields_style', |
| 2065 | array( |
| 2066 | 'label' => __( 'Range Fields', 'jet-form-builder' ), |
| 2067 | 'tab' => Controls_Manager::TAB_STYLE, |
| 2068 | ) |
| 2069 | ); |
| 2070 | |
| 2071 | $this->add_responsive_control( |
| 2072 | 'range_max_width', |
| 2073 | array( |
| 2074 | 'label' => esc_html__( 'Max Width', 'jet-form-builder' ), |
| 2075 | 'type' => Controls_Manager::SLIDER, |
| 2076 | 'size_units' => array( 'px', 'em', 'rem', 'custom' ), |
| 2077 | 'range' => array( |
| 2078 | 'px' => array( |
| 2079 | 'min' => 1, |
| 2080 | 'max' => 1000, |
| 2081 | ), |
| 2082 | ), |
| 2083 | 'selectors' => array( |
| 2084 | $this->selector( '__field-wrap.range-wrap' ) => 'max-width: {{SIZE}}{{UNIT}};', |
| 2085 | ), |
| 2086 | ) |
| 2087 | ); |
| 2088 | |
| 2089 | $this->add_control( |
| 2090 | 'range_slider_heading', |
| 2091 | array( |
| 2092 | 'label' => esc_html__( 'Slider', 'jet-form-builder' ), |
| 2093 | 'type' => Controls_Manager::HEADING, |
| 2094 | 'separator' => 'before', |
| 2095 | ) |
| 2096 | ); |
| 2097 | |
| 2098 | $this->add_responsive_control( |
| 2099 | 'track_height', |
| 2100 | array( |
| 2101 | 'label' => esc_html__( 'Track Height', 'jet-form-builder' ), |
| 2102 | 'type' => Controls_Manager::SLIDER, |
| 2103 | 'size_units' => array( 'px', 'em', 'rem', 'custom' ), |
| 2104 | 'range' => array( |
| 2105 | 'px' => array( |
| 2106 | 'min' => 1, |
| 2107 | 'max' => 20, |
| 2108 | ), |
| 2109 | ), |
| 2110 | 'selectors' => array( |
| 2111 | $this->selector( ' .range-field::-webkit-slider-runnable-track' ) => 'height: {{SIZE}}{{UNIT}};', |
| 2112 | $this->selector( ' .range-field::-moz-range-track' ) => 'height: {{SIZE}}{{UNIT}};', |
| 2113 | $this->selector( ' .range-field::-ms-track' ) => 'height: {{SIZE}}{{UNIT}};', |
| 2114 | $this->selector( ' .range-field::-webkit-slider-thumb' ) => 'margin-top: calc( (18px - {{SIZE}}{{UNIT}})/-2 )', |
| 2115 | ), |
| 2116 | ) |
| 2117 | ); |
| 2118 | |
| 2119 | $this->add_responsive_control( |
| 2120 | 'thumb_size', |
| 2121 | array( |
| 2122 | 'label' => esc_html__( 'Thumb Size', 'jet-form-builder' ), |
| 2123 | 'type' => Controls_Manager::SLIDER, |
| 2124 | 'size_units' => array( 'px', 'em', 'rem', 'custom' ), |
| 2125 | 'range' => array( |
| 2126 | 'px' => array( |
| 2127 | 'min' => 1, |
| 2128 | 'max' => 50, |
| 2129 | ), |
| 2130 | ), |
| 2131 | 'selectors' => array( |
| 2132 | $this->selector( '__field.range-field' ) => 'min-height: {{SIZE}}{{UNIT}};', |
| 2133 | $this->selector( '__field.range-field::-webkit-slider-thumb' ) => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}; margin-top: calc( ({{SIZE}}{{UNIT}} - 4px)/-2 )', |
| 2134 | $this->selector( '__field.range-field::-moz-range-thumb' ) => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};', |
| 2135 | $this->selector( '__field.range-field::-ms-thumb' ) => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};', |
| 2136 | ), |
| 2137 | ) |
| 2138 | ); |
| 2139 | |
| 2140 | $this->add_control( |
| 2141 | 'thumb_indent', |
| 2142 | array( |
| 2143 | 'type' => Controls_Manager::HIDDEN, |
| 2144 | 'default' => 'style', |
| 2145 | 'selectors' => array( |
| 2146 | $this->selector( '__field.range-field::-webkit-slider-thumb' ) => 'margin-top: calc( ({{thumb_size.SIZE}}{{thumb_size.UNIT}} - {{track_height.SIZE}}{{track_height.UNIT}})/-2 )', |
| 2147 | ), |
| 2148 | ) |
| 2149 | ); |
| 2150 | |
| 2151 | $this->add_control( |
| 2152 | 'track_border_radius', |
| 2153 | array( |
| 2154 | 'label' => esc_html__( 'Track Border Radius', 'jet-form-builder' ), |
| 2155 | 'type' => Controls_Manager::DIMENSIONS, |
| 2156 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 2157 | 'selectors' => array( |
| 2158 | $this->selector( '__field.range-field::-webkit-slider-runnable-track' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2159 | $this->selector( '__field.range-field::-moz-range-track' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2160 | $this->selector( '__field.range-field::-ms-track' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2161 | ), |
| 2162 | ) |
| 2163 | ); |
| 2164 | |
| 2165 | $this->add_control( |
| 2166 | 'thumb_border_radius', |
| 2167 | array( |
| 2168 | 'label' => esc_html__( 'Thumb Border Radius', 'jet-form-builder' ), |
| 2169 | 'type' => Controls_Manager::DIMENSIONS, |
| 2170 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 2171 | 'selectors' => array( |
| 2172 | $this->selector( '__field.range-field::-webkit-slider-thumb' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2173 | $this->selector( '__field.range-field::-moz-range-thumb' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2174 | $this->selector( '__field.range-field::-ms-thumb' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2175 | ), |
| 2176 | ) |
| 2177 | ); |
| 2178 | |
| 2179 | $this->add_control( |
| 2180 | 'track_bg_color', |
| 2181 | array( |
| 2182 | 'label' => esc_html__( 'Track Color', 'jet-form-builder' ), |
| 2183 | 'type' => Controls_Manager::COLOR, |
| 2184 | 'selectors' => array( |
| 2185 | $this->selector( '__field.range-field::-webkit-slider-runnable-track' ) => 'background-color: {{VALUE}};', |
| 2186 | $this->selector( '__field.range-field::-moz-range-track' ) => 'background-color: {{VALUE}};', |
| 2187 | $this->selector( '__field.range-field::-ms-track' ) => 'background-color: {{VALUE}};', |
| 2188 | ), |
| 2189 | ) |
| 2190 | ); |
| 2191 | |
| 2192 | $this->add_control( |
| 2193 | 'thumb_bg_color', |
| 2194 | array( |
| 2195 | 'label' => esc_html__( 'Thumb Color', 'jet-form-builder' ), |
| 2196 | 'type' => Controls_Manager::COLOR, |
| 2197 | 'selectors' => array( |
| 2198 | $this->selector( '__field.range-field::-webkit-slider-thumb' ) => 'background-color: {{VALUE}};', |
| 2199 | $this->selector( '__field.range-field::-moz-range-thumb' ) => 'background-color: {{VALUE}};', |
| 2200 | $this->selector( '__field.range-field::-ms-thumb' ) => 'background-color: {{VALUE}};', |
| 2201 | ), |
| 2202 | ) |
| 2203 | ); |
| 2204 | |
| 2205 | $this->add_control( |
| 2206 | 'range_value_heading', |
| 2207 | array( |
| 2208 | 'label' => esc_html__( 'Value', 'jet-form-builder' ), |
| 2209 | 'type' => Controls_Manager::HEADING, |
| 2210 | 'separator' => 'before', |
| 2211 | ) |
| 2212 | ); |
| 2213 | |
| 2214 | $this->add_group_control( |
| 2215 | Group_Control_Typography::get_type(), |
| 2216 | array( |
| 2217 | 'name' => 'range_value_typography', |
| 2218 | 'selector' => $this->selector( '__field-value.range-value' ), |
| 2219 | ) |
| 2220 | ); |
| 2221 | |
| 2222 | $this->add_control( |
| 2223 | 'range_value_color', |
| 2224 | array( |
| 2225 | 'label' => esc_html__( 'Color', 'jet-form-builder' ), |
| 2226 | 'type' => Controls_Manager::COLOR, |
| 2227 | 'selectors' => array( |
| 2228 | $this->selector( '__field-value.range-value' ) => 'color: {{VALUE}};', |
| 2229 | ), |
| 2230 | ) |
| 2231 | ); |
| 2232 | |
| 2233 | $this->add_responsive_control( |
| 2234 | 'range_prefix_value_size', |
| 2235 | array( |
| 2236 | 'label' => __( 'Prefix size', 'jet-form-builder' ), |
| 2237 | 'type' => Controls_Manager::SLIDER, |
| 2238 | 'size_units' => array( 'px', 'em', 'rem', 'custom' ), |
| 2239 | 'range' => array( |
| 2240 | 'px' => array( |
| 2241 | 'min' => 10, |
| 2242 | 'max' => 50, |
| 2243 | ), |
| 2244 | ), |
| 2245 | 'selectors' => array( |
| 2246 | $this->selector( '__field-value.range-value .%s__field-value-prefix' ) => 'font-size: {{SIZE}}{{UNIT}};', |
| 2247 | ), |
| 2248 | 'separator' => 'before', |
| 2249 | ) |
| 2250 | ); |
| 2251 | |
| 2252 | $this->add_control( |
| 2253 | 'range_prefix_value_color', |
| 2254 | array( |
| 2255 | 'label' => __( 'Prefix Color', 'jet-form-builder' ), |
| 2256 | 'type' => Controls_Manager::COLOR, |
| 2257 | 'selectors' => array( |
| 2258 | $this->selector( '__field-value.range-value .%s__field-value-prefix' ) => 'color: {{VALUE}};', |
| 2259 | ), |
| 2260 | ) |
| 2261 | ); |
| 2262 | |
| 2263 | $this->add_responsive_control( |
| 2264 | 'range_suffix_value_size', |
| 2265 | array( |
| 2266 | 'label' => __( 'Suffix size', 'jet-form-builder' ), |
| 2267 | 'type' => Controls_Manager::SLIDER, |
| 2268 | 'size_units' => array( 'px', 'em', 'rem', 'custom' ), |
| 2269 | 'range' => array( |
| 2270 | 'px' => array( |
| 2271 | 'min' => 10, |
| 2272 | 'max' => 50, |
| 2273 | ), |
| 2274 | ), |
| 2275 | 'selectors' => array( |
| 2276 | $this->selector( '__field-value.range-value .%s__field-value-suffix' ) => 'font-size: {{SIZE}}{{UNIT}};', |
| 2277 | ), |
| 2278 | 'separator' => 'before', |
| 2279 | ) |
| 2280 | ); |
| 2281 | |
| 2282 | $this->add_control( |
| 2283 | 'range_suffix_value_color', |
| 2284 | array( |
| 2285 | 'label' => __( 'Suffix Color', 'jet-form-builder' ), |
| 2286 | 'type' => Controls_Manager::COLOR, |
| 2287 | 'selectors' => array( |
| 2288 | $this->selector( '__field-value.range-value .%s__field-value-suffix' ) => 'color: {{VALUE}};', |
| 2289 | ), |
| 2290 | ) |
| 2291 | ); |
| 2292 | |
| 2293 | $this->end_controls_section(); |
| 2294 | } |
| 2295 | |
| 2296 | private function section_headings_style() { |
| 2297 | $this->start_controls_section( |
| 2298 | 'section_headings_style', |
| 2299 | array( |
| 2300 | 'label' => __( 'Heading', 'jet-form-builder' ), |
| 2301 | 'tab' => Controls_Manager::TAB_STYLE, |
| 2302 | 'show_label' => false, |
| 2303 | ) |
| 2304 | ); |
| 2305 | |
| 2306 | $this->add_control( |
| 2307 | 'field_heading_styles_heading', |
| 2308 | array( |
| 2309 | 'label' => esc_html__( 'Label', 'jet-form-builder' ), |
| 2310 | 'type' => Controls_Manager::HEADING, |
| 2311 | 'separator' => 'before', |
| 2312 | ) |
| 2313 | ); |
| 2314 | |
| 2315 | $this->add_group_control( |
| 2316 | Group_Control_Typography::get_type(), |
| 2317 | array( |
| 2318 | 'name' => 'field_heading_typography', |
| 2319 | 'selector' => $this->selector( '__heading' ), |
| 2320 | ) |
| 2321 | ); |
| 2322 | |
| 2323 | $this->add_control( |
| 2324 | 'fields_heading_color', |
| 2325 | array( |
| 2326 | 'label' => __( 'Color', 'jet-form-builder' ), |
| 2327 | 'type' => Controls_Manager::COLOR, |
| 2328 | 'selectors' => array( |
| 2329 | $this->selector( '__heading' ) => 'color: {{VALUE}}', |
| 2330 | ), |
| 2331 | ) |
| 2332 | ); |
| 2333 | |
| 2334 | $this->add_responsive_control( |
| 2335 | 'fields_heading_gap', |
| 2336 | array( |
| 2337 | 'label' => __( 'Gap', 'jet-form-builder' ), |
| 2338 | 'type' => Controls_Manager::DIMENSIONS, |
| 2339 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 2340 | 'selectors' => array( |
| 2341 | $this->selector( '__heading' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2342 | ), |
| 2343 | ) |
| 2344 | ); |
| 2345 | |
| 2346 | $this->add_control( |
| 2347 | 'field_heading_styles_desc', |
| 2348 | array( |
| 2349 | 'label' => esc_html__( 'Description', 'jet-form-builder' ), |
| 2350 | 'type' => Controls_Manager::HEADING, |
| 2351 | 'separator' => 'before', |
| 2352 | ) |
| 2353 | ); |
| 2354 | |
| 2355 | $this->add_group_control( |
| 2356 | Group_Control_Typography::get_type(), |
| 2357 | array( |
| 2358 | 'name' => 'field_desc_typography', |
| 2359 | 'selector' => $this->selector( '__heading-desc' ), |
| 2360 | ) |
| 2361 | ); |
| 2362 | |
| 2363 | $this->add_control( |
| 2364 | 'fields_desc_color', |
| 2365 | array( |
| 2366 | 'label' => __( 'Color', 'jet-form-builder' ), |
| 2367 | 'type' => Controls_Manager::COLOR, |
| 2368 | 'selectors' => array( |
| 2369 | $this->selector( '__heading-desc' ) => 'color: {{VALUE}}', |
| 2370 | ), |
| 2371 | ) |
| 2372 | ); |
| 2373 | |
| 2374 | $this->add_responsive_control( |
| 2375 | 'fields_heading_desc_gap', |
| 2376 | array( |
| 2377 | 'label' => __( 'Gap', 'jet-form-builder' ), |
| 2378 | 'type' => Controls_Manager::DIMENSIONS, |
| 2379 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 2380 | 'selectors' => array( |
| 2381 | $this->selector( '__heading-desc' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2382 | ), |
| 2383 | ) |
| 2384 | ); |
| 2385 | |
| 2386 | $this->end_controls_section(); |
| 2387 | } |
| 2388 | |
| 2389 | private function section_repeater_style() { |
| 2390 | $this->start_controls_section( |
| 2391 | 'section_repeater_style', |
| 2392 | array( |
| 2393 | 'label' => __( 'Repeater', 'jet-form-builder' ), |
| 2394 | 'tab' => Controls_Manager::TAB_STYLE, |
| 2395 | 'show_label' => false, |
| 2396 | ) |
| 2397 | ); |
| 2398 | |
| 2399 | $this->add_control( |
| 2400 | 'field_repeater_row_desc', |
| 2401 | array( |
| 2402 | 'label' => esc_html__( 'Repeater row', 'jet-form-builder' ), |
| 2403 | 'type' => Controls_Manager::HEADING, |
| 2404 | 'separator' => 'before', |
| 2405 | ) |
| 2406 | ); |
| 2407 | |
| 2408 | $this->add_responsive_control( |
| 2409 | 'booking_form_repeater_row_padding', |
| 2410 | array( |
| 2411 | 'label' => esc_html__( 'Padding', 'jet-form-builder' ), |
| 2412 | 'type' => Controls_Manager::DIMENSIONS, |
| 2413 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 2414 | 'selectors' => array( |
| 2415 | $this->selector( '-repeater__row' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2416 | ), |
| 2417 | ) |
| 2418 | ); |
| 2419 | |
| 2420 | $this->add_control( |
| 2421 | 'field_repeater_new_desc', |
| 2422 | array( |
| 2423 | 'label' => esc_html__( 'New item button', 'jet-form-builder' ), |
| 2424 | 'type' => Controls_Manager::HEADING, |
| 2425 | 'separator' => 'before', |
| 2426 | ) |
| 2427 | ); |
| 2428 | |
| 2429 | $this->start_controls_tabs( 'tabs_booking_form_repeater_style' ); |
| 2430 | |
| 2431 | $this->start_controls_tab( |
| 2432 | 'booking_form_repeater_normal', |
| 2433 | array( |
| 2434 | 'label' => esc_html__( 'Normal', 'jet-form-builder' ), |
| 2435 | ) |
| 2436 | ); |
| 2437 | |
| 2438 | $this->add_control( |
| 2439 | 'booking_form_repeater_bg_color', |
| 2440 | array( |
| 2441 | 'label' => esc_html__( 'Background Color', 'jet-form-builder' ), |
| 2442 | 'type' => Controls_Manager::COLOR, |
| 2443 | 'selectors' => array( |
| 2444 | $this->selector( '-repeater__new' ) => 'background-color: {{VALUE}};', |
| 2445 | ), |
| 2446 | ) |
| 2447 | ); |
| 2448 | |
| 2449 | $this->add_control( |
| 2450 | 'booking_form_repeater_color', |
| 2451 | array( |
| 2452 | 'label' => esc_html__( 'Text Color', 'jet-form-builder' ), |
| 2453 | 'type' => Controls_Manager::COLOR, |
| 2454 | 'selectors' => array( |
| 2455 | $this->selector( '-repeater__new' ) => 'color: {{VALUE}};', |
| 2456 | ), |
| 2457 | ) |
| 2458 | ); |
| 2459 | |
| 2460 | $this->end_controls_tab(); |
| 2461 | |
| 2462 | $this->start_controls_tab( |
| 2463 | 'booking_form_repeater_hover', |
| 2464 | array( |
| 2465 | 'label' => esc_html__( 'Hover', 'jet-form-builder' ), |
| 2466 | ) |
| 2467 | ); |
| 2468 | |
| 2469 | $this->add_control( |
| 2470 | 'booking_form_repeater_bg_color_hover', |
| 2471 | array( |
| 2472 | 'label' => esc_html__( 'Background Color', 'jet-form-builder' ), |
| 2473 | 'type' => Controls_Manager::COLOR, |
| 2474 | 'selectors' => array( |
| 2475 | $this->selector( '-repeater__new:hover' ) => 'background-color: {{VALUE}};', |
| 2476 | ), |
| 2477 | ) |
| 2478 | ); |
| 2479 | |
| 2480 | $this->add_control( |
| 2481 | 'booking_form_repeater_color_hover', |
| 2482 | array( |
| 2483 | 'label' => esc_html__( 'Text Color', 'jet-form-builder' ), |
| 2484 | 'type' => Controls_Manager::COLOR, |
| 2485 | 'selectors' => array( |
| 2486 | $this->selector( '-repeater__new:hover' ) => 'color: {{VALUE}}', |
| 2487 | ), |
| 2488 | ) |
| 2489 | ); |
| 2490 | |
| 2491 | $this->add_control( |
| 2492 | 'booking_form_repeater_hover_border_color', |
| 2493 | array( |
| 2494 | 'label' => esc_html__( 'Border Color', 'jet-form-builder' ), |
| 2495 | 'type' => Controls_Manager::COLOR, |
| 2496 | 'condition' => array( |
| 2497 | 'booking_form_repeater_border_border!' => '', |
| 2498 | ), |
| 2499 | 'selectors' => array( |
| 2500 | $this->selector( '-repeater__new:hover' ) => 'border-color: {{VALUE}};', |
| 2501 | ), |
| 2502 | ) |
| 2503 | ); |
| 2504 | |
| 2505 | $this->end_controls_tab(); |
| 2506 | |
| 2507 | $this->end_controls_tabs(); |
| 2508 | |
| 2509 | $this->add_group_control( |
| 2510 | Group_Control_Typography::get_type(), |
| 2511 | array( |
| 2512 | 'name' => 'booking_form_repeater_typography', |
| 2513 | 'selector' => $this->selector( '-repeater__new' ), |
| 2514 | 'fields_options' => array( |
| 2515 | 'typography' => array( |
| 2516 | 'separator' => 'before', |
| 2517 | ), |
| 2518 | ), |
| 2519 | ) |
| 2520 | ); |
| 2521 | |
| 2522 | $this->add_responsive_control( |
| 2523 | 'booking_form_repeater_padding', |
| 2524 | array( |
| 2525 | 'label' => esc_html__( 'Padding', 'jet-form-builder' ), |
| 2526 | 'type' => Controls_Manager::DIMENSIONS, |
| 2527 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 2528 | 'selectors' => array( |
| 2529 | $this->selector( '-repeater__new' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2530 | ), |
| 2531 | ) |
| 2532 | ); |
| 2533 | |
| 2534 | $this->add_responsive_control( |
| 2535 | 'booking_form_repeater_margin', |
| 2536 | array( |
| 2537 | 'label' => esc_html__( 'Margin', 'jet-form-builder' ), |
| 2538 | 'type' => Controls_Manager::DIMENSIONS, |
| 2539 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 2540 | 'selectors' => array( |
| 2541 | $this->selector( '-repeater__new' ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2542 | ), |
| 2543 | ) |
| 2544 | ); |
| 2545 | |
| 2546 | $this->add_group_control( |
| 2547 | Group_Control_Border::get_type(), |
| 2548 | array( |
| 2549 | 'name' => 'booking_form_repeater_border', |
| 2550 | 'label' => esc_html__( 'Border', 'jet-form-builder' ), |
| 2551 | 'placeholder' => '1px', |
| 2552 | 'selector' => $this->selector( '-repeater__new' ), |
| 2553 | ) |
| 2554 | ); |
| 2555 | |
| 2556 | $this->add_responsive_control( |
| 2557 | 'booking_form_repeater_border_radius', |
| 2558 | array( |
| 2559 | 'label' => esc_html__( 'Border Radius', 'jet-form-builder' ), |
| 2560 | 'type' => Controls_Manager::DIMENSIONS, |
| 2561 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 2562 | 'selectors' => array( |
| 2563 | $this->selector( '-repeater__new' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2564 | ), |
| 2565 | ) |
| 2566 | ); |
| 2567 | |
| 2568 | $this->add_group_control( |
| 2569 | Group_Control_Box_Shadow::get_type(), |
| 2570 | array( |
| 2571 | 'name' => 'booking_form_repeater_box_shadow', |
| 2572 | 'selector' => $this->selector( '-repeater__new' ), |
| 2573 | ) |
| 2574 | ); |
| 2575 | |
| 2576 | $this->add_responsive_control( |
| 2577 | 'booking_form_repeater_alignment', |
| 2578 | array( |
| 2579 | 'label' => esc_html__( 'Alignment', 'jet-form-builder' ), |
| 2580 | 'type' => Controls_Manager::CHOOSE, |
| 2581 | 'options' => array( |
| 2582 | 'flex-start' => array( |
| 2583 | 'title' => esc_html__( 'Start', 'jet-form-builder' ), |
| 2584 | 'icon' => ! is_rtl() ? 'eicon-h-align-left' : 'eicon-h-align-right', |
| 2585 | ), |
| 2586 | 'center' => array( |
| 2587 | 'title' => esc_html__( 'Center', 'jet-form-builder' ), |
| 2588 | 'icon' => 'eicon-h-align-center', |
| 2589 | ), |
| 2590 | 'flex-end' => array( |
| 2591 | 'title' => esc_html__( 'End', 'jet-form-builder' ), |
| 2592 | 'icon' => ! is_rtl() ? 'eicon-h-align-right' : 'eicon-h-align-left', |
| 2593 | ), |
| 2594 | ), |
| 2595 | 'selectors' => array( |
| 2596 | $this->selector( '-repeater__actions' ) => 'justify-content: {{VALUE}};', |
| 2597 | ), |
| 2598 | ) |
| 2599 | ); |
| 2600 | |
| 2601 | $this->add_control( |
| 2602 | 'field_repeater_del_desc', |
| 2603 | array( |
| 2604 | 'label' => esc_html__( 'Remove item button', 'jet-form-builder' ), |
| 2605 | 'type' => Controls_Manager::HEADING, |
| 2606 | 'separator' => 'before', |
| 2607 | ) |
| 2608 | ); |
| 2609 | |
| 2610 | $this->start_controls_tabs( 'tabs_booking_form_repeater_del_style' ); |
| 2611 | |
| 2612 | $this->start_controls_tab( |
| 2613 | 'booking_form_repeater_del_normal', |
| 2614 | array( |
| 2615 | 'label' => esc_html__( 'Normal', 'jet-form-builder' ), |
| 2616 | ) |
| 2617 | ); |
| 2618 | |
| 2619 | $this->add_control( |
| 2620 | 'booking_form_repeater_del_bg_color', |
| 2621 | array( |
| 2622 | 'label' => esc_html__( 'Background Color', 'jet-form-builder' ), |
| 2623 | 'type' => Controls_Manager::COLOR, |
| 2624 | 'selectors' => array( |
| 2625 | $this->selector( '-repeater__remove' ) => 'background-color: {{VALUE}}', |
| 2626 | ), |
| 2627 | ) |
| 2628 | ); |
| 2629 | |
| 2630 | $this->add_control( |
| 2631 | 'booking_form_repeater_del_color', |
| 2632 | array( |
| 2633 | 'label' => esc_html__( 'Text Color', 'jet-form-builder' ), |
| 2634 | 'type' => Controls_Manager::COLOR, |
| 2635 | 'selectors' => array( |
| 2636 | $this->selector( '-repeater__remove' ) => 'color: {{VALUE}}', |
| 2637 | ), |
| 2638 | ) |
| 2639 | ); |
| 2640 | |
| 2641 | $this->end_controls_tab(); |
| 2642 | |
| 2643 | $this->start_controls_tab( |
| 2644 | 'booking_form_repeater_del_hover', |
| 2645 | array( |
| 2646 | 'label' => esc_html__( 'Hover', 'jet-form-builder' ), |
| 2647 | ) |
| 2648 | ); |
| 2649 | |
| 2650 | $this->add_control( |
| 2651 | 'booking_form_repeater_del_bg_color_hover', |
| 2652 | array( |
| 2653 | 'label' => esc_html__( 'Background Color', 'jet-form-builder' ), |
| 2654 | 'type' => Controls_Manager::COLOR, |
| 2655 | 'selectors' => array( |
| 2656 | $this->selector( '-repeater__remove:hover' ) => 'background-color: {{VALUE}}', |
| 2657 | ), |
| 2658 | ) |
| 2659 | ); |
| 2660 | |
| 2661 | $this->add_control( |
| 2662 | 'booking_form_repeater_del_color_hover', |
| 2663 | array( |
| 2664 | 'label' => esc_html__( 'Text Color', 'jet-form-builder' ), |
| 2665 | 'type' => Controls_Manager::COLOR, |
| 2666 | 'selectors' => array( |
| 2667 | $this->selector( '-repeater__remove:hover' ) => 'color: {{VALUE}}', |
| 2668 | ), |
| 2669 | ) |
| 2670 | ); |
| 2671 | |
| 2672 | $this->add_control( |
| 2673 | 'booking_form_repeater_del_hover_border_color', |
| 2674 | array( |
| 2675 | 'label' => esc_html__( 'Border Color', 'jet-form-builder' ), |
| 2676 | 'type' => Controls_Manager::COLOR, |
| 2677 | 'condition' => array( |
| 2678 | 'booking_form_repeater_del_border_border!' => '', |
| 2679 | ), |
| 2680 | 'selectors' => array( |
| 2681 | $this->selector( '-repeater__remove:hover' ) => 'border-color: {{VALUE}};', |
| 2682 | ), |
| 2683 | ) |
| 2684 | ); |
| 2685 | |
| 2686 | $this->end_controls_tab(); |
| 2687 | |
| 2688 | $this->end_controls_tabs(); |
| 2689 | |
| 2690 | $this->add_responsive_control( |
| 2691 | 'booking_form_repeater_del_padding', |
| 2692 | array( |
| 2693 | 'label' => esc_html__( 'Padding', 'jet-form-builder' ), |
| 2694 | 'type' => Controls_Manager::DIMENSIONS, |
| 2695 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 2696 | 'separator' => 'before', |
| 2697 | 'selectors' => array( |
| 2698 | $this->selector( '-repeater__remove' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2699 | ), |
| 2700 | ) |
| 2701 | ); |
| 2702 | |
| 2703 | $this->add_responsive_control( |
| 2704 | 'booking_form_repeater_del_margin', |
| 2705 | array( |
| 2706 | 'label' => esc_html__( 'Margin', 'jet-form-builder' ), |
| 2707 | 'type' => Controls_Manager::DIMENSIONS, |
| 2708 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 2709 | 'selectors' => array( |
| 2710 | $this->selector( '-repeater__remove' ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2711 | ), |
| 2712 | ) |
| 2713 | ); |
| 2714 | |
| 2715 | $this->add_group_control( |
| 2716 | Group_Control_Border::get_type(), |
| 2717 | array( |
| 2718 | 'name' => 'booking_form_repeater_del_border', |
| 2719 | 'label' => esc_html__( 'Border', 'jet-form-builder' ), |
| 2720 | 'placeholder' => '1px', |
| 2721 | 'selector' => $this->selector( '-repeater__remove' ), |
| 2722 | ) |
| 2723 | ); |
| 2724 | |
| 2725 | $this->add_responsive_control( |
| 2726 | 'booking_form_repeater_del_border_radius', |
| 2727 | array( |
| 2728 | 'label' => esc_html__( 'Border Radius', 'jet-form-builder' ), |
| 2729 | 'type' => Controls_Manager::DIMENSIONS, |
| 2730 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 2731 | 'selectors' => array( |
| 2732 | $this->selector( '-repeater__remove' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2733 | ), |
| 2734 | ) |
| 2735 | ); |
| 2736 | |
| 2737 | $this->add_responsive_control( |
| 2738 | 'booking_form_repeater_del_size', |
| 2739 | array( |
| 2740 | 'label' => esc_html__( 'Icon Size', 'jet-form-builder' ), |
| 2741 | 'type' => Controls_Manager::SLIDER, |
| 2742 | 'size_units' => array( 'px', 'em', 'rem', 'custom' ), |
| 2743 | 'range' => array( |
| 2744 | 'px' => array( |
| 2745 | 'min' => 12, |
| 2746 | 'max' => 90, |
| 2747 | ), |
| 2748 | ), |
| 2749 | 'selectors' => array( |
| 2750 | $this->selector( '-repeater__remove' ) => 'font-size: {{SIZE}}{{UNIT}};line-height: {{SIZE}}{{UNIT}};', |
| 2751 | ), |
| 2752 | ) |
| 2753 | ); |
| 2754 | |
| 2755 | $this->add_group_control( |
| 2756 | Group_Control_Box_Shadow::get_type(), |
| 2757 | array( |
| 2758 | 'name' => 'booking_form_repeater_del_box_shadow', |
| 2759 | 'selector' => $this->selector( '-repeater__remove' ), |
| 2760 | ) |
| 2761 | ); |
| 2762 | |
| 2763 | $this->add_responsive_control( |
| 2764 | 'booking_form_repeater_del_alignment', |
| 2765 | array( |
| 2766 | 'label' => esc_html__( 'Alignment', 'jet-form-builder' ), |
| 2767 | 'type' => Controls_Manager::CHOOSE, |
| 2768 | 'default' => 'flex-start', |
| 2769 | 'options' => array( |
| 2770 | 'flex-start' => array( |
| 2771 | 'title' => esc_html__( 'Top', 'jet-form-builder' ), |
| 2772 | 'icon' => 'eicon-v-align-top', |
| 2773 | ), |
| 2774 | 'center' => array( |
| 2775 | 'title' => esc_html__( 'Middle', 'jet-form-builder' ), |
| 2776 | 'icon' => 'eicon-v-align-middle', |
| 2777 | ), |
| 2778 | 'flex-end' => array( |
| 2779 | 'title' => esc_html__( 'Bottom', 'jet-form-builder' ), |
| 2780 | 'icon' => 'eicon-v-align-bottom', |
| 2781 | ), |
| 2782 | ), |
| 2783 | 'selectors' => array( |
| 2784 | $this->selector( '-repeater__row-remove' ) => 'align-self: {{VALUE}};', |
| 2785 | ), |
| 2786 | ) |
| 2787 | ); |
| 2788 | |
| 2789 | $this->end_controls_section(); |
| 2790 | } |
| 2791 | |
| 2792 | private function conditional_style() { |
| 2793 | $this->start_controls_section( |
| 2794 | 'conditional_style', |
| 2795 | array( |
| 2796 | 'label' => esc_html__( 'Conditional block', 'jet-form-builder' ), |
| 2797 | 'tab' => Controls_Manager::TAB_STYLE, |
| 2798 | 'show_label' => false, |
| 2799 | ) |
| 2800 | ); |
| 2801 | |
| 2802 | $this->add_responsive_control( |
| 2803 | 'conditional_padding', |
| 2804 | array( |
| 2805 | 'label' => esc_html__( 'Padding', 'jet-form-builder' ), |
| 2806 | 'type' => Controls_Manager::DIMENSIONS, |
| 2807 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 2808 | 'selectors' => array( |
| 2809 | $this->selector( '__conditional' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2810 | ), |
| 2811 | ) |
| 2812 | ); |
| 2813 | |
| 2814 | $this->add_responsive_control( |
| 2815 | 'conditional_margin', |
| 2816 | array( |
| 2817 | 'label' => esc_html__( 'Margin', 'jet-form-builder' ), |
| 2818 | 'type' => Controls_Manager::DIMENSIONS, |
| 2819 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 2820 | 'selectors' => array( |
| 2821 | $this->selector( '__conditional' ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2822 | ), |
| 2823 | ) |
| 2824 | ); |
| 2825 | |
| 2826 | $this->add_group_control( |
| 2827 | Group_Control_Border::get_type(), |
| 2828 | array( |
| 2829 | 'name' => 'conditional_border', |
| 2830 | 'label' => esc_html__( 'Border', 'jet-form-builder' ), |
| 2831 | 'placeholder' => '1px', |
| 2832 | 'selector' => $this->selector( '__conditional' ), |
| 2833 | ) |
| 2834 | ); |
| 2835 | |
| 2836 | $this->add_responsive_control( |
| 2837 | 'conditional_border_radius', |
| 2838 | array( |
| 2839 | 'label' => esc_html__( 'Border Radius', 'jet-form-builder' ), |
| 2840 | 'type' => Controls_Manager::DIMENSIONS, |
| 2841 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 2842 | 'selectors' => array( |
| 2843 | $this->selector( '__conditional' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2844 | ), |
| 2845 | ) |
| 2846 | ); |
| 2847 | |
| 2848 | $this->add_group_control( |
| 2849 | Group_Control_Box_Shadow::get_type(), |
| 2850 | array( |
| 2851 | 'name' => 'conditional_box_shadow', |
| 2852 | 'selector' => $this->selector( '__conditional' ), |
| 2853 | ) |
| 2854 | ); |
| 2855 | |
| 2856 | $this->add_control( |
| 2857 | 'conditional_bg_color', |
| 2858 | array( |
| 2859 | 'label' => esc_html__( 'Background Color', 'jet-form-builder' ), |
| 2860 | 'type' => Controls_Manager::COLOR, |
| 2861 | 'selectors' => array( |
| 2862 | $this->selector( '__conditional' ) => 'background-color: {{VALUE}}', |
| 2863 | ), |
| 2864 | ) |
| 2865 | ); |
| 2866 | |
| 2867 | $this->end_controls_section(); |
| 2868 | } |
| 2869 | |
| 2870 | private function form_submit_style() { |
| 2871 | $this->start_controls_section( |
| 2872 | 'form_submit_style', |
| 2873 | array( |
| 2874 | 'label' => esc_html__( 'Submit', 'jet-form-builder' ), |
| 2875 | 'tab' => Controls_Manager::TAB_STYLE, |
| 2876 | 'show_label' => false, |
| 2877 | ) |
| 2878 | ); |
| 2879 | |
| 2880 | $this->start_controls_tabs( 'tabs_booking_form_submit_style' ); |
| 2881 | |
| 2882 | $this->start_controls_tab( |
| 2883 | 'booking_form_submit_normal', |
| 2884 | array( |
| 2885 | 'label' => esc_html__( 'Normal', 'jet-form-builder' ), |
| 2886 | ) |
| 2887 | ); |
| 2888 | |
| 2889 | $this->add_control( |
| 2890 | 'booking_form_submit_bg_color', |
| 2891 | array( |
| 2892 | 'label' => esc_html__( 'Background Color', 'jet-form-builder' ), |
| 2893 | 'type' => Controls_Manager::COLOR, |
| 2894 | 'selectors' => array( |
| 2895 | $this->selector( '__action-button' ) => 'background-color: {{VALUE}}', |
| 2896 | ), |
| 2897 | ) |
| 2898 | ); |
| 2899 | |
| 2900 | $this->add_control( |
| 2901 | 'booking_form_submit_color', |
| 2902 | array( |
| 2903 | 'label' => esc_html__( 'Text Color', 'jet-form-builder' ), |
| 2904 | 'type' => Controls_Manager::COLOR, |
| 2905 | 'selectors' => array( |
| 2906 | $this->selector( '__action-button' ) => 'color: {{VALUE}}', |
| 2907 | ), |
| 2908 | ) |
| 2909 | ); |
| 2910 | |
| 2911 | $this->end_controls_tab(); |
| 2912 | |
| 2913 | $this->start_controls_tab( |
| 2914 | 'booking_form_submit_hover', |
| 2915 | array( |
| 2916 | 'label' => esc_html__( 'Hover', 'jet-form-builder' ), |
| 2917 | ) |
| 2918 | ); |
| 2919 | |
| 2920 | $this->add_control( |
| 2921 | 'booking_form_submit_bg_color_hover', |
| 2922 | array( |
| 2923 | 'label' => esc_html__( 'Background Color', 'jet-form-builder' ), |
| 2924 | 'type' => Controls_Manager::COLOR, |
| 2925 | 'selectors' => array( |
| 2926 | $this->selector( '__action-button:hover' ) => 'background-color: {{VALUE}}', |
| 2927 | ), |
| 2928 | ) |
| 2929 | ); |
| 2930 | |
| 2931 | $this->add_control( |
| 2932 | 'booking_form_submit_color_hover', |
| 2933 | array( |
| 2934 | 'label' => esc_html__( 'Text Color', 'jet-form-builder' ), |
| 2935 | 'type' => Controls_Manager::COLOR, |
| 2936 | 'selectors' => array( |
| 2937 | $this->selector( '__action-button:hover' ) => 'color: {{VALUE}}', |
| 2938 | ), |
| 2939 | ) |
| 2940 | ); |
| 2941 | |
| 2942 | $this->add_control( |
| 2943 | 'booking_form_submit_hover_border_color', |
| 2944 | array( |
| 2945 | 'label' => esc_html__( 'Border Color', 'jet-form-builder' ), |
| 2946 | 'type' => Controls_Manager::COLOR, |
| 2947 | 'condition' => array( |
| 2948 | 'booking_form_submit_border_border!' => '', |
| 2949 | ), |
| 2950 | 'selectors' => array( |
| 2951 | $this->selector( '__action-button:hover' ) => 'border-color: {{VALUE}};', |
| 2952 | ), |
| 2953 | ) |
| 2954 | ); |
| 2955 | |
| 2956 | $this->add_responsive_control( |
| 2957 | 'booking_form_submit_hover_transition', |
| 2958 | array( |
| 2959 | |
| 2960 | 'type' => Controls_Manager::SLIDER, |
| 2961 | 'label' => __( 'Transition Duration', 'jet-form-builder' ), |
| 2962 | 'size_units' => array( 's', 'ms', 'custom' ), |
| 2963 | 'default' => array( |
| 2964 | 'unit' => 's', |
| 2965 | 'size' => 0.3, |
| 2966 | ), |
| 2967 | 'selectors' => array( |
| 2968 | $this->selector( '__action-button' ) => 'transition: all {{SIZE}}{{UNIT}};', |
| 2969 | ), |
| 2970 | ) |
| 2971 | ); |
| 2972 | |
| 2973 | $this->end_controls_tab(); |
| 2974 | |
| 2975 | $this->end_controls_tabs(); |
| 2976 | |
| 2977 | $this->add_group_control( |
| 2978 | Group_Control_Typography::get_type(), |
| 2979 | array( |
| 2980 | 'name' => 'booking_form_submit_typography', |
| 2981 | 'selector' => $this->selector( '__action-button' ), |
| 2982 | ) |
| 2983 | ); |
| 2984 | |
| 2985 | $this->add_responsive_control( |
| 2986 | 'booking_form_submit_padding', |
| 2987 | array( |
| 2988 | 'label' => esc_html__( 'Padding', 'jet-form-builder' ), |
| 2989 | 'type' => Controls_Manager::DIMENSIONS, |
| 2990 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 2991 | 'separator' => 'before', |
| 2992 | 'selectors' => array( |
| 2993 | $this->selector( '__action-button' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2994 | ), |
| 2995 | ) |
| 2996 | ); |
| 2997 | |
| 2998 | $this->add_responsive_control( |
| 2999 | 'booking_form_submit_margin', |
| 3000 | array( |
| 3001 | 'label' => esc_html__( 'Margin', 'jet-form-builder' ), |
| 3002 | 'type' => Controls_Manager::DIMENSIONS, |
| 3003 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 3004 | 'selectors' => array( |
| 3005 | $this->selector( '__action-button' ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 3006 | ), |
| 3007 | ) |
| 3008 | ); |
| 3009 | |
| 3010 | $this->add_group_control( |
| 3011 | Group_Control_Border::get_type(), |
| 3012 | array( |
| 3013 | 'name' => 'booking_form_submit_border', |
| 3014 | 'label' => esc_html__( 'Border', 'jet-form-builder' ), |
| 3015 | 'placeholder' => '1px', |
| 3016 | 'selector' => $this->selector( '__action-button' ), |
| 3017 | ) |
| 3018 | ); |
| 3019 | |
| 3020 | $this->add_responsive_control( |
| 3021 | 'booking_form_submit_border_radius', |
| 3022 | array( |
| 3023 | 'label' => esc_html__( 'Border Radius', 'jet-form-builder' ), |
| 3024 | 'type' => Controls_Manager::DIMENSIONS, |
| 3025 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 3026 | 'selectors' => array( |
| 3027 | $this->selector( '__action-button' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 3028 | ), |
| 3029 | ) |
| 3030 | ); |
| 3031 | |
| 3032 | $this->add_group_control( |
| 3033 | Group_Control_Box_Shadow::get_type(), |
| 3034 | array( |
| 3035 | 'name' => 'booking_form_submit_box_shadow', |
| 3036 | 'selector' => $this->selector( '__action-button' ), |
| 3037 | ) |
| 3038 | ); |
| 3039 | |
| 3040 | $this->add_responsive_control( |
| 3041 | 'booking_form_submit_alignment', |
| 3042 | array( |
| 3043 | 'label' => esc_html__( 'Alignment', 'jet-form-builder' ), |
| 3044 | 'type' => Controls_Manager::CHOOSE, |
| 3045 | 'options' => array( |
| 3046 | 'flex-start' => array( |
| 3047 | 'title' => esc_html__( 'Start', 'jet-form-builder' ), |
| 3048 | 'icon' => ! is_rtl() ? 'eicon-h-align-left' : 'eicon-h-align-right', |
| 3049 | ), |
| 3050 | 'center' => array( |
| 3051 | 'title' => esc_html__( 'Center', 'jet-form-builder' ), |
| 3052 | 'icon' => 'eicon-h-align-center', |
| 3053 | ), |
| 3054 | 'flex-end' => array( |
| 3055 | 'title' => esc_html__( 'End', 'jet-form-builder' ), |
| 3056 | 'icon' => ! is_rtl() ? 'eicon-h-align-right' : 'eicon-h-align-left', |
| 3057 | ), |
| 3058 | 'stretch' => array( |
| 3059 | 'title' => esc_html__( 'Fullwidth', 'jet-form-builder' ), |
| 3060 | 'icon' => 'eicon-h-align-stretch', |
| 3061 | ), |
| 3062 | ), |
| 3063 | 'selectors' => array( |
| 3064 | $this->selector( '__submit-wrap' ) => 'justify-content: {{VALUE}}; align-items: {{VALUE}};', |
| 3065 | ), |
| 3066 | ) |
| 3067 | ); |
| 3068 | |
| 3069 | $this->add_control( |
| 3070 | 'booking_form_submit_alignment_hidden', |
| 3071 | array( |
| 3072 | 'type' => Controls_Manager::HIDDEN, |
| 3073 | 'default' => 'style', |
| 3074 | 'selectors' => array( |
| 3075 | $this->selector( '__submit-wrap > .%s__submit' ) => 'width: 100%', |
| 3076 | ), |
| 3077 | 'condition' => array( |
| 3078 | 'booking_form_submit_alignment' => 'stretch', |
| 3079 | ), |
| 3080 | ) |
| 3081 | ); |
| 3082 | |
| 3083 | $this->add_responsive_control( |
| 3084 | 'booking_form_submit_alignment_text', |
| 3085 | array( |
| 3086 | 'label' => esc_html__( 'Button Text Alignment', 'jet-form-builder' ), |
| 3087 | 'type' => Controls_Manager::CHOOSE, |
| 3088 | 'options' => array( |
| 3089 | 'flex-start' => array( |
| 3090 | 'title' => esc_html__( 'Start', 'jet-form-builder' ), |
| 3091 | 'icon' => ! is_rtl() ? 'eicon-h-align-left' : 'eicon-h-align-right', |
| 3092 | ), |
| 3093 | 'center' => array( |
| 3094 | 'title' => esc_html__( 'Center', 'jet-form-builder' ), |
| 3095 | 'icon' => 'eicon-h-align-center', |
| 3096 | ), |
| 3097 | 'flex-end' => array( |
| 3098 | 'title' => esc_html__( 'End', 'jet-form-builder' ), |
| 3099 | 'icon' => ! is_rtl() ? 'eicon-h-align-right' : 'eicon-h-align-left', |
| 3100 | ), |
| 3101 | ), |
| 3102 | 'selectors' => array( |
| 3103 | $this->selector( '__submit' ) => 'justify-content: {{VALUE}};', |
| 3104 | ), |
| 3105 | ) |
| 3106 | ); |
| 3107 | |
| 3108 | $this->end_controls_section(); |
| 3109 | } |
| 3110 | |
| 3111 | private function section_form_break_style() { |
| 3112 | $this->start_controls_section( |
| 3113 | 'section_form_break_style', |
| 3114 | array( |
| 3115 | 'label' => __( 'Form Break Row', 'jet-form-builder' ), |
| 3116 | 'tab' => Controls_Manager::TAB_STYLE, |
| 3117 | ) |
| 3118 | ); |
| 3119 | |
| 3120 | $this->add_control( |
| 3121 | 'form_break_notice', |
| 3122 | array( |
| 3123 | 'type' => 'notice', |
| 3124 | 'notice_type' => 'info', |
| 3125 | 'dismissible' => false, |
| 3126 | 'content' => esc_html__( 'Styles from this tab apply to the Next Page and Prev Page controls added through the Form Page Break block.', 'jet-form-builder' ), |
| 3127 | ) |
| 3128 | ); |
| 3129 | |
| 3130 | $this->add_responsive_control( |
| 3131 | 'form_break_gap', |
| 3132 | array( |
| 3133 | 'label' => __( 'Gap', 'jet-form-builder' ), |
| 3134 | 'type' => Controls_Manager::DIMENSIONS, |
| 3135 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 3136 | 'selectors' => array( |
| 3137 | $this->selector( '__next-page-wrap' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 3138 | ), |
| 3139 | ) |
| 3140 | ); |
| 3141 | |
| 3142 | $this->add_responsive_control( |
| 3143 | 'form_break_alignment', |
| 3144 | array( |
| 3145 | 'label' => __( 'Alignment', 'jet-form-builder' ), |
| 3146 | 'type' => Controls_Manager::CHOOSE, |
| 3147 | 'label_block' => false, |
| 3148 | 'default' => 'left', |
| 3149 | 'separator' => 'before', |
| 3150 | 'options' => array( |
| 3151 | 'left' => array( |
| 3152 | 'title' => __( 'Left', 'jet-form-builder' ), |
| 3153 | 'icon' => 'eicon-h-align-left', |
| 3154 | ), |
| 3155 | 'center' => array( |
| 3156 | 'title' => __( 'Center', 'jet-form-builder' ), |
| 3157 | 'icon' => 'eicon-h-align-center', |
| 3158 | ), |
| 3159 | 'right' => array( |
| 3160 | 'title' => __( 'Right', 'jet-form-builder' ), |
| 3161 | 'icon' => 'eicon-h-align-right', |
| 3162 | ), |
| 3163 | ), |
| 3164 | 'selectors' => array( |
| 3165 | $this->selector( '__next-page-wrap' ) => 'text-align: {{VALUE}};', |
| 3166 | ), |
| 3167 | ) |
| 3168 | ); |
| 3169 | |
| 3170 | $this->add_border( |
| 3171 | $this, |
| 3172 | 'form_break_border', |
| 3173 | $this->selector( '__next-page-wrap' ) |
| 3174 | ); |
| 3175 | |
| 3176 | $this->end_controls_section(); |
| 3177 | } |
| 3178 | |
| 3179 | private function section_form_break_next_style() { |
| 3180 | $this->start_controls_section( |
| 3181 | 'section_form_break_next_style', |
| 3182 | array( |
| 3183 | 'label' => __( 'Form Break Buttons', 'jet-form-builder' ), |
| 3184 | 'tab' => Controls_Manager::TAB_STYLE, |
| 3185 | ) |
| 3186 | ); |
| 3187 | |
| 3188 | $this->add_control( |
| 3189 | 'form_break_next_notice', |
| 3190 | array( |
| 3191 | 'type' => 'notice', |
| 3192 | 'notice_type' => 'info', |
| 3193 | 'dismissible' => false, |
| 3194 | 'content' => esc_html__( 'The styles from this tab apply to the Next Page and Prev Page added as separate blocks in the form.', 'jet-form-builder' ), |
| 3195 | ) |
| 3196 | ); |
| 3197 | |
| 3198 | $this->add_control( |
| 3199 | 'form_break_next_button__error_heading', |
| 3200 | array( |
| 3201 | 'label' => __( 'Next Button', 'jet-form-builder' ), |
| 3202 | 'type' => Controls_Manager::HEADING, |
| 3203 | 'separator' => 'after', |
| 3204 | ) |
| 3205 | ); |
| 3206 | |
| 3207 | $this->add_responsive_control( |
| 3208 | 'form_break_next_margin', |
| 3209 | array( |
| 3210 | 'label' => __( 'Margin', 'jet-form-builder' ), |
| 3211 | 'type' => Controls_Manager::DIMENSIONS, |
| 3212 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 3213 | 'selectors' => array( |
| 3214 | $this->selector( '__next-page' ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 3215 | ), |
| 3216 | ) |
| 3217 | ); |
| 3218 | |
| 3219 | $this->add_responsive_control( |
| 3220 | 'form_break_next_padding', |
| 3221 | array( |
| 3222 | 'label' => __( 'Padding', 'jet-form-builder' ), |
| 3223 | 'type' => Controls_Manager::DIMENSIONS, |
| 3224 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 3225 | 'selectors' => array( |
| 3226 | $this->selector( '__next-page' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 3227 | ), |
| 3228 | ) |
| 3229 | ); |
| 3230 | |
| 3231 | $this->add_responsive_control( |
| 3232 | 'form_break_next_justify', |
| 3233 | array( |
| 3234 | 'label' => __( 'Alignment', 'jet-form-builder' ), |
| 3235 | 'type' => Controls_Manager::CHOOSE, |
| 3236 | 'label_block' => false, |
| 3237 | 'options' => array( |
| 3238 | 'flex-start' => array( |
| 3239 | 'title' => __( 'Left', 'jet-form-builder' ), |
| 3240 | 'icon' => 'eicon-h-align-left', |
| 3241 | ), |
| 3242 | 'center' => array( |
| 3243 | 'title' => __( 'Center', 'jet-form-builder' ), |
| 3244 | 'icon' => 'eicon-h-align-center', |
| 3245 | ), |
| 3246 | 'flex-end' => array( |
| 3247 | 'title' => __( 'Right', 'jet-form-builder' ), |
| 3248 | 'icon' => 'eicon-h-align-right', |
| 3249 | ), |
| 3250 | ), |
| 3251 | 'selectors' => array( |
| 3252 | $this->selector( '-row .%s__action-button-wrapper[data-type="next"]' ) => 'justify-content: {{VALUE}};', |
| 3253 | ), |
| 3254 | ) |
| 3255 | ); |
| 3256 | |
| 3257 | $this->start_controls_tabs( 'form_break_next_styles' ); |
| 3258 | |
| 3259 | $this->start_controls_tab( |
| 3260 | 'form_break_next--normal', |
| 3261 | array( |
| 3262 | 'label' => __( 'Normal', 'jet-form-builder' ), |
| 3263 | ) |
| 3264 | ); |
| 3265 | |
| 3266 | $this->add_group_control( |
| 3267 | Group_Control_Typography::get_type(), |
| 3268 | array( |
| 3269 | 'name' => 'form_break_next_typography', |
| 3270 | 'selector' => $this->selector( '__next-page' ), |
| 3271 | ) |
| 3272 | ); |
| 3273 | |
| 3274 | $this->add_border( |
| 3275 | $this, |
| 3276 | 'form_break_next_border', |
| 3277 | $this->selector( '__next-page' ) |
| 3278 | ); |
| 3279 | |
| 3280 | $this->add_control( |
| 3281 | 'form_break_next_color--normal', |
| 3282 | array( |
| 3283 | 'label' => __( 'Color', 'jet-form-builder' ), |
| 3284 | 'type' => Controls_Manager::COLOR, |
| 3285 | 'selectors' => array( |
| 3286 | $this->selector( '__next-page' ) => 'color: {{VALUE}};', |
| 3287 | ), |
| 3288 | ) |
| 3289 | ); |
| 3290 | |
| 3291 | $this->add_control( |
| 3292 | 'form_break_next_bg_color--normal', |
| 3293 | array( |
| 3294 | 'label' => __( 'Background Color', 'jet-form-builder' ), |
| 3295 | 'type' => Controls_Manager::COLOR, |
| 3296 | 'selectors' => array( |
| 3297 | $this->selector( '__next-page' ) => 'background-color: {{VALUE}};', |
| 3298 | ), |
| 3299 | ) |
| 3300 | ); |
| 3301 | |
| 3302 | $this->end_controls_tab(); |
| 3303 | |
| 3304 | $this->start_controls_tab( |
| 3305 | 'form_break_next--hover', |
| 3306 | array( |
| 3307 | 'label' => __( 'Hover', 'jet-form-builder' ), |
| 3308 | ) |
| 3309 | ); |
| 3310 | |
| 3311 | $this->add_group_control( |
| 3312 | Group_Control_Typography::get_type(), |
| 3313 | array( |
| 3314 | 'name' => 'form_break_next_typography--hover', |
| 3315 | 'selector' => $this->selector( '__next-page:hover' ), |
| 3316 | ) |
| 3317 | ); |
| 3318 | |
| 3319 | $this->add_border( |
| 3320 | $this, |
| 3321 | 'form_break_next_border--hover', |
| 3322 | $this->selector( '__next-page:hover' ) |
| 3323 | ); |
| 3324 | |
| 3325 | $this->add_control( |
| 3326 | 'form_break_next_color--hover', |
| 3327 | array( |
| 3328 | 'label' => __( 'Color', 'jet-form-builder' ), |
| 3329 | 'type' => Controls_Manager::COLOR, |
| 3330 | 'selectors' => array( |
| 3331 | $this->selector( '__next-page:hover' ) => 'color: {{VALUE}};', |
| 3332 | ), |
| 3333 | ) |
| 3334 | ); |
| 3335 | $this->add_control( |
| 3336 | 'form_break_next_bg_color--hover', |
| 3337 | array( |
| 3338 | 'label' => __( 'Background Color', 'jet-form-builder' ), |
| 3339 | 'type' => Controls_Manager::COLOR, |
| 3340 | 'selectors' => array( |
| 3341 | $this->selector( '__next-page:hover' ) => 'background-color: {{VALUE}};', |
| 3342 | ), |
| 3343 | ) |
| 3344 | ); |
| 3345 | |
| 3346 | $this->end_controls_tab(); |
| 3347 | |
| 3348 | $options = Tab_Handler_Manager::get_options( 'options-tab' ); |
| 3349 | |
| 3350 | if ( $options['disable_next_button'] ?? false ) { |
| 3351 | $this->start_controls_tab( |
| 3352 | 'form_break_next--disabled', |
| 3353 | array( |
| 3354 | 'label' => __( 'Disabled', 'jet-form-builder' ), |
| 3355 | ) |
| 3356 | ); |
| 3357 | |
| 3358 | $this->add_group_control( |
| 3359 | Group_Control_Typography::get_type(), |
| 3360 | array( |
| 3361 | 'name' => 'form_break_next_typography--disabled', |
| 3362 | 'selector' => $this->selector( '__next-page:disabled' ), |
| 3363 | ) |
| 3364 | ); |
| 3365 | |
| 3366 | $this->add_border( |
| 3367 | $this, |
| 3368 | 'form_break_next_border--disabled', |
| 3369 | $this->selector( '__next-page:disabled' ) |
| 3370 | ); |
| 3371 | |
| 3372 | $this->add_control( |
| 3373 | 'form_break_next_color--disabled', |
| 3374 | array( |
| 3375 | 'label' => __( 'Color', 'jet-form-builder' ), |
| 3376 | 'type' => Controls_Manager::COLOR, |
| 3377 | 'selectors' => array( |
| 3378 | $this->selector( '__next-page:disabled' ) => 'color: {{VALUE}};', |
| 3379 | ), |
| 3380 | ) |
| 3381 | ); |
| 3382 | $this->add_control( |
| 3383 | 'form_break_next_bg_color--disabled', |
| 3384 | array( |
| 3385 | 'label' => __( 'Background Color', 'jet-form-builder' ), |
| 3386 | 'type' => Controls_Manager::COLOR, |
| 3387 | 'selectors' => array( |
| 3388 | $this->selector( '__next-page:disabled' ) => 'background-color: {{VALUE}};', |
| 3389 | ), |
| 3390 | ) |
| 3391 | ); |
| 3392 | |
| 3393 | $this->end_controls_tab(); |
| 3394 | } |
| 3395 | |
| 3396 | $this->end_controls_tabs(); |
| 3397 | |
| 3398 | $this->add_control( |
| 3399 | 'form_break_prev_button__error_heading', |
| 3400 | array( |
| 3401 | 'label' => __( 'Prev Button', 'jet-form-builder' ), |
| 3402 | 'type' => Controls_Manager::HEADING, |
| 3403 | 'separator' => 'before', |
| 3404 | ) |
| 3405 | ); |
| 3406 | |
| 3407 | $this->add_responsive_control( |
| 3408 | 'form_break_prev_margin', |
| 3409 | array( |
| 3410 | 'label' => __( 'Margin', 'jet-form-builder' ), |
| 3411 | 'type' => Controls_Manager::DIMENSIONS, |
| 3412 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 3413 | 'selectors' => array( |
| 3414 | $this->selector( '__prev-page' ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 3415 | ), |
| 3416 | ) |
| 3417 | ); |
| 3418 | |
| 3419 | $this->add_responsive_control( |
| 3420 | 'form_break_prev_padding', |
| 3421 | array( |
| 3422 | 'label' => __( 'Padding', 'jet-form-builder' ), |
| 3423 | 'type' => Controls_Manager::DIMENSIONS, |
| 3424 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 3425 | 'selectors' => array( |
| 3426 | $this->selector( '__prev-page' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 3427 | ), |
| 3428 | ) |
| 3429 | ); |
| 3430 | |
| 3431 | $this->add_responsive_control( |
| 3432 | 'form_break_prev_justify', |
| 3433 | array( |
| 3434 | 'label' => __( 'Alignment', 'jet-form-builder' ), |
| 3435 | 'type' => Controls_Manager::CHOOSE, |
| 3436 | 'label_block' => false, |
| 3437 | 'options' => array( |
| 3438 | 'flex-start' => array( |
| 3439 | 'title' => __( 'Left', 'jet-form-builder' ), |
| 3440 | 'icon' => 'eicon-h-align-left', |
| 3441 | ), |
| 3442 | 'center' => array( |
| 3443 | 'title' => __( 'Center', 'jet-form-builder' ), |
| 3444 | 'icon' => 'eicon-h-align-center', |
| 3445 | ), |
| 3446 | 'flex-end' => array( |
| 3447 | 'title' => __( 'Right', 'jet-form-builder' ), |
| 3448 | 'icon' => 'eicon-h-align-right', |
| 3449 | ), |
| 3450 | ), |
| 3451 | 'selectors' => array( |
| 3452 | $this->selector( '-row .%s__action-button-wrapper[data-type="prev"]' ) => 'justify-content: {{VALUE}};', |
| 3453 | ), |
| 3454 | ) |
| 3455 | ); |
| 3456 | |
| 3457 | $this->start_controls_tabs( 'form_break_prev_styles' ); |
| 3458 | |
| 3459 | $this->start_controls_tab( |
| 3460 | 'form_break_prev--normal', |
| 3461 | array( |
| 3462 | 'label' => __( 'Normal', 'jet-form-builder' ), |
| 3463 | ) |
| 3464 | ); |
| 3465 | |
| 3466 | $this->add_group_control( |
| 3467 | Group_Control_Typography::get_type(), |
| 3468 | array( |
| 3469 | 'name' => 'form_break_prev_typography', |
| 3470 | 'selector' => $this->selector( '__prev-page' ), |
| 3471 | ) |
| 3472 | ); |
| 3473 | |
| 3474 | $this->add_border( |
| 3475 | $this, |
| 3476 | 'form_break_prev_border', |
| 3477 | $this->selector( '__prev-page' ) |
| 3478 | ); |
| 3479 | |
| 3480 | $this->add_control( |
| 3481 | 'form_break_prev_color--normal', |
| 3482 | array( |
| 3483 | 'label' => __( 'Color', 'jet-form-builder' ), |
| 3484 | 'type' => Controls_Manager::COLOR, |
| 3485 | 'selectors' => array( |
| 3486 | $this->selector( '__prev-page' ) => 'color: {{VALUE}};', |
| 3487 | ), |
| 3488 | ) |
| 3489 | ); |
| 3490 | |
| 3491 | $this->add_control( |
| 3492 | 'form_break_prev_bg_color--normal', |
| 3493 | array( |
| 3494 | 'label' => __( 'Background Color', 'jet-form-builder' ), |
| 3495 | 'type' => Controls_Manager::COLOR, |
| 3496 | 'selectors' => array( |
| 3497 | $this->selector( '__prev-page' ) => 'background-color: {{VALUE}};', |
| 3498 | ), |
| 3499 | ) |
| 3500 | ); |
| 3501 | |
| 3502 | $this->end_controls_tab(); |
| 3503 | |
| 3504 | $this->start_controls_tab( |
| 3505 | 'form_break_prev--hover', |
| 3506 | array( |
| 3507 | 'label' => __( 'Hover', 'jet-form-builder' ), |
| 3508 | ) |
| 3509 | ); |
| 3510 | |
| 3511 | $this->add_group_control( |
| 3512 | Group_Control_Typography::get_type(), |
| 3513 | array( |
| 3514 | 'name' => 'form_break_prev_typography--hover', |
| 3515 | 'selector' => $this->selector( '__prev-page:hover' ), |
| 3516 | ) |
| 3517 | ); |
| 3518 | |
| 3519 | $this->add_border( |
| 3520 | $this, |
| 3521 | 'form_break_prev_border--hover', |
| 3522 | $this->selector( '__prev-page:hover' ) |
| 3523 | ); |
| 3524 | |
| 3525 | $this->add_control( |
| 3526 | 'form_break_prev_color--hover', |
| 3527 | array( |
| 3528 | 'label' => __( 'Color', 'jet-form-builder' ), |
| 3529 | 'type' => Controls_Manager::COLOR, |
| 3530 | 'selectors' => array( |
| 3531 | $this->selector( '__prev-page:hover' ) => 'color: {{VALUE}};', |
| 3532 | ), |
| 3533 | ) |
| 3534 | ); |
| 3535 | $this->add_control( |
| 3536 | 'form_break_prev_bg_color--hover', |
| 3537 | array( |
| 3538 | 'label' => __( 'Background Color', 'jet-form-builder' ), |
| 3539 | 'type' => Controls_Manager::COLOR, |
| 3540 | 'selectors' => array( |
| 3541 | $this->selector( '__prev-page:hover' ) => 'background-color: {{VALUE}};', |
| 3542 | ), |
| 3543 | ) |
| 3544 | ); |
| 3545 | |
| 3546 | $this->end_controls_tab(); |
| 3547 | $this->end_controls_tabs(); |
| 3548 | |
| 3549 | $this->end_controls_section(); |
| 3550 | } |
| 3551 | |
| 3552 | private function section_form_break_disabled_style() { |
| 3553 | $this->start_controls_section( |
| 3554 | 'section_form_break_disabled_style', |
| 3555 | array( |
| 3556 | 'label' => __( 'Form Break Disabled Message', 'jet-form-builder' ), |
| 3557 | 'tab' => Controls_Manager::TAB_STYLE, |
| 3558 | ) |
| 3559 | ); |
| 3560 | |
| 3561 | $this->add_responsive_control( |
| 3562 | 'form_break_disabled_margin', |
| 3563 | array( |
| 3564 | 'label' => __( 'Margin', 'jet-form-builder' ), |
| 3565 | 'type' => Controls_Manager::DIMENSIONS, |
| 3566 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 3567 | 'selectors' => array( |
| 3568 | $this->selector( '__next-page-msg' ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 3569 | ), |
| 3570 | ) |
| 3571 | ); |
| 3572 | |
| 3573 | $this->add_responsive_control( |
| 3574 | 'form_break_disabled_padding', |
| 3575 | array( |
| 3576 | 'label' => __( 'Padding', 'jet-form-builder' ), |
| 3577 | 'type' => Controls_Manager::DIMENSIONS, |
| 3578 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 3579 | 'selectors' => array( |
| 3580 | $this->selector( '__next-page-msg' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 3581 | ), |
| 3582 | ) |
| 3583 | ); |
| 3584 | |
| 3585 | $this->add_group_control( |
| 3586 | Group_Control_Typography::get_type(), |
| 3587 | array( |
| 3588 | 'name' => 'form_break_disabled_typography', |
| 3589 | 'selector' => $this->selector( '__next-page-msg' ), |
| 3590 | ) |
| 3591 | ); |
| 3592 | |
| 3593 | $this->add_border( |
| 3594 | $this, |
| 3595 | 'form_break_disabled_border', |
| 3596 | $this->selector( '__next-page-msg' ) |
| 3597 | ); |
| 3598 | |
| 3599 | $this->end_controls_section(); |
| 3600 | } |
| 3601 | |
| 3602 | private function section_message_error_style() { |
| 3603 | $this->start_controls_section( |
| 3604 | 'section_message_error_style', |
| 3605 | array( |
| 3606 | 'label' => __( 'Messages', 'jet-form-builder' ), |
| 3607 | 'tab' => Controls_Manager::TAB_STYLE, |
| 3608 | ) |
| 3609 | ); |
| 3610 | |
| 3611 | $this->start_controls_tabs( 'section_messages_tabs' ); |
| 3612 | |
| 3613 | $this->start_controls_tab( |
| 3614 | 'messages_success_tab', |
| 3615 | array( |
| 3616 | 'label' => __( 'Success Message', 'jet-form-builder' ), |
| 3617 | ) |
| 3618 | ); |
| 3619 | |
| 3620 | $this->add_responsive_control( |
| 3621 | 'form_success_margin', |
| 3622 | array( |
| 3623 | 'label' => __( 'Margin', 'jet-form-builder' ), |
| 3624 | 'type' => Controls_Manager::DIMENSIONS, |
| 3625 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 3626 | 'selectors' => array( |
| 3627 | $this->selector( '-message--success' ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 3628 | ), |
| 3629 | ) |
| 3630 | ); |
| 3631 | |
| 3632 | $this->add_responsive_control( |
| 3633 | 'form_success_padding', |
| 3634 | array( |
| 3635 | 'label' => __( 'Padding', 'jet-form-builder' ), |
| 3636 | 'type' => Controls_Manager::DIMENSIONS, |
| 3637 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 3638 | 'selectors' => array( |
| 3639 | $this->selector( '-message--success' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 3640 | ), |
| 3641 | ) |
| 3642 | ); |
| 3643 | |
| 3644 | $this->add_responsive_control( |
| 3645 | 'form_success_alignment', |
| 3646 | array( |
| 3647 | 'label' => __( 'Alignment', 'jet-form-builder' ), |
| 3648 | 'type' => Controls_Manager::CHOOSE, |
| 3649 | 'label_block' => false, |
| 3650 | 'default' => 'center', |
| 3651 | 'separator' => 'before', |
| 3652 | 'options' => array( |
| 3653 | 'left' => array( |
| 3654 | 'title' => __( 'Left', 'jet-form-builder' ), |
| 3655 | 'icon' => 'eicon-h-align-left', |
| 3656 | ), |
| 3657 | 'center' => array( |
| 3658 | 'title' => __( 'Center', 'jet-form-builder' ), |
| 3659 | 'icon' => 'eicon-h-align-center', |
| 3660 | ), |
| 3661 | 'right' => array( |
| 3662 | 'title' => __( 'Right', 'jet-form-builder' ), |
| 3663 | 'icon' => 'eicon-h-align-right', |
| 3664 | ), |
| 3665 | ), |
| 3666 | 'selectors' => array( |
| 3667 | $this->selector( '-message--success' ) => 'text-align: {{VALUE}};', |
| 3668 | ), |
| 3669 | ) |
| 3670 | ); |
| 3671 | |
| 3672 | $this->add_group_control( |
| 3673 | Group_Control_Typography::get_type(), |
| 3674 | array( |
| 3675 | 'name' => 'form_success_typography', |
| 3676 | 'selector' => $this->selector( '-message--success' ), |
| 3677 | ) |
| 3678 | ); |
| 3679 | |
| 3680 | $this->add_control( |
| 3681 | 'form_success_color', |
| 3682 | array( |
| 3683 | 'label' => __( 'Color', 'jet-form-builder' ), |
| 3684 | 'type' => Controls_Manager::COLOR, |
| 3685 | 'selectors' => array( |
| 3686 | $this->selector( '-message--success' ) => 'color: {{VALUE}};', |
| 3687 | ), |
| 3688 | ) |
| 3689 | ); |
| 3690 | $this->add_control( |
| 3691 | 'form_success_bg_color', |
| 3692 | array( |
| 3693 | 'label' => __( 'Background Color', 'jet-form-builder' ), |
| 3694 | 'type' => Controls_Manager::COLOR, |
| 3695 | 'selectors' => array( |
| 3696 | $this->selector( '-message--success' ) => 'background-color: {{VALUE}};', |
| 3697 | ), |
| 3698 | ) |
| 3699 | ); |
| 3700 | |
| 3701 | $this->add_border( |
| 3702 | $this, |
| 3703 | 'form_success_border', |
| 3704 | $this->selector( '-message--success' ) |
| 3705 | ); |
| 3706 | |
| 3707 | $this->end_controls_tab(); |
| 3708 | |
| 3709 | $this->start_controls_tab( |
| 3710 | 'messages_error_tab', |
| 3711 | array( |
| 3712 | 'label' => __( 'Error Message', 'jet-form-builder' ), |
| 3713 | ) |
| 3714 | ); |
| 3715 | |
| 3716 | $this->add_responsive_control( |
| 3717 | 'form_error_margin', |
| 3718 | array( |
| 3719 | 'label' => __( 'Margin', 'jet-form-builder' ), |
| 3720 | 'type' => Controls_Manager::DIMENSIONS, |
| 3721 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 3722 | 'selectors' => array( |
| 3723 | $this->selector( '-message--error' ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 3724 | ), |
| 3725 | ) |
| 3726 | ); |
| 3727 | |
| 3728 | $this->add_responsive_control( |
| 3729 | 'form_error_padding', |
| 3730 | array( |
| 3731 | 'label' => __( 'Padding', 'jet-form-builder' ), |
| 3732 | 'type' => Controls_Manager::DIMENSIONS, |
| 3733 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 3734 | 'selectors' => array( |
| 3735 | $this->selector( '-message--error' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 3736 | ), |
| 3737 | ) |
| 3738 | ); |
| 3739 | |
| 3740 | $this->add_responsive_control( |
| 3741 | 'form_error_alignment', |
| 3742 | array( |
| 3743 | 'label' => __( 'Alignment', 'jet-form-builder' ), |
| 3744 | 'type' => Controls_Manager::CHOOSE, |
| 3745 | 'label_block' => false, |
| 3746 | 'default' => 'center', |
| 3747 | 'separator' => 'before', |
| 3748 | 'options' => array( |
| 3749 | 'left' => array( |
| 3750 | 'title' => __( 'Left', 'jet-form-builder' ), |
| 3751 | 'icon' => 'eicon-h-align-left', |
| 3752 | ), |
| 3753 | 'center' => array( |
| 3754 | 'title' => __( 'Center', 'jet-form-builder' ), |
| 3755 | 'icon' => 'eicon-h-align-center', |
| 3756 | ), |
| 3757 | 'right' => array( |
| 3758 | 'title' => __( 'Right', 'jet-form-builder' ), |
| 3759 | 'icon' => 'eicon-h-align-right', |
| 3760 | ), |
| 3761 | ), |
| 3762 | 'selectors' => array( |
| 3763 | $this->selector( '-message--error' ) => 'text-align: {{VALUE}};', |
| 3764 | ), |
| 3765 | ) |
| 3766 | ); |
| 3767 | |
| 3768 | $this->add_group_control( |
| 3769 | Group_Control_Typography::get_type(), |
| 3770 | array( |
| 3771 | 'name' => 'form_error_typography', |
| 3772 | 'selector' => $this->selector( '-message--error' ), |
| 3773 | ) |
| 3774 | ); |
| 3775 | |
| 3776 | $this->add_control( |
| 3777 | 'form_error_color', |
| 3778 | array( |
| 3779 | 'label' => __( 'Color', 'jet-form-builder' ), |
| 3780 | 'type' => Controls_Manager::COLOR, |
| 3781 | 'selectors' => array( |
| 3782 | $this->selector( '-message--error' ) => 'color: {{VALUE}};', |
| 3783 | ), |
| 3784 | ) |
| 3785 | ); |
| 3786 | $this->add_control( |
| 3787 | 'form_error_bg_color', |
| 3788 | array( |
| 3789 | 'label' => __( 'Background Color', 'jet-form-builder' ), |
| 3790 | 'type' => Controls_Manager::COLOR, |
| 3791 | 'selectors' => array( |
| 3792 | $this->selector( '-message--error' ) => 'background-color: {{VALUE}};', |
| 3793 | ), |
| 3794 | ) |
| 3795 | ); |
| 3796 | |
| 3797 | $this->add_border( |
| 3798 | $this, |
| 3799 | 'form_error_border', |
| 3800 | $this->selector( '-message--error' ) |
| 3801 | ); |
| 3802 | |
| 3803 | $this->end_controls_tab(); |
| 3804 | $this->end_controls_tabs(); |
| 3805 | $this->end_controls_section(); |
| 3806 | } |
| 3807 | |
| 3808 | |
| 3809 | private function add_border( $instance, $control_id, $selector ) { |
| 3810 | $instance->add_group_control( |
| 3811 | Group_Control_Border::get_type(), |
| 3812 | array( |
| 3813 | 'name' => $control_id, |
| 3814 | 'label' => __( 'Border', 'jet-form-builder' ), |
| 3815 | 'placeholder' => '1px', |
| 3816 | 'selector' => $selector, |
| 3817 | ) |
| 3818 | ); |
| 3819 | $instance->add_responsive_control( |
| 3820 | $control_id . '_radius', |
| 3821 | array( |
| 3822 | 'label' => __( 'Border Radius', 'jet-form-builder' ), |
| 3823 | 'type' => Controls_Manager::DIMENSIONS, |
| 3824 | 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ), |
| 3825 | 'selectors' => array( |
| 3826 | $selector => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 3827 | ), |
| 3828 | ) |
| 3829 | ); |
| 3830 | } |
| 3831 | |
| 3832 | /** |
| 3833 | * Render the widget output on the frontend. |
| 3834 | * |
| 3835 | * Written in PHP and used to generate the final HTML. |
| 3836 | * |
| 3837 | * @since 1.1.0 |
| 3838 | * |
| 3839 | * @access protected |
| 3840 | */ |
| 3841 | protected function render() { |
| 3842 | wp_print_styles( 'wp-block-library' ); |
| 3843 | $settings = $this->get_settings_for_display(); |
| 3844 | |
| 3845 | // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 3846 | echo jet_fb_render_form( $settings ); |
| 3847 | } |
| 3848 | |
| 3849 | |
| 3850 | } |
| 3851 |