@@ -214,42 +262,66 @@ exports[`DomainFieldsDisplay without title 1`] = `
draggable="false"
id="name"
>
- Name
+
+ Name
+
diff --git a/packages/components/src/internal/components/domainproperties/models.tsx b/packages/components/src/internal/components/domainproperties/models.tsx
index 50326689f3..67b8b21cb8 100644
--- a/packages/components/src/internal/components/domainproperties/models.tsx
+++ b/packages/components/src/internal/components/domainproperties/models.tsx
@@ -494,7 +494,6 @@ export class DomainDesign
const selectionCol = new GridColumn({
index: GRID_SELECTION_INDEX,
title: GRID_SELECTION_INDEX,
- width: 20,
cell: (data, row) => {
const domainIndex = row.get('domainIndex');
const fieldIndex = row.get('fieldIndex');
diff --git a/packages/components/src/internal/components/editable/EditableGrid.tsx b/packages/components/src/internal/components/editable/EditableGrid.tsx
index c37f4a25b7..df7b9426de 100644
--- a/packages/components/src/internal/components/editable/EditableGrid.tsx
+++ b/packages/components/src/internal/components/editable/EditableGrid.tsx
@@ -27,6 +27,7 @@ import {
CELL_SELECTION_HANDLE_CLASSNAME,
GRID_CHECKBOX_OPTIONS,
GRID_EDIT_INDEX,
+ GRID_HEADER_CELL_BODY,
GRID_SELECTION_INDEX,
MAX_EDITABLE_GRID_ROWS,
} from '../../constants';
@@ -98,10 +99,6 @@ function moveUp(colIdx: number, rowIdx: number): CellCoordinates {
return { colIdx, rowIdx: rowIdx - 1 };
}
-function hasCellWidthOverride(metadata: EditableColumnMetadata): boolean {
- return !!metadata?.minWidth || !!metadata?.width;
-}
-
function computeSelectionCellKeys(
editorModel: EditorModel,
minColIdx: number,
@@ -144,12 +141,9 @@ const COUNT_COL = new GridColumn({
index: GRID_EDIT_INDEX,
tableCell: true,
title: 'Row',
- width: 45,
- // style cast to "any" type due to @types/react@16.3.14 switch to csstype package usage which does not declare
- // "textAlign" property correctly for elements.
cell: (d, r, c, rn) => (
- |
- {rn + 1}
+ |
+ {rn + 1}
|
),
});
@@ -184,8 +178,6 @@ function inputCellFactory(
const { isReadonlyCell, isReadonlyRow } = editorModel.getCellReadStatus(fieldKey, rowIdx, readonlyRows);
const rowContainer = editorModel.getFolderValueForRow(rowIdx);
const focused = editorModel.isFocused(colIdx, rowIdx);
- const className = classNames({ 'grid-col-with-width': hasCellWidthOverride(columnMetadata) });
- const style = { textAlign: columnMetadata?.align ?? c.align ?? 'left' } as any;
// If we're updating then we want to use the container path from each row if present
if (forUpdate && rowContainer) containerPath = rowContainer;
@@ -225,7 +217,7 @@ function inputCellFactory(
}
return (
-
+ |
| {
const qCol = editorModel.columnMap.get(fieldKey);
const metadata = editorModel.getColumnMetadata(qCol.fieldKey);
- let width = 100;
- let fixedWidth;
- if (hasCellWidthOverride(metadata)) {
- fixedWidth = metadata.width;
- if (!fixedWidth) {
- width = metadata.minWidth;
- }
- }
const hideTooltip = metadata?.hideTitleTooltip ?? qCol.hasHelpTipData;
gridColumns = gridColumns.push(
new GridColumn({
@@ -878,10 +862,8 @@ export class EditableGrid extends PureComponent
+
{!showLabelOverlay && (
<>
{label}
@@ -927,7 +909,7 @@ export class EditableGrid extends PureComponent
)}
- >
+
);
};
@@ -1589,7 +1571,6 @@ export class EditableGrid extends PureComponent
custom column headers 1`] = `
class="grid-messages"
/>
@@ -34,21 +34,33 @@ exports[` custom column headers 1`] = `
draggable="false"
id="col1"
>
- First Column
+
+ First Column
+
@@ -57,57 +69,93 @@ exports[` custom column headers 1`] = `
class="grid-row-alternate"
>
- abc
+
+ abc
+
|
- 123
+
+ 123
+
|
- 2019-01-01
+
+ 2019-01-01
+
|
|
- def
+
+ def
+
|
- 456
+
+ 456
+
|
- 2019-01-02
+
+ 2019-01-02
+
|
|
- ghi
+
+ ghi
+
|
- 789
+
+ 789
+
|
- 2019-01-03
+
+ 2019-01-03
+
|
@@ -142,7 +190,7 @@ exports[` custom header and info message 1`] = `
class="grid-messages"
/>
@@ -151,21 +199,33 @@ exports[` custom header and info message 1`] = `
draggable="false"
id="col1"
>
- col1
+
+ col1
+
@@ -174,57 +234,93 @@ exports[` custom header and info message 1`] = `
class="grid-row-alternate"
>
- abc
+
+ abc
+
|
- 123
+
+ 123
+
|
- 2019-01-01
+
+ 2019-01-01
+
|
|
- def
+
+ def
+
|
- 456
+
+ 456
+
|
- 2019-01-02
+
+ 2019-01-02
+
|
|
- ghi
+
+ ghi
+
|
- 789
+
+ 789
+
|
- 2019-01-03
+
+ 2019-01-03
+
|
@@ -280,7 +376,7 @@ exports[` no data 1`] = `
class="grid-messages"
/>
@@ -326,7 +422,7 @@ exports[` one row of data 1`] = `
class="grid-messages"
/>
@@ -335,7 +431,11 @@ exports[` one row of data 1`] = `
draggable="false"
id="test"
>
- test
+
+ test
+
@@ -344,9 +444,13 @@ exports[` one row of data 1`] = `
class="grid-row-alternate"
>
- 123
+
+ 123
+
|
@@ -386,7 +490,7 @@ exports[` previewData.warningMsg 1`] = `
class="grid-messages"
/>
@@ -395,21 +499,33 @@ exports[` previewData.warningMsg 1`] = `
draggable="false"
id="col1"
>
- col1
+
+ col1
+
@@ -418,57 +534,93 @@ exports[` previewData.warningMsg 1`] = `
class="grid-row-alternate"
>
- abc
+
+ abc
+
|
- 123
+
+ 123
+
|
- 2019-01-01
+
+ 2019-01-01
+
|
|
- def
+
+ def
+
|
- 456
+
+ 456
+
|
- 2019-01-02
+
+ 2019-01-02
+
|
|
- ghi
+
+ ghi
+
|
- 789
+
+ 789
+
|
- 2019-01-03
+
+ 2019-01-03
+
|
@@ -502,7 +654,7 @@ exports[` three rows of data 1`] = `
class="grid-messages"
/>
@@ -511,21 +663,33 @@ exports[` three rows of data 1`] = `
draggable="false"
id="col1"
>
- col1
+
+ col1
+
@@ -534,57 +698,93 @@ exports[` three rows of data 1`] = `
class="grid-row-alternate"
>
- abc
+
+ abc
+
|
- 123
+
+ 123
+
|
- 2019-01-01
+
+ 2019-01-01
+
|
|
- def
+
+ def
+
|
- 456
+
+ 456
+
|
- 2019-01-02
+
+ 2019-01-02
+
|
|
- ghi
+
+ ghi
+
|
- 789
+
+ 789
+
|
- 2019-01-03
+
+ 2019-01-03
+
|
@@ -624,7 +824,7 @@ exports[` warning message 1`] = `
class="grid-messages"
/>
@@ -633,21 +833,33 @@ exports[` warning message 1`] = `
draggable="false"
id="col1"
>
- col1
+
+ col1
+
@@ -656,57 +868,93 @@ exports[` warning message 1`] = `
class="grid-row-alternate"
>
- abc
+
+ abc
+
|
- 123
+
+ 123
+
|
- 2019-01-01
+
+ 2019-01-01
+
|
|
- def
+
+ def
+
|
- 456
+
+ 456
+
|
- 2019-01-02
+
+ 2019-01-02
+
|
|
- ghi
+
+ ghi
+
|
- 789
+
+ 789
+
|
- 2019-01-03
+
+ 2019-01-03
+
|
@@ -752,7 +1000,7 @@ exports[` warning message and previewData.warningMsg 1`] = `
class="grid-messages"
/>
@@ -761,21 +1009,33 @@ exports[` warning message and previewData.warningMsg 1`] = `
draggable="false"
id="col1"
>
- col1
+
+ col1
+
@@ -784,57 +1044,93 @@ exports[` warning message and previewData.warningMsg 1`] = `
class="grid-row-alternate"
>
- abc
+
+ abc
+
|
- 123
+
+ 123
+
|
- 2019-01-01
+
+ 2019-01-01
+
|
|
- def
+
+ def
+
|
- 456
+
+ 456
+
|
- 2019-01-02
+
+ 2019-01-02
+
|
|
- ghi
+
+ ghi
+
|
- 789
+
+ 789
+
|
- 2019-01-03
+
+ 2019-01-03
+
|
diff --git a/packages/components/src/internal/components/lineage/constants.tsx b/packages/components/src/internal/components/lineage/constants.tsx
index 9d7f3280cb..7f9598d92d 100644
--- a/packages/components/src/internal/components/lineage/constants.tsx
+++ b/packages/components/src/internal/components/lineage/constants.tsx
@@ -40,7 +40,6 @@ export const LINEAGE_GRID_COLUMNS = List([
new GridColumn({
index: 'name',
title: 'ID',
- width: 270,
cell: (name: string, node: Map) => {
const indent = node.get('distance') * 10;
const dupeCount = node.get('duplicateCount');
@@ -70,7 +69,6 @@ export const LINEAGE_GRID_COLUMNS = List([
new GridColumn({
index: 'distance',
title: 'Distance',
- width: 60,
cell: (distance: any, node: Map) => {
const gen = distance > 1 ? ' generations' : ' generation';
@@ -86,7 +84,6 @@ export const LINEAGE_GRID_COLUMNS = List([
new GridColumn({
index: 'lsid',
title: 'Change Seed',
- width: 70,
cell: (lsid: string, node: Map) => {
const lineageDistance = node.get('lineageDistance');
const baseURL = AppURL.create('lineage').addParams({
diff --git a/packages/components/src/internal/renderers.tsx b/packages/components/src/internal/renderers.tsx
index 31ce9fbe74..091713a66c 100644
--- a/packages/components/src/internal/renderers.tsx
+++ b/packages/components/src/internal/renderers.tsx
@@ -203,15 +203,16 @@ const HeaderCellDropdownMenu: FC = memo(props => {
let left;
if (toggleEl.current && menuEl.current) {
- const headerRect = toggleEl.current.parentElement.getBoundingClientRect();
+ // The third parentElement is the element, and we want to pin the menu to the bottom of that
+ const headerRect = toggleEl.current.parentElement.parentElement.parentElement.getBoundingClientRect();
const menuRect = menuEl.current.getBoundingClientRect();
- left = headerRect.x - menuRect.width + 18 + 'px';
- top = headerRect.y + headerRect.height + 5 + 'px';
+ left = headerRect.right - menuRect.width + 'px';
+ top = headerRect.bottom + 'px';
// Issue 45553
// Render the dropdown menu above the header if the header is too close to the bottom of the screen.
if (headerRect.bottom + menuRect.height > window.innerHeight) {
- top = headerRect.y - menuRect.height - 10 + 'px';
+ top = headerRect.top - menuRect.height - 10 + 'px';
}
}
@@ -329,7 +330,7 @@ const HeaderCellDropdownMenu: FC = memo(props => {
);
return (
-
+
{/* Note: we don't need a click handler on this icon because there is one on the wrapping div above */}
{createPortal(body, portalRef)}
@@ -401,7 +402,7 @@ export const HeaderCellDropdown: FC = memo(props => {
return (
-
+
= memo(props => {
)}
-
+
{includeDropdown && !editingTitle && (
= memo(({ col, data, noLink }) => {
let display = null;
let style;
- // Issue 43474: Prevent text wrapping for date columns
- const noWrap = col?.jsonType === 'date' || col?.jsonType === 'time';
- // Issue 36941: when using the default renderer, add css so that line breaks as preserved
- let className = noWrap ? 'ws-no-wrap' : 'ws-pre-wrap';
if (data) {
if (typeof data === 'string') {
@@ -55,15 +51,15 @@ export const DefaultRenderer: FC = memo(({ col, data, noLink }) => {
display = data ? 'true' : 'false';
} else if (List.isList(data)) {
// defensively return a MultiValueRenderer, this column likely wasn't declared properly as "multiValue"
- return ;
+ return ;
} else if (col?.isFileInput) {
return ;
- }
- else {
+ } else {
+ let className: string;
if (isConditionalFormattingEnabled()) {
style = getDataStyling(data);
if (style?.backgroundColor) {
- className += ' status-pill';
+ className = 'status-pill';
}
}
if (data.has('formattedValue')) {
@@ -83,14 +79,18 @@ export const DefaultRenderer: FC = memo(({ col, data, noLink }) => {
);
}
+
+ if (style !== undefined) {
+ return (
+
+ {display}
+
+ );
+ }
}
}
- return (
-
- {display}
-
- );
+ return display;
});
DefaultRenderer.displayName = 'DefaultRenderer';
diff --git a/packages/components/src/internal/renderers/ExpirationDateColumnRenderer.tsx b/packages/components/src/internal/renderers/ExpirationDateColumnRenderer.tsx
index 1db192fafa..fde74dfa92 100644
--- a/packages/components/src/internal/renderers/ExpirationDateColumnRenderer.tsx
+++ b/packages/components/src/internal/renderers/ExpirationDateColumnRenderer.tsx
@@ -5,11 +5,12 @@ import classNames from 'classnames';
import { QueryColumn } from '../../public/QueryColumn';
import { isDateTimeInPast } from '../util/Date';
+import { getTextAlignClassName } from '../components/base/models/GridColumn';
export interface ExpirationDateColumnRendererProps {
col?: QueryColumn;
columnIndex?: number;
- data: Map | { [key: string]: any };
+ data: Map | Record;
tableCell?: boolean;
}
@@ -35,19 +36,10 @@ export const ExpirationDateColumnRenderer: FC
if (tableCell) {
return (
-
- {displayValue}
-
+ {displayValue}
|
);
}
diff --git a/packages/components/src/internal/renderers/StorageStatusRenderer.tsx b/packages/components/src/internal/renderers/StorageStatusRenderer.tsx
index 217ea3b903..a00348e28f 100644
--- a/packages/components/src/internal/renderers/StorageStatusRenderer.tsx
+++ b/packages/components/src/internal/renderers/StorageStatusRenderer.tsx
@@ -14,7 +14,7 @@ export class StorageStatusRenderer extends React.PureComponent{value};
+ return value;
} else {
return {value};
}
diff --git a/packages/components/src/internal/renderers/__snapshots__/DefaultRenderer.test.tsx.snap b/packages/components/src/internal/renderers/__snapshots__/DefaultRenderer.test.tsx.snap
index 7dea3529a8..e8623305a9 100644
--- a/packages/components/src/internal/renderers/__snapshots__/DefaultRenderer.test.tsx.snap
+++ b/packages/components/src/internal/renderers/__snapshots__/DefaultRenderer.test.tsx.snap
@@ -2,31 +2,19 @@
exports[`DefaultRenderer boolean 1`] = `
-
- true
-
+ true
`;
exports[`DefaultRenderer displayValue 1`] = `
-
- Value 1
-
+ Value 1
`;
exports[`DefaultRenderer formattedValue 1`] = `
-
- Value 1.00
-
+ Value 1.00
`;
@@ -46,37 +34,22 @@ exports[`DefaultRenderer list 1`] = `
exports[`DefaultRenderer new line 1`] = `
-
- test1
+ test1
test2
-
`;
exports[`DefaultRenderer string 1`] = `
-
- test string
-
+ test string
`;
-exports[`DefaultRenderer undefined 1`] = `
-
-
-
-`;
+exports[`DefaultRenderer undefined 1`] = ` `;
exports[`DefaultRenderer url 1`] = `
Value 1
@@ -86,28 +59,20 @@ exports[`DefaultRenderer url 1`] = `
exports[`DefaultRenderer url, but noLink 1`] = `
-
- Value 1
-
+ Value 1
`;
exports[`DefaultRenderer value 1`] = `
-
- 1
-
+ 1
`;
exports[`DefaultRenderer with style, conditional formatting enabled 1`] = `
Value 1.00
@@ -117,10 +82,6 @@ exports[`DefaultRenderer with style, conditional formatting enabled 1`] = `
exports[`DefaultRenderer with style, conditional formatting not enabled 1`] = `
-
- Value 1.00
-
+ Value 1.00
`;
diff --git a/packages/components/src/public/QueryModel/GridPanel.tsx b/packages/components/src/public/QueryModel/GridPanel.tsx
index 1586085ea5..b3c3ab5178 100644
--- a/packages/components/src/public/QueryModel/GridPanel.tsx
+++ b/packages/components/src/public/QueryModel/GridPanel.tsx
@@ -1057,8 +1057,6 @@ export class GridPanel extends PureComponent, State> {
const {
actions,
allowSelections,
- allowFiltering,
- allowSorting,
allowViewCustomization,
hasHeader,
asPanel,
@@ -1176,7 +1174,6 @@ export class GridPanel extends PureComponent, State> {
{hasData && (
.expired-grid-cell-content {
padding: 5px;
background-image: linear-gradient(225deg, red, red 5px, transparent 5px, transparent);
+ white-space: nowrap;
}
td > .expired-form-field {
@@ -643,3 +645,30 @@ td > .expired-form-field {
scroll-margin: 0;
}
}
+
+.text-left {
+ text-align: left;
+}
+.text-right {
+ text-align: right;
+}
+.text-center {
+ text-align: center;
+}
+
+.read-only-table td,
+.read-only-table th {
+ white-space: pre-wrap; // pre-wrap for multiline column cells
+ vertical-align: top;
+}
+
+.read-only-table .table-cell-content {
+ // min-width: 100% is needed to ensure that table-cell-content will always fill the available space, otherwise it
+ // will only get as wide as the content, which negates the right-aligned style we give for numbers.
+ min-width: 100%;
+ max-width: 300px;
+ // width: max-content makes the table-cell-content elements grow as wide as their content will allow, up to 300px,
+ // which is the behavior we want, instead of the typical table layout algorithm.
+ width: max-content;
+ word-break: break-word;
+}
diff --git a/packages/components/src/theme/query-model.scss b/packages/components/src/theme/query-model.scss
index 63e347dec3..88ce10f853 100644
--- a/packages/components/src/theme/query-model.scss
+++ b/packages/components/src/theme/query-model.scss
@@ -269,7 +269,7 @@
}
.editable-grid__container.grid-panel__lock-left-with-countcol .table-responsive {
thead th:nth-child(2), tr td:nth-child(2) {
- left: 43px;
+ left: 35px;
}
}
| | |