| 1 |
<?php |
| 2 |
namespace ABlocks\Blocks\FormBuilder; |
| 3 |
|
| 4 |
use ABlocks\Controls\Icon; |
| 5 |
use ABlocks\Controls\Border; |
| 6 |
use ABlocks\Controls\Range; |
| 7 |
use ABlocks\Components\ButtonGroup; |
| 8 |
if ( ! defined( 'ABSPATH' ) ) { |
| 9 |
exit; |
| 10 |
} |
| 11 |
|
| 12 |
$attributes = [ |
| 13 |
'block_id' => array( |
| 14 |
'type' => 'string', |
| 15 |
'default' => '' |
| 16 |
), |
| 17 |
'inputWidth' => [ |
| 18 |
'type' => 'number', |
| 19 |
'default' => 100 |
| 20 |
], |
| 21 |
'customName' => [ |
| 22 |
'type' => 'string', |
| 23 |
'default' => '', |
| 24 |
], |
| 25 |
'label' => [ |
| 26 |
'type' => 'string', |
| 27 |
'default' => 'Name' |
| 28 |
], |
| 29 |
'helperText' => [ |
| 30 |
'type' => 'string', |
| 31 |
'default' => '' |
| 32 |
], |
| 33 |
'formType' => [ |
| 34 |
'type' => 'string', |
| 35 |
'default' => '' |
| 36 |
], |
| 37 |
'errorMsg' => [ |
| 38 |
'type' => 'string', |
| 39 |
'default' => 'This field is required', |
| 40 |
], |
| 41 |
'name' => [ |
| 42 |
'type' => 'string', |
| 43 |
'default' => '' |
| 44 |
], |
| 45 |
'placeholder' => [ |
| 46 |
'type' => 'string', |
| 47 |
'default' => 'name' |
| 48 |
], |
| 49 |
'inputType' => [ |
| 50 |
'type' => 'string', |
| 51 |
'default' => '' |
| 52 |
], |
| 53 |
'isRequired' => [ |
| 54 |
'type' => 'boolean', |
| 55 |
'default' => true |
| 56 |
], |
| 57 |
'nameChangeable' => [ |
| 58 |
'type' => 'boolean', |
| 59 |
'default' => true |
| 60 |
], |
| 61 |
'showIcon' => [ |
| 62 |
'type' => 'boolean', |
| 63 |
'default' => false |
| 64 |
], |
| 65 |
'iconColor' => [ |
| 66 |
'type' => 'string', |
| 67 |
'default' => '' |
| 68 |
], |
| 69 |
]; |
| 70 |
|
| 71 |
$attributes = array_merge( |
| 72 |
$attributes, |
| 73 |
Border::get_attribute( 'border', true ), |
| 74 |
Icon::get_attribute('icon', [ |
| 75 |
'size' => 28, |
| 76 |
] ), |
| 77 |
ButtonGroup::get_attribute( 'emailType', false, [ |
| 78 |
'value' => 'email', |
| 79 |
] ), |
| 80 |
Range::get_attribute( [ |
| 81 |
'attributeName' => 'inputIconSize', |
| 82 |
'isResponsive' => false, |
| 83 |
'defaultValue' => 28, |
| 84 |
] ), |
| 85 |
Range::get_attribute( [ |
| 86 |
'attributeName' => 'inputIconSpace', |
| 87 |
'isResponsive' => false, |
| 88 |
'defaultValue' => 38, |
| 89 |
] ), |
| 90 |
); |
| 91 |
|
| 92 |
return array_merge( $attributes, \ABlocks\Classes\BlockGlobal::get_attributes() ); |
| 93 |
|
| 94 |
|