@ni/nimble-angular 9.0.1 → 10.0.0

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.
package/README.md CHANGED
@@ -115,19 +115,6 @@ The @ni/nimble-angular package is now compiled with Ivy. The consequence of this
115
115
 
116
116
  While Nimble Angular will strive to stay current on the most recent version of Angular, there will be some grace period to allow client applications time to make the migration before-hand (which is [required](https://angular.io/guide/creating-libraries#ensuring-library-version-compatibility) in order to use Nimble Angular).
117
117
 
118
- ## Known Issues
119
-
120
- Currently the fast-animation library we depend on only exports CommonJS modules, which triggers an Angular project build warning (and potentially suboptimal bundle optimizations).
121
-
122
- 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:
123
- ```json
124
- "allowedCommonJsDependencies": [
125
- "@microsoft/fast-animation"
126
- ]
127
- ```
128
-
129
- [nimble issue #189](https://github.com/ni/nimble/issues/189) tracks this issue.
130
-
131
118
  ## Contributing
132
119
 
133
120
  Follow the instructions in [CONTRIBUTING.md](/angular-workspace/projects/ni/nimble-angular/CONTRIBUTING.md) to modify this library.
@@ -1225,13 +1225,19 @@
1225
1225
  }] });
1226
1226
 
1227
1227
  /**
1228
- * Directive to provide Angular integration for the drawer.
1228
+ * Directive to provide Angular integration for the drawer element.
1229
+ * @description
1230
+ * In order to provide a custom value for the `CloseReason` for the drawer you need to obtain
1231
+ * a `@ViewChild` reference with the custom type specified. For example, to specify the type as `string`:
1232
+ * ```ts
1233
+ * @ViewChild('drawer', { read: NimbleDrawerDirective }) public drawer: NimbleDrawerDirective<string>;
1234
+ * ```
1229
1235
  */
1236
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
1230
1237
  var NimbleDrawerDirective = /** @class */ (function () {
1231
1238
  function NimbleDrawerDirective(renderer, elementRef) {
1232
1239
  this.renderer = renderer;
1233
1240
  this.elementRef = elementRef;
1234
- this.stateChange = new i0.EventEmitter();
1235
1241
  }
1236
1242
  Object.defineProperty(NimbleDrawerDirective.prototype, "location", {
1237
1243
  get: function () {
@@ -1243,53 +1249,51 @@
1243
1249
  enumerable: false,
1244
1250
  configurable: true
1245
1251
  });
1246
- Object.defineProperty(NimbleDrawerDirective.prototype, "state", {
1252
+ Object.defineProperty(NimbleDrawerDirective.prototype, "preventDismiss", {
1247
1253
  get: function () {
1248
- return this.elementRef.nativeElement.state;
1254
+ return this.elementRef.nativeElement.preventDismiss;
1249
1255
  },
1256
+ // preventDismiss property intentionally maps to the prevent-dismiss attribute
1257
+ // eslint-disable-next-line @angular-eslint/no-input-rename
1250
1258
  set: function (value) {
1251
- this.renderer.setProperty(this.elementRef.nativeElement, 'state', value);
1259
+ this.renderer.setProperty(this.elementRef.nativeElement, 'preventDismiss', toBooleanProperty(value));
1252
1260
  },
1253
1261
  enumerable: false,
1254
1262
  configurable: true
1255
1263
  });
1256
- Object.defineProperty(NimbleDrawerDirective.prototype, "modal", {
1264
+ Object.defineProperty(NimbleDrawerDirective.prototype, "ariaLabel", {
1257
1265
  get: function () {
1258
- return this.elementRef.nativeElement.modal;
1266
+ return this.elementRef.nativeElement.ariaLabel;
1259
1267
  },
1268
+ // ariaLabel property intentionally maps to the aria-label attribute
1269
+ // eslint-disable-next-line @angular-eslint/no-input-rename
1260
1270
  set: function (value) {
1261
- this.renderer.setProperty(this.elementRef.nativeElement, 'modal', toBooleanProperty(value));
1271
+ this.renderer.setProperty(this.elementRef.nativeElement, 'ariaLabel', value);
1262
1272
  },
1263
1273
  enumerable: false,
1264
1274
  configurable: true
1265
1275
  });
1266
- Object.defineProperty(NimbleDrawerDirective.prototype, "preventDismiss", {
1276
+ Object.defineProperty(NimbleDrawerDirective.prototype, "open", {
1267
1277
  get: function () {
1268
- return this.elementRef.nativeElement.preventDismiss;
1269
- },
1270
- // preventDismiss property intentionally maps to the prevent-dismiss attribute
1271
- // eslint-disable-next-line @angular-eslint/no-input-rename
1272
- set: function (value) {
1273
- this.renderer.setProperty(this.elementRef.nativeElement, 'preventDismiss', toBooleanProperty(value));
1278
+ return this.elementRef.nativeElement.open;
1274
1279
  },
1275
1280
  enumerable: false,
1276
1281
  configurable: true
1277
1282
  });
1278
1283
  NimbleDrawerDirective.prototype.show = function () {
1279
- this.state = types$6.DrawerState.opening;
1280
- };
1281
- NimbleDrawerDirective.prototype.hide = function () {
1282
- this.state = types$6.DrawerState.closing;
1284
+ return __awaiter(this, void 0, void 0, function () {
1285
+ return __generator(this, function (_a) {
1286
+ return [2 /*return*/, this.elementRef.nativeElement.show()];
1287
+ });
1288
+ });
1283
1289
  };
1284
- NimbleDrawerDirective.prototype.onStateChanged = function ($event) {
1285
- if ($event.target === this.elementRef.nativeElement) {
1286
- this.stateChange.emit(this.state);
1287
- }
1290
+ NimbleDrawerDirective.prototype.close = function (reason) {
1291
+ this.elementRef.nativeElement.close(reason);
1288
1292
  };
1289
1293
  return NimbleDrawerDirective;
1290
1294
  }());
1291
1295
  NimbleDrawerDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: NimbleDrawerDirective, deps: [{ token: i0__namespace.Renderer2 }, { token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
1292
- NimbleDrawerDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.5", type: NimbleDrawerDirective, selector: "nimble-drawer", inputs: { location: "location", state: "state", modal: "modal", preventDismiss: ["prevent-dismiss", "preventDismiss"] }, outputs: { stateChange: "stateChange" }, host: { listeners: { "state-change": "onStateChanged($event)" } }, ngImport: i0__namespace });
1296
+ NimbleDrawerDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.5", type: NimbleDrawerDirective, selector: "nimble-drawer", inputs: { location: "location", preventDismiss: ["prevent-dismiss", "preventDismiss"], ariaLabel: ["aria-label", "ariaLabel"] }, ngImport: i0__namespace });
1293
1297
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: NimbleDrawerDirective, decorators: [{
1294
1298
  type: i0.Directive,
1295
1299
  args: [{
@@ -1297,18 +1301,12 @@
1297
1301
  }]
1298
1302
  }], ctorParameters: function () { return [{ type: i0__namespace.Renderer2 }, { type: i0__namespace.ElementRef }]; }, propDecorators: { location: [{
1299
1303
  type: i0.Input
1300
- }], state: [{
1301
- type: i0.Input
1302
- }], modal: [{
1303
- type: i0.Input
1304
1304
  }], preventDismiss: [{
1305
1305
  type: i0.Input,
1306
1306
  args: ['prevent-dismiss']
1307
- }], stateChange: [{
1308
- type: i0.Output
1309
- }], onStateChanged: [{
1310
- type: i0.HostListener,
1311
- args: ['state-change', ['$event']]
1307
+ }], ariaLabel: [{
1308
+ type: i0.Input,
1309
+ args: ['aria-label']
1312
1310
  }] } });
1313
1311
 
1314
1312
  var NimbleDrawerModule = /** @class */ (function () {
@@ -8820,18 +8818,14 @@
8820
8818
  enumerable: true,
8821
8819
  get: function () { return types$5.ComboboxAutocomplete; }
8822
8820
  });
8823
- Object.defineProperty(exports, 'USER_DISMISSED', {
8821
+ Object.defineProperty(exports, 'UserDismissed', {
8824
8822
  enumerable: true,
8825
- get: function () { return dialog.USER_DISMISSED; }
8823
+ get: function () { return dialog.UserDismissed; }
8826
8824
  });
8827
8825
  Object.defineProperty(exports, 'DrawerLocation', {
8828
8826
  enumerable: true,
8829
8827
  get: function () { return types$6.DrawerLocation; }
8830
8828
  });
8831
- Object.defineProperty(exports, 'DrawerState', {
8832
- enumerable: true,
8833
- get: function () { return types$6.DrawerState; }
8834
- });
8835
8829
  Object.defineProperty(exports, 'NumberFieldAppearance', {
8836
8830
  enumerable: true,
8837
8831
  get: function () { return types$7.NumberFieldAppearance; }