/** * External dependencies */ import classnames from 'classnames'; /** * WordPress dependencies */ const { Component, Fragment, } = wp.element; const { ResizableBox, } = wp.components; /** * Component */ export default class ProgressBlockEdit extends Component { render() { const { setAttributes, isSelected, } = this.props; let { className, } = this.props; const { height, width, striped, animated, displayPercent, canvasClassName, } = this.props.attributes; className = classnames( 'cnvs-block-progress', { 'cnvs-block-progress-striped': striped, 'cnvs-block-progress-animated': striped && animated, 'is-selected': isSelected, }, canvasClassName, className ); return ( { setAttributes( { height: parseInt( height + delta.height, 10 ), } ); } } > { setAttributes( { width: Math.min( 100, Math.max( 0, width + parseInt( 100 * delta.width / jQuery( elt ).parent().width(), 10 ) ) ), } ); } } > { displayPercent ? `${ width }%` : '' } ); } }