PluginProbe
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder / trunk
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder vtrunk
2.12.0 2.11.1 2.11.0 2.10.0 2.9.0 2.7.4 2.7.5 2.7.6 2.7.7 2.8.0 2.8.1 2.9.1 trunk 1.0 1.0-beta1 1.0-beta2 1.0-beta3 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.2.0 1.2.1 All 78 releases
ablocks / includes / blocks / form-input / attributes.php

attributes.php in aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder trunk, at includes/blocks/form-input/attributes.php

103 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit;
11 }
12
13 $attributes = [
14 'block_id' => array(
15 'type' => 'string',
16 'default' => ''
17 ),
18 // 'inputWidth' => [
19 // 'type' => 'number',
20 // 'default' => 100
21 // ],
22 'customName' => [
23 'type' => 'string',
24 'default' => '',
25 ],
26 'label' => [
27 'type' => 'string',
28 'default' => 'Name'
29 ],
30 'helperText' => [
31 'type' => 'string',
32 'default' => ''
33 ],
34 'formType' => [
35 'type' => 'string',
36 'default' => ''
37 ],
38 'errorMsg' => [
39 'type' => 'string',
40 'default' => 'This field is required',
41 ],
42 'name' => [
43 'type' => 'string',
44 'default' => ''
45 ],
46 'placeholder' => [
47 'type' => 'string',
48 'default' => 'name'
49 ],
50 'inputType' => [
51 'type' => 'string',
52 'default' => ''
53 ],
54 'isRequired' => [
55 'type' => 'boolean',
56 'default' => true
57 ],
58 'nameChangeable' => [
59 'type' => 'boolean',
60 'default' => true
61 ],
62 'showIcon' => [
63 'type' => 'boolean',
64 'default' => false
65 ],
66 'iconColor' => [
67 'type' => 'string',
68 'default' => ''
69 ],
70 ];
71
72 $attributes = array_merge(
73 $attributes,
74 Border::get_attribute( 'border', true ),
75 Icon::get_attribute('icon', [
76 'size' => 28,
77 ] ),
78 ButtonGroup::get_attribute( 'emailType', false, [
79 'value' => 'email',
80 ] ),
81 Range::get_attribute( [
82 'attributeName' => 'inputIconSize',
83 'isResponsive' => false,
84 'defaultValue' => 28,
85 ] ),
86 Range::get_attribute( [
87 'attributeName' => 'inputIconSpace',
88 'isResponsive' => false,
89 'defaultValue' => 38,
90 ] ),
91 Range::get_attribute( [
92 'attributeName' => 'inputWidth',
93 'attributeObjectKey' => 'value',
94 'isResponsive' => true,
95 'defaultValue' => 100,
96 'hasUnit' => true,
97 'unitDefaultValue' => '%',
98 ] ),
99 );
100
101 return array_merge( $attributes, \ABlocks\Classes\BlockGlobal::get_attributes() );
102
103