Server IP : 172.67.158.161 / Your IP : 3.133.136.73 Web Server : LiteSpeed System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : giankuin ( 1871) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/thread-self/root/home/giankuin/sieuthiweb.com.vn/wp-content/plugins/woocommerce/packages/woocommerce-blocks/assets/js/base/components/dropdown-selector/ |
Upload File : |
/** * External dependencies */ import { __, sprintf } from '@wordpress/i18n'; import { useEffect, useRef } from '@wordpress/element'; import { Icon, noAlt } from '@woocommerce/icons'; const DropdownSelectorSelectedValue = ( { onClick, onRemoveItem, option } ) => { const labelRef = useRef( null ); useEffect( () => { labelRef.current.focus(); }, [ labelRef ] ); return ( <div className="wc-block-dropdown-selector__selected-value wc-block-components-dropdown-selector__selected-value"> <button ref={ labelRef } className="wc-block-dropdown-selector__selected-value__label wc-block-components-dropdown-selector__selected-value__label" onClick={ ( e ) => { e.stopPropagation(); onClick( option.value ); } } aria-label={ sprintf( /* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */ __( 'Replace current %s filter', 'woocommerce' ), option.name ) } > { option.label } </button> <button className="wc-block-dropdown-selector__selected-value__remove wc-block-components-dropdown-selector__selected-value__remove" onClick={ () => { onRemoveItem( option.value ); } } onKeyDown={ ( e ) => { if ( e.key === 'Backspace' || e.key === 'Delete' ) { onRemoveItem( option.value ); } } } aria-label={ sprintf( /* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */ __( 'Remove %s filter', 'woocommerce' ), option.name ) } > <Icon srcElement={ noAlt } size={ 16 } /> </button> </div> ); }; export default DropdownSelectorSelectedValue;