@angular/cdk 13.3.1 → 13.3.4

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 (39) hide show
  1. package/a11y/_index.scss +11 -0
  2. package/a11y/live-announcer/live-announcer.d.ts +2 -0
  3. package/a11y-prebuilt.css +1 -1
  4. package/esm2020/a11y/live-announcer/live-announcer.mjs +16 -11
  5. package/esm2020/accordion/accordion.mjs +1 -1
  6. package/esm2020/portal/dom-portal-outlet.mjs +26 -4
  7. package/esm2020/scrolling/virtual-for-of.mjs +4 -2
  8. package/esm2020/table/table.mjs +1 -1
  9. package/esm2020/testing/testbed/fake-events/type-in-element.mjs +2 -2
  10. package/esm2020/version.mjs +1 -1
  11. package/fesm2015/a11y.mjs +16 -11
  12. package/fesm2015/a11y.mjs.map +1 -1
  13. package/fesm2015/accordion.mjs.map +1 -1
  14. package/fesm2015/cdk.mjs +1 -1
  15. package/fesm2015/cdk.mjs.map +1 -1
  16. package/fesm2015/portal.mjs +25 -4
  17. package/fesm2015/portal.mjs.map +1 -1
  18. package/fesm2015/scrolling.mjs +3 -1
  19. package/fesm2015/scrolling.mjs.map +1 -1
  20. package/fesm2015/table.mjs.map +1 -1
  21. package/fesm2015/testing/testbed.mjs +1 -1
  22. package/fesm2015/testing/testbed.mjs.map +1 -1
  23. package/fesm2020/a11y.mjs +15 -10
  24. package/fesm2020/a11y.mjs.map +1 -1
  25. package/fesm2020/accordion.mjs.map +1 -1
  26. package/fesm2020/cdk.mjs +1 -1
  27. package/fesm2020/cdk.mjs.map +1 -1
  28. package/fesm2020/portal.mjs +25 -4
  29. package/fesm2020/portal.mjs.map +1 -1
  30. package/fesm2020/scrolling.mjs +3 -1
  31. package/fesm2020/scrolling.mjs.map +1 -1
  32. package/fesm2020/table.mjs.map +1 -1
  33. package/fesm2020/testing/testbed.mjs +1 -1
  34. package/fesm2020/testing/testbed.mjs.map +1 -1
  35. package/package.json +1 -1
  36. package/portal/dom-portal-outlet.d.ts +15 -4
  37. package/schematics/ng-add/index.js +1 -1
  38. package/schematics/ng-add/index.mjs +1 -1
  39. package/table/table.d.ts +2 -6
package/fesm2015/a11y.mjs CHANGED
@@ -1744,16 +1744,19 @@ class LiveAnnouncer {
1744
1744
  // second time without clearing and then using a non-zero delay.
1745
1745
  // (using JAWS 17 at time of this writing).
1746
1746
  return this._ngZone.runOutsideAngular(() => {
1747
- return new Promise(resolve => {
1748
- clearTimeout(this._previousTimeout);
1749
- this._previousTimeout = setTimeout(() => {
1750
- this._liveElement.textContent = message;
1751
- resolve();
1752
- if (typeof duration === 'number') {
1753
- this._previousTimeout = setTimeout(() => this.clear(), duration);
1754
- }
1755
- }, 100);
1756
- });
1747
+ if (!this._currentPromise) {
1748
+ this._currentPromise = new Promise(resolve => (this._currentResolve = resolve));
1749
+ }
1750
+ clearTimeout(this._previousTimeout);
1751
+ this._previousTimeout = setTimeout(() => {
1752
+ this._liveElement.textContent = message;
1753
+ if (typeof duration === 'number') {
1754
+ this._previousTimeout = setTimeout(() => this.clear(), duration);
1755
+ }
1756
+ this._currentResolve();
1757
+ this._currentPromise = this._currentResolve = undefined;
1758
+ }, 100);
1759
+ return this._currentPromise;
1757
1760
  });
1758
1761
  }
1759
1762
  /**
@@ -1767,10 +1770,12 @@ class LiveAnnouncer {
1767
1770
  }
1768
1771
  }
1769
1772
  ngOnDestroy() {
1770
- var _a;
1773
+ var _a, _b;
1771
1774
  clearTimeout(this._previousTimeout);
1772
1775
  (_a = this._liveElement) === null || _a === void 0 ? void 0 : _a.remove();
1773
1776
  this._liveElement = null;
1777
+ (_b = this._currentResolve) === null || _b === void 0 ? void 0 : _b.call(this);
1778
+ this._currentPromise = this._currentResolve = undefined;
1774
1779
  }
1775
1780
  _createLiveElement() {
1776
1781
  const elementClass = 'cdk-live-announcer-element';