@skyux/core 5.7.2 → 5.8.2
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/bundles/skyux-core.umd.js +193 -1
- package/documentation.json +655 -117
- package/esm2015/index.js +2 -0
- package/esm2015/index.js.map +1 -1
- package/esm2015/lib/modules/media-query/media-query-listener.js.map +1 -1
- package/esm2015/lib/modules/media-query/media-query.service.js +1 -1
- package/esm2015/lib/modules/media-query/media-query.service.js.map +1 -1
- package/esm2015/lib/modules/resize-observer/resize-observer-media-query.service.js +117 -0
- package/esm2015/lib/modules/resize-observer/resize-observer-media-query.service.js.map +1 -0
- package/esm2015/lib/modules/resize-observer/resize-observer.service.js +73 -0
- package/esm2015/lib/modules/resize-observer/resize-observer.service.js.map +1 -0
- package/fesm2015/skyux-core.js +183 -4
- package/fesm2015/skyux-core.js.map +1 -1
- package/index.d.ts +2 -0
- package/lib/modules/media-query/media-query-listener.d.ts +1 -1
- package/lib/modules/media-query/media-query.service.d.ts +1 -1
- package/lib/modules/resize-observer/resize-observer-media-query.service.d.ts +45 -0
- package/lib/modules/resize-observer/resize-observer.service.d.ts +21 -0
- package/package.json +3 -3
package/esm2015/index.js
CHANGED
@@ -43,6 +43,8 @@ export * from './lib/modules/overlay/overlay.module';
|
|
43
43
|
export * from './lib/modules/overlay/overlay.service';
|
44
44
|
export * from './lib/modules/percent-pipe/percent-pipe.module';
|
45
45
|
export * from './lib/modules/percent-pipe/percent.pipe';
|
46
|
+
export * from './lib/modules/resize-observer/resize-observer.service';
|
47
|
+
export * from './lib/modules/resize-observer/resize-observer-media-query.service';
|
46
48
|
export * from './lib/modules/scrollable-host/scrollable-host.service';
|
47
49
|
export * from './lib/modules/title/set-title-args';
|
48
50
|
export * from './lib/modules/title/title.service';
|
package/esm2015/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/components/core/src/index.ts"],"names":[],"mappings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AAc,uDAAuD,CAAC;AAEtE,cAAc,oCAAoC,CAAC;AACnD,cAAc,mCAAmC,CAAC;AAElD,cAAc,2CAA2C,CAAC;AAE1D,cAAc,kDAAkD,CAAC;AACjE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,6CAA6C,CAAC;AAE5D,cAAc,iCAAiC,CAAC;AAEhD,0FAA0F;AAC1F,2EAA2E;AAC3E,OAAO,EAAE,iBAAiB,IAAI,EAAE,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,cAAc,IAAI,EAAE,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,sBAAsB,IAAI,EAAE,EAAE,MAAM,+CAA+C,CAAC","sourcesContent":["export * from './lib/modules/adapter-service/adapter.module';\nexport * from './lib/modules/adapter-service/adapter.service';\nexport * from './lib/modules/adapter-service/focusable-children-options';\n\nexport * from './lib/modules/affix/affix-auto-fit-context';\nexport * from './lib/modules/affix/affix-config';\nexport * from './lib/modules/affix/affix-horizontal-alignment';\nexport * from './lib/modules/affix/affix-offset';\nexport * from './lib/modules/affix/affix-offset-change';\nexport * from './lib/modules/affix/affix-placement';\nexport * from './lib/modules/affix/affix-placement-change';\nexport * from './lib/modules/affix/affix-vertical-alignment';\nexport * from './lib/modules/affix/affix.module';\nexport * from './lib/modules/affix/affix.service';\nexport * from './lib/modules/affix/affixer';\n\nexport * from './lib/modules/dock/dock-insert-component-config';\nexport * from './lib/modules/dock/dock-item';\nexport * from './lib/modules/dock/dock-item-config';\nexport * from './lib/modules/dock/dock-location';\nexport * from './lib/modules/dock/dock-options';\nexport * from './lib/modules/dock/dock.module';\nexport * from './lib/modules/dock/dock.service';\n\nexport * from './lib/modules/dynamic-component/dynamic-component-location';\nexport * from './lib/modules/dynamic-component/dynamic-component-options';\nexport * from './lib/modules/dynamic-component/dynamic-component.module';\nexport * from './lib/modules/dynamic-component/dynamic-component.service';\n\nexport * from './lib/modules/format/app-format';\n\nexport * from './lib/modules/id/id.module';\n\nexport * from './lib/modules/log/log.module';\nexport * from './lib/modules/log/log.service';\n\nexport * from './lib/modules/media-query/media-breakpoints';\nexport * from './lib/modules/media-query/media-query-listener';\nexport * from './lib/modules/media-query/media-query.module';\nexport * from './lib/modules/media-query/media-query.service';\n\nexport * from './lib/modules/mutation/mutation-observer-service';\n\nexport * from './lib/modules/numeric/numeric-symbol';\nexport * from './lib/modules/numeric/numeric.module';\nexport * from './lib/modules/numeric/numeric.options';\nexport * from './lib/modules/numeric/numeric.pipe';\nexport * from './lib/modules/numeric/numeric.service';\n\nexport * from './lib/modules/overlay/overlay-config';\nexport * from './lib/modules/overlay/overlay-instance';\nexport * from './lib/modules/overlay/overlay.module';\nexport * from './lib/modules/overlay/overlay.service';\n\nexport * from './lib/modules/percent-pipe/percent-pipe.module';\nexport * from './lib/modules/percent-pipe/percent.pipe';\n\nexport * from './lib/modules/scrollable-host/scrollable-host.service';\n\nexport * from './lib/modules/title/set-title-args';\nexport * from './lib/modules/title/title.service';\n\nexport * from './lib/modules/ui-config/ui-config.service';\n\nexport * from './lib/modules/viewkeeper/viewkeeper-host-options';\nexport * from './lib/modules/viewkeeper/viewkeeper-options';\nexport * from './lib/modules/viewkeeper/viewkeeper.module';\nexport * from './lib/modules/viewkeeper/viewkeeper.service';\n\nexport * from './lib/modules/window/window-ref';\n\n// Components and directives must be exported to support Angular's \"partial\" Ivy compiler.\n// Obscure names are used to indicate types are not part of the public API.\nexport { SkyAffixDirective as λ1 } from './lib/modules/affix/affix.directive';\nexport { SkyIdDirective as λ2 } from './lib/modules/id/id.directive';\nexport { SkyViewkeeperDirective as λ3 } from './lib/modules/viewkeeper/viewkeeper.directive';\n"]}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/components/core/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,8CAA8C,CAAC;AAC7D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,0DAA0D,CAAC;AAEzE,cAA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AAC;AACnD,cAAc,mCAAmC,CAAC;AAElD,cAAc,2CAA2C,CAAC;AAE1D,cAAc,kDAAkD,CAAC;AACjE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,6CAA6C,CAAC;AAE5D,cAAc,iCAAiC,CAAC;AAEhD,0FAA0F;AAC1F,2EAA2E;AAC3E,OAAO,EAAE,iBAAiB,IAAI,EAAE,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,cAAc,IAAI,EAAE,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,sBAAsB,IAAI,EAAE,EAAE,MAAM,+CAA+C,CAAC","sourcesContent":["export * from './lib/modules/adapter-service/adapter.module';\nexport * from './lib/modules/adapter-service/adapter.service';\nexport * from './lib/modules/adapter-service/focusable-children-options';\n\nexport * from './lib/modules/affix/affix-auto-fit-context';\nexport * from './lib/modules/affix/affix-config';\nexport * from './lib/modules/affix/affix-horizontal-alignment';\nexport * from './lib/modules/affix/affix-offset';\nexport * from './lib/modules/affix/affix-offset-change';\nexport * from './lib/modules/affix/affix-placement';\nexport * from './lib/modules/affix/affix-placement-change';\nexport * from './lib/modules/affix/affix-vertical-alignment';\nexport * from './lib/modules/affix/affix.module';\nexport * from './lib/modules/affix/affix.service';\nexport * from './lib/modules/affix/affixer';\n\nexport * from './lib/modules/dock/dock-insert-component-config';\nexport * from './lib/modules/dock/dock-item';\nexport * from './lib/modules/dock/dock-item-config';\nexport * from './lib/modules/dock/dock-location';\nexport * from './lib/modules/dock/dock-options';\nexport * from './lib/modules/dock/dock.module';\nexport * from './lib/modules/dock/dock.service';\n\nexport * from './lib/modules/dynamic-component/dynamic-component-location';\nexport * from './lib/modules/dynamic-component/dynamic-component-options';\nexport * from './lib/modules/dynamic-component/dynamic-component.module';\nexport * from './lib/modules/dynamic-component/dynamic-component.service';\n\nexport * from './lib/modules/format/app-format';\n\nexport * from './lib/modules/id/id.module';\n\nexport * from './lib/modules/log/log.module';\nexport * from './lib/modules/log/log.service';\n\nexport * from './lib/modules/media-query/media-breakpoints';\nexport * from './lib/modules/media-query/media-query-listener';\nexport * from './lib/modules/media-query/media-query.module';\nexport * from './lib/modules/media-query/media-query.service';\n\nexport * from './lib/modules/mutation/mutation-observer-service';\n\nexport * from './lib/modules/numeric/numeric-symbol';\nexport * from './lib/modules/numeric/numeric.module';\nexport * from './lib/modules/numeric/numeric.options';\nexport * from './lib/modules/numeric/numeric.pipe';\nexport * from './lib/modules/numeric/numeric.service';\n\nexport * from './lib/modules/overlay/overlay-config';\nexport * from './lib/modules/overlay/overlay-instance';\nexport * from './lib/modules/overlay/overlay.module';\nexport * from './lib/modules/overlay/overlay.service';\n\nexport * from './lib/modules/percent-pipe/percent-pipe.module';\nexport * from './lib/modules/percent-pipe/percent.pipe';\n\nexport * from './lib/modules/resize-observer/resize-observer.service';\nexport * from './lib/modules/resize-observer/resize-observer-media-query.service';\n\nexport * from './lib/modules/scrollable-host/scrollable-host.service';\n\nexport * from './lib/modules/title/set-title-args';\nexport * from './lib/modules/title/title.service';\n\nexport * from './lib/modules/ui-config/ui-config.service';\n\nexport * from './lib/modules/viewkeeper/viewkeeper-host-options';\nexport * from './lib/modules/viewkeeper/viewkeeper-options';\nexport * from './lib/modules/viewkeeper/viewkeeper.module';\nexport * from './lib/modules/viewkeeper/viewkeeper.service';\n\nexport * from './lib/modules/window/window-ref';\n\n// Components and directives must be exported to support Angular's \"partial\" Ivy compiler.\n// Obscure names are used to indicate types are not part of the public API.\nexport { SkyAffixDirective as λ1 } from './lib/modules/affix/affix.directive';\nexport { SkyIdDirective as λ2 } from './lib/modules/id/id.directive';\nexport { SkyViewkeeperDirective as λ3 } from './lib/modules/viewkeeper/viewkeeper.directive';\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"media-query-listener.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/media-query/media-query-listener.ts"],"names":[],"mappings":"","sourcesContent":["import { SkyMediaBreakpoints } from './media-breakpoints';\n\n/**\n * Specifies a
|
1
|
+
{"version":3,"file":"media-query-listener.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/media-query/media-query-listener.ts"],"names":[],"mappings":"","sourcesContent":["import { SkyMediaBreakpoints } from './media-breakpoints';\n\n/**\n * Specifies a function that is called when the breakpoints change. It is called\n * with a `SkyMediaBreakpoints` argument, which is an enum that represents the new breakpoint.\n */\nexport type SkyMediaQueryListener = (args: SkyMediaBreakpoints) => void;\n"]}
|
@@ -39,7 +39,7 @@ export class SkyMediaQueryService {
|
|
39
39
|
this.currentSubject.complete();
|
40
40
|
}
|
41
41
|
/**
|
42
|
-
*
|
42
|
+
* Subscribes to screen size changes.
|
43
43
|
* @param listener Specifies a function that is called when breakpoints change.
|
44
44
|
*/
|
45
45
|
subscribe(listener) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"media-query.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/media-query/media-query.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAa,MAAM,eAAe,CAAC;AAE9D,OAAO,EAAE,eAAe,EAAgB,MAAM,MAAM,CAAC;AAErD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;;AAM1D,MAAM,OAAO,oBAAoB;IAiE/B,YAAoB,IAAY;QAAZ,SAAI,GAAJ,IAAI,CAAQ;QAjCxB,mBAAc,GAAG,IAAI,eAAe,CAC1C,IAAI,CAAC,OAAO,CACb,CAAC;QAEM,aAAQ,GAAG,mBAAmB,CAAC,EAAE,CAAC;QAElC,gBAAW,GAGb;YACJ;gBACE,gBAAgB,EAAE,oBAAoB,CAAC,EAAE;gBACzC,IAAI,EAAE,mBAAmB,CAAC,EAAE;aAC7B;YACD;gBACE,gBAAgB,EAAE,oBAAoB,CAAC,EAAE;gBACzC,IAAI,EAAE,mBAAmB,CAAC,EAAE;aAC7B;YACD;gBACE,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,CAAC,CAAC;YACL,CAAC,CAAC;YAEF,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;YAEzB,IAAI,EAAE,CAAC,OAAO,EAAE;gBACd,IAAI,CAAC,sBAAsB,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;aAC9C;YAED,OAAO;gBACL,cAAc,EAAE,EAAE;gBAClB,QAAQ;aACT,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IAEO,eAAe;QACrB,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE;YACvC,UAAU,CAAC,cAAc,CAAC,cAAc,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QAChE,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;IACzB,CAAC;IAEO,sBAAsB,CAAC,UAA+B;QAC5D,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAC;QAC3B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACvC,CAAC;;AAnID;;;GAGG;AACW,uBAAE,GAAG,oBAAoB,CAAC;AAExC;;;GAGG;AACW,uBAAE,GAAG,2CAA2C,CAAC;AAE/D;;;GAGG;AACW,uBAAE,GAAG,4CAA4C,CAAC;AAEhE;;;GAGG;AACW,uBAAE,GAAG,qBAAqB,CAAC;kHAvB9B,oBAAoB;sHAApB,oBAAoB,cAFnB,MAAM;4FAEP,oBAAoB;kBAHhC,UAAU;mBAAC;oBACV,UAAU,EAAE,MAAM;iBACnB","sourcesContent":["import { Injectable, NgZone, OnDestroy } from '@angular/core';\n\nimport { BehaviorSubject, Subscription } from 'rxjs';\n\nimport { SkyMediaBreakpoints } from './media-breakpoints';\nimport { SkyMediaQueryListener } from './media-query-listener';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SkyMediaQueryService implements OnDestroy {\n /**\n * The size for the `xs` breakpoint.\n * @default \"(max-width: 767px)\"\n */\n public static xs = '(max-width: 767px)';\n\n /**\n * The size for the `sm` breakpoint.\n * @default \"(min-width: 768px) and (max-width: 991px)\"\n */\n public static sm = '(min-width: 768px) and (max-width: 991px)';\n\n /**\n * The size for the `md` breakpoint.\n * @default \"(min-width: 992px) and (max-width: 1199px)\"\n */\n public static md = '(min-width: 992px) and (max-width: 1199px)';\n\n /**\n * The size for the `lg` breakpoint.\n * @default \"(min-width: 1200px)\"\n */\n public static lg = '(min-width: 1200px)';\n\n /**\n * Returns the current breakpoint.\n */\n public get current(): SkyMediaBreakpoints {\n return this._current;\n }\n\n private currentSubject = new BehaviorSubject<SkyMediaBreakpoints>(\n this.current\n );\n\n private _current = SkyMediaBreakpoints.md;\n\n private breakpoints: {\n mediaQueryString: string;\n name: SkyMediaBreakpoints;\n }[] = [\n {\n mediaQueryString: SkyMediaQueryService.xs,\n name: SkyMediaBreakpoints.xs,\n },\n {\n mediaQueryString: SkyMediaQueryService.sm,\n name: SkyMediaBreakpoints.sm,\n },\n {\n mediaQueryString: SkyMediaQueryService.md,\n name: SkyMediaBreakpoints.md,\n },\n {\n mediaQueryString: SkyMediaQueryService.lg,\n name: SkyMediaBreakpoints.lg,\n },\n ];\n\n private mediaQueries: {\n mediaQueryList: MediaQueryList;\n listener: (event: any) => void;\n }[] = [];\n\n constructor(private zone: NgZone) {\n this.addListeners();\n }\n\n public ngOnDestroy(): void {\n this.removeListeners();\n this.currentSubject.complete();\n }\n\n /**\n *
|
1
|
+
{"version":3,"file":"media-query.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/media-query/media-query.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAa,MAAM,eAAe,CAAC;AAE9D,OAAO,EAAE,eAAe,EAAgB,MAAM,MAAM,CAAC;AAErD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;;AAM1D,MAAM,OAAO,oBAAoB;IAiE/B,YAAoB,IAAY;QAAZ,SAAI,GAAJ,IAAI,C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4FAEP,oBAAoB;kBAHhC,UAAU;mBAAC;oBACV,UAAU,EAAE,MAAM;iBACnB","sourcesContent":["import { Injectable, NgZone, OnDestroy } from '@angular/core';\n\nimport { BehaviorSubject, Subscription } from 'rxjs';\n\nimport { SkyMediaBreakpoints } from './media-breakpoints';\nimport { SkyMediaQueryListener } from './media-query-listener';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SkyMediaQueryService implements OnDestroy {\n /**\n * The size for the `xs` breakpoint.\n * @default \"(max-width: 767px)\"\n */\n public static xs = '(max-width: 767px)';\n\n /**\n * The size for the `sm` breakpoint.\n * @default \"(min-width: 768px) and (max-width: 991px)\"\n */\n public static sm = '(min-width: 768px) and (max-width: 991px)';\n\n /**\n * The size for the `md` breakpoint.\n * @default \"(min-width: 992px) and (max-width: 1199px)\"\n */\n public static md = '(min-width: 992px) and (max-width: 1199px)';\n\n /**\n * The size for the `lg` breakpoint.\n * @default \"(min-width: 1200px)\"\n */\n public static lg = '(min-width: 1200px)';\n\n /**\n * Returns the current breakpoint.\n */\n public get current(): SkyMediaBreakpoints {\n return this._current;\n }\n\n private currentSubject = new BehaviorSubject<SkyMediaBreakpoints>(\n this.current\n );\n\n private _current = SkyMediaBreakpoints.md;\n\n private breakpoints: {\n mediaQueryString: string;\n name: SkyMediaBreakpoints;\n }[] = [\n {\n mediaQueryString: SkyMediaQueryService.xs,\n name: SkyMediaBreakpoints.xs,\n },\n {\n mediaQueryString: SkyMediaQueryService.sm,\n name: SkyMediaBreakpoints.sm,\n },\n {\n mediaQueryString: SkyMediaQueryService.md,\n name: SkyMediaBreakpoints.md,\n },\n {\n mediaQueryString: SkyMediaQueryService.lg,\n name: SkyMediaBreakpoints.lg,\n },\n ];\n\n private mediaQueries: {\n mediaQueryList: MediaQueryList;\n listener: (event: any) => void;\n }[] = [];\n\n constructor(private zone: NgZone) {\n this.addListeners();\n }\n\n public ngOnDestroy(): void {\n this.removeListeners();\n this.currentSubject.complete();\n }\n\n /**\n * Subscribes to screen size changes.\n * @param listener Specifies a function that is called when breakpoints change.\n */\n public subscribe(listener: SkyMediaQueryListener): Subscription {\n return this.currentSubject.subscribe({\n next: (breakpoints: SkyMediaBreakpoints) => {\n listener(breakpoints);\n },\n });\n }\n\n /**\n * @internal\n */\n public destroy(): void {\n this.removeListeners();\n this.currentSubject.complete();\n }\n\n private addListeners(): void {\n this.mediaQueries = this.breakpoints.map((breakpoint: any) => {\n const mq = matchMedia(breakpoint.mediaQueryString);\n\n const listener = (event: any) => {\n // Run the check outside of Angular's change detection since Angular\n // does not wrap matchMedia listeners in NgZone.\n // See: https://blog.assaf.co/angular-2-change-detection-zones-and-an-example/\n this.zone.run(() => {\n if (event.matches) {\n this.notifyBreakpointChange(breakpoint.name);\n }\n });\n };\n\n mq.addListener(listener);\n\n if (mq.matches) {\n this.notifyBreakpointChange(breakpoint.name);\n }\n\n return {\n mediaQueryList: mq,\n listener,\n };\n });\n }\n\n private removeListeners(): void {\n this.mediaQueries.forEach((mediaQuery) => {\n mediaQuery.mediaQueryList.removeListener(mediaQuery.listener);\n });\n this.mediaQueries = [];\n }\n\n private notifyBreakpointChange(breakpoint: SkyMediaBreakpoints): void {\n this._current = breakpoint;\n this.currentSubject.next(breakpoint);\n }\n}\n"]}
|
@@ -0,0 +1,117 @@
|
|
1
|
+
import { Injectable } from '@angular/core';
|
2
|
+
import { ReplaySubject, Subject } from 'rxjs';
|
3
|
+
import { takeUntil } from 'rxjs/operators';
|
4
|
+
import { SkyMediaBreakpoints } from '../media-query/media-breakpoints';
|
5
|
+
import { SkyResizeObserverService } from './resize-observer.service';
|
6
|
+
import * as i0 from "@angular/core";
|
7
|
+
import * as i1 from "./resize-observer.service";
|
8
|
+
/**
|
9
|
+
* Acts like `SkyMediaQueryService` for a container element, emitting the same responsive breakpoints.
|
10
|
+
*/
|
11
|
+
export class SkyResizeObserverMediaQueryService {
|
12
|
+
constructor(resizeObserverService) {
|
13
|
+
this.resizeObserverService = resizeObserverService;
|
14
|
+
this._breakpoints = [
|
15
|
+
{
|
16
|
+
check: (width) => width <= 767,
|
17
|
+
name: SkyMediaBreakpoints.xs,
|
18
|
+
},
|
19
|
+
{
|
20
|
+
check: (width) => width > 767 && width <= 991,
|
21
|
+
name: SkyMediaBreakpoints.sm,
|
22
|
+
},
|
23
|
+
{
|
24
|
+
check: (width) => width > 991 && width <= 1199,
|
25
|
+
name: SkyMediaBreakpoints.md,
|
26
|
+
},
|
27
|
+
{
|
28
|
+
check: (width) => width > 1199,
|
29
|
+
name: SkyMediaBreakpoints.lg,
|
30
|
+
},
|
31
|
+
];
|
32
|
+
this._currentBreakpointObservable = new ReplaySubject(1);
|
33
|
+
this._stopListening = new Subject();
|
34
|
+
this._stopListening.subscribe(() => {
|
35
|
+
this._target = undefined;
|
36
|
+
this.updateBreakpoint(undefined);
|
37
|
+
});
|
38
|
+
}
|
39
|
+
/**
|
40
|
+
* Returns the current breakpoint.
|
41
|
+
*/
|
42
|
+
get current() {
|
43
|
+
return this._currentBreakpoint;
|
44
|
+
}
|
45
|
+
ngOnDestroy() {
|
46
|
+
this._stopListening.next();
|
47
|
+
this._currentBreakpoint = undefined;
|
48
|
+
this._stopListening.complete();
|
49
|
+
this._currentBreakpointObservable.complete();
|
50
|
+
}
|
51
|
+
/**
|
52
|
+
* @internal
|
53
|
+
*/
|
54
|
+
destroy() {
|
55
|
+
this.ngOnDestroy();
|
56
|
+
}
|
57
|
+
/**
|
58
|
+
* Sets the container element to watch. The `SkyResizeObserverMediaQueryService` will only observe one element at a
|
59
|
+
* time. Any previous subscriptions will be unsubscribed when a new element is observed.
|
60
|
+
*/
|
61
|
+
observe(element) {
|
62
|
+
if (this._target) {
|
63
|
+
if (this._target === element) {
|
64
|
+
return this;
|
65
|
+
}
|
66
|
+
this._stopListening.next();
|
67
|
+
}
|
68
|
+
this._target = element;
|
69
|
+
const width = element.nativeElement.offsetWidth;
|
70
|
+
if (width) {
|
71
|
+
const breakpoint = this.checkBreakpoint(width);
|
72
|
+
this.updateBreakpoint(breakpoint);
|
73
|
+
}
|
74
|
+
this._resizeSubscription = this.resizeObserverService
|
75
|
+
.observe(element)
|
76
|
+
.pipe(takeUntil(this._stopListening))
|
77
|
+
.subscribe((value) => {
|
78
|
+
const breakpoint = this.checkBreakpoint(value.contentRect.width);
|
79
|
+
/* istanbul ignore else */
|
80
|
+
if (breakpoint !== this._currentBreakpoint) {
|
81
|
+
this.updateBreakpoint(breakpoint);
|
82
|
+
}
|
83
|
+
});
|
84
|
+
return this;
|
85
|
+
}
|
86
|
+
/**
|
87
|
+
* Stop watching the container element.
|
88
|
+
*/
|
89
|
+
unobserve() {
|
90
|
+
this._stopListening.next();
|
91
|
+
}
|
92
|
+
/**
|
93
|
+
* Subscribes to element size changes that cross breakpoints.
|
94
|
+
*/
|
95
|
+
subscribe(listener) {
|
96
|
+
return this._currentBreakpointObservable
|
97
|
+
.pipe(takeUntil(this._stopListening))
|
98
|
+
.subscribe(listener);
|
99
|
+
}
|
100
|
+
updateBreakpoint(breakpoint) {
|
101
|
+
this._currentBreakpoint = breakpoint;
|
102
|
+
this._currentBreakpointObservable.next(breakpoint);
|
103
|
+
}
|
104
|
+
checkBreakpoint(width) {
|
105
|
+
var _a;
|
106
|
+
return (_a = this._breakpoints.find((breakpoint) => breakpoint.check(width))) === null || _a === void 0 ? void 0 : _a.name;
|
107
|
+
}
|
108
|
+
}
|
109
|
+
SkyResizeObserverMediaQueryService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyResizeObserverMediaQueryService, deps: [{ token: i1.SkyResizeObserverService }], target: i0.ɵɵFactoryTarget.Injectable });
|
110
|
+
SkyResizeObserverMediaQueryService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyResizeObserverMediaQueryService, providedIn: 'any' });
|
111
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyResizeObserverMediaQueryService, decorators: [{
|
112
|
+
type: Injectable,
|
113
|
+
args: [{
|
114
|
+
providedIn: 'any',
|
115
|
+
}]
|
116
|
+
}], ctorParameters: function () { return [{ type: i1.SkyResizeObserverService }]; } });
|
117
|
+
//# sourceMappingURL=resize-observer-media-query.service.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"resize-observer-media-query.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/resize-observer/resize-observer-media-query.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,UAAU,EAAa,MAAM,eAAe,CAAC;AAElE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAgB,MAAM,MAAM,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAGvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;;;AAErE;;GAEG;AAIH,MAAM,OAAO,kCAAkC;IAqC7C,YAAoB,qBAA+C;QAA/C,0BAAqB,GAArB,qBAAqB,CAA0B;QA7B3D,iBAAY,GAGd;YACJ;gBACE,KAAK,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,IAAI,GAAG;gBACtC,IAAI,EAAE,mBAAmB,CAAC,EAAE;aAC7B;YACD;gBACE,KAAK,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,GAAG,GAAG,IAAI,KAAK,IAAI,GAAG;gBACrD,IAAI,EAAE,mBAAmB,CAAC,EAAE;aAC7B;YACD;gBACE,KAAK,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,GAAG,GAAG,IAAI,KAAK,IAAI,IAAI;gBACtD,IAAI,EAAE,mBAAmB,CAAC,EAAE;aAC7B;YACD;gBACE,KAAK,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,GAAG,IAAI;gBACtC,IAAI,EAAE,mBAAmB,CAAC,EA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AAC,SAAS,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;aACpC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE;YACnB,MAAM,UAAU,GAAG,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;YACjE,0BAA0B;YAC1B,IAAI,UAAU,KAAK,IAAI,CAAC,kBAAkB,EAAE;gBAC1C,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;aACnC;QACH,CAAC,CAAC,CAAC;QACL,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;OAEG;IACI,SAAS;QACd,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC;IAC7B,CAAC;IAED;;OAEG;IACI,SAAS,CAAC,QAA+B;QAC9C,OAAO,IAAI,CAAC,4BAA4B;aACrC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;aACpC,SAAS,CAAC,QAAQ,CAAC,CAAC;IACzB,CAAC;IAEO,gBAAgB,CAAC,UAA+B;QACtD,IAAI,CAAC,kBAAkB,GAAG,UAAU,CAAC;QACrC,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACrD,CAAC;IAEO,eAAe,CAAC,KAAa;;QACnC,OAAO,MAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,0CAClE,IAAI,CAAC;IACX,CAAC;;gIAhHU,kCAAkC;oIAAlC,kCAAkC,cAFjC,KAAK;4FAEN,kCAAkC;kBAH9C,UAAU;mBAAC;oBACV,UAAU,EAAE,KAAK;iBAClB","sourcesContent":["import { ElementRef, Injectable, OnDestroy } from '@angular/core';\n\nimport { ReplaySubject, Subject, Subscription } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { SkyMediaBreakpoints } from '../media-query/media-breakpoints';\nimport { SkyMediaQueryListener } from '../media-query/media-query-listener';\n\nimport { SkyResizeObserverService } from './resize-observer.service';\n\n/**\n * Acts like `SkyMediaQueryService` for a container element, emitting the same responsive breakpoints.\n */\n@Injectable({\n providedIn: 'any',\n})\nexport class SkyResizeObserverMediaQueryService implements OnDestroy {\n /**\n * Returns the current breakpoint.\n */\n public get current(): SkyMediaBreakpoints | undefined {\n return this._currentBreakpoint;\n }\n\n private _breakpoints: {\n check: (width: number) => boolean;\n name: SkyMediaBreakpoints;\n }[] = [\n {\n check: (width: number) => width <= 767,\n name: SkyMediaBreakpoints.xs,\n },\n {\n check: (width: number) => width > 767 && width <= 991,\n name: SkyMediaBreakpoints.sm,\n },\n {\n check: (width: number) => width > 991 && width <= 1199,\n name: SkyMediaBreakpoints.md,\n },\n {\n check: (width: number) => width > 1199,\n name: SkyMediaBreakpoints.lg,\n },\n ];\n private _currentBreakpointObservable = new ReplaySubject<\n SkyMediaBreakpoints | undefined\n >(1);\n private _currentBreakpoint: SkyMediaBreakpoints;\n private _resizeSubscription: Subscription;\n private _stopListening = new Subject<void>();\n private _target?: ElementRef;\n\n constructor(private resizeObserverService: SkyResizeObserverService) {\n this._stopListening.subscribe(() => {\n this._target = undefined;\n this.updateBreakpoint(undefined);\n });\n }\n\n public ngOnDestroy(): void {\n this._stopListening.next();\n this._currentBreakpoint = undefined;\n this._stopListening.complete();\n this._currentBreakpointObservable.complete();\n }\n\n /**\n * @internal\n */\n public destroy(): void {\n this.ngOnDestroy();\n }\n\n /**\n * Sets the container element to watch. The `SkyResizeObserverMediaQueryService` will only observe one element at a\n * time. Any previous subscriptions will be unsubscribed when a new element is observed.\n */\n public observe(element: ElementRef): SkyResizeObserverMediaQueryService {\n if (this._target) {\n if (this._target === element) {\n return this;\n }\n this._stopListening.next();\n }\n this._target = element;\n const width = (element.nativeElement as HTMLElement).offsetWidth;\n if (width) {\n const breakpoint = this.checkBreakpoint(width);\n this.updateBreakpoint(breakpoint);\n }\n this._resizeSubscription = this.resizeObserverService\n .observe(element)\n .pipe(takeUntil(this._stopListening))\n .subscribe((value) => {\n const breakpoint = this.checkBreakpoint(value.contentRect.width);\n /* istanbul ignore else */\n if (breakpoint !== this._currentBreakpoint) {\n this.updateBreakpoint(breakpoint);\n }\n });\n return this;\n }\n\n /**\n * Stop watching the container element.\n */\n public unobserve(): void {\n this._stopListening.next();\n }\n\n /**\n * Subscribes to element size changes that cross breakpoints.\n */\n public subscribe(listener: SkyMediaQueryListener): Subscription {\n return this._currentBreakpointObservable\n .pipe(takeUntil(this._stopListening))\n .subscribe(listener);\n }\n\n private updateBreakpoint(breakpoint: SkyMediaBreakpoints) {\n this._currentBreakpoint = breakpoint;\n this._currentBreakpointObservable.next(breakpoint);\n }\n\n private checkBreakpoint(width: number): SkyMediaBreakpoints | undefined {\n return this._breakpoints.find((breakpoint) => breakpoint.check(width))\n ?.name;\n }\n}\n"]}
|
@@ -0,0 +1,73 @@
|
|
1
|
+
import { Injectable, NgZone } from '@angular/core';
|
2
|
+
import { Subject } from 'rxjs';
|
3
|
+
import { finalize } from 'rxjs/operators';
|
4
|
+
import * as i0 from "@angular/core";
|
5
|
+
/**
|
6
|
+
* Service to create rxjs observables for changes to the content box dimensions of elements.
|
7
|
+
*/
|
8
|
+
export class SkyResizeObserverService {
|
9
|
+
constructor(zone) {
|
10
|
+
this.zone = zone;
|
11
|
+
this._tracking = [];
|
12
|
+
this._resizeObserver = new ResizeObserver((entries) => {
|
13
|
+
entries.forEach((entry) => this.callback(entry));
|
14
|
+
});
|
15
|
+
}
|
16
|
+
ngOnDestroy() {
|
17
|
+
this._resizeObserver.disconnect();
|
18
|
+
}
|
19
|
+
/**
|
20
|
+
* Create rxjs observable to get size changes for an element ref.
|
21
|
+
*/
|
22
|
+
observe(element) {
|
23
|
+
return this.observeAndTrack(element).subjectObservable;
|
24
|
+
}
|
25
|
+
observeAndTrack(element) {
|
26
|
+
const checkTracking = this._tracking.findIndex((value) => {
|
27
|
+
return !value.subject.closed && value.element === element.nativeElement;
|
28
|
+
});
|
29
|
+
if (checkTracking === -1) {
|
30
|
+
this._resizeObserver.observe(element.nativeElement);
|
31
|
+
}
|
32
|
+
const subject = new Subject();
|
33
|
+
const subjectObservable = subject.pipe(finalize(() => {
|
34
|
+
// Are there any other tracking entries still watching this element?
|
35
|
+
const checkTracking = this._tracking.findIndex((value) => {
|
36
|
+
return (value.subject !== subject &&
|
37
|
+
!value.subject.closed &&
|
38
|
+
value.element === element.nativeElement);
|
39
|
+
});
|
40
|
+
if (checkTracking === -1) {
|
41
|
+
this._resizeObserver.unobserve(element.nativeElement);
|
42
|
+
}
|
43
|
+
}));
|
44
|
+
const tracking = {
|
45
|
+
element: element.nativeElement,
|
46
|
+
subject,
|
47
|
+
subjectObservable,
|
48
|
+
};
|
49
|
+
this._tracking.push(tracking);
|
50
|
+
return tracking;
|
51
|
+
}
|
52
|
+
callback(entry) {
|
53
|
+
this._tracking
|
54
|
+
.filter((value) => !(value.subject.closed || value.subject.isStopped))
|
55
|
+
.forEach((value) => {
|
56
|
+
/* istanbul ignore else */
|
57
|
+
if (value.element === entry.target) {
|
58
|
+
this.zone.run(() => {
|
59
|
+
value.subject.next(entry);
|
60
|
+
});
|
61
|
+
}
|
62
|
+
});
|
63
|
+
}
|
64
|
+
}
|
65
|
+
SkyResizeObserverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyResizeObserverService, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
|
66
|
+
SkyResizeObserverService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyResizeObserverService, providedIn: 'any' });
|
67
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyResizeObserverService, decorators: [{
|
68
|
+
type: Injectable,
|
69
|
+
args: [{
|
70
|
+
providedIn: 'any',
|
71
|
+
}]
|
72
|
+
}], ctorParameters: function () { return [{ type: i0.NgZone }]; } });
|
73
|
+
//# sourceMappingURL=resize-observer.service.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"resize-observer.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/resize-observer/resize-observer.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,UAAU,EAAE,MAAM,EAAa,MAAM,eAAe,CAAC;AAE1E,OAAO,EAAc,OAAO,EAAE,MAAM,MAAM,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;;AAQ1C;;GAEG;AAIH,MAAM,OAAO,wBAAwB;IAInC,YAAoB,IAAY;QAAZ,SAAI,GAAJ,IAAI,CAAQ;QAFxB,cAAS,GAA6B,EAAE,CAAC;QAG/C,IAAI,CAAC,eAAe,GAAG,IAAI,cAAc,CACvC,CAAC,OAA8B,EAAE,EAAE;YACjC,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;QACnD,CAAC,CACF,CAAC;IACJ,CAAC;IAEM,WAAW;QAChB,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE,CAAC;IACpC,CAAC;IAED;;OAEG;IACI,OAAO,CAAC,OAAmB;QAChC,OAAO,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,iBAAiB,CAAC;IACzD,CAAC;IAEO,eAAe,CAAC,OAAmB;QACzC,MAAM,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE;YACvD,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,IAAI,KAAK,CAAC,OAAO,KAAK,OAAO,CAAC,aAAa,CAAC;QAC1E,CAAC,CAAC,CAAC;QACH,IAAI,aAAa,KAAK,CAAC,CAAC,EAAE;YACxB,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,OAAO,CAAC,a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CAAC,CAAC;IACP,CAAC;;sHAlEU,wBAAwB;0HAAxB,wBAAwB,cAFvB,KAAK;4FAEN,wBAAwB;kBAHpC,UAAU;mBAAC;oBACV,UAAU,EAAE,KAAK;iBAClB","sourcesContent":["import { ElementRef, Injectable, NgZone, OnDestroy } from '@angular/core';\n\nimport { Observable, Subject } from 'rxjs';\nimport { finalize } from 'rxjs/operators';\n\ntype ResizeObserverTracking = {\n element: Element;\n subject: Subject<ResizeObserverEntry>;\n subjectObservable: Observable<ResizeObserverEntry>;\n};\n\n/**\n * Service to create rxjs observables for changes to the content box dimensions of elements.\n */\n@Injectable({\n providedIn: 'any',\n})\nexport class SkyResizeObserverService implements OnDestroy {\n private _resizeObserver: ResizeObserver;\n private _tracking: ResizeObserverTracking[] = [];\n\n constructor(private zone: NgZone) {\n this._resizeObserver = new ResizeObserver(\n (entries: ResizeObserverEntry[]) => {\n entries.forEach((entry) => this.callback(entry));\n }\n );\n }\n\n public ngOnDestroy(): void {\n this._resizeObserver.disconnect();\n }\n\n /**\n * Create rxjs observable to get size changes for an element ref.\n */\n public observe(element: ElementRef): Observable<ResizeObserverEntry> {\n return this.observeAndTrack(element).subjectObservable;\n }\n\n private observeAndTrack(element: ElementRef): ResizeObserverTracking {\n const checkTracking = this._tracking.findIndex((value) => {\n return !value.subject.closed && value.element === element.nativeElement;\n });\n if (checkTracking === -1) {\n this._resizeObserver.observe(element.nativeElement);\n }\n const subject = new Subject<ResizeObserverEntry>();\n const subjectObservable = subject.pipe(\n finalize(() => {\n // Are there any other tracking entries still watching this element?\n const checkTracking = this._tracking.findIndex((value) => {\n return (\n value.subject !== subject &&\n !value.subject.closed &&\n value.element === element.nativeElement\n );\n });\n if (checkTracking === -1) {\n this._resizeObserver.unobserve(element.nativeElement);\n }\n })\n );\n const tracking = {\n element: element.nativeElement,\n subject,\n subjectObservable,\n };\n this._tracking.push(tracking);\n return tracking;\n }\n\n private callback(entry: ResizeObserverEntry) {\n this._tracking\n .filter((value) => !(value.subject.closed || value.subject.isStopped))\n .forEach((value) => {\n /* istanbul ignore else */\n if (value.element === entry.target) {\n this.zone.run(() => {\n value.subject.next(entry);\n });\n }\n });\n }\n}\n"]}
|
package/fesm2015/skyux-core.js
CHANGED
@@ -2,8 +2,8 @@ import * as i0 from '@angular/core';
|
|
2
2
|
import { NgModule, Injectable, EventEmitter, Directive, Input, Output, Injector, ViewContainerRef, Component, ChangeDetectionStrategy, ViewChild, Pipe, ElementRef, Optional } from '@angular/core';
|
3
3
|
import * as i4 from '@angular/common';
|
4
4
|
import { CommonModule } from '@angular/common';
|
5
|
-
import { Subject, fromEvent, BehaviorSubject, Observable, of } from 'rxjs';
|
6
|
-
import { takeUntil, debounceTime } from 'rxjs/operators';
|
5
|
+
import { Subject, fromEvent, BehaviorSubject, ReplaySubject, Observable, of } from 'rxjs';
|
6
|
+
import { takeUntil, debounceTime, finalize } from 'rxjs/operators';
|
7
7
|
import * as i1 from '@skyux/i18n';
|
8
8
|
import { getLibStringForLocale, SkyI18nModule, SKY_LIB_RESOURCES_PROVIDERS, SkyIntlNumberFormatStyle, SkyIntlNumberFormatter } from '@skyux/i18n';
|
9
9
|
import * as i3 from '@angular/router';
|
@@ -1472,7 +1472,7 @@ class SkyMediaQueryService {
|
|
1472
1472
|
this.currentSubject.complete();
|
1473
1473
|
}
|
1474
1474
|
/**
|
1475
|
-
*
|
1475
|
+
* Subscribes to screen size changes.
|
1476
1476
|
* @param listener Specifies a function that is called when breakpoints change.
|
1477
1477
|
*/
|
1478
1478
|
subscribe(listener) {
|
@@ -2409,6 +2409,185 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
2409
2409
|
}]
|
2410
2410
|
}] });
|
2411
2411
|
|
2412
|
+
/**
|
2413
|
+
* Service to create rxjs observables for changes to the content box dimensions of elements.
|
2414
|
+
*/
|
2415
|
+
class SkyResizeObserverService {
|
2416
|
+
constructor(zone) {
|
2417
|
+
this.zone = zone;
|
2418
|
+
this._tracking = [];
|
2419
|
+
this._resizeObserver = new ResizeObserver((entries) => {
|
2420
|
+
entries.forEach((entry) => this.callback(entry));
|
2421
|
+
});
|
2422
|
+
}
|
2423
|
+
ngOnDestroy() {
|
2424
|
+
this._resizeObserver.disconnect();
|
2425
|
+
}
|
2426
|
+
/**
|
2427
|
+
* Create rxjs observable to get size changes for an element ref.
|
2428
|
+
*/
|
2429
|
+
observe(element) {
|
2430
|
+
return this.observeAndTrack(element).subjectObservable;
|
2431
|
+
}
|
2432
|
+
observeAndTrack(element) {
|
2433
|
+
const checkTracking = this._tracking.findIndex((value) => {
|
2434
|
+
return !value.subject.closed && value.element === element.nativeElement;
|
2435
|
+
});
|
2436
|
+
if (checkTracking === -1) {
|
2437
|
+
this._resizeObserver.observe(element.nativeElement);
|
2438
|
+
}
|
2439
|
+
const subject = new Subject();
|
2440
|
+
const subjectObservable = subject.pipe(finalize(() => {
|
2441
|
+
// Are there any other tracking entries still watching this element?
|
2442
|
+
const checkTracking = this._tracking.findIndex((value) => {
|
2443
|
+
return (value.subject !== subject &&
|
2444
|
+
!value.subject.closed &&
|
2445
|
+
value.element === element.nativeElement);
|
2446
|
+
});
|
2447
|
+
if (checkTracking === -1) {
|
2448
|
+
this._resizeObserver.unobserve(element.nativeElement);
|
2449
|
+
}
|
2450
|
+
}));
|
2451
|
+
const tracking = {
|
2452
|
+
element: element.nativeElement,
|
2453
|
+
subject,
|
2454
|
+
subjectObservable,
|
2455
|
+
};
|
2456
|
+
this._tracking.push(tracking);
|
2457
|
+
return tracking;
|
2458
|
+
}
|
2459
|
+
callback(entry) {
|
2460
|
+
this._tracking
|
2461
|
+
.filter((value) => !(value.subject.closed || value.subject.isStopped))
|
2462
|
+
.forEach((value) => {
|
2463
|
+
/* istanbul ignore else */
|
2464
|
+
if (value.element === entry.target) {
|
2465
|
+
this.zone.run(() => {
|
2466
|
+
value.subject.next(entry);
|
2467
|
+
});
|
2468
|
+
}
|
2469
|
+
});
|
2470
|
+
}
|
2471
|
+
}
|
2472
|
+
SkyResizeObserverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyResizeObserverService, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
|
2473
|
+
SkyResizeObserverService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyResizeObserverService, providedIn: 'any' });
|
2474
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyResizeObserverService, decorators: [{
|
2475
|
+
type: Injectable,
|
2476
|
+
args: [{
|
2477
|
+
providedIn: 'any',
|
2478
|
+
}]
|
2479
|
+
}], ctorParameters: function () { return [{ type: i0.NgZone }]; } });
|
2480
|
+
|
2481
|
+
/**
|
2482
|
+
* Acts like `SkyMediaQueryService` for a container element, emitting the same responsive breakpoints.
|
2483
|
+
*/
|
2484
|
+
class SkyResizeObserverMediaQueryService {
|
2485
|
+
constructor(resizeObserverService) {
|
2486
|
+
this.resizeObserverService = resizeObserverService;
|
2487
|
+
this._breakpoints = [
|
2488
|
+
{
|
2489
|
+
check: (width) => width <= 767,
|
2490
|
+
name: SkyMediaBreakpoints.xs,
|
2491
|
+
},
|
2492
|
+
{
|
2493
|
+
check: (width) => width > 767 && width <= 991,
|
2494
|
+
name: SkyMediaBreakpoints.sm,
|
2495
|
+
},
|
2496
|
+
{
|
2497
|
+
check: (width) => width > 991 && width <= 1199,
|
2498
|
+
name: SkyMediaBreakpoints.md,
|
2499
|
+
},
|
2500
|
+
{
|
2501
|
+
check: (width) => width > 1199,
|
2502
|
+
name: SkyMediaBreakpoints.lg,
|
2503
|
+
},
|
2504
|
+
];
|
2505
|
+
this._currentBreakpointObservable = new ReplaySubject(1);
|
2506
|
+
this._stopListening = new Subject();
|
2507
|
+
this._stopListening.subscribe(() => {
|
2508
|
+
this._target = undefined;
|
2509
|
+
this.updateBreakpoint(undefined);
|
2510
|
+
});
|
2511
|
+
}
|
2512
|
+
/**
|
2513
|
+
* Returns the current breakpoint.
|
2514
|
+
*/
|
2515
|
+
get current() {
|
2516
|
+
return this._currentBreakpoint;
|
2517
|
+
}
|
2518
|
+
ngOnDestroy() {
|
2519
|
+
this._stopListening.next();
|
2520
|
+
this._currentBreakpoint = undefined;
|
2521
|
+
this._stopListening.complete();
|
2522
|
+
this._currentBreakpointObservable.complete();
|
2523
|
+
}
|
2524
|
+
/**
|
2525
|
+
* @internal
|
2526
|
+
*/
|
2527
|
+
destroy() {
|
2528
|
+
this.ngOnDestroy();
|
2529
|
+
}
|
2530
|
+
/**
|
2531
|
+
* Sets the container element to watch. The `SkyResizeObserverMediaQueryService` will only observe one element at a
|
2532
|
+
* time. Any previous subscriptions will be unsubscribed when a new element is observed.
|
2533
|
+
*/
|
2534
|
+
observe(element) {
|
2535
|
+
if (this._target) {
|
2536
|
+
if (this._target === element) {
|
2537
|
+
return this;
|
2538
|
+
}
|
2539
|
+
this._stopListening.next();
|
2540
|
+
}
|
2541
|
+
this._target = element;
|
2542
|
+
const width = element.nativeElement.offsetWidth;
|
2543
|
+
if (width) {
|
2544
|
+
const breakpoint = this.checkBreakpoint(width);
|
2545
|
+
this.updateBreakpoint(breakpoint);
|
2546
|
+
}
|
2547
|
+
this._resizeSubscription = this.resizeObserverService
|
2548
|
+
.observe(element)
|
2549
|
+
.pipe(takeUntil(this._stopListening))
|
2550
|
+
.subscribe((value) => {
|
2551
|
+
const breakpoint = this.checkBreakpoint(value.contentRect.width);
|
2552
|
+
/* istanbul ignore else */
|
2553
|
+
if (breakpoint !== this._currentBreakpoint) {
|
2554
|
+
this.updateBreakpoint(breakpoint);
|
2555
|
+
}
|
2556
|
+
});
|
2557
|
+
return this;
|
2558
|
+
}
|
2559
|
+
/**
|
2560
|
+
* Stop watching the container element.
|
2561
|
+
*/
|
2562
|
+
unobserve() {
|
2563
|
+
this._stopListening.next();
|
2564
|
+
}
|
2565
|
+
/**
|
2566
|
+
* Subscribes to element size changes that cross breakpoints.
|
2567
|
+
*/
|
2568
|
+
subscribe(listener) {
|
2569
|
+
return this._currentBreakpointObservable
|
2570
|
+
.pipe(takeUntil(this._stopListening))
|
2571
|
+
.subscribe(listener);
|
2572
|
+
}
|
2573
|
+
updateBreakpoint(breakpoint) {
|
2574
|
+
this._currentBreakpoint = breakpoint;
|
2575
|
+
this._currentBreakpointObservable.next(breakpoint);
|
2576
|
+
}
|
2577
|
+
checkBreakpoint(width) {
|
2578
|
+
var _a;
|
2579
|
+
return (_a = this._breakpoints.find((breakpoint) => breakpoint.check(width))) === null || _a === void 0 ? void 0 : _a.name;
|
2580
|
+
}
|
2581
|
+
}
|
2582
|
+
SkyResizeObserverMediaQueryService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyResizeObserverMediaQueryService, deps: [{ token: SkyResizeObserverService }], target: i0.ɵɵFactoryTarget.Injectable });
|
2583
|
+
SkyResizeObserverMediaQueryService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyResizeObserverMediaQueryService, providedIn: 'any' });
|
2584
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyResizeObserverMediaQueryService, decorators: [{
|
2585
|
+
type: Injectable,
|
2586
|
+
args: [{
|
2587
|
+
providedIn: 'any',
|
2588
|
+
}]
|
2589
|
+
}], ctorParameters: function () { return [{ type: SkyResizeObserverService }]; } });
|
2590
|
+
|
2412
2591
|
function notifySubscribers(subscribers, item) {
|
2413
2592
|
for (const subscriber of subscribers) {
|
2414
2593
|
subscriber.next(item);
|
@@ -3046,5 +3225,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
3046
3225
|
* Generated bundle index. Do not edit.
|
3047
3226
|
*/
|
3048
3227
|
|
3049
|
-
export { MutationObserverService, NumericOptions, SkyAffixAutoFitContext, SkyAffixModule, SkyAffixService, SkyAffixer, SkyAppFormat, SkyAppTitleService, SkyAppWindowRef, SkyCoreAdapterModule, SkyCoreAdapterService, SkyDockItem, SkyDockLocation, SkyDockModule, SkyDockService, SkyDynamicComponentLocation, SkyDynamicComponentModule, SkyDynamicComponentService, SkyIdModule, SkyLogModule, SkyLogService, SkyMediaBreakpoints, SkyMediaQueryModule, SkyMediaQueryService, SkyNumericModule, SkyNumericPipe, SkyNumericService, SkyOverlayInstance, SkyOverlayModule, SkyOverlayService, SkyPercentPipe, SkyPercentPipeModule, SkyScrollableHostService, SkyUIConfigService, SkyViewkeeperHostOptions, SkyViewkeeperModule, SkyViewkeeperService, getWindow, SkyAffixDirective as λ1, SkyIdDirective as λ2, SkyViewkeeperDirective as λ3 };
|
3228
|
+
export { MutationObserverService, NumericOptions, SkyAffixAutoFitContext, SkyAffixModule, SkyAffixService, SkyAffixer, SkyAppFormat, SkyAppTitleService, SkyAppWindowRef, SkyCoreAdapterModule, SkyCoreAdapterService, SkyDockItem, SkyDockLocation, SkyDockModule, SkyDockService, SkyDynamicComponentLocation, SkyDynamicComponentModule, SkyDynamicComponentService, SkyIdModule, SkyLogModule, SkyLogService, SkyMediaBreakpoints, SkyMediaQueryModule, SkyMediaQueryService, SkyNumericModule, SkyNumericPipe, SkyNumericService, SkyOverlayInstance, SkyOverlayModule, SkyOverlayService, SkyPercentPipe, SkyPercentPipeModule, SkyResizeObserverMediaQueryService, SkyResizeObserverService, SkyScrollableHostService, SkyUIConfigService, SkyViewkeeperHostOptions, SkyViewkeeperModule, SkyViewkeeperService, getWindow, SkyAffixDirective as λ1, SkyIdDirective as λ2, SkyViewkeeperDirective as λ3 };
|
3050
3229
|
//# sourceMappingURL=skyux-core.js.map
|