@ni/nimble-angular 1.0.0-beta.13 → 1.0.0-beta.133

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. package/README.md +51 -20
  2. package/bundles/ni-nimble-angular.umd.js +1384 -0
  3. package/bundles/ni-nimble-angular.umd.js.map +1 -0
  4. package/directives/button/nimble-button.directive.d.ts +21 -0
  5. package/directives/button/nimble-button.module.d.ts +3 -0
  6. package/directives/button/nimble-button.module.ngfactory.d.ts +3 -0
  7. package/directives/checkbox/nimble-checkbox-control-value-accessor.directive.d.ts +9 -0
  8. package/directives/checkbox/nimble-checkbox.directive.d.ts +7 -0
  9. package/directives/checkbox/nimble-checkbox.module.d.ts +3 -0
  10. package/directives/checkbox/nimble-checkbox.module.ngfactory.d.ts +3 -0
  11. package/directives/drawer/nimble-drawer.directive.d.ts +25 -0
  12. package/directives/drawer/nimble-drawer.module.d.ts +3 -0
  13. package/directives/drawer/nimble-drawer.module.ngfactory.d.ts +3 -0
  14. package/directives/listbox-option/nimble-listbox-option.directive.d.ts +16 -0
  15. package/directives/listbox-option/nimble-listbox-option.module.d.ts +3 -0
  16. package/directives/listbox-option/nimble-listbox-option.module.ngfactory.d.ts +3 -0
  17. package/directives/menu/nimble-menu.directive.d.ts +7 -0
  18. package/directives/menu/nimble-menu.module.d.ts +3 -0
  19. package/directives/menu/nimble-menu.module.ngfactory.d.ts +3 -0
  20. package/directives/menu-item/nimble-menu-item.directive.d.ts +14 -0
  21. package/directives/menu-item/nimble-menu-item.module.d.ts +3 -0
  22. package/directives/menu-item/nimble-menu-item.module.ngfactory.d.ts +3 -0
  23. package/directives/number-field/nimble-number-field-control-value-accessor.directive.d.ts +9 -0
  24. package/directives/number-field/nimble-number-field.directive.d.ts +22 -0
  25. package/directives/number-field/nimble-number-field.module.d.ts +3 -0
  26. package/directives/number-field/nimble-number-field.module.ngfactory.d.ts +3 -0
  27. package/directives/select/nimble-select-control-value-accessor.directive.d.ts +11 -0
  28. package/directives/select/nimble-select.directive.d.ts +7 -0
  29. package/directives/select/nimble-select.module.d.ts +3 -0
  30. package/directives/select/nimble-select.module.ngfactory.d.ts +3 -0
  31. package/directives/tab/nimble-tab.directive.d.ts +14 -0
  32. package/directives/tab/nimble-tab.module.d.ts +3 -0
  33. package/directives/tab/nimble-tab.module.ngfactory.d.ts +3 -0
  34. package/directives/tab-panel/nimble-tab-panel.directive.d.ts +7 -0
  35. package/directives/tab-panel/nimble-tab-panel.module.d.ts +3 -0
  36. package/directives/tab-panel/nimble-tab-panel.module.ngfactory.d.ts +3 -0
  37. package/directives/tabs/nimble-tabs.directive.d.ts +15 -0
  38. package/directives/tabs/nimble-tabs.module.d.ts +3 -0
  39. package/directives/tabs/nimble-tabs.module.ngfactory.d.ts +3 -0
  40. package/directives/tabs-toolbar/nimble-tabs-toolbar.directive.d.ts +7 -0
  41. package/directives/tabs-toolbar/nimble-tabs-toolbar.module.d.ts +3 -0
  42. package/directives/tabs-toolbar/nimble-tabs-toolbar.module.ngfactory.d.ts +3 -0
  43. package/directives/text-field/nimble-text-field-control-value-accessor.directive.d.ts +9 -0
  44. package/directives/text-field/nimble-text-field.directive.d.ts +19 -0
  45. package/directives/text-field/nimble-text-field.module.d.ts +3 -0
  46. package/directives/text-field/nimble-text-field.module.ngfactory.d.ts +3 -0
  47. package/directives/theme-provider/nimble-theme-provider.directive.d.ts +16 -0
  48. package/directives/theme-provider/nimble-theme-provider.module.d.ts +3 -0
  49. package/directives/theme-provider/nimble-theme-provider.module.ngfactory.d.ts +3 -0
  50. package/directives/tree-item/nimble-tree-item.directive.d.ts +20 -0
  51. package/directives/tree-item/nimble-tree-item.module.d.ts +3 -0
  52. package/directives/tree-item/nimble-tree-item.module.ngfactory.d.ts +3 -0
  53. package/directives/tree-view/nimble-tree-view.directive.d.ts +16 -0
  54. package/directives/tree-view/nimble-tree-view.module.d.ts +3 -0
  55. package/directives/tree-view/nimble-tree-view.module.ngfactory.d.ts +3 -0
  56. package/directives/utilities/template-value-helpers.d.ts +20 -0
  57. package/esm2015/directives/button/nimble-button.directive.js +46 -0
  58. package/esm2015/directives/button/nimble-button.directive.ngsummary.json +1 -0
  59. package/esm2015/directives/button/nimble-button.module.js +14 -0
  60. package/esm2015/directives/button/nimble-button.module.ngfactory.js +12 -0
  61. package/esm2015/directives/button/nimble-button.module.ngsummary.json +1 -0
  62. package/esm2015/directives/checkbox/nimble-checkbox-control-value-accessor.directive.js +24 -0
  63. package/esm2015/directives/checkbox/nimble-checkbox-control-value-accessor.directive.ngsummary.json +1 -0
  64. package/esm2015/directives/checkbox/nimble-checkbox.directive.js +12 -0
  65. package/esm2015/directives/checkbox/nimble-checkbox.directive.ngsummary.json +1 -0
  66. package/esm2015/directives/checkbox/nimble-checkbox.module.js +15 -0
  67. package/esm2015/directives/checkbox/nimble-checkbox.module.ngfactory.js +12 -0
  68. package/esm2015/directives/checkbox/nimble-checkbox.module.ngsummary.json +1 -0
  69. package/esm2015/directives/drawer/nimble-drawer.directive.js +60 -0
  70. package/esm2015/directives/drawer/nimble-drawer.directive.ngsummary.json +1 -0
  71. package/esm2015/directives/drawer/nimble-drawer.module.js +14 -0
  72. package/esm2015/directives/drawer/nimble-drawer.module.ngfactory.js +12 -0
  73. package/esm2015/directives/drawer/nimble-drawer.module.ngsummary.json +1 -0
  74. package/esm2015/directives/listbox-option/nimble-listbox-option.directive.js +34 -0
  75. package/esm2015/directives/listbox-option/nimble-listbox-option.directive.ngsummary.json +1 -0
  76. package/esm2015/directives/listbox-option/nimble-listbox-option.module.js +14 -0
  77. package/esm2015/directives/listbox-option/nimble-listbox-option.module.ngfactory.js +12 -0
  78. package/esm2015/directives/listbox-option/nimble-listbox-option.module.ngsummary.json +1 -0
  79. package/esm2015/directives/menu/nimble-menu.directive.js +12 -0
  80. package/esm2015/directives/menu/nimble-menu.directive.ngsummary.json +1 -0
  81. package/esm2015/directives/menu/nimble-menu.module.js +14 -0
  82. package/esm2015/directives/menu/nimble-menu.module.ngfactory.js +12 -0
  83. package/esm2015/directives/menu/nimble-menu.module.ngsummary.json +1 -0
  84. package/esm2015/directives/menu-item/nimble-menu-item.directive.js +30 -0
  85. package/esm2015/directives/menu-item/nimble-menu-item.directive.ngsummary.json +1 -0
  86. package/esm2015/directives/menu-item/nimble-menu-item.module.js +14 -0
  87. package/esm2015/directives/menu-item/nimble-menu-item.module.ngfactory.js +12 -0
  88. package/esm2015/directives/menu-item/nimble-menu-item.module.ngsummary.json +1 -0
  89. package/esm2015/directives/number-field/nimble-number-field-control-value-accessor.directive.js +24 -0
  90. package/esm2015/directives/number-field/nimble-number-field-control-value-accessor.directive.ngsummary.json +1 -0
  91. package/esm2015/directives/number-field/nimble-number-field.directive.js +61 -0
  92. package/esm2015/directives/number-field/nimble-number-field.directive.ngsummary.json +1 -0
  93. package/esm2015/directives/number-field/nimble-number-field.module.js +15 -0
  94. package/esm2015/directives/number-field/nimble-number-field.module.ngfactory.js +12 -0
  95. package/esm2015/directives/number-field/nimble-number-field.module.ngsummary.json +1 -0
  96. package/esm2015/directives/select/nimble-select-control-value-accessor.directive.js +26 -0
  97. package/esm2015/directives/select/nimble-select-control-value-accessor.directive.ngsummary.json +1 -0
  98. package/esm2015/directives/select/nimble-select.directive.js +12 -0
  99. package/esm2015/directives/select/nimble-select.directive.ngsummary.json +1 -0
  100. package/esm2015/directives/select/nimble-select.module.js +15 -0
  101. package/esm2015/directives/select/nimble-select.module.ngfactory.js +12 -0
  102. package/esm2015/directives/select/nimble-select.module.ngsummary.json +1 -0
  103. package/esm2015/directives/tab/nimble-tab.directive.js +30 -0
  104. package/esm2015/directives/tab/nimble-tab.directive.ngsummary.json +1 -0
  105. package/esm2015/directives/tab/nimble-tab.module.js +14 -0
  106. package/esm2015/directives/tab/nimble-tab.module.ngfactory.js +12 -0
  107. package/esm2015/directives/tab/nimble-tab.module.ngsummary.json +1 -0
  108. package/esm2015/directives/tab-panel/nimble-tab-panel.directive.js +12 -0
  109. package/esm2015/directives/tab-panel/nimble-tab-panel.directive.ngsummary.json +1 -0
  110. package/esm2015/directives/tab-panel/nimble-tab-panel.module.js +14 -0
  111. package/esm2015/directives/tab-panel/nimble-tab-panel.module.ngfactory.js +12 -0
  112. package/esm2015/directives/tab-panel/nimble-tab-panel.module.ngsummary.json +1 -0
  113. package/esm2015/directives/tabs/nimble-tabs.directive.js +37 -0
  114. package/esm2015/directives/tabs/nimble-tabs.directive.ngsummary.json +1 -0
  115. package/esm2015/directives/tabs/nimble-tabs.module.js +14 -0
  116. package/esm2015/directives/tabs/nimble-tabs.module.ngfactory.js +12 -0
  117. package/esm2015/directives/tabs/nimble-tabs.module.ngsummary.json +1 -0
  118. package/esm2015/directives/tabs-toolbar/nimble-tabs-toolbar.directive.js +12 -0
  119. package/esm2015/directives/tabs-toolbar/nimble-tabs-toolbar.directive.ngsummary.json +1 -0
  120. package/esm2015/directives/tabs-toolbar/nimble-tabs-toolbar.module.js +14 -0
  121. package/esm2015/directives/tabs-toolbar/nimble-tabs-toolbar.module.ngfactory.js +12 -0
  122. package/esm2015/directives/tabs-toolbar/nimble-tabs-toolbar.module.ngsummary.json +1 -0
  123. package/esm2015/directives/text-field/nimble-text-field-control-value-accessor.directive.js +29 -0
  124. package/esm2015/directives/text-field/nimble-text-field-control-value-accessor.directive.ngsummary.json +1 -0
  125. package/esm2015/directives/text-field/nimble-text-field.directive.js +42 -0
  126. package/esm2015/directives/text-field/nimble-text-field.directive.ngsummary.json +1 -0
  127. package/esm2015/directives/text-field/nimble-text-field.module.js +15 -0
  128. package/esm2015/directives/text-field/nimble-text-field.module.ngfactory.js +12 -0
  129. package/esm2015/directives/text-field/nimble-text-field.module.ngsummary.json +1 -0
  130. package/esm2015/directives/theme-provider/nimble-theme-provider.directive.js +31 -0
  131. package/esm2015/directives/theme-provider/nimble-theme-provider.directive.ngsummary.json +1 -0
  132. package/esm2015/directives/theme-provider/nimble-theme-provider.module.js +14 -0
  133. package/esm2015/directives/theme-provider/nimble-theme-provider.module.ngfactory.js +12 -0
  134. package/esm2015/directives/theme-provider/nimble-theme-provider.module.ngsummary.json +1 -0
  135. package/esm2015/directives/tree-item/nimble-tree-item.directive.js +54 -0
  136. package/esm2015/directives/tree-item/nimble-tree-item.directive.ngsummary.json +1 -0
  137. package/esm2015/directives/tree-item/nimble-tree-item.module.js +14 -0
  138. package/esm2015/directives/tree-item/nimble-tree-item.module.ngfactory.js +12 -0
  139. package/esm2015/directives/tree-item/nimble-tree-item.module.ngsummary.json +1 -0
  140. package/esm2015/directives/tree-view/nimble-tree-view.directive.js +33 -0
  141. package/esm2015/directives/tree-view/nimble-tree-view.directive.ngsummary.json +1 -0
  142. package/esm2015/directives/tree-view/nimble-tree-view.module.js +14 -0
  143. package/esm2015/directives/tree-view/nimble-tree-view.module.ngfactory.js +12 -0
  144. package/esm2015/directives/tree-view/nimble-tree-view.module.ngsummary.json +1 -0
  145. package/esm2015/directives/utilities/template-value-helpers.js +37 -0
  146. package/esm2015/directives/utilities/template-value-helpers.ngsummary.json +1 -0
  147. package/esm2015/ni-nimble-angular.js +5 -0
  148. package/esm2015/ni-nimble-angular.ngsummary.json +1 -0
  149. package/esm2015/public-api.js +41 -0
  150. package/esm2015/public-api.ngsummary.json +1 -0
  151. package/esm2015/testing/async-helpers.js +12 -0
  152. package/esm2015/testing/async-helpers.ngsummary.json +1 -0
  153. package/fesm2015/ni-nimble-angular.js +822 -0
  154. package/fesm2015/ni-nimble-angular.js.map +1 -0
  155. package/ni-nimble-angular.d.ts +4 -0
  156. package/ni-nimble-angular.metadata.json +1 -0
  157. package/package.json +11 -18
  158. package/public-api.d.ts +37 -0
  159. package/testing/async-helpers.d.ts +11 -0
  160. package/.eslintrc.js +0 -38
  161. package/karma.conf.js +0 -46
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <div align="center">
2
- <p align="center"><b>ni | nimble | angular</b></p>
2
+ <p><b>ni | nimble | angular</b></p>
3
3
  </div>
4
4
 
5
5
  # Nimble Angular
@@ -8,37 +8,68 @@
8
8
 
9
9
  NI-styled UI components for Angular applications
10
10
 
11
- ## Getting Started
11
+ ## Getting started
12
12
 
13
- You are currently required to set `"buildOptimizer": "false"` in `angular.json`. See [#18](https://github.com/ni/nimble/issues/18) for more info.
13
+ *This guide assumes you have an existing Angular application and are using NPM 7 or greater.*
14
14
 
15
- ## Contributing
15
+ 1. Install Nimble Angular from the [public NPM registry](https://www.npmjs.com/package/@ni/nimble-angular) by running `npm install @ni/nimble-angular`.
16
+ 2. The steps to use components from Nimble Angular are similar to using components from any other Angular library. You can see the [Example Client App](/angular-workspace/projects/example-client-app) project for an example.
17
+ 1. Update your `app.module.ts` to import the module for each component you want to use:
18
+ ```ts
19
+ import { NimbleDrawerModule } from '@ni/nimble-angular';
20
+
21
+ @NgModule ({
22
+ imports: [
23
+ NimbleDrawerModule,
24
+ ]
25
+ })
26
+ class AppModule {}
27
+ ```
28
+ 2. Add the component to your `app.component.html` (or to the template for another component in your application):
29
+ ```html
30
+ <nimble-drawer #drawerReference location="right">This is a drawer</nimble-drawer>
31
+ ```
32
+ 3. If needed, import the Nimble component's directive and types in `app.component.ts` (or the TypeScript file backing another component) to use its programmatic API:
33
+ ```ts
34
+ import { NimbleDrawerDirective } from '@ni/nimble-angular';
35
+
36
+ @Component({ /* ... */ })
37
+ class AppComponent {
38
+ @ViewChild('drawerReference', { read: NimbleDrawerDirective }) public drawer: NimbleDrawerDirective;
16
39
 
17
- Follow the instructions in [CONTRIBUTING.md](CONTRIBUTING.md) to modify this library.
40
+ public openDrawer() {
41
+ this.drawer.show();
42
+ }
43
+ }
44
+ ```
18
45
 
19
- <!--
20
- # NimbleAngular
46
+ ### Learn more
21
47
 
22
- This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 12.1.0.
48
+ See the [README.md for the ni/nimble repository](/README.md) for documentation of individual components.
23
49
 
24
- ## Code scaffolding
50
+ ### Using Nimble form controls
25
51
 
26
- Run `ng generate component component-name --project nimble-angular` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project nimble-angular`.
27
- > Note: Don't forget to add `--project nimble-angular` or else it will be added to the default project in your `angular.json` file.
52
+ For best results, always use `ngModel`, `formControl`, or `formControlName` bindings when integrating Nimble form controls in Angular. Binding to the control's native value property or event (e.g. `[value]` or `(change)`) is not supported, and can cause build failures and other issues. If a value change event is necessary, use `ngModel (ngModelChange)="onChange()"`.
28
53
 
29
- ## Build
54
+ ### Testing with Nimble elements and `fakeAsync`
30
55
 
31
- Run `ng build nimble-angular` to build the project. The build artifacts will be stored in the `dist/` directory.
56
+ Angular's `fakeAsync` utility is useful for writing quickly-executing tests, but it can cause issues when testing components containing Nimble elements. Nimble uses an internal process queue to schedule work. If a `fakeAsync` test schedules work on the queue (by creating or interacting with Nimble elements) and the queue isn't processed by the end of the test, the queue will never be processed and subsequent tests may fail.
32
57
 
33
- ## Publishing
58
+ To avoid this, call `processUpdates()` after each `fakeAsync` test. This will synchronously process the internal queue and put it in a good state for subsequent tests. The `processUpdates()` method can also be called mid-test to synchronously complete operations which would otherwise require waiting for an animation frame.
34
59
 
35
- After building your library with `ng build nimble-angular`, go to the dist folder `cd dist/nimble-angular` and run `npm publish`.
60
+ ## Known Issues
36
61
 
37
- ## Running unit tests
62
+ Currently the fast-animation library we depend on only exports CommonJS modules, which triggers an Angular project build warning (and potentially suboptimal bundle optimizations).
38
63
 
39
- Run `ng test nimble-angular` to execute the unit tests via [Karma](https://karma-runner.github.io).
64
+ Currently clients consuming the nimble Angular integration may need to make the following change in their `angular.json`, if they wish to suppress that build warning, in the `projects.[projectName].architect.build.options` section:
65
+ ```json
66
+ "allowedCommonJsDependencies": [
67
+ "@microsoft/fast-animation"
68
+ ]
69
+ ```
40
70
 
41
- ## Further help
71
+ [nimble issue #189](https://github.com/ni/nimble/issues/189) tracks this issue.
72
+
73
+ ## Contributing
42
74
 
43
- To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
44
- -->
75
+ Follow the instructions in [CONTRIBUTING.md](/angular-workspace/projects/ni/nimble-angular/CONTRIBUTING.md) to modify this library.