PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.1.6
JetFormBuilder — Dynamic Blocks Form Builder v3.1.6
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 / radio-field / edit.js
jetformbuilder / assets / src / editor / blocks / radio-field Last commit date
edit.js 2 years ago index.js 2 years ago preview.js 2 years ago
edit.js
96 lines
1 import { SelectRadioCheckPlaceholder } from '../../components/base-select-check-radio/select-radio-check-placeholder';
2 import SelectRadioCheck
3 from '../../components/base-select-check-radio/select-radio-check';
4 import CustomTemplateControls
5 from '../../components/base-select-check-radio/custom-template';
6 import preview from './preview';
7
8 const {
9 ToolBarFields,
10 BlockLabel,
11 BlockDescription,
12 BlockAdvancedValue,
13 BlockName,
14 AdvancedFields,
15 FieldControl,
16 SwitchPageOnChangeControls,
17 } = JetFBComponents;
18 const {
19 __,
20 } = wp.i18n;
21 const {
22 InspectorControls,
23 useBlockProps,
24 } = wp.blockEditor;
25 const {
26 ToggleControl,
27 PanelBody,
28 } = wp.components;
29
30 const {
31 useUniqueNameOnDuplicate,
32 } = JetFBHooks;
33
34 export default function RadioEdit( props ) {
35
36 const {
37 isSelected,
38 attributes,
39 editProps: { uniqKey },
40 } = props;
41
42 const blockProps = useBlockProps();
43 useUniqueNameOnDuplicate();
44
45 if ( attributes.isPreview ) {
46 return <div style={ {
47 width: '100%',
48 display: 'flex',
49 justifyContent: 'center',
50 } }>
51 { preview }
52 </div>;
53 }
54
55 return <>
56 <ToolBarFields
57 key={ uniqKey( 'ToolBarFields' ) }
58 { ...props }
59 />
60 <SwitchPageOnChangeControls/>
61 { isSelected && <InspectorControls
62 key={ uniqKey( 'InspectorControls' ) }
63 >
64 <PanelBody title={ __( 'General', 'jet-form-builder' ) }>
65 <BlockLabel/>
66 <BlockName/>
67 <BlockDescription/>
68 </PanelBody>
69 <PanelBody title={ __( 'Value', 'jet-form-builder' ) }>
70 <BlockAdvancedValue/>
71 </PanelBody>
72 <AdvancedFields
73 key={ uniqKey( 'AdvancedFields' ) }
74 { ...props }
75 />
76 </InspectorControls> }
77 <div { ...blockProps } key={ uniqKey( 'viewBlock' ) }>
78 <SelectRadioCheckPlaceholder
79 key={ uniqKey( 'SelectRadioCheckPlaceholder' ) }
80 scriptData={ window.JetFormRadioFieldData }
81 { ...props }
82 />
83 <SelectRadioCheck { ...props }>
84 <CustomTemplateControls
85 listingTypes={ window.JetFormRadioFieldData.listings_list }
86 { ...props }
87 />
88 <FieldControl
89 type="custom_settings"
90 key={ uniqKey( 'customSettingsFields' ) }
91 { ...props }
92 />
93 </SelectRadioCheck>
94 </div>
95 </>;
96 }