File "attributes.js"

Full path: /home/webcknlt/admissiontell.com/wp-content/plugins/generateblocks/src/extend/inspector-control/controls/flex-child-panel/attributes.js
File size: 734 B (734 B bytes)
MIME-type: text/plain
Charset: utf-8

Download   Open   Edit   Advanced Editor &nnbsp; Back


export default function getFlexChildAttributes( defaults ) {
	const options = [
		'flexGrow',
		'flexShrink',
		'flexBasis',
		'order',
	];

	const numberOptions = [
		'flexGrow',
		'flexShrink',
		'order',
	];

	const attributes = {};

	options.forEach( ( option ) => {
		attributes[ option ] = {
			type: numberOptions.includes( option ) ? 'number' : 'string',
			default: defaults[ option ],
		};

		attributes[ option + 'Tablet' ] = {
			type: numberOptions.includes( option ) ? 'number' : 'string',
			default: defaults[ option + 'Tablet' ],
		};

		attributes[ option + 'Mobile' ] = {
			type: numberOptions.includes( option ) ? 'number' : 'string',
			default: defaults[ option + 'Mobile' ],
		};
	} );

	return attributes;
}