form.php
2608 lines
| 1 | <?php |
| 2 | |
| 3 | |
| 4 | namespace JFB_Compatibility\Bricks\Widgets; |
| 5 | |
| 6 | use Jet_Form_Builder\Blocks; |
| 7 | use Jet_Form_Builder\Plugin; |
| 8 | use Jet_Form_Builder\Classes\Tools; |
| 9 | use Jet_Form_Builder\Classes\Arguments\Form_Arguments; |
| 10 | |
| 11 | // If this file is called directly, abort. |
| 12 | if ( ! defined( 'WPINC' ) ) { |
| 13 | die; |
| 14 | } |
| 15 | |
| 16 | class Form extends Base { |
| 17 | |
| 18 | /** |
| 19 | * Use predefined element category 'general' |
| 20 | * |
| 21 | * @var string |
| 22 | */ |
| 23 | public $category = 'jet-form-builder'; |
| 24 | /** |
| 25 | * Make sure to prefix your elements |
| 26 | * |
| 27 | * @var string |
| 28 | */ |
| 29 | public $name = 'jet-form-builder-form'; |
| 30 | /** |
| 31 | * Themify icon font class |
| 32 | * |
| 33 | * @var string |
| 34 | */ |
| 35 | public $icon = 'jet-form-builder-icon-forms'; |
| 36 | /** |
| 37 | * Default CSS selector |
| 38 | * |
| 39 | * @var string |
| 40 | */ |
| 41 | public $css_selector = ''; |
| 42 | /** |
| 43 | * Script(s) run when element is rendered on frontend or updated in builder |
| 44 | * |
| 45 | * @var array |
| 46 | */ |
| 47 | public $scripts = array(); |
| 48 | |
| 49 | // Return localised element label |
| 50 | public function get_label() { |
| 51 | return esc_html__( 'JetForm', 'jet-form-builder' ); |
| 52 | } |
| 53 | |
| 54 | // Set builder control groups |
| 55 | public function set_control_groups() { |
| 56 | $this->control_group_form_settings(); |
| 57 | $this->control_group_form_style(); |
| 58 | $this->control_group_label_style(); |
| 59 | $this->control_group_description_style(); |
| 60 | $this->control_group_input_style(); |
| 61 | $this->control_group_checkradio_style(); |
| 62 | $this->control_group_calc_fields_style(); |
| 63 | $this->control_group_range_fields_style(); |
| 64 | $this->control_group_heading_style(); |
| 65 | $this->control_group_repeater_style(); |
| 66 | $this->control_group_conditional_style(); |
| 67 | $this->control_group_submit_style(); |
| 68 | $this->control_group_form_break_style(); |
| 69 | $this->control_group_form_break_buttons_style(); |
| 70 | $this->control_group_form_break_message_style(); |
| 71 | $this->control_group_form_progress_wrap_style(); |
| 72 | $this->control_group_form_progress_pages_style(); |
| 73 | $this->control_group_message_style(); |
| 74 | } |
| 75 | |
| 76 | // Set builder controls |
| 77 | public function set_controls() { |
| 78 | $this->controls_form_settings(); |
| 79 | $this->controls_form_style(); |
| 80 | $this->controls_label_style(); |
| 81 | $this->controls_description_style(); |
| 82 | $this->controls_input_style(); |
| 83 | $this->controls_checkradio_style(); |
| 84 | $this->controls_calc_fields_style(); |
| 85 | $this->controls_range_fields_style(); |
| 86 | $this->controls_heading_style(); |
| 87 | $this->controls_repeater_style(); |
| 88 | $this->controls_conditional_style(); |
| 89 | $this->controls_submit_style(); |
| 90 | $this->controls_form_break_style(); |
| 91 | $this->controls_form_break_buttons_style(); |
| 92 | $this->controls_form_break_message_style(); |
| 93 | $this->controls_form_progress_wrap_style(); |
| 94 | $this->controls_form_progress_pages_style(); |
| 95 | $this->controls_message_style(); |
| 96 | } |
| 97 | |
| 98 | // Start form settings |
| 99 | public function control_group_form_settings() { |
| 100 | $this->register_jet_control_group( |
| 101 | 'form_settings', |
| 102 | array( |
| 103 | 'title' => esc_html__( 'Form settings', 'jet-form-builder' ), |
| 104 | 'tab' => 'content', |
| 105 | ) |
| 106 | ); |
| 107 | } |
| 108 | |
| 109 | public function controls_form_settings() { |
| 110 | $options = Form_Arguments::get_options( true ); |
| 111 | |
| 112 | $this->start_jet_control_group( 'form_settings' ); |
| 113 | |
| 114 | $this->register_jet_control( |
| 115 | 'form_id', |
| 116 | array( |
| 117 | 'tab' => 'content', |
| 118 | 'label' => esc_html__( 'Choose Form', 'jet-form-builder' ), |
| 119 | 'type' => 'select', |
| 120 | 'options' => Tools::get_forms_list_for_js( true ), |
| 121 | 'searchable' => true, |
| 122 | ) |
| 123 | ); |
| 124 | |
| 125 | $this->register_jet_control( |
| 126 | 'fields_layout', |
| 127 | array( |
| 128 | 'tab' => 'content', |
| 129 | 'label' => esc_html__( 'Fields Layout', 'jet-form-builder' ), |
| 130 | 'type' => 'select', |
| 131 | 'options' => $options['fields_layout'], |
| 132 | ) |
| 133 | ); |
| 134 | |
| 135 | $this->register_jet_control( |
| 136 | 'required_mark', |
| 137 | array( |
| 138 | 'tab' => 'content', |
| 139 | 'label' => esc_html__( 'Required Mark', 'jet-form-builder' ), |
| 140 | 'type' => 'text', |
| 141 | 'default' => esc_html__( '*', 'jet-form-builder' ), |
| 142 | 'hasDynamicData' => false, |
| 143 | ) |
| 144 | ); |
| 145 | |
| 146 | $this->register_jet_control( |
| 147 | 'fields_label_tag', |
| 148 | array( |
| 149 | 'tab' => 'content', |
| 150 | 'label' => esc_html__( 'Fields label HTML tag', 'jet-form-builder' ), |
| 151 | 'type' => 'select', |
| 152 | 'options' => $options['fields_label_tag'], |
| 153 | ) |
| 154 | ); |
| 155 | |
| 156 | $this->register_jet_control( |
| 157 | 'submit_type', |
| 158 | array( |
| 159 | 'tab' => 'content', |
| 160 | 'label' => esc_html__( 'Submit Type', 'jet-form-builder' ), |
| 161 | 'type' => 'select', |
| 162 | 'options' => $options['submit_type'], |
| 163 | ) |
| 164 | ); |
| 165 | |
| 166 | $this->register_jet_control( |
| 167 | 'enable_progress', |
| 168 | array( |
| 169 | 'tab' => 'content', |
| 170 | 'label' => esc_html__( 'Enable form pages progress', 'jet-form-builder' ), |
| 171 | 'type' => 'checkbox', |
| 172 | 'default' => false, |
| 173 | ) |
| 174 | ); |
| 175 | |
| 176 | $this->end_jet_control_group(); |
| 177 | } |
| 178 | // End form settings |
| 179 | |
| 180 | // Start form style |
| 181 | public function control_group_form_style() { |
| 182 | $this->register_jet_control_group( |
| 183 | 'form_style', |
| 184 | array( |
| 185 | 'title' => esc_html__( 'Form Row', 'jet-form-builder' ), |
| 186 | 'tab' => 'style', |
| 187 | ) |
| 188 | ); |
| 189 | } |
| 190 | |
| 191 | public function controls_form_style() { |
| 192 | $this->start_jet_control_group( 'form_style' ); |
| 193 | |
| 194 | $this->register_jet_control( |
| 195 | 'form_row_gap_before', |
| 196 | array( |
| 197 | 'tab' => 'style', |
| 198 | 'label' => esc_html__( 'Gap Before', 'jet-form-builder' ), |
| 199 | 'type' => 'number', |
| 200 | 'units' => true, |
| 201 | 'min' => 1, |
| 202 | 'max' => 100, |
| 203 | 'css' => array( array( 'property' => '--jfb-row-mt' ) ), |
| 204 | ) |
| 205 | ); |
| 206 | |
| 207 | $this->register_jet_control( |
| 208 | 'form_row_gap_after', |
| 209 | array( |
| 210 | 'tab' => 'style', |
| 211 | 'label' => esc_html__( 'Gap After', 'jet-form-builder' ), |
| 212 | 'type' => 'number', |
| 213 | 'units' => true, |
| 214 | 'min' => 1, |
| 215 | 'max' => 100, |
| 216 | 'css' => array( array( 'property' => '--jfb-row-mb' ) ), |
| 217 | ) |
| 218 | ); |
| 219 | |
| 220 | $this->end_jet_control_group(); |
| 221 | } |
| 222 | // End form style |
| 223 | |
| 224 | // Start label style |
| 225 | public function control_group_label_style() { |
| 226 | $this->register_jet_control_group( |
| 227 | 'section_label_style', |
| 228 | array( |
| 229 | 'title' => esc_html__( 'Label', 'jet-form-builder' ), |
| 230 | 'tab' => 'style', |
| 231 | ) |
| 232 | ); |
| 233 | } |
| 234 | |
| 235 | public function controls_label_style() { |
| 236 | $this->start_jet_control_group( 'section_label_style' ); |
| 237 | |
| 238 | $css_selector = $this->css_selector( '__label' ); |
| 239 | $label_inner_selector = $this->css_selector( '__label-text' ); |
| 240 | |
| 241 | $this->register_jet_control( |
| 242 | 'label_typography', |
| 243 | array( |
| 244 | 'tab' => 'style', |
| 245 | 'label' => esc_html__( 'Typography', 'jet-form-builder' ), |
| 246 | 'type' => 'typography', |
| 247 | 'css' => array( |
| 248 | array( |
| 249 | 'property' => 'typography', |
| 250 | 'selector' => $label_inner_selector, |
| 251 | ), |
| 252 | ), |
| 253 | ) |
| 254 | ); |
| 255 | |
| 256 | $this->register_jet_control( |
| 257 | 'label_bg_color', |
| 258 | array( |
| 259 | 'tab' => 'style', |
| 260 | 'label' => esc_html__( 'Background color', 'jet-form-builder' ), |
| 261 | 'type' => 'color', |
| 262 | 'css' => array( array( 'property' => '--jfb-label-bgc' ) ), |
| 263 | ) |
| 264 | ); |
| 265 | |
| 266 | $this->register_jet_control( |
| 267 | 'label_margin', |
| 268 | array( |
| 269 | 'tab' => 'style', |
| 270 | 'label' => esc_html__( 'Margin', 'jet-form-builder' ), |
| 271 | 'type' => 'dimensions', |
| 272 | 'css' => array( |
| 273 | array( |
| 274 | 'property' => 'margin', |
| 275 | 'selector' => $css_selector, |
| 276 | ), |
| 277 | ), |
| 278 | ) |
| 279 | ); |
| 280 | |
| 281 | $this->register_jet_control( |
| 282 | 'label_padding', |
| 283 | array( |
| 284 | 'tab' => 'style', |
| 285 | 'label' => esc_html__( 'Padding', 'jet-form-builder' ), |
| 286 | 'type' => 'dimensions', |
| 287 | 'css' => array( |
| 288 | array( |
| 289 | 'property' => 'padding', |
| 290 | 'selector' => $css_selector, |
| 291 | ), |
| 292 | ), |
| 293 | ) |
| 294 | ); |
| 295 | |
| 296 | $this->register_jet_control( |
| 297 | 'label_border', |
| 298 | array( |
| 299 | 'tab' => 'style', |
| 300 | 'label' => esc_html__( 'Border', 'jet-form-builder' ), |
| 301 | 'type' => 'border', |
| 302 | 'css' => array( |
| 303 | array( |
| 304 | 'property' => 'border', |
| 305 | 'selector' => $css_selector, |
| 306 | ), |
| 307 | ), |
| 308 | ) |
| 309 | ); |
| 310 | |
| 311 | $this->register_jet_control( |
| 312 | 'form_required_mark', |
| 313 | array( |
| 314 | 'tab' => 'style', |
| 315 | 'type' => 'separator', |
| 316 | 'label' => esc_html__( 'Required Mark', 'jet-form-builder' ), |
| 317 | ) |
| 318 | ); |
| 319 | |
| 320 | $this->register_jet_control( |
| 321 | 'form_required_typography', |
| 322 | array( |
| 323 | 'tab' => 'style', |
| 324 | 'label' => esc_html__( 'Typography', 'jet-form-builder' ), |
| 325 | 'type' => 'typography', |
| 326 | 'css' => array( |
| 327 | array( |
| 328 | 'property' => 'typography', |
| 329 | 'selector' => $this->css_selector( '__required' ), |
| 330 | ), |
| 331 | ), |
| 332 | ) |
| 333 | ); |
| 334 | |
| 335 | $this->end_jet_control_group(); |
| 336 | } |
| 337 | // End label style |
| 338 | |
| 339 | // Start description style |
| 340 | public function control_group_description_style() { |
| 341 | $this->register_jet_control_group( |
| 342 | 'section_description_style', |
| 343 | array( |
| 344 | 'title' => esc_html__( 'Description', 'jet-form-builder' ), |
| 345 | 'tab' => 'style', |
| 346 | ) |
| 347 | ); |
| 348 | } |
| 349 | |
| 350 | public function controls_description_style() { |
| 351 | $this->start_jet_control_group( 'section_description_style' ); |
| 352 | |
| 353 | $css_selector = $this->css_selector( '__desc' ); |
| 354 | |
| 355 | $this->register_jet_control( |
| 356 | 'description_typography', |
| 357 | array( |
| 358 | 'tab' => 'style', |
| 359 | 'label' => esc_html__( 'Typography', 'jet-form-builder' ), |
| 360 | 'type' => 'typography', |
| 361 | 'css' => array( |
| 362 | array( |
| 363 | 'property' => 'typography', |
| 364 | 'selector' => $css_selector, |
| 365 | ), |
| 366 | ), |
| 367 | ) |
| 368 | ); |
| 369 | |
| 370 | $this->register_jet_control( |
| 371 | 'description_bg_color', |
| 372 | array( |
| 373 | 'tab' => 'style', |
| 374 | 'label' => esc_html__( 'Background color', 'jet-form-builder' ), |
| 375 | 'type' => 'color', |
| 376 | 'css' => array( array( 'property' => '--jfb-desc-bgc' ) ), |
| 377 | ) |
| 378 | ); |
| 379 | |
| 380 | $this->register_jet_control( |
| 381 | 'description_margin', |
| 382 | array( |
| 383 | 'tab' => 'style', |
| 384 | 'label' => esc_html__( 'Margin', 'jet-form-builder' ), |
| 385 | 'type' => 'dimensions', |
| 386 | 'css' => array( |
| 387 | array( |
| 388 | 'property' => 'margin', |
| 389 | 'selector' => $css_selector, |
| 390 | ), |
| 391 | ), |
| 392 | ) |
| 393 | ); |
| 394 | |
| 395 | $this->register_jet_control( |
| 396 | 'description_padding', |
| 397 | array( |
| 398 | 'tab' => 'style', |
| 399 | 'label' => esc_html__( 'Padding', 'jet-form-builder' ), |
| 400 | 'type' => 'dimensions', |
| 401 | 'css' => array( |
| 402 | array( |
| 403 | 'property' => 'padding', |
| 404 | 'selector' => $css_selector, |
| 405 | ), |
| 406 | ), |
| 407 | ) |
| 408 | ); |
| 409 | |
| 410 | $this->register_jet_control( |
| 411 | 'description_border', |
| 412 | array( |
| 413 | 'tab' => 'style', |
| 414 | 'label' => esc_html__( 'Border', 'jet-form-builder' ), |
| 415 | 'type' => 'border', |
| 416 | 'css' => array( |
| 417 | array( |
| 418 | 'property' => 'border', |
| 419 | 'selector' => $css_selector, |
| 420 | ), |
| 421 | ), |
| 422 | ) |
| 423 | ); |
| 424 | |
| 425 | $this->end_jet_control_group(); |
| 426 | } |
| 427 | // End description style |
| 428 | |
| 429 | // Start input style |
| 430 | public function control_group_input_style() { |
| 431 | $this->register_jet_control_group( |
| 432 | 'section_input_style', |
| 433 | array( |
| 434 | 'title' => esc_html__( 'Input fields', 'jet-form-builder' ), |
| 435 | 'tab' => 'style', |
| 436 | ) |
| 437 | ); |
| 438 | } |
| 439 | |
| 440 | public function controls_input_style() { |
| 441 | $repeater_class = $this->css_selector( '-repeater' ); |
| 442 | $css_selector = $this->css_selector( "__field:not(.checkradio-field):not(.range-field):not($repeater_class):not(.wysiwyg-field)" ); |
| 443 | |
| 444 | $this->start_jet_control_group( 'section_input_style' ); |
| 445 | |
| 446 | $this->register_jet_control( |
| 447 | 'input_typography', |
| 448 | array( |
| 449 | 'tab' => 'style', |
| 450 | 'label' => esc_html__( 'Typography', 'jet-form-builder' ), |
| 451 | 'type' => 'typography', |
| 452 | 'css' => array( |
| 453 | array( |
| 454 | 'property' => 'typography', |
| 455 | 'selector' => $css_selector, |
| 456 | ), |
| 457 | ), |
| 458 | ) |
| 459 | ); |
| 460 | |
| 461 | $this->register_jet_control( |
| 462 | 'input_placeholder_color', |
| 463 | array( |
| 464 | 'tab' => 'style', |
| 465 | 'label' => esc_html__( 'Placeholder color', 'jet-form-builder' ), |
| 466 | 'type' => 'color', |
| 467 | 'css' => array( array( 'property' => '--jfb-input-phc' ) ), |
| 468 | ) |
| 469 | ); |
| 470 | |
| 471 | $this->register_jet_control( |
| 472 | 'input_bg_color', |
| 473 | array( |
| 474 | 'tab' => 'style', |
| 475 | 'label' => esc_html__( 'Background color', 'jet-form-builder' ), |
| 476 | 'type' => 'color', |
| 477 | 'css' => array( |
| 478 | array( |
| 479 | 'property' => 'background-color', |
| 480 | 'selector' => $css_selector, |
| 481 | ), |
| 482 | ), |
| 483 | ) |
| 484 | ); |
| 485 | |
| 486 | $this->register_jet_control( |
| 487 | 'input_margin', |
| 488 | array( |
| 489 | 'tab' => 'style', |
| 490 | 'label' => esc_html__( 'Margin', 'jet-form-builder' ), |
| 491 | 'type' => 'dimensions', |
| 492 | 'css' => array( |
| 493 | array( |
| 494 | 'property' => 'margin', |
| 495 | 'selector' => $css_selector, |
| 496 | ), |
| 497 | ), |
| 498 | ) |
| 499 | ); |
| 500 | |
| 501 | $this->register_jet_control( |
| 502 | 'input_padding', |
| 503 | array( |
| 504 | 'tab' => 'style', |
| 505 | 'label' => esc_html__( 'Padding', 'jet-form-builder' ), |
| 506 | 'type' => 'dimensions', |
| 507 | 'css' => array( |
| 508 | array( |
| 509 | 'property' => 'padding', |
| 510 | 'selector' => $css_selector, |
| 511 | ), |
| 512 | ), |
| 513 | ) |
| 514 | ); |
| 515 | |
| 516 | $this->register_jet_control( |
| 517 | 'input_border', |
| 518 | array( |
| 519 | 'tab' => 'style', |
| 520 | 'label' => esc_html__( 'Border', 'jet-form-builder' ), |
| 521 | 'type' => 'border', |
| 522 | 'css' => array( |
| 523 | array( |
| 524 | 'property' => 'border', |
| 525 | 'selector' => $css_selector, |
| 526 | ), |
| 527 | ), |
| 528 | ) |
| 529 | ); |
| 530 | |
| 531 | $this->register_jet_control( |
| 532 | 'input_box_shadow', |
| 533 | array( |
| 534 | 'tab' => 'style', |
| 535 | 'label' => esc_html__( 'Box shadow', 'jet-form-builder' ), |
| 536 | 'type' => 'box-shadow', |
| 537 | 'css' => array( |
| 538 | array( |
| 539 | 'property' => 'box-shadow', |
| 540 | 'selector' => $css_selector, |
| 541 | ), |
| 542 | ), |
| 543 | ) |
| 544 | ); |
| 545 | |
| 546 | $this->register_jet_control( |
| 547 | 'input_width', |
| 548 | array( |
| 549 | 'tab' => 'style', |
| 550 | 'label' => esc_html__( 'Fields width', 'jet-form-builder' ), |
| 551 | 'type' => 'number', |
| 552 | 'units' => true, |
| 553 | 'min' => 50, |
| 554 | 'max' => 1000, |
| 555 | 'css' => array( array( 'property' => '--jfb-input-w' ) ), |
| 556 | ) |
| 557 | ); |
| 558 | |
| 559 | $this->register_jet_control( |
| 560 | 'input_textarea_height', |
| 561 | array( |
| 562 | 'tab' => 'style', |
| 563 | 'label' => esc_html__( 'Textarea height', 'jet-form-builder' ), |
| 564 | 'type' => 'number', |
| 565 | 'units' => true, |
| 566 | 'min' => 10, |
| 567 | 'max' => 500, |
| 568 | 'css' => array( array( 'property' => '--jfb-input-h' ) ), |
| 569 | ) |
| 570 | ); |
| 571 | |
| 572 | $this->register_jet_control( |
| 573 | 'input_color_scheme', |
| 574 | array( |
| 575 | 'tab' => 'style', |
| 576 | 'label' => esc_html__( 'Color scheme', 'jet-form-builder' ), |
| 577 | 'type' => 'select', |
| 578 | 'options' => array( |
| 579 | 'normal' => esc_html__( 'Normal', 'jet-form-builder' ), |
| 580 | 'light' => esc_html__( 'Light', 'jet-form-builder' ), |
| 581 | 'dark' => esc_html__( 'Dark', 'jet-form-builder' ), |
| 582 | ), |
| 583 | 'default' => 'normal', |
| 584 | 'description' => esc_html__( 'Affects default browser UI elements like date and time icons, UI etc.', 'jet-form-builder' ), |
| 585 | 'css' => array( array( 'property' => '--jfb-input-color-scheme' ) ), |
| 586 | ) |
| 587 | ); |
| 588 | |
| 589 | $this->end_jet_control_group(); |
| 590 | } |
| 591 | // End input style |
| 592 | |
| 593 | // Start checkbox & radio fields style |
| 594 | public function control_group_checkradio_style() { |
| 595 | $this->register_jet_control_group( |
| 596 | 'section_checkradio_style', |
| 597 | array( |
| 598 | 'title' => esc_html__( 'Checkbox & Radio fields', 'jet-form-builder' ), |
| 599 | 'tab' => 'style', |
| 600 | ) |
| 601 | ); |
| 602 | } |
| 603 | |
| 604 | public function controls_checkradio_style() { |
| 605 | $this->start_jet_control_group( 'section_checkradio_style' ); |
| 606 | |
| 607 | $this->register_jet_control( |
| 608 | 'checkradio_fields_layout', |
| 609 | array( |
| 610 | 'tab' => 'style', |
| 611 | 'label' => esc_html__( 'Layout', 'jet-form-builder' ), |
| 612 | 'type' => 'select', |
| 613 | 'options' => array( |
| 614 | 'inline-block' => esc_html__( 'Horizontal', 'jet-form-builder' ), |
| 615 | 'block' => esc_html__( 'Vertical', 'jet-form-builder' ), |
| 616 | ), |
| 617 | 'default' => 'block', |
| 618 | 'css' => array( array( 'property' => '--jfb-checkradio-d' ) ), |
| 619 | ) |
| 620 | ); |
| 621 | |
| 622 | $this->register_jet_control( |
| 623 | 'checkradio_fields_gap', |
| 624 | array( |
| 625 | 'tab' => 'style', |
| 626 | 'label' => esc_html__( 'Gap between control and label', 'jet-form-builder' ), |
| 627 | 'type' => 'number', |
| 628 | 'units' => true, |
| 629 | 'min' => 0, |
| 630 | 'max' => 50, |
| 631 | 'css' => array( array( 'property' => '--jfb-checkradio-mr' ) ), |
| 632 | ) |
| 633 | ); |
| 634 | |
| 635 | $this->register_jet_control( |
| 636 | 'checkradio_fields_control_size', |
| 637 | array( |
| 638 | 'tab' => 'style', |
| 639 | 'label' => esc_html__( 'Control size', 'jet-form-builder' ), |
| 640 | 'type' => 'number', |
| 641 | 'units' => true, |
| 642 | 'min' => 0, |
| 643 | 'max' => 50, |
| 644 | 'css' => array( array( 'property' => '--jfb-checkradio-fz' ) ), |
| 645 | ) |
| 646 | ); |
| 647 | |
| 648 | $this->register_jet_control( |
| 649 | 'checkradio_fields_typography', |
| 650 | array( |
| 651 | 'tab' => 'style', |
| 652 | 'label' => esc_html__( 'Typography', 'jet-form-builder' ), |
| 653 | 'type' => 'typography', |
| 654 | 'css' => array( |
| 655 | array( |
| 656 | 'property' => 'typography', |
| 657 | 'selector' => $this->css_selector( '__field-label' ), |
| 658 | ), |
| 659 | ), |
| 660 | ) |
| 661 | ); |
| 662 | |
| 663 | $this->register_jet_control( |
| 664 | 'checkradio_fields_box_heading', |
| 665 | array( |
| 666 | 'tab' => 'style', |
| 667 | 'type' => 'separator', |
| 668 | 'label' => esc_html__( 'Box', 'jet-form-builder' ), |
| 669 | ) |
| 670 | ); |
| 671 | |
| 672 | $this->register_jet_control( |
| 673 | 'checkradio_fields_box_border', |
| 674 | array( |
| 675 | 'tab' => 'style', |
| 676 | 'label' => esc_html__( 'Border', 'jet-form-builder' ), |
| 677 | 'type' => 'border', |
| 678 | 'css' => array( |
| 679 | array( |
| 680 | 'property' => 'border', |
| 681 | 'selector' => $this->css_selector( '__field-label > span::before' ), |
| 682 | ), |
| 683 | ), |
| 684 | ) |
| 685 | ); |
| 686 | |
| 687 | $this->register_jet_control( |
| 688 | 'checkradio_fields_box_bg_color', |
| 689 | array( |
| 690 | 'tab' => 'style', |
| 691 | 'label' => esc_html__( 'Background color', 'jet-form-builder' ), |
| 692 | 'type' => 'color', |
| 693 | 'css' => array( array( 'property' => '--jfb-checkradio-input-bgc' ) ), |
| 694 | ) |
| 695 | ); |
| 696 | |
| 697 | $this->register_jet_control( |
| 698 | 'checkradio_fields_box_checked_heading', |
| 699 | array( |
| 700 | 'tab' => 'style', |
| 701 | 'type' => 'separator', |
| 702 | 'label' => esc_html__( 'Checked state', 'jet-form-builder' ), |
| 703 | ) |
| 704 | ); |
| 705 | |
| 706 | $this->register_jet_control( |
| 707 | 'checkradio_fields_box_checked_bg', |
| 708 | array( |
| 709 | 'tab' => 'style', |
| 710 | 'label' => esc_html__( 'Background color', 'jet-form-builder' ), |
| 711 | 'type' => 'color', |
| 712 | 'css' => array( array( 'property' => '--jfb-checkradio-input-checked-bgc' ) ), |
| 713 | ) |
| 714 | ); |
| 715 | |
| 716 | $this->register_jet_control( |
| 717 | 'checkradio_fields_box_checked_border_color', |
| 718 | array( |
| 719 | 'tab' => 'style', |
| 720 | 'label' => esc_html__( 'Border color', 'jet-form-builder' ), |
| 721 | 'type' => 'color', |
| 722 | 'css' => array( |
| 723 | array( |
| 724 | 'property' => 'border-color', |
| 725 | 'selector' => $this->css_selector( '__field-label :checked + span::before' ), |
| 726 | ), |
| 727 | ), |
| 728 | ) |
| 729 | ); |
| 730 | |
| 731 | $this->end_jet_control_group(); |
| 732 | } |
| 733 | // End checkbox & radio fields style |
| 734 | |
| 735 | // Start calculated fields |
| 736 | public function control_group_calc_fields_style() { |
| 737 | $this->register_jet_control_group( |
| 738 | 'section_calc_fields_style', |
| 739 | array( |
| 740 | 'title' => esc_html__( 'Calculated fields', 'jet-form-builder' ), |
| 741 | 'tab' => 'style', |
| 742 | ) |
| 743 | ); |
| 744 | } |
| 745 | |
| 746 | public function controls_calc_fields_style() { |
| 747 | $this->start_jet_control_group( 'section_calc_fields_style' ); |
| 748 | |
| 749 | $this->register_jet_control( |
| 750 | 'calc_fields_align_main_axis', |
| 751 | array( |
| 752 | 'tab' => 'style', |
| 753 | 'label' => esc_html__( 'Align main axis', 'jet-form-builder' ), |
| 754 | 'type' => 'justify-content', |
| 755 | 'css' => array( array( 'property' => '--jfb-calc-justify-content' ) ), |
| 756 | ) |
| 757 | ); |
| 758 | |
| 759 | $this->register_jet_control( |
| 760 | 'calc_fields_gap', |
| 761 | array( |
| 762 | 'tab' => 'style', |
| 763 | 'label' => esc_html__( 'Gap', 'jet-form-builder' ), |
| 764 | 'type' => 'number', |
| 765 | 'units' => true, |
| 766 | 'min' => 0, |
| 767 | 'max' => 40, |
| 768 | 'css' => array( array( 'property' => '--jfb-calc-gap' ) ), |
| 769 | ) |
| 770 | ); |
| 771 | |
| 772 | $css_selector = $this->css_selector( '__calculated-field' ); |
| 773 | |
| 774 | $this->register_jet_control( |
| 775 | 'calc_fields_typography', |
| 776 | array( |
| 777 | 'tab' => 'style', |
| 778 | 'label' => esc_html__( 'Typography', 'jet-form-builder' ), |
| 779 | 'type' => 'typography', |
| 780 | 'css' => array( |
| 781 | array( |
| 782 | 'property' => 'typography', |
| 783 | 'selector' => $css_selector, |
| 784 | ), |
| 785 | ), |
| 786 | ) |
| 787 | ); |
| 788 | |
| 789 | $this->register_jet_control( |
| 790 | 'calc_fields_prefix_size', |
| 791 | array( |
| 792 | 'tab' => 'style', |
| 793 | 'label' => esc_html__( 'Prefix size', 'jet-form-builder' ), |
| 794 | 'type' => 'number', |
| 795 | 'units' => true, |
| 796 | 'min' => 10, |
| 797 | 'max' => 50, |
| 798 | 'css' => array( array( 'property' => '--jfb-calc-prefix-fz' ) ), |
| 799 | ) |
| 800 | ); |
| 801 | |
| 802 | $this->register_jet_control( |
| 803 | 'calc_fields_prefix_color', |
| 804 | array( |
| 805 | 'tab' => 'style', |
| 806 | 'label' => esc_html__( 'Prefix color', 'jet-form-builder' ), |
| 807 | 'type' => 'color', |
| 808 | 'css' => array( array( 'property' => '--jfb-calc-prefix-color' ) ), |
| 809 | ) |
| 810 | ); |
| 811 | |
| 812 | $this->register_jet_control( |
| 813 | 'calc_fields_suffix_size', |
| 814 | array( |
| 815 | 'tab' => 'style', |
| 816 | 'label' => esc_html__( 'Suffix size', 'jet-form-builder' ), |
| 817 | 'type' => 'number', |
| 818 | 'units' => true, |
| 819 | 'min' => 10, |
| 820 | 'max' => 50, |
| 821 | 'css' => array( array( 'property' => '--jfb-calc-suffix-fz' ) ), |
| 822 | ) |
| 823 | ); |
| 824 | |
| 825 | $this->register_jet_control( |
| 826 | 'calc_fields_suffix_color', |
| 827 | array( |
| 828 | 'tab' => 'style', |
| 829 | 'label' => esc_html__( 'Suffix color', 'jet-form-builder' ), |
| 830 | 'type' => 'color', |
| 831 | 'css' => array( array( 'property' => '--jfb-calc-suffix-color' ) ), |
| 832 | ) |
| 833 | ); |
| 834 | |
| 835 | $this->register_jet_control( |
| 836 | 'calc_fields_bg_color', |
| 837 | array( |
| 838 | 'tab' => 'style', |
| 839 | 'label' => esc_html__( 'Background color', 'jet-form-builder' ), |
| 840 | 'type' => 'color', |
| 841 | 'css' => array( array( 'property' => '--jfb-calc-bgc' ) ), |
| 842 | ) |
| 843 | ); |
| 844 | |
| 845 | $this->register_jet_control( |
| 846 | 'calc_fields_margin', |
| 847 | array( |
| 848 | 'tab' => 'style', |
| 849 | 'label' => esc_html__( 'Margin', 'jet-form-builder' ), |
| 850 | 'type' => 'dimensions', |
| 851 | 'css' => array( |
| 852 | array( |
| 853 | 'property' => 'margin', |
| 854 | 'selector' => $css_selector, |
| 855 | ), |
| 856 | ), |
| 857 | ) |
| 858 | ); |
| 859 | |
| 860 | $this->register_jet_control( |
| 861 | 'calc_fields_padding', |
| 862 | array( |
| 863 | 'tab' => 'style', |
| 864 | 'label' => esc_html__( 'Padding', 'jet-form-builder' ), |
| 865 | 'type' => 'dimensions', |
| 866 | 'css' => array( |
| 867 | array( |
| 868 | 'property' => 'padding', |
| 869 | 'selector' => $css_selector, |
| 870 | ), |
| 871 | ), |
| 872 | ) |
| 873 | ); |
| 874 | |
| 875 | $this->register_jet_control( |
| 876 | 'calc_fields_border', |
| 877 | array( |
| 878 | 'tab' => 'style', |
| 879 | 'label' => esc_html__( 'Border', 'jet-form-builder' ), |
| 880 | 'type' => 'border', |
| 881 | 'css' => array( |
| 882 | array( |
| 883 | 'property' => 'border', |
| 884 | 'selector' => $css_selector, |
| 885 | ), |
| 886 | ), |
| 887 | ) |
| 888 | ); |
| 889 | |
| 890 | $this->end_jet_control_group(); |
| 891 | } |
| 892 | // End calculated fields |
| 893 | |
| 894 | // Start range fields |
| 895 | public function control_group_range_fields_style() { |
| 896 | $this->register_jet_control_group( |
| 897 | 'section_range_fields_style', |
| 898 | array( |
| 899 | 'title' => esc_html__( 'Range fields', 'jet-form-builder' ), |
| 900 | 'tab' => 'style', |
| 901 | ) |
| 902 | ); |
| 903 | } |
| 904 | |
| 905 | public function controls_range_fields_style() { |
| 906 | $this->start_jet_control_group( 'section_range_fields_style' ); |
| 907 | |
| 908 | $this->register_jet_control( |
| 909 | 'range_max_width', |
| 910 | array( |
| 911 | 'tab' => 'style', |
| 912 | 'label' => esc_html__( 'Max width', 'jet-form-builder' ), |
| 913 | 'type' => 'number', |
| 914 | 'units' => true, |
| 915 | 'min' => 1, |
| 916 | 'max' => 1000, |
| 917 | 'css' => array( array( 'property' => '--jfb-range-mw' ) ), |
| 918 | ) |
| 919 | ); |
| 920 | |
| 921 | $this->register_jet_control( |
| 922 | 'range_slider_heading', |
| 923 | array( |
| 924 | 'tab' => 'style', |
| 925 | 'type' => 'separator', |
| 926 | 'label' => esc_html__( 'Slider', 'jet-form-builder' ), |
| 927 | ) |
| 928 | ); |
| 929 | |
| 930 | $this->register_jet_control( |
| 931 | 'track_height', |
| 932 | array( |
| 933 | 'tab' => 'style', |
| 934 | 'label' => esc_html__( 'Track height', 'jet-form-builder' ), |
| 935 | 'type' => 'number', |
| 936 | 'units' => true, |
| 937 | 'min' => 1, |
| 938 | 'max' => 20, |
| 939 | 'css' => array( array( 'property' => '--jet-fb__range-field-range--height' ) ), |
| 940 | ) |
| 941 | ); |
| 942 | |
| 943 | $this->register_jet_control( |
| 944 | 'thumb_size', |
| 945 | array( |
| 946 | 'tab' => 'style', |
| 947 | 'label' => esc_html__( 'Thumb size', 'jet-form-builder' ), |
| 948 | 'type' => 'number', |
| 949 | 'units' => true, |
| 950 | 'min' => 1, |
| 951 | 'max' => 20, |
| 952 | 'css' => array( array( 'property' => '--jet-fb__range-field-slider--size' ) ), |
| 953 | ) |
| 954 | ); |
| 955 | |
| 956 | $this->register_jet_control( |
| 957 | 'track_border_radius', |
| 958 | array( |
| 959 | 'tab' => 'style', |
| 960 | 'label' => esc_html__( 'Track border radius', 'jet-form-builder' ), |
| 961 | 'type' => 'number', |
| 962 | 'units' => true, |
| 963 | 'min' => 1, |
| 964 | 'max' => 50, |
| 965 | 'css' => array( array( 'property' => '--jet-fb__range-field-range--br' ) ), |
| 966 | ) |
| 967 | ); |
| 968 | |
| 969 | $this->register_jet_control( |
| 970 | 'thumb_border_radius', |
| 971 | array( |
| 972 | 'tab' => 'style', |
| 973 | 'label' => esc_html__( 'Thumb border radius', 'jet-form-builder' ), |
| 974 | 'type' => 'number', |
| 975 | 'units' => true, |
| 976 | 'min' => 1, |
| 977 | 'max' => 50, |
| 978 | 'css' => array( array( 'property' => '--jet-fb__range-field-slider--br' ) ), |
| 979 | ) |
| 980 | ); |
| 981 | |
| 982 | $this->register_jet_control( |
| 983 | 'track_bg_color', |
| 984 | array( |
| 985 | 'tab' => 'style', |
| 986 | 'label' => esc_html__( 'Track color', 'jet-form-builder' ), |
| 987 | 'type' => 'color', |
| 988 | 'css' => array( array( 'property' => '--jet-fb__range-field-range--bgc' ) ), |
| 989 | ) |
| 990 | ); |
| 991 | |
| 992 | $this->register_jet_control( |
| 993 | 'thumb_bg_color', |
| 994 | array( |
| 995 | 'tab' => 'style', |
| 996 | 'label' => esc_html__( 'Thumb color', 'jet-form-builder' ), |
| 997 | 'type' => 'color', |
| 998 | 'css' => array( array( 'property' => '--jet-fb__range-field-slider--bgc' ) ), |
| 999 | ) |
| 1000 | ); |
| 1001 | |
| 1002 | $this->register_jet_control( |
| 1003 | 'range_value_heading', |
| 1004 | array( |
| 1005 | 'tab' => 'style', |
| 1006 | 'type' => 'separator', |
| 1007 | 'label' => esc_html__( 'Value', 'jet-form-builder' ), |
| 1008 | ) |
| 1009 | ); |
| 1010 | |
| 1011 | $this->register_jet_control( |
| 1012 | 'range_value_gap', |
| 1013 | array( |
| 1014 | 'tab' => 'style', |
| 1015 | 'label' => esc_html__( 'Gap', 'jet-form-builder' ), |
| 1016 | 'type' => 'number', |
| 1017 | 'units' => true, |
| 1018 | 'min' => 0, |
| 1019 | 'max' => 40, |
| 1020 | 'css' => array( array( 'property' => '--jfb-range-value-gap' ) ), |
| 1021 | ) |
| 1022 | ); |
| 1023 | |
| 1024 | $this->register_jet_control( |
| 1025 | 'range_value_typography', |
| 1026 | array( |
| 1027 | 'tab' => 'style', |
| 1028 | 'label' => esc_html__( 'Typography', 'jet-form-builder' ), |
| 1029 | 'type' => 'typography', |
| 1030 | 'css' => array( |
| 1031 | array( |
| 1032 | 'property' => 'typography', |
| 1033 | 'selector' => $this->css_selector( '__field-value.range-value' ), |
| 1034 | ), |
| 1035 | ), |
| 1036 | ) |
| 1037 | ); |
| 1038 | |
| 1039 | $this->register_jet_control( |
| 1040 | 'range_prefix_value_size', |
| 1041 | array( |
| 1042 | 'tab' => 'style', |
| 1043 | 'label' => esc_html__( 'Prefix size', 'jet-form-builder' ), |
| 1044 | 'type' => 'number', |
| 1045 | 'units' => true, |
| 1046 | 'min' => 10, |
| 1047 | 'max' => 50, |
| 1048 | 'css' => array( array( 'property' => '--jfb-range-value-prefix-fz' ) ), |
| 1049 | ) |
| 1050 | ); |
| 1051 | |
| 1052 | $this->register_jet_control( |
| 1053 | 'range_prefix_value_color', |
| 1054 | array( |
| 1055 | 'tab' => 'style', |
| 1056 | 'label' => esc_html__( 'Prefix color', 'jet-form-builder' ), |
| 1057 | 'type' => 'color', |
| 1058 | 'css' => array( array( 'property' => '--jfb-range-value-prefix-color' ) ), |
| 1059 | ) |
| 1060 | ); |
| 1061 | |
| 1062 | $this->register_jet_control( |
| 1063 | 'range_suffix_value_size', |
| 1064 | array( |
| 1065 | 'tab' => 'style', |
| 1066 | 'label' => esc_html__( 'Suffix size', 'jet-form-builder' ), |
| 1067 | 'type' => 'number', |
| 1068 | 'units' => true, |
| 1069 | 'min' => 10, |
| 1070 | 'max' => 50, |
| 1071 | 'css' => array( array( 'property' => '--jfb-range-value-suffix-fz' ) ), |
| 1072 | ) |
| 1073 | ); |
| 1074 | |
| 1075 | $this->register_jet_control( |
| 1076 | 'range_suffix_value_color', |
| 1077 | array( |
| 1078 | 'tab' => 'style', |
| 1079 | 'label' => esc_html__( 'Suffix color', 'jet-form-builder' ), |
| 1080 | 'type' => 'color', |
| 1081 | 'css' => array( array( 'property' => '--jfb-range-value-suffix-color' ) ), |
| 1082 | ) |
| 1083 | ); |
| 1084 | |
| 1085 | $this->end_jet_control_group(); |
| 1086 | } |
| 1087 | // End range fields |
| 1088 | |
| 1089 | // Start heading style |
| 1090 | public function control_group_heading_style() { |
| 1091 | $this->register_jet_control_group( |
| 1092 | 'section_headings_style', |
| 1093 | array( |
| 1094 | 'title' => esc_html__( 'Heading', 'jet-form-builder' ), |
| 1095 | 'tab' => 'style', |
| 1096 | ) |
| 1097 | ); |
| 1098 | } |
| 1099 | |
| 1100 | public function controls_heading_style() { |
| 1101 | $this->start_jet_control_group( 'section_headings_style' ); |
| 1102 | |
| 1103 | $this->register_jet_control( |
| 1104 | 'heading_label_heading', |
| 1105 | array( |
| 1106 | 'tab' => 'style', |
| 1107 | 'type' => 'separator', |
| 1108 | 'label' => esc_html__( 'Label', 'jet-form-builder' ), |
| 1109 | ) |
| 1110 | ); |
| 1111 | |
| 1112 | $css_selectors = array( |
| 1113 | 'label' => $this->css_selector( '__heading' ), |
| 1114 | 'desc' => $this->css_selector( '__heading-desc' ), |
| 1115 | ); |
| 1116 | |
| 1117 | $this->register_jet_control( |
| 1118 | 'heading_label_typography', |
| 1119 | array( |
| 1120 | 'tab' => 'style', |
| 1121 | 'label' => esc_html__( 'Typography', 'jet-form-builder' ), |
| 1122 | 'type' => 'typography', |
| 1123 | 'css' => array( |
| 1124 | array( |
| 1125 | 'property' => 'typography', |
| 1126 | 'selector' => $css_selectors['label'], |
| 1127 | ), |
| 1128 | ), |
| 1129 | ) |
| 1130 | ); |
| 1131 | |
| 1132 | $this->register_jet_control( |
| 1133 | 'heading_label_bg_color', |
| 1134 | array( |
| 1135 | 'tab' => 'style', |
| 1136 | 'label' => esc_html__( 'Background color', 'jet-form-builder' ), |
| 1137 | 'type' => 'color', |
| 1138 | 'css' => array( array( 'property' => '--jfb-heading-bgc' ) ), |
| 1139 | ) |
| 1140 | ); |
| 1141 | |
| 1142 | $this->register_jet_control( |
| 1143 | 'heading_label_margin', |
| 1144 | array( |
| 1145 | 'tab' => 'style', |
| 1146 | 'label' => esc_html__( 'Margin', 'jet-form-builder' ), |
| 1147 | 'type' => 'dimensions', |
| 1148 | 'css' => array( |
| 1149 | array( |
| 1150 | 'property' => 'margin', |
| 1151 | 'selector' => $css_selectors['label'], |
| 1152 | ), |
| 1153 | ), |
| 1154 | ) |
| 1155 | ); |
| 1156 | |
| 1157 | $this->register_jet_control( |
| 1158 | 'heading_label_padding', |
| 1159 | array( |
| 1160 | 'tab' => 'style', |
| 1161 | 'label' => esc_html__( 'Padding', 'jet-form-builder' ), |
| 1162 | 'type' => 'dimensions', |
| 1163 | 'css' => array( |
| 1164 | array( |
| 1165 | 'property' => 'padding', |
| 1166 | 'selector' => $css_selectors['label'], |
| 1167 | ), |
| 1168 | ), |
| 1169 | ) |
| 1170 | ); |
| 1171 | |
| 1172 | $this->register_jet_control( |
| 1173 | 'heading_label_border', |
| 1174 | array( |
| 1175 | 'tab' => 'style', |
| 1176 | 'label' => esc_html__( 'Border', 'jet-form-builder' ), |
| 1177 | 'type' => 'border', |
| 1178 | 'css' => array( |
| 1179 | array( |
| 1180 | 'property' => 'border', |
| 1181 | 'selector' => $css_selectors['label'], |
| 1182 | ), |
| 1183 | ), |
| 1184 | ) |
| 1185 | ); |
| 1186 | |
| 1187 | $this->register_jet_control( |
| 1188 | 'heading_desc_heading', |
| 1189 | array( |
| 1190 | 'tab' => 'style', |
| 1191 | 'type' => 'separator', |
| 1192 | 'label' => esc_html__( 'Description', 'jet-form-builder' ), |
| 1193 | ) |
| 1194 | ); |
| 1195 | |
| 1196 | $this->register_jet_control( |
| 1197 | 'heading_desc_typography', |
| 1198 | array( |
| 1199 | 'tab' => 'style', |
| 1200 | 'label' => esc_html__( 'Typography', 'jet-form-builder' ), |
| 1201 | 'type' => 'typography', |
| 1202 | 'css' => array( |
| 1203 | array( |
| 1204 | 'property' => 'typography', |
| 1205 | 'selector' => $css_selectors['desc'], |
| 1206 | ), |
| 1207 | ), |
| 1208 | ) |
| 1209 | ); |
| 1210 | |
| 1211 | $this->register_jet_control( |
| 1212 | 'heading_desc_bg_color', |
| 1213 | array( |
| 1214 | 'tab' => 'style', |
| 1215 | 'label' => esc_html__( 'Background color', 'jet-form-builder' ), |
| 1216 | 'type' => 'color', |
| 1217 | 'css' => array( array( 'property' => '--jfb-heading-desc-bgc' ) ), |
| 1218 | ) |
| 1219 | ); |
| 1220 | |
| 1221 | $this->register_jet_control( |
| 1222 | 'heading_desc_margin', |
| 1223 | array( |
| 1224 | 'tab' => 'style', |
| 1225 | 'label' => esc_html__( 'Margin', 'jet-form-builder' ), |
| 1226 | 'type' => 'dimensions', |
| 1227 | 'css' => array( |
| 1228 | array( |
| 1229 | 'property' => 'margin', |
| 1230 | 'selector' => $css_selectors['desc'], |
| 1231 | ), |
| 1232 | ), |
| 1233 | ) |
| 1234 | ); |
| 1235 | |
| 1236 | $this->register_jet_control( |
| 1237 | 'heading_desc_padding', |
| 1238 | array( |
| 1239 | 'tab' => 'style', |
| 1240 | 'label' => esc_html__( 'Padding', 'jet-form-builder' ), |
| 1241 | 'type' => 'dimensions', |
| 1242 | 'css' => array( |
| 1243 | array( |
| 1244 | 'property' => 'padding', |
| 1245 | 'selector' => $css_selectors['desc'], |
| 1246 | ), |
| 1247 | ), |
| 1248 | ) |
| 1249 | ); |
| 1250 | |
| 1251 | $this->register_jet_control( |
| 1252 | 'heading_desc_border', |
| 1253 | array( |
| 1254 | 'tab' => 'style', |
| 1255 | 'label' => esc_html__( 'Border', 'jet-form-builder' ), |
| 1256 | 'type' => 'border', |
| 1257 | 'css' => array( |
| 1258 | array( |
| 1259 | 'property' => 'border', |
| 1260 | 'selector' => $css_selectors['desc'], |
| 1261 | ), |
| 1262 | ), |
| 1263 | ) |
| 1264 | ); |
| 1265 | |
| 1266 | $this->end_jet_control_group(); |
| 1267 | } |
| 1268 | // End heading style |
| 1269 | |
| 1270 | // Start repeater style |
| 1271 | public function control_group_repeater_style() { |
| 1272 | $this->register_jet_control_group( |
| 1273 | 'section_repeater_style', |
| 1274 | array( |
| 1275 | 'title' => esc_html__( 'Repeater', 'jet-form-builder' ), |
| 1276 | 'tab' => 'style', |
| 1277 | ) |
| 1278 | ); |
| 1279 | } |
| 1280 | |
| 1281 | public function controls_repeater_style() { |
| 1282 | $this->start_jet_control_group( 'section_repeater_style' ); |
| 1283 | |
| 1284 | $this->register_jet_control( |
| 1285 | 'repeater_row_heading', |
| 1286 | array( |
| 1287 | 'tab' => 'style', |
| 1288 | 'type' => 'separator', |
| 1289 | 'label' => esc_html__( 'Repeater row', 'jet-form-builder' ), |
| 1290 | ) |
| 1291 | ); |
| 1292 | |
| 1293 | $css_selectors = array( |
| 1294 | 'row' => $this->css_selector( '-repeater__row' ), |
| 1295 | 'new' => $this->css_selector( '-repeater__new' ), |
| 1296 | 'remove' => $this->css_selector( '-repeater__remove' ), |
| 1297 | ); |
| 1298 | |
| 1299 | $this->register_jet_control( |
| 1300 | 'booking_form_repeater_row_padding', |
| 1301 | array( |
| 1302 | 'tab' => 'style', |
| 1303 | 'label' => esc_html__( 'Padding', 'jet-form-builder' ), |
| 1304 | 'type' => 'dimensions', |
| 1305 | 'css' => array( |
| 1306 | array( |
| 1307 | 'property' => 'padding', |
| 1308 | 'selector' => $css_selectors['row'], |
| 1309 | ), |
| 1310 | ), |
| 1311 | ) |
| 1312 | ); |
| 1313 | |
| 1314 | $this->register_jet_control( |
| 1315 | 'repeater_add_button_heading', |
| 1316 | array( |
| 1317 | 'tab' => 'style', |
| 1318 | 'type' => 'separator', |
| 1319 | 'label' => esc_html__( 'New item button', 'jet-form-builder' ), |
| 1320 | ) |
| 1321 | ); |
| 1322 | |
| 1323 | $this->register_jet_control( |
| 1324 | 'booking_form_repeater_align_main_axis', |
| 1325 | array( |
| 1326 | 'tab' => 'style', |
| 1327 | 'label' => esc_html__( 'Align main axis', 'jet-form-builder' ), |
| 1328 | 'type' => 'justify-content', |
| 1329 | 'exclude' => array( |
| 1330 | 'space-between', |
| 1331 | 'space-around', |
| 1332 | 'space-evenly', |
| 1333 | ), |
| 1334 | 'css' => array( array( 'property' => '--jfb-repeater-add-button-justify-content' ) ), |
| 1335 | ) |
| 1336 | ); |
| 1337 | |
| 1338 | $this->register_jet_control( |
| 1339 | 'booking_form_repeater_typography', |
| 1340 | array( |
| 1341 | 'tab' => 'style', |
| 1342 | 'label' => esc_html__( 'Typography', 'jet-form-builder' ), |
| 1343 | 'type' => 'typography', |
| 1344 | 'css' => array( |
| 1345 | array( |
| 1346 | 'property' => 'typography', |
| 1347 | 'selector' => $css_selectors['new'], |
| 1348 | ), |
| 1349 | ), |
| 1350 | ) |
| 1351 | ); |
| 1352 | |
| 1353 | $this->register_jet_control( |
| 1354 | 'booking_form_repeater_bg_color', |
| 1355 | array( |
| 1356 | 'tab' => 'style', |
| 1357 | 'label' => esc_html__( 'Background color', 'jet-form-builder' ), |
| 1358 | 'type' => 'color', |
| 1359 | 'css' => array( |
| 1360 | array( |
| 1361 | 'property' => 'background-color', |
| 1362 | 'selector' => $css_selectors['new'], |
| 1363 | ), |
| 1364 | ), |
| 1365 | ) |
| 1366 | ); |
| 1367 | |
| 1368 | $this->register_jet_control( |
| 1369 | 'booking_form_repeater_margin', |
| 1370 | array( |
| 1371 | 'tab' => 'style', |
| 1372 | 'label' => esc_html__( 'Margin', 'jet-form-builder' ), |
| 1373 | 'type' => 'dimensions', |
| 1374 | 'css' => array( |
| 1375 | array( |
| 1376 | 'property' => 'margin', |
| 1377 | 'selector' => $css_selectors['new'], |
| 1378 | ), |
| 1379 | ), |
| 1380 | ) |
| 1381 | ); |
| 1382 | |
| 1383 | $this->register_jet_control( |
| 1384 | 'booking_form_repeater_padding', |
| 1385 | array( |
| 1386 | 'tab' => 'style', |
| 1387 | 'label' => esc_html__( 'Padding', 'jet-form-builder' ), |
| 1388 | 'type' => 'dimensions', |
| 1389 | 'css' => array( |
| 1390 | array( |
| 1391 | 'property' => 'padding', |
| 1392 | 'selector' => $css_selectors['new'], |
| 1393 | ), |
| 1394 | ), |
| 1395 | ) |
| 1396 | ); |
| 1397 | |
| 1398 | $this->register_jet_control( |
| 1399 | 'booking_form_repeater_border', |
| 1400 | array( |
| 1401 | 'tab' => 'style', |
| 1402 | 'label' => esc_html__( 'Border', 'jet-form-builder' ), |
| 1403 | 'type' => 'border', |
| 1404 | 'css' => array( |
| 1405 | array( |
| 1406 | 'property' => 'border', |
| 1407 | 'selector' => $css_selectors['new'], |
| 1408 | ), |
| 1409 | ), |
| 1410 | ) |
| 1411 | ); |
| 1412 | |
| 1413 | $this->register_jet_control( |
| 1414 | 'booking_form_repeater_box_shadow', |
| 1415 | array( |
| 1416 | 'tab' => 'style', |
| 1417 | 'label' => esc_html__( 'Box shadow', 'jet-form-builder' ), |
| 1418 | 'type' => 'box-shadow', |
| 1419 | 'css' => array( |
| 1420 | array( |
| 1421 | 'property' => 'box-shadow', |
| 1422 | 'selector' => $css_selectors['new'], |
| 1423 | ), |
| 1424 | ), |
| 1425 | ) |
| 1426 | ); |
| 1427 | |
| 1428 | $this->register_jet_control( |
| 1429 | 'repeater_rem_button_heading', |
| 1430 | array( |
| 1431 | 'tab' => 'style', |
| 1432 | 'type' => 'separator', |
| 1433 | 'label' => esc_html__( 'Remove item button', 'jet-form-builder' ), |
| 1434 | ) |
| 1435 | ); |
| 1436 | |
| 1437 | $this->register_jet_control( |
| 1438 | 'booking_form_repeater_rem_size', |
| 1439 | array( |
| 1440 | 'tab' => 'style', |
| 1441 | 'label' => esc_html__( 'Icon size', 'jet-form-builder' ), |
| 1442 | 'type' => 'number', |
| 1443 | 'units' => true, |
| 1444 | 'min' => 12, |
| 1445 | 'max' => 90, |
| 1446 | 'css' => array( array( 'property' => '--jfb-repeater-rem-button-fz' ) ), |
| 1447 | ) |
| 1448 | ); |
| 1449 | |
| 1450 | $this->register_jet_control( |
| 1451 | 'booking_form_repeater_rem_color', |
| 1452 | array( |
| 1453 | 'tab' => 'style', |
| 1454 | 'label' => esc_html__( 'Color', 'jet-form-builder' ), |
| 1455 | 'type' => 'color', |
| 1456 | 'css' => array( array( 'property' => '--jfb-repeater-rem-button-color' ) ), |
| 1457 | ) |
| 1458 | ); |
| 1459 | |
| 1460 | $this->register_jet_control( |
| 1461 | 'booking_form_repeater_rem_bg_color', |
| 1462 | array( |
| 1463 | 'tab' => 'style', |
| 1464 | 'label' => esc_html__( 'Background color', 'jet-form-builder' ), |
| 1465 | 'type' => 'color', |
| 1466 | 'css' => array( array( 'property' => '--jfb-repeater-rem-button-bgc' ) ), |
| 1467 | ) |
| 1468 | ); |
| 1469 | |
| 1470 | $this->register_jet_control( |
| 1471 | 'booking_form_repeater_rem_margin', |
| 1472 | array( |
| 1473 | 'tab' => 'style', |
| 1474 | 'label' => esc_html__( 'Margin', 'jet-form-builder' ), |
| 1475 | 'type' => 'dimensions', |
| 1476 | 'css' => array( |
| 1477 | array( |
| 1478 | 'property' => 'margin', |
| 1479 | 'selector' => $css_selectors['remove'], |
| 1480 | ), |
| 1481 | ), |
| 1482 | ) |
| 1483 | ); |
| 1484 | |
| 1485 | $this->register_jet_control( |
| 1486 | 'booking_form_repeater_rem_padding', |
| 1487 | array( |
| 1488 | 'tab' => 'style', |
| 1489 | 'label' => esc_html__( 'Padding', 'jet-form-builder' ), |
| 1490 | 'type' => 'dimensions', |
| 1491 | 'css' => array( |
| 1492 | array( |
| 1493 | 'property' => 'padding', |
| 1494 | 'selector' => $css_selectors['remove'], |
| 1495 | ), |
| 1496 | ), |
| 1497 | ) |
| 1498 | ); |
| 1499 | |
| 1500 | $this->register_jet_control( |
| 1501 | 'booking_form_repeater_rem_border', |
| 1502 | array( |
| 1503 | 'tab' => 'style', |
| 1504 | 'label' => esc_html__( 'Border', 'jet-form-builder' ), |
| 1505 | 'type' => 'border', |
| 1506 | 'css' => array( |
| 1507 | array( |
| 1508 | 'property' => 'border', |
| 1509 | 'selector' => $css_selectors['remove'], |
| 1510 | ), |
| 1511 | ), |
| 1512 | ) |
| 1513 | ); |
| 1514 | |
| 1515 | $this->register_jet_control( |
| 1516 | 'booking_form_repeater_rem_box_shadow', |
| 1517 | array( |
| 1518 | 'tab' => 'style', |
| 1519 | 'label' => esc_html__( 'Box shadow', 'jet-form-builder' ), |
| 1520 | 'type' => 'box-shadow', |
| 1521 | 'css' => array( |
| 1522 | array( |
| 1523 | 'property' => 'box-shadow', |
| 1524 | 'selector' => $css_selectors['remove'], |
| 1525 | ), |
| 1526 | ), |
| 1527 | ) |
| 1528 | ); |
| 1529 | |
| 1530 | $this->end_jet_control_group(); |
| 1531 | } |
| 1532 | // End repeater style |
| 1533 | |
| 1534 | // Start conditional style |
| 1535 | public function control_group_conditional_style() { |
| 1536 | $this->register_jet_control_group( |
| 1537 | 'section_conditional_style', |
| 1538 | array( |
| 1539 | 'title' => esc_html__( 'Conditional', 'jet-form-builder' ), |
| 1540 | 'tab' => 'style', |
| 1541 | ) |
| 1542 | ); |
| 1543 | } |
| 1544 | |
| 1545 | public function controls_conditional_style() { |
| 1546 | $this->start_jet_control_group( 'section_conditional_style' ); |
| 1547 | |
| 1548 | $this->register_jet_control( |
| 1549 | 'conditional_bg_color', |
| 1550 | array( |
| 1551 | 'tab' => 'style', |
| 1552 | 'label' => esc_html__( 'Background color', 'jet-form-builder' ), |
| 1553 | 'type' => 'color', |
| 1554 | 'css' => array( array( 'property' => '--jfb-conditional-bgc' ) ), |
| 1555 | ) |
| 1556 | ); |
| 1557 | |
| 1558 | $css_selector = $this->css_selector( '__conditional' ); |
| 1559 | |
| 1560 | $this->register_jet_control( |
| 1561 | 'conditional_margin', |
| 1562 | array( |
| 1563 | 'tab' => 'style', |
| 1564 | 'label' => esc_html__( 'Margin', 'jet-form-builder' ), |
| 1565 | 'type' => 'dimensions', |
| 1566 | 'css' => array( |
| 1567 | array( |
| 1568 | 'property' => 'margin', |
| 1569 | 'selector' => $css_selector, |
| 1570 | ), |
| 1571 | ), |
| 1572 | ) |
| 1573 | ); |
| 1574 | |
| 1575 | $this->register_jet_control( |
| 1576 | 'conditional_padding', |
| 1577 | array( |
| 1578 | 'tab' => 'style', |
| 1579 | 'label' => esc_html__( 'Padding', 'jet-form-builder' ), |
| 1580 | 'type' => 'dimensions', |
| 1581 | 'css' => array( |
| 1582 | array( |
| 1583 | 'property' => 'padding', |
| 1584 | 'selector' => $css_selector, |
| 1585 | ), |
| 1586 | ), |
| 1587 | ) |
| 1588 | ); |
| 1589 | |
| 1590 | $this->register_jet_control( |
| 1591 | 'conditional_border', |
| 1592 | array( |
| 1593 | 'tab' => 'style', |
| 1594 | 'label' => esc_html__( 'Border', 'jet-form-builder' ), |
| 1595 | 'type' => 'border', |
| 1596 | 'css' => array( |
| 1597 | array( |
| 1598 | 'property' => 'border', |
| 1599 | 'selector' => $css_selector, |
| 1600 | ), |
| 1601 | ), |
| 1602 | ) |
| 1603 | ); |
| 1604 | |
| 1605 | $this->end_jet_control_group(); |
| 1606 | } |
| 1607 | // End conditional style |
| 1608 | |
| 1609 | // Start submit style |
| 1610 | public function control_group_submit_style() { |
| 1611 | $this->register_jet_control_group( |
| 1612 | 'section_submit_style', |
| 1613 | array( |
| 1614 | 'title' => esc_html__( 'Submit', 'jet-form-builder' ), |
| 1615 | 'tab' => 'style', |
| 1616 | ) |
| 1617 | ); |
| 1618 | } |
| 1619 | |
| 1620 | public function controls_submit_style() { |
| 1621 | $this->start_jet_control_group( 'section_submit_style' ); |
| 1622 | |
| 1623 | $this->register_jet_control( |
| 1624 | 'booking_form_submit_align_main_axis', |
| 1625 | array( |
| 1626 | 'tab' => 'style', |
| 1627 | 'label' => esc_html__( 'Align main axis', 'jet-form-builder' ), |
| 1628 | 'type' => 'justify-content', |
| 1629 | 'exclude' => array( |
| 1630 | 'space-between', |
| 1631 | 'space-around', |
| 1632 | 'space-evenly', |
| 1633 | ), |
| 1634 | 'css' => array( array( 'property' => '--jfb-submit-justify-content' ) ), |
| 1635 | ) |
| 1636 | ); |
| 1637 | |
| 1638 | $this->register_jet_control( |
| 1639 | 'booking_form_submit_width', |
| 1640 | array( |
| 1641 | 'tab' => 'style', |
| 1642 | 'label' => esc_html__( 'Width', 'jet-form-builder' ), |
| 1643 | 'type' => 'number', |
| 1644 | 'units' => true, |
| 1645 | 'min' => 1, |
| 1646 | 'max' => 1000, |
| 1647 | 'css' => array( array( 'property' => '--jfb-submit-w' ) ), |
| 1648 | ) |
| 1649 | ); |
| 1650 | |
| 1651 | $css_selector = $this->css_selector( '__submit' ); |
| 1652 | |
| 1653 | $this->register_jet_control( |
| 1654 | 'booking_form_submit_typography', |
| 1655 | array( |
| 1656 | 'tab' => 'style', |
| 1657 | 'label' => esc_html__( 'Typography', 'jet-form-builder' ), |
| 1658 | 'type' => 'typography', |
| 1659 | 'css' => array( |
| 1660 | array( |
| 1661 | 'property' => 'typography', |
| 1662 | 'selector' => $css_selector, |
| 1663 | ), |
| 1664 | ), |
| 1665 | ) |
| 1666 | ); |
| 1667 | |
| 1668 | $this->register_jet_control( |
| 1669 | 'booking_form_submit_bg_color', |
| 1670 | array( |
| 1671 | 'tab' => 'style', |
| 1672 | 'label' => esc_html__( 'Background color', 'jet-form-builder' ), |
| 1673 | 'type' => 'color', |
| 1674 | 'css' => array( |
| 1675 | array( |
| 1676 | 'property' => 'background-color', |
| 1677 | 'selector' => $css_selector, |
| 1678 | ), |
| 1679 | ), |
| 1680 | ) |
| 1681 | ); |
| 1682 | |
| 1683 | $this->register_jet_control( |
| 1684 | 'booking_form_submit_margin', |
| 1685 | array( |
| 1686 | 'tab' => 'style', |
| 1687 | 'label' => esc_html__( 'Margin', 'jet-form-builder' ), |
| 1688 | 'type' => 'dimensions', |
| 1689 | 'css' => array( |
| 1690 | array( |
| 1691 | 'property' => 'margin', |
| 1692 | 'selector' => $css_selector, |
| 1693 | ), |
| 1694 | ), |
| 1695 | ) |
| 1696 | ); |
| 1697 | |
| 1698 | $this->register_jet_control( |
| 1699 | 'booking_form_submit_padding', |
| 1700 | array( |
| 1701 | 'tab' => 'style', |
| 1702 | 'label' => esc_html__( 'Padding', 'jet-form-builder' ), |
| 1703 | 'type' => 'dimensions', |
| 1704 | 'css' => array( |
| 1705 | array( |
| 1706 | 'property' => 'padding', |
| 1707 | 'selector' => $css_selector, |
| 1708 | ), |
| 1709 | ), |
| 1710 | ) |
| 1711 | ); |
| 1712 | |
| 1713 | $this->register_jet_control( |
| 1714 | 'booking_form_submit_border', |
| 1715 | array( |
| 1716 | 'tab' => 'style', |
| 1717 | 'label' => esc_html__( 'Border', 'jet-form-builder' ), |
| 1718 | 'type' => 'border', |
| 1719 | 'css' => array( |
| 1720 | array( |
| 1721 | 'property' => 'border', |
| 1722 | 'selector' => $css_selector, |
| 1723 | ), |
| 1724 | ), |
| 1725 | ) |
| 1726 | ); |
| 1727 | |
| 1728 | $this->register_jet_control( |
| 1729 | 'booking_form_submit_box_shadow', |
| 1730 | array( |
| 1731 | 'tab' => 'style', |
| 1732 | 'label' => esc_html__( 'Box shadow', 'jet-form-builder' ), |
| 1733 | 'type' => 'box-shadow', |
| 1734 | 'css' => array( |
| 1735 | array( |
| 1736 | 'property' => 'box-shadow', |
| 1737 | 'selector' => $css_selector, |
| 1738 | ), |
| 1739 | ), |
| 1740 | ) |
| 1741 | ); |
| 1742 | |
| 1743 | $this->end_jet_control_group(); |
| 1744 | } |
| 1745 | // End label style |
| 1746 | |
| 1747 | // Start form break style |
| 1748 | public function control_group_form_break_style() { |
| 1749 | $this->register_jet_control_group( |
| 1750 | 'section_form_break_style', |
| 1751 | array( |
| 1752 | 'title' => esc_html__( 'Form Break Row', 'jet-form-builder' ), |
| 1753 | 'tab' => 'style', |
| 1754 | ) |
| 1755 | ); |
| 1756 | } |
| 1757 | |
| 1758 | public function controls_form_break_style() { |
| 1759 | $this->start_jet_control_group( 'section_form_break_style' ); |
| 1760 | |
| 1761 | $this->register_jet_control( |
| 1762 | 'form_break_alignment', |
| 1763 | array( |
| 1764 | 'tab' => 'style', |
| 1765 | 'label' => esc_html__( 'Text align', 'jet-form-builder' ), |
| 1766 | 'type' => 'text-align', |
| 1767 | 'css' => array( array( 'property' => '--jfb-break-text-align' ) ), |
| 1768 | ) |
| 1769 | ); |
| 1770 | |
| 1771 | $css_selector = $this->css_selector( '__next-page-wrap' ); |
| 1772 | |
| 1773 | $this->register_jet_control( |
| 1774 | 'form_break_padding', |
| 1775 | array( |
| 1776 | 'tab' => 'style', |
| 1777 | 'label' => esc_html__( 'Padding', 'jet-form-builder' ), |
| 1778 | 'type' => 'dimensions', |
| 1779 | 'css' => array( |
| 1780 | array( |
| 1781 | 'property' => 'padding', |
| 1782 | 'selector' => $css_selector, |
| 1783 | ), |
| 1784 | ), |
| 1785 | ) |
| 1786 | ); |
| 1787 | |
| 1788 | $this->register_jet_control( |
| 1789 | 'form_break_border', |
| 1790 | array( |
| 1791 | 'tab' => 'style', |
| 1792 | 'label' => esc_html__( 'Border', 'jet-form-builder' ), |
| 1793 | 'type' => 'border', |
| 1794 | 'css' => array( |
| 1795 | array( |
| 1796 | 'property' => 'border', |
| 1797 | 'selector' => $css_selector, |
| 1798 | ), |
| 1799 | ), |
| 1800 | ) |
| 1801 | ); |
| 1802 | |
| 1803 | $this->end_jet_control_group(); |
| 1804 | } |
| 1805 | // End form break style |
| 1806 | |
| 1807 | // Start form break buttons style |
| 1808 | public function control_group_form_break_buttons_style() { |
| 1809 | $this->register_jet_control_group( |
| 1810 | 'section_form_break_next_style', |
| 1811 | array( |
| 1812 | 'title' => esc_html__( 'Form Break Buttons', 'jet-form-builder' ), |
| 1813 | 'tab' => 'style', |
| 1814 | ) |
| 1815 | ); |
| 1816 | } |
| 1817 | |
| 1818 | public function controls_form_break_buttons_style() { |
| 1819 | $this->start_jet_control_group( 'section_form_break_next_style' ); |
| 1820 | |
| 1821 | $css_selectors = array( |
| 1822 | 'prev' => $this->css_selector( '__prev-page' ), |
| 1823 | 'next' => $this->css_selector( '__next-page' ), |
| 1824 | ); |
| 1825 | |
| 1826 | $this->register_jet_control( |
| 1827 | 'form_break_button_typography', |
| 1828 | array( |
| 1829 | 'tab' => 'style', |
| 1830 | 'label' => esc_html__( 'Typography', 'jet-form-builder' ), |
| 1831 | 'type' => 'typography', |
| 1832 | 'css' => array( |
| 1833 | array( |
| 1834 | 'property' => 'typography', |
| 1835 | 'selector' => $css_selectors['prev'], |
| 1836 | ), |
| 1837 | array( |
| 1838 | 'property' => 'typography', |
| 1839 | 'selector' => $css_selectors['next'], |
| 1840 | ), |
| 1841 | ), |
| 1842 | ) |
| 1843 | ); |
| 1844 | |
| 1845 | $this->register_jet_control( |
| 1846 | 'form_break_button_bg_color', |
| 1847 | array( |
| 1848 | 'tab' => 'style', |
| 1849 | 'label' => esc_html__( 'Background color', 'jet-form-builder' ), |
| 1850 | 'type' => 'color', |
| 1851 | 'css' => array( |
| 1852 | array( |
| 1853 | 'property' => 'background-color', |
| 1854 | 'selector' => $css_selectors['prev'], |
| 1855 | ), |
| 1856 | array( |
| 1857 | 'property' => 'background-color', |
| 1858 | 'selector' => $css_selectors['next'], |
| 1859 | ), |
| 1860 | ), |
| 1861 | ) |
| 1862 | ); |
| 1863 | |
| 1864 | $this->register_jet_control( |
| 1865 | 'form_break_button_margin', |
| 1866 | array( |
| 1867 | 'tab' => 'style', |
| 1868 | 'label' => esc_html__( 'Margin', 'jet-form-builder' ), |
| 1869 | 'type' => 'dimensions', |
| 1870 | 'css' => array( |
| 1871 | array( |
| 1872 | 'property' => 'margin', |
| 1873 | 'selector' => $css_selectors['prev'], |
| 1874 | ), |
| 1875 | array( |
| 1876 | 'property' => 'margin', |
| 1877 | 'selector' => $css_selectors['next'], |
| 1878 | ), |
| 1879 | ), |
| 1880 | ) |
| 1881 | ); |
| 1882 | |
| 1883 | $this->register_jet_control( |
| 1884 | 'form_break_button_padding', |
| 1885 | array( |
| 1886 | 'tab' => 'style', |
| 1887 | 'label' => esc_html__( 'Padding', 'jet-form-builder' ), |
| 1888 | 'type' => 'dimensions', |
| 1889 | 'css' => array( |
| 1890 | array( |
| 1891 | 'property' => 'padding', |
| 1892 | 'selector' => $css_selectors['prev'], |
| 1893 | ), |
| 1894 | array( |
| 1895 | 'property' => 'padding', |
| 1896 | 'selector' => $css_selectors['next'], |
| 1897 | ), |
| 1898 | ), |
| 1899 | ) |
| 1900 | ); |
| 1901 | |
| 1902 | $this->register_jet_control( |
| 1903 | 'form_break_button_border', |
| 1904 | array( |
| 1905 | 'tab' => 'style', |
| 1906 | 'label' => esc_html__( 'Border', 'jet-form-builder' ), |
| 1907 | 'type' => 'border', |
| 1908 | 'css' => array( |
| 1909 | array( |
| 1910 | 'property' => 'border', |
| 1911 | 'selector' => $css_selectors['prev'], |
| 1912 | ), |
| 1913 | array( |
| 1914 | 'property' => 'border', |
| 1915 | 'selector' => $css_selectors['next'], |
| 1916 | ), |
| 1917 | ), |
| 1918 | ) |
| 1919 | ); |
| 1920 | |
| 1921 | $this->end_jet_control_group(); |
| 1922 | } |
| 1923 | // End form break buttons style |
| 1924 | |
| 1925 | // Start form break disabled message style |
| 1926 | public function control_group_form_break_message_style() { |
| 1927 | $this->register_jet_control_group( |
| 1928 | 'section_form_break_message_style', |
| 1929 | array( |
| 1930 | 'title' => esc_html__( 'Form Break Disabled Message', 'jet-form-builder' ), |
| 1931 | 'tab' => 'style', |
| 1932 | ) |
| 1933 | ); |
| 1934 | } |
| 1935 | |
| 1936 | public function controls_form_break_message_style() { |
| 1937 | $this->start_jet_control_group( 'section_form_break_message_style' ); |
| 1938 | |
| 1939 | $css_selector = $this->css_selector( '__next-page-msg' ); |
| 1940 | |
| 1941 | $this->register_jet_control( |
| 1942 | 'form_break_message_typography', |
| 1943 | array( |
| 1944 | 'tab' => 'style', |
| 1945 | 'label' => esc_html__( 'Typography', 'jet-form-builder' ), |
| 1946 | 'type' => 'typography', |
| 1947 | 'css' => array( |
| 1948 | array( |
| 1949 | 'property' => 'typography', |
| 1950 | 'selector' => $css_selector, |
| 1951 | ), |
| 1952 | ), |
| 1953 | ) |
| 1954 | ); |
| 1955 | |
| 1956 | $this->register_jet_control( |
| 1957 | 'form_break_message_bg_color', |
| 1958 | array( |
| 1959 | 'tab' => 'style', |
| 1960 | 'label' => esc_html__( 'Background color', 'jet-form-builder' ), |
| 1961 | 'type' => 'color', |
| 1962 | 'css' => array( array( 'property' => '--jfb-break-message-bgc' ) ), |
| 1963 | ) |
| 1964 | ); |
| 1965 | |
| 1966 | $this->register_jet_control( |
| 1967 | 'form_break_message_margin', |
| 1968 | array( |
| 1969 | 'tab' => 'style', |
| 1970 | 'label' => esc_html__( 'Margin', 'jet-form-builder' ), |
| 1971 | 'type' => 'dimensions', |
| 1972 | 'css' => array( |
| 1973 | array( |
| 1974 | 'property' => 'margin', |
| 1975 | 'selector' => $css_selector, |
| 1976 | ), |
| 1977 | ), |
| 1978 | ) |
| 1979 | ); |
| 1980 | |
| 1981 | $this->register_jet_control( |
| 1982 | 'form_break_message_padding', |
| 1983 | array( |
| 1984 | 'tab' => 'style', |
| 1985 | 'label' => esc_html__( 'Padding', 'jet-form-builder' ), |
| 1986 | 'type' => 'dimensions', |
| 1987 | 'css' => array( |
| 1988 | array( |
| 1989 | 'property' => 'padding', |
| 1990 | 'selector' => $css_selector, |
| 1991 | ), |
| 1992 | ), |
| 1993 | ) |
| 1994 | ); |
| 1995 | |
| 1996 | $this->register_jet_control( |
| 1997 | 'form_break_message_border', |
| 1998 | array( |
| 1999 | 'tab' => 'style', |
| 2000 | 'label' => esc_html__( 'Border', 'jet-form-builder' ), |
| 2001 | 'type' => 'border', |
| 2002 | 'css' => array( |
| 2003 | array( |
| 2004 | 'property' => 'border', |
| 2005 | 'selector' => $css_selector, |
| 2006 | ), |
| 2007 | ), |
| 2008 | ) |
| 2009 | ); |
| 2010 | |
| 2011 | $this->end_jet_control_group(); |
| 2012 | } |
| 2013 | // End form break disabled message style |
| 2014 | |
| 2015 | // Start progress wrap |
| 2016 | public function control_group_form_progress_wrap_style() { |
| 2017 | $this->register_jet_control_group( |
| 2018 | 'jet_fb_progress_wrapper_section', |
| 2019 | array( |
| 2020 | 'title' => esc_html__( 'Form Progress - Wrapper', 'jet-form-builder' ), |
| 2021 | 'tab' => 'style', |
| 2022 | ) |
| 2023 | ); |
| 2024 | } |
| 2025 | |
| 2026 | public function controls_form_progress_wrap_style() { |
| 2027 | $this->start_jet_control_group( 'jet_fb_progress_wrapper_section' ); |
| 2028 | |
| 2029 | $this->register_jet_control( |
| 2030 | 'jet_fb_progress_wrapper_bg_color', |
| 2031 | array( |
| 2032 | 'tab' => 'style', |
| 2033 | 'label' => esc_html__( 'Background color', 'jet-form-builder' ), |
| 2034 | 'type' => 'color', |
| 2035 | 'css' => array( array( 'property' => '--jfb-progress-wrapper-bgc' ) ), |
| 2036 | ) |
| 2037 | ); |
| 2038 | |
| 2039 | $css_selector = $this->css_selector( '-progress-pages' ); |
| 2040 | |
| 2041 | $this->register_jet_control( |
| 2042 | 'jet_fb_progress_wrapper_margin', |
| 2043 | array( |
| 2044 | 'tab' => 'style', |
| 2045 | 'label' => esc_html__( 'Margin', 'jet-form-builder' ), |
| 2046 | 'type' => 'dimensions', |
| 2047 | 'css' => array( |
| 2048 | array( |
| 2049 | 'property' => 'margin', |
| 2050 | 'selector' => $css_selector, |
| 2051 | ), |
| 2052 | ), |
| 2053 | ) |
| 2054 | ); |
| 2055 | |
| 2056 | $this->register_jet_control( |
| 2057 | 'jet_fb_progress_wrapper_padding', |
| 2058 | array( |
| 2059 | 'tab' => 'style', |
| 2060 | 'label' => esc_html__( 'Padding', 'jet-form-builder' ), |
| 2061 | 'type' => 'dimensions', |
| 2062 | 'css' => array( |
| 2063 | array( |
| 2064 | 'property' => 'padding', |
| 2065 | 'selector' => $css_selector, |
| 2066 | ), |
| 2067 | ), |
| 2068 | ) |
| 2069 | ); |
| 2070 | |
| 2071 | $this->register_jet_control( |
| 2072 | 'jet_fb_progress_wrapper_border', |
| 2073 | array( |
| 2074 | 'tab' => 'style', |
| 2075 | 'label' => esc_html__( 'Border', 'jet-form-builder' ), |
| 2076 | 'type' => 'border', |
| 2077 | 'css' => array( |
| 2078 | array( |
| 2079 | 'property' => 'border', |
| 2080 | 'selector' => $css_selector, |
| 2081 | ), |
| 2082 | ), |
| 2083 | ) |
| 2084 | ); |
| 2085 | |
| 2086 | $this->end_jet_control_group(); |
| 2087 | } |
| 2088 | // End progress wrap |
| 2089 | |
| 2090 | // Start progress pages |
| 2091 | public function control_group_form_progress_pages_style() { |
| 2092 | $this->register_jet_control_group( |
| 2093 | 'jet_fb_progress_pages_section', |
| 2094 | array( |
| 2095 | 'title' => esc_html__( 'Form Progress - Pages', 'jet-form-builder' ), |
| 2096 | 'tab' => 'style', |
| 2097 | ) |
| 2098 | ); |
| 2099 | } |
| 2100 | |
| 2101 | public function controls_form_progress_pages_style() { |
| 2102 | $this->start_jet_control_group( 'jet_fb_progress_pages_section' ); |
| 2103 | |
| 2104 | $css_selectors = array( |
| 2105 | 'wrapper' => $this->css_selector( '-progress-pages__item--wrapper' ), |
| 2106 | 'item' => $this->css_selector( '-progress-pages__item' ), |
| 2107 | 'circle' => $this->css_selector( '-progress-pages__item--circle' ), |
| 2108 | 'passed-page' => $this->css_selector( '-progress-pages__item--wrapper.passed-page' ), |
| 2109 | 'active-page' => $this->css_selector( '-progress-pages__item--wrapper.active-page' ), |
| 2110 | ); |
| 2111 | |
| 2112 | $this->register_jet_control( |
| 2113 | 'jet_fb_progress_wrapper_typography', |
| 2114 | array( |
| 2115 | 'tab' => 'style', |
| 2116 | 'label' => esc_html__( 'Typography', 'jet-form-builder' ), |
| 2117 | 'type' => 'typography', |
| 2118 | 'css' => array( |
| 2119 | array( |
| 2120 | 'property' => 'typography', |
| 2121 | 'selector' => $css_selectors['wrapper'], |
| 2122 | ), |
| 2123 | ), |
| 2124 | ) |
| 2125 | ); |
| 2126 | |
| 2127 | $this->register_jet_control( |
| 2128 | 'jet_fb_progress_pages_bg_color', |
| 2129 | array( |
| 2130 | 'tab' => 'style', |
| 2131 | 'label' => esc_html__( 'Background color', 'jet-form-builder' ), |
| 2132 | 'type' => 'color', |
| 2133 | 'css' => array( array( 'property' => '--jfb-progress-default-page-bgc' ) ), |
| 2134 | ) |
| 2135 | ); |
| 2136 | |
| 2137 | $this->register_jet_control( |
| 2138 | 'jet_fb_progress_pages_margin', |
| 2139 | array( |
| 2140 | 'tab' => 'style', |
| 2141 | 'label' => esc_html__( 'Margin', 'jet-form-builder' ), |
| 2142 | 'type' => 'dimensions', |
| 2143 | 'css' => array( |
| 2144 | array( |
| 2145 | 'property' => 'margin', |
| 2146 | 'selector' => $css_selectors['item'], |
| 2147 | ), |
| 2148 | ), |
| 2149 | ) |
| 2150 | ); |
| 2151 | |
| 2152 | $this->register_jet_control( |
| 2153 | 'jet_fb_progress_pages_padding', |
| 2154 | array( |
| 2155 | 'tab' => 'style', |
| 2156 | 'label' => esc_html__( 'Padding', 'jet-form-builder' ), |
| 2157 | 'type' => 'dimensions', |
| 2158 | 'css' => array( |
| 2159 | array( |
| 2160 | 'property' => 'padding', |
| 2161 | 'selector' => $css_selectors['item'], |
| 2162 | ), |
| 2163 | ), |
| 2164 | ) |
| 2165 | ); |
| 2166 | |
| 2167 | $this->register_jet_control( |
| 2168 | 'jet_fb_progress_pages_border', |
| 2169 | array( |
| 2170 | 'tab' => 'style', |
| 2171 | 'label' => esc_html__( 'Border', 'jet-form-builder' ), |
| 2172 | 'type' => 'border', |
| 2173 | 'css' => array( |
| 2174 | array( |
| 2175 | 'property' => 'border', |
| 2176 | 'selector' => $css_selectors['item'], |
| 2177 | ), |
| 2178 | ), |
| 2179 | ) |
| 2180 | ); |
| 2181 | |
| 2182 | $this->register_jet_control( |
| 2183 | 'jet_fb_progress_separator_height', |
| 2184 | array( |
| 2185 | 'tab' => 'style', |
| 2186 | 'label' => esc_html__( 'Separator height', 'jet-form-builder' ), |
| 2187 | 'type' => 'number', |
| 2188 | 'units' => true, |
| 2189 | 'min' => 1, |
| 2190 | 'max' => 100, |
| 2191 | 'css' => array( array( 'property' => '--jfb-progress-default-page-separator-h' ) ), |
| 2192 | ) |
| 2193 | ); |
| 2194 | |
| 2195 | $this->register_jet_control( |
| 2196 | 'jet_fb_progress_separator_color', |
| 2197 | array( |
| 2198 | 'tab' => 'style', |
| 2199 | 'label' => esc_html__( 'Separator color', 'jet-form-builder' ), |
| 2200 | 'type' => 'color', |
| 2201 | 'css' => array( array( 'property' => '--jfb-progress-default-page-separator-color' ) ), |
| 2202 | ) |
| 2203 | ); |
| 2204 | |
| 2205 | $this->register_jet_control( |
| 2206 | 'jet_fb_progress_circle_border', |
| 2207 | array( |
| 2208 | 'tab' => 'style', |
| 2209 | 'label' => esc_html__( 'Circle border', 'jet-form-builder' ), |
| 2210 | 'type' => 'border', |
| 2211 | 'css' => array( |
| 2212 | array( |
| 2213 | 'property' => 'border', |
| 2214 | 'selector' => $css_selectors['circle'], |
| 2215 | ), |
| 2216 | ), |
| 2217 | ) |
| 2218 | ); |
| 2219 | |
| 2220 | $this->register_jet_control( |
| 2221 | 'jet_fb_progress_passed_page_heading', |
| 2222 | array( |
| 2223 | 'tab' => 'style', |
| 2224 | 'type' => 'separator', |
| 2225 | 'label' => esc_html__( 'Passed page', 'jet-form-builder' ), |
| 2226 | ) |
| 2227 | ); |
| 2228 | |
| 2229 | $this->register_jet_control( |
| 2230 | 'jet_fb_progress_passed_page_color', |
| 2231 | array( |
| 2232 | 'tab' => 'style', |
| 2233 | 'label' => esc_html__( 'Color', 'jet-form-builder' ), |
| 2234 | 'type' => 'color', |
| 2235 | 'css' => array( |
| 2236 | array( |
| 2237 | 'property' => 'color', |
| 2238 | 'selector' => $css_selectors['passed-page'], |
| 2239 | ), |
| 2240 | ), |
| 2241 | ) |
| 2242 | ); |
| 2243 | |
| 2244 | $this->register_jet_control( |
| 2245 | 'jet_fb_progress_passed_page_bg_color', |
| 2246 | array( |
| 2247 | 'tab' => 'style', |
| 2248 | 'label' => esc_html__( 'Background color', 'jet-form-builder' ), |
| 2249 | 'type' => 'color', |
| 2250 | 'css' => array( array( 'property' => '--jfb-progress-passed-page-bgc' ) ), |
| 2251 | ) |
| 2252 | ); |
| 2253 | |
| 2254 | $this->register_jet_control( |
| 2255 | 'jet_fb_progress_passed_page_border_color', |
| 2256 | array( |
| 2257 | 'tab' => 'style', |
| 2258 | 'label' => esc_html__( 'Border color', 'jet-form-builder' ), |
| 2259 | 'type' => 'color', |
| 2260 | 'css' => array( |
| 2261 | array( |
| 2262 | 'property' => 'border-color', |
| 2263 | 'selector' => '.passed-page ' . $css_selectors['item'], |
| 2264 | ), |
| 2265 | ), |
| 2266 | ) |
| 2267 | ); |
| 2268 | |
| 2269 | $this->register_jet_control( |
| 2270 | 'jet_fb_progress_passed_page_separator_height', |
| 2271 | array( |
| 2272 | 'tab' => 'style', |
| 2273 | 'label' => esc_html__( 'Separator height', 'jet-form-builder' ), |
| 2274 | 'type' => 'number', |
| 2275 | 'units' => true, |
| 2276 | 'min' => 1, |
| 2277 | 'max' => 100, |
| 2278 | 'css' => array( array( 'property' => '--jfb-progress-passed-page-separator-h' ) ), |
| 2279 | ) |
| 2280 | ); |
| 2281 | |
| 2282 | $this->register_jet_control( |
| 2283 | 'jet_fb_progress_passed_page_separator_color', |
| 2284 | array( |
| 2285 | 'tab' => 'style', |
| 2286 | 'label' => esc_html__( 'Separator color', 'jet-form-builder' ), |
| 2287 | 'type' => 'color', |
| 2288 | 'css' => array( array( 'property' => '--jfb-progress-passed-page-separator-color' ) ), |
| 2289 | ) |
| 2290 | ); |
| 2291 | |
| 2292 | $this->register_jet_control( |
| 2293 | 'jet_fb_progress_passed_page_circle_border_color', |
| 2294 | array( |
| 2295 | 'tab' => 'style', |
| 2296 | 'label' => esc_html__( 'Circle border color', 'jet-form-builder' ), |
| 2297 | 'type' => 'color', |
| 2298 | 'css' => array( |
| 2299 | array( |
| 2300 | 'property' => 'border-color', |
| 2301 | 'selector' => '.passed-page ' . $css_selectors['circle'], |
| 2302 | ), |
| 2303 | ), |
| 2304 | ) |
| 2305 | ); |
| 2306 | |
| 2307 | $this->register_jet_control( |
| 2308 | 'jet_fb_progress_active_page_heading', |
| 2309 | array( |
| 2310 | 'tab' => 'style', |
| 2311 | 'type' => 'separator', |
| 2312 | 'label' => esc_html__( 'Active page', 'jet-form-builder' ), |
| 2313 | ) |
| 2314 | ); |
| 2315 | |
| 2316 | $this->register_jet_control( |
| 2317 | 'jet_fb_progress_active_page_color', |
| 2318 | array( |
| 2319 | 'tab' => 'style', |
| 2320 | 'label' => esc_html__( 'Color', 'jet-form-builder' ), |
| 2321 | 'type' => 'color', |
| 2322 | 'css' => array( |
| 2323 | array( |
| 2324 | 'property' => 'color', |
| 2325 | 'selector' => $css_selectors['active-page'], |
| 2326 | ), |
| 2327 | ), |
| 2328 | ) |
| 2329 | ); |
| 2330 | |
| 2331 | $this->register_jet_control( |
| 2332 | 'jet_fb_progress_active_page_bg_color', |
| 2333 | array( |
| 2334 | 'tab' => 'style', |
| 2335 | 'label' => esc_html__( 'Background color', 'jet-form-builder' ), |
| 2336 | 'type' => 'color', |
| 2337 | 'css' => array( array( 'property' => '--jfb-progress-active-page-bgc' ) ), |
| 2338 | ) |
| 2339 | ); |
| 2340 | |
| 2341 | $this->register_jet_control( |
| 2342 | 'jet_fb_progress_active_page_border_color', |
| 2343 | array( |
| 2344 | 'tab' => 'style', |
| 2345 | 'label' => esc_html__( 'Border color', 'jet-form-builder' ), |
| 2346 | 'type' => 'color', |
| 2347 | 'css' => array( |
| 2348 | array( |
| 2349 | 'property' => 'border-color', |
| 2350 | 'selector' => '.active-page ' . $css_selectors['item'], |
| 2351 | ), |
| 2352 | ), |
| 2353 | ) |
| 2354 | ); |
| 2355 | |
| 2356 | $this->register_jet_control( |
| 2357 | 'jet_fb_progress_active_page_separator_height', |
| 2358 | array( |
| 2359 | 'tab' => 'style', |
| 2360 | 'label' => esc_html__( 'Separator height', 'jet-form-builder' ), |
| 2361 | 'type' => 'number', |
| 2362 | 'units' => true, |
| 2363 | 'min' => 1, |
| 2364 | 'max' => 100, |
| 2365 | 'css' => array( array( 'property' => '--jfb-progress-active-page-separator-h' ) ), |
| 2366 | ) |
| 2367 | ); |
| 2368 | |
| 2369 | $this->register_jet_control( |
| 2370 | 'jet_fb_progress_active_page_separator_color', |
| 2371 | array( |
| 2372 | 'tab' => 'style', |
| 2373 | 'label' => esc_html__( 'Separator color', 'jet-form-builder' ), |
| 2374 | 'type' => 'color', |
| 2375 | 'css' => array( array( 'property' => '--jfb-progress-active-page-separator-color' ) ), |
| 2376 | ) |
| 2377 | ); |
| 2378 | |
| 2379 | $this->register_jet_control( |
| 2380 | 'jet_fb_progress_active_page_circle_border_color', |
| 2381 | array( |
| 2382 | 'tab' => 'style', |
| 2383 | 'label' => esc_html__( 'Circle border color', 'jet-form-builder' ), |
| 2384 | 'type' => 'color', |
| 2385 | 'css' => array( |
| 2386 | array( |
| 2387 | 'property' => 'border-color', |
| 2388 | 'selector' => '.active-page ' . $css_selectors['circle'], |
| 2389 | ), |
| 2390 | ), |
| 2391 | ) |
| 2392 | ); |
| 2393 | |
| 2394 | $this->end_jet_control_group(); |
| 2395 | } |
| 2396 | // End progress pages |
| 2397 | |
| 2398 | // Start message style |
| 2399 | public function control_group_message_style() { |
| 2400 | $this->register_jet_control_group( |
| 2401 | 'section_message_style', |
| 2402 | array( |
| 2403 | 'title' => esc_html__( 'Messages', 'jet-form-builder' ), |
| 2404 | 'tab' => 'style', |
| 2405 | ) |
| 2406 | ); |
| 2407 | } |
| 2408 | |
| 2409 | public function controls_message_style() { |
| 2410 | $this->start_jet_control_group( 'section_message_style' ); |
| 2411 | |
| 2412 | $css_selectors = array( |
| 2413 | 'success' => $this->css_selector( '-message--success' ), |
| 2414 | 'error' => $this->css_selector( '-message--error' ), |
| 2415 | ); |
| 2416 | |
| 2417 | $this->register_jet_control( |
| 2418 | 'message_margin', |
| 2419 | array( |
| 2420 | 'tab' => 'style', |
| 2421 | 'label' => esc_html__( 'Margin', 'jet-form-builder' ), |
| 2422 | 'type' => 'dimensions', |
| 2423 | 'css' => array( |
| 2424 | array( |
| 2425 | 'property' => 'margin', |
| 2426 | 'selector' => $css_selectors['success'], |
| 2427 | ), |
| 2428 | array( |
| 2429 | 'property' => 'margin', |
| 2430 | 'selector' => $css_selectors['error'], |
| 2431 | ), |
| 2432 | ), |
| 2433 | ) |
| 2434 | ); |
| 2435 | |
| 2436 | $this->register_jet_control( |
| 2437 | 'message_padding', |
| 2438 | array( |
| 2439 | 'tab' => 'style', |
| 2440 | 'label' => esc_html__( 'Padding', 'jet-form-builder' ), |
| 2441 | 'type' => 'dimensions', |
| 2442 | 'css' => array( |
| 2443 | array( |
| 2444 | 'property' => 'padding', |
| 2445 | 'selector' => $css_selectors['success'], |
| 2446 | ), |
| 2447 | array( |
| 2448 | 'property' => 'padding', |
| 2449 | 'selector' => $css_selectors['error'], |
| 2450 | ), |
| 2451 | ), |
| 2452 | ) |
| 2453 | ); |
| 2454 | |
| 2455 | $this->register_jet_control( |
| 2456 | 'message_success_heading', |
| 2457 | array( |
| 2458 | 'tab' => 'style', |
| 2459 | 'type' => 'separator', |
| 2460 | 'label' => esc_html__( 'Success message', 'jet-form-builder' ), |
| 2461 | ) |
| 2462 | ); |
| 2463 | |
| 2464 | $this->register_jet_control( |
| 2465 | 'message_success_typography', |
| 2466 | array( |
| 2467 | 'tab' => 'style', |
| 2468 | 'label' => esc_html__( 'Typography', 'jet-form-builder' ), |
| 2469 | 'type' => 'typography', |
| 2470 | 'css' => array( |
| 2471 | array( |
| 2472 | 'property' => 'typography', |
| 2473 | 'selector' => $css_selectors['success'], |
| 2474 | ), |
| 2475 | ), |
| 2476 | ) |
| 2477 | ); |
| 2478 | |
| 2479 | $this->register_jet_control( |
| 2480 | 'message_success_bg_color', |
| 2481 | array( |
| 2482 | 'tab' => 'style', |
| 2483 | 'label' => esc_html__( 'Background color', 'jet-form-builder' ), |
| 2484 | 'type' => 'color', |
| 2485 | 'css' => array( array( 'property' => '--jfb-message-success-bgc' ) ), |
| 2486 | ) |
| 2487 | ); |
| 2488 | |
| 2489 | $this->register_jet_control( |
| 2490 | 'message_success_border', |
| 2491 | array( |
| 2492 | 'tab' => 'style', |
| 2493 | 'label' => esc_html__( 'Border', 'jet-form-builder' ), |
| 2494 | 'type' => 'border', |
| 2495 | 'css' => array( |
| 2496 | array( |
| 2497 | 'property' => 'border', |
| 2498 | 'selector' => $css_selectors['success'], |
| 2499 | ), |
| 2500 | ), |
| 2501 | ) |
| 2502 | ); |
| 2503 | |
| 2504 | $this->register_jet_control( |
| 2505 | 'message_error_heading', |
| 2506 | array( |
| 2507 | 'tab' => 'style', |
| 2508 | 'type' => 'separator', |
| 2509 | 'label' => esc_html__( 'Error message', 'jet-form-builder' ), |
| 2510 | ) |
| 2511 | ); |
| 2512 | |
| 2513 | $this->register_jet_control( |
| 2514 | 'message_error_typography', |
| 2515 | array( |
| 2516 | 'tab' => 'style', |
| 2517 | 'label' => esc_html__( 'Typography', 'jet-form-builder' ), |
| 2518 | 'type' => 'typography', |
| 2519 | 'css' => array( |
| 2520 | array( |
| 2521 | 'property' => 'typography', |
| 2522 | 'selector' => $css_selectors['error'], |
| 2523 | ), |
| 2524 | ), |
| 2525 | ) |
| 2526 | ); |
| 2527 | |
| 2528 | $this->register_jet_control( |
| 2529 | 'message_error_bg_color', |
| 2530 | array( |
| 2531 | 'tab' => 'style', |
| 2532 | 'label' => esc_html__( 'Background color', 'jet-form-builder' ), |
| 2533 | 'type' => 'color', |
| 2534 | 'css' => array( array( 'property' => '--jfb-message-error-bgc' ) ), |
| 2535 | ) |
| 2536 | ); |
| 2537 | |
| 2538 | $this->register_jet_control( |
| 2539 | 'message_error_border', |
| 2540 | array( |
| 2541 | 'tab' => 'style', |
| 2542 | 'label' => esc_html__( 'Border', 'jet-form-builder' ), |
| 2543 | 'type' => 'border', |
| 2544 | 'css' => array( |
| 2545 | array( |
| 2546 | 'property' => 'border', |
| 2547 | 'selector' => $css_selectors['error'], |
| 2548 | ), |
| 2549 | ), |
| 2550 | ) |
| 2551 | ); |
| 2552 | |
| 2553 | $this->end_jet_control_group(); |
| 2554 | } |
| 2555 | // End message style |
| 2556 | |
| 2557 | |
| 2558 | /** |
| 2559 | * Enqueue element styles and scripts |
| 2560 | * |
| 2561 | * @noinspection PhpUnhandledExceptionInspection |
| 2562 | */ |
| 2563 | public function enqueue_scripts() { |
| 2564 | $module = jet_form_builder()->compat( 'bricks' ); |
| 2565 | |
| 2566 | wp_enqueue_style( |
| 2567 | $module->get_handle( 'frontend' ), |
| 2568 | $module->get_url( 'assets/build/css/frontend/frontend.css' ), |
| 2569 | array( 'jet-form-builder-frontend' ), |
| 2570 | Plugin::instance()->get_version() |
| 2571 | ); |
| 2572 | } |
| 2573 | |
| 2574 | /** |
| 2575 | * Render element HTML |
| 2576 | * |
| 2577 | * @noinspection PhpUnhandledExceptionInspection |
| 2578 | */ |
| 2579 | public function render() { |
| 2580 | |
| 2581 | $settings = $this->parse_jet_render_attributes( $this->get_jet_settings() ); |
| 2582 | |
| 2583 | // STEP: Form field is empty: Show placeholder text |
| 2584 | if ( empty( $settings['form_id'] ) ) { |
| 2585 | return $this->render_element_placeholder( |
| 2586 | array( |
| 2587 | 'title' => esc_html__( 'Please select form to show.', 'jet-form-builder' ), |
| 2588 | ) |
| 2589 | ); |
| 2590 | } |
| 2591 | |
| 2592 | $this->enqueue_scripts(); |
| 2593 | |
| 2594 | /** @var Blocks\Module $blocks */ |
| 2595 | $blocks = jet_form_builder()->module( \Jet_Form_Builder\Blocks\Module::class ); |
| 2596 | |
| 2597 | // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 2598 | echo "<div {$this->render_attributes( '_root' )}>"; |
| 2599 | // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 2600 | echo $blocks->get_form_class()->render_callback_field( $settings ); |
| 2601 | echo '</div>'; |
| 2602 | } |
| 2603 | |
| 2604 | public function css_selector( $mod = null ) { |
| 2605 | return sprintf( '%1$s%2$s', '.jet-form-builder', $mod ); |
| 2606 | } |
| 2607 | } |
| 2608 |