| 1 |
import { InspectorControls } from '@wordpress/block-editor'; |
| 2 |
import { PanelBody, SelectControl, ToggleControl } from '@wordpress/components'; |
| 3 |
import { __ } from '@wordpress/i18n'; |
| 4 |
|
| 5 |
export default function EditInspectorControls({ attributes, setAttributes }) { |
| 6 |
const { trigger, buttonsAlign, buttonsVerticalAlign } = attributes; |
| 7 |
|
| 8 |
return ( |
| 9 |
<InspectorControls> |
| 10 |
<PanelBody> |
| 11 |
<SelectControl |
| 12 |
label={__('Select Tab Trigger', 'ghostkit')} |
| 13 |
value={trigger} |
| 14 |
options={[ |
| 15 |
{ |
| 16 |
value: '', |
| 17 |
label: __('Click', 'ghostkit'), |
| 18 |
}, |
| 19 |
{ |
| 20 |
value: 'hover', |
| 21 |
label: __('Hover', 'ghostkit'), |
| 22 |
}, |
| 23 |
]} |
| 24 |
onChange={(val) => { |
| 25 |
setAttributes({ trigger: val }); |
| 26 |
}} |
| 27 |
__next40pxDefaultSize |
| 28 |
__nextHasNoMarginBottom |
| 29 |
/> |
| 30 |
<ToggleControl |
| 31 |
label={__('Vertical Tabs', 'ghostkit')} |
| 32 |
checked={!!buttonsVerticalAlign} |
| 33 |
onChange={(val) => { |
| 34 |
setAttributes({ buttonsVerticalAlign: val }); |
| 35 |
|
| 36 |
if (val && buttonsAlign === 'stretch') { |
| 37 |
setAttributes({ buttonsAlign: 'start' }); |
| 38 |
} |
| 39 |
}} |
| 40 |
__nextHasNoMarginBottom |
| 41 |
/> |
| 42 |
</PanelBody> |
| 43 |
</InspectorControls> |
| 44 |
); |
| 45 |
} |
| 46 |
|