@skyux/core 5.9.4 → 6.0.0-beta.10
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/documentation.json +727 -503
- package/esm2020/index.mjs +64 -0
- package/esm2020/lib/modules/adapter-service/adapter.module.mjs +16 -0
- package/esm2020/lib/modules/adapter-service/adapter.service.mjs +225 -0
- package/esm2020/lib/modules/adapter-service/focusable-children-options.mjs +2 -0
- package/esm2020/lib/modules/affix/affix-auto-fit-context.mjs +12 -0
- package/esm2020/lib/modules/affix/affix-config.mjs +2 -0
- package/esm2020/lib/modules/affix/affix-horizontal-alignment.mjs +2 -0
- package/esm2020/lib/modules/affix/affix-offset-change.mjs +2 -0
- package/esm2020/lib/modules/affix/affix-offset.mjs +2 -0
- package/esm2020/lib/modules/affix/affix-placement-change.mjs +2 -0
- package/esm2020/lib/modules/affix/affix-placement.mjs +2 -0
- package/esm2020/lib/modules/affix/affix-utils.mjs +18 -0
- package/esm2020/lib/modules/affix/affix-vertical-alignment.mjs +2 -0
- package/esm2020/lib/modules/affix/affix.directive.mjs +100 -0
- package/esm2020/lib/modules/affix/affix.module.mjs +18 -0
- package/esm2020/lib/modules/affix/affix.service.mjs +24 -0
- package/esm2020/lib/modules/affix/affixer.mjs +346 -0
- package/esm2020/lib/modules/affix/dom-utils.mjs +77 -0
- package/esm2020/lib/modules/dock/dock-dom-adapter.service.mjs +80 -0
- package/esm2020/lib/modules/dock/dock-insert-component-config.mjs +2 -0
- package/esm2020/lib/modules/dock/dock-item-config.mjs +2 -0
- package/esm2020/lib/modules/dock/dock-item-reference.mjs +2 -0
- package/esm2020/lib/modules/dock/dock-item.mjs +29 -0
- package/esm2020/lib/modules/dock/dock-location.mjs +19 -0
- package/esm2020/lib/modules/dock/dock-options.mjs +2 -0
- package/esm2020/lib/modules/dock/dock.component.mjs +88 -0
- package/esm2020/lib/modules/dock/dock.module.mjs +19 -0
- package/esm2020/lib/modules/dock/dock.service.mjs +95 -0
- package/esm2020/lib/modules/dock/sort-by-stack-order.mjs +13 -0
- package/esm2020/lib/modules/dynamic-component/dynamic-component-location.mjs +27 -0
- package/esm2020/lib/modules/dynamic-component/dynamic-component-options.mjs +2 -0
- package/esm2020/lib/modules/dynamic-component/dynamic-component.module.mjs +17 -0
- package/esm2020/lib/modules/dynamic-component/dynamic-component.service.mjs +83 -0
- package/esm2020/lib/modules/format/app-format.mjs +18 -0
- package/esm2020/lib/modules/id/id.directive.mjs +34 -0
- package/esm2020/lib/modules/id/id.module.mjs +16 -0
- package/esm2020/lib/modules/log/log.module.mjs +16 -0
- package/esm2020/lib/modules/log/log.service.mjs +132 -0
- package/esm2020/lib/modules/log/types/log-deprecation-args.mjs +2 -0
- package/esm2020/lib/modules/log/types/log-level-token.mjs +6 -0
- package/esm2020/lib/modules/log/types/log-level.mjs +2 -0
- package/esm2020/lib/modules/media-query/media-breakpoints.mjs +20 -0
- package/esm2020/lib/modules/media-query/media-query-listener.mjs +2 -0
- package/esm2020/lib/modules/media-query/media-query.module.mjs +16 -0
- package/esm2020/lib/modules/media-query/media-query.service.mjs +121 -0
- package/esm2020/lib/modules/mutation/mutation-observer-service.mjs +16 -0
- package/esm2020/lib/modules/numeric/numeric-symbol.mjs +2 -0
- package/esm2020/lib/modules/numeric/numeric.module.mjs +20 -0
- package/esm2020/lib/modules/numeric/numeric.options.mjs +46 -0
- package/esm2020/lib/modules/numeric/numeric.pipe.mjs +80 -0
- package/esm2020/lib/modules/numeric/numeric.service.mjs +186 -0
- package/esm2020/lib/modules/overlay/overlay-adapter.service.mjs +41 -0
- package/esm2020/lib/modules/overlay/overlay-config.mjs +2 -0
- package/esm2020/lib/modules/overlay/overlay-context.mjs +10 -0
- package/esm2020/lib/modules/overlay/overlay-instance.mjs +55 -0
- package/esm2020/lib/modules/overlay/overlay.component.mjs +149 -0
- package/esm2020/lib/modules/overlay/overlay.module.mjs +17 -0
- package/esm2020/lib/modules/overlay/overlay.service.mjs +120 -0
- package/esm2020/lib/modules/percent-pipe/percent-pipe.module.mjs +20 -0
- package/esm2020/lib/modules/percent-pipe/percent.pipe.mjs +48 -0
- package/esm2020/lib/modules/resize-observer/resize-observer-media-query.service.mjs +117 -0
- package/esm2020/lib/modules/resize-observer/resize-observer.service.mjs +73 -0
- package/esm2020/lib/modules/scrollable-host/scrollable-host.service.mjs +184 -0
- package/esm2020/lib/modules/shared/number-format/number-format-utility.mjs +71 -0
- package/esm2020/lib/modules/shared/sky-core-resources.module.mjs +50 -0
- package/esm2020/lib/modules/title/set-title-args.mjs +2 -0
- package/esm2020/lib/modules/title/title.service.mjs +31 -0
- package/esm2020/lib/modules/ui-config/ui-config.service.mjs +21 -0
- package/esm2020/lib/modules/viewkeeper/viewkeeper-boundary-info.mjs +2 -0
- package/esm2020/lib/modules/viewkeeper/viewkeeper-fixed-styles.mjs +2 -0
- package/esm2020/lib/modules/viewkeeper/viewkeeper-host-options.mjs +10 -0
- package/esm2020/lib/modules/viewkeeper/viewkeeper-offset.mjs +2 -0
- package/esm2020/lib/modules/viewkeeper/viewkeeper-options.mjs +2 -0
- package/esm2020/lib/modules/viewkeeper/viewkeeper.directive.mjs +116 -0
- package/esm2020/lib/modules/viewkeeper/viewkeeper.mjs +251 -0
- package/esm2020/lib/modules/viewkeeper/viewkeeper.module.mjs +16 -0
- package/esm2020/lib/modules/viewkeeper/viewkeeper.service.mjs +39 -0
- package/esm2020/lib/modules/window/window-ref.mjs +30 -0
- package/esm2020/skyux-core.mjs +5 -0
- package/esm2020/testing/mock-media-query.service.mjs +41 -0
- package/esm2020/testing/mock-ui-config.service.mjs +59 -0
- package/esm2020/testing/public-api.mjs +3 -0
- package/esm2020/testing/skyux-core-testing.mjs +5 -0
- package/fesm2015/{skyux-core-testing.js → skyux-core-testing.mjs} +7 -7
- package/fesm2015/skyux-core-testing.mjs.map +1 -0
- package/fesm2015/skyux-core.mjs +3343 -0
- package/fesm2015/skyux-core.mjs.map +1 -0
- package/fesm2020/skyux-core-testing.mjs +103 -0
- package/fesm2020/skyux-core-testing.mjs.map +1 -0
- package/{fesm2015/skyux-core.js → fesm2020/skyux-core.mjs} +270 -178
- package/fesm2020/skyux-core.mjs.map +1 -0
- package/index.d.ts +2 -0
- package/lib/modules/log/log.service.d.ts +37 -3
- package/lib/modules/log/types/log-deprecation-args.d.ts +27 -0
- package/lib/modules/log/types/log-level-token.d.ts +6 -0
- package/lib/modules/log/types/log-level.d.ts +8 -0
- package/lib/modules/numeric/numeric.options.d.ts +6 -1
- package/lib/modules/numeric/numeric.pipe.d.ts +2 -4
- package/lib/modules/numeric/numeric.service.d.ts +2 -2
- package/lib/modules/resize-observer/resize-observer-media-query.service.d.ts +0 -1
- package/package.json +35 -11
- package/testing/package.json +5 -5
- package/bundles/skyux-core-testing.umd.js +0 -459
- package/bundles/skyux-core.umd.js +0 -3848
- package/esm2015/index.js +0 -62
- package/esm2015/index.js.map +0 -1
- package/esm2015/lib/modules/adapter-service/adapter.module.js +0 -16
- package/esm2015/lib/modules/adapter-service/adapter.module.js.map +0 -1
- package/esm2015/lib/modules/adapter-service/adapter.service.js +0 -226
- package/esm2015/lib/modules/adapter-service/adapter.service.js.map +0 -1
- package/esm2015/lib/modules/adapter-service/focusable-children-options.js +0 -2
- package/esm2015/lib/modules/adapter-service/focusable-children-options.js.map +0 -1
- package/esm2015/lib/modules/affix/affix-auto-fit-context.js +0 -12
- package/esm2015/lib/modules/affix/affix-auto-fit-context.js.map +0 -1
- package/esm2015/lib/modules/affix/affix-config.js +0 -2
- package/esm2015/lib/modules/affix/affix-config.js.map +0 -1
- package/esm2015/lib/modules/affix/affix-horizontal-alignment.js +0 -2
- package/esm2015/lib/modules/affix/affix-horizontal-alignment.js.map +0 -1
- package/esm2015/lib/modules/affix/affix-offset-change.js +0 -2
- package/esm2015/lib/modules/affix/affix-offset-change.js.map +0 -1
- package/esm2015/lib/modules/affix/affix-offset.js +0 -2
- package/esm2015/lib/modules/affix/affix-offset.js.map +0 -1
- package/esm2015/lib/modules/affix/affix-placement-change.js +0 -2
- package/esm2015/lib/modules/affix/affix-placement-change.js.map +0 -1
- package/esm2015/lib/modules/affix/affix-placement.js +0 -2
- package/esm2015/lib/modules/affix/affix-placement.js.map +0 -1
- package/esm2015/lib/modules/affix/affix-utils.js +0 -18
- package/esm2015/lib/modules/affix/affix-utils.js.map +0 -1
- package/esm2015/lib/modules/affix/affix-vertical-alignment.js +0 -2
- package/esm2015/lib/modules/affix/affix-vertical-alignment.js.map +0 -1
- package/esm2015/lib/modules/affix/affix.directive.js +0 -100
- package/esm2015/lib/modules/affix/affix.directive.js.map +0 -1
- package/esm2015/lib/modules/affix/affix.module.js +0 -18
- package/esm2015/lib/modules/affix/affix.module.js.map +0 -1
- package/esm2015/lib/modules/affix/affix.service.js +0 -24
- package/esm2015/lib/modules/affix/affix.service.js.map +0 -1
- package/esm2015/lib/modules/affix/affixer.js +0 -349
- package/esm2015/lib/modules/affix/affixer.js.map +0 -1
- package/esm2015/lib/modules/affix/dom-utils.js +0 -77
- package/esm2015/lib/modules/affix/dom-utils.js.map +0 -1
- package/esm2015/lib/modules/dock/dock-dom-adapter.service.js +0 -80
- package/esm2015/lib/modules/dock/dock-dom-adapter.service.js.map +0 -1
- package/esm2015/lib/modules/dock/dock-insert-component-config.js +0 -2
- package/esm2015/lib/modules/dock/dock-insert-component-config.js.map +0 -1
- package/esm2015/lib/modules/dock/dock-item-config.js +0 -2
- package/esm2015/lib/modules/dock/dock-item-config.js.map +0 -1
- package/esm2015/lib/modules/dock/dock-item-reference.js +0 -2
- package/esm2015/lib/modules/dock/dock-item-reference.js.map +0 -1
- package/esm2015/lib/modules/dock/dock-item.js +0 -29
- package/esm2015/lib/modules/dock/dock-item.js.map +0 -1
- package/esm2015/lib/modules/dock/dock-location.js +0 -19
- package/esm2015/lib/modules/dock/dock-location.js.map +0 -1
- package/esm2015/lib/modules/dock/dock-options.js +0 -2
- package/esm2015/lib/modules/dock/dock-options.js.map +0 -1
- package/esm2015/lib/modules/dock/dock.component.js +0 -95
- package/esm2015/lib/modules/dock/dock.component.js.map +0 -1
- package/esm2015/lib/modules/dock/dock.module.js +0 -20
- package/esm2015/lib/modules/dock/dock.module.js.map +0 -1
- package/esm2015/lib/modules/dock/dock.service.js +0 -95
- package/esm2015/lib/modules/dock/dock.service.js.map +0 -1
- package/esm2015/lib/modules/dock/sort-by-stack-order.js +0 -13
- package/esm2015/lib/modules/dock/sort-by-stack-order.js.map +0 -1
- package/esm2015/lib/modules/dynamic-component/dynamic-component-location.js +0 -27
- package/esm2015/lib/modules/dynamic-component/dynamic-component-location.js.map +0 -1
- package/esm2015/lib/modules/dynamic-component/dynamic-component-options.js +0 -2
- package/esm2015/lib/modules/dynamic-component/dynamic-component-options.js.map +0 -1
- package/esm2015/lib/modules/dynamic-component/dynamic-component.module.js +0 -17
- package/esm2015/lib/modules/dynamic-component/dynamic-component.module.js.map +0 -1
- package/esm2015/lib/modules/dynamic-component/dynamic-component.service.js +0 -83
- package/esm2015/lib/modules/dynamic-component/dynamic-component.service.js.map +0 -1
- package/esm2015/lib/modules/format/app-format.js +0 -18
- package/esm2015/lib/modules/format/app-format.js.map +0 -1
- package/esm2015/lib/modules/id/id.directive.js +0 -34
- package/esm2015/lib/modules/id/id.directive.js.map +0 -1
- package/esm2015/lib/modules/id/id.module.js +0 -16
- package/esm2015/lib/modules/id/id.module.js.map +0 -1
- package/esm2015/lib/modules/log/log.module.js +0 -16
- package/esm2015/lib/modules/log/log.module.js.map +0 -1
- package/esm2015/lib/modules/log/log.service.js +0 -23
- package/esm2015/lib/modules/log/log.service.js.map +0 -1
- package/esm2015/lib/modules/media-query/media-breakpoints.js +0 -20
- package/esm2015/lib/modules/media-query/media-breakpoints.js.map +0 -1
- package/esm2015/lib/modules/media-query/media-query-listener.js +0 -2
- package/esm2015/lib/modules/media-query/media-query-listener.js.map +0 -1
- package/esm2015/lib/modules/media-query/media-query.module.js +0 -16
- package/esm2015/lib/modules/media-query/media-query.module.js.map +0 -1
- package/esm2015/lib/modules/media-query/media-query.service.js +0 -121
- package/esm2015/lib/modules/media-query/media-query.service.js.map +0 -1
- package/esm2015/lib/modules/mutation/mutation-observer-service.js +0 -16
- package/esm2015/lib/modules/mutation/mutation-observer-service.js.map +0 -1
- package/esm2015/lib/modules/numeric/numeric-symbol.js +0 -2
- package/esm2015/lib/modules/numeric/numeric-symbol.js.map +0 -1
- package/esm2015/lib/modules/numeric/numeric.module.js +0 -20
- package/esm2015/lib/modules/numeric/numeric.module.js.map +0 -1
- package/esm2015/lib/modules/numeric/numeric.options.js +0 -41
- package/esm2015/lib/modules/numeric/numeric.options.js.map +0 -1
- package/esm2015/lib/modules/numeric/numeric.pipe.js +0 -83
- package/esm2015/lib/modules/numeric/numeric.pipe.js.map +0 -1
- package/esm2015/lib/modules/numeric/numeric.service.js +0 -189
- package/esm2015/lib/modules/numeric/numeric.service.js.map +0 -1
- package/esm2015/lib/modules/overlay/overlay-adapter.service.js +0 -41
- package/esm2015/lib/modules/overlay/overlay-adapter.service.js.map +0 -1
- package/esm2015/lib/modules/overlay/overlay-config.js +0 -2
- package/esm2015/lib/modules/overlay/overlay-config.js.map +0 -1
- package/esm2015/lib/modules/overlay/overlay-context.js +0 -10
- package/esm2015/lib/modules/overlay/overlay-context.js.map +0 -1
- package/esm2015/lib/modules/overlay/overlay-instance.js +0 -55
- package/esm2015/lib/modules/overlay/overlay-instance.js.map +0 -1
- package/esm2015/lib/modules/overlay/overlay.component.js +0 -154
- package/esm2015/lib/modules/overlay/overlay.component.js.map +0 -1
- package/esm2015/lib/modules/overlay/overlay.module.js +0 -18
- package/esm2015/lib/modules/overlay/overlay.module.js.map +0 -1
- package/esm2015/lib/modules/overlay/overlay.service.js +0 -120
- package/esm2015/lib/modules/overlay/overlay.service.js.map +0 -1
- package/esm2015/lib/modules/percent-pipe/percent-pipe.module.js +0 -20
- package/esm2015/lib/modules/percent-pipe/percent-pipe.module.js.map +0 -1
- package/esm2015/lib/modules/percent-pipe/percent.pipe.js +0 -48
- package/esm2015/lib/modules/percent-pipe/percent.pipe.js.map +0 -1
- package/esm2015/lib/modules/resize-observer/resize-observer-media-query.service.js +0 -117
- package/esm2015/lib/modules/resize-observer/resize-observer-media-query.service.js.map +0 -1
- package/esm2015/lib/modules/resize-observer/resize-observer.service.js +0 -73
- package/esm2015/lib/modules/resize-observer/resize-observer.service.js.map +0 -1
- package/esm2015/lib/modules/scrollable-host/scrollable-host.service.js +0 -184
- package/esm2015/lib/modules/scrollable-host/scrollable-host.service.js.map +0 -1
- package/esm2015/lib/modules/shared/number-format/number-format-utility.js +0 -72
- package/esm2015/lib/modules/shared/number-format/number-format-utility.js.map +0 -1
- package/esm2015/lib/modules/shared/sky-core-resources.module.js +0 -50
- package/esm2015/lib/modules/shared/sky-core-resources.module.js.map +0 -1
- package/esm2015/lib/modules/title/set-title-args.js +0 -2
- package/esm2015/lib/modules/title/set-title-args.js.map +0 -1
- package/esm2015/lib/modules/title/title.service.js +0 -31
- package/esm2015/lib/modules/title/title.service.js.map +0 -1
- package/esm2015/lib/modules/ui-config/ui-config.service.js +0 -21
- package/esm2015/lib/modules/ui-config/ui-config.service.js.map +0 -1
- package/esm2015/lib/modules/viewkeeper/viewkeeper-boundary-info.js +0 -2
- package/esm2015/lib/modules/viewkeeper/viewkeeper-boundary-info.js.map +0 -1
- package/esm2015/lib/modules/viewkeeper/viewkeeper-fixed-styles.js +0 -2
- package/esm2015/lib/modules/viewkeeper/viewkeeper-fixed-styles.js.map +0 -1
- package/esm2015/lib/modules/viewkeeper/viewkeeper-host-options.js +0 -10
- package/esm2015/lib/modules/viewkeeper/viewkeeper-host-options.js.map +0 -1
- package/esm2015/lib/modules/viewkeeper/viewkeeper-offset.js +0 -2
- package/esm2015/lib/modules/viewkeeper/viewkeeper-offset.js.map +0 -1
- package/esm2015/lib/modules/viewkeeper/viewkeeper-options.js +0 -2
- package/esm2015/lib/modules/viewkeeper/viewkeeper-options.js.map +0 -1
- package/esm2015/lib/modules/viewkeeper/viewkeeper.directive.js +0 -116
- package/esm2015/lib/modules/viewkeeper/viewkeeper.directive.js.map +0 -1
- package/esm2015/lib/modules/viewkeeper/viewkeeper.js +0 -251
- package/esm2015/lib/modules/viewkeeper/viewkeeper.js.map +0 -1
- package/esm2015/lib/modules/viewkeeper/viewkeeper.module.js +0 -16
- package/esm2015/lib/modules/viewkeeper/viewkeeper.module.js.map +0 -1
- package/esm2015/lib/modules/viewkeeper/viewkeeper.service.js +0 -39
- package/esm2015/lib/modules/viewkeeper/viewkeeper.service.js.map +0 -1
- package/esm2015/lib/modules/window/window-ref.js +0 -30
- package/esm2015/lib/modules/window/window-ref.js.map +0 -1
- package/esm2015/skyux-core.js +0 -5
- package/esm2015/skyux-core.js.map +0 -1
- package/esm2015/testing/mock-media-query.service.js +0 -41
- package/esm2015/testing/mock-media-query.service.js.map +0 -1
- package/esm2015/testing/mock-ui-config.service.js +0 -59
- package/esm2015/testing/mock-ui-config.service.js.map +0 -1
- package/esm2015/testing/public-api.js +0 -3
- package/esm2015/testing/public-api.js.map +0 -1
- package/esm2015/testing/skyux-core-testing.js +0 -5
- package/esm2015/testing/skyux-core-testing.js.map +0 -1
- package/fesm2015/skyux-core-testing.js.map +0 -1
- package/fesm2015/skyux-core.js.map +0 -1
@@ -1,117 +0,0 @@
|
|
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
|
@@ -1 +0,0 @@
|
|
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,EAAE;aAC7B;S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AAC,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"]}
|
@@ -1,73 +0,0 @@
|
|
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
|
@@ -1 +0,0 @@
|
|
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,aAAa,CAAC,C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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"]}
|
@@ -1,184 +0,0 @@
|
|
1
|
-
import { Injectable } from '@angular/core';
|
2
|
-
import { Observable, Subject, fromEvent } from 'rxjs';
|
3
|
-
import { takeUntil } from 'rxjs/operators';
|
4
|
-
import { MutationObserverService } from '../mutation/mutation-observer-service';
|
5
|
-
import { SkyAppWindowRef } from '../window/window-ref';
|
6
|
-
import * as i0 from "@angular/core";
|
7
|
-
import * as i1 from "../mutation/mutation-observer-service";
|
8
|
-
import * as i2 from "../window/window-ref";
|
9
|
-
function notifySubscribers(subscribers, item) {
|
10
|
-
for (const subscriber of subscribers) {
|
11
|
-
subscriber.next(item);
|
12
|
-
}
|
13
|
-
}
|
14
|
-
export class SkyScrollableHostService {
|
15
|
-
constructor(mutationObserverSvc, windowRef) {
|
16
|
-
this.mutationObserverSvc = mutationObserverSvc;
|
17
|
-
this.windowRef = windowRef;
|
18
|
-
}
|
19
|
-
/**
|
20
|
-
* Returns the given element's current scrollable host
|
21
|
-
* @param elementRef The element whose scrollable host is being requested
|
22
|
-
* @returns The current scrollable host
|
23
|
-
*/
|
24
|
-
getScrollableHost(elementRef) {
|
25
|
-
return this.findScrollableHost(elementRef.nativeElement);
|
26
|
-
}
|
27
|
-
/**
|
28
|
-
* Returns an observable which emits the given element's current scrollable host
|
29
|
-
* @param elementRef The element whose scrollable host is being requested
|
30
|
-
* @param completionObservable An observable which alerts the internal observers that they should complete
|
31
|
-
* @returns An observable which emits the current scrollable host
|
32
|
-
* @internal
|
33
|
-
*/
|
34
|
-
watchScrollableHost(elementRef) {
|
35
|
-
const subscribers = [];
|
36
|
-
let parentMutationObserver;
|
37
|
-
let documentHiddenElementMutationObserver;
|
38
|
-
return new Observable((subscriber) => {
|
39
|
-
subscribers.push(subscriber);
|
40
|
-
let scrollableHost = this.findScrollableHost(elementRef.nativeElement);
|
41
|
-
if (subscribers.length === 1) {
|
42
|
-
parentMutationObserver = this.mutationObserverSvc.create(() => {
|
43
|
-
const newScrollableHost = this.findScrollableHost(elementRef.nativeElement);
|
44
|
-
if (newScrollableHost !== scrollableHost &&
|
45
|
-
elementRef.nativeElement.offsetParent) {
|
46
|
-
scrollableHost = newScrollableHost;
|
47
|
-
this.observeForScrollableHostChanges(scrollableHost, parentMutationObserver);
|
48
|
-
notifySubscribers(subscribers, scrollableHost);
|
49
|
-
}
|
50
|
-
});
|
51
|
-
this.observeForScrollableHostChanges(scrollableHost, parentMutationObserver);
|
52
|
-
documentHiddenElementMutationObserver = this.mutationObserverSvc.create(() => {
|
53
|
-
if (scrollableHost && !elementRef.nativeElement.offsetParent) {
|
54
|
-
scrollableHost = undefined;
|
55
|
-
this.observeForScrollableHostChanges(scrollableHost, parentMutationObserver);
|
56
|
-
notifySubscribers(subscribers, scrollableHost);
|
57
|
-
}
|
58
|
-
});
|
59
|
-
this.observeDocumentHiddenElementChanges(documentHiddenElementMutationObserver);
|
60
|
-
}
|
61
|
-
subscriber.next(scrollableHost);
|
62
|
-
subscriber.add(() => {
|
63
|
-
const subIndex = subscribers.indexOf(subscriber);
|
64
|
-
/* sanity check */
|
65
|
-
/* istanbul ignore else */
|
66
|
-
if (subIndex >= 0) {
|
67
|
-
subscribers.splice(subIndex, 1);
|
68
|
-
}
|
69
|
-
if (subscribers.length === 0) {
|
70
|
-
documentHiddenElementMutationObserver.disconnect();
|
71
|
-
parentMutationObserver.disconnect();
|
72
|
-
}
|
73
|
-
});
|
74
|
-
});
|
75
|
-
}
|
76
|
-
/**
|
77
|
-
* 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.
|
78
|
-
* @param elementRef The element whose scrollable host scroll events are being requested
|
79
|
-
* @param completionObservable An observable which alerts the internal observers that they should complete
|
80
|
-
* @returns An observable which emits when the elements scrollable host is scrolled or is changed
|
81
|
-
*/
|
82
|
-
watchScrollableHostScrollEvents(elementRef) {
|
83
|
-
const subscribers = [];
|
84
|
-
let scrollableHost;
|
85
|
-
let newScrollableHostObservable = new Subject();
|
86
|
-
let scrollableHostSubscription;
|
87
|
-
let scrollEventSubscription;
|
88
|
-
return new Observable((subscriber) => {
|
89
|
-
subscribers.push(subscriber);
|
90
|
-
if (subscribers.length === 1) {
|
91
|
-
scrollableHostSubscription = this.watchScrollableHost(elementRef).subscribe((newScrollableHost) => {
|
92
|
-
newScrollableHostObservable.next();
|
93
|
-
newScrollableHostObservable.complete();
|
94
|
-
if (scrollableHost && scrollableHost !== newScrollableHost) {
|
95
|
-
notifySubscribers(subscribers);
|
96
|
-
}
|
97
|
-
scrollableHost = newScrollableHost;
|
98
|
-
newScrollableHostObservable = new Subject();
|
99
|
-
if (newScrollableHost) {
|
100
|
-
scrollEventSubscription = fromEvent(newScrollableHost, 'scroll')
|
101
|
-
.pipe(takeUntil(newScrollableHostObservable))
|
102
|
-
.subscribe(() => {
|
103
|
-
notifySubscribers(subscribers);
|
104
|
-
});
|
105
|
-
}
|
106
|
-
});
|
107
|
-
}
|
108
|
-
subscriber.add(() => {
|
109
|
-
const subIndex = subscribers.indexOf(subscriber);
|
110
|
-
/* sanity check */
|
111
|
-
/* istanbul ignore else */
|
112
|
-
if (subIndex >= 0) {
|
113
|
-
subscribers.splice(subIndex, 1);
|
114
|
-
}
|
115
|
-
if (subscribers.length === 0) {
|
116
|
-
scrollableHostSubscription.unsubscribe();
|
117
|
-
scrollEventSubscription.unsubscribe();
|
118
|
-
newScrollableHostObservable.complete();
|
119
|
-
}
|
120
|
-
});
|
121
|
-
});
|
122
|
-
}
|
123
|
-
findScrollableHost(element) {
|
124
|
-
const regex = /(auto|scroll)/;
|
125
|
-
const windowObj = this.windowRef.nativeWindow;
|
126
|
-
const bodyObj = windowObj.document.body;
|
127
|
-
/* Sanity check */
|
128
|
-
if (!element) {
|
129
|
-
return windowObj;
|
130
|
-
}
|
131
|
-
let style = windowObj.getComputedStyle(element);
|
132
|
-
let parent = element;
|
133
|
-
do {
|
134
|
-
parent = parent.parentNode;
|
135
|
-
/* Sanity check for if this function is called for an element which has been removed from the DOM */
|
136
|
-
if (!(parent instanceof HTMLElement)) {
|
137
|
-
return windowObj;
|
138
|
-
}
|
139
|
-
style = windowObj.getComputedStyle(parent);
|
140
|
-
} while (!regex.test(style.overflow) &&
|
141
|
-
!regex.test(style.overflowY) &&
|
142
|
-
parent !== bodyObj);
|
143
|
-
if (parent === bodyObj) {
|
144
|
-
return windowObj;
|
145
|
-
}
|
146
|
-
return parent;
|
147
|
-
}
|
148
|
-
observeDocumentHiddenElementChanges(mutationObserver) {
|
149
|
-
mutationObserver.observe(document.documentElement, {
|
150
|
-
attributes: true,
|
151
|
-
attributeFilter: ['class', 'style', 'hidden'],
|
152
|
-
childList: true,
|
153
|
-
subtree: true,
|
154
|
-
});
|
155
|
-
}
|
156
|
-
observeForScrollableHostChanges(element, mutationObserver) {
|
157
|
-
mutationObserver.disconnect();
|
158
|
-
if (element instanceof HTMLElement) {
|
159
|
-
mutationObserver.observe(element, {
|
160
|
-
attributes: true,
|
161
|
-
attributeFilter: ['class', 'style'],
|
162
|
-
childList: true,
|
163
|
-
subtree: true,
|
164
|
-
});
|
165
|
-
}
|
166
|
-
else {
|
167
|
-
mutationObserver.observe(document.documentElement, {
|
168
|
-
attributes: true,
|
169
|
-
attributeFilter: ['class', 'style'],
|
170
|
-
childList: true,
|
171
|
-
subtree: true,
|
172
|
-
});
|
173
|
-
}
|
174
|
-
}
|
175
|
-
}
|
176
|
-
SkyScrollableHostService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyScrollableHostService, deps: [{ token: i1.MutationObserverService }, { token: i2.SkyAppWindowRef }], target: i0.ɵɵFactoryTarget.Injectable });
|
177
|
-
SkyScrollableHostService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyScrollableHostService, providedIn: 'root' });
|
178
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyScrollableHostService, decorators: [{
|
179
|
-
type: Injectable,
|
180
|
-
args: [{
|
181
|
-
providedIn: 'root',
|
182
|
-
}]
|
183
|
-
}], ctorParameters: function () { return [{ type: i1.MutationObserverService }, { type: i2.SkyAppWindowRef }]; } });
|
184
|
-
//# sourceMappingURL=scrollable-host.service.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"scrollable-host.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/scrollable-host/scrollable-host.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,UAAU,EAAE,MAAM,eAAe,CAAC;AAEvD,OAAO,EAAE,UAAU,EAAE,OAAO,EAA4B,SAAS,EAAE,MAAM,MAAM,CAAC;AAChF,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;;;;AAEvD,SAAS,iBAAiB,CAAC,WAAkC,EAAE,IAAc;IAC3E,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE;QACpC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KACvB;AACH,CAAC;AAKD,MAAM,OAAO,wBAAwB;IACnC,YACU,mBAA4C,EAC5C,SAA0B;QAD1B,wBAAmB,GAAnB,mBAAmB,CAAyB;QAC5C,cAAS,GAAT,SAAS,CAAiB;IACjC,CAAC;IAEJ;;;;OAIG;IACI,iBAAiB,CAAC,UAAsB;QAC7C,OAAO,IAAI,CAAC,kBAAkB,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IAC3D,CAAC;IAED;;;;;;OAMG;IACI,mBAAmB,CACxB,UAAsB;QAEtB,MAAM,WAAW,GAAuC,EAAE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, Subscriber, Subscription, fromEvent } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { MutationObserverService } from '../mutation/mutation-observer-service';\nimport { SkyAppWindowRef } from '../window/window-ref';\n\nfunction notifySubscribers(subscribers: Subscriber<unknown>[], item?: unknown) {\n for (const subscriber of subscribers) {\n subscriber.next(item);\n }\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SkyScrollableHostService {\n constructor(\n private mutationObserverSvc: MutationObserverService,\n private windowRef: SkyAppWindowRef\n ) {}\n\n /**\n * Returns the given element's current scrollable host\n * @param elementRef The element whose scrollable host is being requested\n * @returns The current scrollable host\n */\n public getScrollableHost(elementRef: ElementRef): HTMLElement | Window {\n return this.findScrollableHost(elementRef.nativeElement);\n }\n\n /**\n * Returns an observable which emits the given element's current scrollable host\n * @param elementRef The element whose scrollable host is being requested\n * @param completionObservable An observable which alerts the internal observers that they should complete\n * @returns An observable which emits the current scrollable host\n * @internal\n */\n public watchScrollableHost(\n elementRef: ElementRef\n ): Observable<HTMLElement | Window> {\n const subscribers: Subscriber<HTMLElement | Window>[] = [];\n let parentMutationObserver: MutationObserver;\n let documentHiddenElementMutationObserver: MutationObserver;\n\n return new Observable((subscriber) => {\n subscribers.push(subscriber);\n\n let scrollableHost = this.findScrollableHost(elementRef.nativeElement);\n if (subscribers.length === 1) {\n parentMutationObserver = this.mutationObserverSvc.create(() => {\n const newScrollableHost = this.findScrollableHost(\n elementRef.nativeElement\n );\n\n if (\n newScrollableHost !== scrollableHost &&\n elementRef.nativeElement.offsetParent\n ) {\n scrollableHost = newScrollableHost;\n this.observeForScrollableHostChanges(\n scrollableHost,\n parentMutationObserver\n );\n\n notifySubscribers(subscribers, scrollableHost);\n }\n });\n this.observeForScrollableHostChanges(\n scrollableHost,\n parentMutationObserver\n );\n\n documentHiddenElementMutationObserver = this.mutationObserverSvc.create(\n () => {\n if (scrollableHost && !elementRef.nativeElement.offsetParent) {\n scrollableHost = undefined;\n\n this.observeForScrollableHostChanges(\n scrollableHost,\n parentMutationObserver\n );\n\n notifySubscribers(subscribers, scrollableHost);\n }\n }\n );\n this.observeDocumentHiddenElementChanges(\n documentHiddenElementMutationObserver\n );\n }\n subscriber.next(scrollableHost);\n\n subscriber.add(() => {\n const subIndex = subscribers.indexOf(subscriber);\n\n /* sanity check */\n /* istanbul ignore else */\n if (subIndex >= 0) {\n subscribers.splice(subIndex, 1);\n }\n\n if (subscribers.length === 0) {\n documentHiddenElementMutationObserver.disconnect();\n parentMutationObserver.disconnect();\n }\n });\n });\n }\n\n /**\n * 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.\n * @param elementRef The element whose scrollable host scroll events are being requested\n * @param completionObservable An observable which alerts the internal observers that they should complete\n * @returns An observable which emits when the elements scrollable host is scrolled or is changed\n */\n public watchScrollableHostScrollEvents(\n elementRef: ElementRef\n ): Observable<void> {\n const subscribers: Subscriber<void>[] = [];\n let scrollableHost: HTMLElement | Window;\n\n let newScrollableHostObservable = new Subject();\n let scrollableHostSubscription: Subscription;\n let scrollEventSubscription: Subscription;\n return new Observable((subscriber) => {\n subscribers.push(subscriber);\n\n if (subscribers.length === 1) {\n scrollableHostSubscription = this.watchScrollableHost(\n elementRef\n ).subscribe((newScrollableHost) => {\n newScrollableHostObservable.next();\n newScrollableHostObservable.complete();\n if (scrollableHost && scrollableHost !== newScrollableHost) {\n notifySubscribers(subscribers);\n }\n scrollableHost = newScrollableHost;\n newScrollableHostObservable = new Subject();\n if (newScrollableHost) {\n scrollEventSubscription = fromEvent(newScrollableHost, 'scroll')\n .pipe(takeUntil(newScrollableHostObservable))\n .subscribe(() => {\n notifySubscribers(subscribers);\n });\n }\n });\n }\n\n subscriber.add(() => {\n const subIndex = subscribers.indexOf(subscriber);\n\n /* sanity check */\n /* istanbul ignore else */\n if (subIndex >= 0) {\n subscribers.splice(subIndex, 1);\n }\n\n if (subscribers.length === 0) {\n scrollableHostSubscription.unsubscribe();\n scrollEventSubscription.unsubscribe();\n newScrollableHostObservable.complete();\n }\n });\n });\n }\n\n private findScrollableHost(element: HTMLElement): HTMLElement | Window {\n const regex = /(auto|scroll)/;\n const windowObj = this.windowRef.nativeWindow;\n const bodyObj = windowObj.document.body;\n\n /* Sanity check */\n if (!element) {\n return windowObj;\n }\n\n let style = windowObj.getComputedStyle(element);\n let parent: HTMLElement = element;\n\n do {\n parent = parent.parentNode as HTMLElement;\n\n /* Sanity check for if this function is called for an element which has been removed from the DOM */\n if (!(parent instanceof HTMLElement)) {\n return windowObj;\n }\n\n style = windowObj.getComputedStyle(parent);\n } while (\n !regex.test(style.overflow) &&\n !regex.test(style.overflowY) &&\n parent !== bodyObj\n );\n\n if (parent === bodyObj) {\n return windowObj;\n }\n\n return parent;\n }\n\n private observeDocumentHiddenElementChanges(\n mutationObserver: MutationObserver\n ) {\n mutationObserver.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['class', 'style', 'hidden'],\n childList: true,\n subtree: true,\n });\n }\n\n private observeForScrollableHostChanges(\n element: HTMLElement | Window,\n mutationObserver: MutationObserver\n ) {\n mutationObserver.disconnect();\n if (element instanceof HTMLElement) {\n mutationObserver.observe(element, {\n attributes: true,\n attributeFilter: ['class', 'style'],\n childList: true,\n subtree: true,\n });\n } else {\n mutationObserver.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['class', 'style'],\n childList: true,\n subtree: true,\n });\n }\n }\n}\n"]}
|
@@ -1,72 +0,0 @@
|
|
1
|
-
/* tslint:disable:no-null-keyword */
|
2
|
-
// This file is mostly ported from the Angular 4.x NumberPipe in order to maintain the old
|
3
|
-
// behavior of using the `Intl` API for formatting numbers rather than having to register every
|
4
|
-
// supported locale.
|
5
|
-
// https://github.com/angular/angular/blob/4.4.x/packages/common/src/pipes/number_pipe.ts
|
6
|
-
import { SkyIntlNumberFormatStyle, SkyIntlNumberFormatter } from '@skyux/i18n';
|
7
|
-
function isNumeric(value) {
|
8
|
-
return !isNaN(value - parseFloat(value));
|
9
|
-
}
|
10
|
-
function parseIntAutoRadix(text) {
|
11
|
-
const result = parseInt(text, 10);
|
12
|
-
/* istanbul ignore next */
|
13
|
-
if (isNaN(result)) {
|
14
|
-
throw new Error('Invalid integer literal when parsing ' + text);
|
15
|
-
}
|
16
|
-
return result;
|
17
|
-
}
|
18
|
-
// Need to add the following to classes which contain static methods.
|
19
|
-
// See: https://github.com/ng-packagr/ng-packagr/issues/641
|
20
|
-
// @dynamic
|
21
|
-
export class SkyNumberFormatUtility {
|
22
|
-
static formatNumber(locale, value, style, digits, currency = null, currencyAsSymbol = false, currencySign) {
|
23
|
-
if (value == null) {
|
24
|
-
return null;
|
25
|
-
}
|
26
|
-
// Convert strings to numbers
|
27
|
-
value = typeof value === 'string' && isNumeric(value) ? +value : value;
|
28
|
-
if (typeof value !== 'number') {
|
29
|
-
throw Error(`SkyInvalidPipeArgument: '${value}'`);
|
30
|
-
}
|
31
|
-
let minInt = undefined;
|
32
|
-
let minFraction = undefined;
|
33
|
-
let maxFraction = undefined;
|
34
|
-
if (style !== SkyIntlNumberFormatStyle.Currency) {
|
35
|
-
// rely on Intl default for currency
|
36
|
-
minInt = 1;
|
37
|
-
minFraction = 0;
|
38
|
-
maxFraction = 3;
|
39
|
-
}
|
40
|
-
if (digits) {
|
41
|
-
const parts = digits.match(this._NUMBER_FORMAT_REGEXP);
|
42
|
-
if (parts === null) {
|
43
|
-
throw new Error(`${digits} is not a valid digit info for number pipes`);
|
44
|
-
}
|
45
|
-
/* istanbul ignore else */
|
46
|
-
if (parts[1] != null) {
|
47
|
-
// min integer digits
|
48
|
-
minInt = parseIntAutoRadix(parts[1]);
|
49
|
-
}
|
50
|
-
/* istanbul ignore else */
|
51
|
-
if (parts[3] != null) {
|
52
|
-
// min fraction digits
|
53
|
-
minFraction = parseIntAutoRadix(parts[3]);
|
54
|
-
}
|
55
|
-
/* istanbul ignore else */
|
56
|
-
if (parts[5] != null) {
|
57
|
-
// max fraction digits
|
58
|
-
maxFraction = parseIntAutoRadix(parts[5]);
|
59
|
-
}
|
60
|
-
}
|
61
|
-
return SkyIntlNumberFormatter.format(value, locale, style, {
|
62
|
-
minimumIntegerDigits: minInt,
|
63
|
-
minimumFractionDigits: minFraction,
|
64
|
-
maximumFractionDigits: maxFraction,
|
65
|
-
currency: currency,
|
66
|
-
currencyAsSymbol: currencyAsSymbol,
|
67
|
-
currencySign: currencySign,
|
68
|
-
});
|
69
|
-
}
|
70
|
-
}
|
71
|
-
SkyNumberFormatUtility._NUMBER_FORMAT_REGEXP = /^(\d+)?\.((\d+)(-(\d+))?)?$/;
|
72
|
-
//# sourceMappingURL=number-format-utility.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"number-format-utility.js","sourceRoot":"","sources":["../../../../../../../../../libs/components/core/src/lib/modules/shared/number-format/number-format-utility.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,0FAA0F;AAC1F,+FAA+F;AAC/F,oBAAoB;AACpB,yFAAyF;AACzF,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAE/E,SAAS,SAAS,CAAC,KAAU;IAC3B,OAAO,CAAC,KAAK,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;AAC3C,CAAC;AAED,SAAS,iBAAiB,CAAC,IAAY;IACrC,MAAM,MAAM,GAAW,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAE1C,0BAA0B;IAC1B,IAAI,KAAK,CAAC,MAAM,CAAC,EAAE;QACjB,MAAM,IAAI,KAAK,CAAC,uCAAuC,GAAG,IAAI,CAAC,CAAC;KACjE;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,qEAAqE;AACrE,2DAA2D;AAC3D,WAAW;AACX,MAAM,OAAO,sBAAsB;IAG1B,MAAM,CAAC,YAAY,CACxB,MAAc,EACd,KAAsB,EACtB,KAA+B,EAC/B,MAAsB,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AI,IAAI,EAAE;gBACpB,sBAAsB;gBACtB,WAAW,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;aAC3C;SACF;QAED,OAAO,sBAAsB,CAAC,MAAM,CAAC,KAAe,EAAE,MAAM,EAAE,KAAK,EAAE;YACnE,oBAAoB,EAAE,MAAM;YAC5B,qBAAqB,EAAE,WAAW;YAClC,qBAAqB,EAAE,WAAW;YAClC,QAAQ,EAAE,QAAQ;YAClB,gBAAgB,EAAE,gBAAgB;YAClC,YAAY,EAAE,YAAY;SAC3B,CAAC,CAAC;IACL,CAAC;;AAjEc,4CAAqB,GAAG,6BAA6B,CAAC","sourcesContent":["/* tslint:disable:no-null-keyword */\n// This file is mostly ported from the Angular 4.x NumberPipe in order to maintain the old\n// behavior of using the `Intl` API for formatting numbers rather than having to register every\n// supported locale.\n// https://github.com/angular/angular/blob/4.4.x/packages/common/src/pipes/number_pipe.ts\nimport { SkyIntlNumberFormatStyle, SkyIntlNumberFormatter } from '@skyux/i18n';\n\nfunction isNumeric(value: any): boolean {\n return !isNaN(value - parseFloat(value));\n}\n\nfunction parseIntAutoRadix(text: string): number {\n const result: number = parseInt(text, 10);\n\n /* istanbul ignore next */\n if (isNaN(result)) {\n throw new Error('Invalid integer literal when parsing ' + text);\n }\n\n return result;\n}\n\n// Need to add the following to classes which contain static methods.\n// See: https://github.com/ng-packagr/ng-packagr/issues/641\n// @dynamic\nexport class SkyNumberFormatUtility {\n private static _NUMBER_FORMAT_REGEXP = /^(\\d+)?\\.((\\d+)(-(\\d+))?)?$/;\n\n public static formatNumber(\n locale: string,\n value: number | string,\n style: SkyIntlNumberFormatStyle,\n digits?: string | null,\n currency: string | null = null,\n currencyAsSymbol: boolean = false,\n currencySign?: 'accounting' | 'standard'\n ): string | null {\n if (value == null) {\n return null;\n }\n\n // Convert strings to numbers\n value = typeof value === 'string' && isNumeric(value) ? +value : value;\n if (typeof value !== 'number') {\n throw Error(`SkyInvalidPipeArgument: '${value}'`);\n }\n\n let minInt: number | undefined = undefined;\n let minFraction: number | undefined = undefined;\n let maxFraction: number | undefined = undefined;\n if (style !== SkyIntlNumberFormatStyle.Currency) {\n // rely on Intl default for currency\n minInt = 1;\n minFraction = 0;\n maxFraction = 3;\n }\n\n if (digits) {\n const parts = digits.match(this._NUMBER_FORMAT_REGEXP);\n\n if (parts === null) {\n throw new Error(`${digits} is not a valid digit info for number pipes`);\n }\n\n /* istanbul ignore else */\n if (parts[1] != null) {\n // min integer digits\n minInt = parseIntAutoRadix(parts[1]);\n }\n\n /* istanbul ignore else */\n if (parts[3] != null) {\n // min fraction digits\n minFraction = parseIntAutoRadix(parts[3]);\n }\n\n /* istanbul ignore else */\n if (parts[5] != null) {\n // max fraction digits\n maxFraction = parseIntAutoRadix(parts[5]);\n }\n }\n\n return SkyIntlNumberFormatter.format(value as number, locale, style, {\n minimumIntegerDigits: minInt,\n minimumFractionDigits: minFraction,\n maximumFractionDigits: maxFraction,\n currency: currency,\n currencyAsSymbol: currencyAsSymbol,\n currencySign: currencySign,\n });\n }\n}\n"]}
|
@@ -1,50 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* NOTICE: DO NOT MODIFY THIS FILE!
|
3
|
-
* The contents of this file were automatically generated by
|
4
|
-
* the 'ng generate @skyux/i18n:lib-resources-module lib/modules/shared/sky-core' schematic.
|
5
|
-
* To update this file, simply rerun the command.
|
6
|
-
*/
|
7
|
-
import { NgModule } from '@angular/core';
|
8
|
-
import { SKY_LIB_RESOURCES_PROVIDERS, SkyI18nModule, getLibStringForLocale, } from '@skyux/i18n';
|
9
|
-
import * as i0 from "@angular/core";
|
10
|
-
const RESOURCES = {
|
11
|
-
'EN-US': {
|
12
|
-
skyux_numeric_billions_symbol: { message: 'B' },
|
13
|
-
skyux_numeric_millions_symbol: { message: 'M' },
|
14
|
-
skyux_numeric_thousands_symbol: { message: 'K' },
|
15
|
-
skyux_numeric_trillions_symbol: { message: 'T' },
|
16
|
-
},
|
17
|
-
};
|
18
|
-
export class SkyCoreResourcesProvider {
|
19
|
-
getString(localeInfo, name) {
|
20
|
-
return getLibStringForLocale(RESOURCES, localeInfo.locale, name);
|
21
|
-
}
|
22
|
-
}
|
23
|
-
/**
|
24
|
-
* Import into any component library module that needs to use resource strings.
|
25
|
-
*/
|
26
|
-
export class SkyCoreResourcesModule {
|
27
|
-
}
|
28
|
-
SkyCoreResourcesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyCoreResourcesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
29
|
-
SkyCoreResourcesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyCoreResourcesModule, exports: [SkyI18nModule] });
|
30
|
-
SkyCoreResourcesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyCoreResourcesModule, providers: [
|
31
|
-
{
|
32
|
-
provide: SKY_LIB_RESOURCES_PROVIDERS,
|
33
|
-
useClass: SkyCoreResourcesProvider,
|
34
|
-
multi: true,
|
35
|
-
},
|
36
|
-
], imports: [SkyI18nModule] });
|
37
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyCoreResourcesModule, decorators: [{
|
38
|
-
type: NgModule,
|
39
|
-
args: [{
|
40
|
-
exports: [SkyI18nModule],
|
41
|
-
providers: [
|
42
|
-
{
|
43
|
-
provide: SKY_LIB_RESOURCES_PROVIDERS,
|
44
|
-
useClass: SkyCoreResourcesProvider,
|
45
|
-
multi: true,
|
46
|
-
},
|
47
|
-
],
|
48
|
-
}]
|
49
|
-
}] });
|
50
|
-
//# sourceMappingURL=sky-core-resources.module.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"sky-core-resources.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/shared/sky-core-resources.module.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EACL,2BAA2B,EAE3B,aAAa,EAGb,qBAAqB,GACtB,MAAM,aAAa,CAAC;;AAErB,MAAM,SAAS,GAA0C;IACvD,OAAO,EAAE;QACP,6BAA6B,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE;QAC/C,6BAA6B,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE;QAC/C,8BAA8B,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE;QAChD,8BAA8B,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE;KACjD;CACF,CAAC;AAEF,MAAM,OAAO,wBAAwB;IAC5B,SAAS,CACd,UAA4B,EAC5B,IAAY;QAEZ,OAAO,qBAAqB,CAAC,SAAS,EAAE,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACnE,CAAC;CACF;AAED;;GAEG;AAWH,MAAM,OAAO,sBAAsB;;oHAAtB,sBAAsB;qHAAtB,sBAAsB,YATvB,aAAa;qHASZ,sBAAsB,aARtB;QACT;YACE,OAAO,EAAE,2BAA2B;YACpC,QAAQ,EAAE,wBAAwB;YAClC,KAAK,EAAE,IAAI;SACZ;KACF,YAPS,aAAa;4FASZ,sBAAsB;kBAVlC,QAAQ;mBAAC;oBACR,OAAO,EAAE,CAAC,aAAa,CAAC;oBACxB,SAAS,EAAE;wBACT;4BACE,OAAO,EAAE,2BAA2B;4BACpC,QAAQ,EAAE,wBAAwB;4BAClC,KAAK,EAAE,IAAI;yBACZ;qBACF;iBACF","sourcesContent":["/**\n * NOTICE: DO NOT MODIFY THIS FILE!\n * The contents of this file were automatically generated by\n * the 'ng generate @skyux/i18n:lib-resources-module lib/modules/shared/sky-core' schematic.\n * To update this file, simply rerun the command.\n */\nimport { NgModule } from '@angular/core';\nimport {\n SKY_LIB_RESOURCES_PROVIDERS,\n SkyAppLocaleInfo,\n SkyI18nModule,\n SkyLibResources,\n SkyLibResourcesProvider,\n getLibStringForLocale,\n} from '@skyux/i18n';\n\nconst RESOURCES: { [locale: string]: SkyLibResources } = {\n 'EN-US': {\n skyux_numeric_billions_symbol: { message: 'B' },\n skyux_numeric_millions_symbol: { message: 'M' },\n skyux_numeric_thousands_symbol: { message: 'K' },\n skyux_numeric_trillions_symbol: { message: 'T' },\n },\n};\n\nexport class SkyCoreResourcesProvider implements SkyLibResourcesProvider {\n public getString(\n localeInfo: SkyAppLocaleInfo,\n name: string\n ): string | undefined {\n return getLibStringForLocale(RESOURCES, localeInfo.locale, name);\n }\n}\n\n/**\n * Import into any component library module that needs to use resource strings.\n */\n@NgModule({\n exports: [SkyI18nModule],\n providers: [\n {\n provide: SKY_LIB_RESOURCES_PROVIDERS,\n useClass: SkyCoreResourcesProvider,\n multi: true,\n },\n ],\n})\nexport class SkyCoreResourcesModule {}\n"]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"set-title-args.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/title/set-title-args.ts"],"names":[],"mappings":"","sourcesContent":["export interface SkyAppSetTitleArgs {\n titleParts: string[];\n}\n"]}
|
@@ -1,31 +0,0 @@
|
|
1
|
-
import { Injectable } from '@angular/core';
|
2
|
-
import { Title } from '@angular/platform-browser';
|
3
|
-
import * as i0 from "@angular/core";
|
4
|
-
import * as i1 from "@angular/platform-browser";
|
5
|
-
/**
|
6
|
-
* Provides a method for setting a formatted title on the current window.
|
7
|
-
*/
|
8
|
-
export class SkyAppTitleService {
|
9
|
-
constructor(title) {
|
10
|
-
this.title = title;
|
11
|
-
}
|
12
|
-
/**
|
13
|
-
* Sets the title on the current window.
|
14
|
-
* @param args An array of title parts. The parts will be concatenated with a hyphen between
|
15
|
-
* each part.
|
16
|
-
*/
|
17
|
-
setTitle(args) {
|
18
|
-
if (args && args.titleParts) {
|
19
|
-
this.title.setTitle(args.titleParts.join(' - '));
|
20
|
-
}
|
21
|
-
}
|
22
|
-
}
|
23
|
-
SkyAppTitleService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAppTitleService, deps: [{ token: i1.Title }], target: i0.ɵɵFactoryTarget.Injectable });
|
24
|
-
SkyAppTitleService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAppTitleService, providedIn: 'root' });
|
25
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAppTitleService, decorators: [{
|
26
|
-
type: Injectable,
|
27
|
-
args: [{
|
28
|
-
providedIn: 'root',
|
29
|
-
}]
|
30
|
-
}], ctorParameters: function () { return [{ type: i1.Title }]; } });
|
31
|
-
//# sourceMappingURL=title.service.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"title.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/title/title.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;;;AAIlD;;GAEG;AAIH,MAAM,OAAO,kBAAkB;IAC7B,YAAoB,KAAY;QAAZ,UAAK,GAAL,KAAK,CAAO;IAAG,CAAC;IAEpC;;;;OAIG;IACI,QAAQ,CAAC,IAAwB;QACtC,IAAI,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE;YAC3B,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;SAClD;IACH,CAAC;;gHAZU,kBAAkB;oHAAlB,kBAAkB,cAFjB,MAAM;4FAEP,kBAAkB;kBAH9B,UAAU;mBAAC;oBACV,UAAU,EAAE,MAAM;iBACnB","sourcesContent":["import { Injectable } from '@angular/core';\nimport { Title } from '@angular/platform-browser';\n\nimport { SkyAppSetTitleArgs } from './set-title-args';\n\n/**\n * Provides a method for setting a formatted title on the current window.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class SkyAppTitleService {\n constructor(private title: Title) {}\n\n /**\n * Sets the title on the current window.\n * @param args An array of title parts. The parts will be concatenated with a hyphen between\n * each part.\n */\n public setTitle(args: SkyAppSetTitleArgs): void {\n if (args && args.titleParts) {\n this.title.setTitle(args.titleParts.join(' - '));\n }\n }\n}\n"]}
|
@@ -1,21 +0,0 @@
|
|
1
|
-
import { Injectable } from '@angular/core';
|
2
|
-
import { of as observableOf } from 'rxjs';
|
3
|
-
import * as i0 from "@angular/core";
|
4
|
-
export class SkyUIConfigService {
|
5
|
-
getConfig(key, defaultConfig) {
|
6
|
-
return observableOf(defaultConfig);
|
7
|
-
}
|
8
|
-
/* istanbul ignore next */
|
9
|
-
setConfig(key, value) {
|
10
|
-
return observableOf({});
|
11
|
-
}
|
12
|
-
}
|
13
|
-
SkyUIConfigService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyUIConfigService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
14
|
-
SkyUIConfigService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyUIConfigService, providedIn: 'root' });
|
15
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyUIConfigService, decorators: [{
|
16
|
-
type: Injectable,
|
17
|
-
args: [{
|
18
|
-
providedIn: 'root',
|
19
|
-
}]
|
20
|
-
}] });
|
21
|
-
//# sourceMappingURL=ui-config.service.js.map
|