Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,6 @@ export function GenericNumberEditor({
value={effectiveValue}
onValueChange={(e: any) => options.editorCallback(e.value)}
className={`w-full ${className} p-inputtext-sm`}
inputStyle={{ padding: '0.25rem' }}
onKeyDown={handleGridEditorKeyDown}
disabled={isDisabled}
autoFocus={!isDisabled}
Expand Down
22 changes: 20 additions & 2 deletions packages/react-model-ui/src/views/common/PrimeDataGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1195,7 +1195,16 @@ export function PrimeDataGrid<T extends Record<string, any>>({
resizableColumns={resizableColumns}
columnResizeMode={columnResizeMode}
>
{onSelectionChange !== undefined && <Column selectionMode='multiple' style={{ width: '3rem' }} />}
{onSelectionChange !== undefined && (
<Column
selectionMode='multiple'
style={{ width: '3rem' }}
bodyClassName={(rowData: T) => {
const rowKey = rowData[keyField];
return editingRows && rowKey !== undefined && editingRows[rowKey] ? 'p-cell-editing' : '';
}}
/>
)}
{columns.map(col => {
const filter = col.filter ?? col.filterType !== undefined;
const showFilterMatchModes = col.showFilterMatchModes === undefined ? col.filterType === 'text' : col.showFilterMatchModes;
Expand Down Expand Up @@ -1224,7 +1233,16 @@ export function PrimeDataGrid<T extends Record<string, any>>({
);
})}
{(onRowDelete || editable) && (
<Column header='Actions' rowEditor={editable && !readonly} body={allActionsTemplate} style={{ width: '10rem' }} />
<Column
header='Actions'
rowEditor={editable && !readonly}
body={allActionsTemplate}
style={{ width: '10rem' }}
bodyClassName={(rowData: T) => {
const rowKey = rowData[keyField];
return editingRows && rowKey !== undefined && editingRows[rowKey] ? 'p-cell-editing' : '';
}}
/>
)}
</DataTableComponent>
</div>
Expand Down
20 changes: 5 additions & 15 deletions packages/react-model-ui/style/primereact-overrides.css
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@

/* DataGrid styles */
.p-datatable .p-datatable-tbody > tr > td {
border: 1px solid var(--surface-border);
border-width: 0 0 1px 0;
padding: 0.25rem;
padding-left: 0.5rem;
}
Expand Down Expand Up @@ -127,11 +129,6 @@
border: 0 none;
}

.p-datatable .p-datatable-tbody > tr > td {
border: 1px solid var(--surface-border);
border-width: 0 0 1px 0;
}

.p-datatable .p-datatable-tbody > tr:nth-child(even) {
background: var(--surface-hover);
}
Expand Down Expand Up @@ -379,6 +376,7 @@ body[class*='dark'] {
/* Form validation styles */
.p-error {
color: var(--theia-errorForeground);
margin: 0.25rem 0 0 0;
}

.p-invalid {
Expand Down Expand Up @@ -412,8 +410,8 @@ span.w-full.p-autocomplete {
}

.p-datatable .p-datatable-tbody > tr > td .p-row-action-button.p-button {
width: 1rem;
height: 1rem;
width: 1.3rem;
height: 1.3rem;
padding: 0;
border-radius: 50%;
color: #6b7280;
Expand Down Expand Up @@ -733,10 +731,6 @@ table[style*='position: fixed'] * {
height: 0.6rem;
}

.p-inputnumber-input {
padding-right: 1.5rem !important;
}

.grid-cell-container {
display: flex;
flex-direction: column;
Expand All @@ -750,7 +744,3 @@ table[style*='position: fixed'] * {
font-size: 0.75rem;
white-space: normal;
}

.p-datatable .p-datatable-tbody > tr > td {
vertical-align: top !important;
}
Loading