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-datatable {
|
|
|
|
position: relative;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-table {
|
2024-05-12 23:28:17 +00:00
|
|
|
border-spacing: 0;
|
2024-05-01 08:26:48 +00:00
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.p-datatable-scrollable > .p-datatable-table-container {
|
|
|
|
position: relative;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-scrollable-table > .p-datatable-thead {
|
|
|
|
top: 0;
|
|
|
|
z-index: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-scrollable-table > .p-datatable-frozen-tbody {
|
|
|
|
position: sticky;
|
|
|
|
z-index: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-scrollable-table>.p-datatable-tfoot {
|
|
|
|
bottom: 0;
|
|
|
|
z-index: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-scrollable .p-datatable-frozen-column {
|
|
|
|
position: sticky;
|
|
|
|
background: inherit;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-scrollable th.p-datatable-frozen-column {
|
|
|
|
z-index: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-scrollable > .p-datatable-table-container > .p-datatable-table > .p-datatable-thead,
|
|
|
|
.p-datatable-scrollable > .p-datatable-table-container > .p-virtualscroller > .p-datatable-table > .p-datatable-thead {
|
|
|
|
background: ${dt('datatable.header.cell.background')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-scrollable > .p-datatable-table-container > .p-datatable-table > .p-datatable-tfoot,
|
|
|
|
.p-datatable-scrollable > .p-datatable-table-container > .p-virtualscroller > .p-datatable-table > .p-datatable-tfoot {
|
|
|
|
background: ${dt('datatable.footer.cell.background')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-flex-scrollable {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
height: 100%;
|
|
|
|
}
|
|
|
|
|
2024-05-12 23:28:17 +00:00
|
|
|
.p-datatable-flex-scrollable > .p-datatable-table-container {
|
2024-05-01 08:26:48 +00:00
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
flex: 1;
|
|
|
|
height: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-scrollable-table > .p-datatable-tbody > .p-datatable-row-group-header {
|
|
|
|
position: sticky;
|
|
|
|
z-index: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-resizable-table > .p-datatable-thead > tr > th,
|
|
|
|
.p-datatable-resizable-table > .p-datatable-tfoot > tr > td,
|
|
|
|
.p-datatable-resizable-table > .p-datatable-tbody > tr > td {
|
|
|
|
overflow: hidden;
|
|
|
|
white-space: nowrap;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-resizable-table > .p-datatable-thead > tr > th.p-datatable-resizable-column:not(.p-datatable-frozen-column) {
|
|
|
|
background-clip: padding-box;
|
|
|
|
position: relative;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-resizable-table-fit > .p-datatable-thead > tr > th.p-datatable-resizable-column:last-child .p-datatable-column-resizer {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-column-resizer {
|
|
|
|
display: block;
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
right: 0;
|
|
|
|
margin: 0;
|
2024-05-12 23:28:17 +00:00
|
|
|
width: ${dt('datatable.column.resizer.width')};
|
2024-05-01 08:26:48 +00:00
|
|
|
height: 100%;
|
|
|
|
padding: 0px;
|
|
|
|
cursor: col-resize;
|
|
|
|
border: 1px solid transparent;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-column-header-content {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
2024-05-12 23:28:17 +00:00
|
|
|
gap: ${dt('datatable.header.cell.gap')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-column-resize-indicator {
|
2024-05-12 23:28:17 +00:00
|
|
|
width: ${dt('datatable.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('datatable.resize.indicator.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-row-reorder-indicator-up,
|
|
|
|
.p-datatable-row-reorder-indicator-down {
|
|
|
|
position: absolute;
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-reorderable-column,
|
|
|
|
.p-datatable-reorderable-row-handle {
|
|
|
|
cursor: move;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-mask {
|
|
|
|
position: absolute;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
z-index: 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-inline-filter {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
width: 100%;
|
2024-05-12 23:28:17 +00:00
|
|
|
gap: ${dt('datatable.filter.inline.gap')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-inline-filter .p-datatable-filter-element-container {
|
|
|
|
flex: 1 1 auto;
|
|
|
|
width: 1%;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-filter-overlay {
|
2024-05-12 23:28:17 +00:00
|
|
|
background: ${dt('datatable.filter.overlay.select.background')};
|
|
|
|
color: ${dt('datatable.filter.overlay.select.color')};
|
|
|
|
border: 1px solid ${dt('datatable.filter.overlay.select.border.color')};
|
|
|
|
border-radius: ${dt('datatable.filter.overlay.select.border.radius')};
|
|
|
|
box-shadow: ${dt('datatable.filter.overlay.select.shadow')};
|
2024-05-01 08:26:48 +00:00
|
|
|
min-width: 12.5rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-filter-constraint-list {
|
|
|
|
margin: 0;
|
|
|
|
list-style: none;
|
2024-05-12 23:28:17 +00:00
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
padding: ${dt('datatable.filter.constraint.list.padding')};
|
|
|
|
gap: ${dt('datatable.filter.constraint.list.gap')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-filter-constraint {
|
2024-05-12 23:28:17 +00:00
|
|
|
padding: ${dt('datatable.filter.constraint.padding')};
|
2024-05-04 21:57:50 +00:00
|
|
|
color: ${dt('datatable.filter.constraint.color')};
|
2024-05-12 23:28:17 +00:00
|
|
|
border-radius: ${dt('datatable.filter.constraint.border.radius')};
|
2024-05-01 08:26:48 +00:00
|
|
|
cursor: pointer;
|
2024-05-25 15:09:39 +00:00
|
|
|
transition: background ${dt('datatable.transition.duration')}, color ${dt('datatable.transition.duration')}, border-color ${dt('datatable.transition.duration')},
|
|
|
|
box-shadow ${dt('datatable.transition.duration')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-filter-constraint-selected {
|
2024-05-04 21:57:50 +00:00
|
|
|
background: ${dt('datatable.filter.constraint.selected.background')};
|
|
|
|
color: ${dt('datatable.filter.constraint.selected.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-filter-constraint:not(.p-datatable-filter-constraint-selected):not(.p-disabled):hover {
|
2024-05-04 21:57:50 +00:00
|
|
|
background: ${dt('datatable.filter.constraint.focus.background')};
|
|
|
|
color: ${dt('datatable.filter.constraint.focus.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-filter-constraint:focus-visible {
|
2024-05-12 23:28:17 +00:00
|
|
|
outline: 0 none;
|
|
|
|
background: ${dt('datatable.filter.constraint.focus.background')};
|
|
|
|
color: ${dt('datatable.filter.constraint.focus.color')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-filter-constraint-selected:focus-visible {
|
|
|
|
outline: 0 none;
|
|
|
|
background: ${dt('datatable.filter.constraint.selected.focus.background')};
|
|
|
|
color: ${dt('datatable.filter.constraint.selected.focus.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-filter-constraint-separator {
|
2024-05-04 21:57:50 +00:00
|
|
|
border-top: 1px solid ${dt('datatable.filter.constraint.separator.border.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-popover-filter {
|
|
|
|
display: inline-flex;
|
|
|
|
margin-left: auto;
|
|
|
|
}
|
|
|
|
|
2024-05-12 23:28:17 +00:00
|
|
|
.p-datatable-filter-overlay-popover {
|
|
|
|
background: ${dt('datatable.filter.overlay.popover.background')};
|
|
|
|
color: ${dt('datatable.filter.overlay.popover.color')};
|
|
|
|
border: 1px solid ${dt('datatable.filter.overlay.popover.border.color')};
|
|
|
|
border-radius: ${dt('datatable.filter.overlay.popover.border.radius')};
|
|
|
|
box-shadow: ${dt('datatable.filter.overlay.popover.shadow')};
|
|
|
|
min-width: 12.5rem;
|
|
|
|
padding: ${dt('datatable.filter.overlay.popover.padding')};
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
gap: ${dt('datatable.filter.overlay.popover.gap')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-filter-operator-dropdown {
|
|
|
|
width: 100%;
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-05-12 23:28:17 +00:00
|
|
|
.p-datatable-filter-rule-list,
|
|
|
|
.p-datatable-filter-rule {
|
2024-05-01 08:26:48 +00:00
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
2024-05-12 23:28:17 +00:00
|
|
|
gap: ${dt('datatable.filter.overlay.popover.gap')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-filter-rule {
|
2024-05-04 21:57:50 +00:00
|
|
|
border-bottom: 1px solid ${dt('datatable.filter.rule.border.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-filter-rule:last-child {
|
|
|
|
border-bottom: 0 none;
|
|
|
|
}
|
|
|
|
|
2024-05-12 23:28:17 +00:00
|
|
|
.p-datatable-filter-add-rule-button {
|
|
|
|
width: 100%;
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-05-12 23:28:17 +00:00
|
|
|
.p-datatable-filter-remove-button {
|
|
|
|
width: 100%;
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-filter-buttonbar {
|
|
|
|
padding: 0;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: space-between;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-virtualscroller-spacer {
|
|
|
|
display: flex;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable .p-virtualscroller .p-virtualscroller-loading {
|
|
|
|
transform: none !important;
|
|
|
|
min-height: 0;
|
|
|
|
position: sticky;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-paginator-top {
|
2024-05-12 23:28:17 +00:00
|
|
|
border-color: ${dt('datatable.paginator.top.border.color')};
|
|
|
|
border-style: solid;
|
|
|
|
border-width: ${dt('datatable.paginator.top.border.width')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-paginator-bottom {
|
|
|
|
border-color: ${dt('datatable.paginator.bottom.border.color')};
|
|
|
|
border-style: solid;
|
|
|
|
border-width: ${dt('datatable.paginator.bottom.border.width')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-header {
|
|
|
|
background: ${dt('datatable.header.background')};
|
|
|
|
color: ${dt('datatable.header.color')};
|
2024-05-12 23:28:17 +00:00
|
|
|
border-color: ${dt('datatable.header.border.color')};
|
|
|
|
border-style: solid;
|
|
|
|
border-width: ${dt('datatable.header.border.width')};
|
|
|
|
padding: ${dt('datatable.header.padding')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-footer {
|
|
|
|
background: ${dt('datatable.footer.background')};
|
|
|
|
color: ${dt('datatable.footer.color')};
|
2024-05-12 23:28:17 +00:00
|
|
|
border-color: ${dt('datatable.footer.border.color')};
|
|
|
|
border-style: solid;
|
|
|
|
border-width: ${dt('datatable.footer.border.width')};
|
|
|
|
padding: ${dt('datatable.footer.padding')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-05-13 15:54:30 +00:00
|
|
|
.p-datatable-header-cell {
|
2024-05-12 23:28:17 +00:00
|
|
|
padding: ${dt('datatable.header.cell.padding')};
|
2024-05-01 08:26:48 +00:00
|
|
|
background: ${dt('datatable.header.cell.background')};
|
2024-05-12 23:28:17 +00:00
|
|
|
border-color: ${dt('datatable.header.cell.border.color')};
|
|
|
|
border-style: solid;
|
2024-05-01 08:26:48 +00:00
|
|
|
border-width: 0 0 1px 0;
|
|
|
|
color: ${dt('datatable.header.cell.color')};
|
2024-05-25 15:09:39 +00:00
|
|
|
font-weight: normal;
|
|
|
|
text-align: left;
|
|
|
|
transition: background ${dt('datatable.transition.duration')}, color ${dt('datatable.transition.duration')}, border-color ${dt('datatable.transition.duration')},
|
|
|
|
outline-color ${dt('datatable.transition.duration')}, box-shadow ${dt('datatable.transition.duration')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-column-title {
|
|
|
|
font-weight: ${dt('datatable.column.title.font.weight')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-tbody > tr {
|
|
|
|
outline-color: transparent;
|
|
|
|
background: ${dt('datatable.row.background')};
|
|
|
|
color: ${dt('datatable.row.color')};
|
2024-05-25 15:09:39 +00:00
|
|
|
transition: background ${dt('datatable.transition.duration')}, color ${dt('datatable.transition.duration')}, border-color ${dt('datatable.transition.duration')},
|
|
|
|
outline-color ${dt('datatable.transition.duration')}, box-shadow ${dt('datatable.transition.duration')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-tbody > tr > td {
|
|
|
|
text-align: left;
|
2024-05-12 23:28:17 +00:00
|
|
|
border-color: ${dt('datatable.body.cell.border.color')};
|
|
|
|
border-style: solid;
|
2024-05-01 08:26:48 +00:00
|
|
|
border-width: 0 0 1px 0;
|
2024-05-12 23:28:17 +00:00
|
|
|
padding: ${dt('datatable.body.cell.padding')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-hoverable .p-datatable-tbody > tr:not(.p-datatable-row-selected):hover {
|
|
|
|
background: ${dt('datatable.row.hover.background')};
|
|
|
|
color: ${dt('datatable.row.hover.color')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-tbody > tr.p-datatable-row-selected {
|
2024-05-12 23:28:17 +00:00
|
|
|
background: ${dt('datatable.row.selected.background')};
|
|
|
|
color: ${dt('datatable.row.selected.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-tbody > tr:has(+ .p-datatable-row-selected) > td {
|
|
|
|
border-bottom-color: ${dt('datatable.body.cell.selected.border.color')};
|
|
|
|
}
|
|
|
|
|
2024-05-12 23:28:17 +00:00
|
|
|
.p-datatable-tbody > tr.p-datatable-row-selected > td {
|
2024-05-01 08:26:48 +00:00
|
|
|
border-bottom-color: ${dt('datatable.body.cell.selected.border.color')};
|
|
|
|
}
|
|
|
|
|
2024-05-12 23:28:17 +00:00
|
|
|
.p-datatable-tbody > tr:focus-visible,
|
2024-05-01 08:26:48 +00:00
|
|
|
.p-datatable-tbody > tr.p-datatable-contextmenu-row-selected {
|
2024-05-12 23:28:17 +00:00
|
|
|
box-shadow: ${dt('datatable.body.cell.focus.ring.shadow')};
|
|
|
|
outline: ${dt('datatable.body.cell.focus.ring.width')} ${dt('datatable.body.cell.focus.ring.style')} ${dt('datatable.body.cell.focus.ring.color')};
|
|
|
|
outline-offset: ${dt('datatable.body.cell.focus.ring.offset')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-tfoot > tr > td {
|
|
|
|
text-align: left;
|
2024-05-12 23:28:17 +00:00
|
|
|
padding: ${dt('datatable.footer.cell.padding')};
|
|
|
|
border-color: ${dt('datatable.footer.cell.border.color')};
|
|
|
|
border-style: solid;
|
2024-05-01 08:26:48 +00:00
|
|
|
border-width: 0 0 1px 0;
|
|
|
|
color: ${dt('datatable.footer.cell.color')};
|
|
|
|
background: ${dt('datatable.footer.cell.background')};
|
|
|
|
}
|
|
|
|
|
2024-05-25 15:09:39 +00:00
|
|
|
.p-datatable-column-footer {
|
|
|
|
font-weight: ${dt('datatable.column.footer.font.weight')};
|
|
|
|
}
|
|
|
|
|
2024-05-13 15:54:30 +00:00
|
|
|
.p-datatable-sortable-column {
|
|
|
|
cursor: pointer;
|
|
|
|
user-select: none;
|
|
|
|
outline-color: transparent;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-column-title,
|
|
|
|
.p-datatable-sort-icon,
|
|
|
|
.p-datatable-sort-badge {
|
|
|
|
vertical-align: middle;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-sort-icon {
|
|
|
|
color: ${dt('datatable.sort.icon.color')};
|
2024-05-25 08:18:55 +00:00
|
|
|
transition: color ${dt('datatable.transition.duration')};
|
2024-05-13 15:54:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-sortable-column:not(.p-datatable-column-sorted):hover {
|
|
|
|
background: ${dt('datatable.header.cell.hover.background')};
|
|
|
|
color: ${dt('datatable.header.cell.hover.color')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-sortable-column:not(.p-datatable-column-sorted):hover .p-datatable-sort-icon {
|
|
|
|
color: ${dt('datatable.sort.icon.hover.color')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-column-sorted {
|
|
|
|
background: ${dt('datatable.header.cell.selected.background')};
|
|
|
|
color: ${dt('datatable.header.cell.selected.color')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-column-sorted .p-datatable-sort-icon {
|
|
|
|
color: ${dt('datatable.header.cell.selected.color')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-sortable-column:focus-visible {
|
|
|
|
box-shadow: ${dt('datatable.header.cell.focus.ring.shadow')};
|
|
|
|
outline: ${dt('datatable.header.cell.focus.ring.width')} ${dt('datatable.header.cell.focus.ring.style')} ${dt('datatable.header.cell.focus.ring.color')};
|
|
|
|
outline-offset: ${dt('datatable.header.cell.focus.ring.offset')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-hoverable .p-datatable-selectable-row {
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
|
|
|
|
2024-05-01 08:26:48 +00:00
|
|
|
.p-datatable-tbody > tr.p-datatable-dragpoint-top > td {
|
|
|
|
box-shadow: inset 0 2px 0 0 ${dt('datatable.drop.point.color')};
|
|
|
|
}
|
|
|
|
|
2024-05-12 23:28:17 +00:00
|
|
|
.p-datatable-tbody > tr.p-datatable-dragpoint-bottom > td {
|
2024-05-01 08:26:48 +00:00
|
|
|
box-shadow: inset 0 -2px 0 0 ${dt('datatable.drop.point.color')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-loading-icon {
|
2024-05-12 23:28:17 +00:00
|
|
|
font-size: ${dt('datatable.loading.icon.size')};
|
|
|
|
width: ${dt('datatable.loading.icon.size')};
|
|
|
|
height: ${dt('datatable.loading.icon.size')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-gridlines .p-datatable-header {
|
|
|
|
border-width: 1px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-gridlines .p-datatable-footer {
|
|
|
|
border-width: 0 1px 1px 1px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-gridlines .p-datatable-paginator-top {
|
|
|
|
border-width: 0 1px 0 1px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-gridlines .p-datatable-paginator-bottom {
|
|
|
|
border-width: 0 1px 1px 1px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-gridlines .p-datatable-thead > tr > th {
|
|
|
|
border-width: 1px 0 1px 1px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-gridlines .p-datatable-thead > tr > th:last-child {
|
|
|
|
border-width: 1px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-gridlines .p-datatable-tbody > tr > td {
|
|
|
|
border-width: 1px 0 0 1px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-gridlines .p-datatable-tbody > tr > td:last-child {
|
|
|
|
border-width: 1px 1px 0 1px;
|
|
|
|
}
|
|
|
|
|
2024-05-12 23:28:17 +00:00
|
|
|
p-datatable-gridlines .p-datatable-tbody > tr:last-child > td {
|
2024-05-01 08:26:48 +00:00
|
|
|
border-width: 1px 0 1px 1px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-gridlines .p-datatable-tbody > tr:last-child > td:last-child {
|
|
|
|
border-width: 1px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-gridlines .p-datatable-tfoot>tr>td {
|
|
|
|
border-width: 1px 0 1px 1px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-gridlines .p-datatable-tfoot > tr > td:last-child {
|
|
|
|
border-width: 1px 1px 1px 1px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable.p-datatable-gridlines .p-datatable-thead +.p-datatable-tfoot > tr > td {
|
|
|
|
border-width: 0 0 1px 1px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable.p-datatable-gridlines .p-datatable-thead + .p-datatable-tfoot > tr > td:last-child {
|
|
|
|
border-width: 0 1px 1px 1px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable.p-datatable-gridlines:has(.p-datatable-thead):has(.p-datatable-tbody) .p-datatable-tbody > tr > td {
|
|
|
|
border-width: 0 0 1px 1px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable.p-datatable-gridlines:has(.p-datatable-thead):has(.p-datatable-tbody) .p-datatable-tbody > tr > td:last-child {
|
|
|
|
border-width: 0 1px 1px 1px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable.p-datatable-gridlines:has(.p-datatable-tbody):has(.p-datatable-tfoot) .p-datatable-tbody > tr:last-child > td {
|
|
|
|
border-width: 0 0 0 1px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable.p-datatable-gridlines:has(.p-datatable-tbody):has(.p-datatable-tfoot) .p-datatable-tbody > tr:last-child > td:last-child {
|
|
|
|
border-width: 0 1px 0 1px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable.p-datatable-striped .p-datatable-tbody > tr.p-row-odd {
|
2024-05-12 23:31:23 +00:00
|
|
|
background: ${dt('datatable.row.striped.background')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-05-12 23:31:23 +00:00
|
|
|
.p-datatable.p-datatable-striped .p-datatable-tbody > tr.p-row-odd.p-datatable-row-selected {
|
2024-05-12 23:28:17 +00:00
|
|
|
background: ${dt('datatable.row.selected.background')};
|
|
|
|
color: ${dt('datatable.row.selected.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable.p-datatable-sm .p-datatable-header {
|
|
|
|
padding: 0.375rem 0.5rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable.p-datatable-sm .p-datatable-thead > tr > th {
|
|
|
|
padding: 0.375rem 0.5rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable.p-datatable-sm .p-datatable-tbody > tr > td {
|
|
|
|
padding: 0.375rem 0.5rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable.p-datatable-sm .p-datatable-tfoot > tr > td {
|
|
|
|
padding: 0.375rem 0.5rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable.p-datatable-sm .p-datatable-footer {
|
|
|
|
padding: 0.375rem 0.5rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable.p-datatable-lg .p-datatable-header {
|
|
|
|
padding: 0.9375rem 1.25rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable.p-datatable-lg .p-datatable-thead > tr > th {
|
|
|
|
padding: 0.9375rem 1.25rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable.p-datatable-lg .p-datatable-tbody>tr>td {
|
|
|
|
padding: 0.9375rem 1.25rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable.p-datatable-lg .p-datatable-tfoot>tr>td {
|
|
|
|
padding: 0.9375rem 1.25rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable.p-datatable-lg .p-datatable-footer {
|
|
|
|
padding: 0.9375rem 1.25rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-row-toggle-button {
|
|
|
|
display: inline-flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
overflow: hidden;
|
|
|
|
position: relative;
|
2024-05-12 23:28:17 +00:00
|
|
|
width: ${dt('datatable.row.toggle.button.size')};
|
|
|
|
height: ${dt('datatable.row.toggle.button.size')};
|
2024-05-04 21:57:50 +00:00
|
|
|
color: ${dt('datatable.row.toggle.button.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
border: 0 none;
|
|
|
|
background: transparent;
|
|
|
|
cursor: pointer;
|
2024-05-12 23:28:17 +00:00
|
|
|
border-radius: ${dt('datatable.row.toggle.button.border.radius')};
|
2024-05-25 15:09:39 +00:00
|
|
|
transition: background ${dt('datatable.transition.duration')}, color ${dt('datatable.transition.duration')}, border-color ${dt('datatable.transition.duration')},
|
|
|
|
outline-color ${dt('datatable.transition.duration')}, box-shadow ${dt('datatable.transition.duration')};
|
2024-05-01 08:26:48 +00:00
|
|
|
outline-color: transparent;
|
|
|
|
user-select: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-datatable-row-toggle-button:enabled:hover {
|
2024-05-04 21:57:50 +00:00
|
|
|
color: ${dt('datatable.row.toggle.button.hover.color')};
|
|
|
|
background: ${dt('datatable.row.toggle.button.hover.background')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-05-12 23:28:17 +00:00
|
|
|
.p-datatable-tbody > tr.p-datatable-row-selected .p-datatable-row-toggle-button:hover {
|
|
|
|
background: ${dt('datatable.row.toggle.button.selected.hover.background')};
|
|
|
|
${dt('datatable.row.toggle.button.selected.hover.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-05-12 23:28:17 +00:00
|
|
|
.p-datatable-row-toggle-button:focus-visible {
|
|
|
|
box-shadow: ${dt('datatable.row.toggle.button.focus.ring.shadow')};
|
|
|
|
outline: ${dt('datatable.row.toggle.button.focus.ring.width')} ${dt('datatable.row.toggle.button.focus.ring.style')} ${dt('datatable.row.toggle.button.focus.ring.color')};
|
|
|
|
outline-offset: ${dt('datatable.row.toggle.button.focus.ring.offset')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2023-10-02 10:46:09 +00:00
|
|
|
const classes = {
|
2024-04-28 21:54:19 +00:00
|
|
|
root: ({ props }) => [
|
2023-10-02 10:46:09 +00:00
|
|
|
'p-datatable p-component',
|
|
|
|
{
|
2024-04-28 21:54:19 +00:00
|
|
|
'p-datatable-hoverable': props.rowHover || props.selectionMode,
|
2023-10-02 10:46:09 +00:00
|
|
|
'p-datatable-resizable': props.resizableColumns,
|
|
|
|
'p-datatable-resizable-fit': props.resizableColumns && props.columnResizeMode === 'fit',
|
|
|
|
'p-datatable-scrollable': props.scrollable,
|
|
|
|
'p-datatable-flex-scrollable': props.scrollable && props.scrollHeight === 'flex',
|
|
|
|
'p-datatable-striped': props.stripedRows,
|
|
|
|
'p-datatable-gridlines': props.showGridlines,
|
|
|
|
'p-datatable-sm': props.size === 'small',
|
|
|
|
'p-datatable-lg': props.size === 'large'
|
|
|
|
}
|
|
|
|
],
|
2024-05-13 14:02:20 +00:00
|
|
|
mask: 'p-datatable-mask p-overlay-mask',
|
2023-10-02 10:46:09 +00:00
|
|
|
loadingIcon: 'p-datatable-loading-icon',
|
|
|
|
header: 'p-datatable-header',
|
2024-05-06 15:23:01 +00:00
|
|
|
pcPaginator: ({ position }) => 'p-datatable-paginator-' + position,
|
2024-05-02 09:58:00 +00:00
|
|
|
tableContainer: 'p-datatable-table-container',
|
2023-10-02 10:46:09 +00:00
|
|
|
table: ({ props }) => [
|
|
|
|
'p-datatable-table',
|
|
|
|
{
|
|
|
|
'p-datatable-scrollable-table': props.scrollable,
|
|
|
|
'p-datatable-resizable-table': props.resizableColumns,
|
|
|
|
'p-datatable-resizable-table-fit': props.resizableColumns && props.columnResizeMode === 'fit'
|
|
|
|
}
|
|
|
|
],
|
|
|
|
thead: 'p-datatable-thead',
|
|
|
|
headerCell: ({ instance, props, column }) =>
|
|
|
|
column && !instance.columnProp(column, 'hidden') && (props.rowGroupMode !== 'subheader' || props.groupRowsBy !== instance.columnProp(column, 'field'))
|
|
|
|
? [
|
2024-05-13 15:54:30 +00:00
|
|
|
'p-datatable-header-cell',
|
2023-10-02 10:46:09 +00:00
|
|
|
{
|
2024-04-28 21:54:19 +00:00
|
|
|
'p-datatable-frozen-column': instance.columnProp(column, 'frozen')
|
2023-10-02 10:46:09 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
: [
|
2024-05-13 15:54:30 +00:00
|
|
|
'p-datatable-header-cell',
|
2023-10-02 10:46:09 +00:00
|
|
|
{
|
2024-04-28 21:54:19 +00:00
|
|
|
'p-datatable-sortable-column': instance.columnProp('sortable'),
|
|
|
|
'p-datatable-resizable-column': instance.resizableColumns,
|
|
|
|
'p-datatable-column-sorted': instance.isColumnSorted(),
|
|
|
|
'p-datatable-frozen-column': instance.columnProp('frozen'),
|
|
|
|
'p-datatable-reorderable-column': props.reorderableColumns
|
2023-10-02 10:46:09 +00:00
|
|
|
}
|
|
|
|
],
|
2024-04-28 21:54:19 +00:00
|
|
|
columnResizer: 'p-datatable-column-resizer',
|
2024-05-02 09:58:00 +00:00
|
|
|
columnHeaderContent: 'p-datatable-column-header-content',
|
|
|
|
columnTitle: 'p-datatable-column-title',
|
2024-05-25 15:09:39 +00:00
|
|
|
columnFooter: 'p-datatable-column-footer',
|
2024-04-29 09:00:43 +00:00
|
|
|
sortIcon: 'p-datatable-sort-icon',
|
2024-05-13 10:08:24 +00:00
|
|
|
pcSortBadge: 'p-datatable-sort-badge',
|
2024-05-02 09:58:00 +00:00
|
|
|
filter: ({ props }) => [
|
2024-04-28 21:54:19 +00:00
|
|
|
'p-datatable-filter',
|
2023-10-02 10:46:09 +00:00
|
|
|
{
|
2024-04-28 21:54:19 +00:00
|
|
|
'p-datatable-inline-filter': props.display === 'row',
|
|
|
|
'p-datatable-popover-filter': props.display === 'menu'
|
2023-10-02 10:46:09 +00:00
|
|
|
}
|
|
|
|
],
|
2024-05-02 09:58:00 +00:00
|
|
|
filterElementContainer: 'p-datatable-filter-element-container',
|
2024-05-06 15:23:01 +00:00
|
|
|
pcColumnFilterButton: 'p-datatable-column-filter-button',
|
|
|
|
pcColumnFilterClearButton: 'p-datatable-column-filter-clear-button',
|
2023-10-02 10:46:09 +00:00
|
|
|
filterOverlay: ({ instance, props }) => [
|
2024-04-28 21:54:19 +00:00
|
|
|
'p-datatable-filter-overlay p-component',
|
2023-10-02 10:46:09 +00:00
|
|
|
{
|
2024-05-08 15:58:22 +00:00
|
|
|
'p-datatable-filter-overlay-popover': props.display === 'menu'
|
2023-10-02 10:46:09 +00:00
|
|
|
}
|
|
|
|
],
|
2024-05-02 09:58:00 +00:00
|
|
|
filterConstraintList: 'p-datatable-filter-constraint-list',
|
|
|
|
filterConstraint: ({ instance, matchMode }) => [
|
2024-04-28 21:54:19 +00:00
|
|
|
'p-datatable-filter-constraint',
|
2023-10-02 10:46:09 +00:00
|
|
|
{
|
2024-04-28 21:54:19 +00:00
|
|
|
'p-datatable-filter-constraint-selected': matchMode && instance.isRowMatchModeSelected(matchMode.value)
|
2023-10-02 10:46:09 +00:00
|
|
|
}
|
|
|
|
],
|
2024-05-02 09:58:00 +00:00
|
|
|
filterConstraintSeparator: 'p-datatable-filter-constraint-separator',
|
2024-04-28 21:54:19 +00:00
|
|
|
filterOperator: 'p-datatable-filter-operator',
|
2024-05-06 15:23:01 +00:00
|
|
|
pcFilterOperatorDropdown: 'p-datatable-filter-operator-dropdown',
|
2024-05-06 13:10:13 +00:00
|
|
|
filterRuleList: 'p-datatable-filter-rule-list',
|
2024-05-02 09:58:00 +00:00
|
|
|
filterRule: 'p-datatable-filter-rule',
|
2024-05-06 15:23:01 +00:00
|
|
|
pcFilterConstraintDropdown: 'p-datatable-filter-constraint-dropdown',
|
|
|
|
pcFilterRemoveRuleButton: 'p-datatable-filter-remove-rule-button',
|
2024-05-12 23:28:17 +00:00
|
|
|
pcFilterAddRuleButton: 'p-datatable-filter-add-rule-button',
|
2024-04-28 21:54:19 +00:00
|
|
|
filterButtonbar: 'p-datatable-filter-buttonbar',
|
2024-05-06 15:23:01 +00:00
|
|
|
pcFilterClearButton: 'p-datatable-filter-clear-button',
|
|
|
|
pcFilterApplyButton: 'p-datatable-filter-apply-button',
|
2023-10-02 10:46:09 +00:00
|
|
|
tbody: ({ props }) => (props.frozenRow ? 'p-datatable-tbody p-datatable-frozen-tbody' : 'p-datatable-tbody'),
|
2024-05-02 09:58:00 +00:00
|
|
|
rowGroupHeader: 'p-datatable-row-group-header',
|
|
|
|
rowToggleButton: 'p-datatable-row-toggle-button',
|
|
|
|
rowToggleIcon: 'p-datatable-row-toggle-icon',
|
2024-02-02 20:17:35 +00:00
|
|
|
row: ({ instance, props, index, columnSelectionMode }) => {
|
2023-10-02 10:46:09 +00:00
|
|
|
let rowStyleClass = [];
|
|
|
|
|
|
|
|
if (props.selectionMode) {
|
2024-04-28 21:54:19 +00:00
|
|
|
rowStyleClass.push('p-datatable-selectable-row');
|
2023-10-02 10:46:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (props.selection) {
|
|
|
|
rowStyleClass.push({
|
2024-04-28 21:54:19 +00:00
|
|
|
'p-datatable-row-selected': columnSelectionMode ? instance.isSelected && instance.$parentInstance.$parentInstance.highlightOnSelect : instance.isSelected
|
2023-10-02 10:46:09 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
if (props.contextMenuSelection) {
|
|
|
|
rowStyleClass.push({
|
2024-04-28 21:54:19 +00:00
|
|
|
'p-datatable-contextmenu-row-selected': instance.isSelectedWithContextMenu
|
2023-10-02 10:46:09 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2023-12-20 11:51:03 +00:00
|
|
|
rowStyleClass.push(index % 2 === 0 ? 'p-row-even' : 'p-row-odd');
|
|
|
|
|
2023-10-02 10:46:09 +00:00
|
|
|
return rowStyleClass;
|
|
|
|
},
|
|
|
|
rowExpansion: 'p-datatable-row-expansion',
|
2024-05-02 09:58:00 +00:00
|
|
|
rowGroupFooter: 'p-datatable-row-group-footer',
|
2024-04-29 09:00:43 +00:00
|
|
|
emptyMessage: 'p-datatable-empty-message',
|
2023-10-02 10:46:09 +00:00
|
|
|
bodyCell: ({ instance }) => [
|
|
|
|
{
|
2024-04-28 21:54:19 +00:00
|
|
|
'p-datatable-frozen-column': instance.columnProp('frozen')
|
2023-10-02 10:46:09 +00:00
|
|
|
}
|
|
|
|
],
|
2024-05-02 09:58:00 +00:00
|
|
|
reorderableRowHandle: 'p-datatable-reorderable-row-handle',
|
2024-05-06 15:23:01 +00:00
|
|
|
pcRowEditorInit: 'p-datatable-row-editor-init',
|
|
|
|
pcRowEditorSave: 'p-datatable-row-editor-save',
|
|
|
|
pcRowEditorCancel: 'p-datatable-row-editor-cancel',
|
2023-10-02 10:46:09 +00:00
|
|
|
tfoot: 'p-datatable-tfoot',
|
|
|
|
footerCell: ({ instance }) => [
|
|
|
|
{
|
2024-04-28 21:54:19 +00:00
|
|
|
'p-datatable-frozen-column': instance.columnProp('frozen')
|
2023-10-02 10:46:09 +00:00
|
|
|
}
|
|
|
|
],
|
|
|
|
virtualScrollerSpacer: 'p-datatable-virtualscroller-spacer',
|
|
|
|
footer: 'p-datatable-footer',
|
2024-05-02 09:58:00 +00:00
|
|
|
columnResizeIndicator: 'p-datatable-column-resize-indicator',
|
|
|
|
rowReorderIndicatorUp: 'p-datatable-row-reorder-indicator-up',
|
|
|
|
rowReorderIndicatorDown: 'p-datatable-row-reorder-indicator-down'
|
2023-10-02 10:46:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const inlineStyles = {
|
2024-05-02 09:58:00 +00:00
|
|
|
tableContainer: { overflow: 'auto' },
|
2023-10-02 10:46:09 +00:00
|
|
|
thead: { position: 'sticky' },
|
|
|
|
tfoot: { position: 'sticky' }
|
|
|
|
};
|
|
|
|
|
|
|
|
export default BaseStyle.extend({
|
|
|
|
name: 'datatable',
|
2024-05-01 08:26:48 +00:00
|
|
|
theme,
|
2023-10-02 10:46:09 +00:00
|
|
|
classes,
|
|
|
|
inlineStyles
|
|
|
|
});
|