diff --git a/angular-workspace/projects/example-client-app/src/app/app.module.ts b/angular-workspace/projects/example-client-app/src/app/app.module.ts index 61d301507f..ebb6a1467a 100644 --- a/angular-workspace/projects/example-client-app/src/app/app.module.ts +++ b/angular-workspace/projects/example-client-app/src/app/app.module.ts @@ -22,7 +22,7 @@ import { NimbleTableModule } from '@ni/nimble-angular/table'; import { NimbleTableColumnTextModule } from '@ni/nimble-angular/table-column/text'; import { NimbleTableColumnAnchorModule } from '@ni/nimble-angular/table-column/anchor'; import { NimbleTableColumnDateTextModule } from '@ni/nimble-angular/table-column/date-text'; -import { NimbleTableColumnIconModule } from '@ni/nimble-angular/table-column/icon'; +import { NimbleTableColumnMappingModule } from '@ni/nimble-angular/table-column/mapping'; import { NimbleTableColumnNumberTextModule } from '@ni/nimble-angular/table-column/number-text'; import { NimbleTableColumnDurationTextModule } from '@ni/nimble-angular/table-column/duration-text'; import { NimbleRichTextViewerModule } from '@ni/nimble-angular/rich-text/viewer'; @@ -95,7 +95,7 @@ import { HeaderComponent } from './header/header.component'; NimbleBannerModule, NimbleRichTextViewerModule, NimbleRichTextEditorModule, - NimbleTableColumnIconModule, + NimbleTableColumnMappingModule, NimbleMappingIconModule, NimbleMappingUserModule, NimbleRichTextMentionUsersModule, diff --git a/angular-workspace/projects/example-client-app/src/app/customapp/customapp.component.html b/angular-workspace/projects/example-client-app/src/app/customapp/customapp.component.html index 80a44f58c8..7f50decebc 100644 --- a/angular-workspace/projects/example-client-app/src/app/customapp/customapp.component.html +++ b/angular-workspace/projects/example-client-app/src/app/customapp/customapp.component.html @@ -247,15 +247,15 @@ > Date - Status - - + - + diff --git a/angular-workspace/projects/ni/nimble-angular/CHANGELOG.json b/angular-workspace/projects/ni/nimble-angular/CHANGELOG.json index b719488ee6..2bffdfda16 100644 --- a/angular-workspace/projects/ni/nimble-angular/CHANGELOG.json +++ b/angular-workspace/projects/ni/nimble-angular/CHANGELOG.json @@ -1,6 +1,27 @@ { "name": "@ni/nimble-angular", "entries": [ + { + "date": "Mon, 06 May 2024 19:00:05 GMT", + "version": "24.0.0", + "tag": "@ni/nimble-angular_v24.0.0", + "comments": { + "major": [ + { + "author": "20542556+mollykreis@users.noreply.github.com", + "package": "@ni/nimble-angular", + "commit": "d1c9125a77615d0364671a9e03a558c57b359ed7", + "comment": "Rename icon column to mapping column" + }, + { + "author": "beachball", + "package": "@ni/nimble-angular", + "comment": "Bump @ni/nimble-components to v28.0.0", + "commit": "not available" + } + ] + } + }, { "date": "Thu, 02 May 2024 18:52:31 GMT", "version": "23.2.1", diff --git a/angular-workspace/projects/ni/nimble-angular/CHANGELOG.md b/angular-workspace/projects/ni/nimble-angular/CHANGELOG.md index d8dd1b53b7..e78af03920 100644 --- a/angular-workspace/projects/ni/nimble-angular/CHANGELOG.md +++ b/angular-workspace/projects/ni/nimble-angular/CHANGELOG.md @@ -1,9 +1,18 @@ # Change Log - @ni/nimble-angular -This log was last generated on Thu, 02 May 2024 18:52:31 GMT and should not be manually modified. +This log was last generated on Mon, 06 May 2024 19:00:05 GMT and should not be manually modified. +## 24.0.0 + +Mon, 06 May 2024 19:00:05 GMT + +### Major changes + +- Rename icon column to mapping column ([ni/nimble@d1c9125](https://github.com/ni/nimble/commit/d1c9125a77615d0364671a9e03a558c57b359ed7)) +- Bump @ni/nimble-components to v28.0.0 + ## 23.2.1 Thu, 02 May 2024 18:52:31 GMT diff --git a/angular-workspace/projects/ni/nimble-angular/mapping/icon/nimble-mapping-icon.directive.ts b/angular-workspace/projects/ni/nimble-angular/mapping/icon/nimble-mapping-icon.directive.ts index 5c7ed33bf6..9fb4ee70c6 100644 --- a/angular-workspace/projects/ni/nimble-angular/mapping/icon/nimble-mapping-icon.directive.ts +++ b/angular-workspace/projects/ni/nimble-angular/mapping/icon/nimble-mapping-icon.directive.ts @@ -9,7 +9,7 @@ export type { MappingIcon }; export { mappingIconTag }; /** - * Directive to provide Angular integration for the mapping icon element used by the icon column. + * Directive to provide Angular integration for the mapping icon element used by the mapping column. */ @Directive({ selector: 'nimble-mapping-icon' diff --git a/angular-workspace/projects/ni/nimble-angular/mapping/icon/tests/nimble-mapping-icon.directive.spec.ts b/angular-workspace/projects/ni/nimble-angular/mapping/icon/tests/nimble-mapping-icon.directive.spec.ts index 65df5228f7..45fedba909 100644 --- a/angular-workspace/projects/ni/nimble-angular/mapping/icon/tests/nimble-mapping-icon.directive.spec.ts +++ b/angular-workspace/projects/ni/nimble-angular/mapping/icon/tests/nimble-mapping-icon.directive.spec.ts @@ -2,7 +2,7 @@ import { Component, ElementRef, ViewChild } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { IconSeverity } from '@ni/nimble-angular'; import { NimbleTableModule } from '../../../table/nimble-table.module'; -import { NimbleTableColumnIconModule } from '../../../table-column/icon/nimble-table-column-icon.module'; +import { NimbleTableColumnMappingModule } from '../../../table-column/mapping/nimble-table-column-mapping.module'; import { NimbleMappingIconDirective, type MappingIcon } from '../nimble-mapping-icon.directive'; import { NimbleMappingIconModule } from '../nimble-mapping-icon.module'; @@ -10,7 +10,7 @@ describe('NimbleMappingIcon', () => { describe('module', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [NimbleMappingIconModule] + imports: [NimbleTableColumnMappingModule] }); }); @@ -23,7 +23,7 @@ describe('NimbleMappingIcon', () => { @Component({ template: ` - + { text-hidden > - + ` }) @@ -48,7 +48,7 @@ describe('NimbleMappingIcon', () => { beforeEach(() => { TestBed.configureTestingModule({ declarations: [TestHostComponent], - imports: [NimbleMappingIconModule, NimbleTableColumnIconModule, NimbleTableModule] + imports: [NimbleMappingIconModule, NimbleTableColumnMappingModule, NimbleTableModule] }); fixture = TestBed.createComponent(TestHostComponent); @@ -87,7 +87,7 @@ describe('NimbleMappingIcon', () => { @Component({ template: ` - + { [textHidden]="textHidden" > - + ` }) @@ -117,7 +117,7 @@ describe('NimbleMappingIcon', () => { beforeEach(() => { TestBed.configureTestingModule({ declarations: [TestHostComponent], - imports: [NimbleMappingIconModule, NimbleTableColumnIconModule, NimbleTableModule] + imports: [NimbleMappingIconModule, NimbleTableColumnMappingModule, NimbleTableModule] }); fixture = TestBed.createComponent(TestHostComponent); @@ -186,7 +186,7 @@ describe('NimbleMappingIcon', () => { @Component({ template: ` - + { [attr.text-hidden]="textHidden" > - + ` }) @@ -216,7 +216,7 @@ describe('NimbleMappingIcon', () => { beforeEach(() => { TestBed.configureTestingModule({ declarations: [TestHostComponent], - imports: [NimbleMappingIconModule, NimbleTableColumnIconModule, NimbleTableModule] + imports: [NimbleMappingIconModule, NimbleTableColumnMappingModule, NimbleTableModule] }); fixture = TestBed.createComponent(TestHostComponent); diff --git a/angular-workspace/projects/ni/nimble-angular/mapping/spinner/tests/nimble-mapping-spinner.directive.spec.ts b/angular-workspace/projects/ni/nimble-angular/mapping/spinner/tests/nimble-mapping-spinner.directive.spec.ts index 6dc1e2efbd..53d04c377d 100644 --- a/angular-workspace/projects/ni/nimble-angular/mapping/spinner/tests/nimble-mapping-spinner.directive.spec.ts +++ b/angular-workspace/projects/ni/nimble-angular/mapping/spinner/tests/nimble-mapping-spinner.directive.spec.ts @@ -1,7 +1,7 @@ import { Component, ElementRef, ViewChild } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { NimbleTableModule } from '../../../table/nimble-table.module'; -import { NimbleTableColumnIconModule } from '../../../table-column/icon/nimble-table-column-icon.module'; +import { NimbleTableColumnMappingModule } from '../../../table-column/mapping/nimble-table-column-mapping.module'; import { NimbleMappingSpinnerDirective, type MappingSpinner } from '../nimble-mapping-spinner.directive'; import { NimbleMappingSpinnerModule } from '../nimble-mapping-spinner.module'; @@ -22,7 +22,7 @@ describe('NimbleMappingSpinner', () => { @Component({ template: ` - + { text-hidden > - + ` }) @@ -45,7 +45,7 @@ describe('NimbleMappingSpinner', () => { beforeEach(() => { TestBed.configureTestingModule({ declarations: [TestHostComponent], - imports: [NimbleMappingSpinnerModule, NimbleTableColumnIconModule, NimbleTableModule] + imports: [NimbleMappingSpinnerModule, NimbleTableColumnMappingModule, NimbleTableModule] }); fixture = TestBed.createComponent(TestHostComponent); @@ -74,7 +74,7 @@ describe('NimbleMappingSpinner', () => { @Component({ template: ` - + { [textHidden]="textHidden" > - + ` }) @@ -100,7 +100,7 @@ describe('NimbleMappingSpinner', () => { beforeEach(() => { TestBed.configureTestingModule({ declarations: [TestHostComponent], - imports: [NimbleMappingSpinnerModule, NimbleTableColumnIconModule, NimbleTableModule] + imports: [NimbleMappingSpinnerModule, NimbleTableColumnMappingModule, NimbleTableModule] }); fixture = TestBed.createComponent(TestHostComponent); @@ -147,7 +147,7 @@ describe('NimbleMappingSpinner', () => { @Component({ template: ` - + { [attr.text-hidden]="textHidden" > - + ` }) @@ -173,7 +173,7 @@ describe('NimbleMappingSpinner', () => { beforeEach(() => { TestBed.configureTestingModule({ declarations: [TestHostComponent], - imports: [NimbleMappingSpinnerModule, NimbleTableColumnIconModule, NimbleTableModule] + imports: [NimbleMappingSpinnerModule, NimbleTableColumnMappingModule, NimbleTableModule] }); fixture = TestBed.createComponent(TestHostComponent); diff --git a/angular-workspace/projects/ni/nimble-angular/mapping/text/nimble-mapping-text.directive.ts b/angular-workspace/projects/ni/nimble-angular/mapping/text/nimble-mapping-text.directive.ts index a01381280a..6605da3027 100644 --- a/angular-workspace/projects/ni/nimble-angular/mapping/text/nimble-mapping-text.directive.ts +++ b/angular-workspace/projects/ni/nimble-angular/mapping/text/nimble-mapping-text.directive.ts @@ -7,7 +7,7 @@ export type { MappingText, MappingKey }; export { mappingTextTag }; /** - * Directive to provide Angular integration for the mapping text element used by the icon column. + * Directive to provide Angular integration for the mapping text element used by the mapping column. */ @Directive({ selector: 'nimble-mapping-text' diff --git a/angular-workspace/projects/ni/nimble-angular/mapping/text/tests/nimble-mapping-text.directive.spec.ts b/angular-workspace/projects/ni/nimble-angular/mapping/text/tests/nimble-mapping-text.directive.spec.ts index c2c2b0c3a3..5892aa4b34 100644 --- a/angular-workspace/projects/ni/nimble-angular/mapping/text/tests/nimble-mapping-text.directive.spec.ts +++ b/angular-workspace/projects/ni/nimble-angular/mapping/text/tests/nimble-mapping-text.directive.spec.ts @@ -1,7 +1,7 @@ import { Component, ElementRef, ViewChild } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { NimbleTableModule } from '../../../table/nimble-table.module'; -import { NimbleTableColumnIconModule } from '../../../table-column/icon/nimble-table-column-icon.module'; +import { NimbleTableColumnMappingModule } from '../../../table-column/mapping/nimble-table-column-mapping.module'; import { NimbleMappingTextDirective, type MappingText } from '../nimble-mapping-text.directive'; import { NimbleMappingTextModule } from '../nimble-mapping-text.module'; @@ -22,14 +22,14 @@ describe('NimbleMappingText', () => { @Component({ template: ` - + - + ` }) @@ -44,7 +44,7 @@ describe('NimbleMappingText', () => { beforeEach(() => { TestBed.configureTestingModule({ declarations: [TestHostComponent], - imports: [NimbleMappingTextModule, NimbleTableColumnIconModule, NimbleTableModule] + imports: [NimbleMappingTextModule, NimbleTableColumnMappingModule, NimbleTableModule] }); fixture = TestBed.createComponent(TestHostComponent); @@ -68,14 +68,14 @@ describe('NimbleMappingText', () => { @Component({ template: ` - + - + ` }) @@ -92,7 +92,7 @@ describe('NimbleMappingText', () => { beforeEach(() => { TestBed.configureTestingModule({ declarations: [TestHostComponent], - imports: [NimbleMappingTextModule, NimbleTableColumnIconModule, NimbleTableModule] + imports: [NimbleMappingTextModule, NimbleTableColumnMappingModule, NimbleTableModule] }); fixture = TestBed.createComponent(TestHostComponent); @@ -128,14 +128,14 @@ describe('NimbleMappingText', () => { @Component({ template: ` - + - + ` }) @@ -152,7 +152,7 @@ describe('NimbleMappingText', () => { beforeEach(() => { TestBed.configureTestingModule({ declarations: [TestHostComponent], - imports: [NimbleMappingTextModule, NimbleTableColumnIconModule, NimbleTableModule] + imports: [NimbleMappingTextModule, NimbleTableColumnMappingModule, NimbleTableModule] }); fixture = TestBed.createComponent(TestHostComponent); diff --git a/angular-workspace/projects/ni/nimble-angular/package.json b/angular-workspace/projects/ni/nimble-angular/package.json index 84065b4c6c..e61c69b671 100644 --- a/angular-workspace/projects/ni/nimble-angular/package.json +++ b/angular-workspace/projects/ni/nimble-angular/package.json @@ -1,6 +1,6 @@ { "name": "@ni/nimble-angular", - "version": "23.2.1", + "version": "24.0.0", "description": "Angular components for the NI Nimble Design System", "scripts": { "invoke-publish": "npm run invoke-publish:setup && cd ../../../dist/ni/nimble-angular && npm publish", @@ -32,7 +32,7 @@ "@angular/forms": "^16.2.12", "@angular/localize": "^16.2.12", "@angular/router": "^16.2.12", - "@ni/nimble-components": "^27.2.3" + "@ni/nimble-components": "^28.0.0" }, "dependencies": { "tslib": "^2.2.0" diff --git a/angular-workspace/projects/ni/nimble-angular/table-column/icon/nimble-table-column-icon.module.ts b/angular-workspace/projects/ni/nimble-angular/table-column/icon/nimble-table-column-icon.module.ts deleted file mode 100644 index d3d95db680..0000000000 --- a/angular-workspace/projects/ni/nimble-angular/table-column/icon/nimble-table-column-icon.module.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { NimbleTableColumnIconDirective } from './nimble-table-column-icon.directive'; - -import '@ni/nimble-components/dist/esm/table-column/icon'; - -@NgModule({ - declarations: [NimbleTableColumnIconDirective], - imports: [CommonModule], - exports: [NimbleTableColumnIconDirective] -}) -export class NimbleTableColumnIconModule { } diff --git a/angular-workspace/projects/ni/nimble-angular/table-column/icon/public-api.ts b/angular-workspace/projects/ni/nimble-angular/table-column/icon/public-api.ts deleted file mode 100644 index 209eb764b2..0000000000 --- a/angular-workspace/projects/ni/nimble-angular/table-column/icon/public-api.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './nimble-table-column-icon.directive'; -export * from './nimble-table-column-icon.module'; \ No newline at end of file diff --git a/angular-workspace/projects/ni/nimble-angular/table-column/icon/ng-package.json b/angular-workspace/projects/ni/nimble-angular/table-column/mapping/ng-package.json similarity index 100% rename from angular-workspace/projects/ni/nimble-angular/table-column/icon/ng-package.json rename to angular-workspace/projects/ni/nimble-angular/table-column/mapping/ng-package.json diff --git a/angular-workspace/projects/ni/nimble-angular/table-column/icon/nimble-table-column-icon.directive.ts b/angular-workspace/projects/ni/nimble-angular/table-column/mapping/nimble-table-column-mapping.directive.ts similarity index 86% rename from angular-workspace/projects/ni/nimble-angular/table-column/icon/nimble-table-column-icon.directive.ts rename to angular-workspace/projects/ni/nimble-angular/table-column/mapping/nimble-table-column-mapping.directive.ts index ac501ccc7d..4d99334d25 100644 --- a/angular-workspace/projects/ni/nimble-angular/table-column/icon/nimble-table-column-icon.directive.ts +++ b/angular-workspace/projects/ni/nimble-angular/table-column/mapping/nimble-table-column-mapping.directive.ts @@ -1,21 +1,21 @@ import { Directive, ElementRef, Input, Renderer2 } from '@angular/core'; -import { type TableColumnIcon, tableColumnIconTag } from '@ni/nimble-components/dist/esm/table-column/icon'; +import { type TableColumnMapping, tableColumnMappingTag } from '@ni/nimble-components/dist/esm/table-column/mapping'; import { BooleanValueOrAttribute, NumberValueOrAttribute, toBooleanProperty, toNullableNumberProperty } from '@ni/nimble-angular/internal-utilities'; import { NimbleTableColumnBaseDirective } from '@ni/nimble-angular/table-column'; import { MappingKeyType } from '@ni/nimble-components/dist/esm/table-column/enum-base/types'; -import { TableColumnMappingWidthMode } from '@ni/nimble-components/dist/esm/table-column/icon/types'; +import { TableColumnMappingWidthMode } from '@ni/nimble-components/dist/esm/table-column/mapping/types'; export { MappingKeyType, TableColumnMappingWidthMode }; -export type { TableColumnIcon }; -export { tableColumnIconTag }; +export type { TableColumnMapping }; +export { tableColumnMappingTag }; /** - * Directive to provide Angular integration for the table column element for icons/spinners. + * Directive to provide Angular integration for the table column element for mapped text/icons/spinners. */ @Directive({ - selector: 'nimble-table-column-icon' + selector: 'nimble-table-column-mapping' }) -export class NimbleTableColumnIconDirective extends NimbleTableColumnBaseDirective { +export class NimbleTableColumnMappingDirective extends NimbleTableColumnBaseDirective { public get fieldName(): string | undefined { return this.elementRef.nativeElement.fieldName; } @@ -72,7 +72,7 @@ export class NimbleTableColumnIconDirective extends NimbleTableColumnBaseDirecti this.renderer.setProperty(this.elementRef.nativeElement, 'widthMode', value); } - public constructor(renderer: Renderer2, elementRef: ElementRef) { + public constructor(renderer: Renderer2, elementRef: ElementRef) { super(renderer, elementRef); } } diff --git a/angular-workspace/projects/ni/nimble-angular/table-column/mapping/nimble-table-column-mapping.module.ts b/angular-workspace/projects/ni/nimble-angular/table-column/mapping/nimble-table-column-mapping.module.ts new file mode 100644 index 0000000000..1270f1d2fd --- /dev/null +++ b/angular-workspace/projects/ni/nimble-angular/table-column/mapping/nimble-table-column-mapping.module.ts @@ -0,0 +1,12 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { NimbleTableColumnMappingDirective } from './nimble-table-column-mapping.directive'; + +import '@ni/nimble-components/dist/esm/table-column/mapping'; + +@NgModule({ + declarations: [NimbleTableColumnMappingDirective], + imports: [CommonModule], + exports: [NimbleTableColumnMappingDirective] +}) +export class NimbleTableColumnMappingModule { } diff --git a/angular-workspace/projects/ni/nimble-angular/table-column/mapping/public-api.ts b/angular-workspace/projects/ni/nimble-angular/table-column/mapping/public-api.ts new file mode 100644 index 0000000000..9dc2d1da86 --- /dev/null +++ b/angular-workspace/projects/ni/nimble-angular/table-column/mapping/public-api.ts @@ -0,0 +1,2 @@ +export * from './nimble-table-column-mapping.directive'; +export * from './nimble-table-column-mapping.module'; \ No newline at end of file diff --git a/angular-workspace/projects/ni/nimble-angular/table-column/icon/tests/nimble-table-column-icon.directive.spec.ts b/angular-workspace/projects/ni/nimble-angular/table-column/mapping/tests/nimble-table-column-mapping.directive.spec.ts similarity index 93% rename from angular-workspace/projects/ni/nimble-angular/table-column/icon/tests/nimble-table-column-icon.directive.spec.ts rename to angular-workspace/projects/ni/nimble-angular/table-column/mapping/tests/nimble-table-column-mapping.directive.spec.ts index 33d352a614..d3a31e16e2 100644 --- a/angular-workspace/projects/ni/nimble-angular/table-column/icon/tests/nimble-table-column-icon.directive.spec.ts +++ b/angular-workspace/projects/ni/nimble-angular/table-column/mapping/tests/nimble-table-column-mapping.directive.spec.ts @@ -1,20 +1,20 @@ import { Component, ElementRef, ViewChild } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { NimbleTableModule } from '../../../table/nimble-table.module'; -import { NimbleTableColumnIconModule } from '../nimble-table-column-icon.module'; -import { NimbleTableColumnIconDirective, TableColumnIcon, TableColumnMappingWidthMode } from '../nimble-table-column-icon.directive'; +import { NimbleTableColumnMappingModule } from '../nimble-table-column-mapping.module'; +import { NimbleTableColumnMappingDirective, TableColumnMapping, TableColumnMappingWidthMode } from '../nimble-table-column-mapping.directive'; import { TableColumnSortDirection } from '../../nimble-table-column-base.directive'; -describe('NimbleTableColumnIcon', () => { +describe('NimbleTableColumnMapping', () => { describe('module', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [NimbleTableColumnIconModule] + imports: [NimbleTableColumnMappingModule] }); }); it('custom element is defined', () => { - expect(customElements.get('nimble-table-column-icon')).not.toBeUndefined(); + expect(customElements.get('nimble-table-column-mapping')).not.toBeUndefined(); }); }); @@ -22,7 +22,7 @@ describe('NimbleTableColumnIcon', () => { @Component({ template: ` - { group-index="0" grouping-disabled width-mode="icon-size" - > + > ` }) class TestHostComponent { - @ViewChild('column', { read: NimbleTableColumnIconDirective }) public directive: NimbleTableColumnIconDirective; - @ViewChild('column', { read: ElementRef }) public elementRef: ElementRef; + @ViewChild('column', { read: NimbleTableColumnMappingDirective }) public directive: NimbleTableColumnMappingDirective; + @ViewChild('column', { read: ElementRef }) public elementRef: ElementRef; } let fixture: ComponentFixture; - let directive: NimbleTableColumnIconDirective; - let nativeElement: TableColumnIcon; + let directive: NimbleTableColumnMappingDirective; + let nativeElement: TableColumnMapping; beforeEach(() => { TestBed.configureTestingModule({ declarations: [TestHostComponent], - imports: [NimbleTableColumnIconModule, NimbleTableModule] + imports: [NimbleTableColumnMappingModule, NimbleTableModule] }); fixture = TestBed.createComponent(TestHostComponent); @@ -131,7 +131,7 @@ describe('NimbleTableColumnIcon', () => { @Component({ template: ` - { [group-index]="groupIndex" [grouping-disabled]="groupingDisabled" [width-mode]="widthMode" - > + > ` }) class TestHostComponent { - @ViewChild('column', { read: NimbleTableColumnIconDirective }) public directive: NimbleTableColumnIconDirective; - @ViewChild('column', { read: ElementRef }) public elementRef: ElementRef; + @ViewChild('column', { read: NimbleTableColumnMappingDirective }) public directive: NimbleTableColumnMappingDirective; + @ViewChild('column', { read: ElementRef }) public elementRef: ElementRef; public field = 'field1'; public keyType = 'boolean'; public actionMenuSlot = 'my-slot'; @@ -169,12 +169,12 @@ describe('NimbleTableColumnIcon', () => { } let fixture: ComponentFixture; - let directive: NimbleTableColumnIconDirective; - let nativeElement: TableColumnIcon; + let directive: NimbleTableColumnMappingDirective; + let nativeElement: TableColumnMapping; beforeEach(() => { TestBed.configureTestingModule({ declarations: [TestHostComponent], - imports: [NimbleTableColumnIconModule, NimbleTableModule] + imports: [NimbleTableColumnMappingModule, NimbleTableModule] }); fixture = TestBed.createComponent(TestHostComponent); @@ -375,7 +375,7 @@ describe('NimbleTableColumnIcon', () => { @Component({ template: ` - { [attr.group-index]="groupIndex" [attr.grouping-disabled]="groupingDisabled" [attr.width-mode]="widthMode" - > + > ` }) class TestHostComponent { - @ViewChild('column', { read: NimbleTableColumnIconDirective }) public directive: NimbleTableColumnIconDirective; - @ViewChild('column', { read: ElementRef }) public elementRef: ElementRef; + @ViewChild('column', { read: NimbleTableColumnMappingDirective }) public directive: NimbleTableColumnMappingDirective; + @ViewChild('column', { read: ElementRef }) public elementRef: ElementRef; public field = 'field1'; public keyType = 'boolean'; public actionMenuSlot = 'my-slot'; @@ -413,12 +413,12 @@ describe('NimbleTableColumnIcon', () => { } let fixture: ComponentFixture; - let directive: NimbleTableColumnIconDirective; - let nativeElement: TableColumnIcon; + let directive: NimbleTableColumnMappingDirective; + let nativeElement: TableColumnMapping; beforeEach(() => { TestBed.configureTestingModule({ declarations: [TestHostComponent], - imports: [NimbleTableColumnIconModule, NimbleTableModule] + imports: [NimbleTableColumnMappingModule, NimbleTableModule] }); fixture = TestBed.createComponent(TestHostComponent); diff --git a/angular-workspace/projects/ni/spright-angular/CHANGELOG.json b/angular-workspace/projects/ni/spright-angular/CHANGELOG.json index affec8f7aa..9dde65757c 100644 --- a/angular-workspace/projects/ni/spright-angular/CHANGELOG.json +++ b/angular-workspace/projects/ni/spright-angular/CHANGELOG.json @@ -1,6 +1,21 @@ { "name": "@ni/spright-angular", "entries": [ + { + "date": "Mon, 06 May 2024 19:00:05 GMT", + "version": "0.1.11", + "tag": "@ni/spright-angular_v0.1.11", + "comments": { + "patch": [ + { + "author": "beachball", + "package": "@ni/spright-angular", + "comment": "Bump @ni/spright-components to v0.0.14", + "commit": "not available" + } + ] + } + }, { "date": "Thu, 02 May 2024 18:52:31 GMT", "version": "0.1.10", diff --git a/angular-workspace/projects/ni/spright-angular/CHANGELOG.md b/angular-workspace/projects/ni/spright-angular/CHANGELOG.md index b5ae83891a..d6170c28bd 100644 --- a/angular-workspace/projects/ni/spright-angular/CHANGELOG.md +++ b/angular-workspace/projects/ni/spright-angular/CHANGELOG.md @@ -1,9 +1,17 @@ # Change Log - @ni/spright-angular -This log was last generated on Thu, 02 May 2024 18:52:31 GMT and should not be manually modified. +This log was last generated on Mon, 06 May 2024 19:00:05 GMT and should not be manually modified. +## 0.1.11 + +Mon, 06 May 2024 19:00:05 GMT + +### Patches + +- Bump @ni/spright-components to v0.0.14 + ## 0.1.10 Thu, 02 May 2024 18:52:31 GMT diff --git a/angular-workspace/projects/ni/spright-angular/package.json b/angular-workspace/projects/ni/spright-angular/package.json index b0c77c4244..4047587185 100644 --- a/angular-workspace/projects/ni/spright-angular/package.json +++ b/angular-workspace/projects/ni/spright-angular/package.json @@ -1,6 +1,6 @@ { "name": "@ni/spright-angular", - "version": "0.1.10", + "version": "0.1.11", "description": "Angular components for NI Spright", "scripts": { "invoke-publish": "npm run invoke-publish:setup && cd ../../../dist/ni/spright-angular && npm publish", @@ -24,7 +24,7 @@ "peerDependencies": { "@angular/common": "^16.2.12", "@angular/core": "^16.2.12", - "@ni/spright-components": "^0.0.13" + "@ni/spright-components": "^0.0.14" }, "dependencies": { "tslib": "^2.2.0" diff --git a/package-lock.json b/package-lock.json index 777c5128c3..411f4c3fbe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -82,7 +82,7 @@ }, "angular-workspace/projects/ni/nimble-angular": { "name": "@ni/nimble-angular", - "version": "23.2.1", + "version": "24.0.0", "license": "MIT", "dependencies": { "tslib": "^2.2.0" @@ -93,12 +93,12 @@ "@angular/forms": "^16.2.12", "@angular/localize": "^16.2.12", "@angular/router": "^16.2.12", - "@ni/nimble-components": "^27.2.3" + "@ni/nimble-components": "^28.0.0" } }, "angular-workspace/projects/ni/spright-angular": { "name": "@ni/spright-angular", - "version": "0.1.10", + "version": "0.1.11", "license": "MIT", "dependencies": { "tslib": "^2.2.0" @@ -106,7 +106,7 @@ "peerDependencies": { "@angular/common": "^16.2.12", "@angular/core": "^16.2.12", - "@ni/spright-components": "^0.0.13" + "@ni/spright-components": "^0.0.14" } }, "node_modules/@11ty/dependency-tree": { @@ -32615,7 +32615,7 @@ }, "packages/blazor-workspace/NimbleBlazor": { "name": "@ni/nimble-blazor", - "version": "16.1.1", + "version": "17.0.0", "license": "MIT", "peerDependencies": { "cross-env": "^7.0.3", @@ -32678,7 +32678,7 @@ }, "packages/nimble-components": { "name": "@ni/nimble-components", - "version": "27.2.3", + "version": "28.0.0", "license": "MIT", "dependencies": { "@microsoft/fast-colors": "^5.3.1", @@ -32826,14 +32826,14 @@ }, "packages/spright-components": { "name": "@ni/spright-components", - "version": "0.0.13", + "version": "0.0.14", "license": "MIT", "dependencies": { "@microsoft/fast-colors": "^5.3.1", "@microsoft/fast-element": "^1.12.0", "@microsoft/fast-foundation": "^2.49.6", "@microsoft/fast-web-utilities": "^6.0.0", - "@ni/nimble-components": "27.2.3", + "@ni/nimble-components": "28.0.0", "@ni/nimble-tokens": "^6.13.5", "tslib": "^2.2.0" }, diff --git a/packages/blazor-workspace/Examples/Demo.Shared/Pages/ComponentsDemo.razor b/packages/blazor-workspace/Examples/Demo.Shared/Pages/ComponentsDemo.razor index 830a6e81f5..9c892ba7db 100644 --- a/packages/blazor-workspace/Examples/Demo.Shared/Pages/ComponentsDemo.razor +++ b/packages/blazor-workspace/Examples/Demo.Shared/Pages/ComponentsDemo.razor @@ -233,12 +233,12 @@ Link Date - + Status - - + + - + Number Duration String 2 diff --git a/packages/blazor-workspace/NimbleBlazor/CHANGELOG.json b/packages/blazor-workspace/NimbleBlazor/CHANGELOG.json index 0377654ea8..8be40e1ef6 100644 --- a/packages/blazor-workspace/NimbleBlazor/CHANGELOG.json +++ b/packages/blazor-workspace/NimbleBlazor/CHANGELOG.json @@ -1,6 +1,21 @@ { "name": "@ni/nimble-blazor", "entries": [ + { + "date": "Mon, 06 May 2024 19:00:05 GMT", + "version": "17.0.0", + "tag": "@ni/nimble-blazor_v17.0.0", + "comments": { + "major": [ + { + "author": "20542556+mollykreis@users.noreply.github.com", + "package": "@ni/nimble-blazor", + "commit": "d1c9125a77615d0364671a9e03a558c57b359ed7", + "comment": "Rename icon column to mapping column" + } + ] + } + }, { "date": "Thu, 02 May 2024 23:33:54 GMT", "version": "16.1.1", diff --git a/packages/blazor-workspace/NimbleBlazor/CHANGELOG.md b/packages/blazor-workspace/NimbleBlazor/CHANGELOG.md index 9173a5c237..fa99fb1053 100644 --- a/packages/blazor-workspace/NimbleBlazor/CHANGELOG.md +++ b/packages/blazor-workspace/NimbleBlazor/CHANGELOG.md @@ -1,9 +1,17 @@ # Change Log - @ni/nimble-blazor -This log was last generated on Thu, 02 May 2024 23:33:54 GMT and should not be manually modified. +This log was last generated on Mon, 06 May 2024 19:00:05 GMT and should not be manually modified. +## 17.0.0 + +Mon, 06 May 2024 19:00:05 GMT + +### Major changes + +- Rename icon column to mapping column ([ni/nimble@d1c9125](https://github.com/ni/nimble/commit/d1c9125a77615d0364671a9e03a558c57b359ed7)) + ## 16.1.1 Thu, 02 May 2024 23:33:54 GMT diff --git a/packages/blazor-workspace/NimbleBlazor/Components/NimbleTableColumnIcon.razor b/packages/blazor-workspace/NimbleBlazor/Components/NimbleTableColumnMapping.razor similarity index 91% rename from packages/blazor-workspace/NimbleBlazor/Components/NimbleTableColumnIcon.razor rename to packages/blazor-workspace/NimbleBlazor/Components/NimbleTableColumnMapping.razor index c70ba9e657..82b423cf0e 100644 --- a/packages/blazor-workspace/NimbleBlazor/Components/NimbleTableColumnIcon.razor +++ b/packages/blazor-workspace/NimbleBlazor/Components/NimbleTableColumnMapping.razor @@ -3,7 +3,7 @@ @attribute [CascadingTypeParameter(nameof(TKey))] @typeparam TKey - @ChildContent - + diff --git a/packages/blazor-workspace/NimbleBlazor/Components/NimbleTableColumnIcon.razor.cs b/packages/blazor-workspace/NimbleBlazor/Components/NimbleTableColumnMapping.razor.cs similarity index 83% rename from packages/blazor-workspace/NimbleBlazor/Components/NimbleTableColumnIcon.razor.cs rename to packages/blazor-workspace/NimbleBlazor/Components/NimbleTableColumnMapping.razor.cs index 951f2d6d2f..89c8cd0a11 100644 --- a/packages/blazor-workspace/NimbleBlazor/Components/NimbleTableColumnIcon.razor.cs +++ b/packages/blazor-workspace/NimbleBlazor/Components/NimbleTableColumnMapping.razor.cs @@ -2,7 +2,7 @@ namespace NimbleBlazor; -public partial class NimbleTableColumnIcon : NimbleTableColumnEnumBase, IFractionalWidthColumn +public partial class NimbleTableColumnMapping : NimbleTableColumnEnumBase, IFractionalWidthColumn { /// /// The fractional/proportional width to use for this column diff --git a/packages/blazor-workspace/NimbleBlazor/package.json b/packages/blazor-workspace/NimbleBlazor/package.json index 5c27848272..e437bb1ce2 100644 --- a/packages/blazor-workspace/NimbleBlazor/package.json +++ b/packages/blazor-workspace/NimbleBlazor/package.json @@ -1,6 +1,6 @@ { "name": "@ni/nimble-blazor", - "version": "16.1.1", + "version": "17.0.0", "description": "Blazor components for the NI Nimble Design System", "scripts": { "pack": "cross-env-shell dotnet pack -c Release -p:PackageVersion=$npm_package_version --output ../dist", diff --git a/packages/blazor-workspace/Tests/NimbleBlazor.Tests.Acceptance/Pages/TableColumnIconBoolKey.razor b/packages/blazor-workspace/Tests/NimbleBlazor.Tests.Acceptance/Pages/TableColumnMappingBoolKey.razor similarity index 87% rename from packages/blazor-workspace/Tests/NimbleBlazor.Tests.Acceptance/Pages/TableColumnIconBoolKey.razor rename to packages/blazor-workspace/Tests/NimbleBlazor.Tests.Acceptance/Pages/TableColumnMappingBoolKey.razor index 4cfb01f13e..6a51976e90 100644 --- a/packages/blazor-workspace/Tests/NimbleBlazor.Tests.Acceptance/Pages/TableColumnIconBoolKey.razor +++ b/packages/blazor-workspace/Tests/NimbleBlazor.Tests.Acceptance/Pages/TableColumnMappingBoolKey.razor @@ -1,14 +1,14 @@ -@page "/TableColumnIconBoolKey" +@page "/TableColumnMappingBoolKey" @namespace NimbleBlazor.Tests.Acceptance.Pages @using System.Diagnostics.CodeAnalysis; @inherits LayoutComponentBase - + Column 1 - + @code { @@ -16,7 +16,7 @@ public IEnumerable TableData { get; set; } = Enumerable.Empty(); private NimbleTable? _table; - public TableColumnIconBoolKey() + public TableColumnMappingBoolKey() { UpdateTableData(2); } diff --git a/packages/blazor-workspace/Tests/NimbleBlazor.Tests.Acceptance/Tests/TableColumnIconTests.cs b/packages/blazor-workspace/Tests/NimbleBlazor.Tests.Acceptance/Tests/TableColumnMappingTests.cs similarity index 70% rename from packages/blazor-workspace/Tests/NimbleBlazor.Tests.Acceptance/Tests/TableColumnIconTests.cs rename to packages/blazor-workspace/Tests/NimbleBlazor.Tests.Acceptance/Tests/TableColumnMappingTests.cs index b917ae3e81..6c220dc348 100644 --- a/packages/blazor-workspace/Tests/NimbleBlazor.Tests.Acceptance/Tests/TableColumnIconTests.cs +++ b/packages/blazor-workspace/Tests/NimbleBlazor.Tests.Acceptance/Tests/TableColumnMappingTests.cs @@ -1,19 +1,19 @@ -using Microsoft.Playwright; +using Microsoft.Playwright; using Xunit; namespace NimbleBlazor.Tests.Acceptance; -public class TableColumnIconTests : AcceptanceTestsBase +public class TableColumnMappingTests : AcceptanceTestsBase { - public TableColumnIconTests(PlaywrightFixture playwrightFixture, BlazorServerWebHostFixture blazorServerClassFixture) + public TableColumnMappingTests(PlaywrightFixture playwrightFixture, BlazorServerWebHostFixture blazorServerClassFixture) : base(playwrightFixture, blazorServerClassFixture) { } [Fact] - public async Task TableColumnIcon_BoolKeyAsync() + public async Task TableColumnMapping_BoolKeyAsync() { - await using (var pageWrapper = await NewPageForRouteAsync("TableColumnIconBoolKey")) + await using (var pageWrapper = await NewPageForRouteAsync("TableColumnMappingBoolKey")) { var page = pageWrapper.Page; var table = page.Locator("nimble-table"); @@ -26,4 +26,4 @@ public async Task TableColumnIcon_BoolKeyAsync() await Assertions.Expect(spinner).ToHaveCountAsync(1); } } -} +} \ No newline at end of file diff --git a/packages/blazor-workspace/Tests/NimbleBlazor.Tests/Unit/Components/NimbleTableColumnIconTests.cs b/packages/blazor-workspace/Tests/NimbleBlazor.Tests/Unit/Components/NimbleTableColumnMappingTests.cs similarity index 59% rename from packages/blazor-workspace/Tests/NimbleBlazor.Tests/Unit/Components/NimbleTableColumnIconTests.cs rename to packages/blazor-workspace/Tests/NimbleBlazor.Tests/Unit/Components/NimbleTableColumnMappingTests.cs index a52afa4bde..7a0ac81a66 100644 --- a/packages/blazor-workspace/Tests/NimbleBlazor.Tests/Unit/Components/NimbleTableColumnIconTests.cs +++ b/packages/blazor-workspace/Tests/NimbleBlazor.Tests/Unit/Components/NimbleTableColumnMappingTests.cs @@ -6,21 +6,21 @@ namespace NimbleBlazor.Tests.Unit.Components; /// -/// Tests for +/// Tests for /// -public class NimbleTableColumnIconTests +public class NimbleTableColumnMappingTests { [Fact] - public void NimbleTableColumnIcon_SupportsAdditionalAttributes() + public void NimbleTableColumnMapping_SupportsAdditionalAttributes() { var context = new TestContext(); context.JSInterop.Mode = JSRuntimeMode.Loose; - var exception = Record.Exception(() => context.RenderComponent>(ComponentParameter.CreateParameter("class", "foo"))); + var exception = Record.Exception(() => context.RenderComponent>(ComponentParameter.CreateParameter("class", "foo"))); Assert.Null(exception); } [Fact] - public void NimbleTableColumnIcon_WithIntTypeParameter_HasNumberMarkup() + public void NimbleTableColumnMapping_WithIntTypeParameter_HasNumberMarkup() { var column = RenderTableEnumColumn(); @@ -29,7 +29,7 @@ public void NimbleTableColumnIcon_WithIntTypeParameter_HasNumberMarkup() } [Fact] - public void NimbleTableColumnIcon_WithUIntTypeParameter_HasNumberMarkup() + public void NimbleTableColumnMapping_WithUIntTypeParameter_HasNumberMarkup() { var column = RenderTableEnumColumn(); @@ -38,7 +38,7 @@ public void NimbleTableColumnIcon_WithUIntTypeParameter_HasNumberMarkup() } [Fact] - public void NimbleTableColumnIcon_WithShortTypeParameter_HasNumberMarkup() + public void NimbleTableColumnMapping_WithShortTypeParameter_HasNumberMarkup() { var column = RenderTableEnumColumn(); @@ -47,7 +47,7 @@ public void NimbleTableColumnIcon_WithShortTypeParameter_HasNumberMarkup() } [Fact] - public void NimbleTableColumnIcon_WithUShortTypeParameter_HasNumberMarkup() + public void NimbleTableColumnMapping_WithUShortTypeParameter_HasNumberMarkup() { var column = RenderTableEnumColumn(); @@ -56,19 +56,19 @@ public void NimbleTableColumnIcon_WithUShortTypeParameter_HasNumberMarkup() } [Fact] - public void NimbleTableColumnIcon_WithLongTypeParameter_ThrowsException() + public void NimbleTableColumnMapping_WithLongTypeParameter_ThrowsException() { Assert.Throws(() => RenderTableEnumColumn()); } [Fact] - public void NimbleTableColumnIcon_WithULongTypeParameter_ThrowsException() + public void NimbleTableColumnMapping_WithULongTypeParameter_ThrowsException() { Assert.Throws(() => RenderTableEnumColumn()); } [Fact] - public void NimbleTableColumnIcon_WithByteTypeParameter_HasNumberMarkup() + public void NimbleTableColumnMapping_WithByteTypeParameter_HasNumberMarkup() { var column = RenderTableEnumColumn(); @@ -77,7 +77,7 @@ public void NimbleTableColumnIcon_WithByteTypeParameter_HasNumberMarkup() } [Fact] - public void NimbleTableColumnIcon_WithSByteTypeParameter_HasNumberMarkup() + public void NimbleTableColumnMapping_WithSByteTypeParameter_HasNumberMarkup() { var column = RenderTableEnumColumn(); @@ -86,7 +86,7 @@ public void NimbleTableColumnIcon_WithSByteTypeParameter_HasNumberMarkup() } [Fact] - public void NimbleTableColumnIcon_WithFloatTypeParameter_HasNumberMarkup() + public void NimbleTableColumnMapping_WithFloatTypeParameter_HasNumberMarkup() { var column = RenderTableEnumColumn(); @@ -95,7 +95,7 @@ public void NimbleTableColumnIcon_WithFloatTypeParameter_HasNumberMarkup() } [Fact] - public void NimbleTableColumnIcon_WithDoubleTypeParameter_HasNumberMarkup() + public void NimbleTableColumnMapping_WithDoubleTypeParameter_HasNumberMarkup() { var column = RenderTableEnumColumn(); @@ -104,13 +104,13 @@ public void NimbleTableColumnIcon_WithDoubleTypeParameter_HasNumberMarkup() } [Fact] - public void NimbleTableColumnIcon_WithDecimalTypeParameter_ThrowsException() + public void NimbleTableColumnMapping_WithDecimalTypeParameter_ThrowsException() { Assert.Throws(() => RenderTableEnumColumn()); } [Fact] - public void NimbleTableColumnIcon_WithBooleanTypeParameter_HasBooleanMarkup() + public void NimbleTableColumnMapping_WithBooleanTypeParameter_HasBooleanMarkup() { var column = RenderTableEnumColumn(); @@ -119,7 +119,7 @@ public void NimbleTableColumnIcon_WithBooleanTypeParameter_HasBooleanMarkup() } [Fact] - public void NimbleTableColumnIcon_WithStringTypeParameter_HasStringMarkup() + public void NimbleTableColumnMapping_WithStringTypeParameter_HasStringMarkup() { var column = RenderTableEnumColumn(); @@ -128,13 +128,13 @@ public void NimbleTableColumnIcon_WithStringTypeParameter_HasStringMarkup() } [Fact] - public void NimbleTableColumnIcon_WithObjectTypeParameter_ThrowsException() + public void NimbleTableColumnMapping_WithObjectTypeParameter_ThrowsException() { Assert.Throws(() => RenderTableEnumColumn()); } [Fact] - public void NimbleTableColumnIcon_WithFieldNameAttribute_HasMarkup() + public void NimbleTableColumnMapping_WithFieldNameAttribute_HasMarkup() { var column = RenderWithPropertySet(x => x.FieldName!, "Status"); @@ -143,7 +143,7 @@ public void NimbleTableColumnIcon_WithFieldNameAttribute_HasMarkup() } [Fact] - public void NimbleTableColumnIcon_WithWidthModeAttribute_HasMarkup() + public void NimbleTableColumnMapping_WithWidthModeAttribute_HasMarkup() { var column = RenderWithPropertySet(x => x.WidthMode, MappingColumnWidthMode.IconSize); @@ -151,38 +151,38 @@ public void NimbleTableColumnIcon_WithWidthModeAttribute_HasMarkup() Assert.Contains(expectedMarkup, column.Markup); } - private IRenderedComponent> RenderTableEnumColumn() + private IRenderedComponent> RenderTableEnumColumn() { var context = new TestContext(); context.JSInterop.Mode = JSRuntimeMode.Loose; - return context.RenderComponent>(); + return context.RenderComponent>(); } - private IRenderedComponent> RenderWithPropertySet(Expression, TProperty>> propertyGetter, TProperty propertyValue) + private IRenderedComponent> RenderWithPropertySet(Expression, TProperty>> propertyGetter, TProperty propertyValue) { var context = new TestContext(); context.JSInterop.Mode = JSRuntimeMode.Loose; - return context.RenderComponent>(p => p.Add(propertyGetter, propertyValue)); + return context.RenderComponent>(p => p.Add(propertyGetter, propertyValue)); } } /// -/// Tests for NimbleTableColumn API on +/// Tests for NimbleTableColumn API on /// -public class NimbleTableColumnIconBaseTests : NimbleTableColumnTests> +public class NimbleTableColumnMappingBaseTests : NimbleTableColumnTests> { } /// -/// Tests for FractionalWidthAPI on +/// Tests for FractionalWidthAPI on /// -public class NimbleTableColumnIconFractionalWidthTests : FractionalWidthBaseTests> +public class NimbleTableColumnMappingFractionalWidthTests : FractionalWidthBaseTests> { } /// -/// Tests for GroupableAPI on +/// Tests for GroupableAPI on /// -public class NimbleTableColumnIconGroupableTests : GroupableBaseTests> +public class NimbleTableColumnMappingGroupableTests : GroupableBaseTests> { } diff --git a/packages/nimble-components/CHANGELOG.json b/packages/nimble-components/CHANGELOG.json index ccf3eee31a..0ba64142d8 100644 --- a/packages/nimble-components/CHANGELOG.json +++ b/packages/nimble-components/CHANGELOG.json @@ -1,6 +1,21 @@ { "name": "@ni/nimble-components", "entries": [ + { + "date": "Mon, 06 May 2024 19:00:05 GMT", + "version": "28.0.0", + "tag": "@ni/nimble-components_v28.0.0", + "comments": { + "major": [ + { + "author": "20542556+mollykreis@users.noreply.github.com", + "package": "@ni/nimble-components", + "commit": "d1c9125a77615d0364671a9e03a558c57b359ed7", + "comment": "Rename icon column to mapping column" + } + ] + } + }, { "date": "Thu, 02 May 2024 18:52:31 GMT", "version": "27.2.3", diff --git a/packages/nimble-components/CHANGELOG.md b/packages/nimble-components/CHANGELOG.md index d257d0fe13..38eaee98bd 100644 --- a/packages/nimble-components/CHANGELOG.md +++ b/packages/nimble-components/CHANGELOG.md @@ -1,9 +1,17 @@ # Change Log - @ni/nimble-components -This log was last generated on Thu, 02 May 2024 18:52:31 GMT and should not be manually modified. +This log was last generated on Mon, 06 May 2024 19:00:05 GMT and should not be manually modified. +## 28.0.0 + +Mon, 06 May 2024 19:00:05 GMT + +### Major changes + +- Rename icon column to mapping column ([ni/nimble@d1c9125](https://github.com/ni/nimble/commit/d1c9125a77615d0364671a9e03a558c57b359ed7)) + ## 27.2.3 Thu, 02 May 2024 18:52:31 GMT diff --git a/packages/nimble-components/package.json b/packages/nimble-components/package.json index 2420aad58c..2dcd5df23b 100644 --- a/packages/nimble-components/package.json +++ b/packages/nimble-components/package.json @@ -1,6 +1,6 @@ { "name": "@ni/nimble-components", - "version": "27.2.3", + "version": "28.0.0", "description": "Styled web components for the NI Nimble Design System", "scripts": { "build": "npm run generate-icons && npm run generate-workers && npm run build-components && npm run bundle-components && npm run generate-scss", diff --git a/packages/nimble-components/src/all-components.ts b/packages/nimble-components/src/all-components.ts index 77eaaf1ebb..201ecf9176 100644 --- a/packages/nimble-components/src/all-components.ts +++ b/packages/nimble-components/src/all-components.ts @@ -45,8 +45,8 @@ import './table'; import './table-column/anchor'; import './table-column/date-text'; import './table-column/duration-text'; +import './table-column/mapping'; import './table-column/number-text'; -import './table-column/icon'; import './table-column/text'; import './tabs'; import './tabs-toolbar'; diff --git a/packages/nimble-components/src/mapping/icon/index.ts b/packages/nimble-components/src/mapping/icon/index.ts index 05944d0b01..732f3c9e0d 100644 --- a/packages/nimble-components/src/mapping/icon/index.ts +++ b/packages/nimble-components/src/mapping/icon/index.ts @@ -18,7 +18,7 @@ function isIconClass(elementClass: CustomElementConstructor): boolean { /** * Maps a data value to an icon. - * One or more may be added as children of a nimble-table-column-icon element to define + * One or more may be added as children of a nimble-table-column-mapping element to define * how specific data values should be displayed as icons in that column's cells. */ export class MappingIcon extends Mapping { diff --git a/packages/nimble-components/src/mapping/spinner/index.ts b/packages/nimble-components/src/mapping/spinner/index.ts index 1e39caf62d..d80e969484 100644 --- a/packages/nimble-components/src/mapping/spinner/index.ts +++ b/packages/nimble-components/src/mapping/spinner/index.ts @@ -12,7 +12,7 @@ declare global { /** * Maps data values to a spinner. - * One or more may be added as children of a nimble-table-column-icon element to define + * One or more may be added as children of a nimble-table-column-mapping element to define * which specific data values should be displayed as spinners in that column's cells. */ export class MappingSpinner extends Mapping { diff --git a/packages/nimble-components/src/mapping/text/index.ts b/packages/nimble-components/src/mapping/text/index.ts index 1a2d85f78b..f70a923c3d 100644 --- a/packages/nimble-components/src/mapping/text/index.ts +++ b/packages/nimble-components/src/mapping/text/index.ts @@ -12,7 +12,7 @@ declare global { /** * Defines a mapping from one data value ('key' property) to display text ('text' property). - * One or more may be added as children of a nimble-table-column-icon element to define + * One or more may be added as children of a nimble-table-column-mapping element to define * how a specific data value should be displayed as text in that column's cells. */ export class MappingText extends Mapping { diff --git a/packages/nimble-components/src/table-column/enum-base/types.ts b/packages/nimble-components/src/table-column/enum-base/types.ts index 5b17b98c43..6159447ebc 100644 --- a/packages/nimble-components/src/table-column/enum-base/types.ts +++ b/packages/nimble-components/src/table-column/enum-base/types.ts @@ -1,5 +1,5 @@ /** - * Input data types for mapping-based columns (i.e. enum text and icon) + * Input data types for mapping-based columns * @public */ export const MappingKeyType = { diff --git a/packages/nimble-components/src/table-column/icon/cell-view/tests/table-column-icon-cell-view.spec.ts b/packages/nimble-components/src/table-column/icon/cell-view/tests/table-column-icon-cell-view.spec.ts deleted file mode 100644 index a816125a6f..0000000000 --- a/packages/nimble-components/src/table-column/icon/cell-view/tests/table-column-icon-cell-view.spec.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { TableColumnIconCellView, tableColumnIconCellViewTag } from '..'; - -describe('TableColumnIconCellView', () => { - it('should export its tag', () => { - expect(tableColumnIconCellViewTag).toBe( - 'nimble-table-column-icon-cell-view' - ); - }); - - it('can construct an element instance', () => { - expect( - document.createElement('nimble-table-column-icon-cell-view') - ).toBeInstanceOf(TableColumnIconCellView); - }); -}); diff --git a/packages/nimble-components/src/table-column/icon/group-header-view/tests/table-column-icon-group-header-view.spec.ts b/packages/nimble-components/src/table-column/icon/group-header-view/tests/table-column-icon-group-header-view.spec.ts deleted file mode 100644 index e3f5a6a15d..0000000000 --- a/packages/nimble-components/src/table-column/icon/group-header-view/tests/table-column-icon-group-header-view.spec.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { - TableColumnIconGroupHeaderView, - tableColumnIconGroupHeaderViewTag -} from '..'; - -describe('TableColumnIconGroupHeaderView', () => { - it('should export its tag', () => { - expect(tableColumnIconGroupHeaderViewTag).toBe( - 'nimble-table-column-icon-group-header-view' - ); - }); - - it('can construct an element instance', () => { - expect( - document.createElement('nimble-table-column-icon-group-header-view') - ).toBeInstanceOf(TableColumnIconGroupHeaderView); - }); -}); diff --git a/packages/nimble-components/src/table-column/icon/cell-view/index.ts b/packages/nimble-components/src/table-column/mapping/cell-view/index.ts similarity index 86% rename from packages/nimble-components/src/table-column/icon/cell-view/index.ts rename to packages/nimble-components/src/table-column/mapping/cell-view/index.ts index e448f4d399..c851cdd23b 100644 --- a/packages/nimble-components/src/table-column/icon/cell-view/index.ts +++ b/packages/nimble-components/src/table-column/mapping/cell-view/index.ts @@ -20,14 +20,14 @@ import { MappingTextConfig } from '../../enum-base/models/mapping-text-config'; declare global { interface HTMLElementTagNameMap { - 'nimble-table-column-icon-cell-view': TableColumnIconCellView; + 'nimble-table-column-mapping-cell-view': TableColumnMappingCellView; } } /** - * The cell view for the icon column + * The cell view for the mapping column */ -export class TableColumnIconCellView +export class TableColumnMappingCellView extends TableCellView< TableColumnEnumCellRecord, TableColumnEnumColumnConfig @@ -93,10 +93,10 @@ export class TableColumnIconCellView } } -const iconCellView = TableColumnIconCellView.compose({ - baseName: 'table-column-icon-cell-view', +const mappingCellView = TableColumnMappingCellView.compose({ + baseName: 'table-column-mapping-cell-view', template, styles }); -DesignSystem.getOrCreate().withPrefix('nimble').register(iconCellView()); -export const tableColumnIconCellViewTag = 'nimble-table-column-icon-cell-view'; +DesignSystem.getOrCreate().withPrefix('nimble').register(mappingCellView()); +export const tableColumnMappingCellViewTag = 'nimble-table-column-mapping-cell-view'; diff --git a/packages/nimble-components/src/table-column/icon/cell-view/styles.ts b/packages/nimble-components/src/table-column/mapping/cell-view/styles.ts similarity index 100% rename from packages/nimble-components/src/table-column/icon/cell-view/styles.ts rename to packages/nimble-components/src/table-column/mapping/cell-view/styles.ts diff --git a/packages/nimble-components/src/table-column/icon/cell-view/template.ts b/packages/nimble-components/src/table-column/mapping/cell-view/template.ts similarity index 70% rename from packages/nimble-components/src/table-column/icon/cell-view/template.ts rename to packages/nimble-components/src/table-column/mapping/cell-view/template.ts index 1f17521198..94c142c529 100644 --- a/packages/nimble-components/src/table-column/icon/cell-view/template.ts +++ b/packages/nimble-components/src/table-column/mapping/cell-view/template.ts @@ -1,18 +1,18 @@ import { html, when } from '@microsoft/fast-element'; -import type { TableColumnIconCellView } from '.'; +import type { TableColumnMappingCellView } from '.'; import { overflow } from '../../../utilities/directive/overflow'; // prettier-ignore -export const template = html` +export const template = html` ${when( x => x.visualizationTemplate, - html` + html` ${x => x.visualizationTemplate} ` )} - ${when(x => !x.textHidden, html` + ${when(x => !x.textHidden, html` (x.hasOverflow && x.text ? x.text : null)} diff --git a/packages/nimble-components/src/table-column/mapping/cell-view/tests/table-column-mapping-cell-view.spec.ts b/packages/nimble-components/src/table-column/mapping/cell-view/tests/table-column-mapping-cell-view.spec.ts new file mode 100644 index 0000000000..dbc69cf988 --- /dev/null +++ b/packages/nimble-components/src/table-column/mapping/cell-view/tests/table-column-mapping-cell-view.spec.ts @@ -0,0 +1,15 @@ +import { TableColumnMappingCellView, tableColumnMappingCellViewTag } from '..'; + +describe('TableColumnMappingCellView', () => { + it('should export its tag', () => { + expect(tableColumnMappingCellViewTag).toBe( + 'nimble-table-column-mapping-cell-view' + ); + }); + + it('can construct an element instance', () => { + expect( + document.createElement('nimble-table-column-mapping-cell-view') + ).toBeInstanceOf(TableColumnMappingCellView); + }); +}); diff --git a/packages/nimble-components/src/table-column/icon/group-header-view/index.ts b/packages/nimble-components/src/table-column/mapping/group-header-view/index.ts similarity index 80% rename from packages/nimble-components/src/table-column/icon/group-header-view/index.ts rename to packages/nimble-components/src/table-column/mapping/group-header-view/index.ts index 87f142f036..40f96149e5 100644 --- a/packages/nimble-components/src/table-column/icon/group-header-view/index.ts +++ b/packages/nimble-components/src/table-column/mapping/group-header-view/index.ts @@ -18,14 +18,14 @@ import { MappingTextConfig } from '../../enum-base/models/mapping-text-config'; declare global { interface HTMLElementTagNameMap { - 'nimble-table-column-icon-group-header-view': TableColumnIconGroupHeaderView; + 'nimble-table-column-mapping-group-header-view': TableColumnMappingGroupHeaderView; } } /** - * The group header view for the icon column + * The group header view for the mapping column */ -export class TableColumnIconGroupHeaderView +export class TableColumnMappingGroupHeaderView extends TableColumnTextGroupHeaderViewBase< TableFieldValue, TableColumnEnumColumnConfig @@ -68,10 +68,12 @@ export class TableColumnIconGroupHeaderView } } -const iconGroupHeaderView = TableColumnIconGroupHeaderView.compose({ - baseName: 'table-column-icon-group-header-view', +const mappingGroupHeaderView = TableColumnMappingGroupHeaderView.compose({ + baseName: 'table-column-mapping-group-header-view', template, styles }); -DesignSystem.getOrCreate().withPrefix('nimble').register(iconGroupHeaderView()); -export const tableColumnIconGroupHeaderViewTag = 'nimble-table-column-icon-group-header-view'; +DesignSystem.getOrCreate() + .withPrefix('nimble') + .register(mappingGroupHeaderView()); +export const tableColumnMappingGroupHeaderViewTag = 'nimble-table-column-mapping-group-header-view'; diff --git a/packages/nimble-components/src/table-column/icon/group-header-view/styles.ts b/packages/nimble-components/src/table-column/mapping/group-header-view/styles.ts similarity index 100% rename from packages/nimble-components/src/table-column/icon/group-header-view/styles.ts rename to packages/nimble-components/src/table-column/mapping/group-header-view/styles.ts diff --git a/packages/nimble-components/src/table-column/icon/group-header-view/template.ts b/packages/nimble-components/src/table-column/mapping/group-header-view/template.ts similarity index 73% rename from packages/nimble-components/src/table-column/icon/group-header-view/template.ts rename to packages/nimble-components/src/table-column/mapping/group-header-view/template.ts index 4f93f49851..5764ef5219 100644 --- a/packages/nimble-components/src/table-column/icon/group-header-view/template.ts +++ b/packages/nimble-components/src/table-column/mapping/group-header-view/template.ts @@ -1,13 +1,13 @@ import { html, when } from '@microsoft/fast-element'; -import type { TableColumnIconGroupHeaderView } from '.'; +import type { TableColumnMappingGroupHeaderView } from '.'; import { overflow } from '../../../utilities/directive/overflow'; // prettier-ignore -export const template = html` +export const template = html` ${when( x => x.visualizationTemplate, - html` + html` ${x => x.visualizationTemplate} diff --git a/packages/nimble-components/src/table-column/mapping/group-header-view/tests/table-column-mapping-group-header-view.spec.ts b/packages/nimble-components/src/table-column/mapping/group-header-view/tests/table-column-mapping-group-header-view.spec.ts new file mode 100644 index 0000000000..48c6dbf18c --- /dev/null +++ b/packages/nimble-components/src/table-column/mapping/group-header-view/tests/table-column-mapping-group-header-view.spec.ts @@ -0,0 +1,20 @@ +import { + TableColumnMappingGroupHeaderView, + tableColumnMappingGroupHeaderViewTag +} from '..'; + +describe('TableColumnMappingGroupHeaderView', () => { + it('should export its tag', () => { + expect(tableColumnMappingGroupHeaderViewTag).toBe( + 'nimble-table-column-mapping-group-header-view' + ); + }); + + it('can construct an element instance', () => { + expect( + document.createElement( + 'nimble-table-column-mapping-group-header-view' + ) + ).toBeInstanceOf(TableColumnMappingGroupHeaderView); + }); +}); diff --git a/packages/nimble-components/src/table-column/icon/index.ts b/packages/nimble-components/src/table-column/mapping/index.ts similarity index 80% rename from packages/nimble-components/src/table-column/icon/index.ts rename to packages/nimble-components/src/table-column/mapping/index.ts index 46f0846f48..e62b459b44 100644 --- a/packages/nimble-components/src/table-column/icon/index.ts +++ b/packages/nimble-components/src/table-column/mapping/index.ts @@ -16,10 +16,10 @@ import { mixinGroupableColumnAPI } from '../mixins/groupable-column'; import { mixinFractionalWidthColumnAPI } from '../mixins/fractional-width-column'; import { MappingSpinner } from '../../mapping/spinner'; import { MappingIcon } from '../../mapping/icon'; -import { TableColumnIconValidator } from './models/table-column-icon-validator'; +import { TableColumnMappingValidator } from './models/table-column-mapping-validator'; import type { ColumnInternalsOptions } from '../base/models/column-internals'; -import { tableColumnIconGroupHeaderViewTag } from './group-header-view'; -import { tableColumnIconCellViewTag } from './cell-view'; +import { tableColumnMappingGroupHeaderViewTag } from './group-header-view'; +import { tableColumnMappingCellViewTag } from './cell-view'; import type { Mapping } from '../../mapping/base'; import type { MappingConfig } from '../enum-base/models/mapping-config'; import { MappingIconConfig } from '../enum-base/models/mapping-icon-config'; @@ -30,18 +30,19 @@ import { TableColumnMappingWidthMode } from './types'; declare global { interface HTMLElementTagNameMap { - 'nimble-table-column-icon': TableColumnIcon; + 'nimble-table-column-mapping': TableColumnMapping; } } /** - * Table column that maps values to icons / spinners + * Table column that maps number, boolean, or string values to an icon, a spinner, + * text, or an icon/spinner with text. */ -export class TableColumnIcon extends mixinGroupableColumnAPI( +export class TableColumnMapping extends mixinGroupableColumnAPI( mixinFractionalWidthColumnAPI( TableColumnEnumBase< TableColumnEnumColumnConfig, - TableColumnIconValidator + TableColumnMappingValidator > ) ) { @@ -54,14 +55,14 @@ export class TableColumnIcon extends mixinGroupableColumnAPI( } } - protected override getColumnInternalsOptions(): ColumnInternalsOptions { + protected override getColumnInternalsOptions(): ColumnInternalsOptions { return { cellRecordFieldNames: ['value'], - cellViewTag: tableColumnIconCellViewTag, - groupHeaderViewTag: tableColumnIconGroupHeaderViewTag, + cellViewTag: tableColumnMappingCellViewTag, + groupHeaderViewTag: tableColumnMappingGroupHeaderViewTag, delegatedEvents: [], sortOperation: TableColumnSortOperation.basic, - validator: new TableColumnIconValidator() + validator: new TableColumnMappingValidator() }; } @@ -115,13 +116,13 @@ export class TableColumnIcon extends mixinGroupableColumnAPI( } } -const nimbleTableColumnIcon = TableColumnIcon.compose({ - baseName: 'table-column-icon', +const nimbleTableColumnMapping = TableColumnMapping.compose({ + baseName: 'table-column-mapping', template, styles }); DesignSystem.getOrCreate() .withPrefix('nimble') - .register(nimbleTableColumnIcon()); -export const tableColumnIconTag = 'nimble-table-column-icon'; + .register(nimbleTableColumnMapping()); +export const tableColumnMappingTag = 'nimble-table-column-mapping'; diff --git a/packages/nimble-components/src/table-column/icon/models/table-column-icon-validator.ts b/packages/nimble-components/src/table-column/mapping/models/table-column-mapping-validator.ts similarity index 80% rename from packages/nimble-components/src/table-column/icon/models/table-column-icon-validator.ts rename to packages/nimble-components/src/table-column/mapping/models/table-column-mapping-validator.ts index 0fb5ec08ed..2a3ebaa327 100644 --- a/packages/nimble-components/src/table-column/icon/models/table-column-icon-validator.ts +++ b/packages/nimble-components/src/table-column/mapping/models/table-column-mapping-validator.ts @@ -8,7 +8,7 @@ import { } from '../../enum-base/models/table-column-enum-base-validator'; import type { MappingKeyType } from '../../enum-base/types'; -const iconValidityFlagNames = [ +const mappingColumnValidityFlagNames = [ ...enumBaseValidityFlagNames, 'unsupportedMappingType', 'invalidIconName', @@ -16,13 +16,13 @@ const iconValidityFlagNames = [ ] as const; /** - * Validator for TableColumnIcon + * Validator for TableColumnMapping */ -export class TableColumnIconValidator extends TableColumnEnumBaseValidator< - typeof iconValidityFlagNames +export class TableColumnMappingValidator extends TableColumnEnumBaseValidator< + typeof mappingColumnValidityFlagNames > { public constructor() { - super(iconValidityFlagNames); + super(mappingColumnValidityFlagNames); } private static isIconMappingElement( @@ -60,21 +60,21 @@ export class TableColumnIconValidator extends TableColumnEnumBaseValidator< private validateIconNames(mappings: Mapping[]): void { const invalid = mappings - .filter(TableColumnIconValidator.isIconMappingElement) - .some(TableColumnIconValidator.hasUnresolvedIcon); + .filter(TableColumnMappingValidator.isIconMappingElement) + .some(TableColumnMappingValidator.hasUnresolvedIcon); this.setConditionValue('invalidIconName', invalid); } private validateNoMissingText(mappings: Mapping[]): void { const invalid = mappings - .filter(TableColumnIconValidator.isSupportedMappingElement) + .filter(TableColumnMappingValidator.isSupportedMappingElement) .some(mapping => mapping.text === undefined); this.setConditionValue('missingTextValue', invalid); } private validateMappingTypes(mappings: Mapping[]): void { const valid = mappings.every( - TableColumnIconValidator.isSupportedMappingElement + TableColumnMappingValidator.isSupportedMappingElement ); this.setConditionValue('unsupportedMappingType', !valid); } diff --git a/packages/nimble-components/src/table-column/icon/testing/table-column-icon.pageobject.ts b/packages/nimble-components/src/table-column/mapping/testing/table-column-mapping.pageobject.ts similarity index 97% rename from packages/nimble-components/src/table-column/icon/testing/table-column-icon.pageobject.ts rename to packages/nimble-components/src/table-column/mapping/testing/table-column-mapping.pageobject.ts index 60b52f3249..f18ef06bd8 100644 --- a/packages/nimble-components/src/table-column/icon/testing/table-column-icon.pageobject.ts +++ b/packages/nimble-components/src/table-column/mapping/testing/table-column-mapping.pageobject.ts @@ -6,9 +6,9 @@ import type { TableCellView } from '../../base/cell-view'; import type { TableGroupHeaderView } from '../../base/group-header-view'; /** - * Page object for `nimble-table-column-icon`. + * Page object for `nimble-table-column-mapping`. */ -export class TableColumnIconPageObject { +export class TableColumnMappingPageObject { public constructor(private readonly tablePageObject: TablePageObject) {} public getRenderedCellIconSeverity( diff --git a/packages/nimble-components/src/table-column/icon/tests/table-column-icon.spec.ts b/packages/nimble-components/src/table-column/mapping/tests/table-column-mapping.spec.ts similarity index 93% rename from packages/nimble-components/src/table-column/icon/tests/table-column-icon.spec.ts rename to packages/nimble-components/src/table-column/mapping/tests/table-column-mapping.spec.ts index 40a2c3b656..b4d4351637 100644 --- a/packages/nimble-components/src/table-column/icon/tests/table-column-icon.spec.ts +++ b/packages/nimble-components/src/table-column/mapping/tests/table-column-mapping.spec.ts @@ -1,7 +1,7 @@ import { html, repeat, ref } from '@microsoft/fast-element'; import { parameterizeSpec, parameterizeSuite } from '@ni/jasmine-parameterized'; import { Table, tableTag } from '../../../table'; -import { TableColumnIcon, tableColumnIconTag } from '..'; +import { TableColumnMapping, tableColumnMappingTag } from '..'; import { waitForUpdatesAsync } from '../../../testing/async-helpers'; import { type Fixture, fixture } from '../../../utilities/tests/fixture'; import type { TableRecord } from '../../../table/types'; @@ -17,7 +17,7 @@ import { MappingKeyType } from '../../enum-base/types'; import { mappingSpinnerTag } from '../../../mapping/spinner'; import { spinnerTag } from '../../../spinner'; import { themeProviderTag } from '../../../theme-provider'; -import { TableColumnIconPageObject } from '../testing/table-column-icon.pageobject'; +import { TableColumnMappingPageObject } from '../testing/table-column-mapping.pageobject'; import { mappingUserTag } from '../../../mapping/user'; import { TableColumnMappingWidthMode } from '../types'; import { defaultMinPixelWidth } from '../../base/types'; @@ -47,17 +47,17 @@ interface BasicTextMapping { class Model { public table!: Table; - public col1!: TableColumnIcon; + public col1!: TableColumnMapping; } interface ModelFixture extends Fixture { model: Model; } -describe('TableColumnIcon', () => { +describe('TableColumnMapping', () => { let connect: () => Promise; let disconnect: () => Promise; let pageObject: TablePageObject; - let columnPageObject: TableColumnIconPageObject; + let columnPageObject: TableColumnMappingPageObject; let model: Model; // prettier-ignore @@ -71,7 +71,7 @@ describe('TableColumnIcon', () => { const result = await fixture>(html` <${themeProviderTag} lang="en-US"> <${tableTag} ${ref('table')} style="width: 700px"> - <${tableColumnIconTag} ${ref('col1')} field-name="field1" key-type="${options.keyType}"> + <${tableColumnMappingTag} ${ref('col1')} field-name="field1" key-type="${options.keyType}"> Column 1 ${repeat(() => options.iconMappings ?? [], html` <${mappingIconTag} @@ -94,7 +94,7 @@ describe('TableColumnIcon', () => { text="${x => x.text}" `)} - + <${themeProviderTag}>`, { source }); return { @@ -110,13 +110,13 @@ describe('TableColumnIcon', () => { }); it('should export its tag', () => { - expect(tableColumnIconTag).toBe('nimble-table-column-icon'); + expect(tableColumnMappingTag).toBe('nimble-table-column-mapping'); }); it('can construct an element instance', () => { expect( - document.createElement('nimble-table-column-icon') - ).toBeInstanceOf(TableColumnIcon); + document.createElement('nimble-table-column-mapping') + ).toBeInstanceOf(TableColumnMapping); }); describe('various key types', () => { @@ -136,13 +136,13 @@ describe('TableColumnIcon', () => { pageObject = new TablePageObject( model.table ); - columnPageObject = new TableColumnIconPageObject(pageObject); + columnPageObject = new TableColumnMappingPageObject(pageObject); await model.table.setData([{ field1: value.key }]); await connect(); await waitForUpdatesAsync(); expect( - pageObject.getRenderedIconColumnCellIconTagName(0, 0) + pageObject.getRenderedMappingColumnCellIconTagName(0, 0) ).toBe(iconXmarkTag); }); }); @@ -156,13 +156,13 @@ describe('TableColumnIcon', () => { pageObject = new TablePageObject( model.table ); - columnPageObject = new TableColumnIconPageObject(pageObject); + columnPageObject = new TableColumnMappingPageObject(pageObject); await model.table.setData([{ field1: value.key }]); await connect(); await waitForUpdatesAsync(); expect( - pageObject.getRenderedIconColumnCellIconTagName(0, 0) + pageObject.getRenderedMappingColumnCellIconTagName(0, 0) ).toBe(spinnerTag); }); }); @@ -174,12 +174,12 @@ describe('TableColumnIcon', () => { iconMappings: [{ key: 'a', text: 'alpha', icon: iconXmarkTag }] })); pageObject = new TablePageObject(model.table); - columnPageObject = new TableColumnIconPageObject(pageObject); + columnPageObject = new TableColumnMappingPageObject(pageObject); await model.table.setData([{ field1: 'no match' }]); await connect(); await waitForUpdatesAsync(); - expect(() => pageObject.getRenderedIconColumnCellIconTagName(0, 0)).toThrowError(); + expect(() => pageObject.getRenderedMappingColumnCellIconTagName(0, 0)).toThrowError(); }); it('displays blank when no icon specified for mapping', async () => { @@ -188,12 +188,12 @@ describe('TableColumnIcon', () => { iconMappings: [{ key: 'a', text: 'alpha', icon: undefined }] })); pageObject = new TablePageObject(model.table); - columnPageObject = new TableColumnIconPageObject(pageObject); + columnPageObject = new TableColumnMappingPageObject(pageObject); await model.table.setData([{ field1: 'a' }]); await connect(); await waitForUpdatesAsync(); - expect(() => pageObject.getRenderedIconColumnCellIconTagName(0, 0)).toThrowError(); + expect(() => pageObject.getRenderedMappingColumnCellIconTagName(0, 0)).toThrowError(); }); it('changing fieldName updates display', async () => { @@ -205,7 +205,7 @@ describe('TableColumnIcon', () => { ] })); pageObject = new TablePageObject(model.table); - columnPageObject = new TableColumnIconPageObject(pageObject); + columnPageObject = new TableColumnMappingPageObject(pageObject); await model.table.setData([{ field1: 'a', field2: 'b' }]); await connect(); await waitForUpdatesAsync(); @@ -213,7 +213,7 @@ describe('TableColumnIcon', () => { model.col1.fieldName = 'field2'; await waitForUpdatesAsync(); - expect(pageObject.getRenderedIconColumnCellIconTagName(0, 0)).toBe( + expect(pageObject.getRenderedMappingColumnCellIconTagName(0, 0)).toBe( iconCheckTag ); }); @@ -224,7 +224,7 @@ describe('TableColumnIcon', () => { iconMappings: [{ key: 'a', text: 'alpha', icon: iconXmarkTag }] })); pageObject = new TablePageObject(model.table); - columnPageObject = new TableColumnIconPageObject(pageObject); + columnPageObject = new TableColumnMappingPageObject(pageObject); await model.table.setData([{ field1: 'a' }]); await connect(); await waitForUpdatesAsync(); @@ -233,7 +233,7 @@ describe('TableColumnIcon', () => { mapping.icon = iconCheckTag; await waitForUpdatesAsync(); - expect(pageObject.getRenderedIconColumnCellIconTagName(0, 0)).toBe( + expect(pageObject.getRenderedMappingColumnCellIconTagName(0, 0)).toBe( iconCheckTag ); }); @@ -244,7 +244,7 @@ describe('TableColumnIcon', () => { iconMappings: [{ key: 'a', text: 'alpha', icon: iconXmarkTag }] })); pageObject = new TablePageObject(model.table); - columnPageObject = new TableColumnIconPageObject(pageObject); + columnPageObject = new TableColumnMappingPageObject(pageObject); await model.table.setData([{ field1: 'a' }]); await connect(); await waitForUpdatesAsync(); @@ -264,7 +264,7 @@ describe('TableColumnIcon', () => { iconMappings: [{ key: 'a', text: 'alpha', icon: iconXmarkTag }] })); pageObject = new TablePageObject(model.table); - columnPageObject = new TableColumnIconPageObject(pageObject); + columnPageObject = new TableColumnMappingPageObject(pageObject); await model.table.setData([{ field1: 'b' }]); await connect(); await waitForUpdatesAsync(); @@ -273,7 +273,7 @@ describe('TableColumnIcon', () => { mapping.key = 'b'; await waitForUpdatesAsync(); - expect(pageObject.getRenderedIconColumnCellIconTagName(0, 0)).toBe( + expect(pageObject.getRenderedMappingColumnCellIconTagName(0, 0)).toBe( iconXmarkTag ); }); @@ -294,7 +294,7 @@ describe('TableColumnIcon', () => { pageObject = new TablePageObject( model.table ); - columnPageObject = new TableColumnIconPageObject(pageObject); + columnPageObject = new TableColumnMappingPageObject(pageObject); await model.table.setData([{ field1: 'a' }]); await connect(); await waitForUpdatesAsync(); @@ -314,7 +314,7 @@ describe('TableColumnIcon', () => { iconMappings: [{ key: 'b', text: 'bravo', icon: undefined }] })); pageObject = new TablePageObject(model.table); - columnPageObject = new TableColumnIconPageObject(pageObject); + columnPageObject = new TableColumnMappingPageObject(pageObject); await model.table.setData([{ field1: 'b' }]); await connect(); await waitForUpdatesAsync(); @@ -331,17 +331,17 @@ describe('TableColumnIcon', () => { iconMappings: [{ key: 'a', text: 'alpha', icon: iconXmarkTag }] })); pageObject = new TablePageObject(model.table); - columnPageObject = new TableColumnIconPageObject(pageObject); + columnPageObject = new TableColumnMappingPageObject(pageObject); await model.table.setData([{ field1: 'a' }]); await connect(); await waitForUpdatesAsync(); - expect(pageObject.getRenderedIconColumnCellIconTagName(0, 0)).toBe( + expect(pageObject.getRenderedMappingColumnCellIconTagName(0, 0)).toBe( iconXmarkTag ); model.col1.removeChild(model.col1.firstElementChild!); await waitForUpdatesAsync(); - expect(() => pageObject.getRenderedIconColumnCellIconTagName(0, 0)).toThrowError(); + expect(() => pageObject.getRenderedMappingColumnCellIconTagName(0, 0)).toThrowError(); }); it('clears group header when mappings removed', async () => { @@ -350,7 +350,7 @@ describe('TableColumnIcon', () => { iconMappings: [{ key: 'a', text: 'alpha', icon: iconXmarkTag }] })); pageObject = new TablePageObject(model.table); - columnPageObject = new TableColumnIconPageObject(pageObject); + columnPageObject = new TableColumnMappingPageObject(pageObject); await model.table.setData([{ field1: 'a' }]); model.col1.groupIndex = 0; await connect(); @@ -444,11 +444,11 @@ describe('TableColumnIcon', () => { async function setupInvalidMappings(): Promise>> { return fixture>( html`<${tableTag} style="width: 700px"> - <${tableColumnIconTag} field-name="field1"> + <${tableColumnMappingTag} field-name="field1"> Column 1 <${mappingUserTag} key="foo"> <${mappingUserTag} key="bar"> - + ` ); } @@ -457,7 +457,7 @@ describe('TableColumnIcon', () => { ({ element, connect, disconnect } = await setupInvalidMappings()); await connect(); await waitForUpdatesAsync(); - const column = element.columns[0] as TableColumnIcon; + const column = element.columns[0] as TableColumnMapping; expect(column.checkValidity()).toBeFalse(); expect(column.validity.unsupportedMappingType).toBeTrue(); }); @@ -612,7 +612,7 @@ describe('TableColumnIcon', () => { pageObject = new TablePageObject( model.table ); - columnPageObject = new TableColumnIconPageObject(pageObject); + columnPageObject = new TableColumnMappingPageObject(pageObject); model.col1.groupIndex = 0; await model.table.setData(value.data); await connect(); @@ -650,7 +650,7 @@ describe('TableColumnIcon', () => { pageObject = new TablePageObject( model.table ); - columnPageObject = new TableColumnIconPageObject( + columnPageObject = new TableColumnMappingPageObject( pageObject ); await model.table.setData([{ field1: value.type }]); @@ -780,7 +780,7 @@ describe('TableColumnIcon', () => { pageObject = new TablePageObject( model.table ); - columnPageObject = new TableColumnIconPageObject( + columnPageObject = new TableColumnMappingPageObject( pageObject ); await model.table.setData([ diff --git a/packages/nimble-components/src/table-column/icon/tests/types.spec.ts b/packages/nimble-components/src/table-column/mapping/tests/types.spec.ts similarity index 90% rename from packages/nimble-components/src/table-column/icon/tests/types.spec.ts rename to packages/nimble-components/src/table-column/mapping/tests/types.spec.ts index bc51341459..a43941216b 100644 --- a/packages/nimble-components/src/table-column/icon/tests/types.spec.ts +++ b/packages/nimble-components/src/table-column/mapping/tests/types.spec.ts @@ -1,6 +1,6 @@ import type { TableColumnMappingWidthMode } from '../types'; -describe('Icon column type', () => { +describe('Mapping column type', () => { it('TableColumnMappingWidthMode fails compile if assigning arbitrary string values', () => { // @ts-expect-error This expect will fail if the enum-like type is missing "as const" const widthMode: TableColumnMappingWidthMode = 'hello'; diff --git a/packages/nimble-components/src/table-column/icon/types.ts b/packages/nimble-components/src/table-column/mapping/types.ts similarity index 86% rename from packages/nimble-components/src/table-column/icon/types.ts rename to packages/nimble-components/src/table-column/mapping/types.ts index ae19b32139..6b8502a416 100644 --- a/packages/nimble-components/src/table-column/icon/types.ts +++ b/packages/nimble-components/src/table-column/mapping/types.ts @@ -1,5 +1,5 @@ /** - * Width mode for the icon column + * Width mode for the mapping column */ export const TableColumnMappingWidthMode = { default: undefined, diff --git a/packages/nimble-components/src/table/specs/table-columns-hld.md b/packages/nimble-components/src/table/specs/table-columns-hld.md index 03b93cac57..de3f8be1df 100644 --- a/packages/nimble-components/src/table/specs/table-columns-hld.md +++ b/packages/nimble-components/src/table/specs/table-columns-hld.md @@ -23,7 +23,7 @@ Column custom elements will be provided to the table as slotted elements. The sl ```HTML Name - Status + Value ... ``` @@ -97,7 +97,6 @@ nimble-table-column-progress nimble-table-column-text-field nimble-table-column-number-field nimble-table-column-mapping -nimble-table-column-icon ``` Note: Despite currently being presented as text, the mapping column is not `nimble-table-column-mapping-text` because it may render with alternate presentations in the future (e.g. icon + text) so "mapping" is considered the presentation. diff --git a/packages/nimble-components/src/table/testing/table.pageobject.ts b/packages/nimble-components/src/table/testing/table.pageobject.ts index 9a843a06b6..09e61c5b81 100644 --- a/packages/nimble-components/src/table/testing/table.pageobject.ts +++ b/packages/nimble-components/src/table/testing/table.pageobject.ts @@ -193,11 +193,11 @@ export class TablePageObject { return anchor; } - public getRenderedIconColumnCellIconTagName( + public getRenderedMappingColumnCellIconTagName( rowIndex: number, columnIndex: number ): string { - const iconOrSpinner = this.getRenderedIconColumnIconOrSpinner( + const iconOrSpinner = this.getRenderedMappingColumnIconOrSpinner( this.getRenderedCellView(rowIndex, columnIndex) ); return iconOrSpinner.tagName.toLocaleLowerCase(); @@ -797,7 +797,7 @@ export class TablePageObject { return nodeChildren[0]; // header content should be first item in final slot element } - private getRenderedIconColumnIconOrSpinner( + private getRenderedMappingColumnIconOrSpinner( view: TableCellView | TableGroupHeaderView ): Icon | Spinner { const viewShadowRoot = view.shadowRoot!; diff --git a/packages/spright-components/CHANGELOG.json b/packages/spright-components/CHANGELOG.json index bb03400bc2..43202e3cf3 100644 --- a/packages/spright-components/CHANGELOG.json +++ b/packages/spright-components/CHANGELOG.json @@ -1,6 +1,21 @@ { "name": "@ni/spright-components", "entries": [ + { + "date": "Mon, 06 May 2024 19:00:05 GMT", + "version": "0.0.14", + "tag": "@ni/spright-components_v0.0.14", + "comments": { + "patch": [ + { + "author": "beachball", + "package": "@ni/spright-components", + "comment": "Bump @ni/nimble-components to v28.0.0", + "commit": "not available" + } + ] + } + }, { "date": "Thu, 02 May 2024 18:52:31 GMT", "version": "0.0.13", diff --git a/packages/spright-components/CHANGELOG.md b/packages/spright-components/CHANGELOG.md index 0facbb1ba1..1241a90b2d 100644 --- a/packages/spright-components/CHANGELOG.md +++ b/packages/spright-components/CHANGELOG.md @@ -1,9 +1,17 @@ # Change Log - @ni/spright-components -This log was last generated on Thu, 02 May 2024 18:52:31 GMT and should not be manually modified. +This log was last generated on Mon, 06 May 2024 19:00:05 GMT and should not be manually modified. +## 0.0.14 + +Mon, 06 May 2024 19:00:05 GMT + +### Patches + +- Bump @ni/nimble-components to v28.0.0 + ## 0.0.13 Thu, 02 May 2024 18:52:31 GMT diff --git a/packages/spright-components/package.json b/packages/spright-components/package.json index c24bff6924..0feb682c25 100644 --- a/packages/spright-components/package.json +++ b/packages/spright-components/package.json @@ -1,6 +1,6 @@ { "name": "@ni/spright-components", - "version": "0.0.13", + "version": "0.0.14", "description": "NI Spright Components", "scripts": { "build": "npm run build-components && npm run bundle-components", @@ -55,7 +55,7 @@ "@microsoft/fast-element": "^1.12.0", "@microsoft/fast-foundation": "^2.49.6", "@microsoft/fast-web-utilities": "^6.0.0", - "@ni/nimble-components": "27.2.3", + "@ni/nimble-components": "28.0.0", "@ni/nimble-tokens": "^6.13.5", "tslib": "^2.2.0" }, diff --git a/packages/storybook/src/nimble/icon-base/icons.stories.ts b/packages/storybook/src/nimble/icon-base/icons.stories.ts index 0aa027fd69..129765df44 100644 --- a/packages/storybook/src/nimble/icon-base/icons.stories.ts +++ b/packages/storybook/src/nimble/icon-base/icons.stories.ts @@ -7,7 +7,7 @@ import { scssInternalPropertySetterMarkdown } from '@ni/nimble-components/dist/esm/theme-provider/design-token-names'; import { Table, tableTag } from '@ni/nimble-components/dist/esm/table'; -import { tableColumnIconTag } from '@ni/nimble-components/dist/esm/table-column/icon'; +import { tableColumnMappingTag } from '@ni/nimble-components/dist/esm/table-column/mapping'; import { mappingIconTag } from '@ni/nimble-components/dist/esm/mapping/icon'; import { tableColumnTextTag } from '@ni/nimble-components/dist/esm/table-column/text'; import { IconSeverity } from '@ni/nimble-components/dist/esm/icon-base/types'; @@ -86,7 +86,7 @@ export const icons: StoryObj = { style="height: calc((34px * var(--data-length)) + 32px);" data-unused="${x => updateData(x.tableRef)}" > - <${tableColumnIconTag} field-name="tag" key-type="string"> + <${tableColumnMappingTag} field-name="tag" key-type="string"> Icon ${repeat(() => data, html` <${mappingIconTag} @@ -97,7 +97,7 @@ export const icons: StoryObj = { text-hidden > `)} - + <${tableColumnTextTag} field-name="tag"> Tag Name diff --git a/packages/storybook/src/nimble/mapping/icon/mapping-icon.stories.ts b/packages/storybook/src/nimble/mapping/icon/mapping-icon.stories.ts index 38f27466d4..b582e9c9d3 100644 --- a/packages/storybook/src/nimble/mapping/icon/mapping-icon.stories.ts +++ b/packages/storybook/src/nimble/mapping/icon/mapping-icon.stories.ts @@ -10,7 +10,7 @@ const metadata: Meta = { docs: { description: { component: - 'The `nimble-mapping-icon` element defines a mapping from a data value to an icon representation to use for that value. It is meant to be used as content of the `nimble-table-column-icon` element.' + 'The `nimble-mapping-icon` element defines a mapping from a data value to an icon representation to use for that value. It is meant to be used as content of the `nimble-table-column-mapping` element.' } } } diff --git a/packages/storybook/src/nimble/mapping/spinner/mapping-spinner.stories.ts b/packages/storybook/src/nimble/mapping/spinner/mapping-spinner.stories.ts index d503f486d9..f07098343a 100644 --- a/packages/storybook/src/nimble/mapping/spinner/mapping-spinner.stories.ts +++ b/packages/storybook/src/nimble/mapping/spinner/mapping-spinner.stories.ts @@ -10,7 +10,7 @@ const metadata: Meta = { docs: { description: { component: - 'The `nimble-mapping-spinner` element defines a mapping from a data value to the Nimble spinner. It is meant to be used as content of the `nimble-table-column-icon` element.' + 'The `nimble-mapping-spinner` element defines a mapping from a data value to the Nimble spinner. It is meant to be used as content of the `nimble-table-column-mapping` element.' } } } diff --git a/packages/storybook/src/nimble/mapping/text/mapping-text.stories.ts b/packages/storybook/src/nimble/mapping/text/mapping-text.stories.ts index 9236c1862c..ea8d34b752 100644 --- a/packages/storybook/src/nimble/mapping/text/mapping-text.stories.ts +++ b/packages/storybook/src/nimble/mapping/text/mapping-text.stories.ts @@ -10,7 +10,7 @@ const metadata: Meta = { docs: { description: { component: - 'The `nimble-mapping-text` element defines a mapping from a data value to display text. It is meant to be used as content of the `nimble-table-column-icon` column type element.' + 'The `nimble-mapping-text` element defines a mapping from a data value to display text. It is meant to be used as content of the `nimble-table-column-mapping` column type element.' } } } diff --git a/packages/storybook/src/nimble/table-column/icon/table-column-icon.react.tsx b/packages/storybook/src/nimble/table-column/icon/table-column-icon.react.tsx deleted file mode 100644 index 6a91749a18..0000000000 --- a/packages/storybook/src/nimble/table-column/icon/table-column-icon.react.tsx +++ /dev/null @@ -1,4 +0,0 @@ -import { TableColumnIcon } from '@ni/nimble-components/dist/esm/table-column/icon'; -import { wrap } from '../../../utilities/react-wrapper'; - -export const NimbleTableColumnIcon = wrap(TableColumnIcon); diff --git a/packages/storybook/src/nimble/table-column/icon/table-column-icon-matrix.stories.ts b/packages/storybook/src/nimble/table-column/mapping/table-column-mapping-matrix.stories.ts similarity index 87% rename from packages/storybook/src/nimble/table-column/icon/table-column-icon-matrix.stories.ts rename to packages/storybook/src/nimble/table-column/mapping/table-column-mapping-matrix.stories.ts index febafcbe63..ff3cea2b5b 100644 --- a/packages/storybook/src/nimble/table-column/icon/table-column-icon-matrix.stories.ts +++ b/packages/storybook/src/nimble/table-column/mapping/table-column-mapping-matrix.stories.ts @@ -7,8 +7,8 @@ import { iconQuestionTag } from '@ni/nimble-components/dist/esm/icons/question'; import { mappingIconTag } from '@ni/nimble-components/dist/esm/mapping/icon'; import { mappingSpinnerTag } from '@ni/nimble-components/dist/esm/mapping/spinner'; import { mappingTextTag } from '@ni/nimble-components/dist/esm/mapping/text'; -import { tableColumnIconTag } from '@ni/nimble-components/dist/esm/table-column/icon'; -import { TableColumnMappingWidthMode } from '@ni/nimble-components/dist/esm/table-column/icon/types'; +import { tableColumnMappingTag } from '@ni/nimble-components/dist/esm/table-column/mapping'; +import { TableColumnMappingWidthMode } from '@ni/nimble-components/dist/esm/table-column/mapping/types'; import { isChromatic } from '../../../utilities/isChromatic'; import { createMatrixThemeStory, @@ -47,7 +47,7 @@ const data = [ ] as const; const metadata: Meta = { - title: 'Tests/Table Column: Icon', + title: 'Tests/Table Column: Mapping', parameters: { ...sharedMatrixParameters() } @@ -58,7 +58,7 @@ export default metadata; // prettier-ignore const component = (): ViewTemplate => html` <${tableTag} id-field-name="id" style="height: 520px; ${isChromatic() ? '--ni-private-spinner-animation-play-state:paused' : ''}"> - <${tableColumnIconTag} + <${tableColumnMappingTag} field-name="code" key-type="number" group-index="0" @@ -71,8 +71,8 @@ const component = (): ViewTemplate => html` <${mappingIconTag} key="4" text="Undefined icon, text-hidden" text-hidden> <${mappingIconTag} key="5" text="Undefined icon"> <${mappingTextTag} key="6" text="Text" - - <${tableColumnIconTag} + + <${tableColumnMappingTag} field-name="code" key-type="number" > @@ -81,8 +81,8 @@ const component = (): ViewTemplate => html` <${mappingIconTag} key="0" text="Zero" icon="${iconCheckTag}" severity="success"> <${mappingIconTag} key="1" text="One" icon="${iconCheckTag}" severity="warning"> <${mappingIconTag} key="2" text="Two" icon="${iconCheckTag}" severity="error"> - - <${tableColumnIconTag} + + <${tableColumnMappingTag} field-name="code" key-type="number" width-mode="${TableColumnMappingWidthMode.iconSize}" @@ -94,21 +94,21 @@ const component = (): ViewTemplate => html` <${mappingIconTag} key="2" text="Two" icon="${iconCheckTag}" severity="error" text-hidden> <${mappingIconTag} key="3" text="Three" icon="${iconCheckTag}" severity="information" text-hidden> <${mappingIconTag} key="4" text="Four" icon="${iconCheckTag}" text-hidden> - - <${tableColumnIconTag} + + <${tableColumnMappingTag} field-name="code" key-type="number" > Column 3 <${mappingIconTag} key="-1" text="Unknown value"> <${mappingIconTag} key="0" text="Zero" icon="${iconCheckTag}" severity="information"> - + `; -export const tableColumnIconThemeMatrix: StoryFn = createMatrixThemeStory(component()); +export const tableColumnMappingThemeMatrix: StoryFn = createMatrixThemeStory(component()); -tableColumnIconThemeMatrix.play = async (): Promise => { +tableColumnMappingThemeMatrix.play = async (): Promise => { await Promise.all( Array.from(document.querySelectorAll('nimble-table')).map( async table => { diff --git a/packages/storybook/src/nimble/table-column/icon/table-column-icon.mdx b/packages/storybook/src/nimble/table-column/mapping/table-column-mapping.mdx similarity index 74% rename from packages/storybook/src/nimble/table-column/icon/table-column-icon.mdx rename to packages/storybook/src/nimble/table-column/mapping/table-column-mapping.mdx index 62d8c2e08b..7638d29f9c 100644 --- a/packages/storybook/src/nimble/table-column/icon/table-column-icon.mdx +++ b/packages/storybook/src/nimble/table-column/mapping/table-column-mapping.mdx @@ -1,22 +1,22 @@ import { Canvas, Meta, Controls, Title, Description } from '@storybook/blocks'; import { columnOperationBehavior } from '../base/table-column-stories-utils'; -import * as tableColumnIconStories from './table-column-icon.stories'; +import * as tableColumnMappingStories from './table-column-mapping.stories'; import * as iconMappingStories from '../../mapping/icon/mapping-icon.stories'; import * as spinnerMappingStories from '../../mapping/spinner/mapping-spinner.stories'; import * as textMappingStories from '../../mapping/text/mapping-text.stories'; -import { tableColumnIconTag } from '@ni/nimble-components/dist/esm/table-column/icon'; +import { tableColumnMappingTag } from '@ni/nimble-components/dist/esm/table-column/mapping'; import { tableTag } from '@ni/nimble-components/dist/esm/table'; import { spinnerTag } from '@ni/nimble-components/dist/esm/spinner'; - - +<Meta of={tableColumnMappingStories} /> +<Title of={tableColumnMappingStories} /> -The <Tag name={tableColumnIconTag}/> renders specific number, boolean, or string values as an icon, a spinner, text, or an icon/spinner with text in the <Tag name={tableTag}/>. +The <Tag name={tableColumnMappingTag}/> renders specific number, boolean, or string values as an icon, a spinner, text, or an icon/spinner with text in the <Tag name={tableTag}/>. <p>{columnOperationBehavior}</p> -<Canvas of={tableColumnIconStories.iconColumn} /> -<Controls of={tableColumnIconStories.iconColumn} /> +<Canvas of={tableColumnMappingStories.mappingColumn} /> +<Controls of={tableColumnMappingStories.mappingColumn} /> ## Usage diff --git a/packages/storybook/src/nimble/table-column/mapping/table-column-mapping.react.tsx b/packages/storybook/src/nimble/table-column/mapping/table-column-mapping.react.tsx new file mode 100644 index 0000000000..e49be17b85 --- /dev/null +++ b/packages/storybook/src/nimble/table-column/mapping/table-column-mapping.react.tsx @@ -0,0 +1,4 @@ +import { TableColumnMapping } from '@ni/nimble-components/dist/esm/table-column/mapping'; +import { wrap } from '../../../utilities/react-wrapper'; + +export const NimbleTableColumnMapping = wrap(TableColumnMapping); diff --git a/packages/storybook/src/nimble/table-column/icon/table-column-icon.stories.ts b/packages/storybook/src/nimble/table-column/mapping/table-column-mapping.stories.ts similarity index 85% rename from packages/storybook/src/nimble/table-column/icon/table-column-icon.stories.ts rename to packages/storybook/src/nimble/table-column/mapping/table-column-mapping.stories.ts index 3a4a90d816..b294bd5d50 100644 --- a/packages/storybook/src/nimble/table-column/icon/table-column-icon.stories.ts +++ b/packages/storybook/src/nimble/table-column/mapping/table-column-mapping.stories.ts @@ -9,8 +9,8 @@ import { mappingIconTag } from '@ni/nimble-components/dist/esm/mapping/icon'; import { mappingSpinnerTag } from '@ni/nimble-components/dist/esm/mapping/spinner'; import { sharedMappingValidityDescription } from '@ni/nimble-components/dist/esm/table-column/enum-base/tests/shared-storybook-docs'; import { mappingTextTag } from '@ni/nimble-components/dist/esm/mapping/text'; -import { TableColumnMappingWidthMode } from '@ni/nimble-components/dist/esm/table-column/icon/types'; -import { tableColumnIconTag } from '@ni/nimble-components/dist/esm/table-column/icon'; +import { TableColumnMappingWidthMode } from '@ni/nimble-components/dist/esm/table-column/mapping/types'; +import { tableColumnMappingTag } from '@ni/nimble-components/dist/esm/table-column/mapping'; import { SharedTableArgs, sharedTableArgTypes, @@ -57,14 +57,14 @@ const simpleData = [ } ] as const; -const metadata: Meta<IconColumnTableArgs> = { - title: 'Components/Table Column: Icon', +const metadata: Meta<MappingColumnTableArgs> = { + title: 'Components/Table Column: Mapping', parameters: {} }; export default metadata; -interface IconColumnTableArgs extends SharedTableArgs { +interface MappingColumnTableArgs extends SharedTableArgs { fieldName: string; keyType: string; widthMode: keyof typeof TableColumnMappingWidthMode; @@ -78,12 +78,12 @@ to \`default\`, the column will be resizable and be sized based on its fractiona should not be the right-most column in the table.`; const validityDescription = `${sharedMappingValidityDescription} -- \`invalidIconName\`: \`true\` when a mapping's \`icon\` value is not the tag name of a valid, loaded Nimble icon (e.g. \`nimble-icon-check\`) +- \`invalidIconName\`: \`true\` when an icon mapping's \`icon\` value is not the tag name of a valid, loaded Nimble icon (e.g. \`nimble-icon-check\`) `; -export const iconColumn: StoryObj<IconColumnTableArgs> = { +export const mappingColumn: StoryObj<MappingColumnTableArgs> = { // prettier-ignore - render: createUserSelectedThemeStory(html<IconColumnTableArgs>` + render: createUserSelectedThemeStory(html<MappingColumnTableArgs>` <${tableTag} ${ref('tableRef')} data-unused="${x => x.updateData(x)}" @@ -92,24 +92,24 @@ export const iconColumn: StoryObj<IconColumnTableArgs> = { <${tableColumnTextTag} field-name="firstName" > Name </${tableColumnTextTag}> - <${tableColumnIconTag} field-name="status" group-index="0"> + <${tableColumnMappingTag} field-name="status" group-index="0"> Status <${mappingIconTag} key="fail" icon="${iconXmarkTag}" severity="error" text="Not a Simpson"></${mappingIconTag}> <${mappingIconTag} key="success" icon="${iconCheckLargeTag}" severity="success" text="Is a Simpson"></${mappingIconTag}> <${mappingSpinnerTag} key="calculating" text="Calculating" text-hidden></${mappingSpinnerTag}> <${mappingIconTag} key="unknown" text="Unknown" text-hidden></${mappingIconTag}> - </${tableColumnIconTag}> - <${tableColumnIconTag} field-name="isChild" key-type="boolean" width-mode="${x => TableColumnMappingWidthMode[x.widthMode]}"> + </${tableColumnMappingTag}> + <${tableColumnMappingTag} field-name="isChild" key-type="boolean" width-mode="${x => TableColumnMappingWidthMode[x.widthMode]}"> <${iconChartDiagramChildFocusTag} title="Is child"></${iconChartDiagramChildFocusTag}> <${mappingIconTag} key="false" icon="${iconXmarkTag}" severity="error" text="Not a child" text-hidden></${mappingIconTag}> <${mappingIconTag} key="true" icon="${iconCheckLargeTag}" severity="success" text="Is a child" text-hidden></${mappingIconTag}> - </${tableColumnIconTag}> - <${tableColumnIconTag} field-name="gender" key-type="string"> + </${tableColumnMappingTag}> + <${tableColumnMappingTag} field-name="gender" key-type="string"> Gender <${mappingTextTag} key="male" text="Male"></${mappingTextTag}> <${mappingTextTag} key="female" text="Female"></${mappingTextTag}> - </${tableColumnIconTag}> + </${tableColumnMappingTag}> </${tableTag}> `), argTypes: { diff --git a/packages/storybook/src/nimble/tests/component-status.stories.ts b/packages/storybook/src/nimble/tests/component-status.stories.ts index 890947e218..45638adcf0 100644 --- a/packages/storybook/src/nimble/tests/component-status.stories.ts +++ b/packages/storybook/src/nimble/tests/component-status.stories.ts @@ -2,7 +2,7 @@ import { html, ref } from '@microsoft/fast-element'; import type { Meta, StoryObj } from '@storybook/html'; import { Table, tableTag } from '@ni/nimble-components/dist/esm/table'; import { tableColumnAnchorTag } from '@ni/nimble-components/dist/esm/table-column/anchor'; -import { tableColumnIconTag } from '@ni/nimble-components/dist/esm/table-column/icon'; +import { tableColumnMappingTag } from '@ni/nimble-components/dist/esm/table-column/mapping'; import { mappingIconTag } from '@ni/nimble-components/dist/esm/mapping/icon'; import { iconCheckTag } from '@ni/nimble-components/dist/esm/icons/check'; import { iconTriangleTag } from '@ni/nimble-components/dist/esm/icons/triangle'; @@ -581,30 +581,30 @@ const metadata: Meta<TableArgs> = { > Issue </${tableColumnAnchorTag}> - <${tableColumnIconTag} + <${tableColumnMappingTag} column-id="component-status-column" field-name="componentStatus" ?column-hidden="${x => x.status === 'future'}" > Web Component ${iconMappings} - </${tableColumnIconTag}> - <${tableColumnIconTag} + </${tableColumnMappingTag}> + <${tableColumnMappingTag} column-id="angular-status-column" field-name="angularStatus" ?column-hidden="${x => x.status === 'future'}" > Angular ${iconMappings} - </${tableColumnIconTag}> - <${tableColumnIconTag} + </${tableColumnMappingTag}> + <${tableColumnMappingTag} column-id="blazor-status-column" field-name="blazorStatus" ?column-hidden="${x => x.status === 'future'}" > Blazor ${iconMappings} - </${tableColumnIconTag}> + </${tableColumnMappingTag}> </${tableTag}> `), diff --git a/specs/labels-and-localization/README.md b/specs/labels-and-localization/README.md index d2cc0442dd..04dd93a578 100644 --- a/specs/labels-and-localization/README.md +++ b/specs/labels-and-localization/README.md @@ -27,7 +27,7 @@ The Nimble table will have many labels, which are summarized here: - Sort indicators (ascending/descending icon) in table column headers: No accessible label specifically for these icons is currently planned. The primary sorted column is already indicated with `aria-sort="ascending"` or `aria-sort="descending"`. The [ARIA APG's sortable table example](https://www.w3.org/WAI/ARIA/apg/patterns/table/examples/sortable-table/) follows similar logic, and says sort labels are not added to each column header button "to prevent repetitious verbosity that could interfere with understanding of the column titles". - Grouped indicator in table column headers: Currently no ARIA attributes indicate a grouped column, so we'll probably want to add a label for this (probably via a `title` / tooltip) - Client-provided icon elements in the table (e.g. icons as the primary content of table headers): Follows the same guidance in [accessibility.md](../../packages/nimble-components/docs/accessibility.md), i.e. the icons should provide accessible text via the `title` attribute (and clients will handle localizing it themselves). -- (Mapping/ Icon Columns: As currently specced, `nimble-table-column-icon`'s `nimble-mapping-icon` has a `label` attribute which will become the icon `title`) +- Mapping Columns: `nimble-table-column-mapping`'s mapping elements have `text` attributes which will become the icon or spinner `title` when necessary ## Localization