dev-resources.site
for different kinds of informations.
Mi primera Libreria en NPM
Published at
1/8/2025
Categories
webdev
npm
javascript
Author
yosmarcode
Author
10 person written this
yosmarcode
open
Tabla Componente basada de Material UI.
Es una idea que salió de muchas dificultades que se presentaron en diferentes implementaciones en diferente software
Esta tabla solo ha sido probada usando. React pero puede ser usada en diferentes herramientas
Documentación de Material Table
npm i table-component-mui-lib
Video implementación
Tabla Referencia
- dataSource Datos visibles en la tabla
- columns Columna visible en la tabla
- isCheckbox Se habilita CheckBox para multiple selección en columnas
- isRadioBox Se habilita RadioBox para solo seleccionar un elemento de la columna
- selectedData Hooks Data Seleccionada (esto permite usar la data en el componente principal)
- setSelectedData Hooks Data para seleccionar data
- isPaginate true - false para generar una paginación de la tabla
- search Se habilita un textBox para buscar dentro de la tabla
- isDowmload Permite habilitar button para descargar archivo excel
- _styleColumn Estilo personalizable a las columnas de la tabla
- childreButton Botones personalizable en la tabla
Tipo de Datos Columnas
export interface HeadCell {
disablePadding?: boolean;
id?: keyof any;
label?: string;
numeric?: boolean;
sort?: boolean;
width?: number;
}
Creación de Columna personalizadas
const column: HeadCell[] = [
{
id: 'id',
numeric: false,
disablePadding: false,
label: 'ID',
sort: true
},
{
id: 'name',
numeric: false,
disablePadding: false,
label: 'Name',
sort: true
},
{
id: 'username',
numeric: false,
disablePadding: false,
label: 'User Name',
sort: true
},
{
id: 'email',
numeric: false,
disablePadding: false,
label: 'Correo Eléctronico',
sort: true
},
]
Ejemplo Componente
`
import { TableComponents, HeadCell } from 'table-component-mui-lib'
<TableComponents
dataSource={dataSource ?? []}
dataSourceExcel={dataTableFields.data ?? []}
columns={columns ?? []}
isCheckbox={false}
isRadioBox={false}
selectedData={data seleccionada de las columnas}
setSelectedData={hooks de selección de datos}
isPaginate
search
isDowmload
initialSelectionNumber={5}
_styleColumn={{ backgroundColor: `#cdcd`, color: '#000' }}
childreButton={(row: any) => (
<Box sx={{ display: 'flex', gap: 1, alignContent: 'center' }}>
<RadioGroup
aria-labelledby='demo-controlled-radio-buttons-group'
name='controlled-radio-buttons-group'
>
<FormControlLabel
sx={{ ml: 1 }}
control={<Radio
color='success'
checked={boolean}
onClick={() => { }}
/>}
onClick={(e: React.ChangeEvent<HTMLInputElement> | any) => { }} // Guarda los datos de la fila seleccionada}
label=''
/>
</RadioGroup>
<IconButton size='medium' sx={{ mr: 1 }}>
<Edit
style={{ color: #000 }} onClick={() => { }}
/>
</IconButton>
</Box>
)}
/>
`
npm Article's
30 articles in total
NPM command confusion
read article
My First npm Package!
read article
Introducing date-formatter-i18n: Simplify i18n for Dates in JavaScript
read article
Themeify: A Simple Tool to Beautify Your React and Next.js Projects
read article
Mi primera Libreria en NPM
currently reading
node unsupported engine when updating npm
read article
Starting with semver `1.0.0`
read article
My Experience with Node.js Version Compatibility: Leveraging the engines Field in package.json for AutoScout
read article
NPM Commands Every Web Developer Must Know
read article
Exploring npm: The Node Package Manager
read article
When GitHub Actions Build Fails Due to pnpm-lockfile
read article
Private npm Repositories
read article
🚀 Introducing pingflow: Your Ultimate Internet Speed Testing Tool! 🌐
read article
npm error 'node' is not recognized as an internal or external command
read article
Optimer for your project security and performance issues
read article
Publishing NPM package with Github Actions that react-hook-use-cta used
read article
Building My First NPM Package: A CLI for Scaffolding Express Servers
read article
Resolving Peer Dependency Errors in React: A Comprehensive Guide ⚡
read article
Building Scalable Microservices with Node.js and Event-Driven Architecture
read article
NPM Dependency error
read article
🎄 A Christmas Gift for Developers: FileToMarkdown!
read article
npm
read article
Fastly CLI on npm: now at your JavaScript fingertips
read article
{ my learnings through Error message “error:0308010C:digital envelope routines::unsupported” }
read article
Installing your react.js local package registry to your project
read article
External libraries: The Hidden Weight of External Libraries
read article
Simplifying your code: replacing heavy packages with lightweight solutions
read article
Lazy Devs, Rejoice! Automate Updates with Dependabot (and My Secret Sauce) 🍹📱
read article
Counter - A React library for animating numeric transitions
read article
What I learned building vue3-search-select package
read article
Featured ones: