[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: table-checkbox.js
import { useContext } from 'react'; import { Context } from './table-context'; import { arrayToClassName } from 'elementor-app/utils/utils.js'; import Checkbox from 'elementor-app/ui/atoms/checkbox'; export default function TableCheckbox( props ) { const context = useContext( Context ), { selected, disabled, setSelected } = context || {}, isSelectAllCheckbox = Object.prototype.hasOwnProperty.call( props, 'allSelectedCount' ), isAllSelected = selected.length === props.allSelectedCount, isIndeterminate = isSelectAllCheckbox ? ! ! ( ( selected.length - disabled.length ) && ! isAllSelected ) : false, isSelected = isSelectAllCheckbox ? isAllSelected : selected.includes( props.index ), isDisabled = ! isSelectAllCheckbox ? disabled.includes( props.index ) : null, onSelectAll = () => { setSelected( () => { if ( isAllSelected || isIndeterminate ) { // Disabled checkboxes should not be unchecked. return disabled.length ? [ ...disabled ] : []; } return Array( props.allSelectedCount ) .fill( true ) .map( ( value, index ) => index ); } ); }, onSelectRow = () => { setSelected( ( prevState ) => { const currentSelections = [ ...prevState ], currentIndexPosition = currentSelections.indexOf( props.index ); if ( currentIndexPosition > -1 ) { currentSelections.splice( currentIndexPosition, 1 ); } else { currentSelections.push( props.index ); } return currentSelections; } ); }, onChange = () => isSelectAllCheckbox ? onSelectAll() : onSelectRow(); return ( <Checkbox checked={ isSelected } indeterminate={ isIndeterminate } onChange={ onChange } disabled={ isDisabled } className={ arrayToClassName( [ 'eps-table__checkbox', props.className ] ) } /> ); } TableCheckbox.propTypes = { className: PropTypes.string, index: PropTypes.number, initialChecked: PropTypes.bool, allSelectedCount: PropTypes.number, };
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server.dijitaldukkanim.com.tr
Server IP: 104.247.168.220
PHP Version: 8.1.33
Server Software: Apache
System: Linux server.dijitaldukkanim.com.tr 4.18.0-553.105.1.el8_10.x86_64 #1 SMP Tue Feb 17 05:17:39 EST 2026 x86_64
HDD Total: 492.3 GB
HDD Free: 180.53 GB
Domains on IP: N/A (Requires external lookup)
System Features