Skip to content

Commit

Permalink
Merge branch 'main' into users/makinc/table-column-sizing-mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
m-akinc authored Oct 16, 2024
2 parents 42dfd43 + 195a764 commit 2d48db8
Show file tree
Hide file tree
Showing 30 changed files with 451 additions and 105 deletions.
22 changes: 11 additions & 11 deletions package-lock.json

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

Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
<div class="sub-container">
<div class="container-label">Radio Buttons</div>
<nimble-radio-group>
<span slot="label">Fruit</span>
<nimble-radio name="fruit" value="apple" [(ngModel)]="selectedRadio">Apple</nimble-radio>
<nimble-radio name="fruit" value="banana" [(ngModel)]="selectedRadio">Banana</nimble-radio>
<nimble-radio name="fruit" value="mango" [(ngModel)]="selectedRadio">Mango</nimble-radio>
Expand Down
30 changes: 30 additions & 0 deletions packages/angular-workspace/nimble-angular/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,36 @@
{
"name": "@ni/nimble-angular",
"entries": [
{
"date": "Wed, 16 Oct 2024 21:20:29 GMT",
"version": "28.3.0",
"tag": "@ni/nimble-angular_v28.3.0",
"comments": {
"minor": [
{
"author": "20542556+mollykreis@users.noreply.github.com",
"package": "@ni/nimble-angular",
"commit": "280d85aab3c4cb9c78d4a336d2babbfd9bc33b8d",
"comment": "Expose error state on radio-group"
}
]
}
},
{
"date": "Mon, 14 Oct 2024 13:37:04 GMT",
"version": "28.2.11",
"tag": "@ni/nimble-angular_v28.2.11",
"comments": {
"patch": [
{
"author": "beachball",
"package": "@ni/nimble-angular",
"comment": "Bump @ni/nimble-components to v32.3.1",
"commit": "not available"
}
]
}
},
{
"date": "Wed, 09 Oct 2024 22:13:53 GMT",
"version": "28.2.10",
Expand Down
18 changes: 17 additions & 1 deletion packages/angular-workspace/nimble-angular/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
# Change Log - @ni/nimble-angular

<!-- This log was last generated on Wed, 09 Oct 2024 19:24:18 GMT and should not be manually modified. -->
<!-- This log was last generated on Wed, 16 Oct 2024 21:20:29 GMT and should not be manually modified. -->

<!-- Start content -->

## 28.3.0

Wed, 16 Oct 2024 21:20:29 GMT

### Minor changes

- Expose error state on radio-group ([ni/nimble@280d85a](https://github.com/ni/nimble/commit/280d85aab3c4cb9c78d4a336d2babbfd9bc33b8d))

## 28.2.11

Mon, 14 Oct 2024 13:37:04 GMT

### Patches

- Bump @ni/nimble-components to v32.3.1

## 28.2.10

Wed, 09 Oct 2024 19:24:18 GMT
Expand Down
4 changes: 2 additions & 2 deletions packages/angular-workspace/nimble-angular/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ni/nimble-angular",
"version": "28.2.10",
"version": "28.3.0",
"description": "Angular components for the NI Nimble Design System",
"scripts": {
"invoke-publish": "npm run invoke-publish:setup && cd ../dist/nimble-angular && npm publish",
Expand Down Expand Up @@ -32,7 +32,7 @@
"@angular/forms": "^17.3.12",
"@angular/localize": "^17.3.12",
"@angular/router": "^17.3.12",
"@ni/nimble-components": "^32.3.0"
"@ni/nimble-components": "^32.3.1"
},
"dependencies": {
"tslib": "^2.2.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,21 @@ export class NimbleRadioGroupDirective {
this.renderer.setProperty(this.elementRef.nativeElement, 'orientation', value);
}

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

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

public get errorVisible(): boolean {
return this.elementRef.nativeElement.errorVisible;
}

@Input('error-visible') public set errorVisible(value: BooleanValueOrAttribute) {
this.renderer.setProperty(this.elementRef.nativeElement, 'errorVisible', toBooleanProperty(value));
}

public constructor(private readonly renderer: Renderer2, private readonly elementRef: ElementRef<RadioGroup>) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,28 @@ describe('Nimble radio group', () => {
directive.orientation = Orientation.vertical;
expect(nativeElement.orientation).toBe(Orientation.vertical);
});

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

it('can use the directive to set errorText', () => {
directive.errorText = 'new value';
expect(nativeElement.errorText).toBe('new value');
});
});

describe('with template string values', () => {
@Component({
template: '<nimble-radio-group #radioGroup disabled name="foo" orientation="vertical"></nimble-radio-group>'
template: `
<nimble-radio-group #radioGroup
disabled
name="foo"
orientation="vertical"
error-text="error text"
error-visible
></nimble-radio-group>`
})
class TestHostComponent {
@ViewChild('radioGroup', { read: NimbleRadioGroupDirective }) public directive: NimbleRadioGroupDirective;
Expand Down Expand Up @@ -110,18 +127,37 @@ describe('Nimble radio group', () => {
expect(directive.orientation).toBe(Orientation.vertical);
expect(nativeElement.orientation).toBe(Orientation.vertical);
});

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

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

describe('with property bound values', () => {
@Component({
template: '<nimble-radio-group #radioGroup [disabled]="disabled" [name]="name" [orientation]="orientation"></nimble-radio-group>'
template: `
<nimble-radio-group #radioGroup
[disabled]="disabled"
[name]="name"
[orientation]="orientation"
[error-text]="errorText"
[error-visible]="errorVisible"
></nimble-radio-group>`
})
class TestHostComponent {
@ViewChild('radioGroup', { read: NimbleRadioGroupDirective }) public directive: NimbleRadioGroupDirective;
@ViewChild('radioGroup', { read: ElementRef }) public elementRef: ElementRef<RadioGroup>;
public disabled = false;
public name = 'foo';
public orientation: Orientation = Orientation.vertical;
public errorText = 'initial value';
public errorVisible = false;
}

let fixture: ComponentFixture<TestHostComponent>;
Expand Down Expand Up @@ -171,18 +207,49 @@ describe('Nimble radio group', () => {
expect(directive.orientation).toBe(Orientation.horizontal);
expect(nativeElement.orientation).toBe(Orientation.horizontal);
});

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

fixture.componentInstance.errorText = 'new value';
fixture.detectChanges();

expect(directive.errorText).toBe('new value');
expect(nativeElement.errorText).toBe('new value');
});

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

fixture.componentInstance.errorVisible = true;
fixture.detectChanges();

expect(directive.errorVisible).toBeTrue();
expect(nativeElement.errorVisible).toBeTrue();
});
});

describe('with attribute bound values', () => {
@Component({
template: '<nimble-radio-group #radioGroup [attr.disabled]="disabled" [attr.name]="name" [attr.orientation]="orientation"></nimble-radio-group>'
template: `
<nimble-radio-group #radioGroup
[attr.disabled]="disabled"
[attr.name]="name"
[attr.orientation]="orientation"
[attr.error-text]="errorText"
[attr.error-visible]="errorVisible"
></nimble-radio-group>`
})
class TestHostComponent {
@ViewChild('radioGroup', { read: NimbleRadioGroupDirective }) public directive: NimbleRadioGroupDirective;
@ViewChild('radioGroup', { read: ElementRef }) public elementRef: ElementRef<RadioGroup>;
public disabled: BooleanValueOrAttribute = null;
public name = 'foo';
public orientation: Orientation = Orientation.vertical;
public errorText = 'initial value';
public errorVisible: BooleanValueOrAttribute = null;
}

let fixture: ComponentFixture<TestHostComponent>;
Expand Down Expand Up @@ -232,5 +299,27 @@ describe('Nimble radio group', () => {
expect(directive.orientation).toBe(Orientation.horizontal);
expect(nativeElement.orientation).toBe(Orientation.horizontal);
});

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

fixture.componentInstance.errorText = 'new value';
fixture.detectChanges();

expect(directive.errorText).toBe('new value');
expect(nativeElement.errorText).toBe('new value');
});

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

fixture.componentInstance.errorVisible = '';
fixture.detectChanges();

expect(directive.errorVisible).toBeTrue();
expect(nativeElement.errorVisible).toBeTrue();
});
});
});
15 changes: 15 additions & 0 deletions packages/angular-workspace/spright-angular/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
{
"name": "@ni/spright-angular",
"entries": [
{
"date": "Mon, 14 Oct 2024 13:37:04 GMT",
"version": "5.1.12",
"tag": "@ni/spright-angular_v5.1.12",
"comments": {
"patch": [
{
"author": "beachball",
"package": "@ni/spright-angular",
"comment": "Bump @ni/spright-components to v4.1.12",
"commit": "not available"
}
]
}
},
{
"date": "Wed, 09 Oct 2024 19:24:18 GMT",
"version": "5.1.11",
Expand Down
10 changes: 9 additions & 1 deletion packages/angular-workspace/spright-angular/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
# Change Log - @ni/spright-angular

<!-- This log was last generated on Wed, 09 Oct 2024 19:24:18 GMT and should not be manually modified. -->
<!-- This log was last generated on Mon, 14 Oct 2024 13:37:04 GMT and should not be manually modified. -->

<!-- Start content -->

## 5.1.12

Mon, 14 Oct 2024 13:37:04 GMT

### Patches

- Bump @ni/spright-components to v4.1.12

## 5.1.11

Wed, 09 Oct 2024 19:24:18 GMT
Expand Down
Loading

0 comments on commit 2d48db8

Please sign in to comment.