PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.1.2
JetFormBuilder — Dynamic Blocks Form Builder v3.1.2
3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.10 2.1.11 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 3.0.0 3.0.0.1 3.0.0.2 3.0.0.3 3.0.1 3.0.1.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.0.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.3.1 3.3.4 3.3.4.1 3.3.4.2 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.5.1 3.4.5.2 3.4.6 3.4.7 3.4.7.1 3.5.0 3.5.1 3.5.1.1 3.5.1.2 3.5.2 3.5.2.1 3.5.3 3.5.4 3.5.5 3.5.6 3.5.6.1 3.5.6.2 3.5.6.3 3.6.0
jetformbuilder / assets / src / editor / blocks / form-break-field / edit.js
jetformbuilder / assets / src / editor / blocks / form-break-field Last commit date
edit.js 2 years ago index.js 2 years ago preview.js 2 years ago
edit.js
132 lines
1 import preview from './preview';
2
3 const {
4 BlockClassName,
5 BlockAddPrevButton,
6 BlockPrevButtonLabel,
7 } = JetFBComponents;
8
9 const { __ } = wp.i18n;
10
11 const {
12 InspectorControls,
13 useBlockProps,
14 RichText,
15 } = wp.blockEditor ? wp.blockEditor : wp.editor;
16
17 const {
18 TextareaControl,
19 TextControl,
20 PanelBody,
21 Button,
22 ToggleControl,
23 } = wp.components;
24
25 export default function FormBreakEdit( props ) {
26
27 const blockProps = useBlockProps();
28
29 const {
30 attributes,
31 setAttributes,
32 editProps: { uniqKey, attrHelp },
33 } = props;
34
35 if ( attributes.isPreview ) {
36 return <div style={ {
37 width: '100%',
38 display: 'flex',
39 justifyContent: 'center',
40 } }>
41 { preview }
42 </div>;
43 }
44
45 return [
46 props.isSelected && <InspectorControls
47 key={ uniqKey( 'InspectorControls' ) }
48 >
49 <PanelBody
50 title={ __( 'Buttons Settings', 'jet-form-builder' ) }
51 >
52 <ToggleControl
53 key={ uniqKey( 'add_next_button' ) }
54 label={ __( 'Enable "Next" Button', 'jet-form-builder' ) }
55 checked={ attributes.add_next_button }
56 help={ attrHelp( 'add_next_button' ) }
57 onChange={ add_next_button => setAttributes(
58 { add_next_button } ) }
59 />
60 { attributes.add_next_button && <TextControl
61 label={ __( 'Next Button label', 'jet-form-builder' ) }
62 value={ attributes.label }
63 onChange={ label => setAttributes( { label } ) }
64 /> }
65 <BlockAddPrevButton/>
66 <BlockPrevButtonLabel/>
67 </PanelBody>
68 <PanelBody
69 title={ __( 'Page Settings', 'jet-form-builder' ) }
70 >
71 <TextControl
72 label={ __( 'Label of progress', 'jet-form-builder' ) }
73 value={ attributes.label_progress }
74 help={ attrHelp( 'label_progress' ) }
75 onChange={ ( newValue ) => {
76 props.setAttributes( { label_progress: newValue } );
77 } }
78 />
79 <TextareaControl
80 key="page_break_disabled"
81 value={ attributes.page_break_disabled }
82 label={ __( 'Validation message', 'jet-form-builder' ) }
83 help={ attrHelp( 'page_break_disabled' ) }
84 onChange={ ( newValue ) => {
85 setAttributes( { page_break_disabled: newValue } );
86 } }
87 />
88 </PanelBody>
89 <PanelBody
90 title={ __( 'Advanced', 'jet-form-builder' ) }
91 >
92 <BlockClassName/>
93 </PanelBody>
94 </InspectorControls>,
95 <div { ...blockProps } key={ uniqKey( 'viewBlock' ) }>
96 <div
97 className={ 'jet-form-builder__next-page-wrap jet-form-builder__bottom-line' }>
98 { attributes.add_next_button && <Button
99 isSecondary
100 key="next_page_button"
101 className="jet-form-builder__next-page"
102 >
103 <RichText
104 placeholder="Next..."
105 allowedFormats={ [] }
106 value={ attributes.label }
107 onChange={ label => setAttributes( { label } ) }
108 />
109 </Button> }
110 { attributes.add_prev && <Button
111 isSecondary
112 key="prev_page_button"
113 className="jet-form-builder__prev-page"
114 >
115 <RichText
116 placeholder="Prev..."
117 allowedFormats={ [] }
118 value={ attributes.prev_label }
119 onChange={ prev_label => setAttributes(
120 { prev_label } ) }
121 />
122 </Button> }
123 { (
124 !attributes.add_next_button && !attributes.add_prev
125 ) && <span>
126 { __( 'Form Break', 'jet-form-builder' ) }
127 </span> }
128 </div>
129 </div>,
130 ];
131
132 }