Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

[terra-table] [terra-data-grid] Add column span functionality to FlowsheetDataGrid and Table #2096

Merged
merged 53 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
630224c
Add column span functionality to FlowsheetDataGrid and Table
Mar 20, 2024
e97f173
Disable column highlighting for columns with columnspan greater than 1
Mar 20, 2024
98f046a
Cover an edge case for columnSpan defined as 1
Mar 20, 2024
f28d1bc
Add changelogs, Fix lint errors
Mar 20, 2024
756cbf5
Add WDIO tests, code cleanup
Mar 21, 2024
fe9b4ce
Fix lint errors
Mar 21, 2024
a223d2b
Update snapshots, code cleanup
Mar 21, 2024
c38a2a2
Update data grid changelog
Mar 21, 2024
9c5546b
Update docs
Mar 21, 2024
3ed8202
Merge branch 'main' into fdg-column-span
nikhitasharma Mar 21, 2024
6720132
Fix lint
Mar 21, 2024
c620ad7
Update Actions column header to support column span
Mar 21, 2024
6fd4f66
Update packages/terra-framework-docs/src/terra-dev-site/doc/data-grid…
nikhitasharma Mar 21, 2024
67929c5
Keyboard navigation, multi select and pinned columns css updates
Apr 5, 2024
cb3d7e1
Merge branch 'fdg-column-span' of https://github.com/cerner/terra-fra…
Apr 5, 2024
087ab29
Update docs
Apr 5, 2024
5de78ec
Resolve lint errors
Apr 5, 2024
80f29ed
Support pinned column with columnspans, fix scroll issues, update sna…
Apr 8, 2024
5cf6bf1
Merge branch 'main' of https://github.com/cerner/terra-framework into…
Apr 8, 2024
f791a65
Update snapshots
Apr 8, 2024
744c0c1
Fix jest tests
Apr 8, 2024
31e55a1
Resolve lint errors
Apr 8, 2024
3c86491
Resolve review comments
Apr 9, 2024
3edd3cc
Resolve comments, fix lint errors
Apr 9, 2024
266e7d0
Add example for Column Span with Header Actions
Apr 10, 2024
426e523
Merge remote-tracking branch 'origin' into fdg-column-span
cm9361 Apr 11, 2024
61ce095
Resolve column header selection via keyboard navigation
cm9361 Apr 11, 2024
71e1d4d
Resolve Home and End key navigation issue
Apr 11, 2024
6a79a4f
Fix navigation with column header action rows.
cm9361 Apr 11, 2024
aabecaa
Merge branch 'fdg-column-span' of https://github.com/cerner/terra-fra…
cm9361 Apr 11, 2024
b7cf09c
Remove redundant code, Update home and end key logic
Apr 11, 2024
6be0629
Merge branch 'fdg-column-span' of https://github.com/cerner/terra-fra…
Apr 11, 2024
c602d3c
Update focus logic when tabbing in and out of DataGrid
Apr 11, 2024
9da0845
Resolve review comments
Apr 12, 2024
6882e7d
Update snapshots
Apr 12, 2024
0f2522d
Resolve review comments
Apr 15, 2024
8915402
Reorganize column span code to Table level
Apr 15, 2024
a893464
Flowsheet level ref updates, code cleanup
Apr 15, 2024
d6218c8
Merge branch 'main' of https://github.com/cerner/terra-framework into…
Apr 15, 2024
e149624
Resolve lint errors
Apr 15, 2024
2f3b688
Fix navigation between sections, add resizable columns table example …
Apr 16, 2024
9ee2636
Resolve lint errors
Apr 16, 2024
b3eeed3
Add new tests, examples, update snapshots
Apr 16, 2024
a162cdc
Resolve lint errors
Apr 16, 2024
ea931f3
Fix changelog entries
Apr 16, 2024
a49419c
Update snapshots
Apr 16, 2024
e25f2a4
Update table column span snapshots
Apr 16, 2024
6e49847
Add columnSpanIndex info to callbacks
Apr 16, 2024
f2a16e9
Fix Column Span Actions examples and tests
Apr 16, 2024
5a7fc6e
Resolve lint error
Apr 16, 2024
6f09b55
Update jest snapshot
Apr 16, 2024
8f731e0
Resolve lint error
Apr 16, 2024
e3bb148
Update Column Span actions wdio snapshots
Apr 16, 2024
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
34 changes: 17 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions packages/terra-data-grid/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

* Added
* Added column span functionality to FlowsheetDataGrid.

## 1.21.0 - (March 19, 2024)

* Removed
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions packages/terra-data-grid/tests/wdio/flowsheet-data-grid-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,18 @@ Terra.describeViewports('FlowsheetDataGrid', ['medium', 'large'], () => {
});
});

describe('flowsheet data grid with column span', () => {
before(() => {
browser.url('/raw/tests/cerner-terra-framework-docs/data-grid/flowsheet-data-grid/flowsheet-with-column-span');
});

it('renders a flowsheet data grid with column span', () => {
browser.keys(['Tab']); // Cell 0,0 gets focus
expect(browser.$('[class*="column-header-row"] th:nth-child(1)').isFocused()).toBe(true);
Terra.validates.element('flowsheet-with-column-span', { selector: '#flowsheet-with-column-span' });
});
});

describe('flowsheet data grid with no column headers', () => {
before(() => {
browser.url('/raw/tests/cerner-terra-framework-docs/data-grid/flowsheet-data-grid/column-headers-hidden');
Expand Down
3 changes: 3 additions & 0 deletions packages/terra-framework-docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

* Added
* Added examples for column span support in Flowsheet Data Grid and `terra-table`.

* Changed
* Updated `terra-navigation-side-menu` example.
* Updated single row selection example of `terra-table`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ See [keyboard interactions](/components/cerner-terra-framework-docs/data-grid/fl
* [Row selection](/components/cerner-terra-framework-docs/data-grid/flowsheet-data-grid/examples/row-selection)
* [Sections](/components/cerner-terra-framework-docs/data-grid/flowsheet-data-grid/examples/flowsheet-with-sections)
* [Headerless Flowsheet](/components/cerner-terra-framework-docs/data-grid/flowsheet-data-grid/examples/column-headers-hidden)
* [Column Highlighting](/components/cerner-terra-framework-docs/data-grid/flowsheet-data-grid/examples/column-highlight-orange-green)
* [Column Span](/components/cerner-terra-framework-docs/data-grid/flowsheet-data-grid/examples/flowsheet-with-column-span)

## Examples
|Link to Example| Description|
Expand All @@ -46,6 +48,7 @@ See [keyboard interactions](/components/cerner-terra-framework-docs/data-grid/fl
|[Flowsheet Data Grid with Sections](/components/cerner-terra-framework-docs/data-grid/flowsheet-data-grid/examples/flowsheet-with-sections)|An example demonstrating how to create a Flowsheet Data Grid with sections.|
|[ColumnHighlightOrangeGreen](/components/cerner-terra-framework-docs/data-grid/flowsheet-data-grid/examples/column-highlight-orange-green)|Examples of the Flowsheet Data Grid with orange and green column highlighting.|
|[MultiColumnHighlight](/components/cerner-terra-framework-docs/data-grid/flowsheet-data-grid/examples/multi-column-highlight)|An example of the Flowsheet Data Grid with multi-column highlighting.|
|[Flowsheet Data Grid with Column Span](/components/cerner-terra-framework-docs/data-grid/flowsheet-data-grid/examples/flowsheet-with-column-span)|An example of Flowsheet Data Grid with column span.|

## Accessibility
### Keyboard Interactions
Expand Down Expand Up @@ -135,6 +138,8 @@ A column specifies the data to render a cell in the header row of the Flowsheet
|**width**|number|optional|none|A number (in px) specifying the width of the column. If not provided, the Data Grid's default column width is used.|
|**columnHighlightColor**|`enum: ["green", "orange"]`|optional|none|The color to be used for highlighting a column.|
|**columnHighlightDescription**|string|optional|none|The information to be conveyed to screen readers about the highlighted column.|
|**columnSpan**|number|optional|none|Number that specifies the column span value for a column.|


### Rows
Rows define the cells rendered in the row and the row's selection properties.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import FlowsheetDataGridWithColumnSpan from './FlowsheetDataGridWithColumnSpan?dev-site-example';

# Flowsheet Data Grid With Column Span

### Description

This example demonstrates a [Flowsheet Data Grid](/components/cerner-terra-framework-docs/data-grid/flowsheet-data-grid/about) with column span support.

<FlowsheetDataGridWithColumnSpan title='Flowsheet Data Grid With Column Span' />

Note: Column Highlighting functionality will not be supported for columns with column span.
nikhitasharma marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
import React from 'react';
import { FlowsheetDataGrid } from 'terra-data-grid';

const gridDataJSON = {
cols: [
{ id: 'Column-0', displayName: 'Vitals' },
{ id: 'Column-1', displayName: 'March 16', columnSpan: 2 },
{ id: 'Column-2', displayName: 'March 17', columnSpan: 3 },
{ id: 'Column-3', displayName: 'March 18' },
],
rows: [
{
id: '1',
cells: [
{ content: 'Heart Rate Monitored (bpm)' },
{ content: '68' },
{ content: '69' },
{ content: '66' },
{ content: '68' },
{ content: '69' },
{ content: '67' },
],
},
{
id: '2',
cells: [
{ content: 'Temperature Oral (degC)' },
{ content: '36.7' },
{ content: '36.9' },
{ content: '36.7' },
{ content: '37' },
{ content: '36.7' },
{ content: '37' },
],
},
{
id: '3',
cells: [
{ content: 'Cardiac Index (L/min/m2)' },
{ content: '2.25' },
{ content: '2.28' },
{ content: '2.25' },
{ content: '2.8' },
{ content: '2.25' },
{ content: '2.8' },
],
},
{
id: '4',
cells: [
{ content: 'ICP (mmHg)' },
{ content: '11' },
{ content: '12' },
{ content: '11' },
{ content: '12' },
{ content: '13' },
{ content: '14' },
],
},
{
id: '5',
cells: [
{ content: 'CPP (mmHg)' },
{ content: '63' },
{ content: '47' },
{ content: '63' },
{ content: '48' },
{ content: '63' },
{ content: '47' },
],
},
],
};

const FlowsheetDataGridWithColumnSpan = () => {
const { cols, rows } = gridDataJSON;

return (
<FlowsheetDataGrid
id="default-terra-flowsheet-data-grid"
columns={cols}
rows={rows}
ariaLabel="Flowsheet Data Grid"
/>
);
};

export default FlowsheetDataGridWithColumnSpan;
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ This example demonstrates a [Flowsheet Data Grid](/components/cerner-terra-frame
- `columnHighlightDescription` can be used to provide context regarding the highlighted column to screen readers.

<FlowsheetSectionsWithColHighlight />

Note: Column Highlighting functionality will not be supported for columns with column span.
nikhitasharma marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ Below are the attributes used for column highlighting.


<MultiColumnHighlight title='Flowsheet Data Grid with orange and green column highlight' />

Note: Column Highlighting functionality will not be supported for columns with column span.

Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ See the following example of a default table:
* [Headerless Table](/components/cerner-terra-framework-docs/table/examples/table-without-headers)
* [Column Sorting](/components/cerner-terra-framework-docs/table/examples/sortable-table)
* [Column Error Indicator](/components/cerner-terra-framework-docs/table/examples/table-column-states)
* [Column Span](/components/cerner-terra-framework-docs/table/examples/table-column-span)

## Examples
|Link to Example| Description|
Expand All @@ -56,6 +57,7 @@ See the following example of a default table:
|[Multiple Row Selection](/components/cerner-terra-framework-docs/table/examples/table-multiple-row-selection)|An example demonstrating a table with multiple row selection mode. Consumers control the selection state with the **onRowSelect** callback and **isSelected** row property.|
|[Table with Sections](/components/cerner-terra-framework-docs/table/examples/table-with-sections)|An example demonstrating how to create a table with sections.|
|[Table Without Headers](/components/cerner-terra-framework-docs/table/examples/table-without-headers)|An example demonstrating how to hide table column headers. The column headers still exist in the Document Object Model (DOM) for accessibility.|
|[Table with Column Span](/components/cerner-terra-framework-docs/table/examples/table-column-span)| An example demonstrating a table with column span.|

## Accessibility
### Keyboard Interactions
Expand Down Expand Up @@ -137,6 +139,7 @@ A column specifies the information to render a cell in the header row of the Wor
|**maximumWidth**|Number|Optional|None|A number that specifies the maximum column width in pixels.|
|**width**|number|Optional|None|A number that specifies the width of the column in pixels. If not provided, the Worklist Data Grid component's default column width is used.|
|**sortIndicator**|Custom|Optional|None|A string indicating which sorting indicator is rendered (`ascending` or `descending`). A sorting indicator is rendered only if a value is provided.
|**columnSpan**|number|Optional|None|A number that specifies the column span value for a column.|

### Section
<Notice variant="important" ariaLevel="2">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Badge } from "terra-table/package.json?dev-site-package";
import TableColumnSpan from "./TableColumnSpan?dev-site-example";

# Table With Column Span

### Description

This example demonstrates a [Table](/components/cerner-terra-framework-docs/table/about) with column span implementation.

<TableColumnSpan />
Loading
Loading