PluginProbe
Booking Calendar / 11.2
Booking Calendar v11.2
11.8.3 11.8.2 11.8.1 11.8 11.7 11.6.1 11.6 11.5 11.4.3 11.4.2 11.4.1 11.4 11.3 11.2.1 11.2 11.1 11.0 10.15.7 10.15.6 10.1.3 10.10 10.10.1 10.10.2 10.11 10.11.2 All 203 releases
booking / includes / page-form-builder / _src / form_templates.js

form_templates.js in Booking Calendar 11.2, at includes/page-form-builder/_src/form_templates.js

440 lines 15.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 // ---------------------------------------------------------------------------------------------------------------------
2 // == File /_out/form_templates.js == Time point: 2025-08-28 19:11
3 // ---------------------------------------------------------------------------------------------------------------------
4
5 /**
6 * Example serialized form structure used as initial data/fallback.
7 *
8 * @returns {Array<Object>} Pages array compatible with `load_saved_structure()`.
9 */
10 function wpbc_bfb__form_structure__get_example() {
11 return [
12 {
13 "page": 1,
14 "content": [
15 {
16 "type": "section",
17 "data": {
18 "id": "section-3-1758289897531",
19 "label": "Section",
20 "html_id": "",
21 "cssclass": "",
22 "col_styles": "[{\"aself\":\"stretch\"},{\"dir\":\"row\",\"wrap\":\"wrap\",\"jc\":\"center\",\"ai\":\"center\",\"aself\":\"stretch\"},{\"aself\":\"stretch\"}]",
23 "columns": [
24 {
25 "width": "41.1303%",
26 "items": [
27 {
28 "type": "field",
29 "data": {
30 "id": "calendar",
31 "type": "calendar",
32 "usage_key": "calendar",
33 "usagenumber": 1,
34 "resource_id": 3,
35 "months": 1,
36 "label": "Select dates",
37 "min_width": "250px",
38 "name": "calendar",
39 "help": ""
40 }
41 }
42 ]
43 },
44 {
45 "width": "0.1%",
46 "items": [
47 {
48 "type": "field",
49 "data": {
50 "type": "divider",
51 "usage_key": "divider_vertical",
52 "orientation": "vertical",
53 "line_style": "solid",
54 "thickness_px": 1,
55 "length": "90%",
56 "align": "middle",
57 "color": "#ccc",
58 "label": "Divider_vertical",
59 "margin_top_px": 0,
60 "margin_bottom_px": 0,
61 "margin_left_px": 0,
62 "margin_right_px": 0,
63 "cssclass_extra": "",
64 "id": "divider-vertical-64z2s",
65 "name": "divider-vertical-64z2s",
66 "html_id": ""
67 }
68 }
69 ]
70 },
71 {
72 "width": "52.7697%",
73 "items": [
74 {
75 "type": "field",
76 "data": {
77 "id": "input-text",
78 "type": "text",
79 "min_width": "8em",
80 "label": "First Name",
81 "usage_key": "text",
82 "name": "firstname",
83 "placeholder": "Example: \"John\"",
84 "required": 1,
85 "help": "Enter your first name.",
86 "minlength": 5,
87 "maxlength": 10,
88 "pattern": "aaa",
89 "cssclass": "firstname myname",
90 "html_id": "my-name"
91 }
92 },
93 {
94 "type": "field",
95 "data": {
96 "type": "text",
97 "min_width": "8em",
98 "label": "Second Name",
99 "usage_key": "text",
100 "placeholder": "Example: \"Smith\"",
101 "required": 1,
102 "help": "Enter your last name.",
103 "minlength": 7,
104 "maxlength": 12,
105 "pattern": "bb",
106 "cssclass": "secondname lastname",
107 "id": "first-name-vd18d",
108 "name": "secondname",
109 "html_id": "my-lastname"
110 }
111 },
112 {
113 "type": "field",
114 "data": {
115 "id": "divider_horizontal",
116 "type": "divider",
117 "usage_key": "divider_horizontal",
118 "orientation": "horizontal",
119 "line_style": "solid",
120 "thickness_px": 2,
121 "length": "100%",
122 "align": "center",
123 "color": "#e0e0e0",
124 "label": "Divider_horizontal",
125 "name": "divider_horizontal",
126 "margin_top_px": 8,
127 "margin_bottom_px": 8,
128 "margin_left_px": 8,
129 "margin_right_px": 8,
130 "cssclass_extra": "",
131 "html_id": ""
132 }
133 },
134 {
135 "type": "field",
136 "data": {
137 "id": "select",
138 "type": "select",
139 "usage_key": "select",
140 "label": "Persons",
141 "name": "visitors",
142 "min_width": "100px",
143 "html_id": "personsandvisitorsid",
144 "cssclass": "persons_css visitors_css",
145 "placeholder": "--- Select ---",
146 "options": [
147 {
148 "label": "Person 1",
149 "value": "1",
150 "selected": false
151 },
152 {
153 "label": "Person 2",
154 "value": "2",
155 "selected": false
156 },
157 {
158 "label": "Option 3",
159 "value": "3",
160 "selected": false
161 },
162 {
163 "label": "More than 4",
164 "value": "4-10",
165 "selected": false
166 }
167 ],
168 "help": "Select number of visitors",
169 "required": 1,
170 "size": 4,
171 "default_value": ""
172 }
173 }
174 ]
175 }
176 ]
177 }
178 },
179 {
180 "type": "section",
181 "data": {
182 "id": "section-5-1758537550476",
183 "label": "Section",
184 "html_id": "",
185 "cssclass": "",
186 "col_styles": "[{\"dir\":\"row\",\"wrap\":\"wrap\",\"jc\":\"flex-end\",\"ai\":\"flex-end\",\"gap\":\"9px\",\"aself\":\"flex-end\"}]",
187 "columns": [
188 {
189 "width": "100%",
190 "items": [
191 {
192 "type": "field",
193 "data": {
194 "type": "divider",
195 "usage_key": "divider_vertical",
196 "orientation": "horizontal",
197 "line_style": "solid",
198 "thickness_px": 1,
199 "length": "100%",
200 "align": "center",
201 "color": "#ccc",
202 "label": "Divider_vertical",
203 "margin_top_px": 0,
204 "margin_bottom_px": 0,
205 "margin_left_px": 0,
206 "margin_right_px": 0,
207 "cssclass_extra": "",
208 "id": "divider-vertical-he40a",
209 "name": "divider-vertical-he40a",
210 "html_id": ""
211 }
212 },
213 {
214 "type": "field",
215 "data": {
216 "id": "wizard_nav_next",
217 "type": "wizard_nav",
218 "usage_key": "wizard_nav_next",
219 "direction": "next",
220 "target_step": 2,
221 "label": "Next",
222 "name": "wizard_nav_next",
223 "cssclass_extra": "",
224 "html_id": ""
225 }
226 }
227 ]
228 }
229 ]
230 }
231 }
232 ]
233 },
234 {
235 "page": 2,
236 "content": [
237 {
238 "type": "section",
239 "data": {
240 "id": "section-4-1758634530779",
241 "label": "Section",
242 "html_id": "",
243 "cssclass": "",
244 "col_styles": "",
245 "columns": [
246 {
247 "width": "28.6112%",
248 "items": [
249 {
250 "type": "field",
251 "data": {
252 "id": "radio",
253 "type": "radio",
254 "usage_key": "radio",
255 "label": "Radio buttons",
256 "name": "radio",
257 "min_width": "240px",
258 "html_id": "",
259 "cssclass": "group_inline",
260 "placeholder": "--- Select ---",
261 "options": [
262 {
263 "label": "Option 1",
264 "value": "Option 1",
265 "selected": false
266 },
267 {
268 "label": "Option 2",
269 "value": "Option 2",
270 "selected": false
271 },
272 {
273 "label": "Option 3",
274 "value": "Option 3",
275 "selected": false
276 },
277 {
278 "label": "Option 4",
279 "value": "Option 4",
280 "selected": false
281 }
282 ],
283 "layout_inline": 1
284 }
285 }
286 ]
287 },
288 {
289 "width": "28.6112%",
290 "items": [
291 {
292 "type": "field",
293 "data": {
294 "id": "checkbox",
295 "type": "checkbox",
296 "usage_key": "checkbox",
297 "label": "Checkboxes",
298 "name": "checkbox",
299 "min_width": "240px",
300 "html_id": "",
301 "cssclass": "group_inline",
302 "options": [
303 {
304 "label": "Option 1",
305 "value": "Option 1",
306 "selected": false
307 },
308 {
309 "label": "Option 2",
310 "value": "Option 2",
311 "selected": false
312 },
313 {
314 "label": "Option 3",
315 "value": "Option 3",
316 "selected": false
317 }
318 ],
319 "placeholder": "--- Select ---",
320 "multiple": 1,
321 "layout_inline": 1
322 }
323 }
324 ]
325 },
326 {
327 "width": "36.7777%",
328 "items": [
329 {
330 "type": "field",
331 "data": {
332 "id": "select-7yq",
333 "type": "select",
334 "usage_key": "select",
335 "label": "Select",
336 "name": "select-7yq",
337 "min_width": "240px",
338 "html_id": "",
339 "cssclass": "",
340 "placeholder": "--- Select ---",
341 "options": [
342 {
343 "label": "Option 1",
344 "value": "Option 1",
345 "selected": false
346 },
347 {
348 "label": "Option 2",
349 "value": "Option 2",
350 "selected": false
351 },
352 {
353 "label": "Option 3",
354 "value": "Option 3",
355 "selected": false
356 },
357 {
358 "label": "Option 4",
359 "value": "Option 4",
360 "selected": false
361 }
362 ]
363 }
364 }
365 ]
366 }
367 ]
368 }
369 },
370 {
371 "type": "section",
372 "data": {
373 "id": "section-5-1758537550477",
374 "label": "Section",
375 "html_id": "",
376 "cssclass": "",
377 "col_styles": "[{\"dir\":\"row\",\"wrap\":\"wrap\",\"jc\":\"flex-end\",\"ai\":\"flex-end\",\"gap\":\"9px\",\"aself\":\"flex-end\"}]",
378 "columns": [
379 {
380 "width": "100%",
381 "items": [
382 {
383 "type": "field",
384 "data": {
385 "type": "divider",
386 "usage_key": "divider_vertical",
387 "orientation": "horizontal",
388 "line_style": "solid",
389 "thickness_px": 1,
390 "length": "100%",
391 "align": "center",
392 "color": "#ccc",
393 "label": "Divider_vertical",
394 "margin_top_px": 0,
395 "margin_bottom_px": 0,
396 "margin_left_px": 0,
397 "margin_right_px": 0,
398 "cssclass_extra": "",
399 "id": "divider-vertical-he40a-2",
400 "name": "divider-vertical-he40a-2",
401 "html_id": ""
402 }
403 },
404 {
405 "type": "field",
406 "data": {
407 "id": "wizard_nav_back-2",
408 "type": "wizard_nav",
409 "usage_key": "wizard_nav_back",
410 "direction": "back",
411 "target_step": 1,
412 "label": "Back",
413 "name": "wizard_nav_back-2",
414 "cssclass_extra": "",
415 "html_id": ""
416 }
417 },
418 {
419 "type": "field",
420 "data": {
421 "id": "submit",
422 "type": "submit",
423 "usage_key": "submit",
424 "usagenumber": 1,
425 "label": "Send",
426 "name": "submit",
427 "cssclass": "wpbc_bfb__btn wpbc_bfb__btn--primary",
428 "html_id": ""
429 }
430 }
431 ]
432 }
433 ]
434 }
435 }
436 ]
437 }
438 ];
439 }
440