Skip to content
Open
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
6bc89b4
stash
mollykreis Mar 4, 2026
dbbb14f
working?
mollykreis Mar 4, 2026
385d887
a few improvements
mollykreis Mar 4, 2026
854200c
mostly working -- styling needs help
mollykreis Mar 6, 2026
fc68bfa
merge
hellovolcano May 20, 2026
1b99869
only make the pinned column sticky
hellovolcano May 21, 2026
c9aa786
Merge remote-tracking branch 'origin/main' into users/vgleason/pinned…
hellovolcano May 28, 2026
2d16e03
apply cell indent levels to first non-pinned column
hellovolcano May 28, 2026
355aa50
fix formatting issues
hellovolcano May 28, 2026
e2804b0
cleanup styles and stoybook
hellovolcano May 28, 2026
26e7717
fix test
hellovolcano May 28, 2026
a6ce5ba
restore accidental delition
hellovolcano May 28, 2026
62527b5
wrappers
hellovolcano May 28, 2026
e940d60
Change files
hellovolcano May 28, 2026
f474d84
add tests
hellovolcano May 28, 2026
17b823c
fix ordering of pinned column
hellovolcano May 28, 2026
f322f1c
make pinned an attribute
hellovolcano May 29, 2026
f5a00a4
fix for styling non-pinned chevron
hellovolcano May 29, 2026
4d57bc2
Merge branch 'main' into users/vgleason/pinned-column
hellovolcano May 29, 2026
22eedc5
fix hover/sticky group issue
hellovolcano Jun 1, 2026
e8ce8b0
Merge branch 'users/vgleason/pinned-column' of https://github.com/ni/…
hellovolcano Jun 1, 2026
9684cad
Merge branch 'main' into users/vgleason/pinned-column
hellovolcano Jun 1, 2026
f391277
Merge branch 'main' into users/vgleason/pinned-column
hellovolcano Jun 3, 2026
34444af
pinned to pin-location enum
hellovolcano Jun 5, 2026
fc63a79
fix blazor wrapper
hellovolcano Jun 15, 2026
869849d
adjust header layout to fix relative/sticky column position issue
hellovolcano Jun 15, 2026
28b27b2
fix storybook
hellovolcano Jun 15, 2026
5d97744
small storybook tweak
hellovolcano Jun 15, 2026
27807f2
fix storybook and add slight visual style
hellovolcano Jun 15, 2026
4781a66
Merge branch 'main' into users/vgleason/pinned-column
hellovolcano Jun 15, 2026
23de172
add more matrix tests and fix styling
hellovolcano Jun 16, 2026
e6aaf93
fix chromatic tests
hellovolcano Jun 16, 2026
0f86d08
breakup table to hopefully help load
hellovolcano Jun 16, 2026
a82664a
Change files
hellovolcano Jun 16, 2026
63fea2b
Update packages/storybook/src/nimble/table-column/base/table-column.s…
hellovolcano Jun 16, 2026
311919e
remove sticky position from group row
hellovolcano Jun 16, 2026
acb86d9
Merge branch 'users/vgleason/pinned-column' of https://github.com/ni/…
hellovolcano Jun 16, 2026
8abc316
remove not
hellovolcano Jun 16, 2026
9032a0b
rename method and add selection to matrix tests
hellovolcano Jun 16, 2026
0ba59fe
fix storybook
hellovolcano Jun 16, 2026
45390e2
add horizontal scroll tests
hellovolcano Jun 17, 2026
43ef8ad
PR feedback
hellovolcano Jun 17, 2026
f87910c
fix focus state for rows with pinned columns
hellovolcano Jun 17, 2026
f42d985
create pinnableColumn mixin
hellovolcano Jun 18, 2026
ca962bf
fix group row focus style
hellovolcano Jun 18, 2026
2e4d2e9
Change files
hellovolcano Jun 18, 2026
f45a930
Merge branch 'main' into users/vgleason/pinned-column
hellovolcano Jun 18, 2026
eb1755b
fix mixin implementation
hellovolcano Jun 18, 2026
a360a0c
PR feedback
hellovolcano Jun 18, 2026
14c26eb
lint
hellovolcano Jun 18, 2026
b9f28ce
PR feedback
hellovolcano Jun 18, 2026
8be620e
doesn't need to be a function
hellovolcano Jun 19, 2026
4e4dee9
Merge branch 'main' into users/vgleason/pinned-column
rajsite Jun 19, 2026
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
@@ -0,0 +1,7 @@
{
Comment thread
hellovolcano marked this conversation as resolved.
"type": "minor",
"comment": "add support for pinning table columns",
"packageName": "@ni/nimble-angular",
"email": "5265744+hellovolcano@users.noreply.github.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "add support for pinning table columns",
"packageName": "@ni/nimble-blazor",
"email": "5265744+hellovolcano@users.noreply.github.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
Comment thread
hellovolcano marked this conversation as resolved.
"type": "minor",
"comment": "add support for pinning table columns",
"packageName": "@ni/nimble-components",
"email": "5265744+hellovolcano@users.noreply.github.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "Add support for pinning the breakpoint column",
"packageName": "@ni/ok-blazor",
"email": "5265744+hellovolcano@users.noreply.github.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { NimbleTableModule } from '../../../table/nimble-table.module';
import { NimbleTableColumnMappingModule } from '../nimble-table-column-mapping.module';
import { NimbleTableColumnMappingDirective, type TableColumnMapping, TableColumnMappingWidthMode } from '../nimble-table-column-mapping.directive';
import { TableColumnSortDirection } from '../../nimble-table-column-base.directive';
import { TableColumnPinLocation, TableColumnSortDirection } from '../../nimble-table-column-base.directive';

describe('NimbleTableColumnMapping', () => {
describe('module', () => {
Expand All @@ -30,6 +30,7 @@ describe('NimbleTableColumnMapping', () => {
action-menu-slot="my-slot"
action-menu-label="my menu"
column-hidden="true"
pin-location="left"
fractional-width="2"
min-pixel-width="40"
sort-direction="${TableColumnSortDirection.ascending}"
Expand Down Expand Up @@ -93,6 +94,11 @@ describe('NimbleTableColumnMapping', () => {
expect(nativeElement.columnHidden).toBe(true);
});

it('will use template string value for pin-location', () => {
expect(directive.pinLocation).toBe(TableColumnPinLocation.left);
expect(nativeElement.pinLocation).toBe(TableColumnPinLocation.left);
});

it('will use template string values for sortDirection', () => {
expect(directive.sortDirection).toBe(TableColumnSortDirection.ascending);
expect(nativeElement.sortDirection).toBe(TableColumnSortDirection.ascending);
Expand Down Expand Up @@ -146,6 +152,7 @@ describe('NimbleTableColumnMapping', () => {
[actionMenuSlot]="actionMenuSlot"
[actionMenuLabel]="actionMenuLabel"
[column-hidden]="columnHidden"
[pin-location]="pinLocation"
[fractional-width]="fractionalWidth"
[min-pixel-width]="minPixelWidth"
[sort-direction]="sortDirection"
Expand All @@ -170,6 +177,7 @@ describe('NimbleTableColumnMapping', () => {
public minPixelWidth: number | null = 40;
public columnId = 'my-column';
public columnHidden = true;
public pinLocation: TableColumnPinLocation = TableColumnPinLocation.none;
public sortDirection: TableColumnSortDirection = TableColumnSortDirection.ascending;
public sortIndex: number | null = 0;
public sortingDisabled = false;
Expand Down Expand Up @@ -259,6 +267,17 @@ describe('NimbleTableColumnMapping', () => {
expect(nativeElement.columnHidden).toBe(false);
});

it('can be configured with property binding for pin-location', () => {
expect(directive.pinLocation).toBeUndefined();
expect(nativeElement.pinLocation).toBeUndefined();

fixture.componentInstance.pinLocation = TableColumnPinLocation.left;
fixture.detectChanges();

expect(directive.pinLocation).toBe(TableColumnPinLocation.left);
expect(nativeElement.pinLocation).toBe(TableColumnPinLocation.left);
});

it('can be configured with property binding for sortDirection', () => {
expect(directive.sortDirection).toBe(TableColumnSortDirection.ascending);
expect(nativeElement.sortDirection).toBe(TableColumnSortDirection.ascending);
Expand Down Expand Up @@ -404,6 +423,7 @@ describe('NimbleTableColumnMapping', () => {
[attr.action-menu-slot]="actionMenuSlot"
[attr.action-menu-label]="actionMenuLabel"
[attr.column-hidden]="columnHidden"
[attr.pin-location]="pinLocation"
[attr.fractional-width]="fractionalWidth"
[attr.min-pixel-width]="minPixelWidth"
[attr.sort-direction]="sortDirection"
Expand All @@ -428,6 +448,7 @@ describe('NimbleTableColumnMapping', () => {
public minPixelWidth: number | null = 40;
public columnId = 'my-column';
public columnHidden = true;
public pinLocation: TableColumnPinLocation = TableColumnPinLocation.none;
public sortDirection: TableColumnSortDirection = TableColumnSortDirection.ascending;
public sortIndex: number | null = 0;
public sortingDisabled = false;
Expand Down Expand Up @@ -517,6 +538,17 @@ describe('NimbleTableColumnMapping', () => {
expect(nativeElement.columnHidden).toBe(false);
});

it('can be configured with attribute binding for pin-location', () => {
expect(directive.pinLocation).toBeUndefined();
expect(nativeElement.pinLocation).toBeUndefined();

fixture.componentInstance.pinLocation = TableColumnPinLocation.left;
fixture.detectChanges();

expect(directive.pinLocation).toBe(TableColumnPinLocation.left);
expect(nativeElement.pinLocation).toBe(TableColumnPinLocation.left);
});

it('can be configured with attribute binding for sortDirection', () => {
expect(directive.sortDirection).toBe(TableColumnSortDirection.ascending);
expect(nativeElement.sortDirection).toBe(TableColumnSortDirection.ascending);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { Directive, ElementRef, Input, Renderer2 } from '@angular/core';
import type { TableColumn } from '@ni/nimble-components/dist/esm/table-column/base';
import type { DelegatedEventEventDetails, TableColumnValidity } from '@ni/nimble-components/dist/esm/table-column/base/types';
import { TableColumnPinLocation } from '@ni/nimble-components/dist/esm/table-column/base';
import { TableColumnSortDirection } from '@ni/nimble-components/dist/esm/table/types';
import { type BooleanValueOrAttribute, toBooleanProperty } from '@ni/nimble-angular/internal-utilities';

export { TableColumnSortDirection, type DelegatedEventEventDetails, type TableColumnValidity };
export { TableColumnPinLocation, TableColumnSortDirection, type DelegatedEventEventDetails, type TableColumnValidity };

/**
* Base class for table column directives.
Expand Down Expand Up @@ -43,6 +44,14 @@ export class NimbleTableColumnBaseDirective<T extends TableColumn> {
this.renderer.setProperty(this.elementRef.nativeElement, 'columnHidden', toBooleanProperty(value));
}

public get pinLocation(): TableColumnPinLocation {
return this.elementRef.nativeElement.pinLocation;
}

@Input('pin-location') public set pinLocation(value: TableColumnPinLocation) {
this.renderer.setProperty(this.elementRef.nativeElement, 'pinLocation', value);
}

public constructor(protected readonly renderer: Renderer2, protected readonly elementRef: ElementRef<T>) {}

public checkValidity(): boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ describe('Nimble table', () => {
duplicateGroupIndex: false,
idFieldNameNotConfigured: false,
invalidColumnConfiguration: false,
invalidParentIdConfiguration: false
invalidParentIdConfiguration: false,
invalidPinnedColumnConfiguration: false
};
expect(directive.validity).toEqual(expectedValidity);
expect(nativeElement.validity).toEqual(expectedValidity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
FieldName="BreakpointState"
MenuSlot="breakpoint-menu"
BreakpointStateChangeRequested="OnBreakpointStateChangeRequested"
BreakpointToggle="OnBreakpointToggle">
BreakpointToggle="OnBreakpointToggle"
PinLocation="@OkBlazor.TableColumnPinLocation.Left">
</OkTsTableColumnBreakpoint>
<NimbleTableColumnNumberText FieldName="LineNumber">Line</NimbleTableColumnNumberText>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace NimbleBlazor;

public enum TableColumnPinLocation
{
None,
Left
}

internal static class TableColumnPinLocationExtensions
{
private static readonly Dictionary<TableColumnPinLocation, string> _enumValues = AttributeHelpers.GetEnumNamesAsKebabCaseValues<TableColumnPinLocation>();

public static string? ToAttributeValue(this TableColumnPinLocation? value) => (value == null || value == TableColumnPinLocation.None) ? null : _enumValues[value.Value];
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
column-hidden="@ColumnHidden"
fractional-width="@FractionalWidthAsString"
min-pixel-width="@MinPixelWidthAsString"
pin-location="@PinLocation.ToAttributeValue()"
sort-direction="@SortDirection.ToAttributeValue()"
sort-index="@SortIndex"
sorting-disabled="@SortingDisabled"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ public partial class NimbleTableColumnMapping<TKey> : NimbleTableColumnEnumBase<
[Parameter]
public double? MinPixelWidth { get; set; }

/// <summary>
/// The pin location for the column.
/// </summary>
[Parameter]
public TableColumnPinLocation? PinLocation { get; set; }
Comment thread
hellovolcano marked this conversation as resolved.

/// <summary>
/// Sets the width mode on the column.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
field-name="@FieldName"
column-hidden="@ColumnHidden"
menu-slot="@MenuSlot"
pin-location="@PinLocation.ToAttributeValue()"
@onokbreakpointcolumntoggle="BreakpointToggle"
@onokbreakpointcolumnstatechangerequested="BreakpointStateChangeRequested"
@attributes="AdditionalAttributes">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ public partial class OkTsTableColumnBreakpoint : ComponentBase
[Parameter]
public string? MenuSlot { get; set; }

/// <summary>
/// Gets or sets the pin location for the column.
/// </summary>
[Parameter]
public TableColumnPinLocation? PinLocation { get; set; }

/// <summary>
/// Whether or not the column should be hidden.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace OkBlazor;

public enum TableColumnPinLocation
{
None,
Left
}

internal static class TableColumnPinLocationExtensions
{
private static readonly Dictionary<TableColumnPinLocation, string> _enumValues = AttributeHelpers.GetEnumNamesAsKebabCaseValues<TableColumnPinLocation>();

public static string? ToAttributeValue(this TableColumnPinLocation? value) => (value == null || value == TableColumnPinLocation.None) ? null : _enumValues[value.Value];
}
6 changes: 6 additions & 0 deletions packages/nimble-components/src/table-column/base/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import {
import type { TableColumnValidity } from './types';
import type { ColumnValidator } from './models/column-validator';
import { slotTextContent } from '../../utilities/models/slot-text-content';
import { TableColumnPinLocation } from '../../table/types';

export { TableColumnPinLocation };
Comment thread
hellovolcano marked this conversation as resolved.
Outdated

/**
* The base class for table columns
Expand Down Expand Up @@ -37,6 +40,9 @@ export abstract class TableColumn<
@attr({ attribute: 'column-hidden', mode: 'boolean' })
public columnHidden = false;

@attr({ attribute: 'pin-location' })
Comment thread
hellovolcano marked this conversation as resolved.
Outdated
public pinLocation: TableColumnPinLocation;
Comment thread
hellovolcano marked this conversation as resolved.
Outdated

/** @internal */
@observable
public hasOverflow = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ describe('TableColumn', () => {
expect(element.columnInternals.currentPixelWidth).toBe(200);
});

it('has expected defaults for pin-location', async () => {
await connect();

expect(element.pinLocation).toBeUndefined();
expect(element.hasAttribute('pin-location')).toBeFalse();
});

describe('with a custom constructor', () => {
// Seems subject to change how errors are handled during custom
// element construction: https://github.com/WICG/webcomponents/issues/635
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ export class TableGroupRow extends FoundationElement {
@observable
public nestingLevel = 0;

@observable
public pinnedColumnOffset = 0;

/**
* Row index in the flattened set of all regular and group header rows.
* Represents the index in table.tableData (TableRowState[]).
Expand Down
Loading