Skip to content

Commit

Permalink
Merge branch 'main' into strict-sb-enums
Browse files Browse the repository at this point in the history
  • Loading branch information
rajsite authored Mar 28, 2024
2 parents 640e118 + 3d08d4d commit 8265858
Show file tree
Hide file tree
Showing 14 changed files with 233 additions and 5 deletions.
15 changes: 15 additions & 0 deletions angular-workspace/projects/ni/nimble-angular/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
{
"name": "@ni/nimble-angular",
"entries": [
{
"date": "Thu, 28 Mar 2024 00:47:47 GMT",
"version": "20.6.0",
"tag": "@ni/nimble-angular_v20.6.0",
"comments": {
"minor": [
{
"author": "20542556+mollykreis@users.noreply.github.com",
"package": "@ni/nimble-angular",
"commit": "a9ffce872954c88d7cf4ad0dd84eb55433953886",
"comment": "Add support for column placeholders"
}
]
}
},
{
"date": "Wed, 27 Mar 2024 21:22:02 GMT",
"version": "20.5.7",
Expand Down
10 changes: 9 additions & 1 deletion angular-workspace/projects/ni/nimble-angular/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
# Change Log - @ni/nimble-angular

This log was last generated on Wed, 27 Mar 2024 21:22:02 GMT and should not be manually modified.
This log was last generated on Thu, 28 Mar 2024 00:47:47 GMT and should not be manually modified.

<!-- Start content -->

## 20.6.0

Thu, 28 Mar 2024 00:47:47 GMT

### Minor changes

- Add support for column placeholders ([ni/nimble@a9ffce8](https://github.com/ni/nimble/commit/a9ffce872954c88d7cf4ad0dd84eb55433953886))

## 20.5.7

Wed, 27 Mar 2024 21:22:02 GMT
Expand Down
2 changes: 1 addition & 1 deletion angular-workspace/projects/ni/nimble-angular/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ni/nimble-angular",
"version": "20.5.7",
"version": "20.6.0",
"description": "Angular components for the NI Nimble Design System",
"scripts": {
"invoke-publish": "cd ../../../ && npm run build:library && cd dist/ni/nimble-angular && npm publish"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ export class NimbleTableColumnAnchorDirective extends NimbleTableColumnBaseDirec
this.renderer.setProperty(this.elementRef.nativeElement, 'hrefFieldName', value);
}

public get placeholder(): string | undefined {
return this.elementRef.nativeElement.placeholder;
}

@Input() public set placeholder(value: string | undefined) {
this.renderer.setProperty(this.elementRef.nativeElement, 'placeholder', value);
}

public get appearance(): AnchorAppearance {
return this.elementRef.nativeElement.appearance;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ describe('Nimble anchor table column', () => {
expect(directive.groupingDisabled).toBeFalse();
expect(nativeElement.groupingDisabled).toBeFalse();
});

it('has expected defaults for placeholder', () => {
expect(directive.placeholder).toBeUndefined();
expect(nativeElement.placeholder).toBeUndefined();
});
});

describe('with template string values', () => {
Expand Down Expand Up @@ -187,6 +192,7 @@ describe('Nimble anchor table column', () => {
min-pixel-width="40"
group-index="0"
grouping-disabled
placeholder="Custom placeholder"
>
</nimble-table-column-anchor>
`
Expand Down Expand Up @@ -315,6 +321,11 @@ describe('Nimble anchor table column', () => {
expect(directive.groupingDisabled).toBeTrue();
expect(nativeElement.groupingDisabled).toBeTrue();
});

it('will use template string values for placeholder', () => {
expect(directive.placeholder).toBe('Custom placeholder');
expect(nativeElement.placeholder).toBe('Custom placeholder');
});
});

describe('with property bound values', () => {
Expand Down Expand Up @@ -342,6 +353,7 @@ describe('Nimble anchor table column', () => {
[min-pixel-width]="minPixelWidth"
[group-index]="groupIndex"
[grouping-disabled]="groupingDisabled"
[placeholder]="placeholder"
>
</nimble-table-column-anchor>
`
Expand Down Expand Up @@ -370,6 +382,7 @@ describe('Nimble anchor table column', () => {
public minPixelWidth: number | null = 40;
public groupIndex: number | null = 0;
public groupingDisabled = false;
public placeholder = 'Custom placeholder';
}

let fixture: ComponentFixture<TestHostComponent>;
Expand Down Expand Up @@ -661,6 +674,17 @@ describe('Nimble anchor table column', () => {
expect(directive.groupingDisabled).toBeTrue();
expect(nativeElement.groupingDisabled).toBeTrue();
});

it('can be configured with property binding for placeholder', () => {
expect(directive.placeholder).toBe('Custom placeholder');
expect(nativeElement.placeholder).toBe('Custom placeholder');

fixture.componentInstance.placeholder = 'Updated placeholder';
fixture.detectChanges();

expect(directive.placeholder).toBe('Updated placeholder');
expect(nativeElement.placeholder).toBe('Updated placeholder');
});
});

describe('with attribute bound values', () => {
Expand Down Expand Up @@ -688,6 +712,7 @@ describe('Nimble anchor table column', () => {
[attr.min-pixel-width]="minPixelWidth"
[attr.group-index]="groupIndex"
[attr.grouping-disabled]="groupingDisabled"
[attr.placeholder]="placeholder"
>
</nimble-table-column-anchor>
`
Expand Down Expand Up @@ -716,6 +741,7 @@ describe('Nimble anchor table column', () => {
public minPixelWidth: number | null = 40;
public groupIndex: number | null = 0;
public groupingDisabled = false;
public placeholder = 'Custom placeholder';
}

let fixture: ComponentFixture<TestHostComponent>;
Expand Down Expand Up @@ -1007,5 +1033,16 @@ describe('Nimble anchor table column', () => {
expect(directive.groupingDisabled).toBe(true);
expect(nativeElement.groupingDisabled).toBe(true);
});

it('can be configured with attribute binding for placeholder', () => {
expect(directive.placeholder).toBe('Custom placeholder');
expect(nativeElement.placeholder).toBe('Custom placeholder');

fixture.componentInstance.placeholder = 'Updated placeholder';
fixture.detectChanges();

expect(directive.placeholder).toBe('Updated placeholder');
expect(nativeElement.placeholder).toBe('Updated placeholder');
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ export class NimbleTableColumnDateTextDirective extends NimbleTableColumnBaseDir
this.renderer.setProperty(this.elementRef.nativeElement, 'fieldName', value);
}

public get placeholder(): string | undefined {
return this.elementRef.nativeElement.placeholder;
}

@Input() public set placeholder(value: string | undefined) {
this.renderer.setProperty(this.elementRef.nativeElement, 'placeholder', value);
}

public get format(): DateTextFormat {
return this.elementRef.nativeElement.format;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ describe('NimbleTableColumnDateText', () => {
custom-date-style="medium"
custom-time-style="full"
custom-hour-cycle="h23"
placeholder="Custom placeholder"
></nimble-table-column-date-text>
</nimble-table>
`
Expand Down Expand Up @@ -293,6 +294,11 @@ describe('NimbleTableColumnDateText', () => {
expect(directive.customHourCycle).toBe('h23');
expect(nativeElement.customHourCycle).toBe('h23');
});

it('will use template string values for placeholder', () => {
expect(directive.placeholder).toBe('Custom placeholder');
expect(nativeElement.placeholder).toBe('Custom placeholder');
});
});

describe('with property bound values', () => {
Expand Down Expand Up @@ -332,6 +338,7 @@ describe('NimbleTableColumnDateText', () => {
[custom-date-style]="customDateStyle"
[custom-time-style]="customTimeStyle"
[custom-hour-cycle]="customHourCycle"
[placeholder]="placeholder"
></nimble-table-column-date-text>
</nimble-table>
`
Expand Down Expand Up @@ -370,6 +377,7 @@ describe('NimbleTableColumnDateText', () => {
public customDateStyle: DateStyle = 'medium';
public customTimeStyle: TimeStyle = 'full';
public customHourCycle: HourCycleFormat = 'h23';
public placeholder = 'Custom placeholder';
}

let fixture: ComponentFixture<TestHostComponent>;
Expand Down Expand Up @@ -980,6 +988,17 @@ describe('NimbleTableColumnDateText', () => {
expect(directive.customHourCycle).toBeUndefined();
expect(nativeElement.customHourCycle).toBeUndefined();
});

it('can be configured with property binding for placeholder', () => {
expect(directive.placeholder).toBe('Custom placeholder');
expect(nativeElement.placeholder).toBe('Custom placeholder');

fixture.componentInstance.placeholder = 'Updated placeholder';
fixture.detectChanges();

expect(directive.placeholder).toBe('Updated placeholder');
expect(nativeElement.placeholder).toBe('Updated placeholder');
});
});

describe('with attribute bound values', () => {
Expand Down Expand Up @@ -1019,6 +1038,7 @@ describe('NimbleTableColumnDateText', () => {
[attr.custom-date-style]="customDateStyle"
[attr.custom-time-style]="customTimeStyle"
[attr.custom-hour-cycle]="customHourCycle"
[attr.placeholder]="placeholder"
></nimble-table-column-date-text>
</nimble-table>
`
Expand Down Expand Up @@ -1057,6 +1077,7 @@ describe('NimbleTableColumnDateText', () => {
public customDateStyle: DateStyle = 'medium';
public customTimeStyle: TimeStyle = 'full';
public customHourCycle: HourCycleFormat = 'h23';
public placeholder = 'Custom placeholder';
}

let fixture: ComponentFixture<TestHostComponent>;
Expand Down Expand Up @@ -1667,5 +1688,16 @@ describe('NimbleTableColumnDateText', () => {
expect(directive.customHourCycle).toBeNull();
expect(nativeElement.customHourCycle).toBeNull();
});

it('can be configured with attribute binding for placeholder', () => {
expect(directive.placeholder).toBe('Custom placeholder');
expect(nativeElement.placeholder).toBe('Custom placeholder');

fixture.componentInstance.placeholder = 'Updated placeholder';
fixture.detectChanges();

expect(directive.placeholder).toBe('Updated placeholder');
expect(nativeElement.placeholder).toBe('Updated placeholder');
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ export class NimbleTableColumnDurationTextDirective extends NimbleTableColumnBas
this.renderer.setProperty(this.elementRef.nativeElement, 'fieldName', value);
}

public get placeholder(): string | undefined {
return this.elementRef.nativeElement.placeholder;
}

@Input() public set placeholder(value: string | undefined) {
this.renderer.setProperty(this.elementRef.nativeElement, 'placeholder', value);
}

public get fractionalWidth(): number | null | undefined {
return this.elementRef.nativeElement.fractionalWidth;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ describe('NimbleTableColumnDurationText', () => {
sort-index="0"
group-index="0"
grouping-disabled
placeholder="Custom placeholder"
></nimble-table-column-duration-text>
</nimble-table>
`
Expand Down Expand Up @@ -113,6 +114,11 @@ describe('NimbleTableColumnDurationText', () => {
expect(directive.groupingDisabled).toBeTrue();
expect(nativeElement.groupingDisabled).toBeTrue();
});

it('will use template string values for placeholder', () => {
expect(directive.placeholder).toBe('Custom placeholder');
expect(nativeElement.placeholder).toBe('Custom placeholder');
});
});

describe('with property bound values', () => {
Expand All @@ -132,6 +138,7 @@ describe('NimbleTableColumnDurationText', () => {
[sort-index]="sortIndex"
[group-index]="groupIndex"
[grouping-disabled]="groupingDisabled"
[placeholder]="placeholder"
></nimble-table-column-duration-text>
</nimble-table>
`
Expand All @@ -150,6 +157,7 @@ describe('NimbleTableColumnDurationText', () => {
public sortIndex: number | null = 0;
public groupIndex: number | null = 0;
public groupingDisabled = false;
public placeholder = 'Custom placeholder';
}

let fixture: ComponentFixture<TestHostComponent>;
Expand Down Expand Up @@ -331,6 +339,17 @@ describe('NimbleTableColumnDurationText', () => {
expect(directive.groupingDisabled).toBeTrue();
expect(nativeElement.groupingDisabled).toBeTrue();
});

it('can be configured with property binding for placeholder', () => {
expect(directive.placeholder).toBe('Custom placeholder');
expect(nativeElement.placeholder).toBe('Custom placeholder');

fixture.componentInstance.placeholder = 'Updated placeholder';
fixture.detectChanges();

expect(directive.placeholder).toBe('Updated placeholder');
expect(nativeElement.placeholder).toBe('Updated placeholder');
});
});

describe('with attribute bound values', () => {
Expand All @@ -350,6 +369,7 @@ describe('NimbleTableColumnDurationText', () => {
[attr.sort-index]="sortIndex"
[attr.group-index]="groupIndex"
[attr.grouping-disabled]="groupingDisabled"
[attr.placeholder]="placeholder"
></nimble-table-column-duration-text>
</nimble-table>
`
Expand All @@ -368,6 +388,7 @@ describe('NimbleTableColumnDurationText', () => {
public sortIndex: number | null = 0;
public groupIndex: number | null = 0;
public groupingDisabled = false;
public placeholder = 'Custom placeholder';
}

let fixture: ComponentFixture<TestHostComponent>;
Expand Down Expand Up @@ -549,5 +570,16 @@ describe('NimbleTableColumnDurationText', () => {
expect(directive.groupingDisabled).toBe(true);
expect(nativeElement.groupingDisabled).toBe(true);
});

it('can be configured with attribute binding for placeholder', () => {
expect(directive.placeholder).toBe('Custom placeholder');
expect(nativeElement.placeholder).toBe('Custom placeholder');

fixture.componentInstance.placeholder = 'Updated placeholder';
fixture.detectChanges();

expect(directive.placeholder).toBe('Updated placeholder');
expect(nativeElement.placeholder).toBe('Updated placeholder');
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ export class NimbleTableColumnNumberTextDirective extends NimbleTableColumnBaseD
this.renderer.setProperty(this.elementRef.nativeElement, 'fieldName', value);
}

public get placeholder(): string | undefined {
return this.elementRef.nativeElement.placeholder;
}

@Input() public set placeholder(value: string | undefined) {
this.renderer.setProperty(this.elementRef.nativeElement, 'placeholder', value);
}

public get format(): NumberTextFormat {
return this.elementRef.nativeElement.format;
}
Expand Down
Loading

0 comments on commit 8265858

Please sign in to comment.