File tree Expand file tree Collapse file tree 2 files changed +112
-0
lines changed
packages/plugin-form-builder/src Expand file tree Collapse file tree 2 files changed +112
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,95 @@ const width: Field = {
28
28
label : 'Field Width (percentage)' ,
29
29
}
30
30
31
+ const placeholder : Field = {
32
+ name : 'placeholder' ,
33
+ type : 'text' ,
34
+ label : 'Placeholder' ,
35
+ }
36
+
37
+ const Radio : Block = {
38
+ slug : 'radio' ,
39
+ fields : [
40
+ {
41
+ type : 'row' ,
42
+ fields : [
43
+ {
44
+ ...name ,
45
+ admin : {
46
+ width : '50%' ,
47
+ } ,
48
+ } ,
49
+ {
50
+ ...label ,
51
+ admin : {
52
+ width : '50%' ,
53
+ } ,
54
+ } ,
55
+ ] ,
56
+ } ,
57
+ {
58
+ type : 'row' ,
59
+ fields : [
60
+ {
61
+ ...width ,
62
+ admin : {
63
+ width : '50%' ,
64
+ } ,
65
+ } ,
66
+ {
67
+ name : 'defaultValue' ,
68
+ type : 'text' ,
69
+ admin : {
70
+ width : '50%' ,
71
+ } ,
72
+ label : 'Default Value' ,
73
+ localized : true ,
74
+ } ,
75
+ ] ,
76
+ } ,
77
+ {
78
+ name : 'options' ,
79
+ type : 'array' ,
80
+ fields : [
81
+ {
82
+ type : 'row' ,
83
+ fields : [
84
+ {
85
+ name : 'label' ,
86
+ type : 'text' ,
87
+ admin : {
88
+ width : '50%' ,
89
+ } ,
90
+ label : 'Label' ,
91
+ localized : true ,
92
+ required : true ,
93
+ } ,
94
+ {
95
+ name : 'value' ,
96
+ type : 'text' ,
97
+ admin : {
98
+ width : '50%' ,
99
+ } ,
100
+ label : 'Value' ,
101
+ required : true ,
102
+ } ,
103
+ ] ,
104
+ } ,
105
+ ] ,
106
+ label : 'Radio Attribute Options' ,
107
+ labels : {
108
+ plural : 'Options' ,
109
+ singular : 'Option' ,
110
+ } ,
111
+ } ,
112
+ required ,
113
+ ] ,
114
+ labels : {
115
+ plural : 'Radio Fields' ,
116
+ singular : 'Radio' ,
117
+ } ,
118
+ }
119
+
31
120
const Select : Block = {
32
121
slug : 'select' ,
33
122
fields : [
@@ -68,6 +157,14 @@ const Select: Block = {
68
157
} ,
69
158
] ,
70
159
} ,
160
+ {
161
+ type : 'row' ,
162
+ fields : [
163
+ {
164
+ ...placeholder ,
165
+ } ,
166
+ ] ,
167
+ } ,
71
168
{
72
169
name : 'options' ,
73
170
type : 'array' ,
@@ -576,6 +673,7 @@ export const fields = {
576
673
message : Message ,
577
674
number : Number ,
578
675
payment : Payment ,
676
+ radio : Radio ,
579
677
select : Select ,
580
678
state : State ,
581
679
text : Text ,
Original file line number Diff line number Diff line change @@ -97,6 +97,19 @@ export interface SelectField {
97
97
label ?: string
98
98
name : string
99
99
options : SelectFieldOption [ ]
100
+ placeholder ?: string
101
+ required ?: boolean
102
+ width ?: number
103
+ }
104
+
105
+ export interface RadioField {
106
+ blockName ?: string
107
+ blockType : 'radio'
108
+ defaultValue ?: string
109
+ label ?: string
110
+ name : string
111
+ options : SelectFieldOption [ ]
112
+ placeholder ?: string
100
113
required ?: boolean
101
114
width ?: number
102
115
}
@@ -175,6 +188,7 @@ export type FormFieldBlock =
175
188
| EmailField
176
189
| MessageField
177
190
| PaymentField
191
+ | RadioField
178
192
| SelectField
179
193
| StateField
180
194
| TextAreaField
You can’t perform that action at this time.
0 commit comments