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