PluginProbe
Block Animations, Motion & Scroll Effects – Ghost Kit / 3.3.3
Block Animations, Motion & Scroll Effects – Ghost Kit v3.3.3
3.7.2 3.7.1 3.7.0 3.6.1 trunk 1.6.3 2.25.0 3.3.0 3.3.1 3.3.2 3.3.3 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.6 3.5.0 3.5.1 3.6.0
ghostkit / gutenberg / blocks / form / fields / phone / edit.js

edit.js in Block Animations, Motion & Scroll Effects – Ghost Kit 3.3.3, at gutenberg/blocks/form/fields/phone/edit.js

47 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import classnames from 'classnames/dedupe';
2
3 import { InspectorControls, useBlockProps } from '@wordpress/block-editor';
4 import { PanelBody, TextControl } from '@wordpress/components';
5 import { applyFilters } from '@wordpress/hooks';
6
7 import {
8 FieldDefaultSettings,
9 getFieldAttributes,
10 } from '../../field-attributes';
11 import FieldDescription from '../../field-description';
12 import FieldLabel from '../../field-label';
13
14 /**
15 * Block Edit Class.
16 *
17 * @param props
18 */
19 export default function BlockEdit(props) {
20 const { attributes } = props;
21
22 let { className = '' } = props;
23
24 className = classnames(
25 'ghostkit-form-field ghostkit-form-field-phone',
26 className
27 );
28 className = applyFilters('ghostkit.editor.className', className, props);
29
30 const blockProps = useBlockProps({ className });
31
32 return (
33 <>
34 <InspectorControls>
35 <PanelBody>
36 <FieldDefaultSettings {...props} />
37 </PanelBody>
38 </InspectorControls>
39 <div {...blockProps}>
40 <FieldLabel {...props} />
41 <TextControl type="tel" {...getFieldAttributes(attributes)} />
42 <FieldDescription {...props} />
43 </div>
44 </>
45 );
46 }
47