/**
* External dependencies
*/
import classnames from 'classnames';
import {
registerBlockType,
__,
Autocomplete,
InspectorControls,
RangeControl,
TextControl,
PanelBody,
Fragment,
} from '../../wp-imports'
import { PenciIcon } from '../../icons'
// Rendering in PHP
export const save = ( props ) => { return null }
export const edit = ( props ) => {
const { isSelected } = props;
const { height } = props.attributes;
const autocompleters = [
{
name: 'fruit',
// The prefix that triggers this completer
triggerPrefix: '~',
// The option data
options: [
{ visual: '', name: 'Apple', id: 1 },
{ visual: '', name: 'Orange', id: 2 },
{ visual: '', name: 'Grapes', id: 3 },
],
// Returns a label for an option like " Orange"
getOptionLabel: option => (
{ option.visual }{ option.name }
),
// Declares that options should be matched by their name
getOptionKeywords: option => [ option.name ],
// Declares that the Grapes option is disabled
isOptionDisabled: option => option.name === 'Grapes',
// Declares completions should be inserted as abbreviations
getOptionCompletion: option => (
{ option.visual }
),
}
];
return (
{ ( { isExpanded, listBoxId, activeId } ) => (
) }
{ props.setAttributes( { height } ) } }
/>
)
}
registerBlockType( 'penci-gutenberg/custom-list', {
title: __( 'Penci: Custom list' ),
icon: PenciIcon,
category: 'penci-blocks',
edit: edit,
save: save,
} );
x
Windows NT KPTV 6.2 build 9200 (Windows Server 2012 Datacenter Edition) i586