2023-10-02 10:46:09 +00:00
|
|
|
import BaseStyle from 'primevue/base/style';
|
|
|
|
|
2024-05-01 08:26:48 +00:00
|
|
|
const theme = ({ dt }) => `
|
|
|
|
.p-treetable {
|
|
|
|
position: relative;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-treetable-table {
|
2024-05-13 07:29:23 +00:00
|
|
|
border-spacing: 0;
|
2024-05-01 08:26:48 +00:00
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-treetable-sortable-column {
|
|
|
|
cursor: pointer;
|
|
|
|
user-select: none;
|
|
|
|
outline-color: transparent;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-treetable-column-title,
|
|
|
|
.p-treetable-sort-icon,
|
|
|
|
.p-treetable-sort-badge {
|
|
|
|
vertical-align: middle;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-treetable-sort-icon {
|
|
|
|
color: ${dt('treetable.sort.icon.color')};
|
|
|
|
transition: color ${dt('transition.duration')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-treetable-sort-badge {
|
|
|
|
display: inline-flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
border-radius: 50%;
|
|
|
|
height: 1rem;
|
|
|
|
min-width: 1rem;
|
|
|
|
line-height: 1rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-treetable-sortable-column:not(.p-treetable-column-sorted):hover {
|
|
|
|
background: ${dt('treetable.header.cell.hover.background')};
|
|
|
|
color: ${dt('treetable.header.cell.hover.color')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-treetable-sortable-column:not(.p-treetable-column-sorted):hover .p-treetable-sort-icon {
|
|
|
|
color: ${dt('treetable.sort.icon.hover.color')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-treetable-column-sorted {
|
2024-05-13 07:29:23 +00:00
|
|
|
background: ${dt('treetable.header.cell.selected.background')};
|
|
|
|
color: ${dt('treetable.header.cell.selected.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-05-13 07:29:23 +00:00
|
|
|
.p-treetable-column-sorted .p-treetable-sort-icon {
|
|
|
|
color: ${dt('treetable.header.cell.selected.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-05-13 07:29:23 +00:00
|
|
|
.p-treetable-sortable-column:focus-visible {
|
|
|
|
box-shadow: ${dt('treetable.header.cell.focus.ring.shadow')};
|
|
|
|
outline: ${dt('treetable.header.cell.focus.ring.width')} ${dt('treetable.header.cell.focus.ring.style')} ${dt('treetable.header.cell.focus.ring.color')};
|
|
|
|
outline-offset: ${dt('treetable.header.cell.focus.ring.offset')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-treetable-hoverable .p-treetable-selectable-row {
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-treetable-scrollable > .p-treetable-table-container {
|
|
|
|
position: relative;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-treetable-scrollable-table > .p-treetable-thead {
|
|
|
|
top: 0;
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2024-05-13 07:29:23 +00:00
|
|
|
.p-treetable-scrollable > .p-treetable-table-container > .p-treetable-table > .p-treetable-thead {
|
2024-05-01 08:26:48 +00:00
|
|
|
background: ${dt('treetable.header.cell.background')};
|
|
|
|
}
|
|
|
|
|
2024-05-13 07:29:23 +00:00
|
|
|
.p-treetable-scrollable > .p-treetable-table-container > .p-treetable-table > .p-treetable-tfoot {
|
2024-05-01 08:26:48 +00:00
|
|
|
background: ${dt('treetable.footer.cell.background')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-treetable-flex-scrollable {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
height: 100%;
|
|
|
|
}
|
|
|
|
|
2024-05-13 07:29:23 +00:00
|
|
|
.p-treetable-flex-scrollable > .p-treetable-table-container {
|
2024-05-01 08:26:48 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
.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;
|
|
|
|
white-space: nowrap;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-treetable-resizable-table > .p-treetable-thead > tr > th.p-treetable-resizable-column:not(.p-treetable-frozen-column) {
|
|
|
|
background-clip: padding-box;
|
|
|
|
position: relative;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-treetable-resizable-table-fit > .p-treetable-thead > tr > th.p-treetable-resizable-column:last-child .p-treetable-column-resizer {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-treetable-column-resizer {
|
|
|
|
display: block;
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
right: 0;
|
|
|
|
margin: 0;
|
2024-05-13 07:29:23 +00:00
|
|
|
width: ${dt('treetable.column.resizer.width')};
|
2024-05-01 08:26:48 +00:00
|
|
|
height: 100%;
|
|
|
|
padding: 0px;
|
|
|
|
cursor: col-resize;
|
|
|
|
border: 1px solid transparent;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-treetable-column-header-content {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
2024-05-13 07:29:23 +00:00
|
|
|
gap: ${dt('treetable.header.cell.gap')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-treetable-column-resize-indicator {
|
2024-05-13 07:29:23 +00:00
|
|
|
width: ${dt('treetable.resize.indicator.width')};
|
2024-05-01 08:26:48 +00:00
|
|
|
position: absolute;
|
|
|
|
z-index: 10;
|
|
|
|
display: none;
|
2024-05-04 21:57:50 +00:00
|
|
|
background: ${dt('treetable.resize.indicator.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-treetable-mask {
|
|
|
|
position: absolute;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
z-index: 2;
|
|
|
|
}
|
|
|
|
|
2024-05-13 07:29:23 +00:00
|
|
|
.p-treetable-paginator-top {
|
|
|
|
border-color: ${dt('treetable.paginator.top.border.color')};
|
|
|
|
border-style: solid;
|
|
|
|
border-width: ${dt('treetable.paginator.top.border.width')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-05-13 07:29:23 +00:00
|
|
|
.p-treetable-paginator-bottom {
|
|
|
|
border-color: ${dt('treetable.paginator.bottom.border.color')};
|
|
|
|
border-style: solid;
|
|
|
|
border-width: ${dt('treetable.paginator.bottom.border.width')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-treetable-header {
|
|
|
|
background: ${dt('treetable.header.background')};
|
|
|
|
color: ${dt('treetable.header.color')};
|
2024-05-13 07:29:23 +00:00
|
|
|
border-color: ${dt('treetable.header.border.color')};
|
|
|
|
border-style: solid;
|
|
|
|
border-width: ${dt('treetable.header.border.width')};
|
|
|
|
padding: ${dt('treetable.header.padding')};
|
|
|
|
font-weight: ${dt('treetable.header.font.weight')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-treetable-footer {
|
|
|
|
background: ${dt('treetable.footer.background')};
|
|
|
|
color: ${dt('treetable.footer.color')};
|
2024-05-13 07:29:23 +00:00
|
|
|
border-color: ${dt('treetable.footer.border.color')};
|
|
|
|
border-style: solid;
|
|
|
|
border-width: ${dt('treetable.footer.border.width')};
|
|
|
|
padding: ${dt('treetable.footer.padding')};
|
|
|
|
font-weight: ${dt('treetable.footer.font.weight')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-treetable-thead > tr > th {
|
2024-05-13 07:29:23 +00:00
|
|
|
text-align: ${dt('treetable.header.cell.text.align')};
|
|
|
|
padding: ${dt('treetable.header.cell.padding')};
|
2024-05-01 08:26:48 +00:00
|
|
|
background: ${dt('treetable.header.cell.background')};
|
2024-05-13 07:29:23 +00:00
|
|
|
border-color: ${dt('treetable.header.cell.border.color')};
|
|
|
|
border-style: solid;
|
2024-05-01 08:26:48 +00:00
|
|
|
border-width: 0 0 1px 0;
|
|
|
|
color: ${dt('treetable.header.cell.color')};
|
2024-05-13 07:29:23 +00:00
|
|
|
font-weight: ${dt('treetable.header.font.weight')};
|
|
|
|
transition: background ${dt('transition.duration')}, color ${dt('transition.duration')}, border-color ${dt('transition.duration')}, outline-color ${dt('transition.duration')}, box-shadow ${dt('transition.duration')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-treetable-tbody > tr {
|
|
|
|
outline-color: transparent;
|
|
|
|
background: ${dt('treetable.row.background')};
|
|
|
|
color: ${dt('treetable.row.color')};
|
2024-05-13 07:29:23 +00:00
|
|
|
transition: background ${dt('transition.duration')}, color ${dt('transition.duration')}, border-color ${dt('transition.duration')}, outline-color ${dt('transition.duration')}, box-shadow ${dt('transition.duration')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-treetable-tbody > tr > td {
|
|
|
|
text-align: left;
|
2024-05-13 07:29:23 +00:00
|
|
|
border-color: ${dt('treetable.body.cell.border.color')};
|
|
|
|
border-style: solid;
|
2024-05-01 08:26:48 +00:00
|
|
|
border-width: 0 0 1px 0;
|
2024-05-13 07:29:23 +00:00
|
|
|
padding: ${dt('treetable.body.cell.padding')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-treetable-hoverable .p-treetable-tbody > tr:not(.p-treetable-row-selected):hover {
|
|
|
|
background: ${dt('treetable.row.hover.background')};
|
|
|
|
color: ${dt('treetable.row.hover.color')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-treetable-tbody > tr.p-treetable-row-selected {
|
2024-05-13 07:29:23 +00:00
|
|
|
background: ${dt('treetable.row.selected.background')};
|
|
|
|
color: ${dt('treetable.row.selected.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-treetable-tbody > tr:has(+ .p-treetable-row-selected) > td {
|
|
|
|
border-bottom-color: ${dt('treetable.body.cell.selected.border.color')};
|
|
|
|
}
|
|
|
|
|
2024-05-13 07:29:23 +00:00
|
|
|
.p-treetable-tbody > tr.p-treetable-row-selected > td {
|
2024-05-01 08:26:48 +00:00
|
|
|
border-bottom-color: ${dt('treetable.body.cell.selected.border.color')};
|
|
|
|
}
|
|
|
|
|
2024-05-13 07:29:23 +00:00
|
|
|
.p-treetable-tbody > tr:focus-visible,
|
2024-05-01 08:26:48 +00:00
|
|
|
.p-treetable-tbody > tr.p-treetable-contextmenu-row-selected {
|
2024-05-13 07:29:23 +00:00
|
|
|
box-shadow: ${dt('treetable.body.cell.focus.ring.shadow')};
|
|
|
|
outline: ${dt('treetable.body.cell.focus.ring.width')} ${dt('treetable.body.cell.focus.ring.style')} ${dt('treetable.body.cell.focus.ring.color')};
|
|
|
|
outline-offset: ${dt('treetable.body.cell.focus.ring.offset')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-treetable-tfoot > tr > td {
|
|
|
|
text-align: left;
|
2024-05-13 07:29:23 +00:00
|
|
|
padding: ${dt('treetable.footer.cell.padding')};
|
|
|
|
border-color: ${dt('treetable.footer.cell.border.color')};
|
|
|
|
border-style: solid;
|
2024-05-01 08:26:48 +00:00
|
|
|
border-width: 0 0 1px 0;
|
2024-05-13 07:29:23 +00:00
|
|
|
font-weight: ${dt('treetable.footer.cell.font.weight')};
|
2024-05-01 08:26:48 +00:00
|
|
|
color: ${dt('treetable.footer.cell.color')};
|
|
|
|
background: ${dt('treetable.footer.cell.background')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-treetable-loading-icon {
|
2024-05-13 07:29:23 +00:00
|
|
|
font-size: ${dt('treetable.loading.icon.size')};
|
|
|
|
width: ${dt('treetable.loading.icon.size')};
|
|
|
|
height: ${dt('treetable.loading.icon.size')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-treetable-gridlines .p-treetable-header {
|
|
|
|
border-width: 1px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-treetable-gridlines .p-treetable-footer {
|
|
|
|
border-width: 0 1px 1px 1px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-treetable-gridlines .p-treetable-paginator-top {
|
|
|
|
border-width: 0 1px 0 1px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-treetable-gridlines .p-treetable-paginator-bottom {
|
|
|
|
border-width: 0 1px 1px 1px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.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;
|
|
|
|
}
|
|
|
|
|
|
|
|
.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;
|
|
|
|
}
|
|
|
|
|
2024-05-13 07:29:23 +00:00
|
|
|
p-treetable-gridlines .p-treetable-tbody > tr:last-child > td {
|
2024-05-01 08:26:48 +00:00
|
|
|
border-width: 1px 0 1px 1px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-treetable-gridlines .p-treetable-tbody > tr:last-child > td:last-child {
|
|
|
|
border-width: 1px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-treetable-gridlines .p-treetable-tfoot>tr>td {
|
|
|
|
border-width: 1px 0 1px 1px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-treetable-gridlines .p-treetable-tfoot > tr > td:last-child {
|
|
|
|
border-width: 1px 1px 1px 1px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.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-sm .p-treetable-header {
|
|
|
|
padding: 0.375rem 0.5rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-treetable.p-treetable-sm .p-treetable-thead > tr > th {
|
|
|
|
padding: 0.375rem 0.5rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-treetable.p-treetable-sm .p-treetable-tbody > tr > td {
|
|
|
|
padding: 0.375rem 0.5rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-treetable.p-treetable-sm .p-treetable-tfoot > tr > td {
|
|
|
|
padding: 0.375rem 0.5rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.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;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-treetable.p-treetable-lg .p-treetable-thead > tr > th {
|
|
|
|
padding: 0.9375rem 1.25rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-treetable.p-treetable-lg .p-treetable-tbody>tr>td {
|
|
|
|
padding: 0.9375rem 1.25rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-treetable.p-treetable-lg .p-treetable-tfoot>tr>td {
|
|
|
|
padding: 0.9375rem 1.25rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-treetable.p-treetable-lg .p-treetable-footer {
|
|
|
|
padding: 0.9375rem 1.25rem;
|
|
|
|
}
|
|
|
|
|
2024-05-13 07:29:23 +00:00
|
|
|
.p-treetable-body-cell-content {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
gap: ${dt('treetable.body.cell.gap')};
|
|
|
|
}
|
|
|
|
|
2024-05-04 21:57:50 +00:00
|
|
|
.p-treetable-node-toggle-button {
|
2024-05-01 08:26:48 +00:00
|
|
|
display: inline-flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
overflow: hidden;
|
|
|
|
position: relative;
|
2024-05-13 07:29:23 +00:00
|
|
|
width: ${dt('treetable.node.toggle.button.size')};
|
|
|
|
height: ${dt('treetable.node.toggle.button.size')};
|
2024-05-04 21:57:50 +00:00
|
|
|
color: ${dt('treetable.node.toggle.button.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
border: 0 none;
|
|
|
|
background: transparent;
|
|
|
|
cursor: pointer;
|
2024-05-13 07:29:23 +00:00
|
|
|
border-radius: ${dt('treetable.node.toggle.button.border.radius')};
|
|
|
|
transition: background ${dt('transition.duration')}, color ${dt('transition.duration')}, border-color ${dt('transition.duration')}, outline-color ${dt('transition.duration')}, box-shadow ${dt('transition.duration')};
|
2024-05-01 08:26:48 +00:00
|
|
|
outline-color: transparent;
|
|
|
|
user-select: none;
|
|
|
|
}
|
|
|
|
|
2024-05-04 21:57:50 +00:00
|
|
|
.p-treetable-node-toggle-button:enabled:hover {
|
|
|
|
color: ${dt('treetable.node.toggle.button.hover.color')};
|
|
|
|
background: ${dt('treetable.node.toggle.button.hover.background')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-05-13 07:29:23 +00:00
|
|
|
.p-treetable-tbody > tr.p-treetable-row-selected .p-treetable-node-toggle-button:hover {
|
|
|
|
background: ${dt('treetable.node.toggle.button.selected.hover.background')};
|
|
|
|
${dt('treetable.node.toggle.button.selected.hover.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
2024-05-03 06:20:10 +00:00
|
|
|
|
2024-05-13 07:29:23 +00:00
|
|
|
.p-treetable-node-toggle-button:focus-visible {
|
|
|
|
box-shadow: ${dt('treetable.node.toggle.button.focus.ring.shadow')};
|
|
|
|
outline: ${dt('treetable.node.toggle.button.focus.ring.width')} ${dt('treetable.node.toggle.button.focus.ring.style')} ${dt('treetable.node.toggle.button.focus.ring.color')};
|
|
|
|
outline-offset: ${dt('treetable.node.toggle.button.focus.ring.offset')};
|
2024-05-03 06:20:10 +00:00
|
|
|
}
|
2024-05-01 08:26:48 +00:00
|
|
|
`;
|
|
|
|
|
2023-10-02 10:46:09 +00:00
|
|
|
const classes = {
|
|
|
|
root: ({ instance, props }) => [
|
|
|
|
'p-treetable p-component',
|
|
|
|
{
|
2024-04-29 09:00:43 +00:00
|
|
|
'p-treetable-hoverable': props.rowHover || instance.rowSelectionMode,
|
2023-10-02 10:46:09 +00:00
|
|
|
'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,
|
2023-10-02 10:46:09 +00:00
|
|
|
'p-treetable-sm': props.size === 'small',
|
|
|
|
'p-treetable-lg': props.size === 'large'
|
|
|
|
}
|
|
|
|
],
|
2024-05-02 10:27:11 +00:00
|
|
|
loading: 'p-treetable-loading', //TODO: required?
|
|
|
|
mask: 'p-treetable-mask p-component-overlay',
|
2023-10-02 10:46:09 +00:00
|
|
|
loadingIcon: 'p-treetable-loading-icon',
|
|
|
|
header: 'p-treetable-header',
|
2024-04-29 09:00:43 +00:00
|
|
|
paginator: ({ position }) => 'p-treetable-paginator-' + position,
|
2024-05-02 10:27:11 +00:00
|
|
|
tableContainer: 'p-treetable-table-container',
|
2024-05-03 06:20:10 +00:00
|
|
|
table: ({ props }) => [
|
|
|
|
'p-treetable-table',
|
|
|
|
{
|
|
|
|
'p-treetable-scrollable-table': props.scrollable,
|
|
|
|
'p-treetable-resizable-table': props.resizableColumns,
|
|
|
|
'p-treetable-resizable-table-fit': props.resizableColumns && props.columnResizeMode === 'fit'
|
|
|
|
}
|
|
|
|
],
|
2023-10-02 10:46:09 +00:00
|
|
|
thead: 'p-treetable-thead',
|
2024-05-03 06:20:10 +00:00
|
|
|
headerCell: ({ instance, props, context }) => [
|
2023-10-02 10:46:09 +00:00
|
|
|
{
|
2024-04-29 09:00:43 +00:00
|
|
|
'p-treetable-sortable-column': instance.columnProp('sortable'),
|
|
|
|
'p-treetable-resizable-column': props.resizableColumns,
|
2024-05-03 06:20:10 +00:00
|
|
|
'p-treetable-column-sorted': context?.sorted,
|
2024-04-29 09:00:43 +00:00
|
|
|
'p-treetable-frozen-column': instance.columnProp('frozen')
|
2023-10-02 10:46:09 +00:00
|
|
|
}
|
|
|
|
],
|
2024-04-29 09:00:43 +00:00
|
|
|
columnResizer: 'p-treetable-column-resizer',
|
2024-05-13 09:46:55 +00:00
|
|
|
columnHeaderContent: 'p-treetable-column-header-content',
|
2024-05-02 10:27:11 +00:00
|
|
|
columnTitle: 'p-treetable-column-title',
|
2024-04-29 09:00:43 +00:00
|
|
|
sortIcon: 'p-treetable-sort-icon',
|
|
|
|
sortBadge: 'p-treetable-sort-badge',
|
|
|
|
tbody: 'p-treetable-tbody',
|
|
|
|
row: ({ instance }) => [
|
2023-10-02 10:46:09 +00:00
|
|
|
{
|
2024-04-29 09:00:43 +00:00
|
|
|
'p-treetable-row-selected': instance.selected
|
2023-10-02 10:46:09 +00:00
|
|
|
}
|
|
|
|
],
|
2024-04-29 09:00:43 +00:00
|
|
|
bodyCell: ({ instance }) => [
|
2023-10-02 10:46:09 +00:00
|
|
|
{
|
2024-04-29 09:00:43 +00:00
|
|
|
'p-treetable-frozen-column': instance.columnProp('frozen')
|
2023-10-02 10:46:09 +00:00
|
|
|
}
|
|
|
|
],
|
2024-05-13 07:29:23 +00:00
|
|
|
bodyCellContent: ({ instance }) => [
|
|
|
|
'p-treetable-body-cell-content',
|
|
|
|
{
|
|
|
|
'p-treetable-body-cell-content-expander': instance.columnProp('expander')
|
|
|
|
}
|
|
|
|
],
|
2024-05-04 21:57:50 +00:00
|
|
|
nodeToggleButton: 'p-treetable-node-toggle-button',
|
|
|
|
nodeToggleIcon: 'p-treetable-node-toggle-icon',
|
2024-05-06 15:23:01 +00:00
|
|
|
pcNodeCheckbox: 'p-treetable-node-checkbox',
|
2024-04-29 09:00:43 +00:00
|
|
|
emptyMessage: 'p-treetable-empty-message',
|
2023-10-02 10:46:09 +00:00
|
|
|
tfoot: 'p-treetable-tfoot',
|
|
|
|
footerCell: ({ instance }) => [
|
|
|
|
{
|
2024-04-29 09:00:43 +00:00
|
|
|
'p-treetable-frozen-column': instance.columnProp('frozen')
|
2023-10-02 10:46:09 +00:00
|
|
|
}
|
|
|
|
],
|
|
|
|
footer: 'p-treetable-footer',
|
2024-05-06 13:10:13 +00:00
|
|
|
columnResizeIndicator: 'p-treetable-column-resize-indicator'
|
2023-10-02 10:46:09 +00:00
|
|
|
};
|
|
|
|
|
2024-05-03 06:20:10 +00:00
|
|
|
const inlineStyles = {
|
|
|
|
tableContainer: { overflow: 'auto' },
|
|
|
|
thead: { position: 'sticky' },
|
|
|
|
tfoot: { position: 'sticky' }
|
|
|
|
};
|
|
|
|
|
2023-10-02 10:46:09 +00:00
|
|
|
export default BaseStyle.extend({
|
|
|
|
name: 'treetable',
|
2024-05-01 08:26:48 +00:00
|
|
|
theme,
|
2024-05-03 06:20:10 +00:00
|
|
|
classes,
|
|
|
|
inlineStyles
|
2023-10-02 10:46:09 +00:00
|
|
|
});
|