@nova-ui/bits 13.0.2-3950 → 13.0.2-3957

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.
@@ -42,7 +42,6 @@ import _isInteger from 'lodash/isInteger';
42
42
  import * as i3$2 from '@angular/forms';
43
43
  import { NG_VALUE_ACCESSOR, FormsModule, NG_VALIDATORS, ReactiveFormsModule } from '@angular/forms';
44
44
  import _remove from 'lodash/remove';
45
- import { ENTER, SPACE, ESCAPE, hasModifierKey, UP_ARROW, DOWN_ARROW, BACKSPACE, RIGHT_ARROW, LEFT_ARROW } from '@angular/cdk/keycodes';
46
45
  import * as i1 from '@angular/cdk/drag-drop';
47
46
  import { CdkDropList, CdkDrag, DragDropModule, moveItemInArray, transferArrayItem } from '@angular/cdk/drag-drop';
48
47
  import * as i1$7 from '@angular/animations';
@@ -59,6 +58,7 @@ import isNull from 'lodash/isNull';
59
58
  import * as i1$3 from '@angular/cdk/a11y';
60
59
  import { A11yModule, ActiveDescendantKeyManager, ListKeyManager } from '@angular/cdk/a11y';
61
60
  import { coerceBooleanProperty } from '@angular/cdk/coercion';
61
+ import { hasModifierKey } from '@angular/cdk/keycodes';
62
62
  import * as i1$5 from '@angular/cdk/scrolling';
63
63
  import { CdkVirtualScrollViewport, VIRTUAL_SCROLL_STRATEGY, CdkVirtualForOf, ScrollingModule, CdkScrollable } from '@angular/cdk/scrolling';
64
64
  import last from 'lodash/last';
@@ -5296,6 +5296,68 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
5296
5296
  class NuiFormFieldControl {
5297
5297
  }
5298
5298
 
5299
+ // © 2022 SolarWinds Worldwide, LLC. All rights reserved.
5300
+ //
5301
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
5302
+ // of this software and associated documentation files (the "Software"), to
5303
+ // deal in the Software without restriction, including without limitation the
5304
+ // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
5305
+ // sell copies of the Software, and to permit persons to whom the Software is
5306
+ // furnished to do so, subject to the following conditions:
5307
+ //
5308
+ // The above copyright notice and this permission notice shall be included in
5309
+ // all copies or substantial portions of the Software.
5310
+ //
5311
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
5312
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
5313
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
5314
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
5315
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
5316
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
5317
+ // THE SOFTWARE.
5318
+ /** @deprecated */
5319
+ var KEY_CODE;
5320
+ (function (KEY_CODE) {
5321
+ KEY_CODE[KEY_CODE["BACKSPACE"] = 8] = "BACKSPACE";
5322
+ KEY_CODE[KEY_CODE["TAB"] = 9] = "TAB";
5323
+ KEY_CODE[KEY_CODE["ENTER"] = 13] = "ENTER";
5324
+ KEY_CODE[KEY_CODE["ESCAPE"] = 27] = "ESCAPE";
5325
+ KEY_CODE[KEY_CODE["SPACE"] = 32] = "SPACE";
5326
+ KEY_CODE[KEY_CODE["PAGE_UP"] = 33] = "PAGE_UP";
5327
+ KEY_CODE[KEY_CODE["PAGE_DOWN"] = 34] = "PAGE_DOWN";
5328
+ KEY_CODE[KEY_CODE["END"] = 35] = "END";
5329
+ KEY_CODE[KEY_CODE["HOME"] = 36] = "HOME";
5330
+ KEY_CODE[KEY_CODE["LEFT_ARROW"] = 37] = "LEFT_ARROW";
5331
+ KEY_CODE[KEY_CODE["UP_ARROW"] = 38] = "UP_ARROW";
5332
+ KEY_CODE[KEY_CODE["RIGHT_ARROW"] = 39] = "RIGHT_ARROW";
5333
+ KEY_CODE[KEY_CODE["DOWN_ARROW"] = 40] = "DOWN_ARROW";
5334
+ KEY_CODE[KEY_CODE["DELETE"] = 46] = "DELETE";
5335
+ KEY_CODE[KEY_CODE["X"] = 88] = "X";
5336
+ KEY_CODE[KEY_CODE["ASTERISK"] = 106] = "ASTERISK";
5337
+ KEY_CODE[KEY_CODE["PLUS"] = 107] = "PLUS";
5338
+ KEY_CODE[KEY_CODE["MINUS"] = 109] = "MINUS";
5339
+ KEY_CODE[KEY_CODE["TILDE"] = 192] = "TILDE";
5340
+ })(KEY_CODE || (KEY_CODE = {}));
5341
+ var KEYBOARD_CODE;
5342
+ (function (KEYBOARD_CODE) {
5343
+ KEYBOARD_CODE["ARROW_DOWN"] = "ArrowDown";
5344
+ KEYBOARD_CODE["ARROW_LEFT"] = "ArrowLeft";
5345
+ KEYBOARD_CODE["ARROW_RIGHT"] = "ArrowRight";
5346
+ KEYBOARD_CODE["ARROW_UP"] = "ArrowUp";
5347
+ KEYBOARD_CODE["BACKSPACE"] = "Backspace";
5348
+ KEYBOARD_CODE["ENTER"] = "Enter";
5349
+ KEYBOARD_CODE["END"] = "End";
5350
+ KEYBOARD_CODE["ESCAPE"] = "Escape";
5351
+ KEYBOARD_CODE["HOME"] = "Home";
5352
+ KEYBOARD_CODE["PAGE_DOWN"] = "PageDown";
5353
+ KEYBOARD_CODE["PAGE_UP"] = "PageUp";
5354
+ KEYBOARD_CODE["SHIFT_LEFT"] = "ShiftLeft";
5355
+ KEYBOARD_CODE["SHIFT_RIGHT"] = "ShiftRight";
5356
+ KEYBOARD_CODE["SPACE"] = "Space";
5357
+ KEYBOARD_CODE["TAB"] = "Tab";
5358
+ KEYBOARD_CODE["DELETE"] = "Delete";
5359
+ })(KEYBOARD_CODE || (KEYBOARD_CODE = {}));
5360
+
5299
5361
  // © 2022 SolarWinds Worldwide, LLC. All rights reserved.
5300
5362
  /**
5301
5363
  * <nui-checkbox> provides the same functionality as a native
@@ -5318,6 +5380,7 @@ class CheckboxComponent {
5318
5380
  */
5319
5381
  this.valueChange = new EventEmitter();
5320
5382
  this._ariaLabel = "Checkbox";
5383
+ this.keysAction = [KEYBOARD_CODE.SPACE, KEYBOARD_CODE.ENTER].map(String);
5321
5384
  }
5322
5385
  /**
5323
5386
  * Input to set aria label text
@@ -5367,7 +5430,7 @@ class CheckboxComponent {
5367
5430
  .getStream(CHECKBOX_KEYDOWN_EVENT)
5368
5431
  .subscribe((event) => {
5369
5432
  if (event.target === this.checkboxLabel.nativeElement) {
5370
- if (event.keyCode === ENTER || event.keyCode === SPACE) {
5433
+ if (this.keysAction.includes(event.code)) {
5371
5434
  event.stopPropagation();
5372
5435
  event.preventDefault();
5373
5436
  if (!this.disabled) {
@@ -7495,7 +7558,7 @@ class TooltipDirective {
7495
7558
  /** Handles the keydown events on the host element. */
7496
7559
  _handleKeydown(e) {
7497
7560
  if (this._isTooltipVisible() &&
7498
- e.keyCode === ESCAPE &&
7561
+ e.code === KEYBOARD_CODE.ESCAPE &&
7499
7562
  !hasModifierKey(e)) {
7500
7563
  e.preventDefault();
7501
7564
  e.stopPropagation();
@@ -7635,68 +7698,6 @@ const NUI_SELECT_V2_OPTION_PARENT_COMPONENT = new InjectionToken("NUI_SELECT_V2_
7635
7698
  const ANNOUNCER_OPEN_MESSAGE_SUFFIX = "options available";
7636
7699
  const ANNOUNCER_CLOSE_MESSAGE = "Dropdown closed";
7637
7700
 
7638
- // © 2022 SolarWinds Worldwide, LLC. All rights reserved.
7639
- //
7640
- // Permission is hereby granted, free of charge, to any person obtaining a copy
7641
- // of this software and associated documentation files (the "Software"), to
7642
- // deal in the Software without restriction, including without limitation the
7643
- // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7644
- // sell copies of the Software, and to permit persons to whom the Software is
7645
- // furnished to do so, subject to the following conditions:
7646
- //
7647
- // The above copyright notice and this permission notice shall be included in
7648
- // all copies or substantial portions of the Software.
7649
- //
7650
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
7651
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
7652
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
7653
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
7654
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
7655
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
7656
- // THE SOFTWARE.
7657
- /** @deprecated */
7658
- var KEY_CODE;
7659
- (function (KEY_CODE) {
7660
- KEY_CODE[KEY_CODE["BACKSPACE"] = 8] = "BACKSPACE";
7661
- KEY_CODE[KEY_CODE["TAB"] = 9] = "TAB";
7662
- KEY_CODE[KEY_CODE["ENTER"] = 13] = "ENTER";
7663
- KEY_CODE[KEY_CODE["ESCAPE"] = 27] = "ESCAPE";
7664
- KEY_CODE[KEY_CODE["SPACE"] = 32] = "SPACE";
7665
- KEY_CODE[KEY_CODE["PAGE_UP"] = 33] = "PAGE_UP";
7666
- KEY_CODE[KEY_CODE["PAGE_DOWN"] = 34] = "PAGE_DOWN";
7667
- KEY_CODE[KEY_CODE["END"] = 35] = "END";
7668
- KEY_CODE[KEY_CODE["HOME"] = 36] = "HOME";
7669
- KEY_CODE[KEY_CODE["LEFT_ARROW"] = 37] = "LEFT_ARROW";
7670
- KEY_CODE[KEY_CODE["UP_ARROW"] = 38] = "UP_ARROW";
7671
- KEY_CODE[KEY_CODE["RIGHT_ARROW"] = 39] = "RIGHT_ARROW";
7672
- KEY_CODE[KEY_CODE["DOWN_ARROW"] = 40] = "DOWN_ARROW";
7673
- KEY_CODE[KEY_CODE["DELETE"] = 46] = "DELETE";
7674
- KEY_CODE[KEY_CODE["X"] = 88] = "X";
7675
- KEY_CODE[KEY_CODE["ASTERISK"] = 106] = "ASTERISK";
7676
- KEY_CODE[KEY_CODE["PLUS"] = 107] = "PLUS";
7677
- KEY_CODE[KEY_CODE["MINUS"] = 109] = "MINUS";
7678
- KEY_CODE[KEY_CODE["TILDE"] = 192] = "TILDE";
7679
- })(KEY_CODE || (KEY_CODE = {}));
7680
- var KEYBOARD_CODE;
7681
- (function (KEYBOARD_CODE) {
7682
- KEYBOARD_CODE["ARROW_DOWN"] = "ArrowDown";
7683
- KEYBOARD_CODE["ARROW_LEFT"] = "ArrowLeft";
7684
- KEYBOARD_CODE["ARROW_RIGHT"] = "ArrowRight";
7685
- KEYBOARD_CODE["ARROW_UP"] = "ArrowUp";
7686
- KEYBOARD_CODE["BACKSPACE"] = "Backspace";
7687
- KEYBOARD_CODE["ENTER"] = "Enter";
7688
- KEYBOARD_CODE["END"] = "End";
7689
- KEYBOARD_CODE["ESCAPE"] = "Escape";
7690
- KEYBOARD_CODE["HOME"] = "Home";
7691
- KEYBOARD_CODE["PAGE_DOWN"] = "PageDown";
7692
- KEYBOARD_CODE["PAGE_UP"] = "PageUp";
7693
- KEYBOARD_CODE["SHIFT_LEFT"] = "ShiftLeft";
7694
- KEYBOARD_CODE["SHIFT_RIGHT"] = "ShiftRight";
7695
- KEYBOARD_CODE["SPACE"] = "Space";
7696
- KEYBOARD_CODE["TAB"] = "Tab";
7697
- KEYBOARD_CODE["DELETE"] = "Delete";
7698
- })(KEYBOARD_CODE || (KEYBOARD_CODE = {}));
7699
-
7700
7701
  // © 2022 SolarWinds Worldwide, LLC. All rights reserved.
7701
7702
  class OptionKeyControlService {
7702
7703
  constructor(liveAnnouncer) {
@@ -7956,6 +7957,11 @@ class BaseSelectV2 {
7956
7957
  this.syncWidth = true;
7957
7958
  /** Whether the Select/Combobox disabled */
7958
7959
  this.isDisabled = false;
7960
+ this.allowedKeys = [
7961
+ KEYBOARD_CODE.ARROW_UP,
7962
+ KEYBOARD_CODE.ARROW_DOWN,
7963
+ KEYBOARD_CODE.ENTER,
7964
+ ].map(String);
7959
7965
  /** Name of the icon which indicates open/close state of the Dropdown */
7960
7966
  this.caretIcon = "caret-down";
7961
7967
  this.popupUtilities = new OverlayUtilitiesService();
@@ -8243,7 +8249,7 @@ class BaseSelectV2 {
8243
8249
  });
8244
8250
  }
8245
8251
  isAllowedKeyOnManualDropdown(event) {
8246
- return Boolean([UP_ARROW, DOWN_ARROW, ENTER].find((i) => i === event.keyCode));
8252
+ return this.allowedKeys.includes(event.code);
8247
8253
  }
8248
8254
  defineDropdownContainer() {
8249
8255
  this.dropdown.customContainer = this.dropdownCustomContainer;
@@ -8503,16 +8509,16 @@ class SelectedItemsKeyControlService {
8503
8509
  }
8504
8510
  }
8505
8511
  isBackspace(event) {
8506
- return event.keyCode === BACKSPACE;
8512
+ return event.code === KEYBOARD_CODE.BACKSPACE;
8507
8513
  }
8508
8514
  isLeftOrRightArrow(event) {
8509
8515
  return this.isLeftArrow(event) || this.isRightArrow(event);
8510
8516
  }
8511
8517
  isRightArrow(event) {
8512
- return event.keyCode === RIGHT_ARROW;
8518
+ return event.code === KEYBOARD_CODE.ARROW_RIGHT;
8513
8519
  }
8514
8520
  isLeftArrow(event) {
8515
- return event.keyCode === LEFT_ARROW;
8521
+ return event.code === KEYBOARD_CODE.ARROW_LEFT;
8516
8522
  }
8517
8523
  get activeItem() {
8518
8524
  return this.selectedItemsKeyManager.activeItem;
@@ -19598,6 +19604,7 @@ class ExpanderComponent {
19598
19604
  this.openChange = new EventEmitter();
19599
19605
  this.state = "collapsed";
19600
19606
  this.isCustomHeaderContentEmpty = false;
19607
+ this.actionKeys = [KEYBOARD_CODE.SPACE, KEYBOARD_CODE.ENTER].map(String);
19601
19608
  }
19602
19609
  /**
19603
19610
  * Use this to have expander opened by default.
@@ -19626,8 +19633,7 @@ class ExpanderComponent {
19626
19633
  return this.disabled ? "gray" : "primary-blue";
19627
19634
  }
19628
19635
  onKeyDown(event) {
19629
- if (event.code === KEYBOARD_CODE.SPACE ||
19630
- event.code === KEYBOARD_CODE.ENTER) {
19636
+ if (this.actionKeys.includes(event.code)) {
19631
19637
  if (event.target === event.currentTarget) {
19632
19638
  event.preventDefault();
19633
19639
  this.toggle();