@skyux/core 6.0.2 → 6.1.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.
Files changed (27) hide show
  1. package/documentation.json +104 -104
  2. package/esm2020/lib/modules/adapter-service/adapter.service.mjs +11 -7
  3. package/esm2020/lib/modules/affix/affix.service.mjs +7 -3
  4. package/esm2020/lib/modules/resize-observer/resize-observer-media-query.service.mjs +29 -22
  5. package/esm2020/lib/modules/resize-observer/resize-observer.service.mjs +17 -11
  6. package/esm2020/lib/modules/scrollable-host/scrollable-host.service.mjs +29 -26
  7. package/esm2020/testing/core-testing.module.mjs +29 -0
  8. package/esm2020/testing/mock-media-query.service.mjs +3 -1
  9. package/esm2020/testing/mock-ui-config.service.mjs +1 -1
  10. package/esm2020/testing/public-api.mjs +2 -1
  11. package/fesm2015/skyux-core-testing.mjs +28 -2
  12. package/fesm2015/skyux-core-testing.mjs.map +1 -1
  13. package/fesm2015/skyux-core.mjs +85 -65
  14. package/fesm2015/skyux-core.mjs.map +1 -1
  15. package/fesm2020/skyux-core-testing.mjs +28 -2
  16. package/fesm2020/skyux-core-testing.mjs.map +1 -1
  17. package/fesm2020/skyux-core.mjs +85 -64
  18. package/fesm2020/skyux-core.mjs.map +1 -1
  19. package/lib/modules/adapter-service/adapter.service.d.ts +1 -1
  20. package/lib/modules/affix/affix.service.d.ts +1 -1
  21. package/lib/modules/resize-observer/resize-observer-media-query.service.d.ts +1 -4
  22. package/lib/modules/resize-observer/resize-observer.service.d.ts +1 -2
  23. package/lib/modules/scrollable-host/scrollable-host.service.d.ts +7 -4
  24. package/package.json +2 -2
  25. package/testing/core-testing.module.d.ts +6 -0
  26. package/testing/mock-ui-config.service.d.ts +2 -1
  27. package/testing/public-api.d.ts +1 -0
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { NgZone, Injectable } from '@angular/core';
2
+ import { NgZone, Injectable, NgModule } from '@angular/core';
3
3
  import { SkyMediaQueryService, SkyMediaBreakpoints, SkyUIConfigService } from '@skyux/core';
4
4
  import { BehaviorSubject, of } from 'rxjs';
5
5
 
@@ -28,6 +28,8 @@ class MockSkyMediaQueryService extends SkyMediaQueryService {
28
28
  this._currentBreakpoints = args;
29
29
  this.currentMockSubject.next(this._currentBreakpoints);
30
30
  }
31
+ /* istanbul ignore next */
32
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
31
33
  destroy() { }
32
34
  }
33
35
  MockSkyMediaQueryService.xs = '(max-width: 767px)';
@@ -95,9 +97,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
95
97
  type: Injectable
96
98
  }] });
97
99
 
100
+ class SkyCoreTestingModule {
101
+ }
102
+ SkyCoreTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyCoreTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
103
+ SkyCoreTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyCoreTestingModule });
104
+ SkyCoreTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyCoreTestingModule, providers: [
105
+ { provide: SkyMediaQueryService, useClass: MockSkyMediaQueryService },
106
+ {
107
+ provide: SkyUIConfigService,
108
+ useClass: MockSkyUIConfigService,
109
+ },
110
+ ] });
111
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyCoreTestingModule, decorators: [{
112
+ type: NgModule,
113
+ args: [{
114
+ providers: [
115
+ { provide: SkyMediaQueryService, useClass: MockSkyMediaQueryService },
116
+ {
117
+ provide: SkyUIConfigService,
118
+ useClass: MockSkyUIConfigService,
119
+ },
120
+ ],
121
+ }]
122
+ }] });
123
+
98
124
  /**
99
125
  * Generated bundle index. Do not edit.
100
126
  */
101
127
 
102
- export { MockSkyMediaQueryService, MockSkyUIConfigService };
128
+ export { MockSkyMediaQueryService, MockSkyUIConfigService, SkyCoreTestingModule };
103
129
  //# sourceMappingURL=skyux-core-testing.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"skyux-core-testing.mjs","sources":["../../../../../libs/components/core/testing/src/mock-media-query.service.ts","../../../../../libs/components/core/testing/src/mock-ui-config.service.ts","../../../../../libs/components/core/testing/src/skyux-core-testing.ts"],"sourcesContent":["import { Injectable, NgZone } from '@angular/core';\nimport {\n SkyMediaBreakpoints,\n SkyMediaQueryListener,\n SkyMediaQueryService,\n} from '@skyux/core';\n\nimport { BehaviorSubject, Subscription } from 'rxjs';\n\n@Injectable()\nexport class MockSkyMediaQueryService extends SkyMediaQueryService {\n public static xs = '(max-width: 767px)';\n public static sm = '(min-width: 768px) and (max-width: 991px)';\n public static md = '(min-width: 992px) and (max-width: 1199px)';\n public static lg = '(min-width: 1200px)';\n\n public get current(): SkyMediaBreakpoints {\n return this._currentBreakpoints;\n }\n\n public set current(breakpoints: SkyMediaBreakpoints) {\n this._currentBreakpoints = breakpoints;\n }\n\n public currentMockSubject = new BehaviorSubject<SkyMediaBreakpoints>(\n this.current\n );\n\n private _currentBreakpoints = SkyMediaBreakpoints.md;\n\n constructor() {\n super(\n new NgZone({\n enableLongStackTrace: true,\n })\n );\n }\n\n public subscribe(listener: SkyMediaQueryListener): Subscription {\n return this.currentMockSubject.subscribe({\n next: (breakpoints: SkyMediaBreakpoints) => {\n listener(breakpoints);\n },\n });\n }\n\n public fire(args: SkyMediaBreakpoints): void {\n this._currentBreakpoints = args;\n this.currentMockSubject.next(this._currentBreakpoints);\n }\n\n public destroy(): void {}\n}\n","import { Injectable } from '@angular/core';\nimport { SkyUIConfigService } from '@skyux/core';\n\nimport { of as observableOf } from 'rxjs';\n\n@Injectable()\nexport class MockSkyUIConfigService extends SkyUIConfigService {\n public getConfig(key: string, defaultConfig?: any): any {\n switch (key) {\n case 'defaultSettings':\n return observableOf(defaultConfig);\n case 'badData':\n return observableOf({ invalidProperty: 'invalidData' });\n default: {\n return observableOf({\n settings: {\n userSettings: {\n singleColumn: {\n tiles: [\n {\n id: 'tile-1',\n isCollapsed: true,\n },\n {\n id: 'tile-2',\n isCollapsed: true,\n },\n ],\n },\n multiColumn: [\n {\n tiles: [\n {\n id: 'tile-2',\n isCollapsed: true,\n },\n ],\n },\n {\n tiles: [\n {\n id: 'tile-1',\n isCollapsed: true,\n },\n ],\n },\n ],\n },\n defaultSettings: ['tile-1', 'tile-2'],\n },\n });\n }\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["observableOf"],"mappings":";;;;;AAUM,MAAO,wBAAyB,SAAQ,oBAAoB,CAAA;AAoBhE,IAAA,WAAA,GAAA;QACE,KAAK,CACH,IAAI,MAAM,CAAC;AACT,YAAA,oBAAoB,EAAE,IAAI;AAC3B,SAAA,CAAC,CACH,CAAC;QAXG,IAAkB,CAAA,kBAAA,GAAG,IAAI,eAAe,CAC7C,IAAI,CAAC,OAAO,CACb,CAAC;AAEM,QAAA,IAAA,CAAA,mBAAmB,GAAG,mBAAmB,CAAC,EAAE,CAAC;KAQpD;AApBD,IAAA,IAAW,OAAO,GAAA;QAChB,OAAO,IAAI,CAAC,mBAAmB,CAAC;KACjC;IAED,IAAW,OAAO,CAAC,WAAgC,EAAA;AACjD,QAAA,IAAI,CAAC,mBAAmB,GAAG,WAAW,CAAC;KACxC;AAgBM,IAAA,SAAS,CAAC,QAA+B,EAAA;AAC9C,QAAA,OAAO,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC;AACvC,YAAA,IAAI,EAAE,CAAC,WAAgC,KAAI;gBACzC,QAAQ,CAAC,WAAW,CAAC,CAAC;aACvB;AACF,SAAA,CAAC,CAAC;KACJ;AAEM,IAAA,IAAI,CAAC,IAAyB,EAAA;AACnC,QAAA,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC;QAChC,IAAI,CAAC,k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E,IAAI;AAClB,yCAAA;AACF,qCAAA;AACF,iCAAA;AACD,gCAAA;AACE,oCAAA,KAAK,EAAE;AACL,wCAAA;AACE,4CAAA,EAAE,EAAE,QAAQ;AACZ,4CAAA,WAAW,EAAE,IAAI;AAClB,yCAAA;AACF,qCAAA;AACF,iCAAA;AACF,6BAAA;AACF,yBAAA;AACD,wBAAA,eAAe,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;AACtC,qBAAA;AACF,iBAAA,CAAC,CAAC;AACJ,aAAA;AACF,SAAA;KACF;;mHA/CU,sBAAsB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;uHAAtB,sBAAsB,EAAA,CAAA,CAAA;2FAAtB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBADlC,UAAU;;;ACLX;;AAEG;;;;"}
1
+ {"version":3,"file":"skyux-core-testing.mjs","sources":["../../../../../libs/components/core/testing/src/mock-media-query.service.ts","../../../../../libs/components/core/testing/src/mock-ui-config.service.ts","../../../../../libs/components/core/testing/src/core-testing.module.ts","../../../../../libs/components/core/testing/src/skyux-core-testing.ts"],"sourcesContent":["import { Injectable, NgZone } from '@angular/core';\nimport {\n SkyMediaBreakpoints,\n SkyMediaQueryListener,\n SkyMediaQueryService,\n} from '@skyux/core';\n\nimport { BehaviorSubject, Subscription } from 'rxjs';\n\n@Injectable()\nexport class MockSkyMediaQueryService extends SkyMediaQueryService {\n public static xs = '(max-width: 767px)';\n public static sm = '(min-width: 768px) and (max-width: 991px)';\n public static md = '(min-width: 992px) and (max-width: 1199px)';\n public static lg = '(min-width: 1200px)';\n\n public get current(): SkyMediaBreakpoints {\n return this._currentBreakpoints;\n }\n\n public set current(breakpoints: SkyMediaBreakpoints) {\n this._currentBreakpoints = breakpoints;\n }\n\n public currentMockSubject = new BehaviorSubject<SkyMediaBreakpoints>(\n this.current\n );\n\n private _currentBreakpoints = SkyMediaBreakpoints.md;\n\n constructor() {\n super(\n new NgZone({\n enableLongStackTrace: true,\n })\n );\n }\n\n public subscribe(listener: SkyMediaQueryListener): Subscription {\n return this.currentMockSubject.subscribe({\n next: (breakpoints: SkyMediaBreakpoints) => {\n listener(breakpoints);\n },\n });\n }\n\n public fire(args: SkyMediaBreakpoints): void {\n this._currentBreakpoints = args;\n this.currentMockSubject.next(this._currentBreakpoints);\n }\n\n /* istanbul ignore next */\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n public destroy(): void {}\n}\n","import { Injectable } from '@angular/core';\nimport { SkyUIConfigService } from '@skyux/core';\n\nimport { Observable, of as observableOf } from 'rxjs';\n\n@Injectable()\nexport class MockSkyUIConfigService extends SkyUIConfigService {\n public getConfig(key: string, defaultConfig?: any): Observable<any> {\n switch (key) {\n case 'defaultSettings':\n return observableOf(defaultConfig);\n case 'badData':\n return observableOf({ invalidProperty: 'invalidData' });\n default: {\n return observableOf({\n settings: {\n userSettings: {\n singleColumn: {\n tiles: [\n {\n id: 'tile-1',\n isCollapsed: true,\n },\n {\n id: 'tile-2',\n isCollapsed: true,\n },\n ],\n },\n multiColumn: [\n {\n tiles: [\n {\n id: 'tile-2',\n isCollapsed: true,\n },\n ],\n },\n {\n tiles: [\n {\n id: 'tile-1',\n isCollapsed: true,\n },\n ],\n },\n ],\n },\n defaultSettings: ['tile-1', 'tile-2'],\n },\n });\n }\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { SkyMediaQueryService, SkyUIConfigService } from '@skyux/core';\n\nimport { MockSkyMediaQueryService } from './mock-media-query.service';\nimport { MockSkyUIConfigService } from './mock-ui-config.service';\n\n@NgModule({\n providers: [\n { provide: SkyMediaQueryService, useClass: MockSkyMediaQueryService },\n {\n provide: SkyUIConfigService,\n useClass: MockSkyUIConfigService,\n },\n ],\n})\nexport class SkyCoreTestingModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["observableOf"],"mappings":";;;;;AAUM,MAAO,wBAA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AAA;uHAAtB,sBAAsB,EAAA,CAAA,CAAA;2FAAtB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBADlC,UAAU;;;MCUE,oBAAoB,CAAA;;iHAApB,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;kHAApB,oBAAoB,EAAA,CAAA,CAAA;AAApB,oBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,EARpB,SAAA,EAAA;AACT,QAAA,EAAE,OAAO,EAAE,oBAAoB,EAAE,QAAQ,EAAE,wBAAwB,EAAE;AACrE,QAAA;AACE,YAAA,OAAO,EAAE,kBAAkB;AAC3B,YAAA,QAAQ,EAAE,sBAAsB;AACjC,SAAA;AACF,KAAA,EAAA,CAAA,CAAA;2FAEU,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAThC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,SAAS,EAAE;AACT,wBAAA,EAAE,OAAO,EAAE,oBAAoB,EAAE,QAAQ,EAAE,wBAAwB,EAAE;AACrE,wBAAA;AACE,4BAAA,OAAO,EAAE,kBAAkB;AAC3B,4BAAA,QAAQ,EAAE,sBAAsB;AACjC,yBAAA;AACF,qBAAA;AACF,iBAAA,CAAA;;;ACdD;;AAEG;;;;"}
@@ -1,5 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { NgModule, Injectable, EventEmitter, Directive, Input, Output, Injector, ViewContainerRef, Component, ChangeDetectionStrategy, ViewChild, InjectionToken, Optional, Inject, Pipe, ElementRef } from '@angular/core';
3
+ import { __classPrivateFieldSet, __classPrivateFieldGet } from 'tslib';
3
4
  import * as i4 from '@angular/common';
4
5
  import { CommonModule } from '@angular/common';
5
6
  import { Subject, fromEvent, BehaviorSubject, ReplaySubject, Observable, of } from 'rxjs';
@@ -44,6 +45,7 @@ var SkyMediaBreakpoints;
44
45
  SkyMediaBreakpoints[SkyMediaBreakpoints["lg"] = 4] = "lg";
45
46
  })(SkyMediaBreakpoints || (SkyMediaBreakpoints = {}));
46
47
 
48
+ var _SkyCoreAdapterService_renderer;
47
49
  const SKY_TABBABLE_SELECTOR = [
48
50
  'a[href]',
49
51
  'area[href]',
@@ -60,7 +62,8 @@ const SKY_TABBABLE_SELECTOR = [
60
62
  class SkyCoreAdapterService {
61
63
  constructor(rendererFactory) {
62
64
  this.rendererFactory = rendererFactory;
63
- this.renderer = this.rendererFactory.createRenderer(undefined, undefined);
65
+ _SkyCoreAdapterService_renderer.set(this, void 0);
66
+ __classPrivateFieldSet(this, _SkyCoreAdapterService_renderer, this.rendererFactory.createRenderer(undefined, null), "f");
64
67
  }
65
68
  /**
66
69
  * Set the responsive container CSS class for a given element.
@@ -71,10 +74,10 @@ class SkyCoreAdapterService {
71
74
  */
72
75
  setResponsiveContainerClass(elementRef, breakpoint) {
73
76
  const nativeEl = elementRef.nativeElement;
74
- this.renderer.removeClass(nativeEl, 'sky-responsive-container-xs');
75
- this.renderer.removeClass(nativeEl, 'sky-responsive-container-sm');
76
- this.renderer.removeClass(nativeEl, 'sky-responsive-container-md');
77
- this.renderer.removeClass(nativeEl, 'sky-responsive-container-lg');
77
+ __classPrivateFieldGet(this, _SkyCoreAdapterService_renderer, "f").removeClass(nativeEl, 'sky-responsive-container-xs');
78
+ __classPrivateFieldGet(this, _SkyCoreAdapterService_renderer, "f").removeClass(nativeEl, 'sky-responsive-container-sm');
79
+ __classPrivateFieldGet(this, _SkyCoreAdapterService_renderer, "f").removeClass(nativeEl, 'sky-responsive-container-md');
80
+ __classPrivateFieldGet(this, _SkyCoreAdapterService_renderer, "f").removeClass(nativeEl, 'sky-responsive-container-lg');
78
81
  let newClass;
79
82
  switch (breakpoint) {
80
83
  case SkyMediaBreakpoints.xs: {
@@ -94,7 +97,7 @@ class SkyCoreAdapterService {
94
97
  break;
95
98
  }
96
99
  }
97
- this.renderer.addClass(nativeEl, newClass);
100
+ __classPrivateFieldGet(this, _SkyCoreAdapterService_renderer, "f").addClass(nativeEl, newClass);
98
101
  }
99
102
  /**
100
103
  * This method temporarily enables/disables pointer events.
@@ -257,6 +260,7 @@ class SkyCoreAdapterService {
257
260
  return hasBounds;
258
261
  }
259
262
  }
263
+ _SkyCoreAdapterService_renderer = new WeakMap();
260
264
  SkyCoreAdapterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyCoreAdapterService, deps: [{ token: i0.RendererFactory2 }], target: i0.ɵɵFactoryTarget.Injectable });
261
265
  SkyCoreAdapterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyCoreAdapterService, providedIn: 'root' });
262
266
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyCoreAdapterService, decorators: [{
@@ -715,18 +719,21 @@ class SkyAffixer {
715
719
  }
716
720
  }
717
721
 
722
+ var _SkyAffixService_renderer;
718
723
  class SkyAffixService {
719
724
  constructor(rendererFactory) {
720
- this.renderer = rendererFactory.createRenderer(undefined, undefined);
725
+ _SkyAffixService_renderer.set(this, void 0);
726
+ __classPrivateFieldSet(this, _SkyAffixService_renderer, rendererFactory.createRenderer(undefined, null), "f");
721
727
  }
722
728
  /**
723
729
  * Creates an instance of [[SkyAffixer]].
724
730
  * @param affixed The element to be affixed.
725
731
  */
726
732
  createAffixer(affixed) {
727
- return new SkyAffixer(affixed.nativeElement, this.renderer);
733
+ return new SkyAffixer(affixed.nativeElement, __classPrivateFieldGet(this, _SkyAffixService_renderer, "f"));
728
734
  }
729
735
  }
736
+ _SkyAffixService_renderer = new WeakMap();
730
737
  SkyAffixService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAffixService, deps: [{ token: i0.RendererFactory2 }], target: i0.ɵɵFactoryTarget.Injectable });
731
738
  SkyAffixService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAffixService, providedIn: 'root' });
732
739
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAffixService, decorators: [{
@@ -2477,19 +2484,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
2477
2484
  }]
2478
2485
  }] });
2479
2486
 
2487
+ var _SkyResizeObserverService_resizeObserver, _SkyResizeObserverService_tracking;
2480
2488
  /**
2481
2489
  * Service to create rxjs observables for changes to the content box dimensions of elements.
2482
2490
  */
2483
2491
  class SkyResizeObserverService {
2484
2492
  constructor(zone) {
2485
2493
  this.zone = zone;
2486
- this._tracking = [];
2487
- this._resizeObserver = new ResizeObserver((entries) => {
2494
+ _SkyResizeObserverService_resizeObserver.set(this, void 0);
2495
+ _SkyResizeObserverService_tracking.set(this, []);
2496
+ __classPrivateFieldSet(this, _SkyResizeObserverService_resizeObserver, new ResizeObserver((entries) => {
2488
2497
  entries.forEach((entry) => this.callback(entry));
2489
- });
2498
+ }), "f");
2490
2499
  }
2491
2500
  ngOnDestroy() {
2492
- this._resizeObserver.disconnect();
2501
+ __classPrivateFieldGet(this, _SkyResizeObserverService_resizeObserver, "f").disconnect();
2493
2502
  }
2494
2503
  /**
2495
2504
  * Create rxjs observable to get size changes for an element ref.
@@ -2498,22 +2507,22 @@ class SkyResizeObserverService {
2498
2507
  return this.observeAndTrack(element).subjectObservable;
2499
2508
  }
2500
2509
  observeAndTrack(element) {
2501
- const checkTracking = this._tracking.findIndex((value) => {
2510
+ const checkTracking = __classPrivateFieldGet(this, _SkyResizeObserverService_tracking, "f").findIndex((value) => {
2502
2511
  return !value.subject.closed && value.element === element.nativeElement;
2503
2512
  });
2504
2513
  if (checkTracking === -1) {
2505
- this._resizeObserver.observe(element.nativeElement);
2514
+ __classPrivateFieldGet(this, _SkyResizeObserverService_resizeObserver, "f").observe(element.nativeElement);
2506
2515
  }
2507
2516
  const subject = new Subject();
2508
2517
  const subjectObservable = subject.pipe(finalize(() => {
2509
2518
  // Are there any other tracking entries still watching this element?
2510
- const checkTracking = this._tracking.findIndex((value) => {
2519
+ const checkTracking = __classPrivateFieldGet(this, _SkyResizeObserverService_tracking, "f").findIndex((value) => {
2511
2520
  return (value.subject !== subject &&
2512
2521
  !value.subject.closed &&
2513
2522
  value.element === element.nativeElement);
2514
2523
  });
2515
2524
  if (checkTracking === -1) {
2516
- this._resizeObserver.unobserve(element.nativeElement);
2525
+ __classPrivateFieldGet(this, _SkyResizeObserverService_resizeObserver, "f").unobserve(element.nativeElement);
2517
2526
  }
2518
2527
  }));
2519
2528
  const tracking = {
@@ -2521,15 +2530,17 @@ class SkyResizeObserverService {
2521
2530
  subject,
2522
2531
  subjectObservable,
2523
2532
  };
2524
- this._tracking.push(tracking);
2533
+ __classPrivateFieldGet(this, _SkyResizeObserverService_tracking, "f").push(tracking);
2525
2534
  return tracking;
2526
2535
  }
2527
2536
  callback(entry) {
2528
- this._tracking
2537
+ __classPrivateFieldGet(this, _SkyResizeObserverService_tracking, "f")
2529
2538
  .filter((value) => !(value.subject.closed || value.subject.isStopped))
2530
2539
  .forEach((value) => {
2531
2540
  /* istanbul ignore else */
2532
2541
  if (value.element === entry.target) {
2542
+ // Execute the callback within NgZone because Angular does not "monkey patch"
2543
+ // ResizeObserver like it does for other features in the DOM.
2533
2544
  this.zone.run(() => {
2534
2545
  value.subject.next(entry);
2535
2546
  });
@@ -2537,6 +2548,7 @@ class SkyResizeObserverService {
2537
2548
  });
2538
2549
  }
2539
2550
  }
2551
+ _SkyResizeObserverService_resizeObserver = new WeakMap(), _SkyResizeObserverService_tracking = new WeakMap();
2540
2552
  SkyResizeObserverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyResizeObserverService, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
2541
2553
  SkyResizeObserverService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyResizeObserverService, providedIn: 'any' });
2542
2554
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyResizeObserverService, decorators: [{
@@ -2546,13 +2558,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
2546
2558
  }]
2547
2559
  }], ctorParameters: function () { return [{ type: i0.NgZone }]; } });
2548
2560
 
2561
+ var _SkyResizeObserverMediaQueryService_breakpoints, _SkyResizeObserverMediaQueryService_currentBreakpointObservable, _SkyResizeObserverMediaQueryService_stopListening, _SkyResizeObserverMediaQueryService_target;
2549
2562
  /**
2550
2563
  * Acts like `SkyMediaQueryService` for a container element, emitting the same responsive breakpoints.
2551
2564
  */
2552
2565
  class SkyResizeObserverMediaQueryService {
2553
2566
  constructor(resizeObserverService) {
2554
2567
  this.resizeObserverService = resizeObserverService;
2555
- this._breakpoints = [
2568
+ _SkyResizeObserverMediaQueryService_breakpoints.set(this, [
2556
2569
  {
2557
2570
  check: (width) => width > 0 && width <= 767,
2558
2571
  name: SkyMediaBreakpoints.xs,
@@ -2569,11 +2582,12 @@ class SkyResizeObserverMediaQueryService {
2569
2582
  check: (width) => width > 1199,
2570
2583
  name: SkyMediaBreakpoints.lg,
2571
2584
  },
2572
- ];
2573
- this._currentBreakpointObservable = new ReplaySubject(1);
2574
- this._stopListening = new Subject();
2575
- this._stopListening.subscribe(() => {
2576
- this._target = undefined;
2585
+ ]);
2586
+ _SkyResizeObserverMediaQueryService_currentBreakpointObservable.set(this, new ReplaySubject(1));
2587
+ _SkyResizeObserverMediaQueryService_stopListening.set(this, new Subject());
2588
+ _SkyResizeObserverMediaQueryService_target.set(this, void 0);
2589
+ __classPrivateFieldGet(this, _SkyResizeObserverMediaQueryService_stopListening, "f").subscribe(() => {
2590
+ __classPrivateFieldSet(this, _SkyResizeObserverMediaQueryService_target, undefined, "f");
2577
2591
  this.updateBreakpoint(undefined);
2578
2592
  });
2579
2593
  }
@@ -2584,10 +2598,10 @@ class SkyResizeObserverMediaQueryService {
2584
2598
  return this._currentBreakpoint;
2585
2599
  }
2586
2600
  ngOnDestroy() {
2587
- this._stopListening.next();
2601
+ __classPrivateFieldGet(this, _SkyResizeObserverMediaQueryService_stopListening, "f").next();
2588
2602
  this._currentBreakpoint = undefined;
2589
- this._stopListening.complete();
2590
- this._currentBreakpointObservable.complete();
2603
+ __classPrivateFieldGet(this, _SkyResizeObserverMediaQueryService_stopListening, "f").complete();
2604
+ __classPrivateFieldGet(this, _SkyResizeObserverMediaQueryService_currentBreakpointObservable, "f").complete();
2591
2605
  }
2592
2606
  /**
2593
2607
  * @internal
@@ -2600,21 +2614,21 @@ class SkyResizeObserverMediaQueryService {
2600
2614
  * time. Any previous subscriptions will be unsubscribed when a new element is observed.
2601
2615
  */
2602
2616
  observe(element) {
2603
- if (this._target) {
2604
- if (this._target === element) {
2617
+ if (__classPrivateFieldGet(this, _SkyResizeObserverMediaQueryService_target, "f")) {
2618
+ if (__classPrivateFieldGet(this, _SkyResizeObserverMediaQueryService_target, "f") === element) {
2605
2619
  return this;
2606
2620
  }
2607
- this._stopListening.next();
2621
+ __classPrivateFieldGet(this, _SkyResizeObserverMediaQueryService_stopListening, "f").next();
2608
2622
  }
2609
- this._target = element;
2623
+ __classPrivateFieldSet(this, _SkyResizeObserverMediaQueryService_target, element, "f");
2610
2624
  this.checkWidth(element);
2611
2625
  this.resizeObserverService
2612
2626
  .observe(element)
2613
- .pipe(takeUntil(this._stopListening))
2627
+ .pipe(takeUntil(__classPrivateFieldGet(this, _SkyResizeObserverMediaQueryService_stopListening, "f")))
2614
2628
  .subscribe((value) => {
2615
2629
  const breakpoint = this.checkBreakpoint(value.contentRect.width);
2616
2630
  /* istanbul ignore else */
2617
- if (breakpoint !== this._currentBreakpoint) {
2631
+ if (breakpoint !== this.current) {
2618
2632
  this.updateBreakpoint(breakpoint);
2619
2633
  }
2620
2634
  });
@@ -2624,25 +2638,28 @@ class SkyResizeObserverMediaQueryService {
2624
2638
  * Stop watching the container element.
2625
2639
  */
2626
2640
  unobserve() {
2627
- this._stopListening.next();
2641
+ __classPrivateFieldGet(this, _SkyResizeObserverMediaQueryService_stopListening, "f").next();
2628
2642
  }
2629
2643
  /**
2630
2644
  * Subscribes to element size changes that cross breakpoints.
2631
2645
  */
2632
2646
  subscribe(listener) {
2633
- return this._currentBreakpointObservable
2634
- .pipe(takeUntil(this._stopListening))
2647
+ return __classPrivateFieldGet(this, _SkyResizeObserverMediaQueryService_currentBreakpointObservable, "f")
2648
+ .pipe(takeUntil(__classPrivateFieldGet(this, _SkyResizeObserverMediaQueryService_stopListening, "f")))
2635
2649
  .subscribe((value) => {
2636
2650
  listener(value);
2637
2651
  });
2638
2652
  }
2639
2653
  updateBreakpoint(breakpoint) {
2640
2654
  this._currentBreakpoint = breakpoint;
2641
- this._currentBreakpointObservable.next(breakpoint);
2655
+ __classPrivateFieldGet(this, _SkyResizeObserverMediaQueryService_currentBreakpointObservable, "f").next(breakpoint);
2642
2656
  }
2643
2657
  checkBreakpoint(width) {
2644
- return this._breakpoints.find((breakpoint) => breakpoint.check(width))
2645
- ?.name;
2658
+ const breakpoint = __classPrivateFieldGet(this, _SkyResizeObserverMediaQueryService_breakpoints, "f").find((breakpoint) => breakpoint.check(width));
2659
+ /* istanbul ignore else */
2660
+ if (breakpoint) {
2661
+ return breakpoint.name;
2662
+ }
2646
2663
  }
2647
2664
  checkWidth(element) {
2648
2665
  const width = element.nativeElement.offsetWidth || 0;
@@ -2653,6 +2670,7 @@ class SkyResizeObserverMediaQueryService {
2653
2670
  }
2654
2671
  }
2655
2672
  }
2673
+ _SkyResizeObserverMediaQueryService_breakpoints = new WeakMap(), _SkyResizeObserverMediaQueryService_currentBreakpointObservable = new WeakMap(), _SkyResizeObserverMediaQueryService_stopListening = new WeakMap(), _SkyResizeObserverMediaQueryService_target = new WeakMap();
2656
2674
  SkyResizeObserverMediaQueryService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyResizeObserverMediaQueryService, deps: [{ token: SkyResizeObserverService }], target: i0.ɵɵFactoryTarget.Injectable });
2657
2675
  SkyResizeObserverMediaQueryService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyResizeObserverMediaQueryService, providedIn: 'any' });
2658
2676
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyResizeObserverMediaQueryService, decorators: [{
@@ -2683,8 +2701,7 @@ class SkyScrollableHostService {
2683
2701
  /**
2684
2702
  * Returns an observable which emits the given element's current scrollable host
2685
2703
  * @param elementRef The element whose scrollable host is being requested
2686
- * @param completionObservable An observable which alerts the internal observers that they should complete
2687
- * @returns An observable which emits the current scrollable host
2704
+ * @returns An observable which emits the current scrollable host element.
2688
2705
  * @internal
2689
2706
  */
2690
2707
  watchScrollableHost(elementRef) {
@@ -2694,11 +2711,13 @@ class SkyScrollableHostService {
2694
2711
  return new Observable((subscriber) => {
2695
2712
  subscribers.push(subscriber);
2696
2713
  let scrollableHost = this.findScrollableHost(elementRef.nativeElement);
2714
+ // Setup mutation observers only once, for all subscribers.
2697
2715
  if (subscribers.length === 1) {
2698
2716
  parentMutationObserver = this.mutationObserverSvc.create(() => {
2699
2717
  const newScrollableHost = this.findScrollableHost(elementRef.nativeElement);
2718
+ // Reset observer if scrollable host changes.
2700
2719
  if (newScrollableHost !== scrollableHost &&
2701
- elementRef.nativeElement.offsetParent) {
2720
+ this.isElementVisible(elementRef)) {
2702
2721
  scrollableHost = newScrollableHost;
2703
2722
  this.observeForScrollableHostChanges(scrollableHost, parentMutationObserver);
2704
2723
  notifySubscribers(subscribers, scrollableHost);
@@ -2706,7 +2725,9 @@ class SkyScrollableHostService {
2706
2725
  });
2707
2726
  this.observeForScrollableHostChanges(scrollableHost, parentMutationObserver);
2708
2727
  documentHiddenElementMutationObserver = this.mutationObserverSvc.create(() => {
2709
- if (scrollableHost && !elementRef.nativeElement.offsetParent) {
2728
+ if (scrollableHost && !this.isElementVisible(elementRef)) {
2729
+ // If the scrollable host is not visible, set it to undefined and unsubscribe from its mutation changes.
2730
+ // Then, observe the document element so that a new scrollable host can be found.
2710
2731
  scrollableHost = undefined;
2711
2732
  this.observeForScrollableHostChanges(scrollableHost, parentMutationObserver);
2712
2733
  notifySubscribers(subscribers, scrollableHost);
@@ -2714,10 +2735,11 @@ class SkyScrollableHostService {
2714
2735
  });
2715
2736
  this.observeDocumentHiddenElementChanges(documentHiddenElementMutationObserver);
2716
2737
  }
2738
+ // Emit the scrollable host to the subscriber.
2717
2739
  subscriber.next(scrollableHost);
2740
+ // Teardown callback for the subscription.
2718
2741
  subscriber.add(() => {
2719
2742
  const subIndex = subscribers.indexOf(subscriber);
2720
- /* sanity check */
2721
2743
  /* istanbul ignore else */
2722
2744
  if (subIndex >= 0) {
2723
2745
  subscribers.splice(subIndex, 1);
@@ -2732,7 +2754,6 @@ class SkyScrollableHostService {
2732
2754
  /**
2733
2755
  * Returns an observable which emits whenever the element's scrollable host emits a scroll event. The observable will always emit the scroll events from the elements current scrollable host and will update based on any scrollable host changes. The observable will also emit once whenever the scrollable host changes.
2734
2756
  * @param elementRef The element whose scrollable host scroll events are being requested
2735
- * @param completionObservable An observable which alerts the internal observers that they should complete
2736
2757
  * @returns An observable which emits when the elements scrollable host is scrolled or is changed
2737
2758
  */
2738
2759
  watchScrollableHostScrollEvents(elementRef) {
@@ -2743,6 +2764,7 @@ class SkyScrollableHostService {
2743
2764
  let scrollEventSubscription;
2744
2765
  return new Observable((subscriber) => {
2745
2766
  subscribers.push(subscriber);
2767
+ // Setup mutation observers only once, for all subscribers.
2746
2768
  if (subscribers.length === 1) {
2747
2769
  scrollableHostSubscription = this.watchScrollableHost(elementRef).subscribe((newScrollableHost) => {
2748
2770
  newScrollableHostObservable.next();
@@ -2752,6 +2774,8 @@ class SkyScrollableHostService {
2752
2774
  }
2753
2775
  scrollableHost = newScrollableHost;
2754
2776
  newScrollableHostObservable = new Subject();
2777
+ // Only subscribe to scroll events if the host element is defined.
2778
+ /* istanbul ignore else */
2755
2779
  if (newScrollableHost) {
2756
2780
  scrollEventSubscription = fromEvent(newScrollableHost, 'scroll')
2757
2781
  .pipe(takeUntil(newScrollableHostObservable))
@@ -2761,9 +2785,9 @@ class SkyScrollableHostService {
2761
2785
  }
2762
2786
  });
2763
2787
  }
2788
+ // Teardown callback for the subscription.
2764
2789
  subscriber.add(() => {
2765
2790
  const subIndex = subscribers.indexOf(subscriber);
2766
- /* sanity check */
2767
2791
  /* istanbul ignore else */
2768
2792
  if (subIndex >= 0) {
2769
2793
  subscribers.splice(subIndex, 1);
@@ -2780,7 +2804,6 @@ class SkyScrollableHostService {
2780
2804
  const regex = /(auto|scroll)/;
2781
2805
  const windowObj = this.windowRef.nativeWindow;
2782
2806
  const bodyObj = windowObj.document.body;
2783
- /* Sanity check */
2784
2807
  if (!element) {
2785
2808
  return windowObj;
2786
2809
  }
@@ -2788,7 +2811,7 @@ class SkyScrollableHostService {
2788
2811
  let parent = element;
2789
2812
  do {
2790
2813
  parent = parent.parentNode;
2791
- /* Sanity check for if this function is called for an element which has been removed from the DOM */
2814
+ // Return `window` if the parent element has been removed from the DOM.
2792
2815
  if (!(parent instanceof HTMLElement)) {
2793
2816
  return windowObj;
2794
2817
  }
@@ -2811,22 +2834,20 @@ class SkyScrollableHostService {
2811
2834
  }
2812
2835
  observeForScrollableHostChanges(element, mutationObserver) {
2813
2836
  mutationObserver.disconnect();
2814
- if (element instanceof HTMLElement) {
2815
- mutationObserver.observe(element, {
2816
- attributes: true,
2817
- attributeFilter: ['class', 'style'],
2818
- childList: true,
2819
- subtree: true,
2820
- });
2821
- }
2822
- else {
2823
- mutationObserver.observe(document.documentElement, {
2824
- attributes: true,
2825
- attributeFilter: ['class', 'style'],
2826
- childList: true,
2827
- subtree: true,
2828
- });
2829
- }
2837
+ const target = element instanceof HTMLElement ? element : document.documentElement;
2838
+ mutationObserver.observe(target, {
2839
+ attributes: true,
2840
+ attributeFilter: ['class', 'style'],
2841
+ childList: true,
2842
+ subtree: true,
2843
+ });
2844
+ }
2845
+ /**
2846
+ * Determines if an element is "visible" in the DOM.
2847
+ * @see https://stackoverflow.com/a/11639664/6178885
2848
+ */
2849
+ isElementVisible(elementRef) {
2850
+ return elementRef.nativeElement.offsetParent;
2830
2851
  }
2831
2852
  }
2832
2853
  SkyScrollableHostService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyScrollableHostService, deps: [{ token: MutationObserverService }, { token: SkyAppWindowRef }], target: i0.ɵɵFactoryTarget.Injectable });