Aligned treetable css with table

pull/5677/head
Cagatay Civici 2024-04-29 12:00:43 +03:00
parent 94c6e7d19f
commit b29e165d35
6 changed files with 257 additions and 264 deletions

View File

@ -48,8 +48,8 @@ const classes = {
columnResizer: 'p-datatable-column-resizer', columnResizer: 'p-datatable-column-resizer',
headerContent: 'p-datatable-column-header-content', headerContent: 'p-datatable-column-header-content',
headerTitle: 'p-datatable-column-title', headerTitle: 'p-datatable-column-title',
sortIcon: 'p-datatable-sortable-column-icon', sortIcon: 'p-datatable-sort-icon',
sortBadge: 'p-datatable-sortable-column-badge', sortBadge: 'p-datatable-sort-badge',
columnFilter: ({ props }) => [ columnFilter: ({ props }) => [
'p-datatable-filter', 'p-datatable-filter',
{ {
@ -115,7 +115,7 @@ const classes = {
}, },
rowExpansion: 'p-datatable-row-expansion', rowExpansion: 'p-datatable-row-expansion',
rowgroupFooter: 'p-datatable-row-group-footer', rowgroupFooter: 'p-datatable-row-group-footer',
emptyMessage: 'p-datatable-emptymessage', emptyMessage: 'p-datatable-empty-message',
bodyCell: ({ instance }) => [ bodyCell: ({ instance }) => [
{ {
'p-datatable-frozen-column': instance.columnProp('frozen') 'p-datatable-frozen-column': instance.columnProp('frozen')

View File

@ -16,18 +16,18 @@ export default {
} }
.p-datatable-column-title, .p-datatable-column-title,
.p-datatable-sortable-column-icon, .p-datatable-sort-icon,
.p-datatable-sortable-column-badge { .p-datatable-sort-badge {
vertical-align: middle; vertical-align: middle;
} }
.p-datatable-sortable-column-icon { .p-datatable-sort-icon {
color: ${dt('datatable.sort.icon.color')}; color: ${dt('datatable.sort.icon.color')};
margin-left: 0.5rem; margin-left: 0.5rem;
transition: color ${dt('transition.duration')}; transition: color ${dt('transition.duration')};
} }
.p-datatable-sortable-column-badge { .p-datatable-sort-badge {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@ -43,7 +43,7 @@ export default {
color: ${dt('datatable.header.cell.hover.color')}; color: ${dt('datatable.header.cell.hover.color')};
} }
.p-datatable-sortable-column:not(.p-datatable-column-sorted):hover .p-datatable-sortable-column-icon { .p-datatable-sortable-column:not(.p-datatable-column-sorted):hover .p-datatable-sort-icon {
color: ${dt('datatable.sort.icon.hover.color')}; color: ${dt('datatable.sort.icon.hover.color')};
} }
@ -57,7 +57,7 @@ export default {
outline-offset: -1px; outline-offset: -1px;
} }
.p-datatable-column-sorted .p-datatable-sortable-column-icon { .p-datatable-column-sorted .p-datatable-sort-icon {
color: ${dt('highlight.color')}; color: ${dt('highlight.color')};
} }
@ -573,7 +573,7 @@ p-datatable-gridlines .p-datatable-tbody > tr:last-child>td {
outline-offset: 2px; outline-offset: 2px;
} }
.p-datatable-tbody > tr.p-datatable-row-select .p-datatable-row-toggle-button:hover{ .p-datatable-tbody > tr.p-datatable-row-selected .p-datatable-row-toggle-button:hover{
background: ${dt('datatable.row.action.highlight.hover.background')}; background: ${dt('datatable.row.action.highlight.hover.background')};
color: inherit; color: inherit;
} }

View File

@ -4,31 +4,30 @@ export default {
position: relative; position: relative;
} }
.p-treetable table { .p-treetable-table {
border-collapse: collapse; border-spacing: 0px;
width: 100%; width: 100%;
table-layout: fixed;
} }
.p-treetable .p-sortable-column { .p-treetable-sortable-column {
cursor: pointer; cursor: pointer;
user-select: none; user-select: none;
outline-color: transparent; outline-color: transparent;
} }
.p-treetable .p-sortable-column .p-column-title, .p-treetable-column-title,
.p-treetable .p-sortable-column .p-sortable-column-icon, .p-treetable-sort-icon,
.p-treetable .p-sortable-column .p-sortable-column-badge { .p-treetable-sort-badge {
vertical-align: middle; vertical-align: middle;
} }
.p-treetable .p-sortable-column .p-sortable-column-icon { .p-treetable-sort-icon {
color: ${dt('treetable.sort.icon.color')}; color: ${dt('treetable.sort.icon.color')};
margin-left: 0.5rem; margin-left: 0.5rem;
transition: color ${dt('transition.duration')}; transition: color ${dt('transition.duration')};
} }
.p-treetable .p-sortable-column .p-sortable-column-badge { .p-treetable-sort-badge {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@ -39,62 +38,107 @@ export default {
margin-left: 0.5rem; margin-left: 0.5rem;
} }
.p-treetable .p-sortable-column:not(.p-highlight):hover { .p-treetable-sortable-column:not(.p-treetable-column-sorted):hover {
background: ${dt('treetable.header.cell.hover.background')}; background: ${dt('treetable.header.cell.hover.background')};
color: ${dt('treetable.header.cell.hover.color')}; color: ${dt('treetable.header.cell.hover.color')};
} }
.p-treetable .p-sortable-column:not(.p-highlight):hover .p-sortable-column-icon { .p-treetable-sortable-column:not(.p-treetable-column-sorted):hover .p-treetable-sort-icon {
color: ${dt('treetable.sort.icon.hover.color')}; color: ${dt('treetable.sort.icon.hover.color')};
} }
.p-treetable .p-sortable-column.p-highlight { .p-treetable-column-sorted {
background: ${dt('highlight.background')}; background: ${dt('highlight.background')};
color: ${dt('highlight.color')}; color: ${dt('highlight.color')};
} }
.p-treetable .p-sortable-column:focus-visible { .p-treetable-sortable-column:focus-visible {
outline: ${dt('focus.ring.width')} ${dt('focus.ring.style')} ${dt('focus.ring.color')}; outline: ${dt('focus.ring.width')} ${dt('focus.ring.style')} ${dt('focus.ring.color')};
outline-offset: -1px; outline-offset: -1px;
} }
.p-treetable .p-sortable-column.p-highlight .p-sortable-column-icon { .p-treetable-column-sorted .p-treetable-sort-icon {
color: ${dt('highlight.color')}; color: ${dt('highlight.color')};
} }
.p-treetable-responsive-scroll > .p-treetable-wrapper { .p-treetable-hoverable .p-treetable-selectable-row {
overflow-x: auto;
}
.p-treetable-responsive-scroll > .p-treetable-wrapper > table,
.p-treetable-auto-layout > .p-treetable-wrapper > table {
table-layout: auto;
}
.p-treetable-hoverable-rows .p-treetable-tbody > tr {
cursor: pointer; cursor: pointer;
} }
.p-treetable-resizable>.p-treetable-wrapper { .p-treetable-scrollable > .p-treetable-table-container {
overflow-x: auto; position: relative;
} }
.p-treetable-resizable .p-treetable-thead>tr>th, .p-treetable-scrollable-table > .p-treetable-thead {
.p-treetable-resizable .p-treetable-tfoot>tr>td, top: 0;
.p-treetable-resizable .p-treetable-tbody>tr>td { z-index: 1;
}
.p-treetable-scrollable-table > .p-treetable-frozen-tbody {
position: sticky;
z-index: 1;
}
.p-treetable-scrollable-table>.p-treetable-tfoot {
bottom: 0;
z-index: 1;
}
.p-treetable-scrollable .p-treetable-frozen-column {
position: sticky;
background: inherit;
}
.p-treetable-scrollable th.p-treetable-frozen-column {
z-index: 1;
}
.p-treetable-scrollable > .p-treetable-table-container > .p-treetable-table > .p-treetable-thead,
.p-treetable-scrollable > .p-treetable-table-container > .p-virtualscroller > .p-treetable-table > .p-treetable-thead {
background: ${dt('treetable.header.cell.background')};
}
.p-treetable-scrollable > .p-treetable-table-container > .p-treetable-table > .p-treetable-tfoot,
.p-treetable-scrollable > .p-treetable-table-container > .p-virtualscroller > .p-treetable-table > .p-treetable-tfoot {
background: ${dt('treetable.footer.cell.background')};
}
.p-treetable-flex-scrollable {
display: flex;
flex-direction: column;
height: 100%;
}
.p-treetable-flex-scrollable>.p-treetable-table-container {
display: flex;
flex-direction: column;
flex: 1;
height: 100%;
}
.p-treetable-scrollable-table > .p-treetable-tbody > .p-treetable-row-group-header {
position: sticky;
z-index: 1;
}
/* Resizable */
.p-treetable-resizable-table > .p-treetable-thead > tr > th,
.p-treetable-resizable-table > .p-treetable-tfoot > tr > td,
.p-treetable-resizable-table > .p-treetable-tbody > tr > td {
overflow: hidden; overflow: hidden;
white-space: nowrap;
} }
.p-treetable-resizable .p-resizable-column:not(.p-frozen-column) { .p-treetable-resizable-table > .p-treetable-thead > tr > th.p-treetable-resizable-column:not(.p-treetable-frozen-column) {
background-clip: padding-box; background-clip: padding-box;
position: relative; position: relative;
} }
.p-treetable-resizable-fit .p-resizable-column:last-child .p-column-resizer { .p-treetable-resizable-table-fit > .p-treetable-thead > tr > th.p-treetable-resizable-column:last-child .p-treetable-column-resizer {
display: none; display: none;
} }
.p-treetable .p-column-resizer { .p-treetable-column-resizer {
display: block; display: block;
position: absolute; position: absolute;
top: 0; top: 0;
@ -107,7 +151,12 @@ export default {
border: 1px solid transparent; border: 1px solid transparent;
} }
.p-treetable .p-column-resizer-helper { .p-treetable-column-header-content {
display: flex;
align-items: center;
}
.p-treetable-column-resize-indicator {
width: 1px; width: 1px;
position: absolute; position: absolute;
z-index: 10; z-index: 10;
@ -115,7 +164,18 @@ export default {
background: ${dt('treetable.resizer.color')}; background: ${dt('treetable.resizer.color')};
} }
.p-treetable .p-treetable-loading-overlay { .p-treetable-row-reorder-indicator-up,
.p-treetable-row-reorder-indicator-down {
position: absolute;
display: none;
}
.p-treetable-reorderable-column,
.p-treetable-reorderable-row-handle {
cursor: move;
}
.p-treetable-mask {
position: absolute; position: absolute;
display: flex; display: flex;
align-items: center; align-items: center;
@ -123,98 +183,21 @@ export default {
z-index: 2; z-index: 2;
} }
/* Scrollable */ .p-treetable-virtualscroller-spacer {
.p-treetable-scrollable .p-treetable-wrapper {
position: relative;
overflow: auto;
}
.p-treetable-scrollable .p-treetable-table {
display: block;
}
.p-treetable-scrollable .p-treetable-thead,
.p-treetable-scrollable .p-treetable-tbody,
.p-treetable-scrollable .p-treetable-tfoot {
display: block;
}
.p-treetable-scrollable .p-treetable-thead>tr,
.p-treetable-scrollable .p-treetable-tbody>tr,
.p-treetable-scrollable .p-treetable-tfoot>tr {
display: flex; display: flex;
flex-wrap: nowrap;
width: 100%;
} }
.p-treetable-scrollable .p-treetable-thead>tr>th, .p-treetable .p-virtualscroller .p-virtualscroller-loading {
.p-treetable-scrollable .p-treetable-tbody>tr>td, transform: none !important;
.p-treetable-scrollable .p-treetable-tfoot>tr>td { min-height: 0;
display: flex;
flex: 1 1 0;
align-items: center;
}
.p-treetable-scrollable .p-treetable-thead {
position: sticky; position: sticky;
top: 0; top: 0;
z-index: 1; left: 0;
} }
.p-treetable-scrollable .p-treetable-tfoot { .p-treetable-paginator-top {
position: sticky; border: solid ${dt('treetable.header.border.color')};
bottom: 0;
z-index: 1;
}
.p-treetable-scrollable .p-frozen-column {
position: sticky;
background: inherit;
}
.p-treetable-scrollable th.p-frozen-column {
z-index: 1;
}
.p-treetable-scrollable-both .p-treetable-thead>tr>th,
.p-treetable-scrollable-both .p-treetable-tbody>tr>td,
.p-treetable-scrollable-both .p-treetable-tfoot>tr>td,
.p-treetable-scrollable-horizontal .p-treetable-thead>tr>th .p-treetable-scrollable-horizontal .p-treetable-tbody>tr>td,
.p-treetable-scrollable-horizontal .p-treetable-tfoot>tr>td {
flex: 0 0 auto;
}
.p-treetable-flex-scrollable {
display: flex;
flex-direction: column;
height: 100%;
}
.p-treetable-flex-scrollable .p-treetable-wrapper {
display: flex;
flex-direction: column;
flex: 1;
height: 100%;
}
.p-treetable .p-treetable-scrollable-header {
background: ${dt('treetable.header.background')};
}
.p-treetable .p-treetable-scrollable-footer {
background: ${dt('treetable.footer.background')};
}
.p-treetable .p-paginator-top {
border-width: 0 0 1px 0; border-width: 0 0 1px 0;
border-radius: 0;
}
.p-treetable .p-paginator-bottom {
border-width: 0 0 1px 0;
border-radius: 0;
} }
.p-treetable-header { .p-treetable-header {
@ -241,7 +224,7 @@ export default {
background: ${dt('treetable.header.cell.background')}; background: ${dt('treetable.header.cell.background')};
border: 1px solid ${dt('treetable.header.cell.border.color')}; border: 1px solid ${dt('treetable.header.cell.border.color')};
border-width: 0 0 1px 0; border-width: 0 0 1px 0;
color: ${dt('treetable.header.cell.color')}); color: ${dt('treetable.header.cell.color')};
font-weight: 600; font-weight: 600;
transition: background-color ${dt('transition.duration')}, color ${dt('transition.duration')}, border-color ${dt('transition.duration')}, box-shadow ${dt('transition.duration')}, outline-color ${dt('transition.duration')}; transition: background-color ${dt('transition.duration')}, color ${dt('transition.duration')}, border-color ${dt('transition.duration')}, box-shadow ${dt('transition.duration')}, outline-color ${dt('transition.duration')};
} }
@ -260,22 +243,22 @@ export default {
padding: 0.75rem 1rem; padding: 0.75rem 1rem;
} }
.p-treetable-hoverable-rows .p-treetable-tbody > tr:not(.p-highlight):hover { .p-treetable-hoverable .p-treetable-tbody > tr:not(.p-treetable-row-selected):hover {
background: ${dt('treetable.row.hover.background')}; background: ${dt('treetable.row.hover.background')};
color: ${dt('treetable.row.hover.color')}; color: ${dt('treetable.row.hover.color')};
} }
.p-treetable-tbody > tr.p-highlight { .p-treetable-tbody > tr.p-treetable-row-selected {
background: ${dt('highlight.background')}; background: ${dt('highlight.background')};
color: ${dt('highlight.color')}; color: ${dt('highlight.color')};
} }
.p-treetable-tbody > tr:has(+ .p-highlight) > td { .p-treetable-tbody > tr:has(+ .p-treetable-row-selected) > td {
border-bottom-color: ${dt('treetable.body.cell.selected.border.color')}); border-bottom-color: ${dt('treetable.body.cell.selected.border.color')};
} }
.p-treetable-tbody > tr.p-highlight > td { .p-treetable-tbody > tr.p-treetable-row-selectedt > td {
border-bottom-color: ${dt('treetable.body.cell.selected.border.color')}); border-bottom-color: ${dt('treetable.body.cell.selected.border.color')};
} }
.p-treetable-tbody > tr:focus-visible { .p-treetable-tbody > tr:focus-visible {
@ -283,56 +266,9 @@ export default {
outline-offset: -1px; outline-offset: -1px;
} }
.p-treetable-toggler { .p-treetable-tbody > tr.p-treetable-contextmenu-row-selected {
cursor: pointer; outline: 1px solid ${dt('focus.ring.color')};
user-select: none; outline-offset: -1px;
display: inline-flex;
align-items: center;
justify-content: center;
vertical-align: middle;
overflow: hidden;
position: relative;
width: 1.75rem;
height: 1.75rem;
color: ${dt('treetable.toggle.color')};
border: 0 none;
background: transparent;
border-radius: 50%;
transition: background-color ${dt('transition.duration')}, color ${dt('transition.duration')}, border-color ${dt('transition.duration')}, box-shadow ${dt('transition.duration')}, outline-color ${dt('transition.duration')};
outline-color: transparent;
margin-right: 0.5rem;
}
.p-treetable-toggler + .p-checkbox {
vertical-align: middle;
margin-right: 0.5rem;
}
.p-treetable-toggler + .p-checkbox + span {
vertical-align: middle;
}
.p-treetable-toggler + .p-checkbox.p-indeterminate .p-checkbox-icon {
color: ${dt('treetable.indeterminate.color')};
}
.p-treetable-toggler:enabled:hover {
background: ${dt('treetable.toggle.hover.background')};
color: ${dt('treetable.toggle.hover.color')};
}
.p-treetable-hoverable-rows .p-treetable-tbody > tr:not(.p-highlight):hover .p-treetable-toggler {
color: ${dt('treetable.toggle.hover.color')};
background: transparent;
}
.p-treetable-tbody > tr.p-highlight .p-treetable-toggler {
color: inherit;
}
.p-treetable-tbody > tr.p-highlight .p-treetable-toggler:hover {
background: ${dt('treetable.toggle.highlight.hover.background')};
color: inherit;
} }
.p-treetable-tfoot > tr > td { .p-treetable-tfoot > tr > td {
@ -345,78 +281,166 @@ export default {
background: ${dt('treetable.footer.cell.background')}; background: ${dt('treetable.footer.cell.background')};
} }
.p-treetable .p-treetable-loading-icon { .p-treetable-loading-icon {
font-size: 2rem; font-size: 2rem;
width: 2rem; width: 2rem;
height: 2rem; height: 2rem;
} }
.p-treetable-gridlines .p-treetable-header { .p-treetable-gridlines .p-treetable-header {
border-width: 1px 1px 0 1px; border-width: 1px;
} }
.p-treetable-gridlines .p-treetable-footer { .p-treetable-gridlines .p-treetable-footer {
border-width: 0 1px 1px 1px; border-width: 0 1px 1px 1px;
} }
.p-treetable-gridlines .p-treetable-top { .p-treetable-gridlines .p-treetable-paginator-top {
border-width: 0 1px 0 1px; border-width: 0 1px 0 1px;
} }
.p-treetable-gridlines .p-treetable-bottom { .p-treetable-gridlines .p-treetable-paginator-bottom {
border-width: 0 1px 1px 1px; border-width: 0 1px 1px 1px;
border-style: solid;
border-color: ${dt('treetable.footer.border.color')};
} }
.p-treetable-gridlines .p-treetable-thead > tr > th { .p-treetable-gridlines .p-treetable-thead > tr > th {
border-width: 1px 0 1px 1px;
}
.p-treetable-gridlines .p-treetable-thead > tr > th:last-child {
border-width: 1px; border-width: 1px;
} }
.p-treetable-gridlines .p-treetable-tbody > tr > td { .p-treetable-gridlines .p-treetable-tbody > tr > td {
border-width: 1px 0 0 1px;
}
.p-treetable-gridlines .p-treetable-tbody > tr > td:last-child {
border-width: 1px 1px 0 1px;
}
p-treetable-gridlines .p-treetable-tbody > tr:last-child>td {
border-width: 1px 0 1px 1px;
}
.p-treetable-gridlines .p-treetable-tbody > tr:last-child > td:last-child {
border-width: 1px; border-width: 1px;
} }
.p-treetable-gridlines .p-treetable-tfoot > tr > td { .p-treetable-gridlines .p-treetable-tfoot>tr>td {
border-width: 1px; border-width: 1px 0 1px 1px;
} }
.p-treetable-sm .p-treetable-header { .p-treetable-gridlines .p-treetable-tfoot > tr > td:last-child {
padding: 0.65625rem 0.875rem; border-width: 1px 1px 1px 1px;
} }
.p-treetable-sm .p-treetable-thead > tr > th { .p-treetable.p-treetable-gridlines .p-treetable-thead +.p-treetable-tfoot > tr > td {
border-width: 0 0 1px 1px;
}
.p-treetable.p-treetable-gridlines .p-treetable-thead + .p-treetable-tfoot > tr > td:last-child {
border-width: 0 1px 1px 1px;
}
.p-treetable.p-treetable-gridlines:has(.p-treetable-thead):has(.p-treetable-tbody) .p-treetable-tbody > tr > td {
border-width: 0 0 1px 1px;
}
.p-treetable.p-treetable-gridlines:has(.p-treetable-thead):has(.p-treetable-tbody) .p-treetable-tbody > tr > td:last-child {
border-width: 0 1px 1px 1px;
}
.p-treetable.p-treetable-gridlines:has(.p-treetable-tbody):has(.p-treetable-tfoot) .p-treetable-tbody > tr:last-child > td {
border-width: 0 0 0 1px;
}
.p-treetable.p-treetable-gridlines:has(.p-treetable-tbody):has(.p-treetable-tfoot) .p-treetable-tbody > tr:last-child > td:last-child {
border-width: 0 1px 0 1px;
}
.p-treetable.p-treetable-striped .p-treetable-tbody > tr.p-row-odd {
background: ${dt('treetable.row.striped.background')});
}
.p-treetable.p-treetable-striped .p-treetable-tbody > tr.p-row-odd.p-highlight {
background: ${dt('highlight.background')});
color: ${dt('highlight.color')});
}
.p-treetable.p-treetable-sm .p-treetable-header {
padding: 0.375rem 0.5rem; padding: 0.375rem 0.5rem;
} }
.p-treetable-sm .p-treetable-tbody > tr > td { .p-treetable.p-treetable-sm .p-treetable-thead > tr > th {
padding: 0.375rem 0.5rem; padding: 0.375rem 0.5rem;
} }
.p-treetable-sm .p-treetable-tfoot > tr > td { .p-treetable.p-treetable-sm .p-treetable-tbody > tr > td {
padding: 0.375rem 0.5rem; padding: 0.375rem 0.5rem;
} }
.p-treetable-sm .p-treetable-footer { .p-treetable.p-treetable-sm .p-treetable-tfoot > tr > td {
padding: 0.375rem 0.5rem; padding: 0.375rem 0.5rem;
} }
.p-treetable-lg .p-treetable-header { .p-treetable.p-treetable-sm .p-treetable-footer {
padding: 0.375rem 0.5rem;
}
.p-treetable.p-treetable-lg .p-treetable-header {
padding: 0.9375rem 1.25rem; padding: 0.9375rem 1.25rem;
} }
.p-treetable-lg .p-treetable-thead > tr > th { .p-treetable.p-treetable-lg .p-treetable-thead > tr > th {
padding: 0.9375rem 1.25rem; padding: 0.9375rem 1.25rem;
} }
.p-treetable-lg .p-treetable-tbody > tr > td { .p-treetable.p-treetable-lg .p-treetable-tbody>tr>td {
padding: 0.9375rem 1.25rem; padding: 0.9375rem 1.25rem;
} }
.p-treetable-lg .p-treetable-tfoot > tr > td { .p-treetable.p-treetable-lg .p-treetable-tfoot>tr>td {
padding: 0.9375rem 1.25rem; padding: 0.9375rem 1.25rem;
} }
.p-treetable-lg .p-treetable-footer { .p-treetable.p-treetable-lg .p-treetable-footer {
padding: 0.9375rem 1.25rem; padding: 0.9375rem 1.25rem;
} }
.p-treetable-row-toggle-button {
display: inline-flex;
align-items: center;
justify-content: center;
overflow: hidden;
position: relative;
width: 1.75rem;
height: 1.75rem;
color: ${dt('treetable.row.action.color')};
border: 0 none;
background: transparent;
cursor: pointer;
border-radius: 50%;
transition: background-color ${dt('transition.duration')}, color ${dt('transition.duration')}, border-color ${dt('transition.duration')}, box-shadow ${dt('transition.duration')}, outline-color ${dt('transition.duration')};
outline-color: transparent;
user-select: none;
}
.p-treetable-row-toggle-button:enabled:hover {
color: ${dt('treetable.row.action.hover.color')};
background: ${dt('treetable.row.action.hover.background')};
}
.p-treetable-row-toggle-button:focus-visible {
outline: 1px solid ${dt('focus.ring.color')};
outline-offset: 2px;
}
.p-treetable-tbody > tr.p-treetable-row-selected .p-treetable-row-toggle-button:hover{
background: ${dt('treetable.row.action.highlight.hover.background')};
color: inherit;
}
` `
}; };

View File

@ -15,7 +15,6 @@ export default {
}, },
row: { row: {
background: '{surface.0}', background: '{surface.0}',
stripedBackground: '{surface.50}',
hoverBackground: '{surface.100}', hoverBackground: '{surface.100}',
color: '{surface.700}', color: '{surface.700}',
hoverColor: '{surface.800}' hoverColor: '{surface.800}'
@ -39,14 +38,11 @@ export default {
color: '{surface.500}', color: '{surface.500}',
hoverColor: '{surface.600}' hoverColor: '{surface.600}'
}, },
toggle: { rowAction: {
hoverBackground: '{surface.100}', hoverBackground: '{surface.100}',
highlightHoverBackground: '{surface.0}', highlightHoverBackground: '{surface.0}',
color: '{surface.500}', color: '{surface.500}',
hoverColor: '{surface.600}' hoverColor: '{surface.500}'
},
indeterminate: {
color: '{surface.500}'
} }
}, },
dark: { dark: {
@ -64,7 +60,6 @@ export default {
}, },
row: { row: {
background: '{surface.900}', background: '{surface.900}',
stripedBackground: '{surface.950}',
hoverBackground: '{surface.800}', hoverBackground: '{surface.800}',
color: '{surface.0}', color: '{surface.0}',
hoverColor: '{surface.0}' hoverColor: '{surface.0}'
@ -88,14 +83,11 @@ export default {
color: '{surface.400}', color: '{surface.400}',
hoverColor: '{surface.300}' hoverColor: '{surface.300}'
}, },
toggle: { rowAction: {
hoverBackground: '{surface.800}', hoverBackground: '{surface.800}',
highlightHoverBackground: '{surface.900}', highlightHoverBackground: '{surface.900}',
color: '{surface.400}', color: '{surface.400}',
hoverColor: '{surface.300}' hoverColor: '{surface.300}'
},
indeterminate: {
color: '{surface.400}'
} }
} }
} }

View File

@ -20,7 +20,7 @@
:template="paginatorTemplate" :template="paginatorTemplate"
:rowsPerPageOptions="rowsPerPageOptions" :rowsPerPageOptions="rowsPerPageOptions"
:currentPageReportTemplate="currentPageReportTemplate" :currentPageReportTemplate="currentPageReportTemplate"
:class="cx('paginator')" :class="cx('paginator', { position: 'top' })"
@page="onPage($event)" @page="onPage($event)"
:alwaysShow="alwaysShowPaginator" :alwaysShow="alwaysShowPaginator"
:unstyled="unstyled" :unstyled="unstyled"
@ -129,7 +129,7 @@
:template="paginatorTemplate" :template="paginatorTemplate"
:rowsPerPageOptions="rowsPerPageOptions" :rowsPerPageOptions="rowsPerPageOptions"
:currentPageReportTemplate="currentPageReportTemplate" :currentPageReportTemplate="currentPageReportTemplate"
:class="cx('paginator')" :class="cx('paginator', { position: 'bottom' })"
@page="onPage($event)" @page="onPage($event)"
:alwaysShow="alwaysShowPaginator" :alwaysShow="alwaysShowPaginator"
:unstyled="unstyled" :unstyled="unstyled"

View File

@ -4,82 +4,59 @@ const classes = {
root: ({ instance, props }) => [ root: ({ instance, props }) => [
'p-treetable p-component', 'p-treetable p-component',
{ {
'p-treetable-hoverable-rows': props.rowHover || instance.rowSelectionMode, 'p-treetable-hoverable': props.rowHover || instance.rowSelectionMode,
'p-treetable-auto-layout': props.autoLayout,
'p-treetable-resizable': props.resizableColumns, 'p-treetable-resizable': props.resizableColumns,
'p-treetable-resizable-fit': props.resizableColumns && props.columnResizeMode === 'fit', 'p-treetable-resizable-fit': props.resizableColumns && props.columnResizeMode === 'fit',
'p-treetable-gridlines': props.showGridlines,
'p-treetable-scrollable': props.scrollable, 'p-treetable-scrollable': props.scrollable,
'p-treetable-scrollable-vertical': props.scrollable && props.scrollDirection === 'vertical',
'p-treetable-scrollable-horizontal': props.scrollable && props.scrollDirection === 'horizontal',
'p-treetable-scrollable-both': props.scrollable && props.scrollDirection === 'both',
'p-treetable-flex-scrollable': props.scrollable && props.scrollHeight === 'flex', 'p-treetable-flex-scrollable': props.scrollable && props.scrollHeight === 'flex',
'p-treetable-responsive-scroll': props.responsiveLayout === 'scroll', 'p-treetable-gridlines': props.showGridlines,
'p-treetable-sm': props.size === 'small', 'p-treetable-sm': props.size === 'small',
'p-treetable-lg': props.size === 'large' 'p-treetable-lg': props.size === 'large'
} }
], ],
loadingWrapper: 'p-treetable-loading', loadingWrapper: 'p-treetable-loading', //TODO: required?
loadingOverlay: 'p-treetable-loading-overlay p-component-overlay', loadingOverlay: 'p-treetable-mask p-component-overlay',
loadingIcon: 'p-treetable-loading-icon', loadingIcon: 'p-treetable-loading-icon',
header: 'p-treetable-header', header: 'p-treetable-header',
paginator: ({ instance }) => (instance.paginatorTop ? 'p-paginator-top' : instance.paginatorBottom ? 'p-paginator-bottom' : ''), paginator: ({ position }) => 'p-treetable-paginator-' + position,
wrapper: 'p-treetable-wrapper', wrapper: 'p-treetable-table-container',
thead: 'p-treetable-thead', thead: 'p-treetable-thead',
//headercell headerCell: ({ instance, props }) => [
headerCell: ({ instance, props, column }) => {
column && instance.hasColumnFilter() 'p-treetable-sortable-column': instance.columnProp('sortable'),
? [ 'p-treetable-resizable-column': props.resizableColumns,
'p-filter-column', 'p-treetable-column-sorted': instance.isColumnSorted(),
{ 'p-treetable-frozen-column': instance.columnProp('frozen')
'p-frozen-column': instance.columnProp(column, 'frozen') }
} ],
] columnResizer: 'p-treetable-column-resizer',
: [ headerTitle: 'p-treetable-column-title',
{ sortIcon: 'p-treetable-sort-icon',
'p-sortable-column': instance.columnProp('sortable'), sortBadge: 'p-treetable-sort-badge',
'p-resizable-column': props.resizableColumns,
'p-highlight': instance.isColumnSorted(),
'p-frozen-column': instance.columnProp('frozen')
}
],
columnResizer: 'p-column-resizer',
headerTitle: 'p-column-title',
sortIcon: 'p-sortable-column-icon',
sortBadge: 'p-sortable-column-badge',
tbody: 'p-treetable-tbody', tbody: 'p-treetable-tbody',
//ttrow
row: ({ instance }) => [ row: ({ instance }) => [
{ {
'p-highlight': instance.selected 'p-treetable-row-selected': instance.selected
} }
], ],
//bodycell
bodyCell: ({ instance }) => [ bodyCell: ({ instance }) => [
{ {
'p-frozen-column': instance.columnProp('frozen') 'p-treetable-frozen-column': instance.columnProp('frozen')
} }
], ],
rowToggler: 'p-treetable-toggler p-link', rowToggler: 'p-treetable-row-toggle-button',
rowTogglerIcon: 'p-tree-toggler-icon', rowTogglerIcon: 'p-treetable-row-toggle-icon',
rowCheckbox: ({ instance }) => [ rowCheckbox: ({ instance }) => 'p-treetable-row-checkbox',
'p-treetable-checkbox', emptyMessage: 'p-treetable-empty-message',
{
'p-indeterminate': instance.partialChecked
}
],
//treetable
emptyMessage: 'p-treetable-emptymessage',
tfoot: 'p-treetable-tfoot', tfoot: 'p-treetable-tfoot',
//footercell
footerCell: ({ instance }) => [ footerCell: ({ instance }) => [
{ {
'p-frozen-column': instance.columnProp('frozen') 'p-treetable-frozen-column': instance.columnProp('frozen')
} }
], ],
//treetable //treetable
footer: 'p-treetable-footer', footer: 'p-treetable-footer',
resizeHelper: 'p-column-resizer-helper p-highlight' resizeHelper: 'p-treetable-column-resize-indicator'
}; };
export default BaseStyle.extend({ export default BaseStyle.extend({