@angular/cdk 13.0.2 → 13.0.3

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/fesm2020/a11y.mjs CHANGED
@@ -981,18 +981,20 @@ class FocusTrap {
981
981
  */
982
982
  _getRegionBoundary(bound) {
983
983
  // Contains the deprecated version of selector, for temporary backwards comparability.
984
- let markers = this._element.querySelectorAll(`[cdk-focus-region-${bound}], ` + `[cdkFocusRegion${bound}], ` + `[cdk-focus-${bound}]`);
985
- for (let i = 0; i < markers.length; i++) {
986
- // @breaking-change 8.0.0
987
- if (markers[i].hasAttribute(`cdk-focus-${bound}`)) {
988
- console.warn(`Found use of deprecated attribute 'cdk-focus-${bound}', ` +
989
- `use 'cdkFocusRegion${bound}' instead. The deprecated ` +
990
- `attribute will be removed in 8.0.0.`, markers[i]);
991
- }
992
- else if (markers[i].hasAttribute(`cdk-focus-region-${bound}`)) {
993
- console.warn(`Found use of deprecated attribute 'cdk-focus-region-${bound}', ` +
994
- `use 'cdkFocusRegion${bound}' instead. The deprecated attribute ` +
995
- `will be removed in 8.0.0.`, markers[i]);
984
+ const markers = this._element.querySelectorAll(`[cdk-focus-region-${bound}], ` + `[cdkFocusRegion${bound}], ` + `[cdk-focus-${bound}]`);
985
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
986
+ for (let i = 0; i < markers.length; i++) {
987
+ // @breaking-change 8.0.0
988
+ if (markers[i].hasAttribute(`cdk-focus-${bound}`)) {
989
+ console.warn(`Found use of deprecated attribute 'cdk-focus-${bound}', ` +
990
+ `use 'cdkFocusRegion${bound}' instead. The deprecated ` +
991
+ `attribute will be removed in 8.0.0.`, markers[i]);
992
+ }
993
+ else if (markers[i].hasAttribute(`cdk-focus-region-${bound}`)) {
994
+ console.warn(`Found use of deprecated attribute 'cdk-focus-region-${bound}', ` +
995
+ `use 'cdkFocusRegion${bound}' instead. The deprecated attribute ` +
996
+ `will be removed in 8.0.0.`, markers[i]);
997
+ }
996
998
  }
997
999
  }
998
1000
  if (bound == 'start') {
@@ -1011,7 +1013,8 @@ class FocusTrap {
1011
1013
  const redirectToElement = this._element.querySelector(`[cdk-focus-initial], ` + `[cdkFocusInitial]`);
1012
1014
  if (redirectToElement) {
1013
1015
  // @breaking-change 8.0.0
1014
- if (redirectToElement.hasAttribute(`cdk-focus-initial`)) {
1016
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
1017
+ redirectToElement.hasAttribute(`cdk-focus-initial`)) {
1015
1018
  console.warn(`Found use of deprecated attribute 'cdk-focus-initial', ` +
1016
1019
  `use 'cdkFocusInitial' instead. The deprecated attribute ` +
1017
1020
  `will be removed in 8.0.0`, redirectToElement);