Skip to content
This repository was archived by the owner on Nov 21, 2023. It is now read-only.

Commit 8773c4c

Browse files
committed
add form block
1 parent 6206c86 commit 8773c4c

File tree

2 files changed

+85
-0
lines changed

2 files changed

+85
-0
lines changed

admin/app/blocks/blocks.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { block_editorial } from './editorial.js'
1010
import { block_embed } from './embed.js'
1111
import { block_faq } from './faq.js'
1212
import { block_figure } from './figure.js'
13+
import { block_form } from './form.js'
1314
import { block_datas } from './datas.js'
1415
import { block_images } from './images.js'
1516
import { block_instagram } from './instagram.js'

admin/app/blocks/form.js

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
import { title } from '../fields/title.js'
2+
import { text } from '../fields/text.js'
3+
import { value } from '../fields/value.js'
4+
import { grid } from '../fields/grid.js'
5+
import { background } from '../fields/background.js'
6+
7+
export const block_form = {
8+
name: 'form',
9+
label: 'Formulaire',
10+
widget: 'object',
11+
required: false,
12+
i18n: true,
13+
collapsed: false,
14+
summary: '{{title}}',
15+
fields: [
16+
title,
17+
text,
18+
grid,
19+
{ name: 'name', label: 'Identifiant du formulaire', widget: 'string', i18n: 'duplicate' },
20+
{ name: 'submit', label: 'Texte du bouton d’envoie', widget: 'string', i18n: true },
21+
{
22+
name: 'items',
23+
label: 'Champs',
24+
label_singular: 'champ',
25+
widget: 'list',
26+
required: false,
27+
i18n: true,
28+
collapsed: true,
29+
summary: '{{label}}',
30+
fields: [
31+
{ name: 'label', label: 'Label du champ', widget: 'string', i18n: true },
32+
{
33+
name: 'type',
34+
label: 'Type de champ',
35+
widget: 'select',
36+
i18n: 'duplicate',
37+
options: [
38+
{ label: 'Email', value: 'email' },
39+
{ label: 'Select', value: 'select' },
40+
{ label: 'Téléphone', value: 'tel' },
41+
{ label: 'Texte', value: 'text' },
42+
{ label: 'Zone de texte', value: 'textarea' }
43+
],
44+
default: 'text',
45+
},
46+
{
47+
name: 'options',
48+
label: 'Options',
49+
label_singular: 'option',
50+
hint: 'Pour un champ select seulement',
51+
widget: 'list',
52+
required: false,
53+
i18n: true,
54+
fields: [
55+
title,
56+
value
57+
],
58+
},
59+
{ name: 'placeholder', label: 'Placeholder', widget: 'string', i18n: true, required: false },
60+
{
61+
name: 'autocomplete',
62+
label: 'Autocomplete',
63+
widget: 'select',
64+
i18n: 'duplicate',
65+
required: false,
66+
options: [
67+
{ label: 'Code postal', value: 'postal-code' },
68+
{ label: 'Email', value: 'email' },
69+
{ label: 'Nom complet', value: 'name' },
70+
{ label: 'Nom de famille', value: 'family-name' },
71+
{ label: 'Numéro et nom de la rue', value: 'street-address' },
72+
{ label: 'Pays', value: 'country-name' },
73+
{ label: 'Prénom', value: 'given-name' },
74+
{ label: 'Société', value: 'organization' },
75+
{ label: 'Téléphone', value: 'tel' },
76+
{ label: 'Zone de texte', value: 'textarea' }
77+
],
78+
hint: 'Utilisé par le navigateur pour préremplir le champ',
79+
}
80+
]
81+
},
82+
background
83+
]
84+
}

0 commit comments

Comments
 (0)