primevue-mirror/components/lib/treetable/style/TreeTableStyle.js

66 lines
2.4 KiB
JavaScript
Raw Normal View History

import BaseStyle from 'primevue/base/style';
const classes = {
root: ({ instance, props }) => [
'p-treetable p-component',
{
2024-04-29 09:00:43 +00:00
'p-treetable-hoverable': props.rowHover || instance.rowSelectionMode,
'p-treetable-resizable': props.resizableColumns,
'p-treetable-resizable-fit': props.resizableColumns && props.columnResizeMode === 'fit',
'p-treetable-scrollable': props.scrollable,
'p-treetable-flex-scrollable': props.scrollable && props.scrollHeight === 'flex',
2024-04-29 09:00:43 +00:00
'p-treetable-gridlines': props.showGridlines,
'p-treetable-sm': props.size === 'small',
'p-treetable-lg': props.size === 'large'
}
],
2024-04-29 09:00:43 +00:00
loadingWrapper: 'p-treetable-loading', //TODO: required?
loadingOverlay: 'p-treetable-mask p-component-overlay',
loadingIcon: 'p-treetable-loading-icon',
header: 'p-treetable-header',
2024-04-29 09:00:43 +00:00
paginator: ({ position }) => 'p-treetable-paginator-' + position,
wrapper: 'p-treetable-table-container',
thead: 'p-treetable-thead',
2024-04-29 09:00:43 +00:00
headerCell: ({ instance, props }) => [
{
2024-04-29 09:00:43 +00:00
'p-treetable-sortable-column': instance.columnProp('sortable'),
'p-treetable-resizable-column': props.resizableColumns,
'p-treetable-column-sorted': instance.isColumnSorted(),
'p-treetable-frozen-column': instance.columnProp('frozen')
}
],
2024-04-29 09:00:43 +00:00
columnResizer: 'p-treetable-column-resizer',
headerTitle: 'p-treetable-column-title',
sortIcon: 'p-treetable-sort-icon',
sortBadge: 'p-treetable-sort-badge',
tbody: 'p-treetable-tbody',
row: ({ instance }) => [
{
2024-04-29 09:00:43 +00:00
'p-treetable-row-selected': instance.selected
}
],
2024-04-29 09:00:43 +00:00
bodyCell: ({ instance }) => [
{
2024-04-29 09:00:43 +00:00
'p-treetable-frozen-column': instance.columnProp('frozen')
}
],
2024-04-29 09:00:43 +00:00
rowToggler: 'p-treetable-row-toggle-button',
rowTogglerIcon: 'p-treetable-row-toggle-icon',
rowCheckbox: ({ instance }) => 'p-treetable-row-checkbox',
emptyMessage: 'p-treetable-empty-message',
tfoot: 'p-treetable-tfoot',
footerCell: ({ instance }) => [
{
2024-04-29 09:00:43 +00:00
'p-treetable-frozen-column': instance.columnProp('frozen')
}
],
//treetable
footer: 'p-treetable-footer',
2024-04-29 09:00:43 +00:00
resizeHelper: 'p-treetable-column-resize-indicator'
};
export default BaseStyle.extend({
name: 'treetable',
classes
});