@ni/nimble-angular 1.0.0-beta.131 → 1.0.0-beta.132

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 (58) hide show
  1. package/README.md +2 -3
  2. package/bundles/ni-nimble-angular.umd.js +65 -18
  3. package/bundles/ni-nimble-angular.umd.js.map +1 -1
  4. package/directives/button/nimble-button.directive.d.ts +9 -3
  5. package/directives/checkbox/nimble-checkbox.directive.d.ts +2 -0
  6. package/directives/drawer/nimble-drawer.directive.d.ts +6 -4
  7. package/directives/listbox-option/nimble-listbox-option.directive.d.ts +4 -2
  8. package/directives/menu/nimble-menu.directive.d.ts +2 -0
  9. package/directives/menu-item/nimble-menu-item.directive.d.ts +4 -2
  10. package/directives/number-field/nimble-number-field.directive.d.ts +7 -5
  11. package/directives/select/nimble-select.directive.d.ts +2 -0
  12. package/directives/tab/nimble-tab.directive.d.ts +4 -2
  13. package/directives/tab-panel/nimble-tab-panel.directive.d.ts +2 -0
  14. package/directives/tabs/nimble-tabs.directive.d.ts +2 -1
  15. package/directives/tabs-toolbar/nimble-tabs-toolbar.directive.d.ts +2 -0
  16. package/directives/text-field/nimble-text-field.directive.d.ts +9 -2
  17. package/directives/theme-provider/nimble-theme-provider.directive.d.ts +5 -3
  18. package/directives/tree-item/nimble-tree-item.directive.d.ts +5 -4
  19. package/directives/tree-view/nimble-tree-view.directive.d.ts +6 -5
  20. package/directives/utilities/template-value-helpers.d.ts +8 -6
  21. package/esm2015/directives/button/nimble-button.directive.js +11 -2
  22. package/esm2015/directives/button/nimble-button.directive.ngsummary.json +1 -1
  23. package/esm2015/directives/checkbox/nimble-checkbox.directive.js +1 -1
  24. package/esm2015/directives/checkbox/nimble-checkbox.directive.ngsummary.json +1 -1
  25. package/esm2015/directives/drawer/nimble-drawer.directive.js +1 -2
  26. package/esm2015/directives/listbox-option/nimble-listbox-option.directive.js +3 -3
  27. package/esm2015/directives/listbox-option/nimble-listbox-option.directive.ngsummary.json +1 -1
  28. package/esm2015/directives/menu/nimble-menu.directive.js +1 -1
  29. package/esm2015/directives/menu/nimble-menu.directive.ngsummary.json +1 -1
  30. package/esm2015/directives/menu-item/nimble-menu-item.directive.js +1 -1
  31. package/esm2015/directives/menu-item/nimble-menu-item.directive.ngsummary.json +1 -1
  32. package/esm2015/directives/number-field/nimble-number-field.directive.js +5 -2
  33. package/esm2015/directives/number-field/nimble-number-field.directive.ngsummary.json +1 -1
  34. package/esm2015/directives/select/nimble-select.directive.js +1 -1
  35. package/esm2015/directives/select/nimble-select.directive.ngsummary.json +1 -1
  36. package/esm2015/directives/tab/nimble-tab.directive.js +1 -1
  37. package/esm2015/directives/tab/nimble-tab.directive.ngsummary.json +1 -1
  38. package/esm2015/directives/tab-panel/nimble-tab-panel.directive.js +1 -1
  39. package/esm2015/directives/tab-panel/nimble-tab-panel.directive.ngsummary.json +1 -1
  40. package/esm2015/directives/tabs/nimble-tabs.directive.js +1 -1
  41. package/esm2015/directives/tabs/nimble-tabs.directive.ngsummary.json +1 -1
  42. package/esm2015/directives/tabs-toolbar/nimble-tabs-toolbar.directive.js +1 -1
  43. package/esm2015/directives/tabs-toolbar/nimble-tabs-toolbar.directive.ngsummary.json +1 -1
  44. package/esm2015/directives/text-field/nimble-text-field.directive.js +14 -2
  45. package/esm2015/directives/text-field/nimble-text-field.directive.ngsummary.json +1 -1
  46. package/esm2015/directives/theme-provider/nimble-theme-provider.directive.js +2 -2
  47. package/esm2015/directives/theme-provider/nimble-theme-provider.directive.ngsummary.json +1 -1
  48. package/esm2015/directives/tree-item/nimble-tree-item.directive.js +1 -2
  49. package/esm2015/directives/tree-view/nimble-tree-view.directive.js +6 -5
  50. package/esm2015/directives/tree-view/nimble-tree-view.directive.ngsummary.json +1 -1
  51. package/esm2015/directives/utilities/template-value-helpers.js +8 -3
  52. package/esm2015/directives/utilities/template-value-helpers.ngsummary.json +1 -1
  53. package/esm2015/ni-nimble-angular.ngsummary.json +1 -1
  54. package/esm2015/public-api.ngsummary.json +1 -1
  55. package/fesm2015/ni-nimble-angular.js +40 -11
  56. package/fesm2015/ni-nimble-angular.js.map +1 -1
  57. package/ni-nimble-angular.metadata.json +1 -1
  58. package/package.json +2 -2
package/README.md CHANGED
@@ -27,15 +27,14 @@ NI-styled UI components for Angular applications
27
27
  ```
28
28
  2. Add the component to your `app.component.html` (or to the template for another component in your application):
29
29
  ```html
30
- <nimble-drawer #drawerReference [location]="location">This is a drawer</nimble-drawer>
30
+ <nimble-drawer #drawerReference location="right">This is a drawer</nimble-drawer>
31
31
  ```
32
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
33
  ```ts
34
- import { DrawerLocation, NimbleDrawerDirective } from '@ni/nimble-angular';
34
+ import { NimbleDrawerDirective } from '@ni/nimble-angular';
35
35
 
36
36
  @Component({ /* ... */ })
37
37
  class AppComponent {
38
- @Input() public location: DrawerLocation = DrawerLocation.Right;
39
38
  @ViewChild('drawerReference', { read: NimbleDrawerDirective }) public drawer: NimbleDrawerDirective;
40
39
 
41
40
  public openDrawer() {
@@ -1,12 +1,11 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@ni/nimble-components/dist/esm/button'), require('@angular/forms'), require('@ni/nimble-components/dist/esm/checkbox'), require('@ni/nimble-components/dist/esm/drawer/types'), require('@ni/nimble-components/dist/esm/drawer'), require('@ni/nimble-components/dist/esm/listbox-option'), require('@ni/nimble-components/dist/esm/menu'), require('@ni/nimble-components/dist/esm/menu-item'), require('@ni/nimble-components/dist/esm/number-field'), require('@ni/nimble-components/dist/esm/select'), require('@ni/nimble-components/dist/esm/tab'), require('@ni/nimble-components/dist/esm/tab-panel'), require('@ni/nimble-components/dist/esm/tabs'), require('@ni/nimble-components/dist/esm/tabs-toolbar'), require('@ni/nimble-components/dist/esm/text-field'), require('@ni/nimble-components/dist/esm/theme-provider/themes'), require('@ni/nimble-components/dist/esm/theme-provider'), require('@ni/nimble-components/dist/esm/tree-item'), require('@ni/nimble-components/dist/esm/tree-view/types'), require('@ni/nimble-components/dist/esm/tree-view')) :
3
- typeof define === 'function' && define.amd ? define('@ni/nimble-angular', ['exports', '@angular/core', '@angular/common', '@ni/nimble-components/dist/esm/button', '@angular/forms', '@ni/nimble-components/dist/esm/checkbox', '@ni/nimble-components/dist/esm/drawer/types', '@ni/nimble-components/dist/esm/drawer', '@ni/nimble-components/dist/esm/listbox-option', '@ni/nimble-components/dist/esm/menu', '@ni/nimble-components/dist/esm/menu-item', '@ni/nimble-components/dist/esm/number-field', '@ni/nimble-components/dist/esm/select', '@ni/nimble-components/dist/esm/tab', '@ni/nimble-components/dist/esm/tab-panel', '@ni/nimble-components/dist/esm/tabs', '@ni/nimble-components/dist/esm/tabs-toolbar', '@ni/nimble-components/dist/esm/text-field', '@ni/nimble-components/dist/esm/theme-provider/themes', '@ni/nimble-components/dist/esm/theme-provider', '@ni/nimble-components/dist/esm/tree-item', '@ni/nimble-components/dist/esm/tree-view/types', '@ni/nimble-components/dist/esm/tree-view'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.ni = global.ni || {}, global.ni['nimble-angular'] = {}), global.ng.core, global.ng.common, null, global.ng.forms, null, global.types, null, null, null, null, null, null, null, null, null, null, null, global.themes, null, null, global.types$1));
5
- }(this, (function (exports, core, common, button, forms, checkbox, types, drawer, listboxOption, menu, menuItem, numberField, select, tab, tabPanel, tabs, tabsToolbar, textField, themes, themeProvider, treeItem, types$1) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@ni/nimble-components/dist/esm/button/types'), require('@angular/common'), require('@ni/nimble-components/dist/esm/button'), require('@angular/forms'), require('@ni/nimble-components/dist/esm/checkbox'), require('@ni/nimble-components/dist/esm/drawer/types'), require('@ni/nimble-components/dist/esm/drawer'), require('@ni/nimble-components/dist/esm/listbox-option'), require('@ni/nimble-components/dist/esm/menu'), require('@ni/nimble-components/dist/esm/menu-item'), require('@ni/nimble-components/dist/esm/number-field'), require('@ni/nimble-components/dist/esm/select'), require('@ni/nimble-components/dist/esm/tab'), require('@ni/nimble-components/dist/esm/tab-panel'), require('@ni/nimble-components/dist/esm/tabs'), require('@ni/nimble-components/dist/esm/tabs-toolbar'), require('@ni/nimble-components/dist/esm/text-field/types'), require('@ni/nimble-components/dist/esm/text-field'), require('@ni/nimble-components/dist/esm/theme-provider/types'), require('@ni/nimble-components/dist/esm/theme-provider'), require('@ni/nimble-components/dist/esm/tree-item'), require('@ni/nimble-components/dist/esm/tree-view/types'), require('@ni/nimble-components/dist/esm/tree-view')) :
3
+ typeof define === 'function' && define.amd ? define('@ni/nimble-angular', ['exports', '@angular/core', '@ni/nimble-components/dist/esm/button/types', '@angular/common', '@ni/nimble-components/dist/esm/button', '@angular/forms', '@ni/nimble-components/dist/esm/checkbox', '@ni/nimble-components/dist/esm/drawer/types', '@ni/nimble-components/dist/esm/drawer', '@ni/nimble-components/dist/esm/listbox-option', '@ni/nimble-components/dist/esm/menu', '@ni/nimble-components/dist/esm/menu-item', '@ni/nimble-components/dist/esm/number-field', '@ni/nimble-components/dist/esm/select', '@ni/nimble-components/dist/esm/tab', '@ni/nimble-components/dist/esm/tab-panel', '@ni/nimble-components/dist/esm/tabs', '@ni/nimble-components/dist/esm/tabs-toolbar', '@ni/nimble-components/dist/esm/text-field/types', '@ni/nimble-components/dist/esm/text-field', '@ni/nimble-components/dist/esm/theme-provider/types', '@ni/nimble-components/dist/esm/theme-provider', '@ni/nimble-components/dist/esm/tree-item', '@ni/nimble-components/dist/esm/tree-view/types', '@ni/nimble-components/dist/esm/tree-view'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.ni = global.ni || {}, global.ni['nimble-angular'] = {}), global.ng.core, global.types, global.ng.common, null, global.ng.forms, null, global.types$1, null, null, null, null, null, null, null, null, null, null, global.types$2, null, global.types$3, null, null, global.types$4));
5
+ }(this, (function (exports, core, types, common, button, forms, checkbox, types$1, drawer, listboxOption, menu, menuItem, numberField, select, tab, tabPanel, tabs, tabsToolbar, types$2, textField, types$3, themeProvider, treeItem, types$4) { 'use strict';
6
6
 
7
7
  /**
8
- * Conversion helpers for values coming from Angular templates via
9
- * strings specified in templates or via property bindings
8
+ * Conversion helpers for values coming from template attributes or property bindings
10
9
  */
11
10
  /**
12
11
  * Converts values from templates (empty string or null) or boolean bindings to a boolean property representation
@@ -33,6 +32,12 @@
33
32
  * Converts values from templates (number representation as a string) or number bindings to a number property representation
34
33
  */
35
34
  var toNumberProperty = function (value) {
35
+ // Angular: https://github.com/angular/angular/blob/2664bc2b3ef4ee5fd671f915828cfcc274a36c77/packages/forms/src/directives/number_value_accessor.ts#L67
36
+ // And Fast: https://github.com/microsoft/fast/blob/46bb6d9aab2c37105f4434db3795e176c2354a4f/packages/web-components/fast-element/src/components/attributes.ts#L100
37
+ // Handle numeric conversions from the view differently
38
+ // Since Number(val) https://tc39.es/ecma262/multipage/numbers-and-dates.html#sec-number-constructor-number-value
39
+ // and val * 1 https://tc39.es/ecma262/multipage/ecmascript-language-expressions.html#sec-applystringornumericbinaryoperator
40
+ // Are identical (use ToNumeric algorithm), went with Number() for clarity
36
41
  return Number(value);
37
42
  };
38
43
 
@@ -64,6 +69,16 @@
64
69
  enumerable: false,
65
70
  configurable: true
66
71
  });
72
+ Object.defineProperty(NimbleButtonDirective.prototype, "type", {
73
+ get: function () {
74
+ return this.elementRef.nativeElement.type;
75
+ },
76
+ set: function (value) {
77
+ this.renderer.setProperty(this.elementRef.nativeElement, 'type', value);
78
+ },
79
+ enumerable: false,
80
+ configurable: true
81
+ });
67
82
  return NimbleButtonDirective;
68
83
  }());
69
84
  NimbleButtonDirective.decorators = [
@@ -77,7 +92,8 @@
77
92
  ]; };
78
93
  NimbleButtonDirective.propDecorators = {
79
94
  appearance: [{ type: core.Input }],
80
- disabled: [{ type: core.Input }]
95
+ disabled: [{ type: core.Input }],
96
+ type: [{ type: core.Input }]
81
97
  };
82
98
 
83
99
  var NimbleButtonModule = /** @class */ (function () {
@@ -505,10 +521,10 @@
505
521
  configurable: true
506
522
  });
507
523
  NimbleDrawerDirective.prototype.show = function () {
508
- this.state = types.DrawerState.Opening;
524
+ this.state = types$1.DrawerState.Opening;
509
525
  };
510
526
  NimbleDrawerDirective.prototype.hide = function () {
511
- this.state = types.DrawerState.Closing;
527
+ this.state = types$1.DrawerState.Closing;
512
528
  };
513
529
  NimbleDrawerDirective.prototype.onStateChanged = function ($event) {
514
530
  if ($event.target === this.elementRef.nativeElement) {
@@ -607,7 +623,7 @@
607
623
  NimbleListboxOptionDirective.ctorParameters = function () { return [
608
624
  { type: core.ElementRef },
609
625
  { type: core.Renderer2 },
610
- { type: NimbleSelectControlValueAccessorDirective, decorators: [{ type: core.Optional }, { type: core.Host }] }
626
+ { type: NimbleSelectControlValueAccessorDirective, decorators: [{ type: core.Inject, args: [NimbleSelectControlValueAccessorDirective,] }, { type: core.Optional }, { type: core.Host }] }
611
627
  ]; };
612
628
  NimbleListboxOptionDirective.propDecorators = {
613
629
  disabled: [{ type: core.Input }]
@@ -738,6 +754,9 @@
738
754
  get: function () {
739
755
  return this.elementRef.nativeElement.readOnly;
740
756
  },
757
+ // readOnly property maps to the readonly attribute
758
+ // https://github.com/microsoft/fast/blob/46bb6d9aab2c37105f4434db3795e176c2354a4f/packages/web-components/fast-foundation/src/number-field/number-field.ts#L38
759
+ // eslint-disable-next-line @angular-eslint/no-input-rename
741
760
  set: function (value) {
742
761
  this.renderer.setProperty(this.elementRef.nativeElement, 'readOnly', toBooleanProperty(value));
743
762
  },
@@ -796,7 +815,7 @@
796
815
  { type: core.ElementRef }
797
816
  ]; };
798
817
  NimbleNumberFieldDirective.propDecorators = {
799
- readOnly: [{ type: core.Input }],
818
+ readOnly: [{ type: core.Input, args: ['readonly',] }],
800
819
  min: [{ type: core.Input }],
801
820
  max: [{ type: core.Input }],
802
821
  step: [{ type: core.Input }],
@@ -1041,12 +1060,25 @@
1041
1060
  get: function () {
1042
1061
  return this.elementRef.nativeElement.readOnly;
1043
1062
  },
1063
+ // readOnly property maps to the readonly attribute
1064
+ // See: https://github.com/microsoft/fast/blob/46bb6d9aab2c37105f4434db3795e176c2354a4f/packages/web-components/fast-foundation/src/text-field/text-field.ts#L33
1065
+ // eslint-disable-next-line @angular-eslint/no-input-rename
1044
1066
  set: function (value) {
1045
1067
  this.renderer.setProperty(this.elementRef.nativeElement, 'readOnly', toBooleanProperty(value));
1046
1068
  },
1047
1069
  enumerable: false,
1048
1070
  configurable: true
1049
1071
  });
1072
+ Object.defineProperty(NimbleTextFieldDirective.prototype, "type", {
1073
+ get: function () {
1074
+ return this.elementRef.nativeElement.type;
1075
+ },
1076
+ set: function (value) {
1077
+ this.renderer.setProperty(this.elementRef.nativeElement, 'type', value);
1078
+ },
1079
+ enumerable: false,
1080
+ configurable: true
1081
+ });
1050
1082
  return NimbleTextFieldDirective;
1051
1083
  }());
1052
1084
  NimbleTextFieldDirective.decorators = [
@@ -1059,7 +1091,8 @@
1059
1091
  { type: core.ElementRef }
1060
1092
  ]; };
1061
1093
  NimbleTextFieldDirective.propDecorators = {
1062
- readOnly: [{ type: core.Input }]
1094
+ readOnly: [{ type: core.Input, args: ['readonly',] }],
1095
+ type: [{ type: core.Input }]
1063
1096
  };
1064
1097
 
1065
1098
  var NimbleTextFieldModule = /** @class */ (function () {
@@ -1211,6 +1244,8 @@
1211
1244
  get: function () {
1212
1245
  return this.elementRef.nativeElement.selectionMode;
1213
1246
  },
1247
+ // selectionMode property intentionally maps to the selection-mode attribute
1248
+ // eslint-disable-next-line @angular-eslint/no-input-rename
1214
1249
  set: function (value) {
1215
1250
  this.renderer.setProperty(this.elementRef.nativeElement, 'selectionMode', value);
1216
1251
  },
@@ -1229,7 +1264,7 @@
1229
1264
  { type: core.ElementRef }
1230
1265
  ]; };
1231
1266
  NimbleTreeViewDirective.propDecorators = {
1232
- selectionMode: [{ type: core.Input }]
1267
+ selectionMode: [{ type: core.Input, args: ['selection-mode',] }]
1233
1268
  };
1234
1269
 
1235
1270
  var NimbleTreeViewModule = /** @class */ (function () {
@@ -1253,28 +1288,40 @@
1253
1288
  * Generated bundle index. Do not edit.
1254
1289
  */
1255
1290
 
1291
+ Object.defineProperty(exports, 'ButtonAppearance', {
1292
+ enumerable: true,
1293
+ get: function () {
1294
+ return types.ButtonAppearance;
1295
+ }
1296
+ });
1256
1297
  Object.defineProperty(exports, 'DrawerLocation', {
1257
1298
  enumerable: true,
1258
1299
  get: function () {
1259
- return types.DrawerLocation;
1300
+ return types$1.DrawerLocation;
1260
1301
  }
1261
1302
  });
1262
1303
  Object.defineProperty(exports, 'DrawerState', {
1263
1304
  enumerable: true,
1264
1305
  get: function () {
1265
- return types.DrawerState;
1306
+ return types$1.DrawerState;
1307
+ }
1308
+ });
1309
+ Object.defineProperty(exports, 'TextFieldType', {
1310
+ enumerable: true,
1311
+ get: function () {
1312
+ return types$2.TextFieldType;
1266
1313
  }
1267
1314
  });
1268
1315
  Object.defineProperty(exports, 'NimbleTheme', {
1269
1316
  enumerable: true,
1270
1317
  get: function () {
1271
- return themes.NimbleTheme;
1318
+ return types$3.NimbleTheme;
1272
1319
  }
1273
1320
  });
1274
- Object.defineProperty(exports, 'SelectionMode', {
1321
+ Object.defineProperty(exports, 'TreeViewSelectionMode', {
1275
1322
  enumerable: true,
1276
1323
  get: function () {
1277
- return types$1.SelectionMode;
1324
+ return types$4.TreeViewSelectionMode;
1278
1325
  }
1279
1326
  });
1280
1327
  exports.NimbleButtonDirective = NimbleButtonDirective;