OwlCyberSecurity - MANAGER
Edit File: item-component.js
/* jshint esversion: 6 */ import PropTypes from 'prop-types'; import classnames from 'classnames'; import ResponsiveControl from '../common/responsive.js'; import Icons from '../common/icons.js'; import { __ } from '@wordpress/i18n'; const { ButtonGroup, Dashicon, Tooltip, Button } = wp.components; const { Component, Fragment } = wp.element; class ItemComponent extends Component { constructor() { super( ...arguments ); this.choices = ( kadenceCustomizerControlsData && kadenceCustomizerControlsData.choices && kadenceCustomizerControlsData.choices[ this.props.controlParams.group ] ? kadenceCustomizerControlsData.choices[ this.props.controlParams.group ] : [] ); } render() { return ( <div className="kadence-builder-item" data-id={ this.props.item } data-section={ undefined !== this.choices[ this.props.item ] && undefined !== this.choices[ this.props.item ].section ? this.choices[ this.props.item ].section : '' } key={ this.props.item }> <span className="kadence-builder-item-icon kadence-move-icon" > { Icons['drag'] } </span> <span className="kadence-builder-item-text" > { ( undefined !== this.choices[ this.props.item ] && undefined !== this.choices[ this.props.item ].name ? this.choices[ this.props.item ].name : '' ) } </span> <Button className="kadence-builder-item-focus-icon kadence-builder-item-icon" aria-label={ __( 'Setting settings for', 'kadence' ) + ' ' + ( undefined !== this.choices[ this.props.item ] && undefined !== this.choices[ this.props.item ].name ? this.choices[ this.props.item ].name : '' ) } onClick={ () => { this.props.focusItem( undefined !== this.choices[ this.props.item ] && undefined !== this.choices[ this.props.item ].section ? this.choices[ this.props.item ].section : '' ); } } > <Dashicon icon="admin-generic"/> </Button> { kadenceCustomizerControlsData.blockWidgets && this.props.item.includes('widget') && 'toggle-widget' !== this.props.item && ( <Button className="kadence-builder-item-focus-icon kadence-builder-item-icon" aria-label={ __( 'Setting settings for', 'kadence' ) + ' ' + ( undefined !== this.choices[ this.props.item ] && undefined !== this.choices[ this.props.item ].name ? this.choices[ this.props.item ].name : '' ) } onClick={ () => { this.props.focusItem( undefined !== this.choices[ this.props.item ] && undefined !== this.choices[ this.props.item ].section ? 'kadence_customizer_' + this.choices[ this.props.item ].section : '' ); } } > <Dashicon icon="admin-settings"/> </Button> ) } { kadenceCustomizerControlsData.blockWidgets && 'toggle-widget' === this.props.item && ( <Button className="kadence-builder-item-focus-icon kadence-builder-item-icon" aria-label={ __( 'Setting settings for', 'kadence' ) + ' ' + ( undefined !== this.choices[ this.props.item ] && undefined !== this.choices[ this.props.item ].name ? this.choices[ this.props.item ].name : '' ) } onClick={ () => { this.props.focusItem( 'kadence_customizer_sidebar-widgets-header2' ); } } > <Dashicon icon="admin-settings"/> </Button> ) } <Button className="kadence-builder-item-icon" aria-label={ __( 'Remove', 'kadence' ) + ' ' + ( undefined !== this.choices[ this.props.item ] && undefined !== this.choices[ this.props.item ].name ? this.choices[ this.props.item ].name : '' ) } onClick={ () => { this.props.removeItem( this.props.item ); } } > <Dashicon icon="no-alt"/> </Button> </div> ); } } export default ItemComponent;