Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Angular support for the nimble-card #1646

Merged
merged 15 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { NimbleTextAreaModule, NimbleTextFieldModule, NimbleNumberFieldModule, N
NimbleTabModule, NimbleTabPanelModule, NimbleTabsModule, NimbleTabsToolbarModule, NimbleMenuModule,
NimbleMenuItemModule, NimbleCheckboxModule, NimbleToggleButtonModule, NimbleBreadcrumbModule, NimbleBreadcrumbItemModule,
NimbleIconAddModule, NimbleSwitchModule, NimbleToolbarModule, NimbleMenuButtonModule, NimbleComboboxModule, NimbleTooltipModule,
NimbleCardButtonModule, NimbleDialogModule, NimbleRadioGroupModule, NimbleRadioModule, NimbleSpinnerModule,
NimbleCardModule, NimbleCardButtonModule, NimbleDialogModule, NimbleRadioGroupModule, NimbleRadioModule, NimbleSpinnerModule,
NimbleAnchorModule, NimbleAnchorButtonModule, NimbleAnchorTabModule, NimbleAnchorTabsModule,
NimbleIconCheckModule, NimbleBannerModule, NimbleAnchorMenuItemModule, NimbleAnchorTreeItemModule } from '@ni/nimble-angular';
import { NimbleLabelProviderCoreModule } from '@ni/nimble-angular/label-provider/core';
Expand Down Expand Up @@ -72,6 +72,7 @@ import { HeaderComponent } from './header/header.component';
NimbleComboboxModule,
NimbleMenuButtonModule,
NimbleTooltipModule,
NimbleCardModule,
NimbleCardButtonModule,
NimbleDialogModule,
NimbleRadioGroupModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,19 @@
<nimble-anchor-button nimbleRouterLink="/customapp" appearance="block">Block Anchor Button</nimble-anchor-button>
<nimble-anchor-button nimbleRouterLink="/customapp" appearance="ghost">Ghost Anchor Button</nimble-anchor-button>
</div>
<div class="sub-container">
<div class="container-label">Card</div>
<nimble-card>
<span slot="title">Title of the card</span>
<nimble-number-field>Numeric field 1</nimble-number-field>
<nimble-number-field>Numeric field 2</nimble-number-field>
<nimble-select>
<nimble-list-option value="1">Option 1</nimble-list-option>
<nimble-list-option value="2">Option 2</nimble-list-option>
<nimble-list-option value="3">Option 3</nimble-list-option>
</nimble-select>
</nimble-card>
</div>
<div class="sub-container">
<div class="container-label">Card Button</div>
<nimble-card-button>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Directive } from '@angular/core';
kjohn1922 marked this conversation as resolved.
Show resolved Hide resolved
import { type Card, cardTag } from '@ni/nimble-components/dist/esm/card';

export type { Card };
export { cardTag };

/**
* Directive to provide Angular integration for the card.
*/
@Directive({
selector: 'nimble-card'
})

export class NimbleCardDirective {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { NimbleCardDirective } from './nimble-card.directive';

import '@ni/nimble-components/dist/esm/card';

@NgModule({
declarations: [NimbleCardDirective],
imports: [CommonModule],
exports: [NimbleCardDirective]
})
export class NimbleCardModule { }
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { NimbleCardModule } from '../nimble-card.module';

describe('Nimble card', () => {
describe('module', () => {
beforeEach(() => {
TestBed.configureTestingModule({
imports: [NimbleCardModule]
});
});

it('custom element is defined', () => {
expect(customElements.get('nimble-card')).not.toBeUndefined();
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ export * from './directives/breadcrumb-item/nimble-breadcrumb-item.directive';
export * from './directives/breadcrumb-item/nimble-breadcrumb-item.module';
export * from './directives/button/nimble-button.directive';
export * from './directives/button/nimble-button.module';
export * from './directives/card/nimble-card.directive';
export * from './directives/card/nimble-card.module';
export * from './directives/card-button/nimble-card-button.directive';
export * from './directives/card-button/nimble-card-button.module';
export * from './directives/checkbox/nimble-checkbox-control-value-accessor.directive';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
kjohn1922 marked this conversation as resolved.
Show resolved Hide resolved
"type": "patch",
"comment": "Add Angular support for the nimble-card component",
"packageName": "@ni/nimble-angular",
"email": "35350751+kjohn1922@users.noreply.github.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Add Angular support for the nimble-card component",
kjohn1922 marked this conversation as resolved.
Show resolved Hide resolved
"packageName": "@ni/nimble-components",
"email": "35350751+kjohn1922@users.noreply.github.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ const components = [
issueHref: 'https://github.com/ni/nimble/issues/296',
issueLabel: 'Issue',
componentStatus: ComponentFrameworkStatus.incubating,
angularStatus: ComponentFrameworkStatus.doesNotExist,
angularStatus: ComponentFrameworkStatus.incubating,
blazorStatus: ComponentFrameworkStatus.doesNotExist
},
{
Expand Down
Loading