mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-06-05 22:09:38 +02:00
feat: ✨ Major refactor componente DataTable
- Aggiunto supporto per le tabelle "checkable" (tabelle con le checkbox) - Migliorata la gestione generale della tabella, rendendola meno complicata da creare
This commit is contained in:
@@ -6,7 +6,14 @@ import Component from '../Component.jsx';
|
||||
*/
|
||||
export default class TableCell extends Component {
|
||||
view(vnode) {
|
||||
this.attrs.addClassNames('mdc-data-table__cell', `mdc-data-table__cell--${this.attrs.get('type')}`);
|
||||
this.attrs.addClassNames('mdc-data-table__cell', {
|
||||
[`mdc-data-table__cell--${this.attrs.get('type')}`]: this.attrs.has('type')
|
||||
});
|
||||
|
||||
if ((!vnode.children || vnode.children.length === 0) && this.attrs.get('type') === 'checkbox') {
|
||||
vnode.children = <mwc-checkbox/>;
|
||||
}
|
||||
|
||||
return <td {...this.attrs.all()}>{vnode.children}</td>;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user