﻿import React from 'react';

import Botones from '../../../components/UI/botonera/headerBotones.js';
import CajaTexto from '../../../components/UI/cajaTexto/cajaTexto.jsx';
import CajaTextoNumero from '../../../components/UI/cajaTexto/cajaTextoNumero.jsx';
import TextArea from '../../../components/UI/textArea/textArea.jsx';
import ComboBox from '../../../components/UI/comboBox/combobox.jsx';
import Division from '../../../components/UI/division/division.jsx';
import TablaFiltro from '../../../components/UI/tablaFiltro/tablaFiltroSort.jsx';

function MantAsientoInt(props) {
    return (
        <>
            <div className="col-md-12">
                <div className='row'>
                    <div className="col-md-6">
                        <h1>{props.titulo}</h1>
                    </div>
                    <div className="col-md-6 text-right">
                        <div className="acciones">
                            <Botones
                                botones={props.botones}
                            />
                        </div>
                    </div>
                </div>
                <div className="content">
                    <div className="content-box box-primary">
                        <div className='row'>
                            <ComboBox id="cmbTipo" col="6" attributes={props.Datos.Tipo.attributes} value={props.selectedTipo} label={props.Datos.Tipo.attributes.label} datos={props.listaTipo} onChange={props.handleSelectedTipo} />
                            <CajaTexto col="6" id="Numero" type="text" label={props.Datos.Numero.attributes.label} value={props.Datos.Numero.value} attributes={props.Datos.Numero.attributes} onChangeInput={() => { }} />
                        </div>
                        <div className="row">
                            <ComboBox id="FechaMes" label={props.Datos.FechaMes.attributes.label} col="6" attributes={props.Datos.FechaMes.attributes} value={props.selectedOptionMes} datos={props.listaMeses} onChange={props.onhandleSelectedOptionMes} />
                            <CajaTexto col="6" id="FechaAnio" type="number" label={props.Datos.FechaAnio.attributes.label} value={props.Datos.FechaAnio.value} attributes={props.Datos.FechaAnio.attributes} onChangeInput={props.onhandleAnioChange} onBlur={props.validarAnio} onKeyPress={props.validarSoloNumeros} />
                        </div>
                        <div className='row'>
                            <TextArea id='Descripcion' col='12' value={props.Datos.Descripcion.value} label={props.Datos.Descripcion.attributes.label} attributes={props.Datos.Descripcion.attributes} onChangeInput={props.onChangeInput} rows='3' />
                        </div>

                        <div className='row'>
                            <div className="col-sm-12 col-md-12">
                                <div id="master-tabla" className="table-responsive  col-xs-12 col-sm-12 col-md-12 col-lg-12">
                                    <TablaFiltro
                                        keyField={"llave"}
                                        datos={props.listaDatos}
                                        columnas={props.columnas}                                        
                                        condensed={false}
                                        selectRow={props.selectRow}                                        
                                        modo={props.cellEdit}
                                        borrar={false}
                                        busqueda={true}
                                        nombreCSV={"Asientos"}
                                        botones={props.botonDet}
                                        ingresarDetalle={props.ingresarDetalle}
                                        eliminarDetalle={props.eliminarDetalle}    
                                        actTabla={props.actTabla}
                                        muestraTodo={true}
                                    />
                                    
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </>
    );
}
export default MantAsientoInt;
